]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mach-k3: Move MSMC fixup to SoC level
authorAndrew Davis <afd@ti.com>
Thu, 6 Apr 2023 16:38:10 +0000 (11:38 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 24 Apr 2023 17:18:47 +0000 (13:18 -0400)
The MSMC fixup is something we do based on SoC, not based on the board.
So this fixup does not belong in the board files. Move this to the
mach-k3 common file so that it does not have to be done in each board
that uses these SoCs.

We use ft_system_setup() here instead of ft_board_setup() since it is no
longer board level. Enable OF_SYSTEM_SETUP in the configurations that use
this to keep functionality the same.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
16 files changed:
arch/arm/mach-k3/common.c
arch/arm/mach-k3/include/mach/sys_proto.h
board/siemens/iot2050/board.c
board/ti/am65x/evm.c
board/ti/j721e/evm.c
board/ti/j721s2/evm.c
configs/am65x_evm_a53_defconfig
configs/am65x_hs_evm_a53_defconfig
configs/iot2050_pg1_defconfig
configs/iot2050_pg2_defconfig
configs/j7200_evm_a72_defconfig
configs/j7200_hs_evm_a72_defconfig
configs/j721e_evm_a72_defconfig
configs/j721e_hs_evm_a72_defconfig
configs/j721s2_evm_a72_defconfig
configs/j721s2_hs_evm_a72_defconfig

index a2adb791f6c06cc254259f93005452ba24bb7521..6870f13c5200e7b0cec362debcde39019ffd820c 100644 (file)
@@ -386,6 +386,22 @@ int fdt_disable_node(void *blob, char *node_path)
        return 0;
 }
 
+#if defined(CONFIG_OF_SYSTEM_SETUP)
+int ft_system_setup(void *blob, struct bd_info *bd)
+{
+       int ret;
+
+       ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000");
+       if (ret < 0)
+               ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000",
+                                        "sram@70000000");
+       if (ret)
+               printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
+
+       return ret;
+}
+#endif
+
 #endif
 
 #ifndef CONFIG_SYSRESET
index 3d3d90d02d6548a644f66c1cded0fe84befc89f3..0b5d606eaa2908c11e58b77790a1eb1665b06b65 100644 (file)
@@ -11,7 +11,6 @@ void sdelay(unsigned long loops);
 u32 wait_on_value(u32 read_bit_mask, u32 match_value, void *read_addr,
                  u32 bound);
 struct ti_sci_handle *get_ti_sci_handle(void);
-int fdt_fixup_msmc_ram(void *blob, char *parent_path, char *node_name);
 int do_board_detect(void);
 void release_resources_for_core_shutdown(void);
 int fdt_disable_node(void *blob, char *node_path);
index df705b7c97181b7fdbac502b86852a0eccd953ea..1ba3e90c6fc74d1abae43eaaf8ca1a20486e275d 100644 (file)
@@ -482,19 +482,10 @@ fixup_error:
 
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
-       int ret;
-
-       ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000");
-       if (ret < 0)
-               ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000",
-                                        "sram@70000000");
-       if (ret)
-               pr_err("%s: fixing up msmc ram failed %d\n", __func__, ret);
-
        if (board_is_m2())
                m2_fdt_fixup(blob);
 
-       return ret;
+       return 0;
 }
 #endif
 
index b266ccb4b82eb3d83857c191ef415e682cf9dabe..4053b8333cf70c3532004cc32bf8c807fa844b83 100644 (file)
@@ -101,24 +101,6 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, struct bd_info *bd)
-{
-       int ret;
-
-       ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000");
-       if (ret < 0)
-               ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000",
-                                        "sram@70000000");
-       if (ret) {
-               printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
-               return ret;
-       }
-
-       return 0;
-}
-#endif
-
 #ifdef CONFIG_TI_I2C_BOARD_DETECT
 int do_board_detect(void)
 {
index d4e672a7acd5aa734442a2b6a1fd840a16fe2772..00ce009d3e850049b485ad607be92be6dcf55932 100644 (file)
@@ -144,18 +144,9 @@ void spl_perform_fixups(struct spl_image_info *spl_image)
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
-       int ret;
-
-       ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000");
-       if (ret < 0)
-               ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000",
-                                        "sram@70000000");
-       if (ret)
-               printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
-
        detect_enable_hyperflash(blob);
 
