Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 999159a5 authored by Vineet Gupta's avatar Vineet Gupta
Browse files

ARC: [DeviceTree] Basic support



This is minimal infrastructure needed for devicetree work.
It uses an a sample "skeleton" devicetree - embedded in kernel image -
to print the board, manufacturer by parsing the top-level "compatible"
string.

As of now we don't need any additional "board" specific "machine_desc".

TODO: support interpreting the command line as boot-loader passed dtb

Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: devicetree-discuss@lists.ozlabs.org
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: James Hogan <james.hogan@imgtec.com>
Reviewed-by: default avatarRob Herring <rob.herring@calxeda.com>
Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
parent ee36d172
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -24,8 +24,11 @@ config ARC
	select GENERIC_SMP_IDLE_THREAD
	select HAVE_GENERIC_HARDIRQS
	select HAVE_MEMBLOCK
	select IRQ_DOMAIN
	select MODULES_USE_ELF_RELA
	select NO_BOOTMEM
	select OF
	select OF_EARLY_FLATTREE

config SCHED_OMIT_FRAME_POINTER
	def_bool y
@@ -320,6 +323,12 @@ config CMDLINE_UBOOT
	  to it. kernel startup code will copy the string into cmdline buffer
	  and also append CONFIG_CMDLINE.

config ARC_BUILTIN_DTB_NAME
	string "Built in DTB"
	help
	  Set the name of the DTB to embed in the vmlinux binary
	  Leaving it blank selects the minimal "skeleton" dtb

source "kernel/Kconfig.preempt"

endmenu	 # "ARC Architecture Configuration"
+9 −0
Original line number Diff line number Diff line
@@ -83,6 +83,9 @@ head-y := arch/arc/kernel/head.o
# See arch/arc/Kbuild for content of core part of the kernel
core-y		+= arch/arc/

# w/o this dtb won't embed into kernel binary
core-y		+= arch/arc/boot/dts/

# w/o this ifneq, make ARCH=arc clean was crapping out
ifneq ($(platform-y),)
core-y		+= arch/arc/plat-$(PLATFORM)/
@@ -101,6 +104,12 @@ bootpImage: vmlinux
uImage: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

%.dtb %.dtb.S %.dtb.o: scripts
	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@

dtbs: scripts
	$(Q)$(MAKE) $(build)=$(boot)/dts dtbs

archclean:
	$(Q)$(MAKE) $(clean)=$(boot)

+13 −0
Original line number Diff line number Diff line
# Built-in dtb
builtindtb-y		:= skeleton

ifneq ($(CONFIG_ARC_BUILTIN_DTB_NAME),"")
	builtindtb-y	:= $(patsubst "%",%,$(CONFIG_ARC_BUILTIN_DTB_NAME))
endif

obj-y   += $(builtindtb-y).dtb.o
targets += $(builtindtb-y).dtb

dtbs:  $(addprefix  $(obj)/, $(builtindtb-y).dtb)

clean-files := *.dtb
+10 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
/dts-v1/;

/include/ "skeleton.dtsi"
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

/*
 * Skeleton device tree; the bare minimum needed to boot; just include and
 * add a compatible value.
 */

/ {
	compatible = "snps,arc";
	#address-cells = <1>;
	#size-cells = <1>;
	chosen { };
	aliases { };
	memory { device_type = "memory"; reg = <0 0>; };
};
Loading