[PATCH v3 1/2] configs: phycore-rk3288: Enable CONFIG_LTO

From: Wadim Egorov w.egorov@phytec.de
The phycore-rk3288 SPL binary is reaching the limits of 32KB very often. Enable CONFIG_LTO to reduce the size of the SPL and make the board more future proof for changes increasing the SPL size.
Signed-off-by: Wadim Egorov w.egorov@phytec.de Signed-off-by: Samuel Holland samuel@sholland.org ---
Changes in v3: - New patch for v3
configs/phycore-rk3288_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/phycore-rk3288_defconfig b/configs/phycore-rk3288_defconfig index 0632a928bc..f2a92e25a8 100644 --- a/configs/phycore-rk3288_defconfig +++ b/configs/phycore-rk3288_defconfig @@ -15,6 +15,7 @@ CONFIG_DEBUG_UART_BASE=0xff690000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SYS_LOAD_ADDR=0x800800 CONFIG_DEBUG_UART=y +CONFIG_LTO=y CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x100000 CONFIG_SYS_MONITOR_LEN=614400

If the UART bus or baud clock has a gate, it must be enabled before the UART can be used.
Reviewed-by: Stefan Roese sr@denx.de Signed-off-by: Samuel Holland samuel@sholland.org ---
Changes in v3: - Switch back to the original patch, now that the phycore-rk3288 build is fixed by enabling LTO in patch 1.
Changes in v2: - Only enable the first clock, as using the clk_get_bulk() API pushes a board (phycore-rk3288) over its SPL size limit.
drivers/serial/ns16550.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index eab9537fba..50ec36ed7f 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -506,6 +506,7 @@ int ns16550_serial_probe(struct udevice *dev) struct ns16550_plat *plat = dev_get_plat(dev); struct ns16550 *const com_port = dev_get_priv(dev); struct reset_ctl_bulk reset_bulk; + struct clk_bulk clk_bulk; fdt_addr_t addr; int ret;
@@ -524,6 +525,10 @@ int ns16550_serial_probe(struct udevice *dev) if (!ret) reset_deassert_bulk(&reset_bulk);
+ ret = clk_get_bulk(dev, &clk_bulk); + if (!ret) + clk_enable_bulk(&clk_bulk); + com_port->plat = dev_get_plat(dev); ns16550_init(com_port, -1);

Hi Wadim, Samuel,
Migrate to use the TPL+SPL can fix the size limit issue.
On 2023/1/22 08:08, Samuel Holland wrote:
From: Wadim Egorov w.egorov@phytec.de
The phycore-rk3288 SPL binary is reaching the limits of 32KB very often. Enable CONFIG_LTO to reduce the size of the SPL and make the board more future proof for changes increasing the SPL size.
Signed-off-by: Wadim Egorov w.egorov@phytec.de Signed-off-by: Samuel Holland samuel@sholland.org
Reviewed-by: Kever Yang kever.yang@rock-chips.com
Thanks, - Kever
Changes in v3:
- New patch for v3
configs/phycore-rk3288_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/phycore-rk3288_defconfig b/configs/phycore-rk3288_defconfig index 0632a928bc..f2a92e25a8 100644 --- a/configs/phycore-rk3288_defconfig +++ b/configs/phycore-rk3288_defconfig @@ -15,6 +15,7 @@ CONFIG_DEBUG_UART_BASE=0xff690000 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_SYS_LOAD_ADDR=0x800800 CONFIG_DEBUG_UART=y +CONFIG_LTO=y CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x100000 CONFIG_SYS_MONITOR_LEN=614400
participants (2)
-
Kever Yang
-
Samuel Holland