All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs
@ 2016-03-18 21:08 Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M Thomas Petazzoni
                   ` (21 more replies)
  0 siblings, 22 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

Hello,

Here is the v2 of the patches that add support for ARM Cortex-M and
STM32 defconfigs.

The changes from v1 are:

 - Added Arnout Acked-by on patch "arch/arm: introduce and use
   BR2_ARM_CPU_ARMV7M".

 - Added Arnout Reviewed-by on patch "arch/arm: add Cortex-M4 entry"

 - Replace the complicated COMPILE_IN_THUMB/USE_BX logic in uclibc.mk
   by patches against uClibc-ng that allow to completely get rid of
   those options. Then simplified uclibc.mk accordingly.

 - Remove hard-float suport for now, since there is no support for it
   in the kernel. Suggested by Arnout.

 - Use BR2_BINFMT_FLAT instead of BR2_USE_MMU to decide whether to
   disable DOPIC in uClibc. Suggested by Arnout.

 - Fix typo in DOPIC commit log. Noticed by Arnout.

 - Added Arnout Reviewed-by on patch "uclibc: NPTL thread
   implementation only available on MMU platforms".

 - In the patch that ensures musl is built for the ARM instruction set
   when Thumb1 is selected, clarify the comment. Suggested by Arnout.

 - Added Arnout Reviewed-by on package/Makefile.in: adjust LDFLAGS for
   elf2flt.

 - Add hash file to the elf2flt package. Suggested by Arnout.

 - Improve the elf2flt upstream change commit log, to explain more
   clearly why the patch from Waldemar is included in this
   commit. Done after a comment made by Arnout.

 - Merge the elf2flt --disable-werror into the elf2flt upstream change
   patch, since it's actually related (switching upstream has changed
   the source code, which is the reason for the new warnings that
   cause the build issues).

 - Switch to kernel 4.5 for the STM32 defconfigs

 - Regenerate Linux patches for STM32F469 since they were not applying
   correctly (reported by Maxime Coquelin).

Thanks!

Thomas

Lee Jones (2):
  configs/stm32f429_disco: new configuration for STM32F429 Discovery
    board
  configs/stm32f469_disco: new configuration for STM32F469 Discovery
    board

Thomas Petazzoni (15):
  arch/arm: introduce and use BR2_ARM_CPU_ARMV7M
  arch/arm: Cortex-M3 provides only Thumb-2
  arch/arm: add Cortex-M4 entry
  uclibc: add patches to simplify Thumb handling
  uclibc: remove USE_BX handling
  uclibc: gcc >= 4.9 can build a thumb/thread uclibc
  uclibc: disable DOPIC on ARM FLAT
  uclibc: context functions are not Thumb-compatible
  uclibc: NPTL thread implementation only available on MMU platforms
  musl: build broken on Thumb, use ARM mode
  toolchain-buildroot: update glibc comment for noMMU
  toolchain-buildroot: don't show musl on noMMU platforms
  package/Makefile.in: adjust LDFLAGS for elf2flt
  elf2flt: use new upstream site and add ARM patch
  afboot-stm32: use the Buildroot toolchain

 arch/Config.in.arm                                 |   10 +-
 board/stmicroelectronics/busybox-minimal.config    | 1057 ++++++++++++++++++++
 board/stmicroelectronics/stm32-post-build.sh       |    8 +
 board/stmicroelectronics/stm32f429-disco/flash.sh  |   20 +
 ...49-disco-don-t-force-init-in-chosen-boota.patch |   32 +
 .../stmicroelectronics/stm32f429-disco/readme.txt  |   30 +
 board/stmicroelectronics/stm32f469-disco/flash.sh  |   20 +
 ...-ARM-stm32-Identify-a-new-board-STM32F469.patch |   25 +
 ...upply-a-DTS-file-for-the-STM32F469-Discov.patch |  101 ++
 ...-Add-new-config-fragment-to-change-RAM-st.patch |   28 +
 .../patches/openocd/0001-add-config.patch          |   37 +
 .../patches/openocd/0002-flash-nor.patch           |   37 +
 .../stmicroelectronics/stm32f469-disco/readme.txt  |   19 +
 .../0001-Use-ld-instead-of-gcc-for-linking.patch   |   61 ++
 boot/afboot-stm32/afboot-stm32.mk                  |    2 +-
 configs/stm32f429_disco_defconfig                  |   18 +
 configs/stm32f469_disco_defconfig                  |   19 +
 package/Makefile.in                                |    2 +-
 .../0001-allow-to-build-arm-flat-binaries.patch    |  123 +++
 package/elf2flt/elf2flt.hash                       |    2 +
 package/elf2flt/elf2flt.mk                         |    8 +-
 package/musl/musl.mk                               |    6 +
 .../0001-arm-remove-use-of-USE_BX-option.patch     |   53 +
 package/uclibc/0002-arm-remove-USE_BX-option.patch |   40 +
 .../0003-arm-remove-use-of-USE_LDREXSTREX.patch    |   49 +
 .../uclibc/0004-arm-remove-USE_LDREXSTREX.patch    |   34 +
 .../uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch  |   43 +
 package/uclibc/Config.in                           |    7 +-
 package/uclibc/uclibc.mk                           |   23 +-
 toolchain/toolchain-buildroot/Config.in            |    4 +
 30 files changed, 1897 insertions(+), 21 deletions(-)
 create mode 100644 board/stmicroelectronics/busybox-minimal.config
 create mode 100755 board/stmicroelectronics/stm32-post-build.sh
 create mode 100755 board/stmicroelectronics/stm32f429-disco/flash.sh
 create mode 100644 board/stmicroelectronics/stm32f429-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch
 create mode 100644 board/stmicroelectronics/stm32f429-disco/readme.txt
 create mode 100755 board/stmicroelectronics/stm32f469-disco/flash.sh
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32-Identify-a-new-board-STM32F469.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0002-ARM-stm32-Supply-a-DTS-file-for-the-STM32F469-Discov.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0003-ARM-configs-Add-new-config-fragment-to-change-RAM-st.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/openocd/0001-add-config.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/openocd/0002-flash-nor.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/readme.txt
 create mode 100644 boot/afboot-stm32/0001-Use-ld-instead-of-gcc-for-linking.patch
 create mode 100644 configs/stm32f429_disco_defconfig
 create mode 100644 configs/stm32f469_disco_defconfig
 create mode 100644 package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
 create mode 100644 package/elf2flt/elf2flt.hash
 create mode 100644 package/uclibc/0001-arm-remove-use-of-USE_BX-option.patch
 create mode 100644 package/uclibc/0002-arm-remove-USE_BX-option.patch
 create mode 100644 package/uclibc/0003-arm-remove-use-of-USE_LDREXSTREX.patch
 create mode 100644 package/uclibc/0004-arm-remove-USE_LDREXSTREX.patch
 create mode 100644 package/uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch

-- 
2.6.4

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

* [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 22:30   ` Yann E. MORIN
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 02/17] arch/arm: Cortex-M3 provides only Thumb-2 Thomas Petazzoni
                   ` (20 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

All ARM cores should select a BR2_ARM_CPU_* option. Currently, the
cortex-m3 does not, which this commit fixes by introducing a
BR2_ARM_CPU_ARMV7M option.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 arch/Config.in.arm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/Config.in.arm b/arch/Config.in.arm
index 04f0369..33f763a 100644
--- a/arch/Config.in.arm
+++ b/arch/Config.in.arm
@@ -52,6 +52,9 @@ config BR2_ARM_CPU_ARMV6
 config BR2_ARM_CPU_ARMV7A
 	bool
 
+config BR2_ARM_CPU_ARMV7M
+	bool
+
 choice
 	prompt "Target Architecture Variant"
 	depends on BR2_arm || BR2_armeb
@@ -171,6 +174,7 @@ config BR2_cortex_m3
 	bool "cortex-M3"
 	select BR2_ARM_CPU_HAS_THUMB
 	select BR2_ARM_CPU_HAS_THUMB2
+	select BR2_ARM_CPU_ARMV7M
 config BR2_fa526
 	bool "fa526/626"
 	select BR2_ARM_CPU_HAS_ARM
-- 
2.6.4

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

* [Buildroot] [PATCH v2 02/17] arch/arm: Cortex-M3 provides only Thumb-2
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 22:34   ` Yann E. MORIN
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 03/17] arch/arm: add Cortex-M4 entry Thomas Petazzoni
                   ` (19 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

The Cortex-M cores only support Thumb-2, not Thumb. In fact, Thumb-2
is a superset of Thumb, and we could have a single option for both in
Buildroot, since -mthumb on ARMv4/v5 means original Thumb, while
-mthumb on ARMv7 means Thumb 2. However, for clarity, it makes sense
to have two separate options. But in this case, Cortex-M3 should not
advertise that it supports Thumb, as in fact selecting Thumb would
generate Thumb-2 code.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/Config.in.arm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/Config.in.arm b/arch/Config.in.arm
index 33f763a..cd1ec33 100644
--- a/arch/Config.in.arm
+++ b/arch/Config.in.arm
@@ -172,7 +172,6 @@ config BR2_cortex_a17
 	select BR2_ARCH_HAS_MMU_OPTIONAL
 config BR2_cortex_m3
 	bool "cortex-M3"
-	select BR2_ARM_CPU_HAS_THUMB
 	select BR2_ARM_CPU_HAS_THUMB2
 	select BR2_ARM_CPU_ARMV7M
 config BR2_fa526
-- 
2.6.4

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

* [Buildroot] [PATCH v2 03/17] arch/arm: add Cortex-M4 entry
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 02/17] arch/arm: Cortex-M3 provides only Thumb-2 Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 22:41   ` Yann E. MORIN
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 04/17] uclibc: add patches to simplify Thumb handling Thomas Petazzoni
                   ` (18 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

This commit adds the option to select the Cortex-M4 ARM core, in the
same family as Cortex-M3. This will be useful to enable the internal
toolchain backend for this ARM core, and provide some defconfigs for
Cortex-M4 platforms.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 arch/Config.in.arm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/Config.in.arm b/arch/Config.in.arm
index cd1ec33..ee612f5 100644
--- a/arch/Config.in.arm
+++ b/arch/Config.in.arm
@@ -174,6 +174,10 @@ config BR2_cortex_m3
 	bool "cortex-M3"
 	select BR2_ARM_CPU_HAS_THUMB2
 	select BR2_ARM_CPU_ARMV7M
+config BR2_cortex_m4
+	bool "cortex-M4"
+	select BR2_ARM_CPU_HAS_THUMB2
+	select BR2_ARM_CPU_ARMV7M
 config BR2_fa526
 	bool "fa526/626"
 	select BR2_ARM_CPU_HAS_ARM
@@ -455,6 +459,7 @@ config BR2_GCC_TARGET_CPU
 	default "cortex-a15"	if BR2_cortex_a15
 	default "cortex-a17"	if BR2_cortex_a17
 	default "cortex-m3"	if BR2_cortex_m3
+	default "cortex-m4"	if BR2_cortex_m4
 	default "fa526"		if BR2_fa526
 	default "marvell-pj4"	if BR2_pj4
 	default "strongarm"	if BR2_strongarm
-- 
2.6.4

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

* [Buildroot] [PATCH v2 04/17] uclibc: add patches to simplify Thumb handling
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 03/17] arch/arm: add Cortex-M4 entry Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-19 15:46   ` Arnout Vandecappelle
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 05/17] uclibc: remove USE_BX handling Thomas Petazzoni
                   ` (17 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

This commit adds a number of patches to uClibc that radically
simplifies the Thumb handling. uClibc currently has three options that
you need to toggle on Thumb configurations depending on the specific
ARM CPU being targeted.

However, it turns out that none of those options are necessary:

 - USE_BX can simply be guessed by looking at the ARM core being
   used. The bx instruction is available for all ARM cores >=
   ARMv4T. This is exactly what glibc is doing.

 - USE_LDREXSTREX can also be guessed by looking at the ARM core being
   used: whenever you have Thumb2, ldrex/strex is available.

 - COMPILE_IN_THUMB becomes useless, since all it does is passing
   -mthumb. But just like the uClibc config options to set
   --march=<foo> have been removed a long time ago, there's no need to
   -have an option to pass -mthumb.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../0001-arm-remove-use-of-USE_BX-option.patch     | 53 ++++++++++++++++++++++
 package/uclibc/0002-arm-remove-USE_BX-option.patch | 40 ++++++++++++++++
 .../0003-arm-remove-use-of-USE_LDREXSTREX.patch    | 49 ++++++++++++++++++++
 .../uclibc/0004-arm-remove-USE_LDREXSTREX.patch    | 34 ++++++++++++++
 .../uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch  | 43 ++++++++++++++++++
 5 files changed, 219 insertions(+)
 create mode 100644 package/uclibc/0001-arm-remove-use-of-USE_BX-option.patch
 create mode 100644 package/uclibc/0002-arm-remove-USE_BX-option.patch
 create mode 100644 package/uclibc/0003-arm-remove-use-of-USE_LDREXSTREX.patch
 create mode 100644 package/uclibc/0004-arm-remove-USE_LDREXSTREX.patch
 create mode 100644 package/uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch

diff --git a/package/uclibc/0001-arm-remove-use-of-USE_BX-option.patch b/package/uclibc/0001-arm-remove-use-of-USE_BX-option.patch
new file mode 100644
index 0000000..ab330fe
--- /dev/null
+++ b/package/uclibc/0001-arm-remove-use-of-USE_BX-option.patch
@@ -0,0 +1,53 @@
+From 5ae09aacbe8b959a36cde130c36547456b7ec8d3 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 17 Mar 2016 22:40:19 +0100
+Subject: [PATCH] arm: remove use of USE_BX option
+
+There is no need to have an option for this: knowing whether BX is
+available or not is easy. If you have an ARM > v4 or ARMv4T, then BX
+is available, otherwise it's not. This logic is the one used in glibc:
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ libc/sysdeps/linux/arm/bits/arm_bx.h | 10 ++++------
+ libc/sysdeps/linux/arm/clone.S       |  2 +-
+ 2 files changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/libc/sysdeps/linux/arm/bits/arm_bx.h b/libc/sysdeps/linux/arm/bits/arm_bx.h
+index 2c29089..1c775b6 100644
+--- a/libc/sysdeps/linux/arm/bits/arm_bx.h
++++ b/libc/sysdeps/linux/arm/bits/arm_bx.h
+@@ -23,13 +23,11 @@
+ #error Please include features.h first
+ #endif /* features.h not yet included */
+ 
+-#if defined(__USE_BX__)
+-# if (__ARM_ARCH <= 4 && !defined __ARM_ARCH_4T__)
+-#  error Use of BX was requested, but is not available on the target processor.
+-# endif /* ARCH level */
+-#endif /* __USE_BX__ */
++#if __ARM_ARCH > 4 || defined (__ARM_ARCH_4T__)
++# define ARCH_HAS_BX
++#endif
+ 
+-#if defined(__USE_BX__) && (__ARM_ARCH > 4 || (__ARM_ARCH == 4 && defined __ARM_ARCH_4T__))
++#if defined(ARCH_HAS_BX)
+ # define BX(reg)	bx reg
+ # define BXC(cond, reg)	bx##cond reg
+ #else
+diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
+index b4c7d8a..fd7590d 100644
+--- a/libc/sysdeps/linux/arm/clone.S
++++ b/libc/sysdeps/linux/arm/clone.S
+@@ -69,7 +69,7 @@ __clone:
+ 
+ 	@ pick the function arg and call address off the stack and execute
+ 	ldr	r0, [sp, #4]
+-#if defined(__USE_BX__)
++#if defined(ARCH_HAS_BX)
+ 	ldr	r1, [sp]
+ 	bl	2f	@ blx r1
+ #else
+-- 
+2.6.4
+
diff --git a/package/uclibc/0002-arm-remove-USE_BX-option.patch b/package/uclibc/0002-arm-remove-USE_BX-option.patch
new file mode 100644
index 0000000..12abb42
--- /dev/null
+++ b/package/uclibc/0002-arm-remove-USE_BX-option.patch
@@ -0,0 +1,40 @@
+From b18d26fe870cbe95bb9c9fe43767d8688bad9596 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 17 Mar 2016 22:41:44 +0100
+Subject: [PATCH] arm: remove USE_BX option
+
+Now that __USE_BX__ is no longer used anywhere, we can get rid of the
+configuration option.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ extra/Configs/Config.arm | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
+index 00cf982..6090ead 100644
+--- a/extra/Configs/Config.arm
++++ b/extra/Configs/Config.arm
+@@ -27,19 +27,11 @@ config CONFIG_ARM_EABI
+ 
+ config COMPILE_IN_THUMB_MODE
+ 	bool "Build using Thumb mode"
+-	select USE_BX
+ 	select USE_LDREXSTREX
+ 	help
+ 	  Say 'y' here to force building uClibc in thumb mode.
+ 	  Say 'n' to use your compiler's default mode.
+ 
+-config USE_BX
+-	bool "Use BX in function return"
+-	help
+-	  Say 'y' to use BX to return from functions on your thumb-aware
+-	  processor. Say 'y' if you need to use interworking. Say 'n' if not.
+-	  It is safe to say 'y' even if you're not doing interworking.
+-
+ config USE_LDREXSTREX
+ 	bool "Use load-store exclusive ASM ops (not supported in SmartFusion)"
+ 	depends on COMPILE_IN_THUMB_MODE
+-- 
+2.6.4
+
diff --git a/package/uclibc/0003-arm-remove-use-of-USE_LDREXSTREX.patch b/package/uclibc/0003-arm-remove-use-of-USE_LDREXSTREX.patch
new file mode 100644
index 0000000..a668ecd
--- /dev/null
+++ b/package/uclibc/0003-arm-remove-use-of-USE_LDREXSTREX.patch
@@ -0,0 +1,49 @@
+From 45d2eadc3ff8234ed09fe1870dd7ed4144223ecd Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 17 Mar 2016 22:45:23 +0100
+Subject: [PATCH] arm: remove use of USE_LDREXSTREX
+
+Whenever Thumb2 is available, ldrex/strex are available, so we can
+simply rely on __thumb2__ to determine whether ldrex/strex should be
+used, without requiring a Config.in option.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
+index 2b877f9..fc17e9b 100644
+--- a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
++++ b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h
+@@ -28,8 +28,7 @@
+ # define PT_EI __extern_always_inline
+ #endif
+ 
+-#if defined(__thumb__)
+-#if defined(__USE_LDREXSTREX__)
++#if defined(__thumb2__)
+ PT_EI long int ldrex(int *spinlock)
+ {
+ 	long int ret;
+@@ -63,7 +62,7 @@ testandset (int *spinlock)
+   return ret;
+ }
+ 
+-#else /* __USE_LDREXSTREX__ */
++#elif defined(__thumb__)
+ 
+ /* This will not work on ARM1 or ARM2 because SWP is lacking on those
+    machines.  Unfortunately we have no way to detect this at compile
+@@ -88,7 +87,7 @@ PT_EI long int testandset (int *spinlock)
+ 	: "0"(1), "r"(spinlock));
+   return ret;
+ }
+-#endif
++
+ #else /* __thumb__ */
+ 
+ PT_EI long int testandset (int *spinlock);
+-- 
+2.6.4
+
diff --git a/package/uclibc/0004-arm-remove-USE_LDREXSTREX.patch b/package/uclibc/0004-arm-remove-USE_LDREXSTREX.patch
new file mode 100644
index 0000000..30cf420
--- /dev/null
+++ b/package/uclibc/0004-arm-remove-USE_LDREXSTREX.patch
@@ -0,0 +1,34 @@
+From 14628e02c40df1229c242270e0e2794f30aeed80 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 17 Mar 2016 22:46:36 +0100
+Subject: [PATCH] arm: remove USE_LDREXSTREX
+
+The USE_LDREXSTREX option is no longer needed, get rid of it.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ extra/Configs/Config.arm | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
+index 6090ead..0825c42 100644
+--- a/extra/Configs/Config.arm
++++ b/extra/Configs/Config.arm
+@@ -27,14 +27,6 @@ config CONFIG_ARM_EABI
+ 
+ config COMPILE_IN_THUMB_MODE
+ 	bool "Build using Thumb mode"
+-	select USE_LDREXSTREX
+ 	help
+ 	  Say 'y' here to force building uClibc in thumb mode.
+ 	  Say 'n' to use your compiler's default mode.
+-
+-config USE_LDREXSTREX
+-	bool "Use load-store exclusive ASM ops (not supported in SmartFusion)"
+-	depends on COMPILE_IN_THUMB_MODE
+-	default n
+-	help
+-	  Say 'y' to use LDREX/STREX ASM ops.
+-- 
+2.6.4
+
diff --git a/package/uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch b/package/uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch
new file mode 100644
index 0000000..46d29bb
--- /dev/null
+++ b/package/uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch
@@ -0,0 +1,43 @@
+From 021e407a5ef7d75f62bde70178606b530720d513 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 17 Mar 2016 22:47:16 +0100
+Subject: [PATCH] arm: remove COMPILE_IN_THUMB
+
+One just need to pass the appropriate -mthumb gcc flag, like you
+anyway need to do to build for the proper ARM variant.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ Rules.mak                | 1 -
+ extra/Configs/Config.arm | 6 ------
+ 2 files changed, 7 deletions(-)
+
+diff --git a/Rules.mak b/Rules.mak
+index b1cecec..0ae3bb1 100644
+--- a/Rules.mak
++++ b/Rules.mak
+@@ -392,7 +392,6 @@ endif
+ ifeq ($(TARGET_ARCH),arm)
+ 	CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN)+=-mlittle-endian
+ 	CPU_CFLAGS-$(ARCH_BIG_ENDIAN)+=-mbig-endian
+-	CPU_CFLAGS-$(COMPILE_IN_THUMB_MODE)+=-mthumb
+ endif
+ 
+ ifeq ($(TARGET_ARCH),metag)
+diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
+index 0825c42..0d02e3f 100644
+--- a/extra/Configs/Config.arm
++++ b/extra/Configs/Config.arm
+@@ -24,9 +24,3 @@ config CONFIG_ARM_EABI
+ 
+ 	  If you say 'n' here, then the library will be built for the
+ 	  old Linux ABI.
+-
+-config COMPILE_IN_THUMB_MODE
+-	bool "Build using Thumb mode"
+-	help
+-	  Say 'y' here to force building uClibc in thumb mode.
+-	  Say 'n' to use your compiler's default mode.
+-- 
+2.6.4
+
-- 
2.6.4

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

* [Buildroot] [PATCH v2 05/17] uclibc: remove USE_BX handling
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 04/17] uclibc: add patches to simplify Thumb handling Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-19 15:47   ` Arnout Vandecappelle
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 06/17] uclibc: gcc >= 4.9 can build a thumb/thread uclibc Thomas Petazzoni
                   ` (16 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

Now that uClibc is capable of figuring out by itself whether 'bx' can
be used or not, we can simplify the logic in Buildroot.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/uclibc/Config.in |  5 -----
 package/uclibc/uclibc.mk | 11 -----------
 2 files changed, 16 deletions(-)

diff --git a/package/uclibc/Config.in b/package/uclibc/Config.in
index 16bf89c..e722908 100644
--- a/package/uclibc/Config.in
+++ b/package/uclibc/Config.in
@@ -139,11 +139,6 @@ config BR2_UCLIBC_ARC_TYPE
 	default "ARC_CPU_700"	if BR2_arc770d
 	default "ARC_CPU_HS"	if BR2_archs38
 
-config BR2_UCLIBC_ARM_BX
-	bool
-	depends on BR2_UCLIBC_TARGET_ARCH = "arm"
-	default y if (BR2_ARM_CPU_HAS_THUMB || BR2_ARM_CPU_HAS_THUMB2)
-
 config BR2_UCLIBC_MIPS_ABI
 	string
 	depends on BR2_UCLIBC_TARGET_ARCH = "mips"
diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index 88a4a8c..c981d80 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -80,16 +80,6 @@ ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
 UCLIBC_EXTRA_CFLAGS += -marm
 endif
 
-ifeq ($(BR2_UCLIBC_ARM_BX),y)
-define UCLIBC_ARM_BX_CONFIG
-	$(call KCONFIG_ENABLE_OPT,USE_BX,$(@D)/.config)
-endef
-else
-define UCLIBC_ARM_BX_CONFIG
-	$(call KCONFIG_DISABLE_OPT,USE_BX,$(@D)/.config)
-endef
-endif
-
 endif # arm
 
 #
@@ -362,7 +352,6 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
 	$(UCLIBC_ARC_TYPE_CONFIG)
 	$(UCLIBC_ARC_PAGE_SIZE_CONFIG)
 	$(UCLIBC_ARM_ABI_CONFIG)
-	$(UCLIBC_ARM_BX_CONFIG)
 	$(UCLIBC_MIPS_ABI_CONFIG)
 	$(UCLIBC_MIPS_ISA_CONFIG)
 	$(UCLIBC_SH_TYPE_CONFIG)
-- 
2.6.4

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

* [Buildroot] [PATCH v2 06/17] uclibc: gcc >= 4.9 can build a thumb/thread uclibc
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (4 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 05/17] uclibc: remove USE_BX handling Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-19 15:53   ` Arnout Vandecappelle
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT Thomas Petazzoni
                   ` (15 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

Older gcc were not capable of building a uClibc library, with threads
enabled, in Thumb1. However, the issues have been fixed since gcc 4.9,
so this commit narrows down the condition to just gcc 4.7 and 4.8.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/uclibc/uclibc.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index c981d80..ad94494 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -75,8 +75,10 @@ define UCLIBC_ARM_ABI_CONFIG
 	$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_EABI,$(@D)/.config)
 endef
 
-# Thumb build is broken with threads, build in ARM mode
-ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
+# Thumb1 build is broken with threads with old gcc versions (4.7 and
+# 4.8). Since all cores supporting Thumb1 also support ARM, we use ARM
+# code in this case.
+ifeq ($(BR2_GCC_VERSION_4_7_X)$(BR2_GCC_VERSION_4_8_X):$(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),y:yy)
 UCLIBC_EXTRA_CFLAGS += -marm
 endif
 
-- 
2.6.4

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

* [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (5 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 06/17] uclibc: gcc >= 4.9 can build a thumb/thread uclibc Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-19 16:11   ` Arnout Vandecappelle
  2016-03-19 19:27   ` Ezequiel Garcia
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 08/17] uclibc: context functions are not Thumb-compatible Thomas Petazzoni
                   ` (14 subsequent siblings)
  21 siblings, 2 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

