aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-08-01 17:00:12 -0400
committerRob Herring <robh@kernel.org>2018-10-02 10:22:49 -0400
commitbe7cd2df1d22d29e5f23ce8744fc465cc07cc2bc (patch)
treea4cd426bc23d72fab2a595f149dcbf353cd23b6a
parenta91c614510478598051e8c49adb9863ee47959ec (diff)
c6x: use common built-in dtb support
Using the common build support for built-in dtb files just requires adding a .dtb.o target to obj-y. The dtb now needs to be copied when unflattened because an init section is used now. Cc: Mark Salter <msalter@redhat.com> Cc: Aurelien Jacquiot <jacquiot.aurelien@gmail.com> Cc: linux-c6x-dev@linux-c6x.org Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--arch/c6x/boot/dts/Makefile11
-rw-r--r--arch/c6x/boot/dts/linked_dtb.S2
-rw-r--r--arch/c6x/include/asm/sections.h1
-rw-r--r--arch/c6x/kernel/setup.c4
-rw-r--r--arch/c6x/kernel/vmlinux.lds.S10
5 files changed, 3 insertions, 25 deletions
diff --git a/arch/c6x/boot/dts/Makefile b/arch/c6x/boot/dts/Makefile
index b212d278ebc4..fd937f781d16 100644
--- a/arch/c6x/boot/dts/Makefile
+++ b/arch/c6x/boot/dts/Makefile
@@ -6,14 +6,5 @@
6DTC_FLAGS ?= -p 1024 6DTC_FLAGS ?= -p 1024
7 7
8ifneq ($(DTB),) 8ifneq ($(DTB),)
9obj-y += linked_dtb.o 9obj-y += $(DTB).dtb.o
10endif 10endif
11
12quiet_cmd_cp = CP $< $@$2
13 cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
14
15# Generate builtin.dtb from $(DTB).dtb
16$(obj)/builtin.dtb: $(obj)/$(DTB).dtb
17 $(call if_changed,cp)
18
19$(obj)/linked_dtb.o: $(obj)/builtin.dtb
diff --git a/arch/c6x/boot/dts/linked_dtb.S b/arch/c6x/boot/dts/linked_dtb.S
deleted file mode 100644
index cf347f1d16ce..000000000000
--- a/arch/c6x/boot/dts/linked_dtb.S
+++ /dev/null
@@ -1,2 +0,0 @@
1.section __fdt_blob,"a"
2.incbin "arch/c6x/boot/dts/builtin.dtb"
diff --git a/arch/c6x/include/asm/sections.h b/arch/c6x/include/asm/sections.h
index d6c591ab5b7e..dc2f15eb3bde 100644
--- a/arch/c6x/include/asm/sections.h
+++ b/arch/c6x/include/asm/sections.h
@@ -8,6 +8,5 @@ extern char _vectors_start[];
8extern char _vectors_end[]; 8extern char _vectors_end[];
9 9
10extern char _data_lma[]; 10extern char _data_lma[];
11extern char _fdt_start[], _fdt_end[];
12 11
13#endif /* _ASM_C6X_SECTIONS_H */ 12#endif /* _ASM_C6X_SECTIONS_H */
diff --git a/arch/c6x/kernel/setup.c b/arch/c6x/kernel/setup.c
index 786e36e2f61d..509c5f086496 100644
--- a/arch/c6x/kernel/setup.c
+++ b/arch/c6x/kernel/setup.c
@@ -270,7 +270,7 @@ int __init c6x_add_memory(phys_addr_t start, unsigned long size)
270notrace void __init machine_init(unsigned long dt_ptr) 270notrace void __init machine_init(unsigned long dt_ptr)
271{ 271{
272 void *dtb = __va(dt_ptr); 272 void *dtb = __va(dt_ptr);
273 void *fdt = _fdt_start; 273 void *fdt = __dtb_start;
274 274
275 /* interrupts must be masked */ 275 /* interrupts must be masked */
276 set_creg(IER, 2); 276 set_creg(IER, 2);
@@ -363,7 +363,7 @@ void __init setup_arch(char **cmdline_p)
363 memory_end >> PAGE_SHIFT); 363 memory_end >> PAGE_SHIFT);
364 memblock_reserve(memory_start, bootmap_size); 364 memblock_reserve(memory_start, bootmap_size);
365 365
366 unflatten_device_tree(); 366 unflatten_and_copy_device_tree();
367 367
368 c6x_cache_init(); 368 c6x_cache_init();
369 369
diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S
index 1fba5b421eee..584bab2bace6 100644
--- a/arch/c6x/kernel/vmlinux.lds.S
+++ b/arch/c6x/kernel/vmlinux.lds.S
@@ -90,16 +90,6 @@ SECTIONS
90 *(.switch) 90 *(.switch)
91 } 91 }
92 92
93 . = ALIGN (8) ;
94 __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET)
95 {
96 _fdt_start = . ; /* place for fdt blob */
97 *(__fdt_blob) ; /* Any link-placed DTB */
98 BYTE(0); /* section always has contents */
99 . = _fdt_start + 0x4000; /* Pad up to 16kbyte */
100 _fdt_end = . ;
101 }
102
103 _etext = .; 93 _etext = .;
104 94
105 /* 95 /*