aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass2019-11-14 12:57:20 -0700
committerTom Rini2019-12-02 18:23:09 -0500
commit2189d5f1e8a2fd74ce52906999fd50c8f8330c81 (patch)
tree5d9f8f4af8b10404c6137b4c3dc88b07ce4bf8cc
parent8bef79bf3c30cd1fc5367cc1f78f72e6552629e9 (diff)
Move strtomhz() to vsprintf.h
At present this function sits in its own file but it does not really justify it. There are similar string functions in vsprintf.h, so move it there. Also add the missing function comment. Use the vsprintf.h include file explicitly where needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
-rw-r--r--arch/arc/lib/cpu.c1
-rw-r--r--arch/arm/cpu/arm926ejs/mx25/generic.c1
-rw-r--r--arch/arm/cpu/arm926ejs/mx27/generic.c1
-rw-r--r--arch/arm/cpu/armv7/ls102xa/cpu.c1
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/cpu.c1
-rw-r--r--arch/arm/mach-at91/arm926ejs/cpu.c1
-rw-r--r--arch/arm/mach-at91/armv7/cpu.c1
-rw-r--r--arch/m68k/cpu/mcf5227x/cpu.c1
-rw-r--r--arch/m68k/cpu/mcf523x/cpu.c1
-rw-r--r--arch/m68k/cpu/mcf52x2/cpu.c1
-rw-r--r--arch/m68k/cpu/mcf530x/cpu.c1
-rw-r--r--arch/m68k/cpu/mcf532x/cpu.c1
-rw-r--r--arch/m68k/cpu/mcf5445x/cpu.c1
-rw-r--r--arch/m68k/cpu/mcf547x_8x/cpu.c1
-rw-r--r--arch/powerpc/cpu/mpc83xx/cpu.c1
-rw-r--r--arch/powerpc/cpu/mpc83xx/spd_sdram.c1
-rw-r--r--arch/powerpc/cpu/mpc83xx/speed.c1
-rw-r--r--arch/powerpc/cpu/mpc85xx/cpu.c1
-rw-r--r--arch/powerpc/cpu/mpc86xx/cpu.c1
-rw-r--r--arch/powerpc/cpu/mpc8xx/cpu.c1
-rw-r--r--arch/xtensa/cpu/cpu.c1
-rw-r--r--board/Arcturus/ucp1020/ddr.c1
-rw-r--r--board/atmel/at91sam9261ek/at91sam9261ek.c1
-rw-r--r--board/atmel/at91sam9263ek/at91sam9263ek.c1
-rw-r--r--board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c1
-rw-r--r--board/atmel/at91sam9n12ek/at91sam9n12ek.c1
-rw-r--r--board/atmel/at91sam9rlek/at91sam9rlek.c1
-rw-r--r--board/atmel/common/video_display.c1
-rw-r--r--board/esd/meesc/meesc.c1
-rw-r--r--board/freescale/bsc9131rdb/ddr.c1
-rw-r--r--board/freescale/bsc9132qds/ddr.c1
-rw-r--r--board/freescale/corenet_ds/ddr.c1
-rw-r--r--board/freescale/ls1043ardb/ddr.c1
-rw-r--r--board/freescale/mpc8541cds/mpc8541cds.c1
-rw-r--r--board/freescale/mpc8548cds/mpc8548cds.c1
-rw-r--r--board/freescale/mpc8555cds/mpc8555cds.c1
-rw-r--r--board/freescale/p1010rdb/ddr.c1
-rw-r--r--board/freescale/p1_p2_rdb_pc/ddr.c1
-rw-r--r--board/freescale/p1_twr/ddr.c1
-rw-r--r--board/mini-box/picosam9g45/picosam9g45.c1
-rw-r--r--board/ronetix/pm9261/pm9261.c1
-rw-r--r--cmd/bdinfo.c1
-rw-r--r--drivers/clk/clk_stm32mp1.c1
-rw-r--r--drivers/clk/mpc83xx_clk.c1
-rw-r--r--drivers/cpu/mpc83xx_cpu.c1
-rw-r--r--include/common.h3
-rw-r--r--include/vsprintf.h10
-rw-r--r--lib/Makefile4
-rw-r--r--lib/strmhz.c21
-rw-r--r--lib/vsprintf.c19
50 files changed, 76 insertions, 26 deletions
diff --git a/arch/arc/lib/cpu.c b/arch/arc/lib/cpu.c
index 01cca95d5b1..83246550ec1 100644
--- a/arch/arc/lib/cpu.c
+++ b/arch/arc/lib/cpu.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <malloc.h>
+#include <vsprintf.h>
#include <asm/arcregs.h>
#include <asm/cache.h>
diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c b/arch/arm/cpu/arm926ejs/mx25/generic.c
index 5fcf06ae1a8..eeb61d0d102 100644
--- a/arch/arm/cpu/arm926ejs/mx25/generic.c
+++ b/arch/arm/cpu/arm926ejs/mx25/generic.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <div64.h>
#include <netdev.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/arch-imx/cpu.h>
#include <asm/arch/imx-regs.h>
diff --git a/arch/arm/cpu/arm926ejs/mx27/generic.c b/arch/arm/cpu/arm926ejs/mx27/generic.c
index 08b1b4de717..9bed0e91bea 100644
--- a/arch/arm/cpu/arm926ejs/mx27/generic.c
+++ b/arch/arm/cpu/arm926ejs/mx27/generic.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <div64.h>
#include <netdev.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/clock.h>
diff --git a/arch/arm/cpu/armv7/ls102xa/cpu.c b/arch/arm/cpu/armv7/ls102xa/cpu.c
index 9ccfe1042ce..ec9984db795 100644
--- a/arch/arm/cpu/armv7/ls102xa/cpu.c
+++ b/arch/arm/cpu/armv7/ls102xa/cpu.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/arch/clock.h>
#include <asm/io.h>
#include <asm/arch/immap_ls102xa.h>
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index 83a33193211..59d03b167c4 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <env.h>
#include <fsl_ddr_sdram.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <linux/errno.h>
#include <asm/system.h>
diff --git a/arch/arm/mach-at91/arm926ejs/cpu.c b/arch/arm/mach-at91/arm926ejs/cpu.c
index 6f5aa4274b5..e9b4e06595e 100644
--- a/arch/arm/mach-at91/arm926ejs/cpu.c
+++ b/arch/arm/mach-at91/arm926ejs/cpu.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/arch/hardware.h>
#include <asm/arch/at91_pit.h>
diff --git a/arch/arm/mach-at91/armv7/cpu.c b/arch/arm/mach-at91/armv7/cpu.c
index 5da067cda10..638645c7e40 100644
--- a/arch/arm/mach-at91/armv7/cpu.c
+++ b/arch/arm/mach-at91/armv7/cpu.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/arch/hardware.h>
#include <asm/arch/at91_pit.h>
diff --git a/arch/m68k/cpu/mcf5227x/cpu.c b/arch/m68k/cpu/mcf5227x/cpu.c
index 7ad023dac5a..34534d876bc 100644
--- a/arch/m68k/cpu/mcf5227x/cpu.c
+++ b/arch/m68k/cpu/mcf5227x/cpu.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
diff --git a/arch/m68k/cpu/mcf523x/cpu.c b/arch/m68k/cpu/mcf523x/cpu.c
index 79be04f7a0c..429781945bf 100644
--- a/arch/m68k/cpu/mcf523x/cpu.c
+++ b/arch/m68k/cpu/mcf523x/cpu.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <netdev.h>
diff --git a/arch/m68k/cpu/mcf52x2/cpu.c b/arch/m68k/cpu/mcf52x2/cpu.c
index 29a17c57fce..b48a753f9b7 100644
--- a/arch/m68k/cpu/mcf52x2/cpu.c
+++ b/arch/m68k/cpu/mcf52x2/cpu.c
@@ -14,6 +14,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <asm/immap.h>
diff --git a/arch/m68k/cpu/mcf530x/cpu.c b/arch/m68k/cpu/mcf530x/cpu.c
index c7ae65afce9..a76deebc68a 100644
--- a/arch/m68k/cpu/mcf530x/cpu.c
+++ b/arch/m68k/cpu/mcf530x/cpu.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/immap.h>
#include <asm/io.h>
diff --git a/arch/m68k/cpu/mcf532x/cpu.c b/arch/m68k/cpu/mcf532x/cpu.c
index a01b5e65a74..c8a1f205305 100644
--- a/arch/m68k/cpu/mcf532x/cpu.c
+++ b/arch/m68k/cpu/mcf532x/cpu.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <netdev.h>
diff --git a/arch/m68k/cpu/mcf5445x/cpu.c b/arch/m68k/cpu/mcf5445x/cpu.c
index 56e5585e09e..2f79380c8be 100644
--- a/arch/m68k/cpu/mcf5445x/cpu.c
+++ b/arch/m68k/cpu/mcf5445x/cpu.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <netdev.h>
diff --git a/arch/m68k/cpu/mcf547x_8x/cpu.c b/arch/m68k/cpu/mcf547x_8x/cpu.c
index 819b25f280b..dc5ed1aa79f 100644
--- a/arch/m68k/cpu/mcf547x_8x/cpu.c
+++ b/arch/m68k/cpu/mcf547x_8x/cpu.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <netdev.h>
diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index 3048ecf34ad..363c0ffd285 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <mpc83xx.h>
diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
index 8b5ecdb9ad1..08918a9d75e 100644
--- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c
+++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
@@ -13,6 +13,7 @@
#ifndef CONFIG_MPC83XX_SDRAM
#include <common.h>
+#include <vsprintf.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <i2c.h>
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index e118a10fa8b..93af7f495fd 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <mpc83xx.h>
#include <command.h>
+#include <vsprintf.h>
#include <asm/processor.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 5344b175a45..64024612cd5 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -11,6 +11,7 @@
#include <config.h>
#include <common.h>
#include <cpu_func.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <fsl_esdhc.h>
diff --git a/arch/powerpc/cpu/mpc86xx/cpu.c b/arch/powerpc/cpu/mpc86xx/cpu.c
index c023d0684f8..1c3c78217cb 100644
--- a/arch/powerpc/cpu/mpc86xx/cpu.c
+++ b/arch/powerpc/cpu/mpc86xx/cpu.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <asm/cache.h>
diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c
index 798eabdc21c..6ad86e9a1d7 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu.c
@@ -17,6 +17,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <watchdog.h>
#include <command.h>
#include <mpc8xx.h>
diff --git a/arch/xtensa/cpu/cpu.c b/arch/xtensa/cpu/cpu.c
index 64bb0b6ee0b..6f4b88f88e1 100644
--- a/arch/xtensa/cpu/cpu.c
+++ b/arch/xtensa/cpu/cpu.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <command.h>
+#include <vsprintf.h>
#include <linux/stringify.h>
#include <asm/global_data.h>
#include <asm/cache.h>
diff --git a/board/Arcturus/ucp1020/ddr.c b/board/Arcturus/ucp1020/ddr.c
index 4b84a1a4c01..a3285ebe5cd 100644
--- a/board/Arcturus/ucp1020/ddr.c
+++ b/board/Arcturus/ucp1020/ddr.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/mmu.h>
#include <asm/immap_85xx.h>
#include <asm/processor.h>
diff --git a/board/atmel/at91sam9261ek/at91sam9261ek.c b/board/atmel/at91sam9261ek/at91sam9261ek.c
index 6f15bc67767..28765315f74 100644
--- a/board/atmel/at91sam9261ek/at91sam9261ek.c
+++ b/board/atmel/at91sam9261ek/at91sam9261ek.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <debug_uart.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/arch/at91sam9261.h>
#include <asm/arch/at91sam9261_matrix.h>
diff --git a/board/atmel/at91sam9263ek/at91sam9263ek.c b/board/atmel/at91sam9263ek/at91sam9263ek.c
index 2d882174de0..31bb72c0cdc 100644
--- a/board/atmel/at91sam9263ek/at91sam9263ek.c
+++ b/board/atmel/at91sam9263ek/at91sam9263ek.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <debug_uart.h>
+#include <vsprintf.h>
#include <linux/sizes.h>
#include <asm/arch/at91sam9263.h>
#include <asm/arch/at91sam9_smc.h>
diff --git a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
index 3b277fc575e..85004310b1f 100644
--- a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
+++ b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <debug_uart.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/arch/clk.h>
#include <asm/arch/at91sam9g45_matrix.h>
diff --git a/board/atmel/at91sam9n12ek/at91sam9n12ek.c b/board/atmel/at91sam9n12ek/at91sam9n12ek.c
index b2bb7ec9928..51b24e1d592 100644
--- a/board/atmel/at91sam9n12ek/at91sam9n12ek.c
+++ b/board/atmel/at91sam9n12ek/at91sam9n12ek.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/arch/at91sam9x5_matrix.h>
#include <asm/arch/at91sam9_smc.h>
diff --git a/board/atmel/at91sam9rlek/at91sam9rlek.c b/board/atmel/at91sam9rlek/at91sam9rlek.c
index 03933073157..4e674d49b31 100644
--- a/board/atmel/at91sam9rlek/at91sam9rlek.c
+++ b/board/atmel/at91sam9rlek/at91sam9rlek.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <debug_uart.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/mach-types.h>
#include <asm/arch/at91sam9rl.h>
diff --git a/board/atmel/common/video_display.c b/board/atmel/common/video_display.c
index cc051d2e0cc..5cc52139a77 100644
--- a/board/atmel/common/video_display.c
+++ b/board/atmel/common/video_display.c
@@ -11,6 +11,7 @@
#include <version.h>
#include <video.h>
#include <video_console.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/arch/clk.h>
diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index b0d2f7b6f87..221048a91f1 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <env.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/gpio.h>
#include <asm/mach-types.h>
diff --git a/board/freescale/bsc9131rdb/ddr.c b/board/freescale/bsc9131rdb/ddr.c
index f9f8d802135..4b6d91df219 100644
--- a/board/freescale/bsc9131rdb/ddr.c
+++ b/board/freescale/bsc9131rdb/ddr.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/mmu.h>
#include <asm/immap_85xx.h>
#include <asm/processor.h>
diff --git a/board/freescale/bsc9132qds/ddr.c b/board/freescale/bsc9132qds/ddr.c
index 191ef01d23e..f4effe5a2d6 100644
--- a/board/freescale/bsc9132qds/ddr.c
+++ b/board/freescale/bsc9132qds/ddr.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/mmu.h>
#include <asm/immap_85xx.h>
#include <asm/processor.h>
diff --git a/board/freescale/corenet_ds/ddr.c b/board/freescale/corenet_ds/ddr.c
index 38f13ce4b2e..9c8731ce780 100644
--- a/board/freescale/corenet_ds/ddr.c
+++ b/board/freescale/corenet_ds/ddr.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <i2c.h>
#include <hwconfig.h>
+#include <vsprintf.h>
#include <asm/mmu.h>
#include <fsl_ddr_sdram.h>
#include <fsl_ddr_dimm_params.h>
diff --git a/board/freescale/ls1043ardb/ddr.c b/board/freescale/ls1043ardb/ddr.c
index 784e482f32f..2677b7928f5 100644
--- a/board/freescale/ls1043ardb/ddr.c
+++ b/board/freescale/ls1043ardb/ddr.c
@@ -7,6 +7,7 @@
#include <fsl_ddr_sdram.h>
#include <fsl_ddr_dimm_params.h>
#include "ddr.h"
+#include <vsprintf.h>
#ifdef CONFIG_FSL_DEEP_SLEEP
#include <fsl_sleep.h>
#endif
diff --git a/board/freescale/mpc8541cds/mpc8541cds.c b/board/freescale/mpc8541cds/mpc8541cds.c
index 779c99c2686..be79a7ca7b8 100644
--- a/board/freescale/mpc8541cds/mpc8541cds.c
+++ b/board/freescale/mpc8541cds/mpc8541cds.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <pci.h>
+#include <vsprintf.h>
#include <asm/processor.h>
#include <asm/mmu.h>
#include <asm/immap_85xx.h>
diff --git a/board/freescale/mpc8548cds/mpc8548cds.c b/board/freescale/mpc8548cds/mpc8548cds.c
index 2799b5b5a4b..28f8a998ce7 100644
--- a/board/freescale/mpc8548cds/mpc8548cds.c
+++ b/board/freescale/mpc8548cds/mpc8548cds.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <pci.h>
+#include <vsprintf.h>
#include <asm/processor.h>
#include <asm/mmu.h>
#include <asm/immap_85xx.h>
diff --git a/board/freescale/mpc8555cds/mpc8555cds.c b/board/freescale/mpc8555cds/mpc8555cds.c
index 6cfb8d5191a..bc1ebc51edb 100644
--- a/board/freescale/mpc8555cds/mpc8555cds.c
+++ b/board/freescale/mpc8555cds/mpc8555cds.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <pci.h>
+#include <vsprintf.h>
#include <asm/processor.h>
#include <asm/mmu.h>
#include <asm/immap_85xx.h>
diff --git a/board/freescale/p1010rdb/ddr.c b/board/freescale/p1010rdb/ddr.c
index 01e3eafd12a..71f6259b60e 100644
--- a/board/freescale/p1010rdb/ddr.c
+++ b/board/freescale/p1010rdb/ddr.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/mmu.h>
#include <asm/immap_85xx.h>
#include <asm/processor.h>
diff --git a/board/freescale/p1_p2_rdb_pc/ddr.c b/board/freescale/p1_p2_rdb_pc/ddr.c
index b9bd7b52765..2346f6a0c27 100644
--- a/board/freescale/p1_p2_rdb_pc/ddr.c
+++ b/board/freescale/p1_p2_rdb_pc/ddr.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/mmu.h>
#include <asm/immap_85xx.h>
#include <asm/processor.h>
diff --git a/board/freescale/p1_twr/ddr.c b/board/freescale/p1_twr/ddr.c
index 7e8bd6b8c21..85f1f6344ad 100644
--- a/board/freescale/p1_twr/ddr.c
+++ b/board/freescale/p1_twr/ddr.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/mmu.h>
#include <asm/immap_85xx.h>
#include <asm/processor.h>
diff --git a/board/mini-box/picosam9g45/picosam9g45.c b/board/mini-box/picosam9g45/picosam9g45.c
index 9554fefd4ec..9a724040b07 100644
--- a/board/mini-box/picosam9g45/picosam9g45.c
+++ b/board/mini-box/picosam9g45/picosam9g45.c
@@ -11,6 +11,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <asm/io.h>
#include <asm/arch/clk.h>
#include <asm/arch/at91sam9g45_matrix.h>
diff --git a/board/ronetix/pm9261/pm9261.c b/board/ronetix/pm9261/pm9261.c
index f1e7aab6296..bad673412a1 100644
--- a/board/ronetix/pm9261/pm9261.c
+++ b/board/ronetix/pm9261/pm9261.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <vsprintf.h>
#include <linux/sizes.h>
#include <asm/io.h>
#include <asm/gpio.h>
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index ae6006f85ff..abd9151432e 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
+#include <vsprintf.h>
#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/drivers/clk/clk_stm32mp1.c b/drivers/clk/clk_stm32mp1.c
index e87307fa60c..e223f84eac0 100644
--- a/drivers/clk/clk_stm32mp1.c
+++ b/drivers/clk/clk_stm32mp1.c
@@ -10,6 +10,7 @@
#include <regmap.h>
#include <spl.h>
#include <syscon.h>
+#include <vsprintf.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
diff --git a/drivers/clk/mpc83xx_clk.c b/drivers/clk/mpc83xx_clk.c
index 32d2db9edad..cbccda55943 100644
--- a/drivers/clk/mpc83xx_clk.c
+++ b/drivers/clk/mpc83xx_clk.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <vsprintf.h>
#include <dm/lists.h>
#include <dt-bindings/clk/mpc83xx-clk.h>
#include <asm/arch/soc.h>
diff --git a/drivers/cpu/mpc83xx_cpu.c b/drivers/cpu/mpc83xx_cpu.c
index 7bc86bf9b20..1e584577421 100644
--- a/drivers/cpu/mpc83xx_cpu.c
+++ b/drivers/cpu/mpc83xx_cpu.c
@@ -9,6 +9,7 @@
#include <clk.h>
#include <cpu.h>
#include <dm.h>
+#include <vsprintf.h>
#include "mpc83xx_cpu.h"
diff --git a/include/common.h b/include/common.h
index d17a2b2642c..f993e4bef33 100644
--- a/include/common.h
+++ b/include/common.h
@@ -310,9 +310,6 @@ int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn);
/* lib/vsprintf.c */
#include <vsprintf.h>
-/* lib/strmhz.c */
-char * strmhz(char *buf, unsigned long hz);
-
/*
* STDIO based functions (can always be used)
*/
diff --git a/include/vsprintf.h b/include/vsprintf.h
index d1740a378e0..56844dd2de8 100644
--- a/include/vsprintf.h
+++ b/include/vsprintf.h
@@ -212,4 +212,14 @@ void print_grouped_ull(unsigned long long int_val, int digits);
bool str2off(const char *p, loff_t *num);
bool str2long(const char *p, ulong *num);
+
+/**
+ * strmhz() - Convert a value to a Hz string
+ *
+ * This creates a string indicating the number of MHz of a value. For example,
+ * 2700000 produces "2.7".
+ * @buf: Buffer to hold output string, which must be large enough
+ * @hz: Value to convert
+ */
+char *strmhz(char *buf, unsigned long hz);
#endif
diff --git a/lib/Makefile b/lib/Makefile
index d248d8626ce..e15a189f65b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -109,12 +109,12 @@ ifeq ($(CONFIG_$(SPL_TPL_)BUILD),y)
ifdef CONFIG_$(SPL_TPL_)USE_TINY_PRINTF
obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += tiny-printf.o
else
-obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += vsprintf.o strmhz.o
+obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += vsprintf.o
endif
obj-$(CONFIG_$(SPL_TPL_)STRTO) += strto.o
else
# Main U-Boot always uses the full printf support
-obj-y += vsprintf.o strto.o strmhz.o
+obj-y += vsprintf.o strto.o
endif
subdir-ccflags-$(CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED) += -O2
diff --git a/lib/strmhz.c b/lib/strmhz.c
deleted file mode 100644
index 66afe91ab99..00000000000
--- a/lib/strmhz.c
+++ /dev/null
@@ -1,21 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2002-2006
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- */
-#include <common.h>
-
-char *strmhz (char *buf, unsigned long hz)
-{
- long l, n;
- long m;
-
- n = DIV_ROUND_CLOSEST(hz, 1000) / 1000L;
- l = sprintf (buf, "%ld", n);
-
- hz -= n * 1000000L;
- m = DIV_ROUND_CLOSEST(hz, 1000L);
- if (m != 0)
- sprintf (buf + l, ".%03ld", m);
- return (buf);
-}
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 425f2f53f79..c6467ecd5ff 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -2,6 +2,8 @@
* linux/lib/vsprintf.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*/
/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */
@@ -17,6 +19,7 @@
#include <div64.h>
#include <hexdump.h>
#include <stdarg.h>
+#include <vsprintf.h>
#include <linux/ctype.h>
#include <linux/err.h>
#include <linux/types.h>
@@ -873,3 +876,19 @@ bool str2long(const char *p, ulong *num)
*num = simple_strtoul(p, &endptr, 16);
return *p != '\0' && *endptr == '\0';
}
+
+char *strmhz(char *buf, unsigned long hz)
+{
+ long l, n;
+ long m;
+
+ n = DIV_ROUND_CLOSEST(hz, 1000) / 1000L;
+ l = sprintf(buf, "%ld", n);
+
+ hz -= n * 1000000L;
+ m = DIV_ROUND_CLOSEST(hz, 1000L);
+ if (m != 0)
+ sprintf(buf + l, ".%03ld", m);
+
+ return buf;
+}