U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Angelo Dureghello <angelo@kernel-space.org>,
	Bin Meng <bmeng.cn@gmail.com>,
	Francis Laniel <francis.laniel@amarulasolutions.com>,
	Huan Wang <alison.wang@nxp.com>, Lukasz Majewski <lukma@denx.de>,
	Mario Six <mario.six@gdsys.cc>, Sean Anderson <seanga2@gmail.com>
Subject: [PATCH 01/35] global_data: Move pci_clk to m68k and powerpc
Date: Wed, 24 Jul 2024 09:08:48 -0600	[thread overview]
Message-ID: <20240724150922.2343249-2-sjg@chromium.org> (raw)
In-Reply-To: <20240724150922.2343249-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>
---

 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 aa336d63e3a..970053892e1 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -59,11 +59,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


  reply	other threads:[~2024-07-24 15:09 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 15:08 [PATCH 00/35] global_data: Reduce size of struct global_data Simon Glass
2024-07-24 15:08 ` Simon Glass [this message]
2024-07-29  7:57   ` Acked Angelo Dureghello
2024-07-24 15:08 ` [PATCH 02/35] x86: Drop use of global_data fb_base Simon Glass
2024-07-24 15:08 ` [PATCH 03/35] video: Add a function to obtain the framebuffer address Simon Glass
2024-07-24 15:08 ` [PATCH 04/35] video: mxc: Avoid setting global_data fb_base Simon Glass
2024-07-24 15:08 ` [PATCH 05/35] video: mxs: " Simon Glass
2024-07-24 15:08 ` [PATCH 06/35] arm: friendlyarm: Avoid accessing " Simon Glass
2024-07-29 17:57   ` Stefan Bosch
2024-07-24 15:08 ` [PATCH 07/35] arm: ronetix: " Simon Glass
2024-07-24 15:08 ` [PATCH 08/35] zynqmp: Avoid setting the framebuffer address Simon Glass
2024-07-24 15:08 ` [PATCH 09/35] video: Avoid setting global_data fb_base from SPL handoff Simon Glass
2024-07-24 15:08 ` [PATCH 10/35] video: Avoid setting global_data fb_base in video setup Simon Glass
2024-07-24 15:08 ` [PATCH 11/35] global_data: Drop fb_base Simon Glass
2024-07-24 15:08 ` [PATCH 12/35] global_data: Convert have_console into a flag Simon Glass
2024-08-16 13:08   ` Sverdlin, Alexander
2024-08-29 14:05     ` Simon Glass
2024-08-29 14:28       ` Tom Rini
2024-08-29 15:01         ` Simon Glass
2024-07-24 15:09 ` [PATCH 13/35] global_data: Remove pci_ram_top Simon Glass
2024-07-24 15:09 ` [PATCH 14/35] global_data: Drop global_data hose Simon Glass
2024-07-24 15:09 ` [PATCH 15/35] global_data: Drop pci_bootdelay Simon Glass
2024-07-24 15:09 ` [PATCH 16/35] global_data: Use less space for environment fields Simon Glass
2024-07-24 15:09 ` [PATCH 17/35] board_f: Add a new struct to hold pre-relocation info Simon Glass
2024-07-24 15:09 ` [PATCH 18/35] board_f: Move fdt_size to board Simon Glass
2024-07-24 15:09 ` [PATCH 19/35] board_f: Move new_bootstage to boardf Simon Glass
2024-07-24 15:09 ` [PATCH 20/35] board_f: Move new_bloblist " Simon Glass
2024-07-24 15:09 ` [PATCH 21/35] global_data: Drop spl_handoff Simon Glass
2024-07-24 15:09 ` [PATCH 22/35] global_data: Collect common fields at the top Simon Glass
2024-07-24 15:09 ` [PATCH 23/35] global_data: Reduce the size of bus_clk and mem_clk Simon Glass
2024-07-24 15:09 ` [PATCH 24/35] global_data: Reduce the size of mon_len Simon Glass
2024-07-24 15:09 ` [PATCH 25/35] global_data: log: Reorder and shrink fields Simon Glass
2024-07-24 15:09 ` [PATCH 26/35] global_data: Reduce size of early-malloc vars Simon Glass
2024-07-24 15:09 ` [PATCH 27/35] global_data: Move baud_rate field lower Simon Glass
2024-07-24 15:09 ` [PATCH 28/35] global_data: Move env_addr field higher Simon Glass
2024-07-24 15:09 ` [PATCH 29/35] global_data: Put phys_addr fields near the top Simon Glass
2024-07-24 15:09 ` [PATCH 30/35] global_data: Move ulong fields together Simon Glass
2024-07-24 15:09 ` [PATCH 31/35] global_data: Move pointer members together Simon Glass
2024-07-24 15:09 ` [PATCH 32/35] global_data: Remove jump table in SPL Simon Glass
2024-07-24 15:09 ` [PATCH 33/35] global_data: Remove environment members if not used Simon Glass
2024-07-24 15:09 ` [PATCH 34/35] doc: Move generic-board documentation into rst Simon Glass
2024-07-24 15:09 ` [PATCH 35/35] doc: Add some guidelines about global data Simon Glass
2024-07-24 23:07 ` [PATCH 00/35] global_data: Reduce size of struct global_data Tom Rini
2024-08-21  0:48 ` Tom Rini

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=20240724150922.2343249-2-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=alison.wang@nxp.com \
    --cc=angelo@kernel-space.org \
    --cc=bmeng.cn@gmail.com \
    --cc=francis.laniel@amarulasolutions.com \
    --cc=lukma@denx.de \
    --cc=mario.six@gdsys.cc \
    --cc=seanga2@gmail.com \
    --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