From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>
Subject: [PATCH v2 01/35] global_data: Move pci_clk to m68k and powerpc
Date: Wed, 21 Aug 2024 10:18:53 -0600 [thread overview]
Message-ID: <20240821161927.695717-2-sjg@chromium.org> (raw)
In-Reply-To: <20240821161927.695717-1-sjg@chromium.org>
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>
---
(no changes since v1)
arch/m68k/cpu/mcf5445x/cpu.c | 2 +-
arch/m68k/include/asm/global_data.h | 2 ++
arch/m68k/lib/bdinfo.c | 2 +-
arch/powerpc/cpu/mpc83xx/pci.c | 4 ++--
arch/powerpc/cpu/mpc83xx/speed.c | 2 +-
arch/powerpc/include/asm/global_data.h | 2 ++
drivers/clk/mpc83xx_clk.c | 2 +-
include/asm-generic/global_data.h | 5 -----
8 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/arch/m68k/cpu/mcf5445x/cpu.c b/arch/m68k/cpu/mcf5445x/cpu.c
index b811ac355e4..3fbd6a58c7d 100644
--- a/arch/m68k/cpu/mcf5445x/cpu.c
+++ b/arch/m68k/cpu/mcf5445x/cpu.c
@@ -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
diff --git a/arch/m68k/include/asm/global_data.h b/arch/m68k/include/asm/global_data.h
index 93efc722ba8..4ac886933c6 100644
--- a/arch/m68k/include/asm/global_data.h
+++ b/arch/m68k/include/asm/global_data.h
@@ -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>
diff --git a/arch/m68k/lib/bdinfo.c b/arch/m68k/lib/bdinfo.c
index cf6ae5adddf..891e94bbd3f 100644
--- a/arch/m68k/lib/bdinfo.c
+++ b/arch/m68k/lib/bdinfo.c
@@ -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 */
diff --git a/arch/powerpc/cpu/mpc83xx/pci.c b/arch/powerpc/cpu/mpc83xx/pci.c
index 6f378c4e221..aef1123a2b7 100644
--- a/arch/powerpc/cpu/mpc83xx/pci.c
+++ b/arch/powerpc/cpu/mpc83xx/pci.c
@@ -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);
}
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index 72464962613..0185ab50ad9 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -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;
diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h
index a9efbbdd3d4..cc2ce617350 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -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>
diff --git a/drivers/clk/mpc83xx_clk.c b/drivers/clk/mpc83xx_clk.c
index a29ad0d7a68..a43fff2e7ed 100644
--- a/drivers/clk/mpc83xx_clk.c
+++ b/drivers/clk/mpc83xx_clk.c
@@ -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];
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 19c66e1fe5d..79d2aa4c6f5 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -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
*/
--
2.34.1
next prev parent reply other threads:[~2024-08-21 16:19 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 16:18 [PATCH v2 00/35] global_data: Reduce size of struct global_data Simon Glass
2024-08-21 16:18 ` Simon Glass [this message]
2024-08-21 16:18 ` [PATCH v2 02/35] x86: Drop use of global_data fb_base Simon Glass
2024-08-21 16:18 ` [PATCH v2 03/35] video: Add a function to obtain the framebuffer address Simon Glass
2024-08-21 16:18 ` [PATCH v2 04/35] video: mxc: Avoid setting global_data fb_base Simon Glass
2024-08-21 16:18 ` [PATCH v2 05/35] video: mxs: " Simon Glass
2024-08-21 16:18 ` [PATCH v2 06/35] arm: friendlyarm: Avoid accessing " Simon Glass
2024-08-21 16:18 ` [PATCH v2 07/35] arm: ronetix: " Simon Glass
2024-08-21 16:19 ` [PATCH v2 08/35] zynqmp: Avoid setting the framebuffer address Simon Glass
2024-08-21 16:19 ` [PATCH v2 09/35] video: Avoid setting global_data fb_base from SPL handoff Simon Glass
2024-08-21 16:19 ` [PATCH v2 10/35] video: Avoid setting global_data fb_base in video setup Simon Glass
2024-08-21 16:19 ` [PATCH v2 11/35] global_data: Drop fb_base Simon Glass
2024-08-21 16:19 ` [PATCH v2 12/35] global_data: Convert have_console into a flag Simon Glass
2024-08-21 16:19 ` [PATCH v2 13/35] global_data: Remove pci_ram_top Simon Glass
2024-08-21 16:19 ` [PATCH v2 14/35] global_data: Drop global_data hose Simon Glass
2024-08-21 16:19 ` [PATCH v2 15/35] global_data: Drop pci_bootdelay Simon Glass
2024-08-21 16:19 ` [PATCH v2 16/35] global_data: Use less space for environment fields Simon Glass
2024-08-21 16:19 ` [PATCH v2 17/35] board_f: Add a new struct to hold pre-relocation info Simon Glass
2024-08-21 16:19 ` [PATCH v2 18/35] board_f: Move fdt_size to board Simon Glass
2024-08-21 16:19 ` [PATCH v2 19/35] board_f: Move new_bootstage to boardf Simon Glass
2024-08-21 16:19 ` [PATCH v2 20/35] board_f: Move new_bloblist " Simon Glass
2024-08-21 16:19 ` [PATCH v2 21/35] global_data: Drop spl_handoff Simon Glass
2024-08-21 16:19 ` [PATCH v2 22/35] global_data: Collect common fields at the top Simon Glass
2024-08-21 16:19 ` [PATCH v2 23/35] global_data: Reduce the size of bus_clk and mem_clk Simon Glass
2024-08-21 16:19 ` [PATCH v2 24/35] global_data: Reduce the size of mon_len Simon Glass
2024-08-21 16:19 ` [PATCH v2 25/35] global_data: log: Reorder and shrink fields Simon Glass
2024-08-21 16:19 ` [PATCH v2 26/35] global_data: Reduce size of early-malloc vars Simon Glass
2024-08-23 13:34 ` Tom Rini
2024-08-23 20:30 ` Simon Glass
2024-08-23 21:07 ` Tom Rini
2024-08-23 21:44 ` Simon Glass
2024-08-23 21:49 ` Tom Rini
2024-08-23 23:30 ` Simon Glass
2024-08-26 18:33 ` Tom Rini
2024-08-27 19:25 ` Simon Glass
2024-08-21 16:19 ` [PATCH v2 27/35] global_data: Move baud_rate field lower Simon Glass
2024-08-21 16:19 ` [PATCH v2 28/35] global_data: Move env_addr field higher Simon Glass
2024-08-21 16:19 ` [PATCH v2 29/35] global_data: Put phys_addr fields near the top Simon Glass
2024-08-21 16:19 ` [PATCH v2 30/35] global_data: Move ulong fields together Simon Glass
2024-08-21 16:19 ` [PATCH v2 31/35] global_data: Move pointer members together Simon Glass
2024-08-21 16:19 ` [PATCH v2 32/35] global_data: Remove jump table in SPL Simon Glass
2024-08-21 16:19 ` [PATCH v2 33/35] global_data: Remove environment members if not used Simon Glass
2024-08-21 16:19 ` [PATCH v2 34/35] doc: Move generic-board documentation into rst Simon Glass
2024-08-21 16:19 ` [PATCH v2 35/35] doc: Add some guidelines about global data Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240821161927.695717-2-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox