Skip to contentSkip to conversation

MIPS updates

PATCH New Daniel Schwierzeck 2 participants 11 messages Dec 19, 2015 – Jan 12, 2016 MIPS

lore
Share & tools
lore
#0 lore raw

cover 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
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/5 MIPS: fix annotation of _start and relocate_code

Correctly annotate _start and relocate_code as functions to produce more readable disassembly code generated by objdump.

---

 arch/mips/cpu/start.S       | 12 +++++-------
 arch/mips/include/asm/asm.h |  6 ++++++
 2 files changed, 11 insertions(+), 7 deletions(-)
arch/mips/cpu/start.S +5 -7
index 3b5b622..e95cdca 100644
@@ -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)
arch/mips/include/asm/asm.h +6 -0
index 933ccb1..855f707 100644
@@ -45,6 +45,12 @@
 #define CPLOAD(register)
 #endif
 
+#define ENTRY(symbol)                                   \
+		.globl	symbol;                         \
+		.type	symbol, @function;              \
+		.ent	symbol, 0;                      \
+symbol:
+
 /*
  * LEAF - declare leaf routine
  */
Signature · 1 line
2.5.0
#2 lore raw

PATCH 2/5 MIPS: create .text sub-sections for assembler functions

In reply to Daniel Schwierzeck

Put all functions coded in assembly in sub-sections of section .text. This allows the linker to garbage collect unused assembly functions too.

---

 arch/mips/include/asm/asm.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/mips/include/asm/asm.h +3 -1
index 855f707..8c9c4e2 100644
@@ -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
 
 /*
Signature · 1 line
2.5.0
#3 lore raw

PATCH 3/5 MIPS: do not build position-independent executables for SPL

In reply to Daniel Schwierzeck

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.

---

 arch/mips/config.mk | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
arch/mips/config.mk +14 -4
index 52e28f2..415ec8a 100644
@@ -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)
Signature · 1 line
2.5.0
#4 lore raw

PATCH 4/5 MIPS: add initial infrastructure for device-tree files

In reply to Daniel Schwierzeck

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.

---

 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
arch/Kconfig +1 -0
index 1709d40..ec12013 100644
@@ -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"
arch/mips/dts/.gitignore new file +1 -0
new file mode 100644
index 0000000..b60ed20
@@ -0,0 +1 @@
+*.dtb
arch/mips/dts/Makefile new file +16 -0
new file mode 100644
index 0000000..47b6eb5
@@ -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
arch/mips/dts/skeleton.dtsi new file +23 -0
new file mode 100644
index 0000000..24ee6c3
@@ -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>;
+	};
+};
Signature · 1 line
2.5.0
#5 lore raw

PATCH v2 4/5 MIPS: add initial infrastructure for device-tree files

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.

---

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
arch/Kconfig +1 -0
index 1709d40..ec12013 100644
@@ -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"
arch/mips/config.mk +1 -1
index 415ec8a..3ebc202 100644
@@ -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)
arch/mips/dts/.gitignore new file +1 -0
new file mode 100644
index 0000000..b60ed20
@@ -0,0 +1 @@
+*.dtb
arch/mips/dts/Makefile new file +16 -0
new file mode 100644
index 0000000..47b6eb5
@@ -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
arch/mips/dts/skeleton.dtsi new file +23 -0
new file mode 100644
index 0000000..24ee6c3
@@ -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>;
+	};
+};
dts/Makefile +1 -1
index d3122aa..c4ac153 100644
@@ -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
Signature · 1 line
2.5.0
#6 lore raw

PATCH v2 4/5 MIPS: add initial infrastructure for device-tree files

Quoted 41 lines · Daniel Schwierzeck

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.

---

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
arch/Kconfig +1 -0
index 1709d40..ec12013 100644
@@ -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"
arch/mips/config.mk +0 -0
index 415ec8a..3ebc202 100644

arch/mips/config.mk else · line 76

Quoted 7 lines
arch/mips/config.mk +1 -1
@@ -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.

Quoted 69 lines
arch/mips/config.mk +0 -0
 PLATFORM_CPPFLAGS		+= -G 0 $(PF_ABICALLS) $(PF_PIC)
arch/mips/dts/.gitignore new file +1 -0
new file mode 100644
index 0000000..b60ed20
@@ -0,0 +1 @@
+*.dtb
arch/mips/dts/Makefile new file +16 -0
new file mode 100644
index 0000000..47b6eb5
@@ -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
arch/mips/dts/skeleton.dtsi new file +23 -0
new file mode 100644
index 0000000..24ee6c3
@@ -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>;
+	};
+};
dts/Makefile +1 -1
index d3122aa..c4ac153 100644
@@ -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
#7 lore raw

PATCH v2 4/5 MIPS: add initial infrastructure for device-tree files

Am Montag, den 11.01.2016, 16:55 +0530 schrieb Purna Chandra Mandal:

Quoted 48 lines · Daniel Schwierzeck
Quoted 47 lines

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.

---

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
arch/Kconfig +1 -0
index 1709d40..ec12013 100644
@@ -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"
arch/mips/config.mk +0 -1
index 415ec8a..3ebc202 100644
@@ -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

Quoted 8 lines
Quoted 3 lines

.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.

Quoted 76 lines
Quoted 75 lines

PLATFORM_CPPFLAGS += -G 0 $(PF_ABICALLS) $(PF_PIC)

arch/mips/dts/.gitignore new file +1 -0
new file mode 100644
index 0000000..b60ed20
@@ -0,0 +1 @@
+*.dtb
arch/mips/dts/Makefile new file +16 -0
new file mode 100644
index 0000000..47b6eb5
@@ -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
arch/mips/dts/skeleton.dtsi new file +2 -0
new file mode 100644
index 0000000..24ee6c3
@@ -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+
+ */