-       return ret;
+       return 0;
 }
 #endif
 
index c86715fa211ac008513578b094317a60ad0a6fab..9b130c141aca0ceb295f8b544600780e0f6a4c8b 100644 (file)
@@ -73,22 +73,6 @@ int dram_init_banksize(void)
        return 0;
 }
 
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, struct bd_info *bd)
-{
-       int ret;
-
-       ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000");
-       if (ret < 0)
-               ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000",
-                                        "sram@70000000");
-       if (ret)
-               printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
-
-       return ret;
-}
-#endif
-
 #ifdef CONFIG_TI_I2C_BOARD_DETECT
 /*
  * Functions specific to EVM and SK designs of J721S2/AM68 family.
index bddd94ce80e33e2f13fad0226161c0a2a450d844..4af274e06d698bba0000cf7ec709fe8a58afe567 100644 (file)
@@ -30,7 +30,7 @@ CONFIG_SPL_SPI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
 CONFIG_LOGLEVEL=7
index 898403aad98ad624d63e4a72d3cc4afc179ae098..bdd4b6420dd837ae4093b24d1f5d2c73569b2bfb 100644 (file)
@@ -30,7 +30,7 @@ CONFIG_SPL_SPI=y
 # CONFIG_PSCI_RESET is not set
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run get_fit_${boot}; run get_overlaystring; run run_fit"
 CONFIG_LOGLEVEL=7
index b02769609c77b30dcfeee539062d66262784f24c..957e3c4b2c2c26e1665efd22839912e73c539b20 100644 (file)
@@ -28,6 +28,7 @@ CONFIG_SPL_SPI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTSTAGE=y
 CONFIG_SHOW_BOOT_PROGRESS=y
index b20667780a34499be16e67feacf3506a767e5857..1d221ade0d5bccf25710659beabbfa17357291c8 100644 (file)
@@ -28,6 +28,7 @@ CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_BOOTSTAGE=y
 CONFIG_SHOW_BOOT_PROGRESS=y
 CONFIG_SPL_SHOW_BOOT_PROGRESS=y
index 9b6512bacba79a510f59bfb07e6ffa93c0c65dbc..f9299780f71951b3b3a41c2374be5f54dd94c666 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_SPL_SPI=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
 CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
 CONFIG_LOGLEVEL=7
index cfd2e80aded08b5328d5d6866e6a38f75435e613..e83525bcb5e028a15b076e6526c1db5f57870866 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_SPL_SPI=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
 CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_fit_${boot}; run get_overlaystring; run run_fit"
 CONFIG_LOGLEVEL=7
index 452e4b9695d2b7ac273adbee64c6ebeb40ba6589..46ad1b7d1a1c7db1db7e66e9e3dede1863b6766a 100644 (file)
@@ -29,6 +29,7 @@ CONFIG_SPL_SPI=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
 CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run init_${boot}; run main_cpsw0_qsgmii_phyinit; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
 CONFIG_LOGLEVEL=7
index 651df4a4865c1ac3ba4c8c7aa36b8f3e25cd2bfc..df4bf01daf96c4a66f79850dc87cd09688de244f 100644 (file)
@@ -30,6 +30,7 @@ CONFIG_SPL_SPI=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
 CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run main_cpsw0_qsgmii_phyinit; run boot_rprocs; run get_fit_${boot}; run get_overlay_${boot}; run run_fit"
 CONFIG_LOGLEVEL=7
index 3a91df71d37c0b25e7dac5bbf7cecdea70d16a48..9889e1bd5239d97a2daecb92908e65e06be1f101 100644 (file)
@@ -28,7 +28,7 @@ CONFIG_SPL_SPI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern"
 CONFIG_LOGLEVEL=7
index 453f2aabbfc9b71c40044735f80c49410eb938f1..035d87b49f14108fdeef83031308a8ac7b908ede 100644 (file)
@@ -31,7 +31,7 @@ CONFIG_SPL_SPI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_fit_${boot}; run get_overlaystring; run run_fit"
 CONFIG_LOGLEVEL=7