Skip to contentSkip to conversation

common: Further reduce common.h

PATCH Superseded Simon Glass 4 participants 60 messages Nov 14, 2019 – Dec 3, 2019 Page 1 of 2

Subsystems (69)
lore
Share & tools
lore
#0 lore raw

v4 cover common: Further reduce common.h

This series drops the size of common.h down further, by moving things out into existing and new header files.

It is now down to about 200 lines.

Changes in v4:
- Rename cpu_legacy.h to cpu_func.h
- Use cpu_func.h instead of cpu_legacy.h
- Use irq_func.h instead of irq_legacy.h

Changes in v3:
- Add init.h header
- Add new patch to inline pxa_wait_ticks()
- Drop include in pxa2xx.c since this is for pxa_wait_ticks()
- Put copyright info into vsprintf.c
- Rename eeprom_legacy.h to eeprom.h since this may not be legacy code
- Rename irq_legacy to irq_func to avoid the 'legacy' label
- Update comment to wait_ticks() to indicate it is an internal function
- Update commit message
- Update the commit message

Changes in v2:
- Move trap_init() into init.h instead; update commit message

Simon Glass (42):
common: Move older CPU functions to their own header Drop CONFIG_SHOW_ACTIVITY
common: Drop global inclusion of status_led.h
status_led: Tidy up the code style
common: Move random-number functions into their own header
common: Drop linux/crc8.h
crc: Fix code style with crc functions
crc32: Use the crc.h header for crc functions
spl: bootcount: Move code out of header file
common: Move bootcount functions to their header file
common: Move sorting functions to their own header file Move strtomhz() to vsprintf.h
common: Move env_get_ip() to net.h
serial: usb: Correct the usbtty_...() prototypes
common: Move serial_printf() to the serial header
common: Move serial functions out of common.h
common: Add a new lz4.h header file
common: Move some time functions out of common.h
common: Move wait_ticks functions out of common.h
arm: pxa: Drop pxa_wait_ticks()
common: Move timer_get_us() function out of common.h
common: Move get_ticks() function out of common.h
common: Move mii_init() function out of common.h
common: Move some CPU functions out of common.h
common: Drop cpu_init()
common: Move checkcpu() out of common.h
common: Move some SMP functions out of common.h
arm: powerpc: Tidy up code style for cache functions
common: Move some cache and MMU functions out of common.h
common: Drop checkicache() and checkdcache()
common: Move ARM cache operations out of common.h
arm: powerpc: Tidy up code style for interrupt functions
common: Move interrupt functions into a new header
common: Move enable/disable_interrupts out of common.h
common: Move command functions out of common.h
common: Drop board_show_dram()
common: Move board_get_usable_ram_top() out of common.h
common: Move some board functions out of common.h
common: Move pci_init_board() out of common.h
common: Move trap_init() out of common.h
common: Drop get_endaddr()
common: Move old EEPROM functions into a new header

 README                                        |   2 +-
 api/api.c                                     |   1 +
 arch/arc/lib/bootm.c                          |   1 +
 arch/arc/lib/cache.c                          |   1 +
 arch/arc/lib/cpu.c                            |   1 +
 arch/arc/lib/interrupts.c                     |   1 +
 arch/arm/cpu/arm11/cpu.c                      |   4 +-
 arch/arm/cpu/arm920t/cpu.c                    |   4 +-
 arch/arm/cpu/arm920t/ep93xx/timer.c           |   1 +
 arch/arm/cpu/arm920t/imx/timer.c              |   1 +
 arch/arm/cpu/arm926ejs/armada100/cpu.c        |   1 +
 arch/arm/cpu/arm926ejs/armada100/timer.c      |   1 +
 arch/arm/cpu/arm926ejs/cache.c                |   1 +
 arch/arm/cpu/arm926ejs/cpu.c                  |   4 +-
 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c          |   1 +
 arch/arm/cpu/arm926ejs/lpc32xx/timer.c        |   1 +
 arch/arm/cpu/arm926ejs/mx25/generic.c         |   1 +
 arch/arm/cpu/arm926ejs/mx27/generic.c         |   1 +
 arch/arm/cpu/arm926ejs/mx27/timer.c           |   1 +
 arch/arm/cpu/arm926ejs/mxs/spl_boot.c         |   1 +
 arch/arm/cpu/arm926ejs/mxs/timer.c            |   1 +
 arch/arm/cpu/arm926ejs/spear/spr_misc.c       |   1 +
 arch/arm/cpu/arm926ejs/spear/timer.c          |   1 +
 arch/arm/cpu/arm946es/cpu.c                   |   4 +-
 arch/arm/cpu/armv7/arch_timer.c               |   1 +
 arch/arm/cpu/armv7/cache_v7.c                 |   1 +
 arch/arm/cpu/armv7/cpu.c                      |   2 +
 arch/arm/cpu/armv7/exception_level.c          |   1 +
 .../cpu/armv7/iproc-common/hwinit-common.c    |   1 +
 arch/arm/cpu/armv7/iproc-common/timer.c       |   1 +
 .../arm/cpu/armv7/kona-common/hwinit-common.c |   1 +
 arch/arm/cpu/armv7/ls102xa/cpu.c              |   2 +
 arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c     |   1 +
 arch/arm/cpu/armv7/ls102xa/timer.c            |   1 +
 arch/arm/cpu/armv7/mpu_v7r.c                  |   1 +
 arch/arm/cpu/armv7/s5p-common/timer.c         |   1 +
 arch/arm/cpu/armv7/stv0991/timer.c            |   1 +
 arch/arm/cpu/armv7/sunxi/timer.c              |   1 +
 arch/arm/cpu/armv7/vf610/generic.c            |   1 +
 arch/arm/cpu/armv7/vf610/timer.c              |   1 +
 arch/arm/cpu/armv7/virt-v7.c                  |   1 +
 arch/arm/cpu/armv7m/cache.c                   |   1 +
 arch/arm/cpu/armv7m/cpu.c                     |   2 +
 arch/arm/cpu/armv7m/systick-timer.c           |   1 +
 arch/arm/cpu/armv8/cache_v8.c                 |   1 +
 arch/arm/cpu/armv8/cpu.c                      |   2 +
 arch/arm/cpu/armv8/exception_level.c          |   1 +
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c       |   3 +
 .../armv8/fsl-layerscape/fsl_lsch2_speed.c    |   1 +
 .../armv8/fsl-layerscape/fsl_lsch3_speed.c    |   1 +
 arch/arm/cpu/armv8/fsl-layerscape/mp.c        |   1 +
 arch/arm/cpu/armv8/fsl-layerscape/soc.c       |   1 +
 arch/arm/cpu/armv8/fsl-layerscape/spl.c       |   1 +
 arch/arm/cpu/armv8/generic_timer.c            |   1 +
 arch/arm/cpu/armv8/s32v234/cpu.c              |   1 +
 arch/arm/cpu/armv8/sec_firmware.c             |   1 +
 arch/arm/cpu/pxa/cache.c                      |   1 +
 arch/arm/cpu/pxa/pxa2xx.c                     |  14 +-
 arch/arm/cpu/sa1100/cpu.c                     |   4 +-
 arch/arm/cpu/sa1100/timer.c                   |   1 +
 arch/arm/lib/bootm.c                          |   1 +
 arch/arm/lib/cache-cp15.c                     |  13 +-
 arch/arm/lib/cache.c                          |   1 +
 arch/arm/lib/interrupts.c                     |   7 +-
 arch/arm/lib/interrupts_64.c                  |   1 +
 arch/arm/lib/interrupts_m.c                   |   1 +
 arch/arm/lib/reset.c                          |   1 +
 arch/arm/mach-at91/arm920t/timer.c            |   1 +
 arch/arm/mach-at91/arm926ejs/cpu.c            |   1 +
 arch/arm/mach-at91/armv7/cpu.c                |   2 +
 arch/arm/mach-bcm283x/init.c                  |   1 +
 arch/arm/mach-bcm283x/mbox.c                  |   1 +
 arch/arm/mach-davinci/timer.c                 |   1 +
 arch/arm/mach-exynos/soc.c                    |   1 +
 arch/arm/mach-imx/cache.c                     |   1 +
 arch/arm/mach-imx/imx8/cpu.c                  |   1 +
 arch/arm/mach-imx/imx8m/soc.c                 |   1 +
 arch/arm/mach-imx/mx5/soc.c                   |   1 +
 arch/arm/mach-imx/mx6/mp.c                    |   1 +
 arch/arm/mach-imx/mx6/opos6ul.c               |   1 +
 arch/arm/mach-imx/mx6/soc.c                   |   1 +
 arch/arm/mach-imx/mx7/psci-mx7.c              |   1 +
 arch/arm/mach-imx/mx7ulp/soc.c                |   1 +
 arch/arm/mach-imx/syscounter.c                |   1 +
 arch/arm/mach-imx/timer.c                     |   1 +
 arch/arm/mach-keystone/init.c                 |   1 +
 arch/arm/mach-kirkwood/cpu.c                  |   1 +
 arch/arm/mach-mediatek/cpu.c                  |   1 +
 arch/arm/mach-meson/board-common.c            |   2 +
 arch/arm/mach-mvebu/arm64-common.c            |   1 +
 arch/arm/mach-mvebu/armada8k/cpu.c            |   1 +
 arch/arm/mach-mvebu/cpu.c                     |   1 +
 arch/arm/mach-omap2/omap-cache.c              |   1 +
 arch/arm/mach-omap2/sec-common.c              |   1 +
 arch/arm/mach-omap2/timer.c                   |   1 +
 arch/arm/mach-orion5x/cpu.c                   |   1 +
 arch/arm/mach-orion5x/timer.c                 |   1 +
 arch/arm/mach-rmobile/cpu_info.c              |   1 +
 arch/arm/mach-rmobile/memmap-gen3.c           |   1 +
 arch/arm/mach-rmobile/timer.c                 |   1 +
 arch/arm/mach-rockchip/board.c                |   2 +
 arch/arm/mach-rockchip/misc.c                 |   1 +
 arch/arm/mach-rockchip/rk3288/rk3288.c        |   1 +
 arch/arm/mach-rockchip/sdram_common.c         |   1 +
 arch/arm/mach-s5pc1xx/cache.c                 |   1 +
 arch/arm/mach-socfpga/clock_manager_gen5.c    |   1 +
 arch/arm/mach-socfpga/misc.c                  |   1 +
 arch/arm/mach-socfpga/spl_a10.c               |   1 +
 arch/arm/mach-stm32mp/cpu.c                   |   1 +
 arch/arm/mach-sunxi/board.c                   |   1 +
 arch/arm/mach-sunxi/dram_helpers.c            |   1 +
 arch/arm/mach-sunxi/p2wi.c                    |   1 +
 arch/arm/mach-sunxi/rsb.c                     |   1 +
 arch/arm/mach-tegra/board.c                   |   1 +
 arch/arm/mach-tegra/board2.c                  |   1 +
 arch/arm/mach-tegra/clock.c                   |   1 +
 arch/arm/mach-tegra/cmd_enterrcm.c            |   1 +
 arch/arm/mach-tegra/ivc.c                     |   1 +
 arch/arm/mach-uniphier/arm32/cache-uniphier.c |   1 +
 arch/arm/mach-uniphier/arm32/psci.c           |   1 +
 arch/arm/mach-uniphier/board_late_init.c      |   1 +
 arch/arm/mach-zynq/cpu.c                      |   1 +
 arch/arm/mach-zynqmp/mp.c                     |   1 +
 arch/arm/mach-zynqmp/spl.c                    |   1 +
 arch/m68k/cpu/mcf5227x/cpu.c                  |   1 +
 arch/m68k/cpu/mcf5227x/cpu_init.c             |   1 +
 arch/m68k/cpu/mcf5227x/interrupts.c           |   1 +
 arch/m68k/cpu/mcf523x/cpu.c                   |   1 +
 arch/m68k/cpu/mcf523x/cpu_init.c              |   1 +
 arch/m68k/cpu/mcf523x/interrupts.c            |   1 +
 arch/m68k/cpu/mcf52x2/cpu.c                   |   1 +
 arch/m68k/cpu/mcf52x2/cpu_init.c              |   1 +
 arch/m68k/cpu/mcf52x2/interrupts.c            |   1 +
 arch/m68k/cpu/mcf530x/cpu.c                   |   1 +
 arch/m68k/cpu/mcf530x/cpu_init.c              |   1 +
 arch/m68k/cpu/mcf530x/interrupts.c            |   1 +
 arch/m68k/cpu/mcf532x/cpu.c                   |   1 +
 arch/m68k/cpu/mcf532x/cpu_init.c              |   1 +
 arch/m68k/cpu/mcf532x/interrupts.c            |   1 +
 arch/m68k/cpu/mcf5445x/cpu.c                  |   1 +
 arch/m68k/cpu/mcf5445x/cpu_init.c             |   1 +
 arch/m68k/cpu/mcf5445x/interrupts.c           |   1 +
 arch/m68k/cpu/mcf547x_8x/cpu.c                |   1 +
 arch/m68k/cpu/mcf547x_8x/cpu_init.c           |   1 +
 arch/m68k/cpu/mcf547x_8x/interrupts.c         |   1 +
 arch/m68k/cpu/mcf547x_8x/slicetimer.c         |   1 +
 arch/m68k/lib/cache.c                         |   1 +
 arch/m68k/lib/interrupts.c                    |   9 +-
 arch/m68k/lib/time.c                          |   2 +
 arch/m68k/lib/traps.c                         |   1 +
 arch/microblaze/cpu/cache.c                   |  19 +-
 arch/microblaze/cpu/interrupts.c              |   1 +
 arch/microblaze/cpu/timer.c                   |   1 +
 arch/microblaze/include/asm/microblaze_intc.h |   2 +
 arch/microblaze/lib/bootm.c                   |   1 +
 arch/mips/cpu/interrupts.c                    |   1 +
 arch/mips/lib/cache.c                         |   1 +
 arch/mips/lib/reloc.c                         |   1 +
 arch/mips/lib/traps.c                         |   2 +
 arch/mips/mach-jz47xx/jz4780/jz4780.c         |   2 +
 arch/mips/mach-jz47xx/jz4780/timer.c          |   2 +
 arch/mips/mach-mtmips/ddr_calibrate.c         |   1 +
 arch/nds32/cpu/n1213/ae3xx/cpu.c              |   2 +
 arch/nds32/cpu/n1213/ag101/cpu.c              |   2 +
 arch/nds32/cpu/n1213/ag101/timer.c            |   2 +
 arch/nds32/lib/cache.c                        |   1 +
 arch/nds32/lib/interrupts.c                   |   1 +
 arch/nios2/cpu/cpu.c                          |   2 +
 arch/nios2/cpu/interrupts.c                   |  15 +-
 arch/nios2/lib/bootm.c                        |   2 +
 arch/nios2/lib/cache.c                        |   1 +
 arch/powerpc/cpu/mpc83xx/cpu.c                |   5 +-
 arch/powerpc/cpu/mpc83xx/ecc.c                |   1 +
 arch/powerpc/cpu/mpc83xx/interrupts.c         |   7 +-
 arch/powerpc/cpu/mpc83xx/spd_sdram.c          |   2 +
 arch/powerpc/cpu/mpc83xx/speed.c              |   1 +
 arch/powerpc/cpu/mpc85xx/cpu.c                |   3 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c           |   1 +
 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |   1 +
 arch/powerpc/cpu/mpc85xx/interrupts.c         |   1 +
 arch/powerpc/cpu/mpc85xx/mp.c                 |   1 +
 arch/powerpc/cpu/mpc85xx/speed.c              |   1 +
 arch/powerpc/cpu/mpc85xx/traps.c              |   1 +
 arch/powerpc/cpu/mpc86xx/cpu.c                |   2 +
 arch/powerpc/cpu/mpc86xx/interrupts.c         |   3 +-
 arch/powerpc/cpu/mpc86xx/mp.c                 |   1 +
 arch/powerpc/cpu/mpc8xx/cache.c               |   1 +
 arch/powerpc/cpu/mpc8xx/cpu.c                 | 132 +++++------
 arch/powerpc/cpu/mpc8xx/interrupts.c          |   1 +
 arch/powerpc/cpu/mpc8xxx/cpu.c                |   1 +
 arch/powerpc/cpu/mpc8xxx/fdt.c                |   1 +
 arch/powerpc/cpu/mpc8xxx/srio.c               |   1 +
 arch/powerpc/lib/bootm.c                      |   1 +
 arch/powerpc/lib/cache.c                      |   1 +
 arch/powerpc/lib/interrupts.c                 |  24 +-
 arch/powerpc/lib/time.c                       |   1 +
 arch/riscv/cpu/ax25/cache.c                   |   1 +
 arch/riscv/cpu/ax25/cpu.c                     |   2 +
 arch/riscv/cpu/generic/cpu.c                  |   1 +
 arch/riscv/cpu/generic/dram.c                 |   1 +
 arch/riscv/lib/cache.c                        |   1 +
 arch/riscv/lib/interrupts.c                   |   1 +
 arch/riscv/lib/smp.c                          |   1 +
 arch/riscv/lib/spl.c                          |   1 +
 arch/sandbox/cpu/cpu.c                        |   1 +
 arch/sandbox/cpu/start.c                      |   1 +
 arch/sandbox/lib/interrupts.c                 |   1 +
 arch/sh/cpu/sh4/cache.c                       |   1 +
 arch/sh/cpu/sh4/cpu.c                         |   2 +
 arch/sh/cpu/sh4/interrupts.c                  |   7 +-
 arch/sh/lib/time_sh2.c                        |   1 +
 arch/sh/lib/zimageboot.c                      |   1 +
 arch/x86/cpu/broadwell/cpu_from_spl.c         |   1 +
 arch/x86/cpu/broadwell/sdram.c                |   1 +
 arch/x86/cpu/coreboot/coreboot.c              |   1 +
 arch/x86/cpu/coreboot/sdram.c                 |   1 +
 arch/x86/cpu/cpu.c                            |   1 +
 arch/x86/cpu/efi/app.c                        |   1 +
 arch/x86/cpu/efi/payload.c                    |   2 +
 arch/x86/cpu/efi/sdram.c                      |   1 +
 arch/x86/cpu/i386/cpu.c                       |   1 +
 arch/x86/cpu/i386/interrupt.c                 |   1 +
 arch/x86/cpu/intel_common/mrc.c               |   1 +
 arch/x86/cpu/ivybridge/cpu.c                  |   1 +
 arch/x86/cpu/ivybridge/sdram.c                |   1 +
 arch/x86/cpu/mtrr.c                           |   1 +
 arch/x86/cpu/qemu/dram.c                      |   1 +
 arch/x86/cpu/qemu/qemu.c                      |   1 +
 arch/x86/cpu/quark/dram.c                     |   2 +
 arch/x86/cpu/quark/quark.c                    |   1 +
 arch/x86/cpu/slimbootloader/sdram.c           |   1 +
 arch/x86/cpu/slimbootloader/slimbootloader.c  |   1 +
 arch/x86/cpu/tangier/tangier.c                |   1 +
 arch/x86/cpu/x86_64/cpu.c                     |   1 +
 arch/x86/cpu/x86_64/interrupts.c              |   1 +
 arch/x86/lib/bios.c                           |   1 +
 arch/x86/lib/fsp/fsp_common.c                 |   1 +
 arch/x86/lib/fsp/fsp_dram.c                   |   1 +
 arch/x86/lib/init_helpers.c                   |   1 +
 arch/x86/lib/interrupts.c                     |   1 +
 arch/x86/lib/spl.c                            |   2 +
 arch/x86/lib/zimage.c                         |   1 +
 arch/xtensa/cpu/cpu.c                         |   1 +
 arch/xtensa/cpu/exceptions.c                  |   1 +
 arch/xtensa/lib/bootm.c                       |   1 +
 arch/xtensa/lib/cache.c                       |   1 +
 arch/xtensa/lib/time.c                        |   1 +
 board/Arcturus/ucp1020/cmd_arc.c              |   1 +
 board/Arcturus/ucp1020/ddr.c                  |   1 +
 board/Arcturus/ucp1020/ucp1020.c              |   1 +
 board/BuR/brppt1/board.c                      |   2 +
 board/BuR/brsmarc1/board.c                    |   1 +
 board/BuR/brxre1/board.c                      |   1 +
 board/CZ.NIC/turris_mox/turris_mox.c          |   1 +
 board/CZ.NIC/turris_omnia/turris_omnia.c      |   2 +
 board/Marvell/mvebu_armada-8k/board.c         |   1 +
 board/advantech/dms-ba16/dms-ba16.c           |   1 +
 board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c   |   1 +
 board/amarula/vyasa-rk3288/vyasa-rk3288.c     |   1 +
 board/aristainetos/aristainetos-v2.c          |   1 +
 board/armadeus/apf27/apf27.c                  |   1 +
 board/armadeus/opos6uldev/board.c             |   3 +-
 board/armltd/integrator/integrator.c          |   3 +-
 board/armltd/integrator/pci.c                 |   1 +
 board/armltd/integrator/timer.c               |   1 +
 board/armltd/vexpress/vexpress_common.c       |   1 +
 board/astro/mcf5373l/mcf5373l.c               |   1 +
 .../armadillo-800eva/armadillo-800eva.c       |   1 +
 board/atmel/at91sam9261ek/at91sam9261ek.c     |   1 +
 board/atmel/at91sam9261ek/led.c               |   1 +
 board/atmel/at91sam9263ek/at91sam9263ek.c     |   1 +
 board/atmel/at91sam9263ek/led.c               |   1 +
 .../atmel/at91sam9m10g45ek/at91sam9m10g45ek.c |   1 +
 board/atmel/at91sam9m10g45ek/led.c            |   1 +
 board/atmel/at91sam9n12ek/at91sam9n12ek.c     |   1 +
 board/atmel/at91sam9rlek/at91sam9rlek.c       |   1 +
 board/atmel/at91sam9rlek/led.c                |   1 +
 board/atmel/at91sam9x5ek/at91sam9x5ek.c       |   1 +
 board/atmel/common/mac_eeprom.c               |   1 +
 board/atmel/common/video_display.c            |   1 +
 .../atmel/sama5d27_som1_ek/sama5d27_som1_ek.c |   1 +
 board/atmel/sama5d2_icp/sama5d2_icp.c         |   1 +
 board/atmel/sama5d2_ptc_ek/sama5d2_ptc_ek.c   |   1 +
 .../atmel/sama5d2_xplained/sama5d2_xplained.c |   1 +
 .../atmel/sama5d3_xplained/sama5d3_xplained.c |   1 +
 board/atmel/sama5d3xek/sama5d3xek.c           |   1 +
 .../atmel/sama5d4_xplained/sama5d4_xplained.c |   1 +
 board/atmel/sama5d4ek/sama5d4ek.c             |   1 +
 board/beckhoff/mx53cx9020/mx53cx9020.c        |   2 +
 board/birdland/bav335x/board.c                |   2 +
 board/bluewater/gurnard/gurnard.c             |   1 +
 board/bosch/shc/board.c                       |   2 +
 board/broadcom/bcm_ep/board.c                 |   1 +
 board/broadcom/bcmstb/bcmstb.c                |   3 +
 board/bticino/mamoj/spl.c                     |   1 +
 board/cadence/xtfpga/xtfpga.c                 |   1 +
 board/cavium/thunderx/thunderx.c              |   1 +
 board/ccv/xpress/xpress.c                     |   1 +
 .../popmetal_rk3288/popmetal-rk3288.c         |   1 +
 board/cirrus/edb93xx/edb93xx.c                |   3 +
 board/cobra5272/flash.c                       |  22 +-
 board/compulab/cl-som-imx7/cl-som-imx7.c      |   1 +
 board/compulab/cm_fx6/cm_fx6.c                |   1 +
 board/compulab/cm_t335/cm_t335.c              |   1 +
 board/compulab/common/eeprom.c                |   1 +
 board/congatec/cgtqmx6eval/cgtqmx6eval.c      |   1 +
 .../conga-qeval20-qa3.c                       |   1 +
 board/coreboot/coreboot/coreboot.c            |   1 +
 board/corscience/tricorder/tricorder-eeprom.c |   2 +
 board/corscience/tricorder/tricorder.c        |   1 +
 board/cssi/MCR3000/MCR3000.c                  |   2 +
 board/dfi/dfi-bt700/dfi-bt700.c               |   1 +
 board/dhelectronics/dh_imx6/dh_imx6.c         |   2 +
 board/eets/pdu001/board.c                     |   1 +
 board/efi/efi-x86_payload/payload.c           |   1 +
 board/el/el6x/el6x.c                          |   1 +
 board/embest/mx6boards/mx6boards.c            |   1 +
 board/emulation/qemu-riscv/qemu-riscv.c       |   1 +
 board/engicam/common/board.c                  |   2 +
 board/engicam/common/spl.c                    |   1 +
 board/esd/meesc/meesc.c                       |   2 +
 board/esd/vme8349/pci.c                       |   1 +
 board/freescale/b4860qds/b4860qds.c           |   2 +
 board/freescale/b4860qds/pci.c                |   1 +
 board/freescale/bsc9131rdb/ddr.c              |   1 +
 board/freescale/bsc9132qds/bsc9132qds.c       |   1 +
 board/freescale/bsc9132qds/ddr.c              |   1 +
 board/freescale/c29xpcie/c29xpcie.c           |   1 +
 board/freescale/common/p_corenet/pci.c        |   1 +
 board/freescale/common/sys_eeprom.c           |   1 +
 board/freescale/common/vid.c                  |   1 +
 board/freescale/corenet_ds/corenet_ds.c       |   1 +
 board/freescale/corenet_ds/ddr.c              |   1 +
 board/freescale/imx8mq_evk/imx8mq_evk.c       |   1 +
 board/freescale/imx8qm_mek/imx8qm_mek.c       |   1 +
 board/freescale/imx8qxp_mek/imx8qxp_mek.c     |   1 +
 board/freescale/ls1021aiot/ls1021aiot.c       |   1 +
 board/freescale/ls1021aqds/ls1021aqds.c       |   1 +
 board/freescale/ls1021atsn/ls1021atsn.c       |   1 +
 board/freescale/ls1021atwr/ls1021atwr.c       |   1 +
 board/freescale/ls1043ardb/ddr.c              |   1 +
 board/freescale/m5253demo/flash.c             |   1 +
 board/freescale/m54455evb/m54455evb.c         |   1 +
 board/freescale/m547xevb/m547xevb.c           |   1 +
 board/freescale/m548xevb/m548xevb.c           |   1 +
 board/freescale/mpc8308rdb/mpc8308rdb.c       |   1 +
 board/freescale/mpc8313erdb/mpc8313erdb.c     |   1 +
 board/freescale/mpc8315erdb/mpc8315erdb.c     |   1 +
 board/freescale/mpc8323erdb/mpc8323erdb.c     |   3 +
 board/freescale/mpc832xemds/mpc832xemds.c     |   1 +
 board/freescale/mpc832xemds/pci.c             |   1 +
 board/freescale/mpc8349emds/pci.c             |   1 +
 board/freescale/mpc8349itx/pci.c              |   1 +
 board/freescale/mpc837xemds/mpc837xemds.c     |   1 +
 board/freescale/mpc837xemds/pci.c             |   1 +
 board/freescale/mpc837xerdb/pci.c             |   1 +
 board/freescale/mpc8536ds/mpc8536ds.c         |   1 +
 board/freescale/mpc8541cds/mpc8541cds.c       |   2 +
 board/freescale/mpc8544ds/mpc8544ds.c         |   1 +
 board/freescale/mpc8548cds/mpc8548cds.c       |   2 +
 board/freescale/mpc8555cds/mpc8555cds.c       |   2 +
 board/freescale/mpc8568mds/mpc8568mds.c       |   1 +
 board/freescale/mpc8569mds/mpc8569mds.c       |   1 +
 board/freescale/mpc8572ds/mpc8572ds.c         |   1 +
 board/freescale/mpc8610hpcd/mpc8610hpcd.c     |   1 +
 board/freescale/mpc8641hpcn/mpc8641hpcn.c     |   1 +
 board/freescale/mx25pdk/mx25pdk.c             |   1 +
 board/freescale/mx31pdk/mx31pdk.c             |   1 +
 board/freescale/mx35pdk/mx35pdk.c             |   1 +
 board/freescale/mx51evk/mx51evk.c             |   1 +
 board/freescale/mx53evk/mx53evk.c             |   1 +
 board/freescale/mx53loco/mx53loco.c           |   1 +
 board/freescale/mx6sabreauto/mx6sabreauto.c   |   1 +
 board/freescale/mx6sabresd/mx6sabresd.c       |   1 +
 board/freescale/mx6sllevk/mx6sllevk.c         |   1 +
 .../freescale/mx6sxsabreauto/mx6sxsabreauto.c |   1 +
 board/freescale/mx6sxsabresd/mx6sxsabresd.c   |   1 +
 .../mx6ul_14x14_evk/mx6ul_14x14_evk.c         |   1 +
 board/freescale/mx6ullevk/mx6ullevk.c         |   1 +
 board/freescale/mx7dsabresd/mx7dsabresd.c     |   1 +
 board/freescale/p1010rdb/ddr.c                |   1 +
 board/freescale/p1010rdb/p1010rdb.c           |   1 +
 board/freescale/p1022ds/p1022ds.c             |   1 +
 board/freescale/p1023rdb/p1023rdb.c           |   1 +
 board/freescale/p1_p2_rdb_pc/ddr.c            |   1 +
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c   |   1 +
 board/freescale/p1_twr/ddr.c                  |   1 +
 board/freescale/p1_twr/p1_twr.c               |   1 +
 board/freescale/p2041rdb/p2041rdb.c           |   1 +
 board/freescale/qemu-ppce500/qemu-ppce500.c   |   2 +
 board/freescale/t102xqds/pci.c                |   1 +
 board/freescale/t102xqds/t102xqds.c           |   1 +
 board/freescale/t102xrdb/pci.c                |   1 +
 board/freescale/t102xrdb/t102xrdb.c           |   1 +
 board/freescale/t1040qds/pci.c                |   1 +
 board/freescale/t1040qds/t1040qds.c           |   1 +
 board/freescale/t104xrdb/pci.c                |   1 +
 board/freescale/t104xrdb/t104xrdb.c           |   1 +
 board/freescale/t208xqds/pci.c                |   1 +
 board/freescale/t208xqds/t208xqds.c           |   1 +
 board/freescale/t208xrdb/pci.c                |   1 +
 board/freescale/t208xrdb/t208xrdb.c           |   1 +
 board/freescale/t4qds/pci.c                   |   1 +
 board/freescale/t4qds/t4240emu.c              |   1 +
 board/freescale/t4qds/t4240qds.c              |   2 +
 board/freescale/t4rdb/pci.c                   |   1 +
 board/freescale/t4rdb/t4240rdb.c              |   1 +
 board/gardena/smart-gateway-at91sam/board.c   |   1 +
 board/gardena/smart-gateway-mt7688/board.c    |   2 +
 board/gdsys/a38x/controlcenterdc.c            |   1 +
 board/gdsys/a38x/hre.c                        |   1 +
 board/gdsys/a38x/keyprogram.c                 |   1 +
 board/gdsys/mpc8308/gazerbeam.c               |   1 +
 board/gdsys/mpc8308/hrcon.c                   |   1 +
 board/gdsys/mpc8308/mpc8308.c                 |   1 +
 board/gdsys/mpc8308/strider.c                 |   1 +
 board/gdsys/p1022/controlcenterd-id.c         |   2 +
 board/gdsys/p1022/controlcenterd.c            |   1 +
 board/ge/bx50v3/bx50v3.c                      |   1 +
 board/ge/mx53ppd/mx53ppd.c                    |   1 +
 board/grinn/chiliboard/board.c                |   1 +
 board/grinn/liteboard/board.c                 |   2 +
 board/gumstix/pepper/board.c                  |   1 +
 board/highbank/highbank.c                     |   1 +
 board/imgtec/boston/ddr.c                     |   1 +
 board/imgtec/malta/malta.c                    |   1 +
 board/intel/edison/edison.c                   |   1 +
 board/intel/slimbootloader/slimbootloader.c   |   1 +
 board/inversepath/usbarmory/usbarmory.c       |   1 +
 board/isee/igep003x/board.c                   |   2 +
 board/isee/igep00x0/spl.c                     |   1 +
 board/k+p/kp_imx53/kp_imx53.c                 |   1 +
 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c         |   1 +
 board/keymile/km83xx/km83xx.c                 |   1 +
 board/keymile/km_arm/km_arm.c                 |   1 +
 board/keymile/kmp204x/kmp204x.c               |   1 +
 board/keymile/kmp204x/pci.c                   |   1 +
 board/kosagi/novena/novena.c                  |   2 +
 board/kosagi/novena/novena_spl.c              |   1 +
 board/laird/wb50n/wb50n.c                     |   1 +
 board/liebherr/display5/spl.c                 |   1 +
 board/liebherr/mccmon6/mccmon6.c              |   2 +
 board/liebherr/mccmon6/spl.c                  |   1 +
 board/logicpd/am3517evm/am3517evm.c           |   1 +
 board/logicpd/imx6/imx6logic.c                |   2 +
 board/logicpd/omap3som/omap3logic.c           |   2 +
 board/menlo/m53menlo/m53menlo.c               |   1 +
 board/mini-box/picosam9g45/led.c              |   1 +
 board/mini-box/picosam9g45/picosam9g45.c      |   1 +
 board/mpc8308_p1m/mpc8308_p1m.c               |   1 +
 board/mscc/jr2/jr2.c                          |   1 +
 board/mscc/luton/luton.c                      |   1 +
 board/mscc/ocelot/ocelot.c                    |   1 +
 board/mscc/serval/serval.c                    |   1 +
 board/mscc/servalt/servalt.c                  |   1 +
 board/overo/common.c                          |   1 +
 board/phytec/pcm052/pcm052.c                  |   1 +
 board/phytec/pcm058/pcm058.c                  |   1 +
 board/phytec/pfla02/pfla02.c                  |   2 +
 board/phytec/phycore_rk3288/phycore-rk3288.c  |   2 +
 .../dragonboard410c/dragonboard410c.c         |   1 +
 board/raspberrypi/rpi/rpi.c                   |   1 +
 board/renesas/r2dplus/r2dplus.c               |   1 +
 board/renesas/r7780mp/r7780mp.c               |   1 +
 board/renesas/sh7752evb/sh7752evb.c           |   1 +
 board/renesas/sh7753evb/sh7753evb.c           |   1 +
 board/renesas/sh7757lcr/sh7757lcr.c           |   1 +
 board/rockchip/kylin_rk3036/kylin_rk3036.c    |   1 +
 board/rockchip/tinker_rk3288/tinker-rk3288.c  |   2 +
 board/ronetix/pm9261/led.c                    |   1 +
 board/ronetix/pm9261/pm9261.c                 |   1 +
 board/ronetix/pm9263/led.c                    |   1 +
 board/samsung/arndale/arndale.c               |   1 +
 board/samsung/common/board.c                  |   1 +
 board/samsung/common/misc.c                   |   1 +
 board/sandbox/sandbox.c                       |   2 +
 board/sbc8349/pci.c                           |   1 +
 board/sbc8548/sbc8548.c                       |   1 +
 board/sbc8641d/sbc8641d.c                     |   1 +
 board/siemens/common/board.c                  |   1 +
 board/siemens/draco/board.c                   |   1 +
 board/siemens/pxm2/board.c                    |   1 +
 board/siemens/rut/board.c                     |   1 +
 board/silica/pengwyn/board.c                  |   1 +
 board/softing/vining_2000/vining_2000.c       |   1 +
 board/softing/vining_fpga/socfpga.c           |   3 +
 board/solidrun/mx6cuboxi/mx6cuboxi.c          |   1 +
 board/spear/x600/x600.c                       |   1 +
 board/st/stih410-b2260/board.c                |   1 +
 board/st/stm32f429-discovery/led.c            |   1 +
 board/st/stm32f746-disco/stm32f746-disco.c    |   2 +
 board/st/stm32h743-disco/stm32h743-disco.c    |   1 +
 board/st/stm32h743-eval/stm32h743-eval.c      |   1 +
 board/st/stm32mp1/stm32mp1.c                  |   1 +
 board/sunxi/board.c                           |   1 +
 board/synopsys/axs10x/axs10x.c                |   1 +
 board/synopsys/hsdk/hsdk.c                    |   3 +
 board/syteco/zmx25/zmx25.c                    |   2 +
 board/tcl/sl50/board.c                        |   2 +
 board/technexion/pico-imx7d/pico-imx7d.c      |   1 +
 board/theadorable/theadorable.c               |   3 +-
 .../puma_rk3399/puma-rk3399.c                 |   1 +
 board/ti/am335x/board.c                       |   1 +
 board/ti/am43xx/board.c                       |   2 +
 board/ti/am57xx/board.c                       |   2 +
 board/ti/am65x/evm.c                          |   1 +
 board/ti/beagle/beagle.c                      |   1 +
 board/ti/common/board_detect.c                |   1 +
 board/ti/dra7xx/evm.c                         |   2 +
 board/ti/evm/evm.c                            |   1 +
 board/ti/j721e/evm.c                          |   1 +
 board/ti/ks2_evm/board_k2g.c                  |   2 +
 board/toradex/apalis-imx8/apalis-imx8.c       |   1 +
 board/toradex/apalis_imx6/apalis_imx6.c       |   1 +
 .../toradex/colibri-imx6ull/colibri-imx6ull.c |   1 +
 board/toradex/colibri-imx8x/colibri-imx8x.c   |   1 +
 board/toradex/colibri_imx6/colibri_imx6.c     |   1 +
 board/toradex/colibri_pxa270/colibri_pxa270.c |   1 +
 board/toradex/colibri_vf/colibri_vf.c         |   1 +
 board/tqc/tqm834x/pci.c                       |   1 +
 board/tqc/tqma6/tqma6.c                       |   1 +
 board/tqc/tqma6/tqma6_mba6.c                  |   1 +
 board/tqc/tqma6/tqma6_wru4.c                  |   1 +
 board/udoo/neo/neo.c                          |   1 +
 board/udoo/udoo.c                             |   1 +
 board/varisys/common/sys_eeprom.c             |   1 +
 board/varisys/cyrus/cyrus.c                   |   1 +
 board/varisys/cyrus/pci.c                     |   1 +
 board/ve8313/ve8313.c                         |   1 +
 board/vscom/baltos/board.c                    |   2 +
 board/wandboard/wandboard.c                   |   1 +
 board/warp/warp.c                             |   1 +
 board/warp7/warp7.c                           |   1 +
 board/work-microwave/work_92105/work_92105.c  |   1 +
 board/xes/common/fsl_8xxx_pci.c               |   1 +
 board/xes/xpedite517x/xpedite517x.c           |   1 +
 board/xes/xpedite520x/xpedite520x.c           |   1 +
 board/xes/xpedite537x/xpedite537x.c           |   1 +
 board/xes/xpedite550x/xpedite550x.c           |   1 +
 .../microblaze-generic/microblaze-generic.c   |   1 +
 board/xilinx/versal/board.c                   |   2 +
 board/xilinx/zynq/board.c                     |   1 +
 board/xilinx/zynqmp/cmds.c                    |   1 +
 board/xilinx/zynqmp/zynqmp.c                  |   2 +
 cmd/bdinfo.c                                  |   1 +
 cmd/booti.c                                   |   1 +
 cmd/bootz.c                                   |   1 +
 cmd/cache.c                                   |   1 +
 cmd/disk.c                                    |   1 +
 cmd/eeprom.c                                  |   1 +
 cmd/efi.c                                     |   1 +
 cmd/elf.c                                     |   1 +
 cmd/fdc.c                                     |   1 +
 cmd/i2c.c                                     |   3 +-
 cmd/irq.c                                     |   1 +
 cmd/load.c                                    |   2 +
 cmd/mem.c                                     |   9 +-
 cmd/mp.c                                      |   1 +
 cmd/nvedit.c                                  |   1 +
 cmd/ti/ddr3.c                                 |   1 +
 cmd/ximg.c                                    |   1 +
 common/android_ab.c                           |   1 +
 common/autoboot.c                             |   2 +
 common/avb_verify.c                           |   1 +
 common/bloblist.c                             |   1 +
 common/board_f.c                              |   3 +
 common/board_r.c                              |   5 +
 common/bootm.c                                |   2 +
 common/bootm_os.c                             |   1 +
 common/bootretry.c                            |   1 +
 common/bootstage.c                            |   1 +
 common/bouncebuf.c                            |   1 +
 common/cli.c                                  |   1 +
 common/cli_readline.c                         |   7 +-
 common/cli_simple.c                           |   1 +
 common/hash.c                                 |   1 +
 common/image-fit.c                            |   1 +
 common/image.c                                |   3 +
 common/iotrace.c                              |   2 +
 common/kgdb_stubs.c                           |   2 +
 common/lcd.c                                  |   1 +
 common/lcd_console.c                          |   1 +
 common/main.c                                 |   1 +
 common/spl/spl.c                              |  14 ++
 common/spl/spl_atf.c                          |   1 +
 common/spl/spl_opensbi.c                      |   1 +
 common/splash_source.c                        |   1 +
 common/update.c                               |   1 +
 disk/part_efi.c                               |   1 +
 drivers/ata/ahci.c                            |   1 +
 drivers/ata/dwc_ahsata.c                      |   1 +
 drivers/ata/fsl_ahci.c                        |   1 +
 drivers/ata/fsl_sata.c                        |   1 +
 drivers/ata/sata_mv.c                         |   1 +
 drivers/ata/sata_sil.c                        |   1 +
 drivers/bootcount/bootcount.c                 |   1 +
 drivers/bootcount/bootcount_ram.c             |   1 +
 drivers/clk/clk_stm32mp1.c                    |   2 +
 drivers/clk/mpc83xx_clk.c                     |   1 +
 drivers/core/device.c                         |   1 +
 drivers/cpu/mpc83xx_cpu.c                     |   1 +
 drivers/crypto/fsl/fsl_blob.c                 |   1 +
 drivers/crypto/fsl/fsl_hash.c                 |   1 +
 drivers/crypto/fsl/jobdesc.c                  |   1 +
 drivers/crypto/fsl/jr.c                       |   2 +
 drivers/ddr/altera/sdram_arria10.c            |   1 +
 drivers/ddr/altera/sdram_s10.c                |   1 +
 drivers/dma/apbh_dma.c                        |   1 +
 drivers/dma/bcm6348-iudma.c                   |   1 +
 drivers/dma/dma-uclass.c                      |   1 +
 drivers/dma/ti/k3-udma.c                      |   1 +
 drivers/fastboot/fb_command.c                 |   1 +
 drivers/fastboot/fb_common.c                  |   1 +
 drivers/firmware/psci.c                       |   1 +
 drivers/fpga/versalpl.c                       |   1 +
 drivers/fpga/zynqmppl.c                       |   1 +
 drivers/fpga/zynqpl.c                         |   1 +
 drivers/i2c/fsl_i2c.c                         |   1 +
 drivers/mailbox/mailbox-uclass.c              |   1 +
 drivers/misc/atsha204a-i2c.c                  |   1 +
 drivers/misc/i2c_eeprom.c                     |   1 +
 drivers/misc/pca9551_led.c                    |   1 +
 drivers/misc/status_led.c                     |   8 +-
 drivers/misc/tegra186_bpmp.c                  |   1 +
 drivers/mmc/bcm2835_sdhci.c                   |   1 +
 drivers/mmc/dw_mmc.c                          |   1 +
 drivers/mmc/fsl_esdhc.c                       |   1 +
 drivers/mmc/fsl_esdhc_imx.c                   |   1 +
 drivers/mmc/fsl_esdhc_spl.c                   |   1 +
 drivers/mmc/meson_gx_mmc.c                    |   1 +
 drivers/mmc/mxcmmc.c                          |   1 +
 drivers/mmc/omap_hsmmc.c                      |   1 +
 drivers/mmc/sdhci.c                           |   1 +
 drivers/mmc/stm32_sdmmc2.c                    |   1 +
 drivers/mmc/tmio-common.c                     |   1 +
 drivers/mtd/cfi_flash.c                       |   1 +
 drivers/mtd/mw_eeprom.c                       |   1 +
 drivers/mtd/nand/raw/denali.c                 |   1 +
 drivers/mtd/nand/raw/fsl_elbc_nand.c          |   1 +
 drivers/mtd/nand/raw/fsl_elbc_spl.c           |   1 +
 drivers/mtd/nand/raw/fsl_ifc_nand.c           |   1 +
 drivers/mtd/nand/raw/fsl_ifc_spl.c            |   1 +
 drivers/mtd/nand/raw/mxs_nand.c               |   1 +
 drivers/mtd/pic32_flash.c                     |   2 +
 drivers/mtd/spi/fsl_espi_spl.c                |   1 +
 drivers/mtd/ubi/attach.c                      |   1 +
 drivers/mtd/ubi/crc32.c                       |   1 +
 drivers/mtd/ubi/eba.c                         |   1 +
 drivers/mtd/ubi/fastmap.c                     |   1 +
 drivers/mtd/ubi/io.c                          |   1 +
 drivers/mtd/ubi/vtbl.c                        |   1 +
 drivers/mtd/ubispl/ubispl.c                   |   1 +
 drivers/net/ag7xxx.c                          |   1 +
 drivers/net/altera_tse.c                      |   1 +
 drivers/net/bcm-sf2-eth-gmac.c                |   1 +
 drivers/net/designware.c                      |   1 +
 drivers/net/dwc_eth_qos.c                     |   1 +
 drivers/net/e1000.c                           |   1 +
 drivers/net/ethoc.c                           |   1 +
 drivers/net/fec_mxc.c                         |   1 +
 drivers/net/fm/fdt.c                          |   1 +
 drivers/net/fm/fm.c                           |   1 +
 drivers/net/fsl-mc/mc.c                       |   2 +
 drivers/net/fsl_mcdmafec.c                    |   1 +
 drivers/net/ftgmac100.c                       |   1 +
 drivers/net/ftmac100.c                        |   1 +
 drivers/net/higmacv300.c                      |   1 +
 drivers/net/ldpaa_eth/ldpaa_eth.c             |   1 +
 drivers/net/ldpaa_eth/ls1088a.c               |   1 +
 drivers/net/ldpaa_eth/lx2160a.c               |   1 +
 drivers/net/macb.c                            |   1 +
 drivers/net/mcffec.c                          |   1 +
 drivers/net/mcfmii.c                          |   1 +
 drivers/net/mpc8xx_fec.c                      |   1 +
 drivers/net/mt7628-eth.c                      |   1 +
 drivers/net/mtk_eth.c                         |   1 +
 drivers/net/mvneta.c                          |   1 +
 drivers/net/mvpp2.c                           |   1 +
 drivers/net/pch_gbe.c                         |   1 +
 drivers/net/pcnet.c                           |   1 +
 drivers/net/pic32_eth.c                       |   3 +
 drivers/net/ravb.c                            |   1 +
 drivers/net/rtl8139.c                         |   1 +
 drivers/net/rtl8169.c                         |   1 +
 drivers/net/sh_eth.c                          |   1 +
 drivers/net/sni_ave.c                         |   1 +
 drivers/net/sun8i_emac.c                      |   1 +
 drivers/net/ti/cpsw.c                         |   1 +
 drivers/net/ti/davinci_emac.c                 |   1 +
 drivers/net/xilinx_axi_emac.c                 |   1 +
 drivers/net/zynq_gem.c                        |   1 +
 drivers/nvme/nvme.c                           |   2 +
 drivers/pci/pci.c                             |   1 +
 drivers/pci/pcie_imx.c                        |   1 +
 drivers/power/pmic/stpmic1.c                  |   1 +
 drivers/qe/qe.c                               |   1 +
 drivers/remoteproc/rproc-elf-loader.c         |   1 +
 drivers/rtc/rv3029.c                          |   1 +
 drivers/serial/usbtty.c                       |   1 +
 drivers/sound/broadwell_i2s.c                 |   1 +
 drivers/spi/ath79_spi.c                       |   1 +
 drivers/spi/exynos_spi.c                      |   1 +
 drivers/spi/mxs_spi.c                         |   1 +
 drivers/spi/rk_spi.c                          |   1 +
 drivers/spi/tegra114_spi.c                    |   1 +
 drivers/spi/tegra20_sflash.c                  |   1 +
 drivers/spi/tegra20_slink.c                   |   1 +
 drivers/spi/tegra210_qspi.c                   |   1 +
 drivers/spi/ti_qspi.c                         |   1 +
 drivers/spi/uniphier_spi.c                    |   1 +
 drivers/spi/zynq_spi.c                        |   1 +
 drivers/spi/zynqmp_gqspi.c                    |   1 +
 drivers/timer/mpc83xx_timer.c                 |   7 +-
 drivers/timer/tsc_timer.c                     |   1 +
 drivers/tpm/tpm2_tis_sandbox.c                |   2 +-
 drivers/tpm/tpm_tis_sandbox.c                 |   2 +-
 drivers/usb/dwc3/core.c                       |   1 +
 drivers/usb/dwc3/dwc3-generic.c               |   1 +
 drivers/usb/dwc3/ep0.c                        |   1 +
 drivers/usb/dwc3/gadget.c                     |   1 +
 drivers/usb/dwc3/io.h                         |   1 +
 drivers/usb/gadget/ci_udc.c                   |   1 +
 drivers/usb/gadget/core.c                     |   1 +
 drivers/usb/gadget/designware_udc.c           |   1 +
 drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c    |   3 +
 drivers/usb/gadget/ep0.c                      |   3 +-
 drivers/usb/gadget/f_thor.c                   |   1 +
 drivers/usb/gadget/fotg210.c                  |   1 +
 drivers/usb/host/dwc2.c                       |   1 +
 drivers/usb/host/ehci-hcd.c                   |   1 +
 drivers/usb/host/ohci-hcd.c                   |   1 +
 drivers/usb/host/xhci-mem.c                   |   1 +
 drivers/usb/host/xhci-ring.c                  |   1 +
 drivers/usb/host/xhci.c                       |   1 +
 drivers/usb/musb-new/omap2430.c               |   1 +
 drivers/usb/musb/musb_udc.c                   |   1 +
 drivers/usb/musb/omap3.c                      |   1 +
 drivers/video/atmel_hlcdfb.c                  |   1 +
 drivers/video/cfb_console.c                   |   1 +
 drivers/video/fsl_dcu_fb.c                    |   1 +
 drivers/video/sunxi/sunxi_display.c           |   3 +
 drivers/video/sunxi/sunxi_dw_hdmi.c           |   1 +
 drivers/video/video-uclass.c                  |   1 +
 env/common.c                                  |   2 +
 env/eeprom.c                                  |   2 +
 env/flash.c                                   |   1 +
 env/nand.c                                    |   1 +
 env/nvram.c                                   |   1 +
 env/remote.c                                  |   1 +
 env/sf.c                                      |   1 +
 examples/api/glue.c                           |   1 +
 fs/jffs2/jffs2_1pass.c                        |   1 +
 fs/ubifs/io.c                                 |   1 +
 fs/ubifs/recovery.c                           |   1 +
 fs/ubifs/tnc.c                                |   1 +
 fs/yaffs2/yaffs_qsort.c                       |   1 +
 include/bootcount.h                           |  14 +-
 include/command.h                             |  16 ++
 include/common.h                              | 212 +-----------------
 include/cpu_func.h                            |  87 +++++++
 include/eeprom.h                              |  24 ++
 include/exports.h                             |   4 +
 include/init.h                                |  33 ++-
 include/irq_func.h                            |  26 +++
 include/linux/crc8.h                          |  23 --
 include/linux/mii.h                           |   2 +
 include/lz4.h                                 |  24 ++
 include/net.h                                 |  22 +-
 include/rand.h                                |  40 ++++
 include/serial.h                              |  37 ++-
 include/sort.h                                |  34 +++
 include/status_led.h                          |   4 +-
 include/time.h                                |  43 ++++
 include/u-boot/crc.h                          |  89 +++++++-
 include/vsprintf.h                            |  10 +
 lib/Makefile                                  |   4 +-
 lib/crc32.c                                   |   5 +-
 lib/crc8.c                                    |   7 +-
 lib/efi_loader/efi_boottime.c                 |   3 +
 lib/efi_loader/efi_console.c                  |   1 +
 lib/efi_loader/efi_image_loader.c             |   1 +
 lib/efi_loader/efi_memory.c                   |   1 +
 lib/efi_loader/efi_runtime.c                  |   2 +
 lib/efi_loader/efi_variable.c                 |   1 +
 lib/efi_selftest/efi_selftest_config_table.c  |   1 +
 lib/efi_selftest/efi_selftest_crc32.c         |   1 +
 lib/gunzip.c                                  |   1 +
 lib/hashtable.c                               |   1 +
 lib/lz4_wrapper.c                             |   1 +
 lib/qsort.c                                   |   1 +
 lib/rand.c                                    |   1 +
 lib/strmhz.c                                  |  21 --
 lib/time.c                                    |   1 +
 lib/trace.c                                   |   1 +
 lib/uuid.c                                    |   1 +
 lib/vsprintf.c                                |  19 ++
 lib/zlib/deflate.c                            |   1 +
 net/link_local.c                              |   1 +
 net/net.c                                     |   3 -
 net/nfs.c                                     |   1 +
 post/cpu/mpc83xx/ecc.c                        |   2 +
 post/lib_powerpc/andi.c                       |   1 +
 post/lib_powerpc/b.c                          |   1 +
 post/lib_powerpc/cmp.c                        |   1 +
 post/lib_powerpc/cmpi.c                       |   1 +
 post/lib_powerpc/complex.c                    |   1 +
 post/lib_powerpc/cpu.c                        |   7 +-
 post/lib_powerpc/cr.c                         |   1 +
 post/lib_powerpc/load.c                       |   1 +
 post/lib_powerpc/multi.c                      |   1 +
 post/lib_powerpc/rlwimi.c                     |   1 +
 post/lib_powerpc/rlwinm.c                     |   1 +
 post/lib_powerpc/rlwnm.c                      |   1 +
 post/lib_powerpc/srawi.c                      |   1 +
 post/lib_powerpc/store.c                      |   1 +
 post/lib_powerpc/string.c                     |   1 +
 post/lib_powerpc/three.c                      |   1 +
 post/lib_powerpc/threei.c                     |   1 +
 post/lib_powerpc/threex.c                     |   1 +
 post/lib_powerpc/two.c                        |   1 +
 post/lib_powerpc/twox.c                       |   1 +
 post/post.c                                   |   1 +
 scripts/config_whitelist.txt                  |   1 -
 test/command_ut.c                             |   1 +
 test/compression.c                            |   1 +
 test/dm/sf.c                                  |   1 +
 test/time_ut.c                                |   1 +
 tools/default_image.c                         |   1 +
 tools/env/fw_env.c                            |   1 +
 tools/env/fw_env.h                            |   2 -
 tools/envcrc.c                                |   5 +-
 tools/mkenvimage.c                            |   1 +
 tools/mxsimage.c                              |   1 +
 tools/pbl_crc32.c                             |   1 +
 tools/pblimage.c                              |   1 +
 tools/socfpgaimage.c                          |   1 +
 836 files changed, 1598 insertions(+), 465 deletions(-)
 create mode 100644 include/cpu_func.h
 create mode 100644 include/eeprom.h
 create mode 100644 include/irq_func.h
 delete mode 100644 include/linux/crc8.h
 create mode 100644 include/lz4.h
 create mode 100644 include/rand.h
 create mode 100644 include/sort.h
 delete mode 100644 lib/strmhz.c
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#1 lore raw

PATCH v4 1/42 common: Move older CPU functions to their own header

These should be moved to driver model, but in the meantime, move them out of the common header to help reduce its size.

---

Changes in v4:
- Rename cpu_legacy.h to cpu_func.h

Changes in v3: None
Changes in v2: None

 README                                 |  2 +-
 arch/arm/cpu/armv8/fsl-layerscape/mp.c |  1 +
 arch/arm/mach-imx/mx6/mp.c             |  1 +
 arch/arm/mach-zynqmp/mp.c              |  1 +
 arch/powerpc/cpu/mpc85xx/cpu.c         |  1 +
 arch/powerpc/cpu/mpc85xx/mp.c          |  1 +
 arch/powerpc/cpu/mpc86xx/mp.c          |  1 +
 cmd/mp.c                               |  1 +
 include/common.h                       |  8 --------
 include/cpu_func.h                     | 23 +++++++++++++++++++++++
 10 files changed, 31 insertions(+), 9 deletions(-)
 create mode 100644 include/cpu_func.h
README +1 -1
index 1389e8ff12..107e67fdda 100644
@@ -2983,7 +2983,7 @@ Low Level (hardware related) configuration options:
 - CONFIG_SYS_SRIOn_MEM_VIRT:
 		Virtual Address of SRIO port 'n' memory region
 
-- CONFIG_SYS_SRIOn_MEM_PHYS:
+- CONFIG_SYS_SRIOn_MEM_PHYxS:
 		Physical Address of SRIO port 'n' memory region
 
 - CONFIG_SYS_SRIOn_MEM_SIZE:
arch/arm/cpu/armv8/fsl-layerscape/mp.c +1 -0
index 7627fd13e7..ca07c68863 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/arch/mp.h>
arch/arm/mach-imx/mx6/mp.c +1 -0
index eda168d867..2fdf070a08 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <linux/errno.h>
 #include <asm/arch/sys_proto.h>
arch/arm/mach-zynqmp/mp.c +1 -0
index 2a71870ae7..fbb551151a 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/io.h>
arch/powerpc/cpu/mpc85xx/cpu.c +1 -0
index bf48836036..5344b175a4 100644
@@ -10,6 +10,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <watchdog.h>
 #include <command.h>
 #include <fsl_esdhc.h>
arch/powerpc/cpu/mpc85xx/mp.c +1 -0
index 3882c95f92..9757bffe02 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <asm/processor.h>
 #include <env.h>
arch/powerpc/cpu/mpc86xx/mp.c +1 -0
index ce300eac5b..07c4c079df 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <ioports.h>
cmd/mp.c +1 -0
index 01d30c1ccb..4c8f5fc3fa 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 
 static int cpu_status_all(void)
 {
include/common.h +0 -8
index d8f302ea92..16c885dd3f 100644
@@ -355,14 +355,6 @@ static inline struct in_addr env_get_ip(char *var)
 void show_activity(int arg);
 #endif
 
-/* Multicore arch functions */
-#ifdef CONFIG_MP
-int cpu_status(u32 nr);
-int cpu_reset(u32 nr);
-int cpu_disable(u32 nr);
-int cpu_release(u32 nr, int argc, char * const argv[]);
-#endif
-
 #else	/* __ASSEMBLY__ */
 
 #endif	/* __ASSEMBLY__ */
include/cpu_func.h new file +23 -0
new file mode 100644
index 0000000000..a99b69b976
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ * Copyright 2019 Google LLC
+ */
+
+#ifndef __CPU_LEGACY_H
+#define __CPU_LEGACY_H
+
+#include <linux/types.h>
+
+/*
+ * Multicore arch functions
+ *
+ * These should be moved to use the CPU uclass.
+ */
+int cpu_status(u32 nr);
+int cpu_reset(u32 nr);
+int cpu_disable(u32 nr);
+int cpu_release(u32 nr, int argc, char * const argv[]);
+
+#endif
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#2 lore raw

PATCH v4 1/42 common: Move older CPU functions to their own header

Quoted 4 lines · Simon Glass

These should be moved to driver model, but in the meantime, move them out of the common header to help reduce its size.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/9569bce9/attachment.sig>
#3 lore raw

PATCH v4 2/42 Drop CONFIG_SHOW_ACTIVITY

In reply to Simon Glass

This feature is not enabled by any board. Drop it.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/powerpc/lib/interrupts.c | 13 -------------
 common/cli_readline.c         |  6 ------
 drivers/timer/mpc83xx_timer.c |  4 ----
 include/common.h              |  4 ----
 net/net.c                     |  3 ---
 scripts/config_whitelist.txt  |  1 -
 6 files changed, 31 deletions(-)
arch/powerpc/lib/interrupts.c +0 -13
index 19682cfcfa..e589933f56 100644
@@ -15,15 +15,6 @@
 #endif
 
 #ifndef CONFIG_MPC83XX_TIMER
-#ifdef CONFIG_SHOW_ACTIVITY
-void board_show_activity (ulong) __attribute__((weak, alias("__board_show_activity")));
-
-void __board_show_activity (ulong dummy)
-{
-	return;
-}
-#endif /* CONFIG_SHOW_ACTIVITY */
-
 #ifndef CONFIG_SYS_WATCHDOG_FREQ
 #define CONFIG_SYS_WATCHDOG_FREQ (CONFIG_SYS_HZ / 2)
 #endif
@@ -94,10 +85,6 @@ void timer_interrupt (struct pt_regs *regs)
 #ifdef CONFIG_LED_STATUS
 	status_led_tick (timestamp);
 #endif /* CONFIG_LED_STATUS */
-
-#ifdef CONFIG_SHOW_ACTIVITY
-	board_show_activity (timestamp);
-#endif /* CONFIG_SHOW_ACTIVITY */
 }
 
 ulong get_timer (ulong base)
common/cli_readline.c +0 -6
index 99b631720e..ea510ed639 100644
@@ -569,12 +569,6 @@ int cli_readline_into_buffer(const char *const prompt, char *buffer,
 			return -2;	/* timed out */
 		WATCHDOG_RESET();	/* Trigger watchdog, if needed */
 
-#ifdef CONFIG_SHOW_ACTIVITY
-		while (!tstc()) {
-			show_activity(0);
-			WATCHDOG_RESET();
-		}
-#endif
 		c = getc();
 
 		/*
drivers/timer/mpc83xx_timer.c +0 -4
index 8e541109d4..9bc32f9b28 100644
@@ -171,10 +171,6 @@ void timer_interrupt(struct pt_regs *regs)
 #ifdef CONFIG_LED_STATUS
 	status_led_tick(priv->timestamp);
 #endif /* CONFIG_LED_STATUS */
-
-#ifdef CONFIG_SHOW_ACTIVITY
-	board_show_activity(priv->timestamp);
-#endif /* CONFIG_SHOW_ACTIVITY */
 }
 
 void wait_ticks(ulong ticks)
include/common.h +0 -4
index 16c885dd3f..4b84969ad3 100644
@@ -351,10 +351,6 @@ static inline struct in_addr env_get_ip(char *var)
 
 #include <bootstage.h>
 
-#ifdef CONFIG_SHOW_ACTIVITY
-void show_activity(int arg);
-#endif
-
 #else	/* __ASSEMBLY__ */
 
 #endif	/* __ASSEMBLY__ */
net/net.c +0 -3
index ded86e7456..0513444eb7 100644
@@ -561,9 +561,6 @@ restart:
 	 */
 	for (;;) {
 		WATCHDOG_RESET();
-#ifdef CONFIG_SHOW_ACTIVITY
-		show_activity(1);
-#endif
 		if (arp_timeout_check() > 0)
 			time_start = get_timer(0);
 
scripts/config_whitelist.txt +0 -1
index b680c554c1..4618fbd44f 100644
@@ -1573,7 +1573,6 @@ CONFIG_SHARP_LM8V31
 CONFIG_SHARP_LQ035Q7DH06
 CONFIG_SHEEVA_88SV131
 CONFIG_SHEEVA_88SV331xV5
-CONFIG_SHOW_ACTIVITY
 CONFIG_SH_CMT_CLK_FREQ
 CONFIG_SH_DSP
 CONFIG_SH_ETHER_ALIGNE_SIZE
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#4 lore raw

PATCH v4 3/42 common: Drop global inclusion of status_led.h

In reply to Simon Glass

This is only used by a few files so it should not be in the common header. Move it out.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 1 +
 board/atmel/at91sam9261ek/led.c             | 1 +
 board/atmel/at91sam9263ek/led.c             | 1 +
 board/atmel/at91sam9m10g45ek/led.c          | 1 +
 board/atmel/at91sam9rlek/led.c              | 1 +
 board/cirrus/edb93xx/edb93xx.c              | 1 +
 board/compulab/cm_t335/cm_t335.c            | 1 +
 board/corscience/tricorder/tricorder.c      | 1 +
 board/mini-box/picosam9g45/led.c            | 1 +
 board/ronetix/pm9261/led.c                  | 1 +
 board/ronetix/pm9263/led.c                  | 1 +
 board/softing/vining_fpga/socfpga.c         | 1 +
 board/st/stm32f429-discovery/led.c          | 1 +
 common/board_r.c                            | 1 +
 drivers/misc/pca9551_led.c                  | 1 +
 drivers/timer/mpc83xx_timer.c               | 1 +
 include/common.h                            | 4 ----
 17 files changed, 16 insertions(+), 4 deletions(-)
board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c +1 -0
index e58bbf07ef..0eac10d911 100644
@@ -8,6 +8,7 @@
 #include <linux/io.h>
 #include <miiphy.h>
 #include <netdev.h>
+#include <status_led.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
board/atmel/at91sam9261ek/led.c +1 -0
index 81967864cf..a1aab98d58 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <status_led.h>
 #include <asm/arch/at91sam9261.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91_pio.h>
board/atmel/at91sam9263ek/led.c +1 -0
index 55fb80dc8d..849501ec36 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <status_led.h>
 #include <asm/io.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/at91sam9263.h>
board/atmel/at91sam9m10g45ek/led.c +1 -0
index feef230871..f44a09623f 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <status_led.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9g45.h>
 #include <asm/arch/clk.h>
board/atmel/at91sam9rlek/led.c +1 -0
index c2df6efd18..6dd19aea15 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <status_led.h>
 #include <asm/arch/at91sam9rl.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/gpio.h>
board/cirrus/edb93xx/edb93xx.c +1 -0
index 8a72fa7a42..88fac76ea5 100644
@@ -16,6 +16,7 @@
 #include <config.h>
 #include <common.h>
 #include <netdev.h>
+#include <status_led.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
 #include <asm/arch/ep93xx.h>
board/compulab/cm_t335/cm_t335.c +1 -0
index 6e38745191..561f2f30bb 100644
@@ -11,6 +11,7 @@
 #include <env.h>
 #include <errno.h>
 #include <miiphy.h>
+#include <status_led.h>
 #include <cpsw.h>
 
 #include <asm/arch/sys_proto.h>
board/corscience/tricorder/tricorder.c +1 -0
index 27e6066575..da33f8441c 100644
@@ -11,6 +11,7 @@
  */
 #include <common.h>
 #include <twl4030.h>
+#include <status_led.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/arch/mmc_host_def.h>
board/mini-box/picosam9g45/led.c +1 -0
index 2e32b7fb36..8ce8b6bbea 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <status_led.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9g45.h>
 #include <asm/arch/clk.h>
board/ronetix/pm9261/led.c +1 -0
index 2a53b2e6bd..df955830b1 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <status_led.h>
 #include <asm/gpio.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/gpio.h>
board/ronetix/pm9263/led.c +1 -0
index 683e151a4f..524b4afcbd 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <status_led.h>
 #include <asm/gpio.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/gpio.h>
board/softing/vining_fpga/socfpga.c +1 -0
index 3f597fb99e..e42d9194ad 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <status_led.h>
 #include <asm/arch/reset_manager.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
board/st/stm32f429-discovery/led.c +1 -0
index ae6df78f56..539c139bb5 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <status_led.h>
 #include <asm-generic/gpio.h>
 
 void coloured_LED_init(void)
common/board_r.c +1 -0
index c1ecb06b74..79ee21e968 100644
@@ -37,6 +37,7 @@
 #include <onenand_uboot.h>
 #include <scsi.h>
 #include <serial.h>
+#include <status_led.h>
 #include <stdio_dev.h>
 #include <timer.h>
 #include <trace.h>
drivers/misc/pca9551_led.c +1 -0
index 2333ec8038..cdc4390f81 100644
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <errno.h>
 #include <i2c.h>
+#include <status_led.h>
 
 #ifndef CONFIG_PCA9551_I2C_ADDR
 #error "CONFIG_PCA9551_I2C_ADDR not defined!"
drivers/timer/mpc83xx_timer.c +1 -0
index 9bc32f9b28..dfbc8672b2 100644
@@ -8,6 +8,7 @@
 #include <board.h>
 #include <clk.h>
 #include <dm.h>
+#include <status_led.h>
 #include <timer.h>
 #include <watchdog.h>
 
include/common.h +0 -4
index 4b84969ad3..52bcc2e591 100644
@@ -345,10 +345,6 @@ static inline struct in_addr env_get_ip(char *var)
 	return string_to_ip(env_get(var));
 }
 
-#ifdef CONFIG_LED_STATUS
-# include <status_led.h>
-#endif
-
 #include <bootstage.h>
 
 #else	/* __ASSEMBLY__ */
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#5 lore raw

PATCH v4 4/42 status_led: Tidy up the code style

In reply to Simon Glass

There are a few whitespace problems with this code. Tidy them up.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/powerpc/lib/interrupts.c | 2 +-
 drivers/misc/status_led.c     | 8 ++++----
 include/status_led.h          | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
arch/powerpc/lib/interrupts.c +1 -1
index e589933f56..4b7f543a18 100644
@@ -83,7 +83,7 @@ void timer_interrupt (struct pt_regs *regs)
 #endif    /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */
 
 #ifdef CONFIG_LED_STATUS
-	status_led_tick (timestamp);
+	status_led_tick(timestamp);
 #endif /* CONFIG_LED_STATUS */
 }
 
drivers/misc/status_led.c +4 -4
index 8983ab40e4..a6e9c03a02 100644
@@ -82,13 +82,13 @@ void status_led_init(void)
 	status_led_init_done = 1;
 }
 
-void status_led_tick (ulong timestamp)
+void status_led_tick(ulong timestamp)
 {
 	led_dev_t *ld;
 	int i;
 
 	if (!status_led_init_done)
-		status_led_init ();
+		status_led_init();
 
 	for (i = 0, ld = led_dev; i < MAX_LED_DEV; i++, ld++) {
 
@@ -103,7 +103,7 @@ void status_led_tick (ulong timestamp)
 	}
 }
 
-void status_led_set (int led, int state)
+void status_led_set(int led, int state)
 {
 	led_dev_t *ld;
 
@@ -111,7 +111,7 @@ void status_led_set (int led, int state)
 		return;
 
 	if (!status_led_init_done)
-		status_led_init ();
+		status_led_init();
 
 	ld = &led_dev[led];
 
include/status_led.h +2 -2
index 5b3570166d..6707ab1d29 100644
@@ -36,8 +36,8 @@
 #endif /* CONFIG_LED_STATUS5 */
 
 void status_led_init(void);
-void status_led_tick (unsigned long timestamp);
-void status_led_set  (int led, int state);
+void status_led_tick(unsigned long timestamp);
+void status_led_set(int led, int state);
 
 /*****  MVS v1  **********************************************************/
 #if (defined(CONFIG_MVS) && CONFIG_MVS < 2)
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#6 lore raw

PATCH v4 5/42 common: Move random-number functions into their own header

In reply to Simon Glass

Create a new rand.h header file and move functions into it, to reduce the size of common.h

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/common.h |  6 ------
 include/net.h    |  1 +
 include/rand.h   | 40 ++++++++++++++++++++++++++++++++++++++++
 lib/rand.c       |  1 +
 net/link_local.c |  1 +
 5 files changed, 43 insertions(+), 6 deletions(-)
 create mode 100644 include/rand.h
include/common.h +0 -6
index 52bcc2e591..b09c7aeddd 100644
@@ -325,12 +325,6 @@ char *	strmhz(char *buf, unsigned long hz);
 /* lib/crc32.c */
 #include <u-boot/crc.h>
 
-/* lib/rand.c */
-#define RAND_MAX -1U
-void srand(unsigned int seed);
-unsigned int rand(void);
-unsigned int rand_r(unsigned int *seedp);
-
 /*
  * STDIO based functions (can always be used)
  */
include/net.h +1 -0
index 75a16e4c8f..d8d187d8af 100644
@@ -16,6 +16,7 @@
 #include <asm/byteorder.h>	/* for nton* / ntoh* stuff */
 #include <env.h>
 #include <linux/if_ether.h>
+#include <rand.h>
 
 #define DEBUG_LL_STATE 0	/* Link local state machine changes */
 #define DEBUG_DEV_PKT 0		/* Packets or info directed to the device */
include/rand.h new file +40 -0
new file mode 100644
index 0000000000..c9d15f50a1
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ */
+
+#ifndef __RAND_H
+#define __RAND_H
+
+#define RAND_MAX -1U
+
+/**
+ * srand() - Set the random-number seed value
+ *
+ * This can be used to restart the pseudo-random-number sequence from a known
+ * point. This affects future calls to rand() to start from that point
+ *
+ * @seed: New seed
+ */
+void srand(unsigned int seed);
+
+/**
+ * rand() - Get a 32-bit pseudo-random number
+ *
+ * @returns next random number in the sequence
+ */
+unsigned int rand(void);
+
+/**
+ * rand_r() - Get a 32-bit pseudo-random number
+ *
+ * This version of the function allows multiple sequences to be used at the
+ * same time, since it requires the caller to store the seed value.
+ *
+ * @seed value to use, updated on exit
+ * @returns next random number in the sequence
+ */
+unsigned int rand_r(unsigned int *seedp);
+
+#endif
lib/rand.c +1 -0
index af4cf3a0e8..d256baf5ce 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <rand.h>
 
 static unsigned int y = 1U;
 
net/link_local.c +1 -0
index dd9fcad087..1986b9b9d3 100644
@@ -14,6 +14,7 @@
 #include <common.h>
 #include <env.h>
 #include <net.h>
+#include <rand.h>
 #include "arp.h"
 #include "net_rand.h"
 
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#7 lore raw

PATCH v4 6/42 common: Drop linux/crc8.h

In reply to Simon Glass

We have an existing U-Boot header for the one function that this defines. Use that instead of the linux/ one. Move over the nice comment.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 board/theadorable/theadorable.c |  2 +-
 drivers/tpm/tpm2_tis_sandbox.c  |  2 +-
 drivers/tpm/tpm_tis_sandbox.c   |  2 +-
 include/linux/crc8.h            | 23 -----------------------
 include/u-boot/crc.h            | 14 +++++++++++++-
 lib/crc8.c                      |  7 ++++++-
 6 files changed, 22 insertions(+), 28 deletions(-)
 delete mode 100644 include/linux/crc8.h
board/theadorable/theadorable.c +1 -1
index d42350319c..2958d5ff88 100644
@@ -14,11 +14,11 @@
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
-#include <linux/crc8.h>
 #include <linux/mbus.h>
 #ifdef CONFIG_NET
 #include <netdev.h>
 #endif
+#include <u-boot/crc.h>
 #include "theadorable.h"
 
 #include "../drivers/ddr/marvell/axp/ddr3_hw_training.h"
drivers/tpm/tpm2_tis_sandbox.c +1 -1
index f282ea6adf..522988795c 100644
@@ -9,7 +9,7 @@
 #include <tpm-v2.h>
 #include <asm/state.h>
 #include <asm/unaligned.h>
-#include <linux/crc8.h>
+#include <u-boot/crc.h>
 
 /* Hierarchies */
 enum tpm2_hierarchy {
drivers/tpm/tpm_tis_sandbox.c +1 -1
index 3336f559e5..2dff0d3eee 100644
@@ -8,7 +8,7 @@
 #include <tpm-v1.h>
 #include <asm/state.h>
 #include <asm/unaligned.h>
-#include <linux/crc8.h>
+#include <u-boot/crc.h>
 
 /* TPM NVRAM location indices. */
 #define FIRMWARE_NV_INDEX		0x1007
include/linux/crc8.h deleted +0 -23
deleted file mode 100644
index 0ab5b9ab21..0000000000
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (c) 2013 Google, Inc
- */
-
-
-#ifndef __linux_crc8_h
-#define __linux_crc8_h
-
-/**
- * crc8() - Calculate and return CRC-8 of the data
- *
- * This uses an x^8 + x^2 + x + 1 polynomial.  A table-based algorithm would
- * be faster, but for only a few bytes it isn't worth the code size
- *
- * @crc_start: CRC8 start value
- * @vptr: Buffer to checksum
- * @len: Length of buffer in bytes
- * @return CRC8 checksum
- */
-unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len);
-
-#endif
include/u-boot/crc.h +13 -1
index 788ef29a17..b42bcda2b3 100644
@@ -8,7 +8,19 @@
 #ifndef _UBOOT_CRC_H
 #define _UBOOT_CRC_H
 
-/* lib/crc8.c */
+/**
+ * crc8() - Calculate and return CRC-8 of the data
+ *
+ * This uses an x^8 + x^2 + x + 1 polynomial.  A table-based algorithm would
+ * be faster, but for only a few bytes it isn't worth the code size
+ *
+ * lib/crc8.c
+ *
+ * @crc_start: CRC8 start value
+ * @vptr: Buffer to checksum
+ * @len: Length of buffer in bytes
+ * @return CRC8 checksum
+ */
 unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len);
 
 /* lib/crc16.c - 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */
lib/crc8.c +6 -1
index 55f7c07285..87b87b675b 100644
@@ -3,7 +3,12 @@
  * Copyright (c) 2013 Google, Inc
  */
 
-#include "linux/crc8.h"
+#ifdef USE_HOSTCC
+#include <arpa/inet.h>
+#else
+#include <common.h>
+#endif
+#include <u-boot/crc.h>
 
 #define POLY	(0x1070U << 3)
 
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#8 lore raw

PATCH v4 7/42 crc: Fix code style with crc functions

In reply to Simon Glass

Some of these have a space before the bracket. Drop it to fix the style. Add some missing function comments while here.

Note that u32 and u8 cannot be used here since crc.h is included on the host side.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 cmd/i2c.c            |  2 +-
 include/u-boot/crc.h | 75 +++++++++++++++++++++++++++++++++++++++-----
 lib/crc32.c          |  4 +--
 tools/envcrc.c       |  4 +--
 4 files changed, 73 insertions(+), 12 deletions(-)
cmd/i2c.c +1 -1
index e0f8ece597..038f97c261 100644
@@ -768,7 +768,7 @@ static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
 #endif
 		if (ret)
 			err++;
-		crc = crc32 (crc, &byte, 1);
+		crc = crc32(crc, &byte, 1);
 		addr++;
 	}
 	if (err > 0)
include/u-boot/crc.h +68 -7

88 lines not on this page · raw message

lib/crc32.c +2 -2
index eee21f8d73..dc7e183f18 100644
@@ -244,12 +244,12 @@ uint32_t crc32_wd(uint32_t crc, const unsigned char *buf, uInt len,
 		chunk = end - curr;
 		if (chunk > chunk_sz)
 			chunk = chunk_sz;
-		crc = crc32 (crc, curr, chunk);
+		crc = crc32(crc, curr, chunk);
 		curr += chunk;
 		WATCHDOG_RESET ();
 	}
 #else
-	crc = crc32 (crc, buf, len);
+	crc = crc32(crc, buf, len);
 #endif
 
 	return crc;
tools/envcrc.c +2 -2
index 9577682828..2f0d20d1ff 100644
@@ -61,7 +61,7 @@ extern unsigned int env_size;
 extern env_t embedded_environment;
 #endif	/* CONFIG_BUILD_ENVCRC */
 
-extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
+extern uint32_t crc32(uint32_t, const unsigned char *, unsigned int);
 
 int main (int argc, char **argv)
 {
@@ -91,7 +91,7 @@ int main (int argc, char **argv)
 			memset(dataptr + eoe, pad, datasize - eoe);
 	}
 
-	crc = crc32 (0, dataptr, datasize);
+	crc = crc32(0, dataptr, datasize);
 
 	/* Check if verbose mode is activated passing a parameter to the program */
 	if (argc > 1) {
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#9 lore raw

PATCH v4 8/42 crc32: Use the crc.h header for crc functions

In reply to Simon Glass

Drop inclusion of crc.h in common.h and use the correct header directly instead.

With this we can drop the conflicting definition in fw_env.h and rely on the crc.h header, which is already included.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 api/api.c                                         | 1 +
 arch/arm/mach-meson/board-common.c                | 1 +
 arch/arm/mach-rockchip/misc.c                     | 1 +
 board/CZ.NIC/turris_omnia/turris_omnia.c          | 1 +
 board/corscience/tricorder/tricorder-eeprom.c     | 1 +
 board/freescale/common/sys_eeprom.c               | 1 +
 board/freescale/mpc8323erdb/mpc8323erdb.c         | 1 +
 board/gardena/smart-gateway-mt7688/board.c        | 1 +
 board/gdsys/a38x/hre.c                            | 1 +
 board/gdsys/p1022/controlcenterd-id.c             | 1 +
 board/sunxi/board.c                               | 1 +
 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 1 +
 board/varisys/common/sys_eeprom.c                 | 1 +
 cmd/i2c.c                                         | 1 +
 cmd/nvedit.c                                      | 1 +
 common/android_ab.c                               | 1 +
 common/bloblist.c                                 | 1 +
 common/board_r.c                                  | 1 +
 common/hash.c                                     | 1 +
 common/image-fit.c                                | 1 +
 common/image.c                                    | 1 +
 common/iotrace.c                                  | 1 +
 common/spl/spl.c                                  | 1 +
 disk/part_efi.c                                   | 1 +
 drivers/misc/atsha204a-i2c.c                      | 1 +
 drivers/mtd/ubi/attach.c                          | 1 +
 drivers/mtd/ubi/crc32.c                           | 1 +
 drivers/mtd/ubi/eba.c                             | 1 +
 drivers/mtd/ubi/fastmap.c                         | 1 +
 drivers/mtd/ubi/io.c                              | 1 +
 drivers/mtd/ubi/vtbl.c                            | 1 +
 drivers/mtd/ubispl/ubispl.c                       | 1 +
 drivers/net/fm/fdt.c                              | 1 +
 drivers/net/fm/fm.c                               | 1 +
 drivers/qe/qe.c                                   | 1 +
 env/common.c                                      | 1 +
 env/eeprom.c                                      | 1 +
 env/flash.c                                       | 1 +
 env/nand.c                                        | 1 +
 env/nvram.c                                       | 1 +
 env/remote.c                                      | 1 +
 env/sf.c                                          | 1 +
 examples/api/glue.c                               | 1 +
 fs/jffs2/jffs2_1pass.c                            | 1 +
 fs/ubifs/io.c                                     | 1 +
 fs/ubifs/recovery.c                               | 1 +
 fs/ubifs/tnc.c                                    | 1 +
 include/common.h                                  | 3 ---
 lib/crc32.c                                       | 1 +
 lib/efi_loader/efi_boottime.c                     | 1 +
 lib/efi_loader/efi_runtime.c                      | 1 +
 lib/efi_loader/efi_variable.c                     | 1 +
 lib/efi_selftest/efi_selftest_config_table.c      | 1 +
 lib/efi_selftest/efi_selftest_crc32.c             | 1 +
 lib/gunzip.c                                      | 1 +
 lib/zlib/deflate.c                                | 1 +
 tools/default_image.c                             | 1 +
 tools/env/fw_env.c                                | 1 +
 tools/env/fw_env.h                                | 2 --
 tools/envcrc.c                                    | 1 +
 tools/mkenvimage.c                                | 1 +
 tools/mxsimage.c                                  | 1 +
 tools/pbl_crc32.c                                 | 1 +
 tools/pblimage.c                                  | 1 +
 tools/socfpgaimage.c                              | 1 +
 65 files changed, 63 insertions(+), 5 deletions(-)
api/api.c +1 -0
index 71fa03804e..4fc451a83d 100644
@@ -13,6 +13,7 @@
 #include <env_internal.h>
 #include <linux/types.h>
 #include <api_public.h>
+#include <u-boot/crc.h>
 
 #include "api_private.h"
 
arch/arm/mach-meson/board-common.c +1 -0
index d261b4ea33..6c77e37966 100644
@@ -13,6 +13,7 @@
 #include <asm/armv8/mmu.h>
 #include <asm/unaligned.h>
 #include <efi_loader.h>
+#include <u-boot/crc.h>
 
 #if CONFIG_IS_ENABLED(FASTBOOT)
 #include <asm/psci.h>
arch/arm/mach-rockchip/misc.c +1 -0
index c0e4fdbc00..186ea84d77 100644
@@ -14,6 +14,7 @@
 #include <dm.h>
 #include <dm/uclass-internal.h>
 #include <misc.h>
+#include <u-boot/crc.h>
 #include <u-boot/sha256.h>
 
 #include <asm/arch-rockchip/misc.h>
board/CZ.NIC/turris_omnia/turris_omnia.c +1 -0
index 1d8d08a847..4d21e62e73 100644
@@ -18,6 +18,7 @@
 #include <dm/uclass.h>
 #include <fdt_support.h>
 #include <time.h>
+#include <u-boot/crc.h>
 # include <atsha204a-i2c.h>
 
 #include "../drivers/ddr/marvell/a38x/ddr3_init.h"
board/corscience/tricorder/tricorder-eeprom.c +1 -0
index 16bceea7ba..b28189dafd 100644
@@ -6,6 +6,7 @@
  */
 #include <common.h>
 #include <i2c.h>
+#include <u-boot/crc.h>
 
 #include "tricorder-eeprom.h"
 
board/freescale/common/sys_eeprom.c +1 -0
index bb655ca744..6f151b0f71 100644
@@ -11,6 +11,7 @@
 #include <env.h>
 #include <i2c.h>
 #include <linux/ctype.h>
+#include <u-boot/crc.h>
 
 #ifdef CONFIG_SYS_I2C_EEPROM_CCID
 #include "../common/eeprom.h"
board/freescale/mpc8323erdb/mpc8323erdb.c +1 -0
index e5aecc4e1f..003e95cb6b 100644
@@ -17,6 +17,7 @@
 #include <miiphy.h>
 #include <command.h>
 #include <linux/libfdt.h>
+#include <u-boot/crc.h>
 #if defined(CONFIG_PCI)
 #include <pci.h>
 #endif
board/gardena/smart-gateway-mt7688/board.c +1 -0
index bd494c84fc..1a59839569 100644
@@ -10,6 +10,7 @@
 #include <net.h>
 #include <spi.h>
 #include <spi_flash.h>
+#include <u-boot/crc.h>
 #include <uuid.h>
 #include <linux/ctype.h>
 #include <linux/io.h>
board/gdsys/a38x/hre.c +1 -0
index 82b84284ef..027ad1f57e 100644
@@ -10,6 +10,7 @@
 #include <i2c.h>
 #include <mmc.h>
 #include <tpm-v1.h>
+#include <u-boot/crc.h>
 #include <u-boot/sha1.h>
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
board/gdsys/p1022/controlcenterd-id.c +1 -0
index 43f5404231..d6798bd338 100644
@@ -18,6 +18,7 @@
 #include <i2c.h>
 #include <mmc.h>
 #include <tpm-v1.h>
+#include <u-boot/crc.h>
 #include <u-boot/sha1.h>
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
board/sunxi/board.c +1 -0
index e3b2d13892..b9450a0e36 100644
@@ -24,6 +24,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/spl.h>
+#include <u-boot/crc.h>
 #ifndef CONFIG_ARM64
 #include <asm/armv7.h>
 #endif
board/theobroma-systems/puma_rk3399/puma-rk3399.c +1 -0
index 47259b7149..9887d20207 100644
@@ -9,6 +9,7 @@
 #include <misc.h>
 #include <spl.h>
 #include <syscon.h>
+#include <u-boot/crc.h>
 #include <usb.h>
 #include <dm/pinctrl.h>
 #include <dm/uclass-internal.h>
board/varisys/common/sys_eeprom.c +1 -0
index 77772a6923..4c025087db 100644
@@ -15,6 +15,7 @@
 #include <env.h>
 #include <i2c.h>
 #include <linux/ctype.h>
+#include <u-boot/crc.h>
 
 #include "eeprom.h"
 
cmd/i2c.c +1 -0
index 038f97c261..43a76299b3 100644
@@ -76,6 +76,7 @@
 #include <malloc.h>
 #include <asm/byteorder.h>
 #include <linux/compiler.h>
+#include <u-boot/crc.h>
 
 /* Display values from last command.
  * Memory modify remembered values are different from display memory.
cmd/nvedit.c +1 -0
index 99a3bc57b1..b5da375913 100644
@@ -33,6 +33,7 @@
 #include <errno.h>
 #include <malloc.h>
 #include <mapmem.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 #include <linux/stddef.h>
 #include <asm/byteorder.h>
common/android_ab.c +1 -0
index 05ffc6f4e5..6c4df419b2 100644
@@ -8,6 +8,7 @@
 #include <linux/err.h>
 #include <memalign.h>
 #include <u-boot/crc.h>
+#include <u-boot/crc.h>
 
 /**
  * Compute the CRC-32 of the bootloader control struct.
common/bloblist.c +1 -0
index b4cf169b05..ccf5e4b6f6 100644
@@ -9,6 +9,7 @@
 #include <log.h>
 #include <mapmem.h>
 #include <spl.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
common/board_r.c +1 -0
index 79ee21e968..05e08212b4 100644
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <api.h>
+#include <u-boot/crc.h>
 /* TODO: can we just include all these headers whether needed or not? */
 #if defined(CONFIG_CMD_BEDBUG)
 #include <bedbug/type.h>
common/hash.c +1 -0
index d0d825e389..ff4986a619 100644
@@ -18,6 +18,7 @@
 #include <hw_sha.h>
 #include <asm/io.h>
 #include <linux/errno.h>
+#include <u-boot/crc.h>
 #else
 #include "mkimage.h"
 #include <time.h>
common/image-fit.c +1 -0
index 5c63c769de..c52f945120 100644
@@ -11,6 +11,7 @@
 #ifdef USE_HOSTCC
 #include "mkimage.h"
 #include <time.h>
+#include <u-boot/crc.h>
 #else
 #include <linux/compiler.h>
 #include <linux/kconfig.h>
common/image.c +1 -0
index f17fa40c49..992ebbad51 100644
@@ -9,6 +9,7 @@
 #ifndef USE_HOSTCC
 #include <common.h>
 #include <env.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
common/iotrace.c +1 -0
index 5b92fabc76..ba955afc94 100644
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <mapmem.h>
 #include <asm/io.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
common/spl/spl.c +1 -0
index f1ad8dc9da..cc5507f757 100644
@@ -15,6 +15,7 @@
 #include <asm/u-boot.h>
 #include <nand.h>
 #include <fat.h>
+#include <u-boot/crc.h>
 #include <version.h>
 #include <image.h>
 #include <malloc.h>
disk/part_efi.c +1 -0
index 51fa4a74ab..b2e157d9c1 100644
@@ -19,6 +19,7 @@
 #include <part_efi.h>
 #include <linux/compiler.h>
 #include <linux/ctype.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/misc/atsha204a-i2c.c +1 -0
index 934ba5e6b8..116c0661e7 100644
@@ -15,6 +15,7 @@
 #include <i2c.h>
 #include <errno.h>
 #include <atsha204a-i2c.h>
+#include <u-boot/crc.h>
 
 #define ATSHA204A_TWLO			60
 #define ATSHA204A_TRANSACTION_TIMEOUT	100000
drivers/mtd/ubi/attach.c +1 -0
index b4ba339c80..19defd8831 100644
@@ -74,6 +74,7 @@
 #include <linux/slab.h>
 #include <linux/crc32.h>
 #include <linux/random.h>
+#include <u-boot/crc.h>
 #else
 #include <div64.h>
 #include <linux/err.h>
drivers/mtd/ubi/crc32.c +1 -0
index 9c54ea4db0..9ce061c861 100644
@@ -25,6 +25,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/compiler.h>
+#include <u-boot/crc.h>
 #endif
 #include <linux/types.h>
 
drivers/mtd/ubi/eba.c +1 -0
index 809782b372..0c8b998e7e 100644
@@ -31,6 +31,7 @@
 #ifndef __UBOOT__
 #include <linux/slab.h>
 #include <linux/crc32.h>
+#include <u-boot/crc.h>
 #else
 #include <ubi_uboot.h>
 #endif
drivers/mtd/ubi/fastmap.c +1 -0
index 14368f9738..646c778e87 100644
@@ -8,6 +8,7 @@
 
 #ifndef __UBOOT__
 #include <linux/crc32.h>
+#include <u-boot/crc.h>
 #else
 #include <div64.h>
 #include <malloc.h>
drivers/mtd/ubi/io.c +1 -0
index 688fb509d2..608dede492 100644
@@ -77,6 +77,7 @@
 #include <linux/crc32.h>
 #include <linux/err.h>
 #include <linux/slab.h>
+#include <u-boot/crc.h>
 #else
 #include <hexdump.h>
 #include <ubi_uboot.h>
drivers/mtd/ubi/vtbl.c +1 -0
index fb535c1a87..9c46ef6695 100644
@@ -50,6 +50,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <asm/div64.h>
+#include <u-boot/crc.h>
 #else
 #include <ubi_uboot.h>
 #endif
drivers/mtd/ubispl/ubispl.c +1 -0
index 3f3b9b4367..00102fcf74 100644
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <u-boot/crc.h>
 #include <ubispl.h>
 
 #include <linux/crc32.h>
drivers/net/fm/fdt.c +1 -0
index 72d1294751..a6b0d87415 100644
@@ -5,6 +5,7 @@
 #include <asm/io.h>
 #include <env.h>
 #include <fsl_qe.h>	/* For struct qe_firmware */
+#include <u-boot/crc.h>
 
 #ifdef CONFIG_SYS_DPAA_FMAN
 /**
drivers/net/fm/fm.c +1 -0
index 4c9dce8dc5..926cf81a07 100644
@@ -8,6 +8,7 @@
 #include <malloc.h>
 #include <asm/io.h>
 #include <linux/errno.h>
+#include <u-boot/crc.h>
 
 #include "fm.h"
 #include <fsl_qe.h>		/* For struct qe_firmware */
drivers/qe/qe.c +1 -0
index 6e4d732a07..24549ece65 100644
@@ -14,6 +14,7 @@
 #include <linux/immap_qe.h>
 #include <fsl_qe.h>
 #include <mmc.h>
+#include <u-boot/crc.h>
 
 #ifdef CONFIG_ARCH_LS1021A
 #include <asm/arch/immap_ls102xa.h>
env/common.c +1 -0
index 4daaa6faea..0edb6fb04c 100644
@@ -15,6 +15,7 @@
 #include <search.h>
 #include <errno.h>
 #include <malloc.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
env/eeprom.c +1 -0
index cb04d2ac88..f0bdf2a141 100644
@@ -12,6 +12,7 @@
 #include <env.h>
 #include <env_internal.h>
 #include <linux/stddef.h>
+#include <u-boot/crc.h>
 #if defined(CONFIG_I2C_ENV_EEPROM_BUS)
 #include <i2c.h>
 #endif
env/flash.c +1 -0
index 231a5fdf24..97e0024572 100644
@@ -17,6 +17,7 @@
 #include <malloc.h>
 #include <search.h>
 #include <errno.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
env/nand.c +1 -0
index 9f3dc635cf..4dce234c22 100644
@@ -23,6 +23,7 @@
 #include <nand.h>
 #include <search.h>
 #include <errno.h>
+#include <u-boot/crc.h>
 
 #if defined(CONFIG_CMD_SAVEENV) && defined(CONFIG_CMD_NAND) && \
 		!defined(CONFIG_SPL_BUILD)
env/nvram.c +1 -0
index 79201bd788..a78db21623 100644
@@ -30,6 +30,7 @@
 #include <linux/stddef.h>
 #include <search.h>
 #include <errno.h>
+#include <u-boot/crc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
env/remote.c +1 -0
index 02531f427b..7cdc61a514 100644
@@ -9,6 +9,7 @@
 #include <command.h>
 #include <env_internal.h>
 #include <linux/stddef.h>
+#include <u-boot/crc.h>
 
 #ifdef ENV_IS_EMBEDDED
 env_t *env_ptr = &environment;
env/sf.c +1 -0
index 590d0cedd8..5b55ee51ad 100644
@@ -18,6 +18,7 @@
 #include <search.h>
 #include <errno.h>
 #include <dm/device-internal.h>
+#include <u-boot/crc.h>
 
 #ifndef CONFIG_SPL_BUILD
 #define CMD_SAVEENV
examples/api/glue.c +1 -0
index 4086616a94..91d13157a1 100644
@@ -7,6 +7,7 @@
 #include <env.h>
 #include <linux/types.h>
 #include <api_public.h>
+#include <u-boot/crc.h>
 
 #include "glue.h"
 
fs/jffs2/jffs2_1pass.c +1 -0
index 6bf1943958..5912cde838 100644
@@ -118,6 +118,7 @@
 #include <linux/compiler.h>
 #include <linux/stat.h>
 #include <linux/time.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 #include <jffs2/jffs2.h>
 #include <jffs2/jffs2_1pass.h>
fs/ubifs/io.c +1 -0
index 8d7f8feebb..7fe94e1093 100644
@@ -61,6 +61,7 @@
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>
+#include <u-boot/crc.h>
 #else
 #include <linux/compat.h>
 #include <linux/err.h>
fs/ubifs/recovery.c +1 -0
index 621804c6fd..b568012fec 100644
@@ -38,6 +38,7 @@
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>
+#include <u-boot/crc.h>
 #else
 #include <linux/err.h>
 #endif
fs/ubifs/tnc.c +1 -0
index 86774f8fa2..8afc08ad7d 100644
@@ -21,6 +21,7 @@
 #ifndef __UBOOT__
 #include <linux/crc32.h>
 #include <linux/slab.h>
+#include <u-boot/crc.h>
 #else
 #include <linux/compat.h>
 #include <linux/err.h>
include/common.h +0 -3
index b09c7aeddd..9c454fb1c8 100644
@@ -322,9 +322,6 @@ int strcmp_compar(const void *, const void *);
 /* lib/strmhz.c */
 char *	strmhz(char *buf, unsigned long hz);
 
-/* lib/crc32.c */
-#include <u-boot/crc.h>
-
 /*
  * STDIO based functions (can always be used)
  */
lib/crc32.c +1 -0
index dc7e183f18..e9be3bf386 100644
@@ -10,6 +10,7 @@
 
 #ifdef USE_HOSTCC
 #include <arpa/inet.h>
+#include <u-boot/crc.h>
 #else
 #include <common.h>
 #include <efi_loader.h>
lib/efi_loader/efi_boottime.c +1 -0
index 493d906c64..ea52b9539d 100644
@@ -13,6 +13,7 @@
 #include <u-boot/crc.h>
 #include <bootm.h>
 #include <pe.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
lib/efi_loader/efi_runtime.c +1 -0
index ced00516f7..72555f07fc 100644
@@ -11,6 +11,7 @@
 #include <elf.h>
 #include <efi_loader.h>
 #include <rtc.h>
+#include <u-boot/crc.h>
 
 /* For manual relocation support */
 DECLARE_GLOBAL_DATA_PTR;
lib/efi_loader/efi_variable.c +1 -0
index 46f35bc60b..c316bdfec0 100644
@@ -11,6 +11,7 @@
 #include <hexdump.h>
 #include <malloc.h>
 #include <search.h>
+#include <u-boot/crc.h>
 
 #define READ_ONLY BIT(31)
 
lib/efi_selftest/efi_selftest_config_table.c +1 -0
index 4467f492ac..2bf12b5bb6 100644
@@ -9,6 +9,7 @@
  */
 
 #include <efi_selftest.h>
+#include <u-boot/crc.h>
 
 static const struct efi_system_table *sys_table;
 static struct efi_boot_services *boottime;
lib/efi_selftest/efi_selftest_crc32.c +1 -0
index 4881e8ac6f..19153c759a 100644
@@ -10,6 +10,7 @@
  */
 
 #include <efi_selftest.h>
+#include <u-boot/crc.h>
 
 const struct efi_system_table *st;
 efi_status_t (EFIAPI *bs_crc32)(const void *data, efi_uintn_t data_size,
lib/gunzip.c +1 -0
index 1d65616c13..9e6ccd692a 100644
@@ -12,6 +12,7 @@
 #include <image.h>
 #include <malloc.h>
 #include <memalign.h>
+#include <u-boot/crc.h>
 #include <watchdog.h>
 #include <u-boot/zlib.h>
 
lib/zlib/deflate.c +1 -0
index 9a20b70344..1fe58d5da6 100644
@@ -50,6 +50,7 @@
 /* @(#) $Id$ */
 
 #include "deflate.h"
+#include <u-boot/crc.h>
 
 const char deflate_copyright[] =
    " deflate 1.2.5 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
tools/default_image.c +1 -0
index f7990e28c0..e164c0c27d 100644
@@ -15,6 +15,7 @@
 
 #include "imagetool.h"
 #include "mkimage.h"
+#include <u-boot/crc.h>
 
 #include <image.h>
 #include <tee/optee.h>
tools/env/fw_env.c +1 -0
index e2801f595f..30b5a190ab 100644
@@ -25,6 +25,7 @@
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
+#include <u-boot/crc.h>
 #include <unistd.h>
 #include <dirent.h>
 
tools/env/fw_env.h +0 -2
index 3d2b457b31..b60fbfc8f8 100644
@@ -160,5 +160,3 @@ int fw_env_close(struct env_opts *opts);
  *  version string of the library
  */
 char *fw_env_version(void);
-
-unsigned long crc32(unsigned long, const unsigned char *, unsigned);
tools/envcrc.c +1 -0
index 2f0d20d1ff..1ffa40788a 100644
@@ -9,6 +9,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <u-boot/crc.h>
 #include <unistd.h>
 
 #include <linux/kconfig.h>
tools/mkenvimage.c +1 -0
index a8eebab6c3..b05f83415f 100644
@@ -14,6 +14,7 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
+#include <u-boot/crc.h>
 #include <unistd.h>
 #include <libgen.h>
 #include <sys/types.h>
tools/mxsimage.c +1 -0
index 0bb5c6aa6b..002f4b525a 100644
@@ -11,6 +11,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <string.h>
+#include <u-boot/crc.h>
 #include <unistd.h>
 #include <limits.h>
 
tools/pbl_crc32.c +1 -0
index 06da1d92ff..9b1ca55348 100644
@@ -5,6 +5,7 @@
  * Cleaned up and refactored by Charles Manning.
  */
 #include "pblimage.h"
+#include <u-boot/crc.h>
 
 static uint32_t crc_table[256];
 static int crc_table_valid;
tools/pblimage.c +1 -0
index d11f9afe24..3c823e96cf 100644
@@ -6,6 +6,7 @@
 #include <image.h>
 #include "pblimage.h"
 #include "pbl_crc32.h"
+#include <u-boot/crc.h>
 
 #define roundup(x, y)		((((x) + ((y) - 1)) / (y)) * (y))
 #define PBL_ACS_CONT_CMD	0x81000000
tools/socfpgaimage.c +1 -0
index 72d8b96f54..8fa098338b 100644
@@ -55,6 +55,7 @@
 #include "pbl_crc32.h"
 #include "imagetool.h"
 #include "mkimage.h"
+#include <u-boot/crc.h>
 
 #include <image.h>
 
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#10 lore raw

PATCH v4 9/42 spl: bootcount: Move code out of header file

In reply to Simon Glass

It is not good practice to write code in a header file. If it is included multiple times then the code can cause duplicate functions.

Move the bootcount_store() and bootcount_load() functions into SPL.

Note: bootcount is a bit strange in that it uses driver model but does not define proper drivers. This should be fixed.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/spl/spl.c    | 11 +++++++++++
 include/bootcount.h |  4 ----
 2 files changed, 11 insertions(+), 4 deletions(-)
common/spl/spl.c +11 -0
index cc5507f757..a2ef13a41c 100644
@@ -830,3 +830,14 @@ ulong spl_relocate_stack_gd(void)
 	return 0;
 #endif
 }
+
+#if defined(CONFIG_BOOTCOUNT_LIMIT) && !defined(CONFIG_SPL_BOOTCOUNT_LIMIT)
+void bootcount_store(ulong a)
+{
+}
+
+ulong bootcount_load(void)
+{
+	return 0;
+}
+#endif
include/bootcount.h +0 -4
index 8fa8cf8218..a26a385233 100644
@@ -127,10 +127,6 @@ static inline void bootcount_inc(void)
 #endif /* !CONFIG_SPL_BUILD */
 }
 
-#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_BOOTCOUNT_LIMIT)
-void bootcount_store(ulong a) {};
-ulong bootcount_load(void) { return 0; }
-#endif /* CONFIG_SPL_BUILD && !CONFIG_SPL_BOOTCOUNT_LIMIT */
 #else
 static inline int bootcount_error(void) { return 0; }
 static inline void bootcount_inc(void) {}
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#11 lore raw

PATCH v4 9/42 spl: bootcount: Move code out of header file

Quoted 9 lines · Simon Glass

It is not good practice to write code in a header file. If it is included multiple times then the code can cause duplicate functions.

Move the bootcount_store() and bootcount_load() functions into SPL.

Note: bootcount is a bit strange in that it uses driver model but does not define proper drivers. This should be fixed.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/ca567884/attachment.sig>
#12 lore raw

PATCH v4 10/42 common: Move bootcount functions to their header file

In reply to Simon Glass

These don't need to be in common.h so move them out.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 board/BuR/brppt1/board.c |  1 +
 include/bootcount.h      | 10 ++++++++++
 include/common.h         |  4 ----
 3 files changed, 11 insertions(+), 4 deletions(-)
board/BuR/brppt1/board.c +1 -0
index ef4f5c9501..e0d1707ac1 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <bootcount.h>
 #include <env.h>
 #include <errno.h>
 #include <spl.h>
include/bootcount.h +10 -0
index a26a385233..cd30403984 100644
@@ -59,6 +59,16 @@ int dm_bootcount_set(struct udevice *dev, u32 bootcount);
 
 #endif
 
+/** bootcount_store() - store the current bootcount */
+void bootcount_store(ulong);
+
+/**
+ * bootcount_load() - load the current bootcount
+ *
+ * @return bootcount, read from the appropriate location
+ */
+ulong bootcount_load(void);
+
 #if defined(CONFIG_SPL_BOOTCOUNT_LIMIT) || defined(CONFIG_BOOTCOUNT_LIMIT)
 
 #if !defined(CONFIG_SYS_BOOTCOUNT_LE) && !defined(CONFIG_SYS_BOOTCOUNT_BE)
include/common.h +0 -4
index 9c454fb1c8..97b661181b 100644
@@ -266,10 +266,6 @@ unsigned long timer_get_us(void);
 void	enable_interrupts  (void);
 int	disable_interrupts (void);
 
-/* $(CPU)/.../commproc.c */
-void	bootcount_store (ulong);
-ulong	bootcount_load (void);
-
 /* $(CPU)/.../<eth> */
 void mii_init (void);
 
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#13 lore raw

PATCH v4 10/42 common: Move bootcount functions to their header file

Quoted 4 lines · Simon Glass

These don't need to be in common.h so move them out.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/0c95804c/attachment.sig>
#14 lore raw

PATCH v4 11/42 common: Move sorting functions to their own header file

In reply to Simon Glass

These don't need to be in common.h so move them out into a new header. Also add some missing comments.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 cmd/efi.c               |  1 +
 common/bootstage.c      |  1 +
 env/common.c            |  1 +
 fs/yaffs2/yaffs_qsort.c |  1 +
 include/common.h        |  5 -----
 include/sort.h          | 34 ++++++++++++++++++++++++++++++++++
 lib/hashtable.c         |  1 +
 lib/qsort.c             |  1 +
 8 files changed, 40 insertions(+), 5 deletions(-)
 create mode 100644 include/sort.h
cmd/efi.c +1 -0
index 919cb2fcfd..ea239a01f0 100644
@@ -9,6 +9,7 @@
 #include <efi.h>
 #include <errno.h>
 #include <malloc.h>
+#include <sort.h>
 
 static const char *const type_name[] = {
 	"reserved",
common/bootstage.c +1 -0
index e8b7bbf81a..79972e46f2 100644
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <malloc.h>
+#include <sort.h>
 #include <spl.h>
 #include <linux/compiler.h>
 #include <linux/libfdt.h>
env/common.c +1 -0
index 0edb6fb04c..1fd1bd01d3 100644
@@ -11,6 +11,7 @@
 #include <command.h>
 #include <env.h>
 #include <env_internal.h>
+#include <sort.h>
 #include <linux/stddef.h>
 #include <search.h>
 #include <errno.h>
fs/yaffs2/yaffs_qsort.c +1 -0
index b463569815..32c767f359 100644
@@ -5,6 +5,7 @@
  */
 
 #include "yportenv.h"
+#include <sort.h>
 /* #include <linux/string.h> */
 
 /*
include/common.h +0 -5
index 97b661181b..d17a2b2642 100644
@@ -304,11 +304,6 @@ ulong	ticks2usec    (unsigned long ticks);
 /* lib/lz4_wrapper.c */
 int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn);
 
-/* lib/qsort.c */
-void qsort(void *base, size_t nmemb, size_t size,
-	   int(*compar)(const void *, const void *));
-int strcmp_compar(const void *, const void *);
-
 /* lib/uuid.c */
 #include <uuid.h>
 
include/sort.h new file +34 -0
new file mode 100644
index 0000000000..0c6b588fcb
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2019 Google LLC
+ */
+
+#ifndef __SORT_H
+#define __SORT_H
+
+/**
+ * qsort() - Use the quicksort algorithm to sort some values
+ *
+ * @base: Base address of array to sort
+ * @nmemb: Number of members to sort
+ * @size: Size of each member in bytes
+ * @compar: Comparison function which should return:
+ *	< 0 if element at s1 < element at s2,
+ *	  0 if element at s1 == element@s2,
+ *	> 0 if element at s1 > element at s2,
+ */
+void qsort(void *base, size_t nmemb, size_t size,
+	   int (*compar)(const void *s1, const void *s2));
+
+/**
+ * strcmp_compar() - compar function for string arrays
+ *
+ * This can be passed to qsort when a string array is being sorted
+ *
+ * @s1: First string to compare
+ * @s2: Second string to compare
+ * @return comparison value (less than, equal to, or greater than 0)
+ */
+int strcmp_compar(const void *s1, const void *s2);
+
+#endif
lib/hashtable.c +1 -0
index 2caab0a4c6..907e8a642f 100644
@@ -14,6 +14,7 @@
 
 #include <errno.h>
 #include <malloc.h>
+#include <sort.h>
 
 #ifdef USE_HOSTCC		/* HOST build */
 # include <string.h>
lib/qsort.c +1 -0
index 57098841f9..f63d4ef726 100644
@@ -18,6 +18,7 @@
 #include <linux/types.h>
 #include <common.h>
 #include <exports.h>
+#include <sort.h>
 
 void qsort(void  *base,
 	   size_t nel,
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#15 lore raw

PATCH v4 12/42 Move strtomhz() to vsprintf.h

In reply to Simon Glass

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.

---

Changes in v4: None
Changes in v3:
- Put copyright info into vsprintf.c

Changes in v2: None

 arch/arc/lib/cpu.c                            |  1 +
 arch/arm/cpu/arm926ejs/mx25/generic.c         |  1 +
 arch/arm/cpu/arm926ejs/mx27/generic.c         |  1 +
 arch/arm/cpu/armv7/ls102xa/cpu.c              |  1 +
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c       |  1 +
 arch/arm/mach-at91/arm926ejs/cpu.c            |  1 +
 arch/arm/mach-at91/armv7/cpu.c                |  1 +
 arch/m68k/cpu/mcf5227x/cpu.c                  |  1 +
 arch/m68k/cpu/mcf523x/cpu.c                   |  1 +
 arch/m68k/cpu/mcf52x2/cpu.c                   |  1 +
 arch/m68k/cpu/mcf530x/cpu.c                   |  1 +
 arch/m68k/cpu/mcf532x/cpu.c                   |  1 +
 arch/m68k/cpu/mcf5445x/cpu.c                  |  1 +
 arch/m68k/cpu/mcf547x_8x/cpu.c                |  1 +
 arch/powerpc/cpu/mpc83xx/cpu.c                |  1 +
 arch/powerpc/cpu/mpc83xx/spd_sdram.c          |  1 +
 arch/powerpc/cpu/mpc83xx/speed.c              |  1 +
 arch/powerpc/cpu/mpc85xx/cpu.c                |  1 +
 arch/powerpc/cpu/mpc86xx/cpu.c                |  1 +
 arch/powerpc/cpu/mpc8xx/cpu.c                 |  1 +
 arch/xtensa/cpu/cpu.c                         |  1 +
 board/Arcturus/ucp1020/ddr.c                  |  1 +
 board/atmel/at91sam9261ek/at91sam9261ek.c     |  1 +
 board/atmel/at91sam9263ek/at91sam9263ek.c     |  1 +
 .../atmel/at91sam9m10g45ek/at91sam9m10g45ek.c |  1 +
 board/atmel/at91sam9n12ek/at91sam9n12ek.c     |  1 +
 board/atmel/at91sam9rlek/at91sam9rlek.c       |  1 +
 board/atmel/common/video_display.c            |  1 +
 board/esd/meesc/meesc.c                       |  1 +
 board/freescale/bsc9131rdb/ddr.c              |  1 +
 board/freescale/bsc9132qds/ddr.c              |  1 +
 board/freescale/corenet_ds/ddr.c              |  1 +
 board/freescale/ls1043ardb/ddr.c              |  1 +
 board/freescale/mpc8541cds/mpc8541cds.c       |  1 +
 board/freescale/mpc8548cds/mpc8548cds.c       |  1 +
 board/freescale/mpc8555cds/mpc8555cds.c       |  1 +
 board/freescale/p1010rdb/ddr.c                |  1 +
 board/freescale/p1_p2_rdb_pc/ddr.c            |  1 +
 board/freescale/p1_twr/ddr.c                  |  1 +
 board/mini-box/picosam9g45/picosam9g45.c      |  1 +
 board/ronetix/pm9261/pm9261.c                 |  1 +
 cmd/bdinfo.c                                  |  1 +
 drivers/clk/clk_stm32mp1.c                    |  1 +
 drivers/clk/mpc83xx_clk.c                     |  1 +
 drivers/cpu/mpc83xx_cpu.c                     |  1 +
 include/common.h                              |  3 ---
 include/vsprintf.h                            | 10 +++++++++
 lib/Makefile                                  |  4 ++--
 lib/strmhz.c                                  | 21 -------------------
 lib/vsprintf.c                                | 19 +++++++++++++++++
 50 files changed, 76 insertions(+), 26 deletions(-)
 delete mode 100644 lib/strmhz.c
arch/arc/lib/cpu.c +1 -0
index 01cca95d5b..83246550ec 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <malloc.h>
+#include <vsprintf.h>
 #include <asm/arcregs.h>
 #include <asm/cache.h>
 
arch/arm/cpu/arm926ejs/mx25/generic.c +1 -0
index 5fcf06ae1a..eeb61d0d10 100644
@@ -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>
arch/arm/cpu/arm926ejs/mx27/generic.c +1 -0
index 08b1b4de71..9bed0e91be 100644
@@ -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>
arch/arm/cpu/armv7/ls102xa/cpu.c +1 -0
index 9ccfe1042c..ec9984db79 100644
@@ -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>
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +1 -0
index 83a3319321..59d03b167c 100644
@@ -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>
arch/arm/mach-at91/arm926ejs/cpu.c +1 -0
index 6f5aa4274b..e9b4e06595 100644
@@ -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>
arch/arm/mach-at91/armv7/cpu.c +1 -0
index 5da067cda1..638645c7e4 100644
@@ -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>
arch/m68k/cpu/mcf5227x/cpu.c +1 -0
index 7ad023dac5..34534d876b 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
 
arch/m68k/cpu/mcf523x/cpu.c +1 -0
index 79be04f7a0..429781945b 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
 #include <netdev.h>
arch/m68k/cpu/mcf52x2/cpu.c +1 -0
index 29a17c57fc..b48a753f9b 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
 #include <asm/immap.h>
arch/m68k/cpu/mcf530x/cpu.c +1 -0
index c7ae65afce..a76deebc68 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
arch/m68k/cpu/mcf532x/cpu.c +1 -0
index a01b5e65a7..c8a1f20530 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
 #include <netdev.h>
arch/m68k/cpu/mcf5445x/cpu.c +1 -0
index 56e5585e09..2f79380c8b 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
 #include <netdev.h>
arch/m68k/cpu/mcf547x_8x/cpu.c +1 -0
index 819b25f280..dc5ed1aa79 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
 #include <netdev.h>
arch/powerpc/cpu/mpc83xx/cpu.c +1 -0
index 3048ecf34a..363c0ffd28 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
 #include <mpc83xx.h>
arch/powerpc/cpu/mpc83xx/spd_sdram.c +1 -0
index 8b5ecdb9ad..08918a9d75 100644
@@ -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>
arch/powerpc/cpu/mpc83xx/speed.c +1 -0
index e118a10fa8..93af7f495f 100644
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <mpc83xx.h>
 #include <command.h>
+#include <vsprintf.h>
 #include <asm/processor.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/powerpc/cpu/mpc85xx/cpu.c +1 -0
index 5344b175a4..64024612cd 100644
@@ -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>
arch/powerpc/cpu/mpc86xx/cpu.c +1 -0
index c023d0684f..1c3c78217c 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
 #include <asm/cache.h>
arch/powerpc/cpu/mpc8xx/cpu.c +1 -0
index 798eabdc21..6ad86e9a1d 100644
@@ -17,6 +17,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
 #include <mpc8xx.h>
arch/xtensa/cpu/cpu.c +1 -0
index 64bb0b6ee0..6f4b88f88e 100644
@@ -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>
board/Arcturus/ucp1020/ddr.c +1 -0
index 4b84a1a4c0..a3285ebe5c 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
 #include <asm/processor.h>
board/atmel/at91sam9261ek/at91sam9261ek.c +1 -0
index 6f15bc6776..28765315f7 100644
@@ -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>
board/atmel/at91sam9263ek/at91sam9263ek.c +1 -0
index 2d882174de..31bb72c0cd 100644
@@ -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>
board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c +1 -0
index 3b277fc575..85004310b1 100644
@@ -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>
board/atmel/at91sam9n12ek/at91sam9n12ek.c +1 -0
index b2bb7ec992..51b24e1d59 100644
@@ -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>
board/atmel/at91sam9rlek/at91sam9rlek.c +1 -0
index 0393307315..4e674d49b3 100644
@@ -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>
board/atmel/common/video_display.c +1 -0
index cc051d2e0c..5cc52139a7 100644
@@ -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>
 
board/esd/meesc/meesc.c +1 -0
index b0d2f7b6f8..221048a91f 100644
@@ -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>
board/freescale/bsc9131rdb/ddr.c +1 -0
index f9f8d80213..4b6d91df21 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
 #include <asm/processor.h>
board/freescale/bsc9132qds/ddr.c +1 -0
index 191ef01d23..f4effe5a2d 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
 #include <asm/processor.h>
board/freescale/corenet_ds/ddr.c +1 -0
index 38f13ce4b2..9c8731ce78 100644
@@ -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>
board/freescale/ls1043ardb/ddr.c +1 -0
index 784e482f32..2677b7928f 100644
@@ -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
board/freescale/mpc8541cds/mpc8541cds.c +1 -0
index 779c99c268..be79a7ca7b 100644
@@ -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>
board/freescale/mpc8548cds/mpc8548cds.c +1 -0
index 2799b5b5a4..28f8a998ce 100644
@@ -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>
board/freescale/mpc8555cds/mpc8555cds.c +1 -0
index 6cfb8d5191..bc1ebc51ed 100644
@@ -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>
board/freescale/p1010rdb/ddr.c +1 -0
index 01e3eafd12..71f6259b60 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
 #include <asm/processor.h>
board/freescale/p1_p2_rdb_pc/ddr.c +1 -0
index b9bd7b5276..2346f6a0c2 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
 #include <asm/processor.h>
board/freescale/p1_twr/ddr.c +1 -0
index 7e8bd6b8c2..85f1f6344a 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
 #include <asm/processor.h>
board/mini-box/picosam9g45/picosam9g45.c +1 -0
index 9554fefd4e..9a724040b0 100644
@@ -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>
board/ronetix/pm9261/pm9261.c +1 -0
index f1e7aab629..bad673412a 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <vsprintf.h>
 #include <linux/sizes.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
cmd/bdinfo.c +1 -0
index ae6006f85f..abd9151432 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <vsprintf.h>
 #include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
drivers/clk/clk_stm32mp1.c +1 -0
index e87307fa60..e223f84eac 100644
@@ -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>
drivers/clk/mpc83xx_clk.c +1 -0
index 32d2db9eda..cbccda5594 100644
@@ -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>
drivers/cpu/mpc83xx_cpu.c +1 -0
index 7bc86bf9b2..1e58457742 100644
@@ -9,6 +9,7 @@
 #include <clk.h>
 #include <cpu.h>
 #include <dm.h>
+#include <vsprintf.h>
 
 #include "mpc83xx_cpu.h"
 
include/common.h +0 -3
index d17a2b2642..f993e4bef3 100644
@@ -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)
  */
include/vsprintf.h +10 -0
index d1740a378e..56844dd2de 100644
@@ -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
lib/Makefile +2 -2
index d248d8626c..e15a189f65 100644
@@ -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
lib/strmhz.c deleted +0 -21
deleted file mode 100644
index 66afe91ab9..0000000000
@@ -1,21 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2002-2006
- * Wolfgang Denk, DENX Software Engineering, wd at 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);
-}
lib/vsprintf.c +19 -0
index 425f2f53f7..c6467ecd5f 100644
@@ -2,6 +2,8 @@
  *  linux/lib/vsprintf.c
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd at 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;
+}
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#16 lore raw

PATCH v4 12/42 Move strtomhz() to vsprintf.h

Quoted 7 lines · Simon Glass

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.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/740642a8/attachment.sig>
#17 lore raw

PATCH v4 13/42 common: Move env_get_ip() to net.h

In reply to Simon Glass

This function relates to networking, so move it out of the common.h header file.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/common.h |  4 ----
 include/net.h    | 21 ++++++++++++++++++++-
 2 files changed, 20 insertions(+), 5 deletions(-)
include/common.h +0 -4
index f993e4bef3..4fda40cc1d 100644
@@ -319,10 +319,6 @@ int	serial_printf (const char *fmt, ...)
 
 /* lib/net_utils.c */
 #include <net.h>
-static inline struct in_addr env_get_ip(char *var)
-{
-	return string_to_ip(env_get(var));
-}
 
 #include <bootstage.h>
 
include/net.h +20 -1
index d8d187d8af..11eca1bc6c 100644
@@ -829,7 +829,13 @@ static inline void net_random_ethaddr(uchar *addr)
 /* Convert an IP address to a string */
 void ip_to_string(struct in_addr x, char *s);
 
-/* Convert a string to ip address */
+/**
+ * string_to_ip() - Convert a string to ip address
+ *
+ * @s: String to conver, in the format format a.b.c.d, where each value is a
+ *	decimal number from 0 to 255
+ * @return IP address, or 0 if invalid
+ */
 struct in_addr string_to_ip(const char *s);
 
 /* Convert a VLAN id to a string */
@@ -887,4 +893,17 @@ int update_tftp(ulong addr, char *interface, char *devstring);
  */
 void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr);
 
+/**
+ * env_get_ip() - Convert an environment value to to an ip address
+ *
+ * @var: Environment variable to convert. The value of this variable must be
+ *	in the format format a.b.c.d, where each value is a decimal number from
+ *	0 to 255
+ * @return IP address, or 0 if invalid
+ */
+static inline struct in_addr env_get_ip(char *var)
+{
+	return string_to_ip(env_get(var));
+}
+
 #endif /* __NET_H__ */
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#18 lore raw

PATCH v4 13/42 common: Move env_get_ip() to net.h

Quoted 6 lines · Simon Glass

This function relates to networking, so move it out of the common.h header file.

Nit below, but...

Quoted 31 lines

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/common.h |  4 ----
 include/net.h    | 21 ++++++++++++++++++++-
 2 files changed, 20 insertions(+), 5 deletions(-)
include/common.h +0 -4
index f993e4bef3..4fda40cc1d 100644
@@ -319,10 +319,6 @@ int        serial_printf (const char *fmt, ...)
 
 /* lib/net_utils.c */
 #include <net.h>
-static inline struct in_addr env_get_ip(char *var)
-{
-       return string_to_ip(env_get(var));
-}
 
 #include <bootstage.h>
 
include/net.h +0 -0
index d8d187d8af..11eca1bc6c 100644
@@ -829,7 +829,13 @@ static inline void net_random_ethaddr(uchar *addr)
 /* Convert an IP address to a string */

include/net.h static inline void net_random_ethaddr(uchar *addr) · line 838

Quoted 10 lines
include/net.h +7 -1
 void ip_to_string(struct in_addr x, char *s);
 
-/* Convert a string to ip address */
+/**
+ * string_to_ip() - Convert a string to ip address
+ *
+ * @s: String to conver, in the format format a.b.c.d, where each value is a
+ *     decimal number from 0 to 255
+ * @return IP address, or 0 if invalid
+ */

Please drop this unrelated documentation update... it conflicts with [1]

[1] - https://patchwork.ozlabs.org/patch/1162279/

Quoted 28 lines
include/net.h +13 -1
 struct in_addr string_to_ip(const char *s);
 
 /* Convert a VLAN id to a string */
@@ -887,4 +893,17 @@ int update_tftp(ulong addr, char *interface, char *devstring);
  */
 void eth_parse_enetaddr(const char *addr, uint8_t *enetaddr);
 
+/**
+ * env_get_ip() - Convert an environment value to to an ip address
+ *
+ * @var: Environment variable to convert. The value of this variable must be
+ *     in the format format a.b.c.d, where each value is a decimal number from
+ *     0 to 255
+ * @return IP address, or 0 if invalid
+ */
+static inline struct in_addr env_get_ip(char *var)
+{
+       return string_to_ip(env_get(var));
+}
+
 #endif /* __NET_H__ */
--

2.24.0.rc1.363.gb1bccd3e3d-goog

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#19 lore raw

PATCH v4 14/42 serial: usb: Correct the usbtty_...() prototypes

In reply to Simon Glass

The function declarations in serial.h are not in sync with what is currently used in usbtty. Fix this by updating the header and including it, to help catch future such problems.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/serial/usbtty.c |  1 +
 include/serial.h        | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)
drivers/serial/usbtty.c +1 -0
index 76d9c8a3a6..f1c1a260da 100644
@@ -11,6 +11,7 @@
 #include <config.h>
 #include <circbuf.h>
 #include <env.h>
+#include <serial.h>
 #include <stdio_dev.h>
 #include <asm/unaligned.h>
 #include "usbtty.h"
include/serial.h +10 -8
index c1368c68b6..38a1cc99ae 100644
@@ -50,18 +50,20 @@ extern void serial_reinit_all(void);
 /* For usbtty */
 #ifdef CONFIG_USB_TTY
 
-extern int usbtty_getc(void);
-extern void usbtty_putc(const char c);
-extern void usbtty_puts(const char *str);
-extern int usbtty_tstc(void);
+struct stdio_dev;
+
+int usbtty_getc(struct stdio_dev *dev);
+void usbtty_putc(struct stdio_dev *dev, const char c);
+void usbtty_puts(struct stdio_dev *dev, const char *str);
+int usbtty_tstc(struct stdio_dev *dev);
 
 #else
 
 /* stubs */
-#define usbtty_getc() 0
-#define usbtty_putc(a)
-#define usbtty_puts(a)
-#define usbtty_tstc() 0
+#define usbtty_getc(dev) 0
+#define usbtty_putc(dev, a)
+#define usbtty_puts(dev, a)
+#define usbtty_tstc(dev) 0
 
 #endif /* CONFIG_USB_TTY */
 
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#20 lore raw

PATCH v4 15/42 common: Move serial_printf() to the serial header

In reply to Simon Glass

Move this function header to serial.h since this function is clearly related to serial. The function itself stays in console.c since we don't have a single serial file. DM and non-DM each has a separate file so we would have to either create a new common serial file, or repeat the function in both serial.c and serial-uclass.c, neither of which seem worthwhile.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/usb/gadget/core.c           |  1 +
 drivers/usb/gadget/designware_udc.c |  1 +
 drivers/usb/gadget/ep0.c            |  3 ++-
 drivers/usb/musb-new/omap2430.c     |  1 +
 drivers/usb/musb/musb_udc.c         |  1 +
 drivers/usb/musb/omap3.c            |  1 +
 include/common.h                    |  7 -------
 include/serial.h                    | 11 +++++++++++
 8 files changed, 18 insertions(+), 8 deletions(-)
drivers/usb/gadget/core.c +1 -0
index ffaf161fb7..7e1e51db96 100644
@@ -16,6 +16,7 @@
  */
 
 #include <malloc.h>
+#include <serial.h>
 #include <usbdevice.h>
 
 #define MAX_INTERFACES 2
drivers/usb/gadget/designware_udc.c +1 -0
index 432f312cee..70c5c678c3 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <serial.h>
 #include <asm/io.h>
 
 #include <env.h>
drivers/usb/gadget/ep0.c +2 -1
index a36d9ec03d..6fabee24ce 100644
@@ -37,6 +37,7 @@
  */
 
 #include <common.h>
+#include <serial.h>
 #include <usbdevice.h>
 
 #if 0
@@ -581,7 +582,7 @@ int ep0_recv_setup (struct urb *urb)
 			device->interface = le16_to_cpu (request->wIndex);
 			device->alternate = le16_to_cpu (request->wValue);
 			/*dbg_ep0(2, "set interface: %d alternate: %d", device->interface, device->alternate); */
-			serial_printf ("DEVICE_SET_INTERFACE.. event?\n");
+			serial_printf("DEVICE_SET_INTERFACE.. event?\n");
 			return 0;
 
 		case USB_REQ_GET_STATUS:
drivers/usb/musb-new/omap2430.c +1 -0
index cca1653f1e..05059ce3cb 100644
@@ -10,6 +10,7 @@
  */
 #include <common.h>
 #include <dm.h>
+#include <serial.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
 #include <linux/usb/otg.h>
drivers/usb/musb/musb_udc.c +1 -0
index 7620114bec..584564bac2 100644
@@ -38,6 +38,7 @@
  */
 
 #include <common.h>
+#include <serial.h>
 #include <usbdevice.h>
 #include <usb/udc.h>
 #include "../gadget/ep0.h"
drivers/usb/musb/omap3.c +1 -0
index b2e4c32baf..080bd78523 100644
@@ -16,6 +16,7 @@
  * ------------------------------------------------------------------------
  */
 
+#include <serial.h>
 #include <asm/omap_common.h>
 #include <twl4030.h>
 #include <twl6030.h>
include/common.h +0 -7
index 4fda40cc1d..f97a7b6e14 100644
@@ -310,13 +310,6 @@ int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn);
 /* lib/vsprintf.c */
 #include <vsprintf.h>
 
-/*
- * STDIO based functions (can always be used)
- */
-/* serial stuff */
-int	serial_printf (const char *fmt, ...)
-		__attribute__ ((format (__printf__, 1, 2)));
-
 /* lib/net_utils.c */
 #include <net.h>
 
include/serial.h +11 -0
index 38a1cc99ae..8d1803c800 100644
@@ -324,4 +324,15 @@ void pl01x_serial_initialize(void);
 void pxa_serial_initialize(void);
 void sh_serial_initialize(void);
 
+/**
+ * serial_printf() - Write a formatted string to the serial console
+ *
+ * The total size of the output must be less than CONFIG_SYS_PBSIZE.
+ *
+ * @fmt: Printf format string, followed by format arguments
+ * @return number of characters written
+ */
+int serial_printf(const char *fmt, ...)
+		__attribute__ ((format (__printf__, 1, 2)));
+
 #endif
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#21 lore raw

PATCH v4 16/42 common: Move serial functions out of common.h

In reply to Simon Glass

These functions belong in serial.h so move them over.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm926ejs/mxs/spl_boot.c      | 1 +
 board/amarula/vyasa-rk3288/vyasa-rk3288.c  | 1 +
 board/astro/mcf5373l/mcf5373l.c            | 1 +
 board/birdland/bav335x/board.c             | 1 +
 board/bticino/mamoj/spl.c                  | 1 +
 board/cssi/MCR3000/MCR3000.c               | 1 +
 board/engicam/common/spl.c                 | 1 +
 board/esd/meesc/meesc.c                    | 1 +
 board/gumstix/pepper/board.c               | 1 +
 board/isee/igep003x/board.c                | 1 +
 board/isee/igep00x0/spl.c                  | 1 +
 board/liebherr/display5/spl.c              | 1 +
 board/liebherr/mccmon6/mccmon6.c           | 1 +
 board/liebherr/mccmon6/spl.c               | 1 +
 board/logicpd/am3517evm/am3517evm.c        | 1 +
 board/logicpd/imx6/imx6logic.c             | 1 +
 board/logicpd/omap3som/omap3logic.c        | 1 +
 board/overo/common.c                       | 1 +
 board/siemens/common/board.c               | 1 +
 board/silica/pengwyn/board.c               | 1 +
 board/st/stm32f746-disco/stm32f746-disco.c | 1 +
 board/tcl/sl50/board.c                     | 1 +
 board/ti/am57xx/board.c                    | 1 +
 board/ti/beagle/beagle.c                   | 1 +
 board/ti/dra7xx/evm.c                      | 1 +
 board/ti/evm/evm.c                         | 1 +
 board/vscom/baltos/board.c                 | 1 +
 cmd/load.c                                 | 1 +
 common/board_f.c                           | 1 +
 common/kgdb_stubs.c                        | 1 +
 common/lcd_console.c                       | 1 +
 common/spl/spl.c                           | 1 +
 include/common.h                           | 9 ---------
 include/serial.h                           | 8 ++++++++
 34 files changed, 40 insertions(+), 9 deletions(-)
arch/arm/cpu/arm926ejs/mxs/spl_boot.c +1 -0
index cb361ac65c..5b3b51ce15 100644
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <serial.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
board/amarula/vyasa-rk3288/vyasa-rk3288.c +1 -0
index baf197c485..92e0698c53 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <serial.h>
 
 #ifndef CONFIG_TPL_BUILD
 
board/astro/mcf5373l/mcf5373l.c +1 -0
index 759ff49562..db157a83c8 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <serial.h>
 #include <watchdog.h>
 #include <command.h>
 #include <asm/m5329.h>
board/birdland/bav335x/board.c +1 -0
index 8811583ac6..1f3f44a867 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <env.h>
 #include <errno.h>
+#include <serial.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
board/bticino/mamoj/spl.c +1 -0
index c53bdce0ce..620e4d1de0 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <serial.h>
 #include <spl.h>
 
 #include <asm/io.h>
board/cssi/MCR3000/MCR3000.c +1 -0
index 445b84c180..dcd2c1c975 100644
@@ -12,6 +12,7 @@
 #include <hwconfig.h>
 #include <mpc8xx.h>
 #include <fdt_support.h>
+#include <serial.h>
 #include <asm/io.h>
 #include <dm/uclass.h>
 #include <wdt.h>
board/engicam/common/spl.c +1 -0
index 4d293c8032..a9820a9028 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <serial.h>
 #include <spl.h>
 
 #include <asm/io.h>
board/esd/meesc/meesc.c +1 -0
index 221048a91f..4271b0db19 100644
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <serial.h>
 #include <vsprintf.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
board/gumstix/pepper/board.c +1 -0
index f5beb8c940..65e5e1e60f 100644
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <env.h>
 #include <errno.h>
+#include <serial.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
board/isee/igep003x/board.c +1 -0
index a8c2b121a4..d59121296e 100644
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <env.h>
 #include <errno.h>
+#include <serial.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
board/isee/igep00x0/spl.c +1 -0
index e092e1a418..f814fe1354 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 
+#include <serial.h>
 #include <asm/io.h>
 #include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
board/liebherr/display5/spl.c +1 -0
index 311edaf939..e845edf068 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <serial.h>
 #include <spl.h>
 #include <linux/libfdt.h>
 #include <asm/io.h>
board/liebherr/mccmon6/mccmon6.c +1 -0
index 6a5fbbb8e6..c7af73ff71 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <serial.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux.h>
 #include <asm/arch/imx-regs.h>
board/liebherr/mccmon6/spl.c +1 -0
index fc5f5e948c..08d2b56d54 100644
@@ -18,6 +18,7 @@
 #include <asm/arch/crm_regs.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
+#include <serial.h>
 #include <spl.h>
 
 #include <asm/arch/mx6-ddr.h>
board/logicpd/am3517evm/am3517evm.c +1 -0
index 95c4cfc75d..18f3c3f9d9 100644
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <dm.h>
 #include <ns16550.h>
+#include <serial.h>
 #include <asm/io.h>
 #include <asm/omap_musb.h>
 #include <asm/arch/am35x_def.h>
board/logicpd/imx6/imx6logic.c +1 -0
index 3c1a3a9fa2..0ea24c0870 100644
@@ -14,6 +14,7 @@
 #include <input.h>
 #include <mmc.h>
 #include <fsl_esdhc_imx.h>
+#include <serial.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <linux/sizes.h>
board/logicpd/omap3som/omap3logic.c +1 -0
index 43f049e592..2f93248391 100644
@@ -17,6 +17,7 @@
 #include <flash.h>
 #include <nand.h>
 #include <i2c.h>
+#include <serial.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mmc_host_def.h>
board/overo/common.c +1 -0
index 2c4f412e5d..67823e68b6 100644
@@ -11,6 +11,7 @@
  * (C) Copyright 2004-2008
  * Texas Instruments, <www.ti.com>
  */
+#include <serial.h>
 #include <twl4030.h>
 #include <common.h>
 #include <asm/io.h>
board/siemens/common/board.c +1 -0
index 75462d1c34..5f5e2eb544 100644
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <env.h>
 #include <errno.h>
+#include <serial.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
board/silica/pengwyn/board.c +1 -0
index 345701fd52..c0496c549a 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <serial.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/ddr_defs.h>
board/st/stm32f746-disco/stm32f746-disco.c +1 -0
index e89ed2153b..5be60af18c 100644
@@ -10,6 +10,7 @@
 #include <miiphy.h>
 #include <phy_interface.h>
 #include <ram.h>
+#include <serial.h>
 #include <spl.h>
 #include <splash.h>
 #include <st_logo_data.h>
board/tcl/sl50/board.c +1 -0
index c7eed31946..a958827507 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <env.h>
 #include <errno.h>
+#include <serial.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
board/ti/am57xx/board.c +1 -0
index 237a834c53..8d1f38971c 100644
@@ -11,6 +11,7 @@
 #include <env.h>
 #include <palmas.h>
 #include <sata.h>
+#include <serial.h>
 #include <usb.h>
 #include <asm/omap_common.h>
 #include <asm/omap_sec_common.h>
board/ti/beagle/beagle.c +1 -0
index 0138fc91fc..12e657c9c6 100644
@@ -16,6 +16,7 @@
 #include <dm.h>
 #include <env.h>
 #include <ns16550.h>
+#include <serial.h>
 #ifdef CONFIG_LED_STATUS
 #include <status_led.h>
 #endif
board/ti/dra7xx/evm.c +1 -0
index 74d04bb1e3..ea8523541f 100644
@@ -13,6 +13,7 @@
 #include <env.h>
 #include <palmas.h>
 #include <sata.h>
+#include <serial.h>
 #include <linux/string.h>
 #include <asm/gpio.h>
 #include <usb.h>
board/ti/evm/evm.c +1 -0
index d0b9bafbd1..d26dd5ba84 100644
@@ -15,6 +15,7 @@
 #include <env.h>
 #include <ns16550.h>
 #include <netdev.h>
+#include <serial.h>
 #include <asm/io.h>
 #include <asm/arch/mem.h>
 #include <asm/arch/mux.h>
board/vscom/baltos/board.c +1 -0
index 1ba58d0f11..588f6db172 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <env.h>
 #include <errno.h>
+#include <serial.h>
 #include <linux/libfdt.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
cmd/load.c +1 -0
index 713fe56b55..5811a99310 100644
@@ -14,6 +14,7 @@
 #include <s_record.h>
 #include <net.h>
 #include <exports.h>
+#include <serial.h>
 #include <xyzModem.h>
 
 DECLARE_GLOBAL_DATA_PTR;
common/board_f.c +1 -0
index e3591cbaeb..01044452bf 100644
@@ -26,6 +26,7 @@
 #include <os.h>
 #include <post.h>
 #include <relocate.h>
+#include <serial.h>
 #ifdef CONFIG_SPL
 #include <spl.h>
 #endif
common/kgdb_stubs.c +1 -0
index 5278209909..afa7d6403a 100644
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <kgdb.h>
+#include <serial.h>
 
 int (*debugger_exception_handler)(struct pt_regs *);
 
common/lcd_console.c +1 -0
index 7d1f883013..d34bc2fa83 100644
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <lcd.h>
+#include <serial.h>
 #include <video_font.h>		/* Get font data, width and height */
 #if defined(CONFIG_LCD_LOGO)
 #include <bmp_logo.h>
common/spl/spl.c +1 -0
index a2ef13a41c..82fd54c984 100644
@@ -11,6 +11,7 @@
 #include <binman_sym.h>
 #include <dm.h>
 #include <handoff.h>
+#include <serial.h>
 #include <spl.h>
 #include <asm/u-boot.h>
 #include <nand.h>
include/common.h +0 -9
index f97a7b6e14..f433db17ae 100644
@@ -238,15 +238,6 @@ void ft_pci_setup(void *blob, bd_t *bd);
 void smp_set_core_boot_addr(unsigned long addr, int corenr);
 void smp_kick_all_cpus(void);
 
-/* $(CPU)/serial.c */
-int	serial_init   (void);
-void	serial_setbrg (void);
-void	serial_putc   (const char);
-void	serial_putc_raw(const char);
-void	serial_puts   (const char *);
-int	serial_getc   (void);
-int	serial_tstc   (void);
-
 /* $(CPU)/speed.c */
 int	get_clocks (void);
 ulong	get_bus_freq  (ulong);
include/serial.h +8 -0
index 8d1803c800..104f34ff91 100644
@@ -335,4 +335,12 @@ void sh_serial_initialize(void);
 int serial_printf(const char *fmt, ...)
 		__attribute__ ((format (__printf__, 1, 2)));
 
+int serial_init(void);
+void serial_setbrg(void);
+void serial_putc(const char ch);
+void serial_putc_raw(const char ch);
+void serial_puts(const char *str);
+int serial_getc(void);
+int serial_tstc(void);
+
 #endif
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#22 lore raw

PATCH v4 17/42 common: Add a new lz4.h header file

In reply to Simon Glass

Add a header file to house the lz4 compression function. Add a comment while we are here, since it not even clear from the name what the function actuall does.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/image.c     |  1 +
 include/common.h   |  3 ---
 include/lz4.h      | 24 ++++++++++++++++++++++++
 lib/lz4_wrapper.c  |  1 +
 test/compression.c |  1 +
 5 files changed, 27 insertions(+), 3 deletions(-)
 create mode 100644 include/lz4.h
common/image.c +1 -0
index 992ebbad51..1c8ac2df70 100644
@@ -20,6 +20,7 @@
 
 #include <gzip.h>
 #include <image.h>
+#include <lz4.h>
 #include <mapmem.h>
 
 #if IMAGE_ENABLE_FIT || IMAGE_ENABLE_OF_LIBFDT
include/common.h +0 -3
index f433db17ae..1e77ed393e 100644
@@ -292,9 +292,6 @@ void	wait_ticks    (unsigned long);
 ulong	usec2ticks    (unsigned long usec);
 ulong	ticks2usec    (unsigned long ticks);
 
-/* lib/lz4_wrapper.c */
-int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn);
-
 /* lib/uuid.c */
 #include <uuid.h>
 
include/lz4.h new file +24 -0
new file mode 100644
index 0000000000..1276fb98a3
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2019 Google LLC
+ */
+
+#ifndef __LZ4_H
+#define __LZ4_H
+
+/**
+ * ulz4fn() - Decompress LZ4 data
+ *
+ * @src: Source data to decompress
+ * @srcn: Length of source data
+ * @dst: Destination for uncompressed data
+ * @dstn: Returns length of uncompressed data
+ * @return 0 if OK, -EPROTONOSUPPORT if the magic number or version number are
+ *	not recognised or independent blocks are used, -EINVAL if the reserved
+ *	fields are non-zero, or input is overrun, -EENOBUFS if the destination
+ *	buffer is overrun, -EEPROTO if the compressed data causes an error in
+ *	the decompression algorithm
+ */
+int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn);
+
+#endif
lib/lz4_wrapper.c +1 -0
index 1c68e67452..1e1e8d5085 100644
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <compiler.h>
 #include <image.h>
+#include <lz4.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 
test/compression.c +1 -0
index 08fef59d0a..48dccc0e89 100644
@@ -7,6 +7,7 @@
 #include <bootm.h>
 #include <command.h>
 #include <gzip.h>
+#include <lz4.h>
 #include <malloc.h>
 #include <mapmem.h>
 #include <asm/io.h>
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#23 lore raw

PATCH v4 18/42 common: Move some time functions out of common.h

In reply to Simon Glass

These functions belong in time.h so move them over and add comments.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/armv7/ls102xa/timer.c            |  1 +
 arch/arm/cpu/armv8/generic_timer.c            |  1 +
 arch/arm/mach-imx/syscounter.c                |  1 +
 arch/arm/mach-imx/timer.c                     |  1 +
 arch/m68k/lib/time.c                          |  1 +
 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |  1 +
 arch/powerpc/cpu/mpc8xxx/srio.c               |  1 +
 arch/powerpc/lib/time.c                       |  1 +
 drivers/crypto/fsl/jr.c                       |  1 +
 drivers/i2c/fsl_i2c.c                         |  1 +
 include/common.h                              |  4 ----
 include/time.h                                | 16 ++++++++++++++++
 12 files changed, 26 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/ls102xa/timer.c +1 -0
index e79360ada8..a5f4e31ac7 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/immap_ls102xa.h>
arch/arm/cpu/armv8/generic_timer.c +1 -0
index c1706dcec1..46e63294fe 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <time.h>
 #include <asm/system.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/mach-imx/syscounter.c +1 -0
index c888a93938..5a292c3964 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/imx-regs.h>
arch/arm/mach-imx/timer.c +1 -0
index ed5eb1c8a7..5fe5c51f6a 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/imx-regs.h>
arch/m68k/lib/time.c +1 -0
index a6345a0bc9..c76c5fedc9 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 
 #include <asm/timer.h>
 #include <asm/immap.h>
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c +1 -0
index fcfa730233..ebdcd29c13 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <time.h>
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
 #include <hwconfig.h>
 #endif
arch/powerpc/cpu/mpc8xxx/srio.c +1 -0
index ea7dac6e66..a1f9403559 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <time.h>
 #include <asm/fsl_law.h>
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_srio.h>
arch/powerpc/lib/time.c +1 -0
index a22a73abfa..e1494fa129 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 
 /* ------------------------------------------------------------------------- */
drivers/crypto/fsl/jr.c +1 -0
index 3121762364..1ea9db6850 100644
@@ -11,6 +11,7 @@
 #include "jr.h"
 #include "jobdesc.h"
 #include "desc_constr.h"
+#include <time.h>
 #ifdef CONFIG_FSL_CORENET
 #include <asm/fsl_pamu.h>
 #endif
drivers/i2c/fsl_i2c.c +1 -0
index bf8d52d5ad..bbbd6ef5bf 100644
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <command.h>
 #include <i2c.h>		/* Functional interface */
+#include <time.h>
 #include <asm/io.h>
 #include <asm/fsl_i2c.h>	/* HW definitions */
 #include <clk.h>
include/common.h +0 -4
index 1e77ed393e..20d143deb8 100644
@@ -288,10 +288,6 @@ int cleanup_before_linux_select(int flags);
 uint64_t get_ticks(void);
 void	wait_ticks    (unsigned long);
 
-/* arch/$(ARCH)/lib/time.c */
-ulong	usec2ticks    (unsigned long usec);
-ulong	ticks2usec    (unsigned long ticks);
-
 /* lib/uuid.c */
 #include <uuid.h>
 
include/time.h +16 -0
index a1149522ed..a1bdefc164 100644
@@ -70,4 +70,20 @@ uint64_t usec_to_tick(unsigned long usec);
 	(time_after_eq(a,b) && \
 	 time_before(a,c))
 
+/**
+ * usec2ticks() - Convert microseconds to internal ticks
+ *
+ * @usec: Value of microseconds to convert
+ * @return Corresponding internal ticks value, calculated using get_tbclk()
+ */
+ulong usec2ticks(unsigned long usec);
+
+/**
+ * ticks2usec() - Convert internal ticks to microseconds
+ *
+ * @ticks: Value of ticks to convert
+ * @return Corresponding microseconds value, calculated using get_tbclk()
+ */
+ulong ticks2usec(unsigned long ticks);
+
 #endif /* _TIME_H */
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#24 lore raw

PATCH v4 19/42 common: Move wait_ticks functions out of common.h

In reply to Simon Glass

This function belongs in time.h so move it over and add a comment.

---

Changes in v4: None
Changes in v3:
- Drop include in pxa2xx.c since this is for pxa_wait_ticks()
- Update comment to wait_ticks() to indicate it is an internal function

Changes in v2: None

 drivers/timer/mpc83xx_timer.c |  1 +
 include/common.h              |  1 -
 include/time.h                | 10 ++++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/timer/mpc83xx_timer.c +1 -0
index dfbc8672b2..69949d5333 100644
@@ -9,6 +9,7 @@
 #include <clk.h>
 #include <dm.h>
 #include <status_led.h>
+#include <time.h>
 #include <timer.h>
 #include <watchdog.h>
 
include/common.h +0 -1
index 20d143deb8..091b54787f 100644
@@ -286,7 +286,6 @@ int cleanup_before_linux_select(int flags);
 
 /* arch/$(ARCH)/lib/ticks.S */
 uint64_t get_ticks(void);
-void	wait_ticks    (unsigned long);
 
 /* lib/uuid.c */
 #include <uuid.h>
include/time.h +10 -0
index a1bdefc164..31d386729e 100644
@@ -86,4 +86,14 @@ ulong usec2ticks(unsigned long usec);
  */
 ulong ticks2usec(unsigned long ticks);
 
+/**
+ * wait_ticks() - waits a given number of ticks
+ *
+ * This is an internal function typically used to implement udelay() and
+ * similar. Normally you should use udelay() or mdelay() instead.
+ *
+ * @ticks: Number of ticks to wait
+ */
+void wait_ticks(unsigned long ticks);
+
 #endif /* _TIME_H */
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#25 lore raw

PATCH v4 20/42 arm: pxa: Drop pxa_wait_ticks()

In reply to Simon Glass

This function has a similar name to the common wait_ticks(). It is only used in one place and seems small enough to drop.

Inline it.

---

Changes in v4: None
Changes in v3:
- Add new patch to inline pxa_wait_ticks()

Changes in v2: None

 arch/arm/cpu/pxa/pxa2xx.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
arch/arm/cpu/pxa/pxa2xx.c +4 -8
index 0b28f0a3ef..14fe307c1a 100644
@@ -39,13 +39,6 @@ int cleanup_before_linux(void)
 	return 0;
 }
 
-void pxa_wait_ticks(int ticks)
-{
-	writel(0, OSCR);
-	while (readl(OSCR) < ticks)
-		asm volatile("" : : : "memory");
-}
-
 inline void writelrb(uint32_t val, uint32_t addr)
 {
 	writel(val, addr);
@@ -136,8 +129,11 @@ void pxa2xx_dram_init(void)
 
 	writelrb(CONFIG_SYS_MDCNFG_VAL &
 		~(MDCNFG_DE0 | MDCNFG_DE1 | MDCNFG_DE2 | MDCNFG_DE3), MDCNFG);
+
 	/* Wait for the clock to the SDRAMs to stabilize, 100..200 usec. */
-	pxa_wait_ticks(0x300);
+	writel(0, OSCR);
+	while (readl(OSCR) < 0x300)
+		asm volatile("" : : : "memory");
 
 	/*
 	 * 8) Trigger a number (usually 8) refresh cycles by attempting
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#26 lore raw

PATCH v4 21/42 common: Move timer_get_us() function out of common.h

In reply to Simon Glass

This function belongs in time.h so move it over and update the comment style.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/common.h | 3 ---
 include/time.h   | 7 +++++++
 2 files changed, 7 insertions(+), 3 deletions(-)
include/common.h +0 -3
index 091b54787f..e68bed6407 100644
@@ -251,9 +251,6 @@ void	irq_install_handler(int, interrupt_handler_t *, void *);
 void	irq_free_handler   (int);
 void	reset_timer	   (void);
 
-/* Return value of monotonic microsecond timer */
-unsigned long timer_get_us(void);
-
 void	enable_interrupts  (void);
 int	disable_interrupts (void);
 
include/time.h +7 -0
index 31d386729e..875a2b293e 100644
@@ -96,4 +96,11 @@ ulong ticks2usec(unsigned long ticks);
  */
 void wait_ticks(unsigned long ticks);
 
+/**
+ * timer_get_us() - Get monotonic microsecond timer
+ *
+ * @return value of monotonic microsecond timer
+ */
+unsigned long timer_get_us(void);
+
 #endif /* _TIME_H */
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#27 lore raw

PATCH v4 22/42 common: Move get_ticks() function out of common.h

In reply to Simon Glass

This function belongs in time.h so move it over and add a comment.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm920t/ep93xx/timer.c        |  1 +
 arch/arm/cpu/arm920t/imx/timer.c           |  1 +
 arch/arm/cpu/arm926ejs/armada100/timer.c   |  1 +
 arch/arm/cpu/arm926ejs/lpc32xx/timer.c     |  1 +
 arch/arm/cpu/arm926ejs/mx27/timer.c        |  1 +
 arch/arm/cpu/arm926ejs/mxs/timer.c         |  1 +
 arch/arm/cpu/arm926ejs/spear/timer.c       |  1 +
 arch/arm/cpu/armv7/arch_timer.c            |  1 +
 arch/arm/cpu/armv7/iproc-common/timer.c    |  1 +
 arch/arm/cpu/armv7/s5p-common/timer.c      |  1 +
 arch/arm/cpu/armv7/stv0991/timer.c         |  1 +
 arch/arm/cpu/armv7/sunxi/timer.c           |  1 +
 arch/arm/cpu/armv7/vf610/timer.c           |  1 +
 arch/arm/cpu/armv7m/systick-timer.c        |  1 +
 arch/arm/cpu/sa1100/timer.c                |  1 +
 arch/arm/mach-at91/arm920t/timer.c         |  1 +
 arch/arm/mach-davinci/timer.c              |  1 +
 arch/arm/mach-omap2/timer.c                |  1 +
 arch/arm/mach-orion5x/timer.c              |  1 +
 arch/arm/mach-rmobile/timer.c              |  1 +
 arch/arm/mach-socfpga/clock_manager_gen5.c |  1 +
 arch/arm/mach-sunxi/dram_helpers.c         |  1 +
 arch/arm/mach-sunxi/p2wi.c                 |  1 +
 arch/arm/mach-sunxi/rsb.c                  |  1 +
 arch/arm/mach-tegra/clock.c                |  1 +
 arch/microblaze/cpu/timer.c                |  1 +
 arch/mips/mach-jz47xx/jz4780/timer.c       |  1 +
 arch/nds32/cpu/n1213/ag101/timer.c         |  1 +
 arch/sh/lib/time_sh2.c                     |  1 +
 arch/xtensa/lib/time.c                     |  1 +
 board/armltd/integrator/timer.c            |  1 +
 board/broadcom/bcmstb/bcmstb.c             |  1 +
 board/xilinx/versal/board.c                |  1 +
 common/autoboot.c                          |  1 +
 common/bootretry.c                         |  1 +
 common/cli_readline.c                      |  1 +
 common/iotrace.c                           |  1 +
 drivers/clk/clk_stm32mp1.c                 |  1 +
 drivers/mailbox/mailbox-uclass.c           |  1 +
 drivers/misc/tegra186_bpmp.c               |  1 +
 drivers/mmc/bcm2835_sdhci.c                |  1 +
 drivers/mmc/mxcmmc.c                       |  1 +
 drivers/net/pic32_eth.c                    |  1 +
 drivers/nvme/nvme.c                        |  1 +
 drivers/power/pmic/stpmic1.c               |  1 +
 drivers/sound/broadwell_i2s.c              |  1 +
 drivers/spi/ath79_spi.c                    |  1 +
 drivers/spi/exynos_spi.c                   |  1 +
 drivers/spi/rk_spi.c                       |  1 +
 drivers/spi/tegra114_spi.c                 |  1 +
 drivers/spi/tegra20_sflash.c               |  1 +
 drivers/spi/tegra20_slink.c                |  1 +
 drivers/spi/tegra210_qspi.c                |  1 +
 drivers/spi/uniphier_spi.c                 |  1 +
 drivers/spi/zynq_spi.c                     |  1 +
 drivers/timer/tsc_timer.c                  |  1 +
 drivers/video/sunxi/sunxi_display.c        |  1 +
 drivers/video/sunxi/sunxi_dw_hdmi.c        |  1 +
 include/common.h                           |  7 ++-----
 include/time.h                             | 10 ++++++++++
 lib/efi_loader/efi_boottime.c              |  1 +
 lib/efi_loader/efi_console.c               |  1 +
 lib/time.c                                 |  1 +
 lib/trace.c                                |  1 +
 lib/uuid.c                                 |  1 +
 net/nfs.c                                  |  1 +
 post/post.c                                |  1 +
 test/time_ut.c                             |  1 +
 68 files changed, 78 insertions(+), 5 deletions(-)
arch/arm/cpu/arm920t/ep93xx/timer.c +1 -0
index 49bf49bbd3..4829c996be 100644
@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <linux/types.h>
 #include <asm/arch/ep93xx.h>
 #include <asm/io.h>
arch/arm/cpu/arm920t/imx/timer.c +1 -0
index 96fff3f683..17081ddb6d 100644
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #if defined (CONFIG_IMX)
 
 #include <asm/arch/imx-regs.h>
arch/arm/cpu/arm926ejs/armada100/timer.c +1 -0
index d2ecbd07e2..6c6948a8ef 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/armada100.h>
 
arch/arm/cpu/arm926ejs/lpc32xx/timer.c +1 -0
index b3ca686040..3a896d10ca 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/timer.h>
arch/arm/cpu/arm926ejs/mx27/timer.c +1 -0
index 94b5d454e9..f51f0df8ec 100644
@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 
arch/arm/cpu/arm926ejs/mxs/timer.c +1 -0
index 7492ba46dc..226401dd6e 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
arch/arm/cpu/arm926ejs/spear/timer.c +1 -0
index e7b5bda1bc..28c09e9fd6 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_gpt.h>
arch/arm/cpu/armv7/arch_timer.c +1 -0
index 5de63053d5..2eb571050a 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <bootstage.h>
arch/arm/cpu/armv7/iproc-common/timer.c +1 -0
index aaa767db13..668b5e11a6 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/iproc-common/timer.h>
 #include <asm/iproc-common/sysmap.h>
arch/arm/cpu/armv7/s5p-common/timer.c +1 -0
index 0048cd8067..e54cfb06dc 100644
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/pwm.h>
 #include <asm/arch/clk.h>
arch/arm/cpu/armv7/stv0991/timer.c +1 -0
index d1b763df8e..695bdd7a5c 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch-stv0991/hardware.h>
 #include <asm/arch-stv0991/stv0991_cgu.h>
arch/arm/cpu/armv7/sunxi/timer.c +1 -0
index 304c1ac5f9..6bda5fbbb6 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/timer.h>
 
arch/arm/cpu/armv7/vf610/timer.c +1 -0
index 821a279b63..f858de953d 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <asm/arch/imx-regs.h>
arch/arm/cpu/armv7m/systick-timer.c +1 -0
index d04f67ae16..5c310d306d 100644
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/cpu/sa1100/timer.c +1 -0
index 0fac5c1707..c6b1b2c177 100644
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <SA-1100.h>
+#include <time.h>
 
 static ulong get_timer_masked (void)
 {
arch/arm/mach-at91/arm920t/timer.c +1 -0
index 6db541a7b3..3aef9538b4 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
arch/arm/mach-davinci/timer.c +1 -0
index 99f1eabf5f..9846463c60 100644
@@ -21,6 +21,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/timer_defs.h>
 #include <div64.h>
arch/arm/mach-omap2/timer.c +1 -0
index 87b674e694..dbb68f718d 100644
@@ -16,6 +16,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
arch/arm/mach-orion5x/timer.c +1 -0
index 6aaf94ae08..9da9783822 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 
 #define UBOOT_CNTR	0	/* counter to use for uboot timer */
arch/arm/mach-rmobile/timer.c +1 -0
index bf74955793..9fcab446a5 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch-armv7/globaltimer.h>
 #include <asm/arch/rmobile.h>
arch/arm/mach-socfpga/clock_manager_gen5.c +1 -0
index 3a64600861..54a821a27f 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <dm.h>
 #include <asm/arch/clock_manager.h>
arch/arm/mach-sunxi/dram_helpers.c +1 -0
index 239ab421a8..520b597fcc 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/barriers.h>
 #include <asm/io.h>
 #include <asm/arch/dram.h>
arch/arm/mach-sunxi/p2wi.c +1 -0
index e84e1d8d5c..7c5c12254e 100644
@@ -15,6 +15,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
arch/arm/mach-sunxi/rsb.c +1 -0
index 005ca58db5..01bb09b747 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/prcm.h>
arch/arm/mach-tegra/clock.c +1 -0
index e539ad8b30..31b6aa2cfc 100644
@@ -9,6 +9,7 @@
 #include <div64.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/tegra.h>
arch/microblaze/cpu/timer.c +1 -0
index 58e5c30750..805eac7fa3 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <fdtdec.h>
+#include <time.h>
 #include <asm/microblaze_timer.h>
 #include <asm/microblaze_intc.h>
 
arch/mips/mach-jz47xx/jz4780/timer.c +1 -0
index a689b9d71a..988ebd2671 100644
@@ -9,6 +9,7 @@
 #include <config.h>
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/mipsregs.h>
 #include <mach/jz4780.h>
arch/nds32/cpu/n1213/ag101/timer.c +1 -0
index dfec5b3e96..cbfe07e351 100644
@@ -9,6 +9,7 @@
  */
 #ifndef CONFIG_TIMER
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <faraday/fttmr010.h>
 
arch/sh/lib/time_sh2.c +1 -0
index 14bef6b45b..d82c1d2feb 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 
arch/xtensa/lib/time.c +1 -0
index 81459b4c28..62bbe37b80 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/global_data.h>
 #include <linux/stringify.h>
 
board/armltd/integrator/timer.c +1 -0
index 7ecfa49c70..e65ae997fd 100644
@@ -18,6 +18,7 @@
 
 #include <common.h>
 #include <div64.h>
+#include <time.h>
 
 #ifdef CONFIG_ARCH_CINTEGRATOR
 #define DIV_CLOCK_INIT	1
board/broadcom/bcmstb/bcmstb.c +1 -0
index 5fc2c0591b..23500dfa69 100644
@@ -6,6 +6,7 @@
  * Author: Thomas Fitzsimmons <[email protected]>
  */
 
+#include <time.h>
 #include <linux/types.h>
 #include <common.h>
 #include <env.h>
board/xilinx/versal/board.c +1 -0
index abdd580c01..75056aa3d9 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <fdtdec.h>
 #include <malloc.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
common/autoboot.c +1 -0
index b28bd6823d..8faac2005d 100644
@@ -15,6 +15,7 @@
 #include <memalign.h>
 #include <menu.h>
 #include <post.h>
+#include <time.h>
 #include <u-boot/sha256.h>
 #include <bootcount.h>
 
common/bootretry.c +1 -0
index 47aaaa8220..dac891fbc5 100644
@@ -9,6 +9,7 @@
 #include <cli.h>
 #include <env.h>
 #include <errno.h>
+#include <time.h>
 #include <watchdog.h>
 
 #ifndef CONFIG_BOOT_RETRY_MIN
common/cli_readline.c +1 -0
index ea510ed639..6ef7a3e564 100644
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <bootretry.h>
 #include <cli.h>
+#include <time.h>
 #include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
common/iotrace.c +1 -0
index ba955afc94..295ee07b72 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <mapmem.h>
+#include <time.h>
 #include <asm/io.h>
 #include <u-boot/crc.h>
 
drivers/clk/clk_stm32mp1.c +1 -0
index e223f84eac..3718970dc7 100644
@@ -10,6 +10,7 @@
 #include <regmap.h>
 #include <spl.h>
 #include <syscon.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
drivers/mailbox/mailbox-uclass.c +1 -0
index 9fdb6279e4..5968c9b7eb 100644
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <mailbox.h>
 #include <mailbox-uclass.h>
+#include <time.h>
 
 static inline struct mbox_ops *mbox_dev_ops(struct udevice *dev)
 {
drivers/misc/tegra186_bpmp.c +1 -0
index b3ed03e9da..89e27dd526 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <dm/lists.h>
 #include <dm/root.h>
 #include <mailbox.h>
drivers/mmc/bcm2835_sdhci.c +1 -0
index bc9ee95fd5..39c93db275 100644
@@ -41,6 +41,7 @@
 #include <malloc.h>
 #include <memalign.h>
 #include <sdhci.h>
+#include <time.h>
 #include <asm/arch/msg.h>
 #include <asm/arch/mbox.h>
 #include <mach/sdhci.h>
drivers/mmc/mxcmmc.c +1 -0
index dcf17c5d60..269882b202 100644
@@ -23,6 +23,7 @@
 #include <part.h>
 #include <malloc.h>
 #include <mmc.h>
+#include <time.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
drivers/net/pic32_eth.c +1 -0
index 5c706c04c5..b0f7677154 100644
@@ -9,6 +9,7 @@
 #include <net.h>
 #include <miiphy.h>
 #include <console.h>
+#include <time.h>
 #include <wait_bit.h>
 #include <asm/gpio.h>
 
drivers/nvme/nvme.c +1 -0
index f915817aaa..cddcc2f11d 100644
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <memalign.h>
 #include <pci.h>
+#include <time.h>
 #include <dm/device-internal.h>
 #include "nvme.h"
 
drivers/power/pmic/stpmic1.c +1 -0
index de31934f41..2297af4157 100644
@@ -9,6 +9,7 @@
 #include <i2c.h>
 #include <misc.h>
 #include <sysreset.h>
+#include <time.h>
 #include <dm/device.h>
 #include <dm/lists.h>
 #include <power/pmic.h>
drivers/sound/broadwell_i2s.c +1 -0
index 998792b239..3d577401bd 100644
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <dm.h>
 #include <i2s.h>
+#include <time.h>
 #include <asm/io.h>
 #include "broadwell_i2s.h"
 
drivers/spi/ath79_spi.c +1 -0
index 207069218f..0b8ebaabe9 100644
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <div64.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/addrspace.h>
 #include <asm/types.h>
drivers/spi/exynos_spi.c +1 -0
index a9691c7603..d682a11013 100644
@@ -10,6 +10,7 @@
 #include <malloc.h>
 #include <spi.h>
 #include <fdtdec.h>
+#include <time.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/cpu.h>
drivers/spi/rk_spi.c +1 -0
index a68553b75b..c04535ac44 100644
@@ -16,6 +16,7 @@
 #include <dt-structs.h>
 #include <errno.h>
 #include <spi.h>
+#include <time.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/clock.h>
drivers/spi/tegra114_spi.c +1 -0
index 5c35c22592..bb34b20f54 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
drivers/spi/tegra20_sflash.c +1 -0
index 567e33f156..0e68d33be6 100644
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/arch/clock.h>
drivers/spi/tegra20_slink.c +1 -0
index d55e833cc2..ae2fc3e76d 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
drivers/spi/tegra210_qspi.c +1 -0
index e4b82767f8..d82ecaa61f 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
drivers/spi/uniphier_spi.c +1 -0
index ef02d07aa4..e47b969864 100644
@@ -7,6 +7,7 @@
 #include <clk.h>
 #include <common.h>
 #include <dm.h>
+#include <time.h>
 #include <linux/bitfield.h>
 #include <linux/io.h>
 #include <spi.h>
drivers/spi/zynq_spi.c +1 -0
index 2a02942d41..0b2b2f4810 100644
@@ -10,6 +10,7 @@
 #include <dm.h>
 #include <malloc.h>
 #include <spi.h>
+#include <time.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
drivers/timer/tsc_timer.c +1 -0
index 637c8ff25a..0df551f94c 100644
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <dm.h>
 #include <malloc.h>
+#include <time.h>
 #include <timer.h>
 #include <asm/cpu.h>
 #include <asm/io.h>
drivers/video/sunxi/sunxi_display.c +1 -0
index 46436b88c5..c45b3ebe6e 100644
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <efi_loader.h>
+#include <time.h>
 
 #include <asm/arch/clock.h>
 #include <asm/arch/display.h>
drivers/video/sunxi/sunxi_dw_hdmi.c +1 -0
index 66a319187c..c87c919a52 100644
@@ -10,6 +10,7 @@
 #include <dm.h>
 #include <dw_hdmi.h>
 #include <edid.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/lcdc.h>
include/common.h +2 -5
index e68bed6407..cc5f13ec7e 100644
@@ -3,8 +3,8 @@
  * Common header file for U-Boot
  *
  * This file still includes quite a bit of stuff that should be in separate
- * headers like command.h, cpu.h and timer.h. Please think before adding more
- * things. Patches to remove things are welcome.
+ * headers like command.h and cpu.h. Please think before adding more things.
+ * Patches to remove things are welcome.
  *
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
@@ -281,9 +281,6 @@ enum {
  */
 int cleanup_before_linux_select(int flags);
 
-/* arch/$(ARCH)/lib/ticks.S */
-uint64_t get_ticks(void);
-
 /* lib/uuid.c */
 #include <uuid.h>
 
include/time.h +10 -0
index 875a2b293e..71446c3171 100644
@@ -103,4 +103,14 @@ void wait_ticks(unsigned long ticks);
  */
 unsigned long timer_get_us(void);
 
+/**
+ * get_ticks() - Get the current tick value
+ *
+ * This is an internal value used by the timer on the system. Ticks increase
+ * monotonically at the rate given by get_tbclk().
+ *
+ * @return current tick value
+ */
+uint64_t get_ticks(void);
+
 #endif /* _TIME_H */
lib/efi_loader/efi_boottime.c +1 -0
index ea52b9539d..265297ed46 100644
@@ -9,6 +9,7 @@
 #include <div64.h>
 #include <efi_loader.h>
 #include <malloc.h>
+#include <time.h>
 #include <linux/libfdt_env.h>
 #include <u-boot/crc.h>
 #include <bootm.h>
lib/efi_loader/efi_console.c +1 -0
index a55e4b33ec..218f7caa12 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <charset.h>
+#include <time.h>
 #include <dm/device.h>
 #include <efi_loader.h>
 #include <env.h>
lib/time.c +1 -0
index f30fc05804..75de48f900 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <time.h>
 #include <timer.h>
 #include <watchdog.h>
 #include <div64.h>
lib/trace.c +1 -0
index f2402b9359..6716c7c2f0 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <mapmem.h>
+#include <time.h>
 #include <trace.h>
 #include <asm/io.h>
 #include <asm/sections.h>
lib/uuid.c +1 -0
index a48e19c06e..3d3c7abcae 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <time.h>
 #include <linux/ctype.h>
 #include <errno.h>
 #include <common.h>
net/nfs.c +1 -0
index aca0ca55f3..97e62f1dce 100644
@@ -33,6 +33,7 @@
 #include <mapmem.h>
 #include "nfs.h"
 #include "bootp.h"
+#include <time.h>
 
 #define HASHES_PER_LINE 65	/* Number of "loading" hashes per line	*/
 #define NFS_RETRY_COUNT 30
post/post.c +1 -0
index fb751d9a83..f27138ddaa 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <env.h>
 #include <stdio_dev.h>
+#include <time.h>
 #include <watchdog.h>
 #include <div64.h>
 #include <post.h>
test/time_ut.c +1 -0
index 28c934e426..40a19a50d9 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <errno.h>
+#include <time.h>
 
 static int test_get_timer(void)
 {
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#28 lore raw

PATCH v4 23/42 common: Move mii_init() function out of common.h

In reply to Simon Glass

This function belongs in mii.h so move it over.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 1 +
 drivers/net/fsl_mcdmafec.c              | 1 +
 drivers/net/ldpaa_eth/ls1088a.c         | 1 +
 drivers/net/ldpaa_eth/lx2160a.c         | 1 +
 drivers/net/mcffec.c                    | 1 +
 drivers/net/mcfmii.c                    | 1 +
 drivers/net/mpc8xx_fec.c                | 1 +
 drivers/net/pic32_eth.c                 | 1 +
 include/common.h                        | 3 ---
 include/linux/mii.h                     | 2 ++
 10 files changed, 10 insertions(+), 3 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +1 -0
index 59d03b167c..374fde6b65 100644
@@ -39,6 +39,7 @@
 #include <fsl_validate.h>
 #endif
 #endif
+#include <linux/mii.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/net/fsl_mcdmafec.c +1 -0
index e66fb16de8..b2936b78d7 100644
@@ -14,6 +14,7 @@
 #include <config.h>
 #include <net.h>
 #include <miiphy.h>
+#include <linux/mii.h>
 
 #undef	ET_DEBUG
 #undef	MII_DEBUG
drivers/net/ldpaa_eth/ls1088a.c +1 -0
index c3260d318c..54cb16e51b 100644
@@ -8,6 +8,7 @@
 #include <asm/io.h>
 #include <asm/arch/fsl_serdes.h>
 #include <asm/arch/soc.h>
+#include <linux/mii.h>
 
 u32 dpmac_to_devdisr[] = {
 	[WRIOP1_DPMAC1] = FSL_CHASSIS3_DEVDISR2_DPMAC1,
drivers/net/ldpaa_eth/lx2160a.c +1 -0
index 1fbeb0d14b..9432b6eb85 100644
@@ -8,6 +8,7 @@
 #include <asm/io.h>
 #include <asm/arch/fsl_serdes.h>
 #include <asm/arch/soc.h>
+#include <linux/mii.h>
 
 u32 dpmac_to_devdisr[] = {
 	[WRIOP1_DPMAC1] = FSL_CHASSIS3_DEVDISR2_DPMAC1,
drivers/net/mcffec.c +1 -0
index fb93041256..9a3a8455a1 100644
@@ -18,6 +18,7 @@
 
 #include <asm/fec.h>
 #include <asm/immap.h>
+#include <linux/mii.h>
 
 #undef	ET_DEBUG
 #undef	MII_DEBUG
drivers/net/mcfmii.c +1 -0
index 961618b410..b8af2cc44b 100644
@@ -15,6 +15,7 @@
 #include <asm/fec.h>
 #endif
 #include <asm/immap.h>
+#include <linux/mii.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/net/mpc8xx_fec.c +1 -0
index f45f1e4677..0a80985192 100644
@@ -13,6 +13,7 @@
 #include <asm/io.h>
 
 #include <phy.h>
+#include <linux/mii.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/net/pic32_eth.c +1 -0
index b0f7677154..39c4b10ab8 100644
@@ -12,6 +12,7 @@
 #include <time.h>
 #include <wait_bit.h>
 #include <asm/gpio.h>
+#include <linux/mii.h>
 
 #include "pic32_eth.h"
 
include/common.h +0 -3
index cc5f13ec7e..992675100d 100644
@@ -254,9 +254,6 @@ void	reset_timer	   (void);
 void	enable_interrupts  (void);
 int	disable_interrupts (void);
 
-/* $(CPU)/.../<eth> */
-void mii_init (void);
-
 /* arch/$(ARCH)/lib/cache.c */
 void	enable_caches(void);
 void	flush_cache   (unsigned long, unsigned long);
include/linux/mii.h +2 -0
index 21db032340..49e29ac314 100644
@@ -225,4 +225,6 @@ static inline u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv)
 	return cap;
 }
 
+void mii_init(void);
+
 #endif /* __LINUX_MII_H__ */
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#29 lore raw

PATCH v4 24/42 common: Move some CPU functions out of common.h

In reply to Simon Glass

These functions belong in cpu_func.h since they do not use driver model. Move them over. Don't bother adding comments since these functions should be deleted.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c       |  1 +
 .../armv8/fsl-layerscape/fsl_lsch2_speed.c    |  1 +
 .../armv8/fsl-layerscape/fsl_lsch3_speed.c    |  1 +
 arch/arm/cpu/armv8/s32v234/cpu.c              |  1 +
 arch/powerpc/cpu/mpc85xx/speed.c              |  1 +
 arch/powerpc/cpu/mpc86xx/cpu.c                |  1 +
 arch/powerpc/cpu/mpc8xxx/cpu.c                |  1 +
 arch/powerpc/cpu/mpc8xxx/fdt.c                |  1 +
 board/freescale/qemu-ppce500/qemu-ppce500.c   |  1 +
 include/common.h                              | 20 -------------------
 10 files changed, 9 insertions(+), 20 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +1 -0
index 374fde6b65..6c87c1b11a 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <fsl_ddr_sdram.h>
 #include <vsprintf.h>
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c +1 -0
index df4df9aca7..c61b2701d6 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/compiler.h>
 #include <asm/io.h>
 #include <asm/processor.h>
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c +1 -0
index bbd550b036..21fe2f289f 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/compiler.h>
 #include <fsl_ifc.h>
 #include <asm/processor.h>
arch/arm/cpu/armv8/s32v234/cpu.c +1 -0
index b4cb67a66a..b5a9513ead 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/armv8/mmu.h>
arch/powerpc/cpu/mpc85xx/speed.c +1 -0
index acc2f2bb81..15b05fcc51 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <ppc_asm.tmpl>
 #include <linux/compiler.h>
 #include <asm/processor.h>
arch/powerpc/cpu/mpc86xx/cpu.c +1 -0
index 1c3c78217c..bb14444a2e 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
arch/powerpc/cpu/mpc8xxx/cpu.c +1 -0
index 467eac4a2e..ed482a9c09 100644
@@ -10,6 +10,7 @@
 #include <config.h>
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <tsec.h>
 #include <fm_eth.h>
 #include <netdev.h>
arch/powerpc/cpu/mpc8xxx/fdt.c +1 -0
index 0d877c43be..485c2d4feb 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <asm/mp.h>
board/freescale/qemu-ppce500/qemu-ppce500.c +1 -0
index fb36d8366c..4a5ab72b1f 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <pci.h>
 #include <asm/processor.h>
include/common.h +0 -20
index 992675100d..4de05032b2 100644
@@ -203,26 +203,6 @@ void	relocate_code(ulong, gd_t *, ulong) __attribute__ ((noreturn));
 ulong	get_endaddr   (void);
 void	trap_init     (ulong);
 
-/* $(CPU)/cpu.c */
-static inline int cpumask_next(int cpu, unsigned int mask)
-{
-	for (cpu++; !((1 << cpu) & mask); cpu++)
-		;
-
-	return cpu;
-}
-
-#define for_each_cpu(iter, cpu, num_cpus, mask) \
-	for (iter = 0, cpu = cpumask_next(-1, mask); \
-		iter < num_cpus; \
-		iter++, cpu = cpumask_next(cpu, mask)) \
-
-int	cpu_numcores  (void);
-int	cpu_num_dspcores(void);
-u32	cpu_mask      (void);
-u32	cpu_dsp_mask(void);
-int	is_core_valid (unsigned int);
-
 void s_init(void);
 
 int	checkcpu      (void);
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#30 lore raw

PATCH v4 24/42 common: Move some CPU functions out of common.h

Quoted 5 lines · Simon Glass

These functions belong in cpu_func.h since they do not use driver model. Move them over. Don't bother adding comments since these functions should be deleted.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/f588aa3c/attachment.sig>
#31 lore raw

PATCH v4 25/42 common: Drop cpu_init()

In reply to Simon Glass

This function is not defined anywhere. Drop it.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/common.h | 2 --
 1 file changed, 2 deletions(-)
include/common.h +0 -2
index 4de05032b2..ce08bfe11f 100644
@@ -64,8 +64,6 @@ typedef void (interrupt_handler_t)(void *);
  */
 void	hang		(void) __attribute__ ((noreturn));
 
-int	cpu_init(void);
-
 #include <display_options.h>
 
 /* common/main.c */
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#32 lore raw

PATCH v4 26/42 common: Move checkcpu() out of common.h

In reply to Simon Glass

This function belongs in cpu_func.h so move it over.

---

Changes in v4:
- Use cpu_func.h instead of cpu_legacy.h

Changes in v3: None
Changes in v2: None

 arch/powerpc/cpu/mpc83xx/cpu.c               |  1 +
 arch/powerpc/cpu/mpc8xx/cpu.c                |  1 +
 arch/sh/cpu/sh4/cpu.c                        |  1 +
 arch/x86/cpu/broadwell/cpu_from_spl.c        |  1 +
 arch/x86/cpu/coreboot/coreboot.c             |  1 +
 arch/x86/cpu/efi/app.c                       |  1 +
 arch/x86/cpu/efi/payload.c                   |  1 +
 arch/x86/cpu/ivybridge/cpu.c                 |  1 +
 arch/x86/cpu/qemu/qemu.c                     |  1 +
 arch/x86/cpu/quark/quark.c                   |  1 +
 arch/x86/cpu/slimbootloader/slimbootloader.c |  1 +
 arch/x86/cpu/tangier/tangier.c               |  1 +
 arch/x86/cpu/x86_64/cpu.c                    |  1 +
 arch/x86/lib/fsp/fsp_common.c                |  1 +
 common/board_f.c                             |  1 +
 include/common.h                             |  1 -
 include/cpu_func.h                           | 29 ++++++++++++++++++++
 17 files changed, 44 insertions(+), 1 deletion(-)
arch/powerpc/cpu/mpc83xx/cpu.c +1 -0
index 363c0ffd28..0710f5ab36 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
arch/powerpc/cpu/mpc8xx/cpu.c +1 -0
index 6ad86e9a1d..2b7c5d4301 100644
@@ -17,6 +17,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
arch/sh/cpu/sh4/cpu.c +1 -0
index a8b50a9ff5..ee36aca407 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <netdev.h>
 #include <asm/processor.h>
 
arch/x86/cpu/broadwell/cpu_from_spl.c +1 -0
index c3d4a8d547..2aa6f245e7 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <bloblist.h>
+#include <cpu_func.h>
 #include <debug_uart.h>
 #include <handoff.h>
 #include <asm/mtrr.h>
arch/x86/cpu/coreboot/coreboot.c +1 -0
index 9686f8ed5b..0c4c6348d1 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <fdtdec.h>
 #include <usb.h>
 #include <asm/io.h>
arch/x86/cpu/efi/app.c +1 -0
index ba7c02bd7e..13077411dc 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <fdtdec.h>
 #include <netdev.h>
 
arch/x86/cpu/efi/payload.c +1 -0
index 225aef7bf6..af6dd2f743 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <efi.h>
 #include <errno.h>
 #include <usb.h>
arch/x86/cpu/ivybridge/cpu.c +1 -0
index 6db9da81b7..8f30cdbe24 100644
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <fdtdec.h>
arch/x86/cpu/qemu/qemu.c +1 -0
index 5e8b4f068e..716351ad7f 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <pci.h>
 #include <qfw.h>
 #include <asm/irq.h>
arch/x86/cpu/quark/quark.c +1 -0
index d39edb2271..d6611eea5d 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <mmc.h>
 #include <asm/io.h>
 #include <asm/ioapic.h>
arch/x86/cpu/slimbootloader/slimbootloader.c +1 -0
index e6b174ca88..21dcfb2142 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/slimbootloader.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/x86/cpu/tangier/tangier.c +1 -0
index df2c600be3..43bee1fb70 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/u-boot-x86.h>
 
 /*
arch/x86/cpu/x86_64/cpu.c +1 -0
index 42abb23a9e..90925e46ea 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <debug_uart.h>
 
 /*
arch/x86/lib/fsp/fsp_common.c +1 -0
index 40ba866d77..a5efe35f59 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <acpi_s3.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <rtc.h>
common/board_f.c +1 -0
index 01044452bf..05f4b73c6e 100644
@@ -13,6 +13,7 @@
 #include <bloblist.h>
 #include <console.h>
 #include <cpu.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <env.h>
 #include <env_internal.h>
include/common.h +0 -1
index ce08bfe11f..96bb42ce71 100644
@@ -203,7 +203,6 @@ void	trap_init     (ulong);
 
 void s_init(void);
 
-int	checkcpu      (void);
 int	checkicache   (void);
 int	checkdcache   (void);
 void	upmconfig     (unsigned int, unsigned int *, unsigned int);
include/cpu_func.h +29 -0
index a99b69b976..03feaa63e9 100644
@@ -20,4 +20,33 @@ int cpu_reset(u32 nr);
 int cpu_disable(u32 nr);
 int cpu_release(u32 nr, int argc, char * const argv[]);
 
+static inline int cpumask_next(int cpu, unsigned int mask)
+{
+	for (cpu++; !((1 << cpu) & mask); cpu++)
+		;
+
+	return cpu;
+}
+
+#define for_each_cpu(iter, cpu, num_cpus, mask) \
+	for (iter = 0, cpu = cpumask_next(-1, mask); \
+	     iter < num_cpus; \
+	     iter++, cpu = cpumask_next(cpu, mask)) \
+
+int cpu_numcores(void);
+int cpu_num_dspcores(void);
+u32 cpu_mask(void);
+u32 cpu_dsp_mask(void);
+int is_core_valid(unsigned int core);
+
+/**
+ * checkcpu() - perform an early check of the CPU
+ *
+ * This is used on PowerPC, SH and X86 machines as a CPU init mechanism. It is
+ * called during the pre-relocation init sequence in board_init_f().
+ *
+ * @return 0 if oK, -ve on error
+ */
+int checkcpu(void);
+
 #endif
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#33 lore raw

PATCH v4 26/42 common: Move checkcpu() out of common.h

Quoted 3 lines · Simon Glass

This function belongs in cpu_func.h so move it over.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/a591fe83/attachment.sig>
#34 lore raw

PATCH v4 27/42 common: Move some SMP functions out of common.h

In reply to Simon Glass

These functions belong in cpu_func.h so move them over.

---

Changes in v4:
- Use cpu_func.h instead of cpu_legacy.h

Changes in v3: None
Changes in v2: None

 arch/arm/cpu/armv7/ls102xa/cpu.c        | 1 +
 arch/arm/cpu/armv7/virt-v7.c            | 1 +
 arch/arm/lib/bootm.c                    | 1 +
 arch/arm/mach-uniphier/arm32/psci.c     | 1 +
 board/armltd/vexpress/vexpress_common.c | 1 +
 board/broadcom/bcm_ep/board.c           | 1 +
 board/samsung/arndale/arndale.c         | 1 +
 board/synopsys/axs10x/axs10x.c          | 1 +
 board/xilinx/zynqmp/zynqmp.c            | 1 +
 cmd/elf.c                               | 1 +
 include/common.h                        | 3 ---
 include/cpu_func.h                      | 3 +++
 12 files changed, 13 insertions(+), 3 deletions(-)
arch/arm/cpu/armv7/ls102xa/cpu.c +1 -0
index ec9984db79..664c9c1f4d 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <vsprintf.h>
 #include <asm/arch/clock.h>
 #include <asm/io.h>
arch/arm/cpu/armv7/virt-v7.c +1 -0
index be14eb9376..26c93393cd 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/armv7.h>
 #include <asm/gic.h>
 #include <asm/io.h>
arch/arm/lib/bootm.c +1 -0
index 488358a331..769a64257f 100644
@@ -13,6 +13,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/root.h>
 #include <env.h>
arch/arm/mach-uniphier/arm32/psci.c +1 -0
index ef35923f6a..9a3793316a 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
 #include <linux/io.h>
board/armltd/vexpress/vexpress_common.c +1 -0
index 30b9dbbe8a..416c18adec 100644
@@ -16,6 +16,7 @@
  * Philippe Robin, <[email protected]>
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <errno.h>
 #include <netdev.h>
board/broadcom/bcm_ep/board.c +1 -0
index b2469dcb52..63fb98ba7c 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <config.h>
 #include <netdev.h>
board/samsung/arndale/arndale.c +1 -0
index d06ab8f3c0..1d547b1c38 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <usb.h>
 #include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
board/synopsys/axs10x/axs10x.c +1 -0
index 7c4fcf281c..fa982bda5c 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dwmmc.h>
 #include <malloc.h>
 #include <asm/arcregs.h>
board/xilinx/zynqmp/zynqmp.c +1 -0
index b94936474d..836c28526f 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <sata.h>
 #include <ahci.h>
cmd/elf.c +1 -0
index 538562fda5..32f12a72b9 100644
@@ -15,6 +15,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <elf.h>
 #include <env.h>
 #include <net.h>
include/common.h +0 -3
index 96bb42ce71..3f6a95d7e0 100644
@@ -212,9 +212,6 @@ void	reset_cpu     (ulong addr);
 void ft_cpu_setup(void *blob, bd_t *bd);
 void ft_pci_setup(void *blob, bd_t *bd);
 
-void smp_set_core_boot_addr(unsigned long addr, int corenr);
-void smp_kick_all_cpus(void);
-
 /* $(CPU)/speed.c */
 int	get_clocks (void);
 ulong	get_bus_freq  (ulong);
include/cpu_func.h +3 -0
index 03feaa63e9..1741f7f7a6 100644
@@ -49,4 +49,7 @@ int is_core_valid(unsigned int core);
  */
 int checkcpu(void);
 
+void smp_set_core_boot_addr(unsigned long addr, int corenr);
+void smp_kick_all_cpus(void);
+
 #endif
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#35 lore raw

PATCH v4 27/42 common: Move some SMP functions out of common.h

Quoted 3 lines · Simon Glass

These functions belong in cpu_func.h so move them over.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/a8256a58/attachment.sig>
#36 lore raw

PATCH v4 28/42 arm: powerpc: Tidy up code style for cache functions

In reply to Simon Glass

Remove the unwanted space before the bracket.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/lib/cache-cp15.c            | 12 ++++++------
 arch/microblaze/cpu/cache.c          | 18 +++++++++++-------
 board/armltd/integrator/integrator.c |  2 +-
 board/cobra5272/flash.c              | 12 ++++++------
 include/common.h                     |  2 +-
 post/lib_powerpc/cpu.c               |  6 +++---
 6 files changed, 28 insertions(+), 24 deletions(-)
arch/arm/lib/cache-cp15.c +6 -6
index 47c223917a..8ca8e48380 100644
@@ -253,17 +253,17 @@ static void cache_disable(uint32_t cache_bit)
 #endif
 
 #if CONFIG_IS_ENABLED(SYS_ICACHE_OFF)
-void icache_enable (void)
+void icache_enable(void)
 {
 	return;
 }
 
-void icache_disable (void)
+void icache_disable(void)
 {
 	return;
 }
 
-int icache_status (void)
+int icache_status(void)
 {
 	return 0;					/* always off */
 }
@@ -285,17 +285,17 @@ int icache_status(void)
 #endif
 
 #if CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
-void dcache_enable (void)
+void dcache_enable(void)
 {
 	return;
 }
 
-void dcache_disable (void)
+void dcache_disable(void)
 {
 	return;
 }
 
-int dcache_status (void)
+int dcache_status(void)
 {
 	return 0;					/* always off */
 }
arch/microblaze/cpu/cache.c +11 -7
index eebeb37830..94114555ff 100644
@@ -8,7 +8,7 @@
 #include <common.h>
 #include <asm/asm.h>
 
-int dcache_status (void)
+int dcache_status(void)
 {
 	int i = 0;
 	int mask = 0x80;
@@ -18,7 +18,7 @@ int dcache_status (void)
 	return i;
 }
 
-int icache_status (void)
+int icache_status(void)
 {
 	int i = 0;
 	int mask = 0x20;
@@ -28,28 +28,32 @@ int icache_status (void)
 	return i;
 }
 
-void	icache_enable (void) {
+void icache_enable(void)
+{
 	MSRSET(0x20);
 }
 
-void	icache_disable(void) {
+void icache_disable(void)
+{
 	/* we are not generate ICACHE size -> flush whole cache */
 	flush_cache(0, 32768);
 	MSRCLR(0x20);
 }
 
-void	dcache_enable (void) {
+void dcache_enable(void)
+{
 	MSRSET(0x80);
 }
 
-void	dcache_disable(void) {
+void dcache_disable(void)
+{
 #ifdef XILINX_USE_DCACHE
 	flush_cache(0, XILINX_DCACHE_BYTE_SIZE);
 #endif
 	MSRCLR(0x80);
 }
 
-void flush_cache (ulong addr, ulong size)
+void flush_cache(ulong addr, ulong size)
 {
 	int i;
 	for (i = 0; i < size; i += 4)
board/armltd/integrator/integrator.c +1 -1
index 0a2baa7297..f0fbe2b417 100644
@@ -109,7 +109,7 @@ extern void cm_remap(void);
 	writel(SC_CTRL_FLASHVPP | SC_CTRL_FLASHWP, SC_CTRLS);
 #endif
 
-	icache_enable ();
+	icache_enable();
 
 	return 0;
 }
board/cobra5272/flash.c +6 -6
index e5edc2a040..9bf824889a 100644
@@ -164,8 +164,8 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
 	 * chip is in programming mode.
 	 */
 
-	cflag = icache_status ();
-	icache_disable ();
+	cflag = icache_status();
+	icache_disable();
 	iflag = disable_interrupts ();
 
 	printf ("\n");
@@ -237,7 +237,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
 		enable_interrupts ();
 
 	if (cflag)
-		icache_enable ();
+		icache_enable();
 
 	return rc;
 }
@@ -267,8 +267,8 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
 	 * chip is in programming mode.
 	 */
 
-	cflag = icache_status ();
-	icache_disable ();
+	cflag = icache_status();
+	icache_disable();
 	iflag = disable_interrupts ();
 
 	MEM_FLASH_ADDR1 = CMD_UNLOCK1;
@@ -303,7 +303,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
 		enable_interrupts ();
 
 	if (cflag)
-		icache_enable ();
+		icache_enable();
 
 	return rc;
 }
include/common.h +1 -1
index 3f6a95d7e0..82b1abe698 100644
@@ -189,7 +189,7 @@ int testdram(void);
 int	icache_status (void);
 void	icache_enable (void);
 void	icache_disable(void);
-int	dcache_status (void);
+int	dcache_status(void);
 void	dcache_enable (void);
 void	dcache_disable(void);
 void	mmu_disable(void);
post/lib_powerpc/cpu.c +3 -3
index 109be38e16..6713039330 100644
@@ -57,12 +57,12 @@ ulong cpu_post_makecr (long v)
 
 int cpu_post_test (int flags)
 {
-	int ic = icache_status ();
+	int ic = icache_status();
 	int ret = 0;
 
 	WATCHDOG_RESET();
 	if (ic)
-		icache_disable ();
+		icache_disable();
 
 	if (ret == 0)
 		ret = cpu_post_test_cmp ();
@@ -110,7 +110,7 @@ int cpu_post_test (int flags)
 	WATCHDOG_RESET();
 
 	if (ic)
-		icache_enable ();
+		icache_enable();
 
 	WATCHDOG_RESET();
 
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#37 lore raw

PATCH v4 29/42 common: Move some cache and MMU functions out of common.h

In reply to Simon Glass

These functions belong in cpu_func.h. Another option would be cache.h but that code uses driver model and we have not moved these cache functions to use driver model. Since they are CPU-related it seems reasonable to put them here.

Move them over.

---

Changes in v4:
- Use cpu_func.h instead of cpu_legacy.h

Changes in v3: None
Changes in v2: None

 arch/arc/lib/cache.c                            |  1 +
 arch/arm/cpu/arm11/cpu.c                        |  1 +
 arch/arm/cpu/arm920t/cpu.c                      |  1 +
 arch/arm/cpu/arm926ejs/armada100/cpu.c          |  1 +
 arch/arm/cpu/arm926ejs/cache.c                  |  1 +
 arch/arm/cpu/arm926ejs/cpu.c                    |  1 +
 arch/arm/cpu/arm926ejs/spear/spr_misc.c         |  1 +
 arch/arm/cpu/arm946es/cpu.c                     |  1 +
 arch/arm/cpu/armv7/cpu.c                        |  1 +
 arch/arm/cpu/armv7/exception_level.c            |  1 +
 arch/arm/cpu/armv7/iproc-common/hwinit-common.c |  1 +
 arch/arm/cpu/armv7/kona-common/hwinit-common.c  |  1 +
 arch/arm/cpu/armv7/mpu_v7r.c                    |  1 +
 arch/arm/cpu/armv7/vf610/generic.c              |  1 +
 arch/arm/cpu/armv7m/cache.c                     |  1 +
 arch/arm/cpu/armv7m/cpu.c                       |  1 +
 arch/arm/cpu/armv8/cache_v8.c                   |  1 +
 arch/arm/cpu/armv8/cpu.c                        |  1 +
 arch/arm/cpu/armv8/exception_level.c            |  1 +
 arch/arm/cpu/armv8/fsl-layerscape/spl.c         |  1 +
 arch/arm/cpu/pxa/pxa2xx.c                       |  1 +
 arch/arm/cpu/sa1100/cpu.c                       |  1 +
 arch/arm/lib/cache-cp15.c                       |  1 +
 arch/arm/mach-at91/armv7/cpu.c                  |  1 +
 arch/arm/mach-bcm283x/init.c                    |  1 +
 arch/arm/mach-exynos/soc.c                      |  1 +
 arch/arm/mach-imx/cache.c                       |  1 +
 arch/arm/mach-imx/imx8/cpu.c                    |  1 +
 arch/arm/mach-imx/imx8m/soc.c                   |  1 +
 arch/arm/mach-imx/mx5/soc.c                     |  1 +
 arch/arm/mach-keystone/init.c                   |  1 +
 arch/arm/mach-mediatek/cpu.c                    |  1 +
 arch/arm/mach-mvebu/armada8k/cpu.c              |  1 +
 arch/arm/mach-mvebu/cpu.c                       |  1 +
 arch/arm/mach-omap2/omap-cache.c                |  1 +
 arch/arm/mach-orion5x/cpu.c                     |  1 +
 arch/arm/mach-rmobile/cpu_info.c                |  1 +
 arch/arm/mach-rmobile/memmap-gen3.c             |  1 +
 arch/arm/mach-rockchip/board.c                  |  1 +
 arch/arm/mach-s5pc1xx/cache.c                   |  1 +
 arch/arm/mach-socfpga/misc.c                    |  1 +
 arch/arm/mach-socfpga/spl_a10.c                 |  1 +
 arch/arm/mach-stm32mp/cpu.c                     |  1 +
 arch/arm/mach-sunxi/board.c                     |  1 +
 arch/arm/mach-tegra/board.c                     |  1 +
 arch/arm/mach-uniphier/arm32/cache-uniphier.c   |  1 +
 arch/arm/mach-zynq/cpu.c                        |  1 +
 arch/m68k/cpu/mcf5227x/cpu_init.c               |  1 +
 arch/m68k/cpu/mcf523x/cpu_init.c                |  1 +
 arch/m68k/cpu/mcf52x2/cpu_init.c                |  1 +
 arch/m68k/cpu/mcf530x/cpu_init.c                |  1 +
 arch/m68k/cpu/mcf532x/cpu_init.c                |  1 +
 arch/m68k/cpu/mcf5445x/cpu_init.c               |  1 +
 arch/m68k/cpu/mcf547x_8x/cpu_init.c             |  1 +
 arch/m68k/lib/cache.c                           |  1 +
 arch/microblaze/cpu/cache.c                     |  1 +
 arch/mips/lib/cache.c                           |  1 +
 arch/nds32/cpu/n1213/ae3xx/cpu.c                |  1 +
 arch/nds32/cpu/n1213/ag101/cpu.c                |  1 +
 arch/nds32/lib/cache.c                          |  1 +
 arch/nios2/lib/cache.c                          |  1 +
 arch/powerpc/cpu/mpc83xx/spd_sdram.c            |  1 +
 arch/powerpc/cpu/mpc8xx/cache.c                 |  1 +
 arch/riscv/cpu/ax25/cache.c                     |  1 +
 arch/riscv/cpu/ax25/cpu.c                       |  1 +
 arch/riscv/lib/cache.c                          |  1 +
 arch/sh/cpu/sh4/cache.c                         |  1 +
 arch/x86/cpu/cpu.c                              |  1 +
 arch/x86/cpu/i386/cpu.c                         |  1 +
 arch/x86/cpu/mtrr.c                             |  1 +
 arch/x86/lib/spl.c                              |  1 +
 arch/xtensa/lib/cache.c                         |  1 +
 board/armltd/integrator/integrator.c            |  1 +
 board/cirrus/edb93xx/edb93xx.c                  |  1 +
 board/cobra5272/flash.c                         |  1 +
 board/highbank/highbank.c                       |  1 +
 board/st/stih410-b2260/board.c                  |  1 +
 board/synopsys/hsdk/hsdk.c                      |  1 +
 board/syteco/zmx25/zmx25.c                      |  1 +
 board/toradex/colibri_pxa270/colibri_pxa270.c   |  1 +
 board/xilinx/zynqmp/cmds.c                      |  1 +
 cmd/cache.c                                     |  1 +
 cmd/ti/ddr3.c                                   |  1 +
 common/bootm_os.c                               |  1 +
 common/kgdb_stubs.c                             |  1 +
 common/spl/spl_atf.c                            |  1 +
 drivers/ddr/altera/sdram_arria10.c              |  1 +
 drivers/ddr/altera/sdram_s10.c                  |  1 +
 drivers/fpga/zynqpl.c                           |  1 +
 drivers/video/cfb_console.c                     |  1 +
 include/common.h                                | 10 +---------
 include/cpu_func.h                              |  8 ++++++++
 post/cpu/mpc83xx/ecc.c                          |  1 +
 post/lib_powerpc/cpu.c                          |  1 +
 94 files changed, 101 insertions(+), 9 deletions(-)
arch/arc/lib/cache.c +1 -0
index 8c1cb6e800..1340776c66 100644
@@ -5,6 +5,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/log2.h>
arch/arm/cpu/arm11/cpu.c +1 -0
index 8aee1539a9..fc3658951c 100644
@@ -16,6 +16,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <asm/system.h>
 
 static void cache_flush(void);
arch/arm/cpu/arm920t/cpu.c +1 -0
index 2ef133f133..980a734d1b 100644
@@ -14,6 +14,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <asm/system.h>
 
 static void cache_flush(void);
arch/arm/cpu/arm926ejs/armada100/cpu.c +1 -0
index 4cd8511414..0c81de7e36 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/armada100.h>
 
arch/arm/cpu/arm926ejs/cache.c +1 -0
index 16eea693d1..7b7eaaf31d 100644
@@ -3,6 +3,7 @@
  * (C) Copyright 2011
  * Ilya Yanok, EmCraft Systems
  */
+#include <cpu_func.h>
 #include <linux/types.h>
 #include <common.h>
 
arch/arm/cpu/arm926ejs/cpu.c +1 -0
index d7cffe8b69..2ae46f0357 100644
@@ -14,6 +14,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <asm/system.h>
 
 static void cache_flush(void);
arch/arm/cpu/arm926ejs/spear/spr_misc.c +1 -0
index d36484c9d6..ccf944f814 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <i2c.h>
 #include <net.h>
arch/arm/cpu/arm946es/cpu.c +1 -0
index 3b4f5de8f6..434fed58bf 100644
@@ -14,6 +14,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <asm/system.h>
 #include <asm/io.h>
 
arch/arm/cpu/armv7/cpu.c +1 -0
index 44f2757267..03557e8a2a 100644
@@ -16,6 +16,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <asm/system.h>
 #include <asm/cache.h>
 #include <asm/armv7.h>
arch/arm/cpu/armv7/exception_level.c +1 -0
index 274f03d8bb..6648aed291 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <bootm.h>
+#include <cpu_func.h>
 #include <asm/armv7.h>
 #include <asm/secure.h>
 #include <asm/setjmp.h>
arch/arm/cpu/armv7/iproc-common/hwinit-common.c +1 -0
index 70431ecf6b..a5445338cb 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
 void enable_caches(void)
arch/arm/cpu/armv7/kona-common/hwinit-common.c +1 -0
index 10e7488879..6bf89e07d8 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/sizes.h>
 
 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
arch/arm/cpu/armv7/mpu_v7r.c +1 -0
index 7adecffff8..6deecfdc23 100644
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <asm/armv7.h>
 #include <asm/system.h>
 #include <asm/barriers.h>
arch/arm/cpu/armv7/vf610/generic.c +1 -0
index 7e4641fd32..806c6adf38 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
arch/arm/cpu/armv7m/cache.c +1 -0
index 1106bead41..6dc2ca8e73 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <asm/armv7m.h>
 #include <asm/io.h>
arch/arm/cpu/armv7m/cpu.c +1 -0
index 55ea0787a7..d548dd833c 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/armv7m.h>
 
arch/arm/cpu/armv8/cache_v8.c +1 -0
index e500e722e5..c1a08fb4ac 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/system.h>
 #include <asm/armv8/mmu.h>
 
arch/arm/cpu/armv8/cpu.c +1 -0
index b312b3be35..210301c1fe 100644
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <asm/system.h>
 #include <asm/secure.h>
 #include <linux/compiler.h>
arch/arm/cpu/armv8/exception_level.c +1 -0
index 57824eb2ac..9c1f4a8ca8 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <bootm.h>
+#include <cpu_func.h>
 #include <asm/setjmp.h>
 
 /**
arch/arm/cpu/armv8/fsl-layerscape/spl.c +1 -0
index 3f6a5f6a42..58a39e1123 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <spl.h>
 #include <asm/io.h>
arch/arm/cpu/pxa/pxa2xx.c +1 -0
index 14fe307c1a..7d6abf4dbc 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/io.h>
 #include <asm/system.h>
arch/arm/cpu/sa1100/cpu.c +1 -0
index f81ebc9ba2..6a849ffeaf 100644
@@ -15,6 +15,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <asm/system.h>
 #include <asm/io.h>
 
arch/arm/lib/cache-cp15.c +1 -0
index 8ca8e48380..f8d20960da 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/system.h>
 #include <asm/cache.h>
 #include <linux/compiler.h>
arch/arm/mach-at91/armv7/cpu.c +1 -0
index 638645c7e4..4474a96743 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <vsprintf.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
arch/arm/mach-bcm283x/init.c +1 -0
index 97414415a6..698271185a 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 int arch_cpu_init(void)
 {
arch/arm/mach-exynos/soc.c +1 -0
index 2ae9a43b4e..c4cf59dabb 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/system.h>
 
arch/arm/mach-imx/cache.c +1 -0
index a605942503..4fd2e43448 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/armv7.h>
 #include <asm/pl310.h>
 #include <asm/io.h>
arch/arm/mach-imx/imx8/cpu.c +1 -0
index d393a01178..d31af47c31 100644
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <clk.h>
 #include <cpu.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
arch/arm/mach-imx/imx8m/soc.c +1 -0
index 9a203e4736..181c715be3 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
arch/arm/mach-imx/mx5/soc.c +1 -0
index bbb335e275..b3a57bcf4b 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
arch/arm/mach-keystone/init.c +1 -0
index 3dee300d77..375588894d 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <ns16550.h>
 #include <asm/io.h>
 #include <asm/arch/msmc.h>
arch/arm/mach-mediatek/cpu.c +1 -0
index 1923c9e527..5e5f3f0842 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <wdt.h>
 #include <dm/uclass-internal.h>
arch/arm/mach-mvebu/armada8k/cpu.c +1 -0
index 959a7cff76..529dac9059 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <linux/libfdt.h>
arch/arm/mach-mvebu/cpu.c +1 -0
index f4b7a4fa80..fb241c7e4d 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <ahci.h>
+#include <cpu_func.h>
 #include <linux/mbus.h>
 #include <asm/io.h>
 #include <asm/pl310.h>
arch/arm/mach-omap2/omap-cache.c +1 -0
index d58a0a15ff..1eff9be270 100644
@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/cache.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/mach-orion5x/cpu.c +1 -0
index 79b5f4f34f..5a693e20bb 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <netdev.h>
 #include <asm/cache.h>
 #include <asm/io.h>
arch/arm/mach-rmobile/cpu_info.c +1 -0
index 9ef94a4899..2cc701c4f5 100644
@@ -4,6 +4,7 @@
  * (C) Copyright 2012 Renesas Solutions Corp.
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <env.h>
 #include <linux/ctype.h>
arch/arm/mach-rmobile/memmap-gen3.c +1 -0
index 1a9eb72bb9..578cb9bfd3 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/armv8/mmu.h>
 
 #define GEN3_NR_REGIONS 16
arch/arm/mach-rockchip/board.c +1 -0
index 8ca3463731..3208674ed5 100644
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <ram.h>
 #include <syscon.h>
arch/arm/mach-s5pc1xx/cache.c +1 -0
index 0b879b545d..7816ba1177 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
 void enable_caches(void)
arch/arm/mach-socfpga/misc.c +1 -0
index 49dadd4c3d..904b3d030a 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <errno.h>
 #include <fdtdec.h>
arch/arm/mach-socfpga/spl_a10.c +1 -0
index b820cb0673..d36732447b 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/pl310.h>
 #include <asm/u-boot.h>
arch/arm/mach-stm32mp/cpu.c +1 -0
index a46e8438f7..ed7d9f61dc 100644
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <debug_uart.h>
 #include <env.h>
 #include <misc.h>
arch/arm/mach-sunxi/board.c +1 -0
index db506367bf..aa1d2230c9 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <mmc.h>
 #include <i2c.h>
 #include <serial.h>
arch/arm/mach-tegra/board.c +1 -0
index abcae15ea3..61eaba711a 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <ns16550.h>
 #include <spl.h>
arch/arm/mach-uniphier/arm32/cache-uniphier.c +1 -0
index 023b3396f5..b6e4abbad0 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <asm/armv7.h>
arch/arm/mach-zynq/cpu.c +1 -0
index e5f557716b..aca44dfe67 100644
@@ -4,6 +4,7 @@
  * Copyright (C) 2012 Xilinx, Inc. All rights reserved.
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <zynqpl.h>
 #include <asm/io.h>
 #include <asm/arch/clk.h>
arch/m68k/cpu/mcf5227x/cpu_init.c +1 -0
index 3bbc42f508..7cde4c6105 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <watchdog.h>
 
 #include <asm/immap.h>
arch/m68k/cpu/mcf523x/cpu_init.c +1 -0
index 339fbeb429..9330042f39 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <watchdog.h>
 #include <asm/immap.h>
 #include <asm/io.h>
arch/m68k/cpu/mcf52x2/cpu_init.c +1 -0
index f4a3872667..dba6c23607 100644
@@ -18,6 +18,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <watchdog.h>
 #include <asm/immap.h>
 #include <asm/io.h>
arch/m68k/cpu/mcf530x/cpu_init.c +1 -0
index 27d06d92e2..166720aef5 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <watchdog.h>
 #include <asm/immap.h>
 #include <asm/io.h>
arch/m68k/cpu/mcf532x/cpu_init.c +1 -0
index cbf840f76e..041ada0d16 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <watchdog.h>
 #include <asm/immap.h>
 #include <asm/io.h>
arch/m68k/cpu/mcf5445x/cpu_init.c +1 -0
index 134510b00f..9c5b8122a6 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <watchdog.h>
 #include <asm/immap.h>
 #include <asm/processor.h>
arch/m68k/cpu/mcf547x_8x/cpu_init.c +1 -0
index 81ffc6c094..3f8c38c520 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <MCD_dma.h>
+#include <cpu_func.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
arch/m68k/lib/cache.c +1 -0
index 29f863b8b4..68f2eef584 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/immap.h>
 #include <asm/cache.h>
 
arch/microblaze/cpu/cache.c +1 -0
index 94114555ff..02f66f9087 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/asm.h>
 
 int dcache_status(void)
arch/mips/lib/cache.c +1 -0
index 0ddae30f2c..502956d050 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/cacheops.h>
 #ifdef CONFIG_MIPS_L2_CACHE
 #include <asm/cm.h>
arch/nds32/cpu/n1213/ae3xx/cpu.c +1 -0
index c5a7a3fd0a..a53bed1970 100644
@@ -15,6 +15,7 @@
 /* CPU specific code */
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <watchdog.h>
 #include <asm/cache.h>
 
arch/nds32/cpu/n1213/ag101/cpu.c +1 -0
index c9cb4333ba..34443b58c8 100644
@@ -15,6 +15,7 @@
 /* CPU specific code */
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <watchdog.h>
 #include <asm/cache.h>
 
arch/nds32/lib/cache.c +1 -0
index 27065136dd..e11d300b6d 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
 static inline unsigned long CACHE_SET(unsigned char cache)
 {
arch/nios2/lib/cache.c +1 -0
index c2cdee3e9e..0b961ac676 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/cache.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/powerpc/cpu/mpc83xx/spd_sdram.c +1 -0
index 08918a9d75..a14a438b02 100644
@@ -13,6 +13,7 @@
 #ifndef CONFIG_MPC83XX_SDRAM
 
 #include <common.h>
+#include <cpu_func.h>
 #include <vsprintf.h>
 #include <asm/processor.h>
 #include <asm/io.h>
arch/powerpc/cpu/mpc8xx/cache.c +1 -0
index 8051d3e8d2..41559009ca 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/processor.h>
 #include <asm/ppc.h>
 #include <asm/io.h>
arch/riscv/cpu/ax25/cache.c +1 -0
index 41de30cc02..1455f2298f 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/uclass-internal.h>
 #include <cache.h>
arch/riscv/cpu/ax25/cpu.c +1 -0
index 76689b21d3..0534b37f5d 100644
@@ -6,6 +6,7 @@
 
 /* CPU specific code */
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/cache.h>
 
 /*
arch/riscv/lib/cache.c +1 -0
index 5437a122a1..b1d42bcc2b 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 void invalidate_icache_all(void)
 {
arch/sh/cpu/sh4/cache.c +1 -0
index 5049090424..2f49ce8681 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/system.h>
arch/x86/cpu/cpu.c +1 -0
index 9ee4b0294a..4e59476fc9 100644
@@ -21,6 +21,7 @@
 #include <common.h>
 #include <acpi_s3.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
arch/x86/cpu/i386/cpu.c +1 -0
index 31663714a0..c66382bdd2 100644
@@ -19,6 +19,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <asm/control_regs.h>
 #include <asm/cpu.h>
arch/x86/cpu/mtrr.c +1 -0
index a00db422e7..a43cb7fc15 100644
@@ -17,6 +17,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/msr.h>
 #include <asm/mtrr.h>
arch/x86/lib/spl.c +1 -0
index 1677f80b25..d4e647777a 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <debug_uart.h>
 #include <dm.h>
 #include <malloc.h>
arch/xtensa/lib/cache.c +1 -0
index 8f13f1fb63..4e0c0acc3b 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/cache.h>
 
 /*
board/armltd/integrator/integrator.c +1 -0
index f0fbe2b417..5cdf7905a9 100644
@@ -17,6 +17,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <env.h>
 #include <netdev.h>
board/cirrus/edb93xx/edb93xx.c +1 -0
index 88fac76ea5..0966e37e7a 100644
@@ -15,6 +15,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <netdev.h>
 #include <status_led.h>
 #include <asm/io.h>
board/cobra5272/flash.c +1 -0
index 9bf824889a..ea3ed73515 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <console.h>
+#include <cpu_func.h>
 
 #define PHYS_FLASH_1 CONFIG_SYS_FLASH_BASE
 #define FLASH_BANK_SIZE 0x200000
board/highbank/highbank.c +1 -0
index 9563763dfa..3e0edd48f5 100644
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <ahci.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <netdev.h>
 #include <scsi.h>
board/st/stih410-b2260/board.c +1 -0
index 111e64b995..5d9fdf27b2 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/usb/otg.h>
 #include <dwc3-sti-glue.h>
 #include <dwc3-uboot.h>
board/synopsys/hsdk/hsdk.c +1 -0
index 8a7642a0aa..470d09e528 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <linux/printk.h>
 #include <linux/kernel.h>
board/syteco/zmx25/zmx25.c +1 -0
index d2318457b4..a2e7b8baaa 100644
@@ -14,6 +14,7 @@
  *   RedBoot tx25_misc.c Copyright (C) 2009 Red Hat
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
board/toradex/colibri_pxa270/colibri_pxa270.c +1 -0
index e9e17508a5..c4db516b07 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/pxa.h>
board/xilinx/zynqmp/cmds.c +1 -0
index d3bb57a2e9..893616b6a1 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <malloc.h>
 #include <zynqmp_firmware.h>
cmd/cache.c +1 -0
index 2c687173a8..27dcec0931 100644
@@ -9,6 +9,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <linux/compiler.h>
 
 static int parse_argv(const char *);
cmd/ti/ddr3.c +1 -0
index 448a7f54a9..55130898c9 100644
@@ -5,6 +5,7 @@
  * Copyright (C) 2012-2017 Texas Instruments Incorporated, <www.ti.com>
  */
 
+#include <cpu_func.h>
 #include <asm/arch/hardware.h>
 #include <asm/cache.h>
 #include <asm/emif.h>
common/bootm_os.c +1 -0
index 6fb7d658da..de0709f8ba 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <bootm.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <fdt_support.h>
 #include <linux/libfdt.h>
common/kgdb_stubs.c +1 -0
index afa7d6403a..c061126bed 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <kgdb.h>
 #include <serial.h>
 
common/spl/spl_atf.c +1 -0
index 0498d0a2c9..df29274207 100644
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <atf_common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <spl.h>
 
drivers/ddr/altera/sdram_arria10.c +1 -0
index 1777e7e1a5..2fd50b7ae5 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <fdtdec.h>
 #include <malloc.h>
drivers/ddr/altera/sdram_s10.c +1 -0
index 56cbbac9fe..82d9a13efa 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <div64.h>
drivers/fpga/zynqpl.c +1 -0
index 069c63ba45..21624f715b 100644
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <console.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <fs.h>
 #include <zynqpl.h>
drivers/video/cfb_console.c +1 -0
index e5c077e4f5..5442bac4c6 100644
@@ -65,6 +65,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <fdtdec.h>
 #include <gzip.h>
include/common.h +1 -9
index 82b1abe698..48eb223627 100644
@@ -3,7 +3,7 @@
  * Common header file for U-Boot
  *
  * This file still includes quite a bit of stuff that should be in separate
- * headers like command.h and cpu.h. Please think before adding more things.
+ * headers like command.h. Please think before adding more things.
  * Patches to remove things are welcome.
  *
  * (C) Copyright 2000-2009
@@ -185,14 +185,6 @@ int board_early_init_r (void);
 int testdram(void);
 #endif /* CONFIG_SYS_DRAM_TEST */
 
-/* $(CPU)/start.S */
-int	icache_status (void);
-void	icache_enable (void);
-void	icache_disable(void);
-int	dcache_status(void);
-void	dcache_enable (void);
-void	dcache_disable(void);
-void	mmu_disable(void);
 #if defined(CONFIG_ARM)
 void	relocate_code(ulong);
 #else
include/cpu_func.h +8 -0
index 1741f7f7a6..a14d23a36d 100644
@@ -52,4 +52,12 @@ int checkcpu(void);
 void smp_set_core_boot_addr(unsigned long addr, int corenr);
 void smp_kick_all_cpus(void);
 
+int icache_status(void);
+void icache_enable(void);
+void icache_disable(void);
+int dcache_status(void);
+void dcache_enable(void);
+void dcache_disable(void);
+void mmu_disable(void);
+
 #endif
post/cpu/mpc83xx/ecc.c +1 -0
index 03b6d65fe9..65a490d357 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <mpc83xx.h>
 #include <watchdog.h>
 #include <asm/io.h>
post/lib_powerpc/cpu.c +1 -0
index 6713039330..8506fd6b71 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 /*
  * CPU test
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#38 lore raw

PATCH v4 29/42 common: Move some cache and MMU functions out of common.h

Quoted 8 lines · Simon Glass

These functions belong in cpu_func.h. Another option would be cache.h but that code uses driver model and we have not moved these cache functions to use driver model. Since they are CPU-related it seems reasonable to put them here.

Move them over.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/240a9350/attachment.sig>
#39 lore raw

PATCH v4 30/42 common: Drop checkicache() and checkdcache()

In reply to Simon Glass

These are used by only one arch and only within a single file. Drop the declarations from the common file.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/powerpc/cpu/mpc8xx/cpu.c | 130 +++++++++++++++++-----------------
 include/common.h              |   2 -
 2 files changed, 65 insertions(+), 67 deletions(-)
arch/powerpc/cpu/mpc8xx/cpu.c +65 -65
index 2b7c5d4301..0604433e72 100644
@@ -35,70 +35,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static int check_CPU(long clock, uint pvr, uint immr)
-{
-	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
-	uint k;
-	char buf[32];
-
-	/* the highest 16 bits should be 0x0050 for a 860 */
-
-	if (PVR_VER(pvr) != PVR_VER(PVR_8xx))
-		return -1;
-
-	k = (immr << 16) |
-	    in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]);
-
-	/*
-	 * Some boards use sockets so different CPUs can be used.
-	 * We have to check chip version in run time.
-	 */
-	switch (k) {
-		/* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
-	case 0x08010004:		/* Rev. A.0 */
-		printf("MPC866xxxZPnnA");
-		break;
-	case 0x08000003:		/* Rev. 0.3 */
-		printf("MPC866xxxZPnn");
-		break;
-	case 0x09000000:		/* 870/875/880/885 */
-		puts("MPC885ZPnn");
-		break;
-
-	default:
-		printf("unknown MPC86x (0x%08x)", k);
-		break;
-	}
-
-	printf(" at %s MHz: ", strmhz(buf, clock));
-
-	print_size(checkicache(), " I-Cache ");
-	print_size(checkdcache(), " D-Cache");
-
-	/* do we have a FEC (860T/P or 852/859/866/885)? */
-
-	out_be32(&immap->im_cpm.cp_fec.fec_addr_low, 0x12345678);
-	if (in_be32(&immap->im_cpm.cp_fec.fec_addr_low) == 0x12345678)
-		printf(" FEC present");
-
-	putc('\n');
-
-	return 0;
-}
-
-/* ------------------------------------------------------------------------- */
-
-int checkcpu(void)
-{
-	ulong clock = gd->cpu_clk;
-	uint immr = get_immr();	/* Return full IMMR contents */
-	uint pvr = get_pvr();
-
-	puts("CPU:   ");
-
-	return check_CPU(clock, pvr, immr);
-}
-
 /* ------------------------------------------------------------------------- */
 /* L1 i-cache                                                                */
 
@@ -143,7 +79,7 @@ int checkicache(void)
 /* L1 d-cache                                                                */
 /* call with cache disabled                                                  */
 
-int checkdcache(void)
+static int checkdcache(void)
 {
 	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
 	memctl8xx_t __iomem *memctl = &immap->im_memctl;
@@ -175,6 +111,70 @@ int checkdcache(void)
 	return lines << 4;
 };
 
+static int check_CPU(long clock, uint pvr, uint immr)
+{
+	immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;
+	uint k;
+	char buf[32];
+
+	/* the highest 16 bits should be 0x0050 for a 860 */
+
+	if (PVR_VER(pvr) != PVR_VER(PVR_8xx))
+		return -1;
+
+	k = (immr << 16) |
+	    in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]);
+
+	/*
+	 * Some boards use sockets so different CPUs can be used.
+	 * We have to check chip version in run time.
+	 */
+	switch (k) {
+		/* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
+	case 0x08010004:		/* Rev. A.0 */
+		printf("MPC866xxxZPnnA");
+		break;
+	case 0x08000003:		/* Rev. 0.3 */
+		printf("MPC866xxxZPnn");
+		break;
+	case 0x09000000:		/* 870/875/880/885 */
+		puts("MPC885ZPnn");
+		break;
+
+	default:
+		printf("unknown MPC86x (0x%08x)", k);
+		break;
+	}
+
+	printf(" at %s MHz: ", strmhz(buf, clock));
+
+	print_size(checkicache(), " I-Cache ");
+	print_size(checkdcache(), " D-Cache");
+
+	/* do we have a FEC (860T/P or 852/859/866/885)? */
+
+	out_be32(&immap->im_cpm.cp_fec.fec_addr_low, 0x12345678);
+	if (in_be32(&immap->im_cpm.cp_fec.fec_addr_low) == 0x12345678)
+		printf(" FEC present");
+
+	putc('\n');
+
+	return 0;
+}
+
+/* ------------------------------------------------------------------------- */
+
+int checkcpu(void)
+{
+	ulong clock = gd->cpu_clk;
+	uint immr = get_immr();	/* Return full IMMR contents */
+	uint pvr = get_pvr();
+
+	puts("CPU:   ");
+
+	return check_CPU(clock, pvr, immr);
+}
+
 /* ------------------------------------------------------------------------- */
 
 void upmconfig(uint upm, uint *table, uint size)
include/common.h +0 -2
index 48eb223627..423f1023ad 100644
@@ -195,8 +195,6 @@ void	trap_init     (ulong);
 
 void s_init(void);
 
-int	checkicache   (void);
-int	checkdcache   (void);
 void	upmconfig     (unsigned int, unsigned int *, unsigned int);
 ulong	get_tbclk     (void);
 void	reset_misc    (void);
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#40 lore raw

PATCH v4 31/42 common: Move ARM cache operations out of common.h

In reply to Simon Glass

These functions are CPU-related and do not use driver model. Move them to cpu_func.h

---

Changes in v4:
- Use cpu_func.h instead of cpu_legacy.h
- Use irq_func.h instead of irq_legacy.h

Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c       |  1 +
 arch/arm/cpu/armv7/cache_v7.c              |  1 +
 arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c  |  1 +
 arch/arm/cpu/armv8/sec_firmware.c          |  1 +
 arch/arm/cpu/pxa/cache.c                   |  1 +
 arch/arm/lib/cache.c                       |  1 +
 arch/arm/mach-bcm283x/mbox.c               |  1 +
 arch/arm/mach-imx/mx7/psci-mx7.c           |  1 +
 arch/arm/mach-omap2/sec-common.c           |  1 +
 arch/arm/mach-tegra/ivc.c                  |  1 +
 arch/microblaze/lib/bootm.c                |  1 +
 arch/mips/lib/reloc.c                      |  1 +
 arch/mips/lib/traps.c                      |  1 +
 arch/mips/mach-jz47xx/jz4780/jz4780.c      |  1 +
 arch/mips/mach-mtmips/ddr_calibrate.c      |  1 +
 arch/nds32/cpu/n1213/ae3xx/cpu.c           |  1 +
 arch/nios2/cpu/cpu.c                       |  1 +
 arch/nios2/lib/bootm.c                     |  1 +
 arch/powerpc/lib/bootm.c                   |  1 +
 arch/powerpc/lib/cache.c                   |  1 +
 arch/riscv/cpu/ax25/cpu.c                  |  1 +
 arch/riscv/lib/smp.c                       |  1 +
 arch/riscv/lib/spl.c                       |  1 +
 arch/sandbox/cpu/cpu.c                     |  1 +
 arch/x86/cpu/quark/dram.c                  |  1 +
 arch/xtensa/lib/bootm.c                    |  1 +
 board/Arcturus/ucp1020/cmd_arc.c           |  1 +
 board/beckhoff/mx53cx9020/mx53cx9020.c     |  1 +
 board/broadcom/bcmstb/bcmstb.c             |  1 +
 board/cirrus/edb93xx/edb93xx.c             |  1 +
 board/phytec/pfla02/pfla02.c               |  1 +
 board/sandbox/sandbox.c                    |  1 +
 cmd/disk.c                                 |  1 +
 cmd/load.c                                 |  1 +
 cmd/ximg.c                                 |  1 +
 common/avb_verify.c                        |  1 +
 common/board_r.c                           |  1 +
 common/bootm.c                             |  1 +
 common/bouncebuf.c                         |  1 +
 common/image.c                             |  1 +
 common/lcd.c                               |  1 +
 common/spl/spl_opensbi.c                   |  1 +
 common/update.c                            |  1 +
 drivers/ata/ahci.c                         |  1 +
 drivers/ata/dwc_ahsata.c                   |  1 +
 drivers/ata/fsl_ahci.c                     |  1 +
 drivers/ata/fsl_sata.c                     |  1 +
 drivers/ata/sata_mv.c                      |  1 +
 drivers/ata/sata_sil.c                     |  1 +
 drivers/bootcount/bootcount.c              |  1 +
 drivers/bootcount/bootcount_ram.c          |  1 +
 drivers/core/device.c                      |  1 +
 drivers/crypto/fsl/fsl_blob.c              |  1 +
 drivers/crypto/fsl/fsl_hash.c              |  1 +
 drivers/crypto/fsl/jobdesc.c               |  1 +
 drivers/crypto/fsl/jr.c                    |  1 +
 drivers/dma/apbh_dma.c                     |  1 +
 drivers/dma/bcm6348-iudma.c                |  1 +
 drivers/dma/dma-uclass.c                   |  1 +
 drivers/dma/ti/k3-udma.c                   |  1 +
 drivers/fpga/versalpl.c                    |  1 +
 drivers/fpga/zynqmppl.c                    |  1 +
 drivers/mmc/dw_mmc.c                       |  1 +
 drivers/mmc/fsl_esdhc.c                    |  1 +
 drivers/mmc/fsl_esdhc_imx.c                |  1 +
 drivers/mmc/fsl_esdhc_spl.c                |  1 +
 drivers/mmc/meson_gx_mmc.c                 |  1 +
 drivers/mmc/omap_hsmmc.c                   |  1 +
 drivers/mmc/sdhci.c                        |  1 +
 drivers/mmc/stm32_sdmmc2.c                 |  1 +
 drivers/mmc/tmio-common.c                  |  1 +
 drivers/mtd/nand/raw/denali.c              |  1 +
 drivers/mtd/nand/raw/fsl_elbc_spl.c        |  1 +
 drivers/mtd/nand/raw/fsl_ifc_spl.c         |  1 +
 drivers/mtd/nand/raw/mxs_nand.c            |  1 +
 drivers/mtd/pic32_flash.c                  |  1 +
 drivers/mtd/spi/fsl_espi_spl.c             |  1 +
 drivers/net/ag7xxx.c                       |  1 +
 drivers/net/altera_tse.c                   |  1 +
 drivers/net/bcm-sf2-eth-gmac.c             |  1 +
 drivers/net/designware.c                   |  1 +
 drivers/net/dwc_eth_qos.c                  |  1 +
 drivers/net/e1000.c                        |  1 +
 drivers/net/ethoc.c                        |  1 +
 drivers/net/fec_mxc.c                      |  1 +
 drivers/net/fsl-mc/mc.c                    |  1 +
 drivers/net/ftgmac100.c                    |  1 +
 drivers/net/ftmac100.c                     |  1 +
 drivers/net/higmacv300.c                   |  1 +
 drivers/net/ldpaa_eth/ldpaa_eth.c          |  1 +
 drivers/net/macb.c                         |  1 +
 drivers/net/mt7628-eth.c                   |  1 +
 drivers/net/mtk_eth.c                      |  1 +
 drivers/net/mvneta.c                       |  1 +
 drivers/net/mvpp2.c                        |  1 +
 drivers/net/pch_gbe.c                      |  1 +
 drivers/net/pcnet.c                        |  1 +
 drivers/net/pic32_eth.c                    |  1 +
 drivers/net/ravb.c                         |  1 +
 drivers/net/rtl8139.c                      |  1 +
 drivers/net/rtl8169.c                      |  1 +
 drivers/net/sh_eth.c                       |  1 +
 drivers/net/sni_ave.c                      |  1 +
 drivers/net/sun8i_emac.c                   |  1 +
 drivers/net/ti/cpsw.c                      |  1 +
 drivers/net/ti/davinci_emac.c              |  1 +
 drivers/net/xilinx_axi_emac.c              |  1 +
 drivers/net/zynq_gem.c                     |  1 +
 drivers/nvme/nvme.c                        |  1 +
 drivers/remoteproc/rproc-elf-loader.c      |  1 +
 drivers/spi/mxs_spi.c                      |  1 +
 drivers/spi/ti_qspi.c                      |  1 +
 drivers/spi/zynqmp_gqspi.c                 |  1 +
 drivers/usb/dwc3/core.c                    |  1 +
 drivers/usb/dwc3/dwc3-generic.c            |  1 +
 drivers/usb/dwc3/ep0.c                     |  1 +
 drivers/usb/dwc3/gadget.c                  |  1 +
 drivers/usb/dwc3/io.h                      |  1 +
 drivers/usb/gadget/ci_udc.c                |  1 +
 drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c |  3 +++
 drivers/usb/gadget/fotg210.c               |  1 +
 drivers/usb/host/dwc2.c                    |  1 +
 drivers/usb/host/ehci-hcd.c                |  1 +
 drivers/usb/host/ohci-hcd.c                |  1 +
 drivers/usb/host/xhci-mem.c                |  1 +
 drivers/usb/host/xhci-ring.c               |  1 +
 drivers/usb/host/xhci.c                    |  1 +
 drivers/video/atmel_hlcdfb.c               |  1 +
 drivers/video/sunxi/sunxi_display.c        |  1 +
 drivers/video/video-uclass.c               |  1 +
 include/common.h                           | 24 ----------------------
 include/cpu_func.h                         | 24 ++++++++++++++++++++++
 lib/efi_loader/efi_image_loader.c          |  1 +
 lib/efi_loader/efi_runtime.c               |  1 +
 post/cpu/mpc83xx/ecc.c                     |  1 +
 135 files changed, 159 insertions(+), 24 deletions(-)
arch/arm/cpu/arm926ejs/lpc32xx/cpu.c +1 -0
index 5117177474..4c59a44f7e 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <netdev.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clk.h>
arch/arm/cpu/armv7/cache_v7.c +1 -0
index 0dc4ebf694..99eb7db342 100644
@@ -4,6 +4,7 @@
  * Texas Instruments, <www.ti.com>
  * Aneesh V <[email protected]>
  */
+#include <cpu_func.h>
 #include <linux/types.h>
 #include <common.h>
 #include <asm/armv7.h>
arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c +1 -0
index df64f5415a..4a4b3c6f23 100644
@@ -6,6 +6,7 @@
  */
 
 #include <config.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/psci.h>
 #include <asm/arch/immap_ls102xa.h>
arch/arm/cpu/armv8/sec_firmware.c +1 -0
index 8dc0ac9266..11f9b4df38 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <linux/kernel.h>
 #include <asm/io.h>
arch/arm/cpu/pxa/cache.c +1 -0
index 5cd4a9524b..d4dfe7f6d8 100644
@@ -3,6 +3,7 @@
  * (C) Copyright 2016 Vasily Khoruzhick <[email protected]>
  */
 
+#include <cpu_func.h>
 #include <linux/types.h>
 #include <common.h>
 
arch/arm/lib/cache.c +1 -0
index 463d283cb7..007d4ebc49 100644
@@ -7,6 +7,7 @@
 /* for now: just dummy functions to satisfy the linker */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 
 /*
arch/arm/mach-bcm283x/mbox.c +1 -0
index 3c67f68c17..00c6afb15f 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/mbox.h>
 #include <phys2bus.h>
arch/arm/mach-imx/mx7/psci-mx7.c +1 -0
index c98d2e96af..c8f6ca235b 100644
@@ -4,6 +4,7 @@
  * Copyright 2017 NXP
  */
 
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/psci.h>
 #include <asm/secure.h>
arch/arm/mach-omap2/sec-common.c +1 -0
index b45d3ee544..e9b3e746fe 100644
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <stdarg.h>
 
 #include <asm/arch/sys_proto.h>
arch/arm/mach-tegra/ivc.c +1 -0
index 65b1cfc07d..a448f2df30 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch-tegra/ivc.h>
 
arch/microblaze/lib/bootm.c +1 -0
index 01c5d57bc5..efd5acf359 100644
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <fdt_support.h>
 #include <image.h>
arch/mips/lib/reloc.c +1 -0
index c6a517d66f..e68f49467c 100644
@@ -27,6 +27,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/relocs.h>
 #include <asm/sections.h>
 
arch/mips/lib/traps.c +1 -0
index 976978c3e9..b4bcdf8150 100644
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/mipsregs.h>
 #include <asm/addrspace.h>
 #include <asm/system.h>
arch/mips/mach-jz47xx/jz4780/jz4780.c +1 -0
index dbd328cb49..ec18df8879 100644
@@ -8,6 +8,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/sections.h>
 #include <mach/jz4780.h>
arch/mips/mach-mtmips/ddr_calibrate.c +1 -0
index 75763c4528..3cd440804d 100644
@@ -17,6 +17,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/io.h>
 #include <asm/cacheops.h>
 #include <asm/io.h>
arch/nds32/cpu/n1213/ae3xx/cpu.c +1 -0
index a53bed1970..0660fffa45 100644
@@ -16,6 +16,7 @@
 #include <common.h>
 #include <command.h>
 #include <cpu_func.h>
+#include <irq_func.h>
 #include <watchdog.h>
 #include <asm/cache.h>
 
arch/nios2/cpu/cpu.c +1 -0
index 1fc79213e2..05b26e8d20 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <cpu.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/cache.h>
arch/nios2/lib/bootm.c +1 -0
index 485d5ae540..a68b091f87 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 #define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */
 
arch/powerpc/lib/bootm.c +1 -0
index 84691b7554..f2e670eb6b 100644
@@ -8,6 +8,7 @@
 
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <watchdog.h>
 #include <command.h>
arch/powerpc/lib/cache.c +1 -0
index 2d36c3aa08..3c3c470bbb 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/cache.h>
 #include <watchdog.h>
 
arch/riscv/cpu/ax25/cpu.c +1 -0
index 0534b37f5d..f092600e14 100644
@@ -7,6 +7,7 @@
 /* CPU specific code */
 #include <common.h>
 #include <cpu_func.h>
+#include <irq_func.h>
 #include <asm/cache.h>
 
 /*
arch/riscv/lib/smp.c +1 -0
index cc66f15567..705437862a 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <asm/barrier.h>
 #include <asm/smp.h>
arch/riscv/lib/spl.c +1 -0
index bea8695987..a544df0a2b 100644
@@ -4,6 +4,7 @@
  * Lukas Auer <[email protected]>
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <spl.h>
 #include <asm/smp.h>
 
arch/sandbox/cpu/cpu.c +1 -0
index f3af88d79e..ff7430393f 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <linux/libfdt.h>
arch/x86/cpu/quark/dram.c +1 -0
index 51f9659ab1..1b764dfccd 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <fdtdec.h>
 #include <malloc.h>
arch/xtensa/lib/bootm.c +1 -0
index 93eea53c5f..057b229433 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
board/Arcturus/ucp1020/cmd_arc.c +1 -0
index 2e8477ed3b..b50de63c5e 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <div64.h>
 #include <env.h>
 #include <malloc.h>
board/beckhoff/mx53cx9020/mx53cx9020.c +1 -0
index 9450d925f6..1b1b688f19 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux-mx53.h>
board/broadcom/bcmstb/bcmstb.c +1 -0
index 23500dfa69..12b9dba612 100644
@@ -6,6 +6,7 @@
  * Author: Thomas Fitzsimmons <[email protected]>
  */
 
+#include <cpu_func.h>
 #include <time.h>
 #include <linux/types.h>
 #include <common.h>
board/cirrus/edb93xx/edb93xx.c +1 -0
index 0966e37e7a..dfebb7c1c1 100644
@@ -16,6 +16,7 @@
 #include <config.h>
 #include <common.h>
 #include <cpu_func.h>
+#include <irq_func.h>
 #include <netdev.h>
 #include <status_led.h>
 #include <asm/io.h>
board/phytec/pfla02/pfla02.c +1 -0
index ae9ffe0390..f498fdf807 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
board/sandbox/sandbox.c +1 -0
index 9ca1eca027..438f9a47ed 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <cros_ec.h>
 #include <dm.h>
 #include <led.h>
cmd/disk.c +1 -0
index 9e635c1172..437c175374 100644
@@ -5,6 +5,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <part.h>
 
 int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
cmd/load.c +1 -0
index 5811a99310..3bfc1b41ec 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <s_record.h>
 #include <net.h>
cmd/ximg.c +1 -0
index a9481004f0..22b2037a33 100644
@@ -13,6 +13,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <gzip.h>
 #include <image.h>
common/avb_verify.c +1 -0
index 36898a610f..a2b739626b 100644
@@ -6,6 +6,7 @@
 
 #include <avb_verify.h>
 #include <blk.h>
+#include <cpu_func.h>
 #include <fastboot.h>
 #include <image.h>
 #include <malloc.h>
common/board_r.c +1 -0
index 05e08212b4..6a421002dd 100644
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <api.h>
+#include <cpu_func.h>
 #include <u-boot/crc.h>
 /* TODO: can we just include all these headers whether needed or not? */
 #if defined(CONFIG_CMD_BEDBUG)
common/bootm.c +1 -0
index 02295daf79..3bbe490ab9 100644
@@ -7,6 +7,7 @@
 #ifndef USE_HOSTCC
 #include <common.h>
 #include <bootstage.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <errno.h>
 #include <fdt_support.h>
common/bouncebuf.c +1 -0
index a7098e2caf..614eb36c78 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <errno.h>
 #include <bouncebuf.h>
common/image.c +1 -0
index 1c8ac2df70..eb626dcac9 100644
@@ -8,6 +8,7 @@
 
 #ifndef USE_HOSTCC
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <u-boot/crc.h>
 #include <watchdog.h>
common/lcd.c +1 -0
index b34754fe51..f8bc1ceba7 100644
@@ -10,6 +10,7 @@
 #include <config.h>
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env_callback.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
common/spl/spl_opensbi.c +1 -0
index a6b4480ed2..2345f949f0 100644
@@ -6,6 +6,7 @@
  * Based on common/spl/spl_atf.c
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <spl.h>
 #include <asm/smp.h>
common/update.c +1 -0
index 457b29f42a..13b09ab00f 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 #if !(defined(CONFIG_FIT) && defined(CONFIG_OF_LIBFDT))
 #error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature"
drivers/ata/ahci.c +1 -0
index d10f9f0bf8..4cd7420c3c 100644
@@ -9,6 +9,7 @@
  * This driver provides a SCSI interface to SATA.
  */
 #include <common.h>
+#include <cpu_func.h>
 
 #include <command.h>
 #include <dm.h>
drivers/ata/dwc_ahsata.c +1 -0
index afced8e7e3..c2e28fe518 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <ahci.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dwc_ahsata.h>
 #include <fis.h>
drivers/ata/fsl_ahci.c +1 -0
index d04cff3ee7..4ccfe23593 100644
@@ -6,6 +6,7 @@
  *
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/fsl_serdes.h>
 #include <dm/lists.h>
 #include <dm.h>
drivers/ata/fsl_sata.c +1 -0
index e70a515eff..96a8f2f0c6 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/fsl_serdes.h>
drivers/ata/sata_mv.c +1 -0
index 2a630d46c1..6019ac089e 100644
@@ -33,6 +33,7 @@
 
 #include <common.h>
 #include <ahci.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
drivers/ata/sata_sil.c +1 -0
index a8598d9f21..ae832c5a16 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <pci.h>
 #include <command.h>
 #include <asm/byteorder.h>
drivers/bootcount/bootcount.c +1 -0
index 66c1284c5b..7a6d03dcca 100644
@@ -5,6 +5,7 @@
  */
 
 #include <bootcount.h>
+#include <cpu_func.h>
 #include <linux/compiler.h>
 
 /* Now implement the generic default functions */
drivers/bootcount/bootcount_ram.c +1 -0
index edef36724b..9c678e25f4 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
drivers/core/device.c +1 -0
index 8eabaf8b55..4e037083a6 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <clk.h>
 #include <fdtdec.h>
drivers/crypto/fsl/fsl_blob.c +1 -0
index ce6aa05fe7..0531b1b735 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <fsl_sec.h>
drivers/crypto/fsl/fsl_hash.c +1 -0
index c2686df02f..74e38ca759 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <memalign.h>
 #include "jobdesc.h"
drivers/crypto/fsl/jobdesc.c +1 -0
index 317f73c42b..637ef29f15 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <fsl_sec.h>
 #include "desc_constr.h"
 #include "jobdesc.h"
drivers/crypto/fsl/jr.c +1 -0
index 1ea9db6850..aa84f2cee0 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include "fsl_sec.h"
 #include "jr.h"
drivers/dma/apbh_dma.c +1 -0
index ac589feeb7..15133128be 100644
@@ -9,6 +9,7 @@
  * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
  */
 
+#include <cpu_func.h>
 #include <linux/list.h>
 
 #include <common.h>
drivers/dma/bcm6348-iudma.c +1 -0
index e7bd1b2350..96250eb5d2 100644
@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dma-uclass.h>
 #include <memalign.h>
drivers/dma/dma-uclass.c +1 -0
index 9c961cf1e2..0ff56f7e88 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/read.h>
 #include <dma-uclass.h>
drivers/dma/ti/k3-udma.c +1 -0
index a5fc7809bc..2e64d338ca 100644
@@ -6,6 +6,7 @@
 #define pr_fmt(fmt) "udma: " fmt
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
 #include <malloc.h>
drivers/fpga/versalpl.c +1 -0
index 4bcc213243..6c69ab7802 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/sys_proto.h>
 #include <memalign.h>
 #include <versalpl.h>
drivers/fpga/zynqmppl.c +1 -0
index d129b5459c..4a826e4a71 100644
@@ -7,6 +7,7 @@
 
 #include <console.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <zynqmppl.h>
 #include <zynqmp_firmware.h>
 #include <linux/sizes.h>
drivers/mmc/dw_mmc.c +1 -0
index ebe7bcdd90..1224540811 100644
@@ -7,6 +7,7 @@
 
 #include <bouncebuf.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <malloc.h>
 #include <memalign.h>
drivers/mmc/fsl_esdhc.c +1 -0
index 8ff84aa3a8..3b7bb216eb 100644
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <command.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <hwconfig.h>
 #include <mmc.h>
drivers/mmc/fsl_esdhc_imx.c +1 -0
index 4099386313..f1afab742d 100644
@@ -14,6 +14,7 @@
 #include <common.h>
 #include <command.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <hwconfig.h>
 #include <mmc.h>
drivers/mmc/fsl_esdhc_spl.c +1 -0
index 4557cd3dd7..3021c3d6d4 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <mmc.h>
 #include <malloc.h>
 
drivers/mmc/meson_gx_mmc.c +1 -0
index 031cc79ccb..b5f5122b1b 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <malloc.h>
drivers/mmc/omap_hsmmc.c +1 -0
index bade129aea..dab3425e97 100644
@@ -24,6 +24,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <mmc.h>
drivers/mmc/sdhci.c +1 -0
index fbc576fd72..e6fed1a08a 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
drivers/mmc/stm32_sdmmc2.c +1 -0
index 1726ed72ef..0a7a2fe624 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <linux/libfdt.h>
drivers/mmc/tmio-common.c +1 -0
index 812205a21f..669410d97f 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <fdtdec.h>
 #include <mmc.h>
 #include <dm.h>
drivers/mtd/nand/raw/denali.c +1 -0
index e0eb1339ec..0a7ca8a8df 100644
@@ -5,6 +5,7 @@
  * Copyright (C) 2009-2010, Intel Corporation and its suppliers.
  */
 
+#include <cpu_func.h>
 #include <dm.h>
 #include <nand.h>
 #include <linux/bitfield.h>
drivers/mtd/nand/raw/fsl_elbc_spl.c +1 -0
index 099d86427c..a62ab69ee1 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/fsl_lbc.h>
 #include <nand.h>
drivers/mtd/nand/raw/fsl_ifc_spl.c +1 -0
index 7137eb4108..0983fbced3 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <fsl_ifc.h>
 #include <linux/mtd/rawnand.h>
drivers/mtd/nand/raw/mxs_nand.c +1 -0
index ad7b644886..fe8097c146 100644
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/sizes.h>
drivers/mtd/pic32_flash.c +1 -0
index 5c55f1557f..8f09e5b250 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdt_support.h>
 #include <flash.h>
drivers/mtd/spi/fsl_espi_spl.c +1 -0
index b90e6a5527..580b1e24b7 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <spi_flash.h>
 #include <malloc.h>
 
drivers/net/ag7xxx.c +1 -0
index 7f1dee4b3e..804d5c20b6 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <miiphy.h>
drivers/net/altera_tse.c +1 -0
index fb878d4e63..aabddd6bb6 100644
@@ -9,6 +9,7 @@
  * published by the Free Software Foundation.
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <fdt_support.h>
drivers/net/bcm-sf2-eth-gmac.c +1 -0
index db3e79ade3..6a25f67c30 100644
@@ -11,6 +11,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <net.h>
 #include <asm/io.h>
drivers/net/designware.c +1 -0
index 0031370085..5c2d5e5a79 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <miiphy.h>
drivers/net/dwc_eth_qos.c +1 -0
index 455709338c..da5b696c9d 100644
@@ -28,6 +28,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <memalign.h>
drivers/net/e1000.c +1 -0
index a34f697461..0946011844 100644
@@ -30,6 +30,7 @@ tested on both gig copper and gig fiber boards
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <memalign.h>
drivers/net/ethoc.c +1 -0
index 3d43a58d4a..be5d9add61 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/platform_data/net_ethoc.h>
 #include <linux/io.h>
drivers/net/fec_mxc.c +1 -0
index 131d1998a7..2aa1029d42 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <env.h>
 #include <malloc.h>
drivers/net/fsl-mc/mc.c +1 -0
index c980ba4edb..6a9cf51fe4 100644
@@ -5,6 +5,7 @@
  * Copyright 2017-2018 NXP
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <errno.h>
 #include <linux/bug.h>
drivers/net/ftgmac100.c +1 -0
index 92c38a81bd..b6b8a93bb5 100644
@@ -12,6 +12,7 @@
  */
 
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <miiphy.h>
 #include <net.h>
drivers/net/ftmac100.c +1 -0
index d8f1dde657..24bb45f351 100644
@@ -8,6 +8,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <malloc.h>
 #include <net.h>
drivers/net/higmacv300.c +1 -0
index 1be8359133..897741ab82 100644
@@ -3,6 +3,7 @@
  * Copyright (c) 2019, Linaro Limited
  */
 
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <common.h>
 #include <console.h>
drivers/net/ldpaa_eth/ldpaa_eth.c +1 -0
index 34253e3924..a3b9c152b2 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/types.h>
 #include <malloc.h>
drivers/net/macb.c +1 -0
index 1a532b0e5a..f809f3eb07 100644
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 
 /*
drivers/net/mt7628-eth.c +1 -0
index a1d12f6902..404a046422 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <malloc.h>
 #include <miiphy.h>
drivers/net/mtk_eth.c +1 -0
index 0ef814c78b..c22e590387 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <malloc.h>
 #include <miiphy.h>
drivers/net/mvneta.c +1 -0
index 333be8ff28..6f76a6b0dc 100644
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <net.h>
 #include <netdev.h>
drivers/net/mvpp2.c +1 -0
index bd89725e77..8148c03d22 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
drivers/net/pch_gbe.c +1 -0
index 2286dd07e9..e4507bf7fd 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/io.h>
drivers/net/pcnet.c +1 -0
index eda6743ec3..b4ad11d3fa 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
drivers/net/pic32_eth.c +1 -0
index 39c4b10ab8..3458440b6f 100644
@@ -4,6 +4,7 @@
  *
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <dm.h>
 #include <net.h>
drivers/net/ravb.c +1 -0
index 11abe5e0c9..fb4a628d63 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <miiphy.h>
drivers/net/rtl8139.c +1 -0
index 13309970e2..bb59629f81 100644
@@ -72,6 +72,7 @@
 */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
drivers/net/rtl8169.c +1 -0
index 521e5909a2..53454f2f21 100644
@@ -40,6 +40,7 @@
  * Modified to use le32_to_cpu and cpu_to_le32 properly
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
drivers/net/sh_eth.c +1 -0
index 749f651920..183e8e3083 100644
@@ -10,6 +10,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <malloc.h>
 #include <net.h>
drivers/net/sni_ave.c +1 -0
index ba51ea5e38..6d333e24ee 100644
@@ -5,6 +5,7 @@
  */
 
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdt_support.h>
 #include <linux/io.h>
drivers/net/sun8i_emac.c +1 -0
index 0629b16e57..9551918796 100644
@@ -10,6 +10,7 @@
  *
 */
 
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/gpio.h>
drivers/net/ti/cpsw.c +1 -0
index 4a990be93e..93d53612b5 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <net.h>
 #include <miiphy.h>
 #include <malloc.h>
drivers/net/ti/davinci_emac.c +1 -0
index 2bd9c51079..9c6bfca5a9 100644
@@ -23,6 +23,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <net.h>
 #include <miiphy.h>
 #include <malloc.h>
drivers/net/xilinx_axi_emac.c +1 -0
index 36d651109c..b0450fff56 100644
@@ -7,6 +7,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <net.h>
 #include <malloc.h>
drivers/net/zynq_gem.c +1 -0
index a7a6ce987f..78f94148b4 100644
@@ -10,6 +10,7 @@
 
 #include <clk.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <net.h>
 #include <netdev.h>
drivers/nvme/nvme.c +1 -0
index cddcc2f11d..2593eb174b 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <memalign.h>
drivers/remoteproc/rproc-elf-loader.c +1 -0
index b38a226065..e8026cdfbb 100644
@@ -3,6 +3,7 @@
  * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <elf.h>
 #include <remoteproc.h>
drivers/spi/mxs_spi.c +1 -0
index 58b1c67a19..3ca30887fb 100644
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <spi.h>
drivers/spi/ti_qspi.c +1 -0
index 77fa17ee8a..c3d9e7f2ee 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/omap.h>
 #include <malloc.h>
drivers/spi/zynqmp_gqspi.c +1 -0
index c11f040200..4cca418012 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/io.h>
 #include <clk.h>
drivers/usb/dwc3/core.c +1 -0
index 23af60c98d..d01bda18c5 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dwc3-uboot.h>
 #include <asm/dma-mapping.h>
drivers/usb/dwc3/dwc3-generic.c +1 -0
index 24b320bbce..8d45748b3b 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm-generic/io.h>
 #include <dm.h>
 #include <dm/device-internal.h>
drivers/usb/dwc3/ep0.c +1 -0
index 818efb3e8d..0c8c11d743 100644
@@ -13,6 +13,7 @@
  * commit c00552ebaf : Merge 3.18-rc7 into usb-next
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 
drivers/usb/dwc3/gadget.c +1 -0
index 67d11b4c0d..4353dffb6b 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <asm/dma-mapping.h>
 #include <linux/bug.h>
drivers/usb/dwc3/io.h +1 -0
index f660d53231..2407f826c1 100644
@@ -17,6 +17,7 @@
 #ifndef __DRIVERS_USB_DWC3_IO_H
 #define __DRIVERS_USB_DWC3_IO_H
 
+#include <cpu_func.h>
 #include <asm/io.h>
 
 #define	CACHELINE_SIZE		CONFIG_SYS_CACHELINE_SIZE
drivers/usb/gadget/ci_udc.c +1 -0
index bd596ce977..d9cfff3a29 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <config.h>
+#include <cpu_func.h>
 #include <net.h>
 #include <malloc.h>
 #include <asm/byteorder.h>
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +3 -0
index 7eb632d3b1..e9e18568c1 100644
@@ -17,6 +17,9 @@
  * Lukasz Majewski <[email protected]>
  */
 
+#include <common.h>
+#include <cpu_func.h>
+
 static u8 clear_feature_num;
 int clear_feature_flag;
 
drivers/usb/gadget/fotg210.c +1 -0
index 176068cbfb..0866ef6531 100644
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <command.h>
 #include <config.h>
+#include <cpu_func.h>
 #include <net.h>
 #include <malloc.h>
 #include <asm/io.h>
drivers/usb/host/dwc2.c +1 -0
index 350d820a6e..b9c56f763b 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <usb.h>
drivers/usb/host/ehci-hcd.c +1 -0
index 85918e85be..ef20c3c982 100644
@@ -7,6 +7,7 @@
  * All rights reserved.
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/byteorder.h>
drivers/usb/host/ohci-hcd.c +1 -0
index 57e92a9c89..c94960f2cc 100644
@@ -28,6 +28,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/byteorder.h>
 #include <dm.h>
 #include <errno.h>
drivers/usb/host/xhci-mem.c +1 -0
index 530e979bb7..93450ee3b7 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <asm/byteorder.h>
 #include <usb.h>
drivers/usb/host/xhci-ring.c +1 -0
index 6a469e1dae..3cd6c8a0dc 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/byteorder.h>
 #include <usb.h>
 #include <asm/unaligned.h>
drivers/usb/host/xhci.c +1 -0
index abd23e23fd..40dee2e6d9 100644
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <asm/byteorder.h>
 #include <usb.h>
drivers/video/atmel_hlcdfb.c +1 -0
index 120d41f41f..734bc12c7b 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
drivers/video/sunxi/sunxi_display.c +1 -0
index c45b3ebe6e..b1aa4b25be 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <efi_loader.h>
 #include <time.h>
 
drivers/video/video-uclass.c +1 -0
index d4071c0661..f660c5205e 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <mapmem.h>
 #include <stdio_dev.h>
include/common.h +0 -24
index 423f1023ad..6dedb37a06 100644
@@ -218,30 +218,6 @@ void	reset_timer	   (void);
 void	enable_interrupts  (void);
 int	disable_interrupts (void);
 
-/* arch/$(ARCH)/lib/cache.c */
-void	enable_caches(void);
-void	flush_cache   (unsigned long, unsigned long);
-void	flush_dcache_all(void);
-void	flush_dcache_range(unsigned long start, unsigned long stop);
-void	invalidate_dcache_range(unsigned long start, unsigned long stop);
-void	invalidate_dcache_all(void);
-void	invalidate_icache_all(void);
-
-enum {
-	/* Disable caches (else flush caches but leave them active) */
-	CBL_DISABLE_CACHES		= 1 << 0,
-	CBL_SHOW_BOOTSTAGE_REPORT	= 1 << 1,
-
-	CBL_ALL				= 3,
-};
-
-/**
- * Clean up ready for linux
- *
- * @param flags		Flags to control what is done
- */
-int cleanup_before_linux_select(int flags);
-
 /* lib/uuid.c */
 #include <uuid.h>
 
include/cpu_func.h +24 -0
index a14d23a36d..46f3d92459 100644
@@ -60,4 +60,28 @@ void dcache_enable(void);
 void dcache_disable(void);
 void mmu_disable(void);
 
+/* arch/$(ARCH)/lib/cache.c */
+void enable_caches(void);
+void flush_cache(unsigned long addr, unsigned long size);
+void flush_dcache_all(void);
+void flush_dcache_range(unsigned long start, unsigned long stop);
+void invalidate_dcache_range(unsigned long start, unsigned long stop);
+void invalidate_dcache_all(void);
+void invalidate_icache_all(void);
+
+enum {
+	/* Disable caches (else flush caches but leave them active) */
+	CBL_DISABLE_CACHES		= 1 << 0,
+	CBL_SHOW_BOOTSTAGE_REPORT	= 1 << 1,
+
+	CBL_ALL				= 3,
+};
+
+/**
+ * Clean up ready for linux
+ *
+ * @param flags		Flags to control what is done
+ */
+int cleanup_before_linux_select(int flags);
+;
 #endif
lib/efi_loader/efi_image_loader.c +1 -0
index 13541cfa7a..d5de6df16d 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <efi_loader.h>
 #include <pe.h>
 
lib/efi_loader/efi_runtime.c +1 -0
index 72555f07fc..df0485cdad 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <elf.h>
 #include <efi_loader.h>
post/cpu/mpc83xx/ecc.c +1 -0
index 65a490d357..16210c65ab 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <irq_func.h>
 #include <mpc83xx.h>
 #include <watchdog.h>
 #include <asm/io.h>
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#41 lore raw

PATCH v4 31/42 common: Move ARM cache operations out of common.h

Am 14.11.19 um 20:57 schrieb Simon Glass:

Quoted 141 lines

These functions are CPU-related and do not use driver model. Move them to cpu_func.h

---

Changes in v4:
- Use cpu_func.h instead of cpu_legacy.h
- Use irq_func.h instead of irq_legacy.h

Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c       |  1 +
 arch/arm/cpu/armv7/cache_v7.c              |  1 +
 arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c  |  1 +
 arch/arm/cpu/armv8/sec_firmware.c          |  1 +
 arch/arm/cpu/pxa/cache.c                   |  1 +
 arch/arm/lib/cache.c                       |  1 +
 arch/arm/mach-bcm283x/mbox.c               |  1 +
 arch/arm/mach-imx/mx7/psci-mx7.c           |  1 +
 arch/arm/mach-omap2/sec-common.c           |  1 +
 arch/arm/mach-tegra/ivc.c                  |  1 +
 arch/microblaze/lib/bootm.c                |  1 +
 arch/mips/lib/reloc.c                      |  1 +
 arch/mips/lib/traps.c                      |  1 +
 arch/mips/mach-jz47xx/jz4780/jz4780.c      |  1 +
 arch/mips/mach-mtmips/ddr_calibrate.c      |  1 +
 arch/nds32/cpu/n1213/ae3xx/cpu.c           |  1 +
 arch/nios2/cpu/cpu.c                       |  1 +
 arch/nios2/lib/bootm.c                     |  1 +
 arch/powerpc/lib/bootm.c                   |  1 +
 arch/powerpc/lib/cache.c                   |  1 +
 arch/riscv/cpu/ax25/cpu.c                  |  1 +
 arch/riscv/lib/smp.c                       |  1 +
 arch/riscv/lib/spl.c                       |  1 +
 arch/sandbox/cpu/cpu.c                     |  1 +
 arch/x86/cpu/quark/dram.c                  |  1 +
 arch/xtensa/lib/bootm.c                    |  1 +
 board/Arcturus/ucp1020/cmd_arc.c           |  1 +
 board/beckhoff/mx53cx9020/mx53cx9020.c     |  1 +
 board/broadcom/bcmstb/bcmstb.c             |  1 +
 board/cirrus/edb93xx/edb93xx.c             |  1 +
 board/phytec/pfla02/pfla02.c               |  1 +
 board/sandbox/sandbox.c                    |  1 +
 cmd/disk.c                                 |  1 +
 cmd/load.c                                 |  1 +
 cmd/ximg.c                                 |  1 +
 common/avb_verify.c                        |  1 +
 common/board_r.c                           |  1 +
 common/bootm.c                             |  1 +
 common/bouncebuf.c                         |  1 +
 common/image.c                             |  1 +
 common/lcd.c                               |  1 +
 common/spl/spl_opensbi.c                   |  1 +
 common/update.c                            |  1 +
 drivers/ata/ahci.c                         |  1 +
 drivers/ata/dwc_ahsata.c                   |  1 +
 drivers/ata/fsl_ahci.c                     |  1 +
 drivers/ata/fsl_sata.c                     |  1 +
 drivers/ata/sata_mv.c                      |  1 +
 drivers/ata/sata_sil.c                     |  1 +
 drivers/bootcount/bootcount.c              |  1 +
 drivers/bootcount/bootcount_ram.c          |  1 +
 drivers/core/device.c                      |  1 +
 drivers/crypto/fsl/fsl_blob.c              |  1 +
 drivers/crypto/fsl/fsl_hash.c              |  1 +
 drivers/crypto/fsl/jobdesc.c               |  1 +
 drivers/crypto/fsl/jr.c                    |  1 +
 drivers/dma/apbh_dma.c                     |  1 +
 drivers/dma/bcm6348-iudma.c                |  1 +
 drivers/dma/dma-uclass.c                   |  1 +
 drivers/dma/ti/k3-udma.c                   |  1 +
 drivers/fpga/versalpl.c                    |  1 +
 drivers/fpga/zynqmppl.c                    |  1 +
 drivers/mmc/dw_mmc.c                       |  1 +
 drivers/mmc/fsl_esdhc.c                    |  1 +
 drivers/mmc/fsl_esdhc_imx.c                |  1 +
 drivers/mmc/fsl_esdhc_spl.c                |  1 +
 drivers/mmc/meson_gx_mmc.c                 |  1 +
 drivers/mmc/omap_hsmmc.c                   |  1 +
 drivers/mmc/sdhci.c                        |  1 +
 drivers/mmc/stm32_sdmmc2.c                 |  1 +
 drivers/mmc/tmio-common.c                  |  1 +
 drivers/mtd/nand/raw/denali.c              |  1 +
 drivers/mtd/nand/raw/fsl_elbc_spl.c        |  1 +
 drivers/mtd/nand/raw/fsl_ifc_spl.c         |  1 +
 drivers/mtd/nand/raw/mxs_nand.c            |  1 +
 drivers/mtd/pic32_flash.c                  |  1 +
 drivers/mtd/spi/fsl_espi_spl.c             |  1 +
 drivers/net/ag7xxx.c                       |  1 +
 drivers/net/altera_tse.c                   |  1 +
 drivers/net/bcm-sf2-eth-gmac.c             |  1 +
 drivers/net/designware.c                   |  1 +
 drivers/net/dwc_eth_qos.c                  |  1 +
 drivers/net/e1000.c                        |  1 +
 drivers/net/ethoc.c                        |  1 +
 drivers/net/fec_mxc.c                      |  1 +
 drivers/net/fsl-mc/mc.c                    |  1 +
 drivers/net/ftgmac100.c                    |  1 +
 drivers/net/ftmac100.c                     |  1 +
 drivers/net/higmacv300.c                   |  1 +
 drivers/net/ldpaa_eth/ldpaa_eth.c          |  1 +
 drivers/net/macb.c                         |  1 +
 drivers/net/mt7628-eth.c                   |  1 +
 drivers/net/mtk_eth.c                      |  1 +
 drivers/net/mvneta.c                       |  1 +
 drivers/net/mvpp2.c                        |  1 +
 drivers/net/pch_gbe.c                      |  1 +
 drivers/net/pcnet.c                        |  1 +
 drivers/net/pic32_eth.c                    |  1 +
 drivers/net/ravb.c                         |  1 +
 drivers/net/rtl8139.c                      |  1 +
 drivers/net/rtl8169.c                      |  1 +
 drivers/net/sh_eth.c                       |  1 +
 drivers/net/sni_ave.c                      |  1 +
 drivers/net/sun8i_emac.c                   |  1 +
 drivers/net/ti/cpsw.c                      |  1 +
 drivers/net/ti/davinci_emac.c              |  1 +
 drivers/net/xilinx_axi_emac.c              |  1 +
 drivers/net/zynq_gem.c                     |  1 +
 drivers/nvme/nvme.c                        |  1 +
 drivers/remoteproc/rproc-elf-loader.c      |  1 +
 drivers/spi/mxs_spi.c                      |  1 +
 drivers/spi/ti_qspi.c                      |  1 +
 drivers/spi/zynqmp_gqspi.c                 |  1 +
 drivers/usb/dwc3/core.c                    |  1 +
 drivers/usb/dwc3/dwc3-generic.c            |  1 +
 drivers/usb/dwc3/ep0.c                     |  1 +
 drivers/usb/dwc3/gadget.c                  |  1 +
 drivers/usb/dwc3/io.h                      |  1 +
 drivers/usb/gadget/ci_udc.c                |  1 +
 drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c |  3 +++
 drivers/usb/gadget/fotg210.c               |  1 +
 drivers/usb/host/dwc2.c                    |  1 +
 drivers/usb/host/ehci-hcd.c                |  1 +
 drivers/usb/host/ohci-hcd.c                |  1 +
 drivers/usb/host/xhci-mem.c                |  1 +
 drivers/usb/host/xhci-ring.c               |  1 +
 drivers/usb/host/xhci.c                    |  1 +
 drivers/video/atmel_hlcdfb.c               |  1 +
Quoted 8 lines
 drivers/video/sunxi/sunxi_display.c        |  1 +
 drivers/video/video-uclass.c               |  1 +
 include/common.h                           | 24 ----------------------
 include/cpu_func.h                         | 24 ++++++++++++++++++++++
 lib/efi_loader/efi_image_loader.c          |  1 +
 lib/efi_loader/efi_runtime.c               |  1 +
 post/cpu/mpc83xx/ecc.c                     |  1 +
 135 files changed, 159 insertions(+), 24 deletions(-)

one nit below

Quoted 1,434 lines
arch/arm/cpu/arm926ejs/lpc32xx/cpu.c +1 -0
index 5117177474..4c59a44f7e 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <netdev.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clk.h>
arch/arm/cpu/armv7/cache_v7.c +1 -0
index 0dc4ebf694..99eb7db342 100644
@@ -4,6 +4,7 @@
  * Texas Instruments, <www.ti.com>
  * Aneesh V <[email protected]>
  */
+#include <cpu_func.h>
 #include <linux/types.h>
 #include <common.h>
 #include <asm/armv7.h>
arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c +1 -0
index df64f5415a..4a4b3c6f23 100644
@@ -6,6 +6,7 @@
  */
 
 #include <config.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/psci.h>
 #include <asm/arch/immap_ls102xa.h>
arch/arm/cpu/armv8/sec_firmware.c +1 -0
index 8dc0ac9266..11f9b4df38 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <linux/kernel.h>
 #include <asm/io.h>
arch/arm/cpu/pxa/cache.c +1 -0
index 5cd4a9524b..d4dfe7f6d8 100644
@@ -3,6 +3,7 @@
  * (C) Copyright 2016 Vasily Khoruzhick <[email protected]>
  */
 
+#include <cpu_func.h>
 #include <linux/types.h>
 #include <common.h>
 
arch/arm/lib/cache.c +1 -0
index 463d283cb7..007d4ebc49 100644
@@ -7,6 +7,7 @@
 /* for now: just dummy functions to satisfy the linker */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 
 /*
arch/arm/mach-bcm283x/mbox.c +1 -0
index 3c67f68c17..00c6afb15f 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/mbox.h>
 #include <phys2bus.h>
arch/arm/mach-imx/mx7/psci-mx7.c +1 -0
index c98d2e96af..c8f6ca235b 100644
@@ -4,6 +4,7 @@
  * Copyright 2017 NXP
  */
 
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/psci.h>
 #include <asm/secure.h>
arch/arm/mach-omap2/sec-common.c +1 -0
index b45d3ee544..e9b3e746fe 100644
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <stdarg.h>
 
 #include <asm/arch/sys_proto.h>
arch/arm/mach-tegra/ivc.c +1 -0
index 65b1cfc07d..a448f2df30 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch-tegra/ivc.h>
 
arch/microblaze/lib/bootm.c +1 -0
index 01c5d57bc5..efd5acf359 100644
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <fdt_support.h>
 #include <image.h>
arch/mips/lib/reloc.c +1 -0
index c6a517d66f..e68f49467c 100644
@@ -27,6 +27,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/relocs.h>
 #include <asm/sections.h>
 
arch/mips/lib/traps.c +1 -0
index 976978c3e9..b4bcdf8150 100644
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/mipsregs.h>
 #include <asm/addrspace.h>
 #include <asm/system.h>
arch/mips/mach-jz47xx/jz4780/jz4780.c +1 -0
index dbd328cb49..ec18df8879 100644
@@ -8,6 +8,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/sections.h>
 #include <mach/jz4780.h>
arch/mips/mach-mtmips/ddr_calibrate.c +1 -0
index 75763c4528..3cd440804d 100644
@@ -17,6 +17,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/io.h>
 #include <asm/cacheops.h>
 #include <asm/io.h>
arch/nds32/cpu/n1213/ae3xx/cpu.c +1 -0
index a53bed1970..0660fffa45 100644
@@ -16,6 +16,7 @@
 #include <common.h>
 #include <command.h>
 #include <cpu_func.h>
+#include <irq_func.h>
 #include <watchdog.h>
 #include <asm/cache.h>
 
arch/nios2/cpu/cpu.c +1 -0
index 1fc79213e2..05b26e8d20 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <cpu.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/cache.h>
arch/nios2/lib/bootm.c +1 -0
index 485d5ae540..a68b091f87 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 #define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */
 
arch/powerpc/lib/bootm.c +1 -0
index 84691b7554..f2e670eb6b 100644
@@ -8,6 +8,7 @@
 
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <watchdog.h>
 #include <command.h>
arch/powerpc/lib/cache.c +1 -0
index 2d36c3aa08..3c3c470bbb 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/cache.h>
 #include <watchdog.h>
 
arch/riscv/cpu/ax25/cpu.c +1 -0
index 0534b37f5d..f092600e14 100644
@@ -7,6 +7,7 @@
 /* CPU specific code */
 #include <common.h>
 #include <cpu_func.h>
+#include <irq_func.h>
 #include <asm/cache.h>
 
 /*
arch/riscv/lib/smp.c +1 -0
index cc66f15567..705437862a 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <asm/barrier.h>
 #include <asm/smp.h>
arch/riscv/lib/spl.c +1 -0
index bea8695987..a544df0a2b 100644
@@ -4,6 +4,7 @@
  * Lukas Auer <[email protected]>
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <spl.h>
 #include <asm/smp.h>
 
arch/sandbox/cpu/cpu.c +1 -0
index f3af88d79e..ff7430393f 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <linux/libfdt.h>
arch/x86/cpu/quark/dram.c +1 -0
index 51f9659ab1..1b764dfccd 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <fdtdec.h>
 #include <malloc.h>
arch/xtensa/lib/bootm.c +1 -0
index 93eea53c5f..057b229433 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
board/Arcturus/ucp1020/cmd_arc.c +1 -0
index 2e8477ed3b..b50de63c5e 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <div64.h>
 #include <env.h>
 #include <malloc.h>
board/beckhoff/mx53cx9020/mx53cx9020.c +1 -0
index 9450d925f6..1b1b688f19 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux-mx53.h>
board/broadcom/bcmstb/bcmstb.c +1 -0
index 23500dfa69..12b9dba612 100644
@@ -6,6 +6,7 @@
  * Author: Thomas Fitzsimmons <[email protected]>
  */
 
+#include <cpu_func.h>
 #include <time.h>
 #include <linux/types.h>
 #include <common.h>
board/cirrus/edb93xx/edb93xx.c +1 -0
index 0966e37e7a..dfebb7c1c1 100644
@@ -16,6 +16,7 @@
 #include <config.h>
 #include <common.h>
 #include <cpu_func.h>
+#include <irq_func.h>
 #include <netdev.h>
 #include <status_led.h>
 #include <asm/io.h>
board/phytec/pfla02/pfla02.c +1 -0
index ae9ffe0390..f498fdf807 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
board/sandbox/sandbox.c +1 -0
index 9ca1eca027..438f9a47ed 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <cros_ec.h>
 #include <dm.h>
 #include <led.h>
cmd/disk.c +1 -0
index 9e635c1172..437c175374 100644
@@ -5,6 +5,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <part.h>
 
 int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
cmd/load.c +1 -0
index 5811a99310..3bfc1b41ec 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <s_record.h>
 #include <net.h>
cmd/ximg.c +1 -0
index a9481004f0..22b2037a33 100644
@@ -13,6 +13,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <gzip.h>
 #include <image.h>
common/avb_verify.c +1 -0
index 36898a610f..a2b739626b 100644
@@ -6,6 +6,7 @@
 
 #include <avb_verify.h>
 #include <blk.h>
+#include <cpu_func.h>
 #include <fastboot.h>
 #include <image.h>
 #include <malloc.h>
common/board_r.c +1 -0
index 05e08212b4..6a421002dd 100644
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <api.h>
+#include <cpu_func.h>
 #include <u-boot/crc.h>
 /* TODO: can we just include all these headers whether needed or not? */
 #if defined(CONFIG_CMD_BEDBUG)
common/bootm.c +1 -0
index 02295daf79..3bbe490ab9 100644
@@ -7,6 +7,7 @@
 #ifndef USE_HOSTCC
 #include <common.h>
 #include <bootstage.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <errno.h>
 #include <fdt_support.h>
common/bouncebuf.c +1 -0
index a7098e2caf..614eb36c78 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <errno.h>
 #include <bouncebuf.h>
common/image.c +1 -0
index 1c8ac2df70..eb626dcac9 100644
@@ -8,6 +8,7 @@
 
 #ifndef USE_HOSTCC
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <u-boot/crc.h>
 #include <watchdog.h>
common/lcd.c +1 -0
index b34754fe51..f8bc1ceba7 100644
@@ -10,6 +10,7 @@
 #include <config.h>
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env_callback.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
common/spl/spl_opensbi.c +1 -0
index a6b4480ed2..2345f949f0 100644
@@ -6,6 +6,7 @@
  * Based on common/spl/spl_atf.c
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <spl.h>
 #include <asm/smp.h>
common/update.c +1 -0
index 457b29f42a..13b09ab00f 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 #if !(defined(CONFIG_FIT) && defined(CONFIG_OF_LIBFDT))
 #error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature"
drivers/ata/ahci.c +1 -0
index d10f9f0bf8..4cd7420c3c 100644
@@ -9,6 +9,7 @@
  * This driver provides a SCSI interface to SATA.
  */
 #include <common.h>
+#include <cpu_func.h>
 
 #include <command.h>
 #include <dm.h>
drivers/ata/dwc_ahsata.c +1 -0
index afced8e7e3..c2e28fe518 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <ahci.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dwc_ahsata.h>
 #include <fis.h>
drivers/ata/fsl_ahci.c +1 -0
index d04cff3ee7..4ccfe23593 100644
@@ -6,6 +6,7 @@
  *
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/fsl_serdes.h>
 #include <dm/lists.h>
 #include <dm.h>
drivers/ata/fsl_sata.c +1 -0
index e70a515eff..96a8f2f0c6 100644
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/fsl_serdes.h>
drivers/ata/sata_mv.c +1 -0
index 2a630d46c1..6019ac089e 100644
@@ -33,6 +33,7 @@
 
 #include <common.h>
 #include <ahci.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
drivers/ata/sata_sil.c +1 -0
index a8598d9f21..ae832c5a16 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <pci.h>
 #include <command.h>
 #include <asm/byteorder.h>
drivers/bootcount/bootcount.c +1 -0
index 66c1284c5b..7a6d03dcca 100644
@@ -5,6 +5,7 @@
  */
 
 #include <bootcount.h>
+#include <cpu_func.h>
 #include <linux/compiler.h>
 
 /* Now implement the generic default functions */
drivers/bootcount/bootcount_ram.c +1 -0
index edef36724b..9c678e25f4 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
drivers/core/device.c +1 -0
index 8eabaf8b55..4e037083a6 100644
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <clk.h>
 #include <fdtdec.h>
drivers/crypto/fsl/fsl_blob.c +1 -0
index ce6aa05fe7..0531b1b735 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <fsl_sec.h>
drivers/crypto/fsl/fsl_hash.c +1 -0
index c2686df02f..74e38ca759 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <memalign.h>
 #include "jobdesc.h"
drivers/crypto/fsl/jobdesc.c +1 -0
index 317f73c42b..637ef29f15 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <fsl_sec.h>
 #include "desc_constr.h"
 #include "jobdesc.h"
drivers/crypto/fsl/jr.c +1 -0
index 1ea9db6850..aa84f2cee0 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include "fsl_sec.h"
 #include "jr.h"
drivers/dma/apbh_dma.c +1 -0
index ac589feeb7..15133128be 100644
@@ -9,6 +9,7 @@
  * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
  */
 
+#include <cpu_func.h>
 #include <linux/list.h>
 
 #include <common.h>
drivers/dma/bcm6348-iudma.c +1 -0
index e7bd1b2350..96250eb5d2 100644
@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dma-uclass.h>
 #include <memalign.h>
drivers/dma/dma-uclass.c +1 -0
index 9c961cf1e2..0ff56f7e88 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/read.h>
 #include <dma-uclass.h>
drivers/dma/ti/k3-udma.c +1 -0
index a5fc7809bc..2e64d338ca 100644
@@ -6,6 +6,7 @@
 #define pr_fmt(fmt) "udma: " fmt
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
 #include <malloc.h>
drivers/fpga/versalpl.c +1 -0
index 4bcc213243..6c69ab7802 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/sys_proto.h>
 #include <memalign.h>
 #include <versalpl.h>
drivers/fpga/zynqmppl.c +1 -0
index d129b5459c..4a826e4a71 100644
@@ -7,6 +7,7 @@
 
 #include <console.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <zynqmppl.h>
 #include <zynqmp_firmware.h>
 #include <linux/sizes.h>
drivers/mmc/dw_mmc.c +1 -0
index ebe7bcdd90..1224540811 100644
@@ -7,6 +7,7 @@
 
 #include <bouncebuf.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <malloc.h>
 #include <memalign.h>
drivers/mmc/fsl_esdhc.c +1 -0
index 8ff84aa3a8..3b7bb216eb 100644
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <command.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <hwconfig.h>
 #include <mmc.h>
drivers/mmc/fsl_esdhc_imx.c +1 -0
index 4099386313..f1afab742d 100644
@@ -14,6 +14,7 @@
 #include <common.h>
 #include <command.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <hwconfig.h>
 #include <mmc.h>
drivers/mmc/fsl_esdhc_spl.c +1 -0
index 4557cd3dd7..3021c3d6d4 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <mmc.h>
 #include <malloc.h>
 
drivers/mmc/meson_gx_mmc.c +1 -0
index 031cc79ccb..b5f5122b1b 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <malloc.h>
drivers/mmc/omap_hsmmc.c +1 -0
index bade129aea..dab3425e97 100644
@@ -24,6 +24,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <mmc.h>
drivers/mmc/sdhci.c +1 -0
index fbc576fd72..e6fed1a08a 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
drivers/mmc/stm32_sdmmc2.c +1 -0
index 1726ed72ef..0a7a2fe624 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <linux/libfdt.h>
drivers/mmc/tmio-common.c +1 -0
index 812205a21f..669410d97f 100644
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <fdtdec.h>
 #include <mmc.h>
 #include <dm.h>
drivers/mtd/nand/raw/denali.c +1 -0
index e0eb1339ec..0a7ca8a8df 100644
@@ -5,6 +5,7 @@
  * Copyright (C) 2009-2010, Intel Corporation and its suppliers.
  */
 
+#include <cpu_func.h>
 #include <dm.h>
 #include <nand.h>
 #include <linux/bitfield.h>
drivers/mtd/nand/raw/fsl_elbc_spl.c +1 -0
index 099d86427c..a62ab69ee1 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/fsl_lbc.h>
 #include <nand.h>
drivers/mtd/nand/raw/fsl_ifc_spl.c +1 -0
index 7137eb4108..0983fbced3 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <fsl_ifc.h>
 #include <linux/mtd/rawnand.h>
drivers/mtd/nand/raw/mxs_nand.c +1 -0
index ad7b644886..fe8097c146 100644
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/sizes.h>
drivers/mtd/pic32_flash.c +1 -0
index 5c55f1557f..8f09e5b250 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdt_support.h>
 #include <flash.h>
drivers/mtd/spi/fsl_espi_spl.c +1 -0
index b90e6a5527..580b1e24b7 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <spi_flash.h>
 #include <malloc.h>
 
drivers/net/ag7xxx.c +1 -0
index 7f1dee4b3e..804d5c20b6 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <miiphy.h>
drivers/net/altera_tse.c +1 -0
index fb878d4e63..aabddd6bb6 100644
@@ -9,6 +9,7 @@
  * published by the Free Software Foundation.
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <fdt_support.h>
drivers/net/bcm-sf2-eth-gmac.c +1 -0
index db3e79ade3..6a25f67c30 100644
@@ -11,6 +11,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <net.h>
 #include <asm/io.h>
drivers/net/designware.c +1 -0
index 0031370085..5c2d5e5a79 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <miiphy.h>
drivers/net/dwc_eth_qos.c +1 -0
index 455709338c..da5b696c9d 100644
@@ -28,6 +28,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <memalign.h>
drivers/net/e1000.c +1 -0
index a34f697461..0946011844 100644
@@ -30,6 +30,7 @@ tested on both gig copper and gig fiber boards
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <memalign.h>
drivers/net/ethoc.c +1 -0
index 3d43a58d4a..be5d9add61 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/platform_data/net_ethoc.h>
 #include <linux/io.h>
drivers/net/fec_mxc.c +1 -0
index 131d1998a7..2aa1029d42 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <env.h>
 #include <malloc.h>
drivers/net/fsl-mc/mc.c +1 -0
index c980ba4edb..6a9cf51fe4 100644
@@ -5,6 +5,7 @@
  * Copyright 2017-2018 NXP
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <errno.h>
 #include <linux/bug.h>
drivers/net/ftgmac100.c +1 -0
index 92c38a81bd..b6b8a93bb5 100644
@@ -12,6 +12,7 @@
  */
 
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <miiphy.h>
 #include <net.h>
drivers/net/ftmac100.c +1 -0
index d8f1dde657..24bb45f351 100644
@@ -8,6 +8,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <malloc.h>
 #include <net.h>
drivers/net/higmacv300.c +1 -0
index 1be8359133..897741ab82 100644
@@ -3,6 +3,7 @@
  * Copyright (c) 2019, Linaro Limited
  */
 
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <common.h>
 #include <console.h>
drivers/net/ldpaa_eth/ldpaa_eth.c +1 -0
index 34253e3924..a3b9c152b2 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/types.h>
 #include <malloc.h>
drivers/net/macb.c +1 -0
index 1a532b0e5a..f809f3eb07 100644
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 
 /*
drivers/net/mt7628-eth.c +1 -0
index a1d12f6902..404a046422 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <malloc.h>
 #include <miiphy.h>
drivers/net/mtk_eth.c +1 -0
index 0ef814c78b..c22e590387 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <malloc.h>
 #include <miiphy.h>
drivers/net/mvneta.c +1 -0
index 333be8ff28..6f76a6b0dc 100644
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <net.h>
 #include <netdev.h>
drivers/net/mvpp2.c +1 -0
index bd89725e77..8148c03d22 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
drivers/net/pch_gbe.c +1 -0
index 2286dd07e9..e4507bf7fd 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/io.h>
drivers/net/pcnet.c +1 -0
index eda6743ec3..b4ad11d3fa 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
drivers/net/pic32_eth.c +1 -0
index 39c4b10ab8..3458440b6f 100644
@@ -4,6 +4,7 @@
  *
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <dm.h>
 #include <net.h>
drivers/net/ravb.c +1 -0
index 11abe5e0c9..fb4a628d63 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <miiphy.h>
drivers/net/rtl8139.c +1 -0
index 13309970e2..bb59629f81 100644
@@ -72,6 +72,7 @@
 */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
drivers/net/rtl8169.c +1 -0
index 521e5909a2..53454f2f21 100644
@@ -40,6 +40,7 @@
  * Modified to use le32_to_cpu and cpu_to_le32 properly
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <malloc.h>
drivers/net/sh_eth.c +1 -0
index 749f651920..183e8e3083 100644
@@ -10,6 +10,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <malloc.h>
 #include <net.h>
drivers/net/sni_ave.c +1 -0
index ba51ea5e38..6d333e24ee 100644
@@ -5,6 +5,7 @@
  */
 
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdt_support.h>
 #include <linux/io.h>
drivers/net/sun8i_emac.c +1 -0
index 0629b16e57..9551918796 100644
@@ -10,6 +10,7 @@
  *
 */
 
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/gpio.h>
drivers/net/ti/cpsw.c +1 -0
index 4a990be93e..93d53612b5 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <net.h>
 #include <miiphy.h>
 #include <malloc.h>
drivers/net/ti/davinci_emac.c +1 -0
index 2bd9c51079..9c6bfca5a9 100644
@@ -23,6 +23,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <net.h>
 #include <miiphy.h>
 #include <malloc.h>
drivers/net/xilinx_axi_emac.c +1 -0
index 36d651109c..b0450fff56 100644
@@ -7,6 +7,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <net.h>
 #include <malloc.h>
drivers/net/zynq_gem.c +1 -0
index a7a6ce987f..78f94148b4 100644
@@ -10,6 +10,7 @@
 
 #include <clk.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <net.h>
 #include <netdev.h>
drivers/nvme/nvme.c +1 -0
index cddcc2f11d..2593eb174b 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <memalign.h>
drivers/remoteproc/rproc-elf-loader.c +1 -0
index b38a226065..e8026cdfbb 100644
@@ -3,6 +3,7 @@
  * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <elf.h>
 #include <remoteproc.h>
drivers/spi/mxs_spi.c +1 -0
index 58b1c67a19..3ca30887fb 100644
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <memalign.h>
 #include <spi.h>
drivers/spi/ti_qspi.c +1 -0
index 77fa17ee8a..c3d9e7f2ee 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/omap.h>
 #include <malloc.h>
drivers/spi/zynqmp_gqspi.c +1 -0
index c11f040200..4cca418012 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/io.h>
 #include <clk.h>
drivers/usb/dwc3/core.c +1 -0
index 23af60c98d..d01bda18c5 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dwc3-uboot.h>
 #include <asm/dma-mapping.h>
drivers/usb/dwc3/dwc3-generic.c +1 -0
index 24b320bbce..8d45748b3b 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm-generic/io.h>
 #include <dm.h>
 #include <dm/device-internal.h>
drivers/usb/dwc3/ep0.c +1 -0
index 818efb3e8d..0c8c11d743 100644
@@ -13,6 +13,7 @@
  * commit c00552ebaf : Merge 3.18-rc7 into usb-next
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 
drivers/usb/dwc3/gadget.c +1 -0
index 67d11b4c0d..4353dffb6b 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <asm/dma-mapping.h>
 #include <linux/bug.h>
drivers/usb/dwc3/io.h +1 -0
index f660d53231..2407f826c1 100644
@@ -17,6 +17,7 @@
 #ifndef __DRIVERS_USB_DWC3_IO_H
 #define __DRIVERS_USB_DWC3_IO_H
 
+#include <cpu_func.h>
 #include <asm/io.h>
 
 #define	CACHELINE_SIZE		CONFIG_SYS_CACHELINE_SIZE
drivers/usb/gadget/ci_udc.c +1 -0
index bd596ce977..d9cfff3a29 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <config.h>
+#include <cpu_func.h>
 #include <net.h>
 #include <malloc.h>
 #include <asm/byteorder.h>
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +0 -0
index 7eb632d3b1..e9e18568c1 100644

drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c line 22

Quoted 6 lines
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +3 -0
@@ -17,6 +17,9 @@
  * Lukasz Majewski <[email protected]>
  */
 
+#include <common.h>
+#include <cpu_func.h>
+

is this intended if both files haven't been required before?

Quoted 228 lines
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +0 -0
 static u8 clear_feature_num;
 int clear_feature_flag;
 
drivers/usb/gadget/fotg210.c +1 -0
index 176068cbfb..0866ef6531 100644
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <command.h>
 #include <config.h>
+#include <cpu_func.h>
 #include <net.h>
 #include <malloc.h>
 #include <asm/io.h>
drivers/usb/host/dwc2.c +1 -0
index 350d820a6e..b9c56f763b 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <usb.h>
drivers/usb/host/ehci-hcd.c +1 -0
index 85918e85be..ef20c3c982 100644
@@ -7,6 +7,7 @@
  * All rights reserved.
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/byteorder.h>
drivers/usb/host/ohci-hcd.c +1 -0
index 57e92a9c89..c94960f2cc 100644
@@ -28,6 +28,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/byteorder.h>
 #include <dm.h>
 #include <errno.h>
drivers/usb/host/xhci-mem.c +1 -0
index 530e979bb7..93450ee3b7 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <asm/byteorder.h>
 #include <usb.h>
drivers/usb/host/xhci-ring.c +1 -0
index 6a469e1dae..3cd6c8a0dc 100644
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/byteorder.h>
 #include <usb.h>
 #include <asm/unaligned.h>
drivers/usb/host/xhci.c +1 -0
index abd23e23fd..40dee2e6d9 100644
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <asm/byteorder.h>
 #include <usb.h>
drivers/video/atmel_hlcdfb.c +1 -0
index 120d41f41f..734bc12c7b 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
drivers/video/sunxi/sunxi_display.c +1 -0
index c45b3ebe6e..b1aa4b25be 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <efi_loader.h>
 #include <time.h>
 
drivers/video/video-uclass.c +1 -0
index d4071c0661..f660c5205e 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <mapmem.h>
 #include <stdio_dev.h>
include/common.h +0 -24
index 423f1023ad..6dedb37a06 100644
@@ -218,30 +218,6 @@ void	reset_timer	   (void);
 void	enable_interrupts  (void);
 int	disable_interrupts (void);
 
-/* arch/$(ARCH)/lib/cache.c */
-void	enable_caches(void);
-void	flush_cache   (unsigned long, unsigned long);
-void	flush_dcache_all(void);
-void	flush_dcache_range(unsigned long start, unsigned long stop);
-void	invalidate_dcache_range(unsigned long start, unsigned long stop);
-void	invalidate_dcache_all(void);
-void	invalidate_icache_all(void);
-
-enum {
-	/* Disable caches (else flush caches but leave them active) */
-	CBL_DISABLE_CACHES		= 1 << 0,
-	CBL_SHOW_BOOTSTAGE_REPORT	= 1 << 1,
-
-	CBL_ALL				= 3,
-};
-
-/**
- * Clean up ready for linux
- *
- * @param flags		Flags to control what is done
- */
-int cleanup_before_linux_select(int flags);
-
 /* lib/uuid.c */
 #include <uuid.h>
 
include/cpu_func.h +24 -0
index a14d23a36d..46f3d92459 100644
@@ -60,4 +60,28 @@ void dcache_enable(void);
 void dcache_disable(void);
 void mmu_disable(void);
 
+/* arch/$(ARCH)/lib/cache.c */
+void enable_caches(void);
+void flush_cache(unsigned long addr, unsigned long size);
+void flush_dcache_all(void);
+void flush_dcache_range(unsigned long start, unsigned long stop);
+void invalidate_dcache_range(unsigned long start, unsigned long stop);
+void invalidate_dcache_all(void);
+void invalidate_icache_all(void);
+
+enum {
+	/* Disable caches (else flush caches but leave them active) */
+	CBL_DISABLE_CACHES		= 1 << 0,
+	CBL_SHOW_BOOTSTAGE_REPORT	= 1 << 1,
+
+	CBL_ALL				= 3,
+};
+
+/**
+ * Clean up ready for linux
+ *
+ * @param flags		Flags to control what is done
+ */
+int cleanup_before_linux_select(int flags);
+;
 #endif
lib/efi_loader/efi_image_loader.c +1 -0
index 13541cfa7a..d5de6df16d 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <efi_loader.h>
 #include <pe.h>
 
lib/efi_loader/efi_runtime.c +1 -0
index 72555f07fc..df0485cdad 100644
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <elf.h>
 #include <efi_loader.h>
post/cpu/mpc83xx/ecc.c +1 -0
index 65a490d357..16210c65ab 100644
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <irq_func.h>
 #include <mpc83xx.h>
 #include <watchdog.h>
 #include <asm/io.h>
Signature · 1 line
- Daniel
#42 lore raw

PATCH v4 31/42 common: Move ARM cache operations out of common.h

Hi Daniel,

inOn Fri, 15 Nov 2019 at 05:48, Daniel Schwierzeck

Quoted 1 line · <[email protected]> wrote:

[..]

Quoted 8 lines
Quoted 8 lines
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +0 -0
index 7eb632d3b1..e9e18568c1 100644
@@ -17,6 +17,9 @@
  * Lukasz Majewski <[email protected]>
  */
 
Quoted 5 lines

drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c line 22

Quoted 3 lines
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +3 -0
+#include <common.h>
+#include <cpu_func.h>
+

is this intended if both files haven't been required before?

Well common.h should always be included. The second is needed since flush_dcache_range() is called. This file would cause a error if it were compiled. It seems to be excluded from the build.

Quoted 4 lines

drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c line 25

Quoted 4 lines
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +0 -0
 static u8 clear_feature_num;
 int clear_feature_flag;
 

Regards,
Simon

#43 lore raw

PATCH v4 31/42 common: Move ARM cache operations out of common.h

In reply to Simon Glass
Quoted 4 lines · Simon Glass

These functions are CPU-related and do not use driver model. Move them to cpu_func.h

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191119/423b7027/attachment.sig>
#44 lore raw

PATCH v4 32/42 arm: powerpc: Tidy up code style for interrupt functions

In reply to Simon Glass

Remove the unwanted space before the bracket.

---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/arm11/cpu.c              |  2 +-
 arch/arm/cpu/arm920t/cpu.c            |  2 +-
 arch/arm/cpu/arm926ejs/cpu.c          |  2 +-
 arch/arm/cpu/arm946es/cpu.c           |  2 +-
 arch/arm/cpu/sa1100/cpu.c             |  2 +-
 arch/arm/lib/interrupts.c             |  6 +++---
 arch/m68k/lib/interrupts.c            |  8 ++++----
 arch/nios2/cpu/interrupts.c           | 14 +++++++-------
 arch/powerpc/cpu/mpc83xx/cpu.c        |  2 +-
 arch/powerpc/cpu/mpc83xx/interrupts.c |  6 +++---
 arch/powerpc/cpu/mpc86xx/interrupts.c |  2 +-
 arch/powerpc/lib/interrupts.c         |  8 ++++----
 arch/sh/cpu/sh4/interrupts.c          |  6 +++---
 board/cobra5272/flash.c               |  8 ++++----
 14 files changed, 35 insertions(+), 35 deletions(-)
arch/arm/cpu/arm11/cpu.c +1 -1
index fc3658951c..674ad0715b 100644
@@ -30,7 +30,7 @@ int cleanup_before_linux (void)
 	 * we turn off caches etc ...
 	 */
 
-	disable_interrupts ();
+	disable_interrupts();
 
 	/* turn off I/D-cache */
 	icache_disable();
arch/arm/cpu/arm920t/cpu.c +1 -1
index 980a734d1b..4874b620e6 100644
@@ -28,7 +28,7 @@ int cleanup_before_linux (void)
 	 * we turn off caches etc ...
 	 */
 
-	disable_interrupts ();
+	disable_interrupts();
 
 	/* turn off I/D-cache */
 	icache_disable();
arch/arm/cpu/arm926ejs/cpu.c +1 -1
index 2ae46f0357..ffa2a2302a 100644
@@ -28,7 +28,7 @@ int cleanup_before_linux (void)
 	 * we turn off caches etc ...
 	 */
 
-	disable_interrupts ();
+	disable_interrupts();
 
 
 	/* turn off I/D-cache */
arch/arm/cpu/arm946es/cpu.c +1 -1
index 434fed58bf..8523a9759e 100644
@@ -29,7 +29,7 @@ int cleanup_before_linux (void)
 	 * we turn off caches etc ...
 	 */
 
-	disable_interrupts ();
+	disable_interrupts();
 
 	/* ARM926E-S needs the protection unit enabled for the icache to have
 	 * been enabled	 - left for possible later use
arch/arm/cpu/sa1100/cpu.c +1 -1
index 6a849ffeaf..17c01dd81f 100644
@@ -30,7 +30,7 @@ int cleanup_before_linux (void)
 	 * just disable everything that can disturb booting linux
 	 */
 
-	disable_interrupts ();
+	disable_interrupts();
 
 	/* turn off I-cache */
 	icache_disable();
arch/arm/lib/interrupts.c +3 -3
index ee775ce5d2..e78ca56d25 100644
@@ -25,7 +25,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-int interrupt_init (void)
+int interrupt_init(void)
 {
 	/*
 	 * setup up stacks if necessary
@@ -35,11 +35,11 @@ int interrupt_init (void)
 	return 0;
 }
 
-void enable_interrupts (void)
+void enable_interrupts(void)
 {
 	return;
 }
-int disable_interrupts (void)
+int disable_interrupts(void)
 {
 	return 0;
 }
arch/m68k/lib/interrupts.c +4 -4
index 2d1c6136a1..85ae3b4ee0 100644
@@ -42,7 +42,7 @@ static __inline__ void set_sr (unsigned short sr)
 /*
  * Install and free an interrupt handler
  */
-void irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
+void irq_install_handler(int vec, interrupt_handler_t * handler, void *arg)
 {
 	if ((vec < 0) || (vec >= NR_IRQS)) {
 		printf ("irq_install_handler: wrong interrupt vector %d\n",
@@ -54,7 +54,7 @@ void irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
 	irq_vecs[vec].arg = arg;
 }
 
-void irq_free_handler (int vec)
+void irq_free_handler(int vec)
 {
 	if ((vec < 0) || (vec >= NR_IRQS)) {
 		return;
@@ -64,7 +64,7 @@ void irq_free_handler (int vec)
 	irq_vecs[vec].arg = NULL;
 }
 
-void enable_interrupts (void)
+void enable_interrupts(void)
 {
 	unsigned short sr;
 
@@ -72,7 +72,7 @@ void enable_interrupts (void)
 	set_sr (sr & ~0x0700);
 }
 
-int disable_interrupts (void)
+int disable_interrupts(void)
 {
 	unsigned short sr;
 
arch/nios2/cpu/interrupts.c +7 -7
index 6b5d0724e3..96c3020935 100644
@@ -23,7 +23,7 @@ struct	irq_action {
 
 static struct irq_action vecs[32];
 
-int disable_interrupts (void)
+int disable_interrupts(void)
 {
 	int val = rdctl (CTL_STATUS);
 	wrctl (CTL_STATUS, val & ~STATUS_IE);
@@ -36,7 +36,7 @@ void enable_interrupts( void )
 	wrctl (CTL_STATUS, val | STATUS_IE);
 }
 
-void external_interrupt (struct pt_regs *regs)
+void external_interrupt(struct pt_regs *regs)
 {
 	unsigned irqs;
 	struct irq_action *act;
@@ -73,7 +73,7 @@ static void def_hdlr (void *arg)
 }
 
 /*************************************************************************/
-void irq_install_handler (int irq, interrupt_handler_t *hdlr, void *arg)
+void irq_install_handler(int irq, interrupt_handler_t *hdlr, void *arg)
 {
 
 	int flag;
@@ -84,7 +84,7 @@ void irq_install_handler (int irq, interrupt_handler_t *hdlr, void *arg)
 		return;
 	act = &vecs[irq];
 
-	flag = disable_interrupts ();
+	flag = disable_interrupts();
 	if (hdlr) {
 		act->handler = hdlr;
 		act->arg = arg;
@@ -95,11 +95,11 @@ void irq_install_handler (int irq, interrupt_handler_t *hdlr, void *arg)
 		ena &= ~(1 << irq);		/* disable */
 	}
 	wrctl (CTL_IENABLE, ena);
-	if (flag) enable_interrupts ();
+	if (flag) enable_interrupts();
 }
 
 
-int interrupt_init (void)
+int interrupt_init(void)
 {
 	int i;
 
@@ -110,7 +110,7 @@ int interrupt_init (void)
 		vecs[i].count = 0;
 	}
 
-	enable_interrupts ();
+	enable_interrupts();
 	return (0);
 }
 
arch/powerpc/cpu/mpc83xx/cpu.c +1 -1
index 0710f5ab36..20ed82fbcd 100644
@@ -196,7 +196,7 @@ void watchdog_reset (void)
 	immr->wdt.swsrr = 0xaa39;
 
 	if (re_enable)
-		enable_interrupts ();
+		enable_interrupts();
 }
 #endif
 
arch/powerpc/cpu/mpc83xx/interrupts.c +3 -3
index 520c2c363e..04cd147321 100644
@@ -35,7 +35,7 @@ void interrupt_init_cpu (unsigned *decrementer_count)
  * Handle external interrupts
  */
 
-void external_interrupt (struct pt_regs *regs)
+void external_interrupt(struct pt_regs *regs)
 {
 }
 
@@ -45,12 +45,12 @@ void external_interrupt (struct pt_regs *regs)
  */
 
 void
-irq_install_handler (int irq, interrupt_handler_t * handler, void *arg)
+irq_install_handler(int irq, interrupt_handler_t * handler, void *arg)
 {
 }
 
 
-void irq_free_handler (int irq)
+void irq_free_handler(int irq)
 {
 }
 
arch/powerpc/cpu/mpc86xx/interrupts.c +1 -1
index ed780a599d..04c8f25af6 100644
@@ -108,5 +108,5 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  */
 void external_interrupt(struct pt_regs *regs)
 {
-	puts("external_interrupt (oops!)\n");
+	puts("external_interrupt(oops!)\n");
 }
arch/powerpc/lib/interrupts.c +4 -4
index 4b7f543a18..a58ddfa569 100644
@@ -38,13 +38,13 @@ static __inline__ void set_dec (unsigned long val)
 }
 #endif /* !CONFIG_MPC83XX_TIMER */
 
-void enable_interrupts (void)
+void enable_interrupts(void)
 {
 	set_msr (get_msr () | MSR_EE);
 }
 
 /* returns flag if MSR_EE was set before */
-int disable_interrupts (void)
+int disable_interrupts(void)
 {
 	ulong msr = get_msr ();
 
@@ -53,7 +53,7 @@ int disable_interrupts (void)
 }
 
 #ifndef CONFIG_MPC83XX_TIMER
-int interrupt_init (void)
+int interrupt_init(void)
 {
 	/* call cpu specific function from $(CPU)/interrupts.c */
 	interrupt_init_cpu (&decrementer_count);
@@ -67,7 +67,7 @@ int interrupt_init (void)
 
 static volatile ulong timestamp = 0;
 
-void timer_interrupt (struct pt_regs *regs)
+void timer_interrupt(struct pt_regs *regs)
 {
 	/* call cpu specific function from $(CPU)/interrupts.c */
 	timer_interrupt_cpu (regs);
arch/sh/cpu/sh4/interrupts.c +3 -3
index ff7470eccc..5982aad54e 100644
@@ -6,16 +6,16 @@
 
 #include <common.h>
 
-int interrupt_init (void)
+int interrupt_init(void)
 {
 	return 0;
 }
 
-void enable_interrupts (void)
+void enable_interrupts(void)
 {
 
 }
 
-int disable_interrupts (void){
+int disable_interrupts(void){
 	return 0;
 }
board/cobra5272/flash.c +4 -4
index ea3ed73515..6f36c269d4 100644
@@ -167,7 +167,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
 
 	cflag = icache_status();
 	icache_disable();
-	iflag = disable_interrupts ();
+	iflag = disable_interrupts();
 
 	printf ("\n");
 
@@ -235,7 +235,7 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
 	udelay (10000);
 
 	if (iflag)
-		enable_interrupts ();
+		enable_interrupts();
 
 	if (cflag)
 		icache_enable();
@@ -270,7 +270,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
 
 	cflag = icache_status();
 	icache_disable();
-	iflag = disable_interrupts ();
+	iflag = disable_interrupts();
 
 	MEM_FLASH_ADDR1 = CMD_UNLOCK1;
 	MEM_FLASH_ADDR2 = CMD_UNLOCK2;
@@ -301,7 +301,7 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
 		rc = ERR_PROG_ERROR;
 
 	if (iflag)
-		enable_interrupts ();
+		enable_interrupts();
 
 	if (cflag)
 		icache_enable();
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog
#45 lore raw

PATCH v4 33/42 common: Move interrupt functions into a new header

In reply to Simon Glass

These functions do not use driver model but are fairly widely used in U-Boot. But it is not clear that they will use driver model anytime soon, so we don't want to label them as 'legacy'.

Move them to a new irq_func.h header file. Avoid the name 'irq.h' since it is widely used in U-Boot already.

---

Changes in v4: None
Changes in v3:
- Rename irq_legacy to irq_func to avoid the 'legacy' label
- Update commit message

Changes in v2: None

 arch/arc/lib/interrupts.c             |  1 +
 arch/arm/lib/interrupts.c             |  1 +
 arch/arm/lib/interrupts_64.c          |  1 +
 arch/arm/lib/interrupts_m.c           |  1 +
 arch/m68k/cpu/mcf5227x/interrupts.c   |  1 +
 arch/m68k/cpu/mcf523x/interrupts.c    |  1 +
 arch/m68k/cpu/mcf52x2/interrupts.c    |  1 +
 arch/m68k/cpu/mcf530x/interrupts.c    |  1 +
 arch/m68k/cpu/mcf532x/interrupts.c    |  1 +
 arch/m68k/cpu/mcf5445x/interrupts.c   |  1 +
 arch/m68k/cpu/mcf547x_8x/interrupts.c |  1 +
 arch/m68k/cpu/mcf547x_8x/slicetimer.c |  1 +
 arch/m68k/lib/interrupts.c            |  1 +
 arch/m68k/lib/time.c                  |  1 +
 arch/microblaze/cpu/interrupts.c      |  1 +
 arch/mips/cpu/interrupts.c            |  1 +
 arch/mips/mach-jz47xx/jz4780/timer.c  |  1 +
 arch/nds32/cpu/n1213/ag101/timer.c    |  1 +
 arch/nds32/lib/interrupts.c           |  1 +
 arch/nios2/cpu/interrupts.c           |  1 +
 arch/powerpc/cpu/mpc83xx/interrupts.c |  1 +
 arch/powerpc/cpu/mpc85xx/interrupts.c |  1 +
 arch/powerpc/cpu/mpc85xx/traps.c      |  1 +
 arch/powerpc/cpu/mpc86xx/interrupts.c |  1 +
 arch/powerpc/cpu/mpc8xx/interrupts.c  |  1 +
 arch/powerpc/lib/interrupts.c         |  1 +
 arch/riscv/lib/interrupts.c           |  1 +
 arch/sandbox/lib/interrupts.c         |  1 +
 arch/sh/cpu/sh4/interrupts.c          |  1 +
 arch/x86/cpu/i386/interrupt.c         |  1 +
 arch/x86/cpu/x86_64/interrupts.c      |  1 +
 arch/x86/lib/bios.c                   |  1 +
 arch/x86/lib/interrupts.c             |  1 +
 arch/x86/lib/spl.c                    |  1 +
 arch/xtensa/cpu/exceptions.c          |  1 +
 common/board_r.c                      |  1 +
 common/spl/spl.c                      |  1 +
 drivers/mtd/cfi_flash.c               |  1 +
 drivers/timer/mpc83xx_timer.c         |  1 +
 include/common.h                      |  7 -------
 include/exports.h                     |  2 ++
 include/irq_func.h                    | 19 +++++++++++++++++++
 42 files changed, 60 insertions(+), 7 deletions(-)
 create mode 100644 include/irq_func.h
arch/arc/lib/interrupts.c +1 -0
index 24ff751220..db21fbb114 100644
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <asm/arcregs.h>
 #include <asm/ptrace.h>
 
arch/arm/lib/interrupts.c +1 -0
index e78ca56d25..75b70d9125 100644
@@ -20,6 +20,7 @@
 
 #include <common.h>
 #include <efi_loader.h>
+#include <irq_func.h>
 #include <asm/proc-armv/ptrace.h>
 #include <asm/u-boot-arm.h>
 
arch/arm/lib/interrupts_64.c +1 -0
index a32a4b6868..dffdf57aa2 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <linux/compiler.h>
 #include <efi_loader.h>
 
arch/arm/lib/interrupts_m.c +1 -0
index 95df6cb1eb..e4373f3781 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 
 /*
  * Upon exception entry ARMv7-M processors automatically save stack
arch/m68k/cpu/mcf5227x/interrupts.c +1 -0
index d38f01950b..5a6a88cd57 100644
@@ -10,6 +10,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_func.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
arch/m68k/cpu/mcf523x/interrupts.c +1 -0
index 1d03724f15..b554c51fcb 100644
@@ -7,6 +7,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_func.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
arch/m68k/cpu/mcf52x2/interrupts.c +1 -0
index f874675b12..35ed1e7901 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <watchdog.h>
 #include <asm/processor.h>
 #include <asm/immap.h>
arch/m68k/cpu/mcf530x/interrupts.c +1 -0
index cd85c69f12..2659e3478f 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
arch/m68k/cpu/mcf532x/interrupts.c +1 -0
index 43a903ed72..8f2df452ba 100644
@@ -7,6 +7,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_func.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
arch/m68k/cpu/mcf5445x/interrupts.c +1 -0
index d38f01950b..5a6a88cd57 100644
@@ -10,6 +10,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_func.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
arch/m68k/cpu/mcf547x_8x/interrupts.c +1 -0
index 2cdf53ea09..703090ddc2 100644
@@ -7,6 +7,7 @@
 
 /* CPU specific interrupt routine */
 #include <common.h>
+#include <irq_func.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
arch/m68k/cpu/mcf547x_8x/slicetimer.c +1 -0
index 544bfd2083..885659e342 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 
 #include <asm/timer.h>
 #include <asm/immap.h>
arch/m68k/lib/interrupts.c +1 -0
index 85ae3b4ee0..ddc91993a1 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <watchdog.h>
 #include <asm/processor.h>
 #include <asm/immap.h>
arch/m68k/lib/time.c +1 -0
index c76c5fedc9..8957d194d4 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <time.h>
 
 #include <asm/timer.h>
arch/microblaze/cpu/interrupts.c +1 -0
index aea612eef1..910c596884 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <fdtdec.h>
+#include <irq_func.h>
 #include <malloc.h>
 #include <asm/microblaze_intc.h>
 #include <asm/asm.h>
arch/mips/cpu/interrupts.c +1 -0
index 1c5192ed33..b3ba9aaeae 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 
 int interrupt_init(void)
 {
arch/mips/mach-jz47xx/jz4780/timer.c +1 -0
index 988ebd2671..b32a2f5643 100644
@@ -9,6 +9,7 @@
 #include <config.h>
 #include <common.h>
 #include <div64.h>
+#include <irq_func.h>
 #include <time.h>
 #include <asm/io.h>
 #include <asm/mipsregs.h>
arch/nds32/cpu/n1213/ag101/timer.c +1 -0
index cbfe07e351..f2e362102e 100644
@@ -9,6 +9,7 @@
  */
 #ifndef CONFIG_TIMER
 #include <common.h>
+#include <irq_func.h>
 #include <time.h>
 #include <asm/io.h>
 #include <faraday/fttmr010.h>
arch/nds32/lib/interrupts.c +1 -0
index 966c19a1ae..88cc7b98d8 100644
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 #undef INTERRUPT_MODE
arch/nios2/cpu/interrupts.c +1 -0
index 96c3020935..e9d1ff911b 100644
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <irq_func.h>
 #include <asm/nios2.h>
 #include <asm/types.h>
 #include <asm/io.h>
arch/powerpc/cpu/mpc83xx/interrupts.c +1 -0
index 04cd147321..e83895deab 100644
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <irq_func.h>
 #include <mpc83xx.h>
 #include <asm/processor.h>
 
arch/powerpc/cpu/mpc85xx/interrupts.c +1 -0
index b5a6ead8bd..e767573193 100644
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <watchdog.h>
 #include <command.h>
 #include <asm/processor.h>
arch/powerpc/cpu/mpc85xx/traps.c +1 -0
index e1d492f05a..804788d050 100644
@@ -21,6 +21,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <irq_func.h>
 #include <kgdb.h>
 #include <asm/processor.h>
 
arch/powerpc/cpu/mpc86xx/interrupts.c +1 -0
index 04c8f25af6..0f930fcd9e 100644
@@ -15,6 +15,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <mpc86xx.h>
 #include <command.h>
 #include <asm/processor.h>
arch/powerpc/cpu/mpc8xx/interrupts.c +1 -0
index 26aa7a5645..6ee6088fa8 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <mpc8xx.h>
 #include <mpc8xx_irq.h>
 #include <asm/cpm_8xx.h>
arch/powerpc/lib/interrupts.c +1 -0
index a58ddfa569..64ee0cc210 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <asm/processor.h>
 #include <watchdog.h>
 #ifdef CONFIG_LED_STATUS
arch/riscv/lib/interrupts.c +1 -0
index 74c1e561c7..3b25c5b7a7 100644
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 #include <asm/encoding.h>
arch/sandbox/lib/interrupts.c +1 -0
index 4ddcd37522..21f761ac3b 100644
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 
 int interrupt_init(void)
 {
arch/sh/cpu/sh4/interrupts.c +1 -0
index 5982aad54e..278a3e32ac 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 
 int interrupt_init(void)
 {
arch/x86/cpu/i386/interrupt.c +1 -0
index 1445204878..78aa51a3ea 100644
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <dm.h>
 #include <efi_loader.h>
+#include <irq_func.h>
 #include <asm/control_regs.h>
 #include <asm/i8259.h>
 #include <asm/interrupt.h>
arch/x86/cpu/x86_64/interrupts.c +1 -0
index 15830d6a1a..634f7660c0 100644
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <asm/processor-flags.h>
 
 void enable_interrupts(void)
arch/x86/lib/bios.c +1 -0
index b990f53bfd..30c0997fd0 100644
@@ -7,6 +7,7 @@
  */
 #include <common.h>
 #include <bios_emul.h>
+#include <irq_func.h>
 #include <vbe.h>
 #include <linux/linkage.h>
 #include <asm/cache.h>
arch/x86/lib/interrupts.c +1 -0
index 39f8deaed1..b23b8fd402 100644
@@ -30,6 +30,7 @@
  */
 
 #include <common.h>
+#include <irq_func.h>
 #include <asm/interrupt.h>
 
 #if !CONFIG_IS_ENABLED(X86_64)
arch/x86/lib/spl.c +1 -0
index d4e647777a..f0e2bf053d 100644
@@ -7,6 +7,7 @@
 #include <cpu_func.h>
 #include <debug_uart.h>
 #include <dm.h>
+#include <irq_func.h>
 #include <malloc.h>
 #include <spl.h>
 #include <syscon.h>
arch/xtensa/cpu/exceptions.c +1 -0
index fe2dedf3c4..3b8f4a36d3 100644
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <irq_func.h>
 #include <asm/string.h>
 #include <asm/regs.h>
 
common/board_r.c +1 -0
index 6a421002dd..9e4eb35a54 100644
@@ -28,6 +28,7 @@
 #if defined(CONFIG_CMD_KGDB)
 #include <kgdb.h>
 #endif
+#include <irq_func.h>
 #include <malloc.h>
 #include <mapmem.h>
 #ifdef CONFIG_BITBANGMII
common/spl/spl.c +1 -0
index 82fd54c984..d51dbe9942 100644
@@ -11,6 +11,7 @@
 #include <binman_sym.h>
 #include <dm.h>
 #include <handoff.h>
+#include <irq_func.h>
 #include <serial.h>
 #include <spl.h>
 #include <asm/u-boot.h>
drivers/mtd/cfi_flash.c +1 -0
index 0574fa63a4..4ce183b6f3 100644
@@ -22,6 +22,7 @@
 #include <env.h>
 #include <errno.h>
 #include <fdt_support.h>
+#include <irq_func.h>
 #include <asm/processor.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
drivers/timer/mpc83xx_timer.c +1 -0
index 69949d5333..72cb58b693 100644
@@ -8,6 +8,7 @@
 #include <board.h>
 #include <clk.h>
 #include <dm.h>
+#include <irq_func.h>
 #include <status_led.h>
 #include <time.h>
 #include <timer.h>
include/common.h +0 -7
index 6dedb37a06..81387d561e 100644
@@ -208,13 +208,6 @@ ulong	get_bus_freq  (ulong);
 int get_serial_clock(void);
 
 /* $(CPU)/interrupts.c */
-int	interrupt_init	   (void);
-void	timer_interrupt	   (struct pt_regs *);
-void	external_interrupt (struct pt_regs *);
-void	irq_install_handler(int, interrupt_handler_t *, void *);
-void	irq_free_handler   (int);
-void	reset_timer	   (void);
-
 void	enable_interrupts  (void);
 int	disable_interrupts (void);
 
include/exports.h +2 -0
index 147a00f860..8899622738 100644
@@ -1,6 +1,8 @@
 #ifndef __EXPORTS_H__
 #define __EXPORTS_H__
 
+#include <irq_func.h>
+
 #ifndef __ASSEMBLY__
 #ifdef CONFIG_PHY_AQUANTIA
 #include <env.h>
include/irq_func.h new file +19 -0
new file mode 100644
index 0000000000..11d2bdd912
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Header file for interrupt functions
+ *
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+ */
+
+#ifndef __IRQ_FUNC_H
+#define __IRQ_FUNC_H
+
+int interrupt_init(void);
+void timer_interrupt(struct pt_regs *regs);
+void external_interrupt(struct pt_regs *regs);
+void irq_install_handler (int vec, interrupt_handler_t *handler, void *arg);
+void irq_free_handler(int vec);
+void reset_timer(void);
+
+#endif
Signature · 1 line
2.24.0.rc1.363.gb1bccd3e3d-goog