arch/mips/dts/skeleton.dtsi new file +16 -0
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	chosen {
+	};
+
+	aliases {
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0>;
+	};
+};
dts/Makefile +0 -1
index d3122aa..c4ac153 100644
@@ -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

Signature · 1 line
- Daniel
#8 lore raw

PATCH v3 1/1 MIPS: add initial infrastructure for device-tree files

In reply to Daniel Schwierzeck

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.

---
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
arch/Kconfig +1 -0
index 1709d40..ec12013 100644
@@ -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"
arch/mips/config.mk +1 -0
index 415ec8a..b78d495 100644
@@ -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)
arch/mips/dts/.gitignore new file +1 -0
new file mode 100644
index 0000000..b60ed20
@@ -0,0 +1 @@
+*.dtb
arch/mips/dts/Makefile new file +16 -0
new file mode 100644
index 0000000..47b6eb5
@@ -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
arch/mips/dts/skeleton.dtsi new file +23 -0
new file mode 100644
index 0000000..24ee6c3
@@ -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>;
+	};
+};
dts/Makefile +1 -1
index d3122aa..c4ac153 100644
@@ -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
Signature · 1 line
2.5.0
#9 lore raw

PATCH v4 1/1 MIPS: add initial infrastructure for device-tree files

Prepare sub-folder for device-tree files. Make support for device-tree on MIPS available in Kbuild/Kconfig.

---
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
arch/Kconfig +1 -0
index 1709d40..ec12013 100644
@@ -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"
arch/mips/config.mk +1 -0
index 415ec8a..b78d495 100644
@@ -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)
arch/mips/dts/.gitignore new file +1 -0
new file mode 100644
index 0000000..b60ed20
@@ -0,0 +1 @@
+*.dtb
arch/mips/dts/Makefile new file +16 -0
new file mode 100644
index 0000000..47b6eb5
@@ -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
arch/mips/dts/include/dt-bindings new file +1 -0
new file mode 120000
index 0000000..0cecb3d
@@ -0,0 +1 @@
+../../../../include/dt-bindings
\ No newline at end of file
arch/mips/dts/skeleton.dtsi new file +23 -0
new file mode 100644
index 0000000..24ee6c3
@@ -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>;
+	};
+};
dts/Makefile +1 -1
index d3122aa..c4ac153 100644
@@ -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
Signature · 1 line
2.5.0
#10 lore raw

PATCH 5/5 Kconfig: create symbolic link on MIPS

In reply to Daniel Schwierzeck

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.

---

 arch/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/Kconfig +1 -0
index ec12013..85743d0 100644
@@ -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
Signature · 1 line
2.5.0