[U-Boot] [PATCH 0/5] MIPS updates

Daniel Schwierzeck (5): MIPS: fix annotation of _start and relocate_code MIPS: create .text sub-sections for assembler functions MIPS: do not build position-independent executables for SPL MIPS: add initial infrastructure for device-tree files Kconfig: create symbolic link on MIPS
arch/Kconfig | 2 ++ arch/mips/config.mk | 18 ++++++++++++++---- arch/mips/cpu/start.S | 12 +++++------- arch/mips/dts/.gitignore | 1 + arch/mips/dts/Makefile | 16 ++++++++++++++++ arch/mips/dts/skeleton.dtsi | 23 +++++++++++++++++++++++ arch/mips/include/asm/asm.h | 10 +++++++++- 7 files changed, 70 insertions(+), 12 deletions(-) create mode 100644 arch/mips/dts/.gitignore create mode 100644 arch/mips/dts/Makefile create mode 100644 arch/mips/dts/skeleton.dtsi

Correctly annotate _start and relocate_code as functions to produce more readable disassembly code generated by objdump.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com ---
arch/mips/cpu/start.S | 12 +++++------- arch/mips/include/asm/asm.h | 6 ++++++ 2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S index 3b5b622..e95cdca 100644 --- a/arch/mips/cpu/start.S +++ b/arch/mips/cpu/start.S @@ -56,9 +56,7 @@
.set noreorder
- .globl _start - .text -_start: +ENTRY(_start) /* U-boot entry point */ b reset nop @@ -192,6 +190,8 @@ reset: jr t9 move ra, zero
+ END(_start) + /* * void relocate_code (addr_sp, gd, addr_moni) * @@ -202,9 +202,7 @@ reset: * a1 = gd * a2 = destination address */ - .globl relocate_code - .ent relocate_code -relocate_code: +ENTRY(relocate_code) move sp, a0 # set new stack pointer move fp, sp
@@ -317,4 +315,4 @@ in_ram: jr t9 move ra, zero
- .end relocate_code + END(relocate_code) diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h index 933ccb1..855f707 100644 --- a/arch/mips/include/asm/asm.h +++ b/arch/mips/include/asm/asm.h @@ -45,6 +45,12 @@ #define CPLOAD(register) #endif
+#define ENTRY(symbol) \ + .globl symbol; \ + .type symbol, @function; \ + .ent symbol, 0; \ +symbol: + /* * LEAF - declare leaf routine */

