Commit a9f75ac5 authored by Rabin Vincent's avatar Rabin Vincent Committed by Jesper Nilsson
Browse files

CRISv32: add device tree support



Add support for booting CRISv32 with a built-in device tree.

Signed-off-by: default avatarRabin Vincent <rabin@rab.in>
Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
parent 43f7071e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ config CRIS
	select OLD_SIGACTION
	select ARCH_REQUIRE_GPIOLIB
	select IRQ_DOMAIN if ETRAX_ARCH_V32
	select OF if ETRAX_ARCH_V32
	select OF_EARLY_FLATTREE if ETRAX_ARCH_V32

config HZ
	int
@@ -63,6 +65,10 @@ config NR_CPUS
	int
	default "1"

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

source "init/Kconfig"

source "kernel/Kconfig.freezer"
+4 −0
Original line number Diff line number Diff line
@@ -40,6 +40,10 @@ else
MACH :=
endif

ifneq ($(CONFIG_BUILTIN_DTB),"")
core-$(CONFIG_OF) += arch/cris/boot/dts/
endif

LD = $(CROSS_COMPILE)ld -mcrislinux

OBJCOPYFLAGS := -O binary -R .note -R .comment -S
+6 −0
Original line number Diff line number Diff line
BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
ifneq ($(CONFIG_BUILTIN_DTB),"")
obj-$(CONFIG_OF) += $(BUILTIN_DTB)
endif

clean-files := *.dtb.S
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ CPPFLAGS_vmlinux.lds := -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
extra-y	:= vmlinux.lds

obj-y   := process.o traps.o irq.o ptrace.o setup.o time.o sys_cris.o
obj-y += devicetree.o

obj-$(CONFIG_MODULES)    += crisksyms.o
obj-$(CONFIG_MODULES)	 += module.o
+14 −0
Original line number Diff line number Diff line
#include <linux/init.h>
#include <linux/bootmem.h>
#include <linux/printk.h>

void __init early_init_dt_add_memory_arch(u64 base, u64 size)
{
	pr_err("%s(%llx, %llx)\n",
	       __func__, base, size);
}

void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
{
	return alloc_bootmem_align(size, align);
}
Loading