[PATCH 4/8] MIPS: make use of merged defconfigs

Ahmad Fatoum a.fatoum at pengutronix.de
Fri May 17 06:26:52 PDT 2024


QEmu's Malta emulation can be used in four flavors depending on
endianness and CPU register width. So far we only had two defconfigs and
expected users to adjust the config to arrive at the other two flavors
to cut down on duplication in the config files. Let's use the new merged
defconfigs mechanism instead to merge the configs on the fly.

Cc: Denis Orlov <denorl2009 at gmail.com>
Cc: Antony Pavlov <antonynpavlov at gmail.com>
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 Documentation/boards/mips/qemu-malta.rst   | 11 +++
 arch/mips/Makefile                         |  8 ++
 arch/mips/configs/le.config                |  1 +
 arch/mips/configs/mips64.config            |  2 +
 arch/mips/configs/qemu-malta64el_defconfig | 97 ----------------------
 5 files changed, 22 insertions(+), 97 deletions(-)
 create mode 100644 arch/mips/configs/le.config
 create mode 100644 arch/mips/configs/mips64.config
 delete mode 100644 arch/mips/configs/qemu-malta64el_defconfig

diff --git a/Documentation/boards/mips/qemu-malta.rst b/Documentation/boards/mips/qemu-malta.rst
index 44f671638d9d..b10a3965998c 100644
--- a/Documentation/boards/mips/qemu-malta.rst
+++ b/Documentation/boards/mips/qemu-malta.rst
@@ -1,6 +1,17 @@
 QEMU Malta
 ==========
 
+Building barebox for Qemu Malta:
+
+.. code-block:: sh
+
+  export ARCH=mips
+  make ARCH=mips qemu-malta_defconfig      # 32-bit, big-endian
+  make ARCH=mips qemu-maltael_defconfig    # 32-bit, little-endian
+  make ARCH=mips qemu-malta64_defconfig    # 64-bit, big-endian
+  make ARCH=mips qemu-malta64el_defconfig  # 64-bit, little-endian
+
+
 Big-endian mode
 ---------------
 
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 65a00379ab6e..be360c48a359 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -2,6 +2,14 @@
 
 KBUILD_DEFCONFIG := qemu-malta_defconfig
 
+generated_configs += $(patsubst %, qemu-malta%_defconfig, el 64 64el)
+qemu-maltael_defconfigs:
+	$(call merge_into_defconfig,qemu-malta_defconfig,le)
+qemu-malta64_defconfig:
+	$(call merge_into_defconfig,qemu-malta_defconfig,mips64)
+qemu-malta64el_defconfig:
+	$(call merge_into_defconfig,qemu-malta_defconfig,mips64 le)
+
 #
 # Select the object file format to substitute into the linker script.
 #
diff --git a/arch/mips/configs/le.config b/arch/mips/configs/le.config
new file mode 100644
index 000000000000..ee43fdb3b8f4
--- /dev/null
+++ b/arch/mips/configs/le.config
@@ -0,0 +1 @@
+CONFIG_CPU_LITTLE_ENDIAN=y
diff --git a/arch/mips/configs/mips64.config b/arch/mips/configs/mips64.config
new file mode 100644
index 000000000000..0e80be76cbc6
--- /dev/null
+++ b/arch/mips/configs/mips64.config
@@ -0,0 +1,2 @@
+CONFIG_CPU_MIPS64_R2=y
+CONFIG_64BIT=y
diff --git a/arch/mips/configs/qemu-malta64el_defconfig b/arch/mips/configs/qemu-malta64el_defconfig
deleted file mode 100644
index c1f7366d76d3..000000000000
--- a/arch/mips/configs/qemu-malta64el_defconfig
+++ /dev/null
@@ -1,97 +0,0 @@
-CONFIG_BOARD_QEMU_MALTA=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_CPU_MIPS64_R2=y
-CONFIG_64BIT=y
-CONFIG_IMAGE_COMPRESSION_XZKERN=y
-CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x400000
-CONFIG_STACK_SIZE=0x7000
-CONFIG_EXPERIMENTAL=y
-CONFIG_BAUDRATE=38400
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_MENU=y
-CONFIG_BOOTM_SHOW_TYPE=y
-CONFIG_CONSOLE_ALLOW_COLOR=y
-CONFIG_PARTITION_DISK_EFI=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
-CONFIG_CMD_DMESG=y
-CONFIG_LONGHELP=y
-CONFIG_CMD_IOMEM=y
-CONFIG_CMD_IMD=y
-CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_LOADY=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_PARTITION=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_DEFAULTENV=y
-CONFIG_CMD_LOADENV=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_MD5SUM=y
-CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SHA256SUM=y
-CONFIG_CMD_UNCOMPRESS=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MIITOOL=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_TFTP=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_LOGIN=y
-CONFIG_CMD_MENU=y
-CONFIG_CMD_MENU_MANAGEMENT=y
-CONFIG_CMD_PASSWD=y
-CONFIG_CMD_FBTEST=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_CRC=y
-CONFIG_CMD_CRC_CMP=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_I2C=y
-CONFIG_CMD_OF_NODE=y
-CONFIG_CMD_OF_PROPERTY=y
-CONFIG_CMD_OFTREE=y
-CONFIG_CMD_TIME=y
-CONFIG_NET=y
-CONFIG_NET_NFS=y
-CONFIG_NET_NETCONSOLE=y
-CONFIG_OFDEVICE=y
-CONFIG_OF_BAREBOX_DRIVERS=y
-CONFIG_VIRTIO_CONSOLE=y
-CONFIG_DRIVER_NET_E1000=y
-CONFIG_DRIVER_NET_RTL8139=y
-CONFIG_DRIVER_NET_VIRTIO=y
-# CONFIG_SPI is not set
-CONFIG_I2C=y
-CONFIG_I2C_GPIO=y
-CONFIG_MTD=y
-CONFIG_DRIVER_CFI=y
-# CONFIG_DRIVER_CFI_AMD is not set
-# CONFIG_DRIVER_CFI_BANK_WIDTH_1 is not set
-# CONFIG_DRIVER_CFI_BANK_WIDTH_2 is not set
-CONFIG_CFI_BUFFER_WRITE=y
-CONFIG_DISK=y
-CONFIG_VIRTIO_BLK=y
-CONFIG_VIDEO=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_DRIVER_VIDEO_BOCHS_PCI=y
-CONFIG_VIRTIO_INPUT=y
-CONFIG_HWRNG=y
-CONFIG_HW_RANDOM_VIRTIO=y
-CONFIG_GPIO_MALTA_FPGA_I2C=y
-CONFIG_PCI=y
-CONFIG_PCI_DEBUG=y
-CONFIG_SYSCON_REBOOT_MODE=y
-CONFIG_POWER_RESET_SYSCON=y
-CONFIG_VIRTIO_PCI=y
-CONFIG_FS_CRAMFS=y
-CONFIG_FS_EXT4=y
-CONFIG_FS_TFTP=y
-CONFIG_FS_FAT=y
-CONFIG_FS_FAT_WRITE=y
-CONFIG_FS_FAT_LFN=y
-- 
2.39.2




More information about the barebox mailing list