As explained by Waldemar, enabling DOPIC in uClibc will lead to the
creation of a Position Independent library. In turn, this will cause
elf2flt to generate a "Has-PIC-GOT" flat binary, which doesn't work on
ARM. In fact, elf2flt on ARM really expect to have non-PIC code as
input, so we must disable DOPIC in the uClibc configuration.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/uclibc/uclibc.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index ad94494..e3e45f7 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -82,6 +82,12 @@ ifeq ($(BR2_GCC_VERSION_4_7_X)$(BR2_GCC_VERSION_4_8_X):$(BR2_ARM_INSTRUCTIONS_TH
 UCLIBC_EXTRA_CFLAGS += -marm
 endif
 
+ifeq ($(BR2_BINFMT_FLAT),y)
+define UCLIBC_ARM_BINFMT_FLAT
+	$(call KCONFIG_DISABLE_OPT,DOPIC,$(@D)/.config)
+endef
+endif
+
 endif # arm
 
 #
@@ -354,6 +360,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
 	$(UCLIBC_ARC_TYPE_CONFIG)
 	$(UCLIBC_ARC_PAGE_SIZE_CONFIG)
 	$(UCLIBC_ARM_ABI_CONFIG)
+	$(UCLIBC_ARM_BINFMT_FLAT)
 	$(UCLIBC_MIPS_ABI_CONFIG)
 	$(UCLIBC_MIPS_ISA_CONFIG)
 	$(UCLIBC_SH_TYPE_CONFIG)
-- 
2.6.4

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

* [Buildroot] [PATCH v2 08/17] uclibc: context functions are not Thumb-compatible
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (6 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-19 16:20   ` Arnout Vandecappelle
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 09/17] uclibc: NPTL thread implementation only available on MMU platforms Thomas Petazzoni
                   ` (13 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

On Thumb1 platforms and Thumb2 platforms that support the ARM
instructions set, there is no problem, as the context functions are
built unconditionally in ARM mode.

However, on Thumb2 platforms that only support the Thumb2 instruction
set, the context functions cannot build as the assembler code is not
Thumb-ready. Therefore, those functions must be disabled.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/uclibc/uclibc.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
index e3e45f7..4698132 100644
--- a/package/uclibc/uclibc.mk
+++ b/package/uclibc/uclibc.mk
@@ -88,6 +88,12 @@ define UCLIBC_ARM_BINFMT_FLAT
 endef
 endif
 
+ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB2):$(BR2_ARM_CPU_HAS_ARM),y:)
+define UCLIBC_ARM_NO_CONTEXT_FUNCS
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_CONTEXT_FUNCS,$(@D)/.config)
+endef
+endif
+
 endif # arm
 
 #
@@ -361,6 +367,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
 	$(UCLIBC_ARC_PAGE_SIZE_CONFIG)
 	$(UCLIBC_ARM_ABI_CONFIG)
 	$(UCLIBC_ARM_BINFMT_FLAT)
+	$(UCLIBC_ARM_NO_CONTEXT_FUNCS)
 	$(UCLIBC_MIPS_ABI_CONFIG)
 	$(UCLIBC_MIPS_ISA_CONFIG)
 	$(UCLIBC_SH_TYPE_CONFIG)
-- 
2.6.4

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

* [Buildroot] [PATCH v2 09/17] uclibc: NPTL thread implementation only available on MMU platforms
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (7 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 08/17] uclibc: context functions are not Thumb-compatible Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 10/17] musl: build broken on Thumb, use ARM mode Thomas Petazzoni
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

As indicated by the uClibc-ng source code, the NPTL thread
implementation is only available on MMU platforms, so we replicate
this dependency in Buildroot so that the appropriate thread
implementation is chosen by default on ARM noMMU.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/uclibc/Config.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/uclibc/Config.in b/package/uclibc/Config.in
index e722908..1448037 100644
--- a/package/uclibc/Config.in
+++ b/package/uclibc/Config.in
@@ -48,6 +48,7 @@ config BR2_TOOLCHAIN_BUILDROOT_LOCALE
 choice
 	prompt "Thread library implementation"
 	default BR2_PTHREADS_NATIVE
+	default BR2_PTHREADS_OLD if !BR2_USE_MMU
 	help
 	  Use this option to select the thread library implementation
 	  that should be used in your toolchain.
@@ -69,6 +70,7 @@ choice
 		bool "Native POSIX Threading (NPTL)"
 		select BR2_TOOLCHAIN_HAS_THREADS
 		select BR2_TOOLCHAIN_HAS_THREADS_NPTL
+		depends on BR2_USE_MMU
 		depends on !BR2_m68k && !BR2_x86_i386
 endchoice
 
-- 
2.6.4

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

* [Buildroot] [PATCH v2 10/17] musl: build broken on Thumb, use ARM mode
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (8 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 09/17] uclibc: NPTL thread implementation only available on MMU platforms Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 11/17] toolchain-buildroot: update glibc comment for noMMU Thomas Petazzoni
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

