From 21b446487dae3622c75bde4bb4c2f18dc43f5c7b Mon Sep 17 00:00:00 2001 From: Gokul Sriram Palanisamy Date: Thu, 14 Sep 2023 15:00:07 +0530 Subject: [PATCH] ipq5332: TINY NOR: add compressed_art fixup For tiny profiles, ART partition is compressed. Indicate the same to the Linux kernel with an fdt entry. Change-Id: I9c3a21fc2c8350487fc100dedc79480fec5d462f Signed-off-by: Gokul Sriram Palanisamy --- board/qca/arm/common/fdt_fixup.c | 12 ++++++------ board/qca/arm/ipq5018/ipq5018.c | 2 +- board/qca/arm/ipq5332/ipq5332.c | 13 +++++++++++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/board/qca/arm/common/fdt_fixup.c b/board/qca/arm/common/fdt_fixup.c index 7999e495fc..72b63741f4 100644 --- a/board/qca/arm/common/fdt_fixup.c +++ b/board/qca/arm/common/fdt_fixup.c @@ -876,11 +876,6 @@ __weak void fdt_fixup_for_atf(void *blob) return; } -__weak void fdt_fixup_art_format(void *blob) -{ - return; -} - #ifdef CONFIG_IPQ_BT_SUPPORT __weak void fdt_fixup_bt_running(void *blob) { @@ -963,6 +958,11 @@ __weak void fdt_fixup_auto_restart(void *blob) } #endif +__weak void fdt_fixup_art_format(void *blob) +{ + return; +} + __weak void ipq_fdt_fixup_socinfo(void *blob) { uint32_t cpu_type; @@ -1196,13 +1196,13 @@ int ft_board_setup(void *blob, bd_t *bd) fdt_fixup_bt_running(blob); #endif fdt_fixup_sdx65_gpio(blob); +#endif /* || This features fixup compressed_art in || dts if its 16M profile build. */ fdt_fixup_art_format(blob); -#endif #ifdef CONFIG_QCA_MMC board_mmc_deinit(); diff --git a/board/qca/arm/ipq5018/ipq5018.c b/board/qca/arm/ipq5018/ipq5018.c index 1f611987be..825e482c93 100644 --- a/board/qca/arm/ipq5018/ipq5018.c +++ b/board/qca/arm/ipq5018/ipq5018.c @@ -2055,6 +2055,7 @@ void fdt_fixup_bt_debug(void *blob) parse_fdt_fixup("/soc/serial@78b0000/%status%?ok", blob); parse_fdt_fixup("/soc/usb3@8A00000/%delete%device-power-gpio", blob); } +#endif #ifdef CONFIG_IPQ_TINY void fdt_fixup_art_format(void *blob) @@ -2065,7 +2066,6 @@ void fdt_fixup_art_format(void *blob) } #endif -#endif #ifndef CONFIG_CMD_DISABLE_EXECTZT void run_tzt(void *address) diff --git a/board/qca/arm/ipq5332/ipq5332.c b/board/qca/arm/ipq5332/ipq5332.c index ef2c93a61f..7ee5c41868 100644 --- a/board/qca/arm/ipq5332/ipq5332.c +++ b/board/qca/arm/ipq5332/ipq5332.c @@ -131,6 +131,19 @@ void fdt_fixup_flash(void *blob) } #endif +#ifdef CONFIG_IPQ_TINY_SPI_NOR +void fdt_fixup_art_format(void *blob) +{ + int nodeoffset; + int ret; + + nodeoffset = fdt_path_offset(blob, "/"); + ret = fdt_setprop(blob, nodeoffset, "compressed_art", NULL, 0); + if (ret != 0) + printf("fdt-fixup: unable to set property 'compressed_art'\n"); +} +#endif + void qca_serial_init(struct ipq_serial_platdata *plat) { int ret;