diff options
-rw-r--r-- | package/busybox/Config.in.manual | 7 | ||||
-rwxr-xr-x | scripts/flash.sh | 26 | ||||
-rw-r--r-- | target/linux/Config.in.kernelcfg | 2 | ||||
-rw-r--r-- | target/linux/patches/4.9.257/stm32.patch | 12 | ||||
-rw-r--r-- | toolchain/elf2flt/patches/453398f917d167f8c308c8f997270c48ae8f8b12/0005-arm.patch | 46 |
5 files changed, 87 insertions, 6 deletions
diff --git a/package/busybox/Config.in.manual b/package/busybox/Config.in.manual index 184ccb996..80554efd4 100644 --- a/package/busybox/Config.in.manual +++ b/package/busybox/Config.in.manual @@ -116,18 +116,14 @@ config ADK_PACKAGE_BUSYBOX_MINIMAL select BUSYBOX_DIFF select BUSYBOX_DU select BUSYBOX_ECHO - select BUSYBOX_EGREP if !BUSYBOX_DISABLE_GREP select BUSYBOX_ENV select BUSYBOX_EXPR select BUSYBOX_FIND if !BUSYBOX_DISABLE_FIND select BUSYBOX_GREP if !BUSYBOX_DISABLE_GREP - select BUSYBOX_GUNZIP - select BUSYBOX_GZIP select BUSYBOX_HALT select BUSYBOX_HEAD select BUSYBOX_ID - select BUSYBOX_INIT if ADK_RUNTIME_INIT_SYSV - select BUSYBOX_LESS if !BUSYBOX_DISABLE_LESS + select BUSYBOX_INIT select BUSYBOX_LN select BUSYBOX_LS select BUSYBOX_MKDIR @@ -142,7 +138,6 @@ config ADK_PACKAGE_BUSYBOX_MINIMAL select BUSYBOX_TAIL select BUSYBOX_FEATURE_FANCY_TAIL select BUSYBOX_TEE - select BUSYBOX_TAR if !BUSYBOX_DISABLE_TAR select BUSYBOX_TEST select BUSYBOX_TOUCH select BUSYBOX_TRUE diff --git a/scripts/flash.sh b/scripts/flash.sh new file mode 100755 index 000000000..3763cb7af --- /dev/null +++ b/scripts/flash.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +OUTPUT_DIR=$1 +BOARD_NAME=${2:-stm32f429disc1} + +if ! test -d "${OUTPUT_DIR}" ; then + echo "ERROR: no output directory specified." + echo "Usage: $0 OUTPUT_DIR BOARD_NAME" + echo "" + echo "Arguments:" + echo " OUTPUT_DIR The Buildroot output directory." + echo " BOARD_NAME One of the available boards among:" + echo " stm32f429discovery, stm32f429disc1" + exit 1 +fi + +./host_x86_64-linux-gnu/usr/bin/openocd -f board/${BOARD_NAME}.cfg \ + -c "init" \ + -c "reset init" \ + -c "flash probe 0" \ + -c "flash info 0" \ + -c "flash write_image erase ${OUTPUT_DIR}/stm32f429i-disco.bin 0x08000000" \ + -c "flash write_image erase ${OUTPUT_DIR}/stm32f429-disco.dtb 0x08004000" \ + -c "flash write_image erase ${OUTPUT_DIR}/st-stm32f429-initramfspiggyback-kernel 0x08008000" \ + -c "reset run" \ + -c "shutdown" diff --git a/target/linux/Config.in.kernelcfg b/target/linux/Config.in.kernelcfg index 2865f70c1..bd6f65b57 100644 --- a/target/linux/Config.in.kernelcfg +++ b/target/linux/Config.in.kernelcfg @@ -44,6 +44,8 @@ config ADK_TARGET_LINUX_KERNEL_DEFCONFIG default "edosk2674_defconfig" if ADK_TARGET_SYSTEM_HITACHI_EDOSK2674 default "x86_64_defconfig" if ADK_TARGET_SYSTEM_GENERIC_X86_64 default "i386_defconfig" if ADK_TARGET_SYSTEM_GENERIC_X86 + default "stm32_defconfig" if ADK_TARGET_SYSTEM_ST_STM32F429 + default "stm32_defconfig" if ADK_TARGET_SYSTEM_ST_STM32F769 default "" config ADK_TARGET_LINUX_KERNEL_CUSTOMCONFIG_PATH diff --git a/target/linux/patches/4.9.257/stm32.patch b/target/linux/patches/4.9.257/stm32.patch new file mode 100644 index 000000000..9071eab47 --- /dev/null +++ b/target/linux/patches/4.9.257/stm32.patch @@ -0,0 +1,12 @@ +diff -Nur linux-4.9.257.orig/arch/arm/boot/dts/stm32f429-disco.dts linux-4.9.257/arch/arm/boot/dts/stm32f429-disco.dts +--- linux-4.9.257.orig/arch/arm/boot/dts/stm32f429-disco.dts 2021-02-10 09:09:27.000000000 +0100 ++++ linux-4.9.257/arch/arm/boot/dts/stm32f429-disco.dts 2021-04-09 20:08:56.113152788 +0200 +@@ -53,7 +53,7 @@ + compatible = "st,stm32f429i-disco", "st,stm32f429"; + + chosen { +- bootargs = "root=/dev/ram rdinit=/linuxrc"; ++ bootargs = ""; + stdout-path = "serial0:115200n8"; + }; + diff --git a/toolchain/elf2flt/patches/453398f917d167f8c308c8f997270c48ae8f8b12/0005-arm.patch b/toolchain/elf2flt/patches/453398f917d167f8c308c8f997270c48ae8f8b12/0005-arm.patch new file mode 100644 index 000000000..247ff2b35 --- /dev/null +++ b/toolchain/elf2flt/patches/453398f917d167f8c308c8f997270c48ae8f8b12/0005-arm.patch @@ -0,0 +1,46 @@ +diff -Nur elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12.orig/elf2flt.c elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12/elf2flt.c +--- elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12.orig/elf2flt.c 2021-02-08 14:02:15.000000000 +0100 ++++ elf2flt-453398f917d167f8c308c8f997270c48ae8f8b12/elf2flt.c 2021-04-09 20:40:19.386179197 +0200 +@@ -424,7 +424,8 @@ + */ + if ((!pic_with_got || ALWAYS_RELOC_TEXT) && + ((a->flags & SEC_CODE) || +- ((a->flags & (SEC_DATA | SEC_READONLY)) == (SEC_DATA | SEC_READONLY)))) ++ ((a->flags & (SEC_DATA | SEC_READONLY | SEC_RELOC)) == ++ (SEC_DATA | SEC_READONLY | SEC_RELOC)))) + sectionp = text + (a->vma - text_vma); + else if (a->flags & SEC_DATA) + sectionp = data + (a->vma - data_vma); +@@ -1861,7 +1862,9 @@ + bfd_size_type sec_size; + bfd_vma sec_vma; + +- if (s->flags & SEC_CODE) { ++ if ((s->flags & SEC_CODE) || ++ ((s->flags & (SEC_DATA | SEC_READONLY | SEC_RELOC)) == ++ (SEC_DATA | SEC_READONLY | SEC_RELOC))) { + vma = &text_vma; + len = &text_len; + } else if (s->flags & SEC_DATA) { +@@ -1896,7 +1899,9 @@ + + /* Read in all text sections. */ + for (s = abs_bfd->sections; s != NULL; s = s->next) +- if (s->flags & SEC_CODE) ++ if ((s->flags & SEC_CODE) || ++ ((s->flags & (SEC_DATA | SEC_READONLY | SEC_RELOC)) == ++ (SEC_DATA | SEC_READONLY | SEC_RELOC))) + if (!bfd_get_section_contents(abs_bfd, s, + text + (s->vma - text_vma), 0, + bfd_section_size(abs_bfd, s))) +@@ -1922,7 +1927,9 @@ + + /* Read in all data sections. */ + for (s = abs_bfd->sections; s != NULL; s = s->next) +- if (s->flags & SEC_DATA) ++ if ((s->flags & SEC_DATA) && ++ ((s->flags & (SEC_READONLY | SEC_RELOC)) != ++ (SEC_READONLY | SEC_RELOC))) + if (!bfd_get_section_contents(abs_bfd, s, + data + (s->vma - data_vma), 0, + bfd_section_size(abs_bfd, s))) |