Building the musl C library on Thumb (Thumb1, not Thumb2), fails with:

 {standard input}:20: Error: only lo regs allowed with immediate -- `mov fp,#0'
 {standard input}:21: Error: only lo regs allowed with immediate -- `mov lr,#0'
 {standard input}:25: Error: unshifted register required -- `and ip,a1,#-16'

Since there are no cores that we support that are Thumb1 only, use the
same solution as the one used by glibc: build the C library in ARM
mode.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/musl/musl.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/musl/musl.mk b/package/musl/musl.mk
index 081a700..733f940 100644
--- a/package/musl/musl.mk
+++ b/package/musl/musl.mk
@@ -23,6 +23,12 @@ MUSL_ADD_TOOLCHAIN_DEPENDENCY = NO
 
 MUSL_INSTALL_STAGING = YES
 
+# Thumb build is broken, build in ARM mode, since all architectures
+# that support Thumb1 also support ARM.
+ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
+MUSL_EXTRA_CFLAGS += -marm
+endif
+
 define MUSL_CONFIGURE_CMDS
 	(cd $(@D); \
 		$(TARGET_CONFIGURE_OPTS) \
-- 
2.6.4

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

* [Buildroot] [PATCH v2 11/17] toolchain-buildroot: update glibc comment for noMMU
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (9 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 10/17] musl: build broken on Thumb, use ARM mode Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 12/17] toolchain-buildroot: don't show musl on noMMU platforms Thomas Petazzoni
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

glibc is not available for noMMU platforms, so it doesn't make sense
to show the comment about glibc requiring dynamic libraries on noMMU
platforms.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/toolchain-buildroot/Config.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
index cb4fc18..ea290eb 100644
--- a/toolchain/toolchain-buildroot/Config.in
+++ b/toolchain/toolchain-buildroot/Config.in
@@ -83,6 +83,7 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 	  http://www.gnu.org/software/libc/
 
 comment "(e)glibc only available with shared lib support"
+	depends on BR2_USE_MMU
 	depends on BR2_STATIC_LIBS
 
 config BR2_TOOLCHAIN_BUILDROOT_MUSL
-- 
2.6.4

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

* [Buildroot] [PATCH v2 12/17] toolchain-buildroot: don't show musl on noMMU platforms
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (10 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 11/17] toolchain-buildroot: update glibc comment for noMMU Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 13/17] package/Makefile.in: adjust LDFLAGS for elf2flt Thomas Petazzoni
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

While musl has recently gained noMMU support for the sh2 platform, we
don't support this yet. So for the time being, let's not show musl as
an available C library on noMMU platforms. This is for example
important on ARM noMMU: ARM is supported by musl, but not its noMMU
variants.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/toolchain-buildroot/Config.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
index ea290eb..0c40801 100644
--- a/toolchain/toolchain-buildroot/Config.in
+++ b/toolchain/toolchain-buildroot/Config.in
@@ -94,6 +94,9 @@ config BR2_TOOLCHAIN_BUILDROOT_MUSL
 	depends on !BR2_powerpc_SPE # not supported, build breaks
 	# Unsupported for MIPS R6
 	depends on !BR2_mips_32r6 && !BR2_mips_64r6
+	# sh2 nommu is supported by musl, but we don't have support
+	# for it in Buildroot.
+	depends on BR2_USE_MMU
 	select BR2_TOOLCHAIN_USES_MUSL
 	help
 	  This option selects musl as the C library for the
-- 
2.6.4

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

* [Buildroot] [PATCH v2 13/17] package/Makefile.in: adjust LDFLAGS for elf2flt
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (11 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 12/17] toolchain-buildroot: don't show musl on noMMU platforms Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 14/17] elf2flt: use new upstream site and add ARM patch Thomas Petazzoni
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

So far, our LDFLAGS for the BR2_BINFMT_FLAT case were only used on
Blackfin. However, passing -elf2flt in LDFLAGS is wrong. Indeed,
LDFLAGS are not linker flags, but flags passed to the compiler when
linking.

If you pass -elf2flt to the compiler when linking, it is understood as
"-e lf2flt", i.e "the entry point is named lf2flt", which isn't
exactly the intention. We in fact need to pass -Wl,-elf2flt in LDFLAGS
as well, so that the compiler passes -elf2flt down to the linker.

For some reason, this option does not cause an issue with the Blackfin
toolchain, but it does with either a Buildroot toolchain for Cortex-M
or an OSELAS toolchain for Cortex-M. We have verified that passing
-Wl,-elf2flt continues to work with the Blackfin toolchain.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index dd595e2..616bdd0 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -145,7 +145,7 @@ TARGET_CFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FL
 	-Wl$(comma)-elf2flt)
 TARGET_CXXFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
 	-Wl$(comma)-elf2flt)
-TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),-elf2flt)
+TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt)
 endif
 
 ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
-- 
2.6.4

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

* [Buildroot] [PATCH v2 14/17] elf2flt: use new upstream site and add ARM patch
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (12 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 13/17] package/Makefile.in: adjust LDFLAGS for elf2flt Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 21:34   ` Ezequiel Garcia
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 15/17] afboot-stm32: use the Buildroot toolchain Thomas Petazzoni
                   ` (7 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

The uClinux developers now have a Github with elf2flt code, with an
upstream that is again active. Let's switch to this upstream, to which
Waldemar is contributing as well.

We also add an ARM patch from Waldemar that is needed to make ARM FLAT
binaries work properly. Since this commit was on the previously used
upstream, we add it together with the change of upstream location to
keep the same functionality level.

Since we're now fetching from github, a hash file is added as well.

Finally, we disable -Werror to avoid build issues caused by warnings.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../0001-allow-to-build-arm-flat-binaries.patch    | 123 +++++++++++++++++++++
 package/elf2flt/elf2flt.hash                       |   2 +
 package/elf2flt/elf2flt.mk                         |   8 +-
 3 files changed, 129 insertions(+), 4 deletions(-)
 create mode 100644 package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
 create mode 100644 package/elf2flt/elf2flt.hash

diff --git a/package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch b/package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
new file mode 100644
index 0000000..a6c63c5
--- /dev/null
+++ b/package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
@@ -0,0 +1,123 @@
+From 56b082412c6f49d21f5e54831a40d1e7c45b3ee4 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Sat, 12 Mar 2016 22:09:30 +0100
+Subject: [PATCH] allow to build arm flat binaries
+
+Add patchset from ptxdist which is required to produce working
+ARM flat binaries. Tested with busybox on Kinetis K70.
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ elf2flt.c     | 19 ++++++++++++-------
+ elf2flt.ld.in | 17 ++++++++++++++---
+ 2 files changed, 26 insertions(+), 10 deletions(-)
+
+diff --git a/elf2flt.c b/elf2flt.c
+index fcd797c..c6978e1 100644
+--- a/elf2flt.c
++++ b/elf2flt.c
+@@ -56,6 +56,8 @@ const char *elf2flt_progname;
+ 
+ #if defined(TARGET_h8300)
+ #include <elf/h8.h>      /* TARGET_* ELF support for the BFD library            */
++#elif defined(TARGET_arm)
++#include <elf/arm.h>
+ #elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(TARGET_nios) || defined(TARGET_nios2)
+ #include "cygwin-elf.h"	/* Cygwin uses a local copy */
+ #elif defined(TARGET_xtensa)
+@@ -646,16 +648,23 @@ dump_symbols(symbols, number_of_symbols);
+ 				default:
+ 					goto good_32bit_resolved_reloc;
+ #elif defined(TARGET_arm)
++				case R_ARM_TARGET1:
++				case R_ARM_TARGET2:
+ 				case R_ARM_ABS32:
+ 					relocation_needed = 1;
+ 					break;
+ 				case R_ARM_REL32:
++				case R_ARM_JUMP24:
++				case R_ARM_CALL:
+ 				case R_ARM_THM_PC11:
+ 				case R_ARM_THM_PC22:
++				case R_ARM_THM_JUMP24:
+ 				case R_ARM_PC24:
+ 				case R_ARM_PLT32:
+ 				case R_ARM_GOTPC:
+ 				case R_ARM_GOT32:
++				case R_ARM_PREL31:
++				case R_ARM_NONE:
+ 					relocation_needed = 0;
+ 					break;
+ 				default:
+@@ -871,9 +880,7 @@ dump_symbols(symbols, number_of_symbols);
+ 					relocation_needed = 1;
+ 					if (verbose)
+ 						fprintf(stderr,
+-							"%s vma=0x%x, "
+-							"value=0x%"BFD_VMA_FMT"x, "
+-							"address=0x%"BFD_VMA_FMT"x "
++							"%s vma=0x%x, value=0x%x, address=0x%x "
+ 							"sym_addr=0x%x rs=0x%x, opcode=0x%x\n",
+ 							"ABS32",
+ 							sym_vma, (*(q->sym_ptr_ptr))->value,
+@@ -890,9 +897,7 @@ dump_symbols(symbols, number_of_symbols);
+ 				case R_ARM_PLT32:
+ 					if (verbose)
+ 						fprintf(stderr,
+-							"%s vma=0x%x, "
+-							"value=0x%"BFD_VMA_FMT"x, "
+-							"address=0x%"BFD_VMA_FMT"x "
++							"%s vma=0x%x, value=0x%x, address=0x%x "
+ 							"sym_addr=0x%x rs=0x%x, opcode=0x%x\n",
+ 							"PLT32",
+ 							sym_vma, (*(q->sym_ptr_ptr))->value,
+@@ -1446,7 +1451,7 @@ DIS29_RELOCATION:
+ 				}
+ 			}
+ 
+-			sprintf(&addstr[0], "+0x%lx", sym_addr - (*(q->sym_ptr_ptr))->value -
++			sprintf(&addstr[0], "+0x%x", sym_addr - (*(q->sym_ptr_ptr))->value -
+ 					 bfd_section_vma(abs_bfd, sym_section));
+ 
+ 
+diff --git a/elf2flt.ld.in b/elf2flt.ld.in
+index bfda0ef..ec1fe6f 100644
+--- a/elf2flt.ld.in
++++ b/elf2flt.ld.in
+@@ -35,6 +35,8 @@ W_RODAT		*(.rodata1)
+ W_RODAT		*(.rodata.*)
+ W_RODAT		*(.gnu.linkonce.r*)
+ 
++		/* .ARM.extab name sections containing exception unwinding information */
++		*(.ARM.extab* .gnu.linkonce.armextab.*)
+ 		/* This is special code area at the end of the normal
+ 		   text section.  It contains a small lookup table at
+ 		   the start followed by the code pointed to by entries
+@@ -43,11 +45,20 @@ W_RODAT		*(.gnu.linkonce.r*)
+ 		PROVIDE(@SYMBOL_PREFIX at __ctbp = .);
+ 		*(.call_table_data)
+ 		*(.call_table_text)
+-
+-		. = ALIGN(0x20) ;
+-		@SYMBOL_PREFIX at _etext = . ;
+ 	} > flatmem :text
+ 
++	/* .ARM.exidx name sections containing index entries for section unwinding */
++	/* .ARM.exidx is sorted, so has to go in its own output section.  */
++	@SYMBOL_PREFIX at __exidx_start = .;
++	.ARM.exidx :
++	{
++		*(.ARM.exidx* .gnu.linkonce.armexidx.*)
++	} > flatmem
++	@SYMBOL_PREFIX at __exidx_end = .;
++
++	. = ALIGN(0x20) ;
++	@SYMBOL_PREFIX at _etext = . ;
++
+ 	.data : {
+ 		. = ALIGN(0x4) ;
+ 		@SYMBOL_PREFIX at _sdata = . ;
+-- 
+2.6.4
+
diff --git a/package/elf2flt/elf2flt.hash b/package/elf2flt/elf2flt.hash
new file mode 100644
index 0000000..c5e71db
--- /dev/null
+++ b/package/elf2flt/elf2flt.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256sum a21a7f7035750bc63bc679777f01c6adc77ac20d2b0dbad4419981ebd22c1492	elf2flt-177ec2701aba30270ec1260746b8db5442c77ef4.tar.gz
diff --git a/package/elf2flt/elf2flt.mk b/package/elf2flt/elf2flt.mk
index bec270b..eb0baad 100644
--- a/package/elf2flt/elf2flt.mk
+++ b/package/elf2flt/elf2flt.mk
@@ -4,9 +4,8 @@
 #
 ################################################################################
 
-ELF2FLT_VERSION = f859213b18a67fcfc09961267e0a1122d35186f4
-ELF2FLT_SITE = http://cgit.openadk.org/cgi/cgit/elf2flt.git
-ELF2FLT_SITE_METHOD = git
+ELF2FLT_VERSION = 177ec2701aba30270ec1260746b8db5442c77ef4
+ELF2FLT_SITE = $(call github,uclinux-dev,elf2flt,$(ELF2FLT_VERSION))
 ELF2FLT_LICENSE = GPLv2+
 ELF2FLT_LICENSE_FILES = LICENSE.TXT
 
@@ -19,7 +18,8 @@ HOST_ELF2FLT_CONF_OPTS = \
 	--with-binutils-include-dir=$(HOST_BINUTILS_DIR)/include/ \
 	--with-libbfd=$(HOST_BINUTILS_DIR)/bfd/libbfd.a \
 	--with-libiberty=$(HOST_BINUTILS_DIR)/libiberty/libiberty.a \
-	--target=$(GNU_TARGET_NAME)
+	--target=$(GNU_TARGET_NAME) \
+	--disable-werror
 
 HOST_ELF2FLT_LIBS = -lz
 
-- 
2.6.4

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

* [Buildroot] [PATCH v2 15/17] afboot-stm32: use the Buildroot toolchain
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (13 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 14/17] elf2flt: use new upstream site and add ARM patch Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 16/17] configs/stm32f429_disco: new configuration for STM32F429 Discovery board Thomas Petazzoni
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

By default, the afboot-stm32 Makefile uses "CROSS_COMPILE =
arm-none-eabi-". Since I had such a toolchain installed on my system
when testing afboot-stm32, I didn't realize it wasn't using the
Buildroot toolchain.

However, using the Buildroot toolchain doesn't immediately works for
FLAT toolchains, as gcc automatically wants to create a FLAT
binary. So we need to adjust the afboot-stm32 Makefile to use directly
'ld' and not 'gcc' when linking.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../0001-Use-ld-instead-of-gcc-for-linking.patch   | 61 ++++++++++++++++++++++
 boot/afboot-stm32/afboot-stm32.mk                  |  2 +-
 2 files changed, 62 insertions(+), 1 deletion(-)
 create mode 100644 boot/afboot-stm32/0001-Use-ld-instead-of-gcc-for-linking.patch

diff --git a/boot/afboot-stm32/0001-Use-ld-instead-of-gcc-for-linking.patch b/boot/afboot-stm32/0001-Use-ld-instead-of-gcc-for-linking.patch
new file mode 100644
index 0000000..3f359dc
--- /dev/null
+++ b/boot/afboot-stm32/0001-Use-ld-instead-of-gcc-for-linking.patch
@@ -0,0 +1,61 @@
+From 0d581abe6620ac69adec321b94390e009802f36a Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sun, 13 Mar 2016 14:32:33 +0100
+Subject: [PATCH] Use ld instead of gcc for linking
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ Makefile | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index ce40314..271bb4f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,7 @@
+ CROSS_COMPILE ?= arm-none-eabi-
+ 
+ CC = $(CROSS_COMPILE)gcc
++LD = $(CROSS_COMPILE)ld
+ OBJCOPY = $(CROSS_COMPILE)objcopy
+ OBJDUMP = $(CROSS_COMPILE)objdump
+ SIZE = $(CROSS_COMPILE)size
+@@ -10,7 +11,7 @@ OPENOCD = openocd
+ CFLAGS := -mthumb -mcpu=cortex-m4
+ CFLAGS += -ffunction-sections -fdata-sections
+ CFLAGS += -Os -std=gnu99 -Wall
+-LDFLAGS := -nostartfiles -Wl,--gc-sections
++LINKERFLAGS := -nostartfiles --gc-sections
+ 
+ obj-y += gpio.o mpu.o
+ obj-f4 += $(obj-y) usart-f4.o
+@@ -22,22 +23,22 @@ all: stm32f429i-disco stm32429i-eval stm32f469i-disco stm32746g-eval
+ 	$(CC) -c $(CFLAGS) $< -o $@
+ 
+ stm32f429i-disco: stm32f429i-disco.o $(obj-f4)
+-	$(CC) -T stm32f429.lds $(LDFLAGS) -o stm32f429i-disco.elf stm32f429i-disco.o $(obj-f4)
++	$(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32f429i-disco.elf stm32f429i-disco.o $(obj-f4)
+ 	$(OBJCOPY) -Obinary stm32f429i-disco.elf stm32f429i-disco.bin
+ 	$(SIZE) stm32f429i-disco.elf
+ 
+ stm32429i-eval: stm32429i-eval.o $(obj-f4)
+-	$(CC) -T stm32f429.lds $(LDFLAGS) -o stm32429i-eval.elf stm32429i-eval.o $(obj-f4)
++	$(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32429i-eval.elf stm32429i-eval.o $(obj-f4)
+ 	$(OBJCOPY) -Obinary stm32429i-eval.elf stm32429i-eval.bin
+ 	$(SIZE) stm32429i-eval.elf
+ 
+ stm32f469i-disco: stm32f469i-disco.o $(obj-f4)
+-	$(CC) -T stm32f429.lds $(LDFLAGS) -o stm32f469i-disco.elf stm32f469i-disco.o $(obj-f4)
++	$(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32f469i-disco.elf stm32f469i-disco.o $(obj-f4)
+ 	$(OBJCOPY) -Obinary stm32f469i-disco.elf stm32f469i-disco.bin
+ 	$(SIZE) stm32f469i-disco.elf
+ 
+ stm32746g-eval: stm32746g-eval.o $(obj-f7)
+-	$(CC) -T stm32f429.lds $(LDFLAGS) -o stm32746g-eval.elf stm32746g-eval.o $(obj-f7)
++	$(LD) -T stm32f429.lds $(LINKERFLAGS) -o stm32746g-eval.elf stm32746g-eval.o $(obj-f7)
+ 	$(OBJCOPY) -Obinary stm32746g-eval.elf stm32746g-eval.bin
+ 	$(SIZE) stm32746g-eval.elf
+ 
+-- 
+2.6.4
+
diff --git a/boot/afboot-stm32/afboot-stm32.mk b/boot/afboot-stm32/afboot-stm32.mk
index ac85d58..042b21f 100644
--- a/boot/afboot-stm32/afboot-stm32.mk
+++ b/boot/afboot-stm32/afboot-stm32.mk
@@ -8,7 +8,7 @@ AFBOOT_STM32_VERSION = v0.1
 AFBOOT_STM32_SITE = $(call github,mcoquelin-stm32,afboot-stm32,$(AFBOOT_STM32_VERSION))
 
 define AFBOOT_STM32_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) all
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CROSS_COMPILE=$(TARGET_CROSS) all
 endef
 
 define AFBOOT_STM32_INSTALL_TARGET_CMDS
-- 
2.6.4

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

* [Buildroot] [PATCH v2 16/17] configs/stm32f429_disco: new configuration for STM32F429 Discovery board
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (14 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 15/17] afboot-stm32: use the Buildroot toolchain Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-21  9:48   ` Lee Jones
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 17/17] configs/stm32f469_disco: new configuration for STM32F469 " Thomas Petazzoni
                   ` (5 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

From: Lee Jones <lee.jones@linaro.org>

This commit adds a defconfig for the STM32F429 platform, which is
based on a Cortex-M4 core from ST Microelectronics. It is therefore
the first noMMU ARM platform supported in Buildroot.

This commit includes some files that will be common to several STM32
platforms (hence in board/stmicroelectronics) and some files that are
specific to the STM32F429 (hence in
board/stmicroelectronics/stm32f429-disco). More specifically, this
commit adds:

 - A minimal Busybox configuration, which is small enough to boot
   without causing OOM on such small noMMU platforms. The resulting
   Busybox, statically linked with uClibc-ng, weights around 220
   KB. For now, this file is located in board/stmicroelectronics/, but
   we might consider moving it to package/busybox/ in the future if
   needed.

 - A post-build script that removes the mounting of /dev/pts (not
   enabled in the kernel and not very useful for a system that has no
   network and no X), and removes the network related init script and
   configuration files (no network support).

 - A flash.sh script, to perform the right OpenOCD invocations to
   reflash the board.

 - One small kernel patch to adjust the kernel command line in the
   Device Tree, since it's the only way to do so.

 - The usual readme.txt file.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
[Thomas:
 - squashed multiple patches from Lee Jones together
 - added the minimal Busybox configuration
 - added the post-build script
 - improved the flashing script to not hardcode the location of the
   output directory
 - add the small kernel patch
 - improve the readme.txt file
 - test on HW the resulting image, after using the internal toolchain.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 board/stmicroelectronics/busybox-minimal.config    | 1057 ++++++++++++++++++++
 board/stmicroelectronics/stm32-post-build.sh       |    8 +
 board/stmicroelectronics/stm32f429-disco/flash.sh  |   20 +
 ...49-disco-don-t-force-init-in-chosen-boota.patch |   32 +
 .../stmicroelectronics/stm32f429-disco/readme.txt  |   30 +
 configs/stm32f429_disco_defconfig                  |   18 +
 6 files changed, 1165 insertions(+)
 create mode 100644 board/stmicroelectronics/busybox-minimal.config
 create mode 100755 board/stmicroelectronics/stm32-post-build.sh
 create mode 100755 board/stmicroelectronics/stm32f429-disco/flash.sh
 create mode 100644 board/stmicroelectronics/stm32f429-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch
 create mode 100644 board/stmicroelectronics/stm32f429-disco/readme.txt
 create mode 100644 configs/stm32f429_disco_defconfig

diff --git a/board/stmicroelectronics/busybox-minimal.config b/board/stmicroelectronics/busybox-minimal.config
new file mode 100644
index 0000000..3261e5a
--- /dev/null
+++ b/board/stmicroelectronics/busybox-minimal.config
@@ -0,0 +1,1057 @@
+#
+# Automatically generated make config: don't edit
+# Busybox version: 1.24.1
+# Sat Mar 12 15:36:27 2016
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+
+#
+# General Configuration
+#
+# CONFIG_DESKTOP is not set
+# CONFIG_EXTRA_COMPAT is not set
+CONFIG_INCLUDE_SUSv2=y
+# CONFIG_USE_PORTABLE_CODE is not set
+CONFIG_PLATFORM_LINUX=y
+CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+# CONFIG_SHOW_USAGE is not set
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+# CONFIG_FEATURE_COMPRESS_USAGE is not set
+CONFIG_FEATURE_INSTALLER=y
+# CONFIG_INSTALL_NO_USR is not set
+# CONFIG_LOCALE_SUPPORT is not set
+# CONFIG_UNICODE_SUPPORT is not set
+# CONFIG_UNICODE_USING_LOCALE is not set
+# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
+CONFIG_SUBST_WCHAR=0
+CONFIG_LAST_SUPPORTED_WCHAR=0
+# CONFIG_UNICODE_COMBINING_WCHARS is not set
+# CONFIG_UNICODE_WIDE_WCHARS is not set
+# CONFIG_UNICODE_BIDI_SUPPORT is not set
+# CONFIG_UNICODE_NEUTRAL_TABLE is not set
+# CONFIG_UNICODE_PRESERVE_BROKEN is not set
+# CONFIG_PAM is not set
+CONFIG_FEATURE_USE_SENDFILE=y
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_DEVPTS=y
+CONFIG_FEATURE_CLEAN_UP=y
+CONFIG_FEATURE_UTMP=y
+CONFIG_FEATURE_WTMP=y
+# CONFIG_FEATURE_PIDFILE is not set
+CONFIG_PID_FILE_PATH=""
+CONFIG_FEATURE_SUID=y
+# CONFIG_FEATURE_SUID_CONFIG is not set
+# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_PREFER_APPLETS is not set
+CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
+CONFIG_FEATURE_SYSLOG=y
+# CONFIG_FEATURE_HAVE_RPC is not set
+
+#
+# Build Options
+#
+CONFIG_STATIC=y
+# CONFIG_PIE is not set
+CONFIG_NOMMU=y
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_INDIVIDUAL is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_LFS=y
+CONFIG_CROSS_COMPILER_PREFIX=""
+CONFIG_SYSROOT=""
+CONFIG_EXTRA_CFLAGS=""
+CONFIG_EXTRA_LDFLAGS=""
+CONFIG_EXTRA_LDLIBS=""
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_UNIT_TEST is not set
+# CONFIG_WERROR is not set
+CONFIG_NO_DEBUG_LIB=y
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+
+#
+# Installation Options ("make install" behavior)
+#
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
+# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
+# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
+CONFIG_PREFIX="./_install"
+
+#
+# Busybox Library Tuning
+#
+# CONFIG_FEATURE_SYSTEMD is not set
+CONFIG_FEATURE_RTMINMAX=y
+CONFIG_PASSWORD_MINLEN=6
+CONFIG_MD5_SMALL=1
+CONFIG_SHA3_SMALL=1
+# CONFIG_FEATURE_FAST_TOP is not set
+# CONFIG_FEATURE_ETC_NETWORKS is not set
+CONFIG_FEATURE_USE_TERMIOS=y
+CONFIG_FEATURE_EDITING=y
+CONFIG_FEATURE_EDITING_MAX_LEN=1024
+CONFIG_FEATURE_EDITING_VI=y
+CONFIG_FEATURE_EDITING_HISTORY=999
+CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
+CONFIG_FEATURE_REVERSE_SEARCH=y
+CONFIG_FEATURE_TAB_COMPLETION=y
+# CONFIG_FEATURE_USERNAME_COMPLETION is not set
+CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
+# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
+CONFIG_FEATURE_COPYBUF_KB=4
+CONFIG_FEATURE_SKIP_ROOTFS=y
+CONFIG_MONOTONIC_SYSCALL=y
+CONFIG_IOCTL_HEX2STR_ERROR=y
+CONFIG_FEATURE_HWIB=y
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+# CONFIG_FEATURE_SEAMLESS_XZ is not set
+# CONFIG_FEATURE_SEAMLESS_LZMA is not set
+# CONFIG_FEATURE_SEAMLESS_BZ2 is not set
+# CONFIG_FEATURE_SEAMLESS_GZ is not set
+# CONFIG_FEATURE_SEAMLESS_Z is not set
+# CONFIG_AR is not set
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+# CONFIG_FEATURE_AR_CREATE is not set
+# CONFIG_UNCOMPRESS is not set
+# CONFIG_GUNZIP is not set
+# CONFIG_BUNZIP2 is not set
+# CONFIG_UNLZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+# CONFIG_LZMA is not set
+# CONFIG_UNXZ is not set
+# CONFIG_XZ is not set
+# CONFIG_BZIP2 is not set
+# CONFIG_CPIO is not set
+# CONFIG_FEATURE_CPIO_O is not set
+# CONFIG_FEATURE_CPIO_P is not set
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
+# CONFIG_GZIP is not set
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+CONFIG_GZIP_FAST=0
+# CONFIG_FEATURE_GZIP_LEVELS is not set
+# CONFIG_LZOP is not set
+# CONFIG_LZOP_COMPR_HIGH is not set
+# CONFIG_RPM is not set
+# CONFIG_RPM2CPIO is not set
+# CONFIG_TAR is not set
+# CONFIG_FEATURE_TAR_CREATE is not set
+# CONFIG_FEATURE_TAR_AUTODETECT is not set
+# CONFIG_FEATURE_TAR_FROM is not set
+# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set
+# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
+# CONFIG_FEATURE_TAR_GNU_EXTENSIONS is not set
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+# CONFIG_FEATURE_TAR_TO_COMMAND is not set
+# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
+# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set
+# CONFIG_FEATURE_TAR_SELINUX is not set
+# CONFIG_UNZIP is not set
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+CONFIG_CAT=y
+CONFIG_DATE=y
+CONFIG_FEATURE_DATE_ISOFMT=y
+# CONFIG_FEATURE_DATE_NANO is not set
+CONFIG_FEATURE_DATE_COMPAT=y
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
+CONFIG_FEATURE_DD_IBS_OBS=y
+CONFIG_FEATURE_DD_STATUS=y
+CONFIG_HOSTID=y
+CONFIG_ID=y
+# CONFIG_GROUPS is not set
+# CONFIG_SHUF is not set
+CONFIG_SYNC=y
+# CONFIG_FEATURE_SYNC_FANCY is not set
+CONFIG_TEST=y
+CONFIG_FEATURE_TEST_64=y
+CONFIG_TOUCH=y
+# CONFIG_FEATURE_TOUCH_NODEREF is not set
+CONFIG_FEATURE_TOUCH_SUSV3=y
+CONFIG_TR=y
+CONFIG_FEATURE_TR_CLASSES=y
+CONFIG_FEATURE_TR_EQUIV=y
+CONFIG_TRUNCATE=y
+CONFIG_UNLINK=y
+# CONFIG_BASE64 is not set
+CONFIG_WHO=y
+# CONFIG_USERS is not set
+# CONFIG_CAL is not set
+CONFIG_CATV=y
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
+CONFIG_CHROOT=y
+CONFIG_CKSUM=y
+# CONFIG_COMM is not set
+CONFIG_CP=y
+# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
+CONFIG_CUT=y
+CONFIG_DF=y
+# CONFIG_FEATURE_DF_FANCY is not set
+CONFIG_DIRNAME=y
+CONFIG_DOS2UNIX=y
+CONFIG_UNIX2DOS=y
+CONFIG_DU=y
+CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+# CONFIG_FEATURE_ENV_LONG_OPTIONS is not set
+# CONFIG_EXPAND is not set
+# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
+CONFIG_EXPR=y
+CONFIG_EXPR_MATH_SUPPORT_64=y
+CONFIG_FALSE=y
+CONFIG_FOLD=y
+# CONFIG_FSYNC is not set
+CONFIG_HEAD=y
+CONFIG_FEATURE_FANCY_HEAD=y
+CONFIG_INSTALL=y
+CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y
+CONFIG_LN=y
+CONFIG_LOGNAME=y
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+CONFIG_FEATURE_LS_COLOR=y
+CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y
+CONFIG_MD5SUM=y
+CONFIG_MKDIR=y
+CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
+CONFIG_MKFIFO=y
+CONFIG_MKNOD=y
+CONFIG_MV=y
+CONFIG_FEATURE_MV_LONG_OPTIONS=y
+CONFIG_NICE=y
+CONFIG_NOHUP=y
+CONFIG_OD=y
+CONFIG_PRINTENV=y
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_REALPATH=y
+CONFIG_RM=y
+CONFIG_RMDIR=y
+# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
+CONFIG_SEQ=y
+CONFIG_SHA1SUM=y
+CONFIG_SHA256SUM=y
+CONFIG_SHA512SUM=y
+CONFIG_SHA3SUM=y
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+CONFIG_FEATURE_FLOAT_SLEEP=y
+CONFIG_SORT=y
+CONFIG_FEATURE_SORT_BIG=y
+# CONFIG_SPLIT is not set
+# CONFIG_FEATURE_SPLIT_FANCY is not set
+# CONFIG_STAT is not set
+# CONFIG_FEATURE_STAT_FORMAT is not set
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+# CONFIG_TAC is not set
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
+CONFIG_TRUE=y
+CONFIG_TTY=y
+CONFIG_UNAME=y
+CONFIG_UNAME_OSNAME="GNU/Linux"
+# CONFIG_UNEXPAND is not set
+# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
+CONFIG_UNIQ=y
+CONFIG_USLEEP=y
+CONFIG_UUDECODE=y
+CONFIG_UUENCODE=y
+CONFIG_WC=y
+# CONFIG_FEATURE_WC_LARGE is not set
+CONFIG_WHOAMI=y
+CONFIG_YES=y
+
+#
+# Common options
+#
+CONFIG_FEATURE_VERBOSE=y
+
+#
+# Common options for cp and mv
+#
+CONFIG_FEATURE_PRESERVE_HARDLINKS=y
+
+#
+# Common options for ls, more and telnet
+#
+CONFIG_FEATURE_AUTOWIDTH=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum
+#
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
+
+#
+# Console Utilities
+#
+# CONFIG_CHVT is not set
+# CONFIG_FGCONSOLE is not set
+# CONFIG_CLEAR is not set
+# CONFIG_DEALLOCVT is not set
+# CONFIG_DUMPKMAP is not set
+# CONFIG_KBD_MODE is not set
+# CONFIG_LOADFONT is not set
+# CONFIG_LOADKMAP is not set
+# CONFIG_OPENVT is not set
+# CONFIG_RESET is not set
+# CONFIG_RESIZE is not set
+# CONFIG_FEATURE_RESIZE_PRINT is not set
+# CONFIG_SETCONSOLE is not set
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETFONT is not set
+# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
+CONFIG_DEFAULT_SETFONT_DIR=""
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+# CONFIG_SHOWKEY is not set
+# CONFIG_FEATURE_LOADFONT_PSF2 is not set
+# CONFIG_FEATURE_LOADFONT_RAW is not set
+
+#
+# Debian Utilities
+#
+# CONFIG_MKTEMP is not set
+# CONFIG_PIPE_PROGRESS is not set
+# CONFIG_RUN_PARTS is not set
+# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
+# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+CONFIG_START_STOP_DAEMON=y
+CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
+CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
+CONFIG_WHICH=y
+
+#
+# Editors
+#
+# CONFIG_AWK is not set
+# CONFIG_FEATURE_AWK_LIBM is not set
+# CONFIG_FEATURE_AWK_GNU_EXTENSIONS is not set
+# CONFIG_CMP is not set
+# CONFIG_DIFF is not set
+# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
+# CONFIG_FEATURE_DIFF_DIR is not set
+# CONFIG_ED is not set
+# CONFIG_PATCH is not set
+# CONFIG_SED is not set
+# CONFIG_VI is not set
+CONFIG_FEATURE_VI_MAX_LEN=0
+# CONFIG_FEATURE_VI_8BIT is not set
+# CONFIG_FEATURE_VI_COLON is not set
+# CONFIG_FEATURE_VI_YANKMARK is not set
+# CONFIG_FEATURE_VI_SEARCH is not set
+# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+# CONFIG_FEATURE_VI_USE_SIGNALS is not set
+# CONFIG_FEATURE_VI_DOT_CMD is not set
+# CONFIG_FEATURE_VI_READONLY is not set
+# CONFIG_FEATURE_VI_SETOPTS is not set
+# CONFIG_FEATURE_VI_SET is not set
+# CONFIG_FEATURE_VI_WIN_RESIZE is not set
+# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
+# CONFIG_FEATURE_VI_UNDO is not set
+# CONFIG_FEATURE_VI_UNDO_QUEUE is not set
+CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=0
+# CONFIG_FEATURE_ALLOW_EXEC is not set
+
+#
+# Finding Utilities
+#
+# CONFIG_FIND is not set
+# CONFIG_FEATURE_FIND_PRINT0 is not set
+# CONFIG_FEATURE_FIND_MTIME is not set
+# CONFIG_FEATURE_FIND_MMIN is not set
+# CONFIG_FEATURE_FIND_PERM is not set
+# CONFIG_FEATURE_FIND_TYPE is not set
+# CONFIG_FEATURE_FIND_XDEV is not set
+# CONFIG_FEATURE_FIND_MAXDEPTH is not set
+# CONFIG_FEATURE_FIND_NEWER is not set
+# CONFIG_FEATURE_FIND_INUM is not set
+# CONFIG_FEATURE_FIND_EXEC is not set
+# CONFIG_FEATURE_FIND_EXEC_PLUS is not set
+# CONFIG_FEATURE_FIND_USER is not set
+# CONFIG_FEATURE_FIND_GROUP is not set
+# CONFIG_FEATURE_FIND_NOT is not set
+# CONFIG_FEATURE_FIND_DEPTH is not set
+# CONFIG_FEATURE_FIND_PAREN is not set
+# CONFIG_FEATURE_FIND_SIZE is not set
+# CONFIG_FEATURE_FIND_PRUNE is not set
+# CONFIG_FEATURE_FIND_DELETE is not set
+# CONFIG_FEATURE_FIND_PATH is not set
+# CONFIG_FEATURE_FIND_REGEX is not set
+# CONFIG_FEATURE_FIND_CONTEXT is not set
+# CONFIG_FEATURE_FIND_LINKS is not set
+CONFIG_GREP=y
+CONFIG_FEATURE_GREP_EGREP_ALIAS=y
+CONFIG_FEATURE_GREP_FGREP_ALIAS=y
+CONFIG_FEATURE_GREP_CONTEXT=y
+CONFIG_XARGS=y
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
+CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
+CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
+CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
+
+#
+# Init Utilities
+#
+# CONFIG_BOOTCHARTD is not set
+# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
+# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
+CONFIG_HALT=y
+# CONFIG_FEATURE_CALL_TELINIT is not set
+CONFIG_TELINIT_PATH=""
+CONFIG_INIT=y
+CONFIG_FEATURE_USE_INITTAB=y
+CONFIG_FEATURE_KILL_REMOVED=y
+CONFIG_FEATURE_KILL_DELAY=0
+CONFIG_FEATURE_INIT_SCTTY=y
+CONFIG_FEATURE_INIT_SYSLOG=y
+CONFIG_FEATURE_EXTRA_QUIET=y
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+CONFIG_FEATURE_INITRD=y
+CONFIG_INIT_TERMINAL_TYPE="linux"
+CONFIG_MESG=y
+CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_ADD_SHELL is not set
+# CONFIG_REMOVE_SHELL is not set
+CONFIG_FEATURE_SHADOWPASSWDS=y
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_USE_BB_SHADOW is not set
+CONFIG_USE_BB_CRYPT=y
+# CONFIG_USE_BB_CRYPT_SHA is not set
+CONFIG_ADDUSER=y
+# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
+# CONFIG_FEATURE_CHECK_NAMES is not set
+CONFIG_LAST_ID=60000
+CONFIG_FIRST_SYSTEM_ID=100
+CONFIG_LAST_SYSTEM_ID=999
+# CONFIG_ADDGROUP is not set
+# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
+# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
+# CONFIG_DELUSER is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
+CONFIG_GETTY=y
+CONFIG_LOGIN=y
+# CONFIG_LOGIN_SESSION_AS_CHILD is not set
+# CONFIG_LOGIN_SCRIPTS is not set
+CONFIG_FEATURE_NOLOGIN=y
+CONFIG_FEATURE_SECURETTY=y
+CONFIG_PASSWD=y
+CONFIG_FEATURE_PASSWD_WEAK_CHECK=y
+# CONFIG_CRYPTPW is not set
+# CONFIG_CHPASSWD is not set
+CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="des"
+# CONFIG_SU is not set
+# CONFIG_FEATURE_SU_SYSLOG is not set
+# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+# CONFIG_CHATTR is not set
+# CONFIG_FSCK is not set
+# CONFIG_LSATTR is not set
+# CONFIG_TUNE2FS is not set
+
+#
+# Linux Module Utilities
+#
+# CONFIG_MODINFO is not set
+# CONFIG_MODPROBE_SMALL is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
+# CONFIG_INSMOD is not set
+# CONFIG_RMMOD is not set
+# CONFIG_LSMOD is not set
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+# CONFIG_MODPROBE is not set
+# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+# CONFIG_DEPMOD is not set
+
+#
+# Options common to multiple modutils
+#
+# CONFIG_FEATURE_2_4_MODULES is not set
+# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
+# CONFIG_FEATURE_MODUTILS_ALIAS is not set
+# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
+CONFIG_DEFAULT_MODULES_DIR=""
+CONFIG_DEFAULT_DEPMOD_FILE=""
+
+#
+# Linux System Utilities
+#
+# CONFIG_BLOCKDEV is not set
+# CONFIG_FATATTR is not set
+# CONFIG_FSTRIM is not set
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_RENAME is not set
+# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+CONFIG_MOUNT=y
+# CONFIG_FEATURE_MOUNT_FAKE is not set
+# CONFIG_FEATURE_MOUNT_VERBOSE is not set
+# CONFIG_FEATURE_MOUNT_HELPERS is not set
+# CONFIG_FEATURE_MOUNT_LABEL is not set
+# CONFIG_FEATURE_MOUNT_NFS is not set
+CONFIG_FEATURE_MOUNT_CIFS=y
+CONFIG_FEATURE_MOUNT_FLAGS=y
+CONFIG_FEATURE_MOUNT_FSTAB=y
+CONFIG_FEATURE_MOUNT_OTHERTAB=y
+# CONFIG_REV is not set
+# CONFIG_UEVENT is not set
+# CONFIG_ACPID is not set
+# CONFIG_FEATURE_ACPID_COMPAT is not set
+# CONFIG_BLKID is not set
+# CONFIG_FEATURE_BLKID_TYPE is not set
+CONFIG_DMESG=y
+CONFIG_FEATURE_DMESG_PRETTY=y
+# CONFIG_FBSET is not set
+# CONFIG_FEATURE_FBSET_FANCY is not set
+# CONFIG_FEATURE_FBSET_READMODE is not set
+# CONFIG_FDFLUSH is not set
+# CONFIG_FDFORMAT is not set
+# CONFIG_FDISK is not set
+# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
+# CONFIG_FEATURE_FDISK_WRITABLE is not set
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_GPT_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FINDFS is not set
+# CONFIG_FLOCK is not set
+CONFIG_FREERAMDISK=y
+# CONFIG_FSCK_MINIX is not set
+# CONFIG_MKFS_EXT2 is not set
+# CONFIG_MKFS_MINIX is not set
+# CONFIG_FEATURE_MINIX2 is not set
+# CONFIG_MKFS_REISER is not set
+# CONFIG_MKFS_VFAT is not set
+CONFIG_GETOPT=y
+CONFIG_FEATURE_GETOPT_LONG=y
+# CONFIG_HEXDUMP is not set
+# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
+# CONFIG_HD is not set
+# CONFIG_HWCLOCK is not set
+# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set
+# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+# CONFIG_LOSETUP is not set
+# CONFIG_LSPCI is not set
+# CONFIG_LSUSB is not set
+# CONFIG_MKSWAP is not set
+# CONFIG_FEATURE_MKSWAP_UUID is not set
+CONFIG_MORE=y
+# CONFIG_PIVOT_ROOT is not set
+# CONFIG_RDATE is not set
+# CONFIG_RDEV is not set
+# CONFIG_READPROFILE is not set
+# CONFIG_RTCWAKE is not set
+# CONFIG_SCRIPT is not set
+# CONFIG_SCRIPTREPLAY is not set
+# CONFIG_SETARCH is not set
+# CONFIG_SWAPONOFF is not set
+# CONFIG_FEATURE_SWAPON_DISCARD is not set
+# CONFIG_FEATURE_SWAPON_PRI is not set
+# CONFIG_SWITCH_ROOT is not set
+CONFIG_UMOUNT=y
+CONFIG_FEATURE_UMOUNT_ALL=y
+
+#
+# Common options for mount/umount
+#
+CONFIG_FEATURE_MOUNT_LOOP=y
+CONFIG_FEATURE_MOUNT_LOOP_CREATE=y
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+# CONFIG_VOLUMEID is not set
+# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
+# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
+# CONFIG_FEATURE_VOLUMEID_EXFAT is not set
+# CONFIG_FEATURE_VOLUMEID_EXT is not set
+# CONFIG_FEATURE_VOLUMEID_F2FS is not set
+# CONFIG_FEATURE_VOLUMEID_FAT is not set
+# CONFIG_FEATURE_VOLUMEID_HFS is not set
+# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
+# CONFIG_FEATURE_VOLUMEID_JFS is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
+# CONFIG_FEATURE_VOLUMEID_LUKS is not set
+# CONFIG_FEATURE_VOLUMEID_NILFS is not set
+# CONFIG_FEATURE_VOLUMEID_NTFS is not set
+# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
+# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
+# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
+# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set
+# CONFIG_FEATURE_VOLUMEID_SYSV is not set
+# CONFIG_FEATURE_VOLUMEID_UDF is not set
+# CONFIG_FEATURE_VOLUMEID_XFS is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_CONSPY is not set
+# CONFIG_CROND is not set
+# CONFIG_FEATURE_CROND_D is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_FEATURE_CROND_DIR=""
+# CONFIG_I2CGET is not set
+# CONFIG_I2CSET is not set
+# CONFIG_I2CDUMP is not set
+# CONFIG_I2CDETECT is not set
+# CONFIG_LESS is not set
+CONFIG_FEATURE_LESS_MAXLINES=0
+# CONFIG_FEATURE_LESS_BRACKETS is not set
+# CONFIG_FEATURE_LESS_FLAGS is not set
+# CONFIG_FEATURE_LESS_TRUNCATE is not set
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_FEATURE_LESS_WINCH is not set
+# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set
+# CONFIG_FEATURE_LESS_DASHCMD is not set
+# CONFIG_FEATURE_LESS_LINENUMS is not set
+# CONFIG_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
+# CONFIG_RFKILL is not set
+CONFIG_SETSERIAL=y
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
+# CONFIG_UBIATTACH is not set
+# CONFIG_UBIDETACH is not set
+# CONFIG_UBIMKVOL is not set
+# CONFIG_UBIRMVOL is not set
+# CONFIG_UBIRSVOL is not set
+# CONFIG_UBIUPDATEVOL is not set
+# CONFIG_WALL is not set
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CHAT is not set
+# CONFIG_FEATURE_CHAT_NOFAIL is not set
+# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
+# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
+# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
+# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
+# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
+# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
+# CONFIG_CHRT is not set
+# CONFIG_CRONTAB is not set
+# CONFIG_DC is not set
+# CONFIG_FEATURE_DC_LIBM is not set
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_DEVMEM is not set
+# CONFIG_EJECT is not set
+# CONFIG_FEATURE_EJECT_SCSI is not set
+# CONFIG_FBSPLASH is not set
+# CONFIG_FLASHCP is not set
+# CONFIG_FLASH_LOCK is not set
+# CONFIG_FLASH_UNLOCK is not set
+# CONFIG_FLASH_ERASEALL is not set
+# CONFIG_IONICE is not set
+# CONFIG_INOTIFYD is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_SMALL is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MAN is not set
+# CONFIG_MICROCOM is not set
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_RAIDAUTORUN is not set
+# CONFIG_READAHEAD is not set
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+# CONFIG_SETSID is not set
+# CONFIG_STRINGS is not set
+# CONFIG_TIME is not set
+# CONFIG_TIMEOUT is not set
+# CONFIG_TTYSIZE is not set
+# CONFIG_VOLNAME is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+# CONFIG_NAMEIF is not set
+# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
+# CONFIG_NBDCLIENT is not set
+# CONFIG_NC is not set
+# CONFIG_NC_SERVER is not set
+# CONFIG_NC_EXTRA is not set
+# CONFIG_NC_110_COMPAT is not set
+# CONFIG_PING is not set
+# CONFIG_PING6 is not set
+# CONFIG_FEATURE_FANCY_PING is not set
+# CONFIG_WGET is not set
+# CONFIG_FEATURE_WGET_STATUSBAR is not set
+# CONFIG_FEATURE_WGET_AUTHENTICATION is not set
+# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set
+# CONFIG_FEATURE_WGET_TIMEOUT is not set
+# CONFIG_FEATURE_WGET_OPENSSL is not set
+# CONFIG_FEATURE_WGET_SSL_HELPER is not set
+# CONFIG_WHOIS is not set
+# CONFIG_FEATURE_IPV6 is not set
+# CONFIG_FEATURE_UNIX_LOCAL is not set
+# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
+# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
+# CONFIG_ARP is not set
+# CONFIG_ARPING is not set
+# CONFIG_BRCTL is not set
+# CONFIG_FEATURE_BRCTL_FANCY is not set
+# CONFIG_FEATURE_BRCTL_SHOW is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_FTPD is not set
+# CONFIG_FEATURE_FTP_WRITE is not set
+# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
+# CONFIG_FEATURE_FTP_AUTHENTICATION is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+CONFIG_HOSTNAME=y
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_RANGES is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
+# CONFIG_FEATURE_HTTPD_PROXY is not set
+# CONFIG_FEATURE_HTTPD_GZIP is not set
+# CONFIG_IFCONFIG is not set
+# CONFIG_FEATURE_IFCONFIG_STATUS is not set
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+# CONFIG_FEATURE_IFCONFIG_HW is not set
+# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
+# CONFIG_IFENSLAVE is not set
+# CONFIG_IFPLUGD is not set
+# CONFIG_IFUPDOWN is not set
+CONFIG_IFUPDOWN_IFSTATE_PATH=""
+# CONFIG_FEATURE_IFUPDOWN_IP is not set
+# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
+# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set
+# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set
+# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
+# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set
+# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+# CONFIG_IP is not set
+# CONFIG_FEATURE_IP_ADDRESS is not set
+# CONFIG_FEATURE_IP_LINK is not set
+# CONFIG_FEATURE_IP_ROUTE is not set
+CONFIG_FEATURE_IP_ROUTE_DIR=""
+# CONFIG_FEATURE_IP_TUNNEL is not set
+# CONFIG_FEATURE_IP_RULE is not set
+# CONFIG_FEATURE_IP_SHORT_FORMS is not set
+# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPRULE is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+# CONFIG_NETSTAT is not set
+# CONFIG_FEATURE_NETSTAT_WIDE is not set
+# CONFIG_FEATURE_NETSTAT_PRG is not set
+# CONFIG_NSLOOKUP is not set
+# CONFIG_NTPD is not set
+# CONFIG_FEATURE_NTPD_SERVER is not set
+# CONFIG_FEATURE_NTPD_CONF is not set
+# CONFIG_PSCAN is not set
+# CONFIG_ROUTE is not set
+# CONFIG_SLATTACH is not set
+# CONFIG_TCPSVD is not set
+# CONFIG_TELNET is not set
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_STANDALONE is not set
+# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
+# CONFIG_TFTP is not set
+# CONFIG_TFTPD is not set
+# CONFIG_FEATURE_TFTP_GET is not set
+# CONFIG_FEATURE_TFTP_PUT is not set
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
+# CONFIG_TFTP_DEBUG is not set
+# CONFIG_TRACEROUTE is not set
+# CONFIG_TRACEROUTE6 is not set
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+# CONFIG_TUNCTL is not set
+# CONFIG_FEATURE_TUNCTL_UG is not set
+# CONFIG_UDHCPC6 is not set
+# CONFIG_UDHCPD is not set
+# CONFIG_DHCPRELAY is not set
+# CONFIG_DUMPLEASES is not set
+# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
+# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
+CONFIG_DHCPD_LEASES_FILE=""
+# CONFIG_UDHCPC is not set
+# CONFIG_FEATURE_UDHCPC_ARPING is not set
+# CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set
+# CONFIG_FEATURE_UDHCP_PORT is not set
+CONFIG_UDHCP_DEBUG=0
+# CONFIG_FEATURE_UDHCP_RFC3397 is not set
+# CONFIG_FEATURE_UDHCP_8021Q is not set
+CONFIG_UDHCPC_DEFAULT_SCRIPT=""
+CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
+# CONFIG_UDPSVD is not set
+# CONFIG_VCONFIG is not set
+# CONFIG_ZCIP is not set
+
+#
+# Print Utilities
+#
+# CONFIG_LPD is not set
+# CONFIG_LPR is not set
+# CONFIG_LPQ is not set
+
+#
+# Mail Utilities
+#
+# CONFIG_MAKEMIME is not set
+CONFIG_FEATURE_MIME_CHARSET=""
+# CONFIG_POPMAILDIR is not set
+# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
+# CONFIG_REFORMIME is not set
+# CONFIG_FEATURE_REFORMIME_COMPAT is not set
+# CONFIG_SENDMAIL is not set
+
+#
+# Process Utilities
+#
+# CONFIG_IOSTAT is not set
+# CONFIG_LSOF is not set
+# CONFIG_MPSTAT is not set
+# CONFIG_NMETER is not set
+# CONFIG_PMAP is not set
+# CONFIG_POWERTOP is not set
+# CONFIG_PSTREE is not set
+# CONFIG_PWDX is not set
+# CONFIG_SMEMCAP is not set
+# CONFIG_TOP is not set
+# CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set
+# CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS is not set
+# CONFIG_FEATURE_TOP_SMP_CPU is not set
+# CONFIG_FEATURE_TOP_DECIMALS is not set
+# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
+# CONFIG_FEATURE_TOPMEM is not set
+# CONFIG_UPTIME is not set
+# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
+# CONFIG_FREE is not set
+# CONFIG_FUSER is not set
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+CONFIG_KILLALL5=y
+# CONFIG_PGREP is not set
+# CONFIG_PIDOF is not set
+# CONFIG_FEATURE_PIDOF_SINGLE is not set
+# CONFIG_FEATURE_PIDOF_OMIT is not set
+# CONFIG_PKILL is not set
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+CONFIG_FEATURE_PS_LONG=y
+# CONFIG_FEATURE_PS_TIME is not set
+# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
+# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
+# CONFIG_RENICE is not set
+# CONFIG_BB_SYSCTL is not set
+# CONFIG_FEATURE_SHOW_THREADS is not set
+# CONFIG_WATCH is not set
+
+#
+# Runit Utilities
+#
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
+# CONFIG_SV is not set
+CONFIG_SV_DEFAULT_SERVICE_DIR=""
+# CONFIG_SVLOGD is not set
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
+# CONFIG_CHCON is not set
+# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
+# CONFIG_GETENFORCE is not set
+# CONFIG_GETSEBOOL is not set
+# CONFIG_LOAD_POLICY is not set
+# CONFIG_MATCHPATHCON is not set
+# CONFIG_RESTORECON is not set
+# CONFIG_RUNCON is not set
+# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_SETENFORCE is not set
+# CONFIG_SETFILES is not set
+# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
+# CONFIG_SETSEBOOL is not set
+# CONFIG_SESTATUS is not set
+
+#
+# Shells
+#
+# CONFIG_ASH is not set
+# CONFIG_ASH_BASH_COMPAT is not set
+# CONFIG_ASH_IDLE_TIMEOUT is not set
+# CONFIG_ASH_JOB_CONTROL is not set
+# CONFIG_ASH_ALIAS is not set
+# CONFIG_ASH_GETOPTS is not set
+# CONFIG_ASH_BUILTIN_ECHO is not set
+# CONFIG_ASH_BUILTIN_PRINTF is not set
+# CONFIG_ASH_BUILTIN_TEST is not set
+# CONFIG_ASH_HELP is not set
+# CONFIG_ASH_CMDCMD is not set
+# CONFIG_ASH_MAIL is not set
+# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+# CONFIG_ASH_EXPAND_PRMT is not set
+# CONFIG_CTTYHACK is not set
+CONFIG_HUSH=y
+CONFIG_HUSH_BASH_COMPAT=y
+CONFIG_HUSH_BRACE_EXPANSION=y
+CONFIG_HUSH_HELP=y
+CONFIG_HUSH_INTERACTIVE=y
+CONFIG_HUSH_SAVEHISTORY=y
+CONFIG_HUSH_JOB=y
+CONFIG_HUSH_TICK=y
+CONFIG_HUSH_IF=y
+CONFIG_HUSH_LOOPS=y
+CONFIG_HUSH_CASE=y
+CONFIG_HUSH_FUNCTIONS=y
+CONFIG_HUSH_LOCAL=y
+CONFIG_HUSH_RANDOM_SUPPORT=y
+CONFIG_HUSH_EXPORT_N=y
+CONFIG_HUSH_MODE_X=y
+# CONFIG_MSH is not set
+# CONFIG_FEATURE_SH_IS_ASH is not set
+CONFIG_FEATURE_SH_IS_HUSH=y
+# CONFIG_FEATURE_SH_IS_NONE is not set
+# CONFIG_FEATURE_BASH_IS_ASH is not set
+# CONFIG_FEATURE_BASH_IS_HUSH is not set
+CONFIG_FEATURE_BASH_IS_NONE=y
+CONFIG_SH_MATH_SUPPORT=y
+# CONFIG_SH_MATH_SUPPORT_64 is not set
+CONFIG_FEATURE_SH_EXTRA_QUIET=y
+# CONFIG_FEATURE_SH_STANDALONE is not set
+# CONFIG_FEATURE_SH_NOFORK is not set
+# CONFIG_FEATURE_SH_HISTFILESIZE is not set
+
+#
+# System Logging Utilities
+#
+# CONFIG_SYSLOGD is not set
+# CONFIG_FEATURE_ROTATE_LOGFILE is not set
+# CONFIG_FEATURE_REMOTE_LOG is not set
+# CONFIG_FEATURE_SYSLOGD_DUP is not set
+# CONFIG_FEATURE_SYSLOGD_CFG is not set
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0
+# CONFIG_FEATURE_IPC_SYSLOG is not set
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
+# CONFIG_LOGREAD is not set
+# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
+# CONFIG_FEATURE_KMSG_SYSLOG is not set
+# CONFIG_KLOGD is not set
+# CONFIG_FEATURE_KLOGD_KLOGCTL is not set
+# CONFIG_LOGGER is not set
diff --git a/board/stmicroelectronics/stm32-post-build.sh b/board/stmicroelectronics/stm32-post-build.sh
new file mode 100755
index 0000000..e324afe
--- /dev/null
+++ b/board/stmicroelectronics/stm32-post-build.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Kernel is built without devpts support
+sed -i '/^devpts/d' ${TARGET_DIR}/etc/fstab
+
+# Kernel is built without network support
+rm -f ${TARGET_DIR}/etc/init.d/S40network
+rm -rf ${TARGET_DIR}/etc/network/
diff --git a/board/stmicroelectronics/stm32f429-disco/flash.sh b/board/stmicroelectronics/stm32f429-disco/flash.sh
new file mode 100755
index 0000000..ffb8fcf
--- /dev/null
+++ b/board/stmicroelectronics/stm32f429-disco/flash.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+OUTPUT_DIR=$1
+
+if ! test -d "${OUTPUT_DIR}" ; then
+    echo "ERROR: no output directory specified."
+    echo "Usage: $0 OUTPUT_DIR"
+    exit 1
+fi
+
+${OUTPUT_DIR}/host/usr/bin/openocd -f board/stm32f429discovery.cfg \
+  -c "init" \
+  -c "reset init" \
+  -c "flash probe 0" \
+  -c "flash info 0" \
+  -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f429i-disco.bin 0x08000000" \
+  -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f429-disco.dtb 0x08004000" \
+  -c "flash write_image erase ${OUTPUT_DIR}/images/xipImage 0x08008000" \
+  -c "reset run" \
+  -c "shutdown"
diff --git a/board/stmicroelectronics/stm32f429-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch b/board/stmicroelectronics/stm32f429-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch
new file mode 100644
index 0000000..d6d5c61
--- /dev/null
+++ b/board/stmicroelectronics/stm32f429-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch
@@ -0,0 +1,32 @@
+From ded9afa688184b3240a92c2b8f114c545a09bc3f Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Sat, 12 Mar 2016 23:14:41 +0100
+Subject: [PATCH] ARM: stm32f249-disco: don't force init= in /chosen/bootargs
+
+There is no reason to override the kernel's default init= value, as
+this breaks userspace that assumes the kernel default of /init is
+used. Since stm32 is often used with a minimal bootloader
+(afboot-stm32) that doesn't provide any mechanism to override the DTB,
+we need to adjust the kernel command line in the Device Tree source.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ arch/arm/boot/dts/stm32f429-disco.dts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/stm32f429-disco.dts b/arch/arm/boot/dts/stm32f429-disco.dts
+index f0b731d..2bae81c 100644
+--- a/arch/arm/boot/dts/stm32f429-disco.dts
++++ b/arch/arm/boot/dts/stm32f429-disco.dts
+@@ -53,7 +53,7 @@
+ 	compatible = "st,stm32f429i-disco", "st,stm32f429";
+ 
+ 	chosen {
+-		bootargs = "root=/dev/ram rdinit=/linuxrc";
++		bootargs = "root=/dev/ram";
+ 		stdout-path = "serial0:115200n8";
+ 	};
+ 
+-- 
+2.6.4
+
diff --git a/board/stmicroelectronics/stm32f429-disco/readme.txt b/board/stmicroelectronics/stm32f429-disco/readme.txt
new file mode 100644
index 0000000..afe0f11
--- /dev/null
+++ b/board/stmicroelectronics/stm32f429-disco/readme.txt
@@ -0,0 +1,30 @@
+STM32F429 Discovery
+===================
+
+This tutorial describes how to use the predefined Buildroot
+configuration for the STM32F429 Discovery evaluation platform.
+
+Building
+--------
+
+  make stm32f429_disco_defconfig
+  make
+
+Wire the UART
+-------------
+
+Use a USB to TTL adapter, and connect:
+
+ - RX to PA9
+ - TX to PA10
+ - GND to one of the GND available on the board
+
+The UART is configured at 115200.
+
+Flashing
+--------
+
+  ./board/stmicroelectronics/stm32/stm32f429-disco/flash.sh output/
+
+It will flash the minimal bootloader, the Device Tree Blob, and the
+kernel image which includes the root filesystem as initramfs.
diff --git a/configs/stm32f429_disco_defconfig b/configs/stm32f429_disco_defconfig
new file mode 100644
index 0000000..5ca5393
--- /dev/null
+++ b/configs/stm32f429_disco_defconfig
@@ -0,0 +1,18 @@
+BR2_arm=y
+BR2_cortex_m4=y
+BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f429-disco/patches/"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_5=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32-post-build.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.5"
+BR2_LINUX_KERNEL_DEFCONFIG="stm32"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="xipImage"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32f429-disco"
+BR2_PACKAGE_BUSYBOX_CONFIG="board/stmicroelectronics/busybox-minimal.config"
+BR2_TARGET_ROOTFS_INITRAMFS=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_AFBOOT_STM32=y
+BR2_PACKAGE_HOST_OPENOCD=y
-- 
2.6.4

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

* [Buildroot] [PATCH v2 17/17] configs/stm32f469_disco: new configuration for STM32F469 Discovery board
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (15 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 16/17] configs/stm32f429_disco: new configuration for STM32F429 Discovery board Thomas Petazzoni
@ 2016-03-18 21:08 ` Thomas Petazzoni
  2016-03-21  9:46   ` Lee Jones
  2016-03-18 21:17 ` [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (4 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:08 UTC (permalink / raw)
  To: buildroot

From: Lee Jones <lee.jones@linaro.org>

Similar to stm32f429_disco, this commit adds a configuration for the
Cortex-M4 based STM32F469 platform.

It requires a few kernel patches, which have already been submitted
upstream, as well as a small OpenOCD patch. Besides that, it re-uses
most of what has been added for the STM32F429 platform.

Signed-off-by: Lee Jones <lee.jones@linaro.org>

[Thomas:
 - squash multiple patches from Lee Jones into one
 - improve the readme.txt file
 - sync the defconfig with the adaptations made to the stm32f429
   configuration.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 board/stmicroelectronics/stm32f469-disco/flash.sh  |  20 ++++
 ...-ARM-stm32-Identify-a-new-board-STM32F469.patch |  25 +++++
 ...upply-a-DTS-file-for-the-STM32F469-Discov.patch | 101 +++++++++++++++++++++
 ...-Add-new-config-fragment-to-change-RAM-st.patch |  28 ++++++
 .../patches/openocd/0001-add-config.patch          |  37 ++++++++
 .../patches/openocd/0002-flash-nor.patch           |  37 ++++++++
 .../stmicroelectronics/stm32f469-disco/readme.txt  |  19 ++++
 configs/stm32f469_disco_defconfig                  |  19 ++++
 8 files changed, 286 insertions(+)
 create mode 100755 board/stmicroelectronics/stm32f469-disco/flash.sh
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32-Identify-a-new-board-STM32F469.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0002-ARM-stm32-Supply-a-DTS-file-for-the-STM32F469-Discov.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0003-ARM-configs-Add-new-config-fragment-to-change-RAM-st.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/openocd/0001-add-config.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/openocd/0002-flash-nor.patch
 create mode 100644 board/stmicroelectronics/stm32f469-disco/readme.txt
 create mode 100644 configs/stm32f469_disco_defconfig

diff --git a/board/stmicroelectronics/stm32f469-disco/flash.sh b/board/stmicroelectronics/stm32f469-disco/flash.sh
new file mode 100755
index 0000000..a68bea0
--- /dev/null
+++ b/board/stmicroelectronics/stm32f469-disco/flash.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+OUTPUT_DIR=$1
+
+if ! test -d "${OUTPUT_DIR}" ; then
+    echo "ERROR: no output directory specified."
+    echo "Usage: $0 OUTPUT_DIR"
+    exit 1
+fi
+
+${OUTPUT_DIR}/host/usr/bin/openocd -f board/stm32f469discovery.cfg \
+  -c "init" \
+  -c "reset init" \
+  -c "flash probe 0" \
+  -c "flash info 0" \
+  -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469i-disco.bin 0x08000000" \
+  -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469-disco.dtb 0x08004000" \
+  -c "flash write_image erase ${OUTPUT_DIR}/images/xipImage 0x08008000" \
+  -c "reset run" \
+  -c "shutdown"
diff --git a/board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32-Identify-a-new-board-STM32F469.patch b/board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32-Identify-a-new-board-STM32F469.patch
new file mode 100644
index 0000000..01af415
--- /dev/null
+++ b/board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32-Identify-a-new-board-STM32F469.patch
@@ -0,0 +1,25 @@
+From 3b572676972f9bcf69695fd85a582c6622f7faa8 Mon Sep 17 00:00:00 2001
+From: Lee Jones <lee.jones@linaro.org>
+Date: Tue, 16 Feb 2016 14:04:17 +0000
+Subject: [PATCH] ARM: stm32: Identify a new board - STM32F469
+
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+---
+ arch/arm/mach-stm32/board-dt.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arm/mach-stm32/board-dt.c b/arch/arm/mach-stm32/board-dt.c
+index f2ad772..ceee477 100644
+--- a/arch/arm/mach-stm32/board-dt.c
++++ b/arch/arm/mach-stm32/board-dt.c
+@@ -10,6 +10,7 @@
+ 
+ static const char *const stm32_compat[] __initconst = {
+ 	"st,stm32f429",
++	"st,stm32f469",
+ 	NULL
+ };
+ 
+-- 
+2.6.4
+
diff --git a/board/stmicroelectronics/stm32f469-disco/patches/linux/0002-ARM-stm32-Supply-a-DTS-file-for-the-STM32F469-Discov.patch b/board/stmicroelectronics/stm32f469-disco/patches/linux/0002-ARM-stm32-Supply-a-DTS-file-for-the-STM32F469-Discov.patch
new file mode 100644
index 0000000..45f5228
--- /dev/null
+++ b/board/stmicroelectronics/stm32f469-disco/patches/linux/0002-ARM-stm32-Supply-a-DTS-file-for-the-STM32F469-Discov.patch
@@ -0,0 +1,101 @@
+From a08561ffdfb13986e2628296ccfd42f8a273b729 Mon Sep 17 00:00:00 2001
+From: Lee Jones <lee.jones@linaro.org>
+Date: Tue, 16 Feb 2016 13:53:47 +0000
+Subject: [PATCH] ARM: stm32: Supply a DTS file for the STM32F469 Discovery
+ board
+
+It's pretty similar to the STM32F429, but there are some
+subtle changes required to boot successfully.
+
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+[Thomas: remove rdinit= from /chosen/bootargs.]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ arch/arm/boot/dts/stm32f469-disco.dts | 75 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 75 insertions(+)
+ create mode 100644 arch/arm/boot/dts/stm32f469-disco.dts
+
+diff --git a/arch/arm/boot/dts/stm32f469-disco.dts b/arch/arm/boot/dts/stm32f469-disco.dts
+new file mode 100644
+index 0000000..9e73656
+--- /dev/null
++++ b/arch/arm/boot/dts/stm32f469-disco.dts
+@@ -0,0 +1,75 @@
++/*
++ * Copyright 2016 - Lee Jones <lee.jones@linaro.org>
++ *
++ * This file is dual-licensed: you can use it either under the terms
++ * of the GPL or the X11 license, at your option. Note that this dual
++ * licensing only applies to this file, and not this project as a
++ * whole.
++ *
++ *  a) This file is free software; you can redistribute it and/or
++ *     modify it under the terms of the GNU General Public License as
++ *     published by the Free Software Foundation; either version 2 of the
++ *     License, or (at your option) any later version.
++ *
++ *     This file is distributed in the hope that it will be useful,
++ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *     GNU General Public License for more details.
++ *
++ *     You should have received a copy of the GNU General Public
++ *     License along with this file; if not, write to the Free
++ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++ *     MA 02110-1301 USA
++ *
++ * Or, alternatively,
++ *
++ *  b) Permission is hereby granted, free of charge, to any person
++ *     obtaining a copy of this software and associated documentation
++ *     files (the "Software"), to deal in the Software without
++ *     restriction, including without limitation the rights to use,
++ *     copy, modify, merge, publish, distribute, sublicense, and/or
++ *     sell copies of the Software, and to permit persons to whom the
++ *     Software is furnished to do so, subject to the following
++ *     conditions:
++ *
++ *     The above copyright notice and this permission notice shall be
++ *     included in all copies or substantial portions of the Software.
++ *
++ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
++ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
++ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
++ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++ *     OTHER DEALINGS IN THE SOFTWARE.
++ */
++
++/dts-v1/;
++#include "stm32f429.dtsi"
++
++/ {
++	model = "STMicroelectronics STM32F469i-DISCO board";
++	compatible = "st,stm32f469i-disco", "st,stm32f469";
++
++	chosen {
++		bootargs = "root=/dev/ram";
++		stdout-path = "serial0:115200n8";
++	};
++
++	memory {
++		reg = <0x00000000 0x800000>;
++	};
++
++	aliases {
++		serial0 = &usart3;
++	};
++};
++
++&clk_hse {
++	clock-frequency = <8000000>;
++};
++
++&usart3 {
++	status = "okay";
++};
+-- 
+2.6.4
+
diff --git a/board/stmicroelectronics/stm32f469-disco/patches/linux/0003-ARM-configs-Add-new-config-fragment-to-change-RAM-st.patch b/board/stmicroelectronics/stm32f469-disco/patches/linux/0003-ARM-configs-Add-new-config-fragment-to-change-RAM-st.patch
new file mode 100644
index 0000000..e12c9bc
--- /dev/null
+++ b/board/stmicroelectronics/stm32f469-disco/patches/linux/0003-ARM-configs-Add-new-config-fragment-to-change-RAM-st.patch
@@ -0,0 +1,28 @@
+From 7d67f4be6e1b4d08126023c3902e3fc39488bbf9 Mon Sep 17 00:00:00 2001
+From: Lee Jones <lee.jones@linaro.org>
+Date: Tue, 16 Feb 2016 13:56:13 +0000
+Subject: [PATCH] ARM: configs: Add new config fragment to change RAM start
+ point
+
+Rather than duplicate a defconfig for each difference
+between platforms, we can choose to pick a basic defconfig and
+manipulate it at run-time using config fragments.  Here we're
+adding a new fragment to over-ride the RAM start point to 0x0.
+
+Cc: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+---
+ arch/arm/configs/dram_0x00000000.config | 1 +
+ 1 file changed, 1 insertion(+)
+ create mode 100644 arch/arm/configs/dram_0x00000000.config
+
+diff --git a/arch/arm/configs/dram_0x00000000.config b/arch/arm/configs/dram_0x00000000.config
+new file mode 100644
+index 0000000..db96dcb
+--- /dev/null
++++ b/arch/arm/configs/dram_0x00000000.config
+@@ -0,0 +1 @@
++CONFIG_DRAM_BASE=0x00000000
+-- 
+2.6.4
+
diff --git a/board/stmicroelectronics/stm32f469-disco/patches/openocd/0001-add-config.patch b/board/stmicroelectronics/stm32f469-disco/patches/openocd/0001-add-config.patch
new file mode 100644
index 0000000..036c4f6
--- /dev/null
+++ b/board/stmicroelectronics/stm32f469-disco/patches/openocd/0001-add-config.patch
@@ -0,0 +1,37 @@
+From 26045588f462476cee356d15a24944d6c26befb4 Mon Sep 17 00:00:00 2001
+From: Maxime Coquelin <mcoquelin.stm32@gmail.com>
+Date: Sat, 24 Oct 2015 00:13:38 +0200
+Subject: [PATCH] tcl: add STM32F469 discovery board config
+
+Change-Id: Iad7ee06330b3259ea0ce0d174dfdade6785913eb
+Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
+Reviewed-on: http://openocd.zylin.com/3043
+Tested-by: jenkins
+Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
+Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
+---
+ tcl/board/stm32f469discovery.cfg | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+ create mode 100644 tcl/board/stm32f469discovery.cfg
+
+diff --git a/tcl/board/stm32f469discovery.cfg b/tcl/board/stm32f469discovery.cfg
+new file mode 100644
+index 0000000..eecfe33
+--- /dev/null
++++ b/tcl/board/stm32f469discovery.cfg
+@@ -0,0 +1,12 @@
++#
++# This is an STM32F469 discovery board with a single STM32F469NI chip.
++# http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF262395
++#
++
++source [find interface/stlink-v2-1.cfg]
++
++transport select hla_swd
++
++source [find target/stm32f4x.cfg]
++
++reset_config srst_only
+-- 
+1.9.1
+
diff --git a/board/stmicroelectronics/stm32f469-disco/patches/openocd/0002-flash-nor.patch b/board/stmicroelectronics/stm32f469-disco/patches/openocd/0002-flash-nor.patch
new file mode 100644
index 0000000..bfec983
--- /dev/null
+++ b/board/stmicroelectronics/stm32f469-disco/patches/openocd/0002-flash-nor.patch
@@ -0,0 +1,37 @@
+From 3e219648c80a27f0519003f3b088cbb846e255d8 Mon Sep 17 00:00:00 2001
+From: Maxime Coquelin <maxime.coquelin@st.com>
+Date: Sat, 24 Oct 2015 00:03:54 +0200
+Subject: [PATCH] flash/nor/stm32f2x: Add STM32F469 part
+
+Change-Id: I4e13ceb0ba954dc2fea059ddeef10109be938c9c
+Signed-off-by: Maxime Coquelin <mcoquelin.stm32@gmail.com>
+Reviewed-on: http://openocd.zylin.com/3042
+Tested-by: jenkins
+Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
+---
+ src/flash/nor/stm32f2x.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c
+index 2130444..89fc75d 100644
+--- a/src/flash/nor/stm32f2x.c
++++ b/src/flash/nor/stm32f2x.c
+@@ -790,6 +790,7 @@ static int stm32x_probe(struct flash_bank *bank)
+ 		max_flash_size_in_kb = 1024;
+ 		break;
+ 	case 0x419:
++	case 0x434:
+ 		max_flash_size_in_kb = 2048;
+ 		break;
+ 	case 0x423:
+@@ -952,6 +953,7 @@ static int get_stm32x_info(struct flash_bank *bank, char *buf, int buf_size)
+ 
+ 	case 0x413:
+ 	case 0x419:
++	case 0x434:
+ 		device_str = "STM32F4xx";
+ 
+ 		switch (rev_id) {
+-- 
+1.9.1
+
diff --git a/board/stmicroelectronics/stm32f469-disco/readme.txt b/board/stmicroelectronics/stm32f469-disco/readme.txt
new file mode 100644
index 0000000..3b88496
--- /dev/null
+++ b/board/stmicroelectronics/stm32f469-disco/readme.txt
@@ -0,0 +1,19 @@
+STM32F469 Discovery
+===================
+
+This tutorial describes how to use the predefined Buildroot
+configuration for the STM32F469 Discovery evaluation platform.
+
+Building
+--------
+
+  make stm32f469_disco_defconfig
+  make
+
+Flashing
+--------
+
+  ./board/stmicroelectronics/stm32/stm32f469-disco/flash.sh output/
+
+It will flash the minimal bootloader, the Device Tree Blob, and the
+kernel image which includes the root filesystem as initramfs.
diff --git a/configs/stm32f469_disco_defconfig b/configs/stm32f469_disco_defconfig
new file mode 100644
index 0000000..5fd893b
--- /dev/null
+++ b/configs/stm32f469_disco_defconfig
@@ -0,0 +1,19 @@
+BR2_arm=y
+BR2_cortex_m4=y
+BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f469-disco/patches/"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_5=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32-post-build.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.5"
+BR2_LINUX_KERNEL_DEFCONFIG="stm32"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm/configs/dram_0x00000000.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="xipImage"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32f469-disco"
+BR2_PACKAGE_BUSYBOX_CONFIG="board/stmicroelectronics/busybox-minimal.config"
+BR2_TARGET_ROOTFS_INITRAMFS=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_AFBOOT_STM32=y
+BR2_PACKAGE_HOST_OPENOCD=y
-- 
2.6.4

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

* [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (16 preceding siblings ...)
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 17/17] configs/stm32f469_disco: new configuration for STM32F469 " Thomas Petazzoni
@ 2016-03-18 21:17 ` Thomas Petazzoni
  2016-03-18 22:49   ` Ezequiel Garcia
  2016-03-19 16:12 ` Arnout Vandecappelle
                   ` (3 subsequent siblings)
  21 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-18 21:17 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 18 Mar 2016 22:08:02 +0100, Thomas Petazzoni wrote:

> Here is the v2 of the patches that add support for ARM Cortex-M and
> STM32 defconfigs.

This whole series is available at:

  http://git.free-electrons.com/users/thomas-petazzoni/buildroot/log/?h=cortexm-uclibc-thumb

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 14/17] elf2flt: use new upstream site and add ARM patch
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 14/17] elf2flt: use new upstream site and add ARM patch Thomas Petazzoni
@ 2016-03-18 21:34   ` Ezequiel Garcia
  2016-03-19 13:32     ` Thomas Petazzoni
  0 siblings, 1 reply; 51+ messages in thread
From: Ezequiel Garcia @ 2016-03-18 21:34 UTC (permalink / raw)
  To: buildroot

On 18 March 2016 at 18:08, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> The uClinux developers now have a Github with elf2flt code, with an
> upstream that is again active. Let's switch to this upstream, to which
> Waldemar is contributing as well.
>
> We also add an ARM patch from Waldemar that is needed to make ARM FLAT
> binaries work properly. Since this commit was on the previously used
> upstream, we add it together with the change of upstream location to
> keep the same functionality level.
>
> Since we're now fetching from github, a hash file is added as well.
>
> Finally, we disable -Werror to avoid build issues caused by warnings.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  .../0001-allow-to-build-arm-flat-binaries.patch    | 123 +++++++++++++++++++++
>  package/elf2flt/elf2flt.hash                       |   2 +
>  package/elf2flt/elf2flt.mk                         |   8 +-
>  3 files changed, 129 insertions(+), 4 deletions(-)
>  create mode 100644 package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
>  create mode 100644 package/elf2flt/elf2flt.hash
>
> diff --git a/package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch b/package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
> new file mode 100644
> index 0000000..a6c63c5
> --- /dev/null
> +++ b/package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
> @@ -0,0 +1,123 @@
> +From 56b082412c6f49d21f5e54831a40d1e7c45b3ee4 Mon Sep 17 00:00:00 2001
> +From: Waldemar Brodkorb <wbx@openadk.org>
> +Date: Sat, 12 Mar 2016 22:09:30 +0100
> +Subject: [PATCH] allow to build arm flat binaries
> +
> +Add patchset from ptxdist which is required to produce working
> +ARM flat binaries. Tested with busybox on Kinetis K70.
> +
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +---
> + elf2flt.c     | 19 ++++++++++++-------
> + elf2flt.ld.in | 17 ++++++++++++++---
> + 2 files changed, 26 insertions(+), 10 deletions(-)
> +
> +diff --git a/elf2flt.c b/elf2flt.c
> +index fcd797c..c6978e1 100644
> +--- a/elf2flt.c
> ++++ b/elf2flt.c
> +@@ -56,6 +56,8 @@ const char *elf2flt_progname;
> +
> + #if defined(TARGET_h8300)
> + #include <elf/h8.h>      /* TARGET_* ELF support for the BFD library            */
> ++#elif defined(TARGET_arm)
> ++#include <elf/arm.h>
> + #elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(TARGET_nios) || defined(TARGET_nios2)
> + #include "cygwin-elf.h"       /* Cygwin uses a local copy */
> + #elif defined(TARGET_xtensa)
> +@@ -646,16 +648,23 @@ dump_symbols(symbols, number_of_symbols);
> +                               default:
> +                                       goto good_32bit_resolved_reloc;
> + #elif defined(TARGET_arm)
> ++                              case R_ARM_TARGET1:
> ++                              case R_ARM_TARGET2:
> +                               case R_ARM_ABS32:
> +                                       relocation_needed = 1;
> +                                       break;
> +                               case R_ARM_REL32:
> ++                              case R_ARM_JUMP24:
> ++                              case R_ARM_CALL:
> +                               case R_ARM_THM_PC11:
> +                               case R_ARM_THM_PC22:
> ++                              case R_ARM_THM_JUMP24:
> +                               case R_ARM_PC24:
> +                               case R_ARM_PLT32:
> +                               case R_ARM_GOTPC:
> +                               case R_ARM_GOT32:
> ++                              case R_ARM_PREL31:
> ++                              case R_ARM_NONE:
> +                                       relocation_needed = 0;
> +                                       break;
> +                               default:
> +@@ -871,9 +880,7 @@ dump_symbols(symbols, number_of_symbols);
> +                                       relocation_needed = 1;
> +                                       if (verbose)
> +                                               fprintf(stderr,
> +-                                                      "%s vma=0x%x, "
> +-                                                      "value=0x%"BFD_VMA_FMT"x, "
> +-                                                      "address=0x%"BFD_VMA_FMT"x "
> ++                                                      "%s vma=0x%x, value=0x%x, address=0x%x "
> +                                                       "sym_addr=0x%x rs=0x%x, opcode=0x%x\n",
> +                                                       "ABS32",
> +                                                       sym_vma, (*(q->sym_ptr_ptr))->value,
> +@@ -890,9 +897,7 @@ dump_symbols(symbols, number_of_symbols);
> +                               case R_ARM_PLT32:
> +                                       if (verbose)
> +                                               fprintf(stderr,
> +-                                                      "%s vma=0x%x, "
> +-                                                      "value=0x%"BFD_VMA_FMT"x, "
> +-                                                      "address=0x%"BFD_VMA_FMT"x "
> ++                                                      "%s vma=0x%x, value=0x%x, address=0x%x "
> +                                                       "sym_addr=0x%x rs=0x%x, opcode=0x%x\n",
> +                                                       "PLT32",
> +                                                       sym_vma, (*(q->sym_ptr_ptr))->value,
> +@@ -1446,7 +1451,7 @@ DIS29_RELOCATION:
> +                               }
> +                       }
> +
> +-                      sprintf(&addstr[0], "+0x%lx", sym_addr - (*(q->sym_ptr_ptr))->value -
> ++                      sprintf(&addstr[0], "+0x%x", sym_addr - (*(q->sym_ptr_ptr))->value -
> +                                        bfd_section_vma(abs_bfd, sym_section));
> +
> +
> +diff --git a/elf2flt.ld.in b/elf2flt.ld.in
> +index bfda0ef..ec1fe6f 100644
> +--- a/elf2flt.ld.in
> ++++ b/elf2flt.ld.in
> +@@ -35,6 +35,8 @@ W_RODAT              *(.rodata1)
> + W_RODAT               *(.rodata.*)
> + W_RODAT               *(.gnu.linkonce.r*)
> +
> ++              /* .ARM.extab name sections containing exception unwinding information */
> ++              *(.ARM.extab* .gnu.linkonce.armextab.*)
> +               /* This is special code area at the end of the normal
> +                  text section.  It contains a small lookup table at
> +                  the start followed by the code pointed to by entries
> +@@ -43,11 +45,20 @@ W_RODAT            *(.gnu.linkonce.r*)
> +               PROVIDE(@SYMBOL_PREFIX at __ctbp = .);
> +               *(.call_table_data)
> +               *(.call_table_text)
> +-
> +-              . = ALIGN(0x20) ;
> +-              @SYMBOL_PREFIX at _etext = . ;
> +       } > flatmem :text
> +
> ++      /* .ARM.exidx name sections containing index entries for section unwinding */
> ++      /* .ARM.exidx is sorted, so has to go in its own output section.  */
> ++      @SYMBOL_PREFIX at __exidx_start = .;
> ++      .ARM.exidx :
> ++      {
> ++              *(.ARM.exidx* .gnu.linkonce.armexidx.*)
> ++      } > flatmem
> ++      @SYMBOL_PREFIX at __exidx_end = .;
> ++
> ++      . = ALIGN(0x20) ;
> ++      @SYMBOL_PREFIX at _etext = . ;
> ++
> +       .data : {
> +               . = ALIGN(0x4) ;
> +               @SYMBOL_PREFIX at _sdata = . ;
> +--
> +2.6.4
> +
> diff --git a/package/elf2flt/elf2flt.hash b/package/elf2flt/elf2flt.hash
> new file mode 100644
> index 0000000..c5e71db
> --- /dev/null
> +++ b/package/elf2flt/elf2flt.hash
> @@ -0,0 +1,2 @@
> +# Locally calculated
> +sha256sum

s/sha256sum/sha256 ?

-- 
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar

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

* [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M Thomas Petazzoni
@ 2016-03-18 22:30   ` Yann E. MORIN
  2016-03-19 13:33     ` Thomas Petazzoni
  0 siblings, 1 reply; 51+ messages in thread
From: Yann E. MORIN @ 2016-03-18 22:30 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2016-03-18 22:08 +0100, Thomas Petazzoni spake thusly:
> All ARM cores should select a BR2_ARM_CPU_* option. Currently, the
> cortex-m3 does not, which this commit fixes by introducing a
> BR2_ARM_CPU_ARMV7M option.

Tangentially related: those options are not user to sepcify iany of the
gcc options, but to allow packages that have CPU-specific code todepend
on it or to enable such support it.

> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  arch/Config.in.arm | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/Config.in.arm b/arch/Config.in.arm
> index 04f0369..33f763a 100644
> --- a/arch/Config.in.arm
> +++ b/arch/Config.in.arm
> @@ -52,6 +52,9 @@ config BR2_ARM_CPU_ARMV6
>  config BR2_ARM_CPU_ARMV7A
>  	bool
>  
> +config BR2_ARM_CPU_ARMV7M
> +	bool
> +
>  choice
>  	prompt "Target Architecture Variant"
>  	depends on BR2_arm || BR2_armeb
> @@ -171,6 +174,7 @@ config BR2_cortex_m3
>  	bool "cortex-M3"
>  	select BR2_ARM_CPU_HAS_THUMB
>  	select BR2_ARM_CPU_HAS_THUMB2
> +	select BR2_ARM_CPU_ARMV7M
>  config BR2_fa526
>  	bool "fa526/626"
>  	select BR2_ARM_CPU_HAS_ARM
> -- 
> 2.6.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH v2 02/17] arch/arm: Cortex-M3 provides only Thumb-2
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 02/17] arch/arm: Cortex-M3 provides only Thumb-2 Thomas Petazzoni
@ 2016-03-18 22:34   ` Yann E. MORIN
  2016-03-19 15:33     ` Arnout Vandecappelle
  0 siblings, 1 reply; 51+ messages in thread
From: Yann E. MORIN @ 2016-03-18 22:34 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2016-03-18 22:08 +0100, Thomas Petazzoni spake thusly:
> The Cortex-M cores only support Thumb-2, not Thumb. In fact, Thumb-2
> is a superset of Thumb, and we could have a single option for both in
> Buildroot, since -mthumb on ARMv4/v5 means original Thumb, while
> -mthumb on ARMv7 means Thumb 2. However, for clarity, it makes sense
> to have two separate options. But in this case, Cortex-M3 should not
> advertise that it supports Thumb, as in fact selecting Thumb would
> generate Thumb-2 code.

So, if a package has some assembly code written in Thumb not Thimb2, it
should do sometinh like:

    ifeq ($(BR2_ARM_CPU_HAS_THUMB)$(BR2_ARM_CPU_HAS_THUMB2),y)
    FOO_OPTS += --enable-thumb
    endif

whereas now it would only need to do:

    ifeq ($(BR2_ARM_CPU_HAS_THUMB)$(BR2_ARM_CPU_HAS_THUMB2),y)
    FOO_OPTS += --enable-thumb
    endif

Right?

> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  arch/Config.in.arm | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/Config.in.arm b/arch/Config.in.arm
> index 33f763a..cd1ec33 100644
> --- a/arch/Config.in.arm
> +++ b/arch/Config.in.arm
> @@ -172,7 +172,6 @@ config BR2_cortex_a17
>  	select BR2_ARCH_HAS_MMU_OPTIONAL
>  config BR2_cortex_m3
>  	bool "cortex-M3"
> -	select BR2_ARM_CPU_HAS_THUMB
>  	select BR2_ARM_CPU_HAS_THUMB2
>  	select BR2_ARM_CPU_ARMV7M
>  config BR2_fa526
> -- 
> 2.6.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH v2 03/17] arch/arm: add Cortex-M4 entry
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 03/17] arch/arm: add Cortex-M4 entry Thomas Petazzoni
@ 2016-03-18 22:41   ` Yann E. MORIN
  0 siblings, 0 replies; 51+ messages in thread
From: Yann E. MORIN @ 2016-03-18 22:41 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2016-03-18 22:08 +0100, Thomas Petazzoni spake thusly:
> This commit adds the option to select the Cortex-M4 ARM core, in the
> same family as Cortex-M3. This will be useful to enable the internal
> toolchain backend for this ARM core, and provide some defconfigs for
> Cortex-M4 platforms.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  arch/Config.in.arm | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/Config.in.arm b/arch/Config.in.arm
> index cd1ec33..ee612f5 100644
> --- a/arch/Config.in.arm
> +++ b/arch/Config.in.arm
> @@ -174,6 +174,10 @@ config BR2_cortex_m3
>  	bool "cortex-M3"
>  	select BR2_ARM_CPU_HAS_THUMB2
>  	select BR2_ARM_CPU_ARMV7M
> +config BR2_cortex_m4
> +	bool "cortex-M4"
> +	select BR2_ARM_CPU_HAS_THUMB2
> +	select BR2_ARM_CPU_ARMV7M
>  config BR2_fa526
>  	bool "fa526/626"
>  	select BR2_ARM_CPU_HAS_ARM
> @@ -455,6 +459,7 @@ config BR2_GCC_TARGET_CPU
>  	default "cortex-a15"	if BR2_cortex_a15
>  	default "cortex-a17"	if BR2_cortex_a17
>  	default "cortex-m3"	if BR2_cortex_m3
> +	default "cortex-m4"	if BR2_cortex_m4
>  	default "fa526"		if BR2_fa526
>  	default "marvell-pj4"	if BR2_pj4
>  	default "strongarm"	if BR2_strongarm
> -- 
> 2.6.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs
  2016-03-18 21:17 ` [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
@ 2016-03-18 22:49   ` Ezequiel Garcia
  2016-03-19 13:32     ` Thomas Petazzoni
  0 siblings, 1 reply; 51+ messages in thread
From: Ezequiel Garcia @ 2016-03-18 22:49 UTC (permalink / raw)
  To: buildroot

On 18 Mar 10:17 PM, Thomas Petazzoni wrote:
> Hello,
> 
> On Fri, 18 Mar 2016 22:08:02 +0100, Thomas Petazzoni wrote:
> 
> > Here is the v2 of the patches that add support for ARM Cortex-M and
> > STM32 defconfigs.
> 
> This whole series is available at:
> 
>   http://git.free-electrons.com/users/thomas-petazzoni/buildroot/log/?h=cortexm-uclibc-thumb
> 

Thanks for the branch. Tested on LPC4350 Hitex Eval board and it worked
fine:

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.5.0-rc2-00312-gd183ca0d53b6 (zeta at laptop) (gcc version 4.9.3 (Buildroot 2016.05-git-00495-ga84162dcafb9-dirty) ) #220 PREEMPT Fri Mar 18 19:43:33 ART 2016
[etc]

Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
-- 
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar

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

* [Buildroot] [PATCH v2 14/17] elf2flt: use new upstream site and add ARM patch
  2016-03-18 21:34   ` Ezequiel Garcia
@ 2016-03-19 13:32     ` Thomas Petazzoni
  0 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-19 13:32 UTC (permalink / raw)
  To: buildroot

Ezequiel,

On Fri, 18 Mar 2016 18:34:15 -0300, Ezequiel Garcia wrote:

> > diff --git a/package/elf2flt/elf2flt.hash b/package/elf2flt/elf2flt.hash
> > new file mode 100644
> > index 0000000..c5e71db
> > --- /dev/null
> > +++ b/package/elf2flt/elf2flt.hash
> > @@ -0,0 +1,2 @@
> > +# Locally calculated
> > +sha256sum
> 
> s/sha256sum/sha256 ?

Gaah, indeed. Last minute changes are really not good.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs
  2016-03-18 22:49   ` Ezequiel Garcia
@ 2016-03-19 13:32     ` Thomas Petazzoni
  0 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-19 13:32 UTC (permalink / raw)
  To: buildroot

Dear Ezequiel Garcia,

On Fri, 18 Mar 2016 19:49:31 -0300, Ezequiel Garcia wrote:

> Thanks for the branch. Tested on LPC4350 Hitex Eval board and it worked
> fine:
> 
> Uncompressing Linux... done, booting the kernel.
> [    0.000000] Booting Linux on physical CPU 0x0
> [    0.000000] Linux version 4.5.0-rc2-00312-gd183ca0d53b6 (zeta at laptop) (gcc version 4.9.3 (Buildroot 2016.05-git-00495-ga84162dcafb9-dirty) ) #220 PREEMPT Fri Mar 18 19:43:33 ART 2016
> [etc]
> 
> Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>

Thanks! Any chance that you send a defconfig for this board?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M
  2016-03-18 22:30   ` Yann E. MORIN
@ 2016-03-19 13:33     ` Thomas Petazzoni
  2016-03-19 13:59       ` Yann E. MORIN
  0 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-19 13:33 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 18 Mar 2016 23:30:50 +0100, Yann E. MORIN wrote:
> Thomas, All,
> 
> On 2016-03-18 22:08 +0100, Thomas Petazzoni spake thusly:
> > All ARM cores should select a BR2_ARM_CPU_* option. Currently, the
> > cortex-m3 does not, which this commit fixes by introducing a
> > BR2_ARM_CPU_ARMV7M option.
> 
> Tangentially related: those options are not user to sepcify iany of the
> gcc options, but to allow packages that have CPU-specific code todepend
> on it or to enable such support it.

Hum, yes. But I don't understand what I'm supposed to do with your
comment? Are you suggesting that a change is needed?

> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> 
> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M
  2016-03-19 13:33     ` Thomas Petazzoni
@ 2016-03-19 13:59       ` Yann E. MORIN
  2016-03-19 14:08         ` Thomas Petazzoni
  0 siblings, 1 reply; 51+ messages in thread
From: Yann E. MORIN @ 2016-03-19 13:59 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2016-03-19 14:33 +0100, Thomas Petazzoni spake thusly:
> On Fri, 18 Mar 2016 23:30:50 +0100, Yann E. MORIN wrote:
> > Thomas, All,
> > 
> > On 2016-03-18 22:08 +0100, Thomas Petazzoni spake thusly:
> > > All ARM cores should select a BR2_ARM_CPU_* option. Currently, the
> > > cortex-m3 does not, which this commit fixes by introducing a
> > > BR2_ARM_CPU_ARMV7M option.
> > 
> > Tangentially related: those options are not user to sepcify iany of the
> > gcc options, but to allow packages that have CPU-specific code todepend
> > on it or to enable such support it.
> 
> Hum, yes. But I don't understand what I'm supposed to do with your
> comment?

You could fix my many typoes! ;-)

> Are you suggesting that a change is needed?

No, it's OK (hence ny acked-by). However, I had to do a bit of research
in the tree to see ehre such options were used, only to discover that
packages did use them, not the toolchain.

Those variables are specific to ARM, and we have no such counterparts in
any of the others archs. So maybe we could have a little comment at the
top of arch/Config/in.arm that explains what those kconfig variables are
for?

But really, not related to your patch...

Regards,
Yann E. MORIN.

> > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > > Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> > 
> > Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> Thanks!
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M
  2016-03-19 13:59       ` Yann E. MORIN
@ 2016-03-19 14:08         ` Thomas Petazzoni
  0 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-19 14:08 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 19 Mar 2016 14:59:46 +0100, Yann E. MORIN wrote:

> > Are you suggesting that a change is needed?
> 
> No, it's OK (hence ny acked-by). However, I had to do a bit of research
> in the tree to see ehre such options were used, only to discover that
> packages did use them, not the toolchain.
> 
> Those variables are specific to ARM, and we have no such counterparts in
> any of the others archs. So maybe we could have a little comment at the
> top of arch/Config/in.arm that explains what those kconfig variables are
> for?

IIRC, we originally added them because some packages were doing
$(BR2_cortex_a8)$(BR2_cortex_a9)$(BR2_cortex_aX)... to find out whether
we're on ARMv7 or not, and it was starting to be a bit annoying.

Or some others were doing similar things to say "I need ARMv5" at
least, etc.

But yes, they are only used by packages. For the toolchain build
process itself, only the BR2_cortex*, BR2_arm* options are useful.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 02/17] arch/arm: Cortex-M3 provides only Thumb-2
  2016-03-18 22:34   ` Yann E. MORIN
@ 2016-03-19 15:33     ` Arnout Vandecappelle
  0 siblings, 0 replies; 51+ messages in thread