Put all functions coded in assembly in sub-sections of section .text. This allows the linker to garbage collect unused assembly functions too.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com ---
arch/mips/include/asm/asm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h index 855f707..8c9c4e2 100644 --- a/arch/mips/include/asm/asm.h +++ b/arch/mips/include/asm/asm.h @@ -59,6 +59,7 @@ symbol: .align 2; \ .type symbol, @function; \ .ent symbol, 0; \ + .section .text.symbol, "x"; \ symbol: .frame sp, 0, ra
/* @@ -68,7 +69,8 @@ symbol: .frame sp, 0, ra .globl symbol; \ .align 2; \ .type symbol, @function; \ - .ent symbol, 0; \ + .ent symbol, 0; \ + .section .text.symbol, "x"; \ symbol: .frame sp, framesize, rpc
/*

SPL binaries are usually linked to a fixed address in SRAM. Furthermore SPL binaries do not need to relocate itself. Thus do not build them as position-independent binaries which helps to largely reduce the size of SPL binaries.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com ---
arch/mips/config.mk | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 52e28f2..415ec8a 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -63,10 +63,20 @@ PLATFORM_CPPFLAGS += -D__MIPS__ # On the other hand, we want PIC in the U-Boot code to relocate it from ROM # to RAM. $28 is always used as gp. # -PLATFORM_CPPFLAGS += -G 0 -mabicalls -fpic +ifdef CONFIG_SPL_BUILD +PF_ABICALLS := -mno-abicalls +PF_PIC := -fno-pic +PF_PIE := +else +PF_ABICALLS := -mabicalls +PF_PIC := -fpic +PF_PIE := -pie +PF_OBJCOPY := -j .got -j .u_boot_list -j .rel.dyn -j .padding +endif + +PLATFORM_CPPFLAGS += -G 0 $(PF_ABICALLS) $(PF_PIC) PLATFORM_CPPFLAGS += -msoft-float PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections -LDFLAGS_FINAL += --gc-sections -pie -OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .got -OBJCOPYFLAGS += -j .u_boot_list -j .rel.dyn -j .padding +LDFLAGS_FINAL += --gc-sections $(PF_PIE) +OBJCOPYFLAGS += -j .text -j .rodata -j .data $(PF_OBJCOPY)

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com
---
arch/Kconfig | 1 + arch/mips/dts/.gitignore | 1 + arch/mips/dts/Makefile | 16 ++++++++++++++++ arch/mips/dts/skeleton.dtsi | 23 +++++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 arch/mips/dts/.gitignore create mode 100644 arch/mips/dts/Makefile create mode 100644 arch/mips/dts/skeleton.dtsi
diff --git a/arch/Kconfig b/arch/Kconfig index 1709d40..ec12013 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -55,6 +55,7 @@ config MIPS select HAVE_PRIVATE_LIBGCC select HAVE_GENERIC_BOARD select SYS_GENERIC_BOARD + select SUPPORT_OF_CONTROL
config NDS32 bool "NDS32 architecture" diff --git a/arch/mips/dts/.gitignore b/arch/mips/dts/.gitignore new file mode 100644 index 0000000..b60ed20 --- /dev/null +++ b/arch/mips/dts/.gitignore @@ -0,0 +1 @@ +*.dtb diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile new file mode 100644 index 0000000..47b6eb5 --- /dev/null +++ b/arch/mips/dts/Makefile @@ -0,0 +1,16 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +# + +dtb-y += + +targets += $(dtb-y) + +# Add any required device tree compiler flags here +DTC_FLAGS += + +PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y)) + @: + +clean-files := *.dtb diff --git a/arch/mips/dts/skeleton.dtsi b/arch/mips/dts/skeleton.dtsi new file mode 100644 index 0000000..24ee6c3 --- /dev/null +++ b/arch/mips/dts/skeleton.dtsi @@ -0,0 +1,23 @@ +/* + * Skeleton device tree; the bare minimum needed to boot; just include and + * add a compatible value. The bootloader will typically populate the memory + * node. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/ { + #address-cells = <1>; + #size-cells = <1>; + + chosen { + }; + + aliases { + }; + + memory { + device_type = "memory"; + reg = <0 0>; + }; +};

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com Signed-off-by: Purna Chandra Mandal purna.mandal@microchip.com
---
Changes in v2: - add arch/mips/dts to clean list in dts/Makefile - keep section .dtb during link in case of CONFIG_OF_EMBED
arch/Kconfig | 1 + arch/mips/config.mk | 2 +- arch/mips/dts/.gitignore | 1 + arch/mips/dts/Makefile | 16 ++++++++++++++++ arch/mips/dts/skeleton.dtsi | 23 +++++++++++++++++++++++ dts/Makefile | 2 +- 6 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 arch/mips/dts/.gitignore create mode 100644 arch/mips/dts/Makefile create mode 100644 arch/mips/dts/skeleton.dtsi
diff --git a/arch/Kconfig b/arch/Kconfig index 1709d40..ec12013 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -55,6 +55,7 @@ config MIPS select HAVE_PRIVATE_LIBGCC select HAVE_GENERIC_BOARD select SYS_GENERIC_BOARD + select SUPPORT_OF_CONTROL
config NDS32 bool "NDS32 architecture" diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 415ec8a..3ebc202 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -71,7 +71,7 @@ else PF_ABICALLS := -mabicalls PF_PIC := -fpic PF_PIE := -pie -PF_OBJCOPY := -j .got -j .u_boot_list -j .rel.dyn -j .padding +PF_OBJCOPY := -j .got -j .u_boot_list -j .rel.dyn -j .padding -j .dtb endif
PLATFORM_CPPFLAGS += -G 0 $(PF_ABICALLS) $(PF_PIC) diff --git a/arch/mips/dts/.gitignore b/arch/mips/dts/.gitignore new file mode 100644 index 0000000..b60ed20 --- /dev/null +++ b/arch/mips/dts/.gitignore @@ -0,0 +1 @@ +*.dtb diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile new file mode 100644 index 0000000..47b6eb5 --- /dev/null +++ b/arch/mips/dts/Makefile @@ -0,0 +1,16 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +# + +dtb-y += + +targets += $(dtb-y) + +# Add any required device tree compiler flags here +DTC_FLAGS += + +PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y)) + @: + +clean-files := *.dtb diff --git a/arch/mips/dts/skeleton.dtsi b/arch/mips/dts/skeleton.dtsi new file mode 100644 index 0000000..24ee6c3 --- /dev/null +++ b/arch/mips/dts/skeleton.dtsi @@ -0,0 +1,23 @@ +/* + * Skeleton device tree; the bare minimum needed to boot; just include and + * add a compatible value. The bootloader will typically populate the memory + * node. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/ { + #address-cells = <1>; + #size-cells = <1>; + + chosen { + }; + + aliases { + }; + + memory { + device_type = "memory"; + reg = <0 0>; + }; +}; diff --git a/dts/Makefile b/dts/Makefile index d3122aa..c4ac153 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -45,4 +45,4 @@ dtbs: $(obj)/dt.dtb clean-files := dt.dtb.S
# Let clean descend into dts directories -subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts +subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts

On 12/20/2015 04:13 AM, Daniel Schwierzeck wrote:
Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com Signed-off-by: Purna Chandra Mandal purna.mandal@microchip.com
Changes in v2:
- add arch/mips/dts to clean list in dts/Makefile
- keep section .dtb during link in case of CONFIG_OF_EMBED
arch/Kconfig | 1 + arch/mips/config.mk | 2 +- arch/mips/dts/.gitignore | 1 + arch/mips/dts/Makefile | 16 ++++++++++++++++ arch/mips/dts/skeleton.dtsi | 23 +++++++++++++++++++++++ dts/Makefile | 2 +- 6 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 arch/mips/dts/.gitignore create mode 100644 arch/mips/dts/Makefile create mode 100644 arch/mips/dts/skeleton.dtsi
diff --git a/arch/Kconfig b/arch/Kconfig index 1709d40..ec12013 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -55,6 +55,7 @@ config MIPS select HAVE_PRIVATE_LIBGCC select HAVE_GENERIC_BOARD select SYS_GENERIC_BOARD
- select SUPPORT_OF_CONTROL
config NDS32 bool "NDS32 architecture" diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 415ec8a..3ebc202 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -71,7 +71,7 @@ else PF_ABICALLS := -mabicalls PF_PIC := -fpic PF_PIE := -pie -PF_OBJCOPY := -j .got -j .u_boot_list -j .rel.dyn -j .padding +PF_OBJCOPY := -j .got -j .u_boot_list -j .rel.dyn -j .padding -j .dtb endif
There is no section called '.dtb' in U-boot linker script, instead one generated by build script is named '.dtb.init.rodata'. Unless we add '-j .dtb.init.rodata' device-tree blob will not be copied to binary.
PLATFORM_CPPFLAGS += -G 0 $(PF_ABICALLS) $(PF_PIC) diff --git a/arch/mips/dts/.gitignore b/arch/mips/dts/.gitignore new file mode 100644 index 0000000..b60ed20 --- /dev/null +++ b/arch/mips/dts/.gitignore @@ -0,0 +1 @@ +*.dtb diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile new file mode 100644 index 0000000..47b6eb5 --- /dev/null +++ b/arch/mips/dts/Makefile @@ -0,0 +1,16 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +#
+dtb-y +=
+targets += $(dtb-y)
+# Add any required device tree compiler flags here +DTC_FLAGS +=
+PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
+clean-files := *.dtb diff --git a/arch/mips/dts/skeleton.dtsi b/arch/mips/dts/skeleton.dtsi new file mode 100644 index 0000000..24ee6c3 --- /dev/null +++ b/arch/mips/dts/skeleton.dtsi @@ -0,0 +1,23 @@ +/*
- Skeleton device tree; the bare minimum needed to boot; just include and
- add a compatible value. The bootloader will typically populate the memory
- node.
- SPDX-License-Identifier: GPL-2.0+
- */
+/ {
- #address-cells = <1>;
- #size-cells = <1>;
- chosen {
- };
- aliases {
- };
- memory {
device_type = "memory";
reg = <0 0>;
- };
+}; diff --git a/dts/Makefile b/dts/Makefile index d3122aa..c4ac153 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -45,4 +45,4 @@ dtbs: $(obj)/dt.dtb clean-files := dt.dtb.S
# Let clean descend into dts directories -subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts +subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts

