* [PATCH v4 0/3] Add Onion Omega2/2+ board support
@ 2025-07-08 10:39 Philip Oberfichtner
2025-07-08 10:39 ` [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin Philip Oberfichtner
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Philip Oberfichtner @ 2025-07-08 10:39 UTC (permalink / raw)
To: u-boot
Cc: Philip Oberfichtner, Anshul Dalal, Daniel Schwierzeck,
Dario Binacchi, Greg Malysa, GSS_MTK_Uboot_upstream,
Ilias Apalodimas, Jerome Forissier, Jiaxun Yang, Marek Vasut,
Nathan Barrett-Morrison, Paul Kocialkowski, Peng Fan,
Peter Robinson, Simon Glass, Stefan Roese, Sumit Garg, Tom Rini,
Weijie Gao
Add support for the MediaTek based boards by Onion. Commit one and two are
rather generic, whereas the third commit adds the actual board support.
Changes in v4:
- Rebase board support to v2025.07
- Add new commit to silence warning in arch/mips/
Changes in v3:
- Simplify image size check
Changes in v2:
- I forgot to run checkpatch in v1. Fix some style issues in v2.
Philip Oberfichtner (3):
Makefile: Add size check for u-boot-with-spl.bin
mips: serial: Silence "unused variable" warning
mips: mt7628: Add Onion Omega2/2+ board support
Makefile | 1 +
arch/mips/dts/Makefile | 1 +
arch/mips/dts/onion-omega2p.dts | 58 ++++++++++
arch/mips/mach-mtmips/mt7620/serial.c | 2 +-
arch/mips/mach-mtmips/mt7621/spl/serial.c | 2 +-
arch/mips/mach-mtmips/mt7628/Kconfig | 7 ++
arch/mips/mach-mtmips/mt7628/serial.c | 2 +-
board/onion/omega2p/Kconfig | 12 ++
board/onion/omega2p/MAINTAINERS | 10 ++
board/onion/omega2p/Makefile | 3 +
board/onion/omega2p/board.c | 134 ++++++++++++++++++++++
board/onion/omega2p/omega2p.env | 32 ++++++
common/spl/Kconfig | 2 +-
configs/onion-omega2p_defconfig | 82 +++++++++++++
include/configs/onion-omega2p.h | 15 +++
15 files changed, 359 insertions(+), 4 deletions(-)
create mode 100644 arch/mips/dts/onion-omega2p.dts
create mode 100644 board/onion/omega2p/Kconfig
create mode 100644 board/onion/omega2p/MAINTAINERS
create mode 100644 board/onion/omega2p/Makefile
create mode 100644 board/onion/omega2p/board.c
create mode 100644 board/onion/omega2p/omega2p.env
create mode 100644 configs/onion-omega2p_defconfig
create mode 100644 include/configs/onion-omega2p.h
--
2.39.5
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin
2025-07-08 10:39 [PATCH v4 0/3] Add Onion Omega2/2+ board support Philip Oberfichtner
@ 2025-07-08 10:39 ` Philip Oberfichtner
2025-07-08 11:31 ` Ilias Apalodimas
2025-07-28 22:25 ` Tom Rini
2025-07-08 10:39 ` [PATCH v4 2/3] mips: serial: Silence "unused variable" warning Philip Oberfichtner
` (2 subsequent siblings)
3 siblings, 2 replies; 12+ messages in thread
From: Philip Oberfichtner @ 2025-07-08 10:39 UTC (permalink / raw)
To: u-boot
Cc: Philip Oberfichtner, Anshul Dalal, Dario Binacchi, Greg Malysa,
Ilias Apalodimas, Jerome Forissier, Marek Vasut,
Nathan Barrett-Morrison, Paul Kocialkowski, Peng Fan,
Peter Robinson, Simon Glass, Tom Rini
Like other images, u-boot-with-spl.bin may be subject to size
restrictions. Extend CONFIG_SPL_SIZE_LIMIT to handle this case.
Signed-off-by: Philip Oberfichtner <pro@denx.de>
---
Notes:
Changes in v4: none
Changes in v3:
Reuse existing SPL_SIZE_LIMIT instead of implementing a new option
Changes in v2: none
Makefile | 1 +
common/spl/Kconfig | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index fa9ce756083..791c00713ec 100644
--- a/Makefile
+++ b/Makefile
@@ -1545,6 +1545,7 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
--pad-to=$(CONFIG_SPL_PAD_TO)
u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
$(call if_changed,pad_cat)
+ $(SPL_SIZE_CHECK)
ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 9a17ccb2d3d..dcb25b593f1 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -43,7 +43,7 @@ config SPL_SIZE_LIMIT
default 0x30000 if ARCH_MVEBU && ARMADA_32BIT
default 0x0
help
- Specifies the maximum length of the U-Boot SPL image.
+ Specifies the maximum length of U-Boot SPL images.
If this value is zero, it is ignored.
config SPL_SIZE_LIMIT_SUBTRACT_GD
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v4 2/3] mips: serial: Silence "unused variable" warning
2025-07-08 10:39 [PATCH v4 0/3] Add Onion Omega2/2+ board support Philip Oberfichtner
2025-07-08 10:39 ` [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin Philip Oberfichtner
@ 2025-07-08 10:39 ` Philip Oberfichtner
2025-07-08 10:39 ` [PATCH v4 3/3] mips: mt7628: Add Onion Omega2/2+ board support Philip Oberfichtner
2025-07-17 8:04 ` [PATCH v4 0/3] " Philip Oberfichtner
3 siblings, 0 replies; 12+ messages in thread
From: Philip Oberfichtner @ 2025-07-08 10:39 UTC (permalink / raw)
To: u-boot
Cc: Philip Oberfichtner, Daniel Schwierzeck, GSS_MTK_Uboot_upstream,
Stefan Roese, Tom Rini, Weijie Gao
Before this commit, mtmips_spl_serial_init() caused the following
warning:
arch/mips/mach-mtmips/mt7628/serial.c:14:23: warning: unused variable ‘base’ [-Wunused-variable]
14 | void __iomem *base = ioremap_nocache(SYSCTL_BASE, SYSCTL_SIZE);
| ^~~~
This happens whenever CONFIG_SPECIFY_CONSOLE_INDEX is unset, which leads
to an effectively empty function:
void mtmips_spl_serial_init(void)
{
void __iomem *base = ioremap_nocache(SYSCTL_BASE, SYSCTL_SIZE);
}
Add the __maybe_unused attribute to silence this warning.
Signed-off-by: Philip Oberfichtner <pro@denx.de>
---
Notes:
Changes in v4: new
arch/mips/mach-mtmips/mt7620/serial.c | 2 +-
arch/mips/mach-mtmips/mt7621/spl/serial.c | 2 +-
arch/mips/mach-mtmips/mt7628/serial.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/mips/mach-mtmips/mt7620/serial.c b/arch/mips/mach-mtmips/mt7620/serial.c
index 35544b8537e..a6915865e27 100644
--- a/arch/mips/mach-mtmips/mt7620/serial.c
+++ b/arch/mips/mach-mtmips/mt7620/serial.c
@@ -24,7 +24,7 @@ void board_debug_uart_init(void)
void mtmips_spl_serial_init(void)
{
#ifdef CONFIG_SPL_SERIAL
- void __iomem *base = ioremap_nocache(SYSCTL_BASE, SYSCTL_SIZE);
+ void __iomem __maybe_unused *base = ioremap_nocache(SYSCTL_BASE, SYSCTL_SIZE);
#if CONFIG_CONS_INDEX == 1
clrbits_32(base + SYSCTL_GPIOMODE_REG, UARTL_GPIO_MODE);
diff --git a/arch/mips/mach-mtmips/mt7621/spl/serial.c b/arch/mips/mach-mtmips/mt7621/spl/serial.c
index 5cf093a078a..3f600d778e7 100644
--- a/arch/mips/mach-mtmips/mt7621/spl/serial.c
+++ b/arch/mips/mach-mtmips/mt7621/spl/serial.c
@@ -11,7 +11,7 @@
void mtmips_spl_serial_init(void)
{
#ifdef CONFIG_SPL_SERIAL
- void __iomem *base = ioremap_nocache(SYSCTL_BASE, SYSCTL_SIZE);
+ void __iomem __maybe_unused *base = ioremap_nocache(SYSCTL_BASE, SYSCTL_SIZE);
#if CONFIG_CONS_INDEX == 1
clrbits_32(base + SYSCTL_GPIOMODE_REG, UART1_MODE);
diff --git a/arch/mips/mach-mtmips/mt7628/serial.c b/arch/mips/mach-mtmips/mt7628/serial.c
index 11a2149e127..88d63f3825b 100644
--- a/arch/mips/mach-mtmips/mt7628/serial.c
+++ b/arch/mips/mach-mtmips/mt7628/serial.c
@@ -11,7 +11,7 @@
void mtmips_spl_serial_init(void)
{
#ifdef CONFIG_SPL_SERIAL
- void __iomem *base = ioremap_nocache(SYSCTL_BASE, SYSCTL_SIZE);
+ void __iomem __maybe_unused *base = ioremap_nocache(SYSCTL_BASE, SYSCTL_SIZE);
#if CONFIG_CONS_INDEX == 1
clrbits_32(base + SYSCTL_GPIO_MODE1_REG, UART0_MODE_M);
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v4 3/3] mips: mt7628: Add Onion Omega2/2+ board support
2025-07-08 10:39 [PATCH v4 0/3] Add Onion Omega2/2+ board support Philip Oberfichtner
2025-07-08 10:39 ` [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin Philip Oberfichtner
2025-07-08 10:39 ` [PATCH v4 2/3] mips: serial: Silence "unused variable" warning Philip Oberfichtner
@ 2025-07-08 10:39 ` Philip Oberfichtner
2025-07-17 8:04 ` [PATCH v4 0/3] " Philip Oberfichtner
3 siblings, 0 replies; 12+ messages in thread
From: Philip Oberfichtner @ 2025-07-08 10:39 UTC (permalink / raw)
To: u-boot
Cc: Philip Oberfichtner, Daniel Schwierzeck, GSS_MTK_Uboot_upstream,
Jiaxun Yang, Marek Vasut, Simon Glass, Stefan Roese, Sumit Garg,
Tom Rini, Weijie Gao
The Omega2 / Omega2+ are based on the MediaTek MT7688 SoC with the
following features:
- 64 / 128MB of DDR2 memory
- 16 / 32MB of SPI NOR flash
- USB, WiFi and many more peripherals
Signed-off-by: Philip Oberfichtner <pro@denx.de>
---
Notes:
Changes in v4:
- Adapt bootcmd
- Rebase defconfig
Changes in v3:
- Adapt defconfig to [PATCH 1/2] (SPL_SIZE_LIMIT)
Changes in v2:
- Fix style issues as reported by checkpatch
- Add MAINTAINERS file
arch/mips/dts/Makefile | 1 +
arch/mips/dts/onion-omega2p.dts | 58 ++++++++++++
arch/mips/mach-mtmips/mt7628/Kconfig | 7 ++
board/onion/omega2p/Kconfig | 12 +++
board/onion/omega2p/MAINTAINERS | 10 ++
board/onion/omega2p/Makefile | 3 +
board/onion/omega2p/board.c | 134 +++++++++++++++++++++++++++
board/onion/omega2p/omega2p.env | 32 +++++++
configs/onion-omega2p_defconfig | 82 ++++++++++++++++
include/configs/onion-omega2p.h | 15 +++
10 files changed, 354 insertions(+)
create mode 100644 arch/mips/dts/onion-omega2p.dts
create mode 100644 board/onion/omega2p/Kconfig
create mode 100644 board/onion/omega2p/MAINTAINERS
create mode 100644 board/onion/omega2p/Makefile
create mode 100644 board/onion/omega2p/board.c
create mode 100644 board/onion/omega2p/omega2p.env
create mode 100644 configs/onion-omega2p_defconfig
create mode 100644 include/configs/onion-omega2p.h
diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile
index 7c4ee8b668b..cb33f96edee 100644
--- a/arch/mips/dts/Makefile
+++ b/arch/mips/dts/Makefile
@@ -21,6 +21,7 @@ dtb-$(CONFIG_BOARD_MT7621_NAND_RFB) += mediatek,mt7621-nand-rfb.dtb
dtb-$(CONFIG_BOARD_MT7628_RFB) += mediatek,mt7628-rfb.dtb
dtb-$(CONFIG_BOARD_GARDENA_SMART_GATEWAY_MT7688) += gardena-smart-gateway-mt7688.dtb
dtb-$(CONFIG_BOARD_LINKIT_SMART_7688) += linkit-smart-7688.dtb
+dtb-$(CONFIG_BOARD_ONION_OMEGA2) += onion-omega2p.dtb
dtb-$(CONFIG_TARGET_OCTEON_EBB7304) += mrvl,octeon-ebb7304.dtb
dtb-$(CONFIG_TARGET_OCTEON_NIC23) += mrvl,octeon-nic23.dtb
dtb-$(CONFIG_BOARD_NETGEAR_CG3100D) += netgear,cg3100d.dtb
diff --git a/arch/mips/dts/onion-omega2p.dts b/arch/mips/dts/onion-omega2p.dts
new file mode 100644
index 00000000000..64fecba1db9
--- /dev/null
+++ b/arch/mips/dts/onion-omega2p.dts
@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2024 Zheng Han <zh@onioniot.com>, Lazar Demin <lazar@onioniot.com>
+ */
+
+/dts-v1/;
+
+#include "mt7628a.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+ compatible = "onion,omega2", "onion,omega2p", "ralink,mt7628a-soc";
+ model = "Onion Omega2/Omega2+";
+
+ aliases {
+ serial0 = &uart0;
+ spi0 = &spi0;
+ };
+
+ chosen {
+ stdout-path = &uart0;
+ };
+};
+
+&pinctrl {
+ state_default: pin_state {
+ p0led {
+ groups = "p0led_a";
+ function = "led";
+ };
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&spi0 {
+ status = "okay";
+ num-cs = <2>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi_dual_pins>;
+
+ spi-flash@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ spi-max-frequency = <40000000>;
+ reg = <0>;
+ };
+};
+
+ð {
+ pinctrl-names = "default";
+ pinctrl-0 = <&ephy_iot_mode>;
+ mediatek,poll-link-phy = <0>;
+};
diff --git a/arch/mips/mach-mtmips/mt7628/Kconfig b/arch/mips/mach-mtmips/mt7628/Kconfig
index 79b2ddc6692..a75196eaefd 100644
--- a/arch/mips/mach-mtmips/mt7628/Kconfig
+++ b/arch/mips/mach-mtmips/mt7628/Kconfig
@@ -27,6 +27,12 @@ config BOARD_MT7628_RFB
SPI-NOR flash, 1 built-in switch with 5 ports, 1 UART, 1 USB host,
1 SDXC, 1 PCIe socket and JTAG pins.
+config BOARD_ONION_OMEGA2
+ bool "Onion Omega2/2+"
+ help
+ Onion Omega2/2+ IoT computer. Has a MT7688 SoC with 64/128 MiB of DDR2
+ RAM and 16/32 MiB of SPI flash.
+
config BOARD_VOCORE2
bool "VoCore2"
select SPL_SERIAL
@@ -52,6 +58,7 @@ config SYS_CONFIG_NAME
default "mt7628" if BOARD_MT7628_RFB
source "board/gardena/smart-gateway-mt7688/Kconfig"
+source "board/onion/omega2p/Kconfig"
source "board/seeed/linkit-smart-7688/Kconfig"
source "board/vocore/vocore2/Kconfig"
diff --git a/board/onion/omega2p/Kconfig b/board/onion/omega2p/Kconfig
new file mode 100644
index 00000000000..45c18ee27ef
--- /dev/null
+++ b/board/onion/omega2p/Kconfig
@@ -0,0 +1,12 @@
+if BOARD_ONION_OMEGA2
+
+config SYS_BOARD
+ default "omega2p"
+
+config SYS_VENDOR
+ default "onion"
+
+config SYS_CONFIG_NAME
+ default "onion-omega2p"
+
+endif
diff --git a/board/onion/omega2p/MAINTAINERS b/board/onion/omega2p/MAINTAINERS
new file mode 100644
index 00000000000..4532c1c6d3e
--- /dev/null
+++ b/board/onion/omega2p/MAINTAINERS
@@ -0,0 +1,10 @@
+ONION OMEGA2/2+
+M: Philip Oberfichtner <pro@denx.de>
+S: Maintained
+F: arch/mips/dts/onion-omega2p.dts
+F: board/onion/omega2p/Kconfig
+F: board/onion/omega2p/Makefile
+F: board/onion/omega2p/board.c
+F: board/onion/omega2p/omega2p.env
+F: configs/onion-omega2p_defconfig
+F: include/configs/onion-omega2p.h
diff --git a/board/onion/omega2p/Makefile b/board/onion/omega2p/Makefile
new file mode 100644
index 00000000000..70cd7a8e568
--- /dev/null
+++ b/board/onion/omega2p/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-y += board.o
diff --git a/board/onion/omega2p/board.c b/board/onion/omega2p/board.c
new file mode 100644
index 00000000000..b56fbf262ad
--- /dev/null
+++ b/board/onion/omega2p/board.c
@@ -0,0 +1,134 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2024 Zheng Han <zh@onioniot.com>, Lazar Demin <lazar@onioniot.com>
+ * Copyright (C) 2025 DENX Software Engineering GmbH, Philip Oberfichtner <pro@denx.de>
+ */
+
+#include <asm/io.h>
+#include <env.h>
+#include <init.h>
+#include <mtd.h>
+
+#define OMEGA2_REG(x) (*((u32 *)(x)))
+#define OMEGA2_SYSCTL_BASE 0xB0000000
+#define OMEGA2_SYS_CNTL_BASE (OMEGA2_SYSCTL_BASE)
+#define OMEGA2_REG_PIODIR (OMEGA2_SYSCTL_BASE + 0x600)
+
+static int detect_rst(void)
+{
+ u32 val = OMEGA2_REG(0xb0000624); // Read GPIO 44 (reset button)
+
+ return (val & 1 << 6) ? 1 : 0;
+}
+
+static void gpio_init(void)
+{
+ u32 val;
+
+ printf("Initializing MT7688 GPIO system.\n");
+
+ //set gpio2_mode - setting wled, and p0,p1,p2,p3,p4 LED pins to GPIO mode
+ val = 0x555;
+ OMEGA2_REG(OMEGA2_SYS_CNTL_BASE + 0x64) = val; // GPIO2_MODE register
+ // GINT_FEDGE_1: setting "Enable falling edge triggered" for GPIOs 39-42
+ OMEGA2_REG(0xb0000644) = 0x0f << 7;
+
+ // set gpio_ctrl_1 register: set GPIO44 to output
+ //gpio44 output gpio_ctrl_1 bit3=1
+ val = OMEGA2_REG(OMEGA2_REG_PIODIR + 0x04);
+ val |= 1 << 12;
+ OMEGA2_REG(OMEGA2_REG_PIODIR + 0x04) = val;
+
+ // set gpio1_mode register: set WDT_MODE to GPIO mode
+ //set gpio1_mode 14=1b1
+ val = OMEGA2_REG(OMEGA2_SYS_CNTL_BASE + 0x60);
+ val |= 1 << 14;
+ OMEGA2_REG(OMEGA2_SYS_CNTL_BASE + 0x60) = val;
+
+ // set gpio_ctrl_1 resgister: set GPIO38 to input
+ //gpio38 input gpio_ctrl_1 bit5=0
+ val = OMEGA2_REG(OMEGA2_REG_PIODIR + 0x04);
+ val &= ~1 << 6;
+ OMEGA2_REG(OMEGA2_REG_PIODIR + 0x04) = val;
+}
+
+enum onion_board_variant {
+ OMEGA2,
+ OMEGA2P,
+ UNKNOWN,
+};
+
+static enum onion_board_variant board_variant(void)
+{
+ struct mtd_info *mtd;
+
+ mtd_probe_devices();
+
+ mtd_for_each_device(mtd) {
+ if (mtd->type != MTD_NORFLASH)
+ continue;
+
+ switch (mtd->size) {
+ case 16 * 1024 * 1024: // 16 MB
+ return OMEGA2;
+
+ case 32 * 1024 * 1024: // 32 MB
+ return OMEGA2P;
+
+ default:
+ break;
+ }
+ }
+
+ return UNKNOWN;
+}
+
+#define ONION_MTDPARTS_BASE "spi0.0:192k(u-boot),64k(u-boot-env),64k(factory)"
+
+static void set_mtdparts(void)
+{
+ switch (board_variant()) {
+ case OMEGA2P:
+ printf("Detected board variant OMEGA2+: ");
+ env_set("mtdparts", ONION_MTDPARTS_BASE ",32448k(firmware)");
+ break;
+
+ case OMEGA2:
+ printf("Detected board variant OMEGA2: ");
+ env_set("mtdparts", ONION_MTDPARTS_BASE ",16064k(firmware)");
+ break;
+
+ default:
+ printf("Unable to detect board variant! Using default value: ");
+ env_set("mtdparts", ONION_MTDPARTS_BASE);
+ }
+
+ printf("mtdparts=\"%s\"\n", env_get("mtdparts"));
+}
+
+#define WELCOME_MESSAGE \
+ "\n\n" \
+ " *************************************************************\n"\
+ " * For more info on using U-Boot, visit *\n"\
+ " * https://documentation.onioniot.com/bootloader/overview *\n"\
+ " * *\n"\
+ " * Hold the reset button to enter the U-Boot commandline. *\n"\
+ " *************************************************************\n"\
+ "\n"
+
+int board_late_init(void)
+{
+ gpio_init();
+
+ printf(WELCOME_MESSAGE);
+
+ set_mtdparts();
+
+ if (detect_rst()) {
+ printf("Reset button pressed - entering shell ...\n");
+ env_set("reset_pressed", "1");
+ // This env variable is evaluated by our bootcmd.
+ }
+
+ return 0;
+}
diff --git a/board/onion/omega2p/omega2p.env b/board/onion/omega2p/omega2p.env
new file mode 100644
index 00000000000..f8c10b584e2
--- /dev/null
+++ b/board/onion/omega2p/omega2p.env
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (C) 2025 DENX Software Engineering GmbH, Philip Oberfichtner <pro@denx.de>
+
+# Boot options
+bootargs=console=ttyS0,115200 rootfstype=squashfs,jffs2
+bootfile=firmware.bin
+boot_linux=sf probe && mtd read firmware 81800000 0 400000 && bootm 81800000
+
+# unset temporary variable and make the environment persist if necessary.
+env_check= \
+ env set reset_pressed; \
+ if env info -p -d -q; then \
+ echo "No valid environment found on flash. Write out the defaults."; \
+ env save; \
+ fi
+
+bootcmd= \
+ if test -z "${reset_pressed}"; then \
+ run env_check; \
+ run boot_linux; \
+ else \
+ run env_check; \
+ fi
+
+# Network configuration
+serverip=192.168.8.100
+ipaddr=192.168.8.8
+loadaddr=0x81800000
+
+# MTD settings
+mtdids=nor0=spi0.0
+# mtdparts will be set at runtime, according to the specific board variant.
diff --git a/configs/onion-omega2p_defconfig b/configs/onion-omega2p_defconfig
new file mode 100644
index 00000000000..6e8e4c52f30
--- /dev/null
+++ b/configs/onion-omega2p_defconfig
@@ -0,0 +1,82 @@
+CONFIG_MIPS=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_SYS_MALLOC_LEN=0x1000000
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_ENV_SIZE=0x4000
+CONFIG_ENV_OFFSET=0x30000
+CONFIG_ENV_SECT_SIZE=0x10000
+CONFIG_DEFAULT_DEVICE_TREE="onion-omega2p"
+CONFIG_SPL_SERIAL=y
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x80000
+CONFIG_SPL_BSS_START_ADDR=0x80010000
+CONFIG_SPL_BSS_MAX_SIZE=0x10000
+CONFIG_SYS_LOAD_ADDR=0x81800000
+CONFIG_SPL_SIZE_LIMIT=0x30000
+CONFIG_SPL=y
+CONFIG_ARCH_MTMIPS=y
+CONFIG_SOC_MT7628=y
+CONFIG_BOARD_ONION_OMEGA2=y
+CONFIG_SYS_MIPS_TIMER_FREQ=290000000
+CONFIG_MIPS_CACHE_SETUP=y
+CONFIG_MIPS_CACHE_DISABLE=y
+CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=y
+# CONFIG_MIPS_BOOT_ENV_LEGACY is not set
+CONFIG_MIPS_BOOT_FDT=y
+CONFIG_ENV_VARS_UBOOT_CONFIG=y
+CONFIG_FIT=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_BOOTDELAY=0
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_KEYED_CTRLC=y
+CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_SYS_MALLOC_BOOTPARAMS=y
+CONFIG_SPL_MAX_SIZE=0x10000
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_NOR_SUPPORT=y
+CONFIG_HUSH_PARSER=y
+# CONFIG_CMD_ELF is not set
+CONFIG_CMD_ERASEENV=y
+CONFIG_CMD_NVEDIT_INFO=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_PART=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
+CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="board/onion/omega2p/omega2p.env"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_USE_IPADDR=y
+CONFIG_IPADDR="192.168.8.8"
+CONFIG_USE_SERVERIP=y
+CONFIG_SERVERIP="192.168.8.100"
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_SPL_DM=y
+CONFIG_LED=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
+CONFIG_DM_MTD=y
+CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_GIGADEVICE=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_MTD=y
+CONFIG_MT7628_ETH=y
+CONFIG_PHY=y
+CONFIG_SPI=y
+CONFIG_MT7621_SPI=y
+CONFIG_LZMA=y
+# CONFIG_GZIP is not set
+CONFIG_SPL_LZMA=y
diff --git a/include/configs/onion-omega2p.h b/include/configs/onion-omega2p.h
new file mode 100644
index 00000000000..ca170b22a40
--- /dev/null
+++ b/include/configs/onion-omega2p.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2024 Zheng Han <zh@onioniot.com>, Lazar Demin <lazar@onioniot.com>
+ */
+#ifndef __CONFIG_ONION_OMEGA2P_H
+#define __CONFIG_ONION_OMEGA2P_H
+
+/* RAM */
+#define CFG_SYS_SDRAM_BASE 0x80000000
+#define CFG_SYS_INIT_SP_OFFSET 0x400000
+
+/* Dummy value */
+#define CFG_SYS_UBOOT_BASE 0
+
+#endif /* __CONFIG_ONION_OMEGA2P_H */
--
2.39.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin
2025-07-08 10:39 ` [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin Philip Oberfichtner
@ 2025-07-08 11:31 ` Ilias Apalodimas
2025-07-08 14:34 ` Philip Oberfichtner
2025-07-28 22:25 ` Tom Rini
1 sibling, 1 reply; 12+ messages in thread
From: Ilias Apalodimas @ 2025-07-08 11:31 UTC (permalink / raw)
To: Philip Oberfichtner
Cc: u-boot, Anshul Dalal, Dario Binacchi, Greg Malysa,
Jerome Forissier, Marek Vasut, Nathan Barrett-Morrison,
Paul Kocialkowski, Peng Fan, Peter Robinson, Simon Glass,
Tom Rini
Hi Philip,
On Tue, 8 Jul 2025 at 13:40, Philip Oberfichtner <pro@denx.de> wrote:
>
> Like other images, u-boot-with-spl.bin may be subject to size
> restrictions. Extend CONFIG_SPL_SIZE_LIMIT to handle this case.
>
> Signed-off-by: Philip Oberfichtner <pro@denx.de>
> ---
>
> Notes:
> Changes in v4: none
>
> Changes in v3:
> Reuse existing SPL_SIZE_LIMIT instead of implementing a new option
>
> Changes in v2: none
>
> Makefile | 1 +
> common/spl/Kconfig | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index fa9ce756083..791c00713ec 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1545,6 +1545,7 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
> --pad-to=$(CONFIG_SPL_PAD_TO)
> u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
> $(call if_changed,pad_cat)
> + $(SPL_SIZE_CHECK)
There's a rule in the Makefile
ifneq ($(CONFIG_SPL_SIZE_LIMIT),0x0)
SPL_SIZE_CHECK = @$(call size_check,$@,$$(tools/spl_size_limit))
else
SPL_SIZE_CHECK =
endif
and
isn't this running?
Thanks
/Ilias
>
> ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
> MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 9a17ccb2d3d..dcb25b593f1 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -43,7 +43,7 @@ config SPL_SIZE_LIMIT
> default 0x30000 if ARCH_MVEBU && ARMADA_32BIT
> default 0x0
> help
> - Specifies the maximum length of the U-Boot SPL image.
> + Specifies the maximum length of U-Boot SPL images.
> If this value is zero, it is ignored.
>
> config SPL_SIZE_LIMIT_SUBTRACT_GD
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin
2025-07-08 11:31 ` Ilias Apalodimas
@ 2025-07-08 14:34 ` Philip Oberfichtner
2025-07-10 8:32 ` Ilias Apalodimas
0 siblings, 1 reply; 12+ messages in thread
From: Philip Oberfichtner @ 2025-07-08 14:34 UTC (permalink / raw)
To: Ilias Apalodimas
Cc: u-boot, Anshul Dalal, Dario Binacchi, Greg Malysa,
Jerome Forissier, Marek Vasut, Nathan Barrett-Morrison,
Paul Kocialkowski, Peng Fan, Peter Robinson, Simon Glass,
Tom Rini
Hi Ilias,
Thanks for having a look at this!
On Tue, Jul 08, 2025 at 02:31:37PM +0300, Ilias Apalodimas wrote:
> > diff --git a/Makefile b/Makefile
> > index fa9ce756083..791c00713ec 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1545,6 +1545,7 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
> > --pad-to=$(CONFIG_SPL_PAD_TO)
> > u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
> > $(call if_changed,pad_cat)
> > + $(SPL_SIZE_CHECK)
>
> There's a rule in the Makefile
> ifneq ($(CONFIG_SPL_SIZE_LIMIT),0x0)
> SPL_SIZE_CHECK = @$(call size_check,$@,$$(tools/spl_size_limit))
> else
> SPL_SIZE_CHECK =
> endif
>
> and
>
> isn't this running?
Well, before this patch it only ran for the u-boot-spl.bin target. But I
also need it for the combined u-boot-with-spl.bin image.
I'm not sure if this answers your question?
Just for reference I'll put a link to the previous discussion with Tom:
https://patchwork.ozlabs.org/project/uboot/patch/20250527121049.106825-2-pro@denx.de/
Best regards,
Philip
>
> Thanks
> /Ilias
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin
2025-07-08 14:34 ` Philip Oberfichtner
@ 2025-07-10 8:32 ` Ilias Apalodimas
0 siblings, 0 replies; 12+ messages in thread
From: Ilias Apalodimas @ 2025-07-10 8:32 UTC (permalink / raw)
To: Philip Oberfichtner
Cc: u-boot, Anshul Dalal, Dario Binacchi, Greg Malysa,
Jerome Forissier, Marek Vasut, Nathan Barrett-Morrison,
Paul Kocialkowski, Peng Fan, Peter Robinson, Simon Glass,
Tom Rini
Hi Philip
On Tue, 8 Jul 2025 at 17:34, Philip Oberfichtner <pro@denx.de> wrote:
>
> Hi Ilias,
>
> Thanks for having a look at this!
>
> On Tue, Jul 08, 2025 at 02:31:37PM +0300, Ilias Apalodimas wrote:
> > > diff --git a/Makefile b/Makefile
> > > index fa9ce756083..791c00713ec 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -1545,6 +1545,7 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
> > > --pad-to=$(CONFIG_SPL_PAD_TO)
> > > u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
> > > $(call if_changed,pad_cat)
> > > + $(SPL_SIZE_CHECK)
> >
> > There's a rule in the Makefile
> > ifneq ($(CONFIG_SPL_SIZE_LIMIT),0x0)
> > SPL_SIZE_CHECK = @$(call size_check,$@,$$(tools/spl_size_limit))
> > else
> > SPL_SIZE_CHECK =
> > endif
> >
> > and
> >
> > isn't this running?
>
>
> Well, before this patch it only ran for the u-boot-spl.bin target. But I
> also need it for the combined u-boot-with-spl.bin image.
>
> I'm not sure if this answers your question?
It does, I misread your email
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
>
>
> Just for reference I'll put a link to the previous discussion with Tom:
> https://patchwork.ozlabs.org/project/uboot/patch/20250527121049.106825-2-pro@denx.de/
Thanks for the reference
/Ilias
>
>
> Best regards,
> Philip
>
> >
> > Thanks
> > /Ilias
> >
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 0/3] Add Onion Omega2/2+ board support
2025-07-08 10:39 [PATCH v4 0/3] Add Onion Omega2/2+ board support Philip Oberfichtner
` (2 preceding siblings ...)
2025-07-08 10:39 ` [PATCH v4 3/3] mips: mt7628: Add Onion Omega2/2+ board support Philip Oberfichtner
@ 2025-07-17 8:04 ` Philip Oberfichtner
3 siblings, 0 replies; 12+ messages in thread
From: Philip Oberfichtner @ 2025-07-17 8:04 UTC (permalink / raw)
To: u-boot, Tom Rini, Daniel Schwierzeck
Cc: Anshul Dalal, Dario Binacchi, Greg Malysa, GSS_MTK_Uboot_upstream,
Ilias Apalodimas, Jerome Forissier, Jiaxun Yang, Marek Vasut,
Nathan Barrett-Morrison, Paul Kocialkowski, Peng Fan,
Peter Robinson, Simon Glass, Stefan Roese, Stefan Roese,
Sumit Garg, Weijie Gao
Hi all,
It's been a while since my first submission of this patch set (end of
May). I'd hope we could still get it in within the current merge
window?
Best regards,
Philip
On Tue, Jul 08, 2025 at 12:39:56PM +0200, Philip Oberfichtner wrote:
> Add support for the MediaTek based boards by Onion. Commit one and two are
> rather generic, whereas the third commit adds the actual board support.
>
> Changes in v4:
> - Rebase board support to v2025.07
> - Add new commit to silence warning in arch/mips/
>
> Changes in v3:
> - Simplify image size check
>
> Changes in v2:
> - I forgot to run checkpatch in v1. Fix some style issues in v2.
>
> Philip Oberfichtner (3):
> Makefile: Add size check for u-boot-with-spl.bin
> mips: serial: Silence "unused variable" warning
> mips: mt7628: Add Onion Omega2/2+ board support
>
> Makefile | 1 +
> arch/mips/dts/Makefile | 1 +
> arch/mips/dts/onion-omega2p.dts | 58 ++++++++++
> arch/mips/mach-mtmips/mt7620/serial.c | 2 +-
> arch/mips/mach-mtmips/mt7621/spl/serial.c | 2 +-
> arch/mips/mach-mtmips/mt7628/Kconfig | 7 ++
> arch/mips/mach-mtmips/mt7628/serial.c | 2 +-
> board/onion/omega2p/Kconfig | 12 ++
> board/onion/omega2p/MAINTAINERS | 10 ++
> board/onion/omega2p/Makefile | 3 +
> board/onion/omega2p/board.c | 134 ++++++++++++++++++++++
> board/onion/omega2p/omega2p.env | 32 ++++++
> common/spl/Kconfig | 2 +-
> configs/onion-omega2p_defconfig | 82 +++++++++++++
> include/configs/onion-omega2p.h | 15 +++
> 15 files changed, 359 insertions(+), 4 deletions(-)
> create mode 100644 arch/mips/dts/onion-omega2p.dts
> create mode 100644 board/onion/omega2p/Kconfig
> create mode 100644 board/onion/omega2p/MAINTAINERS
> create mode 100644 board/onion/omega2p/Makefile
> create mode 100644 board/onion/omega2p/board.c
> create mode 100644 board/onion/omega2p/omega2p.env
> create mode 100644 configs/onion-omega2p_defconfig
> create mode 100644 include/configs/onion-omega2p.h
>
> --
> 2.39.5
>
--
=====================================================================
DENX Software Engineering GmbH,
Managing Director: Johanna Denk, Tabea Lutz
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
=====================================================================
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin
2025-07-08 10:39 ` [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin Philip Oberfichtner
2025-07-08 11:31 ` Ilias Apalodimas
@ 2025-07-28 22:25 ` Tom Rini
2025-07-29 12:27 ` Philip Oberfichtner
1 sibling, 1 reply; 12+ messages in thread
From: Tom Rini @ 2025-07-28 22:25 UTC (permalink / raw)
To: Philip Oberfichtner
Cc: u-boot, Anshul Dalal, Dario Binacchi, Greg Malysa,
Ilias Apalodimas, Jerome Forissier, Marek Vasut,
Nathan Barrett-Morrison, Paul Kocialkowski, Peng Fan,
Peter Robinson, Simon Glass
[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]
On Tue, Jul 08, 2025 at 12:39:57PM +0200, Philip Oberfichtner wrote:
> Like other images, u-boot-with-spl.bin may be subject to size
> restrictions. Extend CONFIG_SPL_SIZE_LIMIT to handle this case.
>
> Signed-off-by: Philip Oberfichtner <pro@denx.de>
> ---
>
> Notes:
> Changes in v4: none
>
> Changes in v3:
> Reuse existing SPL_SIZE_LIMIT instead of implementing a new option
>
> Changes in v2: none
>
> Makefile | 1 +
> common/spl/Kconfig | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
This is not quite right enough, sorry. This causes a number of boards
(evb-ast2600 ibm-sbp1 stm32746g-eval_spl stm32f746-disco_spl
stm32f769-disco_spl) which have size checks and are fine to now fail
their size checks, presumably because they're checking the "wrong" file
now or similar. So if you can't see a way to fix both them and your
board then sigh, I was wrong initially and we will need another size
check method like you proposed to start with.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin
2025-07-28 22:25 ` Tom Rini
@ 2025-07-29 12:27 ` Philip Oberfichtner
2025-07-29 14:22 ` Tom Rini
0 siblings, 1 reply; 12+ messages in thread
From: Philip Oberfichtner @ 2025-07-29 12:27 UTC (permalink / raw)
To: Tom Rini
Cc: u-boot, Anshul Dalal, Dario Binacchi, Greg Malysa,
Ilias Apalodimas, Jerome Forissier, Marek Vasut,
Nathan Barrett-Morrison, Paul Kocialkowski, Peng Fan,
Peter Robinson, Simon Glass
Hi Tom,
On Mon, Jul 28, 2025 at 04:25:31PM -0600, Tom Rini wrote:
> On Tue, Jul 08, 2025 at 12:39:57PM +0200, Philip Oberfichtner wrote:
>
> > Like other images, u-boot-with-spl.bin may be subject to size
> > restrictions. Extend CONFIG_SPL_SIZE_LIMIT to handle this case.
> >
> > Signed-off-by: Philip Oberfichtner <pro@denx.de>
> > ---
> >
> > Notes:
> > Changes in v4: none
> >
> > Changes in v3:
> > Reuse existing SPL_SIZE_LIMIT instead of implementing a new option
> >
> > Changes in v2: none
> >
> > Makefile | 1 +
> > common/spl/Kconfig | 2 +-
> > 2 files changed, 2 insertions(+), 1 deletion(-)
>
> This is not quite right enough, sorry. This causes a number of boards
> (evb-ast2600 ibm-sbp1 stm32746g-eval_spl stm32f746-disco_spl
> stm32f769-disco_spl) which have size checks and are fine to now fail
> their size checks, presumably because they're checking the "wrong" file
> now or similar.
Thanks for pointing that out. To sum it up: If those boards use
SPL_SIZE_LIMIT to restrict the size of an SPL-only image, then
u-boot-with-spl.bin, of course, can be too large and the build fails.
Plus in our previous discussion, we figured out why using
BOARD_SIZE_LIMIT also isn't suitable:
https://lore.kernel.org/u-boot/aD2EflR9DRYG-MY5@antares/
So from here I really don't see any better way than introducing yet
another CONFIG_*SIZE_LIMIT option.
But maybe we can however simplify and deduplicate some of the code. What
do you think about something like that (I have not yet tested it, just
a rough idea so far):
diff --git a/Makefile b/Makefile
index 32c036d531d..6f75b371e11 100644
--- a/Makefile
+++ b/Makefile
@@ -372,7 +372,7 @@ endif
define size_check
actual=$$( wc -c $1 | awk '{print $$1}'); \
limit=$$( printf "%d" $2 ); \
- if test $$actual -gt $$limit; then \
+ if test $$limit -gt 0 && test $$actual -gt $$limit; then \
echo "$1 exceeds file size limit:" >&2; \
echo " limit: $$(printf %#x $$limit) bytes" >&2; \
echo " actual: $$(printf %#x $$actual) bytes" >&2; \
@@ -939,30 +939,6 @@ LDPPFLAGS += \
#########################################################################
#########################################################################
-ifneq ($(CONFIG_BOARD_SIZE_LIMIT),)
-BOARD_SIZE_CHECK= @ $(call size_check,$@,$(CONFIG_BOARD_SIZE_LIMIT))
-else
-BOARD_SIZE_CHECK =
-endif
-
-ifneq ($(CONFIG_SPL_SIZE_LIMIT),0x0)
-SPL_SIZE_CHECK = @$(call size_check,$@,$$(tools/spl_size_limit))
-else
-SPL_SIZE_CHECK =
-endif
-
-ifneq ($(CONFIG_TPL_SIZE_LIMIT),0x0)
-TPL_SIZE_CHECK = @$(call size_check,$@,$(CONFIG_TPL_SIZE_LIMIT))
-else
-TPL_SIZE_CHECK =
-endif
-
-ifneq ($(CONFIG_VPL_SIZE_LIMIT),0x0)
-VPL_SIZE_CHECK = @$(call size_check,$@,$(CONFIG_VPL_SIZE_LIMIT))
-else
-VPL_SIZE_CHECK =
-endif
-
# Statically apply RELA-style relocations (currently arm64 only)
# This is useful for arm64 where static relocation needs to be performed on
# the raw binary, but certain simulators only accept an ELF file (but don't
@@ -1266,7 +1242,7 @@ endif
%.imx: $(IMX_DEPS) %.bin
$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
- $(BOARD_SIZE_CHECK)
+ @ $(call size_check,$@,$(CONFIG_BOARD_SIZE_LIMIT))
%.vyb: %.imx
$(Q)$(MAKE) $(build)=arch/arm/cpu/armv7/vf610 $@
@@ -1367,12 +1343,12 @@ endif
u-boot-nodtb.bin: u-boot FORCE
$(call if_changed,objcopy_uboot)
- $(BOARD_SIZE_CHECK)
+ @ $(call size_check,$@,$(CONFIG_BOARD_SIZE_LIMIT))
u-boot.ldr: u-boot
$(CREATE_LDR_ENV)
$(LDR) -T $(CONFIG_LDR_CPU) -c $@ $< $(LDR_FLAGS)
- $(BOARD_SIZE_CHECK)
+ @ $(call size_check,$@,$(CONFIG_BOARD_SIZE_LIMIT))
# binman
# ---------------------------------------------------------------------------
@@ -1498,7 +1474,7 @@ u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SANDBOX),dts/dt.dtb) \
,$(UBOOT_BIN)) FORCE
$(call if_changed,mkimage)
- $(BOARD_SIZE_CHECK)
+ @ $(call size_check,$@,$(CONFIG_BOARD_SIZE_LIMIT))
ifeq ($(CONFIG_SPL_LOAD_FIT_FULL),y)
MKIMAGEFLAGS_u-boot.itb =
@@ -1513,12 +1489,12 @@ u-boot.itb: u-boot-nodtb.bin \
$(if $(CONFIG_MULTI_DTB_FIT),$(FINAL_DTB_CONTAINER)) \
$(U_BOOT_ITS) FORCE
$(call if_changed,mkfitimage)
- $(BOARD_SIZE_CHECK)
+ @ $(call size_check,$@,$(CONFIG_BOARD_SIZE_LIMIT))
endif
u-boot-with-spl.kwb: u-boot.bin spl/u-boot-spl.bin FORCE
$(call if_changed,mkimage)
- $(BOARD_SIZE_CHECK)
+ @ $(call size_check,$@,$(CONFIG_BOARD_SIZE_LIMIT))
u-boot.dis: u-boot
$(OBJDUMP) -d $< > $@
@@ -1535,7 +1511,7 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
--pad-to=$(CONFIG_SPL_PAD_TO)
u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
$(call if_changed,pad_cat)
- $(SPL_SIZE_CHECK)
+ @$(call size_check,$@,$$(tools/spl_size_limit))
ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
@@ -2108,7 +2084,7 @@ u-boot.lds: $(LDSCRIPT) prepare FORCE
spl/u-boot-spl.bin: spl/u-boot-spl
@:
- $(SPL_SIZE_CHECK)
+ @$(call size_check,$@,$$(tools/spl_size_limit))
spl/u-boot-spl-dtb.bin: spl/u-boot-spl
@:
@@ -2133,14 +2109,14 @@ spl/boot.bin: spl/u-boot-spl
tpl/u-boot-tpl.bin: tpl/u-boot-tpl
@:
- $(TPL_SIZE_CHECK)
+ @$(call size_check,$@,$(CONFIG_TPL_SIZE_LIMIT))
tpl/u-boot-tpl: tools prepare $(if $(CONFIG_TPL_OF_CONTROL),dts/dt.dtb)
$(Q)$(MAKE) obj=tpl -f $(srctree)/scripts/Makefile.xpl all
vpl/u-boot-vpl.bin: vpl/u-boot-vpl
@:
- $(VPL_SIZE_CHECK)
+ @$(call size_check,$@,$(CONFIG_VPL_SIZE_LIMIT))
vpl/u-boot-vpl: tools prepare $(if $(CONFIG_TPL_OF_CONTROL),dts/dt.dtb)
$(Q)$(MAKE) obj=vpl -f $(srctree)/scripts/Makefile.xpl all
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin
2025-07-29 12:27 ` Philip Oberfichtner
@ 2025-07-29 14:22 ` Tom Rini
2025-07-30 12:41 ` Philip Oberfichtner
0 siblings, 1 reply; 12+ messages in thread
From: Tom Rini @ 2025-07-29 14:22 UTC (permalink / raw)
To: Philip Oberfichtner
Cc: u-boot, Anshul Dalal, Dario Binacchi, Greg Malysa,
Ilias Apalodimas, Jerome Forissier, Marek Vasut,
Nathan Barrett-Morrison, Paul Kocialkowski, Peng Fan,
Peter Robinson, Simon Glass
[-- Attachment #1: Type: text/plain, Size: 1852 bytes --]
On Tue, Jul 29, 2025 at 02:27:49PM +0200, Philip Oberfichtner wrote:
> Hi Tom,
>
> On Mon, Jul 28, 2025 at 04:25:31PM -0600, Tom Rini wrote:
> > On Tue, Jul 08, 2025 at 12:39:57PM +0200, Philip Oberfichtner wrote:
> >
> > > Like other images, u-boot-with-spl.bin may be subject to size
> > > restrictions. Extend CONFIG_SPL_SIZE_LIMIT to handle this case.
> > >
> > > Signed-off-by: Philip Oberfichtner <pro@denx.de>
> > > ---
> > >
> > > Notes:
> > > Changes in v4: none
> > >
> > > Changes in v3:
> > > Reuse existing SPL_SIZE_LIMIT instead of implementing a new option
> > >
> > > Changes in v2: none
> > >
> > > Makefile | 1 +
> > > common/spl/Kconfig | 2 +-
> > > 2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > This is not quite right enough, sorry. This causes a number of boards
> > (evb-ast2600 ibm-sbp1 stm32746g-eval_spl stm32f746-disco_spl
> > stm32f769-disco_spl) which have size checks and are fine to now fail
> > their size checks, presumably because they're checking the "wrong" file
> > now or similar.
>
> Thanks for pointing that out. To sum it up: If those boards use
> SPL_SIZE_LIMIT to restrict the size of an SPL-only image, then
> u-boot-with-spl.bin, of course, can be too large and the build fails.
>
> Plus in our previous discussion, we figured out why using
> BOARD_SIZE_LIMIT also isn't suitable:
> https://lore.kernel.org/u-boot/aD2EflR9DRYG-MY5@antares/
>
> So from here I really don't see any better way than introducing yet
> another CONFIG_*SIZE_LIMIT option.
>
>
> But maybe we can however simplify and deduplicate some of the code. What
> do you think about something like that (I have not yet tested it, just
> a rough idea so far):
That sounds like a good idea, so long as it works :) Thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin
2025-07-29 14:22 ` Tom Rini
@ 2025-07-30 12:41 ` Philip Oberfichtner
0 siblings, 0 replies; 12+ messages in thread
From: Philip Oberfichtner @ 2025-07-30 12:41 UTC (permalink / raw)
To: Tom Rini
Cc: u-boot, Anshul Dalal, Dario Binacchi, Greg Malysa,
Ilias Apalodimas, Jerome Forissier, Marek Vasut,
Nathan Barrett-Morrison, Paul Kocialkowski, Peng Fan,
Peter Robinson, Simon Glass
On Tue, Jul 29, 2025 at 08:22:11AM -0600, Tom Rini wrote:
> On Tue, Jul 29, 2025 at 02:27:49PM +0200, Philip Oberfichtner wrote:
> > Hi Tom,
> >
> > On Mon, Jul 28, 2025 at 04:25:31PM -0600, Tom Rini wrote:
> > > On Tue, Jul 08, 2025 at 12:39:57PM +0200, Philip Oberfichtner wrote:
> > >
> > > > Like other images, u-boot-with-spl.bin may be subject to size
> > > > restrictions. Extend CONFIG_SPL_SIZE_LIMIT to handle this case.
> > > >
> > > > Signed-off-by: Philip Oberfichtner <pro@denx.de>
> > > > ---
> > > >
> > > > Notes:
> > > > Changes in v4: none
> > > >
> > > > Changes in v3:
> > > > Reuse existing SPL_SIZE_LIMIT instead of implementing a new option
> > > >
> > > > Changes in v2: none
> > > >
> > > > Makefile | 1 +
> > > > common/spl/Kconfig | 2 +-
> > > > 2 files changed, 2 insertions(+), 1 deletion(-)
> > >
> > > This is not quite right enough, sorry. This causes a number of boards
> > > (evb-ast2600 ibm-sbp1 stm32746g-eval_spl stm32f746-disco_spl
> > > stm32f769-disco_spl) which have size checks and are fine to now fail
> > > their size checks, presumably because they're checking the "wrong" file
> > > now or similar.
> >
> > Thanks for pointing that out. To sum it up: If those boards use
> > SPL_SIZE_LIMIT to restrict the size of an SPL-only image, then
> > u-boot-with-spl.bin, of course, can be too large and the build fails.
> >
> > Plus in our previous discussion, we figured out why using
> > BOARD_SIZE_LIMIT also isn't suitable:
> > https://lore.kernel.org/u-boot/aD2EflR9DRYG-MY5@antares/
> >
> > So from here I really don't see any better way than introducing yet
> > another CONFIG_*SIZE_LIMIT option.
> >
> >
> > But maybe we can however simplify and deduplicate some of the code. What
> > do you think about something like that (I have not yet tested it, just
> > a rough idea so far):
>
> That sounds like a good idea, so long as it works :) Thanks!
>
So I've tested it for multiple board/image combinations. Should be fine
now. v5 is on the way.
Best regards,
Philip
> --
> Tom
--
=====================================================================
DENX Software Engineering GmbH,
Managing Director: Johanna Denk, Tabea Lutz
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
=====================================================================
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-07-30 12:41 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08 10:39 [PATCH v4 0/3] Add Onion Omega2/2+ board support Philip Oberfichtner
2025-07-08 10:39 ` [PATCH v4 1/3] Makefile: Add size check for u-boot-with-spl.bin Philip Oberfichtner
2025-07-08 11:31 ` Ilias Apalodimas
2025-07-08 14:34 ` Philip Oberfichtner
2025-07-10 8:32 ` Ilias Apalodimas
2025-07-28 22:25 ` Tom Rini
2025-07-29 12:27 ` Philip Oberfichtner
2025-07-29 14:22 ` Tom Rini
2025-07-30 12:41 ` Philip Oberfichtner
2025-07-08 10:39 ` [PATCH v4 2/3] mips: serial: Silence "unused variable" warning Philip Oberfichtner
2025-07-08 10:39 ` [PATCH v4 3/3] mips: mt7628: Add Onion Omega2/2+ board support Philip Oberfichtner
2025-07-17 8:04 ` [PATCH v4 0/3] " Philip Oberfichtner
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.