From: Arnout Vandecappelle @ 2016-03-19 15:33 UTC (permalink / raw)
  To: buildroot

On 03/18/16 23:34, Yann E. MORIN wrote:
> Thomas, All,
>
> On 2016-03-18 22:08 +0100, Thomas Petazzoni spake thusly:
>> The Cortex-M cores only support Thumb-2, not Thumb. In fact, Thumb-2
>> is a superset of Thumb, and we could have a single option for both in
>> Buildroot, since -mthumb on ARMv4/v5 means original Thumb, while
>> -mthumb on ARMv7 means Thumb 2. However, for clarity, it makes sense
>> to have two separate options. But in this case, Cortex-M3 should not
>> advertise that it supports Thumb, as in fact selecting Thumb would
>> generate Thumb-2 code.
>
> So, if a package has some assembly code written in Thumb not Thimb2, it
> should do sometinh like:
>
>      ifeq ($(BR2_ARM_CPU_HAS_THUMB)$(BR2_ARM_CPU_HAS_THUMB2),y)
>      FOO_OPTS += --enable-thumb
>      endif
>
> whereas now it would only need to do:
>
>      ifeq ($(BR2_ARM_CPU_HAS_THUMB)$(BR2_ARM_CPU_HAS_THUMB2),y)

  I guess you meant to say

	ifeq ($(BR2_ARM_CPU_HAS_THUMB),y)

