Merge tag 'u-boot-stm32-20200117' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
authorTom Rini <trini@konsulko.com>
Mon, 20 Jan 2020 19:54:42 +0000 (14:54 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 20 Jan 2020 19:54:42 +0000 (14:54 -0500)
- stm32mp1: split SOC and board and cleanup config

562 files changed:
.azure-pipelines.yml
.gitlab-ci.yml
Kconfig
Makefile
README
arch/arc/lib/reset.c
arch/arm/cpu/arm1136/mx35/generic.c
arch/arm/cpu/arm920t/ep93xx/cpu.c
arch/arm/cpu/arm920t/imx/timer.c
arch/arm/cpu/arm926ejs/armada100/timer.c
arch/arm/cpu/arm926ejs/lpc32xx/clk.c
arch/arm/cpu/arm926ejs/mx25/generic.c
arch/arm/cpu/arm926ejs/mx25/reset.c
arch/arm/cpu/arm926ejs/mx27/reset.c
arch/arm/cpu/arm926ejs/mxs/mxs.c
arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
arch/arm/cpu/arm926ejs/spear/reset.c
arch/arm/cpu/arm926ejs/spear/spr_misc.c
arch/arm/cpu/armv7/bcm281xx/reset.c
arch/arm/cpu/armv7/bcmcygnus/reset.c
arch/arm/cpu/armv7/bcmnsp/reset.c
arch/arm/cpu/armv7/ls102xa/clock.c
arch/arm/cpu/armv7/ls102xa/fdt.c
arch/arm/cpu/armv7/stv0991/reset.c
arch/arm/cpu/armv7/vf610/generic.c
arch/arm/cpu/armv8/cache_v8.c
arch/arm/cpu/armv8/fsl-layerscape/cpu.c
arch/arm/cpu/armv8/fsl-layerscape/fdt.c
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c
arch/arm/cpu/armv8/fsl-layerscape/soc.c
arch/arm/cpu/armv8/fsl-layerscape/spl.c
arch/arm/cpu/armv8/s32v234/generic.c
arch/arm/cpu/sa1100/timer.c
arch/arm/include/asm/armv8/mmu.h
arch/arm/include/asm/u-boot-arm.h
arch/arm/lib/bootm.c
arch/arm/lib/div0.c
arch/arm/lib/interrupts.c
arch/arm/lib/interrupts_m.c
arch/arm/lib/relocate_64.S
arch/arm/lib/reset.c
arch/arm/mach-at91/arm920t/reset.c
arch/arm/mach-at91/arm926ejs/reset.c
arch/arm/mach-at91/arm926ejs/timer.c
arch/arm/mach-at91/armv7/reset.c
arch/arm/mach-at91/armv7/timer.c
arch/arm/mach-at91/spl.c
arch/arm/mach-at91/spl_at91.c
arch/arm/mach-at91/spl_atmel.c
arch/arm/mach-bcm283x/reset.c
arch/arm/mach-davinci/misc.c
arch/arm/mach-davinci/reset.c
arch/arm/mach-davinci/spl.c
arch/arm/mach-imx/imx8/cpu.c
arch/arm/mach-imx/mx5/mx53_dram.c
arch/arm/mach-imx/mx6/ddr.c
arch/arm/mach-imx/mx6/litesom.c
arch/arm/mach-imx/mx7/clock.c
arch/arm/mach-imx/mx7ulp/clock.c
arch/arm/mach-imx/mx7ulp/soc.c
arch/arm/mach-imx/speed.c
arch/arm/mach-imx/spl.c
arch/arm/mach-k3/common.c
arch/arm/mach-k3/security.c
arch/arm/mach-keystone/ddr3.c
arch/arm/mach-keystone/mon.c
arch/arm/mach-kirkwood/cpu.c
arch/arm/mach-mediatek/mt7623/init.c
arch/arm/mach-mediatek/mt8516/init.c
arch/arm/mach-mediatek/mt8518/init.c
arch/arm/mach-mediatek/spl.c
arch/arm/mach-meson/board-axg.c
arch/arm/mach-meson/board-common.c
arch/arm/mach-meson/board-g12a.c
arch/arm/mach-meson/board-gx.c
arch/arm/mach-mvebu/armada3700/cpu.c
arch/arm/mach-mvebu/dram.c
arch/arm/mach-mvebu/spl.c
arch/arm/mach-omap2/am33xx/board.c
arch/arm/mach-omap2/am33xx/clock.c
arch/arm/mach-omap2/am33xx/fdt.c
arch/arm/mach-omap2/clocks-common.c
arch/arm/mach-omap2/emif-common.c
arch/arm/mach-omap2/omap5/dra7xx_iodelay.c
arch/arm/mach-omap2/omap5/fdt.c
arch/arm/mach-omap2/omap5/hwinit.c
arch/arm/mach-omap2/reset.c
arch/arm/mach-omap2/sec-common.c
arch/arm/mach-orion5x/dram.c
arch/arm/mach-orion5x/timer.c
arch/arm/mach-rockchip/bootrom.c
arch/arm/mach-rockchip/rk3188/rk3188.c
arch/arm/mach-rockchip/spl.c
arch/arm/mach-rockchip/tpl.c
arch/arm/mach-socfpga/mailbox_s10.c
arch/arm/mach-socfpga/misc.c
arch/arm/mach-socfpga/misc_gen5.c
arch/arm/mach-socfpga/spl_a10.c
arch/arm/mach-socfpga/spl_agilex.c
arch/arm/mach-socfpga/spl_gen5.c
arch/arm/mach-socfpga/spl_s10.c
arch/arm/mach-stm32mp/spl.c
arch/arm/mach-sunxi/dram_sun4i.c
arch/arm/mach-tegra/board.c
arch/arm/mach-tegra/cboot.c
arch/arm/mach-tegra/cmd_enterrcm.c
arch/arm/mach-tegra/pmc.c
arch/arm/mach-tegra/tegra20/crypto.c
arch/arm/mach-uniphier/reset.c
arch/arm/mach-uniphier/spl_board_init.c
arch/arm/mach-versal/clk.c
arch/arm/mach-zynq/spl.c
arch/arm/mach-zynq/timer.c
arch/arm/mach-zynqmp-r5/cpu.c
arch/arm/mach-zynqmp/clk.c
arch/arm/mach-zynqmp/cpu.c
arch/m68k/cpu/mcf5227x/speed.c
arch/m68k/cpu/mcf5227x/start.S
arch/m68k/cpu/mcf523x/speed.c
arch/m68k/cpu/mcf523x/start.S
arch/m68k/cpu/mcf52x2/speed.c
arch/m68k/cpu/mcf52x2/start.S
arch/m68k/cpu/mcf530x/speed.c
arch/m68k/cpu/mcf530x/start.S
arch/m68k/cpu/mcf532x/speed.c
arch/m68k/cpu/mcf532x/start.S
arch/m68k/cpu/mcf5445x/speed.c
arch/m68k/cpu/mcf5445x/start.S
arch/m68k/cpu/mcf547x_8x/speed.c
arch/m68k/cpu/mcf547x_8x/start.S
arch/microblaze/cpu/exception.c
arch/microblaze/lib/bootm.c
arch/mips/cpu/time.c
arch/mips/lib/reloc.c
arch/mips/lib/traps.c
arch/mips/mach-ath79/ar933x/clk.c
arch/mips/mach-ath79/ar934x/clk.c
arch/mips/mach-ath79/dram.c
arch/mips/mach-ath79/qca953x/clk.c
arch/mips/mach-ath79/qca956x/clk.c
arch/mips/mach-jz47xx/jz4780/jz4780.c
arch/mips/mach-jz47xx/jz4780/sdram.c
arch/mips/mach-mtmips/cpu.c
arch/nds32/cpu/n1213/start.S
arch/nds32/lib/bootm.c
arch/nds32/lib/interrupts.c
arch/nios2/cpu/start.S
arch/nios2/cpu/traps.c
arch/powerpc/cpu/mpc83xx/cpu.c
arch/powerpc/cpu/mpc83xx/fdt.c
arch/powerpc/cpu/mpc83xx/spd_sdram.c
arch/powerpc/cpu/mpc83xx/speed.c
arch/powerpc/cpu/mpc83xx/spl_minimal.c
arch/powerpc/cpu/mpc83xx/start.S
arch/powerpc/cpu/mpc85xx/cpu.c
arch/powerpc/cpu/mpc85xx/fdt.c
arch/powerpc/cpu/mpc85xx/interrupts.c
arch/powerpc/cpu/mpc85xx/speed.c
arch/powerpc/cpu/mpc85xx/start.S
arch/powerpc/cpu/mpc85xx/traps.c
arch/powerpc/cpu/mpc86xx/cpu.c
arch/powerpc/cpu/mpc86xx/interrupts.c
arch/powerpc/cpu/mpc86xx/speed.c
arch/powerpc/cpu/mpc86xx/start.S
arch/powerpc/cpu/mpc86xx/traps.c
arch/powerpc/cpu/mpc8xx/cpu.c
arch/powerpc/cpu/mpc8xx/fdt.c
arch/powerpc/cpu/mpc8xx/interrupts.c
arch/powerpc/cpu/mpc8xx/speed.c
arch/powerpc/cpu/mpc8xx/start.S
arch/powerpc/cpu/mpc8xxx/fsl_lbc.c
arch/powerpc/include/asm/ppc.h
arch/powerpc/lib/bootm.c
arch/riscv/cpu/start.S
arch/riscv/lib/bootm.c
arch/riscv/lib/interrupts.c
arch/riscv/lib/reset.c
arch/riscv/lib/spl.c
arch/sandbox/cpu/spl.c
arch/sh/cpu/sh4/cpu.c
arch/sh/cpu/sh4/watchdog.c
arch/sh/lib/board.c
arch/x86/cpu/baytrail/cpu.c
arch/x86/cpu/baytrail/valleyview.c
arch/x86/cpu/cpu.c
arch/x86/cpu/i386/cpu.c
arch/x86/cpu/i386/interrupt.c
arch/x86/cpu/quark/mrc_util.c
arch/x86/cpu/tangier/sdram.c
arch/x86/lib/bootm.c
arch/x86/lib/spl.c
arch/x86/lib/tpl.c
arch/xtensa/cpu/start.S
board/AndesTech/adp-ae3xx/adp-ae3xx.c
board/AndesTech/adp-ag101p/adp-ag101p.c
board/AndesTech/ax25-ae350/ax25-ae350.c
board/Arcturus/ucp1020/spl.c
board/Arcturus/ucp1020/spl_minimal.c
board/BuR/brppt2/board.c
board/BuS/eb_cpu5282/eb_cpu5282.c
board/CarMediaLab/flea3/flea3.c
board/LaCie/edminiv2/edminiv2.c
board/LaCie/net2big_v2/net2big_v2.c
board/LaCie/netspace_v2/netspace_v2.c
board/Marvell/db-88f6281-bp/db-88f6281-bp.c
board/Marvell/dreamplug/dreamplug.c
board/Marvell/guruplug/guruplug.c
board/Marvell/openrd/openrd.c
board/Marvell/sheevaplug/sheevaplug.c
board/Seagate/dockstar/dockstar.c
board/Seagate/goflexhome/goflexhome.c
board/Seagate/nas220/nas220.c
board/Synology/ds109/ds109.c
board/abilis/tb100/tb100.c
board/advantech/imx8qm_rom7720_a1/imx8qm_rom7720_a1.c
board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c
board/alliedtelesis/SBx81LIFXCAT/sbx81lifxcat.c
board/armadeus/apf27/apf27.c
board/armltd/integrator/integrator.c
board/armltd/integrator/timer.c
board/armltd/vexpress/vexpress_common.c
board/armltd/vexpress64/vexpress64.c
board/astro/mcf5373l/mcf5373l.c
board/atmark-techno/armadillo-800eva/armadillo-800eva.c
board/atmel/at91rm9200ek/at91rm9200ek.c
board/atmel/at91sam9260ek/at91sam9260ek.c
board/atmel/at91sam9261ek/at91sam9261ek.c
board/atmel/at91sam9263ek/at91sam9263ek.c
board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c
board/atmel/at91sam9n12ek/at91sam9n12ek.c
board/atmel/at91sam9rlek/at91sam9rlek.c
board/atmel/sam9x60ek/sam9x60ek.c
board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c
board/barco/platinum/platinum.c
board/barco/titanium/titanium.c
board/bluewater/snapper9260/snapper9260.c
board/bosch/shc/board.c
board/bosch/shc/mux.c
board/broadcom/bcm23550_w1d/bcm23550_w1d.c
board/broadcom/bcm28155_ap/bcm28155_ap.c
board/broadcom/bcm_ep/board.c
board/broadcom/bcmns2/northstar2.c
board/calao/usb_a9263/usb_a9263.c
board/cavium/thunderx/thunderx.c
board/cloudengines/pogo_e02/pogo_e02.c
board/cobra5272/cobra5272.c
board/compulab/cl-som-imx7/spl.c
board/compulab/cm_fx6/spl.c
board/compulab/cm_t335/spl.c
board/compulab/cm_t43/spl.c
board/d-link/dns325/dns325.c
board/egnite/ethernut5/ethernut5.c
board/engicam/common/board.c
board/esd/meesc/meesc.c
board/esd/vme8349/vme8349.c
board/firefly/firefly-rk3288/firefly-rk3288.c
board/freescale/b4860qds/b4860qds.c
board/freescale/b4860qds/spl.c
board/freescale/bsc9131rdb/ddr.c
board/freescale/bsc9131rdb/spl_minimal.c
board/freescale/bsc9132qds/spl_minimal.c
board/freescale/c29xpcie/spl.c
board/freescale/c29xpcie/spl_minimal.c
board/freescale/corenet_ds/corenet_ds.c
board/freescale/imx8mm_evk/spl.c
board/freescale/imx8mn_evk/spl.c
board/freescale/imx8mp_evk/spl.c
board/freescale/imx8mq_evk/spl.c
board/freescale/imx8qm_mek/imx8qm_mek.c
board/freescale/imx8qxp_mek/imx8qxp_mek.c
board/freescale/ls1012afrdm/eth.c
board/freescale/ls1012afrdm/ls1012afrdm.c
board/freescale/ls1012ardb/eth.c
board/freescale/ls1012ardb/ls1012ardb.c
board/freescale/ls1021aiot/ls1021aiot.c
board/freescale/ls1021aqds/ls1021aqds.c
board/freescale/ls1021atsn/ls1021atsn.c
board/freescale/ls1021atwr/ls1021atwr.c
board/freescale/ls1088a/eth_ls1088aqds.c
board/freescale/ls1088a/eth_ls1088ardb.c
board/freescale/ls2080a/ls2080a.c
board/freescale/ls2080aqds/eth.c
board/freescale/ls2080ardb/eth_ls2080rdb.c
board/freescale/lx2160a/eth_lx2160aqds.c
board/freescale/lx2160a/eth_lx2160ardb.c
board/freescale/lx2160a/lx2160a.c
board/freescale/m5208evbe/m5208evbe.c
board/freescale/m52277evb/m52277evb.c
board/freescale/m5235evb/m5235evb.c
board/freescale/m5249evb/m5249evb.c
board/freescale/m5253demo/m5253demo.c
board/freescale/m5272c3/m5272c3.c
board/freescale/m5275evb/m5275evb.c
board/freescale/m53017evb/m53017evb.c
board/freescale/m5329evb/m5329evb.c
board/freescale/m5373evb/m5373evb.c
board/freescale/m54418twr/m54418twr.c
board/freescale/m54451evb/m54451evb.c
board/freescale/mpc8308rdb/sdram.c
board/freescale/mpc8313erdb/mpc8313erdb.c
board/freescale/mpc8323erdb/mpc8323erdb.c
board/freescale/mpc832xemds/mpc832xemds.c
board/freescale/mpc8349emds/mpc8349emds.c
board/freescale/mpc8349itx/mpc8349itx.c
board/freescale/mpc837xerdb/mpc837xerdb.c
board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
board/freescale/mx53ard/mx53ard.c
board/freescale/mx53smd/mx53smd.c
board/freescale/mx6memcal/spl.c
board/freescale/p1010rdb/spl.c
board/freescale/p1010rdb/spl_minimal.c
board/freescale/p1022ds/diu.c
board/freescale/p1022ds/spl.c
board/freescale/p1022ds/spl_minimal.c
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
board/freescale/p1_p2_rdb_pc/spl.c
board/freescale/p1_p2_rdb_pc/spl_minimal.c
board/freescale/p2041rdb/p2041rdb.c
board/freescale/qemu-ppce500/qemu-ppce500.c
board/freescale/s32v234evb/s32v234evb.c
board/freescale/t102xqds/spl.c
board/freescale/t102xqds/t102xqds.c
board/freescale/t102xrdb/spl.c
board/freescale/t102xrdb/t102xrdb.c
board/freescale/t1040qds/diu.c
board/freescale/t1040qds/t1040qds.c
board/freescale/t104xrdb/diu.c
board/freescale/t104xrdb/spl.c
board/freescale/t104xrdb/t104xrdb.c
board/freescale/t208xqds/spl.c
board/freescale/t208xqds/t208xqds.c
board/freescale/t208xrdb/spl.c
board/freescale/t208xrdb/t208xrdb.c
board/freescale/t4qds/spl.c
board/freescale/t4qds/t4240emu.c
board/freescale/t4qds/t4240qds.c
board/freescale/t4rdb/spl.c
board/freescale/t4rdb/t4240rdb.c
board/freescale/vf610twr/vf610twr.c
board/gateworks/gw_ventana/gw_ventana_spl.c
board/gdsys/mpc8308/sdram.c
board/gdsys/p1022/controlcenterd-id.c
board/gdsys/p1022/diu.c
board/hisilicon/hikey/hikey.c
board/hisilicon/hikey960/hikey960.c
board/hisilicon/poplar/poplar.c
board/ids/ids8313/ids8313.c
board/inversepath/usbarmory/usbarmory.c
board/keymile/km83xx/km83xx.c
board/keymile/km_arm/km_arm.c
board/keymile/kmp204x/kmp204x.c
board/kmc/kzm9g/kzm9g.c
board/kosagi/novena/novena_spl.c
board/l+g/vinco/vinco.c
board/laird/wb45n/wb45n.c
board/liebherr/display5/spl.c
board/mini-box/picosam9g45/picosam9g45.c
board/mpc8308_p1m/sdram.c
board/phytec/pcl063/pcl063.c
board/phytec/phycore_am335x_r2/board.c
board/phytium/durian/durian.c
board/qualcomm/dragonboard410c/dragonboard410c.c
board/qualcomm/dragonboard820c/dragonboard820c.c
board/renesas/alt/alt.c
board/renesas/alt/alt_spl.c
board/renesas/blanche/blanche.c
board/renesas/condor/condor.c
board/renesas/draak/draak.c
board/renesas/eagle/eagle.c
board/renesas/ebisu/ebisu.c
board/renesas/gose/gose.c
board/renesas/gose/gose_spl.c
board/renesas/grpeach/grpeach.c
board/renesas/koelsch/koelsch.c
board/renesas/koelsch/koelsch_spl.c
board/renesas/lager/lager.c
board/renesas/lager/lager_spl.c
board/renesas/porter/porter.c
board/renesas/porter/porter_spl.c
board/renesas/rcar-common/gen3-spl.c
board/renesas/salvator-x/salvator-x.c
board/renesas/silk/silk.c
board/renesas/silk/silk_spl.c
board/renesas/stout/cpld.c
board/renesas/stout/stout_spl.c
board/ronetix/pm9261/pm9261.c
board/ronetix/pm9263/pm9263.c
board/ronetix/pm9g45/pm9g45.c
board/samsung/arndale/arndale.c
board/samsung/common/board.c
board/samsung/smdkc100/smdkc100.c
board/samsung/smdkv310/smdkv310.c
board/sbc8349/sbc8349.c
board/sbc8641d/sbc8641d.c
board/seco/mx6quq7/mx6quq7.c
board/siemens/corvus/board.c
board/siemens/smartweb/smartweb.c
board/siemens/taurus/taurus.c
board/socrates/sdram.c
board/socrates/socrates.c
board/st/stm32mp1/stm32mp1.c
board/sunxi/board.c
board/synopsys/emsdp/emsdp.c
board/synopsys/iot_devkit/iot_devkit.c
board/sysam/amcore/amcore.c
board/sysam/stmark2/stmark2.c
board/technexion/pico-imx6ul/spl.c
board/technexion/pico-imx7d/spl.c
board/technologic/ts4800/ts4800.c
board/ti/am43xx/board.c
board/ti/am57xx/board.c
board/ti/dra7xx/evm.c
board/ti/ks2_evm/board.c
board/ti/ks2_evm/board_k2g.c
board/ti/ks2_evm/mux-k2g.h
board/timll/devkit3250/devkit3250.c
board/toradex/apalis-imx8/apalis-imx8.c
board/toradex/apalis_imx6/apalis_imx6.c
board/toradex/colibri-imx8x/colibri-imx8x.c
board/toradex/colibri_imx6/colibri_imx6.c
board/toradex/colibri_imx7/colibri_imx7.c
board/tqc/tqm834x/tqm834x.c
board/ucRobotics/bubblegum_96/bubblegum_96.c
board/varisys/cyrus/cyrus.c
board/ve8313/ve8313.c
board/woodburn/woodburn.c
board/xilinx/versal/board.c
board/zyxel/nsa310s/nsa310s.c
cmd/Kconfig
cmd/Makefile
cmd/aes.c
cmd/bmp.c
cmd/booti.c
cmd/bootm.c
cmd/bootz.c
cmd/cramfs.c
cmd/disk.c
cmd/elf.c
cmd/fat.c
cmd/fdc.c [deleted file]
cmd/jffs2.c
cmd/load.c
cmd/mem.c
cmd/mvebu/bubt.c
cmd/nand.c
cmd/net.c
cmd/pxe.c
cmd/pxe_utils.c
cmd/reiser.c
cmd/source.c
cmd/ti/ddr3.c
cmd/tpm_test.c
cmd/ximg.c
cmd/zfs.c
common/Makefile
common/board_f.c
common/board_r.c
common/bootstage.c
common/cli.c
common/command.c
common/flash.c
common/image-cipher.c [new file with mode: 0644]
common/image-fdt.c
common/image-fit.c
common/image.c
common/main.c
common/memsize.c
common/spl/spl.c
common/spl/spl_net.c
common/spl/spl_opensbi.c
common/update.c
drivers/cache/cache-ncore.c
drivers/cache/cache-v5l2.c
drivers/clk/clk_pic32.c
drivers/clk/mpc83xx_clk.c
drivers/ddr/altera/sdram_agilex.c
drivers/ddr/altera/sdram_gen5.c
drivers/ddr/altera/sdram_s10.c
drivers/ddr/altera/sdram_soc64.c
drivers/ddr/marvell/a38x/ddr3_training_ip_engine.c
drivers/misc/Makefile
drivers/misc/imx8/scu_api.c
drivers/misc/ns87308.c [deleted file]
drivers/mmc/fsl_esdhc_spl.c
drivers/mtd/nand/raw/mxc_nand_spl.c
drivers/mtd/spi/fsl_espi_spl.c
drivers/net/ag7xxx.c
drivers/net/fsl_mcdmafec.c
drivers/net/mcffec.c
drivers/net/mpc8xx_fec.c
drivers/pci/pci_rom.c
drivers/ram/bmips_ram.c
drivers/ram/k3-j721e/k3-j721e-ddrss.c
drivers/ram/mpc83xx_sdram.c
drivers/ram/rockchip/dmc-rk3368.c
drivers/ram/rockchip/sdram_rk3188.c
drivers/ram/rockchip/sdram_rk3288.c
drivers/ram/stm32mp1/stm32mp1_ram.c
drivers/ram/stm32mp1/stm32mp1_tests.c
drivers/serial/lpc32xx_hsuart.c
drivers/serial/ns16550.c
drivers/serial/serial.c
drivers/serial/serial_ar933x.c
drivers/serial/serial_ns16550.c
drivers/serial/serial_pxa.c
drivers/spi/ath79_spi.c
drivers/sysreset/sysreset-uclass.c
drivers/usb/gadget/f_sdp.c
drivers/usb/musb/musb_udc.c
drivers/usb/phy/rockchip_usb2_phy.c
drivers/video/broadwell_igd.c
drivers/watchdog/imx_watchdog.c
drivers/watchdog/mtk_wdt.c
drivers/watchdog/ulp_wdog.c
drivers/watchdog/wdt-uclass.c
env/flash.c
examples/api/libgenwrap.c
include/clock_legacy.h [new file with mode: 0644]
include/common.h
include/compiler.h
include/cpu_func.h
include/eeprom.h
include/exports.h
include/fdt_support.h
include/fdtdec.h
include/flash.h
include/fs.h
include/hang.h [new file with mode: 0644]
include/image.h
include/init.h
include/linux/kernel.h
include/linux/types.h
include/net.h
include/ns87308.h [deleted file]
include/time.h
include/u-boot/aes.h [new file with mode: 0644]
include/uboot_aes.h
lib/Makefile
lib/aes.c
lib/aes/Makefile [new file with mode: 0644]
lib/aes/aes-decrypt.c [new file with mode: 0644]
lib/aes/aes-encrypt.c [new file with mode: 0644]
lib/display_options.c
lib/efi/efi_app.c
lib/fdtdec.c
lib/hang.c
lib/libavb/avb_sysdeps_posix.c
lib/optee/optee.c
lib/panic.c
lib/zlib/zutil.c
net/net.c
net/nfs.c
net/tftp.c
post/Makefile
scripts/config_whitelist.txt
test/lib/Makefile
test/lib/test_aes.c [new file with mode: 0644]
tools/Makefile
tools/fit_image.c
tools/image-host.c

index 3b7744ce3c38465adebf719e4fd6f9ce84d18a42..916ab84ea0c49e177094ee239486d1dcf3eb293b 100644 (file)
@@ -1,7 +1,7 @@
 variables:
   windows_vm: vs2015-win2012r2
   ubuntu_vm: ubuntu-18.04
-  ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20191202-10Jan2020
+  ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20200112-17Jan2020
   # Add '-u 0' options for Azure pipelines, otherwise we get "permission
   # denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer",
   # since our $(ci_runner_image) user is not root.
index d799cc30a8b90518c19618e540c88dbeda8ddcbb..c7ca5967dd49abb0afe9f24dcb1742afb22f6132 100644 (file)
@@ -2,7 +2,7 @@
 
 # Grab our configured image.  The source for this is found at:
 # https://gitlab.denx.de/u-boot/gitlab-ci-runner
-image: trini/u-boot-gitlab-ci-runner:bionic-20191202-10Jan2020
+image: trini/u-boot-gitlab-ci-runner:bionic-20200112-17Jan2020
 
 # We run some tests in different order, to catch some failures quicker.
 stages:
diff --git a/Kconfig b/Kconfig
index d9be0daf23a19ff60d141d656e332fc17808a5ff..caae4aecbdfb29d012381c6f7d096ac1b4ff6064 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -383,6 +383,14 @@ config FIT_ENABLE_RSASSA_PSS_SUPPORT
          Enable this to support the pss padding algorithm as described
          in the rfc8017 (https://tools.ietf.org/html/rfc8017).
 
+config FIT_CIPHER
+       bool "Enable ciphering data in a FIT uImages"
+       depends on DM
+       select AES
+       help
+         Enable the feature of data ciphering/unciphering in the tool mkimage
+         and in the u-boot support of the FIT image.
+
 config FIT_VERBOSE
        bool "Show verbose messages when FIT images fail"
        help
index 3f332e68856d132db60c5b9fca8c62fa371fab82..9d7d8c269c80118d19d400b2d3c5fce5adf79f60 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -763,7 +763,9 @@ libs-y += cmd/
 libs-y += common/
 libs-y += env/
 libs-$(CONFIG_API) += api/
-libs-$(CONFIG_HAS_POST) += post/
+ifdef CONFIG_POST
+libs-y += post/
+endif
 libs-$(CONFIG_UNIT_TEST) += test/ test/dm/
 libs-$(CONFIG_UT_ENV) += test/env/
 libs-$(CONFIG_UT_OPTEE) += test/optee/
diff --git a/README b/README
index 91dfb24776e185986788603ad055da9d218a689b..c1324c1296346fa07fd0e33da2ca57cf9f532fce 100644 (file)
--- a/README
+++ b/README
@@ -2460,7 +2460,7 @@ typically in board_init_f() and board_init_r().
 Configuration Settings:
 -----------------------
 
-- CONFIG_SYS_SUPPORT_64BIT_DATA: Defined automatically if compiled as 64-bit.
+- MEM_SUPPORT_64BIT_DATA: Defined automatically if compiled as 64-bit.
                Optionally it can be defined to support 64-bit memory commands.
 
 - CONFIG_SYS_LONGHELP: Defined when you want long help messages included;
@@ -2870,32 +2870,6 @@ Low Level (hardware related) configuration options:
                If this macro is defined, then CONFIG_SYS_CCSRBAR_PHYS will be
                forced to a value that ensures that CCSR is not relocated.
 
-- Floppy Disk Support:
-               CONFIG_SYS_FDC_DRIVE_NUMBER
-
-               the default drive number (default value 0)
-
-               CONFIG_SYS_ISA_IO_STRIDE
-
-               defines the spacing between FDC chipset registers
-               (default value 1)
-
-               CONFIG_SYS_ISA_IO_OFFSET
-
-               defines the offset of register from address. It
-               depends on which part of the data bus is connected to
-               the FDC chipset. (default value 0)
-
-               If CONFIG_SYS_ISA_IO_STRIDE CONFIG_SYS_ISA_IO_OFFSET and
-               CONFIG_SYS_FDC_DRIVE_NUMBER are undefined, they take their
-               default value.
-
-               if CONFIG_SYS_FDC_HW_INIT is defined, then the function
-               fdc_hw_init() is called at the beginning of the FDC
-               setup. fdc_hw_init() must be provided by the board
-               source code. It is used to make hardware-dependent
-               initializations.
-
 - CONFIG_IDE_AHB:
                Most IDE controllers were designed to be connected with PCI
                interface. Only few of them were designed for AHB interface.
index 02e08df48de08234a7e751086ffd4da595220136..30dd4b5238b26ebfcb7ac655201b089c547881b8 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <command.h>
 #include <common.h>
+#include <cpu_func.h>
 
 __weak void reset_cpu(ulong addr)
 {
index a651b8c3414b11d91d93b1af9def647402609f0e..45bf49b5ac7372e15fda825b427637c89201c7ab 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <div64.h>
 #include <asm/io.h>
 #include <linux/errno.h>
index 3aae12f8ad3f62684218ecb4670e8ed6f9ac4809..c9ea4e46a8708a4d372c625ce93c963c5b6c0bb4 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/ep93xx.h>
 #include <asm/io.h>
 
index 17081ddb6d8d5f7e7d40860b78670662e3239e33..21129a7901c5ef0c784bdbf2242648a238938418 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <time.h>
 #if defined (CONFIG_IMX)
 
@@ -71,7 +72,7 @@ unsigned long long get_ticks(void)
  * This function is derived from PowerPC code (timebase clock frequency).
  * On ARM it returns the number of timer ticks per second.
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
        return CONFIG_SYS_HZ;
 }
@@ -79,7 +80,7 @@ ulong get_tbclk (void)
 /*
  * Reset the cpu by setting up the watchdog timer and let him time out
  */
-void reset_cpu (ulong ignored)
+void reset_cpu(ulong ignored)
 {
        /* Disable watchdog and set Time-Out field to 0 */
        WCR = 0x00000000;
index 6c6948a8ef4cee45b12a58ee0452ed765df19601..f4962ec45f984de32ee5733e1efba8393a18adc1 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <time.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/armada100.h>
@@ -138,7 +139,7 @@ int timer_init(void)
  * 2. Write key value to TMP_WSAR reg.
  * 3. Perform write operation.
  */
-void reset_cpu (unsigned long ignored)
+void reset_cpu(unsigned long ignored)
 {
        struct armd1mpmu_registers *mpmu =
                (struct armd1mpmu_registers *) ARMD1_MPMU_BASE;
@@ -188,7 +189,7 @@ unsigned long long get_ticks(void)
  * This function is derived from PowerPC code (timebase clock frequency).
  * On ARM it returns the number of timer ticks per second.
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
        return (ulong)CONFIG_SYS_HZ;
 }
index 5eb630dabe959a28f5093db5da4f2358ebbcb957..cb2344d79fec1a0e3b5a73eda3acc1584e93c628 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <div64.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clk.h>
index eeb61d0d102028ee57887f32957a19ed61a8a119..09bda0e3398e38ce6cb0498f144e03917c5f9673 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <div64.h>
 #include <netdev.h>
 #include <vsprintf.h>
index 576f7fac6faa151f5814d53f9cc8d4718f31ac47..38df1c94022726f887767115f0b6190d62a8a939 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 
index e2437d13c84f77659602e84a6f6c59809ebb69ba..320b0a65e70b3ed9cfb7f0869d3923b87b9c3db2 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 
index 183aa40b6d1d30daa05b3e109ba800728ea422e4..16c080a1e159c7c34003254e85f44c125cad01d5 100644 (file)
@@ -10,6 +10,8 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
index 7818d729086bccd13a5eff93aeb7d83dfa36d953..542543cc2857a416e5a64d2df79f1699a092bf94 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
index 7a1b39844e3ef6fedbf2c04da73904185a74fde1..7c57cab0b13241ccd546d0f68d6eedc185715a74 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 
index 05c7ecdb4917eac9c1205c17dcb712b4dbe4672c..3b884cd0d3cd630e36536d21bc3605d97abc2c7b 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/spr_syscntl.h>
index ccf944f8140c244ce8a6959d1be65a01471df158..d5be646555e170d820942ae1ed63ed8ed7519c19 100644 (file)
@@ -9,6 +9,7 @@
 #include <cpu_func.h>
 #include <env.h>
 #include <i2c.h>
+#include <init.h>
 #include <net.h>
 #include <linux/mtd/st_smi.h>
 #include <asm/io.h>
index fbdeea4de3c84feaeb870abdd3cdde678d14ea39..fda5a9527ec3a5bf7714e133b3c7f02a857985c1 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/sysmap.h>
 
index 7f3f4055e42dd8b6c8bb35fd538ef5207cdc6e97..3bfed34533bd4e3fbdef85056c44f2caaf98664b 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 
 #define CRMU_MAIL_BOX1         0x03024028
index 674166daabe527c9de5fcd5b2dd3007497b752d2..675f99fe998fd53e19cc7a8ff4fba545f219399d 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 
 #define CRU_RESET_OFFSET       0x1803F184
index 7a1053cebb4a52255bbf408f9eebb74fbcdf42b3..f3bdb14c0722e22bbce90b27c3bad8e678bbd2f4 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/io.h>
 #include <asm/arch/immap_ls102xa.h>
 #include <asm/arch/clock.h>
index 1aadffff5991954edc7a56ff8a10babdc5a5c047..16ab8676fe4dfd2c611370d06695a9a95519b7c7 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <asm/io.h>
index d4b3ab7fd80eaf6f266f5b3d106ff278da657329..008e271dccfbbe09047c3638ec2a7a95073c7aee 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/stv0991_wdru.h>
 void reset_cpu(ulong ignored)
index 806c6adf387f4d9316511a07a89da71a88c673b8..6698b821d0e1b03068d48b4f8edf08c6b8506d91 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
index c1a08fb4ace13cf8f049860b54083bab2e34b9b1..6a5518f9de82db7ac03e275b0266fb9ae5418222 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <hang.h>
 #include <asm/system.h>
 #include <asm/armv8/mmu.h>
 
index 639f5316498feac707a94b3c03c3bcb1691f65d8..dce915a2ea18d21e772d9d431924b8bb5a80f059 100644 (file)
@@ -8,6 +8,8 @@
 #include <cpu_func.h>
 #include <env.h>
 #include <fsl_ddr_sdram.h>
+#include <init.h>
+#include <hang.h>
 #include <vsprintf.h>
 #include <asm/io.h>
 #include <linux/errno.h>
index 1e7e46e88a06459ad5444c679e7d3e2ef00b8101..87c3e05f4585ac44ee2f9601bd930cb83926d0b3 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <efi_loader.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
index fec231857bf1e7398c416bb3dffa339a6a49e734..c56689086de68aa8422c2704382836fee95da08c 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <cpu_func.h>
 #include <linux/compiler.h>
 #include <asm/io.h>
index bd8b9cbdaddb227338b9e4f8b489bec65e0c5021..7f8178f72ebdef7a8c8c6888e38c3f3fcbe65fc7 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <cpu_func.h>
 #include <linux/compiler.h>
 #include <fsl_ifc.h>
index 578f8d12de65d58cf6906a32fb13feaf2b505a66..2175266a30d2a6739896b57d5d753fa4361eeb0d 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <env.h>
 #include <fsl_immap.h>
 #include <fsl_ifc.h>
index ed3a6056637543c6d6ed5f122ed5d294078dae57..8a6eecab22e3ba9c9cd24ab3f4d9bab1d18eccd5 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <cpu_func.h>
 #include <env.h>
 #include <spl.h>
index 2c4ea36e07ef33672446fd23925b04acabe52f35..ec4641dcdbe2bf20851139875fe17022cd735c42 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
index c6b1b2c177512b68b2ec9e2e1f3c951284712bc0..8e20c96bcda1dfb7b4850534f5be0caf4b1cea66 100644 (file)
@@ -59,7 +59,7 @@ unsigned long long get_ticks(void)
  * This function is derived from PowerPC code (timebase clock frequency).
  * On ARM it returns the number of timer ticks per second.
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
        return CONFIG_SYS_HZ;
 }
index 4a573208dfd0995da25377ab44bb51b44357e02e..fc97c55114682bb6e061a8db48538d7a58b28e67 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef _ASM_ARMV8_MMU_H_
 #define _ASM_ARMV8_MMU_H_
 
+#include <hang.h>
 #include <linux/const.h>
 
 /*
index 2e8c8e53d79bc905f00cc169f334290b0fe01d72..0b93cc48c50dab1e954bb8afc5c6baa4f39f92db 100644 (file)
@@ -23,6 +23,8 @@ extern ulong _datarellocal_start_ofs;
 extern ulong _datarelro_start_ofs;
 extern ulong IRQ_STACK_START_IN;       /* 8 bytes in IRQ stack */
 
+void s_init(void);
+
 /* cpu/.../cpu.c */
 int    cleanup_before_linux(void);
 
@@ -52,6 +54,8 @@ void do_fiq(struct pt_regs *pt_regs);
 void do_irq(struct pt_regs *pt_regswq);
 #endif
 
+void reset_misc(void);
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _U_BOOT_ARM_H_ */
index 769a64257fc4e272c9bd92a4e0ecd9ff61a0cfe9..a135bcfc7b55664382bb5f105b7944dbbf55d091 100644 (file)
@@ -15,6 +15,7 @@
 #include <command.h>
 #include <cpu_func.h>
 #include <dm.h>
+#include <hang.h>
 #include <dm/root.h>
 #include <env.h>
 #include <image.h>
index e185bfe0c652fc7df417573877bd222e3c549f90..b91b408f64bfa0ff2e78a00544c863c9f9293a30 100644 (file)
@@ -4,10 +4,10 @@
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  */
 
+#include <hang.h>
+
 /* Replacement (=dummy) for GNU/Linux division-by zero handler */
 void __div0 (void)
 {
-       extern void hang (void);
-
        hang();
 }
index 75b70d9125361afdde7dbb39f1d8498549652fa8..6dbf03b00cd5c98ac0eeb61b2296cfe4a14e072a 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <efi_loader.h>
 #include <irq_func.h>
 #include <asm/proc-armv/ptrace.h>
@@ -48,7 +49,7 @@ int disable_interrupts(void)
 void bad_mode (void)
 {
        panic ("Resetting CPU ...\n");
-       reset_cpu (0);
+       reset_cpu(0);
 }
 
 static void show_efi_loaded_images(struct pt_regs *regs)
index e4373f3781058649eed0934fbd462029824eba19..1f6fdf2995d88633496a3e7287d6a8d2972e7d1d 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <irq_func.h>
 
 /*
index 26d29c5324ac695c1b7ef3fb86b3032373eef8a3..72e91f2704b1757ed35adbf366204a52a04e6d09 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/macro.h>
 
 /*
- * void relocate_code (addr_moni)
+ * void relocate_code(addr_moni)
  *
  * This function relocates the monitor code.
  * x0 holds the destination address.
index 3c4512d495a9fe5b9770bfc525e1f48bc84ccf64..835a40e59d93b466c87298e684ec5aee763b4c2b 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <irq_func.h>
 
 __weak void reset_misc(void)
index 3164182b697949c456f9b1c63b3d5534be142c2e..d92bc57d6690c9446b9cfb4823260a7540f750f8 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_st.h>
index 06b25db52225d214f359f807ee635cfecbf07473..56fbbd991e5d5e4b34631703defb8c15725a0c90 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_rstc.h>
index f81e8455937cd18b271f09296b41c8fe52267bd4..31ad0bf7026f99354a203c4bad821d21ed3b34fb 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_pit.h>
index c114dafac5d1462fb36e29fe502e0bb172795b46..8f4c81d1afd5ea01760023185a19a031a0ba4913 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_rstc.h>
index 9f08806fb127003236d9215983786f813d7b7b54..15c036cc27edf0787d5de6cc565e2c814dbd84d1 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_pit.h>
index 6da6d41be2ecffc5cbe99b46e80a538e046f1683..156150c89c8b5222cbfd7c409993afea2d4565eb 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_wdt.h>
index 1065f090e0102d06686409ccf7d477524fa042af..822f877de717a00633d8afb945561080452243b0 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91sam9_matrix.h>
index 85290be3696535ffdfd5e439fc4485c689659cb6..6ee0e1c24cfbc6fa4715ae2ffcf9753a9a9800f6 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pit.h>
index cd8138d70221173309cc165afb0a410039914b06..2b4ccd47279f9844df79b8c40457b7429c07e059 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/base.h>
 #include <asm/arch/wdog.h>
index 80e964274e19310449e0211f74d504c5f73d4393..3e5185261c7611e753024d1203ef1afe4786c824 100644 (file)
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <env.h>
 #include <i2c.h>
+#include <init.h>
 #include <net.h>
 #include <asm/arch/hardware.h>
 #include <asm/io.h>
index 9fbd09c77b7db1e6efc03c551112dccd6d988aa9..4e6031a593b7b03b57d19978c38a27711e5caca4 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/timer_defs.h>
 #include <asm/arch/hardware.h>
index be3daa9bc02dfe715d72bc12897be10b66774d7f..d44e840aa0edbacb829bfffbb21d13fe0f67d446 100644 (file)
@@ -5,6 +5,7 @@
  */
 #include <common.h>
 #include <config.h>
+#include <hang.h>
 #include <spl.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
index d31af47c31d56ff33f5174511ce246c0c603f2a8..211038095771aac641cd9a02079897b832f89227 100644 (file)
@@ -8,6 +8,7 @@
 #include <cpu.h>
 #include <cpu_func.h>
 #include <dm.h>
+#include <init.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
 #include <dm/uclass.h>
index 39ac287fb428bea45d06f86f37c1bcd9b2234228..a7f033f3f44d5fefb5e60171e3867ffa2c338203 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 8ed8b79c8b7b2469fcceef2c7f22e956509d586e..4396880b7482d87c39702c23952a626a61d961ba 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <linux/types.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/mx6-ddr.h>
index 4f4df7433bea21b3005682efc68a3d7c0edd0f20..b0a6bd589c0929b1455cf293157efb7340a46774 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (C) 2016 Grinn
  */
 
+#include <init.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux.h>
 #include <asm/arch/imx-regs.h>
index 0e08cabb7ad07ac858aba02ba39349600b3a068c..75be4f8ad7937ee1f48b632ab2bd7b697f891a47 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <div64.h>
 #include <asm/io.h>
 #include <linux/errno.h>
index d3365dd411d7363de3d95fd851d03175d91a0c1e..3c0bcccd0dc7bc205ce1c1539982d71219b5d230 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <div64.h>
 #include <asm/io.h>
 #include <errno.h>
index 8345b01398bdf0545dbb55dee4159b0d80544715..7f8fdc7005e8cc03a212ba4eabba94d32965311a 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * Copyright (C) 2016 Freescale Semiconductor, Inc.
  */
+#include <cpu_func.h>
 #include <init.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
index f9e486c7df2de8c6d442564142811207b3ef4ab9..e78b1fd71b6e0e7f78c800aeb059bb6eb24bdc34 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
 
index 5a6493a6250a3819bf70f3172d365aa6a607dcaa..87dbdf3011eec20389c7ef8f0f1d08f894510c7f 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
index 50f5b81dfe5d2231727cf6628312ae70b5e7d8b8..4e35a13156bdab7226a11b7e927ba918547675f4 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <spl.h>
 #include "common.h"
 #include <dm.h>
index 4e011ee10ef7038839c006eba92eaa915ac9d5fa..6934e88a965bfdf9942d46ab112e5634820f709c 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <hang.h>
 #include <linux/soc/ti/ti_sci_protocol.h>
 #include <mach/spl.h>
 #include <spl.h>
index 863ae6321ba3762b742dcb725d5ce4544c34cf85..23ff06466dd1aeb58dc3701b4798dd400f1cbd96 100644 (file)
@@ -6,6 +6,7 @@
  *     Texas Instruments Incorporated, <www.ti.com>
  */
 
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <common.h>
 #include <asm/arch/msmc.h>
index cc2ec8850568263b74f4a0920ce2332753bae887..b7de9ba099de3922919b9dce12370e64e100e99b 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) 2012-2019 Texas Instruments Incorporated - http://www.ti.com/
  */
 
+#include <hang.h>
 #include <asm/unaligned.h>
 #include <common.h>
 #include <command.h>
index 29c0e592e42de26d7426743f51c39a99051838f2..5e964af8eab0a0190549aef02f063ca7bac9ca18 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <netdev.h>
 #include <asm/cache.h>
index 0ee8c6664c6106f8aaa111f3a37f5f9871078d96..2778e260e024cf9d040fac598df8439eea84bafe 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
 #include <asm/arch/misc.h>
index 186f6c048acf21d1729a0b2540a15d3e60358da9..360d94abb00e658880590fa905e8634e603b5a77 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <clk.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <ram.h>
index 5a97c8cb2642ff896b65096f66f7d8a7f4f35b12..c2b1b7698249b251f573189c9e04aac2f5d45fdf 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <clk.h>
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <ram.h>
index 9b3590ff3d20b0ec105a7c4e7df13dd9b4f45a25..37f1f219b2d55d2844205c872c19a13744ff5fd5 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <clk.h>
 #include <common.h>
+#include <hang.h>
 #include <spl.h>
 
 #include "init.h"
index 173905e762d2635eef46a7ab89b01889b1a25b57..6874458e36ac7d02fc0861fde2d49c21a1abc5ab 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/arch/boot.h>
 #include <asm/arch/eth.h>
 #include <asm/arch/axg.h>
index d33e7f174159efa2458ad82f9c9eeca9caf137e8..bc4c92074cb2f9208a021525f84b51422a8f2b68 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <init.h>
 #include <asm/arch/boot.h>
 #include <env.h>
index 24786df6cdd1142f985b7fc2dad1e01ae5ea9f95..26d6b907906eb0ded7e2df6b61fb6edca3bf9d5f 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/arch/boot.h>
 #include <asm/arch/eth.h>
 #include <asm/arch/g12a.h>
index ab8f1a81f832d687531e4a2e3d249067b68fd823..191fd4900589813316ac36264ad3afd01263fa75 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/arch/boot.h>
 #include <asm/arch/eth.h>
 #include <asm/arch/gx.h>
index 7c8e4cade1ecfa917f159b575589fee3f1885163..c83268181b90d28ee113184351b5dcfc7c18e8f4 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <linux/libfdt.h>
index ba8ebc62887fe21abb469f4ab880506f740be71f..6c6f8d8c5c571168008b72845cce08d3e795265d 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
index 3cb27b7f4b208aca7a6e8e2282197c2ca40d1d74..a99bf166fd85109ce14edd53440bfcf323cf61f3 100644 (file)
@@ -7,6 +7,7 @@
 #include <dm.h>
 #include <debug_uart.h>
 #include <fdtdec.h>
+#include <hang.h>
 #include <spl.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
index e64942b716733bdea70ca4d22cd5e29cf03525cc..283f73522d6dbee85a31d40c094af2999614c143 100644 (file)
@@ -11,6 +11,7 @@
 #include <dm.h>
 #include <debug_uart.h>
 #include <errno.h>
+#include <init.h>
 #include <ns16550.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
index 7c666be758af032a0f0591ea22efb9dbde3bf401..8c61547ee9c5f8d7d2c1e6480806dea5fb9d65b0 100644 (file)
@@ -8,6 +8,7 @@
  * Copyright (C) 2013, Texas Instruments, Incorporated - http://www.ti.com/
  */
 #include <common.h>
+#include <hang.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/hardware.h>
index 1005a5be96d80dd64a029df045f43a76183e7142..c81dc808e5db7f1c63ceb92a75d9218fcf5b7239 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <malloc.h>
index 5932d694d3009862400198f772a061860df29d55..9aff83e9dfdb86b2ee1ee1e64a322e3fad9aff59 100644 (file)
@@ -13,6 +13,7 @@
  *     Rajendra Nayak <rnayak@ti.com>
  */
 #include <common.h>
+#include <hang.h>
 #include <i2c.h>
 #include <asm/omap_common.h>
 #include <asm/gpio.h>
index 290f9dcdb022636d008ad8b2297c35f9650902ae..4658f67e84d321ea474a637b66144f9dd3605b6a 100644 (file)
@@ -9,6 +9,9 @@
  */
 
 #include <common.h>
+#include <hang.h>
+#include <init.h>
+#include <net.h>
 #include <asm/emif.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/sys_proto.h>
index 9eda57c450dda2bfbc037cb1065dcd4b9c667bc2..598074ba21a770fad43958bb28551c62b1c1690a 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/utils.h>
 #include <asm/arch/dra7xx_iodelay.h>
 #include <asm/arch/omap.h>
index 5ba8806dd744f3a49333f4201b40ee2dd8a7572e..c4adba31e6849658d73531b797783d6a1d355bf6 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <malloc.h>
index 56458ce4957d515417ae3cede62a25c67eaa8334..3b1733099fdcd8163e0c48db3c7a1bf2ee146f9a 100644 (file)
@@ -12,6 +12,7 @@
  *     Sricharan       <r.sricharan@ti.com>
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <palmas.h>
 #include <asm/armv7.h>
 #include <asm/arch/cpu.h>
index ea27248e8532bf66f1ec6ff511b1975a332d076d..2bbd5fcb9b8e4dfc7fe31e036cb436ec145815e9 100644 (file)
@@ -9,6 +9,7 @@
  * Sricharan R <r.sricharan@ti.com>
  */
 #include <config.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <linux/compiler.h>
index e9b3e746feaea2aa9b71e276702f32ddffe2e20f..28b929f84f3854acc053495c9fbea94c5332442e 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <hang.h>
+#include <init.h>
 #include <stdarg.h>
 
 #include <asm/arch/sys_proto.h>
index b52c417e309bf106a11046d782ccdc59e2c3d716..33f65db48ea48786aa2cec98d78e810f122b58da 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <init.h>
 #include <asm/arch/cpu.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index 9da978382206bcb0087e3f3caaaa54b489f0b1d9..077eb63e74e974313db97fa6525f0a4a330d0ff3 100644 (file)
@@ -165,7 +165,7 @@ unsigned long long get_ticks(void)
  * This function is derived from PowerPC code (timebase clock frequency).
  * On ARM it returns the number of timer ticks per second.
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
        return (ulong)CONFIG_SYS_HZ;
 }
index 10614c99d9c8b9d5baab8b15d6f5d2bfda19e4c0..1524eca27299c9c2964c59469edd3696a6a05ec8 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/boot_mode.h>
 #include <asm/io.h>
index 1b012f7f67aedfdcef220ddaf6ac0f0807af5e60..61d410d780e4ddf26c1383e8baf6732763e3fd5c 100644 (file)
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <dm.h>
+#include <hang.h>
 #include <syscon.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/bootrom.h>
index 514032a44aab5db692af928d2d5760d6fa34cc00..7d0e6fa1aff3a921b1e515042876b300508f9950 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <debug_uart.h>
 #include <dm.h>
+#include <hang.h>
 #include <ram.h>
 #include <spl.h>
 #include <asm/arch-rockchip/bootrom.h>
index c3734cb07082a358de11bca738f0c3bac0bced13..31a3eb4c285076a33a97af7189343dec0ca5050b 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <debug_uart.h>
 #include <dm.h>
+#include <hang.h>
 #include <ram.h>
 #include <spl.h>
 #include <version.h>
index 3254bc1805a5903169f3e8759a9d00625aac48c1..f30e7f80a2940cfa0ac6a8cb3dc3e235a4f8e322 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <wait_bit.h>
 #include <asm/io.h>
 #include <asm/arch/mailbox_s10.h>
index db71105af34fd6bab4bc6ec00f6343b183277a18..2901b7db680f6a709a2d0f66e5534e9a97894b87 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <errno.h>
 #include <fdtdec.h>
index 35938b2dfc06df3e8cb0a92d1b4e7d42349d9083..21eb934e5653c51785f7bc9eaccd86c2b11a3e14 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <env.h>
 #include <errno.h>
index 7c38c5098169b92fd3c2d39d9038e7347bcbe15c..d9ef851054d85e67371649f8b163582d04d1dc64 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/pl310.h>
 #include <asm/u-boot.h>
index c745d64114c05284ea1a23269f139a32abcae8a7..ecc1a35c4973962775540dd93e489be5e81ddfa0 100644 (file)
@@ -8,6 +8,7 @@
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <common.h>
+#include <hang.h>
 #include <image.h>
 #include <spl.h>
 #include <asm/arch/clock_manager.h>
index e19f55aa9b5e9fbfe85cb57aa441505c622002af..70f8455ddca470b7923df055bf1ad67e1930faf2 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
index 8d96918cb456b5c01bac606cb448368a54460126..d89151d902417acd100746f9bf17ace716c717ee 100644 (file)
@@ -4,6 +4,7 @@
  *
  */
 
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
index a3b0d6f38252a63a4e564e86e4adb1f6aaf52a2f..ca4231cd0df4c58ddc7f34bfdc10d8ee96549b22 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <hang.h>
 #include <spl.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
index 396c0424ea95a793e230fbc4f9ba1d47f7cb7275..72de807a4726ad2524bf8f581065374cd16fbb52 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/dram.h>
index 61eaba711a063c36e27ce858a12da1fbf24efac3..31c49a7c84981928b30fdd5c3e0450c61d128ef1 100644 (file)
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <dm.h>
+#include <init.h>
 #include <ns16550.h>
 #include <spl.h>
 #include <asm/io.h>
index 0762144ecf4a3e843d79e9a0fdf00e68aa8e9bea..c5361ca73d4e630f92893a872ef4973909258e0e 100644 (file)
@@ -7,6 +7,7 @@
 #include <env.h>
 #include <fdt_support.h>
 #include <fdtdec.h>
+#include <hang.h>
 #include <stdlib.h>
 #include <string.h>
 
index 5247e52a5aadd58694b72b953fd4d629924ea93e..b2252f3621918a57e965992189c4e8f280678cd9 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <irq_func.h>
 #include <asm/arch/tegra.h>
 #include <asm/arch-tegra/pmc.h>
index afd3c54179c17079a783432763705692281a0907..68a211286f996f15d93153df9d3a825792168c0f 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 
 #include <linux/arm-smccc.h>
 
index 66fbc3b458c82a4863a4edfa487d1b3e9a6fb69b..b91191eba37729c6620b345d2474b748f4dffccc 100644 (file)
@@ -39,34 +39,35 @@ static void left_shift_vector(u8 *in, u8 *out, int size)
 /**
  * Sign a block of data, putting the result into dst.
  *
- * \param key                  Input AES key, length AES_KEY_LENGTH
+ * \param key                  Input AES key, length AES128_KEY_LENGTH
  * \param key_schedule         Expanded key to use
  * \param src                  Source data of length 'num_aes_blocks' blocks
- * \param dst                  Destination buffer, length AES_KEY_LENGTH
+ * \param dst                  Destination buffer, length AES128_KEY_LENGTH
  * \param num_aes_blocks       Number of AES blocks to encrypt
  */
 static void sign_object(u8 *key, u8 *key_schedule, u8 *src, u8 *dst,
                        u32 num_aes_blocks)
 {
-       u8 tmp_data[AES_KEY_LENGTH];
-       u8 iv[AES_KEY_LENGTH] = {0};
-       u8 left[AES_KEY_LENGTH];
-       u8 k1[AES_KEY_LENGTH];
+       u8 tmp_data[AES128_KEY_LENGTH];
+       u8 iv[AES128_KEY_LENGTH] = {0};
+       u8 left[AES128_KEY_LENGTH];
+       u8 k1[AES128_KEY_LENGTH];
        u8 *cbc_chain_data;
        unsigned i;
 
        cbc_chain_data = zero_key;      /* Convenient array of 0's for IV */
 
        /* compute K1 constant needed by AES-CMAC calculation */
-       for (i = 0; i < AES_KEY_LENGTH; i++)
+       for (i = 0; i < AES128_KEY_LENGTH; i++)
                tmp_data[i] = 0;
 
-       aes_cbc_encrypt_blocks(key_schedule, iv, tmp_data, left, 1);
+       aes_cbc_encrypt_blocks(AES128_KEY_LENGTH, key_schedule, iv,
+                              tmp_data, left, 1);
 
        left_shift_vector(left, k1, sizeof(left));
 
        if ((left[0] >> 7) != 0) /* get MSB of L */
-               k1[AES_KEY_LENGTH-1] ^= AES_CMAC_CONST_RB;
+               k1[AES128_KEY_LENGTH - 1] ^= AES_CMAC_CONST_RB;
 
        /* compute the AES-CMAC value */
        for (i = 0; i < num_aes_blocks; i++) {
@@ -78,31 +79,32 @@ static void sign_object(u8 *key, u8 *key_schedule, u8 *src, u8 *dst,
                        aes_apply_cbc_chain_data(tmp_data, k1, tmp_data);
 
                /* encrypt the AES block */
-               aes_encrypt(tmp_data, key_schedule, dst);
+               aes_encrypt(AES128_KEY_LENGTH, tmp_data,
+                           key_schedule, dst);
 
                debug("sign_obj: block %d of %d\n", i, num_aes_blocks);
 
                /* Update pointers for next loop. */
                cbc_chain_data = dst;
-               src += AES_KEY_LENGTH;
+               src += AES128_KEY_LENGTH;
        }
 }
 
 /**
  * Encrypt and sign a block of data (depending on security mode).
  *
- * \param key          Input AES key, length AES_KEY_LENGTH
+ * \param key          Input AES key, length AES128_KEY_LENGTH
  * \param oper         Security operations mask to perform (enum security_op)
  * \param src          Source data
  * \param length       Size of source data
- * \param sig_dst      Destination address for signature, AES_KEY_LENGTH bytes
+ * \param sig_dst      Destination address for signature, AES128_KEY_LENGTH bytes
  */
 static int encrypt_and_sign(u8 *key, enum security_op oper, u8 *src,
                            u32 length, u8 *sig_dst)
 {
        u32 num_aes_blocks;
-       u8 key_schedule[AES_EXPAND_KEY_LENGTH];
-       u8 iv[AES_KEY_LENGTH] = {0};
+       u8 key_schedule[AES128_EXPAND_KEY_LENGTH];
+       u8 iv[AES128_KEY_LENGTH] = {0};
 
        debug("encrypt_and_sign: length = %d\n", length);
 
@@ -110,15 +112,16 @@ static int encrypt_and_sign(u8 *key, enum security_op oper, u8 *src,
         * The only need for a key is for signing/checksum purposes, so
         * if not encrypting, expand a key of 0s.
         */
-       aes_expand_key(oper & SECURITY_ENCRYPT ? key : zero_key, key_schedule);
+       aes_expand_key(oper & SECURITY_ENCRYPT ? key : zero_key,
+                      AES128_KEY_LENGTH, key_schedule);
 
-       num_aes_blocks = (length + AES_KEY_LENGTH - 1) / AES_KEY_LENGTH;
+       num_aes_blocks = (length + AES128_KEY_LENGTH - 1) / AES128_KEY_LENGTH;
 
        if (oper & SECURITY_ENCRYPT) {
                /* Perform this in place, resulting in src being encrypted. */
                debug("encrypt_and_sign: begin encryption\n");
-               aes_cbc_encrypt_blocks(key_schedule, iv, src, src,
-                                      num_aes_blocks);
+               aes_cbc_encrypt_blocks(AES128_KEY_LENGTH, key_schedule, iv, src,
+                                      src, num_aes_blocks);
                debug("encrypt_and_sign: end encryption\n");
        }
 
index 31685d00094015ae14db436be0ec7590acd58108..92a8b925474f098274d93eaa97f995691fd20a57 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/io.h>
 #include <asm/secure.h>
 
index d09c91ab42c864a2da4ebfad51d6bd63b63c23b9..c7262d70a5df9c84259243cbaa258850a50c06dd 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <hang.h>
 #include <spl.h>
 
 #include "init.h"
index b82cea4ccb6d643f5558fad1647bffca4f5dbb77..9184714e4756d0705f3477676d7a7a00b675d3d9 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 9b7c0be951b58be962a237e2ae2c36613e32e8ef..96ba90fb7a760faacd706fbe4e0b24d2e072581d 100644 (file)
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <debug_uart.h>
+#include <hang.h>
 #include <spl.h>
 
 #include <asm/io.h>
index 8658abb457532732869fe7139975551962cdab12..211ea15884cee0201b9cd14f61ae482ea699b2bf 100644 (file)
@@ -31,6 +31,7 @@
 #include <common.h>
 #include <div64.h>
 #include <dm.h>
+#include <time.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/clk.h>
index 98f63e3427e0654940810a4333a7b2383817b07f..aa5de863eb623c39478efcfee99203293370cf01 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/armv7_mpu.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index 0593b6310fd5b1ea2e37a657e08d5f57f5d90fe5..db2b4a8be2e3734a736c5481c420cf4a2341d5bb 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
index b90d08bbdd4eacdb72c1a2f1040da6b0fd87f2f9..442427bc1106be57cee58b46c8f476fc58744de0 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/armv8/mmu.h>
index f4e53bc82bbefd424d16c9f4db6a45f36fabae07..207f4534807e57f444964aeb495df49ed0259588 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/processor.h>
 
 #include <asm/immap.h>
index 61f9c6859c5c066266dc28146131b6efc510da45..86c93ba3faffb4640034cb2405a7d04ca7521803 100644 (file)
@@ -386,7 +386,7 @@ _start:
 /******************************************************************************/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index a0c1d53e41d5136eab822914fbd25d5d34456005..2f65ac23182ca65bcaa509d5288185a6f5b85b09 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/processor.h>
 
 #include <asm/immap.h>
index f57baa58f5b8d9a0a810363b3aec819b016bda62..8c5a16495523057970b590837b4412e473c8ce66 100644 (file)
@@ -150,7 +150,7 @@ _start:
 /******************************************************************************/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index 0f274adf451a01f7e297b9b742fb7561642be3a5..02ef5d87aa7f2213818c5b5be57f5c4aa4736377 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/processor.h>
 #include <asm/immap.h>
 #include <asm/io.h>
@@ -15,7 +16,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 /* get_clocks() fills in gd->cpu_clock and gd->bus_clk */
-int get_clocks (void)
+int get_clocks(void)
 {
 #if defined(CONFIG_M5208)
        pll_t *pll = (pll_t *) MMAP_PLL;
index f7f124dd2fcd3e4a3e2c3996d4c7695ef6831b96..747a518f6cd5bd9a0c38abb161c63e1b1aef78ef 100644 (file)
@@ -229,7 +229,7 @@ _after_flashbar_copy:
 /******************************************************************************/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index ae260477807ff0200bced339acfea7c9451657ac..cf53dfeb150af2fda519509aed5661144406125d 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/processor.h>
 #include <asm/immap.h>
 
index eb4b33899f6f61804f18b918ee51dc7a03f92082..32356d875ec13a4fe67b00f9fb522dc28b21583b 100644 (file)
@@ -155,7 +155,7 @@ _start:
 /******************************************************************************/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index 661abfa8877d6abbe7779469ffd4569b51a15887..0f54ea4b6a8b00f02556afdf9bbab907fd6c840a 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/processor.h>
 
 #include <asm/immap.h>
index 4411e5fe28c640c7808637dac0042c2818350021..e2d7c72ceec612cbf22560237dc253556f8ab81f 100644 (file)
@@ -165,7 +165,7 @@ _start:
 /******************************************************************************/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index e15e32ebde6a1bd0b8011b7c80027f911b1ebcc4..eaa3b39bec6937fb2d339bfa407374126090f5fe 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/processor.h>
 
 #include <asm/immap.h>
index db30b26c348e6058f4512c5ef1584da041ff437d..80eb287151e263593e4d2c90b433361cb7d01f6e 100644 (file)
@@ -514,7 +514,7 @@ _start:
 /******************************************************************************/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index 5ba6426c454787002051ec8357cda295ca06761c..bc22560ed2cfd5f37c2d9c05353427bf256b410f 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/processor.h>
 
 #include <asm/immap.h>
index 4dd57bf39c48977063161c5b178f393670479fc2..b70842b2b83d8f7009f28adf6ee5a0af3c851f66 100644 (file)
@@ -155,7 +155,7 @@ _start:
 /******************************************************************************/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index bdcbe0868599fdbd1851ce056f4b25a59ea8511b..b8dedc4e1958c59969e1ebc51d956eb7065139b9 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/asm.h>
 
 void _hw_exception_handler (void)
index efd5acf3592bb5f8fa8747882d67145d95b0ef4b..2d6a41be2fd57d9b046b6ffe08288bc518fce358 100644 (file)
@@ -12,6 +12,7 @@
 #include <cpu_func.h>
 #include <env.h>
 #include <fdt_support.h>
+#include <hang.h>
 #include <image.h>
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
index af324f77cefd22e6a2763309ce2595eb647f7d9c..a1508e3b8867d3cc9119386166779aa5ee662755 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <asm/mipsregs.h>
 
 unsigned long notrace timer_read_counter(void)
index e68f49467c9ae2848915ec8b4984385aaf6c2227..1e3cfadd2d7e8588c0314782e37df7b168dec4df 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <init.h>
 #include <asm/relocs.h>
 #include <asm/sections.h>
 
index 6fe8ebd16bad08bd84628fc9167fd8303d4313d2..b8568c00fed53034ce48c6a368c6ebfd28bc392b 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <hang.h>
 #include <init.h>
 #include <asm/mipsregs.h>
 #include <asm/addrspace.h>
index 7c15c2153290b39309e7515634c7ef07b04790d2..3feb25ce71df6d6eaedc64007a2b0561164d446d 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/io.h>
 #include <asm/addrspace.h>
 #include <asm/types.h>
index a5dace7a99b08335948fcc5e25e31b21af4a472e..09bdc253ae23a3225f94bf61394f3800aa74568b 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/addrspace.h>
 #include <asm/types.h>
index 138a7f84832e05d90447e8feba34fe8112dee944..1abe2a49e661bdc1238e045db3a63216bc071d60 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <linux/sizes.h>
 #include <asm/addrspace.h>
 #include <mach/ddr.h>
index 7447adef47e4089e6574f65852cf68cbd45fe1a8..d450ad865233a5a7a00a8a9d0196ee038d17b805 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/io.h>
 #include <asm/addrspace.h>
 #include <asm/types.h>
index 33a44cfff4832e8b7b31b5ea5a70f1b57c0825fb..d71c94e1718a5f30c3c912ea5c6cae4c1a948a3a 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <asm/io.h>
 #include <asm/addrspace.h>
 #include <asm/types.h>
index 0ae5e09e01985ec969e3d8ef4f5f243805e32bc5..015840de256725ddb60de744a395758ce3f9a99b 100644 (file)
@@ -9,6 +9,7 @@
 #include <config.h>
 #include <common.h>
 #include <cpu_func.h>
+#include <hang.h>
 #include <init.h>
 #include <asm/io.h>
 #include <asm/sections.h>
index 5b25c8d002166ebc4f9e35ed55696290d1caf147..65afefe53e18a584873c84fae02e8ed7722465ba 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <mach/jz4780.h>
 #include <mach/jz4780_dram.h>
index 7afc2c5940d3a88e3e283ba36249b4961d183a18..cee3c0cb0a63ab96595ec58fe1eae11d5b4e1ba7 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <ram.h>
 #include <wdt.h>
 #include <asm/io.h>
index 691888157fb1b9db41dab6ec62cd298770bd22a0..386c1998dcefde018a693ad87795ac27fdef9e78 100644 (file)
@@ -223,7 +223,7 @@ call_board_init_f:
        j       board_init_f            ! jump to board_init_f() in lib/board.c
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index a472f6a18737fc697b989eddb317022eeb45424f..1003bc87b9db8b0f360ca2e5d9ce747ca865627c 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <hang.h>
 #include <image.h>
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
index 88cc7b98d8573f00f8a31c8388f24ff72f65838d..1481e055007b0de18ca216b3ff9e4b61fdbf4219 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <irq_func.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
index 2900200dbb91a2192adfbf718dbbca3bd3b417e4..f5ad184e8d0bd53bf579f1e6ab0a874c8d3659b5 100644 (file)
@@ -147,7 +147,7 @@ _reloc:
         * We'll call the board_init_r from here since this isn't
         * supposed to return.
         *
-        * void relocate_code (ulong sp, gd_t *global_data,
+        * void relocate_code(ulong sp, gd_t *global_data,
         *                      ulong reloc_addr)
         *                      __attribute__ ((noreturn));
         */
index 1c3cc03178c7e3d4eec68ea606fd43b2162820e4..087a05097d9e6ffdbf67ae01f77e728542f14333 100644 (file)
@@ -4,8 +4,9 @@
  * Scott McNutt <smcnutt@psyent.com>
  */
 
-#include <asm/ptrace.h>
 #include <common.h>
+#include <hang.h>
+#include <asm/ptrace.h>
 
 void trap_handler (struct pt_regs *regs)
 {
@@ -21,5 +22,5 @@ void soft_emulation (struct pt_regs *regs)
         */
        printf ("\n\n*** ERROR: unimplemented instruction @ %08x\n",
                        regs->reg[29] - 4);
-       hang ();
+       hang();
 }
index c3e25978a807b3d4fa54cd2f3be10713dc6a54d7..f4e25f1f59c39472d0bd853776515617748f501f 100644 (file)
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <irq_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
index b487e31cc0f75fe9deff81da11d792763efbe370..5c685353e16b99540cbde8881dac2261d7c2ac7e 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <asm/processor.h>
index a14a438b02dbff743fa57fdff943c8522edfcb58..22506a5be5048ecb51ad47d53ec779d06dcde0bf 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <asm/processor.h>
 #include <asm/io.h>
index 93af7f495fd3614e808626e539025630b1541aa3..e2fc0b1e8a2090365a5f5dd71fb6d092b10370c5 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef CONFIG_CLK_MPC83XX
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <mpc83xx.h>
 #include <command.h>
 #include <vsprintf.h>
index 133f7abc31aca4bdaecd9bc330d6cb43abcfcf6e..34c81872591f20915d508cc0cbcebb7dd119101d 100644 (file)
@@ -4,7 +4,9 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <mpc83xx.h>
+#include <time.h>
 
 #include "lblaw/lblaw.h"
 #include "elbc/elbc.h"
index f4a8a766c3379e4b3c669baf01f44ee0f7865121..9da22ce486a94627baf65c00b6ec678ae44320c8 100644 (file)
@@ -804,7 +804,7 @@ flush_dcache:
 /*-------------------------------------------------------------------*/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index 18556629c3d6cf925ecbe6ff62324e25b217eec8..9f9eed165bc184d45204cd9460dbead9bdc9c690 100644 (file)
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <irq_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
@@ -332,7 +333,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #ifndef CONFIG_SYS_FSL_TBCLK_DIV
 #define CONFIG_SYS_FSL_TBCLK_DIV 8
 #endif
-__weak unsigned long get_tbclk (void)
+__weak unsigned long get_tbclk(void)
 {
        unsigned long tbclk_div = CONFIG_SYS_FSL_TBCLK_DIV;
 
index db12aefb2903bfc0e64d9582db611ea575165dd5..65f909fd1e559b37f795b28c6f6361664d0e8220 100644 (file)
@@ -7,7 +7,9 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <env.h>
+#include <time.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <asm/processor.h>
index e767573193ff4e1b7f03eebe9177772ab1ec490d..6f539d26776860383d7e1450a8e67edca0866d3b 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <irq_func.h>
+#include <time.h>
 #include <watchdog.h>
 #include <command.h>
 #include <asm/processor.h>
index 0c5252edc272029bffaa4cfd08012a75c63fae94..773ae08dd3b79274df515ca9e952c73356c9bc2b 100644 (file)
@@ -574,8 +574,7 @@ void get_sys_info(sys_info_t *sys_info)
 #endif
 }
 
-
-int get_clocks (void)
+int get_clocks(void)
 {
        sys_info_t sys_info;
 #ifdef CONFIG_ARCH_MPC8544
@@ -653,7 +652,7 @@ int get_clocks (void)
  * get_bus_freq
  * return system bus freq in Hz
  *********************************************/
-ulong get_bus_freq (ulong dummy)
+ulong get_bus_freq(ulong dummy)
 {
        return gd->bus_clk;
 }
index 38e907f5ad51830c8fbfb5b8e1e9d695eca32101..dd784e7e30b55250283b37b8776232433e54699c 100644 (file)
@@ -1549,7 +1549,7 @@ write_tlb:
        blr
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index 804788d05075087ae44705eecbd1d9b1aa92afa1..bc2fc93e1109caa6cfcf798e74c7061297f57877 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <init.h>
 #include <irq_func.h>
 #include <kgdb.h>
 #include <asm/processor.h>
index bb14444a2e7efa0522c3917bd5c32d5b77ab66f1..97b93f02131289c323e8120aeb6231b458de1469 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
index 0f930fcd9e147a8d4e72af3e393c737de845e8dd..eb8e73e41c6737d3adafcad2d3cf66304d0cd699 100644 (file)
@@ -18,6 +18,7 @@
 #include <irq_func.h>
 #include <mpc86xx.h>
 #include <command.h>
+#include <time.h>
 #include <asm/processor.h>
 #ifdef CONFIG_POST
 #include <post.h>
index 434c4f3f43bf953be468dc476ae9a2b70f4dd3e4..50014458622915e0989302b5f5f3e249b73f99d8 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <mpc86xx.h>
 #include <asm/processor.h>
 #include <asm/io.h>
index 59213c2dfe3da93d5cfbe71ca522d43b877e4272..f4651ce8d46fdbf0832c6ffd55b2370ccc124f12 100644 (file)
@@ -636,7 +636,7 @@ in32r:
        blr
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index 1820187d1d0b621b2948dc0ac87027940ca83474..79bab913676a99ed9ed17c06850d41eccd663e82 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <init.h>
 #include <kgdb.h>
 #include <asm/processor.h>
 
index 0604433e7265dc7f7801797126079975ae4ddc82..4a1698d3bca326c0d7473edaa61b3371ece1d63c 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <time.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
index 55c6588249c8de41ad2358f903e593f62a1931ab..4719de4d72c6e1cf88b230dfdf13a775bc6b2eb0 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <time.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 
index 6ee6088fa8ad77439cb0794ebb50364df5505f9f..3efe8956ec57883823eb316925e59b685e309088 100644 (file)
@@ -8,6 +8,7 @@
 #include <irq_func.h>
 #include <mpc8xx.h>
 #include <mpc8xx_irq.h>
+#include <time.h>
 #include <asm/cpm_8xx.h>
 #include <asm/processor.h>
 #include <asm/io.h>
index 5a8fc1f200d044347c9078819e164240a5d1a311..77d4f8e47f74cc43d4f6154f1887be20765a732c 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <mpc8xx.h>
 #include <asm/processor.h>
 #include <asm/io.h>
index b8bdaaec2fae783c52cb0b4ef6dec3e674492fb9..ed735cdee00540292b7857ed03424e28cec7b4fe 100644 (file)
@@ -322,7 +322,7 @@ int_return:
 /*------------------------------------------------------------------------------*/
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index c43732f7c5c73ca8bcbbed13069ae26b1661fe5e..afcb75ba17a0aafb265d6f67d869d6de85109b23 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/fsl_lbc.h>
 
 #ifdef CONFIG_MPC83xx
index 5765f6b522309aa23f6b0a50980b8efd9cd3ad9f..055364c58fd94ab8b47e1e6c2778f43c0f40587c 100644 (file)
@@ -121,6 +121,7 @@ void print_reginfo(void);
 void interrupt_init_cpu(unsigned *);
 void timer_interrupt_cpu(struct pt_regs *);
 unsigned long search_exception_table(unsigned long addr);
+void upmconfig(uint upm, uint *table, uint size);
 
 #endif /* !__ASSEMBLY__ */
 
index f2e670eb6bf0bcf969c3a4f4e1ca40ac257ff3c7..390e8c0673c555bfb592461a8ab7bbb9ed0d2fdf 100644 (file)
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <env.h>
+#include <init.h>
 #include <watchdog.h>
 #include <command.h>
 #include <image.h>
index 1a55b7d57091c2318695f6b4e908dc57c74a0aa1..f3dccdbe4c55a3279e0e3f6eb3d8d81b030ab8cd 100644 (file)
@@ -217,7 +217,7 @@ spl_call_board_init_r:
 #endif
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index e96137a50cb124657381fb12c18f14642920781c..fad16901c5f2a032019b5a73d412aa9b510b6f45 100644 (file)
@@ -9,6 +9,8 @@
 #include <common.h>
 #include <command.h>
 #include <dm.h>
+#include <fdt_support.h>
+#include <hang.h>
 #include <dm/root.h>
 #include <image.h>
 #include <asm/byteorder.h>
index 3b25c5b7a75d735dfc7caa43017c996f0634dc48..512dce061967ce33d4ef4ca53dbb68d084298400 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <irq_func.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
index b8cecb309dcf96d5a67750668efff74c5bbfb2bf..ce3c1cf872b24de5c8f61d18ab05bce857bb04b4 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <hang.h>
 
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
index dc7577f751660dfdc744d316464b236ce01707c3..ae07bbe40a7ae04df527816828ab02bea9259226 100644 (file)
@@ -5,6 +5,7 @@
  */
 #include <common.h>
 #include <cpu_func.h>
+#include <hang.h>
 #include <spl.h>
 #include <asm/smp.h>
 
index 44c68a39bc628e75115b6e693c9d5c30061a79a3..d5f683bbaae1fe2f539b0bd0a5c19f606c5f3014 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <hang.h>
 #include <os.h>
 #include <spl.h>
 #include <asm/spl.h>
index f1b8df9b0b205cf7b429549ebe68518371acf29d..a8d0590d51e31e1da20f1c959693d40aa412cc7d 100644 (file)
@@ -31,7 +31,7 @@ int cleanup_before_linux (void)
 int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        disable_interrupts();
-       reset_cpu (0);
+       reset_cpu(0);
        return 0;
 }
 
index 7c157bc035d20dcf91a4b8e2a2a52fbf54453950..1de32cd419fd1bdb7947e4a9af7d61e72431c3fb 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/processor.h>
 #include <asm/system.h>
 #include <asm/io.h>
index 533fcf8906e0eb610cd665d910d51aa13bae3a91..a6a8f07e6f265ebb8064819570e9cde37a92a602 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 9394eab956ba1fca12e1f08ed9aa13b8396c4838..a9cfcedd81c88e83ab02406e469556890f7fd391 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <cpu.h>
 #include <dm.h>
+#include <init.h>
 #include <pci.h>
 #include <asm/cpu.h>
 #include <asm/cpu_x86.h>
index 8882a76eae596f4c00cd7cf4858e6dce26709e95..f2e48f401feec6d34e444f4183482fd6bdd2dacf 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <mmc.h>
 #include <pci_ids.h>
 #include <asm/irq.h>
index d626e38fd18f073a91255be8f3064d588a46fefd..dae06949cc6e7899408e98d6ed59dae916caab66 100644 (file)
@@ -24,6 +24,7 @@
 #include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
+#include <init.h>
 #include <malloc.h>
 #include <syscon.h>
 #include <asm/acpi.h>
index 2b27617ca3a466fdd0c827a28317753f7cf2d6d7..1592b2c9d3b3a503251af4317b6541db89721e29 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <init.h>
 #include <malloc.h>
 #include <spl.h>
 #include <asm/control_regs.h>
index 78aa51a3ea6adb2b5b2ec7617a234df42feff949..70edbe06e4c6150b6828129a767db81188cf2f42 100644 (file)
@@ -13,6 +13,8 @@
 #include <common.h>
 #include <dm.h>
 #include <efi_loader.h>
+#include <hang.h>
+#include <init.h>
 #include <irq_func.h>
 #include <asm/control_regs.h>
 #include <asm/i8259.h>
index 8a68ddba973859c9178f7623a75784843758db06..b0bc59b71ef5cc3ae87113c0937e7b5563ab8ca8 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/arch/device.h>
 #include <asm/arch/mrc.h>
 #include <asm/arch/msg_port.h>
index b47d896e202305ca9eca544f79f7b8871331f6a4..8c7e1c10c2bcea146a78a5b8f92e62162d7a747b 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/e820.h>
 #include <asm/global_data.h>
 #include <asm/sfi.h>
index 5443a862ab5ec5886d71b8e71f266d2cd662b22a..07d8f1f279ce28ed8161f5339489731314959784 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <hang.h>
 #include <dm/device.h>
 #include <dm/root.h>
 #include <errno.h>
index f0e2bf053d74160145bf0ff5379a689d1077ad48..90baec2a175e3de4100764606db64b368104ac8b 100644 (file)
@@ -7,6 +7,7 @@
 #include <cpu_func.h>
 #include <debug_uart.h>
 #include <dm.h>
+#include <hang.h>
 #include <irq_func.h>
 #include <malloc.h>
 #include <spl.h>
index 784e3a02def1279890fab986632e1005ed33b27c..34804b53ccaef2365969f49ca58dddbf3102e297 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <debug_uart.h>
 #include <dm.h>
+#include <hang.h>
 #include <spl.h>
 #include <asm/cpu.h>
 #include <asm/mtrr.h>
index 38d2fa2fe13b5a0f397b9128eb955b81b1afa5b9..580df65ea78208d9f7f24a204cf780e5d88df2c1 100644 (file)
@@ -273,7 +273,7 @@ _start:
        ill
 
 /*
- * void relocate_code (addr_sp, gd, addr_moni)
+ * void relocate_code(addr_sp, gd, addr_moni)
  *
  * This "function" does not return, instead it continues in RAM
  * after relocating the monitor code.
index db08d86de50000af86b0e878f7cb173dc17e802e..a04415decaf198174ddd29cba2b4a3564b8ebcfa 100644 (file)
@@ -5,6 +5,7 @@
  * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
  */
 
+#include <init.h>
 #include <asm/mach-types.h>
 #include <common.h>
 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
index 657921e741182f93165c9fda84bebda3d75964d8..faf39b4ba6aa8412fbddc7b415d90db6c619d1e1 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
 #include <netdev.h>
 #endif
index 47e692936503da50304343302d902dc16baf7636..f164073000cd164edea022d913d9be747406651d 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #if defined(CONFIG_FTMAC100) && !defined(CONFIG_DM_ETH)
 #include <netdev.h>
 #endif
index 9314fabdf2d97744cf90fe24e2fd0d9293806fb9..6a17aeb78ecbb7b701405cbeceaa7edd6f21d373 100644 (file)
@@ -8,9 +8,11 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env.h>
 #include <env_internal.h>
+#include <init.h>
 #include <ns16550.h>
 #include <malloc.h>
 #include <mmc.h>
index 1c4134d82753b83a0c7017dbb6ac417201815991..cd0022a73e17e4b1136f211c147ee68a81b1180a 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <ns16550.h>
 #include <asm/io.h>
 #include <nand.h>
index 3284ff093664f68af6c00cd59c85d7127c619763..c91d2f9494d5183f57ea5016657ffdd76c8f4398 100644 (file)
@@ -7,6 +7,8 @@
  *
  */
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <spl.h>
 #include <dm.h>
 #include <miiphy.h>
index 0b916d2482c5f52696e3ff7be10bb4c31e33e7c9..a667413bfc87501240a4acf0e331cae38f72a393 100644 (file)
@@ -12,6 +12,7 @@
 #include "asm/m5282.h"
 #include <bmp_layout.h>
 #include <env.h>
+#include <init.h>
 #include <status_led.h>
 #include <bus_vcxk.h>
 
@@ -98,7 +99,7 @@ int dram_init(void)
 }
 
 #if defined(CONFIG_SYS_DRAM_TEST)
-int testdram (void)
+int testdram(void)
 {
        uint *pstart = (uint *) CONFIG_SYS_MEMTEST_START;
        uint *pend = (uint *) CONFIG_SYS_MEMTEST_END;
index be0bc228ec7179f05e85049f495660a5498171c6..fb66c9ecc74159bfd3de6875e45145efb91028bc 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <env.h>
 #include <linux/errno.h>
index b68e18e03499368b370fc8758c554d7ae4798836..b5ffe8162f32cee00378081c7e2ceda5bc7ccaed 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/orion5x.h>
 #include "../common/common.h"
 #include <spl.h>
index 686608d25a5aa63a0b7dfbbd8349e87a0f67896c..50305656e8e5bc106d98e140572db31d64f9a8fb 100644 (file)
@@ -12,6 +12,7 @@
 #include <command.h>
 #include <env.h>
 #include <i2c.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
index bd7ab22948b220608322b94fa9bf0d051b774a78..b7ae58c6454ea8402f83e784190d08d8f2657378 100644 (file)
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
index b68f2f3c895b6374fb44c91785485df8052514aa..729516d9e1de80b579bc655b223e6f545aad0725 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 
 #include <common.h>
+#include <net.h>
 #include <linux/io.h>
 #include <miiphy.h>
 #include <netdev.h>
index ede168c9ece7bec4253c49d2cf27d3d9037dcdd2..887dd1ed74d4da827f0901e25967a0a51fab0994 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
index 466f85eb0810c610533b5a849b68f380121a76d7..71bee76bdce7b3f6eadd5e71cd95b6c1b52706fe 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
index a4923ce97184dd7c20333856a2f2d214fb6db7b8..ae9202895d5a698200427918a63e0d8c98b8ad02 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
index 79999c7d304bc8c9c278a0c38034410d660ae955..6c6106c23c55762c5c814a032535671919bcbb19 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
index 40e5dc7034d1d0ea480b9763adf82ca7003188cc..5a8c6e282bf903138ca758b351837cd20c58fd43 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
 #include <asm/arch/cpu.h>
index 42b51eb29a19192df30a97bb3a267b62c023c62e..1e4477aa5ff10b65dae7f10301c56f507bb4d606 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
index 1e6c43b1fabfa08f7a4255bbb9556c675653b78e..99462052f0426d82229e7b9715163fb9750b8912 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/mach-types.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
index 1f2fce989c953d2c6f3e9a87086b6f72024026e2..f2031ef3bbb2f9225751a7bce1183487d12e957c 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/setup.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
index 4f8006da005418c4035458a14bc1f5a2a4db9cf9..e3fbbbaa8aab1d26c427e432f4806b22bf569527 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <netdev.h>
 #include <asm/io.h>
 
index 2f97d5ce96ac8a230abc13ae990bd12e56e635bb..5017ab8d93e4e30d3fd2d8e6c1d65db132fde420 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
 #include <linux/libfdt.h>
 #include <asm/io.h>
index 0eac10d911373408c21c7d013dde13ff7bdd12d0..1f3f293bd914d2f6742a55f7903cf3c780da2a48 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <net.h>
 #include <linux/io.h>
 #include <miiphy.h>
 #include <netdev.h>
index c584fc0e982fb68aab055c178ca5d5800ea8d759..889ce70d758ce7fa49d138f9d8ff45621c2623f2 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <netdev.h>
 #include <led.h>
 #include <linux/io.h>
index 75395d92cd1fb151bf7295182a308c7d60006bd0..29e0bf388d07a5aa9ba2e3f7d46df5cf7a7b98a1 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <init.h>
 #include <jffs2/jffs2.h>
 #include <nand.h>
index 5cdf7905a90dc956c0ec73610063a87c7bf1322f..1a472f50d3f11c74e8ea67d29ccb51471f623ac9 100644 (file)
@@ -20,6 +20,7 @@
 #include <cpu_func.h>
 #include <dm.h>
 #include <env.h>
+#include <init.h>
 #include <netdev.h>
 #include <asm/io.h>
 #include <dm/platform_data/serial_pl01x.h>
index e65ae997fd648816459f735f24ee1cb4622dcb48..d701669be0ccbd639ffcc3f9cf2551f6bcd632a4 100644 (file)
@@ -153,7 +153,7 @@ unsigned long long get_ticks(void)
  * Return the timebase clock frequency
  * i.e. how often the timer decrements
  */
-ulong get_tbclk (void)
+ulong get_tbclk(void)
 {
        unsigned long long tmp = CONFIG_SYS_HZ_CLOCK;
 
index 416c18adec4f10f4e6f689047e92eddc9f04dbac..14626c1f553eeee9365053fecf73e0509c9ecb49 100644 (file)
@@ -17,6 +17,7 @@
  */
 #include <common.h>
 #include <cpu_func.h>
+#include <init.h>
 #include <malloc.h>
 #include <errno.h>
 #include <netdev.h>
index 7fe539e4d674ff3c3c4cd44d82417b592ef0db96..dd0ebdd3030e8f938fe51b2ba5bbd1accc6f5a92 100644 (file)
@@ -5,6 +5,7 @@
  * Sharma Bhupesh <bhupesh.sharma@freescale.com>
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <malloc.h>
 #include <errno.h>
index db157a83c8f739063562a14828092bfed21e6839..9adf58eb8a32816838203c244391fb62ed13a8d3 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <serial.h>
 #include <watchdog.h>
 #include <command.h>
index 867fa82c177feef94c2bd24d0fa48f99d959f049..a18fb275d9f5862f67aabf453761df0b5df467a3 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <init.h>
 #include <malloc.h>
 #include <asm/processor.h>
index 5d228fcc1632b6fe21583b3ac3b39366a6ff02c0..e75d5b182f6969e5e827397f5e725c1d3fe5f750 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <netdev.h>
 #include <asm/mach-types.h>
 #include <asm/arch/hardware.h>
index 9dcbfc450b273a561c86a8bfb667c0146aecf5a7..42fa7627724ee4dd542a1e93fda3a270993fdfb4 100644 (file)
@@ -7,6 +7,8 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <init.h>
+#include <net.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9260_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
index 28765315f74f6caf435b9f79d968a6a83d8887d3..36f2149b61878f97cd11977d558ba2230cdbad41 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <init.h>
 #include <vsprintf.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9261.h>
index 31bb72c0cdc3758bb2261d0cf71638e1fb6323be..b811d931c44fa8ee18a71544c0c5b082ccc0640a 100644 (file)
@@ -7,6 +7,8 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <init.h>
+#include <net.h>
 #include <vsprintf.h>
 #include <linux/sizes.h>
 #include <asm/arch/at91sam9263.h>
index 85004310b1fcd2b1abd9412e5a78a1b21a5dc0eb..8aabc5595196b12c7c1953b2052dda758ae918b3 100644 (file)
@@ -7,6 +7,8 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <init.h>
+#include <net.h>
 #include <vsprintf.h>
 #include <asm/io.h>
 #include <asm/arch/clk.h>
index 51b24e1d5922de27b9d43035342a8854ce1fd60e..90d32353e9ba62be686878002eecf6082772a12f 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <vsprintf.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9x5_matrix.h>
index 4e674d49b31876bed96f1a82d7e5ef5145bcb856..f81dccc9cccbcba04a3e1087e577c3df361262dc 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <init.h>
 #include <vsprintf.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
index 7be1dd54f46de74da943c4fb29a2f7a9e8382fde..fbd05c78a94859a98db4499713efb6b6a651c508 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
index fc563ebb7150e84a3464018440753afa60683e08..c8c2e95816791445df416d5b436a1c8ab6020e8c 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <debug_uart.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/atmel_pio4.h>
index 1c6514af6e7da8e10d2fd9a86b7e9a3d00e9e148..c2c7c095536b621a1b3a3c663c0ff1711e6a342f 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <mmc.h>
 #include <fsl_esdhc_imx.h>
 #include <miiphy.h>
index 407bfe95ed5433bf7a443545d882fae0c63cd6af..6348f123ad45ed347dcf7caf1dfb5637e9660fbc 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
index d2a1b97d7b1b6e2af439473f300365baa9c67dba..47ce3078808f8135f06e291c34c28132c1220819 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/mach-types.h>
index 440d02fdbc0fd9c236be665f17564ce7e9cc030c..d34f3ba0077f960e1881998fb064b02cf382febe 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <errno.h>
 #include <init.h>
index b04c5914f0d54fcd44660c04ab5e7a52fb776800..0a97eafea6c4ed737c63e1f62ff5d6370015d7c7 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/mux.h>
index ce9f0494ee599c8b2d99498459e6ef2bbce1ff82..d83eb9bd5240b46aa6f7cbf0370abc00c98c27c3 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
 #include <env.h>
index 87616386cb84099916518f3242a179066b50a525..40ced1a87ce4aa3f1cb4b00cc10a9404ad386a1d 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/mach-types.h>
 #include <env.h>
index 63fb98ba7c527ce5357a7cb060018dd62d189846..e4dbe42649057789e7db42f115b9b13cf798bc49 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <init.h>
 #include <asm/io.h>
 #include <config.h>
 #include <netdev.h>
index 1068edca59cb000539197a3a69a2a9c740ae6ad2..6cbad9c1f0abd13c9ffb6d965f32316bcf57abc7 100644 (file)
@@ -3,6 +3,8 @@
  * (C) Copyright 2016 Broadcom Ltd.
  */
 #include <common.h>
+#include <cpu_func.h>
+#include <init.h>
 #include <asm/system.h>
 #include <asm/armv8/mmu.h>
 
index 9e8e1f36f7a6f0e8dade8f5fad25e55355785b0b..919e3ed27cd6fdbea5fdb503e878c14bf39abe81 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/arch/at91sam9_smc.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_matrix.h>
index 940455de5b2706a8e67f1646104fc923581900f2..687ade544acbf5dc0c36a26b83184b9fa326e56e 100644 (file)
@@ -4,6 +4,7 @@
 **/
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <init.h>
 #include <malloc.h>
index ffbd099c4ee49dac055f80aad867920540ad65f0..835c3279be282124e35c4fd2125443cf6aca1bb6 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
index a0a416b50c129726a36e586a54e8fe71a61e8d5b..a79884cb506fa262d25a2ef5a3613959b9ec0a23 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -31,7 +32,7 @@ int dram_init(void)
        return 0;
 };
 
-int testdram (void)
+int testdram(void)
 {
        /* TODO: XXX XXX XXX */
        printf ("DRAM test not implemented!\n");
index f9a19f08daa1e1285e9e285c197c40961277c7e9..360c4df17b314010c725168be4cef8f22764ee13 100644 (file)
@@ -8,6 +8,8 @@
  */
 
 #include <common.h>
+#include <hang.h>
+#include <init.h>
 #include <spl.h>
 #include <fsl_esdhc_imx.h>
 #include <asm/mach-imx/iomux-v3.h>
index 66186ec853a87ee14361d754353be81dff94f611..592d74109510082d494173c18b76bd5bdfc9dbfb 100644 (file)
@@ -8,6 +8,9 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
+#include <hang.h>
+#include <init.h>
 #include <spl.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
index 93f834f51257bc5e83475eba269fb76511e28ce6..39ca535d11dfe39d66a2fdb2101918f815e6ce80 100644 (file)
@@ -10,7 +10,9 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <errno.h>
+#include <init.h>
 
 #include <asm/arch/ddr_defs.h>
 #include <asm/arch/clock.h>
index 7da9a9ad86bea2ee4a13a9a58dbd50892abc5efe..016c63a509a5623d8bf78f94364099796622268e 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <common.h>
+#include <hang.h>
+#include <init.h>
 #include <spl.h>
 #include <i2c.h>
 #include <asm/arch/clock.h>
index a1d987bedaab7da406095a39064d86e719f69344..dfdc683683d8a4fa65ce886556a2c1ef2790449b 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <netdev.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
index 9dea2ba80e2a533c766e261da625d03f5fc7a20f..bfd5a4fe3697d3169837783cf7a3c5a1cbcd7bcb 100644 (file)
@@ -53,6 +53,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <net.h>
 #include <netdev.h>
 #include <miiphy.h>
index 6472d382c93581c471ef6b4214cb5fa0811b9287..9483516ca0dbaedfa51a7642426b8964fe4b93f3 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <hang.h>
 #include <init.h>
 #include <mmc.h>
 #include <asm/arch/clock.h>
index 4271b0db19c951fd7c88e4723cc542e8aba48b96..6c5992733cc679259853d61bf55b55bb4c1b6919 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <init.h>
 #include <serial.h>
 #include <vsprintf.h>
 #include <asm/io.h>
index 4c220fa8e1353cc485e1f5a48c03d24db17b2647..ff811643a67e6f05a308149e2fafcf38d02fc791 100644 (file)
@@ -12,6 +12,8 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
+#include <init.h>
 #include <ioports.h>
 #include <mpc83xx.h>
 #include <asm/mpc8349_pci.h>
index a3f784f0a3a0ef1232aa9cb041db3010a6190270..a2b0eb5a996c09b687cffc0fc413ac86085549b4 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 
 #ifdef CONFIG_SPL_BUILD
 static int setup_led(void)
index 45650b4f088d74909bf229ba41174903dbe80ffc..e7f684bfb3a4da03887a386689ce68d60c892f0a 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <irq_func.h>
index 06ea8775044a1128c323c00397b0b7f60e0dc505..fe5ce350131b1a39a0b9b03fd41e0aa7407b4c89 100644 (file)
@@ -3,9 +3,11 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env.h>
 #include <env_internal.h>
+#include <init.h>
 #include <asm/spl.h>
 #include <malloc.h>
 #include <ns16550.h>
index 4b6d91df219acc2c472243816894adf25a26eeca..0951d7758aaf1691243c637eabc1a88aa16eab29 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <vsprintf.h>
 #include <asm/mmu.h>
 #include <asm/immap_85xx.h>
index e7ed0a90b8f08200c3deb9018842b4bd8ffb5477..79df0f3cbd5516db8005a8bee0f5e233a06fd742 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <ns16550.h>
 #include <asm/io.h>
 #include <nand.h>
index 5e1cc1f4a3834feea5c5fdead5e3f817dfdc3909..dc72b2e2f2e98cfb69c222bb7a4dc7e9abdc442c 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <ns16550.h>
 #include <asm/io.h>
 #include <nand.h>
index 9a2385b978c5320a00fb9b0fcd91bb8ee06c174e..421c2d4b1fc9daff937d83e15871cd5f55501c59 100644 (file)
@@ -3,8 +3,10 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env_internal.h>
+#include <init.h>
 #include <ns16550.h>
 #include <malloc.h>
 #include <mmc.h>
index 7452cec8ff63404da9d167c2467a766e2c1b54d8..8193afdf6aab34b925307c020df67c18965968e5 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <mpc85xx.h>
 #include <asm/io.h>
 #include <ns16550.h>
index c2fa60e321b0d0ec1c6c13920dcf3695f4317563..66eea32e0779c78bf72527bc908e1a8eb6c0fd71 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <netdev.h>
 #include <linux/compiler.h>
index 2d08f9a56331c15a061c65b6c9af7cab5cd2e1b8..a26fc96b91dabe5955ada3aedd234703a7956cca 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <spl.h>
 #include <asm/io.h>
 #include <asm/mach-imx/iomux-v3.h>
index cbde9f6b3c683ea75ff1a885a917e7827c67c1f7..7aed14c52b684ce8b3a58a116c5736464394fc08 100644 (file)
@@ -5,6 +5,8 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <spl.h>
 #include <asm/io.h>
 #include <asm/mach-imx/iomux-v3.h>
index 3c689f2d316acfd8909df8cc04d67fdd1c27ae1b..0b20668e2b30a234a1f36c6315bab5345e946a4d 100644 (file)
@@ -5,6 +5,8 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <spl.h>
 #include <asm/io.h>
 #include <errno.h>
index 9164cfb9d87b2131549b9558f4faf299de61cc59..e442510f44d5023ae50055fb97d00078813ea597 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <errno.h>
 #include <asm/io.h>
index 667a2743a620266d9bae3e1e3869bb07e36ef2fb..bf296a6eb59e604e444c6f677bd8d147e749991e 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <errno.h>
 #include <init.h>
index 194eb60cd37ecb46484c25e59cbc2a3fce269786..1577cd6ba767762dd302fa4e3ab3c1ec3d2397cd 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <errno.h>
 #include <init.h>
index 421e2fe38c5cfdbc1c8dd599abb954d0ff372754..bd1df092f9bbd2442275a2bedf68ca35c2d11021 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <net.h>
 #include <asm/io.h>
 #include <netdev.h>
 #include <fm_eth.h>
index 31e41ce169679c3b6023f0939a11b4ec1c1bd215..d138c9384eb0b156e8bf6d7f10a1132875ddb1ab 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
index b35d5343e4ebeca663e422cecc1d236e493908a2..3cc0a65cb91881541010126538f20cfa8982ac15 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <net.h>
 #include <asm/io.h>
 #include <netdev.h>
 #include <fm_eth.h>
index e4527c19b88af522e9af950977bd1bf3bc4b63bb..0f665c7bc68fa94445c14d7c05ab1532ddb5a22b 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
+#include <hang.h>
 #include <i2c.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
index eda5cc7a9edf86816042f944dadb78aa2269adb0..b4201e76d1c7bf896de9ac1d820dcaa769c9aa5c 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <asm/arch/immap_ls102xa.h>
 #include <asm/arch/clock.h>
index 3efdbe9a690a163c2f356e462b5f0b10ff39ea1a..b7f8f1d57866a19e4e582a841f196e9cdce4de72 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <asm/io.h>
index 8039fd55f47394d2b879a387b08c86af0b018820..3876910cbbeb5ccac97e4fdb4f4fb324bc979a60 100644 (file)
@@ -2,6 +2,8 @@
 /* Copyright 2016-2019 NXP Semiconductors
  */
 #include <common.h>
+#include <clock_legacy.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <asm/arch-ls102xa/ls102xa_soc.h>
 #include <asm/arch/ls102xa_devdis.h>
index c4ff6775c3b0a3218414c12232344e6434d4c9b7..497dce5f0f3c48c4eb90fab0e5bb8f172ae91f62 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <asm/io.h>
index 237088a53710eaf517daa68c339f9581d762124a..54ef75347f604ffbd443d62aba368074329549cb 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <net.h>
 #include <netdev.h>
 #include <asm/io.h>
 #include <asm/arch/fsl_serdes.h>
index a2b52a879b1c1474406bfbde2ff0d766d7a6d193..01f56db0a1bfc664048eb33b8c813e090e2eeef5 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <net.h>
 #include <netdev.h>
 #include <malloc.h>
 #include <fsl_mdio.h>
index 413a698511bda34d77f30e26f1f95eed00da3c38..949b57c24e0f49162206a9638fd194a5205a58e7 100644 (file)
@@ -5,6 +5,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <errno.h>
+#include <net.h>
 #include <netdev.h>
 #include <fsl_ifc.h>
 #include <fsl_ddr.h>
index 6a8788c3125498b005ceee1d52d463bd92ba8840..bbb70a859a1e13529e375b5c3f88cdfa5f0e3728 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <net.h>
 #include <netdev.h>
 #include <asm/io.h>
 #include <asm/arch/fsl_serdes.h>
index 62c7a7a315502c4328a88a58a63e8298cd2d3af3..b0f276e8397c5e15c23eae5a7bb52fe98c78e08e 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <net.h>
 #include <netdev.h>
 #include <malloc.h>
 #include <fsl_mdio.h>
index 55e8a427e65cefb3e771f01336622cad5e3fe443..6500649d7b9eb74d889413f8ec67b1cb99f5eead 100644 (file)
@@ -8,6 +8,7 @@
 #include <env.h>
 #include <hwconfig.h>
 #include <command.h>
+#include <net.h>
 #include <netdev.h>
 #include <malloc.h>
 #include <fsl_mdio.h>
index 365ff73cef2c0f22d1b693ac30b37d1032708f4f..aeb989a638b7ac5388f16106c7bafa2efea3f10b 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <net.h>
 #include <netdev.h>
 #include <malloc.h>
 #include <fsl_mdio.h>
index e5b7fec9a4f634ce000159e6d4757a130d73090e..75361534332d6731cb54ee85270e0727242c31ba 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <dm.h>
 #include <dm/platform_data/serial_pl01x.h>
 #include <i2c.h>
index 82cadb2c33da2528ff8d7c8143fafd3d23a0d99c..e448a64abc6f768a3468ec8373808dd9c4d88a91 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
index 13ce4886e5d26513763d9ee790f8d8969292f5cc..a4b795fc39b3c4909a0c85375dafb09dd0089ba6 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
index fbd2e616045da8f7baeeea10bba339da1d77f970..5d4039375530e7a639499a7952a66587803abf9c 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
index 9969f71da19836544a001ce475ff826fd819dad4..da3adc595414c0dd69c0f6851de411fef71df199 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <init.h>
 #include <malloc.h>
 #include <asm/immap.h>
 
@@ -89,7 +90,8 @@ int dram_init(void)
 };
 
 
-int testdram (void) {
+int testdram(void)
+{
        /* TODO: XXX XXX XXX */
        printf ("DRAM test not implemented!\n");
 
index dcf6d7f1dbc292e12ebbf48f5df013595f2ac0b3..76c18b8504fc0eb0fb22671a8282eba37053d996 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <netdev.h>
 #include <asm/io.h>
index d4457abfbdbe3d0880aa7c087824371759915061..1017ef0c2a538ae6b0226113bb639cc7ff132b78 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
@@ -33,7 +34,8 @@ int dram_init(void)
        return 0;
        };
 
-int testdram (void) {
+int testdram(void)
+{
        /* TODO: XXX XXX XXX */
        printf ("DRAM test not implemented!\n");
 
index a01133612c515cba197c606daf24515009a2d251..e65e6d0af5859911ef52662731d95029b29befbe 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
index 01f51b7c95320a1593f841564548c4e37b12c0ff..8bdb4ad1276072add8aaf06cc34a78a82444936f 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
index 88cdba719c429e7ccbd643589b619964ca266860..d93800b364bffb8ae76f294377341040036ff0fb 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
index 37011fb7308fbcd21e65522068373a816f7944b2..1d52ce047fb6cfd9fd39248f62f20e7442a20ef5 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 
index a4943e76ae4975ad694ace39b6035d7fbdf846f9..8c90cfe537af9ad95fe52b67c0a2935de3094a92 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <spi.h>
 #include <asm/io.h>
 #include <asm/immap.h>
index 7cb840346c8a7e395bb5b693ab03b922bbf8760a..82a2b9093b63965eb01d92f106cf736b241c8ce9 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <spi.h>
 #include <asm/immap.h>
 #include <asm/io.h>
index 317e63ea6a14f32cae9634175613c99a006c1bba..6e0922cd53c94fd08c1af3e8f239d79de001f717 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <mpc83xx.h>
 
 #include <asm/bitops.h>
index 55a3529296d580e764d70c9f50a22b8c41d69c14..e5cc824f487794f5b590239c363a680da26116ac 100644 (file)
@@ -6,6 +6,8 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
+#include <fdt_support.h>
 #include <init.h>
 #if defined(CONFIG_OF_LIBFDT)
 #include <linux/libfdt.h>
index 6c47cb2b3835314f4eeecbc6470e6daedee65184..e513d0bfd533dd80e23856bc5ae0c64099ad6489 100644 (file)
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <eeprom.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <ioports.h>
 #include <mpc83xx.h>
index c9f2ac44a6243db087d8bab30032ca95ee747c45..d4922fe1e123f372dd00e9bfc059d9d84258e1cb 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <ioports.h>
 #include <mpc83xx.h>
index 913b5843e9518ad457f53fc361a64a68c606e329..0996b87c0fc88fbe19cfffc74975b13a079901bd 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
 #include <ioports.h>
 #include <mpc83xx.h>
 #include <asm/mpc8349_pci.h>
index 81b3f00b56e8cfdb4e384cfe33a9cbd86733ffe2..a2e284f1a229a8696fd25c981af130448bc70d41 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
 #include <ioports.h>
 #include <mpc83xx.h>
 #include <i2c.h>
index 4ad62bcf1d6b5384fe72b8e816ec0f3e1e175b7c..45038acf32473f9bb2a91902599b4165cd563572 100644 (file)
@@ -9,6 +9,7 @@
 #include <env.h>
 #include <hwconfig.h>
 #include <i2c.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/fsl_mpc83xx_serdes.h>
 #include <fdt_support.h>
index b4776c5e46c576940087b4f39b3c1c96beb090d1..42b8cab3627d4126b24789d7bac6019a6fa9295b 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <command.h>
 #include <asm/io.h>
 #include <fsl_diu_fb.h>
index e8fccccafd299be51a78066d178727431ed057b7..33d056b47d41bd9358f9fb3c9d3bb1a0ff10f037 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
index cab0e79a6b19f774b70db504fc2019e94fd8bcc6..2599272173a16fef5fdb770bd211431ffbc65894 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
index 75375f12c435860e1216b944ea3abd09dedb3f11..be551bc3753358f7d4138362d35e849d2ac27a19 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/iomux.h>
 #include <asm/arch/clock.h>
index cb489140c030e73131044af2ba5042dba1723355..159d14b024fc7d0d2d0dc965c2be22a2a5cd0a05 100644 (file)
@@ -3,9 +3,11 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env.h>
 #include <env_internal.h>
+#include <init.h>
 #include <ns16550.h>
 #include <malloc.h>
 #include <mmc.h>
index b9eb4430f16fd45a5ad2fb47bd7841b40f9dd99b..0bb2c83872040a691bb4fecfd37a98aceb45f324 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright 2011 Freescale Semiconductor, Inc.
  */
 #include <common.h>
+#include <init.h>
 #include <mpc85xx.h>
 #include <asm/io.h>
 #include <ns16550.h>
index c6514cf45beca64142c12381ed451e8712ef396f..7f7251009c99bd6123f352aa65e09d539b13f40d 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <command.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
index 8d2c1388ec3fea2502e256160f70fc5d564adc31..39e1bee6f361cca5854b897b608ac78e084390dd 100644 (file)
@@ -4,9 +4,11 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env.h>
 #include <env_internal.h>
+#include <init.h>
 #include <ns16550.h>
 #include <malloc.h>
 #include <mmc.h>
index 9ab4029836c852493643477c8f7ddd9ec6ce886b..31de26318dab1e04113239902e2664c1595a7c65 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <ns16550.h>
 #include <asm/io.h>
 #include <nand.h>
index c85243f58ba54cfb1b7de4db06830fd5f27f2bb3..71fca8ca1e1aa4b5d67b7e5438dc5ef18b722e5e 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <hang.h>
 #include <hwconfig.h>
 #include <init.h>
 #include <pci.h>
index 908f4bc96f509f66915160390bea1f2fd52cfbfd..6ed0a816d934b95db88c24f37f1dc0304f91e09a 100644 (file)
@@ -4,9 +4,11 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env.h>
 #include <env_internal.h>
+#include <init.h>
 #include <ns16550.h>
 #include <malloc.h>
 #include <mmc.h>
index d8ae1f835cf801edd444b4551f514ef8aab6c368..ced5f3c3b5d53a5dda214c53135b0eaa33180ea6 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <ns16550.h>
 #include <asm/io.h>
 #include <nand.h>
index 78f89fc4cb713303854e5059a1a5ff83f33373c8..95ed0ef429eb570b60edcc13919c46eacaadcc7e 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <netdev.h>
 #include <linux/compiler.h>
index 381d40d67a0f6eba11b160421901eae24109067d..e804cfe986be419d963ff279ddf42ea75d5d1143 100644 (file)
@@ -9,6 +9,7 @@
 #include <env.h>
 #include <init.h>
 #include <pci.h>
+#include <time.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/fsl_pci.h>
@@ -323,7 +324,7 @@ void get_sys_info(sys_info_t *sys_info)
        sys_info->freq_processor[0] = freq;
 }
 
-int get_clocks (void)
+int get_clocks(void)
 {
        sys_info_t sys_info;
 
@@ -337,7 +338,7 @@ int get_clocks (void)
        return 0;
 }
 
-unsigned long get_tbclk (void)
+unsigned long get_tbclk(void)
 {
        void *fdt = get_fdt_virt();
        int cpus_node = fdt_path_offset(fdt, "/cpus");
@@ -350,7 +351,7 @@ unsigned long get_tbclk (void)
  * get_bus_freq
  * return system bus freq in Hz
  *********************************************/
-ulong get_bus_freq (ulong dummy)
+ulong get_bus_freq(ulong dummy)
 {
        sys_info_t sys_info;
        get_sys_info(&sys_info);
index 9bc9ddf6492f252a8e1ca566baef1bca58821e01..a7301e2a2e95d57a02eadea9c9354b47507c9c79 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/siul.h>
index 7a499a559fbdd31336eeec7966baca1d6acffe2a..9f4a43ed560c306e8b49017e2c3dfaad69b1aecd 100644 (file)
@@ -3,8 +3,10 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env_internal.h>
+#include <init.h>
 #include <malloc.h>
 #include <ns16550.h>
 #include <nand.h>
index 85f8517d79823f98a3b7e4ab2ee8d1d1eff2414b..e42337e47a4570d98b0b98c0c4969c8442bfb539 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <netdev.h>
index c579be1cb253db57530751c536f91462954ca7a9..aed0721c0daf04e983249a1216cce4f473750fc9 100644 (file)
@@ -3,8 +3,10 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env_internal.h>
+#include <init.h>
 #include <malloc.h>
 #include <ns16550.h>
 #include <nand.h>
index ab07c1f8ddb23d44f805cfea1b1cb0801a6a0b21..eee09a57019e1780f6a7397f484555bde2c121b7 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <netdev.h>
index 804966791c6a9a583b736896d3ed40a5dcd55812..ab9e922a927d7e73fc3742a054c400d4025f8941 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <command.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
index 61dedf4c06c5404a4a1ea85ef610df8881de855d..92dd9237ec7f884e368fe03309c57b1de202af0c 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <netdev.h>
index aa56b8ea24e36732a1751afb0420a331f4a6f463..25c8597202a267ff1aecce056a74e7fdbf547e81 100644 (file)
@@ -4,6 +4,7 @@
  * Author: Priyanka Jain <Priyanka.Jain@freescale.com>
  */
 
+#include <clock_legacy.h>
 #include <asm/io.h>
 #include <common.h>
 #include <command.h>
index 2d1342fb99d70c7682f3969f8be240f8b706437b..2306d0391ea3468cb794acdc83e3a506422864f2 100644 (file)
@@ -3,8 +3,10 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env_internal.h>
+#include <init.h>
 #include <malloc.h>
 #include <ns16550.h>
 #include <nand.h>
index 7dacd0c5f1f829995ba31dd9b08d90669a1197c1..dc3b59d26f9d10b967dacb92968153d5d8db5818 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <hwconfig.h>
 #include <init.h>
 #include <netdev.h>
index f0499ad7e542e69411f86b6a012cab3c3f05b7d1..40eb5d30a66dac937deb2eb40abb83fdf0b664da 100644 (file)
@@ -3,8 +3,10 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env_internal.h>
+#include <init.h>
 #include <malloc.h>
 #include <ns16550.h>
 #include <nand.h>
index 6c34db421998cd4ebf22ba3dd8aca3712a8b52a2..79cc1543f95a337225da20d9f4e3a3bdd8e57edf 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <netdev.h>
index d7ca0dd6db2934bb160e25dd07d20e003c6acf57..27e87da40930779f34b30f6ff0aa6a8759b7494a 100644 (file)
@@ -3,8 +3,10 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env_internal.h>
+#include <init.h>
 #include <malloc.h>
 #include <ns16550.h>
 #include <nand.h>
index 3ac61f009c90acf01333173d77cc5bf7433dcb0f..b5c20112d0e5b2d40b64ef92ac0222974fec2520 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <netdev.h>
index df81205e88da8f5202f8a0b0cead62b21b58363a..d72d207a760f7c4cc56d9bd0649c5d4d1ebddfa8 100644 (file)
@@ -3,8 +3,10 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env_internal.h>
+#include <init.h>
 #include <asm/spl.h>
 #include <malloc.h>
 #include <ns16550.h>
index da050bf800f2b35cb4d5e877d29fdebf40a13d45..104b40a110969dfc9006ff61ae92e157dce37cb1 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <netdev.h>
index 11f7489fa21840f3fcfc07f7a4bb8b2443316180..5608774afd19e3194808179d0c8494da5af235be 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <irq_func.h>
index ec3978a70aa7ce05f5f8d20519d8b15224bdac63..5d018c316c61c798bbd8b9953cd6f12da22a8b39 100644 (file)
@@ -6,8 +6,10 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <env_internal.h>
+#include <init.h>
 #include <asm/spl.h>
 #include <malloc.h>
 #include <ns16550.h>
index 48aa6b6822e9faa44654891e46d6485954c4d14f..8015666eccd93a9e3852fa718992e62f0c102d84 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <netdev.h>
index f6cd7a4c8d37fc12a35ef7e0067f2708af635d13..17427f23d8b473704205729656e46c77face16cc 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/iomux-vf610.h>
index b0891379a170f7d87667a554eff9014fe1595e0c..80fec5f9cf3ef22b9aaf4df85c04b1233a4ac21e 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/mx6-ddr.h>
index 2a77fed27022d5489d99c30cddebd4a2bba80705..9695fb0a10dffebd959273ea15fc0c779e74ea1a 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef CONFIG_MPC83XX_SDRAM
 
 #include <common.h>
+#include <init.h>
 #include <mpc83xx.h>
 #include <spd_sdram.h>
 
index 04d380956658901f632dd70108c8e540fb87cacc..ad56dd7d019d98369adf6ce2eca061b21d78cda3 100644 (file)
@@ -14,6 +14,7 @@
 #include <command.h>
 #include <dm.h>
 #include <env.h>
+#include <hang.h>
 #include <malloc.h>
 #include <fs.h>
 #include <i2c.h>
index dfccbed7637e8c45da638d7f96322a02dd55270f..7e1e6ce85c0bb24b3647d40705778c5096b6fddb 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <command.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
index 940ae82c45bc8b7352c9eb6b17a00a96050e5099..84400090b30a3fe0c9f5ba0a4959b41ea91a438a 100644 (file)
@@ -4,7 +4,9 @@
  * Peter Griffin <peter.griffin@linaro.org>
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
+#include <fdt_support.h>
 #include <dm/platform_data/serial_pl01x.h>
 #include <errno.h>
 #include <malloc.h>
index eb9b99eaa92dd117223d9e46e35c1d39c92d844a..84c26e0c14f2cf68626eb88e59f77d2383b79f93 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <asm/io.h>
index 4926419a905aabe9a9b3303c5a10da6f22367910..36999bdcea78d7309a9b3fb62a22e18ad0e721cc 100644 (file)
@@ -4,8 +4,10 @@
  * Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
  */
 
+#include <cpu_func.h>
 #include <dm.h>
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <dm/platform_data/serial_pl01x.h>
 #include <asm/arch/hi3798cv200.h>
index caa36064f053b467d2fe239edc64419aa0920802..6e74e939c3cba3216a7d87b3848148493d96b4a6 100644 (file)
@@ -12,6 +12,8 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
+#include <init.h>
 #include <mpc83xx.h>
 #include <spi.h>
 #include <linux/libfdt.h>
index 19510184d8a6fa24f8cab79e33abbd182d911cab..4fa34e1b51cdaf24a24adac47f9effddf2d3f36d 100644 (file)
@@ -9,6 +9,8 @@
 
 #include <common.h>
 #include <command.h>
+#include <fs.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
index feca7be37276701013cb6abd88db1056eabf2522..23bbdcccacf796736d83195b06294ae83294b63d 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <ioports.h>
 #include <mpc83xx.h>
index 7aa9fa7fcadec8390d7bf65fc83f6f759eb903dc..473acfca68be12d575dbade415f6e1b2e8bee760 100644 (file)
@@ -16,6 +16,7 @@
 #include <i2c.h>
 #include <init.h>
 #include <nand.h>
+#include <net.h>
 #include <netdev.h>
 #include <miiphy.h>
 #include <spi.h>
index 9e1956c8b7ffba834e6e326edcd390f1302554f9..cfb23a53f7458275f5cc829bc90a0c3d809d8063 100644 (file)
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <netdev.h>
 #include <linux/compiler.h>
index 8148ace2fe0cebde0c67272c308e524776b84432..6ef960b06ba08cde878b1cc9c617ce56c13500a6 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/gpio.h>
index 7521cacaf956979ac28f326f790959283bf52635..bc52b91b2f433fa4a2e8eba819bbfac6ffca500b 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <init.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
index 029ab12391821daad8be6242ec0afaf626dd5a0a..5a998e37d8a612c0ea3f01d5673514b90a85a74c 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/at91_pmc.h>
index e7f31ec9e726c48ad577c4b4316801e17b4ca93d..0d1be3f784e106ca349dd883b2b7ed7720969201 100644 (file)
@@ -3,6 +3,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9x5_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
index e845edf0683828f038edb845713b8a9d9ca96e6c..765463e37070c6df7b2bf1c5299216b3335a9e77 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <serial.h>
 #include <spl.h>
index 9a724040b07209271bef4c531bc8246eff92528e..5e55918fa6514b08c38db7c83987368a16b68a29 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <vsprintf.h>
 #include <asm/io.h>
 #include <asm/arch/clk.h>
index baf70d8807b0b7265d4517c124397a46d583bb9d..cbf8781746ebaaf06bb4a14e1d2d8334ce9c4acd 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <mpc83xx.h>
 
 #include <asm/bitops.h>
index 96dd9e38f3708afd7555cbd48a2f386b4618d480..9e6940f9c76aaf64f8534834d1a397a2c8e0acfa 100644 (file)
@@ -6,6 +6,7 @@
  * Copyright (C) 2015-2016 Stefan Roese <sr@denx.de>
  */
 
+#include <init.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/mx6-pins.h>
index 02d6c27cec486943b96328fb51694731e8852394..8964fb5ddac6b453e1ac93935238dbc04d95459b 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <spl.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/ddr_defs.h>
index 59f307d3573b9461c679a24d16e2855c6bb8244f..40dd27a7b0d19ec584637e67ed9c4b99760d4fa4 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/armv8/mmu.h>
 #include <asm/system.h>
 #include <asm/io.h>
index 254af7907ad3ba4e4ad11c388ea354054abdd2a6..81bd8bd95b13a87722e74ce367b7f70318830c58 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <env.h>
 #include <init.h>
index 7a889646df8d1160d1613f1829062f501847611f..6c096b49a1f8286c3635a040211d4d64b3e9acf0 100644 (file)
@@ -5,6 +5,7 @@
  * (C) Copyright 2017 Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
  */
 
+#include <cpu_func.h>
 #include <asm/arch/sysmap-apq8096.h>
 #include <env.h>
 #include <linux/arm-smccc.h>
index 10ef7f931b1f19034a965ca73d6f14376b601734..a6d7cb48a249198b0917ed1ae077135b7122b628 100644 (file)
@@ -6,7 +6,9 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
+#include <hang.h>
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
index 4260dff119458fe439b993fcb645290982ad3862..dbb210584d5a2f53d7a70cb342088614764bd11e 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dm/platform_data/serial_sh.h>
 #include <asm/processor.h>
index 08c544860953fc9c34cbcac343b343f2c5199a01..7232370d6f4f84179a08c9d8588435a935da1e7f 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/rcar-mstp.h>
 #include <asm/arch/rmobile.h>
index d1cbbc33399026dbe1fcc5447ded4d590e1b7413..6505beda8129c8897893a22652e4f33015b8c2b7 100644 (file)
@@ -7,6 +7,8 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <asm/processor.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
index 46d9f74785c7ff4d3720c46e38ef0cf779843860..2f9364c484e9d55e404f47e89a36359c26865855 100644 (file)
@@ -7,6 +7,8 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <malloc.h>
 #include <netdev.h>
 #include <dm.h>
index d6240b19efb1185f6e1e3500649688b959e95cb4..cf06a173e49da0344dd013f30439ae78fbd0ee4e 100644 (file)
@@ -7,6 +7,8 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <malloc.h>
 #include <netdev.h>
 #include <dm.h>
index cb7d432a15a155db70424b45cadaadcfdd232510..81d7f8eafab49a9fcd00a2649a08eaebe4282213 100644 (file)
@@ -7,6 +7,8 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <malloc.h>
 #include <netdev.h>
 #include <dm.h>
index f86c9f1a63501b747a36433e8a9e6c7df5b53e6e..eb6ee6f6a4c3f4d427f0087ed4b0edb09dc31fde 100644 (file)
@@ -6,7 +6,9 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
+#include <hang.h>
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
index 2f94d3e76c78cc37f95c5d4559f8197a10167f8f..42a67581488ed27363870ac7d816dc083a941752 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dm/platform_data/serial_sh.h>
 #include <asm/processor.h>
index 4f901eea71369cd42bb7501a6d28499e482b47b3..ba904609ae744b3238d6afb4c4b07d3e314c4612 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
 
index 841d337f4d3cad395ae61236b7c3fb2d31788d6f..e09d3d0a634041314a3938f15b9e966b1013a4bd 100644 (file)
@@ -7,7 +7,9 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
+#include <hang.h>
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
index b7cdcb22162b84e370c9e42154b409e90aaf3c07..b3530d7ce74b5f7fe54fbc0d24b0a90e0a4b8899 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dm/platform_data/serial_sh.h>
 #include <asm/processor.h>
index 3cb1a56142a900f1271f3bb287189c46734c6165..9ac951592584c27d28b65719d6754d336808d963 100644 (file)
@@ -8,8 +8,10 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <env_internal.h>
+#include <hang.h>
 #include <malloc.h>
 #include <netdev.h>
 #include <dm.h>
index ba9b494476e65a5bfb2b8b7870e00a2784e27ec6..d7db361b12f0c852cc5c4ccdff1a6b8f641b17be 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dm/platform_data/serial_sh.h>
 #include <asm/processor.h>
index 86f79da7fdb4f76b4d6019b6cf3d92caee203c6f..097710b4791c62d98de602dfbc39b9bbe3905879 100644 (file)
@@ -7,7 +7,9 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
+#include <hang.h>
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
index 7bf6823e05740690efd497631258bdda2d4e8e8b..026220d9e243a5c3f8e1314bd4f561d7e3b34a63 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dm/platform_data/serial_sh.h>
 #include <asm/processor.h>
index 27140c5c35c8849eb927e13534f208844d896d99..d9741c19398243ddd46f84310a7a67a6ef919c70 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <spl.h>
 
index 22fe9619cfb8da9d90f225e5c2ccc4620d427945..058fa6fbb6194447be8853cb4c27ac6d962c1ae5 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <netdev.h>
 #include <dm.h>
index 25221e3c55ccedf8b8f1d8102a88f2e45a9d909f..e7cbd7577645a54d1af75b9d97b7bef62b93fb73 100644 (file)
@@ -7,7 +7,9 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
+#include <hang.h>
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
index 64ee75a63e1a2035616983d13b3701c6794e072b..a2c397f935814736f7d9ee90507ee67afb23379d 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dm/platform_data/serial_sh.h>
 #include <asm/processor.h>
index cffdc3e9d21ebe9ef67b4d3a996cc146f919317c..e6c2051bd4bbfaf18ab49126e76fd54bcc1d355b 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include "cpld.h"
index 05a3ced97c59a9b8fc9af9cd1f832f41650338de..8d01efce56c5279c2ca3870fb0f0593674f754da 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dm/platform_data/serial_sh.h>
 #include <asm/processor.h>
index bad673412a1f4d36e03192eb8015aa75fa4ef356..57f8a20ccb0c26a5db91961d7f8751f7082ac31e 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <vsprintf.h>
 #include <linux/sizes.h>
 #include <asm/io.h>
index 2da39c4acd5e41211aa2c171b9017fea018267d7..3cd6384fc320e70a28144b239a519b8d6750a44c 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <linux/sizes.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
index c5d28c61e2d714dc91375e2ee6fa95ffe704ceae..17dc7d6b4dd5f866168e0456af37b4b1c12dae36 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <linux/sizes.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
index 1d547b1c38d7efe9c3d82c4e6fc20efc3d8bb087..9abad3f82497564bcd3e211e94ade665498504cd 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <init.h>
 #include <usb.h>
 #include <asm/gpio.h>
 #include <asm/arch/pinmux.h>
index ee2fc7971eb079c8097f453982577d66e8b70b79..5d4646d14c875088b63867ac0e74feb362f0bdbc 100644 (file)
@@ -8,6 +8,7 @@
 #include <cros_ec.h>
 #include <errno.h>
 #include <fdtdec.h>
+#include <hang.h>
 #include <init.h>
 #include <spi.h>
 #include <tmu.h>
index 13c057b426f0d74d7f9d2ff428408af53ff32679..a80300b0c009989897abdeeb03332598dd38d3b8 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/sromc.h>
index 0eba7b66ee904e70845dd376b4ee385dae3a3775..05369d22271b581738ba6662fc787fd7f2a5be26 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <netdev.h>
index a647de6b11217b0b05aa6b2741566b19df8c4215..9051392cd09f12c5f483bba4c970d8c060a96c99 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
 #include <ioports.h>
 #include <mpc83xx.h>
 #include <asm/mpc8349_pci.h>
index 0a9dab893968e70a602a9f60b5d83ebacd9319b8..d053eaeec34f4a95844d489e031df53bb2cfbe0f 100644 (file)
@@ -56,7 +56,7 @@ int dram_init(void)
 }
 
 #if defined(CONFIG_SYS_DRAM_TEST)
-int testdram (void)
+int testdram(void)
 {
        uint *pstart = (uint *) CONFIG_SYS_MEMTEST_START;
        uint *pend = (uint *) CONFIG_SYS_MEMTEST_END;
index c0a93175fbd1adea1486283b35d2544bc290d346..fabc348440d8525468ae9b00824f5b24fbf513bd 100644 (file)
@@ -7,6 +7,7 @@
  * Modified by: Boris Brezillon <boris.brezillon@free-electrons.com>
  */
 
+#include <init.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/iomux.h>
index a569bd53afe71a80f18f9f660ac770d030816ab5..03768201c3a4631196d2a1e34c6ae04f64667a65 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9g45_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
index e1be384994b02a2b5f9d1118570a40fee4f720a0..cb7206a5616299803cf245972c74eae623acd857 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9_sdramc.h>
 #include <asm/arch/at91sam9260_matrix.h>
index 1cf1f9e1f7cadba9ccc006b164f4aa30e307e59e..0979df563ae045485eaa3ee5f5d50ecce585f117 100644 (file)
@@ -15,6 +15,7 @@
 #include <common.h>
 #include <dm.h>
 #include <env.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9260_matrix.h>
 #include <asm/arch/at91sam9_smc.h>
index 4c76b4d0a803c69200e4eb402060b34e9cc76e0f..8eb4f8fc950bb080aeb90106ebc1b4d70f445d15 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/processor.h>
 #include <asm/immap_85xx.h>
 #include <fsl_ddr_sdram.h>
@@ -61,7 +62,7 @@ phys_size_t fixed_sdram(void)
 #endif
 
 #if defined(CONFIG_SYS_DRAM_TEST)
-int testdram (void)
+int testdram(void)
 {
        uint *pstart = (uint *) CONFIG_SYS_MEMTEST_START;
        uint *pend = (uint *) CONFIG_SYS_MEMTEST_END;
index 5f58b4c21bd6c1acec6c4a94fc030e9babda88b1..b0ddee7906a29c40cdf936429c4760644d04fa16 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <env.h>
 #include <pci.h>
 #include <asm/processor.h>
@@ -165,11 +166,11 @@ void local_bus_init (void)
 
        /* Init UPMA for FPGA access */
        out_be32 (&lbc->mamr, 0x44440); /* Use a customer-supplied value */
-       upmconfig (UPMA, (uint *)UPMTableA, sizeof(UPMTableA)/sizeof(int));
+       upmconfig(UPMA, (uint *)UPMTableA, sizeof(UPMTableA) / sizeof(int));
 
        /* Init UPMB for Lime controller access */
        out_be32 (&lbc->mbmr, 0x444440); /* Use a customer-supplied value */
-       upmconfig (UPMB, (uint *)UPMTableB, sizeof(UPMTableB)/sizeof(int));
+       upmconfig(UPMB, (uint *)UPMTableB, sizeof(UPMTableB) / sizeof(int));
 }
 
 #ifdef CONFIG_BOARD_EARLY_INIT_R
index 4e298dabcbf75a186380ebf9aa246c6900127f6f..e82a43074fb9dd0f7857879ca097c1e95e3b239c 100644 (file)
@@ -12,6 +12,7 @@
 #include <env_internal.h>
 #include <g_dnl.h>
 #include <generic-phy.h>
+#include <hang.h>
 #include <i2c.h>
 #include <init.h>
 #include <led.h>
index b9450a0e36b4e769c1313954dedddaa017b6f1a8..6afea6ef42e42d6137ffc22319659512f1071ee6 100644 (file)
@@ -13,6 +13,8 @@
 #include <common.h>
 #include <dm.h>
 #include <env.h>
+#include <hang.h>
+#include <init.h>
 #include <mmc.h>
 #include <axp_pmic.h>
 #include <generic-phy.h>
index 5ba9f862e14a3a65c8700725308b0ff58271b2f2..c09ed8cff826d616febb252bc2cde7b6fd06c81d 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dwmmc.h>
 #include <malloc.h>
 
index 9dbdc128f8f3513290f09863c14faf958211b5c6..36aa8f6ae55466103a6b2c007a7d127d5a3dfade 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <malloc.h>
 #include <dwmmc.h>
 #include <linux/libfdt.h>
index 0efea3d5cc375d0b4f713cc23c922bc5b24dbed8..4502005941fb645178f010456edbd2fa2268eda5 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/immap.h>
 #include <asm/io.h>
 #include <dm.h>
index 790199a640dfa87c60c155963742fbf8db671da4..ce8b541ccdf7476c0e064549b9033625ebafe5a4 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <spi.h>
 #include <asm/io.h>
 #include <asm/immap.h>
index 7f520beeb08126bff274e23f422d230f311d73f9..41b053ab1c1ddb3abacd0787b768fe41b70dec07 100644 (file)
@@ -1,5 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0+
 
+#include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
+#include <init.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux.h>
 #include <asm/arch/imx-regs.h>
index 8955622b8156cc3e69d5eceb7e98be5c9681db51..6c432ca5a62c1f471d133c685a132d8e8ac6cffb 100644 (file)
@@ -5,6 +5,7 @@
  * Author: Richard Hu <richard.hu@technexion.com>
  */
 
+#include <cpu_func.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/crm_regs.h>
index 82eb0c285cc17c567afbd7cc14ddf4eab8fe51c1..ff1a189c7e92c077b18f71c808dda5b35cdac943 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <asm/arch/imx-regs.h>
index d12f1ebfdf9534e1852fe4ed9cabfa8d848b7289..36f86926bc31345a09fc263288c15e9ed6a4d7fb 100644 (file)
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <eeprom.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <i2c.h>
 #include <init.h>
 #include <linux/errno.h>
index c755821b74f9d55abc00a32754c84212b08d0ad1..c57473c80245c69daf8dcd2da86fb7d8f89150d4 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <palmas.h>
 #include <sata.h>
index 79b8363b868a931f70d974a16b25fab02783d517..94001a4dc39c534602dce69d15ecb95dad7b5a25 100644 (file)
@@ -11,6 +11,7 @@
  */
 #include <common.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <palmas.h>
 #include <sata.h>
index e3305fbaf6760d7b42175d9a38e14b5288e3fbf5..6554c0eb11869d8ebd645ab74b0ea36e18fdaefd 100644 (file)
@@ -9,6 +9,8 @@
 #include <common.h>
 #include "board.h"
 #include <env.h>
+#include <hang.h>
+#include <init.h>
 #include <spl.h>
 #include <exports.h>
 #include <fdt_support.h>
index 920d0d3420f141a3e011098d64beb7013d48dbaf..c6a14a05546959a7ae5a04abfef18e0053dde61b 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <eeprom.h>
 #include <env.h>
+#include <hang.h>
 #include <init.h>
 #include <asm/arch/clock.h>
 #include <asm/ti-common/keystone_net.h>
index 6aa785ea42502d200e61b5b6e1e23d6b997309c8..3ecf571c5c37827195560e45a87339fec945afbd 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <asm/arch/mux-k2g.h>
 #include <asm/arch/hardware.h>
index a4b963d463a659ef5ff4374d1c03bb8c0d9535a5..b455844c89ddd05edc0a9c30eca45f438fb29cf5 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/cpu.h>
index 04830411872e1bbad3c8f4e7233321afee38c5da..fdfab8f3c91afa40dc4d7f7ce967734a7602a643 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <init.h>
 
 #include <asm/arch/clock.h>
index d569782a192eee118b3510a2f832af030f76e1fd..3f85f1ac89b5b18d08371e248df086f31dba64cf 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <init.h>
 
index adeee676434ca9faf679a1edbb1d4f46b6ac441f..857e9fe345451fb699028edd4ca2278ea47e2f77 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <init.h>
 
 #include <asm/arch/clock.h>
index 7db9d25544ce323f3d557e2e3b72776f35156130..f04b7493119d9ea2861cb3b6a8d97c15bd684e51 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <env.h>
 #include <init.h>
index 77197e0fbb013a532b1a25852e318ff7bb48cb85..8727101aa38af1abf34bf698466fd9afc712337d 100644 (file)
@@ -3,6 +3,9 @@
  * Copyright (C) 2016-2018 Toradex AG
  */
 
+#include <common.h>
+#include <cpu_func.h>
+#include <init.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/imx-regs.h>
index 04941b26be457ceb08ae19827e15c000a9eb686d..02b3d2dea11e2a52679bf30791e86135ce0aa10d 100644 (file)
@@ -5,6 +5,8 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
+#include <init.h>
 #include <ioports.h>
 #include <mpc83xx.h>
 #include <asm/mpc8349_pci.h>
index a4c202da19329dfa68fad85789fdc463fe531108..c16f117bf8aed9358737c49ac655de07316a7605 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  */
 
+#include <cpu_func.h>
 #include <linux/arm-smccc.h>
 #include <linux/psci.h>
 #include <common.h>
index 0515ebbad243da48a6ab8c4bba2cb4d2598be73d..13429072c79b0ff53148c41e3028cd9296bcc2be 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <netdev.h>
 #include <linux/compiler.h>
index 781a07f1d8384c542589d21df1a631fe02e06a08..d1c9535f46ead79e4f79139376cbb0a74391d199 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
 #include <init.h>
 #include <linux/libfdt.h>
 #include <pci.h>
@@ -81,7 +82,7 @@ static long fixed_sdram(void)
 
        /* now check the real size */
        disable_addr_trans ();
-       msize = get_ram_size (CONFIG_SYS_SDRAM_BASE, msize);
+       msize = get_ram_size(CONFIG_SYS_SDRAM_BASE, msize);
        enable_addr_trans ();
 #endif
 
index 5cab3f4487012bcebf4836dfc0d6928f9c211a09..c69df6c7bfe271f297859284f67f7ea7b588a422 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/io.h>
 #include <linux/errno.h>
 #include <asm/arch/imx-regs.h>
index 9fa9e76e6663b94dd50d963702aaa0714fa516c5..75aedb092922752f1cbe0ae7af94bcac55233f52 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <fdtdec.h>
 #include <init.h>
 #include <malloc.h>
index e7cb6be616f858906d86db0bfff0a6926bedfb73..82a3feee69ff6fc14abd17dc52610d7d86555b95 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <miiphy.h>
+#include <net.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
index 298feae24d3fee427ce5e753562ac29ca0d799d2..b1a1cbcab25ff64a095446f8fdf28bf6192cc750 100644 (file)
@@ -858,11 +858,6 @@ config CMD_FASTBOOT
 
          See doc/android/fastboot.txt for more information.
 
-config CMD_FDC
-       bool "fdcboot - Boot from floppy device"
-       help
-         The 'fdtboot' command allows booting an image from a floppy disk.
-
 config CMD_FLASH
        bool "flinfo, erase, protect"
        default y
index ecf687d49f380397beb065a21747cacbd00c7982..6afdf65507edcd8105a78fce27c498df6ec6b1e7 100644 (file)
@@ -58,7 +58,6 @@ obj-$(CONFIG_HUSH_PARSER) += exit.o
 obj-$(CONFIG_CMD_EXT4) += ext4.o
 obj-$(CONFIG_CMD_EXT2) += ext2.o
 obj-$(CONFIG_CMD_FAT) += fat.o
-obj-$(CONFIG_CMD_FDC) += fdc.o
 obj-$(CONFIG_CMD_FDT) += fdt.o
 obj-$(CONFIG_CMD_FITUPD) += fitupd.o
 obj-$(CONFIG_CMD_FLASH) += flash.o
index 8c61cee8e89b25db485c1e8729d14d5aea5ecd48..8c5b42fd2c4a261e92d461087b677e73eb490713 100644 (file)
--- a/cmd/aes.c
+++ b/cmd/aes.c
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2014 Marek Vasut <marex@denx.de>
  *
- * Command for en/de-crypting block of memory with AES-128-CBC cipher.
+ * Command for en/de-crypting block of memory with AES-[128/192/256]-CBC cipher.
  */
 
 #include <common.h>
 #include <linux/compiler.h>
 #include <mapmem.h>
 
+u32 aes_get_key_len(char *command)
+{
+       u32 key_len = AES128_KEY_LENGTH;
+
+       if (!strcmp(command, "aes.192"))
+               key_len = AES192_KEY_LENGTH;
+       else if (!strcmp(command, "aes.256"))
+               key_len = AES256_KEY_LENGTH;
+
+       return key_len;
+}
+
 /**
  * do_aes() - Handle the "aes" command-line command
  * @cmdtp:     Command data struct pointer
@@ -27,13 +39,15 @@ static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
        uint32_t key_addr, iv_addr, src_addr, dst_addr, len;
        uint8_t *key_ptr, *iv_ptr, *src_ptr, *dst_ptr;
-       uint8_t key_exp[AES_EXPAND_KEY_LENGTH];
-       uint32_t aes_blocks;
+       u8 key_exp[AES256_EXPAND_KEY_LENGTH];
+       u32 aes_blocks, key_len;
        int enc;
 
        if (argc != 7)
                return CMD_RET_USAGE;
 
+       key_len = aes_get_key_len(argv[0]);
+
        if (!strncmp(argv[1], "enc", 3))
                enc = 1;
        else if (!strncmp(argv[1], "dec", 3))
@@ -47,23 +61,23 @@ static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
        dst_addr = simple_strtoul(argv[5], NULL, 16);
        len = simple_strtoul(argv[6], NULL, 16);
 
-       key_ptr = (uint8_t *)map_sysmem(key_addr, 128 / 8);
+       key_ptr = (uint8_t *)map_sysmem(key_addr, key_len);
        iv_ptr = (uint8_t *)map_sysmem(iv_addr, 128 / 8);
        src_ptr = (uint8_t *)map_sysmem(src_addr, len);
        dst_ptr = (uint8_t *)map_sysmem(dst_addr, len);
 
        /* First we expand the key. */
-       aes_expand_key(key_ptr, key_exp);
+       aes_expand_key(key_ptr, key_len, key_exp);
 
        /* Calculate the number of AES blocks to encrypt. */
-       aes_blocks = DIV_ROUND_UP(len, AES_KEY_LENGTH);
+       aes_blocks = DIV_ROUND_UP(len, AES_BLOCK_LENGTH);
 
        if (enc)
-               aes_cbc_encrypt_blocks(key_exp, iv_ptr, src_ptr, dst_ptr,
-                                      aes_blocks);
+               aes_cbc_encrypt_blocks(key_len, key_exp, iv_ptr, src_ptr,
+                                      dst_ptr, aes_blocks);
        else
-               aes_cbc_decrypt_blocks(key_exp, iv_ptr, src_ptr, dst_ptr,
-                                      aes_blocks);
+               aes_cbc_decrypt_blocks(key_len, key_exp, iv_ptr, src_ptr,
+                                      dst_ptr, aes_blocks);
 
        unmap_sysmem(key_ptr);
        unmap_sysmem(iv_ptr);
@@ -76,13 +90,13 @@ static int do_aes(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 /***************************************************/
 #ifdef CONFIG_SYS_LONGHELP
 static char aes_help_text[] =
-       "enc key iv src dst len - Encrypt block of data $len bytes long\n"
+       "[.128,.192,.256] enc key iv src dst len - Encrypt block of data $len bytes long\n"
        "                             at address $src using a key at address\n"
        "                             $key with initialization vector at address\n"
        "                             $iv. Store the result at address $dst.\n"
        "                             The $len size must be multiple of 16 bytes.\n"
        "                             The $key and $iv must be 16 bytes long.\n"
-       "aes dec key iv src dst len - Decrypt block of data $len bytes long\n"
+       "aes [.128,.192,.256] dec key iv src dst len - Decrypt block of data $len bytes long\n"
        "                             at address $src using a key at address\n"
        "                             $key with initialization vector at address\n"
        "                             $iv. Store the result at address $dst.\n"
@@ -92,6 +106,6 @@ static char aes_help_text[] =
 
 U_BOOT_CMD(
        aes, 7, 1, do_aes,
-       "AES 128 CBC encryption",
+       "AES 128/192/256 CBC encryption",
        aes_help_text
 );
index d2a39f677fda9fa567da98ef1ca67467ef0bdd40..edf4f564266bf9eddbe068c6765ad12ede49fb22 100644 (file)
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -13,6 +13,7 @@
 #include <command.h>
 #include <dm.h>
 #include <gzip.h>
+#include <image.h>
 #include <lcd.h>
 #include <malloc.h>
 #include <mapmem.h>
@@ -95,8 +96,8 @@ static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[
        ulong addr;
 
        switch (argc) {
-       case 1:         /* use load_addr as default address */
-               addr = load_addr;
+       case 1:         /* use image_load_addr as default address */
+               addr = image_load_addr;
                break;
        case 2:         /* use argument */
                addr = simple_strtoul(argv[1], NULL, 16);
@@ -116,8 +117,8 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
        splash_get_pos(&x, &y);
 
        switch (argc) {
-       case 1:         /* use load_addr as default address */
-               addr = load_addr;
+       case 1:         /* use image_load_addr as default address */
+               addr = image_load_addr;
                break;
        case 2:         /* use argument */
                addr = simple_strtoul(argv[1], NULL, 16);
index d0671deb759cebbd127a7b7dc91b7af621ab815c..de5058236e0a03dbad1e0706b124499d75edfb93 100644 (file)
@@ -30,9 +30,9 @@ static int booti_start(cmd_tbl_t *cmdtp, int flag, int argc,
 
        /* Setup Linux kernel Image entry point */
        if (!argc) {
-               ld = load_addr;
+               ld = image_load_addr;
                debug("*  kernel: default image load address = 0x%08lx\n",
-                               load_addr);
+                               image_load_addr);
        } else {
                ld = simple_strtoul(argv[0], NULL, 16);
                debug("*  kernel: cmdline image address = 0x%08lx\n", ld);
index 62ee7c4b8a169bb202483109c5a9fbf78f1277af..931d53f0c7209c77f4d35ac16c03f86dc75fe72b 100644 (file)
@@ -144,7 +144,8 @@ int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd)
                char *local_args[2];
                local_args[0] = (char *)cmd;
                local_args[1] = NULL;
-               printf("Automatic boot of image at addr 0x%08lX ...\n", load_addr);
+               printf("Automatic boot of image at addr 0x%08lX ...\n",
+                      image_load_addr);
                return do_bootm(cmdtp, 0, 1, local_args);
        }
 
@@ -232,7 +233,7 @@ static int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        int     rcode = 0;
 
        if (argc < 2) {
-               return image_info(load_addr);
+               return image_info(image_load_addr);
        }
 
        for (arg = 1; arg < argc; ++arg) {
index 74be62c2c5e45885d5544aba1c74e1b791826b9b..f14a5fefbfc68725160d8f468debdbe9ff67328c 100644 (file)
@@ -7,6 +7,7 @@
 #include <common.h>
 #include <bootm.h>
 #include <command.h>
+#include <image.h>
 #include <irq_func.h>
 #include <lmb.h>
 #include <linux/compiler.h>
@@ -33,9 +34,9 @@ static int bootz_start(cmd_tbl_t *cmdtp, int flag, int argc,
 
        /* Setup Linux kernel zImage entry point */
        if (!argc) {
-               images->ep = load_addr;
+               images->ep = image_load_addr;
                debug("*  kernel: default image load address = 0x%08lx\n",
-                               load_addr);
+                               image_load_addr);
        } else {
                images->ep = simple_strtoul(argv[0], NULL, 16);
                debug("*  kernel: cmdline image address = 0x%08lx\n",
index 2188910b2a77833c393ed113c84176cffd1dbdf3..ad232deae009c2b323b85f5a185a393da5316adf 100644 (file)
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <image.h>
 #include <malloc.h>
 #include <mapmem.h>
 #include <linux/list.h>
@@ -97,7 +98,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        char *filename;
        int size;
-       ulong offset = load_addr;
+       ulong offset = image_load_addr;
        char *offset_virt;
 
        struct part_info part;
@@ -127,7 +128,7 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
        if (argc == 3) {
                offset = simple_strtoul(argv[1], NULL, 0);
-               load_addr = offset;
+               image_load_addr = offset;
                filename = argv[2];
        }
 
index 437c1753740c848a2d184febd7b0c3f62ac1439c..15973b7d132e19ee1e07621001057b8547156564 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <command.h>
 #include <cpu_func.h>
+#include <image.h>
 #include <part.h>
 
 int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
@@ -124,7 +125,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
        flush_cache(addr, (cnt+1)*info.blksz);
 
        /* Loading ok, update default load address */
-       load_addr = addr;
+       image_load_addr = addr;
 
        return bootm_maybe_autostart(cmdtp, argv[0]);
 }
index 32f12a72b9be4bb07f81ffb66207af40a1965b18..ba06df06cf338e1a8c3c0a8eabe209df25898e5f 100644 (file)
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -18,6 +18,7 @@
 #include <cpu_func.h>
 #include <elf.h>
 #include <env.h>
+#include <image.h>
 #include <net.h>
 #include <vxworks.h>
 #ifdef CONFIG_X86
@@ -294,7 +295,7 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                /* Consume address */
                argc--; argv++;
        } else
-               addr = load_addr;
+               addr = image_load_addr;
 
        if (!valid_elf_image(addr))
                return 1;
@@ -348,7 +349,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
         * If we don't know where the image is then we're done.
         */
        if (argc < 2)
-               addr = load_addr;
+               addr = image_load_addr;
        else
                addr = simple_strtoul(argv[1], NULL, 16);
 
index 4b9a7eaab05499c017e164c41cbdc492e7026f55..50df127f6d2c56cdce9392d0697d074f7cdd8dfc 100644 (file)
--- a/cmd/fat.c
+++ b/cmd/fat.c
@@ -31,7 +31,7 @@ U_BOOT_CMD(
        "      and determine its size."
 );
 
-int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_fat_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        return do_load(cmdtp, flag, argc, argv, FS_TYPE_FAT);
 }
diff --git a/cmd/fdc.c b/cmd/fdc.c
deleted file mode 100644 (file)
index 7d4b829..0000000
--- a/cmd/fdc.c
+++ /dev/null
@@ -1,752 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2001
- * Denis Peter, MPL AG, d.peter@mpl.ch.
- */
-/*
- * Floppy Disk support
- */
-
-#include <common.h>
-#include <config.h>
-#include <command.h>
-#include <image.h>
-#include <irq_func.h>
-
-
-#undef FDC_DEBUG
-
-#ifdef FDC_DEBUG
-#define        PRINTF(fmt,args...)     printf (fmt ,##args)
-#else
-#define PRINTF(fmt,args...)
-#endif
-
-/*#if defined(CONFIG_CMD_DATE) */
-/*#include <rtc.h> */
-/*#endif */
-
-typedef struct {
-       int             flags;          /* connected drives ect */
-       unsigned long   blnr;           /* Logical block nr */
-       uchar           drive;          /* drive no */
-       uchar           cmdlen;         /* cmd length */
-       uchar           cmd[16];        /* cmd desc */
-       uchar           dma;            /* if > 0 dma enabled */
-       uchar           result[11];     /* status information */
-       uchar           resultlen;      /* lenght of result */
-} FDC_COMMAND_STRUCT;
-
-/* flags: only the lower 8bit used:
- * bit 0 if set drive 0 is present
- * bit 1 if set drive 1 is present
- * bit 2 if set drive 2 is present
- * bit 3 if set drive 3 is present
- * bit 4 if set disk in drive 0 is inserted
- * bit 5 if set disk in drive 1 is inserted
- * bit 6 if set disk in drive 2 is inserted
- * bit 7 if set disk in drive 4 is inserted
- */
-
-/* cmd indexes */
-#define COMMAND                        0
-#define DRIVE                  1
-#define CONFIG0                        1
-#define SPEC_HUTSRT            1
-#define TRACK                  2
-#define CONFIG1                        2
-#define SPEC_HLT               2
-#define HEAD                   3
-#define CONFIG2                        3
-#define SECTOR                 4
-#define SECTOR_SIZE            5
-#define LAST_TRACK             6
-#define GAP                    7
-#define DTL                    8
-/* result indexes */
-#define STATUS_0               0
-#define STATUS_PCN             1
-#define STATUS_1               1
-#define STATUS_2               2
-#define STATUS_TRACK           3
-#define STATUS_HEAD            4
-#define STATUS_SECT            5
-#define STATUS_SECT_SIZE       6
-
-
-/* Register addresses */
-#define FDC_BASE       0x3F0
-#define FDC_SRA                FDC_BASE + 0    /* Status Register A */
-#define FDC_SRB                FDC_BASE + 1    /* Status Register B */
-#define FDC_DOR                FDC_BASE + 2    /* Digital Output Register */
-#define FDC_TDR                FDC_BASE + 3    /* Tape Drive Register */
-#define FDC_DSR                FDC_BASE + 4    /* Data rate Register */
-#define FDC_MSR                FDC_BASE + 4    /* Main Status Register */
-#define FDC_FIFO       FDC_BASE + 5    /* FIFO */
-#define FDC_DIR                FDC_BASE + 6    /* Digital Input Register */
-#define FDC_CCR                FDC_BASE + 7    /* Configuration Control */
-/* Commands */
-#define FDC_CMD_SENSE_INT      0x08
-#define FDC_CMD_CONFIGURE      0x13
-#define FDC_CMD_SPECIFY                0x03
-#define FDC_CMD_RECALIBRATE    0x07
-#define FDC_CMD_READ           0x06
-#define FDC_CMD_READ_TRACK     0x02
-#define FDC_CMD_READ_ID                0x0A
-#define FDC_CMD_DUMP_REG       0x0E
-#define FDC_CMD_SEEK           0x0F
-
-#define FDC_CMD_SENSE_INT_LEN  0x01
-#define FDC_CMD_CONFIGURE_LEN  0x04
-#define FDC_CMD_SPECIFY_LEN    0x03
-#define FDC_CMD_RECALIBRATE_LEN        0x02
-#define FDC_CMD_READ_LEN       0x09
-#define FDC_CMD_READ_TRACK_LEN 0x09
-#define FDC_CMD_READ_ID_LEN    0x02
-#define FDC_CMD_DUMP_REG_LEN   0x01
-#define FDC_CMD_SEEK_LEN       0x03
-
-#define FDC_FIFO_THR           0x0C
-#define FDC_FIFO_DIS           0x00
-#define FDC_IMPLIED_SEEK       0x01
-#define FDC_POLL_DIS           0x00
-#define FDC_PRE_TRK            0x00
-#define FDC_CONFIGURE          FDC_FIFO_THR | (FDC_POLL_DIS<<4) | (FDC_FIFO_DIS<<5) | (FDC_IMPLIED_SEEK << 6)
-#define FDC_MFM_MODE           0x01 /* MFM enable */
-#define FDC_SKIP_MODE          0x00 /* skip enable */
-
-#define FDC_TIME_OUT 100000 /* time out */
-#define        FDC_RW_RETRIES          3 /* read write retries */
-#define FDC_CAL_RETRIES                3 /* calibration and seek retries */
-
-
-/* Disk structure */
-typedef struct  {
-       unsigned int size;      /* nr of sectors total */
-       unsigned int sect;      /* sectors per track */
-       unsigned int head;      /* nr of heads */
-       unsigned int track;     /* nr of tracks */
-       unsigned int stretch;   /* !=0 means double track steps */
-       unsigned char   gap;    /* gap1 size */
-       unsigned char   rate;   /* data rate. |= 0x40 for perpendicular */
-       unsigned char   spec1;  /* stepping rate, head unload time */
-       unsigned char   fmt_gap;/* gap2 size */
-       unsigned char hlt;      /* head load time */
-       unsigned char sect_code;/* Sector Size code */
-       const char      * name; /* used only for predefined formats */
-} FD_GEO_STRUCT;
-
-
-/* supported Floppy types (currently only one) */
-const static FD_GEO_STRUCT floppy_type[2] = {
-       { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,16,2,"H1440" },    /*  7 1.44MB 3.5"   */
-       {    0, 0,0, 0,0,0x00,0x00,0x00,0x00, 0,0,NULL    },    /*  end of table    */
-};
-
-static FDC_COMMAND_STRUCT cmd; /* global command struct */
-
-/* If the boot drive number is undefined, we assume it's drive 0             */
-#ifndef CONFIG_SYS_FDC_DRIVE_NUMBER
-#define CONFIG_SYS_FDC_DRIVE_NUMBER 0
-#endif
-
-/* Hardware access */
-#ifndef CONFIG_SYS_ISA_IO_STRIDE
-#define CONFIG_SYS_ISA_IO_STRIDE 1
-#endif
-
-#ifndef CONFIG_SYS_ISA_IO_OFFSET
-#define CONFIG_SYS_ISA_IO_OFFSET 0
-#endif
-
-/* Supporting Functions */
-/* reads a Register of the FDC */
-unsigned char read_fdc_reg(unsigned int addr)
-{
-       volatile unsigned char *val =
-               (volatile unsigned char *)(CONFIG_SYS_ISA_IO_BASE_ADDRESS +
-                                          (addr * CONFIG_SYS_ISA_IO_STRIDE) +
-                                          CONFIG_SYS_ISA_IO_OFFSET);
-
-       return val [0];
-}
-
-/* writes a Register of the FDC */
-void write_fdc_reg(unsigned int addr, unsigned char val)
-{
-       volatile unsigned char *tmp =
-               (volatile unsigned char *)(CONFIG_SYS_ISA_IO_BASE_ADDRESS +
-                                          (addr * CONFIG_SYS_ISA_IO_STRIDE) +
-                                          CONFIG_SYS_ISA_IO_OFFSET);
-       tmp[0]=val;
-}
-
-/* waits for an interrupt (polling) */
-int wait_for_fdc_int(void)
-{
-       unsigned long timeout;
-       timeout = FDC_TIME_OUT;
-       while((read_fdc_reg(FDC_SRA)&0x80)==0) {
-               timeout--;
-               udelay(10);
-               if(timeout==0) /* timeout occurred */
-                       return false;
-       }
-       return true;
-}
-
-/* reads a byte from the FIFO of the FDC and checks direction and RQM bit
-   of the MSR. returns -1 if timeout, or byte if ok */
-int read_fdc_byte(void)
-{
-       unsigned long timeout;
-       timeout = FDC_TIME_OUT;
-       while((read_fdc_reg(FDC_MSR)&0xC0)!=0xC0) {
-               /* direction out and ready */
-               udelay(10);
-               timeout--;
-               if(timeout==0) /* timeout occurred */
-                       return -1;
-       }
-       return read_fdc_reg(FDC_FIFO);
-}
-
-/* if the direction of the FIFO is wrong, this routine is used to
-   empty the FIFO. Should _not_ be used */
-int fdc_need_more_output(void)
-{
-       unsigned char c;
-       while((read_fdc_reg(FDC_MSR)&0xC0)==0xC0)       {
-                       c=(unsigned char)read_fdc_byte();
-                       printf("Error: more output: %x\n",c);
-       }
-       return true;
-}
-
-
-/* writes a byte to the FIFO of the FDC and checks direction and RQM bit
-   of the MSR */
-int write_fdc_byte(unsigned char val)
-{
-       unsigned long timeout;
-       timeout = FDC_TIME_OUT;
-       while((read_fdc_reg(FDC_MSR)&0xC0)!=0x80) {
-               /* direction in and ready for byte */
-               timeout--;
-               udelay(10);
-               fdc_need_more_output();
-               if(timeout==0) /* timeout occurred */
-                       return false;
-       }
-       write_fdc_reg(FDC_FIFO,val);
-       return true;
-}
-
-/* sets up all FDC commands and issues it to the FDC. If
-   the command causes direct results (no Execution Phase)
-   the result is be read as well. */
-
-int fdc_issue_cmd(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG)
-{
-       int i;
-       unsigned long head,track,sect,timeout;
-       track = pCMD->blnr / (pFG->sect * pFG->head); /* track nr */
-       sect =  pCMD->blnr % (pFG->sect * pFG->head); /* remaining blocks */
-       head = sect / pFG->sect; /* head nr */
-       sect =  sect % pFG->sect; /* remaining blocks */
-       sect++; /* sectors are 1 based */
-       PRINTF("Cmd 0x%02x Track %ld, Head %ld, Sector %ld, Drive %d (blnr %ld)\n",
-               pCMD->cmd[0],track,head,sect,pCMD->drive,pCMD->blnr);
-
-       if(head|=0) { /* max heads = 2 */
-               pCMD->cmd[DRIVE]=pCMD->drive | 0x04; /* head 1 */
-               pCMD->cmd[HEAD]=(unsigned char) head; /* head register */
-       }
-       else {
-               pCMD->cmd[DRIVE]=pCMD->drive; /* head 0 */
-               pCMD->cmd[HEAD]=(unsigned char) head; /* head register */
-       }
-       pCMD->cmd[TRACK]=(unsigned char) track; /* track */
-       switch (pCMD->cmd[COMMAND]) {
-               case FDC_CMD_READ:
-                       pCMD->cmd[SECTOR]=(unsigned char) sect; /* sector */
-                       pCMD->cmd[SECTOR_SIZE]=pFG->sect_code; /* sector size code */
-                       pCMD->cmd[LAST_TRACK]=pFG->sect; /* End of track */
-                       pCMD->cmd[GAP]=pFG->gap; /* gap */
-                       pCMD->cmd[DTL]=0xFF; /* DTL */
-                       pCMD->cmdlen=FDC_CMD_READ_LEN;
-                       pCMD->cmd[COMMAND]|=(FDC_MFM_MODE<<6); /* set MFM bit */
-                       pCMD->cmd[COMMAND]|=(FDC_SKIP_MODE<<5); /* set Skip bit */
-                       pCMD->resultlen=0;  /* result only after execution */
-                       break;
-               case FDC_CMD_SEEK:
-                       pCMD->cmdlen=FDC_CMD_SEEK_LEN;
-                       pCMD->resultlen=0;  /* no result */
-                       break;
-               case FDC_CMD_CONFIGURE:
-                       pCMD->cmd[CONFIG0]=0;
-                       pCMD->cmd[CONFIG1]=FDC_CONFIGURE; /* FIFO Threshold, Poll, Enable FIFO */
-                       pCMD->cmd[CONFIG2]=FDC_PRE_TRK; /* Precompensation Track */
-                       pCMD->cmdlen=FDC_CMD_CONFIGURE_LEN;
-                       pCMD->resultlen=0;  /* no result */
-                       break;
-               case FDC_CMD_SPECIFY:
-                       pCMD->cmd[SPEC_HUTSRT]=pFG->spec1;
-                       pCMD->cmd[SPEC_HLT]=(pFG->hlt)<<1; /* head load time */
-                       if(pCMD->dma==0)
-                               pCMD->cmd[SPEC_HLT]|=0x1; /* no dma */
-                       pCMD->cmdlen=FDC_CMD_SPECIFY_LEN;
-                       pCMD->resultlen=0;  /* no result */
-                       break;
-               case FDC_CMD_DUMP_REG:
-                       pCMD->cmdlen=FDC_CMD_DUMP_REG_LEN;
-                       pCMD->resultlen=10;  /* 10 byte result */
-                       break;
-               case FDC_CMD_READ_ID:
-                       pCMD->cmd[COMMAND]|=(FDC_MFM_MODE<<6); /* set MFM bit */
-                       pCMD->cmdlen=FDC_CMD_READ_ID_LEN;
-                       pCMD->resultlen=7;  /* 7 byte result */
-                       break;
-               case FDC_CMD_RECALIBRATE:
-                       pCMD->cmd[DRIVE]&=0x03; /* don't set the head bit */
-                       pCMD->cmdlen=FDC_CMD_RECALIBRATE_LEN;
-                       pCMD->resultlen=0;  /* no result */
-                       break;
-                       break;
-               case FDC_CMD_SENSE_INT:
-                       pCMD->cmdlen=FDC_CMD_SENSE_INT_LEN;
-                       pCMD->resultlen=2;
-                       break;
-       }
-       for(i=0;i<pCMD->cmdlen;i++) {
-               /* PRINTF("write cmd%d = 0x%02X\n",i,pCMD->cmd[i]); */
-               if (write_fdc_byte(pCMD->cmd[i]) == false) {
-                       PRINTF("Error: timeout while issue cmd%d\n",i);
-                       return false;
-               }
-       }
-       timeout=FDC_TIME_OUT;
-       for(i=0;i<pCMD->resultlen;i++) {
-               while((read_fdc_reg(FDC_MSR)&0xC0)!=0xC0) {
-                       timeout--;
-                       if(timeout==0) {
-                               PRINTF(" timeout while reading result%d MSR=0x%02X\n",i,read_fdc_reg(FDC_MSR));
-                               return false;
-                       }
-               }
-               pCMD->result[i]=(unsigned char)read_fdc_byte();
-       }
-       return true;
-}
-
-/* selects the drive assigned in the cmd structur and
-   switches on the Motor */
-void select_fdc_drive(FDC_COMMAND_STRUCT *pCMD)
-{
-       unsigned char val;
-
-       val=(1<<(4+pCMD->drive))|pCMD->drive|0xC; /* set reset, dma gate and motor bits */
-       if((read_fdc_reg(FDC_DOR)&val)!=val) {
-               write_fdc_reg(FDC_DOR,val);
-               for(val=0;val<255;val++)
-                       udelay(500); /* wait some time to start motor */
-       }
-}
-
-/* switches off the Motor of the specified drive */
-void stop_fdc_drive(FDC_COMMAND_STRUCT *pCMD)
-{
-       unsigned char val;
-
-       val=(1<<(4+pCMD->drive))|pCMD->drive; /* sets motor bits */
-       write_fdc_reg(FDC_DOR,(read_fdc_reg(FDC_DOR)&~val));
-}
-
-/* issues a recalibrate command, waits for interrupt and
- * issues a sense_interrupt */
-int fdc_recalibrate(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG)
-{
-       pCMD->cmd[COMMAND]=FDC_CMD_RECALIBRATE;
-       if (fdc_issue_cmd(pCMD, pFG) == false)
-               return false;
-       while (wait_for_fdc_int() != true);
-
-       pCMD->cmd[COMMAND]=FDC_CMD_SENSE_INT;
-       return(fdc_issue_cmd(pCMD,pFG));
-}
-
-/* issues a recalibrate command, waits for interrupt and
- * issues a sense_interrupt */
-int fdc_seek(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG)
-{
-       pCMD->cmd[COMMAND]=FDC_CMD_SEEK;
-       if (fdc_issue_cmd(pCMD, pFG) == false)
-               return false;
-       while (wait_for_fdc_int() != true);
-
-       pCMD->cmd[COMMAND]=FDC_CMD_SENSE_INT;
-       return(fdc_issue_cmd(pCMD,pFG));
-}
-
-/* terminates current command, by not servicing the FIFO
- * waits for interrupt and fills in the result bytes */
-int fdc_terminate(FDC_COMMAND_STRUCT *pCMD)
-{
-       int i;
-       for(i=0;i<100;i++)
-               udelay(500); /* wait 500usec for fifo overrun */
-       while((read_fdc_reg(FDC_SRA)&0x80)==0x00); /* wait as long as no int has occurred */
-       for(i=0;i<7;i++) {
-               pCMD->result[i]=(unsigned char)read_fdc_byte();
-       }
-       return true;
-}
-
-/* reads data from FDC, seek commands are issued automatic */
-int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
-{
-  /* first seek to start address */
-       unsigned long len,readblk,i,timeout,ii,offset;
-       unsigned char c,retriesrw,retriescal;
-       unsigned char *bufferw; /* working buffer */
-       int sect_size;
-       int flags;
-
-       flags=disable_interrupts(); /* switch off all Interrupts */
-       select_fdc_drive(pCMD); /* switch on drive */
-       sect_size=0x080<<pFG->sect_code;
-       retriesrw=0;
-       retriescal=0;
-       offset=0;
-       if (fdc_seek(pCMD, pFG) == false) {
-               stop_fdc_drive(pCMD);
-               if (flags)
-                       enable_interrupts();
-               return false;
-       }
-       if((pCMD->result[STATUS_0]&0x20)!=0x20) {
-               printf("Seek error Status: %02X\n",pCMD->result[STATUS_0]);
-               stop_fdc_drive(pCMD);
-               if (flags)
-                       enable_interrupts();
-               return false;
-       }
-       /* now determine the next seek point */
-       /*      lastblk=pCMD->blnr + blocks; */
-       /*      readblk=(pFG->head*pFG->sect)-(pCMD->blnr%(pFG->head*pFG->sect)); */
-       readblk=pFG->sect-(pCMD->blnr%pFG->sect);
-       PRINTF("1st nr of block possible read %ld start %ld\n",readblk,pCMD->blnr);
-       if(readblk>blocks) /* is end within 1st track */
-               readblk=blocks; /* yes, correct it */
-       PRINTF("we read %ld blocks start %ld\n",readblk,pCMD->blnr);
-       bufferw = &buffer[0]; /* setup working buffer */
-       do {
-retryrw:
-               len=sect_size * readblk;
-               pCMD->cmd[COMMAND]=FDC_CMD_READ;
-               if (fdc_issue_cmd(pCMD, pFG) == false) {
-                       stop_fdc_drive(pCMD);
-                       if (flags)
-                               enable_interrupts();
-                       return false;
-               }
-               for (i=0;i<len;i++) {
-                       timeout=FDC_TIME_OUT;
-                       do {
-                               c=read_fdc_reg(FDC_MSR);
-                               if((c&0xC0)==0xC0) {
-                                       bufferw[i]=read_fdc_reg(FDC_FIFO);
-                                       break;
-                               }
-                               if((c&0xC0)==0x80) { /* output */
-                                       PRINTF("Transfer error transferred: at %ld, MSR=%02X\n",i,c);
-                                       if(i>6) {
-                                               for(ii=0;ii<7;ii++) {
-                                                       pCMD->result[ii]=bufferw[(i-7+ii)];
-                                               } /* for */
-                                       }
-                                       if(retriesrw++>FDC_RW_RETRIES) {
-                                               if (retriescal++>FDC_CAL_RETRIES) {
-                                                       stop_fdc_drive(pCMD);
-                                                       if (flags)
-                                                               enable_interrupts();
-                                                       return false;
-                                               }
-                                               else {
-                                                       PRINTF(" trying to recalibrate Try %d\n",retriescal);
-                                                       if (fdc_recalibrate(pCMD, pFG) == false) {
-                                                               stop_fdc_drive(pCMD);
-                                                               if (flags)
-                                                                       enable_interrupts();
-                                                               return false;
-                                                       }
-                                                       retriesrw=0;
-                                                       goto retrycal;
-                                               } /* else >FDC_CAL_RETRIES */
-                                       }
-                                       else {
-                                               PRINTF("Read retry %d\n",retriesrw);
-                                               goto retryrw;
-                                       } /* else >FDC_RW_RETRIES */
-                               }/* if output */
-                               timeout--;
-                       } while (true);
-               } /* for len */
-               /* the last sector of a track or all data has been read,
-                * we need to get the results */
-               fdc_terminate(pCMD);
-               offset+=(sect_size*readblk); /* set up buffer pointer */
-               bufferw = &buffer[offset];
-               pCMD->blnr+=readblk; /* update current block nr */
-               blocks-=readblk; /* update blocks */
-               if(blocks==0)
-                       break; /* we are finish */
-               /* setup new read blocks */
-               /*      readblk=pFG->head*pFG->sect; */
-               readblk=pFG->sect;
-               if(readblk>blocks)
-                       readblk=blocks;
-retrycal:
-               /* a seek is necessary */
-               if (fdc_seek(pCMD, pFG) == false) {
-                       stop_fdc_drive(pCMD);
-                       if (flags)
-                               enable_interrupts();
-                       return false;
-               }
-               if((pCMD->result[STATUS_0]&0x20)!=0x20) {
-                       PRINTF("Seek error Status: %02X\n",pCMD->result[STATUS_0]);
-                       stop_fdc_drive(pCMD);
-                       return false;
-               }
-       } while (true); /* start over */
-       stop_fdc_drive(pCMD); /* switch off drive */
-       if (flags)
-               enable_interrupts();
-       return true;
-}
-
-/* Scan all drives and check if drive is present and disk is inserted */
-int fdc_check_drive(FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
-{
-       int i,drives,state;
-  /* OK procedure of data book is satisfied.
-        * trying to get some information over the drives */
-       state=0; /* no drives, no disks */
-       for(drives=0;drives<4;drives++) {
-               pCMD->drive=drives;
-               select_fdc_drive(pCMD);
-               pCMD->blnr=0; /* set to the 1st block */
-               if (fdc_recalibrate(pCMD, pFG) == false)
-                       continue;
-               if((pCMD->result[STATUS_0]&0x10)==0x10)
-                       continue;
-               /* ok drive connected check for disk */
-               state|=(1<<drives);
-               pCMD->blnr=pFG->size; /* set to the last block */
-               if (fdc_seek(pCMD, pFG) == false)
-                       continue;
-               pCMD->blnr=0; /* set to the 1st block */
-               if (fdc_recalibrate(pCMD, pFG) == false)
-                       continue;
-               pCMD->cmd[COMMAND]=FDC_CMD_READ_ID;
-               if (fdc_issue_cmd(pCMD, pFG) == false)
-                       continue;
-               state|=(0x10<<drives);
-       }
-       stop_fdc_drive(pCMD);
-       for(i=0;i<4;i++) {
-               PRINTF("Floppy Drive %d %sconnected %sDisk inserted %s\n",i,
-                       ((state&(1<<i))==(1<<i)) ? "":"not ",
-                       ((state&(0x10<<i))==(0x10<<i)) ? "":"no ",
-                       ((state&(0x10<<i))==(0x10<<i)) ? pFG->name : "");
-       }
-       pCMD->flags=state;
-       return true;
-}
-
-
-/**************************************************************************
-* int fdc_setup
-* setup the fdc according the datasheet
-* assuming in PS2 Mode
-*/
-int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
-{
-       int i;
-
-#ifdef CONFIG_SYS_FDC_HW_INIT
-       fdc_hw_init ();
-#endif
-       /* first, we reset the FDC via the DOR */
-       write_fdc_reg(FDC_DOR,0x00);
-       for(i=0; i<255; i++) /* then we wait some time */
-               udelay(500);
-       /* then, we clear the reset in the DOR */
-       pCMD->drive=drive;
-       select_fdc_drive(pCMD);
-       /* initialize the CCR */
-       write_fdc_reg(FDC_CCR,pFG->rate);
-       /* then initialize the DSR */
-       write_fdc_reg(FDC_DSR,pFG->rate);
-       if (wait_for_fdc_int() == false) {
-                       PRINTF("Time Out after writing CCR\n");
-                       return false;
-       }
-       /* now issue sense Interrupt and status command
-        * assuming only one drive present (drive 0) */
-       pCMD->dma=0; /* we don't use any dma at all */
-       for(i=0;i<4;i++) {
-               /* issue sense interrupt for all 4 possible drives */
-               pCMD->cmd[COMMAND]=FDC_CMD_SENSE_INT;
-               if (fdc_issue_cmd(pCMD, pFG) == false) {
-                       PRINTF("Sense Interrupt for drive %d failed\n",i);
-               }
-       }
-       /* issue the configure command */
-       pCMD->drive=drive;
-       select_fdc_drive(pCMD);
-       pCMD->cmd[COMMAND]=FDC_CMD_CONFIGURE;
-       if (fdc_issue_cmd(pCMD, pFG) == false) {
-               PRINTF(" configure timeout\n");
-               stop_fdc_drive(pCMD);
-               return false;
-       }
-       /* issue specify command */
-       pCMD->cmd[COMMAND]=FDC_CMD_SPECIFY;
-       if (fdc_issue_cmd(pCMD, pFG) == false) {
-               PRINTF(" specify timeout\n");
-               stop_fdc_drive(pCMD);
-               return false;
-
-       }
-       /* then, we clear the reset in the DOR */
-       /* fdc_check_drive(pCMD,pFG);   */
-       /*      write_fdc_reg(FDC_DOR,0x04); */
-
-       return true;
-}
-
-/****************************************************************************
- * main routine do_fdcboot
- */
-int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-       FD_GEO_STRUCT *pFG = (FD_GEO_STRUCT *)floppy_type;
-       FDC_COMMAND_STRUCT *pCMD = &cmd;
-       unsigned long addr,imsize;
-#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
-       image_header_t *hdr;  /* used for fdc boot */
-#endif
-       unsigned char boot_drive;
-       int i,nrofblk;
-#if defined(CONFIG_FIT)
-       const void *fit_hdr = NULL;
-#endif
-
-       switch (argc) {
-       case 1:
-               addr = CONFIG_SYS_LOAD_ADDR;
-               boot_drive=CONFIG_SYS_FDC_DRIVE_NUMBER;
-               break;
-       case 2:
-               addr = simple_strtoul(argv[1], NULL, 16);
-               boot_drive=CONFIG_SYS_FDC_DRIVE_NUMBER;
-               break;
-       case 3:
-               addr = simple_strtoul(argv[1], NULL, 16);
-               boot_drive=simple_strtoul(argv[2], NULL, 10);
-               break;
-       default:
-               return CMD_RET_USAGE;
-       }
-       /* setup FDC and scan for drives  */
-       if (fdc_setup(boot_drive, pCMD, pFG) == false) {
-               printf("\n** Error in setup FDC **\n");
-               return 1;
-       }
-       if (fdc_check_drive(pCMD, pFG) == false) {
-               printf("\n** Error in check_drives **\n");
-               return 1;
-       }
-       if((pCMD->flags&(1<<boot_drive))==0) {
-               /* drive not available */
-               printf("\n** Drive %d not availabe **\n",boot_drive);
-               return 1;
-       }
-       if((pCMD->flags&(0x10<<boot_drive))==0) {
-               /* no disk inserted */
-               printf("\n** No disk inserted in drive %d **\n",boot_drive);
-               return 1;
-       }
-       /* ok, we have a valid source */
-       pCMD->drive=boot_drive;
-       /* read first block */
-       pCMD->blnr=0;
-       if (fdc_read_data((unsigned char *)addr, 1, pCMD, pFG) == false) {
-               printf("\nRead error:");
-               for(i=0;i<7;i++)
-                       printf("result%d: 0x%02X\n",i,pCMD->result[i]);
-               return 1;
-       }
-
-       switch (genimg_get_format ((void *)addr)) {
-#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
-       case IMAGE_FORMAT_LEGACY:
-               hdr = (image_header_t *)addr;
-               image_print_contents (hdr);
-
-               imsize = image_get_image_size (hdr);
-               break;
-#endif
-#if defined(CONFIG_FIT)
-       case IMAGE_FORMAT_FIT:
-               fit_hdr = (const void *)addr;
-               puts ("Fit image detected...\n");
-
-               imsize = fit_get_size (fit_hdr);
-               break;
-#endif
-       default:
-               puts ("** Unknown image type\n");
-               return 1;
-       }
-
-       nrofblk=imsize/512;
-       if((imsize%512)>0)
-               nrofblk++;
-       printf("Loading %ld Bytes (%d blocks) at 0x%08lx..\n",imsize,nrofblk,addr);
-       pCMD->blnr=0;
-       if (fdc_read_data((unsigned char *)addr, nrofblk, pCMD, pFG) == false) {
-               /* read image block */
-               printf("\nRead error:");
-               for(i=0;i<7;i++)
-                       printf("result%d: 0x%02X\n",i,pCMD->result[i]);
-               return 1;
-       }
-       printf("OK %ld Bytes loaded.\n",imsize);
-
-       flush_cache (addr, imsize);
-
-#if defined(CONFIG_FIT)
-       /* This cannot be done earlier, we need complete FIT image in RAM first */
-       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
-               if (!fit_check_format (fit_hdr)) {
-                       puts ("** Bad FIT image format\n");
-                       return 1;
-               }
-               fit_print_contents (fit_hdr);
-       }
-#endif
-
-       /* Loading ok, update default load address */
-       load_addr = addr;
-
-       return bootm_maybe_autostart(cmdtp, argv[0]);
-}
-
-U_BOOT_CMD(
-       fdcboot,        3,      1,      do_fdcboot,
-       "boot from floppy device",
-       "loadAddr drive"
-);
index b47cd3d98930a4a80ee4fbdc55d4afaad036c795..da2580d85d729dd9cfb579e05bf84e1dc2c938d5 100644 (file)
@@ -73,6 +73,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <image.h>
 #include <malloc.h>
 #include <jffs2/jffs2.h>
 #include <linux/list.h>
@@ -476,7 +477,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        char *filename;
        int size;
        struct part_info *part;
-       ulong offset = load_addr;
+       ulong offset = image_load_addr;
 
        /* pre-set Boot file name */
        filename = env_get("bootfile");
@@ -488,7 +489,7 @@ int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
        if (argc == 3) {
                offset = simple_strtoul(argv[1], NULL, 16);
-               load_addr = offset;
+               image_load_addr = offset;
                filename = argv[2];
        }
 
index 3bfc1b41ecececf359ec609b57270ad3c819caca..fab30fe894318a9308bc7cb41e948b9b6d229879 100644 (file)
@@ -12,6 +12,8 @@
 #include <console.h>
 #include <cpu_func.h>
 #include <env.h>
+#include <flash.h>
+#include <image.h>
 #include <s_record.h>
 #include <net.h>
 #include <exports.h>
@@ -108,7 +110,7 @@ static int do_load_serial(cmd_tbl_t *cmdtp, int flag, int argc,
                rcode = 1;
        } else {
                printf("## Start Addr      = 0x%08lX\n", addr);
-               load_addr = addr;
+               image_load_addr = addr;
        }
 
 #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE
@@ -484,12 +486,12 @@ static int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc,
                addr = load_serial_bin(offset);
 
                if (addr == ~0) {
-                       load_addr = 0;
+                       image_load_addr = 0;
                        printf("## Binary (kermit) download aborted\n");
                        rcode = 1;
                } else {
                        printf("## Start Addr      = 0x%08lX\n", addr);
-                       load_addr = addr;
+                       image_load_addr = addr;
                }
        }
        if (load_baudrate != current_baudrate) {
@@ -980,7 +982,7 @@ static ulong load_serial_ymodem(ulong offset, int mode)
                                rc = flash_write((char *) ymodemBuf,
                                                  store_addr, res);
                                if (rc != 0) {
-                                       flash_perror (rc);
+                                       flash_perror(rc);
                                        return (~0);
                                }
                        } else
index 4ec450b050248d14f6c77bfd08c0c8f818e12359..f32985ca7ddcddd7245cd1d05b2da3372f118c3c 100644 (file)
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -16,6 +16,7 @@
 #include <cli.h>
 #include <command.h>
 #include <console.h>
+#include <flash.h>
 #include <hash.h>
 #include <mapmem.h>
 #include <watchdog.h>
@@ -106,7 +107,7 @@ static int do_mem_nm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        u64 writeval;
 #else
        ulong writeval;
@@ -131,7 +132,7 @@ static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        /* Get the value to write.
        */
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        writeval = simple_strtoull(argv[2], NULL, 16);
 #else
        writeval = simple_strtoul(argv[2], NULL, 16);
@@ -150,7 +151,7 @@ static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        while (count-- > 0) {
                if (size == 4)
                        *((u32 *)buf) = (u32)writeval;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                else if (size == 8)
                        *((u64 *)buf) = (u64)writeval;
 #endif
@@ -227,7 +228,7 @@ static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        int     rcode = 0;
        const char *type;
        const void *buf1, *buf2, *base;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        u64 word1, word2;
 #else
        ulong word1, word2;
@@ -259,7 +260,7 @@ static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                if (size == 4) {
                        word1 = *(u32 *)buf1;
                        word2 = *(u32 *)buf2;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                } else if (size == 8) {
                        word1 = *(u64 *)buf1;
                        word2 = *(u64 *)buf2;
@@ -273,7 +274,7 @@ static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                }
                if (word1 != word2) {
                        ulong offset = buf1 - base;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                        printf("%s at 0x%p (%#0*llx) != %s at 0x%p (%#0*llx)\n",
                               type, (void *)(addr1 + offset), size, word1,
                               type, (void *)(addr2 + offset), size, word2);
@@ -339,7 +340,7 @@ static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
                rc = flash_write((char *)src, (ulong)dst, count * size);
                if (rc != 0) {
-                       flash_perror (rc);
+                       flash_perror(rc);
                        unmap_sysmem(src);
                        unmap_sysmem(dst);
                        return (1);
@@ -377,7 +378,7 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
 {
        ulong   addr, length, i, bytes;
        int     size;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        volatile u64 *llp;
 #endif
        volatile u32 *longp;
@@ -410,7 +411,7 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
         * If we have only one object, just run infinite loops.
         */
        if (length == 1) {
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                if (size == 8) {
                        llp = (u64 *)buf;
                        for (;;)
@@ -432,7 +433,7 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
                        i = *cp;
        }
 
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        if (size == 8) {
                for (;;) {
                        llp = (u64 *)buf;
@@ -475,7 +476,7 @@ static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc,
 {
        ulong   addr, length, i, bytes;
        int     size;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        volatile u64 *llp;
        u64 data;
 #else
@@ -505,7 +506,7 @@ static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc,
        length = simple_strtoul(argv[2], NULL, 16);
 
        /* data to write */
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        data = simple_strtoull(argv[3], NULL, 16);
 #else
        data = simple_strtoul(argv[3], NULL, 16);
@@ -518,7 +519,7 @@ static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc,
         * If we have only one object, just run infinite loops.
         */
        if (length == 1) {
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                if (size == 8) {
                        llp = (u64 *)buf;
                        for (;;)
@@ -540,7 +541,7 @@ static int do_mem_loopw(cmd_tbl_t *cmdtp, int flag, int argc,
                        *cp = data;
        }
 
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        if (size == 8) {
                for (;;) {
                        llp = (u64 *)buf;
@@ -967,7 +968,7 @@ static int
 mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
 {
        ulong   addr;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        u64 i;
 #else
        ulong i;
@@ -1006,7 +1007,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
                printf("%08lx:", addr);
                if (size == 4)
                        printf(" %08x", *((u32 *)ptr));
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                else if (size == 8)
                        printf(" %016llx", *((u64 *)ptr));
 #endif
@@ -1033,7 +1034,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
 #endif
                else {
                        char *endp;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                        i = simple_strtoull(console_buffer, &endp, 16);
 #else
                        i = simple_strtoul(console_buffer, &endp, 16);
@@ -1045,7 +1046,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
                                bootretry_reset_cmd_timeout();
                                if (size == 4)
                                        *((u32 *)ptr) = i;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                                else if (size == 8)
                                        *((u64 *)ptr) = i;
 #endif
@@ -1139,7 +1140,7 @@ static int do_random(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 U_BOOT_CMD(
        md,     3,      1,      do_mem_md,
        "memory display",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] address [# of objects]"
 #else
        "[.b, .w, .l] address [# of objects]"
@@ -1150,7 +1151,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
        mm,     2,      1,      do_mem_mm,
        "memory modify (auto-incrementing address)",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] address"
 #else
        "[.b, .w, .l] address"
@@ -1161,7 +1162,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
        nm,     2,      1,      do_mem_nm,
        "memory modify (constant address)",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] address"
 #else
        "[.b, .w, .l] address"
@@ -1171,7 +1172,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
        mw,     4,      1,      do_mem_mw,
        "memory write (fill)",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] address value [count]"
 #else
        "[.b, .w, .l] address value [count]"
@@ -1181,7 +1182,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
        cp,     4,      1,      do_mem_cp,
        "memory copy",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] source target count"
 #else
        "[.b, .w, .l] source target count"
@@ -1191,7 +1192,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
        cmp,    4,      1,      do_mem_cmp,
        "memory compare",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] addr1 addr2 count"
 #else
        "[.b, .w, .l] addr1 addr2 count"
@@ -1242,7 +1243,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
        loop,   3,      1,      do_mem_loop,
        "infinite loop on address range",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] address number_of_objects"
 #else
        "[.b, .w, .l] address number_of_objects"
@@ -1253,7 +1254,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
        loopw,  4,      1,      do_mem_loopw,
        "infinite write loop on address range",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] address number_of_objects data_to_write"
 #else
        "[.b, .w, .l] address number_of_objects data_to_write"
@@ -1273,7 +1274,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
        mdc,    4,      1,      do_mem_mdc,
        "memory display cyclic",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] address count delay(ms)"
 #else
        "[.b, .w, .l] address count delay(ms)"
@@ -1283,7 +1284,7 @@ U_BOOT_CMD(
 U_BOOT_CMD(
        mwc,    4,      1,      do_mem_mwc,
        "memory write cyclic",
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        "[.b, .w, .l, .q] address value delay(ms)"
 #else
        "[.b, .w, .l] address value delay(ms)"
index 84d2d531f0d43c04dae1bfa0a687f24306b4b905..2041a7a29aa91b184bc1bcbe263c5f04edf54430 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <image.h>
 #include <vsprintf.h>
 #include <errno.h>
 #include <dm.h>
@@ -423,8 +424,10 @@ static int is_usb_active(void)
 #ifdef CONFIG_CMD_NET
 static size_t tftp_read_file(const char *file_name)
 {
-       /* update global variable load_addr before tftp file from network */
-       load_addr = get_load_addr();
+       /*
+        * update global variable image_load_addr before tftp file from network
+        */
+       image_load_addr = get_load_addr();
        return net_loop(TFTPGET);
 }
 
index 5bda69e819b0c4aa4ec16becba073866db3e7694..4de6892a01b845262aefe40cfea0da550b7e8f5c 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <image.h>
 #include <linux/mtd/mtd.h>
 #include <command.h>
 #include <console.h>
@@ -925,7 +926,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, struct mtd_info *mtd,
 
        /* Loading ok, update default load address */
 
-       load_addr = addr;
+       image_load_addr = addr;
 
        return bootm_maybe_autostart(cmdtp, cmd);
 }
index 237403977e8006c651182d01534912aaeeca9676..1b724cc57090e7ab81eecf750c48157d1fa57ce8 100644 (file)
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <image.h>
 #include <net.h>
 
 static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []);
@@ -186,10 +187,10 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
 
        net_boot_file_name_explicit = false;
 
-       /* pre-set load_addr */
+       /* pre-set image_load_addr */
        s = env_get("loadaddr");
        if (s != NULL)
-               load_addr = simple_strtoul(s, NULL, 16);
+               image_load_addr = simple_strtoul(s, NULL, 16);
 
        switch (argc) {
        case 1:
@@ -206,7 +207,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
                 */
                addr = simple_strtoul(argv[1], &end, 16);
                if (end == (argv[1] + strlen(argv[1]))) {
-                       load_addr = addr;
+                       image_load_addr = addr;
                        /* refresh bootfile name from env */
                        copy_filename(net_boot_file_name, env_get("bootfile"),
                                      sizeof(net_boot_file_name));
@@ -218,7 +219,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
                break;
 
        case 3:
-               load_addr = simple_strtoul(argv[1], NULL, 16);
+               image_load_addr = simple_strtoul(argv[1], NULL, 16);
                net_boot_file_name_explicit = true;
                copy_filename(net_boot_file_name, argv[2],
                              sizeof(net_boot_file_name));
@@ -227,8 +228,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
 
 #ifdef CONFIG_CMD_TFTPPUT
        case 4:
-               if (strict_strtoul(argv[1], 16, &save_addr) < 0 ||
-                   strict_strtoul(argv[2], 16, &save_size) < 0) {
+               if (strict_strtoul(argv[1], 16, &image_save_addr) < 0 ||
+                   strict_strtoul(argv[2], 16, &image_save_size) < 0) {
                        printf("Invalid address/size\n");
                        return CMD_RET_USAGE;
                }
index 73f1b4fbd336c246eb56d6603d81ba26e9847205..bce6728875a6c3de11edc6c07ca4b66244731005 100644 (file)
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -6,6 +6,8 @@
 
 #include <common.h>
 #include <command.h>
+#include <fs.h>
+#include <net.h>
 
 #include "pxe_utils.h"
 
index a636346bb51ff0a88603133cda331230e40df0db..8b830212ce163d8e55c203fac5684aedb258543a 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <image.h>
 #include <malloc.h>
 #include <mapmem.h>
 #include <lcd.h>
@@ -1310,9 +1311,9 @@ void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
 #ifdef CONFIG_CMD_BMP
        /* display BMP if available */
        if (cfg->bmp) {
-               if (get_relfile(cmdtp, cfg->bmp, load_addr)) {
+               if (get_relfile(cmdtp, cfg->bmp, image_load_addr)) {
                        run_command("cls", 0);
-                       bmp_display(load_addr,
+                       bmp_display(image_load_addr,
                                    BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
                } else {
                        printf("Skipping background bmp %s for failure\n",
index 7f51b927a47548c074390cbab4939e98a9f5d498..598fab48b322d8231b7b9e9a66ddac103c34a49f 100644 (file)
@@ -154,7 +154,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 
        /* Loading ok, update default load address */
-       load_addr = addr;
+       image_load_addr = addr;
 
        printf ("\n%ld bytes read\n", filelen);
        env_set_hex("filesize", filelen);
index 3a51ebf0b665c5d58db508f5d6b453f1bd64463a..92f8f77ee6fcc60a1cc56f59d4e26db87f720758 100644 (file)
@@ -41,8 +41,7 @@ static const char *get_default_image(const void *fit)
 }
 #endif
 
-int
-source (ulong addr, const char *fit_uname)
+int image_source_script(ulong addr, const char *fit_uname)
 {
        ulong           len;
 #if defined(CONFIG_LEGACY_IMAGE_FORMAT)
@@ -172,7 +171,8 @@ static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                addr = CONFIG_SYS_LOAD_ADDR;
                debug ("*  source: default load address = 0x%08lx\n", addr);
 #if defined(CONFIG_FIT)
-       } else if (fit_parse_subimage (argv[1], load_addr, &addr, &fit_uname)) {
+       } else if (fit_parse_subimage(argv[1], image_load_addr, &addr,
+                                     &fit_uname)) {
                debug ("*  source: subimage '%s' from FIT image at 0x%08lx\n",
                                fit_uname, addr);
 #endif
@@ -182,7 +182,7 @@ static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 
        printf ("## Executing script at %08lx\n", addr);
-       rcode = source (addr, fit_uname);
+       rcode = image_source_script(addr, fit_uname);
        return rcode;
 }
 
index 55130898c9355ba31c391fab4db3125cb6bb82af..a452fe7876a8b76089bc5e7929b917933dd73cd3 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <cpu_func.h>
+#include <init.h>
 #include <asm/arch/hardware.h>
 #include <asm/cache.h>
 #include <asm/emif.h>
index c14dd75a260914583b11351c2b7fce079cc03421..2cde517d7a9043442e0a17994cd2ba29ade6dce5 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <tpm-v1.h>
 #include "tpm-user-utils.h"
 
index 22b2037a33f51187a5c024717811d372a434d99b..dccd1143a7a5bc5c3dc46ad13bc3a7a13c27f278 100644 (file)
@@ -33,7 +33,7 @@
 static int
 do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
-       ulong           addr = load_addr;
+       ulong           addr = image_load_addr;
        ulong           dest = 0;
        ulong           data, len;
        int             verify;
index ed5402bb139e541d78528b68b4a80259f994fd1f..153313063562815e721f5dee1abbd0702a1cd1ed 100644 (file)
--- a/cmd/zfs.c
+++ b/cmd/zfs.c
@@ -112,7 +112,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
        zfs_close(&zfile);
 
        /* Loading ok, update default load address */
-       load_addr = addr;
+       image_load_addr = addr;
 
        printf("%llu bytes read\n", zfile.size);
        env_set_hex("filesize", zfile.size);
index 029cc0f2ce6b408ac79524cb744fc064c81b87e5..5f62b8d0b136afdcd8ae58485d3dedb9a5c94641 100644 (file)
@@ -113,6 +113,7 @@ obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o
 obj-$(CONFIG_$(SPL_TPL_)FIT) += image-fit.o
 obj-$(CONFIG_$(SPL_)MULTI_DTB_FIT) += boot_fit.o common_fit.o
 obj-$(CONFIG_$(SPL_TPL_)FIT_SIGNATURE) += image-sig.o
+obj-$(CONFIG_$(SPL_TPL_)FIT_CIPHER) += image-cipher.o
 obj-$(CONFIG_IO_TRACE) += iotrace.o
 obj-y += memsize.o
 obj-y += stdio.o
index d66afb37ca2f3966281a49920b17340367ecea5a..3f0132a6e339fd23e88857c0a83dae1ad8825d79 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <bloblist.h>
+#include <clock_legacy.h>
 #include <console.h>
 #include <cpu.h>
 #include <cpu_func.h>
@@ -19,6 +20,7 @@
 #include <env_internal.h>
 #include <fdtdec.h>
 #include <fs.h>
+#include <hang.h>
 #include <i2c.h>
 #include <init.h>
 #include <initcall.h>
index e711de64b5b98fb64b3de63315cc6048ff6191a0..8a0c1114e77ac2ed644f2324cbaaa0c7cf5cae72 100644 (file)
 #include <common.h>
 #include <api.h>
 #include <cpu_func.h>
+#include <exports.h>
+#include <hang.h>
+#include <image.h>
 #include <irq_func.h>
+#include <net.h>
 #include <u-boot/crc.h>
 /* TODO: can we just include all these headers whether needed or not? */
 #if defined(CONFIG_CMD_BEDBUG)
@@ -26,6 +30,7 @@
 #include <env_internal.h>
 #include <fdtdec.h>
 #include <ide.h>
+#include <init.h>
 #include <initcall.h>
 #if defined(CONFIG_CMD_KGDB)
 #include <kgdb.h>
@@ -481,7 +486,7 @@ static int initr_env(void)
 #endif
 
        /* Initialize from environment */
-       load_addr = env_get_ulong("loadaddr", 16, load_addr);
+       image_load_addr = env_get_ulong("loadaddr", 16, image_load_addr);
 
        return 0;
 }
index 79972e46f29f22f0cc2201d28934aae8c58c4b00..d2ed33663b7193b574722e5f3d0aa441dd571149 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <malloc.h>
 #include <sort.h>
 #include <spl.h>
index 67ceb635a67776ef3315e156e5b9e40836a2c1a6..7ffe902b88dd13c06d67035a3eac91047a9aeee5 100644 (file)
@@ -15,6 +15,7 @@
 #include <console.h>
 #include <env.h>
 #include <fdtdec.h>
+#include <hang.h>
 #include <malloc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index ceca992510762d1b2cea8df922f8d5310cfb1ce0..0d8bf244be220e02beccc0741847d2f45d5ca285 100644 (file)
@@ -469,7 +469,7 @@ int cmd_get_data_size(char* arg, int default_size)
                        return 2;
                case 'l':
                        return 4;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                case 'q':
                        return 8;
 #endif
index efe8f53de6644ce2735313cd8f9e74ca37ee7ce4..5f155aefd1d36e81cbee1e1bce6932e141cde278 100644 (file)
@@ -179,7 +179,7 @@ flash_write (char *src, ulong addr, ulong cnt)
 /*-----------------------------------------------------------------------
  */
 
-void flash_perror (int err)
+void flash_perror(int err)
 {
        switch (err) {
        case ERR_OK:
diff --git a/common/image-cipher.c b/common/image-cipher.c
new file mode 100644 (file)
index 0000000..cee3b03
--- /dev/null
@@ -0,0 +1,167 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2019, Softathome
+ */
+
+#ifdef USE_HOSTCC
+#include "mkimage.h"
+#include <time.h>
+#else
+#include <common.h>
+#include <malloc.h>
+DECLARE_GLOBAL_DATA_PTR;
+#endif /* !USE_HOSTCC*/
+#include <image.h>
+#include <uboot_aes.h>
+#include <u-boot/aes.h>
+
+struct cipher_algo cipher_algos[] = {
+       {
+               .name = "aes128",
+               .key_len = AES128_KEY_LENGTH,
+               .iv_len  = AES_BLOCK_LENGTH,
+#if IMAGE_ENABLE_ENCRYPT
+               .calculate_type = EVP_aes_128_cbc,
+#endif
+               .encrypt = image_aes_encrypt,
+               .decrypt = image_aes_decrypt,
+               .add_cipher_data = image_aes_add_cipher_data
+       },
+       {
+               .name = "aes192",
+               .key_len = AES192_KEY_LENGTH,
+               .iv_len  = AES_BLOCK_LENGTH,
+#if IMAGE_ENABLE_ENCRYPT
+               .calculate_type = EVP_aes_192_cbc,
+#endif
+               .encrypt = image_aes_encrypt,
+               .decrypt = image_aes_decrypt,
+               .add_cipher_data = image_aes_add_cipher_data
+       },
+       {
+               .name = "aes256",
+               .key_len = AES256_KEY_LENGTH,
+               .iv_len  = AES_BLOCK_LENGTH,
+#if IMAGE_ENABLE_ENCRYPT
+               .calculate_type = EVP_aes_256_cbc,
+#endif
+               .encrypt = image_aes_encrypt,
+               .decrypt = image_aes_decrypt,
+               .add_cipher_data = image_aes_add_cipher_data
+       }
+};
+
+struct cipher_algo *image_get_cipher_algo(const char *full_name)
+{
+       int i;
+       const char *name;
+
+       for (i = 0; i < ARRAY_SIZE(cipher_algos); i++) {
+               name = cipher_algos[i].name;
+               if (!strncmp(name, full_name, strlen(name)))
+                       return &cipher_algos[i];
+       }
+
+       return NULL;
+}
+
+static int fit_image_setup_decrypt(struct image_cipher_info *info,
+                                  const void *fit, int image_noffset,
+                                  int cipher_noffset)
+{
+       const void *fdt = gd_fdt_blob();
+       const char *node_name;
+       char node_path[128];
+       int noffset;
+       char *algo_name;
+       int ret;
+
+       node_name = fit_get_name(fit, image_noffset, NULL);
+       if (!node_name) {
+               printf("Can't get node name\n");
+               return -1;
+       }
+
+       if (fit_image_cipher_get_algo(fit, cipher_noffset, &algo_name)) {
+               printf("Can't get algo name for cipher '%s' in image '%s'\n",
+                      node_name, node_name);
+               return -1;
+       }
+
+       info->keyname = fdt_getprop(fit, cipher_noffset, "key-name-hint", NULL);
+       if (!info->keyname) {
+               printf("Can't get key name\n");
+               return -1;
+       }
+
+       info->ivname = fdt_getprop(fit, cipher_noffset, "iv-name-hint", NULL);
+       if (!info->ivname) {
+               printf("Can't get IV name\n");
+               return -1;
+       }
+
+       info->fit = fit;
+       info->node_noffset = image_noffset;
+       info->name = algo_name;
+       info->cipher = image_get_cipher_algo(algo_name);
+       if (!info->cipher) {
+               printf("Can't get cipher\n");
+               return -1;
+       }
+
+       ret = fit_image_get_data_size_unciphered(fit, image_noffset,
+                                                &info->size_unciphered);
+       if (ret) {
+               printf("Can't get size of unciphered data\n");
+               return -1;
+       }
+
+       /*
+        * Search the cipher node in the u-boot fdt
+        * the path should be: /cipher/key-<algo>-<key>-<iv>
+        */
+       snprintf(node_path, sizeof(node_path), "/%s/key-%s-%s-%s",
+                FIT_CIPHER_NODENAME, algo_name, info->keyname, info->ivname);
+
+       noffset = fdt_path_offset(fdt, node_path);
+       if (noffset < 0) {
+               printf("Can't found cipher node offset\n");
+               return -1;
+       }
+
+       /* read key */
+       info->key = fdt_getprop(fdt, noffset, "key", NULL);
+       if (!info->key) {
+               printf("Can't get key in cipher node '%s'\n", node_path);
+               return -1;
+       }
+
+       /* read iv */
+       info->iv = fdt_getprop(fdt, noffset, "iv", NULL);
+       if (!info->iv) {
+               printf("Can't get IV in cipher node '%s'\n", node_path);
+               return -1;
+       }
+
+       return 0;
+}
+
+int fit_image_decrypt_data(const void *fit,
+                          int image_noffset, int cipher_noffset,
+                          const void *data_ciphered, size_t size_ciphered,
+                          void **data_unciphered, size_t *size_unciphered)
+{
+       struct image_cipher_info info;
+       int ret;
+
+       ret = fit_image_setup_decrypt(&info, fit, image_noffset,
+                                     cipher_noffset);
+       if (ret < 0)
+               goto out;
+
+       ret = info.cipher->decrypt(&info, data_ciphered, size_ciphered,
+                                  data_unciphered, size_unciphered);
+
+ out:
+       return ret;
+}
index 48388488d98defeeabd7641000d68f517aaf6a1f..dbb1e6e131c8e06c745320a6b27eb8d9b435b462 100644 (file)
@@ -285,7 +285,8 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
        *of_flat_tree = NULL;
        *of_size = 0;
 
-       img_addr = (argc == 0) ? load_addr : simple_strtoul(argv[0], NULL, 16);
+       img_addr = (argc == 0) ? image_load_addr :
+                       simple_strtoul(argv[0], NULL, 16);
        buf = map_sysmem(img_addr, 0);
 
        if (argc > 2)
@@ -304,7 +305,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
                        else if (images->fit_uname_os)
                                default_addr = (ulong)images->fit_hdr_os;
                        else
-                               default_addr = load_addr;
+                               default_addr = image_load_addr;
 
                        if (fit_parse_conf(select, default_addr,
                                           &fdt_addr, &fit_uname_config)) {
index 231612ff5f01a85c8b2efdf4c9d47dace10eccc1..f3bb00c98a55d966c3e68869bd180db8a6fefcc9 100644 (file)
@@ -947,6 +947,31 @@ int fit_image_get_data_size(const void *fit, int noffset, int *data_size)
        return 0;
 }
 
+/**
+ * Get 'data-size-unciphered' property from a given image node.
+ *
+ * @fit: pointer to the FIT image header
+ * @noffset: component image node offset
+ * @data_size: holds the data-size property
+ *
+ * returns:
+ *     0, on success
+ *     -ENOENT if the property could not be found
+ */
+int fit_image_get_data_size_unciphered(const void *fit, int noffset,
+                                      size_t *data_size)
+{
+       const fdt32_t *val;
+
+       val = fdt_getprop(fit, noffset, "data-size-unciphered", NULL);
+       if (!val)
+               return -ENOENT;
+
+       *data_size = (size_t)fdt32_to_cpu(*val);
+
+       return 0;
+}
+
 /**
  * fit_image_get_data_and_size - get data and its size including
  *                              both embedded and external data
@@ -1080,6 +1105,33 @@ static int fit_image_hash_get_ignore(const void *fit, int noffset, int *ignore)
        return 0;
 }
 
+/**
+ * fit_image_cipher_get_algo - get cipher algorithm name
+ * @fit: pointer to the FIT format image header
+ * @noffset: cipher node offset
+ * @algo: double pointer to char, will hold pointer to the algorithm name
+ *
+ * fit_image_cipher_get_algo() finds cipher algorithm property in a given
+ * cipher node. If the property is found its data start address is returned
+ * to the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_cipher_get_algo(const void *fit, int noffset, char **algo)
+{
+       int len;
+
+       *algo = (char *)fdt_getprop(fit, noffset, FIT_ALGO_PROP, &len);
+       if (!*algo) {
+               fit_get_debug(fit, noffset, FIT_ALGO_PROP, len);
+               return -1;
+       }
+
+       return 0;
+}
+
 ulong fit_get_end(const void *fit)
 {
        return map_to_sysmem((void *)(fit + fdt_totalsize(fit)));
@@ -1354,6 +1406,32 @@ int fit_all_image_verify(const void *fit)
        return 1;
 }
 
+#ifdef CONFIG_FIT_CIPHER
+static int fit_image_uncipher(const void *fit, int image_noffset,
+                             void **data, size_t *size)
+{
+       int cipher_noffset, ret;
+       void *dst;
+       size_t size_dst;
+
+       cipher_noffset = fdt_subnode_offset(fit, image_noffset,
+                                           FIT_CIPHER_NODENAME);
+       if (cipher_noffset < 0)
+               return 0;
+
+       ret = fit_image_decrypt_data(fit, image_noffset, cipher_noffset,
+                                    *data, *size, &dst, &size_dst);
+       if (ret)
+               goto out;
+
+       *data = dst;
+       *size = size_dst;
+
+ out:
+       return ret;
+}
+#endif /* CONFIG_FIT_CIPHER */
+
 /**
  * fit_image_check_os - check whether image node is of a given os type
  * @fit: pointer to the FIT format image header
@@ -1954,6 +2032,18 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
                return -ENOENT;
        }
 
+#ifdef CONFIG_FIT_CIPHER
+       /* Decrypt data before uncompress/move */
+       if (IMAGE_ENABLE_DECRYPT) {
+               puts("   Decrypting Data ... ");
+               if (fit_image_uncipher(fit, noffset, &buf, &size)) {
+                       puts("Error\n");
+                       return -EACCES;
+               }
+               puts("OK\n");
+       }
+#endif
+
 #if !defined(USE_HOSTCC) && defined(CONFIG_FIT_IMAGE_POST_PROCESS)
        /* perform any post-processing on the image data */
        board_fit_image_post_process(&buf, &size);
index 75d5dd944ff0487bb0d712b1388c149343ac30fc..2288cff1266132529e462b8112d63796862b5c2a 100644 (file)
@@ -557,9 +557,9 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch,
 /* Shared dual-format routines */
 /*****************************************************************************/
 #ifndef USE_HOSTCC
-ulong load_addr = CONFIG_SYS_LOAD_ADDR;        /* Default Load Address */
-ulong save_addr;                       /* Default Save Address */
-ulong save_size;                       /* Default Save Size (in bytes) */
+ulong image_load_addr = CONFIG_SYS_LOAD_ADDR;  /* Default Load Address */
+ulong image_save_addr;                 /* Default Save Address */
+ulong image_save_size;                 /* Default Save Size (in bytes) */
 
 static int on_loadaddr(const char *name, const char *value, enum env_op op,
        int flags)
@@ -567,7 +567,7 @@ static int on_loadaddr(const char *name, const char *value, enum env_op op,
        switch (op) {
        case env_op_create:
        case env_op_overwrite:
-               load_addr = simple_strtoul(value, NULL, 16);
+               image_load_addr = simple_strtoul(value, NULL, 16);
                break;
        default:
                break;
@@ -936,15 +936,15 @@ ulong genimg_get_kernel_addr_fit(char * const img_addr,
 
        /* find out kernel image address */
        if (!img_addr) {
-               kernel_addr = load_addr;
+               kernel_addr = image_load_addr;
                debug("*  kernel: default image load address = 0x%08lx\n",
-                     load_addr);
+                     image_load_addr);
 #if CONFIG_IS_ENABLED(FIT)
-       } else if (fit_parse_conf(img_addr, load_addr, &kernel_addr,
+       } else if (fit_parse_conf(img_addr, image_load_addr, &kernel_addr,
                                  fit_uname_config)) {
                debug("*  kernel: config '%s' from image at 0x%08lx\n",
                      *fit_uname_config, kernel_addr);
-       } else if (fit_parse_subimage(img_addr, load_addr, &kernel_addr,
+       } else if (fit_parse_subimage(img_addr, image_load_addr, &kernel_addr,
                                     fit_uname_kernel)) {
                debug("*  kernel: subimage '%s' from image at 0x%08lx\n",
                      *fit_uname_kernel, kernel_addr);
@@ -1102,7 +1102,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
                        if (images->fit_uname_os)
                                default_addr = (ulong)images->fit_hdr_os;
                        else
-                               default_addr = load_addr;
+                               default_addr = image_load_addr;
 
                        if (fit_parse_conf(select, default_addr,
                                           &rd_addr, &fit_uname_config)) {
index a94df7ae042ffcb1dafd3e92581481127fc1973e..ec8994ad457b9393afec16a7514cd74186a6226a 100644 (file)
@@ -12,6 +12,7 @@
 #include <command.h>
 #include <console.h>
 #include <env.h>
+#include <init.h>
 #include <version.h>
 
 /*
index 13b004778667f98d15b6f8dfbcbdea808ab0e0a8..e95c68265ab92b0f53ccc75a4216aa70f30b026e 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 19085ad2701d901cb908bbba72d7aa9df28714e1..932e6ab98ac4cd5d4c0fd5263bcc9c54183f1ff6 100644 (file)
@@ -11,6 +11,7 @@
 #include <binman_sym.h>
 #include <dm.h>
 #include <handoff.h>
+#include <hang.h>
 #include <irq_func.h>
 #include <serial.h>
 #include <spl.h>
index 803303249c72c623a886ee3425e95b6c26de330c..30c050c0b3e6c0767bf1d607ab63037f919da7a7 100644 (file)
@@ -19,14 +19,14 @@ static ulong spl_net_load_read(struct spl_load_info *load, ulong sector,
 {
        debug("%s: sector %lx, count %lx, buf %lx\n",
              __func__, sector, count, (ulong)buf);
-       memcpy(buf, (void *)(load_addr + sector), count);
+       memcpy(buf, (void *)(image_load_addr + sector), count);
        return count;
 }
 
 static int spl_net_load_image(struct spl_image_info *spl_image,
                              struct spl_boot_device *bootdev)
 {
-       struct image_header *header = (struct image_header *)load_addr;
+       struct image_header *header = (struct image_header *)image_load_addr;
        int rv;
 
        env_init();
index 6404373ecadfbdd9c713f2209879051aa3cf2159..a136073fdbb4b6e29182c4b28e7a613a467a7001 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <cpu_func.h>
 #include <errno.h>
+#include <hang.h>
 #include <spl.h>
 #include <asm/smp.h>
 #include <opensbi.h>
index 13b09ab00f37f602bbe75c2685c7b1d146e7f0ff..c8dd346a0956951a0683679bdd37d13c07383e60 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <image.h>
 
 #if !(defined(CONFIG_FIT) && defined(CONFIG_OF_LIBFDT))
 #error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature"
@@ -45,7 +46,6 @@
 
 extern ulong tftp_timeout_ms;
 extern int tftp_timeout_count_max;
-extern ulong load_addr;
 #ifdef CONFIG_MTD_NOR_FLASH
 extern flash_info_t flash_info[];
 static uchar *saved_prot_info;
@@ -72,7 +72,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
        env_set("netretry", "no");
 
        /* download the update file */
-       load_addr = addr;
+       image_load_addr = addr;
        copy_filename(net_boot_file_name, filename, sizeof(net_boot_file_name));
        size = net_loop(TFTPGET);
 
index e3aca3607138e90a893bfd83fbda06588160d28f..0aab7ee19147bbd77a215912422ebb2b6fcf46b7 100644 (file)
@@ -4,6 +4,7 @@
  *
  */
 #include <dm.h>
+#include <hang.h>
 #include <wait_bit.h>
 
 #include <asm/io.h>
index d367171b3658be00b2c74a4bf8d85883aafc8e43..1373e7c387d8bce94b5d9723d2df3ee0c9d3db39 100644 (file)
@@ -8,6 +8,7 @@
 #include <command.h>
 #include <cache.h>
 #include <dm.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <dm/ofnode.h>
 
index b3ac0d5a92aad1d63f402789711890cb7231f161..79469c454fe3afe1383a55b6f29f95c772c800da 100644 (file)
@@ -8,6 +8,7 @@
 #include <clk-uclass.h>
 #include <dm.h>
 #include <div64.h>
+#include <time.h>
 #include <wait_bit.h>
 #include <dm/lists.h>
 #include <asm/io.h>
index 69c6207e49a74198204a0308633696a0b5b0fcc1..4183db28455df5e5eb0676222ffe4c1efd428abf 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <clk-uclass.h>
+#include <clock_legacy.h>
 #include <dm.h>
 #include <vsprintf.h>
 #include <dm/lists.h>
index 0cbcd14056070de04efd57978f2a398526b11f97..626fb724d4e557f99218f1a41ee48e64695e8625 100644 (file)
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <div64.h>
 #include <fdtdec.h>
+#include <hang.h>
 #include <ram.h>
 #include <reset.h>
 #include "sdram_soc64.h"
index 435f42bc0ab06525effd5a116bdbe6f06665ced2..a3b914fdfc0632a66967b15bd92c39a4feff2cad 100644 (file)
@@ -6,6 +6,7 @@
 #include <dm.h>
 #include <errno.h>
 #include <div64.h>
+#include <init.h>
 #include <ram.h>
 #include <reset.h>
 #include <watchdog.h>
index 93c15dd18b3a7ef61edd3b91f351ad8460a87f9b..0b36d6c027dd27d3509dbb975cf80a9f3d064bdc 100644 (file)
@@ -10,6 +10,8 @@
 #include <errno.h>
 #include <div64.h>
 #include <fdtdec.h>
+#include <hang.h>
+#include <init.h>
 #include <ram.h>
 #include <reset.h>
 #include "sdram_s10.h"
index 985a108b1c5d893ad28825c935dd89321ec04289..e0d04ccca2812a7cb25aa71dca8c0160e804e421 100644 (file)
@@ -10,6 +10,7 @@
 #include <errno.h>
 #include <div64.h>
 #include <fdtdec.h>
+#include <hang.h>
 #include <ram.h>
 #include <reset.h>
 #include "sdram_soc64.h"
index 74417d61b4c536590956763e2ee215e329f0f443..9293d54e5a0d012ce0a4f587e6e88b494d380fb9 100644 (file)
@@ -6,6 +6,7 @@
 #include "ddr3_init.h"
 #include "mv_ddr_regs.h"
 #include "ddr_training_ip_db.h"
+#include <image.h>
 
 #define PATTERN_1      0x55555555
 #define PATTERN_2      0xaaaaaaaa
@@ -612,9 +613,9 @@ int ddr3_tip_load_pattern_to_odpg(u32 dev_num, enum hws_access_type access_type,
                              MASK_ALL_BITS));
        }
 
-       CHECK_STATUS(ddr3_tip_if_write
-                    (dev_num, access_type, if_id,
-                     ODPG_DATA_BUFFER_OFFS_REG, load_addr, MASK_ALL_BITS));
+       CHECK_STATUS(ddr3_tip_if_write(dev_num, access_type, if_id,
+                                      ODPG_DATA_BUFFER_OFFS_REG,
+                                      image_load_addr, MASK_ALL_BITS));
 
        return MV_OK;
 }
index d4e8638dea1d9cbf29df848695682341888dbd7a..2b843de93ceb823eef41b70ef43207b7c5909387 100644 (file)
@@ -51,7 +51,6 @@ obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o
 obj-$(CONFIG_MPC83XX_SERDES) += mpc83xx_serdes.o
 obj-$(CONFIG_MXC_OCOTP) += mxc_ocotp.o
 obj-$(CONFIG_MXS_OCOTP) += mxs_ocotp.o
-obj-$(CONFIG_NS87308) += ns87308.o
 obj-$(CONFIG_NUVOTON_NCT6102D) += nuvoton_nct6102d.o
 obj-$(CONFIG_P2SB) += p2sb-uclass.o
 obj-$(CONFIG_PCA9551_LED) += pca9551_led.o
index b2fdeef13ab0d991941cc19acf4298ec60e11752..b34191753b1becccc95dc9fd0e009fc2f9025757 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <dm.h>
 #include <asm/arch/sci/sci.h>
diff --git a/drivers/misc/ns87308.c b/drivers/misc/ns87308.c
deleted file mode 100644 (file)
index f5de332..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2000
- * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
- */
-
-#include <config.h>
-
-#include <ns87308.h>
-
-void initialise_ns87308 (void)
-{
-#ifdef CONFIG_SYS_NS87308_PS2MOD
-       unsigned char data;
-
-       /*
-        * Switch floppy drive to PS/2 mode.
-        */
-       read_pnp_config(SUPOERIO_CONF1, &data);
-       data &= 0xFB;
-       write_pnp_config(SUPOERIO_CONF1, data);
-#endif
-
-#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_KBC1)
-       PNP_SET_DEVICE_BASE(LDEV_KBC1, CONFIG_SYS_NS87308_KBC1_BASE);
-       write_pnp_config(LUN_CONFIG_REG, 0);
-       write_pnp_config(CBASE_HIGH, 0x00);
-       write_pnp_config(CBASE_LOW, 0x64);
-#endif
-
-#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_MOUSE)
-       PNP_ACTIVATE_DEVICE(LDEV_MOUSE);
-#endif
-
-#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_RTC_APC)
-       PNP_SET_DEVICE_BASE(LDEV_RTC_APC, CONFIG_SYS_NS87308_RTC_BASE);
-#endif
-
-#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_FDC)
-       PNP_SET_DEVICE_BASE(LDEV_FDC, CONFIG_SYS_NS87308_FDC_BASE);
-       write_pnp_config(LUN_CONFIG_REG, 0x40);
-#endif
-
-#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_RARP)
-       PNP_SET_DEVICE_BASE(LDEV_PARP, CONFIG_SYS_NS87308_LPT_BASE);
-#endif
-
-#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_UART1)
-       PNP_SET_DEVICE_BASE(LDEV_UART1, CONFIG_SYS_NS87308_UART1_BASE);
-#endif
-
-#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_UART2)
-       PNP_SET_DEVICE_BASE(LDEV_UART2, CONFIG_SYS_NS87308_UART2_BASE);
-#endif
-
-#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_GPIO)
-       PNP_SET_DEVICE_BASE(LDEV_GPIO, CONFIG_SYS_NS87308_GPIO_BASE);
-#endif
-
-#if (CONFIG_SYS_NS87308_DEVS & CONFIG_SYS_NS87308_POWRMAN)
-#ifndef CONFIG_SYS_NS87308_PWMAN_BASE
-       PNP_ACTIVATE_DEVICE(LDEV_POWRMAN);
-#else
-       PNP_SET_DEVICE_BASE(LDEV_POWRMAN, CONFIG_SYS_NS87308_PWMAN_BASE);
-
-       /*
-        * Enable all units
-        */
-       write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_FER1, 0x7d);
-       write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_FER2, 0x87);
-
-#ifdef CONFIG_SYS_NS87308_PMC1
-       write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC1, CONFIG_SYS_NS87308_PMC1);
-#endif
-
-#ifdef CONFIG_SYS_NS87308_PMC2
-       write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC2, CONFIG_SYS_NS87308_PMC2);
-#endif
-
-#ifdef CONFIG_SYS_NS87308_PMC3
-       write_pm_reg(CONFIG_SYS_NS87308_PWMAN_BASE, PWM_PMC3, CONFIG_SYS_NS87308_PMC3);
-#endif
-#endif
-#endif
-
-#ifdef CONFIG_SYS_NS87308_CS0_BASE
-       PNP_PGCS_CSLINE_BASE(0, CONFIG_SYS_NS87308_CS0_BASE);
-       PNP_PGCS_CSLINE_CONF(0, CONFIG_SYS_NS87308_CS0_CONF);
-#endif
-
-#ifdef CONFIG_SYS_NS87308_CS1_BASE
-       PNP_PGCS_CSLINE_BASE(1, CONFIG_SYS_NS87308_CS1_BASE);
-       PNP_PGCS_CSLINE_CONF(1, CONFIG_SYS_NS87308_CS1_CONF);
-#endif
-
-#ifdef CONFIG_SYS_NS87308_CS2_BASE
-       PNP_PGCS_CSLINE_BASE(2, CONFIG_SYS_NS87308_CS2_BASE);
-       PNP_PGCS_CSLINE_CONF(2, CONFIG_SYS_NS87308_CS2_CONF);
-#endif
-}
index 3021c3d6d4f6c6eb2698df9911980b2e161cb8e5..afe55fad9de6fa7c845bdbb81213e18d6b7338cc 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <hang.h>
 #include <mmc.h>
 #include <malloc.h>
 
index 6c03db8428f65d42fad0ec88cf879212c2da7033..e1e542519d816e6a4d702c947bfe4eb3cbee906d 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <nand.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/io.h>
index 580b1e24b736c2cddf0e549143a215dd62483756..5c41d7558c2449bd271aae0a1faea99c461a8146 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <hang.h>
 #include <spi_flash.h>
 #include <malloc.h>
 
index 804d5c20b6463d8c3e627511b006e5d7072c8013..e3a7222efba94ae14fe6a2d1fd15ed24ad7fef45 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
index 7838fb5c10a75df103fbc9bf10a5ee509f2d702b..45954cecb6b6a9fa0d76f59815a3a710d6495f51 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <hang.h>
 #include <malloc.h>
 #include <command.h>
 #include <config.h>
index 4ec24362d067981e1c7656ed2aca6ff91ab7bf74..8caf0ba6b1ca3b3dbbabff2b6de37901aa5e50f8 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <env.h>
+#include <hang.h>
 #include <malloc.h>
 #include <command.h>
 #include <net.h>
index 0a8098519226abc51460c10fa5e5c873cfca23ed..69b2174ab3d676280f38083026977804da53b202 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <hang.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
index 1d4064e3769281537cbd563f0f903555c5c3e435..90f224b045234ef5b4117da0562b3481e608999b 100644 (file)
@@ -26,6 +26,7 @@
 #include <bios_emul.h>
 #include <dm.h>
 #include <errno.h>
+#include <init.h>
 #include <malloc.h>
 #include <pci.h>
 #include <pci_rom.h>
index 3e1dd9e24101300b017866b61e07e18c07b92a2d..8f953e79afd791a55a4f02a26184dbbda6678687 100644 (file)
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <init.h>
 #include <ram.h>
 #include <asm/io.h>
 
index 9feb0aa766e519814fc5e27e2226113261e423fd..a9b7d40890b3cc9c004f28a39b163a3ace82c23d 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
+#include <hang.h>
 #include <ram.h>
 #include <asm/io.h>
 #include <power-domain.h>
index f03d0428b2aca57028356620edc564abf48da944..46449d3d1229eb22ad5c08cfd91567fb1846241b 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <init.h>
 #include <ram.h>
 #include <dt-bindings/memory/mpc83xx-sdram.h>
 
index 9df8f8f4af009e6315b997cf1a2ec7386c4cfa9c..8addee8cc30e03d39e61a5f1f378373c2e39e466 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
+#include <hang.h>
 #include <dt-bindings/memory/rk3368-dmc.h>
 #include <dt-structs.h>
 #include <ram.h>
index d3e4316ef019b44ef3efafaa9023f037315b8144..9b5eb38eccd423d7bf6c62116e0185bcb3a1b066 100644 (file)
@@ -11,6 +11,7 @@
 #include <dm.h>
 #include <dt-structs.h>
 #include <errno.h>
+#include <hang.h>
 #include <ram.h>
 #include <regmap.h>
 #include <syscon.h>
index 690751d0747eb3ea01174db1b3e5a153690bedbe..3eb14cdb32c079979122a6dfaeacc4363bde28fd 100644 (file)
@@ -11,6 +11,7 @@
 #include <dm.h>
 #include <dt-structs.h>
 #include <errno.h>
+#include <hang.h>
 #include <ram.h>
 #include <regmap.h>
 #include <syscon.h>
index a362cf98bfcb902d8fee09fb409d815b2eb5b700..eb78f1198d727dceafb0322f9651d8ba96cf713a 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
+#include <init.h>
 #include <ram.h>
 #include <regmap.h>
 #include <syscon.h>
index 581ee4897f20efffa378faf8c0442459fd16ed82..12298cf327362c0a4f352f59a9691ced7d2e3039 100644 (file)
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <console.h>
+#include <init.h>
 #include <watchdog.h>
 #include <asm/io.h>
 #include <linux/log2.h>
index 8b0fd254b1b2aaf70244d9b10ca44c21a84e90f2..7d31c6d4a145b4f3fa104fed3a1d408155e641cb 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <dm.h>
 #include <serial.h>
 #include <dm/platform_data/lpc32xx_hsuart.h>
index 754b6e99215822190b1b2eecb7c592302895904b..a92d2b1de882f05c570377610b6ca74fed3524f9 100644 (file)
@@ -4,6 +4,7 @@
  * modified to use CONFIG_SYS_ISA_MEM and new defines
  */
 
+#include <clock_legacy.h>
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
index bf5f39215d1df9521e270399fb69dea5450b7b3f..baeaeaac8ea2fa236503358f2162776c6c96b55a 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <env_internal.h>
+#include <hang.h>
 #include <serial.h>
 #include <stdio_dev.h>
 #include <post.h>
index 5249c553987112e07a61e925b18ce2fe73641c24..897ea5d6dc2700f728568edb16c782ea1e21239e 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <dm.h>
 #include <div64.h>
 #include <errno.h>
index 5afe620b9fc434612999bc52c70d6d8affe7a4d7..ef394b72350915bdc247c812c693b32cd80c8187 100644 (file)
@@ -5,14 +5,10 @@
  */
 
 #include <common.h>
-#include <linux/compiler.h>
-
+#include <clock_legacy.h>
 #include <ns16550.h>
-#ifdef CONFIG_NS87308
-#include <ns87308.h>
-#endif
-
 #include <serial.h>
+#include <linux/compiler.h>
 
 #ifndef CONFIG_NS16550_MIN_FUNCTIONS
 
index cf4d8f64427240d03d12def7b43e991a29074070..6f8f7e1198ae87af1381ad14d0163e3897f110c0 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/regs-uart.h>
 #include <asm/io.h>
index 0b8ebaabe9bb4088c63821c4718b594bb8c4e1b1..f64a28c6e0bdfe10d13e50b5148092e3f2389673 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <clock_legacy.h>
 #include <spi.h>
 #include <dm.h>
 #include <div64.h>
index 39202588ae4f409dcaa251de22d06c410e2cfd0b..51fdb1055e3b36c17933c45d1716222adfe98a0e 100644 (file)
@@ -7,6 +7,8 @@
 #define LOG_CATEGORY UCLASS_SYSRESET
 
 #include <common.h>
+#include <cpu_func.h>
+#include <hang.h>
 #include <sysreset.h>
 #include <dm.h>
 #include <errno.h>
index bcd1c5d47c107d2c06fdabdb44fd2e73d405434c..50836db4a04563bc634269165fb1789dee177e0f 100644 (file)
@@ -726,7 +726,7 @@ static void sdp_handle_in_ep(struct spl_image_info *spl_image)
                        jump_to_image_no_args(&spl_image);
 #else
                        /* In U-Boot, allow jumps to scripts */
-                       source(sdp_func->jmp_address, "script@1");
+                       image_source_script(sdp_func->jmp_address, "script@1");
 #endif
                }
 
index 584564bac2b04e69c8ee8a61392d73be4fce423d..4d7723621d0b3b08c902c3a86acfe11856eec8d8 100644 (file)
@@ -38,6 +38,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <serial.h>
 #include <usbdevice.h>
 #include <usb/udc.h>
index 69e408b6c1bc61c55096824eb1aa06970acd3737..ec998901ab9b82446771228ba2f479d63d417f46 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <asm/io.h>
 
 #include "../gadget/dwc2_udc_otg_priv.h"
index e6df037cb93c653dbe755c7fe558fcc651fcb12e..c23421d25be7057556d542510cef875be7367c4c 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <bios_emul.h>
 #include <dm.h>
+#include <init.h>
 #include <vbe.h>
 #include <video.h>
 #include <asm/cpu.h>
index c030360c219ca5c99e870be8719e0f303ffa1904..01762df019bfd2def99ef5382dbe858d5aa9b79f 100644 (file)
@@ -5,7 +5,9 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
+#include <hang.h>
 #include <asm/io.h>
 #include <wdt.h>
 #include <watchdog.h>
index dafd2b56a8e51dc71280fcb7d0b86843c6e1e946..669a32320d44cd5443ab9556eec72682e8fe0ed9 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <hang.h>
 #include <wdt.h>
 #include <asm/io.h>
 
index 313019f152b976780cfd5f47b7432c4c6a15a71a..7533fc612c797524fcb8ec33353829a497c36a99 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 
index bbfac4f0f9b4a189b39a55c176a540a46e0cbc19..cf1c52747397ff9e3f253caf1a7a89b2ae55e2d7 100644 (file)
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <hang.h>
 #include <wdt.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
index b487e6701ef82632372cbff55f307362112ceb09..e05f7ef74b9ba0de90c9e92f38ab83dd0b7e6bf9 100644 (file)
@@ -13,6 +13,7 @@
 #include <command.h>
 #include <env.h>
 #include <env_internal.h>
+#include <flash.h>
 #include <linux/stddef.h>
 #include <malloc.h>
 #include <search.h>
index 67b2d641fc7c19de09dc15dd78bbf09f554697b7..769dcc7038523b464c6ff0aa0a2b430f042a53cf 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #include <linux/types.h>
 #include <api_public.h>
 
@@ -41,7 +42,7 @@ void *malloc (size_t len)
        return NULL;
 }
 
-void hang (void)
+void hang(void)
 {
        while (1) ;
 }
diff --git a/include/clock_legacy.h b/include/clock_legacy.h
new file mode 100644 (file)
index 0000000..b0a8333
--- /dev/null
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ */
+
+#ifndef __CLOCK_LEGACY_H
+#define __CLOCK_LEGACY_H
+
+int get_clocks(void);
+unsigned long get_bus_freq(unsigned long dummy);
+int get_serial_clock(void);
+
+#endif
index 52c02185f40e0ead25d761ed1c685a56de33f74a..0ef8505fc79326359b59a4b52cb10f413e749b1f 100644 (file)
@@ -2,9 +2,8 @@
 /*
  * Common header file for U-Boot
  *
- * This file still includes quite a bit of stuff that should be in separate
- * headers. Please think before adding more things.
- * Patches to remove things are welcome.
+ * This file still includes quite a few headers that should be included
+ * individually as needed. Patches to remove things are welcome.
  *
  * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #define __COMMON_H_    1
 
 #ifndef __ASSEMBLY__           /* put C only stuff in this section */
-
-typedef volatile unsigned long vu_long;
-typedef volatile unsigned short vu_short;
-typedef volatile unsigned char vu_char;
-
 #include <config.h>
 #include <errno.h>
 #include <time.h>
@@ -34,159 +28,20 @@ typedef volatile unsigned char     vu_char;
 #include <stdarg.h>
 #include <stdio.h>
 #include <linux/kernel.h>
-
 #include <part.h>
 #include <flash.h>
 #include <image.h>
-
-#ifdef __LP64__
-#define CONFIG_SYS_SUPPORT_64BIT_DATA
-#endif
-
 #include <log.h>
-
 #include <asm/u-boot.h> /* boot information for Linux kernel */
 #include <asm/global_data.h>   /* global data used for startup functions */
-
-/* startup functions, used in:
- * common/board_f.c
- * common/init/board_init.c
- * common/board_r.c
- * common/board_info.c
- */
 #include <init.h>
-
-/*
- * Function Prototypes
- */
-void   hang            (void) __attribute__ ((noreturn));
-
 #include <display_options.h>
-
-/* common/main.c */
-void   main_loop       (void);
-
-int checkflash(void);
-int checkdram(void);
-extern u8 __dtb_dt_begin[];    /* embedded device tree blob */
-extern u8 __dtb_dt_spl_begin[];        /* embedded device tree blob for SPL/TPL */
-int mdm_init(void);
-
-/**
- * arch_fixup_fdt() - Write arch-specific information to fdt
- *
- * Defined in arch/$(ARCH)/lib/bootm-fdt.c
- *
- * @blob:      FDT blob to write to
- * @return 0 if ok, or -ve FDT_ERR_... on failure
- */
-int arch_fixup_fdt(void *blob);
-
-/* common/flash.c */
-void flash_perror (int);
-
-/* common/cmd_source.c */
-int    source (ulong addr, const char *fit_uname);
-
-extern ulong load_addr;                /* Default Load Address */
-extern ulong save_addr;                /* Default Save Address */
-extern ulong save_size;                /* Default Save Size */
-
-/* common/cmd_net.c */
-int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
-
-/* common/cmd_fat.c */
-int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);
-
-/* common/cmd_ext2.c */
-int do_ext2load(cmd_tbl_t *, int, int, char * const []);
-
-/* common/exports.c */
-void   jumptable_init(void);
-
-/* common/kallsysm.c */
-const char *symbol_lookup(unsigned long addr, unsigned long *caddr);
-
-/* common/memsize.c */
-long   get_ram_size  (long *, long);
-phys_size_t get_effective_memsize(void);
-
-/* $(BOARD)/$(BOARD).c */
-void   reset_phy     (void);
-void   fdc_hw_init   (void);
-
-#if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR)
-# define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR
-#endif
-
-#if defined(CONFIG_SYS_DRAM_TEST)
-int testdram(void);
-#endif /* CONFIG_SYS_DRAM_TEST */
-
-#if defined(CONFIG_ARM)
-void   relocate_code(ulong);
-#else
-void   relocate_code(ulong, gd_t *, ulong) __attribute__ ((noreturn));
-#endif
-
-void s_init(void);
-
-void   upmconfig     (unsigned int, unsigned int *, unsigned int);
-ulong  get_tbclk     (void);
-void   reset_misc    (void);
-void   reset_cpu     (ulong addr);
-void ft_cpu_setup(void *blob, bd_t *bd);
-void ft_pci_setup(void *blob, bd_t *bd);
-
-/* $(CPU)/speed.c */
-int    get_clocks (void);
-ulong  get_bus_freq  (ulong);
-int get_serial_clock(void);
-
-/* lib/uuid.c */
 #include <uuid.h>
-
-/* lib/vsprintf.c */
 #include <vsprintf.h>
-
-/* lib/net_utils.c */
 #include <net.h>
-
 #include <bootstage.h>
-
-#else  /* __ASSEMBLY__ */
-
 #endif /* __ASSEMBLY__ */
 
-/* Put only stuff here that the assembler can digest */
-
-#ifdef CONFIG_POST
-#define CONFIG_HAS_POST
-#ifndef CONFIG_POST_ALT_LIST
-#define CONFIG_POST_STD_LIST
-#endif
-#endif
-
-#define ROUND(a,b)             (((a) + (b) - 1) & ~((b) - 1))
-
-/*
- * check_member() - Check the offset of a structure member
- *
- * @structure: Name of structure (e.g. global_data)
- * @member:    Name of member (e.g. baudrate)
- * @offset:    Expected offset in bytes
- */
-#define check_member(structure, member, offset) _Static_assert( \
-       offsetof(struct structure, member) == offset, \
-       "`struct " #structure "` offset for `" #member "` is not " #offset)
-
-/* Avoid using CONFIG_EFI_STUB directly as we may boot from other loaders */
-#ifdef CONFIG_EFI_STUB
-#define ll_boot_init() false
-#else
-#define ll_boot_init() true
-#endif
-
 /* Pull in stuff for the build system */
 #ifdef DO_DEPS_ONLY
 # include <env_internal.h>
index 90372f239c0938355176153de063a8546486a757..ed74c272b8c507b99e234369a81bf047a7ab9fc9 100644 (file)
@@ -144,4 +144,8 @@ typedef unsigned long int uintptr_t;
 #define likely(x)      __builtin_expect(!!(x), 1)
 #define unlikely(x)    __builtin_expect(!!(x), 0)
 
+#ifdef __LP64__
+#define MEM_SUPPORT_64BIT_DATA
+#endif
+
 #endif
index 46f3d92459b73d99b20376c65be5eab2bc41b5e4..f701f02bfef0b5258d1451e7d9c40084244e7771 100644 (file)
@@ -83,5 +83,7 @@ enum {
  * @param flags                Flags to control what is done
  */
 int cleanup_before_linux_select(int flags);
+
+void reset_cpu(ulong addr);
 ;
 #endif
index 61eb826a7345994b20f57b23b3b311f8edc390f4..79118eb83ded490d6779cff6062347fa6f446268 100644 (file)
@@ -21,4 +21,8 @@ int eeprom_write(uint dev_addr, uint offset, uchar *buffer, uint cnt);
 #define eeprom_write(dev_addr, offset, buffer, cnt) ((void)-ENOSYS)
 #endif
 
+#if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR)
+# define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR
+#endif
+
 #endif
index 35f463287fb0950a8ede3e7a1e3aa299b44a73c6..cbd16fc5185ea68675c323b511bb0bc7366c238c 100644 (file)
@@ -13,6 +13,9 @@
 
 struct spi_slave;
 
+/* Set up the jump table for use by the API */
+void jumptable_init(void);
+
 /* These are declarations of exported functions available in C code */
 unsigned long get_version(void);
 int  getc(void);
index 3f4bc643d4453b394523a082c5dea65b118c162f..ba14acd7f622b75de4cb4dadce6540e993c36d38 100644 (file)
 #include <asm/u-boot.h>
 #include <linux/libfdt.h>
 
+/**
+ * arch_fixup_fdt() - Write arch-specific information to fdt
+ *
+ * Defined in arch/$(ARCH)/lib/bootm-fdt.c
+ *
+ * @blob:      FDT blob to write to
+ * @return 0 if ok, or -ve FDT_ERR_... on failure
+ */
+int arch_fixup_fdt(void *blob);
+
+void ft_cpu_setup(void *blob, bd_t *bd);
+
+void ft_pci_setup(void *blob, bd_t *bd);
+
 u32 fdt_getprop_u32_default_node(const void *fdt, int off, int cell,
                                const char *prop, const u32 dflt);
 u32 fdt_getprop_u32_default(const void *fdt, const char *path,
index 696e0fd024d5d1ca972401e9aa651e30da439742..c8a143db5f161f6a789a9cc6e43ee35c30d85834 100644 (file)
@@ -111,6 +111,9 @@ struct fdt_pci_addr {
        u32     phys_lo;
 };
 
+extern u8 __dtb_dt_begin[];    /* embedded device tree blob */
+extern u8 __dtb_dt_spl_begin[];        /* embedded device tree blob for SPL/TPL */
+
 /**
  * Compute the size of a resource.
  *
index 807800b524e9abfafabfb132f7523a9a71cd76e3..2655c72087fbea46cf3cf2a8c7ac7ad67c98044c 100644 (file)
@@ -117,6 +117,13 @@ extern int jedec_flash_match(flash_info_t *info, ulong base);
 #define CFI_CMDSET_AMD_LEGACY          0xFFF0
 #endif
 
+/**
+ * flash_perror() - Print a flash error
+ *
+ * @err: Error number of message to print (ERR_... as below)
+ */
+void flash_perror(int err);
+
 /*-----------------------------------------------------------------------
  * return codes from flash_write():
  */
index 742a535b5f010675256f4a855df0509d3449142a..37e35c21206e96a1dac5320f28295cc92a595e15 100644 (file)
 #define FS_TYPE_UBIFS  4
 #define FS_TYPE_BTRFS  5
 
+/**
+ * do_fat_fsload - Run the fatload command
+ *
+ * @cmdtp: Command information for fatload
+ * @flag: Command flags (CMD_FLAG_...)
+ * @argc: Number of arguments
+ * @argv: List of arguments
+ * @return result (see enum command_ret_t)
+ */
+int do_fat_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]);
+
+/**
+ * do_ext2load - Run the ext2load command
+ *
+ * @cmdtp: Command information for ext2load
+ * @flag: Command flags (CMD_FLAG_...)
+ * @argc: Number of arguments
+ * @argv: List of arguments
+ * @return result (see enum command_ret_t)
+ */
+int do_ext2load(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]);
+
 /*
  * Tell the fs layer which block device an partition to use for future
  * commands. This also internally identifies the filesystem that is present
diff --git a/include/hang.h b/include/hang.h
new file mode 100644 (file)
index 0000000..27cda49
--- /dev/null
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ */
+
+#ifndef __HANG_H
+#define __HANG_H
+
+#ifndef __ASSEMBLY__
+/**
+ * hang() - Print a message and stop execution
+ *
+ * This shows a 'hang' message where possible and then goes into an infinite
+ * loop. This is called by panic() if CONFIG_PANIC_HANG is enabled.
+ *
+ * This function does not return.
+ */
+void hang(void) __attribute__ ((noreturn));
+#endif
+
+#endif
index 4a280b78e748ebe49f4c74a4ab60b160ec8b37e2..9c6b6d6054b9964c2153aaa5b5ebb6151ce004bf 100644 (file)
@@ -112,6 +112,10 @@ struct fdt_region;
 # define IMAGE_OF_SYSTEM_SETUP 0
 #endif
 
+extern ulong image_load_addr;          /* Default Load Address */
+extern ulong image_save_addr;          /* Default Save Address */
+extern ulong image_save_size;          /* Default Save Size */
+
 enum ih_category {
        IH_ARCH,
        IH_COMP,
@@ -670,6 +674,18 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
                   int arch, int image_type, int bootstage_id,
                   enum fit_load_op load_op, ulong *datap, ulong *lenp);
 
+/**
+ * image_source_script() - Execute a script
+ *
+ * Executes a U-Boot script at a particular address in memory. The script should
+ * have a header (FIT or legacy) with the script type (IH_TYPE_SCRIPT).
+ *
+ * @addr: Address of script
+ * @fit_uname: FIT subimage name
+ * @return result code (enum command_ret_t)
+ */
+int image_source_script(ulong addr, const char *fit_uname);
+
 #ifndef USE_HOSTCC
 /**
  * fit_get_node_from_config() - Look up an image a FIT by type
@@ -930,6 +946,10 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
 #define FIT_IGNORE_PROP                "uboot-ignore"
 #define FIT_SIG_NODENAME       "signature"
 
+/* cipher node */
+#define FIT_CIPHER_NODENAME    "cipher"
+#define FIT_ALGO_PROP          "algo"
+
 /* image node */
 #define FIT_DATA_PROP          "data"
 #define FIT_DATA_POSITION_PROP "data-position"
@@ -1019,6 +1039,8 @@ int fit_image_get_data_offset(const void *fit, int noffset, int *data_offset);
 int fit_image_get_data_position(const void *fit, int noffset,
                                int *data_position);
 int fit_image_get_data_size(const void *fit, int noffset, int *data_size);
+int fit_image_get_data_size_unciphered(const void *fit, int noffset,
+                                      size_t *data_size);
 int fit_image_get_data_and_size(const void *fit, int noffset,
                                const void **data, size_t *size);
 
@@ -1028,6 +1050,10 @@ int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value,
 
 int fit_set_timestamp(void *fit, int noffset, time_t timestamp);
 
+int fit_cipher_data(const char *keydir, void *keydest, void *fit,
+                   const char *comment, int require_keys,
+                   const char *engine_id, const char *cmdname);
+
 /**
  * fit_add_verification_data() - add verification data to FIT image nodes
  *
@@ -1058,6 +1084,7 @@ int fit_image_verify_with_data(const void *fit, int image_noffset,
 int fit_image_verify(const void *fit, int noffset);
 int fit_config_verify(const void *fit, int conf_noffset);
 int fit_all_image_verify(const void *fit);
+int fit_config_decrypt(const void *fit, int conf_noffset);
 int fit_image_check_os(const void *fit, int noffset, uint8_t os);
 int fit_image_check_arch(const void *fit, int noffset, uint8_t arch);
 int fit_image_check_type(const void *fit, int noffset, uint8_t type);
@@ -1138,6 +1165,7 @@ struct image_sign_info {
        const char *require_keys;       /* Value for 'required' property */
        const char *engine_id;          /* Engine to use for signing */
 };
+
 #endif /* Allow struct image_region to always be defined for rsa.h */
 
 /* A part of an image, used for hashing */
@@ -1284,6 +1312,11 @@ int fit_image_verify_required_sigs(const void *fit, int image_noffset,
 int fit_image_check_sig(const void *fit, int noffset, const void *data,
                size_t size, int required_keynode, char **err_msgp);
 
+int fit_image_decrypt_data(const void *fit,
+                          int image_noffset, int cipher_noffset,
+                          const void *data, size_t size,
+                          void **data_unciphered, size_t *size_unciphered);
+
 /**
  * fit_region_make_list() - Make a list of regions to hash
  *
@@ -1310,6 +1343,64 @@ static inline int fit_image_check_target_arch(const void *fdt, int node)
 #endif
 }
 
+/*
+ * At present we only support ciphering on the host, and unciphering on the
+ * device
+ */
+#if defined(USE_HOSTCC)
+# if defined(CONFIG_FIT_CIPHER)
+#  define IMAGE_ENABLE_ENCRYPT 1
+#  define IMAGE_ENABLE_DECRYPT 1
+#  include <openssl/evp.h>
+# else
+#  define IMAGE_ENABLE_ENCRYPT 0
+#  define IMAGE_ENABLE_DECRYPT 0
+# endif
+#else
+# define IMAGE_ENABLE_ENCRYPT  0
+# define IMAGE_ENABLE_DECRYPT  CONFIG_IS_ENABLED(FIT_CIPHER)
+#endif
+
+/* Information passed to the ciphering routines */
+struct image_cipher_info {
+       const char *keydir;             /* Directory containing keys */
+       const char *keyname;            /* Name of key to use */
+       const char *ivname;             /* Name of IV to use */
+       const void *fit;                /* Pointer to FIT blob */
+       int node_noffset;               /* Offset of the cipher node */
+       const char *name;               /* Algorithm name */
+       struct cipher_algo *cipher;     /* Cipher algorithm information */
+       const void *fdt_blob;           /* FDT containing key and IV */
+       const void *key;                /* Value of the key */
+       const void *iv;                 /* Value of the IV */
+       size_t size_unciphered;         /* Size of the unciphered data */
+};
+
+struct cipher_algo {
+       const char *name;               /* Name of algorithm */
+       int key_len;                    /* Length of the key */
+       int iv_len;                     /* Length of the IV */
+
+#if IMAGE_ENABLE_ENCRYPT
+       const EVP_CIPHER * (*calculate_type)(void);
+#endif
+
+       int (*encrypt)(struct image_cipher_info *info,
+                      const unsigned char *data, int data_len,
+                      unsigned char **cipher, int *cipher_len);
+
+       int (*add_cipher_data)(struct image_cipher_info *info,
+                              void *keydest);
+
+       int (*decrypt)(struct image_cipher_info *info,
+                      const void *cipher, size_t cipher_len,
+                      void **data, size_t *data_len);
+};
+
+int fit_image_cipher_get_algo(const void *fit, int noffset, char **algo);
+
+struct cipher_algo *image_get_cipher_algo(const char *full_name);
+
 #ifdef CONFIG_FIT_VERBOSE
 #define fit_unsupported(msg)   printf("! %s:%d " \
                                "FIT images not supported for '%s'\n", \
index 970a39a6a08f949616d81ec34a07ba5caee75e71..2a33a3fd1e41c54f35b973e9b0a0974b274198ce 100644 (file)
 
 #include <linux/types.h>
 
+struct global_data;
+
 #ifndef __ASSEMBLY__           /* put C only stuff in this section */
 
+/* Avoid using CONFIG_EFI_STUB directly as we may boot from other loaders */
+#ifdef CONFIG_EFI_STUB
+#define ll_boot_init() false
+#else
+#define ll_boot_init() true
+#endif
+
 /*
  * Function Prototypes
  */
@@ -97,6 +106,11 @@ int dram_init(void);
  */
 int dram_init_banksize(void);
 
+long get_ram_size(long *base, long size);
+phys_size_t get_effective_memsize(void);
+
+int testdram(void);
+
 /**
  * arch_reserve_stacks() - Reserve all necessary stacks
  *
@@ -221,6 +235,21 @@ void pci_init_board(void);
 
 void trap_init(unsigned long reloc_addr);
 
+/**
+ * main_loop() - Enter the main loop of U-Boot
+ *
+ * This normally runs the command line.
+ */
+void main_loop(void);
+
+#if defined(CONFIG_ARM)
+void relocate_code(ulong addr_moni);
+#else
+void relocate_code(ulong start_addr_sp, struct global_data *new_gd,
+                  ulong relocaddr)
+       __attribute__ ((noreturn));
+#endif
+
 #endif /* __ASSEMBLY__ */
 /* Put only stuff here that the assembler can digest */
 
index 564819a1c0a7257cc080fce9e0c53dfd47b64e97..b88c21006591d3117cc857a36d381a5cdaf71c0f 100644 (file)
@@ -69,6 +69,8 @@
 
 #define DIV_ROUND_UP_ULL(ll, d)                DIV_ROUND_DOWN_ULL((ll) + (d) - 1, (d))
 
+#define ROUND(a, b)            (((a) + (b) - 1) & ~((b) - 1))
+
 #if BITS_PER_LONG == 32
 # define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
 #else
        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
        (type *)( (char *)__mptr - offsetof(type,member) );})
 
+/*
+ * check_member() - Check the offset of a structure member
+ *
+ * @structure: Name of structure (e.g. global_data)
+ * @member:    Name of member (e.g. baudrate)
+ * @offset:    Expected offset in bytes
+ */
+#define check_member(structure, member, offset) _Static_assert( \
+       offsetof(struct structure, member) == (offset), \
+       "`struct " #structure "` offset for `" #member "` is not " #offset)
+
 #endif
index bd912bcb42fd2bc54619828f21f93dac95d3984f..baa2c491ea5bd187f176dbf04d4df6f0db1a80d3 100644 (file)
@@ -163,4 +163,8 @@ struct ustat {
 #define DECLARE_BITMAP(name, bits) \
        unsigned long name[BITS_TO_LONGS(bits)]
 
+typedef volatile unsigned long vu_long;
+typedef volatile unsigned short vu_short;
+typedef volatile unsigned char vu_char;
+
 #endif /* _LINUX_TYPES_H */
index 834f2449826a96994738f0252205945ca38a6637..8a02c923a40ed286b1d97c0f6e4e867d52fb0bf2 100644 (file)
@@ -50,6 +50,17 @@ struct in_addr {
        __be32 s_addr;
 };
 
+/**
+ * do_tftpb - Run the tftpboot command
+ *
+ * @cmdtp: Command information for tftpboot
+ * @flag: Command flags (CMD_FLAG_...)
+ * @argc: Number of arguments
+ * @argv: List of arguments
+ * @return result (see enum command_ret_t)
+ */
+int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]);
+
 /**
  * An incoming packet handler.
  * @param pkt    pointer to the application packet
@@ -906,4 +917,12 @@ static inline struct in_addr env_get_ip(char *var)
 {
        return string_to_ip(env_get(var));
 }
+
+/**
+ * reset_phy() - Reset the Ethernet PHY
+ *
+ * This should be implemented by boards if CONFIG_RESET_PHY_R is enabled
+ */
+void reset_phy(void);
+
 #endif /* __NET_H__ */
diff --git a/include/ns87308.h b/include/ns87308.h
deleted file mode 100644 (file)
index d5ccd3b..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2000
- * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
- */
-
-#ifndef _NS87308_H_
-#define _NS87308_H_
-
-#include <asm/pci_io.h>
-
-/* Note: I couldn't find a full data sheet for the ns87308, but the ns87307 seems to be pretty
-   functionally- (and pin-) equivalent to the 87308, but the 308 has better ir support. */
-
-void initialise_ns87308(void);
-
-/*
- * The following struct represents the GPIO registers on the NS87308/NS97307
- */
-struct GPIO
-{
-  unsigned char dta1;  /* 0 data port 1 */
-  unsigned char dir1;  /* 1 direction port 1 */
-  unsigned char out1;  /* 2 output type port 1 */
-  unsigned char puc1;  /* 3 pull-up control port 1 */
-  unsigned char dta2;  /* 4 data port 2 */
-  unsigned char dir2;  /* 5 direction port 2 */
-  unsigned char out2;  /* 6 output type port 2 */
-  unsigned char puc2;  /* 7 pull-up control port 2  */
-};
-
-/*
- * The following represents the power management registers on the NS87308/NS97307
- */
-#define PWM_FER1 0  /* 0 function enable reg. 1 */
-#define PWM_FER2 1  /* 1 function enable reg. 2 */
-#define PWM_PMC1 2  /* 2 power mgmt. control 1 */
-#define PWM_PMC2 3  /* 3 power mgmt. control 2 */
-#define PWM_PMC3 4  /* 4 power mgmt. control 3 */
-#define PWM_WDTO 5  /* 5 watchdog time-out */
-#define PWM_WDCF 6  /* 6 watchdog config. */
-#define PWM_WDST 7  /* 7 watchdog status  */
-
-/*PNP config registers:
- * these depend on the stated of BADDR1 and BADDR0 on startup
- * so there's three versions here with the last two digits indicating
- * for which configuration their valid
- * the 1st of the two digits indicates the state of BADDR1
- * the 2st of the two digits indicates the state of BADDR0
- */
-
-
-#define IO_INDEX_OFFSET_0x 0x0279  /* full PnP isa Mode */
-#define IO_INDEX_OFFSET_10 0x015C  /* PnP motherboard mode */
-#define IO_INDEX_OFFSET_11 0x002E  /* PnP motherboard mode */
-#define IO_DATA_OFFSET_0x  0x0A79  /* full PnP isa Mode */
-#define IO_DATA_OFFSET_10  0x015D  /* PnP motherboard mode */
-#define IO_DATA_OFFSET_11  0x002F  /* PnP motherboard mode */
-
-#if defined(CONFIG_SYS_NS87308_BADDR_0x)
-#define IO_INDEX (CONFIG_SYS_ISA_IO + IO_INDEX_OFFSET_0x)
-#define IO_DATA  (CONFIG_SYS_ISA_IO + IO_DATA_OFFSET_0x)
-#elif defined(CONFIG_SYS_NS87308_BADDR_10)
-#define IO_INDEX (CONFIG_SYS_ISA_IO + IO_INDEX_OFFSET_10)
-#define IO_DATA  (CONFIG_SYS_ISA_IO + IO_DATA_OFFSET_10)
-#elif defined(CONFIG_SYS_NS87308_BADDR_11)
-#define IO_INDEX (CONFIG_SYS_ISA_IO + IO_INDEX_OFFSET_11)
-#define IO_DATA  (CONFIG_SYS_ISA_IO + IO_DATA_OFFSET_11)
-#endif
-
-/* PnP register definitions */
-
-#define SET_RD_DATA_PORT    0x00
-#define SERIAL_ISOLATION    0x01
-#define CONFIG_CONTROL      0x02
-#define WAKE_CSN            0x03
-#define RES_DATA            0x04
-#define STATUS              0x05
-#define SET_CSN             0x06
-#define LOGICAL_DEVICE      0x07
-
-/*vendor defined values */
-#define SID_REG             0x20
-#define SUPOERIO_CONF1      0x21
-#define SUPOERIO_CONF2      0x22
-#define PGCS_INDEX          0x23
-#define PGCS_DATA           0x24
-
-/* values above 30 are different for each logical device
-   but I can't be arsed to enter them all. the ones here
-   are pretty consistent between all logical devices
-   feel free to correct the situation if you want.. ;)
-   */
-#define ACTIVATE            0x30
-#define ACTIVATE_OFF        0x00
-#define ACTIVATE_ON         0x01
-
-#define BASE_ADDR_HIGH      0x60
-#define BASE_ADDR_LOW       0x61
-#define LUN_CONFIG_REG         0xF0
-#define DBASE_HIGH                     0x60    /* SIO KBC data base address, 15:8 */
-#define DBASE_LOW                      0x61    /* SIO KBC data base address,  7:0 */
-#define CBASE_HIGH                     0x62    /* SIO KBC command base addr, 15:8 */
-#define CBASE_LOW                      0x63    /* SIO KBC command base addr,  7:0 */
-
-/* the logical devices*/
-#define LDEV_KBC1           0x00       /* 2 devices for keyboard and mouse controller*/
-#define LDEV_KBC2           0x01
-#define LDEV_MOUSE          0x01
-#define LDEV_RTC_APC        0x02       /*Real Time Clock and Advanced Power Control*/
-#define LDEV_FDC            0x03       /*floppy disk controller*/
-#define LDEV_PARP           0x04       /*Parallel port*/
-#define LDEV_UART2          0x05
-#define LDEV_UART1          0x06
-#define LDEV_GPIO           0x07    /*General Purpose IO and chip select output signals*/
-#define LDEV_POWRMAN        0x08    /*Power Managment*/
-
-#define CONFIG_SYS_NS87308_KBC1        (1 << LDEV_KBC1)
-#define CONFIG_SYS_NS87308_KBC2        (1 << LDEV_KBC2)
-#define CONFIG_SYS_NS87308_MOUSE       (1 << LDEV_MOUSE)
-#define CONFIG_SYS_NS87308_RTC_APC     (1 << LDEV_RTC_APC)
-#define CONFIG_SYS_NS87308_FDC         (1 << LDEV_FDC)
-#define CONFIG_SYS_NS87308_PARP        (1 << LDEV_PARP)
-#define CONFIG_SYS_NS87308_UART2       (1 << LDEV_UART2)
-#define CONFIG_SYS_NS87308_UART1       (1 << LDEV_UART1)
-#define CONFIG_SYS_NS87308_GPIO        (1 << LDEV_GPIO)
-#define CONFIG_SYS_NS87308_POWRMAN     (1 << LDEV_POWRMAN)
-
-/*some functions and macro's for doing configuration */
-
-static inline void read_pnp_config(unsigned char index, unsigned char *data)
-{
-    pci_writeb(index,IO_INDEX);
-    pci_readb(IO_DATA, *data);
-}
-
-static inline void write_pnp_config(unsigned char index, unsigned char data)
-{
-    pci_writeb(index,IO_INDEX);
-    pci_writeb(data, IO_DATA);
-}
-
-static inline void pnp_set_device(unsigned char dev)
-{
-    write_pnp_config(LOGICAL_DEVICE, dev);
-}
-
-static inline void write_pm_reg(unsigned short base, unsigned char index, unsigned char data)
-{
-    pci_writeb(index, CONFIG_SYS_ISA_IO + base);
-    eieio();
-    pci_writeb(data, CONFIG_SYS_ISA_IO + base + 1);
-}
-
-/*void write_pnp_config(unsigned char index, unsigned char data);
-void pnp_set_device(unsigned char dev);
-*/
-
-#define PNP_SET_DEVICE_BASE(dev,base) \
-   pnp_set_device(dev); \
-   write_pnp_config(ACTIVATE, ACTIVATE_OFF); \
-   write_pnp_config(BASE_ADDR_HIGH, ((base) >> 8) & 0xff ); \
-   write_pnp_config(BASE_ADDR_LOW, (base) &0xff); \
-   write_pnp_config(ACTIVATE, ACTIVATE_ON);
-
-#define PNP_ACTIVATE_DEVICE(dev) \
-   pnp_set_device(dev); \
-   write_pnp_config(ACTIVATE, ACTIVATE_ON);
-
-#define PNP_DEACTIVATE_DEVICE(dev) \
-   pnp_set_device(dev); \
-   write_pnp_config(ACTIVATE, ACTIVATE_OFF);
-
-
-static inline void write_pgcs_config(unsigned char index, unsigned char data)
-{
-    write_pnp_config(PGCS_INDEX, index);
-    write_pnp_config(PGCS_DATA, data);
-}
-
-/* these macrose configure the 3 CS lines
-   on the sandpoint board these controll NVRAM
-   CS0 is connected to NVRAMCS
-   CS1 is connected to NVRAMAS0
-   CS2 is connected to NVRAMAS1
-   */
-#define PGCS_CS_ASSERT_ON_WRITE 0x10
-#define PGCS_CS_ASSERT_ON_READ  0x20
-
-#define PNP_PGCS_CSLINE_BASE(cs, base) \
-  write_pgcs_config((cs) << 2, ((base) >> 8) & 0xff ); \
-  write_pgcs_config(((cs) << 2) + 1, (base) & 0xff );
-
-#define PNP_PGCS_CSLINE_CONF(cs, conf) \
-  write_pgcs_config(((cs) << 2) + 2, (conf) );
-
-
-/* The following sections are for 87308 extensions to the standard compoents it emulates */
-
-/* extensions to 16550*/
-
-#define MCR_MDSL_MSK    0xe0 /*mode select mask*/
-#define MCR_MDSL_UART   0x00 /*uart, default*/
-#define MCR_MDSL_SHRPIR 0x02 /*Sharp IR*/
-#define MCR_MDSL_SIR    0x03 /*SIR*/
-#define MCR_MDSL_CIR    0x06 /*Consumer IR*/
-
-#define FCR_TXFTH0      0x10    /* these bits control threshod of data level in fifo */
-#define FCR_TXFTH1      0x20    /* for interrupt trigger */
-
-/*
- * Default NS87308 configuration
- */
-#ifndef CONFIG_SYS_NS87308_KBC1_BASE
-#define CONFIG_SYS_NS87308_KBC1_BASE   0x0060
-#endif
-#ifndef CONFIG_SYS_NS87308_RTC_BASE
-#define CONFIG_SYS_NS87308_RTC_BASE    0x0070
-#endif
-#ifndef CONFIG_SYS_NS87308_FDC_BASE
-#define CONFIG_SYS_NS87308_FDC_BASE    0x03F0
-#endif
-#ifndef CONFIG_SYS_NS87308_LPT_BASE
-#define CONFIG_SYS_NS87308_LPT_BASE    0x0278
-#endif
-#ifndef CONFIG_SYS_NS87308_UART1_BASE
-#define CONFIG_SYS_NS87308_UART1_BASE  0x03F8
-#endif
-#ifndef CONFIG_SYS_NS87308_UART2_BASE
-#define CONFIG_SYS_NS87308_UART2_BASE  0x02F8
-#endif
-
-#endif /*_NS87308_H_*/
index 71446c317148a8f521d88d5234c993acf5e4aec6..e99f9c8012701e7f0b62a37c0c71c12d2f4b8f87 100644 (file)
@@ -6,6 +6,8 @@
 #include <linux/typecheck.h>
 #include <linux/types.h>
 
+ulong get_tbclk(void);
+
 unsigned long get_timer(unsigned long base);
 
 /*
diff --git a/include/u-boot/aes.h b/include/u-boot/aes.h
new file mode 100644 (file)
index 0000000..3228104
--- /dev/null
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2019, Softathome
+ */
+
+#ifndef _AES_H
+#define _AES_H
+
+#include <errno.h>
+#include <image.h>
+
+#if IMAGE_ENABLE_ENCRYPT
+int image_aes_encrypt(struct image_cipher_info *info,
+                     const unsigned char *data, int size,
+                     unsigned char **cipher, int *cipher_len);
+int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest);
+#else
+int image_aes_encrypt(struct image_cipher_info *info,
+                     const unsigned char *data, int size,
+                     unsigned char **cipher, int *cipher_len)
+{
+       return -ENXIO;
+}
+
+int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest)
+{
+       return -ENXIO;
+}
+#endif /* IMAGE_ENABLE_ENCRYPT */
+
+#if IMAGE_ENABLE_DECRYPT
+int image_aes_decrypt(struct image_cipher_info *info,
+                     const void *cipher, size_t cipher_len,
+                     void **data, size_t *size);
+#else
+int image_aes_decrypt(struct image_cipher_info *info,
+                     const void *cipher, size_t cipher_len,
+                     void **data, size_t *size)
+{
+       return -ENXIO;
+}
+#endif /* IMAGE_ENABLE_DECRYPT */
+
+#endif
index 2fda384e3b79a5de3766a446ae52fa51ed977a8a..d2583bed9920ad57c01ef1e34b008e5c92282be5 100644 (file)
@@ -18,16 +18,24 @@ typedef unsigned int u32;
  * AES encryption library, with small code size, supporting only 128-bit AES
  *
  * AES is a stream cipher which works a block at a time, with each block
- * in this case being AES_KEY_LENGTH bytes.
+ * in this case being AES_BLOCK_LENGTH bytes.
  */
 
 enum {
        AES_STATECOLS   = 4,    /* columns in the state & expanded key */
-       AES_KEYCOLS     = 4,    /* columns in a key */
-       AES_ROUNDS      = 10,   /* rounds in encryption */
-
-       AES_KEY_LENGTH  = 128 / 8,
-       AES_EXPAND_KEY_LENGTH   = 4 * AES_STATECOLS * (AES_ROUNDS + 1),
+       AES128_KEYCOLS  = 4,    /* columns in a key for aes128 */
+       AES192_KEYCOLS  = 6,    /* columns in a key for aes128 */
+       AES256_KEYCOLS  = 8,    /* columns in a key for aes128 */
+       AES128_ROUNDS   = 10,   /* rounds in encryption for aes128 */
+       AES192_ROUNDS   = 12,   /* rounds in encryption for aes192 */
+       AES256_ROUNDS   = 14,   /* rounds in encryption for aes256 */
+       AES128_KEY_LENGTH       = 128 / 8,
+       AES192_KEY_LENGTH       = 192 / 8,
+       AES256_KEY_LENGTH       = 256 / 8,
+       AES128_EXPAND_KEY_LENGTH = 4 * AES_STATECOLS * (AES128_ROUNDS + 1),
+       AES192_EXPAND_KEY_LENGTH = 4 * AES_STATECOLS * (AES192_ROUNDS + 1),
+       AES256_EXPAND_KEY_LENGTH = 4 * AES_STATECOLS * (AES256_ROUNDS + 1),
+       AES_BLOCK_LENGTH        = 128 / 8,
 };
 
 /**
@@ -36,33 +44,36 @@ enum {
  * Expand a key into a key schedule, which is then used for the other
  * operations.
  *
- * @key                Key, of length AES_KEY_LENGTH bytes
+ * @key                Key
+ * @key_size   Size of the key (in bits)
  * @expkey     Buffer to place expanded key, AES_EXPAND_KEY_LENGTH
  */
-void aes_expand_key(u8 *key, u8 *expkey);
+void aes_expand_key(u8 *key, u32 key_size, u8 *expkey);
 
 /**
  * aes_encrypt() - Encrypt single block of data with AES 128
  *
+ * @key_size   Size of the aes key (in bits)
  * @in         Input data
  * @expkey     Expanded key to use for encryption (from aes_expand_key())
  * @out                Output data
  */
-void aes_encrypt(u8 *in, u8 *expkey, u8 *out);
+void aes_encrypt(u32 key_size, u8 *in, u8 *expkey, u8 *out);
 
 /**
  * aes_decrypt() - Decrypt single block of data with AES 128
  *
+ * @key_size   Size of the aes key (in bits)
  * @in         Input data
  * @expkey     Expanded key to use for decryption (from aes_expand_key())
  * @out                Output data
  */
-void aes_decrypt(u8 *in, u8 *expkey, u8 *out);
+void aes_decrypt(u32 key_size, u8 *in, u8 *expkey, u8 *out);
 
 /**
  * Apply chain data to the destination using EOR
  *
- * Each array is of length AES_KEY_LENGTH.
+ * Each array is of length AES_BLOCK_LENGTH.
  *
  * @cbc_chain_data     Chain data
  * @src                        Source data
@@ -73,25 +84,27 @@ void aes_apply_cbc_chain_data(u8 *cbc_chain_data, u8 *src, u8 *dst);
 /**
  * aes_cbc_encrypt_blocks() - Encrypt multiple blocks of data with AES CBC.
  *
+ * @key_size           Size of the aes key (in bits)
  * @key_exp            Expanded key to use
  * @iv                 Initialization vector
  * @src                        Source data to encrypt
  * @dst                        Destination buffer
  * @num_aes_blocks     Number of AES blocks to encrypt
  */
-void aes_cbc_encrypt_blocks(u8 *key_exp, u8 *iv, u8 *src, u8 *dst,
+void aes_cbc_encrypt_blocks(u32 key_size, u8 *key_exp, u8 *iv, u8 *src, u8 *dst,
                            u32 num_aes_blocks);
 
 /**
  * Decrypt multiple blocks of data with AES CBC.
  *
+ * @key_size           Size of the aes key (in bits)
  * @key_exp            Expanded key to use
  * @iv                 Initialization vector
  * @src                        Source data to decrypt
  * @dst                        Destination buffer
  * @num_aes_blocks     Number of AES blocks to decrypt
  */
-void aes_cbc_decrypt_blocks(u8 *key_exp, u8 *iv, u8 *src, u8 *dst,
+void aes_cbc_decrypt_blocks(u32 key_size, u8 *key_exp, u8 *iv, u8 *src, u8 *dst,
                            u32 num_aes_blocks);
 
 #endif /* _AES_REF_H_ */
index 6b7b9ce85c54789fe9dbd1bffeb60149cef7daf1..51eba80b89656b315eba6604d3251d613c91c488 100644 (file)
@@ -21,6 +21,7 @@ obj-$(CONFIG_ASN1_DECODER) += asn1_decoder.o
 obj-y += crypto/
 
 obj-$(CONFIG_AES) += aes.o
+obj-$(CONFIG_AES) += aes/
 obj-$(CONFIG_$(SPL_TPL_)BINMAN_FDT) += binman.o
 
 ifndef API_BUILD
index a12a19208433acf9ee7ab0991a37124af86819ee..ce53c9f1f372a3b416bd156e321a17cf79e6b48c 100644 (file)
--- a/lib/aes.c
+++ b/lib/aes.c
@@ -508,50 +508,79 @@ static u8 rcon[11] = {
        0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36
 };
 
+static u32 aes_get_rounds(u32 key_len)
+{
+       u32 rounds = AES128_ROUNDS;
+
+       if (key_len == AES192_KEY_LENGTH)
+               rounds = AES192_ROUNDS;
+       else if (key_len == AES256_KEY_LENGTH)
+               rounds = AES256_ROUNDS;
+
+       return rounds;
+}
+
+static u32 aes_get_keycols(u32 key_len)
+{
+       u32 keycols = AES128_KEYCOLS;
+
+       if (key_len == AES192_KEY_LENGTH)
+               keycols = AES192_KEYCOLS;
+       else if (key_len == AES256_KEY_LENGTH)
+               keycols = AES256_KEYCOLS;
+
+       return keycols;
+}
+
 /* produce AES_STATECOLS bytes for each round */
-void aes_expand_key(u8 *key, u8 *expkey)
+void aes_expand_key(u8 *key, u32 key_len, u8 *expkey)
 {
        u8 tmp0, tmp1, tmp2, tmp3, tmp4;
-       u32 idx;
+       u32 idx, aes_rounds, aes_keycols;
 
-       memcpy(expkey, key, AES_KEYCOLS * 4);
+       aes_rounds = aes_get_rounds(key_len);
+       aes_keycols = aes_get_keycols(key_len);
 
-       for (idx = AES_KEYCOLS; idx < AES_STATECOLS * (AES_ROUNDS + 1); idx++) {
+       memcpy(expkey, key, key_len);
+
+       for (idx = aes_keycols; idx < AES_STATECOLS * (aes_rounds + 1); idx++) {
                tmp0 = expkey[4*idx - 4];
                tmp1 = expkey[4*idx - 3];
                tmp2 = expkey[4*idx - 2];
                tmp3 = expkey[4*idx - 1];
-               if (!(idx % AES_KEYCOLS)) {
+               if (!(idx % aes_keycols)) {
                        tmp4 = tmp3;
                        tmp3 = sbox[tmp0];
-                       tmp0 = sbox[tmp1] ^ rcon[idx / AES_KEYCOLS];
+                       tmp0 = sbox[tmp1] ^ rcon[idx / aes_keycols];
                        tmp1 = sbox[tmp2];
                        tmp2 = sbox[tmp4];
-               } else if ((AES_KEYCOLS > 6) && (idx % AES_KEYCOLS == 4)) {
+               } else if ((aes_keycols > 6) && (idx % aes_keycols == 4)) {
                        tmp0 = sbox[tmp0];
                        tmp1 = sbox[tmp1];
                        tmp2 = sbox[tmp2];
                        tmp3 = sbox[tmp3];
                }
 
-               expkey[4*idx+0] = expkey[4*idx - 4*AES_KEYCOLS + 0] ^ tmp0;
-               expkey[4*idx+1] = expkey[4*idx - 4*AES_KEYCOLS + 1] ^ tmp1;
-               expkey[4*idx+2] = expkey[4*idx - 4*AES_KEYCOLS + 2] ^ tmp2;
-               expkey[4*idx+3] = expkey[4*idx - 4*AES_KEYCOLS + 3] ^ tmp3;
+               expkey[4*idx+0] = expkey[4*idx - 4*aes_keycols + 0] ^ tmp0;
+               expkey[4*idx+1] = expkey[4*idx - 4*aes_keycols + 1] ^ tmp1;
+               expkey[4*idx+2] = expkey[4*idx - 4*aes_keycols + 2] ^ tmp2;
+               expkey[4*idx+3] = expkey[4*idx - 4*aes_keycols + 3] ^ tmp3;
        }
 }
 
 /* encrypt one 128 bit block */
-void aes_encrypt(u8 *in, u8 *expkey, u8 *out)
+void aes_encrypt(u32 key_len, u8 *in, u8 *expkey, u8 *out)
 {
        u8 state[AES_STATECOLS * 4];
-       u32 round;
+       u32 round, aes_rounds;
+
+       aes_rounds = aes_get_rounds(key_len);
 
        memcpy(state, in, AES_STATECOLS * 4);
        add_round_key((u32 *)state, (u32 *)expkey);
 
-       for (round = 1; round < AES_ROUNDS + 1; round++) {
-               if (round < AES_ROUNDS)
+       for (round = 1; round < aes_rounds + 1; round++) {
+               if (round < aes_rounds)
                        mix_sub_columns(state);
                else
                        shift_rows(state);
@@ -563,18 +592,20 @@ void aes_encrypt(u8 *in, u8 *expkey, u8 *out)
        memcpy(out, state, sizeof(state));
 }
 
-void aes_decrypt(u8 *in, u8 *expkey, u8 *out)
+void aes_decrypt(u32 key_len, u8 *in, u8 *expkey, u8 *out)
 {
        u8 state[AES_STATECOLS * 4];
-       int round;
+       int round, aes_rounds;
+
+       aes_rounds = aes_get_rounds(key_len);
 
        memcpy(state, in, sizeof(state));
 
        add_round_key((u32 *)state,
-                     (u32 *)expkey + AES_ROUNDS * AES_STATECOLS);
+                     (u32 *)expkey + aes_rounds * AES_STATECOLS);
        inv_shift_rows(state);
 
-       for (round = AES_ROUNDS; round--; ) {
+       for (round = aes_rounds; round--; ) {
                add_round_key((u32 *)state,
                              (u32 *)expkey + round * AES_STATECOLS);
                if (round)
@@ -596,62 +627,62 @@ void aes_apply_cbc_chain_data(u8 *cbc_chain_data, u8 *src, u8 *dst)
 {
        int i;
 
-       for (i = 0; i < AES_KEY_LENGTH; i++)
+       for (i = 0; i < AES_BLOCK_LENGTH; i++)
                *dst++ = *src++ ^ *cbc_chain_data++;
 }
 
-void aes_cbc_encrypt_blocks(u8 *key_exp, u8 *iv, u8 *src, u8 *dst,
+void aes_cbc_encrypt_blocks(u32 key_len, u8 *key_exp, u8 *iv, u8 *src, u8 *dst,
                            u32 num_aes_blocks)
 {
-       u8 tmp_data[AES_KEY_LENGTH];
+       u8 tmp_data[AES_BLOCK_LENGTH];
        u8 *cbc_chain_data = iv;
        u32 i;
 
        for (i = 0; i < num_aes_blocks; i++) {
                debug("encrypt_object: block %d of %d\n", i, num_aes_blocks);
-               debug_print_vector("AES Src", AES_KEY_LENGTH, src);
+               debug_print_vector("AES Src", AES_BLOCK_LENGTH, src);
 
                /* Apply the chain data */
                aes_apply_cbc_chain_data(cbc_chain_data, src, tmp_data);
-               debug_print_vector("AES Xor", AES_KEY_LENGTH, tmp_data);
+               debug_print_vector("AES Xor", AES_BLOCK_LENGTH, tmp_data);
 
                /* Encrypt the AES block */
-               aes_encrypt(tmp_data, key_exp, dst);
-               debug_print_vector("AES Dst", AES_KEY_LENGTH, dst);
+               aes_encrypt(key_len, tmp_data, key_exp, dst);
+               debug_print_vector("AES Dst", AES_BLOCK_LENGTH, dst);
 
                /* Update pointers for next loop. */
                cbc_chain_data = dst;
-               src += AES_KEY_LENGTH;
-               dst += AES_KEY_LENGTH;
+               src += AES_BLOCK_LENGTH;
+               dst += AES_BLOCK_LENGTH;
        }
 }
 
-void aes_cbc_decrypt_blocks(u8 *key_exp, u8 *iv, u8 *src, u8 *dst,
+void aes_cbc_decrypt_blocks(u32 key_len, u8 *key_exp, u8 *iv, u8 *src, u8 *dst,
                            u32 num_aes_blocks)
 {
-       u8 tmp_data[AES_KEY_LENGTH], tmp_block[AES_KEY_LENGTH];
+       u8 tmp_data[AES_BLOCK_LENGTH], tmp_block[AES_BLOCK_LENGTH];
        /* Convenient array of 0's for IV */
-       u8 cbc_chain_data[AES_KEY_LENGTH];
+       u8 cbc_chain_data[AES_BLOCK_LENGTH];
        u32 i;
 
-       memcpy(cbc_chain_data, iv, AES_KEY_LENGTH);
+       memcpy(cbc_chain_data, iv, AES_BLOCK_LENGTH);
        for (i = 0; i < num_aes_blocks; i++) {
                debug("encrypt_object: block %d of %d\n", i, num_aes_blocks);
-               debug_print_vector("AES Src", AES_KEY_LENGTH, src);
+               debug_print_vector("AES Src", AES_BLOCK_LENGTH, src);
 
-               memcpy(tmp_block, src, AES_KEY_LENGTH);
+               memcpy(tmp_block, src, AES_BLOCK_LENGTH);
 
                /* Decrypt the AES block */
-               aes_decrypt(src, key_exp, tmp_data);
-               debug_print_vector("AES Xor", AES_KEY_LENGTH, tmp_data);
+               aes_decrypt(key_len, src, key_exp, tmp_data);
+               debug_print_vector("AES Xor", AES_BLOCK_LENGTH, tmp_data);
 
                /* Apply the chain data */
                aes_apply_cbc_chain_data(cbc_chain_data, tmp_data, dst);
-               debug_print_vector("AES Dst", AES_KEY_LENGTH, dst);
+               debug_print_vector("AES Dst", AES_BLOCK_LENGTH, dst);
 
                /* Update pointers for next loop. */
-               memcpy(cbc_chain_data, tmp_block, AES_KEY_LENGTH);
-               src += AES_KEY_LENGTH;
-               dst += AES_KEY_LENGTH;
+               memcpy(cbc_chain_data, tmp_block, AES_BLOCK_LENGTH);
+               src += AES_BLOCK_LENGTH;
+               dst += AES_BLOCK_LENGTH;
        }
 }
diff --git a/lib/aes/Makefile b/lib/aes/Makefile
new file mode 100644 (file)
index 0000000..daed52a
--- /dev/null
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (c) 2019, Softathome
+
+obj-$(CONFIG_$(SPL_)FIT_CIPHER) += aes-decrypt.o
diff --git a/lib/aes/aes-decrypt.c b/lib/aes/aes-decrypt.c
new file mode 100644 (file)
index 0000000..345029f
--- /dev/null
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2019, softathome
+ */
+
+#ifndef USE_HOSTCC
+#include <common.h>
+#include <malloc.h>
+#endif
+#include <image.h>
+#include <uboot_aes.h>
+
+int image_aes_decrypt(struct image_cipher_info *info,
+                     const void *cipher, size_t cipher_len,
+                     void **data, size_t *size)
+{
+#ifndef USE_HOSTCC
+       unsigned char key_exp[AES256_EXPAND_KEY_LENGTH];
+       unsigned int aes_blocks, key_len = info->cipher->key_len;
+
+       *data = malloc(cipher_len);
+       if (!*data) {
+               printf("Can't allocate memory to decrypt\n");
+               return -ENOMEM;
+       }
+       *size = info->size_unciphered;
+
+       memcpy(&key_exp[0], info->key, key_len);
+
+       /* First we expand the key. */
+       aes_expand_key((u8 *)info->key, key_len, key_exp);
+
+       /* Calculate the number of AES blocks to encrypt. */
+       aes_blocks = DIV_ROUND_UP(cipher_len, AES_BLOCK_LENGTH);
+
+       aes_cbc_decrypt_blocks(key_len, key_exp, (u8 *)info->iv,
+                              (u8 *)cipher, *data, aes_blocks);
+#endif
+
+       return 0;
+}
diff --git a/lib/aes/aes-encrypt.c b/lib/aes/aes-encrypt.c
new file mode 100644 (file)
index 0000000..de00a83
--- /dev/null
@@ -0,0 +1,136 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2019,Softathome
+ */
+#include "mkimage.h"
+#include <stdio.h>
+#include <string.h>
+#include <image.h>
+#include <time.h>
+#include <openssl/bn.h>
+#include <openssl/rsa.h>
+#include <openssl/pem.h>
+#include <openssl/err.h>
+#include <openssl/ssl.h>
+#include <openssl/evp.h>
+#include <openssl/engine.h>
+#include <uboot_aes.h>
+
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+#define HAVE_ERR_REMOVE_THREAD_STATE
+#endif
+
+int image_aes_encrypt(struct image_cipher_info *info,
+                     unsigned char *data, int size,
+                     unsigned char **cipher, int *cipher_len)
+{
+       EVP_CIPHER_CTX *ctx;
+       unsigned char *buf = NULL;
+       int buf_len, len, ret = 0;
+
+       /* create and initialise the context */
+       ctx = EVP_CIPHER_CTX_new();
+       if (!ctx) {
+               printf("Can't create context\n");
+               return -1;
+       }
+
+       /* allocate a buffer for the result */
+       buf = malloc(size + AES_BLOCK_LENGTH);
+       if (!buf) {
+               printf("Can't allocate memory to encrypt\n");
+               ret = -1;
+               goto out;
+       }
+
+       if (EVP_EncryptInit_ex(ctx, info->cipher->calculate_type(),
+                              NULL, info->key, info->iv) != 1) {
+               printf("Can't init encryption\n");
+               ret = -1;
+               goto out;
+       }
+
+       if (EVP_EncryptUpdate(ctx, buf, &len, data, size) != 1) {
+               printf("Can't encrypt data\n");
+               ret = -1;
+               goto out;
+       }
+
+       buf_len = len;
+
+       if (EVP_EncryptFinal_ex(ctx, buf + len, &len) != 1) {
+               printf("Can't finalise the encryption\n");
+               ret = -1;
+               goto out;
+       }
+
+       buf_len += len;
+
+       *cipher = buf;
+       *cipher_len = buf_len;
+
+ out:
+       EVP_CIPHER_CTX_free(ctx);
+       return ret;
+}
+
+int image_aes_add_cipher_data(struct image_cipher_info *info, void *keydest)
+{
+       int parent, node;
+       char name[128];
+       int ret = 0;
+
+       /* Either create or overwrite the named cipher node */
+       parent = fdt_subnode_offset(keydest, 0, FIT_CIPHER_NODENAME);
+       if (parent == -FDT_ERR_NOTFOUND) {
+               parent = fdt_add_subnode(keydest, 0, FIT_CIPHER_NODENAME);
+               if (parent < 0) {
+                       ret = parent;
+                       if (ret != -FDT_ERR_NOSPACE) {
+                               fprintf(stderr,
+                                       "Couldn't create cipher node: %s\n",
+                                       fdt_strerror(parent));
+                       }
+               }
+       }
+       if (ret)
+               goto done;
+
+       /* Either create or overwrite the named key node */
+       snprintf(name, sizeof(name), "key-%s-%s-%s",
+                info->name, info->keyname, info->ivname);
+       node = fdt_subnode_offset(keydest, parent, name);
+       if (node == -FDT_ERR_NOTFOUND) {
+               node = fdt_add_subnode(keydest, parent, name);
+               if (node < 0) {
+                       ret = node;
+                       if (ret != -FDT_ERR_NOSPACE) {
+                               fprintf(stderr,
+                                       "Could not create key subnode: %s\n",
+                                       fdt_strerror(node));
+                       }
+               }
+       } else if (node < 0) {
+               fprintf(stderr, "Cannot select keys parent: %s\n",
+                       fdt_strerror(node));
+               ret = node;
+       }
+
+       if (!ret)
+               ret = fdt_setprop(keydest, node, "iv",
+                                 info->iv, info->cipher->iv_len);
+
+       if (!ret)
+               ret = fdt_setprop(keydest, node, "key",
+                                 info->key, info->cipher->key_len);
+
+       if (!ret)
+               ret = fdt_setprop_u32(keydest, node, "key-len",
+                                     info->cipher->key_len);
+
+done:
+       if (ret)
+               ret = ret == -FDT_ERR_NOSPACE ? -ENOSPC : -EIO;
+
+       return ret;
+}
index ec16d75e0e4cf2a2444d4a3f1e0836f18c937445..74f769d9ff893e27288a16e79567b67fbf719364 100644 (file)
@@ -137,7 +137,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
 {
        /* linebuf as a union causes proper alignment */
        union linebuf {
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                uint64_t uq[MAX_LINE_LENGTH_BYTES/sizeof(uint64_t) + 1];
 #endif
                uint32_t ui[MAX_LINE_LENGTH_BYTES/sizeof(uint32_t) + 1];
@@ -145,7 +145,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
                uint8_t  uc[MAX_LINE_LENGTH_BYTES/sizeof(uint8_t) + 1];
        } lb;
        int i;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
        uint64_t __maybe_unused x;
 #else
        uint32_t __maybe_unused x;
@@ -168,7 +168,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
                for (i = 0; i < thislinelen; i++) {
                        if (width == 4)
                                x = lb.ui[i] = *(volatile uint32_t *)data;
-#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
+#ifdef MEM_SUPPORT_64BIT_DATA
                        else if (width == 8)
                                x = lb.uq[i] = *(volatile uint64_t *)data;
 #endif
@@ -178,7 +178,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
                                x = lb.uc[i] = *(volatile uint8_t *)data;
 #if defined(CONFIG_SPL_BUILD)
                        printf(" %x", (uint)x);
-#elif defined(CONFIG_SYS_SUPPORT_64BIT_DATA)
+#elif defined(MEM_SUPPORT_64BIT_DATA)
                        printf(" %0*llx", width * 2, (long long)x);
 #else
                        printf(" %0*x", width * 2, x);
index 0047998ee0cfdfc7533ff5d40694bfcc9166c0a2..af5a878fc39ad8680e9011a927a9db8d7cdc2521 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <debug_uart.h>
 #include <dm.h>
 #include <errno.h>
index 61af3472e6a41352f3fd2f43a8d56a4b5be5e48a..17051d409c4998ad5b47382e378bd9a267eab4ce 100644 (file)
@@ -7,6 +7,8 @@
 #include <common.h>
 #include <boot_fit.h>
 #include <dm.h>
+#include <hang.h>
+#include <init.h>
 #include <dm/of_extra.h>
 #include <env.h>
 #include <errno.h>
index 4d026a3e64c15c60ba5ea58aede86f3adb26b168..578ac78d45306f949d9ee237c27b17e164c5d317 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <bootstage.h>
+#include <hang.h>
 #include <os.h>
 
 /**
index 4ccf41e4283491c7e13d921b7e1c11ef9abc270e..0bb0cc1498e5a97ab2742d20408f3966f1524800 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright (C) 2016 The Android Open Source Project
  */
 
+#include <hang.h>
 #include <stdarg.h>
 #include <stdlib.h>
 
index c883c498e1d4ce80f0d59d219caf9af503ee93a9..9b49eb8ee760ae7bb3424f5d2e6e57d6b92364fc 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <image.h>
 #include <malloc.h>
 #include <linux/libfdt.h>
 #include <tee/optee.h>
index bae8a359354216e7b8117d4364af872ebdebbd61..8e72c265a617e1f2223a008e5375829537b8c49b 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <hang.h>
 #if !defined(CONFIG_PANIC_HANG)
 #include <command.h>
 #endif
index 227343e48d3fb1305a229ac4b72559bda6351b48..609aac55ce11f015d79f805b29f3c7eec8d014cf 100644 (file)
@@ -6,6 +6,7 @@
 /* @(#) $Id$ */
 
 #include "zutil.h"
+#include <hang.h>
 
 #ifndef NO_DUMMY_DECL
 struct internal_state      {int dummy;}; /* for buggy compilers */
@@ -34,7 +35,7 @@ void z_error (m)
     char *m;
 {
        fprintf(stderr, "%s\n", m);
-       hang ();
+       hang();
 }
 #endif
 
index 5199d679a1fbfc9c3d24d3d0577d7e5a375fe4f4..d8a60b6119101526c71ab4c1ce72905fd82ea3df 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -93,6 +93,7 @@
 #include <env.h>
 #include <env_internal.h>
 #include <errno.h>
+#include <image.h>
 #include <net.h>
 #include <net/fastboot.h>
 #include <net/tftp.h>
@@ -636,7 +637,7 @@ restart:
                                printf("Bytes transferred = %d (%x hex)\n",
                                       net_boot_file_size, net_boot_file_size);
                                env_set_hex("filesize", net_boot_file_size);
-                               env_set_hex("fileaddr", load_addr);
+                               env_set_hex("fileaddr", image_load_addr);
                        }
                        if (protocol != NETCONS)
                                eth_halt();
index 97e62f1dcebae1bbde78ab9f0291ce719ce1ec89..72e1018a3bdd54a01038e5ef2ef6e56fff9461ae 100644 (file)
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -28,6 +28,8 @@
 
 #include <common.h>
 #include <command.h>
+#include <flash.h>
+#include <image.h>
 #include <net.h>
 #include <malloc.h>
 #include <mapmem.h>
@@ -87,14 +89,15 @@ static inline int store_block(uchar *src, unsigned offset, unsigned len)
 
        for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
                /* start address in flash? */
-               if (load_addr + offset >= flash_info[i].start[0]) {
+               if (image_load_addr + offset >= flash_info[i].start[0]) {
                        rc = 1;
                        break;
                }
        }
 
        if (rc) { /* Flash is destination for this packet */
-               rc = flash_write((uchar *)src, (ulong)(load_addr+offset), len);
+               rc = flash_write((uchar *)src, (ulong)image_load_addr + offset,
+                                len);
                if (rc) {
                        flash_perror(rc);
                        return -1;
@@ -102,7 +105,7 @@ static inline int store_block(uchar *src, unsigned offset, unsigned len)
        } else
 #endif /* CONFIG_SYS_DIRECT_FLASH_NFS */
        {
-               void *ptr = map_sysmem(load_addr + offset, len);
+               void *ptr = map_sysmem(image_load_addr + offset, len);
 
                memcpy(ptr, src, len);
                unmap_sysmem(ptr);
@@ -911,7 +914,7 @@ void nfs_start(void)
                       net_boot_file_expected_size_in_blocks << 9);
                print_size(net_boot_file_expected_size_in_blocks << 9, "");
        }
-       printf("\nLoad address: 0x%lx\nLoading: *\b", load_addr);
+       printf("\nLoad address: 0x%lx\nLoading: *\b", image_load_addr);
 
        net_set_timeout_handler(nfs_timeout, nfs_timeout_handler);
        net_set_udp_handler(nfs_handler);
index 1e3c18ae69c0f975e22383fcdcba18bcee0eec38..02401898c5566c089c8d35158c848c7e8e3275e3 100644 (file)
@@ -10,6 +10,7 @@
 #include <command.h>
 #include <efi_loader.h>
 #include <env.h>
+#include <image.h>
 #include <mapmem.h>
 #include <net.h>
 #include <net/tftp.h>
@@ -221,7 +222,7 @@ static int load_block(unsigned block, uchar *dst, unsigned len)
        ulong tosend = len;
 
        tosend = min(net_boot_file_size - offset, tosend);
-       (void)memcpy(dst, (void *)(save_addr + offset), tosend);
+       (void)memcpy(dst, (void *)(image_save_addr + offset), tosend);
        debug("%s: block=%d, offset=%ld, len=%d, tosend=%ld\n", __func__,
              block, offset, len, tosend);
        return tosend;
@@ -605,7 +606,7 @@ static void tftp_timeout_handler(void)
        }
 }
 
-/* Initialize tftp_load_addr and tftp_load_size from load_addr and lmb */
+/* Initialize tftp_load_addr and tftp_load_size from image_load_addr and lmb */
 static int tftp_init_load_addr(void)
 {
 #ifdef CONFIG_LMB
@@ -614,13 +615,13 @@ static int tftp_init_load_addr(void)
 
        lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
 
-       max_size = lmb_get_free_size(&lmb, load_addr);
+       max_size = lmb_get_free_size(&lmb, image_load_addr);
        if (!max_size)
                return -1;
 
        tftp_load_size = max_size;
 #endif
-       tftp_load_addr = load_addr;
+       tftp_load_addr = image_load_addr;
        return 0;
 }
 
@@ -710,9 +711,9 @@ void tftp_start(enum proto_t protocol)
 #ifdef CONFIG_CMD_TFTPPUT
        tftp_put_active = (protocol == TFTPPUT);
        if (tftp_put_active) {
-               printf("Save address: 0x%lx\n", save_addr);
-               printf("Save size:    0x%lx\n", save_size);
-               net_boot_file_size = save_size;
+               printf("Save address: 0x%lx\n", image_save_addr);
+               printf("Save size:    0x%lx\n", image_save_size);
+               net_boot_file_size = image_save_size;
                puts("Saving: *\b");
                tftp_state = STATE_SEND_WRQ;
                new_transfer();
index 5f72708214b32728d75ff8e58ccf5dcbec434a67..afd49403c2818118a81ad15f5bfc548eec289d6f 100644 (file)
@@ -4,7 +4,7 @@
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
 obj-y  += post.o
-obj-$(CONFIG_POST_STD_LIST)    += tests.o
+obj-y  += tests.o
 
 obj-y += drivers/
 obj-$(CONFIG_PPC) += lib_powerpc/
index 95c0ccc9d3ff8cce1cd3920c3706ba1a28bfb4fa..0d6dd06beaeb2ae607cc3c533d54433d17cae44d 100644 (file)
@@ -1236,7 +1236,6 @@ CONFIG_NO_WAIT
 CONFIG_NR_DRAM_POPULATED
 CONFIG_NS16550_MIN_FUNCTIONS
 CONFIG_NS8382X
-CONFIG_NS87308
 CONFIG_NUM_DSP_CPUS
 CONFIG_NUM_PAMU
 CONFIG_ODROID_REV_AIN
@@ -1348,7 +1347,6 @@ CONFIG_PMW_BASE
 CONFIG_PM_SLEEP
 CONFIG_POST
 CONFIG_POSTBOOTMENU
-CONFIG_POST_ALT_LIST
 CONFIG_POST_BSPEC1
 CONFIG_POST_BSPEC2
 CONFIG_POST_BSPEC3
@@ -1356,7 +1354,6 @@ CONFIG_POST_BSPEC4
 CONFIG_POST_BSPEC5
 CONFIG_POST_EXTERNAL_WORD_FUNCS
 CONFIG_POST_SKIP_ENV_FLAGS
-CONFIG_POST_STD_LIST
 CONFIG_POST_UART
 CONFIG_POST_WATCHDOG
 CONFIG_POWER
@@ -2291,8 +2288,6 @@ CONFIG_SYS_FAST_CLK
 CONFIG_SYS_FAULT_ECHO_LINK_DOWN
 CONFIG_SYS_FAULT_MII_ADDR
 CONFIG_SYS_FCC_PSMR
-CONFIG_SYS_FDC_DRIVE_NUMBER
-CONFIG_SYS_FDC_HW_INIT
 CONFIG_SYS_FDT_BASE
 CONFIG_SYS_FDT_LOAD_ADDR
 CONFIG_SYS_FDT_PAD
@@ -2967,8 +2962,6 @@ CONFIG_SYS_IO_BASE
 CONFIG_SYS_ISA_BASE
 CONFIG_SYS_ISA_IO
 CONFIG_SYS_ISA_IO_BASE_ADDRESS
-CONFIG_SYS_ISA_IO_OFFSET
-CONFIG_SYS_ISA_IO_STRIDE
 CONFIG_SYS_ISA_MEM
 CONFIG_SYS_JFFS2_FIRST_BANK
 CONFIG_SYS_JFFS2_FIRST_SECTOR
@@ -3328,35 +3321,6 @@ CONFIG_SYS_NS16550_MEM32
 CONFIG_SYS_NS16550_PORT_MAPPED
 CONFIG_SYS_NS16550_REG_SIZE
 CONFIG_SYS_NS16550_SERIAL
-CONFIG_SYS_NS87308_CS0_BASE
-CONFIG_SYS_NS87308_CS0_CONF
-CONFIG_SYS_NS87308_CS1_BASE
-CONFIG_SYS_NS87308_CS1_CONF
-CONFIG_SYS_NS87308_CS2_BASE
-CONFIG_SYS_NS87308_CS2_CONF
-CONFIG_SYS_NS87308_FDC
-CONFIG_SYS_NS87308_FDC_BASE
-CONFIG_SYS_NS87308_GPIO
-CONFIG_SYS_NS87308_GPIO_BASE
-CONFIG_SYS_NS87308_KBC1
-CONFIG_SYS_NS87308_KBC1_BASE
-CONFIG_SYS_NS87308_KBC2
-CONFIG_SYS_NS87308_LPT_BASE
-CONFIG_SYS_NS87308_MOUSE
-CONFIG_SYS_NS87308_PARP
-CONFIG_SYS_NS87308_PMC1
-CONFIG_SYS_NS87308_PMC2
-CONFIG_SYS_NS87308_PMC3
-CONFIG_SYS_NS87308_POWRMAN
-CONFIG_SYS_NS87308_PS2MOD
-CONFIG_SYS_NS87308_PWMAN_BASE
-CONFIG_SYS_NS87308_RARP
-CONFIG_SYS_NS87308_RTC_APC
-CONFIG_SYS_NS87308_RTC_BASE
-CONFIG_SYS_NS87308_UART1
-CONFIG_SYS_NS87308_UART1_BASE
-CONFIG_SYS_NS87308_UART2
-CONFIG_SYS_NS87308_UART2_BASE
 CONFIG_SYS_NUM_ADDR_MAP
 CONFIG_SYS_NUM_CPC
 CONFIG_SYS_NUM_FM1_10GEC
@@ -3924,7 +3888,6 @@ CONFIG_SYS_STACK_SIZE
 CONFIG_SYS_STATUS_C
 CONFIG_SYS_STATUS_OK
 CONFIG_SYS_STMICRO_BOOT
-CONFIG_SYS_SUPPORT_64BIT_DATA
 CONFIG_SYS_SXCNFG_VAL
 CONFIG_SYS_TBIPA_VALUE
 CONFIG_SYS_TCLK
index 72d2ec74b5f43d40dafc6b4b8a8cdc3a90a19393..230068d5a0019b806d5da0fc4528bc0c0570ae24 100644 (file)
@@ -8,3 +8,4 @@ obj-y += lmb.o
 obj-y += string.o
 obj-$(CONFIG_ERRNO_STR) += test_errno_str.o
 obj-$(CONFIG_UT_LIB_ASN1) += asn1.o
+obj-$(CONFIG_AES) += test_aes.o
diff --git a/test/lib/test_aes.c b/test/lib/test_aes.c
new file mode 100644 (file)
index 0000000..b7b4b77
--- /dev/null
@@ -0,0 +1,166 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2019 Philippe Reynes <philippe.reynes@softathome.com>
+ *
+ * Unit tests for aes functions
+ */
+
+#include <common.h>
+#include <command.h>
+#include <hexdump.h>
+#include <uboot_aes.h>
+#include <test/lib.h>
+#include <test/test.h>
+#include <test/ut.h>
+
+#define TEST_AES_ONE_BLOCK             0
+#define TEST_AES_CBC_CHAIN             1
+
+struct test_aes_s {
+       int key_len;
+       int key_exp_len;
+       int type;
+       int num_block;
+};
+
+static struct test_aes_s test_aes[] = {
+       { AES128_KEY_LENGTH, AES128_EXPAND_KEY_LENGTH, TEST_AES_ONE_BLOCK,  1 },
+       { AES128_KEY_LENGTH, AES128_EXPAND_KEY_LENGTH, TEST_AES_CBC_CHAIN, 16 },
+       { AES192_KEY_LENGTH, AES192_EXPAND_KEY_LENGTH, TEST_AES_ONE_BLOCK,  1 },
+       { AES192_KEY_LENGTH, AES192_EXPAND_KEY_LENGTH, TEST_AES_CBC_CHAIN, 16 },
+       { AES256_KEY_LENGTH, AES256_EXPAND_KEY_LENGTH, TEST_AES_ONE_BLOCK,  1 },
+       { AES256_KEY_LENGTH, AES256_EXPAND_KEY_LENGTH, TEST_AES_CBC_CHAIN, 16 },
+};
+
+static void rand_buf(u8 *buf, int size)
+{
+       int i;
+
+       for (i = 0; i < size; i++)
+               buf[i] = rand() & 0xff;
+}
+
+static int lib_test_aes_one_block(struct unit_test_state *uts, int key_len,
+                                 u8 *key_exp, u8 *iv, int num_block,
+                                 u8 *nocipher, u8 *ciphered, u8 *uncipher)
+{
+       aes_encrypt(key_len, nocipher, key_exp, ciphered);
+       aes_decrypt(key_len, ciphered, key_exp, uncipher);
+
+       ut_asserteq_mem(nocipher, uncipher, AES_BLOCK_LENGTH);
+
+       /* corrupt the expanded key */
+       key_exp[0]++;
+       aes_decrypt(key_len, ciphered, key_exp, uncipher);
+       ut_assertf(memcmp(nocipher, uncipher, AES_BLOCK_LENGTH),
+                  "nocipher and uncipher should be different\n");
+
+       return 0;
+}
+
+static int lib_test_aes_cbc_chain(struct unit_test_state *uts, int key_len,
+                                 u8 *key_exp, u8 *iv, int num_block,
+                                 u8 *nocipher, u8 *ciphered, u8 *uncipher)
+{
+       aes_cbc_encrypt_blocks(key_len, key_exp, iv,
+                              nocipher, ciphered, num_block);
+       aes_cbc_decrypt_blocks(key_len, key_exp, iv,
+                              ciphered, uncipher, num_block);
+
+       ut_asserteq_mem(nocipher, uncipher, num_block * AES_BLOCK_LENGTH);
+
+       /* corrupt the expanded key */
+       key_exp[0]++;
+       aes_cbc_decrypt_blocks(key_len, key_exp, iv,
+                              ciphered, uncipher, num_block);
+       ut_assertf(memcmp(nocipher, uncipher, num_block * AES_BLOCK_LENGTH),
+                  "nocipher and uncipher should be different\n");
+
+       return 0;
+}
+
+static int _lib_test_aes_run(struct unit_test_state *uts, int key_len,
+                            int key_exp_len, int type, int num_block)
+{
+       u8 *key, *key_exp, *iv;
+       u8 *nocipher, *ciphered, *uncipher;
+       int ret;
+
+       /* Allocate all the buffer */
+       key = malloc(key_len);
+       ut_assertnonnull(key);
+       key_exp = malloc(key_exp_len);
+       ut_assertnonnull(key_exp);
+       iv = malloc(AES_BLOCK_LENGTH);
+       ut_assertnonnull(iv);
+       nocipher = malloc(num_block * AES_BLOCK_LENGTH);
+       ut_assertnonnull(nocipher);
+       ciphered = malloc((num_block + 1) * AES_BLOCK_LENGTH);
+       ut_assertnonnull(ciphered);
+       uncipher = malloc((num_block + 1) * AES_BLOCK_LENGTH);
+       ut_assertnonnull(uncipher);
+
+       /* Initialize all buffer */
+       rand_buf(key, key_len);
+       rand_buf(iv, AES_BLOCK_LENGTH);
+       rand_buf(nocipher, num_block * AES_BLOCK_LENGTH);
+       memset(ciphered, 0, (num_block + 1) * AES_BLOCK_LENGTH);
+       memset(uncipher, 0, (num_block + 1) * AES_BLOCK_LENGTH);
+
+       /* Expand the key */
+       aes_expand_key(key, key_len, key_exp);
+
+       /* Encrypt and decrypt */
+       switch (type) {
+       case TEST_AES_ONE_BLOCK:
+               ret = lib_test_aes_one_block(uts, key_len, key_exp, iv,
+                                            num_block, nocipher,
+                                            ciphered, uncipher);
+               break;
+       case TEST_AES_CBC_CHAIN:
+               ret = lib_test_aes_cbc_chain(uts, key_len, key_exp, iv,
+                                            num_block, nocipher,
+                                            ciphered, uncipher);
+               break;
+       default:
+               printf("%s: unknown type (type=%d)\n", __func__, type);
+               ret = -1;
+       };
+
+       /* Free all the data */
+       free(key);
+       free(key_exp);
+       free(iv);
+       free(nocipher);
+       free(ciphered);
+       free(uncipher);
+
+       return ret;
+}
+
+static int lib_test_aes_run(struct unit_test_state *uts,
+                           struct test_aes_s *test)
+{
+       int key_len = test->key_len;
+       int key_exp_len = test->key_exp_len;
+       int type = test->type;
+       int num_block = test->num_block;
+
+       return _lib_test_aes_run(uts, key_len, key_exp_len,
+                                type, num_block);
+}
+
+static int lib_test_aes(struct unit_test_state *uts)
+{
+       int i, ret = 0;
+
+       for (i = 0; i < ARRAY_SIZE(test_aes); i++) {
+               ret = lib_test_aes_run(uts, &test_aes[i]);
+               if (ret)
+                       break;
+       }
+
+       return ret;
+}
+
+LIB_TEST(lib_test_aes, 0);
index 345bc84e48db32173c69457d360acf8bf9638c58..99be724b82a554b761c363d63010a4fa14d64956 100644 (file)
@@ -59,6 +59,7 @@ hostprogs-$(CONFIG_CMD_BOOTEFI_SELFTEST) += file2include
 
 FIT_OBJS-$(CONFIG_FIT) := fit_common.o fit_image.o image-host.o common/image-fit.o
 FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o
+FIT_CIPHER_OBJS-$(CONFIG_FIT_CIPHER) := common/image-cipher.o
 
 # The following files are synced with upstream DTC.
 # Use synced versions from scripts/dtc/libfdt/.
@@ -75,6 +76,9 @@ RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
                                        rsa-sign.o rsa-verify.o rsa-checksum.o \
                                        rsa-mod-exp.o)
 
+AES_OBJS-$(CONFIG_FIT_CIPHER) := $(addprefix lib/aes/, \
+                                       aes-encrypt.o aes-decrypt.o)
+
 ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o
 
 # common objs for dumpimage and mkimage
@@ -82,6 +86,7 @@ dumpimage-mkimage-objs := aisimage.o \
                        atmelimage.o \
                        $(FIT_OBJS-y) \
                        $(FIT_SIG_OBJS-y) \
+                       $(FIT_CIPHER_OBJS-y) \
                        common/bootm.o \
                        lib/crc32.o \
                        default_image.o \
@@ -116,7 +121,8 @@ dumpimage-mkimage-objs := aisimage.o \
                        gpimage.o \
                        gpimage-common.o \
                        mtk_image.o \
-                       $(RSA_OBJS-y)
+                       $(RSA_OBJS-y) \
+                       $(AES_OBJS-y)
 
 dumpimage-objs := $(dumpimage-mkimage-objs) dumpimage.o
 mkimage-objs   := $(dumpimage-mkimage-objs) mkimage.o
@@ -137,6 +143,12 @@ HOST_EXTRACFLAGS   += -DCONFIG_FIT_SIGNATURE
 HOST_EXTRACFLAGS       += -DCONFIG_FIT_SIGNATURE_MAX_SIZE=$(CONFIG_FIT_SIGNATURE_MAX_SIZE)
 endif
 
+ifdef CONFIG_FIT_CIPHER
+# This affects include/image.h, but including the board config file
+# is tricky, so manually define this options here.
+HOST_EXTRACFLAGS       += -DCONFIG_FIT_CIPHER
+endif
+
 ifdef CONFIG_SYS_U_BOOT_OFFS
 HOSTCFLAGS_kwbimage.o += -DCONFIG_SYS_U_BOOT_OFFS=$(CONFIG_SYS_U_BOOT_OFFS)
 endif
index 6aa4b1c7330a8cd040b34bd5301a529a0b927ce1..dd61a816c93f65c141326f28ad9eea0028ed7488 100644 (file)
@@ -58,6 +58,14 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc,
                ret = fit_set_timestamp(ptr, 0, time);
        }
 
+       if (!ret) {
+               ret = fit_cipher_data(params->keydir, dest_blob, ptr,
+                                     params->comment,
+                                     params->require_keys,
+                                     params->engine_id,
+                                     params->cmdname);
+       }
+
        if (!ret) {
                ret = fit_add_verification_data(params->keydir, dest_blob, ptr,
                                                params->comment,
@@ -74,7 +82,6 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc,
 err_keydest:
        munmap(ptr, sbuf.st_size);
        close(tfd);
-
        return ret;
 }
 
@@ -621,6 +628,62 @@ err_no_fd:
        return ret;
 }
 
+static int copyfile(const char *src, const char *dst)
+{
+       int fd_src = -1, fd_dst = -1;
+       void *buf = NULL;
+       ssize_t size;
+       size_t count;
+       int ret = -1;
+
+       fd_src = open(src, O_RDONLY);
+       if (fd_src < 0) {
+               printf("Can't open file %s (%s)\n", src, strerror(errno));
+               goto out;
+       }
+
+       fd_dst = open(dst, O_WRONLY | O_CREAT, 0700);
+       if (fd_dst < 0) {
+               printf("Can't open file %s (%s)\n", dst, strerror(errno));
+               goto out;
+       }
+
+       buf = malloc(512);
+       if (!buf) {
+               printf("Can't allocate buffer to copy file\n");
+               goto out;
+       }
+
+       while (1) {
+               size = read(fd_src, buf, 512);
+               if (size < 0) {
+                       printf("Can't read file %s\n", src);
+                       goto out;
+               }
+               if (!size)
+                       break;
+
+               count = size;
+               size = write(fd_dst, buf, count);
+               if (size < 0) {
+                       printf("Can't write file %s\n", dst);
+                       goto out;
+               }
+       }
+
+       ret = 0;
+
+ out:
+       if (fd_src >= 0)
+               close(fd_src);
+       if (fd_dst >= 0)
+               close(fd_dst);
+       if (buf)
+               free(buf);
+
+       return ret;
+}
+
 /**
  * fit_handle_file - main FIT file processing function
  *
@@ -636,6 +699,7 @@ err_no_fd:
 static int fit_handle_file(struct image_tool_params *params)
 {
        char tmpfile[MKIMAGE_MAX_TMPFILE_LEN];
+       char bakfile[MKIMAGE_MAX_TMPFILE_LEN + 4] = {0};
        char cmd[MKIMAGE_MAX_DTC_CMDLINE_LEN];
        size_t size_inc;
        int ret;
@@ -670,6 +734,7 @@ static int fit_handle_file(struct image_tool_params *params)
                snprintf(cmd, sizeof(cmd), "cp \"%s\" \"%s\"",
                         params->imagefile, tmpfile);
        }
+
        if (*cmd && system(cmd) == -1) {
                fprintf (stderr, "%s: system(%s) failed: %s\n",
                                params->cmdname, cmd, strerror(errno));
@@ -681,6 +746,14 @@ static int fit_handle_file(struct image_tool_params *params)
        if (ret)
                goto err_system;
 
+       /*
+        * Copy the tmpfile to bakfile, then in the following loop
+        * we copy bakfile to tmpfile. So we always start from the
+        * beginning.
+        */
+       sprintf(bakfile, "%s%s", tmpfile, ".bak");
+       rename(tmpfile, bakfile);
+
        /*
         * Set hashes for images in the blob. Unfortunately we may need more
         * space in either FDT, so keep trying until we succeed.
@@ -692,6 +765,11 @@ static int fit_handle_file(struct image_tool_params *params)
         * steps of this loop is enough to sign with several keys.
         */
        for (size_inc = 0; size_inc < 64 * 1024; size_inc += 1024) {
+               if (copyfile(bakfile, tmpfile) < 0) {
+                       printf("Can't copy %s to %s\n", bakfile, tmpfile);
+                       ret = -EIO;
+                       break;
+               }
                ret = fit_add_file_data(params, size_inc, tmpfile);
                if (!ret || ret != -ENOSPC)
                        break;
@@ -715,13 +793,16 @@ static int fit_handle_file(struct image_tool_params *params)
                                params->cmdname, tmpfile, params->imagefile,
                                strerror (errno));
                unlink (tmpfile);
+               unlink(bakfile);
                unlink (params->imagefile);
                return EXIT_FAILURE;
        }
+       unlink(bakfile);
        return EXIT_SUCCESS;
 
 err_system:
        unlink(tmpfile);
+       unlink(bakfile);
        return -1;
 }
 
index 88b329502ca3a56e6a1349f3312cfab2e4117143..9483561bfa518487366a131d81d2c94d509081f1 100644 (file)
@@ -12,6 +12,7 @@
 #include <bootm.h>
 #include <image.h>
 #include <version.h>
+#include <uboot_aes.h>
 
 /**
  * fit_set_hash_value - set hash value in requested has node
@@ -268,6 +269,262 @@ static int fit_image_process_sig(const char *keydir, void *keydest,
        return 0;
 }
 
+static int fit_image_read_data(char *filename, unsigned char *data,
+                              int expected_size)
+{
+       struct stat sbuf;
+       int fd, ret = -1;
+       ssize_t n;
+
+       /* Open file */
+       fd = open(filename, O_RDONLY | O_BINARY);
+       if (fd < 0) {
+               printf("Can't open file %s (err=%d => %s)\n",
+                      filename, errno, strerror(errno));
+               return -1;
+       }
+
+       /* Compute file size */
+       if (fstat(fd, &sbuf) < 0) {
+               printf("Can't fstat file %s (err=%d => %s)\n",
+                      filename, errno, strerror(errno));
+               goto err;
+       }
+
+       /* Check file size */
+       if (sbuf.st_size != expected_size) {
+               printf("File %s don't have the expected size (size=%ld, expected=%d)\n",
+                      filename, sbuf.st_size, expected_size);
+               goto err;
+       }
+
+       /* Read data */
+       n = read(fd, data, sbuf.st_size);
+       if (n < 0) {
+               printf("Can't read file %s (err=%d => %s)\n",
+                      filename, errno, strerror(errno));
+               goto err;
+       }
+
+       /* Check that we have read all the file */
+       if (n != sbuf.st_size) {
+               printf("Can't read all file %s (read %ld bytes, expexted %ld)\n",
+                      filename, n, sbuf.st_size);
+               goto err;
+       }
+
+       ret = 0;
+
+err:
+       close(fd);
+       return ret;
+}
+
+static int fit_image_setup_cipher(struct image_cipher_info *info,
+                                 const char *keydir, void *fit,
+                                 const char *image_name, int image_noffset,
+                                 const char *node_name, int noffset)
+{
+       char *algo_name;
+       char filename[128];
+       int ret = -1;
+
+       if (fit_image_cipher_get_algo(fit, noffset, &algo_name)) {
+               printf("Can't get algo name for cipher '%s' in image '%s'\n",
+                      node_name, image_name);
+               goto out;
+       }
+
+       info->keydir = keydir;
+
+       /* Read the key name */
+       info->keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
+       if (!info->keyname) {
+               printf("Can't get key name for cipher '%s' in image '%s'\n",
+                      node_name, image_name);
+               goto out;
+       }
+
+       /* Read the IV name */
+       info->ivname = fdt_getprop(fit, noffset, "iv-name-hint", NULL);
+       if (!info->ivname) {
+               printf("Can't get iv name for cipher '%s' in image '%s'\n",
+                      node_name, image_name);
+               goto out;
+       }
+
+       info->fit = fit;
+       info->node_noffset = noffset;
+       info->name = algo_name;
+
+       info->cipher = image_get_cipher_algo(algo_name);
+       if (!info->cipher) {
+               printf("Can't get algo for cipher '%s'\n", image_name);
+               goto out;
+       }
+
+       /* Read the key in the file */
+       snprintf(filename, sizeof(filename), "%s/%s%s",
+                info->keydir, info->keyname, ".bin");
+       info->key = malloc(info->cipher->key_len);
+       if (!info->key) {
+               printf("Can't allocate memory for key\n");
+               ret = -1;
+               goto out;
+       }
+       ret = fit_image_read_data(filename, (unsigned char *)info->key,
+                                 info->cipher->key_len);
+       if (ret < 0)
+               goto out;
+
+       /* Read the IV in the file */
+       snprintf(filename, sizeof(filename), "%s/%s%s",
+                info->keydir, info->ivname, ".bin");
+       info->iv = malloc(info->cipher->iv_len);
+       if (!info->iv) {
+               printf("Can't allocate memory for iv\n");
+               ret = -1;
+               goto out;
+       }
+       ret = fit_image_read_data(filename, (unsigned char *)info->iv,
+                                 info->cipher->iv_len);
+
+ out:
+       return ret;
+}
+
+int fit_image_write_cipher(void *fit, int image_noffset, int noffset,
+                          const void *data, size_t size,
+                          unsigned char *data_ciphered, int data_ciphered_len)
+{
+       int ret = -1;
+
+       /* Remove unciphered data */
+       ret = fdt_delprop(fit, image_noffset, FIT_DATA_PROP);
+       if (ret) {
+               printf("Can't remove data (err = %d)\n", ret);
+               goto out;
+       }
+
+       /* Add ciphered data */
+       ret = fdt_setprop(fit, image_noffset, FIT_DATA_PROP,
+                         data_ciphered, data_ciphered_len);
+       if (ret) {
+               printf("Can't add ciphered data (err = %d)\n", ret);
+               goto out;
+       }
+
+       /* add non ciphered data size */
+       ret = fdt_setprop_u32(fit, image_noffset, "data-size-unciphered", size);
+       if (ret) {
+               printf("Can't add unciphered data size (err = %d)\n", ret);
+               goto out;
+       }
+
+ out:
+       return ret;
+}
+
+static int
+fit_image_process_cipher(const char *keydir, void *keydest, void *fit,
+                        const char *image_name, int image_noffset,
+                        const char *node_name, int node_noffset,
+                        const void *data, size_t size,
+                        const char *cmdname)
+{
+       struct image_cipher_info info;
+       unsigned char *data_ciphered = NULL;
+       int data_ciphered_len;
+       int ret;
+
+       memset(&info, 0, sizeof(info));
+
+       ret = fit_image_setup_cipher(&info, keydir, fit, image_name,
+                                    image_noffset, node_name, node_noffset);
+       if (ret)
+               goto out;
+
+       ret = info.cipher->encrypt(&info, data, size,
+                                   &data_ciphered, &data_ciphered_len);
+       if (ret)
+               goto out;
+
+       /*
+        * Write the public key into the supplied FDT file; this might fail
+        * several times, since we try signing with successively increasing
+        * size values
+        */
+       if (keydest) {
+               ret = info.cipher->add_cipher_data(&info, keydest);
+               if (ret) {
+                       printf("Failed to add verification data for cipher '%s' in image '%s'\n",
+                              info.keyname, image_name);
+                       goto out;
+               }
+       }
+
+       ret = fit_image_write_cipher(fit, image_noffset, node_noffset,
+                                    data, size,
+                                    data_ciphered, data_ciphered_len);
+
+ out:
+       free(data_ciphered);
+       free((void *)info.key);
+       free((void *)info.iv);
+       return ret;
+}
+
+int fit_image_cipher_data(const char *keydir, void *keydest,
+                         void *fit, int image_noffset, const char *comment,
+                         int require_keys, const char *engine_id,
+                         const char *cmdname)
+{
+       const char *image_name;
+       const void *data;
+       size_t size;
+       int node_noffset;
+
+       /* Get image name */
+       image_name = fit_get_name(fit, image_noffset, NULL);
+       if (!image_name) {
+               printf("Can't get image name\n");
+               return -1;
+       }
+
+       /* Get image data and data length */
+       if (fit_image_get_data(fit, image_noffset, &data, &size)) {
+               printf("Can't get image data/size\n");
+               return -1;
+       }
+
+       /* Process all hash subnodes of the component image node */
+       for (node_noffset = fdt_first_subnode(fit, image_noffset);
+            node_noffset >= 0;
+            node_noffset = fdt_next_subnode(fit, node_noffset)) {
+               const char *node_name;
+               int ret = 0;
+
+               node_name = fit_get_name(fit, node_noffset, NULL);
+               if (!node_name) {
+                       printf("Can't get node name\n");
+                       return -1;
+               }
+
+               if (IMAGE_ENABLE_ENCRYPT && keydir &&
+                   !strncmp(node_name, FIT_CIPHER_NODENAME,
+                            strlen(FIT_CIPHER_NODENAME)))
+                       ret = fit_image_process_cipher(keydir, keydest,
+                                                      fit, image_name,
+                                                      image_noffset,
+                                                      node_name, node_noffset,
+                                                      data, size, cmdname);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
+}
+
 /**
  * fit_image_add_verification_data() - calculate/set verig. data for image node
  *
@@ -675,6 +932,41 @@ static int fit_config_add_verification_data(const char *keydir, void *keydest,
        return 0;
 }
 
+int fit_cipher_data(const char *keydir, void *keydest, void *fit,
+                   const char *comment, int require_keys,
+                   const char *engine_id, const char *cmdname)
+{
+       int images_noffset;
+       int noffset;
+       int ret;
+
+       /* Find images parent node offset */
+       images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
+       if (images_noffset < 0) {
+               printf("Can't find images parent node '%s' (%s)\n",
+                      FIT_IMAGES_PATH, fdt_strerror(images_noffset));
+               return images_noffset;
+       }
+
+       /* Process its subnodes, print out component images details */
+       for (noffset = fdt_first_subnode(fit, images_noffset);
+            noffset >= 0;
+            noffset = fdt_next_subnode(fit, noffset)) {
+               /*
+                * Direct child node of the images parent node,
+                * i.e. component image node.
+                */
+               ret = fit_image_cipher_data(keydir, keydest,
+                                           fit, noffset, comment,
+                                           require_keys, engine_id,
+                                           cmdname);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
+}
+
 int fit_add_verification_data(const char *keydir, void *keydest, void *fit,
                              const char *comment, int require_keys,
                              const char *engine_id, const char *cmdname)