All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/5] MIPS updates
@ 2015-12-19 19:20 Daniel Schwierzeck
  2015-12-19 19:20 ` [U-Boot] [PATCH 1/5] MIPS: fix annotation of _start and relocate_code Daniel Schwierzeck
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Daniel Schwierzeck @ 2015-12-19 19:20 UTC (permalink / raw)
  To: u-boot




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

-- 
2.5.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 1/5] MIPS: fix annotation of _start and relocate_code
  2015-12-19 19:20 [U-Boot] [PATCH 0/5] MIPS updates Daniel Schwierzeck
@ 2015-12-19 19:20 ` Daniel Schwierzeck
  2015-12-19 19:20 ` [U-Boot] [PATCH 2/5] MIPS: create .text sub-sections for assembler functions Daniel Schwierzeck
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Daniel Schwierzeck @ 2015-12-19 19:20 UTC (permalink / raw)
  To: u-boot

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
  */
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 2/5] MIPS: create .text sub-sections for assembler functions
  2015-12-19 19:20 [U-Boot] [PATCH 0/5] MIPS updates Daniel Schwierzeck
  2015-12-19 19:20 ` [U-Boot] [PATCH 1/5] MIPS: fix annotation of _start and relocate_code Daniel Schwierzeck
@ 2015-12-19 19:20 ` Daniel Schwierzeck
  2015-12-19 19:20 ` [U-Boot] [PATCH 3/5] MIPS: do not build position-independent executables for SPL Daniel Schwierzeck
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Daniel Schwierzeck @ 2015-12-19 19:20 UTC (permalink / raw)
  To: u-boot

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
 
 /*
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 3/5] MIPS: do not build position-independent executables for SPL
  2015-12-19 19:20 [U-Boot] [PATCH 0/5] MIPS updates Daniel Schwierzeck
  2015-12-19 19:20 ` [U-Boot] [PATCH 1/5] MIPS: fix annotation of _start and relocate_code Daniel Schwierzeck
  2015-12-19 19:20 ` [U-Boot] [PATCH 2/5] MIPS: create .text sub-sections for assembler functions Daniel Schwierzeck
@ 2015-12-19 19:20 ` Daniel Schwierzeck
  2015-12-19 19:20 ` [U-Boot] [PATCH 4/5] MIPS: add initial infrastructure for device-tree files Daniel Schwierzeck
  2015-12-19 19:20 ` [U-Boot] [PATCH 5/5] Kconfig: create symbolic link on MIPS Daniel Schwierzeck
  4 siblings, 0 replies; 11+ messages in thread
From: Daniel Schwierzeck @ 2015-12-19 19:20 UTC (permalink / raw)
  To: u-boot

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)
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 4/5] MIPS: add initial infrastructure for device-tree files
  2015-12-19 19:20 [U-Boot] [PATCH 0/5] MIPS updates Daniel Schwierzeck
                   ` (2 preceding siblings ...)
  2015-12-19 19:20 ` [U-Boot] [PATCH 3/5] MIPS: do not build position-independent executables for SPL Daniel Schwierzeck
@ 2015-12-19 19:20 ` Daniel Schwierzeck
  2015-12-19 22:43   ` [U-Boot] [PATCH v2 " Daniel Schwierzeck
  2015-12-19 19:20 ` [U-Boot] [PATCH 5/5] Kconfig: create symbolic link on MIPS Daniel Schwierzeck
  4 siblings, 1 reply; 11+ messages in thread
From: Daniel Schwierzeck @ 2015-12-19 19:20 UTC (permalink / raw)
  To: u-boot

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>;
+	};
+};
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 5/5] Kconfig: create symbolic link on MIPS
  2015-12-19 19:20 [U-Boot] [PATCH 0/5] MIPS updates Daniel Schwierzeck
                   ` (3 preceding siblings ...)
  2015-12-19 19:20 ` [U-Boot] [PATCH 4/5] MIPS: add initial infrastructure for device-tree files Daniel Schwierzeck
@ 2015-12-19 19:20 ` Daniel Schwierzeck
  4 siblings, 0 replies; 11+ messages in thread
From: Daniel Schwierzeck @ 2015-12-19 19:20 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 4/5] MIPS: add initial infrastructure for device-tree files
  2015-12-19 19:20 ` [U-Boot] [PATCH 4/5] MIPS: add initial infrastructure for device-tree files Daniel Schwierzeck
@ 2015-12-19 22:43   ` Daniel Schwierzeck
  2016-01-11 11:25     ` Purna Chandra Mandal
  2016-01-11 16:48     ` [U-Boot] [PATCH v3] " Daniel Schwierzeck
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Schwierzeck @ 2015-12-19 22:43 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 4/5] MIPS: add initial infrastructure for device-tree files
  2015-12-19 22:43   ` [U-Boot] [PATCH v2 " Daniel Schwierzeck
@ 2016-01-11 11:25     ` Purna Chandra Mandal
  2016-01-11 16:40       ` Daniel Schwierzeck
  2016-01-11 16:48     ` [U-Boot] [PATCH v3] " Daniel Schwierzeck
  1 sibling, 1 reply; 11+ messages in thread
From: Purna Chandra Mandal @ 2016-01-11 11:25 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v2 4/5] MIPS: add initial infrastructure for device-tree files
  2016-01-11 11:25     ` Purna Chandra Mandal
@ 2016-01-11 16:40       ` Daniel Schwierzeck
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Schwierzeck @ 2016-01-11 16:40 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v3] MIPS: add initial infrastructure for device-tree files
  2015-12-19 22:43   ` [U-Boot] [PATCH v2 " Daniel Schwierzeck
  2016-01-11 11:25     ` Purna Chandra Mandal
@ 2016-01-11 16:48     ` Daniel Schwierzeck
  2016-01-12 19:05       ` [U-Boot] [PATCH v4] " Daniel Schwierzeck
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel Schwierzeck @ 2016-01-11 16:48 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v4] MIPS: add initial infrastructure for device-tree files
  2016-01-11 16:48     ` [U-Boot] [PATCH v3] " Daniel Schwierzeck
@ 2016-01-12 19:05       ` Daniel Schwierzeck
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Schwierzeck @ 2016-01-12 19:05 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-01-12 19:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-19 19:20 [U-Boot] [PATCH 0/5] MIPS updates Daniel Schwierzeck
2015-12-19 19:20 ` [U-Boot] [PATCH 1/5] MIPS: fix annotation of _start and relocate_code Daniel Schwierzeck
2015-12-19 19:20 ` [U-Boot] [PATCH 2/5] MIPS: create .text sub-sections for assembler functions Daniel Schwierzeck
2015-12-19 19:20 ` [U-Boot] [PATCH 3/5] MIPS: do not build position-independent executables for SPL Daniel Schwierzeck
2015-12-19 19:20 ` [U-Boot] [PATCH 4/5] MIPS: add initial infrastructure for device-tree files Daniel Schwierzeck
2015-12-19 22:43   ` [U-Boot] [PATCH v2 " Daniel Schwierzeck
2016-01-11 11:25     ` Purna Chandra Mandal
2016-01-11 16:40       ` Daniel Schwierzeck
2016-01-11 16:48     ` [U-Boot] [PATCH v3] " Daniel Schwierzeck
2016-01-12 19:05       ` [U-Boot] [PATCH v4] " Daniel Schwierzeck
2015-12-19 19:20 ` [U-Boot] [PATCH 5/5] Kconfig: create symbolic link on MIPS Daniel Schwierzeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.