>      FOO_OPTS += --enable-thumb
>      endif
>
> Right?

  Indeed. This was discussed in v1 of the series, and Thomas updated the commit 
message to clarify that a bit. It turns out that we have no case you need a 
condition like that, but we do have a few cases where we need 
thumb-but-not-thumb2 (e.g. the uClibc threads stuff).

>
>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

  Regards,
  Arnout

>
> Regards,
> Yann E. MORIN.
>
>> ---
>>   arch/Config.in.arm | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/arch/Config.in.arm b/arch/Config.in.arm
>> index 33f763a..cd1ec33 100644
>> --- a/arch/Config.in.arm
>> +++ b/arch/Config.in.arm
>> @@ -172,7 +172,6 @@ config BR2_cortex_a17
>>   	select BR2_ARCH_HAS_MMU_OPTIONAL
>>   config BR2_cortex_m3
>>   	bool "cortex-M3"
>> -	select BR2_ARM_CPU_HAS_THUMB
>>   	select BR2_ARM_CPU_HAS_THUMB2
>>   	select BR2_ARM_CPU_ARMV7M
>>   config BR2_fa526
>> --
>> 2.6.4
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v2 04/17] uclibc: add patches to simplify Thumb handling
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 04/17] uclibc: add patches to simplify Thumb handling Thomas Petazzoni
@ 2016-03-19 15:46   ` Arnout Vandecappelle
  2016-03-29 22:14     ` Thomas Petazzoni
  0 siblings, 1 reply; 51+ messages in thread