Am Montag, den 11.01.2016, 16:55 +0530 schrieb Purna Chandra Mandal:
On 12/20/2015 04:13 AM, Daniel Schwierzeck wrote:
Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com Signed-off-by: Purna Chandra Mandal purna.mandal@microchip.com
Changes in v2:
- add arch/mips/dts to clean list in dts/Makefile
- keep section .dtb during link in case of CONFIG_OF_EMBED
arch/Kconfig | 1 + arch/mips/config.mk | 2 +- arch/mips/dts/.gitignore | 1 + arch/mips/dts/Makefile | 16 ++++++++++++++++ arch/mips/dts/skeleton.dtsi | 23 +++++++++++++++++++++++ dts/Makefile | 2 +- 6 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 arch/mips/dts/.gitignore create mode 100644 arch/mips/dts/Makefile create mode 100644 arch/mips/dts/skeleton.dtsi
diff --git a/arch/Kconfig b/arch/Kconfig index 1709d40..ec12013 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -55,6 +55,7 @@ config MIPS select HAVE_PRIVATE_LIBGCC select HAVE_GENERIC_BOARD select SYS_GENERIC_BOARD
- select SUPPORT_OF_CONTROL
config NDS32 bool "NDS32 architecture" diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 415ec8a..3ebc202 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -71,7 +71,7 @@ else PF_ABICALLS := -mabicalls PF_PIC := -fpic PF_PIE := -pie -PF_OBJCOPY := -j .got -j .u_boot_list -j .rel.dyn -j .padding +PF_OBJCOPY := -j .got -j .u_boot_list -j .rel.dyn -j .padding -j .dtb endif
There is no section called '.dtb' in U-boot linker script, instead one generated by build script is named '.dtb.init.rodata'. Unless we add '-j .dtb.init.rodata' device-tree blob will not be copied to binary.
you are right. My thought was that all sub-sections are picked up by objcopy. It works if I put a .dtb section to the linker script. I will change to '-j .dtb.init.rodata', ARM does it in the same way.
PLATFORM_CPPFLAGS += -G 0 $(PF_ABICALLS) $(PF_PIC) diff --git a/arch/mips/dts/.gitignore b/arch/mips/dts/.gitignore new file mode 100644 index 0000000..b60ed20 --- /dev/null +++ b/arch/mips/dts/.gitignore @@ -0,0 +1 @@ +*.dtb diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile new file mode 100644 index 0000000..47b6eb5 --- /dev/null +++ b/arch/mips/dts/Makefile @@ -0,0 +1,16 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +#
+dtb-y +=
+targets += $(dtb-y)
+# Add any required device tree compiler flags here +DTC_FLAGS +=
+PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
+clean-files := *.dtb diff --git a/arch/mips/dts/skeleton.dtsi b/arch/mips/dts/skeleton.dtsi new file mode 100644 index 0000000..24ee6c3 --- /dev/null +++ b/arch/mips/dts/skeleton.dtsi @@ -0,0 +1,23 @@ +/*
- Skeleton device tree; the bare minimum needed to boot; just
include and
- add a compatible value. The bootloader will typically populate
the memory
- node.
- SPDX-License-Identifier: GPL-2.0+
- */
+/ {
- #address-cells = <1>;
- #size-cells = <1>;
- chosen {
- };
- aliases {
- };
- memory {
device_type = "memory";
reg = <0 0>;
- };
+}; diff --git a/dts/Makefile b/dts/Makefile index d3122aa..c4ac153 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -45,4 +45,4 @@ dtbs: $(obj)/dt.dtb clean-files := dt.dtb.S
# Let clean descend into dts directories -subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts +subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com Signed-off-by: Purna Chandra Mandal purna.mandal@microchip.com --- Changes in v3: - keep section .dtb.init.rodata during link in case of CONFIG_OF_EMBED, .dtb only does not work
Changes in v2: - add arch/mips/dts to clean list in dts/Makefile - keep section .dtb during link in case of CONFIG_OF_EMBED
arch/Kconfig | 1 + arch/mips/config.mk | 1 + arch/mips/dts/.gitignore | 1 + arch/mips/dts/Makefile | 16 ++++++++++++++++ arch/mips/dts/skeleton.dtsi | 23 +++++++++++++++++++++++ dts/Makefile | 2 +- 6 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 arch/mips/dts/.gitignore create mode 100644 arch/mips/dts/Makefile create mode 100644 arch/mips/dts/skeleton.dtsi
diff --git a/arch/Kconfig b/arch/Kconfig index 1709d40..ec12013 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -55,6 +55,7 @@ config MIPS select HAVE_PRIVATE_LIBGCC select HAVE_GENERIC_BOARD select SYS_GENERIC_BOARD + select SUPPORT_OF_CONTROL
config NDS32 bool "NDS32 architecture" diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 415ec8a..b78d495 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -72,6 +72,7 @@ PF_ABICALLS := -mabicalls PF_PIC := -fpic PF_PIE := -pie PF_OBJCOPY := -j .got -j .u_boot_list -j .rel.dyn -j .padding +PF_OBJCOPY += -j .dtb.init.rodata endif
PLATFORM_CPPFLAGS += -G 0 $(PF_ABICALLS) $(PF_PIC) diff --git a/arch/mips/dts/.gitignore b/arch/mips/dts/.gitignore new file mode 100644 index 0000000..b60ed20 --- /dev/null +++ b/arch/mips/dts/.gitignore @@ -0,0 +1 @@ +*.dtb diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile new file mode 100644 index 0000000..47b6eb5 --- /dev/null +++ b/arch/mips/dts/Makefile @@ -0,0 +1,16 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +# + +dtb-y += + +targets += $(dtb-y) + +# Add any required device tree compiler flags here +DTC_FLAGS += + +PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y)) + @: + +clean-files := *.dtb diff --git a/arch/mips/dts/skeleton.dtsi b/arch/mips/dts/skeleton.dtsi new file mode 100644 index 0000000..24ee6c3 --- /dev/null +++ b/arch/mips/dts/skeleton.dtsi @@ -0,0 +1,23 @@ +/* + * Skeleton device tree; the bare minimum needed to boot; just include and + * add a compatible value. The bootloader will typically populate the memory + * node. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/ { + #address-cells = <1>; + #size-cells = <1>; + + chosen { + }; + + aliases { + }; + + memory { + device_type = "memory"; + reg = <0 0>; + }; +}; diff --git a/dts/Makefile b/dts/Makefile index d3122aa..c4ac153 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -45,4 +45,4 @@ dtbs: $(obj)/dt.dtb clean-files := dt.dtb.S
# Let clean descend into dts directories -subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts +subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com Signed-off-by: Purna Chandra Mandal purna.mandal@microchip.com --- Changes in v4: - add directory arch/mips/dts/include/ - add symlink arch/mips/dts/include/dt-bindings/
Changes in v3: - keep section .dtb.init.rodata during link in case of CONFIG_OF_EMBED, .dtb only does not work
Changes in v2: - add arch/mips/dts to clean list in dts/Makefile - keep section .dtb during link in case of CONFIG_OF_EMBED
arch/Kconfig | 1 + arch/mips/config.mk | 1 + arch/mips/dts/.gitignore | 1 + arch/mips/dts/Makefile | 16 ++++++++++++++++ arch/mips/dts/include/dt-bindings | 1 + arch/mips/dts/skeleton.dtsi | 23 +++++++++++++++++++++++ dts/Makefile | 2 +- 7 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 arch/mips/dts/.gitignore create mode 100644 arch/mips/dts/Makefile create mode 120000 arch/mips/dts/include/dt-bindings create mode 100644 arch/mips/dts/skeleton.dtsi
diff --git a/arch/Kconfig b/arch/Kconfig index 1709d40..ec12013 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -55,6 +55,7 @@ config MIPS select HAVE_PRIVATE_LIBGCC select HAVE_GENERIC_BOARD select SYS_GENERIC_BOARD + select SUPPORT_OF_CONTROL
config NDS32 bool "NDS32 architecture" diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 415ec8a..b78d495 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -72,6 +72,7 @@ PF_ABICALLS := -mabicalls PF_PIC := -fpic PF_PIE := -pie PF_OBJCOPY := -j .got -j .u_boot_list -j .rel.dyn -j .padding +PF_OBJCOPY += -j .dtb.init.rodata endif
PLATFORM_CPPFLAGS += -G 0 $(PF_ABICALLS) $(PF_PIC) diff --git a/arch/mips/dts/.gitignore b/arch/mips/dts/.gitignore new file mode 100644 index 0000000..b60ed20 --- /dev/null +++ b/arch/mips/dts/.gitignore @@ -0,0 +1 @@ +*.dtb diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile new file mode 100644 index 0000000..47b6eb5 --- /dev/null +++ b/arch/mips/dts/Makefile @@ -0,0 +1,16 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +# + +dtb-y += + +targets += $(dtb-y) + +# Add any required device tree compiler flags here +DTC_FLAGS += + +PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y)) + @: + +clean-files := *.dtb diff --git a/arch/mips/dts/include/dt-bindings b/arch/mips/dts/include/dt-bindings new file mode 120000 index 0000000..0cecb3d --- /dev/null +++ b/arch/mips/dts/include/dt-bindings @@ -0,0 +1 @@ +../../../../include/dt-bindings \ No newline at end of file diff --git a/arch/mips/dts/skeleton.dtsi b/arch/mips/dts/skeleton.dtsi new file mode 100644 index 0000000..24ee6c3 --- /dev/null +++ b/arch/mips/dts/skeleton.dtsi @@ -0,0 +1,23 @@ +/* + * Skeleton device tree; the bare minimum needed to boot; just include and + * add a compatible value. The bootloader will typically populate the memory + * node. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/ { + #address-cells = <1>; + #size-cells = <1>; + + chosen { + }; + + aliases { + }; + + memory { + device_type = "memory"; + reg = <0 0>; + }; +}; diff --git a/dts/Makefile b/dts/Makefile index d3122aa..c4ac153 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -45,4 +45,4 @@ dtbs: $(obj)/dt.dtb clean-files := dt.dtb.S
# Let clean descend into dts directories -subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts +subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts

Commit a350c6a60223f7a60228ed563d2e7b02fb7944ab disabled the creation of symbolic links on MIPS. But that feature is used in out-of-tree SoC ports and will be required for the upcoming mainline support of those SoC's.
Signed-off-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com
---
arch/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/Kconfig b/arch/Kconfig index ec12013..85743d0 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -52,6 +52,7 @@ config MICROBLAZE
config MIPS bool "MIPS architecture" + select CREATE_ARCH_SYMLINK select HAVE_PRIVATE_LIBGCC select HAVE_GENERIC_BOARD select SYS_GENERIC_BOARD
participants (2)
-
Daniel Schwierzeck
-
Purna Chandra Mandal