]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call
authorMarek Vasut <marex@denx.de>
Mon, 19 Sep 2022 19:41:15 +0000 (21:41 +0200)
committerStefano Babic <sbabic@denx.de>
Fri, 21 Oct 2022 09:54:00 +0000 (11:54 +0200)
Instead of duplicating code implemented by i.MX8M version of arch_misc_init()
in every board, enable CONFIG_ARCH_MISC_INIT and call arch_misc_init() from
spl_board_init(). This removes the duplication. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
12 files changed:
board/freescale/imx8mm_evk/spl.c
board/freescale/imx8mn_evk/spl.c
board/freescale/imx8mp_evk/spl.c
board/kontron/sl-mx8mm/spl.c
board/toradex/verdin-imx8mm/spl.c
configs/imx8mm-mx8menlo_defconfig
configs/imx8mm_evk_defconfig
configs/imx8mm_evk_fspi_defconfig
configs/imx8mn_ddr4_evk_defconfig
configs/imx8mp_evk_defconfig
configs/kontron-sl-mx8mm_defconfig
configs/verdin-imx8mm_defconfig

index e2eb1426c83678a4f588ab87cc9b78957126e99a..e0e97c7fd9ab436fee031732340fcfd0d30059fc 100644 (file)
@@ -53,15 +53,7 @@ static void spl_dram_init(void)
 
 void spl_board_init(void)
 {
-       if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-               struct udevice *dev;
-               int ret;
-
-               ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-               if (ret)
-                       printf("Failed to initialize caam_jr: %d\n", ret);
-       }
-       puts("Normal Boot\n");
+       arch_misc_init();
 }
 
 #ifdef CONFIG_SPL_LOAD_FIT
index c0bfb67199ae40d7a97497d65493930f07c3e442..380abecd7460198bf0e92bd60c37a022476774ba 100644 (file)
@@ -49,11 +49,8 @@ void spl_board_init(void)
        struct udevice *dev;
        int ret;
 
-       if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-               ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-               if (ret)
-                       printf("Failed to initialize caam_jr: %d\n", ret);
-       }
+       arch_misc_init();
+
        puts("Normal Boot\n");
 
        ret = uclass_get_device_by_name(UCLASS_CLK,
index 719b1f6d7da589c4e75c96809d663a12b2631bc1..f1b285417d076517fabc663f3c9a7df67eaf6cbe 100644 (file)
@@ -37,14 +37,8 @@ void spl_dram_init(void)
 
 void spl_board_init(void)
 {
-       if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-               struct udevice *dev;
-               int ret;
+       arch_misc_init();
 
-               ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-               if (ret)
-                       printf("Failed to initialize caam_jr: %d\n", ret);
-       }
        /*
         * Set GIC clock to 500Mhz for OD VDD_SOC. Kernel driver does
         * not allow to change it. Should set the clock after PMIC
index 8e7d017688bb6c1dfc5b3e8134d525b190960da5..25ee925ceb07aea8da3373400a3fca02045a5d64 100644 (file)
@@ -162,11 +162,7 @@ void spl_board_init(void)
        struct udevice *dev;
        int ret;
 
-       if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-               ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-               if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
-       }
+       arch_misc_init();
 
        puts("Normal Boot\n");
 
index fb9aae6c9c84755beeeb36d8f46babe4191250f8..59a3d9e0caee37eacdb72b55e022c1f84fa163c5 100644 (file)
@@ -53,14 +53,7 @@ void spl_dram_init(void)
 
 void spl_board_init(void)
 {
-       if (IS_ENABLED(CONFIG_FSL_CAAM)) {
-               struct udevice *dev;
-               int ret;
-
-               ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
-               if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
-       }
+       arch_misc_init();
 
        /* Serial download mode */
        if (is_usb_boot()) {
index 702162f86de84030e65bfb1e74ca5c396c4aaa81..929ff382f27b83c85ef04a2cb9983a01b0027a73 100644 (file)
@@ -34,6 +34,7 @@ CONFIG_DEFAULT_FDT_FILE="imx8mm-mx8menlo.dtb"
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x910000
index 7bcedcd51f5a96f43717de831f505224734086d8..58b5e468a58b4f51ed394d843c5a049794bd6f5e 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x910000
index 21fd7e08db1c0a96d27215a018f40286a71a1dee..73c96f634ce4b34e288aeb7a1f11ad33d90e57b8 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x25000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
index b99319afa6436e195bae2ee45c763ca739d6260f..d8a9a8065a4647b654af890d1416277956fefa50 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_DEFAULT_FDT_FILE="imx8mn-ddr4-evk.dtb"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x25000
index 0be1951e740fe44024d023fd43b35393f9e688a5..406e89e428ba7a5bb70a4b25b94448c868dabd4e 100644 (file)
@@ -28,6 +28,7 @@ CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x26000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
index 749b25a317828d2630e3628fb21a40f81319d65c..061391784f0131abb591f1b26ae0619f2fa65927 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_SPL_LOAD_FIT=y
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOARD_TYPES=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x910000
index f65b4a7f307a45896a6b400cd4f7e2192087ba4a..230fe55d0688fcd9a84b0af175c95e2a5ad69849 100644 (file)
@@ -36,6 +36,7 @@ CONFIG_PREBOOT="test -n ${fdtfile} || setenv fdtfile imx8mm-verdin-${variant}-${
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
 CONFIG_SPL_BSS_START_ADDR=0x910000