From: Arnout Vandecappelle @ 2016-03-19 15:46 UTC (permalink / raw)
  To: buildroot

On 03/18/16 22:08, Thomas Petazzoni wrote:
> This commit adds a number of patches to uClibc that radically
> simplifies the Thumb handling. uClibc currently has three options that
> you need to toggle on Thumb configurations depending on the specific
> ARM CPU being targeted.
>
> However, it turns out that none of those options are necessary:
>
>   - USE_BX can simply be guessed by looking at the ARM core being
>     used. The bx instruction is available for all ARM cores >=
>     ARMv4T. This is exactly what glibc is doing.
>
>   - USE_LDREXSTREX can also be guessed by looking at the ARM core being
>     used: whenever you have Thumb2, ldrex/strex is available.
>
>   - COMPILE_IN_THUMB becomes useless, since all it does is passing
>     -mthumb. But just like the uClibc config options to set
>     --march=<foo> have been removed a long time ago, there's no need to
>     -have an option to pass -mthumb.
>
> Signed-off-by: Thomas Petazzoni<thomas.petazzoni@free-electrons.com>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

  Upstream status? Knowing Waldemar's lightning reflexes, we will probably just 
bump the uClibc version rather than having these patches in Buildroot :-)

  Regards,
  Arnout

> ---
>   .../0001-arm-remove-use-of-USE_BX-option.patch     | 53 ++++++++++++++++++++++
>   package/uclibc/0002-arm-remove-USE_BX-option.patch | 40 ++++++++++++++++
>   .../0003-arm-remove-use-of-USE_LDREXSTREX.patch    | 49 ++++++++++++++++++++
>   .../uclibc/0004-arm-remove-USE_LDREXSTREX.patch    | 34 ++++++++++++++
>   .../uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch  | 43 ++++++++++++++++++
>   5 files changed, 219 insertions(+)
>   create mode 100644 package/uclibc/0001-arm-remove-use-of-USE_BX-option.patch
>   create mode 100644 package/uclibc/0002-arm-remove-USE_BX-option.patch
>   create mode 100644 package/uclibc/0003-arm-remove-use-of-USE_LDREXSTREX.patch
>   create mode 100644 package/uclibc/0004-arm-remove-USE_LDREXSTREX.patch
>   create mode 100644 package/uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v2 05/17] uclibc: remove USE_BX handling
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 05/17] uclibc: remove USE_BX handling Thomas Petazzoni
@ 2016-03-19 15:47   ` Arnout Vandecappelle
  0 siblings, 0 replies; 51+ messages in thread
From: Arnout Vandecappelle @ 2016-03-19 15:47 UTC (permalink / raw)
  To: buildroot

On 03/18/16 22:08, Thomas Petazzoni wrote:
> Now that uClibc is capable of figuring out by itself whether 'bx' can
> be used or not, we can simplify the logic in Buildroot.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

  I verified that the other config symbols removed by the previous patch are not 
used in Buildroot.

  Regards,
  Arnout

> ---
>   package/uclibc/Config.in |  5 -----
>   package/uclibc/uclibc.mk | 11 -----------
>   2 files changed, 16 deletions(-)
>
> diff --git a/package/uclibc/Config.in b/package/uclibc/Config.in
> index 16bf89c..e722908 100644
> --- a/package/uclibc/Config.in
> +++ b/package/uclibc/Config.in
> @@ -139,11 +139,6 @@ config BR2_UCLIBC_ARC_TYPE
>   	default "ARC_CPU_700"	if BR2_arc770d
>   	default "ARC_CPU_HS"	if BR2_archs38
>
> -config BR2_UCLIBC_ARM_BX
> -	bool
> -	depends on BR2_UCLIBC_TARGET_ARCH = "arm"
> -	default y if (BR2_ARM_CPU_HAS_THUMB || BR2_ARM_CPU_HAS_THUMB2)
> -
>   config BR2_UCLIBC_MIPS_ABI
>   	string
>   	depends on BR2_UCLIBC_TARGET_ARCH = "mips"
> diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
> index 88a4a8c..c981d80 100644
> --- a/package/uclibc/uclibc.mk
> +++ b/package/uclibc/uclibc.mk
> @@ -80,16 +80,6 @@ ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
>   UCLIBC_EXTRA_CFLAGS += -marm
>   endif
>
> -ifeq ($(BR2_UCLIBC_ARM_BX),y)
> -define UCLIBC_ARM_BX_CONFIG
> -	$(call KCONFIG_ENABLE_OPT,USE_BX,$(@D)/.config)
> -endef
> -else
> -define UCLIBC_ARM_BX_CONFIG
> -	$(call KCONFIG_DISABLE_OPT,USE_BX,$(@D)/.config)
> -endef
> -endif
> -
>   endif # arm
>
>   #
> @@ -362,7 +352,6 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
>   	$(UCLIBC_ARC_TYPE_CONFIG)
>   	$(UCLIBC_ARC_PAGE_SIZE_CONFIG)
>   	$(UCLIBC_ARM_ABI_CONFIG)
> -	$(UCLIBC_ARM_BX_CONFIG)
>   	$(UCLIBC_MIPS_ABI_CONFIG)
>   	$(UCLIBC_MIPS_ISA_CONFIG)
>   	$(UCLIBC_SH_TYPE_CONFIG)
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v2 06/17] uclibc: gcc >= 4.9 can build a thumb/thread uclibc
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 06/17] uclibc: gcc >= 4.9 can build a thumb/thread uclibc Thomas Petazzoni
@ 2016-03-19 15:53   ` Arnout Vandecappelle
  2016-03-29 22:18     ` Thomas Petazzoni
  0 siblings, 1 reply; 51+ messages in thread
From: Arnout Vandecappelle @ 2016-03-19 15:53 UTC (permalink / raw)
  To: buildroot

On 03/18/16 22:08, Thomas Petazzoni wrote:
> Older gcc were not capable of building a uClibc library, with threads
> enabled, in Thumb1. However, the issues have been fixed since gcc 4.9,
> so this commit narrows down the condition to just gcc 4.7 and 4.8.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

> ---
>   package/uclibc/uclibc.mk | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
> index c981d80..ad94494 100644
> --- a/package/uclibc/uclibc.mk
> +++ b/package/uclibc/uclibc.mk
> @@ -75,8 +75,10 @@ define UCLIBC_ARM_ABI_CONFIG
>   	$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_EABI,$(@D)/.config)
>   endef
>
> -# Thumb build is broken with threads, build in ARM mode
> -ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
> +# Thumb1 build is broken with threads with old gcc versions (4.7 and
> +# 4.8). Since all cores supporting Thumb1 also support ARM, we use ARM
> +# code in this case.
> +ifeq ($(BR2_GCC_VERSION_4_7_X)$(BR2_GCC_VERSION_4_8_X):$(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),y:yy)

  This line is a bit long so would be nicer to split off into separate 
variables. This kind of logic is also much easier to do (and certainly easier to 
understand) in Kconfig than in the make language - like we had for BX before you 
removed it.

  However, that is something for another patch, so my Rev-by stands.

  Regards,
  Arnout

>   UCLIBC_EXTRA_CFLAGS += -marm
>   endif
>
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT Thomas Petazzoni
@ 2016-03-19 16:11   ` Arnout Vandecappelle
  2016-03-29 22:20     ` Thomas Petazzoni
  2016-03-19 19:27   ` Ezequiel Garcia
  1 sibling, 1 reply; 51+ messages in thread
