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

Commit da844a81 authored by Max Filippov's avatar Max Filippov Committed by Chris Zankel
Browse files

xtensa: add device trees support



Device trees allow specification of hardware topology and device
parameters at runtime instead of hard-coding them in platform setup
code. This allows running single binary kernel on a range of compatible
boards.

New boot parameters tag BP_TAG_FDT is allocated and a pointer to flat
device tree is passed in it.

Note that current interrupt mapping scheme uses single cell for
interrupt identification. That means that IRQ numbers used in DTS must
be CPU internal IRQ numbers, not external. It is possible to extend
interrupt identification to two cells, and use second cell to tell
external IRQ numbers form internal. That would allow to use single DTS
on multiple boards with different mapping of external IRQ numbers.

Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Signed-off-by: default avatarChris Zankel <chris@zankel.net>
parent 2206d5dd
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -178,6 +178,17 @@ config CMDLINE
	  time by entering them here. As a minimum, you should specify the
	  memory size and the root device (e.g., mem=64M root=/dev/nfs).

config USE_OF
	bool "Flattened Device Tree support"
	select OF
	select OF_EARLY_FLATTREE
	help
	  Include support for flattened device tree machine descriptions.

config BUILTIN_DTB
	string "DTB to build into the kernel image"
	depends on OF

source "mm/Kconfig"

source "drivers/pcmcia/Kconfig"
+7 −0
Original line number Diff line number Diff line
@@ -79,6 +79,10 @@ core-y += $(buildvar) $(buildplf)

libs-y		+= arch/xtensa/lib/ $(LIBGCC)

ifneq ($(CONFIG_BUILTIN_DTB),"")
core-y += arch/xtensa/boot/
endif

boot		:= arch/xtensa/boot

all: zImage
@@ -88,6 +92,9 @@ bzImage : zImage
zImage: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $@

%.dtb:
	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

define archhelp
  @echo '* zImage      - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
endef
+11 −0
Original line number Diff line number Diff line
@@ -25,6 +25,17 @@ bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf
bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf boot-uboot


BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
ifneq ($(CONFIG_BUILTIN_DTB),"")
obj-y += $(BUILTIN_DTB)
endif

# Rule to build device tree blobs
$(obj)/%.dtb: $(src)/dts/%.dts FORCE
	$(call if_changed_dep,dtc)

clean-files := *.dtb.S

zImage Image: $(bootdir-y)

$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#define BP_TAG_MEMORY		0x1003	/* memory addr and size (bp_meminfo) */
#define BP_TAG_SERIAL_BAUSRATE	0x1004	/* baud rate of current console. */
#define BP_TAG_SERIAL_PORT	0x1005	/* serial device of current console */
#define BP_TAG_FDT		0x1006	/* flat device tree addr */

#define BP_TAG_FIRST		0x7B0B  /* first tag with a version number */
#define BP_TAG_LAST 		0x7E0B	/* last tag */
+6 −0
Original line number Diff line number Diff line
#ifndef _XTENSA_ASM_PROM_H
#define _XTENSA_ASM_PROM_H

#define HAVE_ARCH_DEVTREE_FIXUPS

#endif /* _XTENSA_ASM_PROM_H */
Loading