]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
global_data: Move pci_clk to m68k and powerpc
authorSimon Glass <sjg@chromium.org>
Wed, 21 Aug 2024 16:18:53 +0000 (10:18 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 26 Aug 2024 20:05:37 +0000 (14:05 -0600)
Only m68k and powerpc use this field, so move it to the arch-specific
info, to reduce the size for other archs.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/m68k/cpu/mcf5445x/cpu.c
arch/m68k/include/asm/global_data.h
arch/m68k/lib/bdinfo.c
arch/powerpc/cpu/mpc83xx/pci.c
arch/powerpc/cpu/mpc83xx/speed.c
arch/powerpc/include/asm/global_data.h
drivers/clk/mpc83xx_clk.c
include/asm-generic/global_data.h

index b811ac355e4d1c934c08f571244b37615f74e080..3fbd6a58c7d313041f84e7ba1a964094f68508e2 100644 (file)
@@ -92,7 +92,7 @@ int print_cpuinfo(void)
                       strmhz(buf3, gd->arch.flb_clk));
 #ifdef CONFIG_PCI
                printf("       PCI CLK %s MHz INP CLK %s MHz VCO CLK %s MHz\n",
-                      strmhz(buf1, gd->pci_clk),
+                      strmhz(buf1, gd->arch.pci_clk),
                       strmhz(buf2, gd->arch.inp_clk),
                       strmhz(buf3, gd->arch.vco_clk));
 #else
index 93efc722ba8a025ea684246859ee9922242eba33..4ac886933c6ba6f72987de6999df62e347402615 100644 (file)
@@ -26,6 +26,8 @@ struct arch_global_data {
 #if defined(CONFIG_FSL_ESDHC)
        unsigned long sdhc_per_clk;
 #endif
+       /** @pci_clk: PCI clock rate in Hz */
+       unsigned long pci_clk;
 };
 
 #include <asm-generic/global_data.h>
index cf6ae5adddfdcf97e0432e555bc1bca00fc98797..891e94bbd3fae59992f6607656ef2a79a212fc68 100644 (file)
@@ -22,7 +22,7 @@ int arch_setup_bdinfo(void)
        bd->bi_busfreq = gd->bus_clk;   /* Bus Freq,      in Hz */
 
        if (IS_ENABLED(CONFIG_PCI))
-               bd->bi_pcifreq = gd->pci_clk;
+               bd->bi_pcifreq = gd->arch.pci_clk;
 
 #if defined(CONFIG_EXTRA_CLOCK)
        bd->bi_inpfreq = gd->arch.inp_clk;      /* input Freq in Hz */
index 6f378c4e221ff7f6d22786d1c5b6701a6a2c8267..aef1123a2b77eb7026c6e850f52d98f1a691bd81 100644 (file)
@@ -45,7 +45,7 @@ void ft_pci_setup(void *blob, struct bd_info *bd)
                        do_fixup_by_path(blob, path, "bus-range",
                                &tmp, sizeof(tmp), 1);
 
-                       tmp[0] = cpu_to_be32(gd->pci_clk);
+                       tmp[0] = cpu_to_be32(gd->arch.pci_clk);
                        do_fixup_by_path(blob, path, "clock-frequency",
                                &tmp, sizeof(tmp[0]), 1);
                }
@@ -60,7 +60,7 @@ void ft_pci_setup(void *blob, struct bd_info *bd)
                        do_fixup_by_path(blob, path, "bus-range",
                                &tmp, sizeof(tmp), 1);
 
-                       tmp[0] = cpu_to_be32(gd->pci_clk);
+                       tmp[0] = cpu_to_be32(gd->arch.pci_clk);
                        do_fixup_by_path(blob, path, "clock-frequency",
                                &tmp, sizeof(tmp[0]), 1);
                }
index 72464962613f361864f36fb3012e2afc7a20a0a1..0185ab50ad9bca421ee0f2fa1345eae63178a9aa 100644 (file)
@@ -456,7 +456,7 @@ int get_clocks(void)
 #if defined(CONFIG_ARCH_MPC837X)
        gd->arch.sata_clk = sata_clk;
 #endif
-       gd->pci_clk = pci_sync_in;
+       gd->arch.pci_clk = pci_sync_in;
        gd->cpu_clk = gd->arch.core_clk;
        gd->bus_clk = gd->arch.csb_clk;
        return 0;
index a9efbbdd3d498c9b25a9850b0dbff996267f1720..cc2ce617350ca8e48d3e1c6f62f5a7635b9e07d5 100644 (file)
@@ -87,6 +87,8 @@ struct arch_global_data {
 #if defined(CONFIG_LWMON5)
        unsigned long kbd_status;
 #endif
+       /** @pci_clk: PCI clock rate in Hz */
+       unsigned long pci_clk;
 };
 
 #include <asm-generic/global_data.h>
index a29ad0d7a68d7e8afaf2e46f92cf038a8ad6eadb..a43fff2e7ed98a279ff62605cad00ba21ca89ab2 100644 (file)
@@ -358,7 +358,7 @@ static int mpc83xx_clk_probe(struct udevice *dev)
        gd->mem_clk = priv->speed[MPC83XX_CLK_MEM];
 
        if (mpc83xx_has_pci(type))
-               gd->pci_clk = priv->speed[MPC83XX_CLK_PCI];
+               gd->arch.pci_clk = priv->speed[MPC83XX_CLK_PCI];
 
        gd->cpu_clk = priv->speed[MPC83XX_CLK_CORE];
        gd->bus_clk = priv->speed[MPC83XX_CLK_CSB];
index 19c66e1fe5d83094de0ef8099e44f104ba0bd8a1..79d2aa4c6f5a91a4f50e13a380f2fc5d2fc2c8e4 100644 (file)
@@ -60,11 +60,6 @@ struct global_data {
         * @bus_clk: platform clock rate in Hz
         */
        unsigned long bus_clk;
-       /**
-        * @pci_clk: PCI clock rate in Hz
-        */
-       /* We cannot bracket this with CONFIG_PCI due to mpc5xxx */
-       unsigned long pci_clk;
        /**
         * @mem_clk: memory clock rate in Hz
         */