From: Arnout Vandecappelle @ 2016-03-19 16:11 UTC (permalink / raw)
  To: buildroot

On 03/18/16 22:08, Thomas Petazzoni wrote:
> As explained by Waldemar, enabling DOPIC in uClibc will lead to the
> creation of a Position Independent library. In turn, this will cause
> elf2flt to generate a "Has-PIC-GOT" flat binary, which doesn't work on
> ARM. In fact, elf2flt on ARM really expect to have non-PIC code as
                                       ^^^^^^expects

> input, so we must disable DOPIC in the uClibc configuration.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

  Otherwise:
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>


  Though I wonder: shouldn't uClibc detect this by itself? Similar to the BX 
handling that you removed. Adding Waldemar in Cc to think about this.

  Regards,
  Arnout


> ---
>   package/uclibc/uclibc.mk | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
> index ad94494..e3e45f7 100644
> --- a/package/uclibc/uclibc.mk
> +++ b/package/uclibc/uclibc.mk
> @@ -82,6 +82,12 @@ ifeq ($(BR2_GCC_VERSION_4_7_X)$(BR2_GCC_VERSION_4_8_X):$(BR2_ARM_INSTRUCTIONS_TH
>   UCLIBC_EXTRA_CFLAGS += -marm
>   endif
>
> +ifeq ($(BR2_BINFMT_FLAT),y)
> +define UCLIBC_ARM_BINFMT_FLAT
> +	$(call KCONFIG_DISABLE_OPT,DOPIC,$(@D)/.config)
> +endef
> +endif
> +
>   endif # arm
>
>   #
> @@ -354,6 +360,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
>   	$(UCLIBC_ARC_TYPE_CONFIG)
>   	$(UCLIBC_ARC_PAGE_SIZE_CONFIG)
>   	$(UCLIBC_ARM_ABI_CONFIG)
> +	$(UCLIBC_ARM_BINFMT_FLAT)
>   	$(UCLIBC_MIPS_ABI_CONFIG)
>   	$(UCLIBC_MIPS_ISA_CONFIG)
>   	$(UCLIBC_SH_TYPE_CONFIG)
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (17 preceding siblings ...)
  2016-03-18 21:17 ` [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
@ 2016-03-19 16:12 ` Arnout Vandecappelle
  2016-03-20 14:39 ` Thomas Petazzoni
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 51+ messages in thread
From: Arnout Vandecappelle @ 2016-03-19 16:12 UTC (permalink / raw)
  To: buildroot

On 03/18/16 22:08, Thomas Petazzoni wrote:
> Hello,
>
> Here is the v2 of the patches that add support for ARM Cortex-M and
> STM32 defconfigs.

  Hi Thomas,

  Since there are quite a few Rev's/Acks already, I propose that you commit part 
of the series before posting a v3.

  Regards,
  Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v2 08/17] uclibc: context functions are not Thumb-compatible
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 08/17] uclibc: context functions are not Thumb-compatible Thomas Petazzoni
@ 2016-03-19 16:20   ` Arnout Vandecappelle
  2016-03-19 18:07     ` Thomas Petazzoni
  0 siblings, 1 reply; 51+ messages in thread
From: Arnout Vandecappelle @ 2016-03-19 16:20 UTC (permalink / raw)
  To: buildroot

On 03/18/16 22:08, Thomas Petazzoni wrote:
> On Thumb1 platforms and Thumb2 platforms that support the ARM

  This sentence is a bit weird, unless you realise that we don't have any thumb1 
platforms that don't have ARM instructions.

> instructions set, there is no problem, as the context functions are
> built unconditionally in ARM mode.
>
> However, on Thumb2 platforms that only support the Thumb2 instruction
> set, the context functions cannot build as the assembler code is not
> Thumb-ready. Therefore, those functions must be disabled.

  It may be useful to note that this will break packages that rely on the 
context functions, so that these packages must be disabled for that architecture 
combination.

  BTW, for that reason, it may be better to create a Kconfig blind option to 
encode this situation.

  In summary, a better commit message could be:

uclibc: context functions are not Thumb-compatible

On platforms that do support the ARM instruction set, there is no problem, as 
the context functions are built unconditionally in ARM mode.

However, on platforms that only support the Thumb instruction set, the context 
functions cannot be built since the assembler code is not Thumb-ready. 
Therefore, these functions must be disabled. All Thumb1 platforms support ARM 
instructions, so this is only relevant for Thumb2 platforms (i.e., Cortex-M).

Note that some packages require the context functions, so these will fail to 
build on these platforms. Those will be handled in later patches.


  Regards,
  Arnout

>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>   package/uclibc/uclibc.mk | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/package/uclibc/uclibc.mk b/package/uclibc/uclibc.mk
> index e3e45f7..4698132 100644
> --- a/package/uclibc/uclibc.mk
> +++ b/package/uclibc/uclibc.mk
> @@ -88,6 +88,12 @@ define UCLIBC_ARM_BINFMT_FLAT
>   endef
>   endif
>
> +ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB2):$(BR2_ARM_CPU_HAS_ARM),y:)
> +define UCLIBC_ARM_NO_CONTEXT_FUNCS
> +	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_CONTEXT_FUNCS,$(@D)/.config)
> +endef
> +endif
> +
>   endif # arm
>
>   #
> @@ -361,6 +367,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
>   	$(UCLIBC_ARC_PAGE_SIZE_CONFIG)
>   	$(UCLIBC_ARM_ABI_CONFIG)
>   	$(UCLIBC_ARM_BINFMT_FLAT)
> +	$(UCLIBC_ARM_NO_CONTEXT_FUNCS)
>   	$(UCLIBC_MIPS_ABI_CONFIG)
>   	$(UCLIBC_MIPS_ISA_CONFIG)
>   	$(UCLIBC_SH_TYPE_CONFIG)
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v2 08/17] uclibc: context functions are not Thumb-compatible
  2016-03-19 16:20   ` Arnout Vandecappelle
@ 2016-03-19 18:07     ` Thomas Petazzoni
  2016-03-20 19:39       ` Arnout Vandecappelle
  0 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-19 18:07 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 19 Mar 2016 17:20:09 +0100, Arnout Vandecappelle wrote:
> On 03/18/16 22:08, Thomas Petazzoni wrote:
> > On Thumb1 platforms and Thumb2 platforms that support the ARM
> 
>   This sentence is a bit weird, unless you realise that we don't have any thumb1 
> platforms that don't have ARM instructions.

Right.

>   It may be useful to note that this will break packages that rely on the 
> context functions, so that these packages must be disabled for that architecture 
> combination.

Correct, but we already have such a case with musl, which doesn't
implement the context functions.

>   BTW, for that reason, it may be better to create a Kconfig blind option to 
> encode this situation.

I think we need to see how many packages use such functions. Probably
not many.

> uclibc: context functions are not Thumb-compatible
> 
> On platforms that do support the ARM instruction set, there is no problem, as 
> the context functions are built unconditionally in ARM mode.
> 
> However, on platforms that only support the Thumb instruction set, the context 
> functions cannot be built since the assembler code is not Thumb-ready. 
> Therefore, these functions must be disabled. All Thumb1 platforms support ARM 
> instructions, so this is only relevant for Thumb2 platforms (i.e., Cortex-M).

I would do: "only relevant for Thumb2-only platforms". Cortex-A is a
Thumb2 platform, but does not have any problem as it also supports the
ARM instruction set.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT Thomas Petazzoni
  2016-03-19 16:11   ` Arnout Vandecappelle
@ 2016-03-19 19:27   ` Ezequiel Garcia
  2016-03-19 20:50     ` Thomas Petazzoni
  1 sibling, 1 reply; 51+ messages in thread
From: Ezequiel Garcia @ 2016-03-19 19:27 UTC (permalink / raw)
  To: buildroot

+Waldemar

On 18 March 2016 at 18:08, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> As explained by Waldemar, enabling DOPIC in uClibc will lead to the
> creation of a Position Independent library. In turn, this will cause
> elf2flt to generate a "Has-PIC-GOT" flat binary, which doesn't work on
> ARM. In fact, elf2flt on ARM really expect to have non-PIC code as
> input, so we must disable DOPIC in the uClibc configuration.
>

While testing on LPC4350, I found that Lua is built with the Has-PIC-GOT flag:

$ output/host/usr/bin/arm-buildroot-uclinux-uclibcgnueabi-flthdr
output/target/usr/bin/lua
output/target/usr/bin/lua
    Magic:        bFLT
    Rev:          4
    Build Date:   Sat Mar 19 16:14:03 2016
    Entry:        0x45
    Data Start:   0x1f08c
    Data End:     0x23ed8
    BSS End:      0x260c0
    Stack Size:   0x1000
    Reloc Start:  0x23ed8
    Reloc Count:  0x214
    Flags:        0x2 ( Has-PIC-GOT )

The Lua interpreter is not loaded by the binfmt_flat loader, and the
kernel says:

  BINFMT_FLAT: reloc outside program 0x7fffd3e4 (0 - 0x26080/0x1f04c),
killing lua!

When DEBUG is defined in fs/binfmt_flat.c, the kernel says:

  BINFMT_FLAT: reference 0xffd3e4 to shared library 127, killing lua!

On the other side, atftp throws the same error:

  BINFMT_FLAT: reference 0xa0100 to shared library 161, killing atftp!

Any ideas?
-- 
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar

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

* [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT
  2016-03-19 19:27   ` Ezequiel Garcia
@ 2016-03-19 20:50     ` Thomas Petazzoni
  2016-03-20  1:59       ` Ezequiel Garcia
  0 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-19 20:50 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 19 Mar 2016 16:27:19 -0300, Ezequiel Garcia wrote:

> On 18 March 2016 at 18:08, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
> > As explained by Waldemar, enabling DOPIC in uClibc will lead to the
> > creation of a Position Independent library. In turn, this will cause
> > elf2flt to generate a "Has-PIC-GOT" flat binary, which doesn't work on
> > ARM. In fact, elf2flt on ARM really expect to have non-PIC code as
> > input, so we must disable DOPIC in the uClibc configuration.
> >
> 
> While testing on LPC4350, I found that Lua is built with the Has-PIC-GOT flag:
> 
> $ output/host/usr/bin/arm-buildroot-uclinux-uclibcgnueabi-flthdr
> output/target/usr/bin/lua
> output/target/usr/bin/lua
>     Magic:        bFLT
>     Rev:          4
>     Build Date:   Sat Mar 19 16:14:03 2016
>     Entry:        0x45
>     Data Start:   0x1f08c
>     Data End:     0x23ed8
>     BSS End:      0x260c0
>     Stack Size:   0x1000
>     Reloc Start:  0x23ed8
>     Reloc Count:  0x214
>     Flags:        0x2 ( Has-PIC-GOT )
> 
> The Lua interpreter is not loaded by the binfmt_flat loader, and the
> kernel says:
> 
>   BINFMT_FLAT: reloc outside program 0x7fffd3e4 (0 - 0x26080/0x1f04c),
> killing lua!
> 
> When DEBUG is defined in fs/binfmt_flat.c, the kernel says:
> 
>   BINFMT_FLAT: reference 0xffd3e4 to shared library 127, killing lua!
> 
> On the other side, atftp throws the same error:
> 
>   BINFMT_FLAT: reference 0xa0100 to shared library 161, killing atftp!
> 
> Any ideas?

Thanks for this testing. Is lua using threads by any chance? I for sure
know that the thread support is causing errors similar to the one that
you are reporting.

The ARM noMMU support is preliminary, for now I've only tested Busybox
and a few other small programs. Once this preliminary support is
merged, we can start looking at additional problems. For example,
adding a check at the end of the build that all binaries have the
appropriate BFLT flags.

Waldemar: in fact maybe the issue I had with threads is that as soon as
you link with -lpthread, you have a Has-PIC-GOT flagged BFLT. I'll
check that when I find some time.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT
  2016-03-19 20:50     ` Thomas Petazzoni
@ 2016-03-20  1:59       ` Ezequiel Garcia
  0 siblings, 0 replies; 51+ messages in thread
From: Ezequiel Garcia @ 2016-03-20  1:59 UTC (permalink / raw)
  To: buildroot

On 19 March 2016 at 17:50, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Sat, 19 Mar 2016 16:27:19 -0300, Ezequiel Garcia wrote:
>
>> On 18 March 2016 at 18:08, Thomas Petazzoni
>> <thomas.petazzoni@free-electrons.com> wrote:
>> > As explained by Waldemar, enabling DOPIC in uClibc will lead to the
>> > creation of a Position Independent library. In turn, this will cause
>> > elf2flt to generate a "Has-PIC-GOT" flat binary, which doesn't work on
>> > ARM. In fact, elf2flt on ARM really expect to have non-PIC code as
>> > input, so we must disable DOPIC in the uClibc configuration.
>> >
>>
>> While testing on LPC4350, I found that Lua is built with the Has-PIC-GOT flag:
>>
>> $ output/host/usr/bin/arm-buildroot-uclinux-uclibcgnueabi-flthdr
>> output/target/usr/bin/lua
>> output/target/usr/bin/lua
>>     Magic:        bFLT
>>     Rev:          4
>>     Build Date:   Sat Mar 19 16:14:03 2016
>>     Entry:        0x45
>>     Data Start:   0x1f08c
>>     Data End:     0x23ed8
>>     BSS End:      0x260c0
>>     Stack Size:   0x1000
>>     Reloc Start:  0x23ed8
>>     Reloc Count:  0x214
>>     Flags:        0x2 ( Has-PIC-GOT )
>>
>> The Lua interpreter is not loaded by the binfmt_flat loader, and the
>> kernel says:
>>
>>   BINFMT_FLAT: reloc outside program 0x7fffd3e4 (0 - 0x26080/0x1f04c),
>> killing lua!
>>
>> When DEBUG is defined in fs/binfmt_flat.c, the kernel says:
>>
>>   BINFMT_FLAT: reference 0xffd3e4 to shared library 127, killing lua!
>>
>> On the other side, atftp throws the same error:
>>
>>   BINFMT_FLAT: reference 0xa0100 to shared library 161, killing atftp!
>>
>> Any ideas?
>
> Thanks for this testing. Is lua using threads by any chance? I for sure
> know that the thread support is causing errors similar to the one that
> you are reporting.
>

No, Lua doesn't uses threads.

> The ARM noMMU support is preliminary, for now I've only tested Busybox
> and a few other small programs. Once this preliminary support is
> merged, we can start looking at additional problems.

Sure, I'm not at all objecting this patchset. I've tested some
programs and all of them seem to work fine, with the sole exception of
lua and atftp.

Interestingly, the atftp binary does not have the Has-PIC-GOT flag
set... so I don't know if it's the real reason for the issue.
-- 
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar

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

* [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (18 preceding siblings ...)
  2016-03-19 16:12 ` Arnout Vandecappelle
@ 2016-03-20 14:39 ` Thomas Petazzoni
  2016-03-21  9:49 ` Lee Jones
  2016-03-29 22:28 ` Thomas Petazzoni
  21 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-20 14:39 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 18 Mar 2016 22:08:02 +0100, Thomas Petazzoni wrote:

> Thomas Petazzoni (15):
>   arch/arm: introduce and use BR2_ARM_CPU_ARMV7M
>   arch/arm: Cortex-M3 provides only Thumb-2
>   arch/arm: add Cortex-M4 entry

Those three initial patches have been applied.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 08/17] uclibc: context functions are not Thumb-compatible
  2016-03-19 18:07     ` Thomas Petazzoni
@ 2016-03-20 19:39       ` Arnout Vandecappelle
  0 siblings, 0 replies; 51+ messages in thread
From: Arnout Vandecappelle @ 2016-03-20 19:39 UTC (permalink / raw)
  To: buildroot

On 03/19/16 19:07, Thomas Petazzoni wrote:
> Hello,
>
> On Sat, 19 Mar 2016 17:20:09 +0100, Arnout Vandecappelle wrote:
[snip]
>> uclibc: context functions are not Thumb-compatible
>>
>> On platforms that do support the ARM instruction set, there is no problem, as
>> the context functions are built unconditionally in ARM mode.
>>
>> However, on platforms that only support the Thumb instruction set, the context
>> functions cannot be built since the assembler code is not Thumb-ready.
>> Therefore, these functions must be disabled. All Thumb1 platforms support ARM
>> instructions, so this is only relevant for Thumb2 platforms (i.e., Cortex-M).
>
> I would do: "only relevant for Thumb2-only platforms". Cortex-A is a
> Thumb2 platform, but does not have any problem as it also supports the
> ARM instruction set.

  Right!

  Regards,
  Arnout



-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v2 17/17] configs/stm32f469_disco: new configuration for STM32F469 Discovery board
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 17/17] configs/stm32f469_disco: new configuration for STM32F469 " Thomas Petazzoni
@ 2016-03-21  9:46   ` Lee Jones
  0 siblings, 0 replies; 51+ messages in thread
From: Lee Jones @ 2016-03-21  9:46 UTC (permalink / raw)
  To: buildroot

On Fri, 18 Mar 2016, Thomas Petazzoni wrote:

> From: Lee Jones <lee.jones@linaro.org>
> 
> Similar to stm32f429_disco, this commit adds a configuration for the
> Cortex-M4 based STM32F469 platform.
> 
> It requires a few kernel patches, which have already been submitted
> upstream, as well as a small OpenOCD patch. Besides that, it re-uses
> most of what has been added for the STM32F429 platform.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 
> [Thomas:
>  - squash multiple patches from Lee Jones into one
>  - improve the readme.txt file
>  - sync the defconfig with the adaptations made to the stm32f429
>    configuration.]
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  board/stmicroelectronics/stm32f469-disco/flash.sh  |  20 ++++
>  ...-ARM-stm32-Identify-a-new-board-STM32F469.patch |  25 +++++
>  ...upply-a-DTS-file-for-the-STM32F469-Discov.patch | 101 +++++++++++++++++++++
>  ...-Add-new-config-fragment-to-change-RAM-st.patch |  28 ++++++
>  .../patches/openocd/0001-add-config.patch          |  37 ++++++++
>  .../patches/openocd/0002-flash-nor.patch           |  37 ++++++++
>  .../stmicroelectronics/stm32f469-disco/readme.txt  |  19 ++++
>  configs/stm32f469_disco_defconfig                  |  19 ++++
>  8 files changed, 286 insertions(+)
>  create mode 100755 board/stmicroelectronics/stm32f469-disco/flash.sh
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32-Identify-a-new-board-STM32F469.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0002-ARM-stm32-Supply-a-DTS-file-for-the-STM32F469-Discov.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0003-ARM-configs-Add-new-config-fragment-to-change-RAM-st.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/openocd/0001-add-config.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/openocd/0002-flash-nor.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/readme.txt
>  create mode 100644 configs/stm32f469_disco_defconfig

[...]

> diff --git a/board/stmicroelectronics/stm32f469-disco/readme.txt b/board/stmicroelectronics/stm32f469-disco/readme.txt
> new file mode 100644
> index 0000000..3b88496
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32f469-disco/readme.txt
> @@ -0,0 +1,19 @@
> +STM32F469 Discovery
> +===================
> +
> +This tutorial describes how to use the predefined Buildroot
> +configuration for the STM32F469 Discovery evaluation platform.
> +
> +Building
> +--------
> +
> +  make stm32f469_disco_defconfig
> +  make
> +
> +Flashing
> +--------
> +
> +  ./board/stmicroelectronics/stm32/stm32f469-disco/flash.sh output/

Looks like you've removed the stm32 directory, but still reference it
from readme.txt

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [Buildroot] [PATCH v2 16/17] configs/stm32f429_disco: new configuration for STM32F429 Discovery board
  2016-03-18 21:08 ` [Buildroot] [PATCH v2 16/17] configs/stm32f429_disco: new configuration for STM32F429 Discovery board Thomas Petazzoni
