From 0e1dc3456fef34832ef67161f4a96d90363294ec Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Sun, 26 Oct 2014 14:14:07 +0100 Subject: MIPS: kconfig: add options for endianess select Add new Kconfig option to let the user select the targets endianess. Each target have to select SUPPORTS_BIG_ENDIAN and/or SUPPORTS_LITTLE_ENDIAN to indicate which endianess is supported. Signed-off-by: Daniel Schwierzeck --- arch/mips/Kconfig | 38 +++++++++++++++++++++++++ configs/dbau1000_defconfig | 1 + configs/dbau1100_defconfig | 1 + configs/dbau1500_defconfig | 1 + configs/dbau1550_defconfig | 1 + configs/dbau1550_el_defconfig | 3 +- configs/malta_defconfig | 2 +- configs/maltael_defconfig | 2 +- configs/pb1000_defconfig | 1 + configs/qemu_mips64_defconfig | 2 +- configs/qemu_mips64el_defconfig | 2 +- configs/qemu_mips_defconfig | 2 +- configs/qemu_mipsel_defconfig | 2 +- configs/vct_platinum_defconfig | 1 + configs/vct_platinum_onenand_defconfig | 1 + configs/vct_platinum_onenand_small_defconfig | 1 + configs/vct_platinum_small_defconfig | 1 + configs/vct_platinumavc_defconfig | 1 + configs/vct_platinumavc_onenand_defconfig | 1 + configs/vct_platinumavc_onenand_small_defconfig | 1 + configs/vct_platinumavc_small_defconfig | 1 + configs/vct_premium_defconfig | 1 + configs/vct_premium_onenand_defconfig | 1 + configs/vct_premium_onenand_small_defconfig | 1 + configs/vct_premium_small_defconfig | 1 + include/configs/pb1x00.h | 2 -- 26 files changed, 63 insertions(+), 9 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 9b72bab56b..f2e6a453fc 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -12,21 +12,31 @@ choice config TARGET_QEMU_MIPS bool "Support qemu-mips" + select SUPPORTS_BIG_ENDIAN + select SUPPORTS_LITTLE_ENDIAN config TARGET_MALTA bool "Support malta" + select SUPPORTS_BIG_ENDIAN + select SUPPORTS_LITTLE_ENDIAN config TARGET_VCT bool "Support vct" + select SUPPORTS_BIG_ENDIAN config TARGET_DBAU1X00 bool "Support dbau1x00" + select SUPPORTS_BIG_ENDIAN + select SUPPORTS_LITTLE_ENDIAN config TARGET_PB1X00 bool "Support pb1x00" + select SUPPORTS_LITTLE_ENDIAN config TARGET_QEMU_MIPS64 bool "Support qemu-mips64" + select SUPPORTS_BIG_ENDIAN + select SUPPORTS_LITTLE_ENDIAN endchoice @@ -36,4 +46,32 @@ source "board/micronas/vct/Kconfig" source "board/pb1x00/Kconfig" source "board/qemu-mips/Kconfig" +if MIPS + +choice + prompt "Endianness selection" + help + Some MIPS boards can be configured for either little or big endian + byte order. These modes require different U-Boot images. In general there + is one preferred byteorder for a particular system but some systems are + just as commonly used in the one or the other endianness. + +config SYS_BIG_ENDIAN + bool "Big endian" + depends on SUPPORTS_BIG_ENDIAN + +config SYS_LITTLE_ENDIAN + bool "Little endian" + depends on SUPPORTS_LITTLE_ENDIAN + +endchoice + +config SUPPORTS_BIG_ENDIAN + bool + +config SUPPORTS_LITTLE_ENDIAN + bool + +endif + endmenu diff --git a/configs/dbau1000_defconfig b/configs/dbau1000_defconfig index 7c95629cfb..aa4d338d43 100644 --- a/configs/dbau1000_defconfig +++ b/configs/dbau1000_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="DBAU1000" CONFIG_MIPS=y CONFIG_TARGET_DBAU1X00=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/dbau1100_defconfig b/configs/dbau1100_defconfig index 506f5da8ca..db6f98ea00 100644 --- a/configs/dbau1100_defconfig +++ b/configs/dbau1100_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="DBAU1100" CONFIG_MIPS=y CONFIG_TARGET_DBAU1X00=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/dbau1500_defconfig b/configs/dbau1500_defconfig index 5a02a78610..d2fbff9b38 100644 --- a/configs/dbau1500_defconfig +++ b/configs/dbau1500_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="DBAU1500" CONFIG_MIPS=y CONFIG_TARGET_DBAU1X00=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/dbau1550_defconfig b/configs/dbau1550_defconfig index 9015023524..31423919db 100644 --- a/configs/dbau1550_defconfig +++ b/configs/dbau1550_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="DBAU1550" CONFIG_MIPS=y CONFIG_TARGET_DBAU1X00=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/dbau1550_el_defconfig b/configs/dbau1550_el_defconfig index 53b35ce60f..514f227627 100644 --- a/configs/dbau1550_el_defconfig +++ b/configs/dbau1550_el_defconfig @@ -1,3 +1,4 @@ -CONFIG_SYS_EXTRA_OPTIONS="DBAU1550,SYS_LITTLE_ENDIAN" +CONFIG_SYS_EXTRA_OPTIONS="DBAU1550" CONFIG_MIPS=y CONFIG_TARGET_DBAU1X00=y +CONFIG_SYS_LITTLE_ENDIAN=y diff --git a/configs/malta_defconfig b/configs/malta_defconfig index f3788b6db1..5a178a76b3 100644 --- a/configs/malta_defconfig +++ b/configs/malta_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="SYS_BIG_ENDIAN" CONFIG_MIPS=y CONFIG_TARGET_MALTA=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/maltael_defconfig b/configs/maltael_defconfig index 97d0e899da..011525fc2b 100644 --- a/configs/maltael_defconfig +++ b/configs/maltael_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="SYS_LITTLE_ENDIAN" CONFIG_MIPS=y CONFIG_TARGET_MALTA=y +CONFIG_SYS_LITTLE_ENDIAN=y diff --git a/configs/pb1000_defconfig b/configs/pb1000_defconfig index e226358fe2..72c22a0876 100644 --- a/configs/pb1000_defconfig +++ b/configs/pb1000_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="PB1000" CONFIG_MIPS=y CONFIG_TARGET_PB1X00=y +CONFIG_SYS_LITTLE_ENDIAN=y diff --git a/configs/qemu_mips64_defconfig b/configs/qemu_mips64_defconfig index 2948355769..36897b997b 100644 --- a/configs/qemu_mips64_defconfig +++ b/configs/qemu_mips64_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="SYS_BIG_ENDIAN" CONFIG_MIPS=y CONFIG_TARGET_QEMU_MIPS64=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/qemu_mips64el_defconfig b/configs/qemu_mips64el_defconfig index 13a039f0b8..70d226ae7f 100644 --- a/configs/qemu_mips64el_defconfig +++ b/configs/qemu_mips64el_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="SYS_LITTLE_ENDIAN" CONFIG_MIPS=y CONFIG_TARGET_QEMU_MIPS64=y +CONFIG_SYS_LITTLE_ENDIAN=y diff --git a/configs/qemu_mips_defconfig b/configs/qemu_mips_defconfig index 6b2c0290e9..0a385af2c0 100644 --- a/configs/qemu_mips_defconfig +++ b/configs/qemu_mips_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="SYS_BIG_ENDIAN" CONFIG_MIPS=y CONFIG_TARGET_QEMU_MIPS=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/qemu_mipsel_defconfig b/configs/qemu_mipsel_defconfig index 57c87016c4..d0acb28972 100644 --- a/configs/qemu_mipsel_defconfig +++ b/configs/qemu_mipsel_defconfig @@ -1,3 +1,3 @@ -CONFIG_SYS_EXTRA_OPTIONS="SYS_LITTLE_ENDIAN" CONFIG_MIPS=y CONFIG_TARGET_QEMU_MIPS=y +CONFIG_SYS_LITTLE_ENDIAN=y diff --git a/configs/vct_platinum_defconfig b/configs/vct_platinum_defconfig index 9ff8b68421..85584e37b1 100644 --- a/configs/vct_platinum_defconfig +++ b/configs/vct_platinum_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUM" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/vct_platinum_onenand_defconfig b/configs/vct_platinum_onenand_defconfig index f33c97dc8f..0ba7ae67aa 100644 --- a/configs/vct_platinum_onenand_defconfig +++ b/configs/vct_platinum_onenand_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUM,VCT_ONENAND" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/vct_platinum_onenand_small_defconfig b/configs/vct_platinum_onenand_small_defconfig index 58c79955ab..d70a97938b 100644 --- a/configs/vct_platinum_onenand_small_defconfig +++ b/configs/vct_platinum_onenand_small_defconfig @@ -1,4 +1,5 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUM,VCT_ONENAND,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_platinum_small_defconfig b/configs/vct_platinum_small_defconfig index f4f56c4f4c..ab5c2e1278 100644 --- a/configs/vct_platinum_small_defconfig +++ b/configs/vct_platinum_small_defconfig @@ -1,4 +1,5 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUM,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_platinumavc_defconfig b/configs/vct_platinumavc_defconfig index 8aaac56e3d..691325d0cd 100644 --- a/configs/vct_platinumavc_defconfig +++ b/configs/vct_platinumavc_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUMAVC" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/vct_platinumavc_onenand_defconfig b/configs/vct_platinumavc_onenand_defconfig index 926c6e4050..1e0c3991ff 100644 --- a/configs/vct_platinumavc_onenand_defconfig +++ b/configs/vct_platinumavc_onenand_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUMAVC,VCT_ONENAND" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/vct_platinumavc_onenand_small_defconfig b/configs/vct_platinumavc_onenand_small_defconfig index 31b4c9a8d6..f254ab6ad5 100644 --- a/configs/vct_platinumavc_onenand_small_defconfig +++ b/configs/vct_platinumavc_onenand_small_defconfig @@ -1,4 +1,5 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUMAVC,VCT_ONENAND,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_platinumavc_small_defconfig b/configs/vct_platinumavc_small_defconfig index 23f6561b34..83670ed450 100644 --- a/configs/vct_platinumavc_small_defconfig +++ b/configs/vct_platinumavc_small_defconfig @@ -1,4 +1,5 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUMAVC,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_premium_defconfig b/configs/vct_premium_defconfig index 0e16ff9cac..24bf87e700 100644 --- a/configs/vct_premium_defconfig +++ b/configs/vct_premium_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PREMIUM" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/vct_premium_onenand_defconfig b/configs/vct_premium_onenand_defconfig index 29734b8274..0039ec17e4 100644 --- a/configs/vct_premium_onenand_defconfig +++ b/configs/vct_premium_onenand_defconfig @@ -1,3 +1,4 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PREMIUM,VCT_ONENAND" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y diff --git a/configs/vct_premium_onenand_small_defconfig b/configs/vct_premium_onenand_small_defconfig index 354793edc8..8fc6ac1cff 100644 --- a/configs/vct_premium_onenand_small_defconfig +++ b/configs/vct_premium_onenand_small_defconfig @@ -1,4 +1,5 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PREMIUM,VCT_ONENAND,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_premium_small_defconfig b/configs/vct_premium_small_defconfig index a23ddb7e21..96bb0ee8c3 100644 --- a/configs/vct_premium_small_defconfig +++ b/configs/vct_premium_small_defconfig @@ -1,4 +1,5 @@ CONFIG_SYS_EXTRA_OPTIONS="VCT_PREMIUM,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y +CONFIG_SYS_BIG_ENDIAN=y # CONFIG_CMD_CRC32 is not set diff --git a/include/configs/pb1x00.h b/include/configs/pb1x00.h index f92496571b..1c04a58e9f 100644 --- a/include/configs/pb1x00.h +++ b/include/configs/pb1x00.h @@ -29,8 +29,6 @@ #endif #endif -#define CONFIG_SYS_LITTLE_ENDIAN - #define CONFIG_ETHADDR DE:AD:BE:EF:01:01 /* Ethernet address */ #define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */ -- cgit v1.2.1 From 02611cbb7ca56d5dc405cf616ea570ae7bce43fa Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Sun, 26 Oct 2014 14:14:07 +0100 Subject: MIPS: kconfig: add options for CPU type select Add new Kconfig option to let the user select the targets CPU type. Each target have to select SUPPORTS_CPU_MIPS[32,64]_R[1,2] to indicate which CPU types are supported. Signed-off-by: Daniel Schwierzeck --- arch/mips/Kconfig | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index f2e6a453fc..623ec66a84 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -14,29 +14,41 @@ config TARGET_QEMU_MIPS bool "Support qemu-mips" select SUPPORTS_BIG_ENDIAN select SUPPORTS_LITTLE_ENDIAN + select SUPPORTS_CPU_MIPS32_R1 + select SUPPORTS_CPU_MIPS32_R2 config TARGET_MALTA bool "Support malta" select SUPPORTS_BIG_ENDIAN select SUPPORTS_LITTLE_ENDIAN + select SUPPORTS_CPU_MIPS32_R1 + select SUPPORTS_CPU_MIPS32_R2 config TARGET_VCT bool "Support vct" select SUPPORTS_BIG_ENDIAN + select SUPPORTS_CPU_MIPS32_R1 + select SUPPORTS_CPU_MIPS32_R2 config TARGET_DBAU1X00 bool "Support dbau1x00" select SUPPORTS_BIG_ENDIAN select SUPPORTS_LITTLE_ENDIAN + select SUPPORTS_CPU_MIPS32_R1 + select SUPPORTS_CPU_MIPS32_R2 config TARGET_PB1X00 bool "Support pb1x00" select SUPPORTS_LITTLE_ENDIAN + select SUPPORTS_CPU_MIPS32_R1 + select SUPPORTS_CPU_MIPS32_R2 config TARGET_QEMU_MIPS64 bool "Support qemu-mips64" select SUPPORTS_BIG_ENDIAN select SUPPORTS_LITTLE_ENDIAN + select SUPPORTS_CPU_MIPS64_R1 + select SUPPORTS_CPU_MIPS64_R2 endchoice @@ -66,12 +78,68 @@ config SYS_LITTLE_ENDIAN endchoice +choice + prompt "CPU selection" + default CPU_MIPS32_R2 + +config CPU_MIPS32_R1 + bool "MIPS32 Release 1" + depends on SUPPORTS_CPU_MIPS32_R1 + select 32BIT + help + Choose this option to build an U-Boot for release 1 or later of the + MIPS32 architecture. + +config CPU_MIPS32_R2 + bool "MIPS32 Release 2" + depends on SUPPORTS_CPU_MIPS32_R2 + select 32BIT + help + Choose this option to build an U-Boot for release 2 or later of the + MIPS32 architecture. + +config CPU_MIPS64_R1 + bool "MIPS64 Release 1" + depends on SUPPORTS_CPU_MIPS64_R1 + select 64BIT + help + Choose this option to build a kernel for release 1 or later of the + MIPS64 architecture. + +config CPU_MIPS64_R2 + bool "MIPS64 Release 2" + depends on SUPPORTS_CPU_MIPS64_R2 + select 64BIT + help + Choose this option to build a kernel for release 2 or later of the + MIPS64 architecture. + +endchoice + config SUPPORTS_BIG_ENDIAN bool config SUPPORTS_LITTLE_ENDIAN bool +config SUPPORTS_CPU_MIPS32_R1 + bool + +config SUPPORTS_CPU_MIPS32_R2 + bool + +config SUPPORTS_CPU_MIPS64_R1 + bool + +config SUPPORTS_CPU_MIPS64_R2 + bool + +config 32BIT + bool + +config 64BIT + bool + endif endmenu -- cgit v1.2.1 From b9863b6de22b48dd863d4385f5a5656ba84138a3 Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Sun, 26 Oct 2014 14:14:07 +0100 Subject: MIPS: kconfig: globally define CONFIG_SYS_CPU for MIPS Now the user can select the CPU type for each target. Thus CONFIG_SYS_CPU could be set globally. Signed-off-by: Daniel Schwierzeck --- arch/mips/Kconfig | 4 ++++ board/dbau1x00/Kconfig | 3 --- board/imgtec/malta/Kconfig | 3 --- board/micronas/vct/Kconfig | 3 --- board/pb1x00/Kconfig | 3 --- board/qemu-mips/Kconfig | 3 --- 6 files changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 623ec66a84..b974e8ff07 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -4,6 +4,10 @@ menu "MIPS architecture" config SYS_ARCH default "mips" +config SYS_CPU + default "mips32" if CPU_MIPS32_R1 || CPU_MIPS32_R2 + default "mips64" if CPU_MIPS64_R1 || CPU_MIPS64_R2 + config USE_PRIVATE_LIBGCC default y diff --git a/board/dbau1x00/Kconfig b/board/dbau1x00/Kconfig index 1a8946d06c..3e3cb77352 100644 --- a/board/dbau1x00/Kconfig +++ b/board/dbau1x00/Kconfig @@ -1,8 +1,5 @@ if TARGET_DBAU1X00 -config SYS_CPU - default "mips32" - config SYS_BOARD default "dbau1x00" diff --git a/board/imgtec/malta/Kconfig b/board/imgtec/malta/Kconfig index 401962c4bd..4c06d0c0d8 100644 --- a/board/imgtec/malta/Kconfig +++ b/board/imgtec/malta/Kconfig @@ -1,8 +1,5 @@ if TARGET_MALTA -config SYS_CPU - default "mips32" - config SYS_BOARD default "malta" diff --git a/board/micronas/vct/Kconfig b/board/micronas/vct/Kconfig index 75046fe7ab..7c69453d1b 100644 --- a/board/micronas/vct/Kconfig +++ b/board/micronas/vct/Kconfig @@ -1,8 +1,5 @@ if TARGET_VCT -config SYS_CPU - default "mips32" - config SYS_BOARD default "vct" diff --git a/board/pb1x00/Kconfig b/board/pb1x00/Kconfig index ef2844a497..251db6ab63 100644 --- a/board/pb1x00/Kconfig +++ b/board/pb1x00/Kconfig @@ -1,8 +1,5 @@ if TARGET_PB1X00 -config SYS_CPU - default "mips32" - config SYS_BOARD default "pb1x00" diff --git a/board/qemu-mips/Kconfig b/board/qemu-mips/Kconfig index e4d9663c2d..394534fcc5 100644 --- a/board/qemu-mips/Kconfig +++ b/board/qemu-mips/Kconfig @@ -1,8 +1,5 @@ if TARGET_QEMU_MIPS -config SYS_CPU - default "mips32" - config SYS_BOARD default "qemu-mips" -- cgit v1.2.1 From aa45f75eaf8165731ce1d810d9a4cfb84cf3ffff Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Sun, 26 Oct 2014 14:14:07 +0100 Subject: MIPS: kconfig: merge targets qemu_mips and qemu_mips64 Now the user can separately select the CPU type. Thus the targets qemu_mips and qemu_mips64 can be merged to a single target. Signed-off-by: Daniel Schwierzeck --- arch/mips/Kconfig | 8 ++------ board/qemu-mips/Kconfig | 16 ++-------------- configs/qemu_mips64_defconfig | 3 ++- configs/qemu_mips64el_defconfig | 3 ++- configs/qemu_mips_defconfig | 1 + configs/qemu_mipsel_defconfig | 1 + 6 files changed, 10 insertions(+), 22 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index b974e8ff07..4991da2226 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -20,6 +20,8 @@ config TARGET_QEMU_MIPS select SUPPORTS_LITTLE_ENDIAN select SUPPORTS_CPU_MIPS32_R1 select SUPPORTS_CPU_MIPS32_R2 + select SUPPORTS_CPU_MIPS64_R1 + select SUPPORTS_CPU_MIPS64_R2 config TARGET_MALTA bool "Support malta" @@ -47,12 +49,6 @@ config TARGET_PB1X00 select SUPPORTS_CPU_MIPS32_R1 select SUPPORTS_CPU_MIPS32_R2 -config TARGET_QEMU_MIPS64 - bool "Support qemu-mips64" - select SUPPORTS_BIG_ENDIAN - select SUPPORTS_LITTLE_ENDIAN - select SUPPORTS_CPU_MIPS64_R1 - select SUPPORTS_CPU_MIPS64_R2 endchoice diff --git a/board/qemu-mips/Kconfig b/board/qemu-mips/Kconfig index 394534fcc5..18d78b5100 100644 --- a/board/qemu-mips/Kconfig +++ b/board/qemu-mips/Kconfig @@ -4,19 +4,7 @@ config SYS_BOARD default "qemu-mips" config SYS_CONFIG_NAME - default "qemu-mips" - -endif - -if TARGET_QEMU_MIPS64 - -config SYS_CPU - default "mips64" - -config SYS_BOARD - default "qemu-mips" - -config SYS_CONFIG_NAME - default "qemu-mips64" + default "qemu-mips" if 32BIT + default "qemu-mips64" if 64BIT endif diff --git a/configs/qemu_mips64_defconfig b/configs/qemu_mips64_defconfig index 36897b997b..3608bbe552 100644 --- a/configs/qemu_mips64_defconfig +++ b/configs/qemu_mips64_defconfig @@ -1,3 +1,4 @@ CONFIG_MIPS=y -CONFIG_TARGET_QEMU_MIPS64=y +CONFIG_TARGET_QEMU_MIPS=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_CPU_MIPS64_R1=y diff --git a/configs/qemu_mips64el_defconfig b/configs/qemu_mips64el_defconfig index 70d226ae7f..a9ebd7b5ff 100644 --- a/configs/qemu_mips64el_defconfig +++ b/configs/qemu_mips64el_defconfig @@ -1,3 +1,4 @@ CONFIG_MIPS=y -CONFIG_TARGET_QEMU_MIPS64=y +CONFIG_TARGET_QEMU_MIPS=y CONFIG_SYS_LITTLE_ENDIAN=y +CONFIG_CPU_MIPS64_R1=y diff --git a/configs/qemu_mips_defconfig b/configs/qemu_mips_defconfig index 0a385af2c0..f58dd2200a 100644 --- a/configs/qemu_mips_defconfig +++ b/configs/qemu_mips_defconfig @@ -1,3 +1,4 @@ CONFIG_MIPS=y CONFIG_TARGET_QEMU_MIPS=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_CPU_MIPS32_R2=y diff --git a/configs/qemu_mipsel_defconfig b/configs/qemu_mipsel_defconfig index d0acb28972..84a45116fa 100644 --- a/configs/qemu_mipsel_defconfig +++ b/configs/qemu_mipsel_defconfig @@ -1,3 +1,4 @@ CONFIG_MIPS=y CONFIG_TARGET_QEMU_MIPS=y CONFIG_SYS_LITTLE_ENDIAN=y +CONFIG_CPU_MIPS32_R2=y -- cgit v1.2.1 From edf7dbba69252c1db9e8981153bac6bb4b760516 Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Sun, 26 Oct 2014 14:14:07 +0100 Subject: MIPS: kconfig: add options for dbau1x00 board variant select The dbau1x00 board can be built with various variants which are configured via CONFIG_SYS_EXTRA_OPTIONS. This is deprecated. Thus add new Kconfig options for those board variants. Signed-off-by: Daniel Schwierzeck --- board/dbau1x00/Kconfig | 18 ++++++++++++++++++ configs/dbau1100_defconfig | 2 +- configs/dbau1500_defconfig | 2 +- configs/dbau1550_defconfig | 2 +- configs/dbau1550_el_defconfig | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/board/dbau1x00/Kconfig b/board/dbau1x00/Kconfig index 3e3cb77352..1286e4509f 100644 --- a/board/dbau1x00/Kconfig +++ b/board/dbau1x00/Kconfig @@ -9,4 +9,22 @@ config SYS_SOC config SYS_CONFIG_NAME default "dbau1x00" +menu "dbau1x00 board options" + +choice + prompt "Select au1x00 SoC type" + +config DBAU1100 + bool "Select AU1100" + +config DBAU1500 + bool "Select AU1500" + +config DBAU1550 + bool "Select AU1550" + +endchoice + +endmenu + endif diff --git a/configs/dbau1100_defconfig b/configs/dbau1100_defconfig index db6f98ea00..aac9f032b0 100644 --- a/configs/dbau1100_defconfig +++ b/configs/dbau1100_defconfig @@ -1,4 +1,4 @@ -CONFIG_SYS_EXTRA_OPTIONS="DBAU1100" CONFIG_MIPS=y CONFIG_TARGET_DBAU1X00=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_DBAU1100=y diff --git a/configs/dbau1500_defconfig b/configs/dbau1500_defconfig index d2fbff9b38..d96de13ff9 100644 --- a/configs/dbau1500_defconfig +++ b/configs/dbau1500_defconfig @@ -1,4 +1,4 @@ -CONFIG_SYS_EXTRA_OPTIONS="DBAU1500" CONFIG_MIPS=y CONFIG_TARGET_DBAU1X00=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_DBAU1500=y diff --git a/configs/dbau1550_defconfig b/configs/dbau1550_defconfig index 31423919db..a2dfe18c78 100644 --- a/configs/dbau1550_defconfig +++ b/configs/dbau1550_defconfig @@ -1,4 +1,4 @@ -CONFIG_SYS_EXTRA_OPTIONS="DBAU1550" CONFIG_MIPS=y CONFIG_TARGET_DBAU1X00=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_DBAU1550=y diff --git a/configs/dbau1550_el_defconfig b/configs/dbau1550_el_defconfig index 514f227627..767326f6d4 100644 --- a/configs/dbau1550_el_defconfig +++ b/configs/dbau1550_el_defconfig @@ -1,4 +1,4 @@ -CONFIG_SYS_EXTRA_OPTIONS="DBAU1550" CONFIG_MIPS=y CONFIG_TARGET_DBAU1X00=y CONFIG_SYS_LITTLE_ENDIAN=y +CONFIG_DBAU1550=y -- cgit v1.2.1 From 4207917867d4bf3dc071ca0ed0ddf5955cfcc55d Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Sun, 26 Oct 2014 14:14:07 +0100 Subject: MIPS: kconfig: add options for vct board variant select The vct board can be built with various variants which are configured via CONFIG_SYS_EXTRA_OPTIONS. This is deprecated. Thus add new Kconfig options for those board variants. Signed-off-by: Daniel Schwierzeck Acked-by: Stefan Roese --- board/micronas/vct/Kconfig | 24 ++++++++++++++++++++++++ configs/vct_platinum_defconfig | 2 +- configs/vct_platinum_onenand_defconfig | 3 ++- configs/vct_platinum_onenand_small_defconfig | 4 +++- configs/vct_platinum_small_defconfig | 3 ++- configs/vct_platinumavc_defconfig | 2 +- configs/vct_platinumavc_onenand_defconfig | 3 ++- configs/vct_platinumavc_onenand_small_defconfig | 4 +++- configs/vct_platinumavc_small_defconfig | 3 ++- configs/vct_premium_defconfig | 2 +- configs/vct_premium_onenand_defconfig | 3 ++- configs/vct_premium_onenand_small_defconfig | 4 +++- configs/vct_premium_small_defconfig | 3 ++- 13 files changed, 48 insertions(+), 12 deletions(-) diff --git a/board/micronas/vct/Kconfig b/board/micronas/vct/Kconfig index 7c69453d1b..288a1aeb70 100644 --- a/board/micronas/vct/Kconfig +++ b/board/micronas/vct/Kconfig @@ -9,4 +9,28 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "vct" +menu "vct board options" + +choice + prompt "Board variant" + +config VCT_PLATINUM + bool "Enable VCT_PLATINUM" + +config VCT_PLATINUMAVC + bool "Enable VCT_PLATINUMAVC" + +config VCT_PREMIUM + bool "Enable VCT_PLATINUMAVC" + +endchoice + +config VCT_ONENAND + bool "Enable VCT_ONENAND" + +config VCT_SMALL_IMAGE + bool "Enable VCT_SMALL_IMAGE" + +endmenu + endif diff --git a/configs/vct_platinum_defconfig b/configs/vct_platinum_defconfig index 85584e37b1..32e9e8cc6d 100644 --- a/configs/vct_platinum_defconfig +++ b/configs/vct_platinum_defconfig @@ -1,4 +1,4 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUM" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PLATINUM=y diff --git a/configs/vct_platinum_onenand_defconfig b/configs/vct_platinum_onenand_defconfig index 0ba7ae67aa..4346518a18 100644 --- a/configs/vct_platinum_onenand_defconfig +++ b/configs/vct_platinum_onenand_defconfig @@ -1,4 +1,5 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUM,VCT_ONENAND" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PLATINUM=y +CONFIG_VCT_ONENAND=y diff --git a/configs/vct_platinum_onenand_small_defconfig b/configs/vct_platinum_onenand_small_defconfig index d70a97938b..fd52282966 100644 --- a/configs/vct_platinum_onenand_small_defconfig +++ b/configs/vct_platinum_onenand_small_defconfig @@ -1,5 +1,7 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUM,VCT_ONENAND,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PLATINUM=y +CONFIG_VCT_ONENAND=y +CONFIG_VCT_SMALL_IMAGE=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_platinum_small_defconfig b/configs/vct_platinum_small_defconfig index ab5c2e1278..58f956d7db 100644 --- a/configs/vct_platinum_small_defconfig +++ b/configs/vct_platinum_small_defconfig @@ -1,5 +1,6 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUM,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PLATINUM=y +CONFIG_VCT_SMALL_IMAGE=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_platinumavc_defconfig b/configs/vct_platinumavc_defconfig index 691325d0cd..732565cb96 100644 --- a/configs/vct_platinumavc_defconfig +++ b/configs/vct_platinumavc_defconfig @@ -1,4 +1,4 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUMAVC" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PLATINUMAVC=y diff --git a/configs/vct_platinumavc_onenand_defconfig b/configs/vct_platinumavc_onenand_defconfig index 1e0c3991ff..670e7f92da 100644 --- a/configs/vct_platinumavc_onenand_defconfig +++ b/configs/vct_platinumavc_onenand_defconfig @@ -1,4 +1,5 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUMAVC,VCT_ONENAND" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PLATINUMAVC=y +CONFIG_VCT_ONENAND=y diff --git a/configs/vct_platinumavc_onenand_small_defconfig b/configs/vct_platinumavc_onenand_small_defconfig index f254ab6ad5..31a4948e70 100644 --- a/configs/vct_platinumavc_onenand_small_defconfig +++ b/configs/vct_platinumavc_onenand_small_defconfig @@ -1,5 +1,7 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUMAVC,VCT_ONENAND,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PLATINUMAVC=y +CONFIG_VCT_ONENAND=y +CONFIG_VCT_SMALL_IMAGE=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_platinumavc_small_defconfig b/configs/vct_platinumavc_small_defconfig index 83670ed450..ce00a6c0f1 100644 --- a/configs/vct_platinumavc_small_defconfig +++ b/configs/vct_platinumavc_small_defconfig @@ -1,5 +1,6 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PLATINUMAVC,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PLATINUMAVC=y +CONFIG_VCT_SMALL_IMAGE=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_premium_defconfig b/configs/vct_premium_defconfig index 24bf87e700..a19e65d7e6 100644 --- a/configs/vct_premium_defconfig +++ b/configs/vct_premium_defconfig @@ -1,4 +1,4 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PREMIUM" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PREMIUM=y diff --git a/configs/vct_premium_onenand_defconfig b/configs/vct_premium_onenand_defconfig index 0039ec17e4..092d0f79d3 100644 --- a/configs/vct_premium_onenand_defconfig +++ b/configs/vct_premium_onenand_defconfig @@ -1,4 +1,5 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PREMIUM,VCT_ONENAND" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PREMIUM=y +CONFIG_VCT_ONENAND=y diff --git a/configs/vct_premium_onenand_small_defconfig b/configs/vct_premium_onenand_small_defconfig index 8fc6ac1cff..eabfb88e0c 100644 --- a/configs/vct_premium_onenand_small_defconfig +++ b/configs/vct_premium_onenand_small_defconfig @@ -1,5 +1,7 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PREMIUM,VCT_ONENAND,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PREMIUM=y +CONFIG_VCT_ONENAND=y +CONFIG_VCT_SMALL_IMAGE=y # CONFIG_CMD_CRC32 is not set diff --git a/configs/vct_premium_small_defconfig b/configs/vct_premium_small_defconfig index 96bb0ee8c3..1ce0efd273 100644 --- a/configs/vct_premium_small_defconfig +++ b/configs/vct_premium_small_defconfig @@ -1,5 +1,6 @@ -CONFIG_SYS_EXTRA_OPTIONS="VCT_PREMIUM,VCT_SMALL_IMAGE" CONFIG_MIPS=y CONFIG_TARGET_VCT=y CONFIG_SYS_BIG_ENDIAN=y +CONFIG_VCT_PREMIUM=y +CONFIG_VCT_SMALL_IMAGE=y # CONFIG_CMD_CRC32 is not set -- cgit v1.2.1 From 837cad1e47d2e8a81956140d37ee23f5d3c07de6 Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Sun, 26 Oct 2014 14:16:23 +0100 Subject: MIPS: refactor setting of compiler options Refactor and unify all compiler settings in arch/mips/config.mk. Also add tune flags for each supported CPU type. Signed-off-by: Daniel Schwierzeck --- arch/mips/config.mk | 42 +++++++++++++++++++++++++++++------------- arch/mips/cpu/mips32/config.mk | 14 -------------- arch/mips/cpu/mips64/config.mk | 14 -------------- 3 files changed, 29 insertions(+), 41 deletions(-) diff --git a/arch/mips/config.mk b/arch/mips/config.mk index a2d07aff1b..b758116d97 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -5,25 +5,41 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifeq ($(CROSS_COMPILE),) -CROSS_COMPILE := mips_4KC- +ifdef CONFIG_SYS_BIG_ENDIAN +32bit-emul := elf32btsmip +64bit-emul := elf64btsmip +32bit-bfd := elf32-tradbigmips +64bit-bfd := elf64-tradbigmips +PLATFORM_CPPFLAGS += -EB +PLATFORM_LDFLAGS += -EB endif -# Handle special prefix in ELDK 4.0 toolchain -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE))) -ENDIANNESS := -EL +ifdef CONFIG_SYS_LITTLE_ENDIAN +32bit-emul := elf32ltsmip +64bit-emul := elf64ltsmip +32bit-bfd := elf32-tradlittlemips +64bit-bfd := elf64-tradlittlemips +PLATFORM_CPPFLAGS += -EL +PLATFORM_LDFLAGS += -EL endif -ifdef CONFIG_SYS_LITTLE_ENDIAN -ENDIANNESS := -EL +ifdef CONFIG_32BIT +PLATFORM_CPPFLAGS += -mabi=32 +PLATFORM_LDFLAGS += -m $(32bit-emul) +OBJCOPYFLAGS += -O $(32bit-bfd) endif -ifdef CONFIG_SYS_BIG_ENDIAN -ENDIANNESS := -EB +ifdef CONFIG_64BIT +PLATFORM_CPPFLAGS += -mabi=64 +PLATFORM_LDFLAGS += -m$(64bit-emul) +OBJCOPYFLAGS += -O $(64bit-bfd) endif -# Default to EB if no endianess is configured -ENDIANNESS ?= -EB +cpuflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,-mips32 +cpuflags-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -Wa,-mips32r2 +cpuflags-$(CONFIG_CPU_MIPS64_R1) += -march=mips64 -Wa,-mips64 +cpuflags-$(CONFIG_CPU_MIPS64_R2) += -march=mips64r2 -Wa,-mips64r2 +PLATFORM_CPPFLAGS += $(cpuflags-y) PLATFORM_CPPFLAGS += -D__MIPS__ @@ -49,9 +65,9 @@ __HAVE_ARCH_GENERIC_BOARD := y # On the other hand, we want PIC in the U-Boot code to relocate it from ROM # to RAM. $28 is always used as gp. # -PLATFORM_CPPFLAGS += -G 0 -mabicalls -fpic $(ENDIANNESS) +PLATFORM_CPPFLAGS += -G 0 -mabicalls -fpic PLATFORM_CPPFLAGS += -msoft-float -PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib $(ENDIANNESS) +PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections -pie OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .got diff --git a/arch/mips/cpu/mips32/config.mk b/arch/mips/cpu/mips32/config.mk index 332cd62c74..4257c56d59 100644 --- a/arch/mips/cpu/mips32/config.mk +++ b/arch/mips/cpu/mips32/config.mk @@ -5,19 +5,5 @@ # SPDX-License-Identifier: GPL-2.0+ # -# -# Default optimization level for MIPS32 -# -# Note: Toolchains with binutils prior to v2.16 -# are no longer supported by U-Boot MIPS tree! -# -PLATFORM_CPPFLAGS += -DCONFIG_MIPS32 -march=mips32r2 -PLATFORM_CPPFLAGS += -mabi=32 -DCONFIG_32BIT -ifdef CONFIG_SYS_BIG_ENDIAN -PLATFORM_LDFLAGS += -m elf32btsmip -else -PLATFORM_LDFLAGS += -m elf32ltsmip -endif - CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 \ -T $(srctree)/examples/standalone/mips.lds diff --git a/arch/mips/cpu/mips64/config.mk b/arch/mips/cpu/mips64/config.mk index c55eb7f2ee..96eb82948d 100644 --- a/arch/mips/cpu/mips64/config.mk +++ b/arch/mips/cpu/mips64/config.mk @@ -5,19 +5,5 @@ # SPDX-License-Identifier: GPL-2.0+ # -# -# Default optimization level for MIPS64 -# -# Note: Toolchains with binutils prior to v2.16 -# are no longer supported by U-Boot MIPS tree! -# -PLATFORM_CPPFLAGS += -DCONFIG_MIPS64 -march=mips64 -PLATFORM_CPPFLAGS += -mabi=64 -DCONFIG_64BIT -ifdef CONFIG_SYS_BIG_ENDIAN -PLATFORM_LDFLAGS += -m elf64btsmip -else -PLATFORM_LDFLAGS += -m elf64ltsmip -endif - CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 \ -T $(srctree)/examples/standalone/mips64.lds -- cgit v1.2.1 From 265072ba75d7a931ed0a751d5192220bcc5cc230 Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Wed, 29 Oct 2014 17:30:36 +0100 Subject: MIPS: add .padding section to linker script Commit 79fd7e649e287228a1445820a72f7dd33baedb96 MIPS: always keep all sections in u-boot ELF binary. Always keep all sections in u-boot ELF binary. Move all unneeded sections after _end to avoid allocating space in the final binary. Also remove .deadcode section which is now obsolete. removed section .deadcode because the original symptoms were not visible anymore. Unfortuneatly the binutils bug still exists. The size of .rel.dyn section is often bigger than needed for all entries. But objcopy only allocates space as much as required for all reloc entries. Thus there is a gap between the last entry and __rel_dyn_end in u-boot.bin. If u-boot is booted from RAM (e.g. in SPL scenarios) that area could contain garbage data which could lead to CPU exceptions during relocation. Signed-off-by: Gabor Juhos Signed-off-by: Daniel Schwierzeck --- arch/mips/config.mk | 2 +- arch/mips/cpu/u-boot.lds | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/arch/mips/config.mk b/arch/mips/config.mk index b758116d97..4dc88f4d51 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -71,4 +71,4 @@ PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections -pie OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .got -OBJCOPYFLAGS += -j .u_boot_list -j .rel.dyn +OBJCOPYFLAGS += -j .u_boot_list -j .rel.dyn -j .padding diff --git a/arch/mips/cpu/u-boot.lds b/arch/mips/cpu/u-boot.lds index e504ea7544..7d71c11ae4 100644 --- a/arch/mips/cpu/u-boot.lds +++ b/arch/mips/cpu/u-boot.lds @@ -61,6 +61,24 @@ SECTIONS __rel_dyn_end = .; } + .padding : { + /* + * Workaround for a binutils feature (or bug?). + * + * The GNU ld from binutils puts the dynamic relocation + * entries into the .rel.dyn section. Sometimes it + * allocates more dynamic relocation entries than it needs + * and the unused slots are set to R_MIPS_NONE entries. + * + * However the size of the .rel.dyn section in the ELF + * section header does not cover the unused entries, so + * objcopy removes those during stripping. + * + * Create a small section here to avoid that. + */ + LONG(0xFFFFFFFF) + } + _end = .; .bss __rel_dyn_start (OVERLAY) : { -- cgit v1.2.1