[PATCH 23/35] global_data: Reduce the size of bus_clk and mem_clk
Simon Glass
sjg at chromium.org
Wed Jul 24 17:09:10 CEST 2024
The bus clock and memory clock are unlikely to go above 4GHz for now, so
reduce the field size to 32 bits.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
arch/mips/mach-ath79/ar934x/clk.c | 4 ++--
arch/mips/mach-octeon/cpu.c | 2 +-
include/asm-generic/global_data.h | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/mips/mach-ath79/ar934x/clk.c b/arch/mips/mach-ath79/ar934x/clk.c
index bdaa6839a2b..231a21ca90f 100644
--- a/arch/mips/mach-ath79/ar934x/clk.c
+++ b/arch/mips/mach-ath79/ar934x/clk.c
@@ -327,8 +327,8 @@ int do_ar934x_showclk(struct cmd_tbl *cmdtp, int flag, int argc,
{
ar934x_update_clock();
printf("CPU: %8ld MHz\n", gd->cpu_clk / 1000000);
- printf("Memory: %8ld MHz\n", gd->mem_clk / 1000000);
- printf("AHB: %8ld MHz\n", gd->bus_clk / 1000000);
+ printf("Memory: %8d MHz\n", gd->mem_clk / 1000000);
+ printf("AHB: %8d MHz\n", gd->bus_clk / 1000000);
return 0;
}
diff --git a/arch/mips/mach-octeon/cpu.c b/arch/mips/mach-octeon/cpu.c
index c7744e84706..c771da61a68 100644
--- a/arch/mips/mach-octeon/cpu.c
+++ b/arch/mips/mach-octeon/cpu.c
@@ -67,7 +67,7 @@ static int get_clocks(void)
gd->cpu_clk = ref_clock * FIELD_GET(RST_BOOT_C_MUL, val);
gd->bus_clk = ref_clock * FIELD_GET(RST_BOOT_PNR_MUL, val);
- debug("%s: cpu: %lu, bus: %lu\n", __func__, gd->cpu_clk, gd->bus_clk);
+ debug("%s: cpu: %lu, bus: %u\n", __func__, gd->cpu_clk, gd->bus_clk);
return 0;
}
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 48241d10034..7910e73e2e3 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -65,11 +65,11 @@ struct global_data {
/**
* @bus_clk: platform clock rate in Hz
*/
- unsigned long bus_clk;
+ unsigned int bus_clk;
/**
* @mem_clk: memory clock rate in Hz
*/
- unsigned long mem_clk;
+ unsigned int mem_clk;
/**
* @env_addr: address of environment structure
*
--
2.34.1
More information about the U-Boot
mailing list