@ 2016-03-21  9:48   ` Lee Jones
  2016-03-21 10:39     ` Thomas Petazzoni
  0 siblings, 1 reply; 51+ messages in thread
From: Lee Jones @ 2016-03-21  9:48 UTC (permalink / raw)
  To: buildroot

On Fri, 18 Mar 2016, Thomas Petazzoni wrote:

> From: Lee Jones <lee.jones@linaro.org>
> 
> This commit adds a defconfig for the STM32F429 platform, which is
> based on a Cortex-M4 core from ST Microelectronics. It is therefore
> the first noMMU ARM platform supported in Buildroot.
> 
> This commit includes some files that will be common to several STM32
> platforms (hence in board/stmicroelectronics) and some files that are
> specific to the STM32F429 (hence in
> board/stmicroelectronics/stm32f429-disco). More specifically, this
> commit adds:
> 
>  - A minimal Busybox configuration, which is small enough to boot
>    without causing OOM on such small noMMU platforms. The resulting
>    Busybox, statically linked with uClibc-ng, weights around 220
>    KB. For now, this file is located in board/stmicroelectronics/, but
>    we might consider moving it to package/busybox/ in the future if
>    needed.
> 
>  - A post-build script that removes the mounting of /dev/pts (not
>    enabled in the kernel and not very useful for a system that has no
>    network and no X), and removes the network related init script and
>    configuration files (no network support).
> 
>  - A flash.sh script, to perform the right OpenOCD invocations to
>    reflash the board.
> 
>  - One small kernel patch to adjust the kernel command line in the
>    Device Tree, since it's the only way to do so.
> 
>  - The usual readme.txt file.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> [Thomas:
>  - squashed multiple patches from Lee Jones together
>  - added the minimal Busybox configuration
>  - added the post-build script
>  - improved the flashing script to not hardcode the location of the
>    output directory
>  - add the small kernel patch
>  - improve the readme.txt file
>  - test on HW the resulting image, after using the internal toolchain.]
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  board/stmicroelectronics/busybox-minimal.config    | 1057 ++++++++++++++++++++
>  board/stmicroelectronics/stm32-post-build.sh       |    8 +
>  board/stmicroelectronics/stm32f429-disco/flash.sh  |   20 +
>  ...49-disco-don-t-force-init-in-chosen-boota.patch |   32 +
>  .../stmicroelectronics/stm32f429-disco/readme.txt  |   30 +
>  configs/stm32f429_disco_defconfig                  |   18 +
>  6 files changed, 1165 insertions(+)
>  create mode 100644 board/stmicroelectronics/busybox-minimal.config
>  create mode 100755 board/stmicroelectronics/stm32-post-build.sh
>  create mode 100755 board/stmicroelectronics/stm32f429-disco/flash.sh
>  create mode 100644 board/stmicroelectronics/stm32f429-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch
>  create mode 100644 board/stmicroelectronics/stm32f429-disco/readme.txt
>  create mode 100644 configs/stm32f429_disco_defconfig

[...]

> diff --git a/board/stmicroelectronics/stm32f429-disco/readme.txt b/board/stmicroelectronics/stm32f429-disco/readme.txt
> new file mode 100644
> index 0000000..afe0f11
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32f429-disco/readme.txt
> @@ -0,0 +1,30 @@
> +STM32F429 Discovery
> +===================
> +
> +This tutorial describes how to use the predefined Buildroot
> +configuration for the STM32F429 Discovery evaluation platform.
> +
> +Building
> +--------
> +
> +  make stm32f429_disco_defconfig
> +  make
> +
> +Wire the UART
> +-------------
> +
> +Use a USB to TTL adapter, and connect:
> +
> + - RX to PA9
> + - TX to PA10
> + - GND to one of the GND available on the board
> +
> +The UART is configured at 115200.
> +
> +Flashing
> +--------
> +
> +  ./board/stmicroelectronics/stm32/stm32f429-disco/flash.sh output/

Looks like you've removed the stm32 directory, but still reference it
from readme.txt

[...]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (19 preceding siblings ...)
  2016-03-20 14:39 ` Thomas Petazzoni
@ 2016-03-21  9:49 ` Lee Jones
  2016-03-29 22:28 ` Thomas Petazzoni
  21 siblings, 0 replies; 51+ messages in thread
From: Lee Jones @ 2016-03-21  9:49 UTC (permalink / raw)
  To: buildroot

On Fri, 18 Mar 2016, Thomas Petazzoni wrote:

> Hello,
> 
> Here is the v2 of the patches that add support for ARM Cortex-M and
> STM32 defconfigs.
> 
> The changes from v1 are:
> 
>  - Added Arnout Acked-by on patch "arch/arm: introduce and use
>    BR2_ARM_CPU_ARMV7M".
> 
>  - Added Arnout Reviewed-by on patch "arch/arm: add Cortex-M4 entry"
> 
>  - Replace the complicated COMPILE_IN_THUMB/USE_BX logic in uclibc.mk
>    by patches against uClibc-ng that allow to completely get rid of
>    those options. Then simplified uclibc.mk accordingly.
> 
>  - Remove hard-float suport for now, since there is no support for it
>    in the kernel. Suggested by Arnout.
> 
>  - Use BR2_BINFMT_FLAT instead of BR2_USE_MMU to decide whether to
>    disable DOPIC in uClibc. Suggested by Arnout.
> 
>  - Fix typo in DOPIC commit log. Noticed by Arnout.
> 
>  - Added Arnout Reviewed-by on patch "uclibc: NPTL thread
>    implementation only available on MMU platforms".
> 
>  - In the patch that ensures musl is built for the ARM instruction set
>    when Thumb1 is selected, clarify the comment. Suggested by Arnout.
> 
>  - Added Arnout Reviewed-by on package/Makefile.in: adjust LDFLAGS for
>    elf2flt.
> 
>  - Add hash file to the elf2flt package. Suggested by Arnout.
> 
>  - Improve the elf2flt upstream change commit log, to explain more
>    clearly why the patch from Waldemar is included in this
>    commit. Done after a comment made by Arnout.
> 
>  - Merge the elf2flt --disable-werror into the elf2flt upstream change
>    patch, since it's actually related (switching upstream has changed
>    the source code, which is the reason for the new warnings that
>    cause the build issues).
> 
>  - Switch to kernel 4.5 for the STM32 defconfigs
> 
>  - Regenerate Linux patches for STM32F469 since they were not applying
>    correctly (reported by Maxime Coquelin).
> 
> Thanks!
> 
> Thomas
> 
> Lee Jones (2):
>   configs/stm32f429_disco: new configuration for STM32F429 Discovery
>     board
>   configs/stm32f469_disco: new configuration for STM32F469 Discovery
>     board
> 
> Thomas Petazzoni (15):
>   arch/arm: introduce and use BR2_ARM_CPU_ARMV7M
>   arch/arm: Cortex-M3 provides only Thumb-2
>   arch/arm: add Cortex-M4 entry
>   uclibc: add patches to simplify Thumb handling
>   uclibc: remove USE_BX handling
>   uclibc: gcc >= 4.9 can build a thumb/thread uclibc
>   uclibc: disable DOPIC on ARM FLAT
>   uclibc: context functions are not Thumb-compatible
>   uclibc: NPTL thread implementation only available on MMU platforms
>   musl: build broken on Thumb, use ARM mode
>   toolchain-buildroot: update glibc comment for noMMU
>   toolchain-buildroot: don't show musl on noMMU platforms
>   package/Makefile.in: adjust LDFLAGS for elf2flt
>   elf2flt: use new upstream site and add ARM patch
>   afboot-stm32: use the Buildroot toolchain
> 
>  arch/Config.in.arm                                 |   10 +-
>  board/stmicroelectronics/busybox-minimal.config    | 1057 ++++++++++++++++++++
>  board/stmicroelectronics/stm32-post-build.sh       |    8 +
>  board/stmicroelectronics/stm32f429-disco/flash.sh  |   20 +
>  ...49-disco-don-t-force-init-in-chosen-boota.patch |   32 +
>  .../stmicroelectronics/stm32f429-disco/readme.txt  |   30 +
>  board/stmicroelectronics/stm32f469-disco/flash.sh  |   20 +
>  ...-ARM-stm32-Identify-a-new-board-STM32F469.patch |   25 +
>  ...upply-a-DTS-file-for-the-STM32F469-Discov.patch |  101 ++
>  ...-Add-new-config-fragment-to-change-RAM-st.patch |   28 +
>  .../patches/openocd/0001-add-config.patch          |   37 +
>  .../patches/openocd/0002-flash-nor.patch           |   37 +
>  .../stmicroelectronics/stm32f469-disco/readme.txt  |   19 +
>  .../0001-Use-ld-instead-of-gcc-for-linking.patch   |   61 ++
>  boot/afboot-stm32/afboot-stm32.mk                  |    2 +-
>  configs/stm32f429_disco_defconfig                  |   18 +
>  configs/stm32f469_disco_defconfig                  |   19 +
>  package/Makefile.in                                |    2 +-
>  .../0001-allow-to-build-arm-flat-binaries.patch    |  123 +++
>  package/elf2flt/elf2flt.hash                       |    2 +
>  package/elf2flt/elf2flt.mk                         |    8 +-
>  package/musl/musl.mk                               |    6 +
>  .../0001-arm-remove-use-of-USE_BX-option.patch     |   53 +
>  package/uclibc/0002-arm-remove-USE_BX-option.patch |   40 +
>  .../0003-arm-remove-use-of-USE_LDREXSTREX.patch    |   49 +
>  .../uclibc/0004-arm-remove-USE_LDREXSTREX.patch    |   34 +
>  .../uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch  |   43 +
>  package/uclibc/Config.in                           |    7 +-
>  package/uclibc/uclibc.mk                           |   23 +-
>  toolchain/toolchain-buildroot/Config.in            |    4 +
>  30 files changed, 1897 insertions(+), 21 deletions(-)
>  create mode 100644 board/stmicroelectronics/busybox-minimal.config
>  create mode 100755 board/stmicroelectronics/stm32-post-build.sh
>  create mode 100755 board/stmicroelectronics/stm32f429-disco/flash.sh
>  create mode 100644 board/stmicroelectronics/stm32f429-disco/patches/linux/0001-ARM-stm32f249-disco-don-t-force-init-in-chosen-boota.patch
>  create mode 100644 board/stmicroelectronics/stm32f429-disco/readme.txt
>  create mode 100755 board/stmicroelectronics/stm32f469-disco/flash.sh
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0001-ARM-stm32-Identify-a-new-board-STM32F469.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0002-ARM-stm32-Supply-a-DTS-file-for-the-STM32F469-Discov.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/linux/0003-ARM-configs-Add-new-config-fragment-to-change-RAM-st.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/openocd/0001-add-config.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/patches/openocd/0002-flash-nor.patch
>  create mode 100644 board/stmicroelectronics/stm32f469-disco/readme.txt
>  create mode 100644 boot/afboot-stm32/0001-Use-ld-instead-of-gcc-for-linking.patch
>  create mode 100644 configs/stm32f429_disco_defconfig
>  create mode 100644 configs/stm32f469_disco_defconfig
>  create mode 100644 package/elf2flt/0001-allow-to-build-arm-flat-binaries.patch
>  create mode 100644 package/elf2flt/elf2flt.hash
>  create mode 100644 package/uclibc/0001-arm-remove-use-of-USE_BX-option.patch
>  create mode 100644 package/uclibc/0002-arm-remove-USE_BX-option.patch
>  create mode 100644 package/uclibc/0003-arm-remove-use-of-USE_LDREXSTREX.patch
>  create mode 100644 package/uclibc/0004-arm-remove-USE_LDREXSTREX.patch
>  create mode 100644 package/uclibc/0005-arm-remove-COMPILE_IN_THUMB.patch

Apart from the document change already requested:

  Tested-by: Lee Jones <lee.jones@linaro.org>

... on STM32F469-DISCO.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [Buildroot] [PATCH v2 16/17] configs/stm32f429_disco: new configuration for STM32F429 Discovery board
  2016-03-21  9:48   ` Lee Jones
@ 2016-03-21 10:39     ` Thomas Petazzoni
  0 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-21 10:39 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 21 Mar 2016 09:48:01 +0000, Lee Jones wrote:

> > +  ./board/stmicroelectronics/stm32/stm32f429-disco/flash.sh output/
> 
> Looks like you've removed the stm32 directory, but still reference it
> from readme.txt

Right, will fix, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 04/17] uclibc: add patches to simplify Thumb handling
  2016-03-19 15:46   ` Arnout Vandecappelle
@ 2016-03-29 22:14     ` Thomas Petazzoni
  0 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-29 22:14 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 19 Mar 2016 16:46:04 +0100, Arnout Vandecappelle wrote:

> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Thanks!

>   Upstream status? Knowing Waldemar's lightning reflexes, we will probably just 
> bump the uClibc version rather than having these patches in Buildroot :-)

I've submitted upstream 10 days ago. Got a bit of feedback from Rich
Felker, but I replied to it and I don't think the feedback calls for a
new iteration. No feedback from Waldemar so far.

Note that the version sent upstream is in one single patch, as that's
what Waldemar requested on IRC. I'm going to apply my patch to
Buildroot with the separate patches, and I'll rework that later on
when/if the patch gets accepted upstream.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 06/17] uclibc: gcc >= 4.9 can build a thumb/thread uclibc
  2016-03-19 15:53   ` Arnout Vandecappelle
@ 2016-03-29 22:18     ` Thomas Petazzoni
  2016-03-29 22:49       ` Arnout Vandecappelle
  0 siblings, 1 reply; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-29 22:18 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 19 Mar 2016 16:53:16 +0100, Arnout Vandecappelle wrote:

> > -# Thumb build is broken with threads, build in ARM mode
> > -ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
> > +# Thumb1 build is broken with threads with old gcc versions (4.7 and
> > +# 4.8). Since all cores supporting Thumb1 also support ARM, we use ARM
> > +# code in this case.
> > +ifeq ($(BR2_GCC_VERSION_4_7_X)$(BR2_GCC_VERSION_4_8_X):$(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),y:yy)
> 
>   This line is a bit long so would be nicer to split off into separate 
> variables. This kind of logic is also much easier to do (and certainly easier to 
> understand) in Kconfig than in the make language - like we had for BX before you 
> removed it.

I agree this line is a bit long. But how would be named this Config.in
option? BR2_PACKAGE_UCLIBC_FORCE_ARM ?

config BR2_PACKAGE_UCLIBC_FORCE_ARM
	bool
	depends on BR2_ARM_INSTRUCTIONS_THUMB
	depends on BR2_TOOLCHAIN_HAS_THREADS
	default y if BR2_GCC_VERSION_4_7_X
	default y if BR2_GCC_VERSION_4_8_X

Something like that?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT
  2016-03-19 16:11   ` Arnout Vandecappelle
@ 2016-03-29 22:20     ` Thomas Petazzoni
  0 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-29 22:20 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 19 Mar 2016 17:11:58 +0100, Arnout Vandecappelle wrote:

>   Though I wonder: shouldn't uClibc detect this by itself? Similar to the BX 
> handling that you removed. Adding Waldemar in Cc to think about this.

I don't yet fully understand the different modes of elf2flt, and why
DOPIC affects what elf2flt is capable of doing/not doing.

However, if as Waldemar told me, a uClibc built with DOPIC=y will not
work with elf2flt on ARM, then I could indeed send a patch to uClibc to
disable DOPIC on ARM/noMMU.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs
  2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
                   ` (20 preceding siblings ...)
  2016-03-21  9:49 ` Lee Jones
@ 2016-03-29 22:28 ` Thomas Petazzoni
  21 siblings, 0 replies; 51+ messages in thread
From: Thomas Petazzoni @ 2016-03-29 22:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 18 Mar 2016 22:08:02 +0100, Thomas Petazzoni wrote:

>   uclibc: add patches to simplify Thumb handling
>   uclibc: remove USE_BX handling
>   uclibc: gcc >= 4.9 can build a thumb/thread uclibc
>   uclibc: disable DOPIC on ARM FLAT

I've applied those four patches.

>   uclibc: NPTL thread implementation only available on MMU platforms

And also this one.

The other ones haven't received Acked-by/Reviewed-by, and some of them
have comments that I will address.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2 06/17] uclibc: gcc >= 4.9 can build a thumb/thread uclibc
  2016-03-29 22:18     ` Thomas Petazzoni
@ 2016-03-29 22:49       ` Arnout Vandecappelle
  0 siblings, 0 replies; 51+ messages in thread
From: Arnout Vandecappelle @ 2016-03-29 22:49 UTC (permalink / raw)
  To: buildroot

On 03/30/16 00:18, Thomas Petazzoni wrote:
> Hello,
>
> On Sat, 19 Mar 2016 16:53:16 +0100, Arnout Vandecappelle wrote:
>
>>> -# Thumb build is broken with threads, build in ARM mode
>>> -ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
>>> +# Thumb1 build is broken with threads with old gcc versions (4.7 and
>>> +# 4.8). Since all cores supporting Thumb1 also support ARM, we use ARM
>>> +# code in this case.
>>> +ifeq ($(BR2_GCC_VERSION_4_7_X)$(BR2_GCC_VERSION_4_8_X):$(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),y:yy)
>>
>>    This line is a bit long so would be nicer to split off into separate
>> variables. This kind of logic is also much easier to do (and certainly easier to
>> understand) in Kconfig than in the make language - like we had for BX before you
>> removed it.
>
> I agree this line is a bit long. But how would be named this Config.in
> option? BR2_PACKAGE_UCLIBC_FORCE_ARM ?

  Maybe FORCE_NO_THUMB?

>
> config BR2_PACKAGE_UCLIBC_FORCE_ARM
> 	bool
> 	depends on BR2_ARM_INSTRUCTIONS_THUMB
> 	depends on BR2_TOOLCHAIN_HAS_THREADS
> 	default y if BR2_GCC_VERSION_4_7_X
> 	default y if BR2_GCC_VERSION_4_8_X
>
> Something like that?

  Yep, that's it.


  Regards,
  Arnout

>
> Thomas
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

end of thread, other threads:[~2016-03-29 22:49 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-18 21:08 [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 01/17] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M Thomas Petazzoni
2016-03-18 22:30   ` Yann E. MORIN
2016-03-19 13:33     ` Thomas Petazzoni
2016-03-19 13:59       ` Yann E. MORIN
2016-03-19 14:08         ` Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 02/17] arch/arm: Cortex-M3 provides only Thumb-2 Thomas Petazzoni
2016-03-18 22:34   ` Yann E. MORIN
2016-03-19 15:33     ` Arnout Vandecappelle
2016-03-18 21:08 ` [Buildroot] [PATCH v2 03/17] arch/arm: add Cortex-M4 entry Thomas Petazzoni
2016-03-18 22:41   ` Yann E. MORIN
2016-03-18 21:08 ` [Buildroot] [PATCH v2 04/17] uclibc: add patches to simplify Thumb handling Thomas Petazzoni
2016-03-19 15:46   ` Arnout Vandecappelle
2016-03-29 22:14     ` Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 05/17] uclibc: remove USE_BX handling Thomas Petazzoni
2016-03-19 15:47   ` Arnout Vandecappelle
2016-03-18 21:08 ` [Buildroot] [PATCH v2 06/17] uclibc: gcc >= 4.9 can build a thumb/thread uclibc Thomas Petazzoni
2016-03-19 15:53   ` Arnout Vandecappelle
2016-03-29 22:18     ` Thomas Petazzoni
2016-03-29 22:49       ` Arnout Vandecappelle
2016-03-18 21:08 ` [Buildroot] [PATCH v2 07/17] uclibc: disable DOPIC on ARM FLAT Thomas Petazzoni
2016-03-19 16:11   ` Arnout Vandecappelle
2016-03-29 22:20     ` Thomas Petazzoni
2016-03-19 19:27   ` Ezequiel Garcia
2016-03-19 20:50     ` Thomas Petazzoni
2016-03-20  1:59       ` Ezequiel Garcia
2016-03-18 21:08 ` [Buildroot] [PATCH v2 08/17] uclibc: context functions are not Thumb-compatible Thomas Petazzoni
2016-03-19 16:20   ` Arnout Vandecappelle
2016-03-19 18:07     ` Thomas Petazzoni
2016-03-20 19:39       ` Arnout Vandecappelle
2016-03-18 21:08 ` [Buildroot] [PATCH v2 09/17] uclibc: NPTL thread implementation only available on MMU platforms Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 10/17] musl: build broken on Thumb, use ARM mode Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 11/17] toolchain-buildroot: update glibc comment for noMMU Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 12/17] toolchain-buildroot: don't show musl on noMMU platforms Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 13/17] package/Makefile.in: adjust LDFLAGS for elf2flt Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 14/17] elf2flt: use new upstream site and add ARM patch Thomas Petazzoni
2016-03-18 21:34   ` Ezequiel Garcia
2016-03-19 13:32     ` Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 15/17] afboot-stm32: use the Buildroot toolchain Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 16/17] configs/stm32f429_disco: new configuration for STM32F429 Discovery board Thomas Petazzoni
2016-03-21  9:48   ` Lee Jones
2016-03-21 10:39     ` Thomas Petazzoni
2016-03-18 21:08 ` [Buildroot] [PATCH v2 17/17] configs/stm32f469_disco: new configuration for STM32F469 " Thomas Petazzoni
2016-03-21  9:46   ` Lee Jones
2016-03-18 21:17 ` [Buildroot] [PATCH v2 00/17] ARM Cortex-M support and STM32 defconfigs Thomas Petazzoni
2016-03-18 22:49   ` Ezequiel Garcia
2016-03-19 13:32     ` Thomas Petazzoni
2016-03-19 16:12 ` Arnout Vandecappelle
2016-03-20 14:39 ` Thomas Petazzoni
2016-03-21  9:49 ` Lee Jones
2016-03-29 22:28 ` Thomas Petazzoni

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.