]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Merge branch 'master' of git://git.denx.de/u-boot
authorStefano Babic <sbabic@denx.de>
Tue, 29 Nov 2016 15:28:28 +0000 (16:28 +0100)
committerStefano Babic <sbabic@denx.de>
Tue, 29 Nov 2016 15:28:28 +0000 (16:28 +0100)
Signed-off-by: Stefano Babic <sbabic@denx.de>
528 files changed:
.travis.yml
Kconfig
MAINTAINERS
Makefile
README
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/config.mk
arch/arm/cpu/arm1176/start.S
arch/arm/cpu/armv7/Makefile
arch/arm/cpu/armv7/omap3/config.mk [deleted file]
arch/arm/cpu/armv7/omap4/config.mk [deleted file]
arch/arm/cpu/armv7/omap5/config.mk [deleted file]
arch/arm/cpu/armv8/Kconfig
arch/arm/cpu/armv8/config.mk
arch/arm/cpu/armv8/fsl-layerscape/cpu.c
arch/arm/cpu/armv8/fsl-layerscape/cpu.h
arch/arm/cpu/armv8/fsl-layerscape/doc/README.qspi [new file with mode: 0644]
arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc
arch/arm/cpu/armv8/fsl-layerscape/fdt.c
arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
arch/arm/cpu/armv8/fsl-layerscape/ls2080a_serdes.c
arch/arm/cpu/armv8/fsl-layerscape/mp.c
arch/arm/cpu/armv8/fsl-layerscape/soc.c
arch/arm/cpu/armv8/sec_firmware_asm.S
arch/arm/cpu/armv8/start.S
arch/arm/cpu/armv8/transition.S
arch/arm/cpu/armv8/zynqmp/Kconfig
arch/arm/cpu/armv8/zynqmp/spl.c
arch/arm/dts/Makefile
arch/arm/dts/fsl-ls1046a-qds-lpuart.dts [new file with mode: 0644]
arch/arm/dts/fsl-ls1046a-qds.dtsi
arch/arm/dts/fsl-ls1046a.dtsi
arch/arm/dts/ls1021a-iot-duart.dts [new file with mode: 0644]
arch/arm/dts/ls1021a-iot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3036-sdk.dts
arch/arm/dts/rk3288-veyron-chromebook.dtsi
arch/arm/dts/rk3288-veyron-jerry.dts [moved from arch/arm/dts/rk3288-jerry.dts with 92% similarity]
arch/arm/dts/rk3288-veyron-mickey.dts [new file with mode: 0644]
arch/arm/dts/rk3288-veyron-minnie.dts [new file with mode: 0644]
arch/arm/dts/rk3288-veyron.dtsi
arch/arm/dts/sun8i-r16-nintendo-nes-classic-edition.dts [new file with mode: 0644]
arch/arm/dts/zynq-7000.dtsi
arch/arm/dts/zynq-microzed.dts
arch/arm/dts/zynq-picozed.dts
arch/arm/dts/zynq-topic-miami.dts [new file with mode: 0644]
arch/arm/dts/zynq-topic-miamiplus.dts [new file with mode: 0644]
arch/arm/dts/zynq-zc702.dts
arch/arm/dts/zynq-zc706.dts
arch/arm/dts/zynq-zc770-xm010.dts
arch/arm/dts/zynq-zc770-xm011.dts
arch/arm/dts/zynq-zc770-xm012.dts
arch/arm/dts/zynq-zc770-xm013.dts
arch/arm/dts/zynq-zed.dts
arch/arm/dts/zynq-zybo.dts
arch/arm/dts/zynqmp-clk.dtsi
arch/arm/dts/zynqmp-ep108-clk.dtsi
arch/arm/dts/zynqmp-ep108.dts
arch/arm/dts/zynqmp-zc1751-xm015-dc1.dts
arch/arm/dts/zynqmp-zc1751-xm016-dc2.dts
arch/arm/dts/zynqmp-zc1751-xm018-dc4.dts
arch/arm/dts/zynqmp-zc1751-xm019-dc5.dts
arch/arm/dts/zynqmp-zcu102.dts
arch/arm/dts/zynqmp.dtsi
arch/arm/include/asm/arch-am33xx/sys_proto.h
arch/arm/include/asm/arch-fsl-layerscape/config.h
arch/arm/include/asm/arch-fsl-layerscape/cpu.h
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
arch/arm/include/asm/arch-fsl-layerscape/mp.h
arch/arm/include/asm/arch-fsl-layerscape/soc.h
arch/arm/include/asm/arch-mvebu/spi.h
arch/arm/include/asm/arch-zynqmp/hardware.h
arch/arm/include/asm/global_data.h
arch/arm/include/asm/macro.h
arch/arm/include/asm/system.h
arch/arm/include/asm/ti-common/sys_proto.h
arch/arm/include/asm/u-boot-arm.h
arch/arm/lib/Makefile
arch/arm/lib/bootm.c
arch/arm/lib/crt0_aarch64_efi.S [new file with mode: 0644]
arch/arm/lib/crt0_arm_efi.S [new file with mode: 0644]
arch/arm/lib/elf_aarch64_efi.lds [new file with mode: 0644]
arch/arm/lib/elf_arm_efi.lds [new file with mode: 0644]
arch/arm/lib/reloc_aarch64_efi.c [new file with mode: 0644]
arch/arm/lib/reloc_arm_efi.c [new file with mode: 0644]
arch/arm/lib/relocate.S
arch/arm/lib/relocate_64.S
arch/arm/mach-exynos/Kconfig
arch/arm/mach-exynos/soc.c
arch/arm/mach-keystone/Makefile
arch/arm/mach-omap2/Kconfig [moved from arch/arm/cpu/armv7/omap-common/Kconfig with 68% similarity]
arch/arm/mach-omap2/Makefile [moved from arch/arm/cpu/armv7/omap-common/Makefile with 80% similarity]
arch/arm/mach-omap2/abb.c [moved from arch/arm/cpu/armv7/omap-common/abb.c with 100% similarity]
arch/arm/mach-omap2/am33xx/Kconfig [moved from arch/arm/cpu/armv7/am33xx/Kconfig with 100% similarity]
arch/arm/mach-omap2/am33xx/Makefile [moved from arch/arm/cpu/armv7/am33xx/Makefile with 100% similarity]
arch/arm/mach-omap2/am33xx/board.c [moved from arch/arm/cpu/armv7/am33xx/board.c with 96% similarity]
arch/arm/mach-omap2/am33xx/clk_synthesizer.c [moved from arch/arm/cpu/armv7/am33xx/clk_synthesizer.c with 100% similarity]
arch/arm/mach-omap2/am33xx/clock.c [moved from arch/arm/cpu/armv7/am33xx/clock.c with 98% similarity]
arch/arm/mach-omap2/am33xx/clock_am33xx.c [moved from arch/arm/cpu/armv7/am33xx/clock_am33xx.c with 100% similarity]
arch/arm/mach-omap2/am33xx/clock_am43xx.c [moved from arch/arm/cpu/armv7/am33xx/clock_am43xx.c with 100% similarity]
arch/arm/mach-omap2/am33xx/clock_ti814x.c [moved from arch/arm/cpu/armv7/am33xx/clock_ti814x.c with 99% similarity]
arch/arm/mach-omap2/am33xx/clock_ti816x.c [moved from arch/arm/cpu/armv7/am33xx/clock_ti816x.c with 99% similarity]
arch/arm/mach-omap2/am33xx/ddr.c [moved from arch/arm/cpu/armv7/am33xx/ddr.c with 100% similarity]
arch/arm/mach-omap2/am33xx/emif4.c [moved from arch/arm/cpu/armv7/am33xx/emif4.c with 100% similarity]
arch/arm/mach-omap2/am33xx/mux.c [moved from arch/arm/cpu/armv7/am33xx/mux.c with 100% similarity]
arch/arm/mach-omap2/am33xx/sys_info.c [moved from arch/arm/cpu/armv7/am33xx/sys_info.c with 100% similarity]
arch/arm/mach-omap2/am33xx/u-boot-spl.lds [moved from arch/arm/cpu/armv7/am33xx/u-boot-spl.lds with 100% similarity]
arch/arm/mach-omap2/boot-common.c [moved from arch/arm/cpu/armv7/omap-common/boot-common.c with 100% similarity]
arch/arm/mach-omap2/clocks-common.c [moved from arch/arm/cpu/armv7/omap-common/clocks-common.c with 100% similarity]
arch/arm/mach-omap2/config.mk [moved from arch/arm/cpu/armv7/am33xx/config.mk with 69% similarity]
arch/arm/mach-omap2/config_secure.mk [moved from arch/arm/cpu/armv7/omap-common/config_secure.mk with 100% similarity]
arch/arm/mach-omap2/emif-common.c [moved from arch/arm/cpu/armv7/omap-common/emif-common.c with 100% similarity]
arch/arm/mach-omap2/hwinit-common.c [moved from arch/arm/cpu/armv7/omap-common/hwinit-common.c with 100% similarity]
arch/arm/mach-omap2/lowlevel_init.S [moved from arch/arm/cpu/armv7/omap-common/lowlevel_init.S with 100% similarity]
arch/arm/mach-omap2/mem-common.c [moved from arch/arm/cpu/armv7/omap-common/mem-common.c with 100% similarity]
arch/arm/mach-omap2/omap-cache.c [moved from arch/arm/cpu/armv7/omap-common/omap-cache.c with 100% similarity]
arch/arm/mach-omap2/omap3/Kconfig [moved from arch/arm/cpu/armv7/omap3/Kconfig with 100% similarity]
arch/arm/mach-omap2/omap3/Makefile [moved from arch/arm/cpu/armv7/omap3/Makefile with 100% similarity]
arch/arm/mach-omap2/omap3/am35x_musb.c [moved from arch/arm/cpu/armv7/omap3/am35x_musb.c with 100% similarity]
arch/arm/mach-omap2/omap3/board.c [moved from arch/arm/cpu/armv7/omap3/board.c with 100% similarity]
arch/arm/mach-omap2/omap3/boot.c [moved from arch/arm/cpu/armv7/omap3/boot.c with 100% similarity]
arch/arm/mach-omap2/omap3/clock.c [moved from arch/arm/cpu/armv7/omap3/clock.c with 100% similarity]
arch/arm/mach-omap2/omap3/emac.c [moved from arch/arm/cpu/armv7/omap3/emac.c with 100% similarity]
arch/arm/mach-omap2/omap3/emif4.c [moved from arch/arm/cpu/armv7/omap3/emif4.c with 100% similarity]
arch/arm/mach-omap2/omap3/lowlevel_init.S [moved from arch/arm/cpu/armv7/omap3/lowlevel_init.S with 100% similarity]
arch/arm/mach-omap2/omap3/sdrc.c [moved from arch/arm/cpu/armv7/omap3/sdrc.c with 100% similarity]
arch/arm/mach-omap2/omap3/spl_id_nand.c [moved from arch/arm/cpu/armv7/omap3/spl_id_nand.c with 100% similarity]
arch/arm/mach-omap2/omap3/sys_info.c [moved from arch/arm/cpu/armv7/omap3/sys_info.c with 100% similarity]
arch/arm/mach-omap2/omap4/Kconfig [moved from arch/arm/cpu/armv7/omap4/Kconfig with 100% similarity]
arch/arm/mach-omap2/omap4/Makefile [moved from arch/arm/cpu/armv7/omap4/Makefile with 100% similarity]
arch/arm/mach-omap2/omap4/boot.c [moved from arch/arm/cpu/armv7/omap4/boot.c with 100% similarity]
arch/arm/mach-omap2/omap4/emif.c [moved from arch/arm/cpu/armv7/omap4/emif.c with 100% similarity]
arch/arm/mach-omap2/omap4/hw_data.c [moved from arch/arm/cpu/armv7/omap4/hw_data.c with 100% similarity]
arch/arm/mach-omap2/omap4/hwinit.c [moved from arch/arm/cpu/armv7/omap4/hwinit.c with 100% similarity]
arch/arm/mach-omap2/omap4/prcm-regs.c [moved from arch/arm/cpu/armv7/omap4/prcm-regs.c with 100% similarity]
arch/arm/mach-omap2/omap4/sdram_elpida.c [moved from arch/arm/cpu/armv7/omap4/sdram_elpida.c with 100% similarity]
arch/arm/mach-omap2/omap5/Kconfig [moved from arch/arm/cpu/armv7/omap5/Kconfig with 100% similarity]
arch/arm/mach-omap2/omap5/Makefile [moved from arch/arm/cpu/armv7/omap5/Makefile with 100% similarity]
arch/arm/mach-omap2/omap5/abb.c [moved from arch/arm/cpu/armv7/omap5/abb.c with 100% similarity]
arch/arm/mach-omap2/omap5/boot.c [moved from arch/arm/cpu/armv7/omap5/boot.c with 100% similarity]
arch/arm/mach-omap2/omap5/dra7xx_iodelay.c [moved from arch/arm/cpu/armv7/omap5/dra7xx_iodelay.c with 100% similarity]
arch/arm/mach-omap2/omap5/emif.c [moved from arch/arm/cpu/armv7/omap5/emif.c with 100% similarity]
arch/arm/mach-omap2/omap5/fdt.c [moved from arch/arm/cpu/armv7/omap5/fdt.c with 100% similarity]
arch/arm/mach-omap2/omap5/hw_data.c [moved from arch/arm/cpu/armv7/omap5/hw_data.c with 100% similarity]
arch/arm/mach-omap2/omap5/hwinit.c [moved from arch/arm/cpu/armv7/omap5/hwinit.c with 100% similarity]
arch/arm/mach-omap2/omap5/prcm-regs.c [moved from arch/arm/cpu/armv7/omap5/prcm-regs.c with 100% similarity]
arch/arm/mach-omap2/omap5/sdram.c [moved from arch/arm/cpu/armv7/omap5/sdram.c with 100% similarity]
arch/arm/mach-omap2/omap5/sec-fxns.c [moved from arch/arm/cpu/armv7/omap5/sec-fxns.c with 100% similarity]
arch/arm/mach-omap2/pipe3-phy.c [moved from arch/arm/cpu/armv7/omap-common/pipe3-phy.c with 100% similarity]
arch/arm/mach-omap2/pipe3-phy.h [moved from arch/arm/cpu/armv7/omap-common/pipe3-phy.h with 100% similarity]
arch/arm/mach-omap2/reset.c [moved from arch/arm/cpu/armv7/omap-common/reset.c with 100% similarity]
arch/arm/mach-omap2/sata.c [moved from arch/arm/cpu/armv7/omap-common/sata.c with 100% similarity]
arch/arm/mach-omap2/sec-common.c [moved from arch/arm/cpu/armv7/omap-common/sec-common.c with 100% similarity]
arch/arm/mach-omap2/timer.c [moved from arch/arm/cpu/armv7/omap-common/timer.c with 100% similarity]
arch/arm/mach-omap2/u-boot-spl.lds [moved from arch/arm/cpu/armv7/omap-common/u-boot-spl.lds with 100% similarity]
arch/arm/mach-omap2/utils.c [moved from arch/arm/cpu/armv7/omap-common/utils.c with 100% similarity]
arch/arm/mach-omap2/vc.c [moved from arch/arm/cpu/armv7/omap-common/vc.c with 100% similarity]
arch/arm/mach-rmobile/lowlevel_init_gen3.S
arch/arm/mach-rockchip/Kconfig
arch/arm/mach-rockchip/rk3288-board-spl.c
arch/arm/mach-rockchip/rk3288-board.c
arch/arm/mach-rockchip/rk3288/Kconfig
arch/arm/mach-zynq/Kconfig
arch/arm/mach-zynq/slcr.c
arch/powerpc/cpu/mpc512x/start.S
arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
arch/x86/config.mk
arch/x86/include/asm/u-boot-x86.h
arch/x86/lib/Makefile
arch/x86/lib/bootm.c
arch/x86/lib/crt0_ia32_efi.S [moved from arch/x86/lib/efi/crt0-efi-ia32.S with 100% similarity]
arch/x86/lib/crt0_x86_64_efi.S [moved from arch/x86/lib/efi/crt0-efi-x86_64.S with 100% similarity]
arch/x86/lib/efi/Makefile
arch/x86/lib/elf_ia32_efi.lds [moved from arch/x86/cpu/efi/elf_ia32_efi.lds with 98% similarity]
arch/x86/lib/elf_x86_64_efi.lds [moved from arch/x86/cpu/efi/elf_x86_64_efi.lds with 98% similarity]
arch/x86/lib/reloc_ia32_efi.c [moved from arch/x86/lib/efi/reloc_ia32.c with 100% similarity]
arch/x86/lib/reloc_x86_64_efi.c [moved from arch/x86/lib/efi/reloc_x86_64.c with 100% similarity]
arch/x86/lib/tables.c
board/freescale/ls1021aiot/Kconfig [new file with mode: 0644]
board/freescale/ls1021aiot/MAINTAINERS [new file with mode: 0644]
board/freescale/ls1021aiot/Makefile [new file with mode: 0644]
board/freescale/ls1021aiot/README [new file with mode: 0644]
board/freescale/ls1021aiot/dcu.c [new file with mode: 0644]
board/freescale/ls1021aiot/ls1021aiot.c [new file with mode: 0644]
board/freescale/ls1021aiot/ls102xa_pbi.cfg [new file with mode: 0644]
board/freescale/ls1021aiot/ls102xa_rcw_sd.cfg [new file with mode: 0644]
board/freescale/ls1021aiot/psci.S [new file with mode: 0644]
board/freescale/ls1021aqds/ls102xa_rcw_nand.cfg
board/freescale/ls1021aqds/ls102xa_rcw_sd_ifc.cfg
board/freescale/ls1021aqds/ls102xa_rcw_sd_qspi.cfg
board/freescale/ls1021atwr/ls102xa_rcw_sd_ifc.cfg
board/freescale/ls1021atwr/ls102xa_rcw_sd_qspi.cfg
board/freescale/ls1046aqds/ls1046aqds.c
board/freescale/ls2080a/MAINTAINERS
board/freescale/ls2080a/ls2080a.c
board/freescale/ls2080aqds/MAINTAINERS
board/freescale/ls2080aqds/README
board/freescale/ls2080aqds/eth.c
board/freescale/ls2080aqds/ls2080aqds.c
board/freescale/ls2080ardb/MAINTAINERS
board/freescale/ls2080ardb/README
board/freescale/ls2080ardb/ls2080ardb.c
board/google/chromebook_jerry/Kconfig [deleted file]
board/google/chromebook_jerry/MAINTAINERS [deleted file]
board/google/chromebook_jerry/jerry.c [deleted file]
board/google/veyron/Kconfig [new file with mode: 0644]
board/google/veyron/MAINTAINERS [new file with mode: 0644]
board/google/veyron/Makefile [moved from board/google/chromebook_jerry/Makefile with 81% similarity]
board/google/veyron/veyron.c [new file with mode: 0644]
board/raspberrypi/rpi/Makefile
board/raspberrypi/rpi/lowlevel_init.S [new file with mode: 0644]
board/raspberrypi/rpi/rpi.c
board/rockchip/evb_rk3399/evb-rk3399.c
board/sunxi/MAINTAINERS
board/ti/am335x/board.c
board/ti/am43xx/board.c
board/ti/am57xx/board.c
board/ti/ks2_evm/Makefile
board/topic/zynq/MAINTAINERS [new file with mode: 0644]
board/topic/zynq/Makefile [new file with mode: 0644]
board/topic/zynq/board.c [new file with mode: 0644]
board/topic/zynq/ps7_init_common.c [new file with mode: 0644]
board/topic/zynq/ps7_init_gpl.h [new file with mode: 0644]
board/topic/zynq/zynq-topic-miami/ps7_init_gpl.c [new file with mode: 0644]
board/topic/zynq/zynq-topic-miami/ps7_regs.txt [new file with mode: 0644]
board/topic/zynq/zynq-topic-miamiplus/ps7_init_gpl.c [new file with mode: 0644]
board/topic/zynq/zynq-topic-miamiplus/ps7_regs.txt [new file with mode: 0644]
board/toradex/apalis_t30/Kconfig
board/toradex/apalis_t30/apalis_t30.c
board/toradex/colibri_imx7/Kconfig
board/toradex/colibri_pxa270/Kconfig
board/toradex/colibri_pxa270/colibri_pxa270.c
board/toradex/colibri_t20/Kconfig
board/toradex/colibri_t20/colibri_t20.c
board/toradex/colibri_t30/Kconfig
board/toradex/colibri_t30/colibri_t30.c
board/toradex/colibri_vf/Kconfig
board/toradex/colibri_vf/colibri_vf.c
board/toradex/common/Kconfig [new file with mode: 0644]
board/toradex/common/Makefile [new file with mode: 0644]
board/toradex/common/tdx-cfg-block.c [new file with mode: 0644]
board/toradex/common/tdx-cfg-block.h [new file with mode: 0644]
board/toradex/common/tdx-common.c [new file with mode: 0644]
board/toradex/common/tdx-common.h [new file with mode: 0644]
board/xilinx/zynq/board.c
board/xilinx/zynqmp/Makefile
board/xilinx/zynqmp/xil_io.h
board/xilinx/zynqmp/zynqmp.c
cmd/Kconfig
cmd/bootefi.c
cmd/fastboot/Kconfig
cmd/regulator.c
cmd/sata.c
common/board_info.c
common/image-fit.c
common/image-sig.c
common/sata.c
common/spl/Kconfig
common/spl/spl.c
common/spl/spl_ext.c
common/spl/spl_mmc.c
common/spl/spl_spi.c
common/spl/spl_ymodem.c
common/stdio.c
common/xyzModem.c
configs/A10-OLinuXino-Lime_defconfig
configs/A20-OLinuXino-Lime2_defconfig
configs/A20-OLinuXino-Lime_defconfig
configs/A20-OLinuXino_MICRO_defconfig
configs/A20-Olimex-SOM-EVB_defconfig
configs/Bananapi_defconfig
configs/Bananapro_defconfig
configs/Cubieboard2_defconfig
configs/Cubieboard_defconfig
configs/Cubietruck_defconfig
configs/Itead_Ibox_A20_defconfig
configs/Lamobo_R1_defconfig
configs/Linksprite_pcDuino3_Nano_defconfig
configs/Linksprite_pcDuino3_defconfig
configs/Marsboard_A10_defconfig
configs/Mele_A1000_defconfig
configs/Mele_M5_defconfig
configs/Nintendo_NES_Classic_Edition_defconfig [new file with mode: 0644]
configs/Orangepi_defconfig
configs/Orangepi_mini_defconfig
configs/Sinlinx_SinA33_defconfig
configs/Wits_Pro_A20_DKT_defconfig
configs/am335x_evm_usbspl_defconfig
configs/am57xx_evm_defconfig
configs/am57xx_evm_nodt_defconfig
configs/am57xx_hs_evm_defconfig
configs/apalis_t30_defconfig
configs/brppt1_mmc_defconfig
configs/brppt1_nand_defconfig
configs/brppt1_spi_defconfig
configs/brxre1_defconfig
configs/chromebit_mickey_defconfig [new file with mode: 0644]
configs/chromebook_jerry_defconfig
configs/chromebook_minnie_defconfig [new file with mode: 0644]
configs/clearfog_defconfig
configs/cm_fx6_defconfig
configs/cm_t43_defconfig
configs/cm_t54_defconfig
configs/colibri_pxa270_defconfig
configs/colibri_t20_defconfig
configs/colibri_t30_defconfig
configs/colibri_vf_defconfig
configs/draco_defconfig
configs/efi-x86_defconfig
configs/etamin_defconfig
configs/evb-rk3399_defconfig
configs/h2200_defconfig
configs/kc1_defconfig
configs/kylin-rk3036_defconfig
configs/ls1021aiot_qspi_defconfig [new file with mode: 0644]
configs/ls1021aiot_sdcard_defconfig [new file with mode: 0644]
configs/ls1021aqds_nand_defconfig
configs/ls1021aqds_sdcard_ifc_defconfig
configs/ls1021aqds_sdcard_qspi_defconfig
configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
configs/ls1021atwr_sdcard_ifc_defconfig
configs/ls1021atwr_sdcard_qspi_defconfig
configs/ls1043aqds_nand_defconfig
configs/ls1043aqds_sdcard_ifc_defconfig
configs/ls1043aqds_sdcard_qspi_defconfig
configs/ls1043ardb_nand_defconfig
configs/ls1043ardb_sdcard_defconfig
configs/ls1046aqds_lpuart_defconfig [new file with mode: 0644]
configs/ls1046aqds_nand_defconfig
configs/ls1046aqds_sdcard_ifc_defconfig
configs/ls1046aqds_sdcard_qspi_defconfig
configs/ls1046ardb_emmc_defconfig
configs/ls1046ardb_sdcard_defconfig
configs/omap3_logic_defconfig
configs/pxm2_defconfig
configs/qemu-x86_efi_payload64_defconfig
configs/rastaban_defconfig
configs/rut_defconfig
configs/sniper_defconfig
configs/stm32f429-discovery_defconfig
configs/thuban_defconfig
configs/ti814x_evm_defconfig
configs/ti816x_evm_defconfig
configs/topic_miami_defconfig [new file with mode: 0644]
configs/topic_miamiplus_defconfig [new file with mode: 0644]
configs/woodburn_sd_defconfig
configs/zipitz2_defconfig
configs/zynq_zc770_xm011_defconfig
doc/README.efi
doc/README.x86
doc/device-tree-bindings/mtd/spi/spi-flash.txt
doc/git-mailrc
drivers/Makefile
drivers/bootcount/bootcount_ram.c
drivers/clk/rockchip/clk_rk3288.c
drivers/gpio/dwapb_gpio.c
drivers/mmc/mmc.c
drivers/mmc/sunxi_mmc.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/Makefile
drivers/mtd/nand/arasan_nfc.c
drivers/mtd/nand/nand_ids.c
drivers/mtd/nand/zynq_nand.c [new file with mode: 0644]
drivers/mtd/spi/Makefile
drivers/mtd/spi/sandbox.c
drivers/mtd/spi/sf.c
drivers/mtd/spi/sf_dataflash.c
drivers/mtd/spi/sf_internal.h
drivers/mtd/spi/sf_params.c [deleted file]
drivers/mtd/spi/spi_flash.c
drivers/mtd/spi/spi_flash_ids.c [new file with mode: 0644]
drivers/mtd/spi/sunxi_spi_spl.c
drivers/net/fsl-mc/mc.c
drivers/net/ldpaa_eth/ldpaa_eth.c
drivers/net/sun8i_emac.c
drivers/net/zynq_gem.c
drivers/power/regulator/regulator-uclass.c
drivers/serial/Kconfig
drivers/serial/serial_lpuart.c
drivers/serial/serial_pxa.c
drivers/spi/kirkwood_spi.c
drivers/spi/rk_spi.c
drivers/spi/spi-uclass.c
drivers/usb/gadget/Makefile
drivers/video/display-uclass.c
drivers/video/rockchip/rk_hdmi.c
drivers/video/rockchip/rk_vop.c
drivers/video/video-uclass.c
fs/ext4/ext4_common.c
fs/ext4/ext4fs.c
include/asm-generic/sections.h
include/configs/am335x_evm.h
include/configs/am335x_igep0033.h
include/configs/am335x_shc.h
include/configs/am335x_sl50.h
include/configs/am3517_crane.h
include/configs/am3517_evm.h
include/configs/am43xx_evm.h
include/configs/am57xx_evm.h
include/configs/apalis_t30.h
include/configs/at91sam9m10g45ek.h
include/configs/at91sam9n12ek.h
include/configs/at91sam9x5ek.h
include/configs/baltos.h
include/configs/bav335x.h
include/configs/brppt1.h
include/configs/brxre1.h
include/configs/bur_am335x_common.h
include/configs/clearfog.h
include/configs/cm_fx6.h
include/configs/cm_t335.h
include/configs/cm_t35.h
include/configs/cm_t3517.h
include/configs/cm_t43.h
include/configs/cm_t54.h
include/configs/colibri_imx7.h
include/configs/colibri_pxa270.h
include/configs/colibri_t20.h
include/configs/colibri_t30.h
include/configs/colibri_vf.h
include/configs/da850evm.h
include/configs/db-88f6820-gp.h
include/configs/dra7xx_evm.h
include/configs/draco.h
include/configs/etamin.h
include/configs/exynos7420-common.h
include/configs/h2200.h
include/configs/imx6_spl.h
include/configs/k2e_evm.h
include/configs/k2g_evm.h
include/configs/k2hk_evm.h
include/configs/k2l_evm.h
include/configs/kc1.h
include/configs/ls1012a_common.h
include/configs/ls1021aiot.h [new file with mode: 0644]
include/configs/ls1021aqds.h
include/configs/ls1021atwr.h
include/configs/ls1043a_common.h
include/configs/ls1046a_common.h
include/configs/ls1046aqds.h
include/configs/ls2080ardb.h
include/configs/mcx.h
include/configs/nokia_rx51.h
include/configs/omap3_beagle.h
include/configs/omap3_evm.h
include/configs/omap3_logic.h
include/configs/pcm051.h
include/configs/pengwyn.h
include/configs/pepper.h
include/configs/picosam9g45.h
include/configs/pxm2.h
include/configs/rastaban.h
include/configs/rk3036_common.h
include/configs/rk3288_common.h
include/configs/rk3399_common.h
include/configs/rockchip-common.h
include/configs/rut.h
include/configs/sama5d2_xplained.h
include/configs/sama5d3_xplained.h
include/configs/sama5d3xek.h
include/configs/sama5d4_xplained.h
include/configs/sama5d4ek.h
include/configs/siemens-am33x-common.h
include/configs/sniper.h
include/configs/socfpga_common.h
include/configs/sunxi-common.h
include/configs/tam3517-common.h
include/configs/tao3530.h
include/configs/thuban.h
include/configs/ti814x_evm.h
include/configs/ti816x_evm.h
include/configs/ti_armv7_common.h
include/configs/ti_armv7_keystone2.h
include/configs/ti_armv7_omap.h
include/configs/ti_omap3_common.h
include/configs/ti_omap4_common.h
include/configs/ti_omap5_common.h
include/configs/topic_miami.h [new file with mode: 0644]
include/configs/topic_miamiplus.h [new file with mode: 0644]
include/configs/tricorder.h
include/configs/uniphier.h
include/configs/veyron.h [moved from include/configs/chromebook_jerry.h with 100% similarity]
include/configs/woodburn_sd.h
include/configs/xilinx_zynqmp_ep.h
include/configs/zipitz2.h
include/configs/zynq-common.h
include/display.h
include/dm/platform_data/serial_pxa.h [new file with mode: 0644]
include/efi.h
include/efi_api.h
include/efi_loader.h
include/elf.h
include/ext4fs.h
include/image.h
include/linux/compat.h
include/linux/err.h
include/power/regulator.h
include/spi.h
include/u-boot/rsa-checksum.h
include/u-boot/sha1.h
include/u-boot/sha256.h
include/zynqmppl.h
include/zynqpl.h
lib/efi/Makefile
lib/efi_loader/Kconfig
lib/efi_loader/Makefile
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_console.c
lib/efi_loader/efi_image_loader.c
lib/efi_loader/efi_net.c
lib/efi_loader/helloworld.c [new file with mode: 0644]
lib/rsa/rsa-checksum.c
lib/rsa/rsa-sign.c
lib/rsa/rsa-verify.c
lib/sha1.c
lib/sha256.c
scripts/Makefile.lib
scripts/Makefile.spl
scripts/config_whitelist.txt
test/fs/fs-test.sh
test/py/conftest.py
test/py/tests/test_efi_loader.py [new file with mode: 0644]
test/py/tests/test_net.py
tools/Makefile
tools/env/fw_env.c
tools/image-host.c
tools/zynqimage.c
tools/zynqmpimage.c

index 3d7fffe0bd3e070a231e1a48a1d1aac3a66ef2d3..b4ae71a39be0c9a3448625e6237ff0de83bbb16c 100644 (file)
@@ -29,6 +29,9 @@ addons:
     - gcc-arm-linux-gnueabihf
     - gcc-aarch64-linux-gnu
     - iasl
+    - grub-efi-ia32-bin
+    - rpm2cpio
+    - wget
 
 install:
  # install latest device tree compiler
@@ -45,10 +48,14 @@ install:
  - virtualenv /tmp/venv
  - . /tmp/venv/bin/activate
  - pip install pytest
+ - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
+ - mkdir ~/grub2-arm
+ - ( cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di )
 
 env:
   global:
     - PATH=/tmp/dtc:/tmp/uboot-test-hooks/bin:$PATH
+    - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
     - BUILD_DIR=build
     - HOSTCC="cc"
     - HOSTCXX="c++"
@@ -86,10 +93,13 @@ script:
  # never prevent any test from running. That way, we can always pass
  # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
  # value.
- - if [[ "${TEST_PY_BD}" != "" ]]; then
+ - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
+   cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
+   cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
+   if [[ "${TEST_PY_BD}" != "" ]]; then
      ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
        -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
-       --build-dir `cd .. && pwd`/.bm-work/${TEST_PY_BD};
+       --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
    fi
 
 matrix:
@@ -242,6 +252,7 @@ matrix:
           BUILDMAN="^vexpress_ca9x4$"
     - env:
         - TEST_PY_BD="integratorcp_cm926ejs"
+          TEST_PY_TEST_SPEC="not sleep"
           TEST_PY_ID="--id qemu"
           BUILDMAN="^integratorcp_cm926ejs$"
     - env:
diff --git a/Kconfig b/Kconfig
index 1263d0b612dd0668e0264d08b6cdef70bcb97853..529858a79dab58af5c86da3dc8ce0c927159913a 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -56,6 +56,7 @@ config CC_OPTIMIZE_FOR_SIZE
 config DISTRO_DEFAULTS
        bool "Select defaults suitable for booting general purpose Linux distributions"
        default y if ARCH_SUNXI
+       default y if ARCH_LS2080A
        default n
        select CMD_BOOTZ if ARM && !ARM64
        select CMD_BOOTI if ARM64
@@ -291,33 +292,6 @@ config FIT_IMAGE_POST_PROCESS
          injected into the FIT creation (i.e. the blobs would have been pre-
          processed before being added to the FIT image).
 
-config SPL_DFU_SUPPORT
-       bool "Enable SPL with DFU to load binaries to memory device"
-       depends on USB
-       help
-         Currently the SPL does not have capability to load the
-         binaries or boot images to boot devices like ram,eMMC,SPI,etc.
-         This feature enables the DFU (Device Firmware Upgarde) in SPL with
-         RAM memory device support. The ROM code will load and execute
-         the SPL built with dfu. The user can load binaries (u-boot/kernel) to
-         selected device partition from host-pc using dfu-utils.
-               This feature will be useful to flash the binaries to factory
-         or bare-metal boards using USB interface.
-
-choice
-       bool "DFU device selection"
-       depends on SPL_DFU_SUPPORT
-
-config SPL_DFU_RAM
-       bool "RAM device"
-       depends on SPL_DFU_SUPPORT
-       help
-        select RAM/DDR memory device for loading binary images
-        (u-boot/kernel) to the selected device partition using
-        DFU and execute the u-boot/kernel from RAM.
-
-endchoice
-
 config SYS_CLK_FREQ
        depends on ARC || ARCH_SUNXI
        int "CPU clock frequency"
index 83a70dfd12407e02eccfcbb6b240c8fa510723bd..a1a8e064689fd1e462bce3e356c0f6aa62b0346f 100644 (file)
@@ -167,7 +167,8 @@ F:  arch/arm/cpu/armv7/stv0991/
 F:     arch/arm/include/asm/arch-stv0991/
 
 ARM SUNXI
-S:     Orphan
+M:     Jagan Teki <jagan@openedev.com>
+M:     Maxime Ripard <maxime.ripard@free-electrons.com>
 T:     git git://git.denx.de/u-boot-sunxi.git
 F:     arch/arm/cpu/armv7/sunxi/
 F:     arch/arm/include/asm/arch-sunxi/
@@ -271,7 +272,7 @@ F:  lib/fdtdec*
 F:     lib/libfdt/
 F:     include/fdt*
 F:     include/libfdt*
-F.     common/cmd_fdt.c
+F:     cmd/fdt.c
 F:     common/fdt_support.c
 
 FREEBSD
index 8ca1db57d439619d912258f68e11b353c9a785f4..96ddc59ca668f455c5de64a9306d9dca4db51683 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -527,6 +527,15 @@ endif
 endif
 endif
 
+# These are set by the arch-specific config.mk. Make sure they are exported
+# so they can be used when building an EFI application.
+export EFI_LDS         # Filename of EFI link script in arch/$(ARCH)/lib
+export EFI_CRT0                # Filename of EFI CRT0 in arch/$(ARCH)/lib
+export EFI_RELOC       # Filename of EFU relocation code in arch/$(ARCH)/lib
+export CFLAGS_EFI      # Compiler flags to add when building EFI app
+export CFLAGS_NON_EFI  # Compiler flags to remove when building EFI app
+export EFI_TARGET      # binutils target if EFI is natively supported
+
 # If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
 # that (or fail if absent).  Otherwise, search for a linker script in a
 # standard location.
@@ -1131,7 +1140,7 @@ quiet_cmd_u-boot_payload ?= LD      $@
       cmd_u-boot_payload ?= $(LD) $(LDFLAGS_EFI_PAYLOAD) -o $@ \
       -T u-boot-payload.lds arch/x86/cpu/call32.o \
       lib/efi/efi.o lib/efi/efi_stub.o u-boot.bin.o \
-      $(addprefix arch/$(ARCH)/lib/efi/,$(EFISTUB))
+      $(addprefix arch/$(ARCH)/lib/,$(EFISTUB))
 
 u-boot-payload: u-boot.bin.o u-boot-payload.lds FORCE
        $(call if_changed,u-boot_payload)
diff --git a/README b/README
index 00830d76df9cc8de0fccc5826ed6e37c762f9b81..25cad2ff01962e0fb7a540773b0a028b08761181 100644 (file)
--- a/README
+++ b/README
@@ -3338,11 +3338,6 @@ FIT uImage format:
                CONFIG_SPL_INIT_MINIMAL
                Arch init code should be built for a very small image
 
-               CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR,
-               CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS,
-               Address and partition on the MMC to load U-Boot from
-               when the MMC is being used in raw mode.
-
                CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
                Partition on the MMC to load U-Boot from when the MMC is being
                used in raw mode
@@ -4115,7 +4110,7 @@ but it can not erase, write this NOR flash by SRIO or PCIE interface.
 
          Define this to a string that is the name of the block device.
 
-       - FAT_ENV_DEV_AND_PART:
+       - FAT_ENV_DEVICE_AND_PART:
 
          Define this to a string to specify the partition of the device. It can
          be as following:
index d7a9b11c766a37ca20aeeb368b1409bae800371c..220022bcd9bfa3f06b150a110884a07a71e4766f 100644 (file)
@@ -126,6 +126,17 @@ config ENABLE_ARM_SOC_BOOT0_HOOK
          ARM_SOC_BOOT0_HOOK which contains the required assembler
          preprocessor code.
 
+config ARCH_OMAP2
+       bool
+       select CPU_V7
+       select SUPPORT_SPL
+
+config ARM64_SUPPORT_AARCH32
+       bool "ARM64 system support AArch32 execution state"
+       default y if ARM64 && !TARGET_THUNDERX_88XX
+       help
+         This ARM64 system supports AArch32 execution state.
+
 choice
        prompt "Target select"
        default TARGET_HIKEY
@@ -327,71 +338,61 @@ config TARGET_VEXPRESS_CA9X4
 
 config TARGET_BRXRE1
        bool "Support BRXRE1"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
 
 config TARGET_BRPPT1
        bool "Support BRPPT1"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
 
 config TARGET_DRACO
        bool "Support draco"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        select DM
        select DM_SERIAL
        select DM_GPIO
 
 config TARGET_THUBAN
        bool "Support thuban"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        select DM
        select DM_SERIAL
        select DM_GPIO
 
 config TARGET_RASTABAN
        bool "Support rastaban"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        select DM
        select DM_SERIAL
        select DM_GPIO
 
 config TARGET_ETAMIN
        bool "Support etamin"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        select DM
        select DM_SERIAL
        select DM_GPIO
 
 config TARGET_PXM2
        bool "Support pxm2"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        select DM
        select DM_SERIAL
        select DM_GPIO
 
 config TARGET_RUT
        bool "Support rut"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        select DM
        select DM_SERIAL
        select DM_GPIO
 
 config TARGET_TI814X_EVM
        bool "Support ti814x_evm"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
 
 config TARGET_TI816X_EVM
        bool "Support ti816x_evm"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
 
 config TARGET_BCM23550_W1D
        bool "Support bcm23550_w1d"
@@ -486,25 +487,21 @@ config TARGET_MX53SMD
 
 config OMAP34XX
        bool "OMAP34XX SoC"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        select USE_TINY_PRINTF
 
 config OMAP44XX
        bool "OMAP44XX SoC"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        select USE_TINY_PRINTF
 
 config OMAP54XX
        bool "OMAP54XX SoC"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
 
 config AM43XX
        bool "AM43XX SoC"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        help
          Support for AM43xx SOC from Texas Instruments.
          The AM43xx high performance SOC features a Cortex-A9
@@ -514,8 +511,7 @@ config AM43XX
 
 config AM33XX
        bool "AM33XX SoC"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
        help
          Support for AM335x SOC from Texas Instruments.
          The AM335x high performance SOC features a Cortex-A8
@@ -554,29 +550,28 @@ config ARCH_SOCFPGA
 
 config TARGET_CM_T43
        bool "Support cm_t43"
-       select CPU_V7
-       select SUPPORT_SPL
+       select ARCH_OMAP2
 
 config ARCH_SUNXI
        bool "Support sunxi (Allwinner) SoCs"
        select CMD_GPIO
        select CMD_MMC if MMC
-       select CMD_USB
+       select CMD_USB if DISTRO_DEFAULTS
        select DM
        select DM_ETH
        select DM_GPIO
        select DM_KEYBOARD
        select DM_SERIAL
-       select DM_USB
+       select DM_USB if DISTRO_DEFAULTS
        select OF_BOARD_SETUP
        select OF_CONTROL
        select OF_SEPARATE
        select SPL_STACK_R if SUPPORT_SPL
        select SPL_SYS_MALLOC_SIMPLE if SUPPORT_SPL
        select SYS_NS16550
-       select USB
-       select USB_STORAGE
-       select USB_KEYBOARD
+       select USB if DISTRO_DEFAULTS
+       select USB_STORAGE if DISTRO_DEFAULTS
+       select USB_KEYBOARD if DISTRO_DEFAULTS
        select USE_TINY_PRINTF
 
 config TARGET_TS4800
@@ -761,6 +756,20 @@ config TARGET_LS1021ATWR
        select ARCH_SUPPORT_PSCI
        select LS1_DEEP_SLEEP
 
+config TARGET_LS1021AIOT
+       bool "Support ls1021aiot"
+       select CPU_V7
+       select CPU_V7_HAS_NONSEC
+       select CPU_V7_HAS_VIRT
+       select SUPPORT_SPL
+       select ARCH_LS1021A
+       select ARCH_SUPPORT_PSCI
+       help
+         Support for Freescale LS1021AIOT platform.
+         The LS1021A Freescale board (IOT) is a high-performance
+         development platform that supports the QorIQ LS1021A
+         Layerscape Architecture processor.
+
 config TARGET_LS1043AQDS
        bool "Support ls1043aqds"
        select ARCH_LS1043A
@@ -901,7 +910,7 @@ source "arch/arm/cpu/armv7/mx6/Kconfig"
 
 source "arch/arm/cpu/armv7/mx5/Kconfig"
 
-source "arch/arm/cpu/armv7/omap-common/Kconfig"
+source "arch/arm/mach-omap2/Kconfig"
 
 source "arch/arm/cpu/armv8/fsl-layerscape/Kconfig"
 
@@ -962,6 +971,7 @@ source "board/freescale/ls2080ardb/Kconfig"
 source "board/freescale/ls1021aqds/Kconfig"
 source "board/freescale/ls1043aqds/Kconfig"
 source "board/freescale/ls1021atwr/Kconfig"
+source "board/freescale/ls1021aiot/Kconfig"
 source "board/freescale/ls1046aqds/Kconfig"
 source "board/freescale/ls1043ardb/Kconfig"
 source "board/freescale/ls1046ardb/Kconfig"
index 42093c2b5e29baf825a882fc0ba3473e8b9be641..236debb45286008614cf15b2d4e10e4aa9fa452a 100644 (file)
@@ -63,6 +63,7 @@ machine-$(CONFIG_ARCH_MVEBU)          += mvebu
 # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
 # TODO: rename CONFIG_ORION5X -> CONFIG_ARCH_ORION5X
 machine-$(CONFIG_ORION5X)              += orion5x
+machine-$(CONFIG_ARCH_OMAP2)           += omap2
 machine-$(CONFIG_ARCH_S5PC1XX)         += s5pc1xx
 machine-$(CONFIG_ARCH_SUNXI)           += sunxi
 machine-$(CONFIG_ARCH_SNAPDRAGON)      += snapdragon
index 542b897c31e0e93b84ba06eb54a5475099550cb8..008da39a6c02d11b5b8aa02a34363d9cc3b187e0 100644 (file)
@@ -6,13 +6,16 @@
 #
 
 ifndef CONFIG_STANDALONE_LOAD_ADDR
-ifneq ($(CONFIG_OMAP_COMMON),)
+ifneq ($(CONFIG_ARCH_OMAP2),)
 CONFIG_STANDALONE_LOAD_ADDR = 0x80300000
 else
 CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
 endif
 endif
 
+CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata-sections
+CFLAGS_EFI := -fpic -fshort-wchar
+
 LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \
                     -fno-common -ffixed-r9
@@ -148,3 +151,7 @@ ifneq ($(CONFIG_VF610),)
 ALL-y += u-boot.vyb
 endif
 endif
+
+EFI_LDS := elf_arm_efi.lds
+EFI_CRT0 := crt0_arm_efi.o
+EFI_RELOC := reloc_arm_efi.o
index a602d4e693745e3f1a631010cf87b35babdfe862..7c00201dd0ab7689604797922141045ae3235838 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <asm-offsets.h>
 #include <config.h>
+#include <linux/linkage.h>
 
 #ifndef CONFIG_SYS_PHY_UBOOT_BASE
 #define CONFIG_SYS_PHY_UBOOT_BASE      CONFIG_SYS_UBOOT_BASE
        .globl reset
 
 reset:
+       /* Allow the board to save important registers */
+       b       save_boot_params
+.globl save_boot_params_ret
+save_boot_params_ret:
+
        /*
         * set the cpu to SVC32 mode
         */
@@ -110,3 +116,7 @@ mmu_disable_phys:
 c_runtime_cpu_setup:
 
        mov     pc, lr
+
+WEAK(save_boot_params)
+       b       save_boot_params_ret    /* back to my caller */
+ENDPROC(save_boot_params)
index 4d3bc9440fa7f920ea22c3754e712fb0a5bd7597..0e515a4603da3f093026f5f5268ce279e18f7a13 100644 (file)
@@ -23,14 +23,12 @@ obj-$(CONFIG_ARMV7_PSCI)    += psci.o psci-common.o
 
 obj-$(CONFIG_IPROC) += iproc-common/
 obj-$(CONFIG_KONA) += kona-common/
-obj-$(CONFIG_OMAP_COMMON) += omap-common/
 obj-$(CONFIG_SYS_ARCH_TIMER) += arch_timer.o
 
 ifneq (,$(filter s5pc1xx exynos,$(SOC)))
 obj-y += s5p-common/
 endif
 
-obj-$(if $(filter am33xx,$(SOC)),y) += am33xx/
 obj-$(if $(filter bcm235xx,$(SOC)),y) += bcm235xx/
 obj-$(if $(filter bcm281xx,$(SOC)),y) += bcm281xx/
 obj-$(if $(filter bcmcygnus,$(SOC)),y) += bcmcygnus/
@@ -39,9 +37,6 @@ obj-$(if $(filter ls102xa,$(SOC)),y) += ls102xa/
 obj-$(if $(filter mx5,$(SOC)),y) += mx5/
 obj-$(CONFIG_MX6) += mx6/
 obj-$(CONFIG_MX7) += mx7/
-obj-$(CONFIG_OMAP34XX) += omap3/
-obj-$(CONFIG_OMAP44XX) += omap4/
-obj-$(CONFIG_OMAP54XX) += omap5/
 obj-$(CONFIG_RMOBILE) += rmobile/
 obj-$(if $(filter stv0991,$(SOC)),y) += stv0991/
 obj-$(CONFIG_ARCH_SUNXI) += sunxi/
diff --git a/arch/arm/cpu/armv7/omap3/config.mk b/arch/arm/cpu/armv7/omap3/config.mk
deleted file mode 100644 (file)
index ad44d63..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Copyright 2011 Linaro Limited
-#
-# (C) Copyright 2010
-# Texas Instruments, <www.ti.com>
-#
-# Aneesh V <aneesh@ti.com>
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-ifdef CONFIG_SPL_BUILD
-ALL-y  += MLO
-else
-ALL-y  += u-boot.img
-endif
diff --git a/arch/arm/cpu/armv7/omap4/config.mk b/arch/arm/cpu/armv7/omap4/config.mk
deleted file mode 100644 (file)
index ad44d63..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Copyright 2011 Linaro Limited
-#
-# (C) Copyright 2010
-# Texas Instruments, <www.ti.com>
-#
-# Aneesh V <aneesh@ti.com>
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-ifdef CONFIG_SPL_BUILD
-ALL-y  += MLO
-else
-ALL-y  += u-boot.img
-endif
diff --git a/arch/arm/cpu/armv7/omap5/config.mk b/arch/arm/cpu/armv7/omap5/config.mk
deleted file mode 100644 (file)
index 286ca86..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright 2011 Linaro Limited
-#
-# Aneesh V <annesh@ti.com>
-#
-# SPDX-License-Identifier:     GPL-2.0+
-#
-
-include  $(srctree)/$(CPUDIR)/omap-common/config_secure.mk
-
-ifdef CONFIG_SPL_BUILD
-ifeq ($(CONFIG_TI_SECURE_DEVICE),y)
-ALL-y  += u-boot-spl_HS_MLO u-boot-spl_HS_X-LOADER
-else
-ALL-y  += MLO
-endif
-else
-ifeq ($(CONFIG_TI_SECURE_DEVICE),y)
-ALL-$(CONFIG_SPL_LOAD_FIT) += u-boot_HS.img
-endif
-ALL-y  += u-boot.img
-endif
index cd2d9bb91791e871a67eef21e9dabaca03a19aca..965a8d129c1d0055a1decde4f38d898c1905452e 100644 (file)
@@ -28,8 +28,9 @@ config PSCI_RESET
                   !TARGET_LS2080A_SIMU && !TARGET_LS2080AQDS && \
                   !TARGET_LS2080ARDB && !TARGET_LS1012AQDS && \
                   !TARGET_LS1012ARDB && !TARGET_LS1012AFRDM && \
-                  !TARGET_LS1043ARDB && !ARCH_UNIPHIER && !ARCH_SNAPDRAGON && \
-                  !TARGET_S32V234EVB
+                  !TARGET_LS1043ARDB && !TARGET_LS1043AQDS && \
+                  !TARGET_LS1046ARDB && !TARGET_LS1046AQDS && \
+                  !ARCH_UNIPHIER && !ARCH_SNAPDRAGON && !TARGET_S32V234EVB
        help
          Most armv8 systems have PSCI support enabled in EL3, either through
          ARM Trusted Firmware or other firmware.
index 685025881c487ee39dc7d0c1e09da9e8aec29cd3..27b66d41b1a87b566938dd571920fb1a66d726c8 100644 (file)
@@ -8,3 +8,7 @@ PLATFORM_RELFLAGS += -fno-common -ffixed-x18
 
 PF_NO_UNALIGNED := $(call cc-option, -mstrict-align)
 PLATFORM_CPPFLAGS += $(PF_NO_UNALIGNED)
+
+EFI_LDS := elf_aarch64_efi.lds
+EFI_CRT0 := crt0_aarch64_efi.o
+EFI_RELOC := reloc_aarch64_efi.o
index b7a2e0c946081904e124701932f9c84f9d3a67cf..d6ee54642d214cb1445adab7965e09f6110c12b5 100644 (file)
@@ -17,6 +17,7 @@
 #ifdef CONFIG_MP
 #include <asm/arch/mp.h>
 #endif
+#include <efi_loader.h>
 #include <fm_eth.h>
 #include <fsl-mc/fsl_mc.h>
 #ifdef CONFIG_FSL_ESDHC
@@ -190,7 +191,7 @@ void enable_caches(void)
 }
 #endif
 
-static inline u32 initiator_type(u32 cluster, int init_id)
+u32 initiator_type(u32 cluster, int init_id)
 {
        struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
        u32 idx = (cluster >> (init_id * 8)) & TP_CLUSTER_INIT_MASK;
@@ -305,12 +306,14 @@ u32 fsl_qoriq_core_to_type(unsigned int core)
        return -1;      /* cannot identify the cluster */
 }
 
+#ifndef CONFIG_FSL_LSCH3
 uint get_svr(void)
 {
        struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
 
        return gur_in32(&gur->svr);
 }
+#endif
 
 #ifdef CONFIG_DISPLAY_CPUINFO
 int print_cpuinfo(void)
@@ -430,6 +433,7 @@ int timer_init(void)
 #endif
 #ifdef CONFIG_LS2080A
        u32 __iomem *pctbenr = (u32 *)FSL_PMU_PCTBENR_OFFSET;
+       u32 svr_dev_id;
 #endif
 #ifdef COUNTER_FREQUENCY_REAL
        unsigned long cntfrq = COUNTER_FREQUENCY_REAL;
@@ -452,6 +456,14 @@ int timer_init(void)
         * Register (PCTBENR), which allows the watchdog to operate.
         */
        setbits_le32(pctbenr, 0xff);
+       /*
+        * For LS2080A SoC and its personalities, timer controller
+        * offset is different
+        */
+       svr_dev_id = get_svr() >> 16;
+       if (svr_dev_id == SVR_DEV_LS2080A)
+               cntcr = (u32 *)SYS_FSL_LS2080A_LS2085A_TIMER_ADDR;
+
 #endif
 
        /* Enable clock for timer
@@ -462,9 +474,10 @@ int timer_init(void)
        return 0;
 }
 
-void reset_cpu(ulong addr)
+__efi_runtime_data u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
+
+void __efi_runtime reset_cpu(ulong addr)
 {
-       u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
        u32 val;
 
        /* Raise RESET_REQ_B */
@@ -473,6 +486,33 @@ void reset_cpu(ulong addr)
        scfg_out32(rstcr, val);
 }
 
+#ifdef CONFIG_EFI_LOADER
+
+void __efi_runtime EFIAPI efi_reset_system(
+                      enum efi_reset_type reset_type,
+                      efi_status_t reset_status,
+                      unsigned long data_size, void *reset_data)
+{
+       switch (reset_type) {
+       case EFI_RESET_COLD:
+       case EFI_RESET_WARM:
+               reset_cpu(0);
+               break;
+       case EFI_RESET_SHUTDOWN:
+               /* Nothing we can do */
+               break;
+       }
+
+       while (1) { }
+}
+
+void efi_reset_system_init(void)
+{
+       efi_add_runtime_mmio(&rstcr, sizeof(*rstcr));
+}
+
+#endif
+
 phys_size_t board_reserve_ram_top(phys_size_t ram_size)
 {
        phys_size_t ram_top = ram_size;
index 8072f3ca6a09917e023df9cc5e93845125e45372..a05f8aad617aac3b1d5cce469d9e62e3c921be84 100644 (file)
@@ -5,4 +5,5 @@
  */
 
 int fsl_qoriq_core_to_cluster(unsigned int core);
+u32 initiator_type(u32 cluster, int init_id);
 u32 cpu_mask(void);
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/doc/README.qspi b/arch/arm/cpu/armv8/fsl-layerscape/doc/README.qspi
new file mode 100644 (file)
index 0000000..de86f4b
--- /dev/null
@@ -0,0 +1,42 @@
+QSPI Boot source support Overview
+-------------------
+       1. LS1043A
+               LS1043AQDS
+       2. LS2080A
+               LS2080AQDS
+       3. LS1012A
+               LS1012AQDS
+               LS1012ARDB
+       4. LS1046A
+               LS1046AQDS
+               LS1046ARDB
+
+Booting from QSPI
+-------------------
+Booting from QSPI requires two images, RCW and u-boot-dtb.bin.
+The difference between QSPI boot RCW image and NOR boot image is the PBI
+command sequence for setting the boot location pointer. It's should point
+to the address for u-boot in QSPI flash.
+
+RCW image should be written to the beginning of QSPI flash device.
+Example of using u-boot command
+
+=> sf probe 0:0
+SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB
+=> sf erase 0 +<size of rcw image>
+SF: 65536 bytes @ 0x0 Erased: OK
+=> sf write <rcw image in memory> 0 <size of rcw image>
+SF: 164 bytes @ 0x0 Written: OK
+
+To get the QSPI image, build u-boot with QSPI config, for example,
+<board_name>_qspi_defconfig. The image needed is u-boot-dtb.bin.
+The u-boot image should be written to 0x10000(but 0x1000 for LS1043A, LS2080A).
+
+=> sf probe 0:0
+SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB
+=> sf erase 10000 +<size of u-boot image>
+SF: 589824 bytes @ 0x10000 Erased: OK
+=> sf write <u-boot image in memory> 10000 <size of u-boot image>
+SF: 580966 bytes @ 0x10000 Written: OK
+
+With these two images in QSPI flash device, the board can boot from QSPI.
index f7b949aca22ef5953f40f3bd3296045a85c92060..c7496c02f57b2c04c4a3328b0c525b750280047b 100644 (file)
@@ -4,6 +4,7 @@ SoC overview
        2. LS2080A
        3. LS1012A
        4. LS1046A
+       5. LS2088A
 
 LS1043A
 ---------
@@ -169,3 +170,60 @@ The LS1046A SoC includes the following function and features:
    - Two DUARTs
    - Integrated flash controller (IFC) supporting NAND and NOR flash
  - QorIQ platform's trust architecture 2.1
+
+LS2088A
+--------
+The LS2088A integrated multicore processor combines eight ARM Cortex-A72
+processor cores with high-performance data path acceleration logic and network
+and peripheral bus interfaces required for networking, telecom/datacom,
+wireless infrastructure, and mil/aerospace applications.
+
+The LS2088A SoC includes the following function and features:
+
+ - Eight 64-bit ARM Cortex-A72 CPUs
+ - 1 MB platform cache with ECC
+ - Two 64-bit DDR4 SDRAM memory controllers with ECC and interleaving support
+ - One secondary 32-bit DDR4 SDRAM memory controller, intended for use by
+   the AIOP
+ - Data path acceleration architecture (DPAA2) incorporating acceleration for
+   the following functions:
+   - Packet parsing, classification, and distribution (WRIOP)
+   - Queue and Hardware buffer management for scheduling, packet sequencing, and
+     congestion management, buffer allocation and de-allocation (QBMan)
+   - Cryptography acceleration (SEC) at up to 10 Gbps
+   - RegEx pattern matching acceleration (PME) at up to 10 Gbps
+   - Decompression/compression acceleration (DCE) at up to 20 Gbps
+   - Accelerated I/O processing (AIOP) at up to 20 Gbps
+   - QDMA engine
+ - 16 SerDes lanes at up to 10.3125 GHz
+ - Ethernet interfaces
+   - Up to eight 10 Gbps Ethernet MACs
+   - Up to eight 1 / 2.5 Gbps Ethernet MACs
+ - High-speed peripheral interfaces
+   - Four PCIe 3.0 controllers, one supporting SR-IOV
+ - Additional peripheral interfaces
+   - Two serial ATA (SATA 3.0) controllers
+   - Two high-speed USB 3.0 controllers with integrated PHY
+   - Enhanced secure digital host controller (eSDXC/eMMC)
+   - Serial peripheral interface (SPI) controller
+   - Quad Serial Peripheral Interface (QSPI) Controller
+   - Four I2C controllers
+   - Two DUARTs
+   - Integrated flash controller (IFC 2.0) supporting NAND and NOR flash
+ - Support for hardware virtualization and partitioning enforcement
+ - QorIQ platform's trust architecture 3.0
+ - Service processor (SP) provides pre-boot initialization and secure-boot
+ capabilities
+
+LS2088A SoC has 3 more similar SoC personalities
+1)LS2048A, few difference w.r.t. LS2088A:
+       a) Four 64-bit ARM v8 Cortex-A72 CPUs
+
+2)LS2084A, few difference w.r.t. LS2088A:
+       a) No AIOP
+       b) No 32-bit DDR3 SDRAM memory
+       c) 5 * 1/10G + 5 *1G WRIOP
+       d) No L2 switch
+
+3)LS2044A, few difference w.r.t. LS2084A:
+       a) Four 64-bit ARM v8 Cortex-A72 CPUs
index 1a8321b0e4064d9c7f780b18e72d72cd286b2528..0dae5faad81038e6d587a6f386cf65df381bdd8c 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <efi_loader.h>
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <phy.h>
@@ -105,6 +106,11 @@ remove_psci_node:
 
        fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code,
                        *boot_code_size);
+#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
+       efi_add_memory_map((uintptr_t)&secondary_boot_code,
+                          ALIGN(*boot_code_size, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT,
+                          EFI_RESERVED_MEMORY_TYPE, false);
+#endif
 }
 #endif
 
index 5700b1fb654393a3f6f793643061e32455c4e8c2..72f2c11baf65104c3af95e0f9873fa20aec1e6ed 100644 (file)
 #ifdef CONFIG_MP
 #include <asm/arch/mp.h>
 #endif
+#ifdef CONFIG_FSL_LSCH3
+#include <asm/arch-fsl-layerscape/immap_lsch3.h>
+#include <asm/arch-fsl-layerscape/soc.h>
+#endif
+#include <asm/u-boot.h>
 
 ENTRY(lowlevel_init)
        mov     x29, lr                 /* Save LR */
@@ -137,6 +142,16 @@ ENTRY(lowlevel_init)
 #endif
 
 #ifdef CONFIG_FSL_TZASC_400
+       /*
+        * LS2080 and its personalities does not support TZASC
+        * So skip TZASC related operations
+        */
+       bl      get_svr
+       lsr     w0, w0, #16
+       ldr     w1, =SVR_DEV_LS2080A
+       cmp     w0, w1
+       b.eq    1f
+
        /* Set TZASC so that:
         * a. We use only Region0 whose global secure write/read is EN
         * b. We use only Region0 whose NSAID write/read is EN
@@ -145,26 +160,26 @@ ENTRY(lowlevel_init)
         *       placeholders.
         */
        ldr     x1, =TZASC_GATE_KEEPER(0)
-       ldr     x0, [x1]                /* Filter 0 Gate Keeper Register */
-       orr     x0, x0, #1 << 0         /* Set open_request for Filter 0 */
-       str     x0, [x1]
+       ldr     w0, [x1]                /* Filter 0 Gate Keeper Register */
+       orr     w0, w0, #1 << 0         /* Set open_request for Filter 0 */
+       str     w0, [x1]
 
        ldr     x1, =TZASC_GATE_KEEPER(1)
-       ldr     x0, [x1]                /* Filter 0 Gate Keeper Register */
-       orr     x0, x0, #1 << 0         /* Set open_request for Filter 0 */
-       str     x0, [x1]
+       ldr     w0, [x1]                /* Filter 0 Gate Keeper Register */
+       orr     w0, w0, #1 << 0         /* Set open_request for Filter 0 */
+       str     w0, [x1]
 
        ldr     x1, =TZASC_REGION_ATTRIBUTES_0(0)
-       ldr     x0, [x1]                /* Region-0 Attributes Register */
-       orr     x0, x0, #1 << 31        /* Set Sec global write en, Bit[31] */
-       orr     x0, x0, #1 << 30        /* Set Sec global read en, Bit[30] */
-       str     x0, [x1]
+       ldr     w0, [x1]                /* Region-0 Attributes Register */
+       orr     w0, w0, #1 << 31        /* Set Sec global write en, Bit[31] */
+       orr     w0, w0, #1 << 30        /* Set Sec global read en, Bit[30] */
+       str     w0, [x1]
 
        ldr     x1, =TZASC_REGION_ATTRIBUTES_0(1)
-       ldr     x0, [x1]                /* Region-1 Attributes Register */
-       orr     x0, x0, #1 << 31        /* Set Sec global write en, Bit[31] */
-       orr     x0, x0, #1 << 30        /* Set Sec global read en, Bit[30] */
-       str     x0, [x1]
+       ldr     w0, [x1]                /* Region-1 Attributes Register */
+       orr     w0, w0, #1 << 31        /* Set Sec global write en, Bit[31] */
+       orr     w0, w0, #1 << 30        /* Set Sec global read en, Bit[30] */
+       str     w0, [x1]
 
        ldr     x1, =TZASC_REGION_ID_ACCESS_0(0)
        ldr     w0, [x1]                /* Region-0 Access Register */
@@ -179,7 +194,7 @@ ENTRY(lowlevel_init)
        isb
        dsb     sy
 #endif
-
+1:
 #ifdef CONFIG_ARCH_LS1046A
        /* Initialize the L2 RAM latency */
        mrs   x1, S3_1_c11_c0_2
@@ -199,6 +214,12 @@ ENTRY(lowlevel_init)
 ENDPROC(lowlevel_init)
 
 #ifdef CONFIG_FSL_LSCH3
+       .globl get_svr
+get_svr:
+       ldr     x1, =FSL_LSCH3_SVR
+       ldr     w0, [x1]
+       ret
+
 hnf_pstate_poll:
        /* x0 has the desired status, return 0 for success, 1 for timeout
         * clobber x1, x2, x3, x4, x6, x7
@@ -339,11 +360,6 @@ ENTRY(secondary_boot_func)
         gic_wait_for_interrupt_m x0, w1
 #endif
 
-       bl secondary_switch_to_el2
-#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
-       bl secondary_switch_to_el1
-#endif
-
 slave_cpu:
        wfe
        ldr     x0, [x11]
@@ -356,19 +372,64 @@ slave_cpu:
        tbz     x1, #25, cpu_is_le
        rev     x0, x0                  /* BE to LE conversion */
 cpu_is_le:
-       br      x0                      /* branch to the given address */
+       ldr     x5, [x11, #24]
+       ldr     x6, =IH_ARCH_DEFAULT
+       cmp     x6, x5
+       b.eq    1f
+
+#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+       adr     x3, secondary_switch_to_el1
+       ldr     x4, =ES_TO_AARCH64
+#else
+       ldr     x3, [x11]
+       ldr     x4, =ES_TO_AARCH32
+#endif
+       bl      secondary_switch_to_el2
+
+1:
+#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+       adr     x3, secondary_switch_to_el1
+#else
+       ldr     x3, [x11]
+#endif
+       ldr     x4, =ES_TO_AARCH64
+       bl      secondary_switch_to_el2
+
 ENDPROC(secondary_boot_func)
 
 ENTRY(secondary_switch_to_el2)
-       switch_el x0, 1f, 0f, 0f
+       switch_el x5, 1f, 0f, 0f
 0:     ret
-1:     armv8_switch_to_el2_m x0
+1:     armv8_switch_to_el2_m x3, x4, x5
 ENDPROC(secondary_switch_to_el2)
 
 ENTRY(secondary_switch_to_el1)
-       switch_el x0, 0f, 1f, 0f
+       mrs     x0, mpidr_el1
+       ubfm    x1, x0, #8, #15
+       ubfm    x2, x0, #0, #1
+       orr     x10, x2, x1, lsl #2     /* x10 has LPID */
+
+       lsl     x1, x10, #6
+       ldr     x0, =__spin_table
+       /* physical address of this cpus spin table element */
+       add     x11, x1, x0
+
+       ldr     x3, [x11]
+
+       ldr     x5, [x11, #24]
+       ldr     x6, =IH_ARCH_DEFAULT
+       cmp     x6, x5
+       b.eq    2f
+
+       ldr     x4, =ES_TO_AARCH32
+       bl      switch_to_el1
+
+2:     ldr     x4, =ES_TO_AARCH64
+
+switch_to_el1:
+       switch_el x5, 0f, 1f, 0f
 0:     ret
-1:     armv8_switch_to_el1_m x0, x1
+1:     armv8_switch_to_el1_m x3, x4, x5
 ENDPROC(secondary_switch_to_el1)
 
        /* Ensure that the literals used by the secondary boot code are
index eaa44a74c5b30957b696886b315899fa7c8ae84f..67d605e38b1812ce9673fa2ac10bb3500e6e5df7 100644 (file)
@@ -34,6 +34,11 @@ static struct serdes_config serdes1_cfg_tbl[] = {
        {0x33, {PCIE2, PCIE2, PCIE2, PCIE2, QSGMII_D, QSGMII_C, QSGMII_B,
                QSGMII_A} },
        {0x35, {QSGMII_D, QSGMII_C, QSGMII_B, PCIE2, XFI4, XFI3, XFI2, XFI1 } },
+       {0x39, {SGMII8, SGMII7, SGMII6, PCIE2, SGMII4, SGMII3, SGMII2,
+               PCIE1 } },
+       {0x4B, {PCIE2, PCIE2, PCIE2, PCIE2, XFI4, XFI3, XFI2, XFI1 } },
+       {0x4C, {XFI8, XFI7, XFI6, XFI5, PCIE1, PCIE1, PCIE1, PCIE1 } },
+       {0x4D, {SGMII8, SGMII7, PCIE2, PCIE2, SGMII4, SGMII3, PCIE1, PCIE1 } },
                {}
 };
 static struct serdes_config serdes2_cfg_tbl[] = {
@@ -64,6 +69,7 @@ static struct serdes_config serdes2_cfg_tbl[] = {
                SATA2 } },
        {0x4A, {SGMII9, SGMII10, SGMII11, SGMII12, PCIE4, PCIE4, SATA1,
                SATA2 } },
+       {0x57, {PCIE3, PCIE3, PCIE3, PCIE3, PCIE4, PCIE4, SGMII15, SGMII16 } },
        {}
 };
 
index f607c3900ad53514b309a5d210eec3a6da477c56..80fe1ade2e61097a34b0981afd89379f5f3849be 100644 (file)
@@ -9,6 +9,8 @@
 #include <asm/system.h>
 #include <asm/arch/mp.h>
 #include <asm/arch/soc.h>
+#include "cpu.h"
+#include <asm/arch-fsl-layerscape/soc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -22,11 +24,49 @@ phys_addr_t determine_mp_bootpg(void)
        return (phys_addr_t)&secondary_boot_code;
 }
 
+void update_os_arch_secondary_cores(uint8_t os_arch)
+{
+       u64 *table = get_spin_tbl_addr();
+       int i;
+
+       for (i = 1; i < CONFIG_MAX_CPUS; i++)
+               table[i * WORDS_PER_SPIN_TABLE_ENTRY +
+                       SPIN_TABLE_ELEM_OS_ARCH_IDX] = os_arch;
+}
+
+#ifdef CONFIG_FSL_LSCH3
+void wake_secondary_core_n(int cluster, int core, int cluster_cores)
+{
+       struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+       struct ccsr_reset __iomem *rst = (void *)(CONFIG_SYS_FSL_RST_ADDR);
+       u32 mpidr = 0;
+
+       mpidr = ((cluster << 8) | core);
+       /*
+        * mpidr_el1 register value of core which needs to be released
+        * is written to scratchrw[6] register
+        */
+       gur_out32(&gur->scratchrw[6], mpidr);
+       asm volatile("dsb st" : : : "memory");
+       rst->brrl |= 1 << ((cluster * cluster_cores) + core);
+       asm volatile("dsb st" : : : "memory");
+       /*
+        * scratchrw[6] register value is polled
+        * when the value becomes zero, this means that this core is up
+        * and running, next core can be released now
+        */
+       while (gur_in32(&gur->scratchrw[6]) != 0)
+               ;
+}
+#endif
+
 int fsl_layerscape_wake_seconday_cores(void)
 {
        struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
 #ifdef CONFIG_FSL_LSCH3
        struct ccsr_reset __iomem *rst = (void *)(CONFIG_SYS_FSL_RST_ADDR);
+       u32 svr, ver, cluster, type;
+       int j = 0, cluster_cores = 0;
 #elif defined(CONFIG_FSL_LSCH2)
        struct ccsr_scfg __iomem *scfg = (void *)(CONFIG_SYS_FSL_SCFG_ADDR);
 #endif
@@ -55,10 +95,40 @@ int fsl_layerscape_wake_seconday_cores(void)
 #ifdef CONFIG_FSL_LSCH3
        gur_out32(&gur->bootlocptrh, (u32)(gd->relocaddr >> 32));
        gur_out32(&gur->bootlocptrl, (u32)gd->relocaddr);
-       gur_out32(&gur->scratchrw[6], 1);
-       asm volatile("dsb st" : : : "memory");
-       rst->brrl = cores;
-       asm volatile("dsb st" : : : "memory");
+
+       svr = gur_in32(&gur->svr);
+       ver = SVR_SOC_VER(svr);
+       if (ver == SVR_LS2080A || ver == SVR_LS2085A) {
+               gur_out32(&gur->scratchrw[6], 1);
+               asm volatile("dsb st" : : : "memory");
+               rst->brrl = cores;
+               asm volatile("dsb st" : : : "memory");
+       } else {
+               /*
+                * Release the cores out of reset one-at-a-time to avoid
+                * power spikes
+                */
+               i = 0;
+               cluster = in_le32(&gur->tp_cluster[i].lower);
+               for (j = 0; j < TP_INIT_PER_CLUSTER; j++) {
+                       type = initiator_type(cluster, j);
+                       if (type &&
+                           TP_ITYP_TYPE(type) == TP_ITYP_TYPE_ARM)
+                               cluster_cores++;
+               }
+
+               do {
+                       cluster = in_le32(&gur->tp_cluster[i].lower);
+                       for (j = 0; j < TP_INIT_PER_CLUSTER; j++) {
+                               type = initiator_type(cluster, j);
+                               if (type &&
+                                   TP_ITYP_TYPE(type) == TP_ITYP_TYPE_ARM)
+                                       wake_secondary_core_n(i, j,
+                                                             cluster_cores);
+                       }
+               i++;
+               } while ((cluster & TP_CLUSTER_EOC) != TP_CLUSTER_EOC);
+       }
 #elif defined(CONFIG_FSL_LSCH2)
        scfg_out32(&scfg->scratchrw[0], (u32)(gd->relocaddr >> 32));
        scfg_out32(&scfg->scratchrw[1], (u32)gd->relocaddr);
index d68eeba349a13ca9fd15ea34387ef072fc378e62..6c4238707d1c32a44a16c3da479bd495b4386478 100644 (file)
@@ -31,8 +31,10 @@ bool soc_has_dp_ddr(void)
        struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
        u32 svr = gur_in32(&gur->svr);
 
-       /* LS2085A has DP_DDR */
-       if (SVR_SOC_VER(svr) == SVR_LS2085A)
+       /* LS2085A, LS2088A, LS2048A has DP_DDR */
+       if ((SVR_SOC_VER(svr) == SVR_LS2085A) ||
+           (SVR_SOC_VER(svr) == SVR_LS2088A) ||
+           (SVR_SOC_VER(svr) == SVR_LS2048A))
                return true;
 
        return false;
@@ -50,16 +52,16 @@ bool soc_has_aiop(void)
        return false;
 }
 
-#ifdef CONFIG_LS2080A
+#if defined(CONFIG_FSL_LSCH3)
 /*
  * This erratum requires setting a value to eddrtqcr1 to
  * optimal the DDR performance.
  */
 static void erratum_a008336(void)
 {
+#ifdef CONFIG_SYS_FSL_ERRATUM_A008336
        u32 *eddrtqcr1;
 
-#ifdef CONFIG_SYS_FSL_ERRATUM_A008336
 #ifdef CONFIG_SYS_FSL_DCSR_DDR_ADDR
        eddrtqcr1 = (void *)CONFIG_SYS_FSL_DCSR_DDR_ADDR + 0x800;
        if (fsl_ddr_get_version(0) == 0x50200)
@@ -79,9 +81,9 @@ static void erratum_a008336(void)
  */
 static void erratum_a008514(void)
 {
+#ifdef CONFIG_SYS_FSL_ERRATUM_A008514
        u32 *eddrtqcr1;
 
-#ifdef CONFIG_SYS_FSL_ERRATUM_A008514
 #ifdef CONFIG_SYS_FSL_DCSR_DDR3_ADDR
        eddrtqcr1 = (void *)CONFIG_SYS_FSL_DCSR_DDR3_ADDR + 0x800;
        out_le32(eddrtqcr1, 0x63b20002);
@@ -176,6 +178,7 @@ static void erratum_a009203(void)
 #endif
 #endif
 }
+
 void bypass_smmu(void)
 {
        u32 val;
index 0c6a46249a262b9619067bc133b135c8c1fd2f76..1b39f1d3227a4cb754660bd48fb92283d3793a6c 100644 (file)
@@ -50,4 +50,27 @@ ENTRY(_sec_firmware_support_psci_version)
        smc     #0
        ret
 ENDPROC(_sec_firmware_support_psci_version)
+
+/*
+ * Switch from AArch64 EL2 to AArch32 EL2
+ * @param inputs:
+ * x0: argument, zero
+ * x1: machine nr
+ * x2: fdt address
+ * x3: kernel entry point
+ * @param outputs for secure firmware:
+ * x0: function id
+ * x1: kernel entry point
+ * x2: machine nr
+ * x3: fdt address
+*/
+ENTRY(armv8_el2_to_aarch32)
+       mov     x0, x3
+       mov     x3, x2
+       mov     x2, x1
+       mov     x1, x0
+       ldr     x0, =0xc000ff04
+       smc     #0
+       ret
+ENDPROC(armv8_el2_to_aarch32)
 #endif
index 19c771dba3abc2dad0971474d2f9d7773119f771..4f5f6d8020f892dd7eb04310e8af8a924a2e175e 100644 (file)
@@ -251,9 +251,17 @@ WEAK(lowlevel_init)
        /*
         * All slaves will enter EL2 and optionally EL1.
         */
+       adr     x3, lowlevel_in_el2
+       ldr     x4, =ES_TO_AARCH64
        bl      armv8_switch_to_el2
+
+lowlevel_in_el2:
 #ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+       adr     x3, lowlevel_in_el1
+       ldr     x4, =ES_TO_AARCH64
        bl      armv8_switch_to_el1
+
+lowlevel_in_el1:
 #endif
 
 #endif /* CONFIG_ARMV8_MULTIENTRY */
index 253a39bd1137ab7d7b1cc86791ba4289b5ee91af..adb9f3566bfc3f3fba690b4692400997a2b14468 100644 (file)
 #include <asm/macro.h>
 
 ENTRY(armv8_switch_to_el2)
-       switch_el x0, 1f, 0f, 0f
-0:     ret
-1:     armv8_switch_to_el2_m x0
+       switch_el x5, 1f, 0f, 0f
+0:
+       cmp x4, #ES_TO_AARCH64
+       b.eq 2f
+       /*
+        * When loading 32-bit kernel, it will jump
+        * to secure firmware again, and never return.
+        */
+       bl armv8_el2_to_aarch32
+2:
+       /*
+        * x3 is kernel entry point or switch_to_el1
+        * if CONFIG_ARMV8_SWITCH_TO_EL1 is defined.
+         * When running in EL2 now, jump to the
+        * address saved in x3.
+        */
+       br x3
+1:     armv8_switch_to_el2_m x3, x4, x5
 ENDPROC(armv8_switch_to_el2)
 
 ENTRY(armv8_switch_to_el1)
-       switch_el x0, 0f, 1f, 0f
-0:     ret
-1:     armv8_switch_to_el1_m x0, x1
+       switch_el x5, 0f, 1f, 0f
+0:
+       /* x3 is kernel entry point. When running in EL1
+        * now, jump to the address saved in x3.
+        */
+       br x3
+1:     armv8_switch_to_el1_m x3, x4, x5
 ENDPROC(armv8_switch_to_el1)
+
+WEAK(armv8_el2_to_aarch32)
+       ret
+ENDPROC(armv8_el2_to_aarch32)
index 1eedb39aa5a864ca91462efd8c1c12b3c23343f6..a3baae4f740ca15e37906ce86b8b8ff900632953 100644 (file)
@@ -41,6 +41,13 @@ config SYS_CONFIG_NAME
          Based on this option include/configs/<CONFIG_SYS_CONFIG_NAME>.h header
          will be used for board configuration.
 
+config BOOT_INIT_FILE
+       string "boot.bin init register filename"
+       default ""
+       help
+         Add register writes to boot.bin format (max 256 pairs).
+         Expect a table of register-value pairs, e.g. "0x12345678 0x4321"
+
 config ZYNQMP_USB
        bool "Configure ZynqMP USB"
 
index 04e190537d15c47e9b976fd1a1fb14c73c9da41c..bdbd61380ab7aa8323b118128e48fd8a2b85717b 100644 (file)
@@ -69,12 +69,14 @@ u32 spl_boot_device(void)
 
 #if defined(CONFIG_SPL_ZYNQMP_ALT_BOOTMODE_ENABLED)
        /* Change default boot mode at run-time */
-       writel(BOOT_MODE_USE_ALT |
-              CONFIG_SPL_ZYNQMP_ALT_BOOTMODE << BOOT_MODE_ALT_SHIFT,
+       writel(CONFIG_SPL_ZYNQMP_ALT_BOOTMODE << BOOT_MODE_ALT_SHIFT,
               &crlapb_base->boot_mode);
 #endif
 
        reg = readl(&crlapb_base->boot_mode);
+       if (reg >> BOOT_MODE_ALT_SHIFT)
+               reg >>= BOOT_MODE_ALT_SHIFT;
+
        bootmode = reg & BOOT_MODES_MASK;
 
        switch (bootmode) {
index 836a8c4d1ee2852ed2627282ad1d82083ee5bff1..ae47d8127ca06f9c1ed70a325c3964b80970815c 100644 (file)
@@ -28,14 +28,16 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
        exynos5422-odroidxu3.dtb
 dtb-$(CONFIG_EXYNOS7420) += exynos7420-espresso7420.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += \
+       rk3036-sdk.dtb \
        rk3288-firefly.dtb \
-       rk3288-jerry.dtb \
+       rk3288-veyron-jerry.dtb \
+       rk3288-veyron-mickey.dtb \
+       rk3288-veyron-minnie.dtb \
        rk3288-rock2-square.dtb \
        rk3288-evb.dtb \
        rk3288-fennec.dtb \
        rk3288-miniarm.dtb \
        rk3288-popmetal.dtb \
-       rk3036-sdk.dtb \
        rk3399-evb.dtb
 dtb-$(CONFIG_ARCH_MESON) += \
        meson-gxbb-odroidc2.dtb
@@ -97,6 +99,8 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
        zynq-zybo.dtb \
        zynq-microzed.dtb \
        zynq-picozed.dtb \
+       zynq-topic-miami.dtb \
+       zynq-topic-miamiplus.dtb \
        zynq-zc770-xm010.dtb \
        zynq-zc770-xm011.dtb \
        zynq-zc770-xm012.dtb \
@@ -141,13 +145,15 @@ dtb-$(CONFIG_TARGET_STV0991) += stv0991.dtb
 
 dtb-$(CONFIG_LS102XA) += ls1021a-qds-duart.dtb \
        ls1021a-qds-lpuart.dtb \
-       ls1021a-twr-duart.dtb ls1021a-twr-lpuart.dtb
+       ls1021a-twr-duart.dtb ls1021a-twr-lpuart.dtb \
+       ls1021a-iot-duart.dtb
 dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2080a-qds.dtb \
        fsl-ls2080a-rdb.dtb
 dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds-duart.dtb \
        fsl-ls1043a-qds-lpuart.dtb \
        fsl-ls1043a-rdb.dtb \
        fsl-ls1046a-qds-duart.dtb \
+       fsl-ls1046a-qds-lpuart.dtb \
        fsl-ls1046a-rdb.dtb \
        fsl-ls1012a-qds.dtb \
        fsl-ls1012a-rdb.dtb \
@@ -254,6 +260,7 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \
        sun8i-a33-olinuxino.dtb \
        sun8i-a33-q8-tablet.dtb \
        sun8i-a33-sinlinx-sina33.dtb \
+       sun8i-r16-nintendo-nes-classic-edition.dtb \
        sun8i-r16-parrot.dtb
 dtb-$(CONFIG_MACH_SUN8I_A83T) += \
        sun8i-a83t-allwinner-h8homlet-v2.dtb \
diff --git a/arch/arm/dts/fsl-ls1046a-qds-lpuart.dts b/arch/arm/dts/fsl-ls1046a-qds-lpuart.dts
new file mode 100644 (file)
index 0000000..21243d0
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Device Tree file for Freescale Layerscape-1046A family SoC.
+ *
+ * Copyright (C) 2016, Freescale Semiconductor
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/dts-v1/;
+#include "fsl-ls1046a-qds.dtsi"
+
+/ {
+       chosen {
+               stdout-path = &lpuart0;
+       };
+};
index c5122930fe13a65e26bba6a3a0896dcebd49dc94..a49ca08d888eb2f9e1cfe83138adb7f41029e38b 100644 (file)
@@ -75,3 +75,7 @@
 &duart1 {
        status = "okay";
 };
+
+&lpuart0 {
+       status = "okay";
+};
index 87dd9976d154aa6fbad1a4a64f4374d131e55406..359a9d13bf8e6397d462b84a40240204fbfb6271 100644 (file)
                        clocks = <&clockgen 4 0>;
                };
 
+               lpuart0: serial@2950000 {
+                       compatible = "fsl,ls1021a-lpuart";
+                       reg = <0x0 0x2950000 0x0 0x1000>;
+                       interrupts = <0 48 0x4>;
+                       clocks = <&clockgen 4 0>;
+                       clock-names = "ipg";
+                       status = "disabled";
+               };
+
+               lpuart1: serial@2960000 {
+                       compatible = "fsl,ls1021a-lpuart";
+                       reg = <0x0 0x2960000 0x0 0x1000>;
+                       interrupts = <0 49 0x4>;
+                       clocks = <&clockgen 4 1>;
+                       clock-names = "ipg";
+                       status = "disabled";
+               };
+
+               lpuart2: serial@2970000 {
+                       compatible = "fsl,ls1021a-lpuart";
+                       reg = <0x0 0x2970000 0x0 0x1000>;
+                       interrupts = <0 50 0x4>;
+                       clocks = <&clockgen 4 1>;
+                       clock-names = "ipg";
+                       status = "disabled";
+               };
+
+               lpuart3: serial@2980000 {
+                       compatible = "fsl,ls1021a-lpuart";
+                       reg = <0x0 0x2980000 0x0 0x1000>;
+                       interrupts = <0 51 0x4>;
+                       clocks = <&clockgen 4 1>;
+                       clock-names = "ipg";
+                       status = "disabled";
+               };
+
+               lpuart4: serial@2990000 {
+                       compatible = "fsl,ls1021a-lpuart";
+                       reg = <0x0 0x2990000 0x0 0x1000>;
+                       interrupts = <0 52 0x4>;
+                       clocks = <&clockgen 4 1>;
+                       clock-names = "ipg";
+                       status = "disabled";
+               };
+
+               lpuart5: serial@29a0000 {
+                       compatible = "fsl,ls1021a-lpuart";
+                       reg = <0x0 0x29a0000 0x0 0x1000>;
+                       interrupts = <0 53 0x4>;
+                       clocks = <&clockgen 4 1>;
+                       clock-names = "ipg";
+                       status = "disabled";
+               };
+
                qspi: quadspi@1550000 {
                        compatible = "fsl,vf610-qspi";
                        #address-cells = <1>;
diff --git a/arch/arm/dts/ls1021a-iot-duart.dts b/arch/arm/dts/ls1021a-iot-duart.dts
new file mode 100644 (file)
index 0000000..62e4c67
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Freescale ls1021a IOT board device tree source
+ *
+ * Copyright 2016 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/dts-v1/;
+#include "ls1021a-iot.dtsi"
+
+/ {
+       chosen {
+       stdout-path = &uart0;
+       };
+};
diff --git a/arch/arm/dts/ls1021a-iot.dtsi b/arch/arm/dts/ls1021a-iot.dtsi
new file mode 100644 (file)
index 0000000..1817c62
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Freescale ls1021a IOT board device tree source
+ *
+ * Copyright 2016 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+
+#include "ls1021a.dtsi"
+
+/ {
+       model = "LS1021A IOT Board";
+
+       aliases {
+               enet2_rgmii_phy = &rgmii_phy1;
+               enet0_sgmii_phy = &sgmii_phy2;
+               enet1_sgmii_phy = &sgmii_phy0;
+               spi0 = &qspi;
+               spi1 = &dspi1;
+       };
+};
+
+&qspi {
+       bus-num = <0>;
+       status = "okay";
+
+       qflash0: n25q128a13@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spi-flash";
+               spi-max-frequency = <20000000>;
+               reg = <0>;
+       };
+};
+
+&dspi1 {
+       bus-num = <0>;
+       status = "okay";
+
+       dspiflash: at26df081a@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spi-flash";
+               spi-max-frequency = <16000000>;
+               spi-cpol;
+               spi-cpha;
+               reg = <0>;
+       };
+};
+
+&i2c0 {
+       status = "okay";
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&ifc {
+       #address-cells = <2>;
+       #size-cells = <1>;
+       /* NOR Flash on board */
+       ranges = <0x0 0x0 0x60000000 0x08000000>;
+       status = "okay";
+
+       nor@0,0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "cfi-flash";
+               reg = <0x0 0x0 0x8000000>;
+               bank-width = <2>;
+               device-width = <1>;
+       };
+};
+
+&lpuart0 {
+       status = "okay";
+};
+
+&mdio0 {
+       sgmii_phy0: ethernet-phy@0 {
+               reg = <0x0>;
+       };
+       rgmii_phy1: ethernet-phy@1 {
+               reg = <0x1>;
+       };
+       sgmii_phy2: ethernet-phy@2 {
+               reg = <0x2>;
+       };
+       tbi1: tbi-phy@1f {
+               reg = <0x1f>;
+               device_type = "tbi-phy";
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
index 1c9ddf985610790de2add1ba24d71e9157811fc7..bdc7b980b0dec844165f1acb1ab96adfa7b38b1a 100644 (file)
                stdout-path = &uart2;
        };
 
-       usb_control {
-               compatible = "rockchip,rk3036-usb-control";
-               host_drv_gpio = <&gpio2 23 GPIO_ACTIVE_LOW>;
-               otg_drv_gpio = <&gpio0 26 GPIO_ACTIVE_LOW>;
+       vcc5v0_otg: vcc5v0-otg-drv {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_otg";
+               gpio = <&gpio0 26 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&otg_vbus_drv>;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+       };
+
+       vcc5v0_host: vcc5v0-host-drv {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_host";
+               gpio = <&gpio2 23 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&host_vbus_drv>;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
        };
 };
 
 &usb_otg {
        status = "okay";
 };
+
+&pinctrl {
+       usb_otg {
+               otg_vbus_drv: host-vbus-drv {
+                       rockchip,pins = <0 26 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       usb_host {
+               host_vbus_drv: host-vbus-drv {
+                       rockchip,pins = <2 23 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
index bbbc2f408d632a6d6e3d65ea2903bece8db1ddf3..f88a8680bfa5afdcf06ff3438df94139e155a900 100644 (file)
@@ -13,6 +13,8 @@
 / {
        aliases {
                i2c20 = &i2c_tunnel;
+               video0 = &vopl;
+               video1 = &vopb;
        };
 
        gpio_keys: gpio-keys {
similarity index 92%
rename from arch/arm/dts/rk3288-jerry.dts
rename to arch/arm/dts/rk3288-veyron-jerry.dts
index 2aa3b9f97149a5ae36a4f4381ef027d70d6e8361..8aab607cc527dc1f140cb960e3ebdb65602ece61 100644 (file)
        };
 };
 
+&dmc {
+       rockchip,pctl-timing = <0x29a 0xc8 0x1f4 0x42 0x4e 0x4 0xea 0xa
+               0x5 0x0 0xa 0x7 0x19 0x24 0xa 0x7
+               0x5 0xa 0x5 0x200 0x5 0x10 0x40 0x0
+               0x1 0x7 0x7 0x4 0xc 0x43 0x100 0x0
+               0x5 0x0>;
+       rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
+               0xa60 0x40 0x10 0x0>;
+       rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>;
+};
+
 &gpio_keys {
        power {
                gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
        pinctrl-0 = <&vcc50_hdmi_en>;
 };
 
-&vopb {
-       /* Disable this so that we use vopl */
-       status = "disabled";
-};
-
 &edp {
        pinctrl-names = "default";
        pinctrl-0 = <&edp_hpd>;
diff --git a/arch/arm/dts/rk3288-veyron-mickey.dts b/arch/arm/dts/rk3288-veyron-mickey.dts
new file mode 100644 (file)
index 0000000..e0dc362
--- /dev/null
@@ -0,0 +1,277 @@
+/*
+ * Google Veyron Mickey Rev 0 board device tree source
+ *
+ * Copyright 2015 Google, Inc
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *  Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "rk3288-veyron-chromebook.dtsi"
+
+/ {
+       model = "Google Mickey";
+       compatible = "google,veyron-mickey-rev8", "google,veyron-mickey-rev7",
+                    "google,veyron-mickey-rev6", "google,veyron-mickey-rev5",
+                    "google,veyron-mickey-rev4", "google,veyron-mickey-rev3",
+                    "google,veyron-mickey-rev2", "google,veyron-mickey-rev1",
+                    "google,veyron-mickey-rev0", "google,veyron-mickey",
+                    "google,veyron", "rockchip,rk3288";
+
+       vcc_5v: vcc-5v {
+               vin-supply = <&vcc33_sys>;
+       };
+
+       vcc33_io: vcc33_io {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc33_io";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc33_sys>;
+       };
+};
+
+&cpu_thermal {
+       /delete-node/ trips;
+       /delete-node/ cooling-maps;
+
+       trips {
+               cpu_alert_almost_warm: cpu_alert_almost_warm {
+                       temperature = <63000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "passive";
+               };
+               cpu_alert_warm: cpu_alert_warm {
+                       temperature = <65000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "passive";
+               };
+               cpu_alert_almost_hot: cpu_alert_almost_hot {
+                       temperature = <80000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "passive";
+               };
+               cpu_alert_hot: cpu_alert_hot {
+                       temperature = <82000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "passive";
+               };
+               cpu_alert_hotter: cpu_alert_hotter {
+                       temperature = <84000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "passive";
+               };
+               cpu_alert_very_hot: cpu_alert_very_hot {
+                       temperature = <85000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "passive";
+               };
+               cpu_crit: cpu_crit {
+                       temperature = <90000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "critical";
+               };
+       };
+
+       cooling-maps {
+               /*
+                * After 1st level, throttle the CPU down to as low as 1.4 GHz
+                * and don't let the GPU go faster than 400 MHz.  Note that we
+                * won't throttle the GPU lower than 400 MHz due to CPU
+                * heat--we'll let the GPU do the rest itself.
+                */
+               cpu_warm_limit_cpu {
+                       trip = <&cpu_alert_warm>;
+                       cooling-device =
+                               <&cpu0 THERMAL_NO_LIMIT 4>;
+               };
+
+               /*
+                * Add some discrete steps to help throttling system deal
+                * with the fact that there are two passive cooling devices:
+                * the CPU and the GPU.
+                *
+                * - 1.2 GHz - 1.0 GHz (almost hot)
+                * - 800 MHz           (hot)
+                * - 800 MHz - 696 MHz (hotter)
+                * - 696 MHz - min     (very hot)
+                *
+                * Note:
+                * - 800 MHz appears to be a "sweet spot" for me.  I can run
+                *   some pretty serious workload here and be happy.
+                * - After 696 MHz we stop lowering voltage, so throttling
+                *   past there is less effective.
+                */
+               cpu_almost_hot_limit_cpu {
+                       trip = <&cpu_alert_almost_hot>;
+                       cooling-device =
+                               <&cpu0 5 6>;
+               };
+               cpu_hot_limit_cpu {
+                       trip = <&cpu_alert_hot>;
+                       cooling-device =
+                               <&cpu0 7 7>;
+               };
+               cpu_hotter_limit_cpu {
+                       trip = <&cpu_alert_hotter>;
+                       cooling-device =
+                               <&cpu0 7 8>;
+               };
+               cpu_very_hot_limit_cpu {
+                       trip = <&cpu_alert_very_hot>;
+                       cooling-device =
+                               <&cpu0 8 THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&dmc {
+       rockchip,pctl-timing = <0x215 0xc8 0x0 0x35 0x26 0x2 0x70 0x2000d
+               0x6 0x0 0x8 0x4 0x17 0x24 0xd 0x6
+               0x4 0x8 0x4 0x76 0x4 0x0 0x30 0x0
+               0x1 0x2 0x2 0x4 0x0 0x0 0xc0 0x4
+               0x8 0x1f4>;
+       rockchip,phy-timing = <0x48d7dd93 0x187008d8 0x121076
+               0x0 0xc3 0x6 0x2>;
+       rockchip,sdram-params = <0x20d266a4 0x5b6 2 533000000 6 9 1>;
+};
+
+&emmc {
+       /delete-property/mmc-hs200-1_8v;
+};
+
+&i2c2 {
+       status = "disabled";
+};
+
+&i2c4 {
+       status = "disabled";
+};
+
+&i2s {
+       status = "okay";
+       clock-names = "i2s_hclk", "i2s_clk", "i2s_clk_out";
+       clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>, <&cru SCLK_I2S0_OUT>;
+};
+
+&rk808 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pmic_int_l &dvs_1 &dvs_2>;
+       dvs-gpios = <&gpio7 12 GPIO_ACTIVE_HIGH>,
+                   <&gpio7 15 GPIO_ACTIVE_HIGH>;
+
+       /delete-property/ vcc6-supply;
+       /delete-property/ vcc12-supply;
+
+       vcc11-supply = <&vcc33_sys>;
+
+       regulators {
+               /* vcc33_io is sourced directly from vcc33_sys */
+               /delete-node/ LDO_REG1;
+               /delete-node/ LDO_REG7;
+
+               /* This is not a pwren anymore, but the real power supply */
+               vdd10_lcd: LDO_REG7 {
+                       regulator-always-on;
+                       regulator-boot-on;
+                       regulator-min-microvolt = <1000000>;
+                       regulator-max-microvolt = <1000000>;
+                       regulator-name = "vdd10_lcd";
+                       regulator-suspend-mem-disabled;
+               };
+
+               vcc18_lcd: LDO_REG8 {
+                       regulator-always-on;
+                       regulator-boot-on;
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-name = "vcc18_lcd";
+                       regulator-suspend-mem-disabled;
+               };
+       };
+};
+
+&pinctrl {
+       hdmi {
+               power_hdmi_on: power-hdmi-on {
+                       rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pmic {
+               dvs_1: dvs-1 {
+                       rockchip,pins = <7 12 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+
+               dvs_2: dvs-2 {
+                       rockchip,pins = <7 15 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+       };
+};
+
+&sdmmc {
+       status = "disabled";
+};
+
+&sdio0 {
+       status = "disabled";
+};
+
+&sdmmc {
+       status = "disabled";
+};
+
+&spi0 {
+       status = "disabled";
+};
+
+&usb_host0_ehci {
+       status = "disabled";
+};
+
+&usb_host1 {
+       status = "disabled";
+};
+
+&vcc50_hdmi {
+       enable-active-high;
+       gpio = <&gpio7 11 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&power_hdmi_on>;
+};
diff --git a/arch/arm/dts/rk3288-veyron-minnie.dts b/arch/arm/dts/rk3288-veyron-minnie.dts
new file mode 100644 (file)
index 0000000..0a2915f
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * Google Veyron Minnie Rev 0+ board device tree source
+ *
+ * Copyright 2015 Google, Inc
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *  Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "rk3288-veyron-chromebook.dtsi"
+
+/ {
+       model = "Google Minnie";
+       compatible = "google,veyron-minnie-rev4", "google,veyron-minnie-rev3",
+                    "google,veyron-minnie-rev2", "google,veyron-minnie-rev1",
+                    "google,veyron-minnie-rev0", "google,veyron-minnie",
+                    "google,veyron", "rockchip,rk3288";
+
+       backlight_regulator: backlight-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio2 12 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&bl_pwr_en>;
+               regulator-name = "backlight_regulator";
+               vin-supply = <&vcc33_sys>;
+               startup-delay-us = <15000>;
+       };
+
+       panel_regulator: panel-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio7 14 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&lcd_enable_h>;
+               regulator-name = "panel_regulator";
+               startup-delay-us = <100000>;
+               vin-supply = <&vcc33_sys>;
+       };
+
+       vcc18_lcd: vcc18-lcd {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio2 13 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&avdd_1v8_disp_en>;
+               regulator-name = "vcc18_lcd";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc18_wl>;
+       };
+};
+
+&backlight {
+       /* Minnie panel PWM must be >= 1%, so start non-zero brightness at 3 */
+       brightness-levels = <
+                         0   3   4   5   6   7
+                         8   9  10  11  12  13  14  15
+                        16  17  18  19  20  21  22  23
+                        24  25  26  27  28  29  30  31
+                        32  33  34  35  36  37  38  39
+                        40  41  42  43  44  45  46  47
+                        48  49  50  51  52  53  54  55
+                        56  57  58  59  60  61  62  63
+                        64  65  66  67  68  69  70  71
+                        72  73  74  75  76  77  78  79
+                        80  81  82  83  84  85  86  87
+                        88  89  90  91  92  93  94  95
+                        96  97  98  99 100 101 102 103
+                       104 105 106 107 108 109 110 111
+                       112 113 114 115 116 117 118 119
+                       120 121 122 123 124 125 126 127
+                       128 129 130 131 132 133 134 135
+                       136 137 138 139 140 141 142 143
+                       144 145 146 147 148 149 150 151
+                       152 153 154 155 156 157 158 159
+                       160 161 162 163 164 165 166 167
+                       168 169 170 171 172 173 174 175
+                       176 177 178 179 180 181 182 183
+                       184 185 186 187 188 189 190 191
+                       192 193 194 195 196 197 198 199
+                       200 201 202 203 204 205 206 207
+                       208 209 210 211 212 213 214 215
+                       216 217 218 219 220 221 222 223
+                       224 225 226 227 228 229 230 231
+                       232 233 234 235 236 237 238 239
+                       240 241 242 243 244 245 246 247
+                       248 249 250 251 252 253 254 255>;
+       power-supply = <&backlight_regulator>;
+};
+
+&dmc {
+       rockchip,pctl-timing = <0x215 0xc8 0x0 0x35 0x26 0x2 0x70 0x2000d
+               0x6 0x0 0x8 0x4 0x17 0x24 0xd 0x6
+               0x4 0x8 0x4 0x76 0x4 0x0 0x30 0x0
+               0x1 0x2 0x2 0x4 0x0 0x0 0xc0 0x4
+               0x8 0x1f4>;
+       rockchip,phy-timing = <0x48d7dd93 0x187008d8 0x121076
+               0x0 0xc3 0x6 0x1>;
+       rockchip,sdram-params = <0x20d266a4 0x5b6 6 533000000 6 13 0>;
+};
+
+&emmc {
+       /delete-property/mmc-hs200-1_8v;
+};
+
+&gpio_keys {
+       pinctrl-0 = <&pwr_key_h &ap_lid_int_l &volum_down_l &volum_up_l>;
+
+       volum_down {
+               label = "Volum_down";
+               gpios = <&gpio5 11 GPIO_ACTIVE_LOW>;
+               linux,code = <KEY_VOLUMEDOWN>;
+               debounce-interval = <100>;
+       };
+
+       volum_up {
+               label = "Volum_up";
+               gpios = <&gpio5 10 GPIO_ACTIVE_LOW>;
+               linux,code = <KEY_VOLUMEUP>;
+               debounce-interval = <100>;
+       };
+};
+
+&i2c_tunnel {
+       battery: bq27500@55 {
+               compatible = "ti,bq27500";
+               reg = <0x55>;
+       };
+};
+
+&i2c3 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       i2c-scl-falling-time-ns = <50>;
+       i2c-scl-rising-time-ns = <300>;
+
+       touchscreen@10 {
+               compatible = "elan,ekth3500";
+               reg = <0x10>;
+               interrupt-parent = <&gpio2>;
+               interrupts = <14 IRQ_TYPE_EDGE_FALLING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&touch_int &touch_rst>;
+               reset-gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
+               vcc33-supply = <&vcc33_touch>;
+               vccio-supply = <&vcc33_touch>;
+       };
+};
+
+&panel {
+       compatible = "auo,b101ean01", "simple-panel";
+       power-supply= <&panel_regulator>;
+};
+
+&rk808 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pmic_int_l &dvs_1 &dvs_2>;
+
+       regulators {
+               vcc33_touch: LDO_REG2 {
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-name = "vcc33_touch";
+                       regulator-state-mem {
+                               regulator-off-in-suspend;
+                       };
+               };
+
+               vcc5v_touch: SWITCH_REG2 {
+                       regulator-name = "vcc5v_touch";
+                       regulator-state-mem {
+                               regulator-off-in-suspend;
+                       };
+               };
+       };
+};
+
+&sdmmc {
+       disable-wp;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd_disabled &sdmmc_cd_gpio
+                       &sdmmc_bus4>;
+};
+
+&vcc_5v {
+       enable-active-high;
+       gpio = <&gpio7 21 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&drv_5v>;
+};
+
+&vcc50_hdmi {
+       enable-active-high;
+       gpio = <&gpio5 19 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&vcc50_hdmi_en>;
+};
+
+&pinctrl {
+       backlight {
+               bl_pwr_en: bl_pwr_en {
+                       rockchip,pins = <2 12 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       buck-5v {
+               drv_5v: drv-5v {
+                       rockchip,pins = <7 21 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       buttons {
+               volum_down_l: volum-down-l {
+                       rockchip,pins = <5 11 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+
+               volum_up_l: volum-up-l {
+                       rockchip,pins = <5 10 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       hdmi {
+               vcc50_hdmi_en: vcc50-hdmi-en {
+                       rockchip,pins = <5 19 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       lcd {
+               lcd_enable_h: lcd-en {
+                       rockchip,pins = <7 14 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               avdd_1v8_disp_en: avdd-1v8-disp-en {
+                       rockchip,pins = <2 13 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pmic {
+               dvs_1: dvs-1 {
+                       rockchip,pins = <7 12 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+
+               dvs_2: dvs-2 {
+                       rockchip,pins = <7 15 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+       };
+
+       prochot {
+               gpio_prochot: gpio-prochot {
+                       rockchip,pins = <2 8 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       touchscreen {
+               touch_int: touch-int {
+                       rockchip,pins = <2 14 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               touch_rst: touch-rst {
+                       rockchip,pins = <2 15 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
index 2ffe39cbf710331a699232249fbb2a860a071077..a31405875036d471c71b50521a93790c8c9d2b16 100644 (file)
                533000 1150000
                666000 1200000
        >;
-       rockchip,pctl-timing = <0x29a 0xc8 0x1f4 0x42 0x4e 0x4 0xea 0xa
-               0x5 0x0 0xa 0x7 0x19 0x24 0xa 0x7
-               0x5 0xa 0x5 0x200 0x5 0x10 0x40 0x0
-               0x1 0x7 0x7 0x4 0xc 0x43 0x100 0x0
-               0x5 0x0>;
-       rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
-               0xa60 0x40 0x10 0x0>;
-       rockchip,sdram-params = <0x30B25564 0x627 3 666000000 3 9 1>;
 };
 
 &efuse {
diff --git a/arch/arm/dts/sun8i-r16-nintendo-nes-classic-edition.dts b/arch/arm/dts/sun8i-r16-nintendo-nes-classic-edition.dts
new file mode 100644 (file)
index 0000000..dce688e
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016 FUKAUMI Naoki <naobsd@gmail.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-a33.dtsi"
+
+/ {
+       model = "Nintendo NES Classic Edition";
+       compatible = "nintendo,nes-classic-edition", "allwinner,sun8i-a33";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
index b618a3f484f0e507948bdff1017cc01ec40a4e26..6df0329cfc902f55eded63968d00c3299707db2c 100644 (file)
@@ -6,9 +6,10 @@
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
-/include/ "skeleton.dtsi"
 
 / {
+       #address-cells = <1>;
+       #size-cells = <1>;
        compatible = "xlnx,zynq-7000";
 
        cpus {
                };
        };
 
-       pmu {
+       pmu@f8891000 {
                compatible = "arm,cortex-a9-pmu";
                interrupts = <0 5 4>, <0 6 4>;
                interrupt-parent = <&intc>;
                reg = < 0xf8891000 0x1000 0xf8893000 0x1000 >;
        };
 
-       regulator_vccpint: fixedregulator@0 {
+       regulator_vccpint: fixedregulator {
                compatible = "regulator-fixed";
                regulator-name = "VCCPINT";
                regulator-min-microvolt = <1000000>;
index cb238cd5e7bbb68f59784143de40445d66492bc8..2d07b92e9cff99723365e1a0a1df1c780bc87a3e 100644 (file)
@@ -18,7 +18,7 @@
                mmc0 = &sdhci0;
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0 0x40000000>;
        };
index 3408df8b8b3d5c6e3538a00b3a1a174ca5d295e1..fea04ab45a72834884f0eb852f005ad3db96cc1d 100644 (file)
@@ -16,7 +16,7 @@
                serial0 = &uart1;
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0 0x40000000>;
        };
diff --git a/arch/arm/dts/zynq-topic-miami.dts b/arch/arm/dts/zynq-topic-miami.dts
new file mode 100644 (file)
index 0000000..aa05c4d
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Topic Miami board DTS
+ *
+ * Copyright (C) 2014-2016 Topic Embedded Products
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+/dts-v1/;
+#include "zynq-7000.dtsi"
+
+/ {
+       model = "Topic Miami Zynq Board";
+       compatible = "topic,miami", "xlnx,zynq-7000";
+
+       aliases {
+               ethernet0 = &gem0;
+               serial0 = &uart0;
+               spi0 = &qspi;
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               mmc0 = &sdhci0;
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x40000000>;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&qspi {
+       u-boot,dm-pre-reloc;
+       status = "okay";
+       is-dual = <0>;
+       num-cs = <1>;
+       flash@0 {
+               compatible = "st,m25p80", "n25q256a";
+               m25p,fast-read;
+               reg = <0x0>;
+               spi-tx-bus-width = <1>;
+               spi-rx-bus-width = <4>;
+               spi-max-frequency = <100000000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               partition@qspi-u-boot-spl {
+                       label = "qspi-u-boot-spl";
+                       reg = <0x00000 0x10000>;
+               };
+               partition@qspi-u-boot-img {
+                       label = "qspi-u-boot-img";
+                       reg = <0x10000 0x60000>;
+               };
+               partition@qspi-device-tree {
+                       label = "qspi-device-tree";
+                       reg = <0x70000 0x10000>;
+               };
+               partition@qspi-linux {
+                       label = "qspi-linux";
+                       reg = <0x80000 0x400000>;
+               };
+               partition@qspi-rootfs {
+                       label = "qspi-rootfs";
+                       reg = <0x480000 0x1b80000>;
+               };
+       };
+};
+
+&i2c0 {
+       status = "okay";
+       clock-frequency = <400000>;
+};
+
+&i2c1 {
+       status = "okay";
+       clock-frequency = <400000>;
+};
+
+&clkc {
+       ps-clk-frequency = <33333333>;
+};
+
+&sdhci0 {
+       u-boot,dm-pre-reloc;
+       status = "okay";
+};
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+};
diff --git a/arch/arm/dts/zynq-topic-miamiplus.dts b/arch/arm/dts/zynq-topic-miamiplus.dts
new file mode 100644 (file)
index 0000000..3036f6e
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Topic Miami Plus board DTS
+ *
+ * Copyright (C) 2016 Topic Embedded Products
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+#include "zynq-topic-miami.dts"
+
+/ {
+       model = "Topic Miami+ Zynq Board";
+       compatible = "topic,miamiplus", "xlnx,zynq-7000";
+};
+
+&qspi {
+       is-dual = <1>;
+};
index 6585010f4bc8b92821878c2f136fd62cd72dbdc9..478e9fd4ef25c26adcc092bf25a9925c0bac4c00 100644 (file)
@@ -21,7 +21,7 @@
                mmc0 = &sdhci0;
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x40000000>;
        };
index d04880a2cdd3b4f77405dcefdf8574cdf4203381..8b0177bc512a3c61a61e5813b7193ba7b8a4c60a 100644 (file)
@@ -21,7 +21,7 @@
                mmc0 = &sdhci0;
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x40000000>;
        };
index 33524cb6def54f12b834a28acc0bdecb8fa487d8..42af313c13ddfe60a0d28aa9161de0425b6c28ff 100644 (file)
@@ -25,7 +25,7 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x40000000>;
        };
index 463b14b5ea15449d238401a19f309876660f6575..7f08961491a62780395a06adbd7fcb2480971e70 100644 (file)
@@ -23,7 +23,7 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x40000000>;
        };
index 6cab8326677009a48c1f674f0ded01b7decfa763..699cd2c0fb1cf6dd1e87d0345d6dee8d3a87337a 100644 (file)
@@ -24,7 +24,7 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x40000000>;
        };
index d5bb4efcc58a66f5632555e9494a21c1e07a4ada..07e92b88fb0faca13920015c19ad01034e500130 100644 (file)
@@ -25,7 +25,7 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x40000000>;
        };
index 4363a4fcaccb10f61f986e86ac07ed0b663189cc..0ac7532300f030d13d9aaa2e475de7e4d1705dee 100644 (file)
@@ -20,7 +20,7 @@
                mmc0 = &sdhci0;
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x20000000>;
        };
index f8dcf1d6995c4b98bf90092fa2d5342724a668e5..d59a3831352db66f137505bf4a0ce35b371a9f29 100644 (file)
@@ -20,7 +20,7 @@
                mmc0 = &sdhci0;
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x20000000>;
        };
index 0918c686d70ea557a3bc7658b4fbae57388516ad..aa848c864637164d7175d1b96ea428562afc435e 100644 (file)
        clocks = <&clk600>, <&clk100>;
 };
 
+&lpd_dma_chan1 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&lpd_dma_chan2 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&lpd_dma_chan3 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&lpd_dma_chan4 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&lpd_dma_chan5 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&lpd_dma_chan6 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&lpd_dma_chan7 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&lpd_dma_chan8 {
+       clocks = <&clk600>, <&clk100>;
+};
+
 &nand0 {
        clocks = <&clk100 &clk100>;
 };
index b3ce0de549e058c17ab7659dd68a298ee6203df1..1c2efe459d4f31f6d33c542c16a55eeb85a95368 100644 (file)
                clock-accuracy = <100>;
        };
 
+       clk100: clk100 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+       };
+
+       clk600: clk600 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <600000000>;
+       };
+
        dp_aud_clk: clock1 {
                compatible = "fixed-clock";
                #clock-cells = <0>;
        clocks = <&misc_clk &misc_clk>;
 };
 
+&can1 {
+       clocks = <&misc_clk &misc_clk>;
+};
+
+&fpd_dma_chan1 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&fpd_dma_chan2 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&fpd_dma_chan3 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&fpd_dma_chan4 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&fpd_dma_chan5 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&fpd_dma_chan6 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&fpd_dma_chan7 {
+       clocks = <&clk600>, <&clk100>;
+};
+
+&fpd_dma_chan8 {
+       clocks = <&clk600>, <&clk100>;
+};
+
 &gem0 {
        clocks = <&misc_clk>, <&misc_clk>, <&misc_clk>;
 };
index 0bbf9a7597560195989d69ca8118aaae55381ca6..2483180d38f68c7d84ad1c7fc1f03cf6193a92b1 100644 (file)
@@ -31,7 +31,7 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x40000000>;
        };
        status = "okay";
 };
 
+&can1 {
+       status = "okay";
+};
+
 &gem0 {
        status = "okay";
        phy-handle = <&phy0>;
 &sdhci0 {
        status = "okay";
        bus-width = <8>;
+       xlnx,mio_bank = <2>;
 };
 
 &sdhci1 {
        status = "okay";
+       xlnx,mio_bank = <1>;
 };
 
 &spi0 {
index c68a41bea79aed85acd4441c5e3b13436bf6a00d..b3f42977ab3cb3be4831889d3fc1bc468bd7f0e6 100644 (file)
@@ -34,7 +34,7 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
        };
 &sdhci0 {
        status = "okay";
        bus-width = <8>;
+       xlnx,mio_bank = <0>;
 };
 
 /* SD1 with level shifter */
 &sdhci1 {
        status = "okay";
        no-1-8-v;       /* for 1.0 silicon */
+       xlnx,mio_bank = <1>;
 };
 
 &uart0 {
index 3fdfcc8a11ae87cae50f0408a349eea93f6ce025..09a114be1610a1ace54809ec5dbb57aa2e83b79e 100644 (file)
@@ -36,7 +36,7 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
        };
index 03f1ad7934c1cc0f4c829b5cc9e0a53095ad692c..1f03a94820e241601c5c5e32a2968cad6923e276 100644 (file)
@@ -41,7 +41,7 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
        };
index d754f9f9040a82195428117a3de0b4b0a809793f..698e72e0c5d0c18c46b1410eea0f7ddb854ace9e 100644 (file)
@@ -32,7 +32,7 @@
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
        };
index de9960245664734ef4b24be0d6f4f7b0b05935e5..0e9150e6b1cb1cfb3457d89dac5225972eeb36e9 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "zynqmp.dtsi"
 #include "zynqmp-clk.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "ZynqMP ZCU102 RevA";
@@ -26,6 +27,7 @@
                rtc0 = &rtc;
                serial0 = &uart0;
                serial1 = &uart1;
+               serial2 = &dcc;
                spi0 = &qspi;
                usb0 = &usb0;
        };
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0x0 0x0 0x0 0x80000000>, <0x8 0x00000000 0x0 0x80000000>;
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               autorepeat;
+               sw19 {
+                       label = "sw19";
+                       gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
+                       linux,code = <108>; /* down */
+                       gpio-key,wakeup;
+                       autorepeat;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               heartbeat_led {
+                       label = "heartbeat";
+                       gpios = <&gpio 23 0>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
 };
 
 &can1 {
        status = "okay";
 };
 
+&dcc {
+       status = "okay";
+};
+
 /* fpd_dma clk 667MHz, lpd_dma 500MHz */
 &fpd_dma_chan1 {
        status = "okay";
@@ -365,7 +394,7 @@ drivers/hwmon/pmbus/Makefile:11:obj-$(CONFIG_SENSORS_MAX20751)  += max20751.o
                /* Bus 3 is not connected */
        };
 
-       /* FIXME PL connection - u55 , PMOD - j160 */
+       /* FIXME PMOD - j160 */
        /* FIXME MSP430F - u41 - not detected */
 };
 
@@ -576,6 +605,7 @@ drivers/hwmon/pmbus/Makefile:11:obj-$(CONFIG_SENSORS_MAX20751)  += max20751.o
 &sdhci1 {
        status = "okay";
        no-1-8-v;       /* for 1.0 silicon */
+       xlnx,mio_bank = <1>;
 };
 
 &uart0 {
index 619450e1ba92c4d55965879b7ab567c0efe0e4f9..ab5c243c61d3758d8b6fb6cb2ccfd153f3989481 100644 (file)
                };
        };
 
+       dcc: dcc {
+               compatible = "arm,dcc";
+               status = "disabled";
+               u-boot,dm-pre-reloc;
+       };
+
        power-domains {
                compatible = "xlnx,zynqmp-genpd";
 
                        pd-id = <0x30>;
                };
 
-               pd_ddr: pd-ddr {
-                       #power-domain-cells = <0x0>;
-                       pd-id = <0x37>;
-               };
-
-               pd_apll: pd-apll {
-                       #power-domain-cells = <0x0>;
-                       pd-id = <0x32>;
-               };
-
-               pd_vpll: pd-vpll {
+               pd_pcie: pd-pcie {
                        #power-domain-cells = <0x0>;
-                       pd-id = <0x33>;
+                       pd-id = <0x3b>;
                };
 
-               pd_dpll: pd-dpll {
+               pd_gpu: pd-gpu {
                        #power-domain-cells = <0x0>;
-                       pd-id = <0x34>;
-               };
-
-               pd_rpll: pd-rpll {
-                       #power-domain-cells = <0x0>;
-                       pd-id = <0x35>;
-               };
-
-               pd_iopll: pd-iopll {
-                       #power-domain-cells = <0x0>;
-                       pd-id = <0x36>;
+                       pd-id = <0x3a 0x14 0x15>;
                };
        };
 
                             <1 10 0xf01>;
        };
 
-       amba_apu: amba_apu {
+       edac {
+               compatible = "arm,cortex-a53-edac";
+       };
+
+       pcap {
+               compatible = "xlnx,zynqmp-pcap-fpga";
+       };
+
+       amba_apu: amba_apu@0 {
                compatible = "simple-bus";
                #address-cells = <2>;
                #size-cells = <1>;
                compatible = "simple-bus";
                u-boot,dm-pre-reloc;
                #address-cells = <2>;
-               #size-cells = <1>;
-               ranges = <0 0 0 0 0xffffffff>;
+               #size-cells = <2>;
+               ranges;
 
                can0: can@ff060000 {
                        compatible = "xlnx,zynq-can-1.0";
                        status = "disabled";
                        clock-names = "can_clk", "pclk";
-                       reg = <0x0 0xff060000 0x1000>;
+                       reg = <0x0 0xff060000 0x0 0x1000>;
                        interrupts = <0 23 4>;
                        interrupt-parent = <&gic>;
                        tx-fifo-depth = <0x40>;
                        compatible = "xlnx,zynq-can-1.0";
                        status = "disabled";
                        clock-names = "can_clk", "pclk";
-                       reg = <0x0 0xff070000 0x1000>;
+                       reg = <0x0 0xff070000 0x0 0x1000>;
                        interrupts = <0 24 4>;
                        interrupt-parent = <&gic>;
                        tx-fifo-depth = <0x40>;
 
                cci: cci@fd6e0000 {
                        compatible = "arm,cci-400";
-                       reg = <0x0 0xfd6e0000 0x9000>;
+                       reg = <0x0 0xfd6e0000 0x0 0x9000>;
                        ranges = <0x0 0x0 0xfd6e0000 0x10000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                fpd_dma_chan1: dma@fd500000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xfd500000 0x1000>;
+                       reg = <0x0 0xfd500000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 124 4>;
                        clock-names = "clk_main", "clk_apb";
-                       xlnx,id = <0>;
                        xlnx,bus-width = <128>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x14e8>;
                        power-domains = <&pd_gdma>;
                };
 
                fpd_dma_chan2: dma@fd510000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xfd510000 0x1000>;
+                       reg = <0x0 0xfd510000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 125 4>;
                        clock-names = "clk_main", "clk_apb";
-                       xlnx,id = <1>;
                        xlnx,bus-width = <128>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x14e9>;
                        power-domains = <&pd_gdma>;
                };
 
                fpd_dma_chan3: dma@fd520000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xfd520000 0x1000>;
+                       reg = <0x0 0xfd520000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 126 4>;
                        clock-names = "clk_main", "clk_apb";
-                       xlnx,id = <2>;
                        xlnx,bus-width = <128>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x14ea>;
                        power-domains = <&pd_gdma>;
                };
 
                fpd_dma_chan4: dma@fd530000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xfd530000 0x1000>;
+                       reg = <0x0 0xfd530000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 127 4>;
                        clock-names = "clk_main", "clk_apb";
-                       xlnx,id = <3>;
                        xlnx,bus-width = <128>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x14eb>;
                        power-domains = <&pd_gdma>;
                };
 
                fpd_dma_chan5: dma@fd540000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xfd540000 0x1000>;
+                       reg = <0x0 0xfd540000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 128 4>;
                        clock-names = "clk_main", "clk_apb";
-                       xlnx,id = <4>;
                        xlnx,bus-width = <128>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x14ec>;
                        power-domains = <&pd_gdma>;
                };
 
                fpd_dma_chan6: dma@fd550000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xfd550000 0x1000>;
+                       reg = <0x0 0xfd550000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 129 4>;
                        clock-names = "clk_main", "clk_apb";
-                       xlnx,id = <5>;
                        xlnx,bus-width = <128>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x14ed>;
                        power-domains = <&pd_gdma>;
                };
 
                fpd_dma_chan7: dma@fd560000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xfd560000 0x1000>;
+                       reg = <0x0 0xfd560000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 130 4>;
                        clock-names = "clk_main", "clk_apb";
-                       xlnx,id = <6>;
                        xlnx,bus-width = <128>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x14ee>;
                        power-domains = <&pd_gdma>;
                };
 
                fpd_dma_chan8: dma@fd570000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xfd570000 0x1000>;
+                       reg = <0x0 0xfd570000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 131 4>;
                        clock-names = "clk_main", "clk_apb";
-                       xlnx,id = <7>;
                        xlnx,bus-width = <128>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x14ef>;
                        power-domains = <&pd_gdma>;
                };
 
                gpu: gpu@fd4b0000 {
                        status = "disabled";
                        compatible = "arm,mali-400", "arm,mali-utgard";
-                       reg = <0x0 0xfd4b0000 0x30000>;
+                       reg = <0x0 0xfd4b0000 0x0 0x30000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 132 4>, <0 132 4>, <0 132 4>, <0 132 4>, <0 132 4>, <0 132 4>;
                        interrupt-names = "IRQGP", "IRQGPMMU", "IRQPP0", "IRQPPMMU0", "IRQPP1", "IRQPPMMU1";
+                       power-domains = <&pd_gpu>;
                };
 
-               /* ADMA */
+               /* LPDDMA default allows only secured access. inorder to enable
+                * These dma channels, Users should ensure that these dma
+                * Channels are allowed for non secure access.
+                */
                lpd_dma_chan1: dma@ffa80000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xffa80000 0x1000>;
+                       clock-names = "clk_main", "clk_apb";
+                       reg = <0x0 0xffa80000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 77 4>;
-                       xlnx,id = <0>;
                        xlnx,bus-width = <64>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x868>;
                        power-domains = <&pd_adma>;
                };
 
                lpd_dma_chan2: dma@ffa90000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xffa90000 0x1000>;
+                       clock-names = "clk_main", "clk_apb";
+                       reg = <0x0 0xffa90000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 78 4>;
-                       xlnx,id = <1>;
                        xlnx,bus-width = <64>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x869>;
                        power-domains = <&pd_adma>;
                };
 
                lpd_dma_chan3: dma@ffaa0000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xffaa0000 0x1000>;
+                       clock-names = "clk_main", "clk_apb";
+                       reg = <0x0 0xffaa0000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 79 4>;
-                       xlnx,id = <2>;
                        xlnx,bus-width = <64>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x86a>;
                        power-domains = <&pd_adma>;
                };
 
                lpd_dma_chan4: dma@ffab0000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xffab0000 0x1000>;
+                       clock-names = "clk_main", "clk_apb";
+                       reg = <0x0 0xffab0000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 80 4>;
-                       xlnx,id = <3>;
                        xlnx,bus-width = <64>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x86b>;
                        power-domains = <&pd_adma>;
                };
 
                lpd_dma_chan5: dma@ffac0000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xffac0000 0x1000>;
+                       clock-names = "clk_main", "clk_apb";
+                       reg = <0x0 0xffac0000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 81 4>;
-                       xlnx,id = <4>;
                        xlnx,bus-width = <64>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x86c>;
                        power-domains = <&pd_adma>;
                };
 
                lpd_dma_chan6: dma@ffad0000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xffad0000 0x1000>;
+                       clock-names = "clk_main", "clk_apb";
+                       reg = <0x0 0xffad0000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 82 4>;
-                       xlnx,id = <5>;
                        xlnx,bus-width = <64>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x86d>;
                        power-domains = <&pd_adma>;
                };
 
                lpd_dma_chan7: dma@ffae0000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xffae0000 0x1000>;
+                       clock-names = "clk_main", "clk_apb";
+                       reg = <0x0 0xffae0000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 83 4>;
-                       xlnx,id = <6>;
                        xlnx,bus-width = <64>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x86e>;
                        power-domains = <&pd_adma>;
                };
 
                lpd_dma_chan8: dma@ffaf0000 {
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dma-1.0";
-                       reg = <0x0 0xffaf0000 0x1000>;
+                       clock-names = "clk_main", "clk_apb";
+                       reg = <0x0 0xffaf0000 0x0 0x1000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 84 4>;
-                       xlnx,id = <7>;
                        xlnx,bus-width = <64>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x86f>;
                        power-domains = <&pd_adma>;
                };
 
                mc: memory-controller@fd070000 {
                        compatible = "xlnx,zynqmp-ddrc-2.40a";
-                       reg = <0x0 0xfd070000 0x30000>;
+                       reg = <0x0 0xfd070000 0x0 0x30000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 112 4>;
                };
                nand0: nand@ff100000 {
                        compatible = "arasan,nfc-v3p10";
                        status = "disabled";
-                       reg = <0x0 0xff100000 0x1000>;
+                       reg = <0x0 0xff100000 0x0 0x1000>;
                        clock-names = "clk_sys", "clk_flash";
                        interrupt-parent = <&gic>;
                        interrupts = <0 14 4>;
                        #address-cells = <2>;
                        #size-cells = <1>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x872>;
                        power-domains = <&pd_nand>;
                };
 
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 57 4>, <0 57 4>;
-                       reg = <0x0 0xff0b0000 0x1000>;
+                       reg = <0x0 0xff0b0000 0x0 0x1000>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #stream-id-cells = <1>;
+                       iommus = <&smmu 0x874>;
                        power-domains = <&pd_eth0>;
                };
 
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 59 4>, <0 59 4>;
-                       reg = <0x0 0xff0c0000 0x1000>;
+                       reg = <0x0 0xff0c0000 0x0 0x1000>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #stream-id-cells = <1>;
+                       iommus = <&smmu 0x875>;
                        power-domains = <&pd_eth1>;
                };
 
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 61 4>, <0 61 4>;
-                       reg = <0x0 0xff0d0000 0x1000>;
+                       reg = <0x0 0xff0d0000 0x0 0x1000>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #stream-id-cells = <1>;
+                       iommus = <&smmu 0x876>;
                        power-domains = <&pd_eth2>;
                };
 
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 63 4>, <0 63 4>;
-                       reg = <0x0 0xff0e0000 0x1000>;
+                       reg = <0x0 0xff0e0000 0x0 0x1000>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #stream-id-cells = <1>;
+                       iommus = <&smmu 0x877>;
                        power-domains = <&pd_eth3>;
                };
 
                        compatible = "xlnx,zynqmp-gpio-1.0";
                        status = "disabled";
                        #gpio-cells = <0x2>;
-                       #interrupt-cells = <2>;
-                       interrupt-controller;
                        interrupt-parent = <&gic>;
                        interrupts = <0 16 4>;
-                       reg = <0x0 0xff0a0000 0x1000>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       reg = <0x0 0xff0a0000 0x0 0x1000>;
                        power-domains = <&pd_gpio>;
                };
 
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 17 4>;
-                       reg = <0x0 0xff020000 0x1000>;
+                       reg = <0x0 0xff020000 0x0 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        power-domains = <&pd_i2c0>;
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 18 4>;
-                       reg = <0x0 0xff030000 0x1000>;
+                       reg = <0x0 0xff030000 0x0 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        power-domains = <&pd_i2c1>;
                };
 
+               ocm: memory-controller@ff960000 {
+                       compatible = "xlnx,zynqmp-ocmc-1.0";
+                       reg = <0x0 0xff960000 0x0 0x1000>;
+                       interrupt-parent = <&gic>;
+                       interrupts = <0 10 4>;
+               };
+
                pcie: pcie@fd0e0000 {
                        compatible = "xlnx,nwl-pcie-2.11";
                        status = "disabled";
                        #address-cells = <3>;
                        #size-cells = <2>;
                        #interrupt-cells = <1>;
+                       msi-controller;
                        device_type = "pci";
                        interrupt-parent = <&gic>;
                        interrupts = <0 118 4>,
+                                    <0 117 4>,
                                     <0 116 4>,
                                     <0 115 4>, /* MSI_1 [63...32] */
                                     <0 114 4>; /* MSI_0 [31...0] */
-                       interrupt-names = "misc", "intx", "msi_1", "msi_0";
-                       reg = <0x0 0xfd0e0000 0x1000>,
-                             <0x0 0xfd480000 0x1000>,
-                             <0x0 0xe0000000 0x1000000>;
+                       interrupt-names = "misc","dummy","intx", "msi1", "msi0";
+                       msi-parent = <&pcie>;
+                       reg = <0x0 0xfd0e0000 0x0 0x1000>,
+                             <0x0 0xfd480000 0x0 0x1000>,
+                             <0x80 0x00000000 0x0 0x1000000>;
                        reg-names = "breg", "pcireg", "cfg";
-                       ranges = <0x02000000 0x00000000 0xe1000000 0x00000000 0xe1000000 0 0x0f000000>;
+                       ranges = <0x02000000 0x00000000 0xe0000000 0x00000000 0xe0000000 0x00000000 0x10000000  /* non-prefetchable memory */
+                                 0x43000000 0x00000006 0x00000000 0x00000006 0x00000000 0x00000002 0x00000000>;/* prefetchable memory */
                        interrupt-map-mask = <0x0 0x0 0x0 0x7>;
                        interrupt-map = <0x0 0x0 0x0 0x1 &pcie_intc 0x1>,
                                        <0x0 0x0 0x0 0x2 &pcie_intc 0x2>,
                                        <0x0 0x0 0x0 0x3 &pcie_intc 0x3>,
                                        <0x0 0x0 0x0 0x4 &pcie_intc 0x4>;
+                       power-domains = <&pd_pcie>;
                        pcie_intc: legacy-interrupt-controller {
                                interrupt-controller;
                                #address-cells = <0>;
                        interrupts = <0 15 4>;
                        interrupt-parent = <&gic>;
                        num-cs = <1>;
-                       reg = <0x0 0xff0f0000 0x1000>,
-                             <0x0 0xc0000000 0x8000000>;
+                       reg = <0x0 0xff0f0000 0x0 0x1000>,
+                             <0x0 0xc0000000 0x0 0x8000000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x873>;
                        power-domains = <&pd_qspi>;
                };
 
                rtc: rtc@ffa60000 {
                        compatible = "xlnx,zynqmp-rtc";
                        status = "disabled";
-                       reg = <0x0 0xffa60000 0x100>;
+                       reg = <0x0 0xffa60000 0x0 0x100>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 26 4>, <0 27 4>;
                        interrupt-names = "alarm", "sec";
                };
 
+               serdes: zynqmp_phy@fd400000 {
+                       compatible = "xlnx,zynqmp-psgtr";
+                       status = "disabled";
+                       reg = <0x0 0xfd400000 0x0 0x40000>,
+                             <0x0 0xfd3d0000 0x0 0x1000>,
+                             <0x0 0xfd1a0000 0x0 0x1000>,
+                             <0x0 0xff5e0000 0x0 0x1000>;
+                       reg-names = "serdes", "siou", "fpd", "lpd";
+                       xlnx,tx_termination_fix;
+                       lane0: lane0 {
+                               #phy-cells = <4>;
+                       };
+                       lane1: lane1 {
+                               #phy-cells = <4>;
+                       };
+                       lane2: lane2 {
+                               #phy-cells = <4>;
+                       };
+                       lane3: lane3 {
+                               #phy-cells = <4>;
+                       };
+               };
+
                sata: ahci@fd0c0000 {
                        compatible = "ceva,ahci-1v84";
                        status = "disabled";
-                       reg = <0x0 0xfd0c0000 0x2000>;
+                       reg = <0x0 0xfd0c0000 0x0 0x2000>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 133 4>;
                        power-domains = <&pd_sata>;
 
                sdhci0: sdhci@ff160000 {
                        u-boot,dm-pre-reloc;
-                       compatible = "arasan,sdhci-8.9a";
+                       compatible = "xlnx,zynqmp-8.9a", "arasan,sdhci-8.9a";
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 48 4>;
-                       reg = <0x0 0xff160000 0x1000>;
+                       reg = <0x0 0xff160000 0x0 0x1000>;
                        clock-names = "clk_xin", "clk_ahb";
-                       broken-tuning;
+                       xlnx,device_id = <0>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x870>;
                        power-domains = <&pd_sd0>;
                };
 
                sdhci1: sdhci@ff170000 {
                        u-boot,dm-pre-reloc;
-                       compatible = "arasan,sdhci-8.9a";
+                       compatible = "xlnx,zynqmp-8.9a", "arasan,sdhci-8.9a";
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 49 4>;
-                       reg = <0x0 0xff170000 0x1000>;
+                       reg = <0x0 0xff170000 0x0 0x1000>;
                        clock-names = "clk_xin", "clk_ahb";
-                       broken-tuning;
+                       xlnx,device_id = <1>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x871>;
                        power-domains = <&pd_sd1>;
                };
 
                smmu: smmu@fd800000 {
                        compatible = "arm,mmu-500";
-                       reg = <0x0 0xfd800000 0x20000>;
+                       reg = <0x0 0xfd800000 0x0 0x20000>;
+                       #iommu-cells = <1>;
                        #global-interrupts = <1>;
                        interrupt-parent = <&gic>;
                        interrupts = <0 155 4>,
                        mmu-masters = < &gem0 0x874
                                        &gem1 0x875
                                        &gem2 0x876
-                                       &gem3 0x877 >;
+                                       &gem3 0x877
+                                       &usb0 0x860
+                                       &usb1 0x861
+                                       &qspi 0x873
+                                       &lpd_dma_chan1 0x868
+                                       &lpd_dma_chan2 0x869
+                                       &lpd_dma_chan3 0x86a
+                                       &lpd_dma_chan4 0x86b
+                                       &lpd_dma_chan5 0x86c
+                                       &lpd_dma_chan6 0x86d
+                                       &lpd_dma_chan7 0x86e
+                                       &lpd_dma_chan8 0x86f
+                                       &fpd_dma_chan1 0x14e8
+                                       &fpd_dma_chan2 0x14e9
+                                       &fpd_dma_chan3 0x14ea
+                                       &fpd_dma_chan4 0x14eb
+                                       &fpd_dma_chan5 0x14ec
+                                       &fpd_dma_chan6 0x14ed
+                                       &fpd_dma_chan7 0x14ee
+                                       &fpd_dma_chan8 0x14ef
+                                       &sdhci0 0x870
+                                       &sdhci1 0x871
+                                       &nand0 0x872>;
                };
 
                spi0: spi@ff040000 {
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 19 4>;
-                       reg = <0x0 0xff040000 0x1000>;
+                       reg = <0x0 0xff040000 0x0 0x1000>;
                        clock-names = "ref_clk", "pclk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 20 4>;
-                       reg = <0x0 0xff050000 0x1000>;
+                       reg = <0x0 0xff050000 0x0 0x1000>;
                        clock-names = "ref_clk", "pclk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 36 4>, <0 37 4>, <0 38 4>;
-                       reg = <0x0 0xff110000 0x1000>;
+                       reg = <0x0 0xff110000 0x0 0x1000>;
                        timer-width = <32>;
                        power-domains = <&pd_ttc0>;
                };
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 39 4>, <0 40 4>, <0 41 4>;
-                       reg = <0x0 0xff120000 0x1000>;
+                       reg = <0x0 0xff120000 0x0 0x1000>;
                        timer-width = <32>;
                        power-domains = <&pd_ttc1>;
                };
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 42 4>, <0 43 4>, <0 44 4>;
-                       reg = <0x0 0xff130000 0x1000>;
+                       reg = <0x0 0xff130000 0x0 0x1000>;
                        timer-width = <32>;
                        power-domains = <&pd_ttc2>;
                };
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 45 4>, <0 46 4>, <0 47 4>;
-                       reg = <0x0 0xff140000 0x1000>;
+                       reg = <0x0 0xff140000 0x0 0x1000>;
                        timer-width = <32>;
                        power-domains = <&pd_ttc3>;
                };
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 21 4>;
-                       reg = <0x0 0xff000000 0x1000>;
+                       reg = <0x0 0xff000000 0x0 0x1000>;
                        clock-names = "uart_clk", "pclk";
                        power-domains = <&pd_uart0>;
                };
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 22 4>;
-                       reg = <0x0 0xff010000 0x1000>;
+                       reg = <0x0 0xff010000 0x0 0x1000>;
                        clock-names = "uart_clk", "pclk";
                        power-domains = <&pd_uart1>;
                };
 
-               usb0: usb@fe200000 {
+               usb0: usb0 {
                        #address-cells = <2>;
-                       #size-cells = <1>;
+                       #size-cells = <2>;
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dwc3";
                        clock-names = "bus_clk", "ref_clk";
                        clocks = <&clk125>, <&clk125>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x860>;
                        power-domains = <&pd_usb0>;
                        ranges;
 
                        dwc3_0: dwc3@fe200000 {
                                compatible = "snps,dwc3";
                                status = "disabled";
-                               reg = <0x0 0xfe200000 0x40000>;
+                               reg = <0x0 0xfe200000 0x0 0x40000>;
                                interrupt-parent = <&gic>;
                                interrupts = <0 65 4>;
                                /* snps,quirk-frame-length-adjustment = <0x20>; */
                        };
                };
 
-               usb1: usb@fe300000 {
+               usb1: usb1 {
                        #address-cells = <2>;
-                       #size-cells = <1>;
+                       #size-cells = <2>;
                        status = "disabled";
                        compatible = "xlnx,zynqmp-dwc3";
                        clock-names = "bus_clk", "ref_clk";
                        clocks = <&clk125>, <&clk125>;
+                       #stream-id-cells = <1>;
+                       iommus = <&smmu 0x861>;
                        power-domains = <&pd_usb1>;
                        ranges;
 
                        dwc3_1: dwc3@fe300000 {
                                compatible = "snps,dwc3";
                                status = "disabled";
-                               reg = <0x0 0xfe300000 0x40000>;
+                               reg = <0x0 0xfe300000 0x0 0x40000>;
                                interrupt-parent = <&gic>;
                                interrupts = <0 70 4>;
                                /* snps,quirk-frame-length-adjustment = <0x20>; */
                        status = "disabled";
                        interrupt-parent = <&gic>;
                        interrupts = <0 113 1>;
-                       reg = <0x0 0xfd4d0000 0x1000>;
+                       reg = <0x0 0xfd4d0000 0x0 0x1000>;
                        timeout-sec = <10>;
                };
 
                                xlnx,pixel-format = "rgb565";
                                plane0 {
                                        dmas = <&xlnx_dpdma 3>;
-                                       dma-names = "dma";
+                                       dma-names = "dma0";
                                };
                                plane1 {
-                                       dmas = <&xlnx_dpdma 0>;
-                                       dma-names = "dma";
+                                       dmas = <&xlnx_dpdma 0>,
+                                              <&xlnx_dpdma 1>,
+                                              <&xlnx_dpdma 2>;
+                                       dma-names = "dma0", "dma1", "dma2";
                                };
                        };
                };
                xlnx_dp: dp@fd4a0000 {
                        compatible = "xlnx,v-dp";
                        status = "disabled";
-                       reg = <0x0 0xfd4a0000 0x1000>,
-                             <0x0 0xfd400000 0x20000>;
+                       reg = <0x0 0xfd4a0000 0x0 0x1000>;
                        interrupts = <0 119 4>;
                        interrupt-parent = <&gic>;
                        clock-names = "aclk", "aud_clk";
                xlnx_dp_sub: dp_sub@fd4aa000 {
                        compatible = "xlnx,dp-sub";
                        status = "disabled";
-                       reg = <0x0 0xfd4aa000 0x1000>,
-                             <0x0 0xfd4ab000 0x1000>,
-                             <0x0 0xfd4ac000 0x1000>;
+                       reg = <0x0 0xfd4aa000 0x0 0x1000>,
+                             <0x0 0xfd4ab000 0x0 0x1000>,
+                             <0x0 0xfd4ac000 0x0 0x1000>;
                        reg-names = "blend", "av_buf", "aud";
                        xlnx,output-fmt = "rgb";
                        xlnx,vid-fmt = "yuyv";
                xlnx_dpdma: dma@fd4c0000 {
                        compatible = "xlnx,dpdma";
                        status = "disabled";
-                       reg = <0x0 0xfd4c0000 0x1000>;
+                       reg = <0x0 0xfd4c0000 0x0 0x1000>;
                        interrupts = <0 122 4>;
                        interrupt-parent = <&gic>;
                        clock-names = "axi_clk";
                        dma-channels = <6>;
                        #dma-cells = <1>;
-                       dma-video0channel@fd4c0000 {
+                       dma-video0channel {
                                compatible = "xlnx,video0";
                        };
-                       dma-video1channel@fd4c0000 {
+                       dma-video1channel {
                                compatible = "xlnx,video1";
                        };
-                       dma-video2channel@fd4c0000 {
+                       dma-video2channel {
                                compatible = "xlnx,video2";
                        };
-                       dma-graphicschannel@fd4c0000 {
+                       dma-graphicschannel {
                                compatible = "xlnx,graphics";
                        };
-                       dma-audio0channel@fd4c0000 {
+                       dma-audio0channel {
                                compatible = "xlnx,audio0";
                        };
-                       dma-audio1channel@fd4c0000 {
+                       dma-audio1channel {
                                compatible = "xlnx,audio1";
                        };
                };
index ed1a46c2e71d7477e04b30ee5ca7e440fce095aa..0c5792baa87151f748d82ea0f12ec2f24cc6ff0b 100644 (file)
@@ -19,6 +19,7 @@ u32 get_sysboot_value(void);
 extern struct ctrl_stat *cstat;
 u32 get_device_type(void);
 void save_omap_boot_params(void);
+void setup_early_clocks(void);
 void setup_clocks_for_console(void);
 void mpu_pll_config_val(int mpull_m);
 void ddr_pll_config(unsigned int ddrpll_M);
@@ -44,3 +45,4 @@ int am335x_get_tps65910_mpu_vdd(int sil_rev, int frequency);
 
 void enable_usb_clocks(int index);
 void disable_usb_clocks(int index);
+void do_board_detect(void);
index 4201e0fbec4a7c7e410050b6954a3c86ea947db7..6c3ba494f891d9d0582484883412e0288c489bd5 100644 (file)
@@ -25,6 +25,7 @@
 #ifndef L1_CACHE_BYTES
 #define L1_CACHE_SHIFT         6
 #define L1_CACHE_BYTES         BIT(L1_CACHE_SHIFT)
+#define CONFIG_FSL_TZASC_400
 #endif
 
 #define CONFIG_SYS_FSL_OCRAM_BASE      0x18000000      /* initial RAM */
index e2d96a1b7816b2666636278bb3bf606121e6d21d..a97be5c098a23ec203a711b6bf9e98c4db16c0cf 100644 (file)
@@ -11,6 +11,10 @@ static struct cpu_type cpu_type_list[] = {
        CPU_TYPE_ENTRY(LS2080A, LS2080A, 8),
        CPU_TYPE_ENTRY(LS2085A, LS2085A, 8),
        CPU_TYPE_ENTRY(LS2045A, LS2045A, 4),
+       CPU_TYPE_ENTRY(LS2088A, LS2088A, 8),
+       CPU_TYPE_ENTRY(LS2084A, LS2084A, 8),
+       CPU_TYPE_ENTRY(LS2048A, LS2048A, 4),
+       CPU_TYPE_ENTRY(LS2044A, LS2044A, 4),
        CPU_TYPE_ENTRY(LS1043A, LS1043A, 4),
        CPU_TYPE_ENTRY(LS1023A, LS1023A, 2),
        CPU_TYPE_ENTRY(LS1046A, LS1046A, 4),
index 7acba2730aac21e861161f14de9904c522fd759d..2df56f7a5b20adb9b18369d816ff7b652c8cdcff 100644 (file)
 #define CONFIG_SYS_IFC_ADDR                    (CONFIG_SYS_IMMR + 0x01240000)
 #define CONFIG_SYS_NS16550_COM1                        (CONFIG_SYS_IMMR + 0x011C0500)
 #define CONFIG_SYS_NS16550_COM2                        (CONFIG_SYS_IMMR + 0x011C0600)
-#define CONFIG_SYS_FSL_TIMER_ADDR              0x023d0000
+#define SYS_FSL_LS2080A_LS2085A_TIMER_ADDR     0x023d0000
+#define CONFIG_SYS_FSL_TIMER_ADDR              0x023e0000
 #define CONFIG_SYS_FSL_PMU_CLTBENR             (CONFIG_SYS_FSL_PMU_ADDR + \
                                                 0x18A0)
 #define FSL_PMU_PCTBENR_OFFSET (CONFIG_SYS_FSL_PMU_ADDR + 0x8A0)
+#define FSL_LSCH3_SVR          (CONFIG_SYS_FSL_GUTS_ADDR + 0xA4)
 
 #define CONFIG_SYS_FSL_WRIOP1_ADDR             (CONFIG_SYS_IMMR + 0x7B80000)
 #define CONFIG_SYS_FSL_WRIOP1_MDIO1    (CONFIG_SYS_FSL_WRIOP1_ADDR + 0x16000)
 #define TP_CLUSTER_INIT_MASK   0x0000003f      /* initiator mask */
 #define TP_INIT_PER_CLUSTER     4
 /* This is chassis generation 3 */
-
+#ifndef __ASSEMBLY__
 struct sys_info {
        unsigned long freq_processor[CONFIG_MAX_CPUS];
        unsigned long freq_systembus;
@@ -317,6 +319,5 @@ struct ccsr_reset {
        u32 ip_rev2;                    /* 0xbfc */
 };
 
-uint get_svr(void);
-
+#endif /*__ASSEMBLY__*/
 #endif /* __ARCH_FSL_LSCH3_IMMAP_H_ */
index f7306ff266717b9c8ac2d17e1d5c2fb00b5712fb..d0832b54bc546b975ff4a1fe1ceae160bd5a64fc 100644 (file)
@@ -13,6 +13,7 @@
 *      uint64_t entry_addr;
 *      uint64_t status;
 *      uint64_t lpid;
+*      uint64_t os_arch;
 * };
 * we pad this struct to 64 bytes so each entry is in its own cacheline
 * the actual spin table is an array of these structures
@@ -20,6 +21,7 @@
 #define SPIN_TABLE_ELEM_ENTRY_ADDR_IDX 0
 #define SPIN_TABLE_ELEM_STATUS_IDX     1
 #define SPIN_TABLE_ELEM_LPID_IDX       2
+#define SPIN_TABLE_ELEM_OS_ARCH_IDX    3
 #define WORDS_PER_SPIN_TABLE_ENTRY     8       /* pad to 64 bytes */
 #define SPIN_TABLE_ELEM_SIZE           64
 
@@ -36,4 +38,8 @@ void secondary_boot_func(void);
 int is_core_online(u64 cpu_id);
 u32 cpu_pos_mask(void);
 #endif
+
+#define IH_ARCH_ARM            2       /* ARM */
+#define IH_ARCH_ARM64          22      /* ARM64 */
+
 #endif /* _FSL_LAYERSCAPE_MP_H */
index 58e90d8d8819c24871aac575929320d3259a3b4a..78363b602c778f74a67832bd6be64ef32fe3202d 100644 (file)
@@ -30,7 +30,7 @@
 #define pex_lut_in32(a)       in_be32(a)
 #define pex_lut_out32(a, v)   out_be32(a, v)
 #endif
-
+#ifndef __ASSEMBLY__
 struct cpu_type {
        char name[15];
        u32 soc_ver;
@@ -39,7 +39,7 @@ struct cpu_type {
 
 #define CPU_TYPE_ENTRY(n, v, nc) \
        { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc)}
-
+#endif
 #define SVR_WO_E               0xFFFFFE
 #define SVR_LS1012A            0x870400
 #define SVR_LS1043A            0x879200
@@ -50,6 +50,12 @@ struct cpu_type {
 #define SVR_LS2080A            0x870110
 #define SVR_LS2085A            0x870100
 #define SVR_LS2040A            0x870130
+#define SVR_LS2088A            0x870900
+#define SVR_LS2084A            0x870910
+#define SVR_LS2048A            0x870920
+#define SVR_LS2044A            0x870930
+
+#define SVR_DEV_LS2080A                0x8701
 
 #define SVR_MAJ(svr)           (((svr) >> 4) & 0xf)
 #define SVR_MIN(svr)           (((svr) >> 0) & 0xf)
@@ -63,6 +69,7 @@ struct cpu_type {
 #define AHCI_PORT_TRANS_CFG    0x08000029
 #define AHCI_PORT_AXICC_CFG    0x3fffffff
 
+#ifndef __ASSEMBLY__
 /* AHCI (sata) register map */
 struct ccsr_ahci {
        u32 res1[0xa4/4];       /* 0x0 - 0xa4 */
@@ -105,4 +112,5 @@ void erratum_a010315(void);
 
 bool soc_has_dp_ddr(void);
 bool soc_has_aiop(void);
+#endif
 #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */
index 78869a253d1f604427ae70101ea78261bba99f54..3545aed1734755f453aee447c6c2c16a59e92b76 100644 (file)
@@ -52,6 +52,10 @@ struct kwspi_registers {
 #define KWSPI_ADRLEN_3BYTE     (2 << 8)
 #define KWSPI_ADRLEN_4BYTE     (3 << 8)
 #define KWSPI_ADRLEN_MASK      (3 << 8)
+#define KWSPI_CPOL             (1 << 11)
+#define KWSPI_CPHA             (1 << 12)
+#define KWSPI_TXLSBF           (1 << 13)
+#define KWSPI_RXLSBF           (1 << 14)
 
 #define KWSPI_IRQUNMASK                1 /* unmask SPI interrupt */
 #define KWSPI_IRQMASK          0 /* mask SPI interrupt */
index 456c1b0902e578c985dba3af3115873863102748..e7738faaf896d4b04576acd90c8ce817fb12fa0a 100644 (file)
@@ -79,6 +79,7 @@ struct iou_scntr_secure {
 #define NAND_MODE      0x00000004
 #define EMMC_MODE      0x00000006
 #define USB_MODE       0x00000007
+#define SD1_LSHFT_MODE 0x0000000E /* SD1 Level shifter */
 #define JTAG_MODE      0x00000000
 #define BOOT_MODE_USE_ALT      0x100
 #define BOOT_MODE_ALT_SHIFT    12
index 10550174df4bddc9f73e32ea89e8fd66e49f9d78..aee87cdcbf9e1b0c81a287475131476bc7ae01fc 100644 (file)
@@ -60,7 +60,7 @@ struct arch_global_data {
        unsigned long tlb_allocated;
 #endif
 
-#ifdef CONFIG_OMAP_COMMON
+#ifdef CONFIG_ARCH_OMAP2
        u32 omap_boot_device;
        u32 omap_boot_mode;
        u8 omap_ch_flags;
index 9bb0efa5ff04e41a345ebc8446ab509dd2c22ae3..2553e3e349c5da1a4572fe735e0cbb5ec4ea5f04 100644 (file)
@@ -8,6 +8,11 @@
 
 #ifndef __ASM_ARM_MACRO_H__
 #define __ASM_ARM_MACRO_H__
+
+#ifdef CONFIG_ARM64
+#include <asm/system.h>
+#endif
+
 #ifdef __ASSEMBLY__
 
 /*
@@ -135,13 +140,21 @@ lr        .req    x30
 #endif
 .endm
 
-.macro armv8_switch_to_el2_m, xreg1
-       /* 64bit EL2 | HCE | SMD | RES1 (Bits[5:4]) | Non-secure EL0/EL1 */
-       mov     \xreg1, #0x5b1
-       msr     scr_el3, \xreg1
+/*
+ * Switch from EL3 to EL2 for ARMv8
+ * @ep:     kernel entry point
+ * @flag:   The execution state flag for lower exception
+ *          level, ES_TO_AARCH64 or ES_TO_AARCH32
+ * @tmp:    temporary register
+ *
+ * For loading 32-bit OS, x1 is machine nr and x2 is ftaddr.
+ * For loading 64-bit OS, x0 is physical address to the FDT blob.
+ * They will be passed to the guest.
+ */
+.macro armv8_switch_to_el2_m, ep, flag, tmp
        msr     cptr_el3, xzr           /* Disable coprocessor traps to EL3 */
-       mov     \xreg1, #0x33ff
-       msr     cptr_el2, \xreg1        /* Disable coprocessor traps to EL2 */
+       mov     \tmp, #CPTR_EL2_RES1
+       msr     cptr_el2, \tmp          /* Disable coprocessor traps to EL2 */
 
        /* Initialize Generic Timers */
        msr     cntvoff_el2, xzr
@@ -152,45 +165,90 @@ lr        .req    x30
         * and RES0 bits (31,30,27,26,24,21,20,17,15-13,10-6) +
         * EE,WXN,I,SA,C,A,M to 0
         */
-       mov     \xreg1, #0x0830
-       movk    \xreg1, #0x30C5, lsl #16
-       msr     sctlr_el2, \xreg1
+       ldr     \tmp, =(SCTLR_EL2_RES1 | SCTLR_EL2_EE_LE |\
+                       SCTLR_EL2_WXN_DIS | SCTLR_EL2_ICACHE_DIS |\
+                       SCTLR_EL2_SA_DIS | SCTLR_EL2_DCACHE_DIS |\
+                       SCTLR_EL2_ALIGN_DIS | SCTLR_EL2_MMU_DIS)
+       msr     sctlr_el2, \tmp
+
+       mov     \tmp, sp
+       msr     sp_el2, \tmp            /* Migrate SP */
+       mrs     \tmp, vbar_el3
+       msr     vbar_el2, \tmp          /* Migrate VBAR */
+
+       /* Check switch to AArch64 EL2 or AArch32 Hypervisor mode */
+       cmp     \flag, #ES_TO_AARCH32
+       b.eq    1f
+
+       /*
+        * The next lower exception level is AArch64, 64bit EL2 | HCE |
+        * SMD | RES1 (Bits[5:4]) | Non-secure EL0/EL1.
+        */
+       ldr     \tmp, =(SCR_EL3_RW_AARCH64 | SCR_EL3_HCE_EN |\
+                       SCR_EL3_SMD_DIS | SCR_EL3_RES1 |\
+                       SCR_EL3_NS_EN)
+       msr     scr_el3, \tmp
 
        /* Return to the EL2_SP2 mode from EL3 */
-       mov     \xreg1, sp
-       msr     sp_el2, \xreg1          /* Migrate SP */
-       mrs     \xreg1, vbar_el3
-       msr     vbar_el2, \xreg1        /* Migrate VBAR */
-       mov     \xreg1, #0x3c9
-       msr     spsr_el3, \xreg1        /* EL2_SP2 | D | A | I | F */
-       msr     elr_el3, lr
+       ldr     \tmp, =(SPSR_EL_DEBUG_MASK | SPSR_EL_SERR_MASK |\
+                       SPSR_EL_IRQ_MASK | SPSR_EL_FIQ_MASK |\
+                       SPSR_EL_M_AARCH64 | SPSR_EL_M_EL2H)
+       msr     spsr_el3, \tmp
+       msr     elr_el3, \ep
+       eret
+
+1:
+       /*
+        * The next lower exception level is AArch32, 32bit EL2 | HCE |
+        * SMD | RES1 (Bits[5:4]) | Non-secure EL0/EL1.
+        */
+       ldr     \tmp, =(SCR_EL3_RW_AARCH32 | SCR_EL3_HCE_EN |\
+                       SCR_EL3_SMD_DIS | SCR_EL3_RES1 |\
+                       SCR_EL3_NS_EN)
+       msr     scr_el3, \tmp
+
+       /* Return to AArch32 Hypervisor mode */
+       ldr     \tmp, =(SPSR_EL_END_LE | SPSR_EL_ASYN_MASK |\
+                       SPSR_EL_IRQ_MASK | SPSR_EL_FIQ_MASK |\
+                       SPSR_EL_T_A32 | SPSR_EL_M_AARCH32 |\
+                       SPSR_EL_M_HYP)
+       msr     spsr_el3, \tmp
+       msr     elr_el3, \ep
        eret
 .endm
 
-.macro armv8_switch_to_el1_m, xreg1, xreg2
+/*
+ * Switch from EL2 to EL1 for ARMv8
+ * @ep:     kernel entry point
+ * @flag:   The execution state flag for lower exception
+ *          level, ES_TO_AARCH64 or ES_TO_AARCH32
+ * @tmp:    temporary register
+ *
+ * For loading 32-bit OS, x1 is machine nr and x2 is ftaddr.
+ * For loading 64-bit OS, x0 is physical address to the FDT blob.
+ * They will be passed to the guest.
+ */
+.macro armv8_switch_to_el1_m, ep, flag, tmp
        /* Initialize Generic Timers */
-       mrs     \xreg1, cnthctl_el2
-       orr     \xreg1, \xreg1, #0x3    /* Enable EL1 access to timers */
-       msr     cnthctl_el2, \xreg1
+       mrs     \tmp, cnthctl_el2
+       /* Enable EL1 access to timers */
+       orr     \tmp, \tmp, #(CNTHCTL_EL2_EL1PCEN_EN |\
+               CNTHCTL_EL2_EL1PCTEN_EN)
+       msr     cnthctl_el2, \tmp
        msr     cntvoff_el2, xzr
 
        /* Initilize MPID/MPIDR registers */
-       mrs     \xreg1, midr_el1
-       mrs     \xreg2, mpidr_el1
-       msr     vpidr_el2, \xreg1
-       msr     vmpidr_el2, \xreg2
+       mrs     \tmp, midr_el1
+       msr     vpidr_el2, \tmp
+       mrs     \tmp, mpidr_el1
+       msr     vmpidr_el2, \tmp
 
        /* Disable coprocessor traps */
-       mov     \xreg1, #0x33ff
-       msr     cptr_el2, \xreg1        /* Disable coprocessor traps to EL2 */
+       mov     \tmp, #CPTR_EL2_RES1
+       msr     cptr_el2, \tmp          /* Disable coprocessor traps to EL2 */
        msr     hstr_el2, xzr           /* Disable coprocessor traps to EL2 */
-       mov     \xreg1, #3 << 20
-       msr     cpacr_el1, \xreg1       /* Enable FP/SIMD at EL1 */
-
-       /* Initialize HCR_EL2 */
-       mov     \xreg1, #(1 << 31)              /* 64bit EL1 */
-       orr     \xreg1, \xreg1, #(1 << 29)      /* Disable HVC */
-       msr     hcr_el2, \xreg1
+       mov     \tmp, #CPACR_EL1_FPEN_EN
+       msr     cpacr_el1, \tmp         /* Enable FP/SIMD at EL1 */
 
        /* SCTLR_EL1 initialization
         *
@@ -199,18 +257,50 @@ lr        .req    x30
         * UCI,EE,EOE,WXN,nTWE,nTWI,UCT,DZE,I,UMA,SED,ITD,
         * CP15BEN,SA0,SA,C,A,M to 0
         */
-       mov     \xreg1, #0x0800
-       movk    \xreg1, #0x30d0, lsl #16
-       msr     sctlr_el1, \xreg1
+       ldr     \tmp, =(SCTLR_EL1_RES1 | SCTLR_EL1_UCI_DIS |\
+                       SCTLR_EL1_EE_LE | SCTLR_EL1_WXN_DIS |\
+                       SCTLR_EL1_NTWE_DIS | SCTLR_EL1_NTWI_DIS |\
+                       SCTLR_EL1_UCT_DIS | SCTLR_EL1_DZE_DIS |\
+                       SCTLR_EL1_ICACHE_DIS | SCTLR_EL1_UMA_DIS |\
+                       SCTLR_EL1_SED_EN | SCTLR_EL1_ITD_EN |\
+                       SCTLR_EL1_CP15BEN_DIS | SCTLR_EL1_SA0_DIS |\
+                       SCTLR_EL1_SA_DIS | SCTLR_EL1_DCACHE_DIS |\
+                       SCTLR_EL1_ALIGN_DIS | SCTLR_EL1_MMU_DIS)
+       msr     sctlr_el1, \tmp
+
+       mov     \tmp, sp
+       msr     sp_el1, \tmp            /* Migrate SP */
+       mrs     \tmp, vbar_el2
+       msr     vbar_el1, \tmp          /* Migrate VBAR */
+
+       /* Check switch to AArch64 EL1 or AArch32 Supervisor mode */
+       cmp     \flag, #ES_TO_AARCH32
+       b.eq    1f
+
+       /* Initialize HCR_EL2 */
+       ldr     \tmp, =(HCR_EL2_RW_AARCH64 | HCR_EL2_HCD_DIS)
+       msr     hcr_el2, \tmp
 
        /* Return to the EL1_SP1 mode from EL2 */
-       mov     \xreg1, sp
-       msr     sp_el1, \xreg1          /* Migrate SP */
-       mrs     \xreg1, vbar_el2
-       msr     vbar_el1, \xreg1        /* Migrate VBAR */
-       mov     \xreg1, #0x3c5
-       msr     spsr_el2, \xreg1        /* EL1_SP1 | D | A | I | F */
-       msr     elr_el2, lr
+       ldr     \tmp, =(SPSR_EL_DEBUG_MASK | SPSR_EL_SERR_MASK |\
+                       SPSR_EL_IRQ_MASK | SPSR_EL_FIQ_MASK |\
+                       SPSR_EL_M_AARCH64 | SPSR_EL_M_EL1H)
+       msr     spsr_el2, \tmp
+       msr     elr_el2, \ep
+       eret
+
+1:
+       /* Initialize HCR_EL2 */
+       ldr     \tmp, =(HCR_EL2_RW_AARCH32 | HCR_EL2_HCD_DIS)
+       msr     hcr_el2, \tmp
+
+       /* Return to AArch32 Supervisor mode from EL2 */
+       ldr     \tmp, =(SPSR_EL_END_LE | SPSR_EL_ASYN_MASK |\
+                       SPSR_EL_IRQ_MASK | SPSR_EL_FIQ_MASK |\
+                       SPSR_EL_T_A32 | SPSR_EL_M_AARCH32 |\
+                       SPSR_EL_M_SVC)
+       msr     spsr_el2, \tmp
+       msr     elr_el2, \ep
        eret
 .endm
 
index 574a0e775f3d6f8d120e6a7ed15a8a213e9274ab..01efc43657f3257b6b3c7c4a4dced0dbc34b1fcb 100644 (file)
 #define CR_WXN         (1 << 19)       /* Write Permision Imply XN     */
 #define CR_EE          (1 << 25)       /* Exception (Big) Endian       */
 
+#define ES_TO_AARCH64          1
+#define ES_TO_AARCH32          0
+
+/*
+ * SCR_EL3 bits definitions
+ */
+#define SCR_EL3_RW_AARCH64     (1 << 10) /* Next lower level is AArch64     */
+#define SCR_EL3_RW_AARCH32     (0 << 10) /* Lower lowers level are AArch32  */
+#define SCR_EL3_HCE_EN         (1 << 8)  /* Hypervisor Call enable          */
+#define SCR_EL3_SMD_DIS                (1 << 7)  /* Secure Monitor Call disable     */
+#define SCR_EL3_RES1           (3 << 4)  /* Reserved, RES1                  */
+#define SCR_EL3_NS_EN          (1 << 0)  /* EL0 and EL1 in Non-scure state  */
+
+/*
+ * SPSR_EL3/SPSR_EL2 bits definitions
+ */
+#define SPSR_EL_END_LE         (0 << 9)  /* Exception Little-endian          */
+#define SPSR_EL_DEBUG_MASK     (1 << 9)  /* Debug exception masked           */
+#define SPSR_EL_ASYN_MASK      (1 << 8)  /* Asynchronous data abort masked   */
+#define SPSR_EL_SERR_MASK      (1 << 8)  /* System Error exception masked    */
+#define SPSR_EL_IRQ_MASK       (1 << 7)  /* IRQ exception masked             */
+#define SPSR_EL_FIQ_MASK       (1 << 6)  /* FIQ exception masked             */
+#define SPSR_EL_T_A32          (0 << 5)  /* AArch32 instruction set A32      */
+#define SPSR_EL_M_AARCH64      (0 << 4)  /* Exception taken from AArch64     */
+#define SPSR_EL_M_AARCH32      (1 << 4)  /* Exception taken from AArch32     */
+#define SPSR_EL_M_SVC          (0x3)     /* Exception taken from SVC mode    */
+#define SPSR_EL_M_HYP          (0xa)     /* Exception taken from HYP mode    */
+#define SPSR_EL_M_EL1H         (5)       /* Exception taken from EL1h mode   */
+#define SPSR_EL_M_EL2H         (9)       /* Exception taken from EL2h mode   */
+
+/*
+ * CPTR_EL2 bits definitions
+ */
+#define CPTR_EL2_RES1          (3 << 12 | 0x3ff)           /* Reserved, RES1 */
+
+/*
+ * SCTLR_EL2 bits definitions
+ */
+#define SCTLR_EL2_RES1         (3 << 28 | 3 << 22 | 1 << 18 | 1 << 16 |\
+                                1 << 11 | 3 << 4)          /* Reserved, RES1 */
+#define SCTLR_EL2_EE_LE                (0 << 25) /* Exception Little-endian          */
+#define SCTLR_EL2_WXN_DIS      (0 << 19) /* Write permission is not XN       */
+#define SCTLR_EL2_ICACHE_DIS   (0 << 12) /* Instruction cache disabled       */
+#define SCTLR_EL2_SA_DIS       (0 << 3)  /* Stack Alignment Check disabled   */
+#define SCTLR_EL2_DCACHE_DIS   (0 << 2)  /* Data cache disabled              */
+#define SCTLR_EL2_ALIGN_DIS    (0 << 1)  /* Alignment check disabled         */
+#define SCTLR_EL2_MMU_DIS      (0)       /* MMU disabled                     */
+
+/*
+ * CNTHCTL_EL2 bits definitions
+ */
+#define CNTHCTL_EL2_EL1PCEN_EN (1 << 1)  /* Physical timer regs accessible   */
+#define CNTHCTL_EL2_EL1PCTEN_EN        (1 << 0)  /* Physical counter accessible      */
+
+/*
+ * HCR_EL2 bits definitions
+ */
+#define HCR_EL2_RW_AARCH64     (1 << 31) /* EL1 is AArch64                   */
+#define HCR_EL2_RW_AARCH32     (0 << 31) /* Lower levels are AArch32         */
+#define HCR_EL2_HCD_DIS                (1 << 29) /* Hypervisor Call disabled         */
+
+/*
+ * CPACR_EL1 bits definitions
+ */
+#define CPACR_EL1_FPEN_EN      (3 << 20) /* SIMD and FP instruction enabled  */
+
+/*
+ * SCTLR_EL1 bits definitions
+ */
+#define SCTLR_EL1_RES1         (3 << 28 | 3 << 22 | 1 << 20 |\
+                                1 << 11) /* Reserved, RES1                   */
+#define SCTLR_EL1_UCI_DIS      (0 << 26) /* Cache instruction disabled       */
+#define SCTLR_EL1_EE_LE                (0 << 25) /* Exception Little-endian          */
+#define SCTLR_EL1_WXN_DIS      (0 << 19) /* Write permission is not XN       */
+#define SCTLR_EL1_NTWE_DIS     (0 << 18) /* WFE instruction disabled         */
+#define SCTLR_EL1_NTWI_DIS     (0 << 16) /* WFI instruction disabled         */
+#define SCTLR_EL1_UCT_DIS      (0 << 15) /* CTR_EL0 access disabled          */
+#define SCTLR_EL1_DZE_DIS      (0 << 14) /* DC ZVA instruction disabled      */
+#define SCTLR_EL1_ICACHE_DIS   (0 << 12) /* Instruction cache disabled       */
+#define SCTLR_EL1_UMA_DIS      (0 << 9)  /* User Mask Access disabled        */
+#define SCTLR_EL1_SED_EN       (0 << 8)  /* SETEND instruction enabled       */
+#define SCTLR_EL1_ITD_EN       (0 << 7)  /* IT instruction enabled           */
+#define SCTLR_EL1_CP15BEN_DIS  (0 << 5)  /* CP15 barrier operation disabled  */
+#define SCTLR_EL1_SA0_DIS      (0 << 4)  /* Stack Alignment EL0 disabled     */
+#define SCTLR_EL1_SA_DIS       (0 << 3)  /* Stack Alignment EL1 disabled     */
+#define SCTLR_EL1_DCACHE_DIS   (0 << 2)  /* Data cache disabled              */
+#define SCTLR_EL1_ALIGN_DIS    (0 << 1)  /* Alignment check disabled         */
+#define SCTLR_EL1_MMU_DIS      (0)       /* MMU disabled                     */
+
 #ifndef __ASSEMBLY__
 
 u64 get_page_table_size(void);
@@ -98,8 +187,36 @@ int __asm_flush_l3_dcache(void);
 int __asm_invalidate_l3_icache(void);
 void __asm_switch_ttbr(u64 new_ttbr);
 
-void armv8_switch_to_el2(void);
-void armv8_switch_to_el1(void);
+/*
+ * Switch from EL3 to EL2 for ARMv8
+ *
+ * @args:        For loading 64-bit OS, fdt address.
+ *               For loading 32-bit OS, zero.
+ * @mach_nr:     For loading 64-bit OS, zero.
+ *               For loading 32-bit OS, machine nr
+ * @fdt_addr:    For loading 64-bit OS, zero.
+ *               For loading 32-bit OS, fdt address.
+ * @entry_point: kernel entry point
+ * @es_flag:     execution state flag, ES_TO_AARCH64 or ES_TO_AARCH32
+ */
+void armv8_switch_to_el2(u64 args, u64 mach_nr, u64 fdt_addr,
+                        u64 entry_point, u64 es_flag);
+/*
+ * Switch from EL2 to EL1 for ARMv8
+ *
+ * @args:        For loading 64-bit OS, fdt address.
+ *               For loading 32-bit OS, zero.
+ * @mach_nr:     For loading 64-bit OS, zero.
+ *               For loading 32-bit OS, machine nr
+ * @fdt_addr:    For loading 64-bit OS, zero.
+ *               For loading 32-bit OS, fdt address.
+ * @entry_point: kernel entry point
+ * @es_flag:     execution state flag, ES_TO_AARCH64 or ES_TO_AARCH32
+ */
+void armv8_switch_to_el1(u64 args, u64 mach_nr, u64 fdt_addr,
+                        u64 entry_point, u64 es_flag);
+void armv8_el2_to_aarch32(u64 args, u64 mach_nr, u64 fdt_addr,
+                         u64 entry_point);
 void gic_init(void);
 void gic_send_sgi(unsigned long sgino);
 void wait_for_wakeup(void);
index 2bdb71cfe8e593eded89661b87cecb4cedbb50e6..60d1160459bb86569a84bab60b8ffc7fa73b15a4 100644 (file)
@@ -9,7 +9,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_OMAP_COMMON
+#ifdef CONFIG_ARCH_OMAP2
 #define TI_ARMV7_DRAM_ADDR_SPACE_START 0x80000000
 #define TI_ARMV7_DRAM_ADDR_SPACE_END   0xFFFFFFFF
 
index 414042d4039b52b626eeae689b0b5a0e31d59fc5..305a302dfc4b9aff45e4293f03bc5bbbad177ba8 100644 (file)
@@ -37,6 +37,7 @@ int   arch_early_init_r(void);
 /* board/.../... */
 int    board_init(void);
 void   dram_init_banksize (void);
+void   board_quiesce_devices(void);
 
 /* cpu/.../interrupt.c */
 int    arch_interrupt_init     (void);
index caa62c6355899c7881068fe55d760c2a7f8baf01..0051f76db028f41a790e0b3410fe8929b819c012 100644 (file)
@@ -92,3 +92,13 @@ AFLAGS_memset.o := -DMEMSET_NO_THUMB_BUILD
 AFLAGS_memcpy.o := -DMEMCPY_NO_THUMB_BUILD
 endif
 endif
+
+# For building EFI apps
+CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
+CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_NON_EFI)
+
+CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI)
+CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI)
+
+extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC)
+extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC)
index 53c3141322a0de8f30e18c20fd2157483570fe4b..35e6b06733b8f8c9e00060d0e1efb4b98f25df77 100644 (file)
@@ -64,6 +64,10 @@ void arch_lmb_reserve(struct lmb *lmb)
                    gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size - sp);
 }
 
+__weak void board_quiesce_devices(void)
+{
+}
+
 /**
  * announce_and_cleanup() - Print message and prepare for kernel boot
  *
@@ -84,6 +88,9 @@ static void announce_and_cleanup(int fake)
 #ifdef CONFIG_USB_DEVICE
        udc_disconnect();
 #endif
+
+       board_quiesce_devices();
+
        cleanup_before_linux();
 }
 
@@ -193,10 +200,6 @@ static void do_nonsec_virt_switch(void)
 {
        smp_kick_all_cpus();
        dcache_disable();       /* flush cache before swtiching to EL2 */
-       armv8_switch_to_el2();
-#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
-       armv8_switch_to_el1();
-#endif
 }
 #endif
 
@@ -273,6 +276,28 @@ bool armv7_boot_nonsec(void)
 }
 #endif
 
+#ifdef CONFIG_ARM64
+__weak void update_os_arch_secondary_cores(uint8_t os_arch)
+{
+}
+
+#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+static void switch_to_el1(void)
+{
+       if ((IH_ARCH_DEFAULT == IH_ARCH_ARM64) &&
+           (images.os.arch == IH_ARCH_ARM))
+               armv8_switch_to_el1(0, (u64)gd->bd->bi_arch_number,
+                                   (u64)images.ft_addr,
+                                   (u64)images.ep,
+                                   ES_TO_AARCH32);
+       else
+               armv8_switch_to_el1((u64)images.ft_addr, 0, 0,
+                                   images.ep,
+                                   ES_TO_AARCH64);
+}
+#endif
+#endif
+
 /* Subcommand: GO */
 static void boot_jump_linux(bootm_headers_t *images, int flag)
 {
@@ -292,7 +317,24 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
 
        if (!fake) {
                do_nonsec_virt_switch();
-               kernel_entry(images->ft_addr, NULL, NULL, NULL);
+
+               update_os_arch_secondary_cores(images->os.arch);
+
+#ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+               armv8_switch_to_el2((u64)images->ft_addr, 0, 0,
+                                   (u64)switch_to_el1, ES_TO_AARCH64);
+#else
+               if ((IH_ARCH_DEFAULT == IH_ARCH_ARM64) &&
+                   (images->os.arch == IH_ARCH_ARM))
+                       armv8_switch_to_el2(0, (u64)gd->bd->bi_arch_number,
+                                           (u64)images->ft_addr,
+                                           (u64)images->ep,
+                                           ES_TO_AARCH32);
+               else
+                       armv8_switch_to_el2((u64)images->ft_addr, 0, 0,
+                                           images->ep,
+                                           ES_TO_AARCH64);
+#endif
        }
 #else
        unsigned long machid = gd->bd->bi_arch_number;
diff --git a/arch/arm/lib/crt0_aarch64_efi.S b/arch/arm/lib/crt0_aarch64_efi.S
new file mode 100644 (file)
index 0000000..5205646
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * crt0-efi-aarch64.S - PE/COFF header for aarch64 EFI applications
+ *
+ * Copright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+     BSD-2-Clause
+ *
+ * This file is taken and modified from the gnu-efi project.
+ */
+
+       .section        .text.head
+
+       /*
+        * Magic "MZ" signature for PE/COFF
+        */
+       .globl  ImageBase
+ImageBase:
+       .ascii  "MZ"
+       .skip   58                              /* 'MZ' + pad + offset == 64 */
+       .long   pe_header - ImageBase           /* Offset to the PE header */
+pe_header:
+       .ascii  "PE"
+       .short  0
+coff_header:
+       .short  0xaa64                          /* AArch64 */
+       .short  2                               /* nr_sections */
+       .long   0                               /* TimeDateStamp */
+       .long   0                               /* PointerToSymbolTable */
+       .long   1                               /* NumberOfSymbols */
+       .short  section_table - optional_header /* SizeOfOptionalHeader */
+       /*
+        * Characteristics: IMAGE_FILE_DEBUG_STRIPPED |
+        * IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_LINE_NUMS_STRIPPED
+        */
+       .short  0x206
+optional_header:
+       .short  0x20b                           /* PE32+ format */
+       .byte   0x02                            /* MajorLinkerVersion */
+       .byte   0x14                            /* MinorLinkerVersion */
+       .long   _edata - _start                 /* SizeOfCode */
+       .long   0                               /* SizeOfInitializedData */
+       .long   0                               /* SizeOfUninitializedData */
+       .long   _start - ImageBase              /* AddressOfEntryPoint */
+       .long   _start - ImageBase              /* BaseOfCode */
+
+extra_header_fields:
+       .quad   0                               /* ImageBase */
+       .long   0x20                            /* SectionAlignment */
+       .long   0x8                             /* FileAlignment */
+       .short  0                               /* MajorOperatingSystemVersion */
+       .short  0                               /* MinorOperatingSystemVersion */
+       .short  0                               /* MajorImageVersion */
+       .short  0                               /* MinorImageVersion */
+       .short  0                               /* MajorSubsystemVersion */
+       .short  0                               /* MinorSubsystemVersion */
+       .long   0                               /* Win32VersionValue */
+
+       .long   _edata - ImageBase              /* SizeOfImage */
+
+       /*
+        * Everything before the kernel image is considered part of the header
+        */
+       .long   _start - ImageBase              /* SizeOfHeaders */
+       .long   0                               /* CheckSum */
+       .short  EFI_SUBSYSTEM                   /* Subsystem */
+       .short  0                               /* DllCharacteristics */
+       .quad   0                               /* SizeOfStackReserve */
+       .quad   0                               /* SizeOfStackCommit */
+       .quad   0                               /* SizeOfHeapReserve */
+       .quad   0                               /* SizeOfHeapCommit */
+       .long   0                               /* LoaderFlags */
+       .long   0x6                             /* NumberOfRvaAndSizes */
+
+       .quad   0                               /* ExportTable */
+       .quad   0                               /* ImportTable */
+       .quad   0                               /* ResourceTable */
+       .quad   0                               /* ExceptionTable */
+       .quad   0                               /* CertificationTable */
+       .quad   0                               /* BaseRelocationTable */
+
+       /* Section table */
+section_table:
+
+       /*
+        * The EFI application loader requires a relocation section
+        * because EFI applications must be relocatable.  This is a
+        * dummy section as far as we are concerned.
+        */
+       .ascii  ".reloc"
+       .byte   0
+       .byte   0                       /* end of 0 padding of section name */
+       .long   0
+       .long   0
+       .long   0                       /* SizeOfRawData */
+       .long   0                       /* PointerToRawData */
+       .long   0                       /* PointerToRelocations */
+       .long   0                       /* PointerToLineNumbers */
+       .short  0                       /* NumberOfRelocations */
+       .short  0                       /* NumberOfLineNumbers */
+       .long   0x42100040              /* Characteristics (section flags) */
+
+
+       .ascii  ".text"
+       .byte   0
+       .byte   0
+       .byte   0                       /* end of 0 padding of section name */
+       .long   _edata - _start         /* VirtualSize */
+       .long   _start - ImageBase      /* VirtualAddress */
+       .long   _edata - _start         /* SizeOfRawData */
+       .long   _start - ImageBase      /* PointerToRawData */
+
+       .long   0               /* PointerToRelocations (0 for executables) */
+       .long   0               /* PointerToLineNumbers (0 for executables) */
+       .short  0               /* NumberOfRelocations  (0 for executables) */
+       .short  0               /* NumberOfLineNumbers  (0 for executables) */
+       .long   0xe0500020      /* Characteristics (section flags) */
+
+_start:
+       stp             x29, x30, [sp, #-32]!
+       mov             x29, sp
+
+       stp             x0, x1, [sp, #16]
+       mov             x2, x0
+       mov             x3, x1
+       adr             x0, ImageBase
+       adrp            x1, _DYNAMIC
+       add             x1, x1, #:lo12:_DYNAMIC
+       bl              _relocate
+       cbnz            x0, 0f
+
+       ldp             x0, x1, [sp, #16]
+       bl              efi_main
+
+0:     ldp             x29, x30, [sp], #32
+       ret
diff --git a/arch/arm/lib/crt0_arm_efi.S b/arch/arm/lib/crt0_arm_efi.S
new file mode 100644 (file)
index 0000000..967c885
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * crt0-efi-arm.S - PE/COFF header for ARM EFI applications
+ *
+ * Copright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+     BSD-2-Clause
+ *
+ * This file is taken and modified from the gnu-efi project.
+ */
+
+       .section        .text.head
+
+       /*
+        * Magic "MZ" signature for PE/COFF
+        */
+       .globl  image_base
+image_base:
+       .ascii  "MZ"
+       .skip   58                              /* 'MZ' + pad + offset == 64 */
+       .long   pe_header - image_base          /* Offset to the PE header */
+pe_header:
+       .ascii  "PE"
+       .short  0
+coff_header:
+       .short  0x1c2                           /* Mixed ARM/Thumb */
+       .short  2                               /* nr_sections */
+       .long   0                               /* TimeDateStamp */
+       .long   0                               /* PointerToSymbolTable */
+       .long   1                               /* NumberOfSymbols */
+       .short  section_table - optional_header /* SizeOfOptionalHeader */
+       /*
+        * Characteristics: IMAGE_FILE_32BIT_MACHINE |
+        * IMAGE_FILE_DEBUG_STRIPPED | IMAGE_FILE_EXECUTABLE_IMAGE |
+        * IMAGE_FILE_LINE_NUMS_STRIPPED
+        */
+       .short  0x306
+optional_header:
+       .short  0x10b                           /* PE32+ format */
+       .byte   0x02                            /* MajorLinkerVersion */
+       .byte   0x14                            /* MinorLinkerVersion */
+       .long   _edata - _start                 /* SizeOfCode */
+       .long   0                               /* SizeOfInitializedData */
+       .long   0                               /* SizeOfUninitializedData */
+       .long   _start - image_base             /* AddressOfEntryPoint */
+       .long   _start - image_base             /* BaseOfCode */
+       .long   0                               /* BaseOfData */
+
+extra_header_fields:
+       .long   0                               /* image_base */
+       .long   0x20                            /* SectionAlignment */
+       .long   0x8                             /* FileAlignment */
+       .short  0                               /* MajorOperatingSystemVersion */
+       .short  0                               /* MinorOperatingSystemVersion */
+       .short  0                               /* MajorImageVersion */
+       .short  0                               /* MinorImageVersion */
+       .short  0                               /* MajorSubsystemVersion */
+       .short  0                               /* MinorSubsystemVersion */
+       .long   0                               /* Win32VersionValue */
+
+       .long   _edata - image_base             /* SizeOfImage */
+
+       /*
+        * Everything before the kernel image is considered part of the header
+        */
+       .long   _start - image_base             /* SizeOfHeaders */
+       .long   0                               /* CheckSum */
+       .short  EFI_SUBSYSTEM                   /* Subsystem */
+       .short  0                               /* DllCharacteristics */
+       .long   0                               /* SizeOfStackReserve */
+       .long   0                               /* SizeOfStackCommit */
+       .long   0                               /* SizeOfHeapReserve */
+       .long   0                               /* SizeOfHeapCommit */
+       .long   0                               /* LoaderFlags */
+       .long   0x6                             /* NumberOfRvaAndSizes */
+
+       .quad   0                               /* ExportTable */
+       .quad   0                               /* ImportTable */
+       .quad   0                               /* ResourceTable */
+       .quad   0                               /* ExceptionTable */
+       .quad   0                               /* CertificationTable */
+       .quad   0                               /* BaseRelocationTable */
+
+section_table:
+
+       /*
+        * The EFI application loader requires a relocation section
+        * because EFI applications must be relocatable.  This is a
+        * dummy section as far as we are concerned.
+        */
+       .ascii  ".reloc"
+       .byte   0
+       .byte   0                       /* end of 0 padding of section name */
+       .long   0
+       .long   0
+       .long   0                       /* SizeOfRawData */
+       .long   0                       /* PointerToRawData */
+       .long   0                       /* PointerToRelocations */
+       .long   0                       /* PointerToLineNumbers */
+       .short  0                       /* NumberOfRelocations */
+       .short  0                       /* NumberOfLineNumbers */
+       .long   0x42100040              /* Characteristics (section flags) */
+
+       .ascii  ".text"
+       .byte   0
+       .byte   0
+       .byte   0                       /* end of 0 padding of section name */
+       .long   _edata - _start         /* VirtualSize */
+       .long   _start - image_base     /* VirtualAddress */
+       .long   _edata - _start         /* SizeOfRawData */
+       .long   _start - image_base     /* PointerToRawData */
+
+       .long   0               /* PointerToRelocations (0 for executables) */
+       .long   0               /* PointerToLineNumbers (0 for executables) */
+       .short  0               /* NumberOfRelocations  (0 for executables) */
+       .short  0               /* NumberOfLineNumbers  (0 for executables) */
+       .long   0xe0500020      /* Characteristics (section flags) */
+
+_start:
+       stmfd           sp!, {r0-r2, lr}
+
+       mov             r2, r0
+       mov             r3, r1
+       adr             r1, .L_DYNAMIC
+       ldr             r0, [r1]
+       add             r1, r0, r1
+       adr             r0, image_base
+       bl              _relocate
+       teq             r0, #0
+       bne             0f
+
+       ldmfd           sp, {r0-r1}
+       bl              efi_main
+
+0:     add             sp, sp, #12
+       ldr             pc, [sp], #4
+
+.L_DYNAMIC:
+       .word           _DYNAMIC - .
diff --git a/arch/arm/lib/elf_aarch64_efi.lds b/arch/arm/lib/elf_aarch64_efi.lds
new file mode 100644 (file)
index 0000000..47cce1d
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * U-Boot aarch64 EFI linker script
+ *
+ * SPDX-License-Identifier:    BSD-2-Clause
+ *
+ * Modified from elf_aarch64_efi.lds in gnu-efi
+ */
+
+OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
+OUTPUT_ARCH(aarch64)
+ENTRY(_start)
+SECTIONS
+{
+       .text 0x0 : {
+               _text = .;
+               *(.text.head)
+               *(.text)
+               *(.text.*)
+               *(.gnu.linkonce.t.*)
+               *(.srodata)
+               *(.rodata*)
+               . = ALIGN(16);
+       }
+       _etext = .;
+       _text_size = . - _text;
+       .dynamic  : { *(.dynamic) }
+       .data : {
+               _data = .;
+               *(.sdata)
+               *(.data)
+               *(.data1)
+               *(.data.*)
+               *(.got.plt)
+               *(.got)
+
+               /*
+                * The EFI loader doesn't seem to like a .bss section, so we
+                * stick it all into .data:
+                */
+               . = ALIGN(16);
+               _bss = .;
+               *(.sbss)
+               *(.scommon)
+               *(.dynbss)
+               *(.bss)
+               *(.bss.*)
+               *(COMMON)
+               . = ALIGN(16);
+               _bss_end = .;
+               _edata = .;
+       }
+       .rela.dyn : { *(.rela.dyn) }
+       .rela.plt : { *(.rela.plt) }
+       .rela.got : { *(.rela.got) }
+       .rela.data : { *(.rela.data) *(.rela.data*) }
+       _data_size = . - _etext;
+
+       . = ALIGN(4096);
+       .dynsym   : { *(.dynsym) }
+       . = ALIGN(4096);
+       .dynstr   : { *(.dynstr) }
+       . = ALIGN(4096);
+       .note.gnu.build-id : { *(.note.gnu.build-id) }
+       /DISCARD/ : {
+               *(.rel.reloc)
+               *(.eh_frame)
+               *(.note.GNU-stack)
+       }
+       .comment 0 : { *(.comment) }
+}
diff --git a/arch/arm/lib/elf_arm_efi.lds b/arch/arm/lib/elf_arm_efi.lds
new file mode 100644 (file)
index 0000000..59f66a1
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * U-Boot ARM EFI linker script
+ *
+ * SPDX-License-Identifier:    BSD-2-Clause
+ *
+ * Modified from elf_arm_efi.lds in gnu-efi
+ */
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       .text 0x0 : {
+               _text = .;
+               *(.text.head)
+               *(.text)
+               *(.text.*)
+               *(.gnu.linkonce.t.*)
+               *(.srodata)
+               *(.rodata*)
+               . = ALIGN(16);
+       }
+       _etext = .;
+       _text_size = . - _text;
+       .dynamic  : { *(.dynamic) }
+       .data : {
+               _data = .;
+               *(.sdata)
+               *(.data)
+               *(.data1)
+               *(.data.*)
+               *(.got.plt)
+               *(.got)
+
+               /*
+                * The EFI loader doesn't seem to like a .bss section, so we
+                * stick it all into .data:
+                */
+               . = ALIGN(16);
+               _bss = .;
+               *(.sbss)
+               *(.scommon)
+               *(.dynbss)
+               *(.bss)
+               *(.bss.*)
+               *(COMMON)
+               . = ALIGN(16);
+               _bss_end = .;
+               _edata = .;
+       }
+       .rel.dyn : { *(.rel.dyn) }
+       .rel.plt : { *(.rel.plt) }
+       .rel.got : { *(.rel.got) }
+       .rel.data : { *(.rel.data) *(.rel.data*) }
+       _data_size = . - _etext;
+
+       . = ALIGN(4096);
+       .dynsym   : { *(.dynsym) }
+       . = ALIGN(4096);
+       .dynstr   : { *(.dynstr) }
+       . = ALIGN(4096);
+       .note.gnu.build-id : { *(.note.gnu.build-id) }
+       /DISCARD/ : {
+               *(.rel.reloc)
+               *(.eh_frame)
+               *(.note.GNU-stack)
+       }
+       .comment 0 : { *(.comment) }
+}
diff --git a/arch/arm/lib/reloc_aarch64_efi.c b/arch/arm/lib/reloc_aarch64_efi.c
new file mode 100644 (file)
index 0000000..38c13d3
--- /dev/null
@@ -0,0 +1,87 @@
+/* reloc_aarch64.c - position independent x86 ELF shared object relocator
+   Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
+   Copyright (C) 1999 Hewlett-Packard Co.
+       Contributed by David Mosberger <davidm@hpl.hp.com>.
+
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials
+      provided with the distribution.
+    * Neither the name of Hewlett-Packard Co. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+    CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+    BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+    THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+    SUCH DAMAGE.
+*/
+
+#include <efi.h>
+
+#include <elf.h>
+
+efi_status_t _relocate(long ldbase, Elf64_Dyn *dyn, efi_handle_t image,
+                      struct efi_system_table *systab)
+{
+       long relsz = 0, relent = 0;
+       Elf64_Rela *rel = 0;
+       unsigned long *addr;
+       int i;
+
+       for (i = 0; dyn[i].d_tag != DT_NULL; ++i) {
+               switch (dyn[i].d_tag) {
+               case DT_RELA:
+                       rel = (Elf64_Rela *)((ulong)dyn[i].d_un.d_ptr + ldbase);
+                       break;
+               case DT_RELASZ:
+                       relsz = dyn[i].d_un.d_val;
+                       break;
+               case DT_RELAENT:
+                       relent = dyn[i].d_un.d_val;
+                       break;
+               default:
+                       break;
+               }
+       }
+
+       if (!rel && relent == 0)
+               return EFI_SUCCESS;
+
+       if (!rel || relent == 0)
+               return EFI_LOAD_ERROR;
+
+       while (relsz > 0) {
+               /* apply the relocs */
+               switch (ELF64_R_TYPE(rel->r_info)) {
+               case R_AARCH64_NONE:
+                       break;
+               case R_AARCH64_RELATIVE:
+                       addr = (ulong *)(ldbase + rel->r_offset);
+                       *addr = ldbase + rel->r_addend;
+                       break;
+               default:
+                       break;
+               }
+               rel = (Elf64_Rela *)((char *)rel + relent);
+               relsz -= relent;
+       }
+       return EFI_SUCCESS;
+}
diff --git a/arch/arm/lib/reloc_arm_efi.c b/arch/arm/lib/reloc_arm_efi.c
new file mode 100644 (file)
index 0000000..d2f96ee
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * reloc_arm.c - position-independent ARM ELF shared object relocator
+ *
+ * Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org>
+ * Copyright (C) 1999 Hewlett-Packard Co.
+ * Contributed by David Mosberger <davidm@hpl.hp.com>.
+ *
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:    BSD-3-Clause
+ *
+ * This file is taken and modified from the gnu-efi project.
+ */
+
+#include <efi.h>
+#include <elf.h>
+
+efi_status_t _relocate(long ldbase, Elf32_Dyn *dyn, efi_handle_t image,
+                      struct efi_system_table *systab)
+{
+       long relsz = 0, relent = 0;
+       Elf32_Rel *rel = 0;
+       ulong *addr;
+       int i;
+
+       for (i = 0; dyn[i].d_tag != DT_NULL; ++i) {
+               switch (dyn[i].d_tag) {
+               case DT_REL:
+                       rel = (Elf32_Rel *)((ulong)dyn[i].d_un.d_ptr
+                                       + ldbase);
+                       break;
+               case DT_RELSZ:
+                       relsz = dyn[i].d_un.d_val;
+                       break;
+               case DT_RELENT:
+                       relent = dyn[i].d_un.d_val;
+                       break;
+               default:
+                       break;
+               }
+       }
+
+       if (!rel && relent == 0)
+               return EFI_SUCCESS;
+
+       if (!rel || relent == 0)
+               return EFI_LOAD_ERROR;
+
+       while (relsz > 0) {
+               /* apply the relocs */
+               switch (ELF32_R_TYPE(rel->r_info)) {
+               case R_ARM_NONE:
+                       break;
+               case R_ARM_RELATIVE:
+                       addr = (ulong *)(ldbase + rel->r_offset);
+                       *addr += ldbase;
+                       break;
+               default:
+                       break;
+               }
+               rel = (Elf32_Rel *)((char *)rel + relent);
+               relsz -= relent;
+       }
+
+       return EFI_SUCCESS;
+}
index 475d503dd9df63fda046d225c47205a1bc9c80af..a6fb07c401d47426ba914722da345dfcff2766c7 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <asm-offsets.h>
 #include <config.h>
+#include <elf.h>
 #include <linux/linkage.h>
 #ifdef CONFIG_CPU_V7M
 #include <asm/armv7m.h>
@@ -96,7 +97,7 @@ copy_loop:
 fixloop:
        ldmia   r2!, {r0-r1}            /* (r0,r1) <- (SRC location,fixup) */
        and     r1, r1, #0xff
-       cmp     r1, #23                 /* relative fixup? */
+       cmp     r1, #R_ARM_RELATIVE
        bne     fixnext
 
        /* relative fix: increase location by offset */
index 5c51cae8ab0b126fb8c391919a51e880e031e08e..242e56e960848136fb2c61bb2eea12fd249f1d77 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <asm-offsets.h>
 #include <config.h>
+#include <elf.h>
 #include <linux/linkage.h>
 #include <asm/macro.h>
 
@@ -47,7 +48,7 @@ fixloop:
        ldp     x0, x1, [x2], #16       /* (x0,x1) <- (SRC location, fixup) */
        ldr     x4, [x2], #8            /* x4 <- addend */
        and     x1, x1, #0xffffffff
-       cmp     x1, #1027               /* relative fixup? */
+       cmp     x1, #R_AARCH64_RELATIVE
        bne     fixnext
 
        /* relative fix: store addend plus offset at dest location */
index ce2a16f95b029ff3b1b08afc2a43074de5045a21..07118fc3df3023cb752a6d04be87bd7556e692ea 100644 (file)
@@ -126,6 +126,7 @@ choice
 config  TARGET_ESPRESSO7420
        bool "ESPRESSO7420 board"
        select ARM64
+       select ARMV8_MULTIENTRY
        select SUPPORT_SPL
        select OF_CONTROL
        select SPL_DISABLE_OF_CONTROL
index f9c746861199eae76be4f7bd8914841c2aa151b1..cf149ad1a8cf05e3d3c7f69c666291958a6afc21 100644 (file)
@@ -9,6 +9,16 @@
 #include <asm/io.h>
 #include <asm/system.h>
 
+#ifdef CONFIG_TARGET_ESPRESSO7420
+/*
+ * Exynos7420 uses CPU0 of Cluster-1 as boot CPU. Due to this, branch_if_master
+ * fails to identify as the boot CPU as the master CPU. As temporary workaround,
+ * setup the slave CPU boot address as "_main".
+ */
+extern void _main(void);
+void *secondary_boot_addr = (void *)_main;
+#endif /* CONFIG_TARGET_ESPRESSO7420 */
+
 void reset_cpu(ulong addr)
 {
 #ifdef CONFIG_CPU_V7
@@ -23,11 +33,3 @@ void enable_caches(void)
        dcache_enable();
 }
 #endif
-
-#ifdef CONFIG_ARM64
-void lowlevel_init(void)
-{
-       armv8_switch_to_el2();
-       armv8_switch_to_el1();
-}
-#endif
index b2ffe5bc2f2d6f159a25476e557609bcdb6520d0..8253a3bcc11685c21fdab9aaca44373860008625 100644 (file)
@@ -18,5 +18,5 @@ endif
 obj-y  += msmc.o
 obj-y  += ddr3.o
 obj-y  += keystone.o
-obj-$(CONFIG_K2E_EVM) += ddr3_spd.o
-obj-$(CONFIG_K2HK_EVM) += ddr3_spd.o
+obj-$(CONFIG_TARGET_K2E_EVM) += ddr3_spd.o
+obj-$(CONFIG_TARGET_K2HK_EVM) += ddr3_spd.o
similarity index 68%
rename from arch/arm/cpu/armv7/omap-common/Kconfig
rename to arch/arm/mach-omap2/Kconfig
index 4daccd93ffc7227c47681f693568dae3c00bf2c1..24bc4851958317682ddda185dd598dfe38a318dd 100644 (file)
@@ -8,10 +8,10 @@ config TI_SECURE_DEVICE
          authenticated) and the code. See the doc/README.ti-secure
          file for further details.
 
-source "arch/arm/cpu/armv7/omap3/Kconfig"
+source "arch/arm/mach-omap2/omap3/Kconfig"
 
-source "arch/arm/cpu/armv7/omap4/Kconfig"
+source "arch/arm/mach-omap2/omap4/Kconfig"
 
-source "arch/arm/cpu/armv7/omap5/Kconfig"
+source "arch/arm/mach-omap2/omap5/Kconfig"
 
-source "arch/arm/cpu/armv7/am33xx/Kconfig"
+source "arch/arm/mach-omap2/am33xx/Kconfig"
similarity index 80%
rename from arch/arm/cpu/armv7/omap-common/Makefile
rename to arch/arm/mach-omap2/Makefile
index 3172bae105bb120b79d33b900b3a9e09ea89e2b5..e814eb008e44308db39468d926302d14ee2d48de 100644 (file)
@@ -5,7 +5,12 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y  := reset.o
+obj-$(if $(filter am33xx,$(SOC)),y) += am33xx/
+obj-$(CONFIG_OMAP34XX) += omap3/
+obj-$(CONFIG_OMAP44XX) += omap4/
+obj-$(CONFIG_OMAP54XX) += omap5/
+
+obj-y  += reset.o
 ifeq ($(CONFIG_TIMER),)
 obj-y  += timer.o
 else
similarity index 96%
rename from arch/arm/cpu/armv7/am33xx/board.c
rename to arch/arm/mach-omap2/am33xx/board.c
index 68badedd1475066008b5a5389acd34da9ded8bf4..5ebeac0ee1e194775e145deb1921f61df9256ab4 100644 (file)
@@ -270,15 +270,11 @@ static void watchdog_disable(void)
                ;
 }
 
-#ifdef CONFIG_SPL_BUILD
-void board_init_f(ulong dummy)
+void s_init(void)
 {
-       board_early_init_f();
-       sdram_init();
 }
-#endif
 
-void s_init(void)
+void early_system_init(void)
 {
        /*
         * The ROM will only have set up sufficient pinmux to allow for the
@@ -290,11 +286,32 @@ void s_init(void)
 #endif
        watchdog_disable();
        set_uart_mux_conf();
-       setup_clocks_for_console();
+       setup_early_clocks();
        uart_soft_reset();
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
+       do_board_detect();
+#endif
 #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
        /* Enable RTC32K clock */
        rtc32k_enable();
 #endif
 }
+
+#ifdef CONFIG_SPL_BUILD
+void board_init_f(ulong dummy)
+{
+       early_system_init();
+       board_early_init_f();
+       sdram_init();
+}
 #endif
+
+#endif
+
+int arch_cpu_init_dm(void)
+{
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+       early_system_init();
+#endif
+       return 0;
+}
similarity index 98%
rename from arch/arm/cpu/armv7/am33xx/clock.c
rename to arch/arm/mach-omap2/am33xx/clock.c
index 9b9b78edddc7c97d27391836042673c6e7f33f3f..3d17698e1865b81503a09bc76edb039ebc6c476d 100644 (file)
@@ -232,10 +232,15 @@ __weak void scale_vcores(void)
 {
 }
 
-void prcm_init()
+void setup_early_clocks(void)
 {
+       setup_clocks_for_console();
        enable_basic_clocks();
+       timer_init();
+}
+
+void prcm_init(void)
+{
        scale_vcores();
        setup_dplls();
-       timer_init();
 }
similarity index 99%
rename from arch/arm/cpu/armv7/am33xx/clock_ti814x.c
rename to arch/arm/mach-omap2/am33xx/clock_ti814x.c
index 9b5a47b01892f36c239638d857c0499e8a49f331..50bd631cf6b56f1022a717551244e3c64cfc41bf 100644 (file)
@@ -386,6 +386,12 @@ void setup_clocks_for_console(void)
        while (readl(&cmalwon->uart0clkctrl) != PRCM_MOD_EN)
                ;
 }
+
+void setup_early_clocks(void)
+{
+       setup_clocks_for_console();
+}
+
 /*
  * Configure the PLL/PRCM for necessary peripherals
  */
similarity index 99%
rename from arch/arm/cpu/armv7/am33xx/clock_ti816x.c
rename to arch/arm/mach-omap2/am33xx/clock_ti816x.c
index ace4a5afef09f63ddef09efad5a8a466c34e8a50..079ddd7eb9fc12afaed8ab4e5138dd114375e681 100644 (file)
@@ -429,6 +429,11 @@ void setup_clocks_for_console(void)
                ;
 }
 
+void setup_early_clocks(void)
+{
+       setup_clocks_for_console();
+}
+
 void prcm_init(void)
 {
        /* Enable the control */
similarity index 69%
rename from arch/arm/cpu/armv7/am33xx/config.mk
rename to arch/arm/mach-omap2/config.mk
index 87b76d96a83937030455a9062b88d29429051fea..5368f6b2d72eff22631cfb0418f391bd19b075e8 100644 (file)
@@ -1,13 +1,12 @@
 #
 # Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
 #
-# SPDX-License-Identifier:     GPL-2.0+
-#
+# SPDX-License-Identifier:      GPL-2.0+
 
-include  $(srctree)/$(CPUDIR)/omap-common/config_secure.mk
+include  $(srctree)/arch/arm/mach-omap2/config_secure.mk
 
 ifdef CONFIG_SPL_BUILD
-ifeq ($(CONFIG_TI_SECURE_DEVICE),y)
+ifeq ($(CONFIG_AM33XX)$(CONFIG_TI_SECURE_DEVICE),yy)
 #
 # For booting from SPI use
 # u-boot-spl_HS_SPI_X-LOADER to program flash
@@ -30,19 +29,25 @@ ifeq ($(CONFIG_TI_SECURE_DEVICE),y)
 #
 # Refer to README.ti-secure for more info
 #
-ALL-y  += u-boot-spl_HS_ISSW
+ALL-y += u-boot-spl_HS_ISSW
 ALL-y += u-boot-spl_HS_SPI_X-LOADER
 ALL-y += u-boot-spl_HS_X-LOADER
 ALL-y += u-boot-spl_HS_MLO
 ALL-y += u-boot-spl_HS_2ND
 else
-ALL-y  += MLO
+ifeq ($(CONFIG_OMAP54XX)$(CONFIG_TI_SECURE_DEVICE),yy)
+ALL-y += u-boot-spl_HS_MLO u-boot-spl_HS_X-LOADER
+else
+ALL-y += MLO
+ifeq ($(CONFIG_AM33XX),y)
 ALL-y += MLO.byteswap
 endif
+endif
+endif
 else
 ifeq ($(CONFIG_TI_SECURE_DEVICE),y)
 ALL-$(CONFIG_QSPI_BOOT) += u-boot_HS_XIP_X-LOADER
 ALL-$(CONFIG_SPL_LOAD_FIT) += u-boot_HS.img
 endif
-ALL-y  += u-boot.img
+ALL-y += u-boot.img
 endif
index 88ff56ecbf8227aabeb9f9edb43da3b37a580ef1..11acce0395707156abb4277f1cafbb1e09f990fa 100644 (file)
@@ -61,11 +61,18 @@ ENTRY(lowlevel_init)
        /*
         * All slaves will enter EL2 and optionally EL1.
         */
+       adr     x3, lowlevel_in_el2
+       ldr     x4, =ES_TO_AARCH64
        bl      armv8_switch_to_el2
+
+lowlevel_in_el2:
 #ifdef CONFIG_ARMV8_SWITCH_TO_EL1
+       adr     x3, lowlevel_in_el1
+       ldr     x4, =ES_TO_AARCH64
        bl      armv8_switch_to_el1
-#endif
 
+lowlevel_in_el1:
+#endif
 #endif /* CONFIG_ARMV8_MULTIENTRY */
 
        bl      s_init
index 8a5d62a73539a078bfc242517b60fb8bebf65560..5c4a4c229176d43bddb9ac103eaa670fbbc707dc 100644 (file)
@@ -21,7 +21,7 @@ config ROCKCHIP_RK3288
          including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two
          video interfaces supporting HDMI and eDP, several DDR3 options
          and video codec support. Peripherals include Gigabit Ethernet,
-         USB2 host and OTG, SDIO, I2S, UART,s, SPI, I2C and PWMs.
+         USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs.
 
 config ROCKCHIP_RK3399
        bool "Support Rockchip RK3399"
index 0f40351769e658c18e2934d6f276797cf7764d2d..930939ad24c4bc9a3b97850f3db32959819290ea 100644 (file)
@@ -64,6 +64,10 @@ u32 spl_boot_device(void)
        }
 
 fallback:
+#elif defined(CONFIG_TARGET_CHROMEBOOK_JERRY) || \
+               defined(CONFIG_TARGET_CHROMEBIT_MICKEY) || \
+               defined(CONFIG_TARGET_CHROMEBOOK_MINNIE)
+       return BOOT_DEVICE_SPI;
 #endif
        return BOOT_DEVICE_MMC1;
 }
index baf9522bcdd87a0ddc5e2bcd144beb83e588c764..bca6075c2c3380c9cd9f118b0b68436c0d18c846 100644 (file)
@@ -16,6 +16,8 @@
 #include <asm/arch/boot_mode.h>
 #include <asm/gpio.h>
 #include <dm/pinctrl.h>
+#include <dt-bindings/clock/rk3288-cru.h>
+#include <power/regulator.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -56,6 +58,39 @@ int board_late_init(void)
        return rk_board_late_init();
 }
 
+#ifndef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+static int veyron_init(void)
+{
+       struct udevice *dev;
+       struct clk clk;
+       int ret;
+
+       ret = regulator_get_by_platname("vdd_arm", &dev);
+       if (ret)
+               return ret;
+
+       /* Slowly raise to max CPU voltage to prevent overshoot */
+       ret = regulator_set_value(dev, 1200000);
+       if (ret)
+               return ret;
+       udelay(175); /* Must wait for voltage to stabilize, 2mV/us */
+       ret = regulator_set_value(dev, 1400000);
+       if (ret)
+               return ret;
+       udelay(100); /* Must wait for voltage to stabilize, 2mV/us */
+
+       ret = rockchip_get_clk(&clk.dev);
+       if (ret)
+               return ret;
+       clk.id = PLL_APLL;
+       ret = clk_set_rate(&clk, 1800000000);
+       if (IS_ERR_VALUE(ret))
+               return ret;
+
+       return 0;
+}
+#endif
+
 int board_init(void)
 {
 #ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
@@ -87,6 +122,15 @@ err:
 
        return -1;
 #else
+       int ret;
+
+       /* We do some SoC one time setting here */
+       if (!fdt_node_check_compatible(gd->fdt_blob, 0, "google,veyron")) {
+               ret = veyron_init();
+               if (ret)
+                       return ret;
+       }
+
        return 0;
 #endif
 }
index c53d2e203377a1e2fa812cd572fbbb78c9ec3466..223ae41dd473c3ca9348c3be3ae2d3c49be1451f 100644 (file)
@@ -49,6 +49,25 @@ config TARGET_CHROMEBOOK_JERRY
          WiFi. It includes a Chrome OS EC (Cortex-M3) to provide access to
          the keyboard and battery functions.
 
+config TARGET_CHROMEBIT_MICKEY
+       bool "Google/Rockchip Veyron-Mickey Chromebit"
+       help
+         Mickey is a small RK3288-based device with one USB 3.0 port, HDMI
+         and WiFi. It has a separate power port and is designed to connect
+         to the HDMI input of a monitor or TV. It has no internal battery.
+         Typically a USB hub or wireless keyboard/touchpad is used to get
+         keyboard and mouse access.
+
+config TARGET_CHROMEBOOK_MINNIE
+       bool "Google/Rockchip Veyron-Minnie Chromebook"
+       help
+         Jerry is a RK3288-based convertible clamshell device with 2 USB 3.0
+         ports, micro HDMI, a 10.1-inch 1280x800 EDP display, micro-SD card,
+         HD camera, touchpad, WiFi and Bluetooth. It includes a Chrome OS
+         EC (Cortex-M3) to provide access to the keyboard and battery
+         functions. It includes 2 or 4GB of SDRAM and 16 or 32GB of
+         internal MMC. The product name is ASUS Chromebook Flip.
+
 config TARGET_ROCK2
        bool "Radxa Rock 2"
        help
@@ -88,7 +107,7 @@ source "board/chipspark/popmetal_rk3288/Kconfig"
 
 source "board/firefly/firefly-rk3288/Kconfig"
 
-source "board/google/chromebook_jerry/Kconfig"
+source "board/google/veyron/Kconfig"
 
 source "board/radxa/rock2/Kconfig"
 
index a1175eea6ebb432ec2eb440e5f1caf6be78db1a1..c46591846a55e9c1a91ba9bce879ca6a8a50000c 100644 (file)
@@ -28,6 +28,7 @@ config SYS_BOARD
        default "zynq"
 
 config SYS_VENDOR
+       string "Vendor name"
        default "xilinx"
 
 config SYS_SOC
@@ -44,4 +45,11 @@ config SYS_CONFIG_NAME
 config SYS_MALLOC_F_LEN
        default 0x600
 
+config BOOT_INIT_FILE
+       string "boot.bin init register filename"
+       default ""
+       help
+         Add register writes to boot.bin format (max 256 pairs).
+         Expect a table of register-value pairs, e.g. "0x12345678 0x4321"
+
 endif
index 05f4099aaee81712eb21d130aa0044f6fa2e37d2..2d3bf2acef7e449ab73c4fcfc77878d19181079c 100644 (file)
@@ -14,6 +14,9 @@
 #define SLCR_LOCK_MAGIC                0x767B
 #define SLCR_UNLOCK_MAGIC      0xDF0D
 
+#define SLCR_NAND_L2_SEL               0x10
+#define SLCR_NAND_L2_SEL_MASK          0x1F
+
 #define SLCR_USB_L1_SEL                        0x04
 
 #define SLCR_IDCODE_MASK       0x1F000
@@ -36,6 +39,14 @@ struct zynq_slcr_mio_get_status {
        u32 check_val;
 };
 
+static const int nand8_pins[] = {
+       0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
+};
+
+static const int nand16_pins[] = {
+       16, 17, 18, 19, 20, 21, 22, 23
+};
+
 static const int usb0_pins[] = {
        28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39
 };
@@ -45,6 +56,20 @@ static const int usb1_pins[] = {
 };
 
 static const struct zynq_slcr_mio_get_status mio_periphs[] = {
+       {
+               "nand8",
+               nand8_pins,
+               ARRAY_SIZE(nand8_pins),
+               SLCR_NAND_L2_SEL_MASK,
+               SLCR_NAND_L2_SEL,
+       },
+       {
+               "nand16",
+               nand16_pins,
+               ARRAY_SIZE(nand16_pins),
+               SLCR_NAND_L2_SEL_MASK,
+               SLCR_NAND_L2_SEL,
+       },
        {
                "usb0",
                usb0_pins,
index 471d401d49b2a211618980da88197906c2820af9..dd3066ec4c3bdbb62c99388ac031dd5ce945b38a 100644 (file)
@@ -443,6 +443,11 @@ get_pvr:
        mfspr   r3, PVR
        blr
 
+       .globl get_svr
+get_svr:
+       mfspr   r3, SVR
+       blr
+
 /*-------------------------------------------------------------------*/
 
 /*
index 72d5e3007d9d20fc7f6b9205976988f17b82597d..b6c434154477ed758eee2c7c267da184894b6e62 100644 (file)
@@ -607,6 +607,9 @@ void fsl_serdes_init(void)
 
        soc_serdes_init();
 
+       /* Set the first bit to indicate serdes has been initialized */
+       serdes_prtcl_map |= (1 << NONE);
+
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES8
        /*
         * Bank two uses the clock from bank three, so if bank two is enabled,
@@ -862,9 +865,6 @@ void fsl_serdes_init(void)
                             SRDS_RSTCTL_SDPD);
        }
 #endif
-
-       /* Set the first bit to indicate serdes has been initialized */
-       serdes_prtcl_map |= (1 << NONE);
 }
 
 const char *serdes_clock_to_string(u32 clock)
index d7addd872866a7e752ae2be4856157fe5bd9242c..1697dca47fb2b9c78fa07ddb83c016bec6972720 100644 (file)
@@ -45,8 +45,8 @@ endif
 
 EFIPAYLOAD_BFDARCH = i386
 
-LDSCRIPT_EFI := $(srctree)/$(CPUDIR)/efi/elf_$(EFIARCH)_efi.lds
-EFISTUB := crt0-efi-$(EFIARCH).o reloc_$(EFIARCH).o
+LDSCRIPT_EFI := $(srctree)/arch/x86/lib/elf_$(EFIARCH)_efi.lds
+EFISTUB := crt0_$(EFIARCH)_efi.o reloc_$(EFIARCH)_efi.o
 OBJCOPYFLAGS_EFI += --target=efi-app-$(EFIARCH)
 
 CPPFLAGS_REMOVE_crt0-efi-$(EFIARCH).o += $(CFLAGS_NON_EFI)
@@ -65,3 +65,19 @@ PLATFORM_LDFLAGS += --emit-relocs
 LDFLAGS_FINAL += --gc-sections -pie
 
 endif
+
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
+
+ifneq ($(CONFIG_EFI_STUB_64BIT),)
+EFI_LDS := elf_x86_64_efi.lds
+EFI_CRT0 := crt0_x86_64_efi.o
+EFI_RELOC := reloc_x86_64_efi.o
+EFI_TARGET := --target=efi-app-ia32
+else
+EFI_LDS := elf_ia32_efi.lds
+EFI_CRT0 := crt0_ia32_efi.o
+EFI_RELOC := reloc_ia32_efi.o
+EFI_TARGET := --target=efi-app-x86_64
+endif
+
+endif
index 031740b708a8f5d660801f816db421af77e0a8fd..4f901f9392c06844644bfb257047b9b18b802014 100644 (file)
@@ -74,6 +74,7 @@ static inline __attribute__((no_instrument_function)) uint64_t rdtsc(void)
 /* board/... */
 void timer_set_tsc_base(uint64_t new_base);
 uint64_t timer_get_tsc(void);
+void board_quiesce_devices(void);
 
 void quick_ram_check(void);
 
index b9c29226bdb3a93928224c900d9cfa9298b86907..723288f7b2bf21fbe4b34eadf516e9b214cc8b37 100644 (file)
@@ -44,3 +44,26 @@ NORMAL_LIBGCC = $(shell $(CC) $(PLATFORM_CPPFLAGS) -print-libgcc-file-name)
 OBJCOPYFLAGS := --prefix-symbols=__normal_
 $(obj)/lib.a: $(NORMAL_LIBGCC) FORCE
        $(call if_changed,objcopy)
+
+obj-$(CONFIG_EFI_APP) += crt0_ia32_efi.o reloc_ia32_efi.o
+
+ifneq ($(CONFIG_EFI_STUB),)
+
+CFLAGS_REMOVE_reloc_ia32_efi.o += -mregparm=3
+CFLAGS_reloc_ia32_efi.o += -fpic -fshort-wchar
+
+# When building for 64-bit we must remove the i386-specific flags
+CFLAGS_REMOVE_reloc_x86_64_efi.o += -mregparm=3 -march=i386 -m32
+CFLAGS_reloc_x86_64_efi.o += -fpic -fshort-wchar
+
+AFLAGS_REMOVE_crt0_x86_64_efi.o += -mregparm=3 -march=i386 -m32
+AFLAGS_crt0_x86_64_efi.o += -fpic -fshort-wchar
+
+extra-$(CONFIG_EFI_STUB_32BIT) += crt0_ia32_efi.o reloc_ia32_efi.o
+extra-$(CONFIG_EFI_STUB_64BIT) += crt0_x86_64_efi.o reloc_x86_64_efi.o
+
+endif
+
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
+extra-y += $(EFI_CRT0) $(EFI_RELOC)
+endif
index 7cf9de4d7b53e083acda9e0035250568ae1435ba..80fadef34e99c44b6080bcb2f49e257393f00759 100644 (file)
@@ -26,6 +26,10 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define COMMAND_LINE_OFFSET 0x9000
 
+__weak void board_quiesce_devices(void)
+{
+}
+
 void bootm_announce_and_cleanup(void)
 {
        printf("\nStarting kernel ...\n\n");
index af4503e1c22c695fa785cc2c323005b5afe4c056..43aadfc996a1c892f7788ba10cdcb476e992ec0e 100644 (file)
@@ -7,21 +7,3 @@
 
 obj-$(CONFIG_EFI_STUB) += car.o
 obj-$(CONFIG_EFI_STUB) += efi.o
-
-obj-$(CONFIG_EFI_APP) += crt0-efi-ia32.o reloc_ia32.o
-
-ifneq ($(CONFIG_EFI_STUB),)
-
-CFLAGS_REMOVE_reloc_ia32.o += -mregparm=3
-CFLAGS_reloc_ia32.o += -fpic -fshort-wchar
-
-# When building for 64-bit we must remove the i386-specific flags
-CFLAGS_REMOVE_reloc_x86_64.o += -mregparm=3 -march=i386 -m32
-CFLAGS_reloc_x86_64.o += -fpic -fshort-wchar
-
-AFLAGS_REMOVE_crt0-efi-x86_64.o += -mregparm=3 -march=i386 -m32
-AFLAGS_crt0-efi-x86_64.o += -fpic -fshort-wchar
-
-extra-$(CONFIG_EFI_STUB_32BIT) += crt0-efi-ia32.o reloc_ia32.o
-extra-$(CONFIG_EFI_STUB_64BIT) += crt0-efi-x86_64.o reloc_x86_64.o
-endif
similarity index 98%
rename from arch/x86/cpu/efi/elf_ia32_efi.lds
rename to arch/x86/lib/elf_ia32_efi.lds
index cd3b0a982dac85dcd15634f6c95e5b284898521f..174d36f758e3731bf851785480d3e9d8dc14ca9e 100644 (file)
@@ -6,8 +6,6 @@
  * Modified from usr/lib32/elf_ia32_efi.lds in gnu-efi
  */
 
-#include <config.h>
-
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
 OUTPUT_ARCH(i386)
 ENTRY(_start)
similarity index 98%
rename from arch/x86/cpu/efi/elf_x86_64_efi.lds
rename to arch/x86/lib/elf_x86_64_efi.lds
index 9d9f05774a929a3eb31b437d9d3f8f4efa7feed5..70c7c52332888b6460e95e767813c11a756b7eaa 100644 (file)
@@ -6,8 +6,6 @@
  * Modified from usr/lib32/elf_x86_64_efi.lds in gnu-efi
  */
 
-#include <config.h>
-
 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
 OUTPUT_ARCH(i386:x86-64)
 ENTRY(_start)
index 025b183d6bd7a61788e5680c370f82d555397fdc..5966e5862a31eddf5c2d39e582a6ec98e0c871d5 100644 (file)
 #include <asm/acpi_table.h>
 #include <asm/coreboot_tables.h>
 
+#ifdef CONFIG_GENERATE_SMBIOS_TABLE
 static u32 write_smbios_table_wrapper(u32 addr)
 {
        return write_smbios_table(addr);
 }
+#endif
 
 /**
  * Function prototype to write a specific configuration table
diff --git a/board/freescale/ls1021aiot/Kconfig b/board/freescale/ls1021aiot/Kconfig
new file mode 100644 (file)
index 0000000..4a12c16
--- /dev/null
@@ -0,0 +1,15 @@
+if TARGET_LS1021AIOT
+
+config SYS_BOARD
+       default "ls1021aiot"
+
+config SYS_VENDOR
+       default "freescale"
+
+config SYS_SOC
+       default "ls102xa"
+
+config SYS_CONFIG_NAME
+       default "ls1021aiot"
+
+endif
diff --git a/board/freescale/ls1021aiot/MAINTAINERS b/board/freescale/ls1021aiot/MAINTAINERS
new file mode 100644 (file)
index 0000000..2dab798
--- /dev/null
@@ -0,0 +1,7 @@
+LS1021AIOT BOARD
+M:     Feng Li <feng.li_2@nxp.com>
+S:     Maintained
+F:     board/freescale/ls1021aiot/
+F:     include/configs/ls1021aiot.h
+F:     configs/ls1021aiot_sdcard_defconfig
+F:     configs/ls1021aiot_qspi_defconfig
diff --git a/board/freescale/ls1021aiot/Makefile b/board/freescale/ls1021aiot/Makefile
new file mode 100644 (file)
index 0000000..05709e6
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# Copyright 2016 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y += ls1021aiot.o
+obj-$(CONFIG_FSL_DCU_FB) += dcu.o
+obj-$(CONFIG_ARMV7_PSCI) += psci.o
diff --git a/board/freescale/ls1021aiot/README b/board/freescale/ls1021aiot/README
new file mode 100644 (file)
index 0000000..08b0268
--- /dev/null
@@ -0,0 +1,58 @@
+Overview
+--------
+The LS1021A-IOT is a Freescale reference board that hosts
+the LS1021A SoC.
+
+LS1021AIOT board Overview
+-------------------------
+ - DDR Controller
+       - Supports 1GB un-buffered DDR3L SDRAM discrete
+       devices(32-bit bus) with 4 bit ECC
+       - DDR power supplies 1.35V to all devices with
+       automatic tracking of VTT
+       - Soldered DDR chip
+       - Supprot one fixed speed
+ - Ethernet
+       - Two on-board SGMII 10/100/1G ethernet ports
+       - One Gbit Etherent RGMII interface to 4-ports switch
+       with 4x 10/100/1000 RJ145 ports
+ - CPLD
+       - 8-bit registers in CPLD for system configuration
+       - connected to IFC_AD[0:7]
+ - Power Supplies
+       - 12V@5A DC
+ - SDHC
+       - SDHC port connects directly to a full 8-bit SD/MMC slot
+       - Support for SDIO devices
+ - USB
+       - Two on-board USB 3.0
+       - One on-board USB k22
+ - PCIe
+       - Two MiniPCIe Solts
+ - SATA
+       - Support SATA Connector
+ - AUDIO
+       - AUDIO in and out
+ - I/O Expansion
+       - Arduino Shield Connector
+       - Port0 - CAN/GPIO/Flextimer
+       - Port1 - GPIO/CPLD Expansion
+       - Port2 - SPI/I2C/UART
+
+Memory map
+-----------
+The addresses in brackets are physical addresses.
+
+Start Address  End Address             Description                     Size
+0x00_0100_0000 0x00_0FFF_FFFF  CCSRBAR                         240MB
+0x00_4000_0000 0x00_43FF_FFFF  QSPI(Chip select 0)     64MB
+0x00_4400_0000 0x00_47FF_FFFF  QSPI(Chip select 1)     64MB
+0x00_6000_0000 0x00_6000_FFFF  CPLD                            64K
+0x00_8000_0000 0x00_BFFF_FFFF  DDR                                     1GB
+
+Boot description
+-----------------
+LS1021A-IOT support two ways of boot:
+Qspi boot and SD boot
+The board doesn't support boot from another
+source without changing any switch/jumper.
diff --git a/board/freescale/ls1021aiot/dcu.c b/board/freescale/ls1021aiot/dcu.c
new file mode 100644 (file)
index 0000000..e27647f
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2016 Freescale Semiconductor, Inc.
+ *
+ * FSL DCU Framebuffer driver
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <fsl_dcu_fb.h>
+#include "div64.h"
+#include "../common/dcu_sii9022a.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int dcu_set_pixel_clock(unsigned int pixclock)
+{
+       unsigned long long div;
+
+       div = (unsigned long long)(gd->bus_clk / 1000);
+       div *= (unsigned long long)pixclock;
+       do_div(div, 1000000000);
+
+       return div;
+}
+
+int platform_dcu_init(unsigned int xres, unsigned int yres,
+               const char *port,
+               struct fb_videomode *dcu_fb_videomode)
+{
+       const char *name;
+       unsigned int pixel_format;
+
+       if (strncmp(port, "twr_lcd", 4) == 0) {
+               name = "TWR_LCD_RGB card";
+       } else {
+               name = "HDMI";
+               dcu_set_dvi_encoder(dcu_fb_videomode);
+       }
+
+       printf("DCU: Switching to %s monitor @ %ux%u\n", name, xres, yres);
+
+       pixel_format = 32;
+       fsl_dcu_init(xres, yres, pixel_format);
+
+       return 0;
+}
diff --git a/board/freescale/ls1021aiot/ls1021aiot.c b/board/freescale/ls1021aiot/ls1021aiot.c
new file mode 100644 (file)
index 0000000..3340e4d
--- /dev/null
@@ -0,0 +1,259 @@
+/*
+ * Copyright 2016 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/immap_ls102xa.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/fsl_serdes.h>
+#include <asm/arch/ls102xa_stream_id.h>
+
+#include <asm/arch/ls102xa_devdis.h>
+#include <asm/arch/ls102xa_soc.h>
+#include <asm/arch/ls102xa_sata.h>
+#include <fsl_csu.h>
+#include <fsl_esdhc.h>
+#include <fsl_immap.h>
+#include <netdev.h>
+#include <fsl_mdio.h>
+#include <tsec.h>
+#include <spl.h>
+
+#include <fsl_validate.h>
+#include "../common/sleep.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define DDR_SIZE               0x40000000
+
+
+int checkboard(void)
+{
+       puts("Board: LS1021AIOT\n");
+
+#ifndef CONFIG_QSPI_BOOT
+       struct ccsr_gur *dcfg = (struct ccsr_gur *)CONFIG_SYS_FSL_GUTS_ADDR;
+       u32 cpldrev;
+
+       cpldrev = in_be32(&dcfg->gpporcr1);
+
+       printf("CPLD:  V%d.%d\n", ((cpldrev >> 28) & 0xf), ((cpldrev >> 24) &
+               0xf));
+#endif
+       return 0;
+}
+
+void ddrmc_init(void)
+{
+       struct ccsr_ddr *ddr = (struct ccsr_ddr *)CONFIG_SYS_FSL_DDR_ADDR;
+       u32 temp_sdram_cfg, tmp;
+
+       out_be32(&ddr->sdram_cfg, DDR_SDRAM_CFG);
+
+       out_be32(&ddr->cs0_bnds, DDR_CS0_BNDS);
+       out_be32(&ddr->cs0_config, DDR_CS0_CONFIG);
+
+       out_be32(&ddr->timing_cfg_0, DDR_TIMING_CFG_0);
+       out_be32(&ddr->timing_cfg_1, DDR_TIMING_CFG_1);
+       out_be32(&ddr->timing_cfg_2, DDR_TIMING_CFG_2);
+       out_be32(&ddr->timing_cfg_3, DDR_TIMING_CFG_3);
+       out_be32(&ddr->timing_cfg_4, DDR_TIMING_CFG_4);
+       out_be32(&ddr->timing_cfg_5, DDR_TIMING_CFG_5);
+
+       out_be32(&ddr->sdram_cfg_2, DDR_SDRAM_CFG_2);
+       out_be32(&ddr->ddr_cdr2, DDR_DDR_CDR2);
+
+       out_be32(&ddr->sdram_mode, DDR_SDRAM_MODE);
+       out_be32(&ddr->sdram_mode_2, DDR_SDRAM_MODE_2);
+
+       out_be32(&ddr->sdram_interval, DDR_SDRAM_INTERVAL);
+
+       out_be32(&ddr->ddr_wrlvl_cntl, DDR_DDR_WRLVL_CNTL);
+
+       out_be32(&ddr->ddr_wrlvl_cntl_2, DDR_DDR_WRLVL_CNTL_2);
+       out_be32(&ddr->ddr_wrlvl_cntl_3, DDR_DDR_WRLVL_CNTL_3);
+
+       out_be32(&ddr->ddr_cdr1, DDR_DDR_CDR1);
+
+       out_be32(&ddr->sdram_clk_cntl, DDR_SDRAM_CLK_CNTL);
+       out_be32(&ddr->ddr_zq_cntl, DDR_DDR_ZQ_CNTL);
+
+       out_be32(&ddr->cs0_config_2, DDR_CS0_CONFIG_2);
+
+       /* DDR erratum A-009942 */
+       tmp = in_be32(&ddr->debug[28]);
+       out_be32(&ddr->debug[28], tmp | 0x0070006f);
+
+       udelay(500);
+
+       temp_sdram_cfg = (DDR_SDRAM_CFG_MEM_EN & ~SDRAM_CFG_BI);
+
+       out_be32(&ddr->sdram_cfg, DDR_SDRAM_CFG | temp_sdram_cfg);
+}
+
+int dram_init(void)
+{
+#if (!defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD))
+       ddrmc_init();
+#endif
+
+       gd->ram_size = DDR_SIZE;
+       return 0;
+}
+
+#ifdef CONFIG_FSL_ESDHC
+struct fsl_esdhc_cfg esdhc_cfg[1] = {
+       {CONFIG_SYS_FSL_ESDHC_ADDR},
+};
+
+int board_mmc_init(bd_t *bis)
+{
+       esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
+
+       return fsl_esdhc_initialize(bis, &esdhc_cfg[0]);
+}
+
+#endif
+
+#ifdef CONFIG_TSEC_ENET
+int board_eth_init(bd_t *bis)
+{
+       struct fsl_pq_mdio_info mdio_info;
+       struct tsec_info_struct tsec_info[4];
+       int num = 0;
+
+#ifdef CONFIG_TSEC1
+       SET_STD_TSEC_INFO(tsec_info[num], 1);
+       if (is_serdes_configured(SGMII_TSEC1)) {
+               puts("eTSEC1 is in sgmii mode.\n");
+               tsec_info[num].flags |= TSEC_SGMII;
+       }
+       num++;
+#endif
+#ifdef CONFIG_TSEC2
+       SET_STD_TSEC_INFO(tsec_info[num], 2);
+       if (is_serdes_configured(SGMII_TSEC2)) {
+               puts("eTSEC2 is in sgmii mode.\n");
+               tsec_info[num].flags |= TSEC_SGMII;
+       }
+       num++;
+#endif
+       if (!num) {
+               printf("No TSECs initialized\n");
+               return 0;
+       }
+
+       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.name = DEFAULT_MII_NAME;
+       fsl_pq_mdio_init(bis, &mdio_info);
+
+       tsec_eth_init(bis, tsec_info, num);
+
+       return pci_eth_init(bis);
+}
+#endif
+
+int board_early_init_f(void)
+{
+       struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
+
+#ifdef CONFIG_TSEC_ENET
+       /* clear BD & FR bits for BE BD's and frame data */
+       clrbits_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR);
+       out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE2_CLK125);
+
+#endif
+
+       arch_soc_init();
+
+       return 0;
+}
+
+#ifdef CONFIG_SPL_BUILD
+void board_init_f(ulong dummy)
+{
+       /* Clear the BSS */
+       memset(__bss_start, 0, __bss_end - __bss_start);
+
+       get_clocks();
+
+       preloader_console_init();
+
+       dram_init();
+
+       /* Allow OCRAM access permission as R/W */
+
+#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
+       enable_layerscape_ns_access();
+#endif
+
+       board_init_r(NULL, 0);
+}
+#endif
+
+int board_init(void)
+{
+#ifndef CONFIG_SYS_FSL_NO_SERDES
+       fsl_serdes_init();
+#endif
+
+       ls102xa_smmu_stream_id_init();
+
+#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
+       enable_layerscape_ns_access();
+#endif
+
+       return 0;
+}
+
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+#ifdef CONFIG_SCSI_AHCI_PLAT
+       ls1021a_sata_init();
+#endif
+
+       return 0;
+}
+#endif
+
+#if defined(CONFIG_MISC_INIT_R)
+int misc_init_r(void)
+{
+#ifdef CONFIG_FSL_DEVICE_DISABLE
+       device_disable(devdis_tbl, ARRAY_SIZE(devdis_tbl));
+
+#endif
+
+#ifdef CONFIG_FSL_CAAM
+       return sec_init();
+#endif
+}
+#endif
+
+int ft_board_setup(void *blob, bd_t *bd)
+{
+       ft_cpu_setup(blob, bd);
+
+#ifdef CONFIG_PCI
+       ft_pci_setup(blob, bd);
+#endif
+
+       return 0;
+}
+
+void flash_write16(u16 val, void *addr)
+{
+       u16 shftval = (((val >> 8) & 0xff) | ((val << 8) & 0xff00));
+
+       __raw_writew(shftval, addr);
+}
+
+u16 flash_read16(void *addr)
+{
+       u16 val = __raw_readw(addr);
+
+       return (((val) >> 8) & 0x00ff) | (((val) << 8) & 0xff00);
+}
diff --git a/board/freescale/ls1021aiot/ls102xa_pbi.cfg b/board/freescale/ls1021aiot/ls102xa_pbi.cfg
new file mode 100644 (file)
index 0000000..b5ac5e2
--- /dev/null
@@ -0,0 +1,14 @@
+#PBI commands
+
+09570200 ffffffff
+09570158 00000300
+8940007c 21f47300
+
+#Configure Scratch register
+09ee0200 10000000
+#Configure alternate space
+09570158 00001000
+#Flush PBL data
+096100c0 000FFFFF
+
+09ea085c 00502880
diff --git a/board/freescale/ls1021aiot/ls102xa_rcw_sd.cfg b/board/freescale/ls1021aiot/ls102xa_rcw_sd.cfg
new file mode 100644 (file)
index 0000000..a1984c7
--- /dev/null
@@ -0,0 +1,27 @@
+#PBL preamble and RCW header
+aa55aa55 01ee0100
+# serdes protocol
+
+#Default with 2 x SGMII (no SATA)
+0608000a 00000000 00000000 00000000
+20000000 08407900 60025a00 21046000
+00000000 00000000 00000000 20038000
+20024800 881b1340 00000000 00000000
+
+#SATA set-up
+#0608000a 00000000 00000000 00000000
+#70000000 08007900 60025a00 21046000
+#00000000 00000000 00000000 20038000
+#20024800 881b1340 00000000 00000000
+
+#HDMI set-up
+#0608000a 00000000 00000000 00000000
+#20000000 08407900 60025a00 21046000
+#00000000 00000000 00000000 20038000
+#00000000 881b1340 00000000 00000000
+
+#QE testing
+#0608000a 00000000 00000000 00000000
+#20000000 08407900 60025a00 21046000
+#00000000 00000000 00000000 00038000
+#20094800 881b1340 00000000 00000000
diff --git a/board/freescale/ls1021aiot/psci.S b/board/freescale/ls1021aiot/psci.S
new file mode 100644 (file)
index 0000000..564145c
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2016 NXP Semiconductor.
+ * Author: Feng Li <feng.li_2@nxp.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <config.h>
+#include <linux/linkage.h>
+
+#include <asm/armv7.h>
+#include <asm/psci.h>
+
+       .pushsection ._secure.text, "ax"
+
+       .arch_extension sec
+
+       .align  5
+
+.globl psci_system_off
+psci_system_off:
+1:     wfi
+       b       1b
+
+.globl psci_text_end
+psci_text_end:
+       nop
+       .popsection
index 222c71dcb617a1a2304f6a7d8b210f80e7e0fd5e..d76e9132e3580a5c6af4d775eae2c861a5dcf3c2 100644 (file)
@@ -1,7 +1,7 @@
 #PBL preamble and RCW header
 aa55aa55 01ee0100
 # serdes protocol
-0608000a 00000000 00000000 00000000
+0608000c 00000000 00000000 00000000
 60000000 00407900 e0106a00 21046000
 00000000 00000000 00000000 00038000
 00000000 001b7200 00000000 00000000
index 9d99bd862dd707dfb18c7a058943ffe5605b77b9..f0cf9c2b38d92684f86640ed62764d247f49a231 100644 (file)
@@ -2,13 +2,13 @@
 aa55aa55 01ee0100
 
 #enable IFC, disable QSPI and DSPI
-0608000a 00000000 00000000 00000000
+0608000c 00000000 00000000 00000000
 60000000 00407900 60040a00 21046000
 00000000 00000000 00000000 00038000
 00000000 001b7200 00000000 00000000
 
 #disable IFC, enable QSPI and DSPI
-#0608000a 00000000 00000000 00000000
+#0608000c 00000000 00000000 00000000
 #60000000 00407900 60040a00 21046000
 #00000000 00000000 00000000 00038000
 #20024800 001b7200 00000000 00000000
index 2bd398cc539080523a308fc5d74d816a37610d30..10cc4a9ab0be8a52b81bc039e08f55e249d6e929 100644 (file)
@@ -2,13 +2,13 @@
 aa55aa55 01ee0100
 
 #enable IFC, disable QSPI and DSPI
-#0608000a 00000000 00000000 00000000
+#0608000c 00000000 00000000 00000000
 #60000000 00407900 60040a00 21046000
 #00000000 00000000 00000000 00038000
 #00000000 001b7200 00000000 00000000
 
 #disable IFC, enable QSPI and DSPI
-0608000a 00000000 00000000 00000000
+0608000c 00000000 00000000 00000000
 60000000 00407900 60040a00 21046000
 00000000 00000000 00000000 00038000
 20024800 001b7200 00000000 00000000
index 205606f4d2fcb76e2215a8c8b6fd6f3647d567e3..f94997d5384593f9026f028eee37e50832b375df 100644 (file)
@@ -2,7 +2,7 @@
 aa55aa55 01ee0100
 
 #enable IFC, disable QSPI and DSPI
-0608000a 00000000 00000000 00000000
+0608000c 00000000 00000000 00000000
 30000000 00007900 60040a00 21046000
 00000000 00000000 00000000 20000000
 00080000 881b7340 00000000 00000000
index 6767e09388042c0bfd54a06cc5b24bfabbc94eb2..541b604cffcf413aabef9ba9fe0a196650bc1966 100644 (file)
@@ -2,7 +2,7 @@
 aa55aa55 01ee0100
 
 #disable IFC, enable QSPI and DSPI
-0608000a 00000000 00000000 00000000
+0608000c 00000000 00000000 00000000
 30000000 00007900 60040a00 21046000
 00000000 00000000 00000000 20000000
 20024800 881b7340 00000000 00000000
index 8c1853850308b6831f83e750e9636c683469c437..552365b9d88854afd9d529e21739a8d828352675 100644 (file)
@@ -120,6 +120,13 @@ unsigned long get_board_ddr_clk(void)
        return 66666666;
 }
 
+#ifdef CONFIG_LPUART
+u32 get_lpuart_clk(void)
+{
+       return gd->bus_clk;
+}
+#endif
+
 int select_i2c_ch_pca9547(u8 ch)
 {
        int ret;
@@ -157,6 +164,9 @@ int board_early_init_f(void)
        struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
        u32 usb_pwrfault;
 #endif
+#ifdef CONFIG_LPUART
+       u8 uart;
+#endif
 
 #ifdef CONFIG_SYS_I2C_EARLY_INIT
        i2c_early_init_f();
@@ -175,6 +185,14 @@ int board_early_init_f(void)
        out_be32(&scfg->usbpwrfault_selcr, usb_pwrfault);
 #endif
 
+#ifdef CONFIG_LPUART
+       /* We use lpuart0 as system console */
+       uart = QIXIS_READ(brdcfg[14]);
+       uart &= ~CFG_UART_MUX_MASK;
+       uart |= CFG_LPUART_EN << CFG_UART_MUX_SHIFT;
+       QIXIS_WRITE(brdcfg[14], uart);
+#endif
+
        return 0;
 }
 
index c8dac99889af3f941d7c3689291509e9a78126d5..de137ef64f461a5420c3ef3dbe70f5579bc2752d 100644 (file)
@@ -1,5 +1,5 @@
 LS2080A BOARD
-M:     York Sun <york.sun@nxp.com>
+M:     York Sun <york.sun@nxp.com>, Priyanka Jain <priyanka.jain@nxp.com>
 S:     Maintained
 F:     board/freescale/ls2080a/
 F:     include/configs/ls2080a_emu.h
index d0a88d4ef9d1dbd41bd5943443767e78e03d288e..4f9b9c8a7739525e0c84209fed9b9a1319120cbd 100644 (file)
@@ -102,6 +102,11 @@ void fdt_fixup_board_enet(void *fdt)
        else
                fdt_status_fail(fdt, offset);
 }
+
+void board_quiesce_devices(void)
+{
+       fsl_mc_ldpaa_exit(gd->bd);
+}
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
@@ -122,7 +127,6 @@ int ft_board_setup(void *blob, bd_t *bd)
 
 #ifdef CONFIG_FSL_MC_ENET
        fdt_fixup_board_enet(blob);
-       fsl_mc_ldpaa_exit(bd);
 #endif
 
        return 0;
index 8f78b67baae96c01f02748cb52197d9402dd3450..79877d7774244e21d250029f4c1e6793592deb9f 100644 (file)
@@ -1,5 +1,5 @@
 LS2080A BOARD
-M:     Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
+M:     Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>, Priyanka Jain <priyanka.jain@nxp.com>
 S:     Maintained
 F:     board/freescale/ls2080aqds/
 F:     board/freescale/ls2080a/ls2080aqds.c
index f28875099360c3115730b565dc7decd6b180e94f..2808bd5851928db5034ff3c847c6c511034df433 100644 (file)
@@ -2,14 +2,14 @@ Overview
 --------
 The LS2080A Development System (QDS) is a high-performance computing,
 evaluation, and development platform that supports the QorIQ LS2080A
-Layerscape Architecture processor. The LS2080AQDS provides validation and
-SW development platform for the Freescale LS2080A processor series, with
-a complete debugging environment.
+and LS2088A Layerscape Architecture processor. The LS2080AQDS provides
+validation and SW development platform for the Freescale LS2080A, LS2088A
+processor series, with a complete debugging environment.
 
-LS2080A SoC Overview
+LS2080A, LS2088A SoC Overview
 --------------------
-Please refer arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc for LS2080A
-SoC overview.
+Please refer arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc for LS2080A,
+LS2088A SoC overview.
 
  LS2080AQDS board Overview
  -----------------------
index 95ff68b3649f188f0749498596935ba44ea98941..59361e9111f5382b528911a97319a712c8b65bed 100644 (file)
@@ -64,7 +64,7 @@ static int sgmii_riser_phy_addr[] = {
 };
 
 /* Slot2 does not have EMI connections */
-#define EMI_NONE       0xFFFFFFFF
+#define EMI_NONE       0xFF
 #define EMI1_SLOT1     0
 #define EMI1_SLOT2     1
 #define EMI1_SLOT3     2
@@ -144,8 +144,10 @@ static void sgmii_configure_repeater(int serdes_port)
 
                mdelay(10);
 
-               if ((value & 0xfff) == 0x40f) {
+               if ((value & 0xfff) == 0x401) {
                        printf("DPMAC %d:PHY is ..... Configured\n", dpmac_id);
+                       miiphy_write(dev[mii_bus], riser_phy_addr[dpmac],
+                                    0x1f, 0);
                        continue;
                }
 
@@ -181,28 +183,29 @@ static void sgmii_configure_repeater(int serdes_port)
                                if (ret > 0)
                                        goto error;
 
-                               mdelay(1);
+                               mdelay(100);
                                ret = miiphy_read(dev[mii_bus],
                                                  riser_phy_addr[dpmac],
                                                  0x11, &value);
                                if (ret > 0)
                                        goto error;
-                               mdelay(10);
 
-                               if ((value & 0xfff) == 0x40f) {
+                               if ((value & 0xfff) == 0x401) {
                                        printf("DPMAC %d :PHY is configured ",
                                               dpmac_id);
                                        printf("after setting repeater 0x%x\n",
                                               value);
                                        i = 5;
                                        j = 5;
-                               } else
+                               } else {
                                        printf("DPMAC %d :PHY is failed to ",
                                               dpmac_id);
                                        printf("configure the repeater 0x%x\n",
                                               value);
                                }
+                       }
                }
+               miiphy_write(dev[mii_bus], riser_phy_addr[dpmac], 0x1f, 0);
        }
 error:
        if (ret)
@@ -470,7 +473,49 @@ static void initialize_dpmac_to_slot(void)
                }
                break;
 
+       case 0x39:
+               printf("qds: WRIOP: Supported SerDes1 Protocol 0x%02x\n",
+                      serdes1_prtcl);
+               if (hwconfig_f("xqsgmii", env_hwconfig)) {
+                       lane_to_slot_fsm1[0] = EMI1_SLOT3;
+                       lane_to_slot_fsm1[1] = EMI1_SLOT3;
+                       lane_to_slot_fsm1[2] = EMI1_SLOT3;
+                       lane_to_slot_fsm1[3] = EMI_NONE;
+               } else {
+                       lane_to_slot_fsm1[0] = EMI_NONE;
+                       lane_to_slot_fsm1[1] = EMI_NONE;
+                       lane_to_slot_fsm1[2] = EMI_NONE;
+                       lane_to_slot_fsm1[3] = EMI_NONE;
+               }
+               lane_to_slot_fsm1[4] = EMI1_SLOT3;
+               lane_to_slot_fsm1[5] = EMI1_SLOT3;
+               lane_to_slot_fsm1[6] = EMI1_SLOT3;
+               lane_to_slot_fsm1[7] = EMI_NONE;
+               break;
+
+       case 0x4D:
+               printf("qds: WRIOP: Supported SerDes1 Protocol 0x%02x\n",
+                      serdes1_prtcl);
+               if (hwconfig_f("xqsgmii", env_hwconfig)) {
+                       lane_to_slot_fsm1[0] = EMI1_SLOT3;
+                       lane_to_slot_fsm1[1] = EMI1_SLOT3;
+                       lane_to_slot_fsm1[2] = EMI_NONE;
+                       lane_to_slot_fsm1[3] = EMI_NONE;
+               } else {
+                       lane_to_slot_fsm1[0] = EMI_NONE;
+                       lane_to_slot_fsm1[1] = EMI_NONE;
+                       lane_to_slot_fsm1[2] = EMI_NONE;
+                       lane_to_slot_fsm1[3] = EMI_NONE;
+               }
+               lane_to_slot_fsm1[4] = EMI1_SLOT3;
+               lane_to_slot_fsm1[5] = EMI1_SLOT3;
+               lane_to_slot_fsm1[6] = EMI_NONE;
+               lane_to_slot_fsm1[7] = EMI_NONE;
+               break;
+
        case 0x2A:
+       case 0x4B:
+       case 0x4C:
                printf("qds: WRIOP: Supported SerDes1 Protocol 0x%02x\n",
                       serdes1_prtcl);
                break;
@@ -505,6 +550,38 @@ static void initialize_dpmac_to_slot(void)
                        lane_to_slot_fsm2[7] = EMI1_SLOT6;
                }
                break;
+
+       case 0x47:
+               printf("qds: WRIOP: Supported SerDes2 Protocol 0x%02x\n",
+                      serdes2_prtcl);
+               lane_to_slot_fsm2[0] = EMI_NONE;
+               lane_to_slot_fsm2[1] = EMI1_SLOT5;
+               lane_to_slot_fsm2[2] = EMI1_SLOT5;
+               lane_to_slot_fsm2[3] = EMI1_SLOT5;
+
+               if (hwconfig_f("xqsgmii", env_hwconfig)) {
+                       lane_to_slot_fsm2[4] = EMI_NONE;
+                       lane_to_slot_fsm2[5] = EMI1_SLOT5;
+                       lane_to_slot_fsm2[6] = EMI1_SLOT5;
+                       lane_to_slot_fsm2[7] = EMI1_SLOT5;
+               }
+               break;
+
+       case 0x57:
+               printf("qds: WRIOP: Supported SerDes2 Protocol 0x%02x\n",
+                      serdes2_prtcl);
+               if (hwconfig_f("xqsgmii", env_hwconfig)) {
+                       lane_to_slot_fsm2[0] = EMI_NONE;
+                       lane_to_slot_fsm2[1] = EMI_NONE;
+                       lane_to_slot_fsm2[2] = EMI_NONE;
+                       lane_to_slot_fsm2[3] = EMI_NONE;
+               }
+               lane_to_slot_fsm2[4] = EMI_NONE;
+               lane_to_slot_fsm2[5] = EMI_NONE;
+               lane_to_slot_fsm2[6] = EMI1_SLOT5;
+               lane_to_slot_fsm2[7] = EMI1_SLOT5;
+               break;
+
        default:
                printf(" %s qds: WRIOP: Unsupported SerDes2 Protocol 0x%02x\n",
                       __func__ , serdes2_prtcl);
@@ -537,8 +614,10 @@ void ls2080a_handle_phy_interface_sgmii(int dpmac_id)
 
        switch (serdes1_prtcl) {
        case 0x07:
+       case 0x39:
+       case 0x4D:
+               lane = serdes_get_first_lane(FSL_SRDS_1, SGMII1 + dpmac_id - 1);
 
-               lane = serdes_get_first_lane(FSL_SRDS_1, SGMII1 + dpmac_id);
                slot = lane_to_slot_fsm1[lane];
 
                switch (++slot) {
@@ -559,6 +638,26 @@ void ls2080a_handle_phy_interface_sgmii(int dpmac_id)
                        wriop_set_mdio(dpmac_id, bus);
                        break;
                case 3:
+                       if (slot == EMI_NONE)
+                               return;
+                       if (serdes1_prtcl == 0x39) {
+                               wriop_set_phy_address(dpmac_id,
+                                       riser_phy_addr[dpmac_id - 2]);
+                               if (dpmac_id >= 6 && hwconfig_f("xqsgmii",
+                                                               env_hwconfig))
+                                       wriop_set_phy_address(dpmac_id,
+                                               riser_phy_addr[dpmac_id - 3]);
+                       } else {
+                               wriop_set_phy_address(dpmac_id,
+                                       riser_phy_addr[dpmac_id - 2]);
+                               if (dpmac_id >= 7 && hwconfig_f("xqsgmii",
+                                                               env_hwconfig))
+                                       wriop_set_phy_address(dpmac_id,
+                                               riser_phy_addr[dpmac_id - 3]);
+                       }
+                       dpmac_info[dpmac_id].board_mux = EMI1_SLOT3;
+                       bus = mii_dev_for_muxval(EMI1_SLOT3);
+                       wriop_set_mdio(dpmac_id, bus);
                        break;
                case 4:
                        break;
@@ -579,6 +678,8 @@ serdes2:
        case 0x07:
        case 0x08:
        case 0x49:
+       case 0x47:
+       case 0x57:
                lane = serdes_get_first_lane(FSL_SRDS_2, SGMII9 +
                                                        (dpmac_id - 9));
                slot = lane_to_slot_fsm2[lane];
@@ -597,7 +698,23 @@ serdes2:
                        wriop_set_mdio(dpmac_id, bus);
                break;
                case 5:
-               break;
+                       if (slot == EMI_NONE)
+                               return;
+                       if (serdes2_prtcl == 0x47) {
+                               wriop_set_phy_address(dpmac_id,
+                                             riser_phy_addr[dpmac_id - 10]);
+                               if (dpmac_id >= 14 && hwconfig_f("xqsgmii",
+                                                                env_hwconfig))
+                                       wriop_set_phy_address(dpmac_id,
+                                               riser_phy_addr[dpmac_id - 11]);
+                       } else {
+                               wriop_set_phy_address(dpmac_id,
+                                       riser_phy_addr[dpmac_id - 11]);
+                       }
+                       dpmac_info[dpmac_id].board_mux = EMI1_SLOT5;
+                       bus = mii_dev_for_muxval(EMI1_SLOT5);
+                       wriop_set_mdio(dpmac_id, bus);
+                       break;
                case 6:
                        /* Slot housing a SGMII riser card? */
                        wriop_set_phy_address(dpmac_id,
@@ -691,6 +808,8 @@ void ls2080a_handle_phy_interface_xsgmii(int i)
 
        switch (serdes1_prtcl) {
        case 0x2A:
+       case 0x4B:
+       case 0x4C:
                /*
                 * XFI does not need a PHY to work, but to avoid U-Boot use
                 * default PHY address which is zero to a MAC when it found
index d07ca18af9a6ae029a7b90b5a351aaff8a76fb1c..73a61fd75aa12a3c6f7f2dfcbfca7a9b34bea5e6 100644 (file)
@@ -292,14 +292,16 @@ void fdt_fixup_board_enet(void *fdt)
        else
                fdt_status_fail(fdt, offset);
 }
+
+void board_quiesce_devices(void)
+{
+       fsl_mc_ldpaa_exit(gd->bd);
+}
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, bd_t *bd)
 {
-#ifdef CONFIG_FSL_MC_ENET
-       int err;
-#endif
        u64 base[CONFIG_NR_DRAM_BANKS];
        u64 size[CONFIG_NR_DRAM_BANKS];
 
@@ -317,9 +319,6 @@ int ft_board_setup(void *blob, bd_t *bd)
 
 #ifdef CONFIG_FSL_MC_ENET
        fdt_fixup_board_enet(blob);
-       err = fsl_mc_ldpaa_exit(bd);
-       if (err)
-               return err;
 #endif
 
        return 0;
index a20c003ce750edb69f288e52a394a113f5178b2f..759a14605c68487004a2ca790d9e251ca68491ce 100644 (file)
@@ -1,5 +1,5 @@
 LS2080A BOARD
-M:     Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
+M:     Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>, Priyanka Jain <priyanka.jain@nxp.com>
 S:     Maintained
 F:     board/freescale/ls2080ardb/
 F:     board/freescale/ls2080a/ls2080ardb.c
index b1613ba680081422feb7cf99987567f8653a8035..0c9c574f3387591fa1c0bd0c07a153ae7279bc84 100644 (file)
@@ -1,13 +1,13 @@
 Overview
 --------
 The LS2080A Reference Design (RDB) is a high-performance computing,
-evaluation, and development platform that supports the QorIQ LS2080A
+evaluation, and development platform that supports the QorIQ LS2080A, LS2088A
 Layerscape Architecture processor.
 
-LS2080A SoC Overview
+LS2080A, LS2088A SoC Overview
 --------------------
-Please refer arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc for LS2080A
-SoC overview.
+Please refer arch/arm/cpu/armv8/fsl-layerscape/doc/README.soc for LS2080A,
+LS2088A SoC overview.
 
  LS2080ARDB board Overview
  -----------------------
index 83d9e7ec12c0330c785e53f3acb86d659ceff063..02954ef6d760964a04a1c4d69b9572132ec757ad 100644 (file)
@@ -15,6 +15,7 @@
 #include <libfdt.h>
 #include <fsl-mc/fsl_mc.h>
 #include <environment.h>
+#include <efi_loader.h>
 #include <i2c.h>
 #include <asm/arch/soc.h>
 #include <fsl_sec.h>
@@ -201,6 +202,14 @@ int misc_init_r(void)
        if (adjust_vdd(0))
                printf("Warning: Adjusting core voltage failed.\n");
 
+#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
+       if (soc_has_dp_ddr() && gd->bd->bi_dram[2].size) {
+               efi_add_memory_map(gd->bd->bi_dram[2].start,
+                                  gd->bd->bi_dram[2].size >> EFI_PAGE_SHIFT,
+                                  EFI_RESERVED_MEMORY_TYPE, false);
+       }
+#endif
+
        return 0;
 }
 
@@ -256,14 +265,16 @@ void fdt_fixup_board_enet(void *fdt)
        else
                fdt_status_fail(fdt, offset);
 }
+
+void board_quiesce_devices(void)
+{
+       fsl_mc_ldpaa_exit(gd->bd);
+}
 #endif
 
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, bd_t *bd)
 {
-#ifdef CONFIG_FSL_MC_ENET
-       int err;
-#endif
        u64 base[CONFIG_NR_DRAM_BANKS];
        u64 size[CONFIG_NR_DRAM_BANKS];
 
@@ -281,9 +292,6 @@ int ft_board_setup(void *blob, bd_t *bd)
 
 #ifdef CONFIG_FSL_MC_ENET
        fdt_fixup_board_enet(blob);
-       err = fsl_mc_ldpaa_exit(bd);
-       if (err)
-               return err;
 #endif
 
        return 0;
diff --git a/board/google/chromebook_jerry/Kconfig b/board/google/chromebook_jerry/Kconfig
deleted file mode 100644 (file)
index 3640513..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-if TARGET_CHROMEBOOK_JERRY
-
-config SYS_BOARD
-       default "chromebook_jerry"
-
-config SYS_VENDOR
-       default "google"
-
-config SYS_CONFIG_NAME
-       default "chromebook_jerry"
-
-config BOARD_SPECIFIC_OPTIONS # dummy
-       def_bool y
-
-endif
diff --git a/board/google/chromebook_jerry/MAINTAINERS b/board/google/chromebook_jerry/MAINTAINERS
deleted file mode 100644 (file)
index b01b6cd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-CHROMEBOOK JERRY BOARD
-M:     Simon Glass <sjg@chromium.org>
-S:     Maintained
-F:     board/google/chromebook_jerry/
-F:     include/configs/chromebook_jerry.h
-F:     configs/chromebook_jerry_defconfig
diff --git a/board/google/chromebook_jerry/jerry.c b/board/google/chromebook_jerry/jerry.c
deleted file mode 100644 (file)
index 5119e95..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * (C) Copyright 2015 Google, Inc
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#include <common.h>
diff --git a/board/google/veyron/Kconfig b/board/google/veyron/Kconfig
new file mode 100644 (file)
index 0000000..770e9aa
--- /dev/null
@@ -0,0 +1,47 @@
+if TARGET_CHROMEBOOK_JERRY
+
+config SYS_BOARD
+       default "veyron"
+
+config SYS_VENDOR
+       default "google"
+
+config SYS_CONFIG_NAME
+       default "veyron"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+       def_bool y
+
+endif
+
+if TARGET_CHROMEBIT_MICKEY
+
+config SYS_BOARD
+       default "veyron"
+
+config SYS_VENDOR
+       default "google"
+
+config SYS_CONFIG_NAME
+       default "veyron"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+       def_bool y
+
+endif
+
+if TARGET_CHROMEBOOK_MINNIE
+
+config SYS_BOARD
+       default "veyron"
+
+config SYS_VENDOR
+       default "google"
+
+config SYS_CONFIG_NAME
+       default "veyron"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+       def_bool y
+
+endif
diff --git a/board/google/veyron/MAINTAINERS b/board/google/veyron/MAINTAINERS
new file mode 100644 (file)
index 0000000..d582cb0
--- /dev/null
@@ -0,0 +1,20 @@
+CHROMEBOOK JERRY BOARD
+M:     Simon Glass <sjg@chromium.org>
+S:     Maintained
+F:     board/google/veyron/
+F:     include/configs/veyron.h
+F:     configs/chromebook_jerry_defconfig
+
+CHROMEBIT MICKEY BOARD
+M:     Simon Glass <sjg@chromium.org>
+S:     Maintained
+F:     board/google/veyron/
+F:     include/configs/veyron.h
+F:     configs/chromebit_mickey_defconfig
+
+CHROMEBIT MINNIE BOARD
+M:     Simon Glass <sjg@chromium.org>
+S:     Maintained
+F:     board/google/veyron/
+F:     include/configs/veyron.h
+F:     configs/chromebit_minnie_defconfig
similarity index 81%
rename from board/google/chromebook_jerry/Makefile
rename to board/google/veyron/Makefile
index d29a063dcdd16fa73254cd5920d58f5c48480810..98683579dbea9a3d8d17f1d8bd0b4c4fa62c994e 100644 (file)
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y  += jerry.o
+obj-y  += veyron.o
diff --git a/board/google/veyron/veyron.c b/board/google/veyron/veyron.c
new file mode 100644 (file)
index 0000000..20297e1
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * (C) Copyright 2015 Google, Inc
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+
+/*
+ * We should increase the DDR voltage to 1.2V using the PWM regulator.
+ * There is a U-Boot driver for this but it may need to add support for the
+ * 'voltage-table' property.
+ */
index 4ce2c983b382d44ed54ee802f07787cef84a3546..dcb25acf1884b5f7861a66edad37d2d444413489 100644 (file)
@@ -5,3 +5,4 @@
 #
 
 obj-y  := rpi.o
+obj-y  += lowlevel_init.o
diff --git a/board/raspberrypi/rpi/lowlevel_init.S b/board/raspberrypi/rpi/lowlevel_init.S
new file mode 100644 (file)
index 0000000..cdbd8e1
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * (C) Copyright 2016
+ * Cédric Schieli <cschieli@gmail.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <config.h>
+
+.align 8
+.global fw_dtb_pointer
+fw_dtb_pointer:
+#ifdef CONFIG_ARM64
+       .dword 0x0
+#else
+       .word 0x0
+#endif
+
+/*
+ * Routine: save_boot_params (called after reset from start.S)
+ * Description: save ATAG/FDT address provided by the firmware at boot time
+ */
+
+.global save_boot_params
+save_boot_params:
+
+       /* The firmware provided ATAG/FDT address can be found in r2/x0 */
+#ifdef CONFIG_ARM64
+       adr     x8, fw_dtb_pointer
+       str     x0, [x8]
+#else
+       str     r2, fw_dtb_pointer
+#endif
+
+       /* Returns */
+       b       save_boot_params_ret
index 6245b3678f15ae31b2073f6be4b3cc59a6e326e9..ffd6d315ed9923465abe35a899d37f3db2c852c9 100644 (file)
@@ -25,6 +25,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* From lowlevel_init.S */
+extern unsigned long fw_dtb_pointer;
+
 static const struct bcm2835_gpio_platdata gpio_platdata = {
        .base = BCM2835_GPIO_BASE,
 };
@@ -285,6 +288,31 @@ static void set_fdtfile(void)
        setenv("fdtfile", fdtfile);
 }
 
+/*
+ * If the firmware provided a valid FDT at boot time, let's expose it in
+ * ${fdt_addr} so it may be passed unmodified to the kernel.
+ */
+static void set_fdt_addr(void)
+{
+       if (getenv("fdt_addr"))
+               return;
+
+       if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC)
+               return;
+
+       setenv_hex("fdt_addr", fw_dtb_pointer);
+}
+
+/*
+ * Prevent relocation from stomping on a firmware provided FDT blob.
+ */
+unsigned long board_get_usable_ram_top(unsigned long total_size)
+{
+       if ((gd->ram_top - fw_dtb_pointer) > SZ_64M)
+               return gd->ram_top;
+       return fw_dtb_pointer & ~0xffff;
+}
+
 static void set_usbethaddr(void)
 {
        ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_mac_address, msg, 1);
@@ -356,6 +384,7 @@ static void set_serial_number(void)
 
 int misc_init_r(void)
 {
+       set_fdt_addr();
        set_fdtfile();
        set_usbethaddr();
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
index c6e6cd3e0b29120b0f32ee83ea2e85cbcd21c58d..c437f1be0b328444665ad19d62b36db149ebd786 100644 (file)
@@ -71,5 +71,5 @@ void dram_init_banksize(void)
 {
        /* Reserve 0x200000 for ATF bl31 */
        gd->bd->bi_dram[0].start = 0x200000;
-       gd->bd->bi_dram[0].size = 0x80000000;
+       gd->bd->bi_dram[0].size = 0x7e000000;
 }
index d7dc55bfc16e6f05101fbd757afbc9f63eceb0b9..e23d45eed9d65c9f0ae3d203d80ec6f28cd68ad4 100644 (file)
@@ -232,6 +232,11 @@ M: Jelle van der Waa <jelle@vdwaa.nl>
 S:     Maintained
 F:     configs/nanopi_neo_defconfig
 
+NINTENDO NES CLASSIC EDITION BOARD
+M:     FUKAUMI Naoki <naobsd@gmail.com>
+S:     Maintained
+F:     configs/Nintendo_NES_Classic_Edition_defconfig
+
 R16 EVB PARROT BOARD
 M:     Quentin Schulz <quentin.schulz@free-electrons.com>
 S:     Maintained
index fc1353ae3b2c63d747beb61bbc19f84158d39635..da9eab47bce2489113ea3ee18748e8322d9ad891 100644 (file)
@@ -64,10 +64,16 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 /*
  * Read header information from EEPROM into global structure.
  */
-static inline int __maybe_unused read_eeprom(void)
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
+void do_board_detect(void)
 {
-       return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
+       enable_i2c0_pin_mux();
+       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+
+       if (ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR))
+               printf("ti_i2c_eeprom_init failed\n");
 }
+#endif
 
 #ifndef CONFIG_DM_SERIAL
 struct serial_device *default_serial_console(void)
@@ -248,9 +254,6 @@ void am33xx_spl_board_init(void)
 {
        int mpu_vdd;
 
-       if (read_eeprom() < 0)
-               puts("Could not get board ID.\n");
-
        /* Get the frequency */
        dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
 
@@ -388,11 +391,6 @@ void am33xx_spl_board_init(void)
 
 const struct dpll_params *get_dpll_ddr_params(void)
 {
-       enable_i2c0_pin_mux();
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-       if (read_eeprom() < 0)
-               puts("Could not get board ID.\n");
-
        if (board_is_evm_sk())
                return &dpll_ddr_evm_sk;
        else if (board_is_bone_lt() || board_is_icev2())
@@ -422,9 +420,6 @@ void set_uart_mux_conf(void)
 
 void set_mux_conf_regs(void)
 {
-       if (read_eeprom() < 0)
-               puts("Could not get board ID.\n");
-
        enable_board_pin_mux();
 }
 
@@ -462,9 +457,6 @@ const struct ctrl_ioregs ioregs = {
 
 void sdram_init(void)
 {
-       if (read_eeprom() < 0)
-               puts("Could not get board ID.\n");
-
        if (board_is_evm_sk()) {
                /*
                 * EVM SK 1.2A and later use gpio0_7 to enable DDR3.
@@ -642,13 +634,8 @@ int board_late_init(void)
 #endif
 
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-       int rc;
        char *name = NULL;
 
-       rc = read_eeprom();
-       if (rc)
-               puts("Could not get board ID.\n");
-
        if (board_is_bbg1())
                name = "BBG1";
        set_board_info_env(name);
@@ -779,9 +766,6 @@ int board_eth_init(bd_t *bis)
        (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
 
 #ifdef CONFIG_DRIVER_TI_CPSW
-       if (read_eeprom() < 0)
-               puts("Could not get board ID.\n");
-
        if (board_is_bone() || board_is_bone_lt() ||
            board_is_idk()) {
                writel(MII_MODE_ENABLE, &cdev->miisel);
index f04a06e0d5f7eb2edeb832ecd08ca9e32923007d..ba6f88ffa85081642eaf3568339868fd99b2776e 100644 (file)
@@ -39,10 +39,13 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 /*
  * Read header information from EEPROM into global structure.
  */
-static inline int __maybe_unused read_eeprom(void)
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
+void do_board_detect(void)
 {
-       return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
+       if (ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR))
+               printf("ti_i2c_eeprom_init failed\n");
 }
+#endif
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 
@@ -337,9 +340,6 @@ const struct dpll_params *get_dpll_ddr_params(void)
 {
        int ind = get_sys_clk_index();
 
-       if (read_eeprom() < 0)
-               return NULL;
-
        if (board_is_eposevm())
                return &epos_evm_dpll_ddr[ind];
        else if (board_is_evm() || board_is_sk())
@@ -495,9 +495,6 @@ void scale_vcores(void)
 {
        const struct dpll_params *mpu_params;
 
-       if (read_eeprom() < 0)
-               puts("Could not get board ID.\n");
-
        /* Ensure I2C is initialized for PMIC configuration */
        gpi2c_init();
 
@@ -537,8 +534,6 @@ static void enable_vtt_regulator(void)
 
 void sdram_init(void)
 {
-       if (read_eeprom() < 0)
-               return;
        /*
         * EPOS EVM has 1GB LPDDR2 connected to EMIF.
         * GP EMV has 1GB DDR3 connected to EMIF
index 64de60254136e7485213bf9aa6ba933344058e8e..f3e3f0bd3d608547336da8f6a567e266bed1ccf5 100644 (file)
@@ -447,26 +447,6 @@ int spl_start_uboot(void)
 #endif
 
 #ifdef CONFIG_USB_DWC3
-static struct dwc3_device usb_otg_ss1 = {
-       .maximum_speed = USB_SPEED_SUPER,
-       .base = DRA7_USB_OTG_SS1_BASE,
-       .tx_fifo_resize = false,
-       .index = 0,
-};
-
-static struct dwc3_omap_device usb_otg_ss1_glue = {
-       .base = (void *)DRA7_USB_OTG_SS1_GLUE_BASE,
-       .utmi_mode = DWC3_OMAP_UTMI_MODE_SW,
-       .index = 0,
-};
-
-static struct ti_usb_phy_device usb_phy1_device = {
-       .pll_ctrl_base = (void *)DRA7_USB3_PHY1_PLL_CTRL,
-       .usb2_phy_power = (void *)DRA7_USB2_PHY1_POWER,
-       .usb3_phy_power = (void *)DRA7_USB3_PHY1_POWER,
-       .index = 0,
-};
-
 static struct dwc3_device usb_otg_ss2 = {
        .maximum_speed = USB_SPEED_HIGH,
        .base = DRA7_USB_OTG_SS2_BASE,
index 7ef2d2bff5a02d4d3651c749d8b711c44c35da20..879f8b598355d2625cfa88618ceac79173c73703 100644 (file)
@@ -6,12 +6,12 @@
 #
 
 obj-y += board.o
-obj-$(CONFIG_K2HK_EVM) += board_k2hk.o
-obj-$(CONFIG_K2HK_EVM) += ddr3_k2hk.o
-obj-$(CONFIG_K2E_EVM) += board_k2e.o
-obj-$(CONFIG_K2E_EVM) += ddr3_k2e.o
-obj-$(CONFIG_K2L_EVM) += board_k2l.o
-obj-$(CONFIG_K2L_EVM) += ddr3_k2l.o
-obj-$(CONFIG_K2L_EVM) += ddr3_cfg.o
-obj-$(CONFIG_K2G_EVM) += board_k2g.o
-obj-$(CONFIG_K2G_EVM) += ddr3_k2g.o
+obj-$(CONFIG_TARGET_K2HK_EVM) += board_k2hk.o
+obj-$(CONFIG_TARGET_K2HK_EVM) += ddr3_k2hk.o
+obj-$(CONFIG_TARGET_K2E_EVM) += board_k2e.o
+obj-$(CONFIG_TARGET_K2E_EVM) += ddr3_k2e.o
+obj-$(CONFIG_TARGET_K2L_EVM) += board_k2l.o
+obj-$(CONFIG_TARGET_K2L_EVM) += ddr3_k2l.o
+obj-$(CONFIG_TARGET_K2L_EVM) += ddr3_cfg.o
+obj-$(CONFIG_TARGET_K2G_EVM) += board_k2g.o
+obj-$(CONFIG_TARGET_K2G_EVM) += ddr3_k2g.o
diff --git a/board/topic/zynq/MAINTAINERS b/board/topic/zynq/MAINTAINERS
new file mode 100644 (file)
index 0000000..d795b30
--- /dev/null
@@ -0,0 +1,6 @@
+TOPIC BOARD
+M:     Mike Looijmans <mike.looijmans@topic.nl>
+S:     Maintained
+F:     board/topic/zynq/
+F:     include/configs/topic*.h
+F:     configs/topic_*_defconfig
diff --git a/board/topic/zynq/Makefile b/board/topic/zynq/Makefile
new file mode 100644 (file)
index 0000000..eaf59cd
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  := board.o
+
+# Remove quotes
+hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE))
+
+obj-$(CONFIG_SPL_BUILD) += $(hw-platform-y)/ps7_init_gpl.o ps7_init_common.o
diff --git a/board/topic/zynq/board.c b/board/topic/zynq/board.c
new file mode 100644 (file)
index 0000000..a95c9d1
--- /dev/null
@@ -0,0 +1 @@
+#include "../../xilinx/zynq/board.c"
diff --git a/board/topic/zynq/ps7_init_common.c b/board/topic/zynq/ps7_init_common.c
new file mode 100644 (file)
index 0000000..b1d45c2
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
+ * (c) Copyright 2016 Topic Embedded Products.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "ps7_init_gpl.h"
+#include <asm/io.h>
+
+/* For delay calculation using global registers*/
+#define SCU_GLOBAL_TIMER_COUNT_L32     0xF8F00200
+#define SCU_GLOBAL_TIMER_COUNT_U32     0xF8F00204
+#define SCU_GLOBAL_TIMER_CONTROL       0xF8F00208
+#define SCU_GLOBAL_TIMER_AUTO_INC      0xF8F00218
+#define APU_FREQ  666666666
+
+#define PS7_MASK_POLL_TIME 100000000
+
+/* IO accessors. No memory barriers desired. */
+static inline void iowrite(unsigned long val, unsigned long addr)
+{
+       __raw_writel(val, addr);
+}
+
+static inline unsigned long ioread(unsigned long addr)
+{
+       return __raw_readl(addr);
+}
+
+/* start timer */
+static void perf_start_clock(void)
+{
+       iowrite((1 << 0) | /* Timer Enable */
+               (1 << 3) | /* Auto-increment */
+               (0 << 8), /* Pre-scale */
+               SCU_GLOBAL_TIMER_CONTROL);
+}
+
+/* Compute mask for given delay in miliseconds*/
+static int get_number_of_cycles_for_delay(unsigned int delay)
+{
+       return (APU_FREQ / (2 * 1000)) * delay;
+}
+
+/* stop timer */
+static void perf_disable_clock(void)
+{
+       iowrite(0, SCU_GLOBAL_TIMER_CONTROL);
+}
+
+/* stop timer and reset timer count regs */
+static void perf_reset_clock(void)
+{
+       perf_disable_clock();
+       iowrite(0, SCU_GLOBAL_TIMER_COUNT_L32);
+       iowrite(0, SCU_GLOBAL_TIMER_COUNT_U32);
+}
+
+static void perf_reset_and_start_timer(void)
+{
+       perf_reset_clock();
+       perf_start_clock();
+}
+
+int ps7_config(unsigned long *ps7_config_init)
+{
+       unsigned long *ptr = ps7_config_init;
+       unsigned long opcode;
+       unsigned long addr;
+       unsigned long val;
+       unsigned long mask;
+       unsigned int numargs;
+       int i;
+       int delay;
+
+       for (;;) {
+               opcode = ptr[0];
+               if (opcode == OPCODE_EXIT)
+                       return PS7_INIT_SUCCESS;
+               addr = (opcode & OPCODE_ADDRESS_MASK);
+
+               switch (opcode & ~OPCODE_ADDRESS_MASK) {
+               case OPCODE_MASKWRITE:
+                       numargs = 3;
+                       mask = ptr[1];
+                       val = ptr[2];
+                       iowrite((ioread(addr) & ~mask) | (val & mask), addr);
+                       break;
+
+               case OPCODE_MASKPOLL:
+                       numargs = 2;
+                       mask = ptr[1];
+                       i = 0;
+                       while (!(ioread(addr) & mask)) {
+                               if (i == PS7_MASK_POLL_TIME)
+                                       return PS7_INIT_TIMEOUT;
+                               i++;
+                       }
+                       break;
+
+               case OPCODE_MASKDELAY:
+                       numargs = 2;
+                       mask = ptr[1];
+                       delay = get_number_of_cycles_for_delay(mask);
+                       perf_reset_and_start_timer();
+                       while (ioread(addr) < delay)
+                               ;
+                       break;
+
+               default:
+                       return PS7_INIT_CORRUPT;
+               }
+
+               ptr += numargs;
+       }
+}
diff --git a/board/topic/zynq/ps7_init_gpl.h b/board/topic/zynq/ps7_init_gpl.h
new file mode 100644 (file)
index 0000000..ef719ac
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
+ * (c) Copyright 2016 Topic Embedded Products.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#define OPCODE_EXIT       0U
+#define OPCODE_MASKWRITE  0U
+#define OPCODE_MASKPOLL   1U
+#define OPCODE_MASKDELAY  2U
+#define OPCODE_ADDRESS_MASK (~3U)
+
+/* Sentinel */
+#define EMIT_EXIT()                     OPCODE_EXIT
+/* Opcode is in lower 2 bits of address, address is always 4-byte aligned */
+#define EMIT_MASKWRITE(addr, mask, val) OPCODE_MASKWRITE | addr, mask, val
+#define EMIT_MASKPOLL(addr, mask)       OPCODE_MASKPOLL | addr, mask
+#define EMIT_MASKDELAY(addr, mask)      OPCODE_MASKDELAY | addr, mask
+
+/* Returns codes of ps7_init* */
+#define PS7_INIT_SUCCESS   (0)
+#define PS7_INIT_CORRUPT   (1)
+#define PS7_INIT_TIMEOUT   (2)
+#define PS7_POLL_FAILED_DDR_INIT (3)
+#define PS7_POLL_FAILED_DMA      (4)
+#define PS7_POLL_FAILED_PLL      (5)
+
+/* Called by spl.c */
+int ps7_init(void);
+int ps7_post_config(void);
+
+/* Defined in ps7_init_common.c */
+int ps7_config(unsigned long *ps7_config_init);
diff --git a/board/topic/zynq/zynq-topic-miami/ps7_init_gpl.c b/board/topic/zynq/zynq-topic-miami/ps7_init_gpl.c
new file mode 100644 (file)
index 0000000..b195d7a
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
+ * (c) Copyright 2016 Topic Embedded Products.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "../ps7_init_gpl.h"
+
+static unsigned long ps7_pll_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000110, 0x003FFFF0U, 0x000FA220U),
+       EMIT_MASKWRITE(0XF8000100, 0x0007F000U, 0x00028000U),
+       EMIT_MASKWRITE(0XF8000100, 0x00000010U, 0x00000010U),
+       EMIT_MASKWRITE(0XF8000100, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000100, 0x00000001U, 0x00000000U),
+       EMIT_MASKPOLL(0XF800010C, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000100, 0x00000010U, 0x00000000U),
+       EMIT_MASKWRITE(0XF8000120, 0x1F003F30U, 0x1F000200U),
+       EMIT_MASKWRITE(0XF8000114, 0x003FFFF0U, 0x0012C220U),
+       EMIT_MASKWRITE(0XF8000104, 0x0007F000U, 0x00020000U),
+       EMIT_MASKWRITE(0XF8000104, 0x00000010U, 0x00000010U),
+       EMIT_MASKWRITE(0XF8000104, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000104, 0x00000001U, 0x00000000U),
+       EMIT_MASKPOLL(0XF800010C, 0x00000002U),
+       EMIT_MASKWRITE(0XF8000104, 0x00000010U, 0x00000000U),
+       EMIT_MASKWRITE(0XF8000124, 0xFFF00003U, 0x0C200003U),
+       EMIT_MASKWRITE(0XF8000118, 0x003FFFF0U, 0x00113220U),
+       EMIT_MASKWRITE(0XF8000108, 0x0007F000U, 0x00024000U),
+       EMIT_MASKWRITE(0XF8000108, 0x00000010U, 0x00000010U),
+       EMIT_MASKWRITE(0XF8000108, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000108, 0x00000001U, 0x00000000U),
+       EMIT_MASKPOLL(0XF800010C, 0x00000004U),
+       EMIT_MASKWRITE(0XF8000108, 0x00000010U, 0x00000000U),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_clock_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000128, 0x03F03F01U, 0x00302301U),
+       EMIT_MASKWRITE(0XF8000138, 0x00000011U, 0x00000011U),
+       EMIT_MASKWRITE(0XF800013C, 0x00000011U, 0x00000011U),
+       EMIT_MASKWRITE(0XF8000140, 0x03F03F71U, 0x00100141U),
+       EMIT_MASKWRITE(0XF8000144, 0x03F03F71U, 0x00100141U),
+       EMIT_MASKWRITE(0XF8000148, 0x00003F31U, 0x00000C01U),
+       EMIT_MASKWRITE(0XF800014C, 0x00003F31U, 0x00000601U),
+       EMIT_MASKWRITE(0XF8000150, 0x00003F33U, 0x00001803U),
+       EMIT_MASKWRITE(0XF8000154, 0x00003F33U, 0x00000C03U),
+       EMIT_MASKWRITE(0XF8000158, 0x00003F33U, 0x00000601U),
+       EMIT_MASKWRITE(0XF8000168, 0x00003F31U, 0x00000601U),
+       EMIT_MASKWRITE(0XF8000170, 0x03F03F30U, 0x00100C00U),
+       EMIT_MASKWRITE(0XF8000180, 0x03F03F30U, 0x00100C00U),
+       EMIT_MASKWRITE(0XF8000190, 0x03F03F30U, 0x00100600U),
+       EMIT_MASKWRITE(0XF80001A0, 0x03F03F30U, 0x00101800U),
+       EMIT_MASKWRITE(0XF80001C4, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF800012C, 0x01FFCCCDU, 0x01FC4C4DU),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_ddr_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8006000, 0x0001FFFFU, 0x00000080U),
+       EMIT_MASKWRITE(0XF8006004, 0x0007FFFFU, 0x00001081U),
+       EMIT_MASKWRITE(0XF8006008, 0x03FFFFFFU, 0x03C0780FU),
+       EMIT_MASKWRITE(0XF800600C, 0x03FFFFFFU, 0x02001001U),
+       EMIT_MASKWRITE(0XF8006010, 0x03FFFFFFU, 0x00014001U),
+       EMIT_MASKWRITE(0XF8006014, 0x001FFFFFU, 0x0004281AU),
+       EMIT_MASKWRITE(0XF8006018, 0xF7FFFFFFU, 0x44E458D2U),
+       EMIT_MASKWRITE(0XF800601C, 0xFFFFFFFFU, 0x720238E5U),
+       EMIT_MASKWRITE(0XF8006020, 0x7FDFFFFCU, 0x270872D0U),
+       EMIT_MASKWRITE(0XF8006024, 0x0FFFFFC3U, 0x00000000U),
+       EMIT_MASKWRITE(0XF8006028, 0x00003FFFU, 0x00002007U),
+       EMIT_MASKWRITE(0XF800602C, 0xFFFFFFFFU, 0x00000008U),
+       EMIT_MASKWRITE(0XF8006030, 0xFFFFFFFFU, 0x00040930U),
+       EMIT_MASKWRITE(0XF8006034, 0x13FF3FFFU, 0x000116D4U),
+       EMIT_MASKWRITE(0XF8006038, 0x00000003U, 0x00000000U),
+       EMIT_MASKWRITE(0XF800603C, 0x000FFFFFU, 0x00000777U),
+       EMIT_MASKWRITE(0XF8006040, 0xFFFFFFFFU, 0xFFF00000U),
+       EMIT_MASKWRITE(0XF8006044, 0x0FFFFFFFU, 0x0F666666U),
+       EMIT_MASKWRITE(0XF8006048, 0x0003F03FU, 0x0003C008U),
+       EMIT_MASKWRITE(0XF8006050, 0xFF0F8FFFU, 0x77010800U),
+       EMIT_MASKWRITE(0XF8006058, 0x00010000U, 0x00000000U),
+       EMIT_MASKWRITE(0XF800605C, 0x0000FFFFU, 0x00005003U),
+       EMIT_MASKWRITE(0XF8006060, 0x000017FFU, 0x0000003EU),
+       EMIT_MASKWRITE(0XF8006064, 0x00021FE0U, 0x00020000U),
+       EMIT_MASKWRITE(0XF8006068, 0x03FFFFFFU, 0x00284141U),
+       EMIT_MASKWRITE(0XF800606C, 0x0000FFFFU, 0x00001610U),
+       EMIT_MASKWRITE(0XF8006078, 0x03FFFFFFU, 0x00466111U),
+       EMIT_MASKWRITE(0XF800607C, 0x000FFFFFU, 0x00032222U),
+       EMIT_MASKWRITE(0XF80060A4, 0xFFFFFFFFU, 0x10200802U),
+       EMIT_MASKWRITE(0XF80060A8, 0x0FFFFFFFU, 0x0690CB73U),
+       EMIT_MASKWRITE(0XF80060AC, 0x000001FFU, 0x000001FEU),
+       EMIT_MASKWRITE(0XF80060B0, 0x1FFFFFFFU, 0x1CFFFFFFU),
+       EMIT_MASKWRITE(0XF80060B4, 0x00000200U, 0x00000200U),
+       EMIT_MASKWRITE(0XF80060B8, 0x01FFFFFFU, 0x00200066U),
+       EMIT_MASKWRITE(0XF80060C4, 0x00000003U, 0x00000003U),
+       EMIT_MASKWRITE(0XF80060C4, 0x00000003U, 0x00000000U),
+       EMIT_MASKWRITE(0XF80060C8, 0x000000FFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF80060DC, 0x00000001U, 0x00000000U),
+       EMIT_MASKWRITE(0XF80060F0, 0x0000FFFFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF80060F4, 0x0000000FU, 0x00000008U),
+       EMIT_MASKWRITE(0XF8006114, 0x000000FFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF8006118, 0x7FFFFFCFU, 0x40000001U),
+       EMIT_MASKWRITE(0XF800611C, 0x7FFFFFCFU, 0x40000001U),
+       EMIT_MASKWRITE(0XF8006120, 0x7FFFFFCFU, 0x40000001U),
+       EMIT_MASKWRITE(0XF8006124, 0x7FFFFFCFU, 0x40000001U),
+       EMIT_MASKWRITE(0XF800612C, 0x000FFFFFU, 0x00025010U),
+       EMIT_MASKWRITE(0XF8006130, 0x000FFFFFU, 0x00026400U),
+       EMIT_MASKWRITE(0XF8006134, 0x000FFFFFU, 0x00029418U),
+       EMIT_MASKWRITE(0XF8006138, 0x000FFFFFU, 0x00027820U),
+       EMIT_MASKWRITE(0XF8006140, 0x000FFFFFU, 0x00000035U),
+       EMIT_MASKWRITE(0XF8006144, 0x000FFFFFU, 0x00000035U),
+       EMIT_MASKWRITE(0XF8006148, 0x000FFFFFU, 0x00000035U),
+       EMIT_MASKWRITE(0XF800614C, 0x000FFFFFU, 0x00000035U),
+       EMIT_MASKWRITE(0XF8006154, 0x000FFFFFU, 0x00000090U),
+       EMIT_MASKWRITE(0XF8006158, 0x000FFFFFU, 0x00000080U),
+       EMIT_MASKWRITE(0XF800615C, 0x000FFFFFU, 0x00000098U),
+       EMIT_MASKWRITE(0XF8006160, 0x000FFFFFU, 0x000000A0U),
+       EMIT_MASKWRITE(0XF8006168, 0x001FFFFFU, 0x000000E9U),
+       EMIT_MASKWRITE(0XF800616C, 0x001FFFFFU, 0x000000EEU),
+       EMIT_MASKWRITE(0XF8006170, 0x001FFFFFU, 0x000000FAU),
+       EMIT_MASKWRITE(0XF8006174, 0x001FFFFFU, 0x000000F3U),
+       EMIT_MASKWRITE(0XF800617C, 0x000FFFFFU, 0x000000D0U),
+       EMIT_MASKWRITE(0XF8006180, 0x000FFFFFU, 0x000000C0U),
+       EMIT_MASKWRITE(0XF8006184, 0x000FFFFFU, 0x000000D8U),
+       EMIT_MASKWRITE(0XF8006188, 0x000FFFFFU, 0x000000E0U),
+       EMIT_MASKWRITE(0XF8006190, 0x6FFFFEFEU, 0x00040080U),
+       EMIT_MASKWRITE(0XF8006194, 0x000FFFFFU, 0x0001FC82U),
+       EMIT_MASKWRITE(0XF8006204, 0xFFFFFFFFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF8006208, 0x000703FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF800620C, 0x000703FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006210, 0x000703FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006214, 0x000703FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006218, 0x000F03FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF800621C, 0x000F03FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006220, 0x000F03FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006224, 0x000F03FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF80062A8, 0x00000FF5U, 0x00000000U),
+       EMIT_MASKWRITE(0XF80062AC, 0xFFFFFFFFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF80062B0, 0x003FFFFFU, 0x00005125U),
+       EMIT_MASKWRITE(0XF80062B4, 0x0003FFFFU, 0x000012A8U),
+       EMIT_MASKPOLL(0XF8000B74, 0x00002000U),
+       EMIT_MASKWRITE(0XF8006000, 0x0001FFFFU, 0x00000081U),
+       EMIT_MASKPOLL(0XF8006054, 0x00000007U),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_mio_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000B40, 0x00000FFFU, 0x00000600U),
+       EMIT_MASKWRITE(0XF8000B44, 0x00000FFFU, 0x00000600U),
+       EMIT_MASKWRITE(0XF8000B48, 0x00000FFFU, 0x00000672U),
+       EMIT_MASKWRITE(0XF8000B4C, 0x00000FFFU, 0x00000672U),
+       EMIT_MASKWRITE(0XF8000B50, 0x00000FFFU, 0x00000674U),
+       EMIT_MASKWRITE(0XF8000B54, 0x00000FFFU, 0x00000674U),
+       EMIT_MASKWRITE(0XF8000B58, 0x00000FFFU, 0x00000600U),
+       EMIT_MASKWRITE(0XF8000B5C, 0xFFFFFFFFU, 0x0018C61CU),
+       EMIT_MASKWRITE(0XF8000B60, 0xFFFFFFFFU, 0x00F9861CU),
+       EMIT_MASKWRITE(0XF8000B64, 0xFFFFFFFFU, 0x00F9861CU),
+       EMIT_MASKWRITE(0XF8000B68, 0xFFFFFFFFU, 0x00F9861CU),
+       EMIT_MASKWRITE(0XF8000B6C, 0x00007FFFU, 0x00000E60U),
+       EMIT_MASKWRITE(0XF8000B70, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000B70, 0x00000021U, 0x00000020U),
+       EMIT_MASKWRITE(0XF8000B70, 0x07FEFFFFU, 0x00000823U),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_peripherals_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000B48, 0x00000180U, 0x00000180U),
+       EMIT_MASKWRITE(0XF8000B4C, 0x00000180U, 0x00000180U),
+       EMIT_MASKWRITE(0XF8000B50, 0x00000180U, 0x00000180U),
+       EMIT_MASKWRITE(0XF8000B54, 0x00000180U, 0x00000180U),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_MASKWRITE(0XE0001034, 0x000000FFU, 0x00000006U),
+       EMIT_MASKWRITE(0XE0001018, 0x0000FFFFU, 0x0000007CU),
+       EMIT_MASKWRITE(0XE0001000, 0x000001FFU, 0x00000017U),
+       EMIT_MASKWRITE(0XE0001004, 0x000003FFU, 0x00000020U),
+       EMIT_MASKWRITE(0XE0000034, 0x000000FFU, 0x00000006U),
+       EMIT_MASKWRITE(0XE0000018, 0x0000FFFFU, 0x0000007CU),
+       EMIT_MASKWRITE(0XE0000000, 0x000001FFU, 0x00000017U),
+       EMIT_MASKWRITE(0XE0000004, 0x000003FFU, 0x00000020U),
+       EMIT_MASKWRITE(0XE000D000, 0x000800FFU, 0x000800C1U),
+       EMIT_MASKWRITE(0XF8007000, 0x20000000U, 0x00000000U),
+       EMIT_MASKDELAY(0XF8F00200, 1),
+       EMIT_MASKDELAY(0XF8F00200, 1),
+       EMIT_MASKDELAY(0XF8F00200, 1),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_post_config_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000900, 0x0000000FU, 0x0000000FU),
+       EMIT_MASKWRITE(0XF8000240, 0xFFFFFFFFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_EXIT(),
+};
+
+int ps7_init(void)
+{
+       int ret;
+
+       ret = ps7_config(ps7_mio_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+       ret = ps7_config(ps7_pll_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+       ret = ps7_config(ps7_clock_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+       ret = ps7_config(ps7_ddr_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+       ret = ps7_config(ps7_peripherals_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+
+       return PS7_INIT_SUCCESS;
+}
+
+int ps7_post_config(void)
+{
+       return ps7_config(ps7_post_config_3_0);
+}
diff --git a/board/topic/zynq/zynq-topic-miami/ps7_regs.txt b/board/topic/zynq/zynq-topic-miami/ps7_regs.txt
new file mode 100644 (file)
index 0000000..2ad9da6
--- /dev/null
@@ -0,0 +1,61 @@
+0xF8000120 0x1F000200 // ARM_CLK_CTRL - divisor = 2 433 MHz (?)
+0xf8000700 0x1210     // MIO configuration
+0xf8000704 0x202
+0xf8000708 0x202
+0xf800070c 0x202
+0xf8000710 0x202
+0xf8000714 0x202
+0xf8000718 0x202
+0xf800071c 0x210
+0xf8000720 0x202
+0xf8000724 0x1210
+0xf8000728 0x1210
+0xf800072c 0x1210
+0xf8000730 0x1210
+0xf8000734 0x1210
+0xf8000738 0x1211
+0xf800073c 0x1200
+0xf8000740 0x1210
+0xf8000744 0x1210
+0xf8000748 0x1210
+0xf800074c 0x1210
+0xf8000750 0x1210
+0xf8000754 0x1210
+0xf8000758 0x1210
+0xf800075c 0x1210
+0xf8000760 0x1201
+0xf8000764 0x200
+0xf8000768 0x12e1
+0xf800076c 0x2e0
+0xf8000770 0x304
+0xf8000774 0x305
+0xf8000778 0x304
+0xf800077c 0x305
+0xf8000780 0x304
+0xf8000784 0x304
+0xf8000788 0x304
+0xf800078c 0x304
+0xf8000790 0x305
+0xf8000794 0x304
+0xf8000798 0x304
+0xf800079c 0x304
+0xf80007a0 0x380
+0xf80007a4 0x380
+0xf80007a8 0x380
+0xf80007ac 0x380
+0xf80007b0 0x380
+0xf80007b4 0x380
+0xf80007b8 0x1261
+0xf80007bc 0x1260
+0xf80007c0 0x1261
+0xf80007c4 0x1261
+0xf80007c8 0x1240
+0xf80007cc 0x1240
+0xf80007d0 0x1240
+0xf80007d4 0x1240
+0xf8000830 0x180037
+0xf8000834 0x3a0039
+0xF800014C 0x00000621 // LQSPI_CLK_CTRL - ARMPLL/6 (200 MHz)
+0xE000D000 0x800238C1 // QSPI config - divide-by-2
+0xE000D038 0x00000020 // QSPI loopback - internal, 0 delay
+0xE000D0A0 0x82FF04EB // LQSPI_CFG - QIOREAD mode, Numonyx/Micron
diff --git a/board/topic/zynq/zynq-topic-miamiplus/ps7_init_gpl.c b/board/topic/zynq/zynq-topic-miamiplus/ps7_init_gpl.c
new file mode 100644 (file)
index 0000000..5a92336
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved.
+ * (c) Copyright 2016 Topic Embedded Products.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "../ps7_init_gpl.h"
+
+static unsigned long ps7_pll_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000110, 0x003FFFF0U, 0x000FA220U),
+       EMIT_MASKWRITE(0XF8000100, 0x0007F000U, 0x00028000U),
+       EMIT_MASKWRITE(0XF8000100, 0x00000010U, 0x00000010U),
+       EMIT_MASKWRITE(0XF8000100, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000100, 0x00000001U, 0x00000000U),
+       EMIT_MASKPOLL(0XF800010C, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000100, 0x00000010U, 0x00000000U),
+       EMIT_MASKWRITE(0XF8000120, 0x1F003F30U, 0x1F000200U),
+       EMIT_MASKWRITE(0XF8000114, 0x003FFFF0U, 0x0012C220U),
+       EMIT_MASKWRITE(0XF8000104, 0x0007F000U, 0x00020000U),
+       EMIT_MASKWRITE(0XF8000104, 0x00000010U, 0x00000010U),
+       EMIT_MASKWRITE(0XF8000104, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000104, 0x00000001U, 0x00000000U),
+       EMIT_MASKPOLL(0XF800010C, 0x00000002U),
+       EMIT_MASKWRITE(0XF8000104, 0x00000010U, 0x00000000U),
+       EMIT_MASKWRITE(0XF8000124, 0xFFF00003U, 0x0C200003U),
+       EMIT_MASKWRITE(0XF8000118, 0x003FFFF0U, 0x00113220U),
+       EMIT_MASKWRITE(0XF8000108, 0x0007F000U, 0x00024000U),
+       EMIT_MASKWRITE(0XF8000108, 0x00000010U, 0x00000010U),
+       EMIT_MASKWRITE(0XF8000108, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000108, 0x00000001U, 0x00000000U),
+       EMIT_MASKPOLL(0XF800010C, 0x00000004U),
+       EMIT_MASKWRITE(0XF8000108, 0x00000010U, 0x00000000U),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_clock_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000128, 0x03F03F01U, 0x00302301U),
+       EMIT_MASKWRITE(0XF8000138, 0x00000011U, 0x00000011U),
+       EMIT_MASKWRITE(0XF800013C, 0x00000011U, 0x00000011U),
+       EMIT_MASKWRITE(0XF8000140, 0x03F03F71U, 0x00100141U),
+       EMIT_MASKWRITE(0XF8000144, 0x03F03F71U, 0x00100141U),
+       EMIT_MASKWRITE(0XF8000148, 0x00003F31U, 0x00000C01U),
+       EMIT_MASKWRITE(0XF800014C, 0x00003F31U, 0x00000601U),
+       EMIT_MASKWRITE(0XF8000150, 0x00003F33U, 0x00001803U),
+       EMIT_MASKWRITE(0XF8000154, 0x00003F33U, 0x00000C03U),
+       EMIT_MASKWRITE(0XF8000158, 0x00003F33U, 0x00000601U),
+       EMIT_MASKWRITE(0XF8000168, 0x00003F31U, 0x00000601U),
+       EMIT_MASKWRITE(0XF8000170, 0x03F03F30U, 0x00100C00U),
+       EMIT_MASKWRITE(0XF8000180, 0x03F03F30U, 0x00100C00U),
+       EMIT_MASKWRITE(0XF8000190, 0x03F03F30U, 0x00100600U),
+       EMIT_MASKWRITE(0XF80001A0, 0x03F03F30U, 0x00101800U),
+       EMIT_MASKWRITE(0XF80001C4, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF800012C, 0x01FFCCCDU, 0x01FC4C4DU),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_ddr_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8006000, 0x0001FFFFU, 0x00000080U),
+       EMIT_MASKWRITE(0XF8006004, 0x0007FFFFU, 0x00001081U),
+       EMIT_MASKWRITE(0XF8006008, 0x03FFFFFFU, 0x03C0780FU),
+       EMIT_MASKWRITE(0XF800600C, 0x03FFFFFFU, 0x02001001U),
+       EMIT_MASKWRITE(0XF8006010, 0x03FFFFFFU, 0x00014001U),
+       EMIT_MASKWRITE(0XF8006014, 0x001FFFFFU, 0x0004281AU),
+       EMIT_MASKWRITE(0XF8006018, 0xF7FFFFFFU, 0x44E458D2U),
+       EMIT_MASKWRITE(0XF800601C, 0xFFFFFFFFU, 0x720238E5U),
+       EMIT_MASKWRITE(0XF8006020, 0x7FDFFFFCU, 0x270872D0U),
+       EMIT_MASKWRITE(0XF8006024, 0x0FFFFFC3U, 0x00000000U),
+       EMIT_MASKWRITE(0XF8006028, 0x00003FFFU, 0x00002007U),
+       EMIT_MASKWRITE(0XF800602C, 0xFFFFFFFFU, 0x00000008U),
+       EMIT_MASKWRITE(0XF8006030, 0xFFFFFFFFU, 0x00040930U),
+       EMIT_MASKWRITE(0XF8006034, 0x13FF3FFFU, 0x000116D4U),
+       EMIT_MASKWRITE(0XF8006038, 0x00000003U, 0x00000000U),
+       EMIT_MASKWRITE(0XF800603C, 0x000FFFFFU, 0x00000777U),
+       EMIT_MASKWRITE(0XF8006040, 0xFFFFFFFFU, 0xFFF00000U),
+       EMIT_MASKWRITE(0XF8006044, 0x0FFFFFFFU, 0x0F666666U),
+       EMIT_MASKWRITE(0XF8006048, 0x0003F03FU, 0x0003C008U),
+       EMIT_MASKWRITE(0XF8006050, 0xFF0F8FFFU, 0x77010800U),
+       EMIT_MASKWRITE(0XF8006058, 0x00010000U, 0x00000000U),
+       EMIT_MASKWRITE(0XF800605C, 0x0000FFFFU, 0x00005003U),
+       EMIT_MASKWRITE(0XF8006060, 0x000017FFU, 0x0000003EU),
+       EMIT_MASKWRITE(0XF8006064, 0x00021FE0U, 0x00020000U),
+       EMIT_MASKWRITE(0XF8006068, 0x03FFFFFFU, 0x00284141U),
+       EMIT_MASKWRITE(0XF800606C, 0x0000FFFFU, 0x00001610U),
+       EMIT_MASKWRITE(0XF8006078, 0x03FFFFFFU, 0x00466111U),
+       EMIT_MASKWRITE(0XF800607C, 0x000FFFFFU, 0x00032222U),
+       EMIT_MASKWRITE(0XF80060A4, 0xFFFFFFFFU, 0x10200802U),
+       EMIT_MASKWRITE(0XF80060A8, 0x0FFFFFFFU, 0x0690CB73U),
+       EMIT_MASKWRITE(0XF80060AC, 0x000001FFU, 0x000001FEU),
+       EMIT_MASKWRITE(0XF80060B0, 0x1FFFFFFFU, 0x1CFFFFFFU),
+       EMIT_MASKWRITE(0XF80060B4, 0x00000200U, 0x00000200U),
+       EMIT_MASKWRITE(0XF80060B8, 0x01FFFFFFU, 0x00200066U),
+       EMIT_MASKWRITE(0XF80060C4, 0x00000003U, 0x00000003U),
+       EMIT_MASKWRITE(0XF80060C4, 0x00000003U, 0x00000000U),
+       EMIT_MASKWRITE(0XF80060C8, 0x000000FFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF80060DC, 0x00000001U, 0x00000000U),
+       EMIT_MASKWRITE(0XF80060F0, 0x0000FFFFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF80060F4, 0x0000000FU, 0x00000008U),
+       EMIT_MASKWRITE(0XF8006114, 0x000000FFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF8006118, 0x7FFFFFCFU, 0x40000001U),
+       EMIT_MASKWRITE(0XF800611C, 0x7FFFFFCFU, 0x40000001U),
+       EMIT_MASKWRITE(0XF8006120, 0x7FFFFFCFU, 0x40000001U),
+       EMIT_MASKWRITE(0XF8006124, 0x7FFFFFCFU, 0x40000001U),
+       EMIT_MASKWRITE(0XF800612C, 0x000FFFFFU, 0x00025010U),
+       EMIT_MASKWRITE(0XF8006130, 0x000FFFFFU, 0x00026400U),
+       EMIT_MASKWRITE(0XF8006134, 0x000FFFFFU, 0x00029418U),
+       EMIT_MASKWRITE(0XF8006138, 0x000FFFFFU, 0x00027820U),
+       EMIT_MASKWRITE(0XF8006140, 0x000FFFFFU, 0x00000035U),
+       EMIT_MASKWRITE(0XF8006144, 0x000FFFFFU, 0x00000035U),
+       EMIT_MASKWRITE(0XF8006148, 0x000FFFFFU, 0x00000035U),
+       EMIT_MASKWRITE(0XF800614C, 0x000FFFFFU, 0x00000035U),
+       EMIT_MASKWRITE(0XF8006154, 0x000FFFFFU, 0x00000090U),
+       EMIT_MASKWRITE(0XF8006158, 0x000FFFFFU, 0x00000080U),
+       EMIT_MASKWRITE(0XF800615C, 0x000FFFFFU, 0x00000098U),
+       EMIT_MASKWRITE(0XF8006160, 0x000FFFFFU, 0x000000A0U),
+       EMIT_MASKWRITE(0XF8006168, 0x001FFFFFU, 0x000000E9U),
+       EMIT_MASKWRITE(0XF800616C, 0x001FFFFFU, 0x000000EEU),
+       EMIT_MASKWRITE(0XF8006170, 0x001FFFFFU, 0x000000FAU),
+       EMIT_MASKWRITE(0XF8006174, 0x001FFFFFU, 0x000000F3U),
+       EMIT_MASKWRITE(0XF800617C, 0x000FFFFFU, 0x000000D0U),
+       EMIT_MASKWRITE(0XF8006180, 0x000FFFFFU, 0x000000C0U),
+       EMIT_MASKWRITE(0XF8006184, 0x000FFFFFU, 0x000000D8U),
+       EMIT_MASKWRITE(0XF8006188, 0x000FFFFFU, 0x000000E0U),
+       EMIT_MASKWRITE(0XF8006190, 0x6FFFFEFEU, 0x00040080U),
+       EMIT_MASKWRITE(0XF8006194, 0x000FFFFFU, 0x0001FC82U),
+       EMIT_MASKWRITE(0XF8006204, 0xFFFFFFFFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF8006208, 0x000703FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF800620C, 0x000703FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006210, 0x000703FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006214, 0x000703FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006218, 0x000F03FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF800621C, 0x000F03FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006220, 0x000F03FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF8006224, 0x000F03FFU, 0x000003FFU),
+       EMIT_MASKWRITE(0XF80062A8, 0x00000FF5U, 0x00000000U),
+       EMIT_MASKWRITE(0XF80062AC, 0xFFFFFFFFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF80062B0, 0x003FFFFFU, 0x00005125U),
+       EMIT_MASKWRITE(0XF80062B4, 0x0003FFFFU, 0x000012A8U),
+       EMIT_MASKPOLL(0XF8000B74, 0x00002000U),
+       EMIT_MASKWRITE(0XF8006000, 0x0001FFFFU, 0x00000081U),
+       EMIT_MASKPOLL(0XF8006054, 0x00000007U),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_mio_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000B40, 0x00000FFFU, 0x00000600U),
+       EMIT_MASKWRITE(0XF8000B44, 0x00000FFFU, 0x00000600U),
+       EMIT_MASKWRITE(0XF8000B48, 0x00000FFFU, 0x00000672U),
+       EMIT_MASKWRITE(0XF8000B4C, 0x00000FFFU, 0x00000672U),
+       EMIT_MASKWRITE(0XF8000B50, 0x00000FFFU, 0x00000674U),
+       EMIT_MASKWRITE(0XF8000B54, 0x00000FFFU, 0x00000674U),
+       EMIT_MASKWRITE(0XF8000B58, 0x00000FFFU, 0x00000600U),
+       EMIT_MASKWRITE(0XF8000B5C, 0xFFFFFFFFU, 0x0018C61CU),
+       EMIT_MASKWRITE(0XF8000B60, 0xFFFFFFFFU, 0x00F9861CU),
+       EMIT_MASKWRITE(0XF8000B64, 0xFFFFFFFFU, 0x00F9861CU),
+       EMIT_MASKWRITE(0XF8000B68, 0xFFFFFFFFU, 0x00F9861CU),
+       EMIT_MASKWRITE(0XF8000B6C, 0x00007FFFU, 0x00000E60U),
+       EMIT_MASKWRITE(0XF8000B70, 0x00000001U, 0x00000001U),
+       EMIT_MASKWRITE(0XF8000B70, 0x00000021U, 0x00000020U),
+       EMIT_MASKWRITE(0XF8000B70, 0x07FEFFFFU, 0x00000823U),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_peripherals_init_data_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000B48, 0x00000180U, 0x00000180U),
+       EMIT_MASKWRITE(0XF8000B4C, 0x00000180U, 0x00000180U),
+       EMIT_MASKWRITE(0XF8000B50, 0x00000180U, 0x00000180U),
+       EMIT_MASKWRITE(0XF8000B54, 0x00000180U, 0x00000180U),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_MASKWRITE(0XE0001034, 0x000000FFU, 0x00000006U),
+       EMIT_MASKWRITE(0XE0001018, 0x0000FFFFU, 0x0000007CU),
+       EMIT_MASKWRITE(0XE0001000, 0x000001FFU, 0x00000017U),
+       EMIT_MASKWRITE(0XE0001004, 0x000003FFU, 0x00000020U),
+       EMIT_MASKWRITE(0XE0000034, 0x000000FFU, 0x00000006U),
+       EMIT_MASKWRITE(0XE0000018, 0x0000FFFFU, 0x0000007CU),
+       EMIT_MASKWRITE(0XE0000000, 0x000001FFU, 0x00000017U),
+       EMIT_MASKWRITE(0XE0000004, 0x000003FFU, 0x00000020U),
+       EMIT_MASKWRITE(0XE000D000, 0x000800FFU, 0x000800C1U),
+       EMIT_MASKWRITE(0XF8007000, 0x20000000U, 0x00000000U),
+       EMIT_MASKDELAY(0XF8F00200, 1),
+       EMIT_MASKWRITE(0XE000A244, 0x003FFFFFU, 0x00004000U),
+       EMIT_MASKWRITE(0XE000A008, 0xFFFFFFFFU, 0xBFFF4000U),
+       EMIT_MASKWRITE(0XE000A248, 0x003FFFFFU, 0x00004000U),
+       EMIT_MASKWRITE(0XE000A008, 0xFFFFFFFFU, 0xBFFF0000U),
+       EMIT_MASKDELAY(0XF8F00200, 1),
+       EMIT_MASKWRITE(0XE000A008, 0xFFFFFFFFU, 0xBFFF4000U),
+       EMIT_MASKDELAY(0XF8F00200, 1),
+       EMIT_MASKDELAY(0XF8F00200, 1),
+       EMIT_EXIT(),
+};
+
+static unsigned long ps7_post_config_3_0[] = {
+       EMIT_MASKWRITE(0XF8000008, 0x0000FFFFU, 0x0000DF0DU),
+       EMIT_MASKWRITE(0XF8000900, 0x0000000FU, 0x0000000FU),
+       EMIT_MASKWRITE(0XF8000240, 0xFFFFFFFFU, 0x00000000U),
+       EMIT_MASKWRITE(0XF8000004, 0x0000FFFFU, 0x0000767BU),
+       EMIT_EXIT(),
+};
+
+int ps7_init(void)
+{
+       int ret;
+
+       ret = ps7_config(ps7_mio_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+       ret = ps7_config(ps7_pll_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+       ret = ps7_config(ps7_clock_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+       ret = ps7_config(ps7_ddr_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+       ret = ps7_config(ps7_peripherals_init_data_3_0);
+       if (ret != PS7_INIT_SUCCESS)
+               return ret;
+
+       return PS7_INIT_SUCCESS;
+}
+
+int ps7_post_config(void)
+{
+       return ps7_config(ps7_post_config_3_0);
+}
diff --git a/board/topic/zynq/zynq-topic-miamiplus/ps7_regs.txt b/board/topic/zynq/zynq-topic-miamiplus/ps7_regs.txt
new file mode 100644 (file)
index 0000000..7b102de
--- /dev/null
@@ -0,0 +1,61 @@
+0xF8000120 0x1F000200 // ARM_CLK_CTRL - divisor = 2 (433 MHz)
+0xf8000700 0x1202     // MIO configuration
+0xf8000704 0x1202
+0xf8000708 0x202
+0xf800070c 0x202
+0xf8000710 0x202
+0xf8000714 0x202
+0xf8000718 0x202
+0xf800071c 0x200
+0xf8000720 0x202
+0xf8000724 0x202
+0xf8000728 0x202
+0xf800072c 0x202
+0xf8000730 0x202
+0xf8000734 0x202
+0xf8000738 0x12e1
+0xf800073c 0x12e0
+0xf8000740 0x1202
+0xf8000744 0x1202
+0xf8000748 0x1202
+0xf800074c 0x1202
+0xf8000750 0x1202
+0xf8000754 0x1202
+0xf8000758 0x1203
+0xf800075c 0x1203
+0xf8000760 0x1203
+0xf8000764 0x203
+0xf8000768 0x1203
+0xf800076c 0x203
+0xf8000770 0x304
+0xf8000774 0x305
+0xf8000778 0x304
+0xf800077c 0x305
+0xf8000780 0x304
+0xf8000784 0x304
+0xf8000788 0x304
+0xf800078c 0x304
+0xf8000790 0x305
+0xf8000794 0x304
+0xf8000798 0x304
+0xf800079c 0x304
+0xf80007a0 0x380
+0xf80007a4 0x380
+0xf80007a8 0x380
+0xf80007ac 0x380
+0xf80007b0 0x380
+0xf80007b4 0x380
+0xf80007b8 0x1200
+0xf80007bc 0x1201
+0xf80007c0 0x1240
+0xf80007c4 0x1240
+0xf80007c8 0x1240
+0xf80007cc 0x1240
+0xf80007d0 0x1280
+0xf80007d4 0x1280
+0xf8000830 0x2f0037
+0xf8000834 0x3a0039
+0xF800014C 0x00000621 // LQSPI_CLK_CTRL - ARMPLL/6
+0xE000D000 0x800238C1 // QSPI config - divide-by-2
+0xE000D038 0x00000020 // QSPI loopback - internal, 0 delay
+0xE000D0A0 0xE2FF06EB // LQSPI_CFG - Quad read, dual flash
index f1dcda592752f55d27045d34b0ef2666c75453a6..16224daa1208237d31f1d0562e8052ba0f2fb602 100644 (file)
@@ -9,4 +9,22 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
        default "apalis_t30"
 
+config TDX_CFG_BLOCK
+       default y
+
+config TDX_HAVE_MMC
+       default y
+
+config TDX_CFG_BLOCK_DEV
+       default "0"
+
+config TDX_CFG_BLOCK_PART
+       default "1"
+
+# Toradex config block in eMMC, at the end of 1st "boot sector"
+config TDX_CFG_BLOCK_OFFSET
+       default "-512"
+
+source "board/toradex/common/Kconfig"
+
 endif
index 3f56971a13b15416549bdfbdd8d380f61d77476d..3d834910706da8e57942f82706f0060ff5b244a4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  (C) Copyright 2014
+ *  (C) Copyright 2014-2016
  *  Marcel Ziswiler <marcel@ziswiler.com>
  *
  * SPDX-License-Identifier:    GPL-2.0+
@@ -17,6 +17,8 @@
 
 #include "pinmux-config-apalis_t30.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define PMU_I2C_ADDRESS                0x2D
 #define MAX_I2C_RETRY          3
 
@@ -29,6 +31,14 @@ int arch_misc_init(void)
        return 0;
 }
 
+int checkboard(void)
+{
+       printf("Model: Toradex Apalis T30 %dGB\n",
+              (gd->ram_size == 0x40000000) ? 1 : 2);
+
+       return 0;
+}
+
 /*
  * Routine: pinmux_init
  * Description: Do individual peripheral pinmux configs
index 7bba26b90dda8405df6b3e6f44a46605da85327f..414a600eefbaffe007c9c4df020054274099166a 100644 (file)
@@ -16,5 +16,21 @@ config COLIBRI_IMX7_EXT_PHYCLK
          clock source.
        default y
 
+config TDX_CFG_BLOCK
+       default y
+
+config TDX_HAVE_NAND
+       default y
+
+config TDX_CFG_BLOCK_OFFSET
+       default "2048"
+
+config TDX_CFG_BLOCK_OFFSET2
+       default "133120"
+
+config TDX_CFG_BLOCK_2ND_ETHADDR
+       default y
+
+source "board/toradex/common/Kconfig"
 
 endif
index 949407a0423e029cb479dedc3f325f37176685d3..f646baa3f05480c16dfbf3c412b72f75482b89f8 100644 (file)
@@ -9,4 +9,15 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
        default "colibri_pxa270"
 
+config TDX_CFG_BLOCK
+       default y
+
+config TDX_HAVE_NOR
+       default y
+
+config TDX_CFG_BLOCK_OFFSET
+       default "262144"
+
+source "board/toradex/common/Kconfig"
+
 endif
index 3def0a6fd0709533beafcea38b44a50a4761bf75..932b90014ba147910ab9e23ebe9d582f325fe08b 100644 (file)
@@ -2,16 +2,20 @@
  * Toradex Colibri PXA270 Support
  *
  * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
+ * Copyright (C) 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <asm/arch/hardware.h>
-#include <asm/arch/regs-mmc.h>
 #include <asm/arch/pxa.h>
-#include <netdev.h>
+#include <asm/arch/regs-mmc.h>
+#include <asm/arch/regs-uart.h>
 #include <asm/io.h>
+#include <dm/platdata.h>
+#include <dm/platform_data/serial_pxa.h>
+#include <netdev.h>
 #include <serial.h>
 #include <usb.h>
 
@@ -32,6 +36,13 @@ int board_init(void)
        return 0;
 }
 
+int checkboard(void)
+{
+       puts("Model: Toradex Colibri PXA270\n");
+
+       return 0;
+}
+
 int dram_init(void)
 {
        pxa2xx_dram_init();
@@ -105,3 +116,14 @@ int board_mmc_init(bd_t *bis)
        return 0;
 }
 #endif
+
+static const struct pxa_serial_platdata serial_platdata = {
+       .base = (struct pxa_uart_regs *)FFUART_BASE,
+       .port = FFUART_INDEX,
+       .baudrate = CONFIG_BAUDRATE,
+};
+
+U_BOOT_DEVICE(pxa_serials) = {
+       .name = "serial_pxa",
+       .platdata = &serial_platdata,
+};
index 7f373b2d26b4a66c83ca447b99515d176c868fa7..a43acddb801d2afe840dfa72ae520d20f816bfb1 100644 (file)
@@ -9,4 +9,15 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
        default "colibri_t20"
 
+config TDX_CFG_BLOCK
+       default y
+
+config TDX_HAVE_NAND
+       default y
+
+config TDX_CFG_BLOCK_OFFSET
+       default "3145728"
+
+source "board/toradex/common/Kconfig"
+
 endif
index 68fbf4957981ab72a33a9ae67ae1bbbac0970562..01b55be763da4167c2986f88b30e6d69279cb549 100644 (file)
@@ -14,6 +14,9 @@
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <i2c.h>
+#include <nand.h>
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #define PMU_I2C_ADDRESS                0x34
 #define MAX_I2C_RETRY          3
@@ -61,6 +64,16 @@ int arch_misc_init(void)
        return 0;
 }
 
+int checkboard(void)
+{
+       printf("Model: Toradex Colibri T20 %dMB V%s\n",
+              (gd->ram_size == 0x10000000) ? 256 : 512,
+              (nand_info[0]->erasesize >> 10 == 512) ?
+              ((gd->ram_size == 0x10000000) ? "1.1B" : "1.1C") : "1.2A");
+
+       return 0;
+}
+
 #ifdef CONFIG_TEGRA_MMC
 /*
  * Routine: pin_mux_mmc
index 3e436a2d3fd3dd923fc51c749db537703e367368..68ef82b099d8771f4caf21dcec5facd5e11b8b16 100644 (file)
@@ -9,4 +9,22 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
        default "colibri_t30"
 
+config TDX_CFG_BLOCK
+       default y
+
+config TDX_HAVE_MMC
+       default y
+
+config TDX_CFG_BLOCK_DEV
+       default "0"
+
+config TDX_CFG_BLOCK_PART
+       default "1"
+
+# Toradex config block in eMMC, at the end of 1st "boot sector"
+config TDX_CFG_BLOCK_OFFSET
+       default "-512"
+
+source "board/toradex/common/Kconfig"
+
 endif
index e32362a93a6304f12f7b499589b118656326bccc..707d07e2dfcfd725a1267c5f42f5300410e58ae1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  (C) Copyright 2014
+ *  (C) Copyright 2014-2016
  *  Stefan Agner <stefan@agner.ch>
  *
  * SPDX-License-Identifier:    GPL-2.0+
@@ -24,6 +24,13 @@ int arch_misc_init(void)
        return 0;
 }
 
+int checkboard(void)
+{
+       puts("Model: Toradex Colibri T30 1GB\n");
+
+       return 0;
+}
+
 /*
  * Routine: pinmux_init
  * Description: Do individual peripheral pinmux configs
index 2c3cb307fd2ca8fae9a2817adc7b0cb66563df25..bf9bb0146e5a0749bad1aa04d1ec83bb72389b2c 100644 (file)
@@ -15,4 +15,18 @@ config SYS_SOC
 config SYS_CONFIG_NAME
        default "colibri_vf"
 
+config TDX_CFG_BLOCK
+       default y
+
+config TDX_HAVE_NAND
+       default y
+
+config TDX_CFG_BLOCK_OFFSET
+       default "2048"
+
+config TDX_CFG_BLOCK_2ND_ETHADDR
+       default y
+
+source "board/toradex/common/Kconfig"
+
 endif
index c65ccb3fd764c21111e991e3fe8968f0690150e3..e65d9c35580326f4c3ebc30586f680ee8ada117b 100644 (file)
@@ -528,22 +528,6 @@ int checkboard(void)
        return 0;
 }
 
-int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
-{
-       unsigned short usb_pid;
-
-       put_unaligned(CONFIG_TRDX_VID, &dev->idVendor);
-
-       if (is_colibri_vf61())
-               usb_pid = CONFIG_TRDX_PID_COLIBRI_VF61IT;
-       else
-               usb_pid = CONFIG_TRDX_PID_COLIBRI_VF50IT;
-
-       put_unaligned(usb_pid, &dev->idProduct);
-
-       return 0;
-}
-
 #ifdef CONFIG_USB_EHCI_VF
 int board_ehci_hcd_init(int port)
 {
diff --git a/board/toradex/common/Kconfig b/board/toradex/common/Kconfig
new file mode 100644 (file)
index 0000000..b33baef
--- /dev/null
@@ -0,0 +1,69 @@
+# Copyright (c) 2016 Toradex, Inc.
+# SPDX-License-Identifier:     GPL-2.0+
+
+menuconfig TDX_CFG_BLOCK
+       bool "Enable Toradex config block support"
+       select OF_BOARD_SETUP
+       help
+         The Toradex config block stored production data on the on-module
+         flash device (NAND, NOR or eMMC). The area is normally preserved by
+         software and contains the serial number (out of which the MAC
+         address is generated) and the exact module type.
+
+# Helper config to determine the correct default location of the cfg block
+config TDX_HAVE_MMC
+       bool
+
+config TDX_HAVE_NAND
+       bool
+
+config TDX_HAVE_NOR
+       bool
+
+if TDX_CFG_BLOCK
+
+config TDX_CFG_BLOCK_IS_IN_MMC
+       bool
+       depends on TDX_HAVE_MMC
+       default y
+
+config TDX_CFG_BLOCK_IS_IN_NAND
+       bool
+       depends on TDX_HAVE_NAND
+       default y
+
+config TDX_CFG_BLOCK_IS_IN_NOR
+       bool
+       depends on TDX_HAVE_NOR
+       default y
+
+config TDX_CFG_BLOCK_DEV
+       int "Toradex config block eMMC device ID"
+       depends on TDX_CFG_BLOCK_IS_IN_MMC
+
+config TDX_CFG_BLOCK_PART
+       int "Toradex config block eMMC partition ID"
+       depends on TDX_CFG_BLOCK_IS_IN_MMC
+
+config TDX_CFG_BLOCK_OFFSET
+       int "Toradex config block offset"
+       help
+         Specify the byte offset of the Toradex config block within the flash
+         device the config block is stored on.
+
+config TDX_CFG_BLOCK_OFFSET2
+       int "Toradex config block offset, second instance"
+       default 0
+       help
+         Specify the byte offset of the 2nd instance of the Toradex config block
+         within the flash device the config block is stored on.
+         Set to 0 on modules which have no 2nd instance.
+
+config TDX_CFG_BLOCK_2ND_ETHADDR
+       bool "Set the second Ethernet address"
+       help
+         For each serial number two Ethernet addresses are available for dual
+         Ethernet carrier boards. This options enables the code to set the
+         second Ethernet address as environment variable (eth1addr).
+
+endif
diff --git a/board/toradex/common/Makefile b/board/toradex/common/Makefile
new file mode 100644 (file)
index 0000000..d645f5a
--- /dev/null
@@ -0,0 +1,11 @@
+# Copyright (c) 2016 Toradex, Inc.
+# SPDX-License-Identifier:     GPL-2.0+
+
+# Common for all Toradex modules
+ifeq ($(CONFIG_SPL_BUILD),y)
+# Necessary to create built-in.o
+obj- := __dummy__.o
+else
+obj-$(CONFIG_TDX_CFG_BLOCK) += tdx-cfg-block.o
+obj-y += tdx-common.o
+endif
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
new file mode 100644 (file)
index 0000000..0014ce8
--- /dev/null
@@ -0,0 +1,544 @@
+/*
+ * Copyright (c) 2016 Toradex, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include "tdx-cfg-block.h"
+
+#if defined(CONFIG_TARGET_APALIS_IMX6) || defined(CONFIG_TARGET_COLIBRI_IMX6)
+#include <asm/arch/sys_proto.h>
+#else
+#define is_cpu_type(cpu) (0)
+#endif
+#if defined(CONFIG_CPU_PXA27X)
+#include <asm/arch-pxa/pxa.h>
+#else
+#define cpu_is_pxa27x(cpu) (0)
+#endif
+#include <cli.h>
+#include <console.h>
+#include <flash.h>
+#include <malloc.h>
+#include <mmc.h>
+#include <nand.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define TAG_VALID      0xcf01
+#define TAG_MAC                0x0000
+#define TAG_HW         0x0008
+#define TAG_INVALID    0xffff
+
+#define TAG_FLAG_VALID 0x1
+
+#if defined(CONFIG_TDX_CFG_BLOCK_IS_IN_MMC)
+#define TDX_CFG_BLOCK_MAX_SIZE 512
+#elif defined(CONFIG_TDX_CFG_BLOCK_IS_IN_NAND)
+#define TDX_CFG_BLOCK_MAX_SIZE 64
+#elif defined(CONFIG_TDX_CFG_BLOCK_IS_IN_NOR)
+#define TDX_CFG_BLOCK_MAX_SIZE 64
+#else
+#error Toradex config block location not set
+#endif
+
+struct toradex_tag {
+       u32 len:14;
+       u32 flags:2;
+       u32 id:16;
+};
+
+bool valid_cfgblock;
+struct toradex_hw tdx_hw_tag;
+struct toradex_eth_addr tdx_eth_addr;
+u32 tdx_serial;
+
+const char * const toradex_modules[] = {
+        [0] = "UNKNOWN MODULE",
+        [1] = "Colibri PXA270 312MHz",
+        [2] = "Colibri PXA270 520MHz",
+        [3] = "Colibri PXA320 806MHz",
+        [4] = "Colibri PXA300 208MHz",
+        [5] = "Colibri PXA310 624MHz",
+        [6] = "Colibri PXA320 806MHz IT",
+        [7] = "Colibri PXA300 208MHz XT",
+        [8] = "Colibri PXA270 312MHz",
+        [9] = "Colibri PXA270 520MHz",
+       [10] = "Colibri VF50 128MB", /* not currently on sale */
+       [11] = "Colibri VF61 256MB",
+       [12] = "Colibri VF61 256MB IT",
+       [13] = "Colibri VF50 128MB IT",
+       [14] = "Colibri iMX6 Solo 256MB",
+       [15] = "Colibri iMX6 DualLite 512MB",
+       [16] = "Colibri iMX6 Solo 256MB IT",
+       [17] = "Colibri iMX6 DualLite 512MB IT",
+       [18] = "UNKNOWN MODULE",
+       [19] = "UNKNOWN MODULE",
+       [20] = "Colibri T20 256MB",
+       [21] = "Colibri T20 512MB",
+       [22] = "Colibri T20 512MB IT",
+       [23] = "Colibri T30 1GB",
+       [24] = "Colibri T20 256MB IT",
+       [25] = "Apalis T30 2GB",
+       [26] = "Apalis T30 1GB",
+       [27] = "Apalis iMX6 Quad 1GB",
+       [28] = "Apalis iMX6 Quad 2GB IT",
+       [29] = "Apalis iMX6 Dual 512MB",
+       [30] = "Colibri T30 1GB IT",
+       [31] = "Apalis T30 1GB IT",
+       [32] = "Colibri iMX7 Solo 256MB",
+       [33] = "Colibri iMX7 Dual 512MB",
+       [34] = "Apalis TK1 2GB",
+       [35] = "Apalis iMX6 Dual 1GB IT",
+};
+
+#ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC
+static int tdx_cfg_block_mmc_storage(u8 *config_block, int write)
+{
+       struct mmc *mmc;
+       int dev = CONFIG_TDX_CFG_BLOCK_DEV;
+       int offset = CONFIG_TDX_CFG_BLOCK_OFFSET;
+       uint part = CONFIG_TDX_CFG_BLOCK_PART;
+       uint blk_start;
+       int ret = 0;
+
+       /* Read production parameter config block from eMMC */
+       mmc = find_mmc_device(dev);
+       if (!mmc) {
+               puts("No MMC card found\n");
+               ret = -ENODEV;
+               goto out;
+       }
+       if (part != mmc->block_dev.hwpart) {
+               if (blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part)) {
+                       puts("MMC partition switch failed\n");
+                       ret = -ENODEV;
+                       goto out;
+               }
+       }
+       if (offset < 0)
+               offset += mmc->capacity;
+       blk_start = ALIGN(offset, mmc->write_bl_len) / mmc->write_bl_len;
+
+       if (!write) {
+               /* Careful reads a whole block of 512 bytes into config_block */
+               if (blk_dread(mmc_get_blk_desc(mmc), blk_start, 1,
+                             (unsigned char *)config_block) != 1) {
+                       ret = -EIO;
+                       goto out;
+               }
+               /* Flush cache after read */
+               flush_cache((ulong)(unsigned char *)config_block, 512);
+       } else {
+               /* Just writing one 512 byte block */
+               if (blk_dwrite(mmc_get_blk_desc(mmc), blk_start, 1,
+                              (unsigned char *)config_block) != 1) {
+                       ret = -EIO;
+                       goto out;
+               }
+       }
+
+out:
+       /* Switch back to regular eMMC user partition */
+       blk_select_hwpart_devnum(IF_TYPE_MMC, 0, 0);
+
+       return ret;
+}
+#endif
+
+#ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_NAND
+static int read_tdx_cfg_block_from_nand(unsigned char *config_block)
+{
+       size_t size = TDX_CFG_BLOCK_MAX_SIZE;
+
+       /* Read production parameter config block from NAND page */
+       return nand_read_skip_bad(nand_info[0], CONFIG_TDX_CFG_BLOCK_OFFSET,
+                        &size, NULL, TDX_CFG_BLOCK_MAX_SIZE, config_block);
+}
+
+static int write_tdx_cfg_block_to_nand(unsigned char *config_block)
+{
+       size_t size = TDX_CFG_BLOCK_MAX_SIZE;
+
+       /* Write production parameter config block to NAND page */
+       return nand_write_skip_bad(nand_info[0], CONFIG_TDX_CFG_BLOCK_OFFSET,
+                                  &size, NULL, TDX_CFG_BLOCK_MAX_SIZE,
+                                  config_block, WITH_WR_VERIFY);
+}
+#endif
+
+#ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_NOR
+static int read_tdx_cfg_block_from_nor(unsigned char *config_block)
+{
+       /* Read production parameter config block from NOR flash */
+       memcpy(config_block, (void *)CONFIG_TDX_CFG_BLOCK_OFFSET,
+              TDX_CFG_BLOCK_MAX_SIZE);
+       return 0;
+}
+
+static int write_tdx_cfg_block_to_nor(unsigned char *config_block)
+{
+       /* Write production parameter config block to NOR flash */
+       return flash_write((void *)config_block, CONFIG_TDX_CFG_BLOCK_OFFSET,
+                          TDX_CFG_BLOCK_MAX_SIZE);
+}
+#endif
+
+int read_tdx_cfg_block(void)
+{
+       int ret = 0;
+       u8 *config_block = NULL;
+       struct toradex_tag *tag;
+       size_t size = TDX_CFG_BLOCK_MAX_SIZE;
+       int offset;
+
+       /* Allocate RAM area for config block */
+       config_block = memalign(ARCH_DMA_MINALIGN, size);
+       if (!config_block) {
+               printf("Not enough malloc space available!\n");
+               return -ENOMEM;
+       }
+
+       memset(config_block, 0, size);
+
+#if defined(CONFIG_TDX_CFG_BLOCK_IS_IN_MMC)
+       ret = tdx_cfg_block_mmc_storage(config_block, 0);
+#elif defined(CONFIG_TDX_CFG_BLOCK_IS_IN_NAND)
+       ret = read_tdx_cfg_block_from_nand(config_block);
+#elif defined(CONFIG_TDX_CFG_BLOCK_IS_IN_NOR)
+       ret = read_tdx_cfg_block_from_nor(config_block);
+#else
+       ret = -EINVAL;
+#endif
+       if (ret)
+               goto out;
+
+       /* Expect a valid tag first */
+       tag = (struct toradex_tag *)config_block;
+       if (tag->flags != TAG_FLAG_VALID || tag->id != TAG_VALID) {
+               valid_cfgblock = false;
+               ret = -EINVAL;
+               goto out;
+       }
+       valid_cfgblock = true;
+       offset = 4;
+
+       while (offset < TDX_CFG_BLOCK_MAX_SIZE) {
+               tag = (struct toradex_tag *)(config_block + offset);
+               offset += 4;
+               if (tag->id == TAG_INVALID)
+                       break;
+
+               if (tag->flags == TAG_FLAG_VALID) {
+                       switch (tag->id) {
+                       case TAG_MAC:
+                               memcpy(&tdx_eth_addr, config_block + offset,
+                                      6);
+
+                               /* NIC part of MAC address is serial number */
+                               tdx_serial = ntohl(tdx_eth_addr.nic) >> 8;
+                               break;
+                       case TAG_HW:
+                               memcpy(&tdx_hw_tag, config_block + offset, 8);
+                               break;
+                       }
+               }
+
+               /* Get to next tag according to current tags length */
+               offset += tag->len * 4;
+       }
+
+       /* Cap product id to avoid issues with a yet unknown one */
+       if (tdx_hw_tag.prodid > (sizeof(toradex_modules) /
+                                 sizeof(toradex_modules[0])))
+               tdx_hw_tag.prodid = 0;
+
+out:
+       free(config_block);
+       return ret;
+}
+
+static int get_cfgblock_interactive(void)
+{
+       char message[CONFIG_SYS_CBSIZE];
+       char *soc;
+       char it = 'n';
+       int len;
+
+       if (cpu_is_pxa27x())
+               sprintf(message, "Is the module the 312 MHz version? [y/N] ");
+       else
+               sprintf(message, "Is the module an IT version? [y/N] ");
+
+       len = cli_readline(message);
+       it = console_buffer[0];
+
+       soc = getenv("soc");
+       if (!strcmp("mx6", soc)) {
+#ifdef CONFIG_MACH_TYPE
+               if (it == 'y' || it == 'Y')
+                       if (is_cpu_type(MXC_CPU_MX6Q))
+                               tdx_hw_tag.prodid = APALIS_IMX6Q_IT;
+                       else
+                               tdx_hw_tag.prodid = APALIS_IMX6D_IT;
+               else
+                       if (is_cpu_type(MXC_CPU_MX6Q))
+                               tdx_hw_tag.prodid = APALIS_IMX6Q;
+                       else
+                               tdx_hw_tag.prodid = APALIS_IMX6D;
+#else
+               if (it == 'y' || it == 'Y')
+                       if (is_cpu_type(MXC_CPU_MX6DL))
+                               tdx_hw_tag.prodid = COLIBRI_IMX6DL_IT;
+                       else
+                               tdx_hw_tag.prodid = COLIBRI_IMX6S_IT;
+               else
+                       if (is_cpu_type(MXC_CPU_MX6DL))
+                               tdx_hw_tag.prodid = COLIBRI_IMX6DL;
+                       else
+                               tdx_hw_tag.prodid = COLIBRI_IMX6S;
+#endif /* CONFIG_MACH_TYPE */
+       } else if (!strcmp("imx7d", soc)) {
+               tdx_hw_tag.prodid = COLIBRI_IMX7D;
+       } else if (!strcmp("imx7s", soc)) {
+               tdx_hw_tag.prodid = COLIBRI_IMX7S;
+       } else if (!strcmp("tegra20", soc)) {
+               if (it == 'y' || it == 'Y')
+                       if (gd->ram_size == 0x10000000)
+                               tdx_hw_tag.prodid = COLIBRI_T20_256MB_IT;
+                       else
+                               tdx_hw_tag.prodid = COLIBRI_T20_512MB_IT;
+               else
+                       if (gd->ram_size == 0x10000000)
+                               tdx_hw_tag.prodid = COLIBRI_T20_256MB;
+                       else
+                               tdx_hw_tag.prodid = COLIBRI_T20_512MB;
+       } else if (cpu_is_pxa27x()) {
+               if (it == 'y' || it == 'Y')
+                       tdx_hw_tag.prodid = COLIBRI_PXA270_312MHZ;
+               else
+                       tdx_hw_tag.prodid = COLIBRI_PXA270_520MHZ;
+#ifdef CONFIG_MACH_TYPE
+       } else if (!strcmp("tegra30", soc)) {
+               if (CONFIG_MACH_TYPE == MACH_TYPE_APALIS_T30) {
+                       if (it == 'y' || it == 'Y')
+                               tdx_hw_tag.prodid = APALIS_T30_IT;
+                       else
+                               if (gd->ram_size == 0x40000000)
+                                       tdx_hw_tag.prodid = APALIS_T30_1GB;
+                               else
+                                       tdx_hw_tag.prodid = APALIS_T30_2GB;
+               } else {
+                       if (it == 'y' || it == 'Y')
+                               tdx_hw_tag.prodid = COLIBRI_T30_IT;
+                       else
+                               tdx_hw_tag.prodid = COLIBRI_T30;
+               }
+#endif /* CONFIG_MACH_TYPE */
+       } else if (!strcmp("tegra124", soc)) {
+               tdx_hw_tag.prodid = APALIS_TK1_2GB;
+       } else if (!strcmp("vf500", soc)) {
+               if (it == 'y' || it == 'Y')
+                       tdx_hw_tag.prodid = COLIBRI_VF50_IT;
+               else
+                       tdx_hw_tag.prodid = COLIBRI_VF50;
+       } else if (!strcmp("vf610", soc)) {
+               if (it == 'y' || it == 'Y')
+                       tdx_hw_tag.prodid = COLIBRI_VF61_IT;
+               else
+                       tdx_hw_tag.prodid = COLIBRI_VF61;
+       } else {
+               printf("Module type not detectable due to unknown SoC\n");
+               return -1;
+       }
+
+       while (len < 4) {
+               sprintf(message, "Enter the module version (e.g. V1.1B): V");
+               len = cli_readline(message);
+       }
+
+       tdx_hw_tag.ver_major = console_buffer[0] - '0';
+       tdx_hw_tag.ver_minor = console_buffer[2] - '0';
+       tdx_hw_tag.ver_assembly = console_buffer[3] - 'A';
+
+       if (cpu_is_pxa27x() && (tdx_hw_tag.ver_major == 1))
+               tdx_hw_tag.prodid -= (COLIBRI_PXA270_312MHZ -
+                                      COLIBRI_PXA270_V1_312MHZ);
+
+       while (len < 8) {
+               sprintf(message, "Enter module serial number: ");
+               len = cli_readline(message);
+       }
+
+       tdx_serial = simple_strtoul(console_buffer, NULL, 10);
+
+       return 0;
+}
+
+static int get_cfgblock_barcode(char *barcode)
+{
+       if (strlen(barcode) < 16) {
+               printf("Argument too short, barcode is 16 chars long\n");
+               return -1;
+       }
+
+       /* Get hardware information from the first 8 digits */
+       tdx_hw_tag.ver_major = barcode[4] - '0';
+       tdx_hw_tag.ver_minor = barcode[5] - '0';
+       tdx_hw_tag.ver_assembly = barcode[7] - '0';
+
+       barcode[4] = '\0';
+       tdx_hw_tag.prodid = simple_strtoul(barcode, NULL, 10);
+
+       /* Parse second part of the barcode (serial number */
+       barcode += 8;
+       tdx_serial = simple_strtoul(barcode, NULL, 10);
+
+       return 0;
+}
+
+static int do_cfgblock_create(cmd_tbl_t *cmdtp, int flag, int argc,
+                             char * const argv[])
+{
+       u8 *config_block;
+       struct toradex_tag *tag;
+       size_t size = TDX_CFG_BLOCK_MAX_SIZE;
+       int offset = 0;
+       int ret = CMD_RET_SUCCESS;
+       int err;
+
+       /* Allocate RAM area for config block */
+       config_block = memalign(ARCH_DMA_MINALIGN, size);
+       if (!config_block) {
+               printf("Not enough malloc space available!\n");
+               return CMD_RET_FAILURE;
+       }
+
+       memset(config_block, 0xff, size);
+
+       read_tdx_cfg_block();
+       if (valid_cfgblock) {
+#if defined(CONFIG_TDX_CFG_BLOCK_IS_IN_NAND)
+               /*
+                * On NAND devices, recreation is only allowed if the page is
+                * empty (config block invalid...)
+                */
+               printf("NAND erase block %d need to be erased before creating a Toradex config block\n",
+                      CONFIG_TDX_CFG_BLOCK_OFFSET / nand_info[0]->erasesize);
+               goto out;
+#elif defined(CONFIG_TDX_CFG_BLOCK_IS_IN_NOR)
+               /*
+                * On NOR devices, recreation is only allowed if the sector is
+                * empty and write protection is off (config block invalid...)
+                */
+               printf("NOR sector at offset 0x%02x need to be erased and unprotected before creating a Toradex config block\n",
+                      CONFIG_TDX_CFG_BLOCK_OFFSET);
+               goto out;
+#else
+               char message[CONFIG_SYS_CBSIZE];
+               sprintf(message,
+                       "A valid Toradex config block is present, still recreate? [y/N] ");
+
+               if (!cli_readline(message))
+                       goto out;
+
+               if (console_buffer[0] != 'y' && console_buffer[0] != 'Y')
+                       goto out;
+#endif
+       }
+
+       /* Parse new Toradex config block data... */
+       if (argc < 3)
+               err = get_cfgblock_interactive();
+       else
+               err = get_cfgblock_barcode(argv[2]);
+
+       if (err) {
+               ret = CMD_RET_FAILURE;
+               goto out;
+       }
+
+       /* Convert serial number to MAC address (the storage format) */
+       tdx_eth_addr.oui = htonl(0x00142dUL << 8);
+       tdx_eth_addr.nic = htonl(tdx_serial << 8);
+
+       /* Valid Tag */
+       tag = (struct toradex_tag *)config_block;
+       tag->id = TAG_VALID;
+       tag->flags = TAG_FLAG_VALID;
+       tag->len = 0;
+       offset += 4;
+
+       /* Product Tag */
+       tag = (struct toradex_tag *)(config_block + offset);
+       tag->id = TAG_HW;
+       tag->flags = TAG_FLAG_VALID;
+       tag->len = 2;
+       offset += 4;
+
+       memcpy(config_block + offset, &tdx_hw_tag, 8);
+       offset += 8;
+
+       /* MAC Tag */
+       tag = (struct toradex_tag *)(config_block + offset);
+       tag->id = TAG_MAC;
+       tag->flags = TAG_FLAG_VALID;
+       tag->len = 2;
+       offset += 4;
+
+       memcpy(config_block + offset, &tdx_eth_addr, 6);
+       offset += 6;
+       memset(config_block + offset, 0, 32 - offset);
+
+#if defined(CONFIG_TDX_CFG_BLOCK_IS_IN_MMC)
+       err = tdx_cfg_block_mmc_storage(config_block, 1);
+#elif defined(CONFIG_TDX_CFG_BLOCK_IS_IN_NAND)
+       err = write_tdx_cfg_block_to_nand(config_block);
+#elif defined(CONFIG_TDX_CFG_BLOCK_IS_IN_NOR)
+       err = write_tdx_cfg_block_to_nor(config_block);
+#else
+       err = -EINVAL;
+#endif
+       if (err) {
+               printf("Failed to write Toradex config block: %d\n", ret);
+               ret = CMD_RET_FAILURE;
+               goto out;
+       }
+
+       printf("Toradex config block successfully written\n");
+
+out:
+       free(config_block);
+       return ret;
+}
+
+static int do_cfgblock(cmd_tbl_t *cmdtp, int flag, int argc,
+                      char * const argv[])
+{
+       int ret;
+
+       if (argc < 2)
+               return CMD_RET_USAGE;
+
+       if (!strcmp(argv[1], "create")) {
+               return do_cfgblock_create(cmdtp, flag, argc, argv);
+       } else if (!strcmp(argv[1], "reload")) {
+               ret = read_tdx_cfg_block();
+               if (ret) {
+                       printf("Failed to reload Toradex config block: %d\n",
+                              ret);
+                       return CMD_RET_FAILURE;
+               }
+               return CMD_RET_SUCCESS;
+       }
+
+       return CMD_RET_USAGE;
+}
+
+U_BOOT_CMD(
+       cfgblock, 3, 0, do_cfgblock,
+       "Toradex config block handling commands",
+       "create [barcode] - (Re-)create Toradex config block\n"
+       "cfgblock reload - Reload Toradex config block from flash"
+);
diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h
new file mode 100644 (file)
index 0000000..fd7c362
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2016 Toradex, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _TDX_CFG_BLOCK_H
+#define _TDX_CFG_BLOCK_H
+
+#include "tdx-common.h"
+
+struct toradex_hw {
+       u16 ver_major;
+       u16 ver_minor;
+       u16 ver_assembly;
+       u16 prodid;
+};
+
+struct toradex_eth_addr {
+       u32 oui:24;
+       u32 nic:24;
+} __attribute__((__packed__));
+
+enum {
+       COLIBRI_PXA270_V1_312MHZ = 1,
+       COLIBRI_PXA270_V1_520MHZ,
+       COLIBRI_PXA320,
+       COLIBRI_PXA300,
+       COLIBRI_PXA310,
+       COLIBRI_PXA320_IT,
+       COLIBRI_PXA300_XT,
+       COLIBRI_PXA270_312MHZ,
+       COLIBRI_PXA270_520MHZ,
+       COLIBRI_VF50, /* not currently on sale */
+       COLIBRI_VF61,
+       COLIBRI_VF61_IT,
+       COLIBRI_VF50_IT,
+       COLIBRI_IMX6S,
+       COLIBRI_IMX6DL,
+       COLIBRI_IMX6S_IT,
+       COLIBRI_IMX6DL_IT,
+       COLIBRI_T20_256MB = 20,
+       COLIBRI_T20_512MB,
+       COLIBRI_T20_512MB_IT,
+       COLIBRI_T30,
+       COLIBRI_T20_256MB_IT,
+       APALIS_T30_2GB,
+       APALIS_T30_1GB,
+       APALIS_IMX6Q,
+       APALIS_IMX6Q_IT,
+       APALIS_IMX6D,
+       COLIBRI_T30_IT,
+       APALIS_T30_IT,
+       COLIBRI_IMX7S,
+       COLIBRI_IMX7D,
+       APALIS_TK1_2GB,
+       APALIS_IMX6D_IT,
+};
+
+extern const char * const toradex_modules[];
+extern bool valid_cfgblock;
+extern struct toradex_hw tdx_hw_tag;
+extern struct toradex_eth_addr tdx_eth_addr;
+extern u32 tdx_serial;
+
+int read_tdx_cfg_block(void);
+
+#endif /* _TDX_CFG_BLOCK_H */
diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c
new file mode 100644 (file)
index 0000000..f1ab794
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2016 Toradex, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <g_dnl.h>
+#include <libfdt.h>
+
+#include "tdx-cfg-block.h"
+#include "tdx-common.h"
+
+#ifdef CONFIG_TDX_CFG_BLOCK
+static char tdx_serial_str[9];
+static char tdx_board_rev_str[6];
+
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+       /* Check validity */
+       if (!tdx_hw_tag.ver_major)
+               return 0;
+
+       return ((tdx_hw_tag.ver_major & 0xff) << 8) |
+               ((tdx_hw_tag.ver_minor & 0xf) << 4) |
+               ((tdx_hw_tag.ver_assembly & 0xf) + 0xa);
+}
+#endif /* CONFIG_TDX_CFG_BLOCK */
+
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+       int array[8];
+       unsigned int serial = tdx_serial;
+       int i;
+
+       serialnr->low = 0;
+       serialnr->high = 0;
+
+       /* Check validity */
+       if (serial) {
+               /*
+                * Convert to Linux serial number format (hexadecimal coded
+                * decimal)
+                */
+               i = 7;
+               while (serial) {
+                       array[i--] = serial % 10;
+                       serial /= 10;
+               }
+               while (i >= 0)
+                       array[i--] = 0;
+               serial = array[0];
+               for (i = 1; i < 8; i++) {
+                       serial *= 16;
+                       serial += array[i];
+               }
+
+               serialnr->low = serial;
+       }
+}
+#endif /* CONFIG_SERIAL_TAG */
+
+int show_board_info(void)
+{
+       unsigned char ethaddr[6];
+
+       if (read_tdx_cfg_block()) {
+               printf("Missing Toradex config block\n");
+               checkboard();
+               return 0;
+       }
+
+       /* board serial-number */
+       sprintf(tdx_serial_str, "%08u", tdx_serial);
+       sprintf(tdx_board_rev_str, "V%1d.%1d%c",
+               tdx_hw_tag.ver_major,
+               tdx_hw_tag.ver_minor,
+               (char)tdx_hw_tag.ver_assembly + 'A');
+
+       setenv("serial#", tdx_serial_str);
+
+       /*
+        * Check if environment contains a valid MAC address,
+        * set the one from config block if not
+        */
+       if (!eth_getenv_enetaddr("ethaddr", ethaddr))
+               eth_setenv_enetaddr("ethaddr", (u8 *)&tdx_eth_addr);
+
+#ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR
+       if (!eth_getenv_enetaddr("eth1addr", ethaddr)) {
+               /*
+                * Secondary MAC address is allocated from block
+                * 0x100000 higher then the first MAC address
+                */
+               memcpy(ethaddr, &tdx_eth_addr, 6);
+               ethaddr[3] += 0x10;
+               eth_setenv_enetaddr("eth1addr", ethaddr);
+       }
+#endif
+
+       printf("Model: Toradex %s %s, Serial# %s\n",
+              toradex_modules[tdx_hw_tag.prodid],
+              tdx_board_rev_str,
+              tdx_serial_str);
+
+       return 0;
+}
+
+#ifdef CONFIG_USBDOWNLOAD_GADGET
+int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
+{
+       unsigned short usb_pid;
+
+       usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + tdx_hw_tag.prodid;
+       put_unaligned(usb_pid, &dev->idProduct);
+
+       return 0;
+}
+#endif /* CONFIG_USBDOWNLOAD_GADGET */
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+       if (tdx_serial) {
+               fdt_setprop(blob, 0, "serial-number", tdx_serial_str,
+                           strlen(tdx_serial_str) + 1);
+       }
+
+       if (tdx_hw_tag.ver_major) {
+               char prod_id[5];
+
+               sprintf(prod_id, "%04u", tdx_hw_tag.prodid);
+               fdt_setprop(blob, 0, "toradex,product-id", prod_id, 5);
+
+               fdt_setprop(blob, 0, "toradex,board-rev", tdx_board_rev_str,
+                           strlen(tdx_board_rev_str) + 1);
+       }
+
+       return 0;
+}
+#endif
+
+#else /* CONFIG_TDX_CFG_BLOCK */
+
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+       return 0;
+}
+#endif /* CONFIG_REVISION_TAG */
+
+#ifdef CONFIG_SERIAL_TAG
+u32 get_board_serial(void)
+{
+       return 0;
+}
+#endif /* CONFIG_SERIAL_TAG */
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+       return 0;
+}
+#endif
+
+#endif /* CONFIG_TDX_CFG_BLOCK */
diff --git a/board/toradex/common/tdx-common.h b/board/toradex/common/tdx-common.h
new file mode 100644 (file)
index 0000000..f308ebd
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2016 Toradex, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _TDX_COMMON_H
+#define _TDX_COMMON_H
+
+#define TORADEX_USB_PRODUCT_NUM_OFFSET 0x4000
+#define TDX_USB_VID                    0x1B67
+
+#endif /* _TDX_COMMON_H */
index 183f642753494d1b9afc96305c77edb99e8a3a7c..2c86940957ec5d021e045d6a34be3c9f133f1a7a 100644 (file)
@@ -19,7 +19,10 @@ DECLARE_GLOBAL_DATA_PTR;
 static xilinx_desc fpga;
 
 /* It can be done differently */
+static xilinx_desc fpga007s = XILINX_XC7Z007S_DESC(0x7);
 static xilinx_desc fpga010 = XILINX_XC7Z010_DESC(0x10);
+static xilinx_desc fpga012s = XILINX_XC7Z012S_DESC(0x12);
+static xilinx_desc fpga014s = XILINX_XC7Z014S_DESC(0x14);
 static xilinx_desc fpga015 = XILINX_XC7Z015_DESC(0x15);
 static xilinx_desc fpga020 = XILINX_XC7Z020_DESC(0x20);
 static xilinx_desc fpga030 = XILINX_XC7Z030_DESC(0x30);
@@ -37,9 +40,18 @@ int board_init(void)
        idcode = zynq_slcr_get_idcode();
 
        switch (idcode) {
+       case XILINX_ZYNQ_7007S:
+               fpga = fpga007s;
+               break;
        case XILINX_ZYNQ_7010:
                fpga = fpga010;
                break;
+       case XILINX_ZYNQ_7012S:
+               fpga = fpga012s;
+               break;
+       case XILINX_ZYNQ_7014S:
+               fpga = fpga014s;
+               break;
        case XILINX_ZYNQ_7015:
                fpga = fpga015;
                break;
index 90f00c650a816a52f55a6d1184d85c3a9da49e52..efc8edaaf6e6d8c31f95ebfb6fa62c737e9e4769 100644 (file)
@@ -27,3 +27,6 @@ CFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes
 
 # To include xil_io.h
 CFLAGS_psu_init_gpl.o := -I$(srctree)/$(src)
+
+# To suppress "warning: cast to pointer from integer of different size"
+CFLAGS_psu_init_gpl.o += -Wno-int-to-pointer-cast
index 57ca4adf11bf42adfbf6911f32de36d1045ec9e2..6bbc000da8283f3b66a7494019e5088c8d36a67a 100644 (file)
@@ -7,6 +7,7 @@
 
 /* FIXME remove this when vivado is fixed */
 #include <asm/io.h>
+#include <common.h>
 
 #define xil_printf(...)
 
@@ -32,4 +33,12 @@ int Xil_In32(unsigned long addr)
        return readl(addr);
 }
 
+void mask_delay(u32 delay);
+void usleep(u32 sleep)
+{
+       udelay(sleep);
+}
+int mask_poll(u32 add, u32 mask);
+int mask_pollOnValue(u32 add, u32 mask, u32 value);
+
 #endif /* XIL_IO_H */
index ba4dfbb4762530d37120905a6ae6d834b60163ca..cef1f6a13aee00adc48b0d0781ad5273fa14c8ba 100644 (file)
@@ -86,6 +86,17 @@ static int chip_id(void)
 
        smc_call(&regs);
 
+       /*
+        * SMC returns:
+        * regs[0][31:0]  = status of the operation
+        * regs[0][63:32] = CSU.IDCODE register
+        * regs[1][31:0]  = CSU.version register
+        */
+       regs.regs[0] = upper_32_bits(regs.regs[0]);
+       regs.regs[0] &= ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK |
+                       ZYNQMP_CSU_IDCODE_SVD_MASK;
+       regs.regs[0] >>= ZYNQMP_CSU_IDCODE_SVD_SHIFT;
+
        return regs.regs[0];
 }
 
@@ -324,6 +335,9 @@ int board_late_init(void)
        }
 
        reg = readl(&crlapb_base->boot_mode);
+       if (reg >> BOOT_MODE_ALT_SHIFT)
+               reg >>= BOOT_MODE_ALT_SHIFT;
+
        bootmode = reg & BOOT_MODES_MASK;
 
        puts("Bootmode: ");
@@ -349,6 +363,9 @@ int board_late_init(void)
                puts("SD_MODE\n");
                mode = "mmc0";
                break;
+       case SD1_LSHFT_MODE:
+               puts("LVL_SHFT_");
+               /* fall through */
        case SD_MODE1:
                puts("SD_MODE1\n");
 #if defined(CONFIG_ZYNQ_SDHCI0) && defined(CONFIG_ZYNQ_SDHCI1)
@@ -411,6 +428,10 @@ int board_usb_init(int index, enum usb_init_type init)
 {
        debug("%s: index %x\n", __func__, index);
 
+#if defined(CONFIG_USB_GADGET_DOWNLOAD)
+       g_dnl_set_serialnumber(CONFIG_SYS_CONFIG_NAME);
+#endif
+
        switch (index) {
        case 0:
                return dwc3_uboot_init(&dwc3_device_data0);
index e339d8638aa5a4a4881f98b7c8bbeb9d4b7530df..b16c6032aa2d493f7f3ff4422b47055b77c69c23 100644 (file)
@@ -181,6 +181,28 @@ config CMD_BOOTEFI
        help
          Boot an EFI image from memory.
 
+config CMD_BOOTEFI_HELLO_COMPILE
+       bool "Compile a standard EFI hello world binary for testing"
+       depends on CMD_BOOTEFI && (ARM || X86)
+       default y
+       help
+         This compiles a standard EFI hello world application with U-Boot so
+         that it can be used with the test/py testing framework. This is useful
+         for testing that EFI is working at a basic level, and for bringing
+         up EFI support on a new architecture.
+
+         No additional space will be required in the resulting U-Boot binary
+         when this option is enabled.
+
+config CMD_BOOTEFI_HELLO
+       bool "Allow booting a standard EFI hello world for testing"
+       depends on CMD_BOOTEFI_HELLO_COMPILE
+       help
+         This adds a standard EFI hello world application to U-Boot so that
+         it can be used with the 'bootefi hello' command. This is useful
+         for testing that EFI is working at a basic level, and for bringing
+         up EFI support on a new architecture.
+
 config CMD_ELF
        bool "bootelf, bootvx"
        default y
index c8079c4fe81b71dfb74f5fcd74c351ae2fb77f31..97a0fc9c7ca3c638c8ed85674d153930235e8856 100644 (file)
@@ -141,6 +141,18 @@ static void *copy_fdt(void *fdt)
        return new_fdt;
 }
 
+#ifdef CONFIG_ARM64
+static unsigned long efi_run_in_el2(ulong (*entry)(void *image_handle,
+               struct efi_system_table *st), void *image_handle,
+               struct efi_system_table *st)
+{
+       /* Enable caches again */
+       dcache_enable();
+
+       return entry(image_handle, st);
+}
+#endif
+
 /*
  * Load an EFI payload into a newly allocated piece of memory, register all
  * EFI objects it would want to access and jump to it.
@@ -226,6 +238,22 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
                return status == EFI_SUCCESS ? 0 : -EINVAL;
        }
 
+#ifdef CONFIG_ARM64
+       /* On AArch64 we need to make sure we call our payload in < EL3 */
+       if (current_el() == 3) {
+               smp_kick_all_cpus();
+               dcache_disable();       /* flush cache before switch to EL2 */
+
+               /* Move into EL2 and keep running there */
+               armv8_switch_to_el2((ulong)entry, (ulong)&loaded_image_info,
+                                   (ulong)&systab, (ulong)efi_run_in_el2,
+                                   ES_TO_AARCH64);
+
+               /* Should never reach here, efi exits with longjmp */
+               while (1) { }
+       }
+#endif
+
        return entry(&loaded_image_info, &systab);
 }
 
@@ -239,16 +267,26 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        if (argc < 2)
                return CMD_RET_USAGE;
-       saddr = argv[1];
+#ifdef CONFIG_CMD_BOOTEFI_HELLO
+       if (!strcmp(argv[1], "hello")) {
+               ulong size = __efi_hello_world_end - __efi_hello_world_begin;
+
+               addr = CONFIG_SYS_LOAD_ADDR;
+               memcpy((char *)addr, __efi_hello_world_begin, size);
+       } else
+#endif
+       {
+               saddr = argv[1];
 
-       addr = simple_strtoul(saddr, NULL, 16);
+               addr = simple_strtoul(saddr, NULL, 16);
 
-       if (argc > 2) {
-               sfdt = argv[2];
-               fdt_addr = simple_strtoul(sfdt, NULL, 16);
+               if (argc > 2) {
+                       sfdt = argv[2];
+                       fdt_addr = simple_strtoul(sfdt, NULL, 16);
+               }
        }
 
-       printf("## Starting EFI application at 0x%08lx ...\n", addr);
+       printf("## Starting EFI application at %08lx ...\n", addr);
        r = do_bootefi_exec((void *)addr, (void*)fdt_addr);
        printf("## Application terminated, r = %d\n", r);
 
@@ -263,7 +301,12 @@ static char bootefi_help_text[] =
        "<image address> [fdt address]\n"
        "  - boot EFI payload stored at address <image address>.\n"
        "    If specified, the device tree located at <fdt address> gets\n"
-       "    exposed as EFI configuration table.\n";
+       "    exposed as EFI configuration table.\n"
+#ifdef CONFIG_CMD_BOOTEFI_HELLO
+       "hello\n"
+       "  - boot a sample Hello World application stored within U-Boot"
+#endif
+       ;
 #endif
 
 U_BOOT_CMD(
index 5d2facc298de5a1e6b1127087bf1a202c2b5d9ec..89b9e73440c8dd7ab0082ac550f4b72378c62c24 100644 (file)
@@ -1,10 +1,9 @@
 comment "FASTBOOT"
 
-config FASTBOOT
-       bool ""
+menuconfig FASTBOOT
+       bool "Fastboot support"
 
-menu "Fastboot support"
-       depends on FASTBOOT
+if FASTBOOT
 
 config USB_FUNCTION_FASTBOOT
        bool "Enable USB fastboot gadget"
@@ -41,6 +40,14 @@ config FASTBOOT_BUF_SIZE
          downloads. This buffer should be as large as possible for a
          platform. Define this to the size available RAM for fastboot.
 
+config FASTBOOT_USB_DEV
+       int "USB controller number"
+       default 0
+       help
+         Some boards have USB OTG controller other than 0. Define this
+         option so it can be used in compiled environment (e.g. in
+         CONFIG_BOOTCOMMAND).
+
 config FASTBOOT_FLASH
        bool "Enable FASTBOOT FLASH command"
        help
@@ -81,4 +88,4 @@ config FASTBOOT_MBR_NAME
 
 endif # USB_FUNCTION_FASTBOOT
 
-endmenu
+endif # FASTBOOT
index bfea6e04b6746dbb5d8efaa26073761ad9d390f9..2ef5bc9a828967f913b3d13a16f62f05342ff839 100644 (file)
@@ -292,7 +292,10 @@ static int do_value(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                return CMD_RET_FAILURE;
        }
 
-       ret = regulator_set_value(dev, value);
+       if (!force)
+               ret = regulator_set_value(dev, value);
+       else
+               ret = regulator_set_value_force(dev, value);
        if (ret) {
                printf("Regulator: %s - can't set the Voltage!\n",
                       uc_pdata->name);
index d18b5233e6aa973457f29893c22d8463d825ecaa..f56622acc2ccb794d947b7e2b8c9dd85cf3f4306 100644 (file)
@@ -32,9 +32,12 @@ static int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 
        /* If the user has not yet run `sata init`, do it now */
-       if (sata_curr_device == -1)
-               if (sata_initialize())
-                       return 1;
+       if (sata_curr_device == -1) {
+               rc = sata_initialize();
+               if (rc == -1)
+                       return rc;
+               sata_curr_device = rc;
+       }
 
        switch (argc) {
        case 0:
index bd5dcfa066358c2cc44ce5d19fcc3e77d555cd09..aa45e24b34603751c8e21cae4c631bd41eb54b1a 100644 (file)
@@ -15,9 +15,9 @@ int __weak checkboard(void)
  * If the root node of the DTB has a "model" property, show it.
  * Then call checkboard().
  */
-int show_board_info(void)
+int __weak show_board_info(void)
 {
-#if defined(CONFIG_OF_CONTROL) && !defined(CONFIG_CUSTOM_BOARDINFO)
+#ifdef CONFIG_OF_CONTROL
        DECLARE_GLOBAL_DATA_PTR;
        const char *model;
 
index 77dc011dc3bfc25f5e9d084f54bb25192dda9367..9468e519dbbe3f4cdd40388d78b146e6132a1fb1 100644 (file)
@@ -14,6 +14,7 @@
 #include <time.h>
 #else
 #include <linux/compiler.h>
+#include <linux/kconfig.h>
 #include <common.h>
 #include <errno.h>
 #include <mapmem.h>
@@ -1161,11 +1162,18 @@ 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)
 {
        uint8_t image_arch;
+       int aarch32_support = 0;
+
+#ifdef CONFIG_ARM64_SUPPORT_AARCH32
+       aarch32_support = 1;
+#endif
 
        if (fit_image_get_arch(fit, noffset, &image_arch))
                return 0;
        return (arch == image_arch) ||
-               (arch == IH_ARCH_I386 && image_arch == IH_ARCH_X86_64);
+               (arch == IH_ARCH_I386 && image_arch == IH_ARCH_X86_64) ||
+               (arch == IH_ARCH_ARM64 && image_arch == IH_ARCH_ARM &&
+                aarch32_support);
 }
 
 /**
@@ -1614,6 +1622,9 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
        int type_ok, os_ok;
        ulong load, data, len;
        uint8_t os;
+#ifndef USE_HOSTCC
+       uint8_t os_arch;
+#endif
        const char *prop_name;
        int ret;
 
@@ -1697,6 +1708,12 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
                return -ENOEXEC;
        }
 #endif
+
+#ifndef USE_HOSTCC
+       fit_image_get_arch(fit, noffset, &os_arch);
+       images->os.arch = os_arch;
+#endif
+
        if (image_type == IH_TYPE_FLATDT &&
            !fit_image_check_comp(fit, noffset, IH_COMP_NONE)) {
                puts("FDT image is compressed");
index 28f7a20cadfb249ec9ac565e9a03f2eae5b76780..455f2b96294985af5fb7fb9011bb45e2bc8b33b3 100644 (file)
@@ -34,68 +34,74 @@ struct checksum_algo checksum_algos[] = {
        {
                "sha1",
                SHA1_SUM_LEN,
-               RSA2048_BYTES,
+               SHA1_DER_LEN,
+               sha1_der_prefix,
 #if IMAGE_ENABLE_SIGN
                EVP_sha1,
 #endif
                hash_calculate,
-               padding_sha1_rsa2048,
-       },
-       {
-               "sha256",
-               SHA256_SUM_LEN,
-               RSA2048_BYTES,
-#if IMAGE_ENABLE_SIGN
-               EVP_sha256,
-#endif
-               hash_calculate,
-               padding_sha256_rsa2048,
        },
        {
                "sha256",
                SHA256_SUM_LEN,
-               RSA4096_BYTES,
+               SHA256_DER_LEN,
+               sha256_der_prefix,
 #if IMAGE_ENABLE_SIGN
                EVP_sha256,
 #endif
                hash_calculate,
-               padding_sha256_rsa4096,
        }
 
 };
 
-struct image_sig_algo image_sig_algos[] = {
+struct crypto_algo crypto_algos[] = {
        {
-               "sha1,rsa2048",
-               rsa_sign,
-               rsa_add_verify_data,
-               rsa_verify,
-               &checksum_algos[0],
-       },
-       {
-               "sha256,rsa2048",
+               "rsa2048",
+               RSA2048_BYTES,
                rsa_sign,
                rsa_add_verify_data,
                rsa_verify,
-               &checksum_algos[1],
        },
        {
-               "sha256,rsa4096",
+               "rsa4096",
+               RSA4096_BYTES,
                rsa_sign,
                rsa_add_verify_data,
                rsa_verify,
-               &checksum_algos[2],
        }
 
 };
 
-struct image_sig_algo *image_get_sig_algo(const char *name)
+struct checksum_algo *image_get_checksum_algo(const char *full_name)
 {
        int i;
+       const char *name;
+
+       for (i = 0; i < ARRAY_SIZE(checksum_algos); i++) {
+               name = checksum_algos[i].name;
+               /* Make sure names match and next char is a comma */
+               if (!strncmp(name, full_name, strlen(name)) &&
+                   full_name[strlen(name)] == ',')
+                       return &checksum_algos[i];
+       }
+
+       return NULL;
+}
+
+struct crypto_algo *image_get_crypto_algo(const char *full_name)
+{
+       int i;
+       const char *name;
+
+       /* Move name to after the comma */
+       name = strchr(full_name, ',');
+       if (!name)
+               return NULL;
+       name += 1;
 
-       for (i = 0; i < ARRAY_SIZE(image_sig_algos); i++) {
-               if (!strcmp(image_sig_algos[i].name, name))
-                       return &image_sig_algos[i];
+       for (i = 0; i < ARRAY_SIZE(crypto_algos); i++) {
+               if (!strcmp(crypto_algos[i].name, name))
+                       return &crypto_algos[i];
        }
 
        return NULL;
@@ -159,12 +165,14 @@ static int fit_image_setup_verify(struct image_sign_info *info,
        info->keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
        info->fit = (void *)fit;
        info->node_offset = noffset;
-       info->algo = image_get_sig_algo(algo_name);
+       info->name = algo_name;
+       info->checksum = image_get_checksum_algo(algo_name);
+       info->crypto = image_get_crypto_algo(algo_name);
        info->fdt_blob = gd_fdt_blob();
        info->required_keynode = required_keynode;
        printf("%s:%s", algo_name, info->keyname);
 
-       if (!info->algo) {
+       if (!info->checksum || !info->crypto) {
                *err_msgp = "Unknown signature algorithm";
                return -1;
        }
@@ -194,7 +202,7 @@ int fit_image_check_sig(const void *fit, int noffset, const void *data,
        region.data = data;
        region.size = size;
 
-       if (info.algo->verify(&info, &region, 1, fit_value, fit_value_len)) {
+       if (info.crypto->verify(&info, &region, 1, fit_value, fit_value_len)) {
                *err_msgp = "Verification failed";
                return -1;
        }
@@ -375,8 +383,8 @@ int fit_config_check_sig(const void *fit, int noffset, int required_keynode,
        struct image_region region[count];
 
        fit_region_make_list(fit, fdt_regions, count, region);
-       if (info.algo->verify(&info, region, count, fit_value,
-                             fit_value_len)) {
+       if (info.crypto->verify(&info, region, count, fit_value,
+                               fit_value_len)) {
                *err_msgp = "Verification failed";
                return -1;
        }
index 88f08c95eca46249143b3898189bcfc846cfc0e6..42ff5c7755a64d466965c81b75632a88fdb6f0f9 100644 (file)
@@ -51,7 +51,7 @@ static unsigned long sata_bwrite(struct blk_desc *block_dev, lbaint_t start,
 
 int __sata_initialize(void)
 {
-       int rc;
+       int rc, ret = -1;
        int i;
 
        for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) {
@@ -71,12 +71,14 @@ int __sata_initialize(void)
                if (!rc) {
                        rc = scan_sata(i);
                        if (!rc && sata_dev_desc[i].lba > 0 &&
-                           sata_dev_desc[i].blksz > 0)
+                           sata_dev_desc[i].blksz > 0) {
                                part_init(&sata_dev_desc[i]);
+                               ret = i;
+                       }
                }
        }
 
-       return rc;
+       return ret;
 }
 int sata_initialize(void) __attribute__((weak, alias("__sata_initialize")));
 
index bb99f1fcff4b4ba3ae909be3d3134323741f6c84..cba51f5df626ed38a547eaf36c3258bdd2be188e 100644 (file)
@@ -70,6 +70,33 @@ config SPL_DISPLAY_PRINT
          banner ("U-Boot SPL ..."). This function should be provided by
          the board.
 
+config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
+       bool "MMC raw mode: by sector"
+       depends on SPL
+       default y if ARCH_SUNXI || ARCH_DAVINCI || ARCH_UNIPHIER ||ARCH_MX6 || \
+                    ARCH_ROCKCHIP || ARCH_MVEBU ||  ARCH_SOCFPGA || \
+                    ARCH_AT91 || ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \
+                    OMAP44XX || OMAP54XX || AM33XX || AM43XX
+       help
+         Use sector number for specifying U-Boot location on MMC/SD in
+         raw mode.
+
+config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
+       hex "Address on the MMC to load U-Boot from"
+       depends on SPL && SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
+       default 0x50 if ARCH_SUNXI
+       default 0x75 if ARCH_DAVINCI
+       default 0x80 if ARCH_UNIPHIER
+       default 0x8a if ARCH_MX6
+       default 0x100 if ARCH_ROCKCHIP
+       default 0x140 if ARCH_MVEBU
+       default 0x200 if ARCH_SOCFPGA || ARCH_AT91
+       default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \
+                        OMAP54XX || AM33XX || AM43XX
+       help
+         Address on the MMC to load U-Boot from, when the MMC is being used
+         in raw mode. Units: MMC sectors (1 sector = 512 bytes).
+
 config TPL
        bool
        depends on SPL && SUPPORT_TPL
@@ -465,17 +492,6 @@ config SPL_SPI_SUPPORT
          enable SPI drivers that are needed for other purposes also, such
          as a SPI PMIC.
 
-config SPL_USBETH_SUPPORT
-       bool "Support USB Ethernet drivers"
-       depends on SPL
-       help
-         Enable access to the USB network subsystem and associated
-         drivers in SPL. This permits SPL to load U-Boot over a
-         USB-connected Ethernet link (such as a USB Ethernet dongle) rather
-         than from an onboard peripheral. Environment support is required
-         since the network stack uses a number of environment variables.
-         See also SPL_NET_SUPPORT and SPL_ETH_SUPPORT.
-
 config SPL_USB_HOST_SUPPORT
        bool "Support USB host drivers"
        depends on SPL
@@ -497,6 +513,52 @@ config SPL_USB_SUPPORT
          config options. This enables loading from USB using a configured
          device.
 
+config SPL_USB_GADGET_SUPPORT
+       bool "Suppport USB Gadget drivers"
+       depends on SPL
+       help
+         Enable USB Gadget API which allows to enable USB device functions
+         in SPL.
+
+if SPL_USB_GADGET_SUPPORT
+
+config SPL_USBETH_SUPPORT
+       bool "Support USB Ethernet drivers"
+       help
+         Enable access to the USB network subsystem and associated
+         drivers in SPL. This permits SPL to load U-Boot over a
+         USB-connected Ethernet link (such as a USB Ethernet dongle) rather
+         than from an onboard peripheral. Environment support is required
+         since the network stack uses a number of environment variables.
+         See also SPL_NET_SUPPORT and SPL_ETH_SUPPORT.
+
+config SPL_DFU_SUPPORT
+       bool "Support DFU (Device Firmware Upgarde)"
+       select SPL_HASH_SUPPORT
+       help
+         This feature enables the DFU (Device Firmware Upgarde) in SPL with
+         RAM memory device support. The ROM code will load and execute
+         the SPL built with dfu. The user can load binaries (u-boot/kernel) to
+         selected device partition from host-pc using dfu-utils.
+         This feature is useful to flash the binaries to factory or bare-metal
+         boards using USB interface.
+
+choice
+       bool "DFU device selection"
+       depends on SPL_DFU_SUPPORT
+
+config SPL_DFU_RAM
+       bool "RAM device"
+       depends on SPL_DFU_SUPPORT
+       help
+        select RAM/DDR memory device for loading binary images
+        (u-boot/kernel) to the selected device partition using
+        DFU and execute the u-boot/kernel from RAM.
+
+endchoice
+
+endif
+
 config SPL_WATCHDOG_SUPPORT
        bool "Support watchdog drivers"
        depends on SPL
index bdb165ac2841829e317eb5b733214742cd6eb74c..32b9f1e95cd06e153b7aab21a8b4be81364d9a7a 100644 (file)
@@ -220,7 +220,9 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
 
        return 0;
 }
+#if defined(CONFIG_SPL_RAM_DEVICE)
 SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_RAM, spl_ram_load_image);
+#endif
 #if defined(CONFIG_SPL_DFU_SUPPORT)
 SPL_LOAD_IMAGE_METHOD(0, BOOT_DEVICE_DFU, spl_ram_load_image);
 #endif
index b93e1eacd3033bc10f3c528791a43153b1151e79..1b8e15e37d6af1e0b06767a9780cf602c02a4ca9 100644 (file)
@@ -42,7 +42,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
                puts("spl: ext4fs_open failed\n");
                goto end;
        }
-       err = ext4fs_read((char *)header, sizeof(struct image_header), &actlen);
+       err = ext4fs_read((char *)header, 0, sizeof(struct image_header), &actlen);
        if (err < 0) {
                puts("spl: ext4fs_read failed\n");
                goto end;
@@ -54,7 +54,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
                goto end;
        }
 
-       err = ext4fs_read((char *)spl_image->load_addr, filelen, &actlen);
+       err = ext4fs_read((char *)spl_image->load_addr, 0, filelen, &actlen);
 
 end:
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
@@ -97,7 +97,7 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image,
                        puts("spl: ext4fs_open failed\n");
                        goto defaults;
                }
-               err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
+               err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, 0, filelen, &actlen);
                if (err < 0) {
                        printf("spl: error reading image %s, err - %d, falling back to default\n",
                               file, err);
@@ -127,7 +127,7 @@ defaults:
        if (err < 0)
                puts("spl: ext4fs_open failed\n");
 
-       err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen);
+       err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, 0, filelen, &actlen);
        if (err < 0) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
                printf("%s: error reading image %s, err - %d\n",
index c674e61cbdebf4fb8fd98a078efce7617cb157d1..0b681c23de94247e5ef92975fffa7e7a465f4236 100644 (file)
@@ -165,7 +165,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
                return -1;
        }
 
-#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
        return mmc_load_image_raw_sector(spl_image, mmc,
                        info.start + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
 #else
@@ -327,7 +327,7 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,
                        CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);
                if (!err)
                        return err;
-#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR)
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
                err = mmc_load_image_raw_sector(spl_image, mmc,
                        CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
                if (!err)
index a3caafbd46d612b9f06783265c410ecdc5dd461c..78b8cd16bb8361f50ff7a160c8bb2a95febbede1 100644 (file)
@@ -99,7 +99,8 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
                if (err)
                        return err;
 
-               if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
+               if (IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
+                       image_get_magic(header) == FDT_MAGIC) {
                        struct spl_load_info load;
 
                        debug("Found FIT\n");
index 13e8e51da99d5031b01e2b3bdc3474b7e44e587a..957894dccbf22486e32c581a6d9aabd86bb56228 100644 (file)
@@ -109,7 +109,6 @@ static int spl_ymodem_load_image(struct spl_image_info *spl_image,
                while ((res = xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0)
                        size += res;
        } else {
-               spl_parse_image_header(spl_image, (struct image_header *)buf);
                ret = spl_parse_image_header(spl_image,
                                             (struct image_header *)buf);
                if (ret)
index 8e4a9beef4542dab055489c31589a0f4c64b3707..4d300175301877c1aeeb438fc67ccb3389fedceb 100644 (file)
@@ -151,9 +151,10 @@ static int stdio_probe_device(const char *name, enum uclass_id id,
        *sdevp = NULL;
        seq = trailing_strtoln(name, NULL);
        if (seq == -1)
+               seq = 0;
+       ret = uclass_get_device_by_seq(id, seq, &dev);
+       if (ret == -ENODEV)
                ret = uclass_first_device_err(id, &dev);
-       else
-               ret = uclass_get_device_by_seq(id, seq, &dev);
        if (ret) {
                debug("No %s device for seq %d (%s)\n", uclass_get_name(id),
                      seq, name);
@@ -173,12 +174,12 @@ static int stdio_probe_device(const char *name, enum uclass_id id,
 }
 #endif
 
-struct stdio_devstdio_get_by_name(const char *name)
+struct stdio_dev *stdio_get_by_name(const char *name)
 {
        struct list_head *pos;
        struct stdio_dev *sdev;
 
-       if(!name)
+       if (!name)
                return NULL;
 
        list_for_each(pos, &(devs.list)) {
index 5656aac48fb1b688a10247adf572444392779194..e0d87dbfec95af68bf72be382cc931aeb60c9ea5 100644 (file)
@@ -71,12 +71,12 @@ typedef int cyg_int32;
 static int
 CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)
 {
-#define DELAY 20
-  unsigned long counter = 0;
-  while (!tstc () && (counter < xyzModem_CHAR_TIMEOUT * 1000 / DELAY))
+
+  ulong now = get_timer(0);
+  while (!tstc ())
     {
-      udelay (DELAY);
-      counter++;
+      if (get_timer(now) > xyzModem_CHAR_TIMEOUT)
+        break;
     }
   if (tstc ())
     {
index 04b720d264b8a573adec1f8985256ce86456d29c..bb7eaf8dab7e429fc5a72bf58169d25d8a6ab384 100644 (file)
@@ -8,7 +8,8 @@ CONFIG_SYS_CLK_FREQ=912000000
 CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-olinuxino-lime"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,AHCI,SATAPWR=SUNXI_GPC(3)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 4751fe053332be1753b103afb95a984d7b019fff..d48e35dbd728a561127ecf6dcbc520be7fd0abbf 100644 (file)
@@ -8,7 +8,8 @@ CONFIG_USB0_VBUS_PIN="PC17"
 CONFIG_USB0_VBUS_DET="PH5"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 024dc2d8a76cebd4e8069ac5960f1f644d150e71..7c5d84dcf5a2c974249550965f96022953483028 100644 (file)
@@ -6,7 +6,8 @@ CONFIG_DRAM_CLK=384
 CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPC(3)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 5809345fc5579969bffea6cc5ea80cd66041ca63..9eb5f1b717ef6334830512a64b6c7fb61ba0b805 100644 (file)
@@ -9,7 +9,8 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=3
 CONFIG_VIDEO_VGA=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-micro"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 3f4e90db4aafad93c594c8d6133dc6ef4e084cc3..53d800f2841d030e40aa10b25cb3fae1b2f2200c 100644 (file)
@@ -11,7 +11,8 @@ CONFIG_USB0_VBUS_PIN="PB9"
 CONFIG_USB0_VBUS_DET="PH5"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olimex-som-evb"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 366ef247358dae9f0a0cbe3e000d5defe063dcd8..3da1cf73a5ea5438fecabab80b338e7f50636c95 100644 (file)
@@ -7,7 +7,8 @@ CONFIG_VIDEO_COMPOSITE=y
 CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapi"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHCI"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 9b39124a4090fa2a31ff061f464dcdf411394f84..2b9c865092d4b6b712341e46fc9db56c0a349b5c 100644 (file)
@@ -9,7 +9,8 @@ CONFIG_VIDEO_COMPOSITE=y
 CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapro"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHCI"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index ad6eb62a0bfc63559429a9f84afab90e3ef7624b..9212a1796bf0c94344d287cc1aef19c5c114c73b 100644 (file)
@@ -6,7 +6,8 @@ CONFIG_DRAM_CLK=480
 CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-cubieboard2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 9b4f4838eeca9163fd46ddbbb959d90702becc40..6e7e74127572039c3e55fc198a28a3eadf4a756c 100644 (file)
@@ -6,7 +6,8 @@ CONFIG_DRAM_CLK=480
 CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-cubieboard"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,AHCI,SATAPWR=SUNXI_GPB(8)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 927ccd484b47bbac03afb41e23af4ac254abaee9..37b60b85568517279d803fa365620918d37f80d9 100644 (file)
@@ -11,7 +11,8 @@ CONFIG_VIDEO_VGA=y
 CONFIG_GMAC_TX_DELAY=1
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-cubietruck"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPH(12)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,SATAPWR=SUNXI_GPH(12)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 1a8fad7d0f56a28e6dbf1225f2b564c7f443691e..d544d5086500af26111fe5c2eb9d22e9b96f5140 100644 (file)
@@ -6,7 +6,8 @@ CONFIG_DRAM_CLK=480
 CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-itead-ibox"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,SATAPWR=SUNXI_GPB(8)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index c2fc2b3f7899cc7d1fc3e0f715bb68e841952047..58bc5a23e7afe2481d3e20801143898779cdc084 100644 (file)
@@ -7,7 +7,8 @@ CONFIG_MMC0_CD_PIN="PH10"
 CONFIG_GMAC_TX_DELAY=4
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-lamobo-r1"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHCI,SATAPWR=SUNXI_GPB(3)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),SATAPWR=SUNXI_GPB(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index a916e5d88e23df64966154bd1a57e322ee50b491..8cbe9c339a40b784676d86314a37f2a613680423 100644 (file)
@@ -8,7 +8,8 @@ CONFIG_USB1_VBUS_PIN="PH11"
 CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-pcduino3-nano"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPH(2)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,SATAPWR=SUNXI_GPH(2)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 8eea21428440737d98bf77541723d4cddb86d4c2..5d155b4ac272dffaa7a244936f587b8113ded4c9 100644 (file)
@@ -6,7 +6,8 @@ CONFIG_DRAM_CLK=480
 CONFIG_DRAM_ZQ=122
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-pcduino3"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPH(2)"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,SATAPWR=SUNXI_GPH(2)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index b1d6b23c5b25b528f313a5c653b2dab5840794c3..6a882388c4c6b05abd2c901ac7cfc649f9ed9a75 100644 (file)
@@ -3,7 +3,8 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN4I=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-marsboard"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,AHCI"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index eae5ead73bfe563f9ae6cdc1b66f7e4e897c312f..d678ffbe25fe0cadffc4d1e98022a2483da41d08 100644 (file)
@@ -6,7 +6,8 @@ CONFIG_VIDEO_VGA=y
 CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-a1000"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,MACPWR=SUNXI_GPH(15),AHCI"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_EMAC,MACPWR=SUNXI_GPH(15)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 124dc22f5d17d6ebe1cd724724ea36068badd90d..09addc569fd8cdd724ea3706487d5716ec399047 100644 (file)
@@ -8,7 +8,8 @@ CONFIG_MMC0_CD_PIN="PH1"
 CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-m5"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,AHCI,STATUSLED=234"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/Nintendo_NES_Classic_Edition_defconfig b/configs/Nintendo_NES_Classic_Edition_defconfig
new file mode 100644 (file)
index 0000000..fcda1be
--- /dev/null
@@ -0,0 +1,24 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+# CONFIG_SPL_MMC_SUPPORT is not set
+CONFIG_MACH_SUN8I_A33=y
+CONFIG_DRAM_CLK=600
+CONFIG_DRAM_ZQ=15291
+CONFIG_DRAM_ODT_EN=y
+# CONFIG_MMC is not set
+CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
+CONFIG_AXP_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-r16-nintendo-nes-classic-edition"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_AXP_DLDO1_VOLT=3300
+CONFIG_AXP_ELDO2_VOLT=1800
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
+CONFIG_G_DNL_VENDOR_NUM=0x1f3a
+CONFIG_G_DNL_PRODUCT_NUM=0x1010
index c3eaae2cb4727513f7043cb6a5ecae27b45f5adc..052ca838aa35a4dbde0bae6d1e3bbee603843d07 100644 (file)
@@ -10,7 +10,8 @@ CONFIG_VIDEO_COMPOSITE=y
 CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-orangepi"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHCI"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 2903d8359e5ed5162bad0e4955371071d001dfc8..63db70d2c0e2167e1a7bad208776a0a9d5fc8eef 100644 (file)
@@ -12,7 +12,8 @@ CONFIG_VIDEO_COMPOSITE=y
 CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-orangepi-mini"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23),AHCI"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPH(23)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 2a5f985dd303df2627187522a0475b88fbfd974e..26b119a9b92f3157ac09cd65c0f5f02ff2cd65a7 100644 (file)
@@ -4,7 +4,12 @@ CONFIG_MACH_SUN8I_A33=y
 CONFIG_DRAM_CLK=552
 CONFIG_DRAM_ZQ=15291
 CONFIG_MMC0_CD_PIN="PB4"
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_USB0_ID_DET="PH8"
+CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:66000,le:90,ri:160,up:3,lo:127,hs:70,vs:20,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_DCLK_PHASE=0
+CONFIG_VIDEO_LCD_BL_EN="PH6"
+CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-sinlinx-sina33"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
index d83cee7fbd0df3ddddd647289ffb636aa7a25ed2..d847fc756cb4c97ecfb30608c5cce66b0ed98a0d 100644 (file)
@@ -11,7 +11,8 @@ CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_VIDEO_LCD_PANEL_LVDS=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-wits-pro-a20-dkt"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI"
+CONFIG_AHCI=y
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index 8c28e28f27b0a3636c870766422afc2dfcba1cf5..fdb6f77e7a0dedc76eb2b607f2909672854b8167 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_NET_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SPL_GADGET_SUPPORT=y
 CONFIG_SPL_USBETH_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index 06f7f7677222585f2258fcb9493acaabdb1c8e92..12d9a1425f88848c44cfa9f41897e392c6bc2379 100644 (file)
@@ -17,6 +17,15 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
+CONFIG_FASTBOOT_BUF_ADDR=0x82000000
+CONFIG_FASTBOOT_BUF_SIZE=0x2f000000
+CONFIG_FASTBOOT_USB_DEV=1
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=1
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
@@ -60,5 +69,14 @@ CONFIG_TI_QSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_OMAP=y
+CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
+CONFIG_G_DNL_VENDOR_NUM=0x0451
+CONFIG_G_DNL_PRODUCT_NUM=0xd022
 CONFIG_SPL_OF_LIBFDT=y
index c3cdb20b56889cf7271bdb40e273217944e0ef5b..7e08b0ab42f728b850ed5f4a5bec730258447932 100644 (file)
@@ -10,6 +10,15 @@ CONFIG_SPL=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
+CONFIG_FASTBOOT_BUF_ADDR=0x82000000
+CONFIG_FASTBOOT_BUF_SIZE=0x2f000000
+CONFIG_FASTBOOT_USB_DEV=1
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=1
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
@@ -37,5 +46,14 @@ CONFIG_TI_QSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_OMAP=y
+CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
+CONFIG_G_DNL_VENDOR_NUM=0x0451
+CONFIG_G_DNL_PRODUCT_NUM=0xd022
 CONFIG_OF_LIBFDT=y
index 6631bb25a8e237eb838256dc777341811c4c87db..c508b8e4dabc959f965076852489c3fa9e79ddcc 100644 (file)
@@ -18,6 +18,15 @@ CONFIG_SPL=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_FASTBOOT=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
+CONFIG_FASTBOOT_BUF_ADDR=0x82000000
+CONFIG_FASTBOOT_BUF_SIZE=0x2f000000
+CONFIG_FASTBOOT_USB_DEV=1
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=1
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
@@ -55,5 +64,14 @@ CONFIG_TI_QSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_OMAP=y
+CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
+CONFIG_G_DNL_VENDOR_NUM=0x0451
+CONFIG_G_DNL_PRODUCT_NUM=0xd022
 CONFIG_SPL_OF_LIBFDT=y
index 640c9ce4be5afa547cf7d3f8972510eec10a9f8d..0ac2fe635c33c7cf25de225900674e7132d89ae2 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra30-apalis"
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
+# CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Apalis T30 # "
 CONFIG_CMD_BOOTZ=y
index 78f3093c92c6b70f3c0625bdce559c3f6bbcf8e5..41eac1828cf64743000c1a3e107f8e8811242ebc 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
index 8e5325ecb60d7c4f0fb4d3eebbc46cd15ebe7b78..f8d5539ad40d3d692d347e90cb388116f5cd46a4 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
index 9a5ed65514fefc6cdc124fc19f9fef8d23428eda..17b9cb1e8006f2b4e6079971fb7b2bce59d9844c 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
index 16415334ca6c045d51e0d8c16e20a0f442b61ba0..7c0cf965cd2ac4933cfdff670e77c10047446e96 100644 (file)
@@ -18,6 +18,8 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_BOOTM is not set
diff --git a/configs/chromebit_mickey_defconfig b/configs/chromebit_mickey_defconfig
new file mode 100644 (file)
index 0000000..b118907
--- /dev/null
@@ -0,0 +1,84 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+# CONFIG_SPL_MMC_SUPPORT is not set
+CONFIG_ROCKCHIP_RK3288=y
+CONFIG_TARGET_CHROMEBIT_MICKEY=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_DM_KEYBOARD=y
+CONFIG_DEFAULT_DEVICE_TREE="rk3288-veyron-mickey"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_SPL_SYSCON=y
+# CONFIG_SPL_SIMPLE_BUS is not set
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_I2C_CROS_EC_TUNNEL=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_I2C_MUX=y
+CONFIG_CROS_EC_KEYB=y
+CONFIG_CMD_CROS_EC=y
+CONFIG_CROS_EC=y
+CONFIG_CROS_EC_SPI=y
+CONFIG_PWRSEQ=y
+CONFIG_ROCKCHIP_DWMMC=y
+CONFIG_PINCTRL=y
+CONFIG_SPL_PINCTRL=y
+# CONFIG_SPL_PINCTRL_FULL is not set
+CONFIG_ROCKCHIP_RK3288_PINCTRL=y
+CONFIG_DM_PMIC=y
+# CONFIG_SPL_PMIC_CHILDREN is not set
+CONFIG_PMIC_RK808=y
+CONFIG_DM_REGULATOR=y
+CONFIG_SPL_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_REGULATOR_RK808=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_RAM=y
+CONFIG_SPL_RAM=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_BASE=0xff690000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550=y
+CONFIG_ROCKCHIP_SERIAL=y
+CONFIG_ROCKCHIP_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_DM_VIDEO=y
+CONFIG_DISPLAY=y
+CONFIG_VIDEO_ROCKCHIP=y
+CONFIG_USE_TINY_PRINTF=y
+CONFIG_CMD_DHRYSTONE=y
+CONFIG_ERRNO_STR=y
+CONFIG_SPL_OF_PLATDATA=y
+# CONFIG_SPL_OF_LIBFDT is not set
index 876adc46715858043ccea17c6ab64b1a242e6ce5..46df1a66251176c57cea27ccaea95b1741511d8b 100644 (file)
@@ -1,16 +1,13 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_MMC_SUPPORT is not set
-CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_TARGET_CHROMEBOOK_JERRY=y
-CONFIG_ROCKCHIP_FAST_SPL=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_SPL_STACK_R_ADDR=0x80000
-CONFIG_DEFAULT_DEVICE_TREE="rk3288-jerry"
+CONFIG_DEFAULT_DEVICE_TREE="rk3288-veyron-jerry"
 CONFIG_SILENT_CONSOLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
@@ -36,7 +33,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_SPL_OF_CONTROL=y
-CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent"
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_REGMAP=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SYSCON=y
@@ -71,6 +68,7 @@ CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550=y
+CONFIG_ROCKCHIP_SERIAL=y
 CONFIG_ROCKCHIP_SPI=y
 CONFIG_SYSRESET=y
 CONFIG_DM_VIDEO=y
@@ -80,3 +78,5 @@ CONFIG_CONSOLE_SCROLL_LINES=10
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+CONFIG_SPL_OF_PLATDATA=y
+# CONFIG_SPL_OF_LIBFDT is not set
diff --git a/configs/chromebook_minnie_defconfig b/configs/chromebook_minnie_defconfig
new file mode 100644 (file)
index 0000000..6aced14
--- /dev/null
@@ -0,0 +1,82 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+# CONFIG_SPL_MMC_SUPPORT is not set
+CONFIG_ROCKCHIP_RK3288=y
+CONFIG_TARGET_CHROMEBOOK_MINNIE=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_DEFAULT_DEVICE_TREE="rk3288-veyron-minnie"
+CONFIG_SILENT_CONSOLE=y
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_SPL_SYSCON=y
+# CONFIG_SPL_SIMPLE_BUS is not set
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_I2C_CROS_EC_TUNNEL=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_I2C_MUX=y
+CONFIG_DM_KEYBOARD=y
+CONFIG_CROS_EC_KEYB=y
+CONFIG_CROS_EC=y
+CONFIG_CROS_EC_SPI=y
+CONFIG_PWRSEQ=y
+CONFIG_ROCKCHIP_DWMMC=y
+CONFIG_PINCTRL=y
+CONFIG_SPL_PINCTRL=y
+# CONFIG_SPL_PINCTRL_FULL is not set
+CONFIG_ROCKCHIP_RK3288_PINCTRL=y
+CONFIG_DM_PMIC=y
+# CONFIG_SPL_PMIC_CHILDREN is not set
+CONFIG_PMIC_RK808=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_REGULATOR_RK808=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_RAM=y
+CONFIG_SPL_RAM=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_BASE=0xff690000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550=y
+CONFIG_ROCKCHIP_SERIAL=y
+CONFIG_ROCKCHIP_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_DM_VIDEO=y
+CONFIG_DISPLAY=y
+CONFIG_VIDEO_ROCKCHIP=y
+CONFIG_CONSOLE_SCROLL_LINES=10
+CONFIG_USE_TINY_PRINTF=y
+CONFIG_CMD_DHRYSTONE=y
+CONFIG_ERRNO_STR=y
+CONFIG_SPL_OF_PLATDATA=y
+# CONFIG_SPL_OF_LIBFDT is not set
index 0891b917b0be7e7c067b8078f08424585ecfee90..d06b75c027cbc9b78645156681e7db66b5c39bce 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x141
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
index 9c3a6ec699341c0a1897732f4f49e0680b6a85e3..dc7544a17f17576a20d29d273713fff0a5d23e42 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL,SPL"
 CONFIG_BOOTDELAY=3
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x80
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CM-FX6 # "
 CONFIG_CMD_BOOTZ=y
index d359fabf684175d98d680c6661dc4c8fd68c77e5..2d7884119d6369e96d56a0b9a25f2b6e8874d17b 100644 (file)
@@ -16,6 +16,8 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x480
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CM-T43 # "
index c30ee0be6db5c1b853256e121ee121493631d8e3..e002e1c8511c8bab12616cae211b6a3ae7e02392 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
 CONFIG_SPL_SATA_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CM-T54 # "
index 9a57041c36a9eb62e3c19444307b67da0a6d0e79..e0a36f13ddb49ca4eb1298c82c97ab5ccca04987 100644 (file)
@@ -1,19 +1,26 @@
 CONFIG_ARM=y
 CONFIG_TARGET_COLIBRI_PXA270=y
 # CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="$ "
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_EXPORTENV is not set
+# CONFIG_CMD_IMPORTENV is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
+# CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
+CONFIG_DM=y
+CONFIG_DM_SERIAL=y
+CONFIG_PXA_SERIAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+# CONFIG_REGEX is not set
 CONFIG_OF_LIBFDT=y
 # CONFIG_EFI_LOADER is not set
index 5f95e3eb99b2b678586cc4190f69c63ad107867a..fa56a753b54e0ea3529e689c6a3f9a1acc8ff14e 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_TARGET_COLIBRI_T20=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-colibri"
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
+# CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Colibri T20 # "
 CONFIG_CMD_BOOTZ=y
index de00afe1b01e9b9273e4a71ab09848b313d8e866..cb24627d4280dc6279dab0f9c1193f55a57ce2f3 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra30-colibri"
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
+# CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Colibri T30 # "
 CONFIG_CMD_BOOTZ=y
index 1020e44c112b89537e73a7fdb870f29cca323470..54d35815d5e497a1eb55cd73d46b170a1369baa1 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,ENV_IS_IN_NAND,IMX_NAND"
 CONFIG_BOOTDELAY=1
 CONFIG_VERSION_VARIABLE=y
+# CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Colibri VFxx # "
 CONFIG_CMD_BOOTZ=y
index 5212facc534c3b7edc5af1cc8a4501b095a1460a..0cb441299316368d5f9d20418c053dd6b6cf47a3 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
index b31c73b71e76aed09015e25be429bb8c1d28c4f6..1fe61428644f52bbb9cc89b5dd7f08c63cc14859 100644 (file)
@@ -34,3 +34,4 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_EFI=y
+# CONFIG_EFI_LOADER is not set
index 4e5baac33c992dbac42bb3e409ac90b90b31c441..8fb6ebd7bf06796f0b16617be6cff39328ed13cf 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
index e3edeb7517d2589b20f92a682c854543ff25c98d..40a8295417873b58c18d6e247aad153e7dc46dcd 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_ROCKCHIP_DWMMC=y
 CONFIG_ROCKCHIP_SDHCI=y
 CONFIG_PINCTRL=y
 CONFIG_ROCKCHIP_RK3399_PINCTRL=y
+CONFIG_PWM_ROCKCHIP=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_RAM=y
index c1b359e54d73ed6bef80cf18ec327a61d175b202..a47159a283d0ff7a7a4bff7fd0f7864b6bed7704 100644 (file)
@@ -24,3 +24,4 @@ CONFIG_SYS_PROMPT="> "
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_PING=y
 # CONFIG_CMD_MISC is not set
+CONFIG_PXA_SERIAL=y
index b73a2de1b6f6ea2f79b57f45dfa22b7ab37c6a49..c2d5d47692b2517b4eecf866c7efa6859d284cef 100644 (file)
@@ -31,3 +31,4 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0451
 CONFIG_G_DNL_PRODUCT_NUM=0xd022
 CONFIG_OF_LIBFDT=y
+# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
index 424cdab5693afdc71b612662548970d48d7eb2bb..631d1f5498ec86b500b5d0bb01f8ea2b87fe224a 100644 (file)
@@ -32,7 +32,11 @@ CONFIG_LED=y
 CONFIG_ROCKCHIP_DWMMC=y
 CONFIG_PINCTRL=y
 CONFIG_ROCKCHIP_RK3036_PINCTRL=y
+CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_RAM=y
 CONFIG_SYSRESET=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+CONFIG_CMD_USB=y
+CONFIG_USB=y
+CONFIG_USB_STORAGE=y
diff --git a/configs/ls1021aiot_qspi_defconfig b/configs/ls1021aiot_qspi_defconfig
new file mode 100644 (file)
index 0000000..6c9140b
--- /dev/null
@@ -0,0 +1,15 @@
+CONFIG_SYS_EXTRA_OPTIONS="QSPI_BOOT"
+CONFIG_ARM=y
+CONFIG_DM_SPI=y
+CONFIG_DM=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_NETDEVICES=y
+CONFIG_E1000=y
+CONFIG_SYS_NS16550=y
+CONFIG_FSL_DSPI=y
+CONFIG_FSL_QSPI=y
+CONFIG_TARGET_LS1021AIOT=y
+CONFIG_DEFAULT_DEVICE_TREE="ls1021a-iot-duart"
diff --git a/configs/ls1021aiot_sdcard_defconfig b/configs/ls1021aiot_sdcard_defconfig
new file mode 100644 (file)
index 0000000..a5a391d
--- /dev/null
@@ -0,0 +1,19 @@
+CONFIG_ARM=y
+CONFIG_TARGET_LS1021AIOT=y
+CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
+CONFIG_DEFAULT_DEVICE_TREE="ls1021a-iot-duart"
+CONFIG_DM_SPI=y
+CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,SD_BOOT,SD_BOOT_QSPI"
+CONFIG_CMD_DM=y
+CONFIG_DM=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_FSL_DSPI=y
+CONFIG_FSL_QSPI=y
+CONFIG_NETDEVICES=y
+CONFIG_E1000=y
+CONFIG_SYS_NS16550=y
index 2bdc7239432a6ff328a960f165d0e911a44cb4c0..e28aa487b98c0e8823f21f5176502bc7e6669b05 100644 (file)
@@ -21,6 +21,8 @@ CONFIG_SILENT_CONSOLE=y
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index 402cce77a7470e0cef95979ca92dcfb5c4d4d3e1..beed9ac6bd8924733f3ac4d795987a26f003919c 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_SILENT_CONSOLE=y
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index 6f3588ebbbd2f38dd1a519702892d56cc40f37f8..d6b08de2a26a54a12792890b1d24acdba38eeca9 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_SILENT_CONSOLE=y
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index 8178e8a0a242bd357ab4b4b0c4ef09fee47e324a..ae0d8143d94873563c4c03084da32778ab8a30d0 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_SILENT_CONSOLE=y
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
 CONFIG_SPL_CRYPTO_SUPPORT=y
 CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
index eef1c1c9bdde756904c3005047df2861b0113606..22be22ce5731bb60e766a5cd72789f3340436a4d 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_SILENT_CONSOLE=y
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index 3f6fb17945f410592c579fdbf3206904be077427..80329fcf75fcf119b6ad7a96a94a42c1a69c6c5e 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_SILENT_CONSOLE=y
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index dbdb416f544cddae5add31217e08883cd028f814..de0780157c5f524d14d8bed37dbae02b50a2df48 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,NAND_BOOT"
 CONFIG_NAND_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xf0
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index 24220edccc8677a52aced83631354cfe42d886ae..48ea853b9a2368098f5543686354aa895947cd40 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,SD_BOOT"
 CONFIG_SD_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xf0
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index fdcbf8a612ecd86efcfe4d0d72707d076ac26e50..fd0922da03221f2b57b148121253fbe223bba3bb 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,SD_BOOT,SD_BOOT_QSPI"
 CONFIG_SD_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xf0
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index b21f47e13b8d5b003483f4f40f5ca436c69fc8dc..da69986010074440774d76ee466f4e0651f280b2 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,NAND_BOOT"
 CONFIG_NAND_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xf0
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_MMC=y
index 12ac6482628538925b08abed429e90724ce2bad0..c0b0a9253e4b3a5986cd999c80434a962368da4b 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,SD_BOOT"
 CONFIG_SD_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xf0
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_MMC=y
diff --git a/configs/ls1046aqds_lpuart_defconfig b/configs/ls1046aqds_lpuart_defconfig
new file mode 100644 (file)
index 0000000..25bb5f9
--- /dev/null
@@ -0,0 +1,30 @@
+CONFIG_ARM=y
+CONFIG_TARGET_LS1046AQDS=y
+CONFIG_SYS_FSL_DDR4=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1046a-qds-lpuart"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_SYS_EXTRA_OPTIONS="LPUART"
+CONFIG_BOOTDELAY=10
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_DM_SPI=y
+CONFIG_SPI_FLASH=y
+CONFIG_FSL_DSPI=y
+CONFIG_DM_SERIAL=y
+CONFIG_FSL_LPUART=y
index 01140b9c56b6e22c3a450b465ca4ecb469668c8f..74fcd4ae7230ed66db2febe268bc2c2f77d82304 100644 (file)
@@ -8,6 +8,8 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,RAMBOOT_PBL,SPL_FSL_PBL"
 CONFIG_NAND_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x110
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GREPENV=y
index e6eeadd6e98f60cacb6e0ea36cb2c26abc8e1b61..fe9ad0efcaae0e29e29680818950c2858d42a8c5 100644 (file)
@@ -8,6 +8,8 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,RAMBOOT_PBL,SPL_FSL_PBL"
 CONFIG_SD_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x110
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GREPENV=y
index 8a14862535147ea476a53cfb923fcb69ece2901d..17000820a45230632e9611fcae083933359f77bb 100644 (file)
@@ -8,6 +8,8 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,RAMBOOT_PBL,SPL_FSL_PBL,SD_BOOT_QSPI"
 CONFIG_SD_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x110
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMLS is not set
index ba28047c299ac5f8d083e89b69f2ec1e6ee6211a..fd21959becda0bdd85292f250af5a14ee46edaa5 100644 (file)
@@ -8,6 +8,8 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,SYS_FSL_DDR4,EMMC_BOOT"
 CONFIG_SD_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x110
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MMC=y
index 01e63979ee26481bdf25d6101b1de67efaf523d4..0b810d3bc4b9f7583d74bd4ea4840cb9fc6b130d 100644 (file)
@@ -8,6 +8,8 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL,SYS_FSL_DDR4"
 CONFIG_SD_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x110
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MMC=y
index c8eb5b500a2d3dd40b80dea93b111988f2ace31e..ac1a6a30b8f5bd699402b88d51ed11f21fa6d0a5 100644 (file)
@@ -1,7 +1,6 @@
 CONFIG_ARM=y
 CONFIG_OMAP34XX=y
 CONFIG_TARGET_OMAP3_LOGIC=y
-CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="NAND"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
index b73e42687e27228bbfac551c49482827f31d8030..650d23d7a0b4ce0cde6e7109129af261d3db73c0 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
index c081ead86cb391e24936f207622b472b1ed08a3f..eaf0e32784d2b234016b9b2ef546dd558740df1c 100644 (file)
@@ -52,3 +52,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
 CONFIG_EFI_STUB_64BIT=y
+# CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
index ab65c145bd54afc6ea7b599802fe3e78d049e5c2..d3ac645ad6aafb5fb1972c122fe5868107cb06d7 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
index ff3c57190b756e60fa750945bf56527166d90228..4c99c13c825c2a0ef49091e79360380e87ee7f71 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
index 02b51c46d50218d2d97adde881292c4071f0eb83..d529a69d6a4a727e74d73b61b1e672cf37d526cd 100644 (file)
@@ -32,3 +32,4 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0451
 CONFIG_G_DNL_PRODUCT_NUM=0xd022
 CONFIG_OF_LIBFDT=y
+# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
index 24e2221d014b46d7bf94733813083c738eeb5556..bb161d4f95ab8320b3d0af3182b44a2fe9ddefe8 100644 (file)
@@ -10,3 +10,4 @@ CONFIG_SYS_PROMPT="U-Boot > "
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIMER=y
 CONFIG_OF_LIBFDT=y
+# CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
index a9d3e7ed600b2f3383bd001ecded696ae8a42dd1..7e1b63bc8078a0673fc3946c84eaf47cd0fe0561 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
index 9d1df816b2bd1e63f6cdebf68f6a419c1338eeb1..029791718e953231ea13da12e58fd4ce4b7f8e17 100644 (file)
@@ -14,6 +14,8 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot# "
 # CONFIG_CMD_IMLS is not set
index e3a9f03e135babdae8ba34c87335786623971811..7d3a7d6634c73319e85011fd1b715ae6075b215f 100644 (file)
@@ -13,6 +13,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="u-boot/ti816x# "
 # CONFIG_CMD_IMLS is not set
diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig
new file mode 100644 (file)
index 0000000..3d6161e
--- /dev/null
@@ -0,0 +1,49 @@
+CONFIG_ARM=y
+CONFIG_SYS_VENDOR="topic"
+CONFIG_SYS_CONFIG_NAME="topic_miami"
+CONFIG_ARCH_ZYNQ=y
+CONFIG_BOOT_INIT_FILE="board/topic/zynq/zynq-topic-miami/ps7_regs.txt"
+CONFIG_DEFAULT_DEVICE_TREE="zynq-topic-miami"
+CONFIG_BOOTDELAY=0
+CONFIG_SYS_NO_FLASH=y
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_SPL=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="zynq-uboot> "
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_DFU=y
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_EMBED=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_ZYNQ_SDHCI=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_STMICRO=y
+# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+# CONFIG_NETDEVICES is not set
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ZYNQ=y
+CONFIG_DEBUG_UART_BASE=0xe0000000
+CONFIG_DEBUG_UART_CLOCK=100000000
+CONFIG_ZYNQ_QSPI=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_ULPI_VIEWPORT=y
+CONFIG_USB_ULPI=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Xilinx"
+CONFIG_G_DNL_VENDOR_NUM=0x03fd
+CONFIG_G_DNL_PRODUCT_NUM=0x0300
diff --git a/configs/topic_miamiplus_defconfig b/configs/topic_miamiplus_defconfig
new file mode 100644 (file)
index 0000000..3160f00
--- /dev/null
@@ -0,0 +1,49 @@
+CONFIG_ARM=y
+CONFIG_SYS_VENDOR="topic"
+CONFIG_SYS_CONFIG_NAME="topic_miamiplus"
+CONFIG_ARCH_ZYNQ=y
+CONFIG_BOOT_INIT_FILE="board/topic/zynq/zynq-topic-miamiplus/ps7_regs.txt"
+CONFIG_DEFAULT_DEVICE_TREE="zynq-topic-miamiplus"
+CONFIG_BOOTDELAY=0
+CONFIG_SYS_NO_FLASH=y
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_SPL=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_PROMPT="zynq-uboot> "
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_DFU=y
+CONFIG_CMD_GPIO=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_EMBED=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_ZYNQ_SDHCI=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_STMICRO=y
+# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+# CONFIG_NETDEVICES is not set
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ZYNQ=y
+CONFIG_DEBUG_UART_BASE=0xe0000000
+CONFIG_DEBUG_UART_CLOCK=100000000
+CONFIG_ZYNQ_QSPI=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_ULPI_VIEWPORT=y
+CONFIG_USB_ULPI=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Xilinx"
+CONFIG_G_DNL_VENDOR_NUM=0x03fd
+CONFIG_G_DNL_PRODUCT_NUM=0x0300
index 01aae3b06bd0b5d540077e23bd54002cc2c7193b..085c2dff6f67d1fe0b2ee5ab81b556c0e429729d 100644 (file)
@@ -10,6 +10,8 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/woodburn/imximage.cfg"
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x100
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="woodburn U-Boot > "
 CONFIG_CMD_MMC=y
index 8eb9be4357b973f8647a6e7dfbcf108b25367b7d..584657995477da8ea06265235cc0a671043a0098 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
+CONFIG_PXA_SERIAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_LCD=y
index 56c285115453a1b3cc668026dca9d74fcbe5fb33..2f4fc1e37db5f1e33398b4fef676839acdacb664 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_NAND=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -22,4 +23,5 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_NAND_ZYNQ=y
 CONFIG_ZYNQ_GEM=y
index 1fd3f004c3999f1d5b90e502be984be5a33846c8..66259f3e260ec33c6b5317b1aad9392d32fdc3c2 100644 (file)
@@ -310,6 +310,20 @@ Removable media booting (search for /efi/boot/boota{a64,arm}.efi) is supported.
 Simple use cases like "Plug this SD card into my ARM device and it just
 boots into grub which boots into Linux", work very well.
 
+
+Running HelloWord.efi
+---------------------
+
+You can run a simple 'hello world' EFI program in U-Boot.
+Enable the option CONFIG_CMD_BOOTEFI_HELLO.
+
+Then you can boot into U-Boot and type:
+
+   > bootefi hello
+
+The 'hello world EFI' program will then run, print a message and exit.
+
+
 Future work
 -----------
 
index 679955983bba613af4217210b224c1ff8c6bb5e1..a38cc1bc6ca9b7b7a00036961f606bc4d1e48bf9 100644 (file)
@@ -1077,7 +1077,6 @@ TODO List
 ---------
 - Audio
 - Chrome OS verified boot
-- Support for CONFIG_EFI_LOADER
 - Building U-Boot to run in 64-bit mode
 
 References
index 85522d8011b0a64ccc53a6a9a2f4ceafc47eb017..332789026a7f1772007257d77da64a3488d010ec 100644 (file)
@@ -6,7 +6,7 @@ Required properties:
 - compatible : Should be the manufacturer and the name of the chip. Bear in
                mind that the DT binding is not U-Boot-only, but in case of
                U-Boot, see spi_flash_params_table table in
-               drivers/mtd/spi/sf_params.c for the list of supported chips.
+               drivers/mtd/spi/spi_flash_ids.c for the list of supported chips.
 - reg : Chip-Select number
 - spi-max-frequency : Maximum frequency of the SPI bus the chip can operate at
 
index d01a8c7533b19be903875ebaed2da0a244c22ece..b78e194ea89893560eb515a0f067f9b1311cdfd3 100644 (file)
@@ -35,6 +35,7 @@ alias macpaul        Macpaul Lin <macpaul@andestech.com>
 alias marex          Marek Vasut <marex@denx.de>
 alias masahiro       Masahiro Yamada <yamada.masahiro@socionext.com>
 alias mateusz        Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
+alias maxime        Maxime Ripard <maxime.ripard@free-electrons.com>
 alias monstr         Michal Simek <monstr@monstr.eu>
 alias prafulla       Prafulla Wadaskar <prafulla@marvell.com>
 alias bobenstein     Przemyslaw Marczak <p.marczak@samsung.com>
@@ -70,7 +71,7 @@ alias s5pc           samsung
 alias samsung        uboot, prom
 alias snapdragon     uboot, mateusz
 alias socfpga        uboot, marex, Dinh Nguyen <dinguyen@opensource.altera.com>
-alias sunxi          uboot, ijc, jwrdegoede
+alias sunxi          uboot, jagan, maxime
 alias tegra          uboot, sjg, Tom Warren <twarren@nvidia.com>, Stephen Warren <swarren@nvidia.com>
 alias tegra2         tegra
 alias ti             uboot, trini
index 761d0b3e85b4caee90e8aa798a81fcfd322c593d..c19fa142f3a8dc57e05b0ff449f1af5e9621e813 100644 (file)
@@ -33,7 +33,9 @@ obj-$(CONFIG_SPL_ETH_SUPPORT) += net/
 obj-$(CONFIG_SPL_ETH_SUPPORT) += net/phy/
 obj-$(CONFIG_SPL_USBETH_SUPPORT) += net/phy/
 obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
-obj-$(CONFIG_SPL_USBETH_SUPPORT) += usb/gadget/
+obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/
+obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/udc/
+obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu/
 obj-$(CONFIG_SPL_WATCHDOG_SUPPORT) += watchdog/
 obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/
 obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
index e0d2669b71df61daf4a65cf49efa5dfd9db10720..ad4cc569a381f88d228e9e11a407dd604627d63a 100644 (file)
@@ -37,7 +37,8 @@ void bootcount_store(ulong a)
 
        /* Make sure the data is written to RAM */
        flush_dcache_range((ulong)&save_addr[0],
-                          (ulong)&save_addr[REPEAT_PATTERN + OFFS_PATTERN]);
+                          (((ulong)&save_addr[REPEAT_PATTERN + OFFS_PATTERN] &
+                            ~(ARCH_DMA_MINALIGN - 1)) + ARCH_DMA_MINALIGN));
 }
 
 ulong bootcount_load(void)
index ed97e87a959bfbdc936d438e7dd3d9c2336389e5..d15504c3aaebda86250b56233d7871a8249bc061 100644 (file)
@@ -691,6 +691,13 @@ static ulong rk3288_clk_set_rate(struct clk *clk, ulong rate)
 
        gclk_rate = rkclk_pll_get_rate(priv->cru, CLK_GENERAL);
        switch (clk->id) {
+       case PLL_APLL:
+               /* We only support a fixed rate here */
+               if (rate != 1800000000)
+                       return -EINVAL;
+               rk3288_clk_configure_cpu(priv->cru, priv->grf);
+               new_rate = rate;
+               break;
        case CLK_DDR:
                new_rate = rkclk_configure_ddr(priv->cru, priv->grf, rate);
                break;
index 471e18aeaa0b3c54091a100214dab6ab735ff69c..85e0a8647f278646464971691e6fc6ab78ae19e3 100644 (file)
@@ -19,8 +19,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define GPIO_SWPORTA_DR                0x00
-#define GPIO_SWPORTA_DDR       0x04
+#define GPIO_SWPORT_DR(p)      (0x00 + (p) * 0xc)
+#define GPIO_SWPORT_DDR(p)     (0x04 + (p) * 0xc)
 #define GPIO_INTEN             0x30
 #define GPIO_INTMASK           0x34
 #define GPIO_INTTYPE_LEVEL     0x38
@@ -28,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define GPIO_INTSTATUS         0x40
 #define GPIO_PORTA_DEBOUNCE    0x48
 #define GPIO_PORTA_EOI         0x4c
-#define GPIO_EXT_PORTA         0x50
+#define GPIO_EXT_PORT(p)       (0x50 + (p) * 4)
 
 struct gpio_dwapb_platdata {
        const char      *name;
@@ -41,7 +41,7 @@ static int dwapb_gpio_direction_input(struct udevice *dev, unsigned pin)
 {
        struct gpio_dwapb_platdata *plat = dev_get_platdata(dev);
 
-       clrbits_le32(plat->base + GPIO_SWPORTA_DDR, 1 << pin);
+       clrbits_le32(plat->base + GPIO_SWPORT_DDR(plat->bank), 1 << pin);
        return 0;
 }
 
@@ -50,12 +50,12 @@ static int dwapb_gpio_direction_output(struct udevice *dev, unsigned pin,
 {
        struct gpio_dwapb_platdata *plat = dev_get_platdata(dev);
 
-       setbits_le32(plat->base + GPIO_SWPORTA_DDR, 1 << pin);
+       setbits_le32(plat->base + GPIO_SWPORT_DDR(plat->bank), 1 << pin);
 
        if (val)
-               setbits_le32(plat->base + GPIO_SWPORTA_DR, 1 << pin);
+               setbits_le32(plat->base + GPIO_SWPORT_DR(plat->bank), 1 << pin);
        else
-               clrbits_le32(plat->base + GPIO_SWPORTA_DR, 1 << pin);
+               clrbits_le32(plat->base + GPIO_SWPORT_DR(plat->bank), 1 << pin);
 
        return 0;
 }
@@ -63,7 +63,7 @@ static int dwapb_gpio_direction_output(struct udevice *dev, unsigned pin,
 static int dwapb_gpio_get_value(struct udevice *dev, unsigned pin)
 {
        struct gpio_dwapb_platdata *plat = dev_get_platdata(dev);
-       return !!(readl(plat->base + GPIO_EXT_PORTA) & (1 << pin));
+       return !!(readl(plat->base + GPIO_EXT_PORT(plat->bank)) & (1 << pin));
 }
 
 
@@ -72,9 +72,9 @@ static int dwapb_gpio_set_value(struct udevice *dev, unsigned pin, int val)
        struct gpio_dwapb_platdata *plat = dev_get_platdata(dev);
 
        if (val)
-               setbits_le32(plat->base + GPIO_SWPORTA_DR, 1 << pin);
+               setbits_le32(plat->base + GPIO_SWPORT_DR(plat->bank), 1 << pin);
        else
-               clrbits_le32(plat->base + GPIO_SWPORTA_DR, 1 << pin);
+               clrbits_le32(plat->base + GPIO_SWPORT_DR(plat->bank), 1 << pin);
 
        return 0;
 }
index 4380c7c195a628e343f1f0b4719be6b6bbf3fdb3..d6b7e4f510c93c3faadaa6b84646bc7402e68b1b 100644 (file)
@@ -494,6 +494,7 @@ int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value)
 {
        struct mmc_cmd cmd;
        int timeout = 1000;
+       int retries = 3;
        int ret;
 
        cmd.cmdidx = MMC_CMD_SWITCH;
@@ -502,11 +503,17 @@ int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value)
                                 (index << 16) |
                                 (value << 8);
 
-       ret = mmc_send_cmd(mmc, &cmd, NULL);
+       while (retries > 0) {
+               ret = mmc_send_cmd(mmc, &cmd, NULL);
 
-       /* Waiting for the ready status */
-       if (!ret)
-               ret = mmc_send_status(mmc, timeout);
+               /* Waiting for the ready status */
+               if (!ret) {
+                       ret = mmc_send_status(mmc, timeout);
+                       return ret;
+               }
+
+               retries--;
+       }
 
        return ret;
 
index 6953accce1234fe8c4bba78551e9f9e203473316..b8716c93cb06df7e04f3d3b3719c50cee65bf8f7 100644 (file)
@@ -463,7 +463,7 @@ struct mmc *sunxi_mmc_init(int sdc_no)
 
        cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
        cfg->host_caps = MMC_MODE_4BIT;
-#ifdef CONFIG_MACH_SUN50I
+#if defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUN8I)
        if (sdc_no == 2)
                cfg->host_caps = MMC_MODE_8BIT;
 #endif
index df154bfd32b949d29ee936009ee761a36eb341ac..65bb040407b2cccd619c85681c2fab26fa83e0fe 100644 (file)
@@ -87,6 +87,13 @@ config NAND_MXS
          This enables NAND driver for the NAND flash controller on the
          MXS processors.
 
+config NAND_ZYNQ
+       bool "Support for Zynq Nand controller"
+       select SYS_NAND_SELF_INIT
+       help
+         This enables Nand driver support for Nand flash controller
+         found on Zynq SoC.
+
 comment "Generic NAND options"
 
 # Enhance depends when converting drivers to Kconfig which use this config
index 1df9273cdd1114f64f161a9d987ce2ae89f590d2..fd4bb66f50d2e3b71746273f6e7fd7264092ee40 100644 (file)
@@ -67,6 +67,7 @@ obj-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 obj-$(CONFIG_NAND_OMAP_ELM) += omap_elm.o
 obj-$(CONFIG_NAND_PLAT) += nand_plat.o
 obj-$(CONFIG_NAND_SUNXI) += sunxi_nand.o
+obj-$(CONFIG_NAND_ZYNQ) += zynq_nand.o
 
 else  # minimal SPL drivers
 
index 86f7526a84e85b36787d9a4752b5241fe0145ad2..a8f795d957ffa03f2ab6e29defb5c1915afb684f 100644 (file)
@@ -853,6 +853,8 @@ static int arasan_nand_send_rdcmd(struct arasan_nand_command_format *curr_cmd,
                reg_val |= (page_val << ARASAN_NAND_CMD_PG_SIZE_SHIFT);
        }
 
+       reg_val &= ~ARASAN_NAND_CMD_ECC_ON_MASK;
+
        reg_val &= ~ARASAN_NAND_CMD_ADDR_CYCL_MASK;
 
        addr_cycles = arasan_nand_get_addrcycle(mtd);
index ce0a14e28abb60972648ab5ba7a2ffeed95b2038..d36f9006c99dc67d2340d4d421836cc2ad7b849b 100644 (file)
@@ -46,6 +46,9 @@ struct nand_flash_dev nand_flash_ids[] = {
        {"TC58NVG2S0F 4G 3.3V 8-bit",
                { .id = {0x98, 0xdc, 0x90, 0x26, 0x76, 0x15, 0x01, 0x08} },
                  SZ_4K, SZ_512, SZ_256K, 0, 8, 224, NAND_ECC_INFO(4, SZ_512) },
+       {"TC58NVG2S0H 4G 3.3V 8-bit",
+               { .id = {0x98, 0xdc, 0x90, 0x26, 0x76, 0x16, 0x08, 0x00} },
+                 SZ_4K, SZ_512, SZ_256K, 0, 8, 256, NAND_ECC_INFO(8, SZ_512) },
        {"TC58NVG3S0F 8G 3.3V 8-bit",
                { .id = {0x98, 0xd3, 0x90, 0x26, 0x76, 0x15, 0x02, 0x08} },
                  SZ_4K, SZ_1K, SZ_256K, 0, 8, 232, NAND_ECC_INFO(4, SZ_512) },
diff --git a/drivers/mtd/nand/zynq_nand.c b/drivers/mtd/nand/zynq_nand.c
new file mode 100644 (file)
index 0000000..cb3340d
--- /dev/null
@@ -0,0 +1,1186 @@
+/*
+ * (C) Copyright 2016 Xilinx, Inc.
+ *
+ * Xilinx Zynq NAND Flash Controller Driver
+ * This driver is based on plat_nand.c and mxc_nand.c drivers
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <asm/io.h>
+#include <linux/errno.h>
+#include <nand.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/nand_ecc.h>
+#include <asm/arch/hardware.h>
+
+/* The NAND flash driver defines */
+#define ZYNQ_NAND_CMD_PHASE            1
+#define ZYNQ_NAND_DATA_PHASE           2
+#define ZYNQ_NAND_ECC_SIZE             512
+#define ZYNQ_NAND_SET_OPMODE_8BIT      (0 << 0)
+#define ZYNQ_NAND_SET_OPMODE_16BIT     (1 << 0)
+#define ZYNQ_NAND_ECC_STATUS           (1 << 6)
+#define ZYNQ_MEMC_CLRCR_INT_CLR1       (1 << 4)
+#define ZYNQ_MEMC_SR_RAW_INT_ST1       (1 << 6)
+#define ZYNQ_MEMC_SR_INT_ST1           (1 << 4)
+#define ZYNQ_MEMC_NAND_ECC_MODE_MASK   0xC
+
+/* Flash memory controller operating parameters */
+#define ZYNQ_NAND_CLR_CONFIG   ((0x1 << 1)  |  /* Disable interrupt */ \
+                               (0x1 << 4)   |  /* Clear interrupt */ \
+                               (0x1 << 6))     /* Disable ECC interrupt */
+
+/* Assuming 50MHz clock (20ns cycle time) and 3V operation */
+#define ZYNQ_NAND_SET_CYCLES   ((0x2 << 20) |  /* t_rr from nand_cycles */ \
+                               (0x2 << 17)  |  /* t_ar from nand_cycles */ \
+                               (0x1 << 14)  |  /* t_clr from nand_cycles */ \
+                               (0x3 << 11)  |  /* t_wp from nand_cycles */ \
+                               (0x2 << 8)   |  /* t_rea from nand_cycles */ \
+                               (0x5 << 4)   |  /* t_wc from nand_cycles */ \
+                               (0x5 << 0))     /* t_rc from nand_cycles */
+
+
+#define ZYNQ_NAND_DIRECT_CMD   ((0x4 << 23) |  /* Chip 0 from interface 1 */ \
+                               (0x2 << 21))    /* UpdateRegs operation */
+
+#define ZYNQ_NAND_ECC_CONFIG   ((0x1 << 2)  |  /* ECC available on APB */ \
+                               (0x1 << 4)   |  /* ECC read at end of page */ \
+                               (0x0 << 5))     /* No Jumping */
+
+#define ZYNQ_NAND_ECC_CMD1     ((0x80)      |  /* Write command */ \
+                               (0x00 << 8)  |  /* Read command */ \
+                               (0x30 << 16) |  /* Read End command */ \
+                               (0x1 << 24))    /* Read End command calid */
+
+#define ZYNQ_NAND_ECC_CMD2     ((0x85)      |  /* Write col change cmd */ \
+                               (0x05 << 8)  |  /* Read col change cmd */ \
+                               (0xE0 << 16) |  /* Read col change end cmd */ \
+                               (0x1 << 24))    /* Read col change
+                                                       end cmd valid */
+/* AXI Address definitions */
+#define START_CMD_SHIFT                        3
+#define END_CMD_SHIFT                  11
+#define END_CMD_VALID_SHIFT            20
+#define ADDR_CYCLES_SHIFT              21
+#define CLEAR_CS_SHIFT                 21
+#define ECC_LAST_SHIFT                 10
+#define COMMAND_PHASE                  (0 << 19)
+#define DATA_PHASE                     (1 << 19)
+#define ONDIE_ECC_FEATURE_ADDR         0x90
+#define ONDIE_ECC_FEATURE_ENABLE       0x08
+
+#define ZYNQ_NAND_ECC_LAST     (1 << ECC_LAST_SHIFT)   /* Set ECC_Last */
+#define ZYNQ_NAND_CLEAR_CS     (1 << CLEAR_CS_SHIFT)   /* Clear chip select */
+
+/* ECC block registers bit position and bit mask */
+#define ZYNQ_NAND_ECC_BUSY     (1 << 6)        /* ECC block is busy */
+#define ZYNQ_NAND_ECC_MASK     0x00FFFFFF      /* ECC value mask */
+
+
+/* SMC register set */
+struct zynq_nand_smc_regs {
+       u32 csr;                /* 0x00 */
+       u32 reserved0[2];
+       u32 cfr;                /* 0x0C */
+       u32 dcr;                /* 0x10 */
+       u32 scr;                /* 0x14 */
+       u32 sor;                /* 0x18 */
+       u32 reserved1[249];
+       u32 esr;                /* 0x400 */
+       u32 emcr;               /* 0x404 */
+       u32 emcmd1r;            /* 0x408 */
+       u32 emcmd2r;            /* 0x40C */
+       u32 reserved2[2];
+       u32 eval0r;             /* 0x418 */
+};
+#define zynq_nand_smc_base     ((struct zynq_nand_smc_regs __iomem *)\
+                               ZYNQ_SMC_BASEADDR)
+
+/*
+ * struct zynq_nand_info - Defines the NAND flash driver instance
+ * @parts:             Pointer to the mtd_partition structure
+ * @nand_base:         Virtual address of the NAND flash device
+ * @end_cmd_pending:   End command is pending
+ * @end_cmd:           End command
+ */
+struct zynq_nand_info {
+       void __iomem    *nand_base;
+       u8              end_cmd_pending;
+       u8              end_cmd;
+};
+
+/*
+ * struct zynq_nand_command_format - Defines NAND flash command format
+ * @start_cmd:         First cycle command (Start command)
+ * @end_cmd:           Second cycle command (Last command)
+ * @addr_cycles:       Number of address cycles required to send the address
+ * @end_cmd_valid:     The second cycle command is valid for cmd or data phase
+ */
+struct zynq_nand_command_format {
+       u8 start_cmd;
+       u8 end_cmd;
+       u8 addr_cycles;
+       u8 end_cmd_valid;
+};
+
+/*  The NAND flash operations command format */
+static const struct zynq_nand_command_format zynq_nand_commands[] = {
+       {NAND_CMD_READ0, NAND_CMD_READSTART, 5, ZYNQ_NAND_CMD_PHASE},
+       {NAND_CMD_RNDOUT, NAND_CMD_RNDOUTSTART, 2, ZYNQ_NAND_CMD_PHASE},
+       {NAND_CMD_READID, NAND_CMD_NONE, 1, 0},
+       {NAND_CMD_STATUS, NAND_CMD_NONE, 0, 0},
+       {NAND_CMD_SEQIN, NAND_CMD_PAGEPROG, 5, ZYNQ_NAND_DATA_PHASE},
+       {NAND_CMD_RNDIN, NAND_CMD_NONE, 2, 0},
+       {NAND_CMD_ERASE1, NAND_CMD_ERASE2, 3, ZYNQ_NAND_CMD_PHASE},
+       {NAND_CMD_RESET, NAND_CMD_NONE, 0, 0},
+       {NAND_CMD_PARAM, NAND_CMD_NONE, 1, 0},
+       {NAND_CMD_GET_FEATURES, NAND_CMD_NONE, 1, 0},
+       {NAND_CMD_SET_FEATURES, NAND_CMD_NONE, 1, 0},
+       {NAND_CMD_NONE, NAND_CMD_NONE, 0, 0},
+       /* Add all the flash commands supported by the flash device */
+};
+
+/* Define default oob placement schemes for large and small page devices */
+static struct nand_ecclayout nand_oob_16 = {
+       .eccbytes = 3,
+       .eccpos = {0, 1, 2},
+       .oobfree = {
+               { .offset = 8, .length = 8 }
+       }
+};
+
+static struct nand_ecclayout nand_oob_64 = {
+       .eccbytes = 12,
+       .eccpos = {
+                  52, 53, 54, 55, 56, 57,
+                  58, 59, 60, 61, 62, 63},
+       .oobfree = {
+               { .offset = 2, .length = 50 }
+       }
+};
+
+static struct nand_ecclayout ondie_nand_oob_64 = {
+       .eccbytes = 32,
+
+       .eccpos = {
+               8, 9, 10, 11, 12, 13, 14, 15,
+               24, 25, 26, 27, 28, 29, 30, 31,
+               40, 41, 42, 43, 44, 45, 46, 47,
+               56, 57, 58, 59, 60, 61, 62, 63
+       },
+
+       .oobfree = {
+               { .offset = 4, .length = 4 },
+               { .offset = 20, .length = 4 },
+               { .offset = 36, .length = 4 },
+               { .offset = 52, .length = 4 }
+       }
+};
+
+/* bbt decriptors for chips with on-die ECC and
+   chips with 64-byte OOB */
+static u8 bbt_pattern[] = {'B', 'b', 't', '0' };
+static u8 mirror_pattern[] = {'1', 't', 'b', 'B' };
+
+static struct nand_bbt_descr bbt_main_descr = {
+       .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE |
+               NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
+       .offs = 4,
+       .len = 4,
+       .veroffs = 20,
+       .maxblocks = 4,
+       .pattern = bbt_pattern
+};
+
+static struct nand_bbt_descr bbt_mirror_descr = {
+       .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE |
+               NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
+       .offs = 4,
+       .len = 4,
+       .veroffs = 20,
+       .maxblocks = 4,
+       .pattern = mirror_pattern
+};
+
+/*
+ * zynq_nand_waitfor_ecc_completion - Wait for ECC completion
+ *
+ * returns: status for command completion, -1 for Timeout
+ */
+static int zynq_nand_waitfor_ecc_completion(void)
+{
+       unsigned long timeout;
+       u32 status;
+
+       /* Wait max 10us */
+       timeout = 10;
+       status = readl(&zynq_nand_smc_base->esr);
+       while (status & ZYNQ_NAND_ECC_BUSY) {
+               status = readl(&zynq_nand_smc_base->esr);
+               if (timeout == 0)
+                       return -1;
+               timeout--;
+               udelay(1);
+       }
+
+       return status;
+}
+
+/*
+ * zynq_nand_init_nand_flash - Initialize NAND controller
+ * @option:    Device property flags
+ *
+ * This function initializes the NAND flash interface on the NAND controller.
+ *
+ * returns:    0 on success or error value on failure
+ */
+static int zynq_nand_init_nand_flash(int option)
+{
+       u32 status;
+
+       /* disable interrupts */
+       writel(ZYNQ_NAND_CLR_CONFIG, &zynq_nand_smc_base->cfr);
+       /* Initialize the NAND interface by setting cycles and operation mode */
+       writel(ZYNQ_NAND_SET_CYCLES, &zynq_nand_smc_base->scr);
+       if (option & NAND_BUSWIDTH_16)
+               writel(ZYNQ_NAND_SET_OPMODE_16BIT, &zynq_nand_smc_base->sor);
+       else
+               writel(ZYNQ_NAND_SET_OPMODE_8BIT, &zynq_nand_smc_base->sor);
+
+       writel(ZYNQ_NAND_DIRECT_CMD, &zynq_nand_smc_base->dcr);
+
+       /* Wait till the ECC operation is complete */
+       status = zynq_nand_waitfor_ecc_completion();
+       if (status < 0) {
+               printf("%s: Timeout\n", __func__);
+               return status;
+       }
+
+       /* Set the command1 and command2 register */
+       writel(ZYNQ_NAND_ECC_CMD1, &zynq_nand_smc_base->emcmd1r);
+       writel(ZYNQ_NAND_ECC_CMD2, &zynq_nand_smc_base->emcmd2r);
+
+       return 0;
+}
+
+/*
+ * zynq_nand_calculate_hwecc - Calculate Hardware ECC
+ * @mtd:       Pointer to the mtd_info structure
+ * @data:      Pointer to the page data
+ * @ecc_code:  Pointer to the ECC buffer where ECC data needs to be stored
+ *
+ * This function retrieves the Hardware ECC data from the controller and returns
+ * ECC data back to the MTD subsystem.
+ *
+ * returns:    0 on success or error value on failure
+ */
+static int zynq_nand_calculate_hwecc(struct mtd_info *mtd, const u8 *data,
+               u8 *ecc_code)
+{
+       u32 ecc_value = 0;
+       u8 ecc_reg, ecc_byte;
+       u32 ecc_status;
+
+       /* Wait till the ECC operation is complete */
+       ecc_status = zynq_nand_waitfor_ecc_completion();
+       if (ecc_status < 0) {
+               printf("%s: Timeout\n", __func__);
+               return ecc_status;
+       }
+
+       for (ecc_reg = 0; ecc_reg < 4; ecc_reg++) {
+               /* Read ECC value for each block */
+               ecc_value = readl(&zynq_nand_smc_base->eval0r + ecc_reg);
+
+               /* Get the ecc status from ecc read value */
+               ecc_status = (ecc_value >> 24) & 0xFF;
+
+               /* ECC value valid */
+               if (ecc_status & ZYNQ_NAND_ECC_STATUS) {
+                       for (ecc_byte = 0; ecc_byte < 3; ecc_byte++) {
+                               /* Copy ECC bytes to MTD buffer */
+                               *ecc_code = ecc_value & 0xFF;
+                               ecc_value = ecc_value >> 8;
+                               ecc_code++;
+                       }
+               } else {
+                       debug("%s: ecc status failed\n", __func__);
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * onehot - onehot function
+ * @value:     value to check for onehot
+ *
+ * This function checks whether a value is onehot or not.
+ * onehot is if and only if one bit is set.
+ *
+ * FIXME: Try to move this in common.h
+ */
+static bool onehot(unsigned short value)
+{
+       bool onehot;
+
+       onehot = value && !(value & (value - 1));
+       return onehot;
+}
+
+/*
+ * zynq_nand_correct_data - ECC correction function
+ * @mtd:       Pointer to the mtd_info structure
+ * @buf:       Pointer to the page data
+ * @read_ecc:  Pointer to the ECC value read from spare data area
+ * @calc_ecc:  Pointer to the calculated ECC value
+ *
+ * This function corrects the ECC single bit errors & detects 2-bit errors.
+ *
+ * returns:    0 if no ECC errors found
+ *             1 if single bit error found and corrected.
+ *             -1 if multiple ECC errors found.
+ */
+static int zynq_nand_correct_data(struct mtd_info *mtd, unsigned char *buf,
+                       unsigned char *read_ecc, unsigned char *calc_ecc)
+{
+       unsigned char bit_addr;
+       unsigned int byte_addr;
+       unsigned short ecc_odd, ecc_even;
+       unsigned short read_ecc_lower, read_ecc_upper;
+       unsigned short calc_ecc_lower, calc_ecc_upper;
+
+       read_ecc_lower = (read_ecc[0] | (read_ecc[1] << 8)) & 0xfff;
+       read_ecc_upper = ((read_ecc[1] >> 4) | (read_ecc[2] << 4)) & 0xfff;
+
+       calc_ecc_lower = (calc_ecc[0] | (calc_ecc[1] << 8)) & 0xfff;
+       calc_ecc_upper = ((calc_ecc[1] >> 4) | (calc_ecc[2] << 4)) & 0xfff;
+
+       ecc_odd = read_ecc_lower ^ calc_ecc_lower;
+       ecc_even = read_ecc_upper ^ calc_ecc_upper;
+
+       if ((ecc_odd == 0) && (ecc_even == 0))
+               return 0;       /* no error */
+
+       if (ecc_odd == (~ecc_even & 0xfff)) {
+               /* bits [11:3] of error code is byte offset */
+               byte_addr = (ecc_odd >> 3) & 0x1ff;
+               /* bits [2:0] of error code is bit offset */
+               bit_addr = ecc_odd & 0x7;
+               /* Toggling error bit */
+               buf[byte_addr] ^= (1 << bit_addr);
+               return 1;
+       }
+
+       if (onehot(ecc_odd | ecc_even))
+               return 1; /* one error in parity */
+
+       return -1; /* Uncorrectable error */
+}
+
+/*
+ * zynq_nand_read_oob - [REPLACABLE] the most common OOB data read function
+ * @mtd:       mtd info structure
+ * @chip:      nand chip info structure
+ * @page:      page number to read
+ * @sndcmd:    flag whether to issue read command or not
+ */
+static int zynq_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
+                       int page)
+{
+       unsigned long data_phase_addr = 0;
+       int data_width = 4;
+       u8 *p;
+
+       chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
+
+       p = chip->oob_poi;
+       chip->read_buf(mtd, p, (mtd->oobsize - data_width));
+       p += mtd->oobsize - data_width;
+
+       data_phase_addr = (unsigned long)chip->IO_ADDR_R;
+       data_phase_addr |= ZYNQ_NAND_CLEAR_CS;
+       chip->IO_ADDR_R = (void __iomem *)data_phase_addr;
+       chip->read_buf(mtd, p, data_width);
+
+       return 0;
+}
+
+/*
+ * zynq_nand_write_oob - [REPLACABLE] the most common OOB data write function
+ * @mtd:       mtd info structure
+ * @chip:      nand chip info structure
+ * @page:      page number to write
+ */
+static int zynq_nand_write_oob(struct mtd_info *mtd, struct nand_chip *chip,
+                            int page)
+{
+       int status = 0, data_width = 4;
+       const u8 *buf = chip->oob_poi;
+       unsigned long data_phase_addr = 0;
+
+       chip->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page);
+
+       chip->write_buf(mtd, buf, (mtd->oobsize - data_width));
+       buf += mtd->oobsize - data_width;
+
+       data_phase_addr = (unsigned long)chip->IO_ADDR_W;
+       data_phase_addr |= ZYNQ_NAND_CLEAR_CS;
+       data_phase_addr |= (1 << END_CMD_VALID_SHIFT);
+       chip->IO_ADDR_W = (void __iomem *)data_phase_addr;
+       chip->write_buf(mtd, buf, data_width);
+
+       /* Send command to program the OOB data */
+       chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
+       status = chip->waitfunc(mtd, chip);
+
+       return status & NAND_STATUS_FAIL ? -EIO : 0;
+}
+
+/*
+ * zynq_nand_read_page_raw - [Intern] read raw page data without ecc
+ * @mtd:        mtd info structure
+ * @chip:       nand chip info structure
+ * @buf:        buffer to store read data
+ * @oob_required: must write chip->oob_poi to OOB
+ * @page:       page number to read
+ */
+static int zynq_nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
+                                  u8 *buf,  int oob_required, int page)
+{
+       unsigned long data_width = 4;
+       unsigned long data_phase_addr = 0;
+       u8 *p;
+
+       chip->read_buf(mtd, buf, mtd->writesize);
+
+       p = chip->oob_poi;
+       chip->read_buf(mtd, p, (mtd->oobsize - data_width));
+       p += (mtd->oobsize - data_width);
+
+       data_phase_addr = (unsigned long)chip->IO_ADDR_R;
+       data_phase_addr |= ZYNQ_NAND_CLEAR_CS;
+       chip->IO_ADDR_R = (void __iomem *)data_phase_addr;
+
+       chip->read_buf(mtd, p, data_width);
+       return 0;
+}
+
+static int zynq_nand_read_page_raw_nooob(struct mtd_info *mtd,
+               struct nand_chip *chip, u8 *buf, int oob_required, int page)
+{
+       chip->read_buf(mtd, buf, mtd->writesize);
+       return 0;
+}
+
+static int zynq_nand_read_subpage_raw(struct mtd_info *mtd,
+                                   struct nand_chip *chip, u32 data_offs,
+                                   u32 readlen, u8 *buf, int page)
+{
+       if (data_offs != 0) {
+               chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_offs, -1);
+               buf += data_offs;
+       }
+       chip->read_buf(mtd, buf, readlen);
+
+       return 0;
+}
+
+/*
+ * zynq_nand_write_page_raw - [Intern] raw page write function
+ * @mtd:        mtd info structure
+ * @chip:       nand chip info structure
+ * @buf:        data buffer
+ * @oob_required: must write chip->oob_poi to OOB
+ */
+static int zynq_nand_write_page_raw(struct mtd_info *mtd,
+       struct nand_chip *chip, const u8 *buf, int oob_required, int page)
+{
+       unsigned long data_width = 4;
+       unsigned long data_phase_addr = 0;
+       u8 *p;
+
+       chip->write_buf(mtd, buf, mtd->writesize);
+
+       p = chip->oob_poi;
+       chip->write_buf(mtd, p, (mtd->oobsize - data_width));
+       p += (mtd->oobsize - data_width);
+
+       data_phase_addr = (unsigned long)chip->IO_ADDR_W;
+       data_phase_addr |= ZYNQ_NAND_CLEAR_CS;
+       data_phase_addr |= (1 << END_CMD_VALID_SHIFT);
+       chip->IO_ADDR_W = (void __iomem *)data_phase_addr;
+
+       chip->write_buf(mtd, p, data_width);
+
+       return 0;
+}
+
+/*
+ * nand_write_page_hwecc - Hardware ECC based page write function
+ * @mtd:       Pointer to the mtd info structure
+ * @chip:      Pointer to the NAND chip info structure
+ * @buf:       Pointer to the data buffer
+ * @oob_required: must write chip->oob_poi to OOB
+ *
+ * This functions writes data and hardware generated ECC values in to the page.
+ */
+static int zynq_nand_write_page_hwecc(struct mtd_info *mtd,
+       struct nand_chip *chip, const u8 *buf, int oob_required, int page)
+{
+       int i, eccsteps, eccsize = chip->ecc.size;
+       u8 *ecc_calc = chip->buffers->ecccalc;
+       const u8 *p = buf;
+       u32 *eccpos = chip->ecc.layout->eccpos;
+       unsigned long data_phase_addr = 0;
+       unsigned long data_width = 4;
+       u8 *oob_ptr;
+
+       for (eccsteps = chip->ecc.steps; (eccsteps - 1); eccsteps--) {
+               chip->write_buf(mtd, p, eccsize);
+               p += eccsize;
+       }
+       chip->write_buf(mtd, p, (eccsize - data_width));
+       p += eccsize - data_width;
+
+       /* Set ECC Last bit to 1 */
+       data_phase_addr = (unsigned long) chip->IO_ADDR_W;
+       data_phase_addr |= ZYNQ_NAND_ECC_LAST;
+       chip->IO_ADDR_W = (void __iomem *)data_phase_addr;
+       chip->write_buf(mtd, p, data_width);
+
+       /* Wait for ECC to be calculated and read the error values */
+       p = buf;
+       chip->ecc.calculate(mtd, p, &ecc_calc[0]);
+
+       for (i = 0; i < chip->ecc.total; i++)
+               chip->oob_poi[eccpos[i]] = ~(ecc_calc[i]);
+
+       /* Clear ECC last bit */
+       data_phase_addr = (unsigned long)chip->IO_ADDR_W;
+       data_phase_addr &= ~ZYNQ_NAND_ECC_LAST;
+       chip->IO_ADDR_W = (void __iomem *)data_phase_addr;
+
+       /* Write the spare area with ECC bytes */
+       oob_ptr = chip->oob_poi;
+       chip->write_buf(mtd, oob_ptr, (mtd->oobsize - data_width));
+
+       data_phase_addr = (unsigned long)chip->IO_ADDR_W;
+       data_phase_addr |= ZYNQ_NAND_CLEAR_CS;
+       data_phase_addr |= (1 << END_CMD_VALID_SHIFT);
+       chip->IO_ADDR_W = (void __iomem *)data_phase_addr;
+       oob_ptr += (mtd->oobsize - data_width);
+       chip->write_buf(mtd, oob_ptr, data_width);
+
+       return 0;
+}
+
+/*
+ * zynq_nand_write_page_swecc - [REPLACABLE] software ecc based page
+ * write function
+ * @mtd:       mtd info structure
+ * @chip:      nand chip info structure
+ * @buf:       data buffer
+ * @oob_required: must write chip->oob_poi to OOB
+ */
+static int zynq_nand_write_page_swecc(struct mtd_info *mtd,
+       struct nand_chip *chip, const u8 *buf, int oob_required, int page)
+{
+       int i, eccsize = chip->ecc.size;
+       int eccbytes = chip->ecc.bytes;
+       int eccsteps = chip->ecc.steps;
+       u8 *ecc_calc = chip->buffers->ecccalc;
+       const u8 *p = buf;
+       u32 *eccpos = chip->ecc.layout->eccpos;
+
+       /* Software ecc calculation */
+       for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
+               chip->ecc.calculate(mtd, p, &ecc_calc[i]);
+
+       for (i = 0; i < chip->ecc.total; i++)
+               chip->oob_poi[eccpos[i]] = ecc_calc[i];
+
+       return chip->ecc.write_page_raw(mtd, chip, buf, 1, page);
+}
+
+/*
+ * nand_read_page_hwecc - Hardware ECC based page read function
+ * @mtd:       Pointer to the mtd info structure
+ * @chip:      Pointer to the NAND chip info structure
+ * @buf:       Pointer to the buffer to store read data
+ * @oob_required: must write chip->oob_poi to OOB
+ * @page:      page number to read
+ *
+ * This functions reads data and checks the data integrity by comparing hardware
+ * generated ECC values and read ECC values from spare area.
+ *
+ * returns:    0 always and updates ECC operation status in to MTD structure
+ */
+static int zynq_nand_read_page_hwecc(struct mtd_info *mtd,
+       struct nand_chip *chip, u8 *buf, int oob_required, int page)
+{
+       int i, stat, eccsteps, eccsize = chip->ecc.size;
+       int eccbytes = chip->ecc.bytes;
+       u8 *p = buf;
+       u8 *ecc_calc = chip->buffers->ecccalc;
+       u8 *ecc_code = chip->buffers->ecccode;
+       u32 *eccpos = chip->ecc.layout->eccpos;
+       unsigned long data_phase_addr = 0;
+       unsigned long data_width = 4;
+       u8 *oob_ptr;
+
+       for (eccsteps = chip->ecc.steps; (eccsteps - 1); eccsteps--) {
+               chip->read_buf(mtd, p, eccsize);
+               p += eccsize;
+       }
+       chip->read_buf(mtd, p, (eccsize - data_width));
+       p += eccsize - data_width;
+
+       /* Set ECC Last bit to 1 */
+       data_phase_addr = (unsigned long)chip->IO_ADDR_R;
+       data_phase_addr |= ZYNQ_NAND_ECC_LAST;
+       chip->IO_ADDR_R = (void __iomem *)data_phase_addr;
+       chip->read_buf(mtd, p, data_width);
+
+       /* Read the calculated ECC value */
+       p = buf;
+       chip->ecc.calculate(mtd, p, &ecc_calc[0]);
+
+       /* Clear ECC last bit */
+       data_phase_addr = (unsigned long)chip->IO_ADDR_R;
+       data_phase_addr &= ~ZYNQ_NAND_ECC_LAST;
+       chip->IO_ADDR_R = (void __iomem *)data_phase_addr;
+
+       /* Read the stored ECC value */
+       oob_ptr = chip->oob_poi;
+       chip->read_buf(mtd, oob_ptr, (mtd->oobsize - data_width));
+
+       /* de-assert chip select */
+       data_phase_addr = (unsigned long)chip->IO_ADDR_R;
+       data_phase_addr |= ZYNQ_NAND_CLEAR_CS;
+       chip->IO_ADDR_R = (void __iomem *)data_phase_addr;
+
+       oob_ptr += (mtd->oobsize - data_width);
+       chip->read_buf(mtd, oob_ptr, data_width);
+
+       for (i = 0; i < chip->ecc.total; i++)
+               ecc_code[i] = ~(chip->oob_poi[eccpos[i]]);
+
+       eccsteps = chip->ecc.steps;
+       p = buf;
+
+       /* Check ECC error for all blocks and correct if it is correctable */
+       for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
+               stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]);
+               if (stat < 0)
+                       mtd->ecc_stats.failed++;
+               else
+                       mtd->ecc_stats.corrected += stat;
+       }
+       return 0;
+}
+
+/*
+ * zynq_nand_read_page_swecc - [REPLACABLE] software ecc based page
+ * read function
+ * @mtd:       mtd info structure
+ * @chip:      nand chip info structure
+ * @buf:       buffer to store read data
+ * @page:      page number to read
+ */
+static int zynq_nand_read_page_swecc(struct mtd_info *mtd,
+       struct nand_chip *chip, u8 *buf, int oob_required,  int page)
+{
+       int i, eccsize = chip->ecc.size;
+       int eccbytes = chip->ecc.bytes;
+       int eccsteps = chip->ecc.steps;
+       u8 *p = buf;
+       u8 *ecc_calc = chip->buffers->ecccalc;
+       u8 *ecc_code = chip->buffers->ecccode;
+       u32 *eccpos = chip->ecc.layout->eccpos;
+
+       chip->ecc.read_page_raw(mtd, chip, buf, 1, page);
+
+       for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
+               chip->ecc.calculate(mtd, p, &ecc_calc[i]);
+
+       for (i = 0; i < chip->ecc.total; i++)
+               ecc_code[i] = chip->oob_poi[eccpos[i]];
+
+       eccsteps = chip->ecc.steps;
+       p = buf;
+
+       for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
+               int stat;
+
+               stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]);
+               if (stat < 0)
+                       mtd->ecc_stats.failed++;
+               else
+                       mtd->ecc_stats.corrected += stat;
+       }
+       return 0;
+}
+
+/*
+ * zynq_nand_select_chip - Select the flash device
+ * @mtd:       Pointer to the mtd_info structure
+ * @chip:      Chip number to be selected
+ *
+ * This function is empty as the NAND controller handles chip select line
+ * internally based on the chip address passed in command and data phase.
+ */
+static void zynq_nand_select_chip(struct mtd_info *mtd, int chip)
+{
+       /* Not support multiple chips yet */
+}
+
+/*
+ * zynq_nand_cmd_function - Send command to NAND device
+ * @mtd:       Pointer to the mtd_info structure
+ * @command:   The command to be sent to the flash device
+ * @column:    The column address for this command, -1 if none
+ * @page_addr: The page address for this command, -1 if none
+ */
+static void zynq_nand_cmd_function(struct mtd_info *mtd, unsigned int command,
+                                int column, int page_addr)
+{
+       struct nand_chip *chip = mtd->priv;
+       const struct zynq_nand_command_format *curr_cmd = NULL;
+       struct zynq_nand_info *xnand = (struct zynq_nand_info *)chip->priv;
+       void *cmd_addr;
+       unsigned long cmd_data = 0;
+       unsigned long cmd_phase_addr = 0;
+       unsigned long data_phase_addr = 0;
+       u8 end_cmd = 0;
+       u8 end_cmd_valid = 0;
+       u32 index;
+
+       if (xnand->end_cmd_pending) {
+               /* Check for end command if this command request is same as the
+                * pending command then return
+                */
+               if (xnand->end_cmd == command) {
+                       xnand->end_cmd = 0;
+                       xnand->end_cmd_pending = 0;
+                       return;
+               }
+       }
+
+       /* Emulate NAND_CMD_READOOB for large page device */
+       if ((mtd->writesize > ZYNQ_NAND_ECC_SIZE) &&
+           (command == NAND_CMD_READOOB)) {
+               column += mtd->writesize;
+               command = NAND_CMD_READ0;
+       }
+
+       /* Get the command format */
+       for (index = 0; index < ARRAY_SIZE(zynq_nand_commands); index++)
+               if (command == zynq_nand_commands[index].start_cmd)
+                       break;
+
+       if (index == ARRAY_SIZE(zynq_nand_commands)) {
+               printf("%s: Unsupported start cmd %02x\n", __func__, command);
+               return;
+       }
+       curr_cmd = &zynq_nand_commands[index];
+
+       /* Clear interrupt */
+       writel(ZYNQ_MEMC_CLRCR_INT_CLR1, &zynq_nand_smc_base->cfr);
+
+       /* Get the command phase address */
+       if (curr_cmd->end_cmd_valid == ZYNQ_NAND_CMD_PHASE)
+               end_cmd_valid = 1;
+
+       if (curr_cmd->end_cmd == NAND_CMD_NONE)
+               end_cmd = 0x0;
+       else
+               end_cmd = curr_cmd->end_cmd;
+
+       cmd_phase_addr = (unsigned long)xnand->nand_base        |
+                       (curr_cmd->addr_cycles << ADDR_CYCLES_SHIFT)    |
+                       (end_cmd_valid << END_CMD_VALID_SHIFT)          |
+                       (COMMAND_PHASE)                                 |
+                       (end_cmd << END_CMD_SHIFT)                      |
+                       (curr_cmd->start_cmd << START_CMD_SHIFT);
+
+       cmd_addr = (void __iomem *)cmd_phase_addr;
+
+       /* Get the data phase address */
+       end_cmd_valid = 0;
+
+       data_phase_addr = (unsigned long)xnand->nand_base       |
+                       (0x0 << CLEAR_CS_SHIFT)                         |
+                       (end_cmd_valid << END_CMD_VALID_SHIFT)          |
+                       (DATA_PHASE)                                    |
+                       (end_cmd << END_CMD_SHIFT)                      |
+                       (0x0 << ECC_LAST_SHIFT);
+
+       chip->IO_ADDR_R = (void  __iomem *)data_phase_addr;
+       chip->IO_ADDR_W = chip->IO_ADDR_R;
+
+       /* Command phase AXI Read & Write */
+       if (column != -1 && page_addr != -1) {
+               /* Adjust columns for 16 bit bus width */
+               if (chip->options & NAND_BUSWIDTH_16)
+                       column >>= 1;
+               cmd_data = column;
+               if (mtd->writesize > ZYNQ_NAND_ECC_SIZE) {
+                       cmd_data |= page_addr << 16;
+                       /* Another address cycle for devices > 128MiB */
+                       if (chip->chipsize > (128 << 20)) {
+                               writel(cmd_data, cmd_addr);
+                               cmd_data = (page_addr >> 16);
+                       }
+               } else {
+                       cmd_data |= page_addr << 8;
+               }
+       } else if (page_addr != -1)  { /* Erase */
+               cmd_data = page_addr;
+       } else if (column != -1) { /* Change read/write column, read id etc */
+               /* Adjust columns for 16 bit bus width */
+               if ((chip->options & NAND_BUSWIDTH_16) &&
+                   ((command == NAND_CMD_READ0) ||
+                    (command == NAND_CMD_SEQIN) ||
+                    (command == NAND_CMD_RNDOUT) ||
+                    (command == NAND_CMD_RNDIN)))
+                       column >>= 1;
+               cmd_data = column;
+       }
+
+       writel(cmd_data, cmd_addr);
+
+       if (curr_cmd->end_cmd_valid) {
+               xnand->end_cmd = curr_cmd->end_cmd;
+               xnand->end_cmd_pending = 1;
+       }
+
+       ndelay(100);
+
+       if ((command == NAND_CMD_READ0) ||
+           (command == NAND_CMD_RESET) ||
+           (command == NAND_CMD_PARAM) ||
+           (command == NAND_CMD_GET_FEATURES))
+               /* wait until command is processed */
+               nand_wait_ready(mtd);
+}
+
+/*
+ * zynq_nand_read_buf - read chip data into buffer
+ * @mtd:        MTD device structure
+ * @buf:        buffer to store date
+ * @len:        number of bytes to read
+ */
+static void zynq_nand_read_buf(struct mtd_info *mtd, u8 *buf, int len)
+{
+       struct nand_chip *chip = mtd->priv;
+
+       /* Make sure that buf is 32 bit aligned */
+       if (((unsigned long)buf & 0x3) != 0) {
+               if (((unsigned long)buf & 0x1) != 0) {
+                       if (len) {
+                               *buf = readb(chip->IO_ADDR_R);
+                               buf += 1;
+                               len--;
+                       }
+               }
+
+               if (((unsigned long)buf & 0x3) != 0) {
+                       if (len >= 2) {
+                               *(u16 *)buf = readw(chip->IO_ADDR_R);
+                               buf += 2;
+                               len -= 2;
+                       }
+               }
+       }
+
+       /* copy aligned data */
+       while (len >= 4) {
+               *(u32 *)buf = readl(chip->IO_ADDR_R);
+               buf += 4;
+               len -= 4;
+       }
+
+       /* mop up any remaining bytes */
+       if (len) {
+               if (len >= 2) {
+                       *(u16 *)buf = readw(chip->IO_ADDR_R);
+                       buf += 2;
+                       len -= 2;
+               }
+               if (len)
+                       *buf = readb(chip->IO_ADDR_R);
+       }
+}
+
+/*
+ * zynq_nand_write_buf - write buffer to chip
+ * @mtd:        MTD device structure
+ * @buf:        data buffer
+ * @len:        number of bytes to write
+ */
+static void zynq_nand_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
+{
+       struct nand_chip *chip = mtd->priv;
+       const u32 *nand = chip->IO_ADDR_W;
+
+       /* Make sure that buf is 32 bit aligned */
+       if (((unsigned long)buf & 0x3) != 0) {
+               if (((unsigned long)buf & 0x1) != 0) {
+                       if (len) {
+                               writeb(*buf, nand);
+                               buf += 1;
+                               len--;
+                       }
+               }
+
+               if (((unsigned long)buf & 0x3) != 0) {
+                       if (len >= 2) {
+                               writew(*(u16 *)buf, nand);
+                               buf += 2;
+                               len -= 2;
+                       }
+               }
+       }
+
+       /* copy aligned data */
+       while (len >= 4) {
+               writel(*(u32 *)buf, nand);
+               buf += 4;
+               len -= 4;
+       }
+
+       /* mop up any remaining bytes */
+       if (len) {
+               if (len >= 2) {
+                       writew(*(u16 *)buf, nand);
+                       buf += 2;
+                       len -= 2;
+               }
+
+               if (len)
+                       writeb(*buf, nand);
+       }
+}
+
+/*
+ * zynq_nand_device_ready - Check device ready/busy line
+ * @mtd:       Pointer to the mtd_info structure
+ *
+ * returns:    0 on busy or 1 on ready state
+ */
+static int zynq_nand_device_ready(struct mtd_info *mtd)
+{
+       u32 csr_val;
+
+       csr_val = readl(&zynq_nand_smc_base->csr);
+       /* Check the raw_int_status1 bit */
+       if (csr_val & ZYNQ_MEMC_SR_RAW_INT_ST1) {
+               /* Clear the interrupt condition */
+               writel(ZYNQ_MEMC_SR_INT_ST1, &zynq_nand_smc_base->cfr);
+               return 1;
+       }
+
+       return 0;
+}
+
+static int zynq_nand_init(struct nand_chip *nand_chip, int devnum)
+{
+       struct zynq_nand_info *xnand;
+       struct mtd_info *mtd;
+       unsigned long ecc_page_size;
+       u8 maf_id, dev_id, i;
+       u8 get_feature[4];
+       u8 set_feature[4] = {ONDIE_ECC_FEATURE_ENABLE, 0x00, 0x00, 0x00};
+       unsigned long ecc_cfg;
+       int ondie_ecc_enabled = 0;
+       int err = -1;
+
+       xnand = calloc(1, sizeof(struct zynq_nand_info));
+       if (!xnand) {
+               printf("%s: failed to allocate\n", __func__);
+               goto fail;
+       }
+
+       xnand->nand_base = (void __iomem *)ZYNQ_NAND_BASEADDR;
+       mtd = (struct mtd_info *)&nand_info[0];
+
+       nand_chip->priv = xnand;
+       mtd->priv = nand_chip;
+
+       /* Set address of NAND IO lines */
+       nand_chip->IO_ADDR_R = xnand->nand_base;
+       nand_chip->IO_ADDR_W = xnand->nand_base;
+
+       /* Set the driver entry points for MTD */
+       nand_chip->cmdfunc = zynq_nand_cmd_function;
+       nand_chip->dev_ready = zynq_nand_device_ready;
+       nand_chip->select_chip = zynq_nand_select_chip;
+
+       /* If we don't set this delay driver sets 20us by default */
+       nand_chip->chip_delay = 30;
+
+       /* Buffer read/write routines */
+       nand_chip->read_buf = zynq_nand_read_buf;
+       nand_chip->write_buf = zynq_nand_write_buf;
+
+       nand_chip->bbt_options = NAND_BBT_USE_FLASH;
+
+       /* Initialize the NAND flash interface on NAND controller */
+       if (zynq_nand_init_nand_flash(nand_chip->options) < 0) {
+               printf("%s: nand flash init failed\n", __func__);
+               goto fail;
+       }
+
+       /* first scan to find the device and get the page size */
+       if (nand_scan_ident(mtd, 1, NULL)) {
+               printf("%s: nand_scan_ident failed\n", __func__);
+               goto fail;
+       }
+       /* Send the command for reading device ID */
+       nand_chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
+       nand_chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);
+
+       /* Read manufacturer and device IDs */
+       maf_id = nand_chip->read_byte(mtd);
+       dev_id = nand_chip->read_byte(mtd);
+
+       if ((maf_id == 0x2c) && ((dev_id == 0xf1) ||
+                                (dev_id == 0xa1) || (dev_id == 0xb1) ||
+                                (dev_id == 0xaa) || (dev_id == 0xba) ||
+                                (dev_id == 0xda) || (dev_id == 0xca) ||
+                                (dev_id == 0xac) || (dev_id == 0xbc) ||
+                                (dev_id == 0xdc) || (dev_id == 0xcc) ||
+                                (dev_id == 0xa3) || (dev_id == 0xb3) ||
+                                (dev_id == 0xd3) || (dev_id == 0xc3))) {
+               nand_chip->cmdfunc(mtd, NAND_CMD_SET_FEATURES,
+                                               ONDIE_ECC_FEATURE_ADDR, -1);
+               for (i = 0; i < 4; i++)
+                       writeb(set_feature[i], nand_chip->IO_ADDR_W);
+
+               /* Wait for 1us after writing data with SET_FEATURES command */
+               ndelay(1000);
+
+               nand_chip->cmdfunc(mtd, NAND_CMD_GET_FEATURES,
+                                               ONDIE_ECC_FEATURE_ADDR, -1);
+               nand_chip->read_buf(mtd, get_feature, 4);
+
+               if (get_feature[0] & ONDIE_ECC_FEATURE_ENABLE) {
+                       debug("%s: OnDie ECC flash\n", __func__);
+                       ondie_ecc_enabled = 1;
+               } else {
+                       printf("%s: Unable to detect OnDie ECC\n", __func__);
+               }
+       }
+
+       if (ondie_ecc_enabled) {
+               /* Bypass the controller ECC block */
+               ecc_cfg = readl(&zynq_nand_smc_base->emcr);
+               ecc_cfg &= ~ZYNQ_MEMC_NAND_ECC_MODE_MASK;
+               writel(ecc_cfg, &zynq_nand_smc_base->emcr);
+
+               /* The software ECC routines won't work
+                * with the SMC controller
+                */
+               nand_chip->ecc.mode = NAND_ECC_HW;
+               nand_chip->ecc.strength = 1;
+               nand_chip->ecc.read_page = zynq_nand_read_page_raw_nooob;
+               nand_chip->ecc.read_subpage = zynq_nand_read_subpage_raw;
+               nand_chip->ecc.write_page = zynq_nand_write_page_raw;
+               nand_chip->ecc.read_page_raw = zynq_nand_read_page_raw;
+               nand_chip->ecc.write_page_raw = zynq_nand_write_page_raw;
+               nand_chip->ecc.read_oob = zynq_nand_read_oob;
+               nand_chip->ecc.write_oob = zynq_nand_write_oob;
+               nand_chip->ecc.size = mtd->writesize;
+               nand_chip->ecc.bytes = 0;
+
+               /* NAND with on-die ECC supports subpage reads */
+               nand_chip->options |= NAND_SUBPAGE_READ;
+
+               /* On-Die ECC spare bytes offset 8 is used for ECC codes */
+               if (ondie_ecc_enabled) {
+                       nand_chip->ecc.layout = &ondie_nand_oob_64;
+                       /* Use the BBT pattern descriptors */
+                       nand_chip->bbt_td = &bbt_main_descr;
+                       nand_chip->bbt_md = &bbt_mirror_descr;
+               }
+       } else {
+               /* Hardware ECC generates 3 bytes ECC code for each 512 bytes */
+               nand_chip->ecc.mode = NAND_ECC_HW;
+               nand_chip->ecc.strength = 1;
+               nand_chip->ecc.size = ZYNQ_NAND_ECC_SIZE;
+               nand_chip->ecc.bytes = 3;
+               nand_chip->ecc.calculate = zynq_nand_calculate_hwecc;
+               nand_chip->ecc.correct = zynq_nand_correct_data;
+               nand_chip->ecc.hwctl = NULL;
+               nand_chip->ecc.read_page = zynq_nand_read_page_hwecc;
+               nand_chip->ecc.write_page = zynq_nand_write_page_hwecc;
+               nand_chip->ecc.read_page_raw = zynq_nand_read_page_raw;
+               nand_chip->ecc.write_page_raw = zynq_nand_write_page_raw;
+               nand_chip->ecc.read_oob = zynq_nand_read_oob;
+               nand_chip->ecc.write_oob = zynq_nand_write_oob;
+
+               switch (mtd->writesize) {
+               case 512:
+                       ecc_page_size = 0x1;
+                       /* Set the ECC memory config register */
+                       writel((ZYNQ_NAND_ECC_CONFIG | ecc_page_size),
+                              &zynq_nand_smc_base->emcr);
+                       break;
+               case 1024:
+                       ecc_page_size = 0x2;
+                       /* Set the ECC memory config register */
+                       writel((ZYNQ_NAND_ECC_CONFIG | ecc_page_size),
+                              &zynq_nand_smc_base->emcr);
+                       break;
+               case 2048:
+                       ecc_page_size = 0x3;
+                       /* Set the ECC memory config register */
+                       writel((ZYNQ_NAND_ECC_CONFIG | ecc_page_size),
+                              &zynq_nand_smc_base->emcr);
+                       break;
+               default:
+                       nand_chip->ecc.mode = NAND_ECC_SOFT;
+                       nand_chip->ecc.calculate = nand_calculate_ecc;
+                       nand_chip->ecc.correct = nand_correct_data;
+                       nand_chip->ecc.read_page = zynq_nand_read_page_swecc;
+                       nand_chip->ecc.write_page = zynq_nand_write_page_swecc;
+                       nand_chip->ecc.size = 256;
+                       break;
+               }
+
+               if (mtd->oobsize == 16)
+                       nand_chip->ecc.layout = &nand_oob_16;
+               else if (mtd->oobsize == 64)
+                       nand_chip->ecc.layout = &nand_oob_64;
+               else
+                       printf("%s: No oob layout found\n", __func__);
+       }
+
+       /* Second phase scan */
+       if (nand_scan_tail(mtd)) {
+               printf("%s: nand_scan_tail failed\n", __func__);
+               goto fail;
+       }
+       if (nand_register(devnum, mtd))
+               goto fail;
+       return 0;
+fail:
+       free(xnand);
+       return err;
+}
+
+static struct nand_chip nand_chip[CONFIG_SYS_MAX_NAND_DEVICE];
+
+void board_nand_init(void)
+{
+       struct nand_chip *nand = &nand_chip[0];
+
+       if (zynq_nand_init(nand, 0))
+               puts("ZYNQ NAND init failed\n");
+}
index f3dc40963251038d2c471b9807ae0c6b4c643b03..fcda02341216ec9da1dd8068e1f3d9c221d189e8 100644 (file)
@@ -12,7 +12,7 @@ obj-$(CONFIG_SPL_SPI_BOOT)    += fsl_espi_spl.o
 obj-$(CONFIG_SPL_SPI_SUNXI)    += sunxi_spi_spl.o
 endif
 
-obj-$(CONFIG_SPI_FLASH) += sf_probe.o spi_flash.o sf_params.o sf.o
+obj-$(CONFIG_SPI_FLASH) += sf_probe.o spi_flash.o spi_flash_ids.o sf.o
 obj-$(CONFIG_SPI_FLASH_DATAFLASH) += sf_dataflash.o
 obj-$(CONFIG_SPI_FLASH_MTD) += sf_mtd.o
 obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
index f59134ff9260dbd38b4dcec07bc29b74e7b09ca7..4944059fa3f16c1d8710089f18e92246854bea3b 100644 (file)
@@ -88,7 +88,7 @@ struct sandbox_spi_flash {
        /* The current flash status (see STAT_XXX defines above) */
        u16 status;
        /* Data describing the flash we're emulating */
-       const struct spi_flash_params *data;
+       const struct spi_flash_info *data;
        /* The file on disk to serv up data from */
        int fd;
 };
@@ -112,7 +112,7 @@ static int sandbox_sf_probe(struct udevice *dev)
        struct sandbox_spi_flash *sbsf = dev_get_priv(dev);
        const char *file;
        size_t len, idname_len;
-       const struct spi_flash_params *data;
+       const struct spi_flash_info *data;
        struct sandbox_spi_flash_plat_data *pdata = dev_get_platdata(dev);
        struct sandbox_state *state = state_get_current();
        struct udevice *bus = dev->parent;
@@ -168,7 +168,7 @@ static int sandbox_sf_probe(struct udevice *dev)
        }
        debug("%s: device='%s'\n", __func__, spec);
 
-       for (data = spi_flash_params_table; data->name; data++) {
+       for (data = spi_flash_ids; data->name; data++) {
                len = strlen(data->name);
                if (idname_len != len)
                        continue;
@@ -289,7 +289,7 @@ static int sandbox_sf_process_cmd(struct sandbox_spi_flash *sbsf, const u8 *rx,
                /* we only support erase here */
                if (sbsf->cmd == CMD_ERASE_CHIP) {
                        sbsf->erase_size = sbsf->data->sector_size *
-                               sbsf->data->nr_sectors;
+                               sbsf->data->n_sectors;
                } else if (sbsf->cmd == CMD_ERASE_4K && (flags & SECT_4K)) {
                        sbsf->erase_size = 4 << 10;
                } else if (sbsf->cmd == CMD_ERASE_64K && !(flags & SECT_4K)) {
@@ -359,7 +359,8 @@ static int sandbox_sf_xfer(struct udevice *dev, unsigned int bitlen,
                        debug(" id: off:%u tx:", sbsf->off);
                        if (sbsf->off < IDCODE_LEN) {
                                /* Extract correct byte from ID 0x00aabbcc */
-                               id = sbsf->data->jedec >>
+                               id = ((JEDEC_MFR(sbsf->data) << 16) |
+                                       JEDEC_ID(sbsf->data)) >>
                                        (8 * (IDCODE_LEN - 1 - sbsf->off));
                        } else {
                                id = 0;
index 664e86082b19c95e08a68f1443f1efd18f89d5ca..d5e175ca0000f571ed3cfa290cbd12653cd10f76 100644 (file)
@@ -18,10 +18,6 @@ static int spi_flash_read_write(struct spi_slave *spi,
        unsigned long flags = SPI_XFER_BEGIN;
        int ret;
 
-#ifdef CONFIG_SF_DUAL_FLASH
-       if (spi->flags & SPI_XFER_U_PAGE)
-               flags |= SPI_XFER_U_PAGE;
-#endif
        if (data_len == 0)
                flags |= SPI_XFER_END;
 
index b2a56da7cad688423d5639980b99cf0812badc44..bcddfa07556bb9f1bd68b6606f29d20e22b84375 100644 (file)
@@ -1,12 +1,12 @@
 /*
- *
  * Atmel DataFlash probing
  *
  * Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc.
  * Haikun Wang (haikun.wang@freescale.com)
  *
  * SPDX-License-Identifier:    GPL-2.0+
-*/
+ */
+
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
 #define OP_WRITE_SECURITY_REVC 0x9A
 #define OP_WRITE_SECURITY      0x9B    /* revision D */
 
-
 struct dataflash {
        uint8_t                 command[16];
        unsigned short          page_offset;    /* offset in flash address */
 };
 
-/*
- * Return the status of the DataFlash device.
- */
+/* Return the status of the DataFlash device */
 static inline int dataflash_status(struct spi_slave *spi)
 {
        int ret;
@@ -114,9 +111,7 @@ static int dataflash_waitready(struct spi_slave *spi)
        return -ETIME;
 }
 
-/*
- * Erase pages of flash.
- */
+/* Erase pages of flash */
 static int spi_dataflash_erase(struct udevice *dev, u32 offset, size_t len)
 {
        struct dataflash        *dataflash;
@@ -147,7 +142,7 @@ static int spi_dataflash_erase(struct udevice *dev, u32 offset, size_t len)
 
        status = spi_claim_bus(spi);
        if (status) {
-               debug("SPI DATAFLASH: unable to claim SPI bus\n");
+               debug("dataflash: unable to claim SPI bus\n");
                return status;
        }
 
@@ -232,7 +227,7 @@ static int spi_dataflash_read(struct udevice *dev, u32 offset, size_t len,
 
        status = spi_claim_bus(spi);
        if (status) {
-               debug("SPI DATAFLASH: unable to claim SPI bus\n");
+               debug("dataflash: unable to claim SPI bus\n");
                return status;
        }
 
@@ -290,7 +285,7 @@ int spi_dataflash_write(struct udevice *dev, u32 offset, size_t len,
 
        status = spi_claim_bus(spi);
        if (status) {
-               debug("SPI DATAFLASH: unable to claim SPI bus\n");
+               debug("dataflash: unable to claim SPI bus\n");
                return status;
        }
 
@@ -387,7 +382,7 @@ int spi_dataflash_write(struct udevice *dev, u32 offset, size_t len,
 
                /* Check result of the compare operation */
                if (status & (1 << 6)) {
-                       printf("SPI DataFlash: write compare page %u, err %d\n",
+                       printf("dataflash: write compare page %u, err %d\n",
                               pageaddr, status);
                        remaining = 0;
                        status = -EIO;
@@ -501,9 +496,10 @@ static struct flash_info dataflash_data[] = {
        { "at45db642d",  0x1f2800, 8192, 1024, 10, SUP_POW2PS | IS_POW2PS},
 };
 
-static struct flash_info *jedec_probe(struct spi_slave *spi, u8 *id)
+static struct flash_info *jedec_probe(struct spi_slave *spi)
 {
        int                     tmp;
+       uint8_t                 id[5];
        uint32_t                jedec;
        struct flash_info       *info;
        int status;
@@ -517,6 +513,11 @@ static struct flash_info *jedec_probe(struct spi_slave *spi, u8 *id)
         * That's not an error; only rev C and newer chips handle it, and
         * only Atmel sells these chips.
         */
+       tmp = spi_flash_cmd(spi, CMD_READ_ID, id, sizeof(id));
+       if (tmp < 0) {
+               printf("dataflash: error %d reading JEDEC ID\n", tmp);
+               return ERR_PTR(tmp);
+       }
        if (id[0] != 0x1f)
                return NULL;
 
@@ -533,7 +534,7 @@ static struct flash_info *jedec_probe(struct spi_slave *spi, u8 *id)
                        if (info->flags & SUP_POW2PS) {
                                status = dataflash_status(spi);
                                if (status < 0) {
-                                       debug("SPI DataFlash: status error %d\n",
+                                       debug("dataflash: status error %d\n",
                                              status);
                                        return NULL;
                                }
@@ -555,10 +556,8 @@ static struct flash_info *jedec_probe(struct spi_slave *spi, u8 *id)
         * size (it might be binary) even when we can tell which density
         * class is involved (legacy chip id scheme).
         */
-       printf("SPI DataFlash: Unsupported flash IDs: ");
-       printf("manuf %02x, jedec %04x, ext_jedec %04x\n",
-              id[0], jedec, id[3] << 8 | id[4]);
-       return NULL;
+       printf("dataflash: JEDEC id %06x not handled\n", jedec);
+       return ERR_PTR(-ENODEV);
 }
 
 /*
@@ -580,21 +579,15 @@ static int spi_dataflash_probe(struct udevice *dev)
        struct spi_slave *spi = dev_get_parent_priv(dev);
        struct spi_flash *spi_flash;
        struct flash_info *info;
-       u8 idcode[5];
-       int ret, status = 0;
+       int status;
 
        spi_flash = dev_get_uclass_priv(dev);
+       spi_flash->spi = spi;
        spi_flash->dev = dev;
 
-       ret = spi_claim_bus(spi);
-       if (ret)
-               return ret;
-
-       ret = spi_flash_cmd(spi, CMD_READ_ID, idcode, sizeof(idcode));
-       if (ret) {
-               printf("SPI DataFlash: Failed to get idcodes\n");
-               goto err_read_cmd;
-       }
+       status = spi_claim_bus(spi);
+       if (status)
+               return status;
 
        /*
         * Try to detect dataflash by JEDEC ID.
@@ -603,79 +596,70 @@ static int spi_dataflash_probe(struct udevice *dev)
         * Both support the security register, though with different
         * write procedures.
         */
-       info = jedec_probe(spi, idcode);
-       if (info != NULL)
-               add_dataflash(dev, info->name, info->nr_pages,
-                             info->pagesize, info->pageoffset,
-                             (info->flags & SUP_POW2PS) ? 'd' : 'c');
-       else {
-               /*
-               * Older chips support only legacy commands, identifing
-               * capacity using bits in the status byte.
-               */
-               status = dataflash_status(spi);
-               if (status <= 0 || status == 0xff) {
-                       printf("SPI DataFlash: read status error %d\n", status);
-                       if (status == 0 || status == 0xff)
-                               status = -ENODEV;
-                       goto err_read_cmd;
-               }
-               /*
-               * if there's a device there, assume it's dataflash.
-               * board setup should have set spi->max_speed_max to
-               * match f(car) for continuous reads, mode 0 or 3.
-               */
-               switch (status & 0x3c) {
-               case 0x0c:      /* 0 0 1 1 x x */
-                       status = add_dataflash(dev, "AT45DB011B",
-                                              512, 264, 9, 0);
-                       break;
-               case 0x14:      /* 0 1 0 1 x x */
-                       status = add_dataflash(dev, "AT45DB021B",
-                                              1024, 264, 9, 0);
-                       break;
-               case 0x1c:      /* 0 1 1 1 x x */
-                       status = add_dataflash(dev, "AT45DB041x",
-                                              2048, 264, 9, 0);
-                       break;
-               case 0x24:      /* 1 0 0 1 x x */
-                       status = add_dataflash(dev, "AT45DB081B",
-                                              4096, 264, 9, 0);
-                       break;
-               case 0x2c:      /* 1 0 1 1 x x */
-                       status = add_dataflash(dev, "AT45DB161x",
-                                              4096, 528, 10, 0);
-                       break;
-               case 0x34:      /* 1 1 0 1 x x */
-                       status = add_dataflash(dev, "AT45DB321x",
-                                              8192, 528, 10, 0);
-                       break;
-               case 0x38:      /* 1 1 1 x x x */
-               case 0x3c:
-                       status = add_dataflash(dev, "AT45DB642x",
-                                              8192, 1056, 11, 0);
-                       break;
-               /* obsolete AT45DB1282 not (yet?) supported */
-               default:
-                       dev_info(&spi->dev, "unsupported device (%x)\n",
-                                status & 0x3c);
-                       status = -ENODEV;
-                       goto err_read_cmd;
-               }
+       info = jedec_probe(spi);
+       if (IS_ERR(info))
+               goto err_jedec_probe;
+       if (info != NULL) {
+               status = add_dataflash(dev, info->name, info->nr_pages,
+                               info->pagesize, info->pageoffset,
+                               (info->flags & SUP_POW2PS) ? 'd' : 'c');
+               if (status < 0)
+                       goto err_status;
        }
 
-       /* Assign spi data */
-       spi_flash->spi = spi;
-       spi_flash->memory_map = spi->memory_map;
-       spi_flash->dual_flash = spi->option;
+       /*
+       * Older chips support only legacy commands, identifing
+       * capacity using bits in the status byte.
+       */
+       status = dataflash_status(spi);
+       if (status <= 0 || status == 0xff) {
+               printf("dataflash: read status error %d\n", status);
+               if (status == 0 || status == 0xff)
+                       status = -ENODEV;
+               goto err_jedec_probe;
+       }
 
-       spi_release_bus(spi);
+       /*
+       * if there's a device there, assume it's dataflash.
+       * board setup should have set spi->max_speed_max to
+       * match f(car) for continuous reads, mode 0 or 3.
+       */
+       switch (status & 0x3c) {
+       case 0x0c:      /* 0 0 1 1 x x */
+               status = add_dataflash(dev, "AT45DB011B", 512, 264, 9, 0);
+               break;
+       case 0x14:      /* 0 1 0 1 x x */
+               status = add_dataflash(dev, "AT45DB021B", 1024, 264, 9, 0);
+               break;
+       case 0x1c:      /* 0 1 1 1 x x */
+               status = add_dataflash(dev, "AT45DB041x", 2048, 264, 9, 0);
+               break;
+       case 0x24:      /* 1 0 0 1 x x */
+               status = add_dataflash(dev, "AT45DB081B", 4096, 264, 9, 0);
+               break;
+       case 0x2c:      /* 1 0 1 1 x x */
+               status = add_dataflash(dev, "AT45DB161x", 4096, 528, 10, 0);
+               break;
+       case 0x34:      /* 1 1 0 1 x x */
+               status = add_dataflash(dev, "AT45DB321x", 8192, 528, 10, 0);
+               break;
+       case 0x38:      /* 1 1 1 x x x */
+       case 0x3c:
+               status = add_dataflash(dev, "AT45DB642x", 8192, 1056, 11, 0);
+               break;
+       /* obsolete AT45DB1282 not (yet?) supported */
+       default:
+               printf("dataflash: unsupported device (%x)\n", status & 0x3c);
+               status = -ENODEV;
+               goto err_status;
+       }
 
-       return 0;
+       return status;
 
-err_read_cmd:
+err_status:
+       spi_free_slave(spi);
+err_jedec_probe:
        spi_release_bus(spi);
-
        return status;
 }
 
index cde4cfbf2e32b5b1257b2d5a9b2b44080dc496ec..2463686617eeb68c172ac5bfa77546fb8b2ce42b 100644 (file)
@@ -23,6 +23,7 @@ enum spi_dual_flash {
 enum spi_nor_option_flags {
        SNOR_F_SST_WR           = BIT(0),
        SNOR_F_USE_FSR          = BIT(1),
+       SNOR_F_USE_UPAGE        = BIT(3),
 };
 
 #define SPI_FLASH_3B_ADDR_LEN          3
@@ -98,42 +99,45 @@ int sst_write_bp(struct spi_flash *flash, u32 offset, size_t len,
                const void *buf);
 #endif
 
-#ifdef CONFIG_SPI_FLASH_SPANSION
-/* Used for Spansion S25FS-S family flash only. */
-#define CMD_SPANSION_RDAR      0x65 /* Read any device register */
-#define CMD_SPANSION_WRAR      0x71 /* Write any device register */
-#endif
-/**
- * struct spi_flash_params - SPI/QSPI flash device params structure
- *
- * @name:              Device name ([MANUFLETTER][DEVTYPE][DENSITY][EXTRAINFO])
- * @jedec:             Device jedec ID (0x[1byte_manuf_id][2byte_dev_id])
- * @ext_jedec:         Device ext_jedec ID
- * @sector_size:       Isn't necessarily a sector size from vendor,
- *                     the size listed here is what works with CMD_ERASE_64K
- * @nr_sectors:                No.of sectors on this device
- * @flags:             Important param, for flash specific behaviour
- */
-struct spi_flash_params {
-       const char *name;
-       u32 jedec;
-       u16 ext_jedec;
-       u32 sector_size;
-       u32 nr_sectors;
-
-       u16 flags;
-#define SECT_4K                        BIT(0)
-#define E_FSR                  BIT(1)
-#define SST_WR                 BIT(2)
-#define WR_QPP                 BIT(3)
-#define RD_QUAD                        BIT(4)
-#define RD_DUAL                        BIT(5)
-#define RD_QUADIO              BIT(6)
-#define RD_DUALIO              BIT(7)
+#define JEDEC_MFR(info)                ((info)->id[0])
+#define JEDEC_ID(info)         (((info)->id[1]) << 8 | ((info)->id[2]))
+#define JEDEC_EXT(info)                (((info)->id[3]) << 8 | ((info)->id[4]))
+#define SPI_FLASH_MAX_ID_LEN   6
+
+struct spi_flash_info {
+       /* Device name ([MANUFLETTER][DEVTYPE][DENSITY][EXTRAINFO]) */
+       const char      *name;
+
+       /*
+        * This array stores the ID bytes.
+        * The first three bytes are the JEDIC ID.
+        * JEDEC ID zero means "no ID" (mostly older chips).
+        */
+       u8              id[SPI_FLASH_MAX_ID_LEN];
+       u8              id_len;
+
+       /*
+        * The size listed here is what works with SPINOR_OP_SE, which isn't
+        * necessarily called a "sector" by the vendor.
+        */
+       u32             sector_size;
+       u32             n_sectors;
+
+       u16             page_size;
+
+       u16             flags;
+#define SECT_4K                        BIT(0)  /* CMD_ERASE_4K works uniformly */
+#define E_FSR                  BIT(1)  /* use flag status register for */
+#define SST_WR                 BIT(2)  /* use SST byte/word programming */
+#define WR_QPP                 BIT(3)  /* use Quad Page Program */
+#define RD_QUAD                        BIT(4)  /* use Quad Read */
+#define RD_DUAL                        BIT(5)  /* use Dual Read */
+#define RD_QUADIO              BIT(6)  /* use Quad IO Read */
+#define RD_DUALIO              BIT(7)  /* use Dual IO Read */
 #define RD_FULL                        (RD_QUAD | RD_DUAL | RD_QUADIO | RD_DUALIO)
 };
 
-extern const struct spi_flash_params spi_flash_params_table[];
+extern const struct spi_flash_info spi_flash_ids[];
 
 /* Send a single-byte command to the device and read the response */
 int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response, size_t len);
@@ -182,7 +186,7 @@ static inline int spi_flash_cmd_write_disable(struct spi_flash *flash)
  * - SPI claim
  * - spi_flash_cmd_write_enable
  * - spi_flash_cmd_write
- * - spi_flash_cmd_wait_ready
+ * - spi_flash_wait_till_ready
  * - SPI release
  */
 int spi_flash_write_common(struct spi_flash *flash, const u8 *cmd,
diff --git a/drivers/mtd/spi/sf_params.c b/drivers/mtd/spi/sf_params.c
deleted file mode 100644 (file)
index 5b50114..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * SPI flash Params table
- *
- * Copyright (C) 2013 Jagannadha Sutradharudu Teki, Xilinx Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <spi.h>
-#include <spi_flash.h>
-
-#include "sf_internal.h"
-
-/* SPI/QSPI flash device params structure */
-const struct spi_flash_params spi_flash_params_table[] = {
-#ifdef CONFIG_SPI_FLASH_ATMEL          /* ATMEL */
-       {"AT45DB011D",     0x1f2200, 0x0,       64 * 1024,     4, SECT_4K},
-       {"AT45DB021D",     0x1f2300, 0x0,       64 * 1024,     8, SECT_4K},
-       {"AT45DB041D",     0x1f2400, 0x0,       64 * 1024,     8, SECT_4K},
-       {"AT45DB081D",     0x1f2500, 0x0,       64 * 1024,    16, SECT_4K},
-       {"AT45DB161D",     0x1f2600, 0x0,       64 * 1024,    32, SECT_4K},
-       {"AT45DB321D",     0x1f2700, 0x0,       64 * 1024,    64, SECT_4K},
-       {"AT45DB641D",     0x1f2800, 0x0,       64 * 1024,   128, SECT_4K},
-       {"AT25DF321A",     0x1f4701, 0x0,       64 * 1024,    64, SECT_4K},
-       {"AT25DF321",      0x1f4700, 0x0,       64 * 1024,    64, SECT_4K},
-       {"AT26DF081A",     0x1f4501, 0x0,       64 * 1024,    16, SECT_4K},
-#endif
-#ifdef CONFIG_SPI_FLASH_EON            /* EON */
-       {"EN25Q32B",       0x1c3016, 0x0,       64 * 1024,    64, 0},
-       {"EN25Q64",        0x1c3017, 0x0,       64 * 1024,   128, SECT_4K},
-       {"EN25Q128B",      0x1c3018, 0x0,       64 * 1024,   256, 0},
-       {"EN25S64",        0x1c3817, 0x0,       64 * 1024,   128, 0},
-#endif
-#ifdef CONFIG_SPI_FLASH_GIGADEVICE     /* GIGADEVICE */
-       {"GD25Q64B",       0xc84017, 0x0,       64 * 1024,   128, SECT_4K},
-       {"GD25LQ32",       0xc86016, 0x0,       64 * 1024,    64, SECT_4K},
-#endif
-#ifdef CONFIG_SPI_FLASH_ISSI           /* ISSI */
-       {"IS25LP032",      0x9d6016, 0x0,       64 * 1024,    64, 0},
-       {"IS25LP064",      0x9d6017, 0x0,       64 * 1024,   128, 0},
-       {"IS25LP128",      0x9d6018, 0x0,       64 * 1024,   256, 0},
-#endif
-#ifdef CONFIG_SPI_FLASH_MACRONIX       /* MACRONIX */
-       {"MX25L2006E",     0xc22012, 0x0,       64 * 1024,     4, 0},
-       {"MX25L4005",      0xc22013, 0x0,       64 * 1024,     8, 0},
-       {"MX25L8005",      0xc22014, 0x0,       64 * 1024,    16, 0},
-       {"MX25L1605D",     0xc22015, 0x0,       64 * 1024,    32, 0},
-       {"MX25L3205D",     0xc22016, 0x0,       64 * 1024,    64, 0},
-       {"MX25L6405D",     0xc22017, 0x0,       64 * 1024,   128, 0},
-       {"MX25L12805",     0xc22018, 0x0,       64 * 1024,   256, RD_FULL | WR_QPP},
-       {"MX25L25635F",    0xc22019, 0x0,       64 * 1024,   512, RD_FULL | WR_QPP},
-       {"MX25L51235F",    0xc2201a, 0x0,       64 * 1024,  1024, RD_FULL | WR_QPP},
-       {"MX25L12855E",    0xc22618, 0x0,       64 * 1024,   256, RD_FULL | WR_QPP},
-#endif
-#ifdef CONFIG_SPI_FLASH_SPANSION       /* SPANSION */
-       {"S25FL008A",      0x010213, 0x0,       64 * 1024,    16, 0},
-       {"S25FL016A",      0x010214, 0x0,       64 * 1024,    32, 0},
-       {"S25FL032A",      0x010215, 0x0,       64 * 1024,    64, 0},
-       {"S25FL064A",      0x010216, 0x0,       64 * 1024,   128, 0},
-       {"S25FL116K",      0x014015, 0x0,       64 * 1024,   128, 0},
-       {"S25FL164K",      0x014017, 0x0140,    64 * 1024,   128, 0},
-       {"S25FL128P_256K", 0x012018, 0x0300,   256 * 1024,    64, RD_FULL | WR_QPP},
-       {"S25FL128P_64K",  0x012018, 0x0301,    64 * 1024,   256, RD_FULL | WR_QPP},
-       {"S25FL032P",      0x010215, 0x4d00,    64 * 1024,    64, RD_FULL | WR_QPP},
-       {"S25FL064P",      0x010216, 0x4d00,    64 * 1024,   128, RD_FULL | WR_QPP},
-       {"S25FL128S_256K", 0x012018, 0x4d00,   256 * 1024,    64, RD_FULL | WR_QPP},
-       {"S25FL128S_64K",  0x012018, 0x4d01,    64 * 1024,   256, RD_FULL | WR_QPP},
-       {"S25FL256S_256K", 0x010219, 0x4d00,   256 * 1024,   128, RD_FULL | WR_QPP},
-       {"S25FL256S_64K",  0x010219, 0x4d01,    64 * 1024,   512, RD_FULL | WR_QPP},
-       {"S25FS512S",      0x010220, 0x4D00,   128 * 1024,   512, RD_FULL | WR_QPP},
-       {"S25FL512S_256K", 0x010220, 0x4d00,   256 * 1024,   256, RD_FULL | WR_QPP},
-       {"S25FL512S_64K",  0x010220, 0x4d01,    64 * 1024,  1024, RD_FULL | WR_QPP},
-       {"S25FL512S_512K", 0x010220, 0x4f00,   256 * 1024,   256, RD_FULL | WR_QPP},
-#endif
-#ifdef CONFIG_SPI_FLASH_STMICRO                /* STMICRO */
-       {"M25P10",         0x202011, 0x0,       32 * 1024,     4, 0},
-       {"M25P20",         0x202012, 0x0,       64 * 1024,     4, 0},
-       {"M25P40",         0x202013, 0x0,       64 * 1024,     8, 0},
-       {"M25P80",         0x202014, 0x0,       64 * 1024,    16, 0},
-       {"M25P16",         0x202015, 0x0,       64 * 1024,    32, 0},
-       {"M25PE16",        0x208015, 0x1000,    64 * 1024,    32, 0},
-       {"M25PX16",        0x207115, 0x1000,    64 * 1024,    32, RD_QUAD | RD_DUAL},
-       {"M25P32",         0x202016, 0x0,       64 * 1024,    64, 0},
-       {"M25P64",         0x202017, 0x0,       64 * 1024,   128, 0},
-       {"M25P128",        0x202018, 0x0,      256 * 1024,    64, 0},
-       {"M25PX64",        0x207117, 0x0,       64 * 1024,   128, SECT_4K},
-       {"N25Q016A",       0x20bb15, 0x0,       64 * 1024,    32, SECT_4K},
-       {"N25Q32",         0x20ba16, 0x0,       64 * 1024,    64, RD_FULL | WR_QPP | SECT_4K},
-       {"N25Q32A",        0x20bb16, 0x0,       64 * 1024,    64, RD_FULL | WR_QPP | SECT_4K},
-       {"N25Q64",         0x20ba17, 0x0,       64 * 1024,   128, RD_FULL | WR_QPP | SECT_4K},
-       {"N25Q64A",        0x20bb17, 0x0,       64 * 1024,   128, RD_FULL | WR_QPP | SECT_4K},
-       {"N25Q128",        0x20ba18, 0x0,       64 * 1024,   256, RD_FULL | WR_QPP},
-       {"N25Q128A",       0x20bb18, 0x0,       64 * 1024,   256, RD_FULL | WR_QPP},
-       {"N25Q256",        0x20ba19, 0x0,       64 * 1024,   512, RD_FULL | WR_QPP | SECT_4K},
-       {"N25Q256A",       0x20bb19, 0x0,       64 * 1024,   512, RD_FULL | WR_QPP | SECT_4K},
-       {"N25Q512",        0x20ba20, 0x0,       64 * 1024,  1024, RD_FULL | WR_QPP | E_FSR | SECT_4K},
-       {"N25Q512A",       0x20bb20, 0x0,       64 * 1024,  1024, RD_FULL | WR_QPP | E_FSR | SECT_4K},
-       {"N25Q1024",       0x20ba21, 0x0,       64 * 1024,  2048, RD_FULL | WR_QPP | E_FSR | SECT_4K},
-       {"N25Q1024A",      0x20bb21, 0x0,       64 * 1024,  2048, RD_FULL | WR_QPP | E_FSR | SECT_4K},
-#endif
-#ifdef CONFIG_SPI_FLASH_SST            /* SST */
-       {"SST25VF040B",    0xbf258d, 0x0,       64 * 1024,     8, SECT_4K | SST_WR},
-       {"SST25VF080B",    0xbf258e, 0x0,       64 * 1024,    16, SECT_4K | SST_WR},
-       {"SST25VF016B",    0xbf2541, 0x0,       64 * 1024,    32, SECT_4K | SST_WR},
-       {"SST25VF032B",    0xbf254a, 0x0,       64 * 1024,    64, SECT_4K | SST_WR},
-       {"SST25VF064C",    0xbf254b, 0x0,       64 * 1024,   128, SECT_4K},
-       {"SST25WF512",     0xbf2501, 0x0,       64 * 1024,     1, SECT_4K | SST_WR},
-       {"SST25WF010",     0xbf2502, 0x0,       64 * 1024,     2, SECT_4K | SST_WR},
-       {"SST25WF020",     0xbf2503, 0x0,       64 * 1024,     4, SECT_4K | SST_WR},
-       {"SST25WF040",     0xbf2504, 0x0,       64 * 1024,     8, SECT_4K | SST_WR},
-       {"SST25WF040B",    0x621613, 0x0,       64 * 1024,     8, SECT_4K},
-       {"SST25WF080",     0xbf2505, 0x0,       64 * 1024,    16, SECT_4K | SST_WR},
-#endif
-#ifdef CONFIG_SPI_FLASH_WINBOND                /* WINBOND */
-       {"W25P80",         0xef2014, 0x0,       64 * 1024,    16, 0},
-       {"W25P16",         0xef2015, 0x0,       64 * 1024,    32, 0},
-       {"W25P32",         0xef2016, 0x0,       64 * 1024,    64, 0},
-       {"W25X40",         0xef3013, 0x0,       64 * 1024,     8, SECT_4K},
-       {"W25X16",         0xef3015, 0x0,       64 * 1024,    32, SECT_4K},
-       {"W25X32",         0xef3016, 0x0,       64 * 1024,    64, SECT_4K},
-       {"W25X64",         0xef3017, 0x0,       64 * 1024,   128, SECT_4K},
-       {"W25Q80BL",       0xef4014, 0x0,       64 * 1024,    16, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q16CL",       0xef4015, 0x0,       64 * 1024,    32, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q32BV",       0xef4016, 0x0,       64 * 1024,    64, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q64CV",       0xef4017, 0x0,       64 * 1024,   128, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q128BV",      0xef4018, 0x0,       64 * 1024,   256, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q256",        0xef4019, 0x0,       64 * 1024,   512, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q80BW",       0xef5014, 0x0,       64 * 1024,    16, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q16DW",       0xef6015, 0x0,       64 * 1024,    32, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q32DW",       0xef6016, 0x0,       64 * 1024,    64, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q64DW",       0xef6017, 0x0,       64 * 1024,   128, RD_FULL | WR_QPP | SECT_4K},
-       {"W25Q128FW",      0xef6018, 0x0,       64 * 1024,   256, RD_FULL | WR_QPP | SECT_4K},
-#endif
-       {},     /* Empty entry to terminate the list */
-       /*
-        * Note:
-        * Below paired flash devices has similar spi_flash params.
-        * (S25FL129P_64K, S25FL128S_64K)
-        * (W25Q80BL, W25Q80BV)
-        * (W25Q16CL, W25Q16DV)
-        * (W25Q32BV, W25Q32FV_SPI)
-        * (W25Q64CV, W25Q64FV_SPI)
-        * (W25Q128BV, W25Q128FV_SPI)
-        * (W25Q32DW, W25Q32FV_QPI)
-        * (W25Q64DW, W25Q64FV_QPI)
-        * (W25Q128FW, W25Q128FV_QPI)
-        */
-};
index 7f6e9ae23ea83356f4ceee56d91103354bbcfb27..94c0b0063d1a833b30557fcb0f35ed53d9496f66 100644 (file)
@@ -144,7 +144,7 @@ static int write_evcr(struct spi_flash *flash, u8 evcr)
 #endif
 
 #ifdef CONFIG_SPI_FLASH_BAR
-static int spi_flash_write_bar(struct spi_flash *flash, u32 offset)
+static int write_bar(struct spi_flash *flash, u32 offset)
 {
        u8 cmd, bank_sel;
        int ret;
@@ -165,7 +165,7 @@ bar_end:
        return flash->bank_curr;
 }
 
-static int spi_flash_read_bar(struct spi_flash *flash, u8 idcode0)
+static int read_bar(struct spi_flash *flash, const struct spi_flash_info *info)
 {
        u8 curr_bank = 0;
        int ret;
@@ -173,7 +173,7 @@ static int spi_flash_read_bar(struct spi_flash *flash, u8 idcode0)
        if (flash->size <= SPI_FLASH_16MB_BOUN)
                goto bar_end;
 
-       switch (idcode0) {
+       switch (JEDEC_MFR(info)) {
        case SPI_FLASH_CFI_MFR_SPANSION:
                flash->bank_read_cmd = CMD_BANKADDR_BRRD;
                flash->bank_write_cmd = CMD_BANKADDR_BRWR;
@@ -199,15 +199,13 @@ bar_end:
 #ifdef CONFIG_SF_DUAL_FLASH
 static void spi_flash_dual(struct spi_flash *flash, u32 *addr)
 {
-       struct spi_slave *spi = flash->spi;
-
        switch (flash->dual_flash) {
        case SF_DUAL_STACKED_FLASH:
                if (*addr >= (flash->size >> 1)) {
                        *addr -= flash->size >> 1;
-                       spi->flags |= SPI_XFER_U_PAGE;
+                       flash->flags |= SNOR_F_USE_UPAGE;
                } else {
-                       spi->flags &= ~SPI_XFER_U_PAGE;
+                       flash->flags &= ~SNOR_F_USE_UPAGE;
                }
                break;
        case SF_DUAL_PARALLEL_FLASH:
@@ -262,8 +260,8 @@ static int spi_flash_ready(struct spi_flash *flash)
        return sr && fsr;
 }
 
-static int spi_flash_cmd_wait_ready(struct spi_flash *flash,
-                                       unsigned long timeout)
+static int spi_flash_wait_till_ready(struct spi_flash *flash,
+                                    unsigned long timeout)
 {
        unsigned long timebase;
        int ret;
@@ -311,7 +309,7 @@ int spi_flash_write_common(struct spi_flash *flash, const u8 *cmd,
                return ret;
        }
 
-       ret = spi_flash_cmd_wait_ready(flash, timeout);
+       ret = spi_flash_wait_till_ready(flash, timeout);
        if (ret < 0) {
                debug("SF: write %s timed out\n",
                      timeout == SPI_FLASH_PROG_TIMEOUT ?
@@ -353,7 +351,7 @@ int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 offset, size_t len)
                        spi_flash_dual(flash, &erase_addr);
 #endif
 #ifdef CONFIG_SPI_FLASH_BAR
-               ret = spi_flash_write_bar(flash, erase_addr);
+               ret = write_bar(flash, erase_addr);
                if (ret < 0)
                        return ret;
 #endif
@@ -404,7 +402,7 @@ int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 offset,
                        spi_flash_dual(flash, &write_addr);
 #endif
 #ifdef CONFIG_SPI_FLASH_BAR
-               ret = spi_flash_write_bar(flash, write_addr);
+               ret = write_bar(flash, write_addr);
                if (ret < 0)
                        return ret;
 #endif
@@ -508,7 +506,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
                        spi_flash_dual(flash, &read_addr);
 #endif
 #ifdef CONFIG_SPI_FLASH_BAR
-               ret = spi_flash_write_bar(flash, read_addr);
+               ret = write_bar(flash, read_addr);
                if (ret < 0)
                        return ret;
                bank_sel = flash->bank_curr;
@@ -560,7 +558,7 @@ static int sst_byte_write(struct spi_flash *flash, u32 offset, const void *buf)
        if (ret)
                return ret;
 
-       return spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+       return spi_flash_wait_till_ready(flash, SPI_FLASH_PROG_TIMEOUT);
 }
 
 int sst_write_wp(struct spi_flash *flash, u32 offset, size_t len,
@@ -608,7 +606,7 @@ int sst_write_wp(struct spi_flash *flash, u32 offset, size_t len,
                        break;
                }
 
-               ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+               ret = spi_flash_wait_till_ready(flash, SPI_FLASH_PROG_TIMEOUT);
                if (ret)
                        break;
 
@@ -924,9 +922,35 @@ static int micron_quad_enable(struct spi_flash *flash)
 }
 #endif
 
-static int set_quad_mode(struct spi_flash *flash, u8 idcode0)
+static const struct spi_flash_info *spi_flash_read_id(struct spi_flash *flash)
 {
-       switch (idcode0) {
+       int                             tmp;
+       u8                              id[SPI_FLASH_MAX_ID_LEN];
+       const struct spi_flash_info     *info;
+
+       tmp = spi_flash_cmd(flash->spi, CMD_READ_ID, id, SPI_FLASH_MAX_ID_LEN);
+       if (tmp < 0) {
+               printf("SF: error %d reading JEDEC ID\n", tmp);
+               return ERR_PTR(tmp);
+       }
+
+       info = spi_flash_ids;
+       for (; info->name != NULL; info++) {
+               if (info->id_len) {
+                       if (!memcmp(info->id, id, info->id_len))
+                               return info;
+               }
+       }
+
+       printf("SF: unrecognized JEDEC id bytes: %02x, %02x, %02x\n",
+              id[0], id[1], id[2]);
+       return ERR_PTR(-ENODEV);
+}
+
+static int set_quad_mode(struct spi_flash *flash,
+                        const struct spi_flash_info *info)
+{
+       switch (JEDEC_MFR(info)) {
 #ifdef CONFIG_SPI_FLASH_MACRONIX
        case SPI_FLASH_CFI_MFR_MACRONIX:
                return macronix_quad_enable(flash);
@@ -941,7 +965,8 @@ static int set_quad_mode(struct spi_flash *flash, u8 idcode0)
                return micron_quad_enable(flash);
 #endif
        default:
-               printf("SF: Need set QEB func for %02x flash\n", idcode0);
+               printf("SF: Need set QEB func for %02x flash\n",
+                      JEDEC_MFR(info));
                return -1;
        }
 }
@@ -971,138 +996,28 @@ int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash)
 }
 #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
-#ifdef CONFIG_SPI_FLASH_SPANSION
-static int spansion_s25fss_disable_4KB_erase(struct spi_slave *spi)
-{
-       u8 cmd[4];
-       u32 offset = 0x800004; /* CR3V register offset */
-       u8 cr3v;
-       int ret;
-
-       cmd[0] = CMD_SPANSION_RDAR;
-       cmd[1] = offset >> 16;
-       cmd[2] = offset >> 8;
-       cmd[3] = offset >> 0;
-
-       ret = spi_flash_cmd_read(spi, cmd, 4, &cr3v, 1);
-       if (ret)
-               return -EIO;
-       /* CR3V bit3: 4-KB Erase */
-       if (cr3v & 0x8)
-               return 0;
-
-       cmd[0] = CMD_SPANSION_WRAR;
-       cr3v |= 0x8;
-       ret = spi_flash_cmd_write(spi, cmd, 4, &cr3v, 1);
-       if (ret)
-               return -EIO;
-
-       cmd[0] = CMD_SPANSION_RDAR;
-       ret = spi_flash_cmd_read(spi, cmd, 4, &cr3v, 1);
-       if (ret)
-               return -EIO;
-       if (!(cr3v & 0x8))
-               return -EFAULT;
-
-       return 0;
-}
-#endif
-
 int spi_flash_scan(struct spi_flash *flash)
 {
        struct spi_slave *spi = flash->spi;
-       const struct spi_flash_params *params;
-       u16 jedec, ext_jedec;
-       u8 idcode[5];
-       int ret;
-
-       /* Read the ID codes */
-       ret = spi_flash_cmd(spi, CMD_READ_ID, idcode, sizeof(idcode));
-       if (ret) {
-               printf("SF: Failed to get idcodes\n");
-               return ret;
-       }
-
-#ifdef DEBUG
-       printf("SF: Got idcodes\n");
-       print_buffer(0, idcode, 1, sizeof(idcode), 0);
-#endif
-
-       jedec = idcode[1] << 8 | idcode[2];
-       ext_jedec = idcode[3] << 8 | idcode[4];
-
-       /* Validate params from spi_flash_params table */
-       params = spi_flash_params_table;
-       for (; params->name != NULL; params++) {
-               if ((params->jedec >> 16) == idcode[0]) {
-                       if ((params->jedec & 0xFFFF) == jedec) {
-                               if (params->ext_jedec == 0)
-                                       break;
-                               else if (params->ext_jedec == ext_jedec)
-                                       break;
-                       }
-               }
-       }
-
-       if (!params->name) {
-               printf("SF: Unsupported flash IDs: ");
-               printf("manuf %02x, jedec %04x, ext_jedec %04x\n",
-                      idcode[0], jedec, ext_jedec);
-               return -EPROTONOSUPPORT;
-       }
-
-#ifdef CONFIG_SPI_FLASH_SPANSION
-       /*
-        * The S25FS-S family physical sectors may be configured as a
-        * hybrid combination of eight 4-kB parameter sectors
-        * at the top or bottom of the address space with all
-        * but one of the remaining sectors being uniform size.
-        * The Parameter Sector Erase commands (20h or 21h) must
-        * be used to erase the 4-kB parameter sectors individually.
-        * The Sector (uniform sector) Erase commands (D8h or DCh)
-        * must be used to erase any of the remaining
-        * sectors, including the portion of highest or lowest address
-        * sector that is not overlaid by the parameter sectors.
-        * The uniform sector erase command has no effect on parameter sectors.
-        */
-       if ((jedec == 0x0219 || (jedec == 0x0220)) &&
-           (ext_jedec & 0xff00) == 0x4d00) {
-               int ret;
-               u8 id[6];
-
-               /* Read the ID codes again, 6 bytes */
-               ret = spi_flash_cmd(flash->spi, CMD_READ_ID, id, sizeof(id));
-               if (ret)
-                       return -EIO;
+       const struct spi_flash_info *info = NULL;
+       int ret = -1;
 
-               ret = memcmp(id, idcode, 5);
-               if (ret)
-                       return -EIO;
+       info = spi_flash_read_id(flash);
+       if (IS_ERR_OR_NULL(info))
+               return -ENOENT;
 
-               /* 0x81: S25FS-S family 0x80: S25FL-S family */
-               if (id[5] == 0x81) {
-                       ret = spansion_s25fss_disable_4KB_erase(spi);
-                       if (ret)
-                               return ret;
-               }
-       }
-#endif
        /* Flash powers up read-only, so clear BP# bits */
-       if (idcode[0] == SPI_FLASH_CFI_MFR_ATMEL ||
-           idcode[0] == SPI_FLASH_CFI_MFR_MACRONIX ||
-           idcode[0] == SPI_FLASH_CFI_MFR_SST)
+       if (JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_ATMEL ||
+           JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_MACRONIX ||
+           JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_SST)
                write_sr(flash, 0);
 
-       /* Assign spi data */
-       flash->name = params->name;
+       flash->name = info->name;
        flash->memory_map = spi->memory_map;
-       flash->dual_flash = spi->option;
 
-       /* Assign spi flash flags */
-       if (params->flags & SST_WR)
+       if (info->flags & SST_WR)
                flash->flags |= SNOR_F_SST_WR;
 
-       /* Assign spi_flash ops */
 #ifndef CONFIG_DM_SPI_FLASH
        flash->write = spi_flash_cmd_write_ops;
 #if defined(CONFIG_SPI_FLASH_SST)
@@ -1117,39 +1032,33 @@ int spi_flash_scan(struct spi_flash *flash)
        flash->read = spi_flash_cmd_read_ops;
 #endif
 
-       /* lock hooks are flash specific - assign them based on idcode0 */
-       switch (idcode[0]) {
 #if defined(CONFIG_SPI_FLASH_STMICRO) || defined(CONFIG_SPI_FLASH_SST)
-       case SPI_FLASH_CFI_MFR_STMICRO:
-       case SPI_FLASH_CFI_MFR_SST:
+       /* NOR protection support for STmicro/Micron chips and similar */
+       if (JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_STMICRO ||
+           JEDEC_MFR(info) == SPI_FLASH_CFI_MFR_SST) {
                flash->flash_lock = stm_lock;
                flash->flash_unlock = stm_unlock;
                flash->flash_is_locked = stm_is_locked;
-#endif
-               break;
-       default:
-               debug("SF: Lock ops not supported for %02x flash\n", idcode[0]);
        }
+#endif
 
        /* Compute the flash size */
        flash->shift = (flash->dual_flash & SF_DUAL_PARALLEL_FLASH) ? 1 : 0;
+       flash->page_size = info->page_size;
        /*
         * The Spansion S25FL032P and S25FL064P have 256b pages, yet use the
         * 0x4d00 Extended JEDEC code. The rest of the Spansion flashes with
         * the 0x4d00 Extended JEDEC code have 512b pages. All of the others
         * have 256b pages.
         */
-       if (ext_jedec == 0x4d00) {
-               if ((jedec == 0x0215) || (jedec == 0x216) || (jedec == 0x220))
-                       flash->page_size = 256;
-               else
+       if (JEDEC_EXT(info) == 0x4d00) {
+               if ((JEDEC_ID(info) != 0x0215) &&
+                   (JEDEC_ID(info) != 0x0216))
                        flash->page_size = 512;
-       } else {
-               flash->page_size = 256;
        }
        flash->page_size <<= flash->shift;
-       flash->sector_size = params->sector_size << flash->shift;
-       flash->size = flash->sector_size * params->nr_sectors << flash->shift;
+       flash->sector_size = info->sector_size << flash->shift;
+       flash->size = flash->sector_size * info->n_sectors << flash->shift;
 #ifdef CONFIG_SF_DUAL_FLASH
        if (flash->dual_flash & SF_DUAL_STACKED_FLASH)
                flash->size <<= 1;
@@ -1157,7 +1066,7 @@ int spi_flash_scan(struct spi_flash *flash)
 
 #ifdef CONFIG_SPI_FLASH_USE_4K_SECTORS
        /* Compute erase sector and command */
-       if (params->flags & SECT_4K) {
+       if (info->flags & SECT_4K) {
                flash->erase_cmd = CMD_ERASE_4K;
                flash->erase_size = 4096 << flash->shift;
        } else
@@ -1174,13 +1083,13 @@ int spi_flash_scan(struct spi_flash *flash)
        flash->read_cmd = CMD_READ_ARRAY_FAST;
        if (spi->mode & SPI_RX_SLOW)
                flash->read_cmd = CMD_READ_ARRAY_SLOW;
-       else if (spi->mode & SPI_RX_QUAD && params->flags & RD_QUAD)
+       else if (spi->mode & SPI_RX_QUAD && info->flags & RD_QUAD)
                flash->read_cmd = CMD_READ_QUAD_OUTPUT_FAST;
-       else if (spi->mode & SPI_RX_DUAL && params->flags & RD_DUAL)
+       else if (spi->mode & SPI_RX_DUAL && info->flags & RD_DUAL)
                flash->read_cmd = CMD_READ_DUAL_OUTPUT_FAST;
 
        /* Look for write commands */
-       if (params->flags & WR_QPP && spi->mode & SPI_TX_QUAD)
+       if (info->flags & WR_QPP && spi->mode & SPI_TX_QUAD)
                flash->write_cmd = CMD_QUAD_PAGE_PROGRAM;
        else
                /* Go for default supported write cmd */
@@ -1190,9 +1099,10 @@ int spi_flash_scan(struct spi_flash *flash)
        if ((flash->read_cmd == CMD_READ_QUAD_OUTPUT_FAST) ||
            (flash->read_cmd == CMD_READ_QUAD_IO_FAST) ||
            (flash->write_cmd == CMD_QUAD_PAGE_PROGRAM)) {
-               ret = set_quad_mode(flash, idcode[0]);
+               ret = set_quad_mode(flash, info);
                if (ret) {
-                       debug("SF: Fail to set QEB for %02x\n", idcode[0]);
+                       debug("SF: Fail to set QEB for %02x\n",
+                             JEDEC_MFR(info));
                        return -EINVAL;
                }
        }
@@ -1217,18 +1127,18 @@ int spi_flash_scan(struct spi_flash *flash)
        }
 
 #ifdef CONFIG_SPI_FLASH_STMICRO
-       if (params->flags & E_FSR)
+       if (info->flags & E_FSR)
                flash->flags |= SNOR_F_USE_FSR;
 #endif
 
        /* Configure the BAR - discover bank cmds and read current bank */
 #ifdef CONFIG_SPI_FLASH_BAR
-       ret = spi_flash_read_bar(flash, idcode[0]);
+       ret = read_bar(flash, info);
        if (ret < 0)
                return ret;
 #endif
 
-#if CONFIG_IS_ENABLED(OF_CONTROL)
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
        ret = spi_flash_decode_fdt(gd->fdt_blob, flash);
        if (ret) {
                debug("SF: FDT decode error\n");
diff --git a/drivers/mtd/spi/spi_flash_ids.c b/drivers/mtd/spi/spi_flash_ids.c
new file mode 100644 (file)
index 0000000..edca94e
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * SPI Flash ID's.
+ *
+ * Copyright (C) 2016 Jagan Teki <jagan@openedev.com>
+ * Copyright (C) 2013 Jagannadha Sutradharudu Teki, Xilinx Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <spi.h>
+#include <spi_flash.h>
+
+#include "sf_internal.h"
+
+/* Used when the "_ext_id" is two bytes at most */
+#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags)     \
+               .id = {                                                 \
+                       ((_jedec_id) >> 16) & 0xff,                     \
+                       ((_jedec_id) >> 8) & 0xff,                      \
+                       (_jedec_id) & 0xff,                             \
+                       ((_ext_id) >> 8) & 0xff,                        \
+                       (_ext_id) & 0xff,                               \
+                       },                                              \
+               .id_len = (!(_jedec_id) ? 0 : (3 + ((_ext_id) ? 2 : 0))),       \
+               .sector_size = (_sector_size),                          \
+               .n_sectors = (_n_sectors),                              \
+               .page_size = 256,                                       \
+               .flags = (_flags),
+
+#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags)    \
+               .id = {                                                 \
+                       ((_jedec_id) >> 16) & 0xff,                     \
+                       ((_jedec_id) >> 8) & 0xff,                      \
+                       (_jedec_id) & 0xff,                             \
+                       ((_ext_id) >> 16) & 0xff,                       \
+                       ((_ext_id) >> 8) & 0xff,                        \
+                       (_ext_id) & 0xff,                               \
+                       },                                              \
+               .id_len = 6,                                            \
+               .sector_size = (_sector_size),                          \
+               .n_sectors = (_n_sectors),                              \
+               .page_size = 256,                                       \
+               .flags = (_flags),
+
+const struct spi_flash_info spi_flash_ids[] = {
+#ifdef CONFIG_SPI_FLASH_ATMEL          /* ATMEL */
+       {"at45db011d",     INFO(0x1f2200, 0x0, 64 * 1024,     4, SECT_4K) },
+       {"at45db021d",     INFO(0x1f2300, 0x0, 64 * 1024,     8, SECT_4K) },
+       {"at45db041d",     INFO(0x1f2400, 0x0, 64 * 1024,     8, SECT_4K) },
+       {"at45db081d",     INFO(0x1f2500, 0x0, 64 * 1024,    16, SECT_4K) },
+       {"at45db161d",     INFO(0x1f2600, 0x0, 64 * 1024,    32, SECT_4K) },
+       {"at45db321d",     INFO(0x1f2700, 0x0, 64 * 1024,    64, SECT_4K) },
+       {"at45db641d",     INFO(0x1f2800, 0x0, 64 * 1024,   128, SECT_4K) },
+       {"at25df321a",     INFO(0x1f4701, 0x0, 64 * 1024,    64, SECT_4K) },
+       {"at25df321",      INFO(0x1f4700, 0x0, 64 * 1024,    64, SECT_4K) },
+       {"at26df081a",     INFO(0x1f4501, 0x0, 64 * 1024,    16, SECT_4K) },
+#endif
+#ifdef CONFIG_SPI_FLASH_EON            /* EON */
+       {"en25q32b",       INFO(0x1c3016, 0x0, 64 * 1024,    64, 0) },
+       {"en25q64",        INFO(0x1c3017, 0x0, 64 * 1024,   128, SECT_4K) },
+       {"en25q128b",      INFO(0x1c3018, 0x0, 64 * 1024,   256, 0) },
+       {"en25s64",        INFO(0x1c3817, 0x0, 64 * 1024,   128, 0) },
+#endif
+#ifdef CONFIG_SPI_FLASH_GIGADEVICE     /* GIGADEVICE */
+       {"gd25q64b",       INFO(0xc84017, 0x0, 64 * 1024,   128, SECT_4K) },
+       {"gd25lq32",       INFO(0xc86016, 0x0, 64 * 1024,    64, SECT_4K) },
+#endif
+#ifdef CONFIG_SPI_FLASH_ISSI           /* ISSI */
+       {"is25lp032",      INFO(0x9d6016, 0x0, 64 * 1024,    64, 0) },
+       {"is25lp064",      INFO(0x9d6017, 0x0, 64 * 1024,   128, 0) },
+       {"is25lp128",      INFO(0x9d6018, 0x0, 64 * 1024,   256, 0) },
+#endif
+#ifdef CONFIG_SPI_FLASH_MACRONIX       /* MACRONIX */
+       {"mx25l2006e",     INFO(0xc22012, 0x0, 64 * 1024,     4, 0) },
+       {"mx25l4005",      INFO(0xc22013, 0x0, 64 * 1024,     8, 0) },
+       {"mx25l8005",      INFO(0xc22014, 0x0, 64 * 1024,    16, 0) },
+       {"mx25l1605d",     INFO(0xc22015, 0x0, 64 * 1024,    32, 0) },
+       {"mx25l3205d",     INFO(0xc22016, 0x0, 64 * 1024,    64, 0) },
+       {"mx25l6405d",     INFO(0xc22017, 0x0, 64 * 1024,   128, 0) },
+       {"mx25l12805",     INFO(0xc22018, 0x0, 64 * 1024,   256, RD_FULL | WR_QPP) },
+       {"mx25l25635f",    INFO(0xc22019, 0x0, 64 * 1024,   512, RD_FULL | WR_QPP) },
+       {"mx25l51235f",    INFO(0xc2201a, 0x0, 64 * 1024,  1024, RD_FULL | WR_QPP) },
+       {"mx25l12855e",    INFO(0xc22618, 0x0, 64 * 1024,   256, RD_FULL | WR_QPP) },
+       {"mx66u51235f",    INFO(0xc2253a, 0x0, 64 * 1024,  1024, RD_FULL | WR_QPP) },
+       {"mx66l1g45g",     INFO(0xc2201b, 0x0, 64 * 1024,  2048, RD_FULL | WR_QPP) },
+#endif
+#ifdef CONFIG_SPI_FLASH_SPANSION       /* SPANSION */
+       {"s25fl008a",      INFO(0x010213, 0x0, 64 * 1024,    16, 0) },
+       {"s25fl016a",      INFO(0x010214, 0x0, 64 * 1024,    32, 0) },
+       {"s25fl032a",      INFO(0x010215, 0x0, 64 * 1024,    64, 0) },
+       {"s25fl064a",      INFO(0x010216, 0x0, 64 * 1024,   128, 0) },
+       {"s25fl116k",      INFO(0x014015, 0x0, 64 * 1024,   128, 0) },
+       {"s25fl164k",      INFO(0x014017, 0x0140,  64 * 1024,   128, 0) },
+       {"s25fl128p_256k", INFO(0x012018, 0x0300, 256 * 1024,    64, RD_FULL | WR_QPP) },
+       {"s25fl128p_64k",  INFO(0x012018, 0x0301,  64 * 1024,   256, RD_FULL | WR_QPP) },
+       {"s25fl032p",      INFO(0x010215, 0x4d00,  64 * 1024,    64, RD_FULL | WR_QPP) },
+       {"s25fl064p",      INFO(0x010216, 0x4d00,  64 * 1024,   128, RD_FULL | WR_QPP) },
+       {"s25fl128s_256k", INFO(0x012018, 0x4d00, 256 * 1024,    64, RD_FULL | WR_QPP) },
+       {"s25fl128s_64k",  INFO(0x012018, 0x4d01,  64 * 1024,   256, RD_FULL | WR_QPP) },
+       {"s25fl256s_256k", INFO(0x010219, 0x4d00, 256 * 1024,   128, RD_FULL | WR_QPP) },
+       {"s25fl256s_64k",  INFO(0x010219, 0x4d01,  64 * 1024,   512, RD_FULL | WR_QPP) },
+       {"s25fs256s_64k",  INFO6(0x010219, 0x4d0181, 64 * 1024, 512, RD_FULL | WR_QPP | SECT_4K) },
+       {"s25fs512s",      INFO6(0x010220, 0x4d0081, 128 * 1024, 512, RD_FULL | WR_QPP | SECT_4K) },
+       {"s25fl512s_256k", INFO(0x010220, 0x4d00, 256 * 1024,   256, RD_FULL | WR_QPP) },
+       {"s25fl512s_64k",  INFO(0x010220, 0x4d01,  64 * 1024,  1024, RD_FULL | WR_QPP) },
+       {"s25fl512s_512k", INFO(0x010220, 0x4f00, 256 * 1024,   256, RD_FULL | WR_QPP) },
+#endif
+#ifdef CONFIG_SPI_FLASH_STMICRO                /* STMICRO */
+       {"m25p10",         INFO(0x202011, 0x0, 32 * 1024,     4, 0) },
+       {"m25p20",         INFO(0x202012, 0x0, 64 * 1024,     4, 0) },
+       {"m25p40",         INFO(0x202013, 0x0, 64 * 1024,     8, 0) },
+       {"m25p80",         INFO(0x202014, 0x0, 64 * 1024,    16, 0) },
+       {"m25p16",         INFO(0x202015, 0x0, 64 * 1024,    32, 0) },
+       {"m25pE16",        INFO(0x208015, 0x1000, 64 * 1024, 32, 0) },
+       {"m25pX16",        INFO(0x207115, 0x1000, 64 * 1024, 32, RD_QUAD | RD_DUAL) },
+       {"m25p32",         INFO(0x202016, 0x0,  64 * 1024,    64, 0) },
+       {"m25p64",         INFO(0x202017, 0x0,  64 * 1024,   128, 0) },
+       {"m25p128",        INFO(0x202018, 0x0, 256 * 1024,    64, 0) },
+       {"m25pX64",        INFO(0x207117, 0x0,  64 * 1024,   128, SECT_4K) },
+       {"n25q016a",       INFO(0x20bb15, 0x0,  64 * 1024,    32, SECT_4K) },
+       {"n25q32",         INFO(0x20ba16, 0x0,  64 * 1024,    64, RD_FULL | WR_QPP | SECT_4K) },
+       {"n25q32a",        INFO(0x20bb16, 0x0,  64 * 1024,    64, RD_FULL | WR_QPP | SECT_4K) },
+       {"n25q64",         INFO(0x20ba17, 0x0,  64 * 1024,   128, RD_FULL | WR_QPP | SECT_4K) },
+       {"n25q64a",        INFO(0x20bb17, 0x0,  64 * 1024,   128, RD_FULL | WR_QPP | SECT_4K) },
+       {"n25q128",        INFO(0x20ba18, 0x0,  64 * 1024,   256, RD_FULL | WR_QPP) },
+       {"n25q128a",       INFO(0x20bb18, 0x0,  64 * 1024,   256, RD_FULL | WR_QPP) },
+       {"n25q256",        INFO(0x20ba19, 0x0,  64 * 1024,   512, RD_FULL | WR_QPP | SECT_4K) },
+       {"n25q256a",       INFO(0x20bb19, 0x0,  64 * 1024,   512, RD_FULL | WR_QPP | SECT_4K) },
+       {"n25q512",        INFO(0x20ba20, 0x0,  64 * 1024,  1024, RD_FULL | WR_QPP | E_FSR | SECT_4K) },
+       {"n25q512a",       INFO(0x20bb20, 0x0,  64 * 1024,  1024, RD_FULL | WR_QPP | E_FSR | SECT_4K) },
+       {"n25q1024",       INFO(0x20ba21, 0x0,  64 * 1024,  2048, RD_FULL | WR_QPP | E_FSR | SECT_4K) },
+       {"n25q1024a",      INFO(0x20bb21, 0x0,  64 * 1024,  2048, RD_FULL | WR_QPP | E_FSR | SECT_4K) },
+       {"mt25qu02g",      INFO(0x20bb22, 0x0,  64 * 1024,  4096, RD_FULL | WR_QPP | E_FSR | SECT_4K) },
+       {"mt25ql02g",      INFO(0x20ba22, 0x0,  64 * 1024,  4096, RD_FULL | WR_QPP | E_FSR | SECT_4K) },
+#endif
+#ifdef CONFIG_SPI_FLASH_SST            /* SST */
+       {"sst25vf040b",    INFO(0xbf258d, 0x0,  64 * 1024,     8, SECT_4K | SST_WR) },
+       {"sst25vf080b",    INFO(0xbf258e, 0x0,  64 * 1024,    16, SECT_4K | SST_WR) },
+       {"sst25vf016b",    INFO(0xbf2541, 0x0,  64 * 1024,    32, SECT_4K | SST_WR) },
+       {"sst25vf032b",    INFO(0xbf254a, 0x0,  64 * 1024,    64, SECT_4K | SST_WR) },
+       {"sst25vf064c",    INFO(0xbf254b, 0x0,  64 * 1024,   128, SECT_4K) },
+       {"sst25wf512",     INFO(0xbf2501, 0x0,  64 * 1024,     1, SECT_4K | SST_WR) },
+       {"sst25wf010",     INFO(0xbf2502, 0x0,  64 * 1024,     2, SECT_4K | SST_WR) },
+       {"sst25wf020",     INFO(0xbf2503, 0x0,  64 * 1024,     4, SECT_4K | SST_WR) },
+       {"sst25wf040",     INFO(0xbf2504, 0x0,  64 * 1024,     8, SECT_4K | SST_WR) },
+       {"sst25wf040b",    INFO(0x621613, 0x0,  64 * 1024,     8, SECT_4K) },
+       {"sst25wf080",     INFO(0xbf2505, 0x0,  64 * 1024,    16, SECT_4K | SST_WR) },
+#endif
+#ifdef CONFIG_SPI_FLASH_WINBOND                /* WINBOND */
+       {"w25p80",         INFO(0xef2014, 0x0,  64 * 1024,    16, 0) },
+       {"w25p16",         INFO(0xef2015, 0x0,  64 * 1024,    32, 0) },
+       {"w25p32",         INFO(0xef2016, 0x0,  64 * 1024,    64, 0) },
+       {"w25x40",         INFO(0xef3013, 0x0,  64 * 1024,     8, SECT_4K) },
+       {"w25x16",         INFO(0xef3015, 0x0,  64 * 1024,    32, SECT_4K) },
+       {"w25x32",         INFO(0xef3016, 0x0,  64 * 1024,    64, SECT_4K) },
+       {"w25x64",         INFO(0xef3017, 0x0,  64 * 1024,   128, SECT_4K) },
+       {"w25q80bl",       INFO(0xef4014, 0x0,  64 * 1024,    16, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q16cl",       INFO(0xef4015, 0x0,  64 * 1024,    32, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q32bv",       INFO(0xef4016, 0x0,  64 * 1024,    64, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q64cv",       INFO(0xef4017, 0x0,  64 * 1024,   128, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q128bv",      INFO(0xef4018, 0x0,  64 * 1024,   256, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q256",        INFO(0xef4019, 0x0,  64 * 1024,   512, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q80bw",       INFO(0xef5014, 0x0,  64 * 1024,    16, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q16dw",       INFO(0xef6015, 0x0,  64 * 1024,    32, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q32dw",       INFO(0xef6016, 0x0,  64 * 1024,    64, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q64dw",       INFO(0xef6017, 0x0,  64 * 1024,   128, RD_FULL | WR_QPP | SECT_4K) },
+       {"w25q128fw",      INFO(0xef6018, 0x0,  64 * 1024,   256, RD_FULL | WR_QPP | SECT_4K) },
+#endif
+       {},     /* Empty entry to terminate the list */
+       /*
+        * Note:
+        * Below paired flash devices has similar spi_flash params.
+        * (s25fl129p_64k, s25fl128s_64k)
+        * (w25q80bl, w25q80bv)
+        * (w25q16cl, w25q16dv)
+        * (w25q32bv, w25q32fv_spi)
+        * (w25q64cv, w25q64fv_spi)
+        * (w25q128bv, w25q128fv_spi)
+        * (w25q32dw, w25q32fv_qpi)
+        * (w25q64dw, w25q64fv_qpi)
+        * (w25q128fw, w25q128fv_qpi)
+        */
+};
index 67c7edd92d0c6b1d7b20d072ab50085ce9bcc5b8..75023149a4d3749e3526b315104c93a7df43be00 100644 (file)
@@ -158,9 +158,10 @@ static void spi0_disable_clock(void)
                             (1 << AHB_RESET_SPI0_SHIFT));
 }
 
-static int spi0_init(void)
+static void spi0_init(void)
 {
        unsigned int pin_function = SUNXI_GPC_SPI0;
+
        if (IS_ENABLED(CONFIG_MACH_SUN50I))
                pin_function = SUN50I_GPC_SPI0;
 
index 1811b0fe1a3f13d40203013bb4fb3a5a05c66b3e..46b8a6bc69912f4da1868fe6ca3f87d4fe9f8b78 100644 (file)
@@ -40,6 +40,7 @@ int child_dprc_id;
 struct fsl_dpbp_obj *dflt_dpbp = NULL;
 struct fsl_dpio_obj *dflt_dpio = NULL;
 struct fsl_dpni_obj *dflt_dpni = NULL;
+static u64 mc_lazy_dpl_addr;
 
 #ifdef DEBUG
 void dump_ram_words(const char *title, void *addr)
@@ -572,6 +573,9 @@ int mc_apply_dpl(u64 mc_dpl_addr)
        u64 mc_ram_addr = mc_get_dram_addr();
        size_t mc_ram_size = mc_get_dram_block_size();
 
+       if (!mc_dpl_addr)
+               return -1;
+
        error = load_mc_dpl(mc_ram_addr, mc_ram_size, mc_dpl_addr);
        if (error != 0)
                return error;
@@ -1156,6 +1160,11 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
 {
        int err = 0;
 
+       if (bd && mc_lazy_dpl_addr && !fsl_mc_ldpaa_exit(NULL)) {
+               mc_apply_dpl(mc_lazy_dpl_addr);
+               mc_lazy_dpl_addr = 0;
+       }
+
        /* MC is not loaded intentionally, So return success. */
        if (bd && get_mc_boot_status() != 0)
                return 0;
@@ -1259,6 +1268,7 @@ static int do_fsl_mc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                }
                break;
 
+       case 'l':
        case 'a': {
                        u64 mc_dpl_addr;
 
@@ -1279,8 +1289,17 @@ static int do_fsl_mc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                return -ENODEV;
                        }
 
-                       if (!fsl_mc_ldpaa_exit(NULL))
-                               err = mc_apply_dpl(mc_dpl_addr);
+                       if (argv[1][0] == 'l') {
+                               /*
+                                * We will do the actual dpaa exit and dpl apply
+                                * later from announce_and_cleanup().
+                                */
+                               mc_lazy_dpl_addr = mc_dpl_addr;
+                       } else {
+                               /* The user wants it applied now */
+                               if (!fsl_mc_ldpaa_exit(NULL))
+                                       err = mc_apply_dpl(mc_dpl_addr);
+                       }
                        break;
                }
        default:
@@ -1298,5 +1317,6 @@ U_BOOT_CMD(
        "DPAA2 command to manage Management Complex (MC)",
        "start mc [FW_addr] [DPC_addr] - Start Management Complex\n"
        "fsl_mc apply DPL [DPL_addr] - Apply DPL file\n"
+       "fsl_mc lazyapply DPL [DPL_addr] - Apply DPL file on exit\n"
        "fsl_mc start aiop [FW_addr] - Start AIOP\n"
 );
index 75b2b6b04966bbdb2e9dc3fedba04a4204858e3a..4e61700d5d11423ab67402f22d8407194d850450 100644 (file)
@@ -420,13 +420,14 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
                goto err_dpmac_setup;
 
 #ifdef CONFIG_PHYLIB
-       if (priv->phydev)
+       if (priv->phydev) {
                err = phy_startup(priv->phydev);
                if (err) {
                        printf("%s: Could not initialize\n",
                               priv->phydev->dev->name);
                        goto err_dpamc_bind;
                }
+       }
 #else
        priv->phydev = (struct phy_device *)malloc(sizeof(struct phy_device));
        memset(priv->phydev, 0, sizeof(struct phy_device));
index 6ac8ba3721f8000f6633fe28fd517c97429a0563..abd9cc8bc0b3ba51ab826b1cfc8c4bbfd9e675aa 100644 (file)
@@ -180,8 +180,8 @@ static int sun8i_mdio_write(struct mii_dev *bus, int addr, int devad, int reg,
        miiaddr |= MDIO_CMD_MII_WRITE;
        miiaddr |= MDIO_CMD_MII_BUSY;
 
-       writel(miiaddr, priv->mac_reg + EMAC_MII_CMD);
        writel(val, priv->mac_reg + EMAC_MII_DATA);
+       writel(miiaddr, priv->mac_reg + EMAC_MII_CMD);
 
        start = get_timer(0);
        while (get_timer(start) < timeout) {
index 8b7c1be5d909051d13a5236c6ff5ae2d9c436b81..3319e10467d0a36c29e0d962428bf01a542c6684 100644 (file)
@@ -53,16 +53,16 @@ DECLARE_GLOBAL_DATA_PTR;
 #define ZYNQ_GEM_NWCTRL_MDEN_MASK      0x00000010 /* Enable MDIO port */
 #define ZYNQ_GEM_NWCTRL_STARTTX_MASK   0x00000200 /* Start tx (tx_go) */
 
-#define ZYNQ_GEM_NWCFG_SPEED100                0x000000001 /* 100 Mbps operation */
-#define ZYNQ_GEM_NWCFG_SPEED1000       0x000000400 /* 1Gbps operation */
-#define ZYNQ_GEM_NWCFG_FDEN            0x000000002 /* Full Duplex mode */
-#define ZYNQ_GEM_NWCFG_FSREM           0x000020000 /* FCS removal */
-#define ZYNQ_GEM_NWCFG_SGMII_ENBL      0x080000000 /* SGMII Enable */
-#define ZYNQ_GEM_NWCFG_PCS_SEL         0x000000800 /* PCS select */
+#define ZYNQ_GEM_NWCFG_SPEED100                0x00000001 /* 100 Mbps operation */
+#define ZYNQ_GEM_NWCFG_SPEED1000       0x00000400 /* 1Gbps operation */
+#define ZYNQ_GEM_NWCFG_FDEN            0x00000002 /* Full Duplex mode */
+#define ZYNQ_GEM_NWCFG_FSREM           0x00020000 /* FCS removal */
+#define ZYNQ_GEM_NWCFG_SGMII_ENBL      0x08000000 /* SGMII Enable */
+#define ZYNQ_GEM_NWCFG_PCS_SEL         0x00000800 /* PCS select */
 #ifdef CONFIG_ARM64
-#define ZYNQ_GEM_NWCFG_MDCCLKDIV       0x000100000 /* Div pclk by 64, max 160MHz */
+#define ZYNQ_GEM_NWCFG_MDCCLKDIV       0x00100000 /* Div pclk by 64, max 160MHz */
 #else
-#define ZYNQ_GEM_NWCFG_MDCCLKDIV       0x0000c0000 /* Div pclk by 48, max 120MHz */
+#define ZYNQ_GEM_NWCFG_MDCCLKDIV       0x000c0000 /* Div pclk by 48, max 120MHz */
 #endif
 
 #ifdef CONFIG_ARM64
index 4434e36312ac9f9f322bcf364b523e82494290ac..52a107036325e2fb31d150e7fd3890d3f72432df 100644 (file)
@@ -39,6 +39,27 @@ int regulator_get_value(struct udevice *dev)
 }
 
 int regulator_set_value(struct udevice *dev, int uV)
+{
+       const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+       struct dm_regulator_uclass_platdata *uc_pdata;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+       if (uc_pdata->min_uV != -ENODATA && uV < uc_pdata->min_uV)
+               return -EINVAL;
+       if (uc_pdata->max_uV != -ENODATA && uV > uc_pdata->max_uV)
+               return -EINVAL;
+
+       if (!ops || !ops->set_value)
+               return -ENOSYS;
+
+       return ops->set_value(dev, uV);
+}
+
+/*
+ * To be called with at most caution as there is no check
+ * before setting the actual voltage value.
+ */
+int regulator_set_value_force(struct udevice *dev, int uV)
 {
        const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
 
@@ -61,6 +82,13 @@ int regulator_get_current(struct udevice *dev)
 int regulator_set_current(struct udevice *dev, int uA)
 {
        const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+       struct dm_regulator_uclass_platdata *uc_pdata;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+       if (uc_pdata->min_uA != -ENODATA && uA < uc_pdata->min_uA)
+               return -EINVAL;
+       if (uc_pdata->max_uA != -ENODATA && uA > uc_pdata->max_uA)
+               return -EINVAL;
 
        if (!ops || !ops->set_current)
                return -ENOSYS;
index 56c024f97a140c87121e3c228ef25e28c2691fed..620dd82d6b91657d9f0763c295bcb103435357a9 100644 (file)
@@ -407,4 +407,10 @@ config MSM_SERIAL
          for example APQ8016 and MSM8916.
          Single baudrate is supported in current implementation (115200).
 
+config PXA_SERIAL
+       bool "PXA serial port support"
+       help
+         If you have a machine based on a Marvell XScale PXA2xx CPU you
+         can enable its onboard serial ports by enabling this option.
+
 endmenu
index 042e9a26d1cb52114085a29685337a8891bb9cc3..beb42431245a9338f13edc7e3d80362d9c14930c 100644 (file)
@@ -170,9 +170,14 @@ static int lpuart_serial_probe(struct udevice *dev)
 }
 #else
 
+u32 __weak get_lpuart_clk(void)
+{
+       return CONFIG_SYS_CLK_FREQ;
+}
+
 static void _lpuart32_serial_setbrg(struct lpuart_fsl *base, int baudrate)
 {
-       u32 clk = CONFIG_SYS_CLK_FREQ;
+       u32 clk = get_lpuart_clk();
        u32 sbr;
 
        sbr = (clk / (16 * baudrate));
index 1eb19ececdfdd514a6d59e6a25ee01507dfaaab8..ea5971ba3ca63a82e4d9c83bb37d80a303715b4e 100644 (file)
@@ -14,6 +14,9 @@
  *
  * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
  *
+ * Modified to add driver model (DM) support
+ * (C) Copyright 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
+ *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <asm/arch/pxa-regs.h>
 #include <asm/arch/regs-uart.h>
 #include <asm/io.h>
+#include <dm.h>
+#include <dm/platform_data/serial_pxa.h>
 #include <linux/compiler.h>
 #include <serial.h>
 #include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/*
- * The numbering scheme differs here for PXA25x, PXA27x and PXA3xx so we can
- * easily handle enabling of clock.
- */
-#ifdef CONFIG_CPU_MONAHANS
-#define        UART_CLK_BASE   CKENA_21_BTUART
-#define        UART_CLK_REG    CKENA
-#define        BTUART_INDEX    0
-#define        FFUART_INDEX    1
-#define        STUART_INDEX    2
-#elif  CONFIG_CPU_PXA25X
-#define        UART_CLK_BASE   (1 << 4)        /* HWUART */
-#define        UART_CLK_REG    CKEN
-#define        HWUART_INDEX    0
-#define        STUART_INDEX    1
-#define        FFUART_INDEX    2
-#define        BTUART_INDEX    3
-#else  /* PXA27x */
-#define        UART_CLK_BASE   CKEN5_STUART
-#define        UART_CLK_REG    CKEN
-#define        STUART_INDEX    0
-#define        FFUART_INDEX    1
-#define        BTUART_INDEX    2
-#endif
-
-/*
- * Only PXA250 has HWUART, to avoid poluting the code with more macros,
- * artificially introduce this.
- */
-#ifndef        CONFIG_CPU_PXA25X
-#define        HWUART_INDEX    0xff
-#endif
-
-static uint32_t pxa_uart_get_baud_divider(void)
-{
-       if (gd->baudrate == 1200)
-               return 768;
-       else if (gd->baudrate == 9600)
-               return 96;
-       else if (gd->baudrate == 19200)
-               return 48;
-       else if (gd->baudrate == 38400)
-               return 24;
-       else if (gd->baudrate == 57600)
-               return 16;
-       else if (gd->baudrate == 115200)
-               return 8;
-       else    /* Unsupported baudrate */
-               return 0;
-}
-
-static struct pxa_uart_regs *pxa_uart_index_to_regs(uint32_t uart_index)
+static uint32_t pxa_uart_get_baud_divider(int baudrate)
 {
-       switch (uart_index) {
-       case FFUART_INDEX: return (struct pxa_uart_regs *)FFUART_BASE;
-       case BTUART_INDEX: return (struct pxa_uart_regs *)BTUART_BASE;
-       case STUART_INDEX: return (struct pxa_uart_regs *)STUART_BASE;
-       case HWUART_INDEX: return (struct pxa_uart_regs *)HWUART_BASE;
-       default:
-               return NULL;
-       }
+       return 921600 / baudrate;
 }
 
 static void pxa_uart_toggle_clock(uint32_t uart_index, int enable)
@@ -110,20 +57,14 @@ static void pxa_uart_toggle_clock(uint32_t uart_index, int enable)
 /*
  * Enable clock and set baud rate, parity etc.
  */
-void pxa_setbrg_dev(uint32_t uart_index)
+void pxa_setbrg_common(struct pxa_uart_regs *uart_regs, int port, int baudrate)
 {
-       uint32_t divider = 0;
-       struct pxa_uart_regs *uart_regs;
-
-       divider = pxa_uart_get_baud_divider();
+       uint32_t divider = pxa_uart_get_baud_divider(baudrate);
        if (!divider)
                hang();
 
-       uart_regs = pxa_uart_index_to_regs(uart_index);
-       if (!uart_regs)
-               hang();
 
-       pxa_uart_toggle_clock(uart_index, 1);
+       pxa_uart_toggle_clock(port, 1);
 
        /* Disable interrupts and FIFOs */
        writel(0, &uart_regs->ier);
@@ -139,13 +80,38 @@ void pxa_setbrg_dev(uint32_t uart_index)
        writel(IER_UUE, &uart_regs->ier);
 }
 
+#ifndef CONFIG_DM_SERIAL
+static struct pxa_uart_regs *pxa_uart_index_to_regs(uint32_t uart_index)
+{
+       switch (uart_index) {
+       case FFUART_INDEX: return (struct pxa_uart_regs *)FFUART_BASE;
+       case BTUART_INDEX: return (struct pxa_uart_regs *)BTUART_BASE;
+       case STUART_INDEX: return (struct pxa_uart_regs *)STUART_BASE;
+       case HWUART_INDEX: return (struct pxa_uart_regs *)HWUART_BASE;
+       default:
+               return NULL;
+       }
+}
+
+/*
+ * Enable clock and set baud rate, parity etc.
+ */
+void pxa_setbrg_dev(uint32_t uart_index)
+{
+       struct pxa_uart_regs *uart_regs = pxa_uart_index_to_regs(uart_index);
+       if (!uart_regs)
+               panic("Failed getting UART registers\n");
+
+       pxa_setbrg_common(uart_regs, uart_index, gd->baudrate);
+}
+
 /*
  * Initialise the serial port with the given baudrate. The settings
  * are always 8 data bits, no parity, 1 stop bit, no start bits.
  */
 int pxa_init_dev(unsigned int uart_index)
 {
-       pxa_setbrg_dev (uart_index);
+       pxa_setbrg_dev(uart_index);
        return 0;
 }
 
@@ -297,3 +263,80 @@ void pxa_serial_initialize(void)
        serial_register(&serial_stuart_device);
 #endif
 }
+#endif /* CONFIG_DM_SERIAL */
+
+#ifdef CONFIG_DM_SERIAL
+static int pxa_serial_probe(struct udevice *dev)
+{
+       struct pxa_serial_platdata *plat = dev->platdata;
+
+       pxa_setbrg_common((struct pxa_uart_regs *)plat->base, plat->port,
+                         plat->baudrate);
+       return 0;
+}
+
+static int pxa_serial_putc(struct udevice *dev, const char ch)
+{
+       struct pxa_serial_platdata *plat = dev->platdata;
+       struct pxa_uart_regs *uart_regs = (struct pxa_uart_regs *)plat->base;
+
+       /* Wait for last character to go. */
+       if (!(readl(&uart_regs->lsr) & LSR_TEMT))
+               return -EAGAIN;
+
+       writel(ch, &uart_regs->thr);
+
+       return 0;
+}
+
+static int pxa_serial_getc(struct udevice *dev)
+{
+       struct pxa_serial_platdata *plat = dev->platdata;
+       struct pxa_uart_regs *uart_regs = (struct pxa_uart_regs *)plat->base;
+
+       /* Wait for a character to arrive. */
+       if (!(readl(&uart_regs->lsr) & LSR_DR))
+               return -EAGAIN;
+
+       return readl(&uart_regs->rbr) & 0xff;
+}
+
+int pxa_serial_setbrg(struct udevice *dev, int baudrate)
+{
+       struct pxa_serial_platdata *plat = dev->platdata;
+       struct pxa_uart_regs *uart_regs = (struct pxa_uart_regs *)plat->base;
+       int port = plat->port;
+
+       pxa_setbrg_common(uart_regs, port, baudrate);
+
+       return 0;
+}
+
+static int pxa_serial_pending(struct udevice *dev, bool input)
+{
+       struct pxa_serial_platdata *plat = dev->platdata;
+       struct pxa_uart_regs *uart_regs = (struct pxa_uart_regs *)plat->base;
+
+       if (input)
+               return readl(&uart_regs->lsr) & LSR_DR ? 1 : 0;
+       else
+               return readl(&uart_regs->lsr) & LSR_TEMT ? 0 : 1;
+
+       return 0;
+}
+
+static const struct dm_serial_ops pxa_serial_ops = {
+       .putc           = pxa_serial_putc,
+       .pending        = pxa_serial_pending,
+       .getc           = pxa_serial_getc,
+       .setbrg         = pxa_serial_setbrg,
+};
+
+U_BOOT_DRIVER(serial_pxa) = {
+       .name   = "serial_pxa",
+       .id     = UCLASS_SERIAL,
+       .probe  = pxa_serial_probe,
+       .ops    = &pxa_serial_ops,
+       .flags  = DM_FLAG_PRE_RELOC,
+};
+#endif /* CONFIG_DM_SERIAL */
index 6851ba942f51a14d72779f9c78eb5e0783ee7c32..791f3e8099c8f157b2fb7f8fff582ef8dd487cad 100644 (file)
@@ -271,6 +271,21 @@ static int mvebu_spi_set_speed(struct udevice *bus, uint hz)
 
 static int mvebu_spi_set_mode(struct udevice *bus, uint mode)
 {
+       struct mvebu_spi_platdata *plat = dev_get_platdata(bus);
+       struct kwspi_registers *reg = plat->spireg;
+       u32 data = readl(&reg->cfg);
+
+       data &= ~(KWSPI_CPHA | KWSPI_CPOL | KWSPI_RXLSBF | KWSPI_TXLSBF);
+
+       if (mode & SPI_CPHA)
+               data |= KWSPI_CPHA;
+       if (mode & SPI_CPOL)
+               data |= KWSPI_CPOL;
+       if (mode & SPI_LSB_FIRST)
+               data |= (KWSPI_RXLSBF | KWSPI_TXLSBF);
+
+       writel(data, &reg->cfg);
+
        return 0;
 }
 
index 105ee4a3ba59882c29f353c137316a5e027d1539..15cf0bda202a72b7257e27a5eff97bdd8250485f 100644 (file)
@@ -12,6 +12,7 @@
 #include <common.h>
 #include <clk.h>
 #include <dm.h>
+#include <dt-structs.h>
 #include <errno.h>
 #include <spi.h>
 #include <linux/errno.h>
@@ -27,6 +28,9 @@ DECLARE_GLOBAL_DATA_PTR;
 #define DEBUG_RK_SPI   0
 
 struct rockchip_spi_platdata {
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct dtd_rockchip_rk3288_spi of_plat;
+#endif
        s32 frequency;          /* Default clock frequency, -1 for none */
        fdt_addr_t base;
        uint deactivate_delay_us;       /* Delay to wait after deactivate */
@@ -106,6 +110,14 @@ static void spi_cs_activate(struct udevice *dev, uint cs)
        struct rockchip_spi_priv *priv = dev_get_priv(bus);
        struct rockchip_spi *regs = priv->regs;
 
+       /* If it's too soon to do another transaction, wait */
+       if (plat->deactivate_delay_us && priv->last_transaction_us) {
+               ulong delay_us;         /* The delay completed so far */
+               delay_us = timer_get_us() - priv->last_transaction_us;
+               if (delay_us < plat->deactivate_delay_us)
+                       udelay(plat->deactivate_delay_us - delay_us);
+       }
+
        debug("activate cs%u\n", cs);
        writel(1 << cs, &regs->ser);
        if (plat->activate_delay_us)
@@ -127,9 +139,29 @@ static void spi_cs_deactivate(struct udevice *dev, uint cs)
                priv->last_transaction_us = timer_get_us();
 }
 
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+static int conv_of_platdata(struct udevice *dev)
+{
+       struct rockchip_spi_platdata *plat = dev->platdata;
+       struct dtd_rockchip_rk3288_spi *dtplat = &plat->of_plat;
+       struct rockchip_spi_priv *priv = dev_get_priv(dev);
+       int ret;
+
+       plat->base = dtplat->reg[0];
+       plat->frequency = 20000000;
+       ret = clk_get_by_index_platdata(dev, 0, dtplat->clocks, &priv->clk);
+       if (ret < 0)
+               return ret;
+       dev->req_seq = 0;
+
+       return 0;
+}
+#endif
+
 static int rockchip_spi_ofdata_to_platdata(struct udevice *bus)
 {
-       struct rockchip_spi_platdata *plat = bus->platdata;
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct rockchip_spi_platdata *plat = dev_get_platdata(bus);
        struct rockchip_spi_priv *priv = dev_get_priv(bus);
        const void *blob = gd->fdt_blob;
        int node = bus->of_offset;
@@ -153,6 +185,7 @@ static int rockchip_spi_ofdata_to_platdata(struct udevice *bus)
        debug("%s: base=%x, max-frequency=%d, deactivate_delay=%d\n",
              __func__, (uint)plat->base, plat->frequency,
              plat->deactivate_delay_us);
+#endif
 
        return 0;
 }
@@ -164,6 +197,11 @@ static int rockchip_spi_probe(struct udevice *bus)
        int ret;
 
        debug("%s: probe\n", __func__);
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       ret = conv_of_platdata(bus);
+       if (ret)
+               return ret;
+#endif
        priv->regs = (struct rockchip_spi *)plat->base;
 
        priv->last_transaction_us = timer_get_us();
@@ -369,7 +407,11 @@ static const struct udevice_id rockchip_spi_ids[] = {
 };
 
 U_BOOT_DRIVER(rockchip_spi) = {
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       .name   = "rockchip_rk3288_spi",
+#else
        .name   = "rockchip_spi",
+#endif
        .id     = UCLASS_SPI,
        .of_match = rockchip_spi_ids,
        .ops    = &rockchip_spi_ops,
index d9c49e4e8c208a5f8474427726c53a89871cf976..f59a70173c41ace0b05c6ae805657f26c11bb496 100644 (file)
@@ -108,6 +108,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
        return dm_spi_xfer(slave->dev, bitlen, dout, din, flags);
 }
 
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
 static int spi_child_post_bind(struct udevice *dev)
 {
        struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
@@ -117,14 +118,16 @@ static int spi_child_post_bind(struct udevice *dev)
 
        return spi_slave_ofdata_to_platdata(gd->fdt_blob, dev->of_offset, plat);
 }
+#endif
 
 static int spi_post_probe(struct udevice *bus)
 {
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
        struct dm_spi_bus *spi = dev_get_uclass_priv(bus);
 
        spi->max_hz = fdtdec_get_int(gd->fdt_blob, bus->of_offset,
                                     "spi-max-frequency", 0);
-
+#endif
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
        struct dm_spi_ops *ops = spi_get_ops(bus);
 
@@ -274,7 +277,11 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
        bool created = false;
        int ret;
 
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       ret = uclass_first_device_err(UCLASS_SPI, &bus);
+#else
        ret = uclass_get_device_by_seq(UCLASS_SPI, busnum, &bus);
+#endif
        if (ret) {
                printf("Invalid bus %d (err=%d)\n", busnum, ret);
                return ret;
@@ -290,8 +297,11 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
                debug("%s: Binding new device '%s', busnum=%d, cs=%d, driver=%s\n",
                      __func__, dev_name, busnum, cs, drv_name);
                ret = device_bind_driver(bus, drv_name, dev_name, &dev);
-               if (ret)
+               if (ret) {
+                       debug("%s: Unable to bind driver (ret=%d)\n", __func__,
+                             ret);
                        return ret;
+               }
                plat = dev_get_parent_platdata(dev);
                plat->cs = cs;
                plat->max_hz = speed;
@@ -436,14 +446,18 @@ UCLASS_DRIVER(spi) = {
        .id             = UCLASS_SPI,
        .name           = "spi",
        .flags          = DM_UC_FLAG_SEQ_ALIAS,
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
        .post_bind      = dm_scan_fdt_dev,
+#endif
        .post_probe     = spi_post_probe,
        .child_pre_probe = spi_child_pre_probe,
        .per_device_auto_alloc_size = sizeof(struct dm_spi_bus),
        .per_child_auto_alloc_size = sizeof(struct spi_slave),
        .per_child_platdata_auto_alloc_size =
                        sizeof(struct dm_spi_slave_platdata),
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
        .child_post_bind = spi_child_post_bind,
+#endif
 };
 
 UCLASS_DRIVER(spi_generic) = {
index acc9964e232680cc74ce4773dd1f2d5b747556b3..0fbbb7c82c698dd0ea882fb868fce72669d02e54 100644 (file)
@@ -8,6 +8,11 @@
 obj-$(CONFIG_USB_GADGET) += epautoconf.o config.o usbstring.o
 obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o
 
+ifdef CONFIG_SPL_BUILD
+obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += g_dnl.o
+obj-$(CONFIG_SPL_DFU_SUPPORT) += f_dfu.o
+endif
+
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
 obj-$(CONFIG_USB_GADGET_AT91) += at91_udc.o
@@ -17,14 +22,14 @@ obj-$(CONFIG_USB_GADGET_DWC2_OTG) += dwc2_udc_otg.o
 obj-$(CONFIG_USB_GADGET_DWC2_OTG_PHY) += dwc2_udc_otg_phy.o
 obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
 obj-$(CONFIG_CI_UDC)   += ci_udc.o
+ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
 obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
-ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
-endif
 obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
 endif
+endif
 ifdef CONFIG_USB_ETHER
 obj-y += ether.o
 obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o
index e4763de73df5e312ee810eeda9edb8d066176bd9..e752eb07c4d6ea761c455a3acf80024a293766ba 100644 (file)
@@ -23,10 +23,19 @@ int display_enable(struct udevice *dev, int panel_bpp,
                        const struct display_timing *timing)
 {
        struct dm_display_ops *ops = display_get_ops(dev);
+       struct display_plat *disp_uc_plat;
+       int ret;
 
        if (!ops || !ops->enable)
                return -ENOSYS;
-       return ops->enable(dev, panel_bpp, timing);
+       ret = ops->enable(dev, panel_bpp, timing);
+       if (ret)
+               return ret;
+
+       disp_uc_plat = dev_get_uclass_platdata(dev);
+       disp_uc_plat->in_use = true;
+
+       return 0;
 }
 
 int display_read_timing(struct udevice *dev, struct display_timing *timing)
@@ -48,6 +57,13 @@ int display_read_timing(struct udevice *dev, struct display_timing *timing)
        return edid_get_timing(buf, ret, timing, &panel_bits_per_colour);
 }
 
+bool display_in_use(struct udevice *dev)
+{
+       struct display_plat *disp_uc_plat = dev_get_uclass_platdata(dev);
+
+       return disp_uc_plat->in_use;
+}
+
 UCLASS_DRIVER(display) = {
        .id             = UCLASS_DISPLAY,
        .name           = "display",
index 7976c5e26376985633dca22ece6f7f47df5ae47b..032b1de103d8cd9a09868d7cc96b9c3c0038e777 100644 (file)
@@ -132,8 +132,8 @@ static const u32 csc_coeff_default[3][4] = {
 
 static void hdmi_set_clock_regenerator(struct rk3288_hdmi *regs, u32 n, u32 cts)
 {
-       u8 cts3;
-       u8 n3;
+       uint cts3;
+       uint n3;
 
        /* first set ncts_atomic_write (if present) */
        n3 = HDMI_AUD_N3_NCTS_ATOMIC_WRITE;
@@ -199,7 +199,7 @@ static void hdmi_audio_set_samplerate(struct rk3288_hdmi *regs, u32 pixel_clk)
 static void hdmi_video_sample(struct rk3288_hdmi *regs)
 {
        u32 color_format = 0x01;
-       u8 val;
+       uint val;
 
        val = HDMI_TX_INVID0_INTERNAL_DE_GENERATOR_DISABLE |
              ((color_format << HDMI_TX_INVID0_VIDEO_MAPPING_OFFSET) &
@@ -256,7 +256,7 @@ static void hdmi_video_packetize(struct rk3288_hdmi *regs)
        u32 output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS;
        u32 remap_size = HDMI_VP_REMAP_YCC422_16BIT;
        u32 color_depth = 0;
-       u8 val, vp_conf;
+       uint val, vp_conf;
 
        /* set the packetizer registers */
        val = ((color_depth << HDMI_VP_PR_CD_COLOR_DEPTH_OFFSET) &
@@ -297,7 +297,7 @@ static void hdmi_video_packetize(struct rk3288_hdmi *regs)
                        output_select);
 }
 
-static inline void hdmi_phy_test_clear(struct rk3288_hdmi *regs, u8 bit)
+static inline void hdmi_phy_test_clear(struct rk3288_hdmi *regs, uint bit)
 {
        clrsetbits_le32(&regs->phy_tst0, HDMI_PHY_TST0_TSTCLR_MASK,
                        bit << HDMI_PHY_TST0_TSTCLR_OFFSET);
@@ -382,7 +382,7 @@ static void hdmi_phy_sel_interface_control(struct rk3288_hdmi *regs,
 static int hdmi_phy_configure(struct rk3288_hdmi *regs, u32 mpixelclock)
 {
        ulong start;
-       u8 i, val;
+       uint i, val;
 
        writel(HDMI_MC_FLOWCTRL_FEED_THROUGH_OFF_CSC_BYPASS,
               &regs->mc_flowctrl);
@@ -481,8 +481,8 @@ static int hdmi_phy_init(struct rk3288_hdmi *regs, uint mpixelclock)
 static void hdmi_av_composer(struct rk3288_hdmi *regs,
                             const struct display_timing *edid)
 {
-       u8 mdataenablepolarity = 1;
-       u8 inv_val;
+       bool mdataenablepolarity = true;
+       uint inv_val;
        uint hbl;
        uint vbl;
 
@@ -553,7 +553,7 @@ static void hdmi_av_composer(struct rk3288_hdmi *regs,
 /* hdmi initialization step b.4 */
 static void hdmi_enable_video_path(struct rk3288_hdmi *regs)
 {
-       u8 clkdis;
+       uint clkdis;
 
        /* control period minimum duration */
        writel(12, &regs->fc_ctrldur);
@@ -580,7 +580,7 @@ static void hdmi_enable_video_path(struct rk3288_hdmi *regs)
 /* workaround to clear the overflow condition */
 static void hdmi_clear_overflow(struct rk3288_hdmi *regs)
 {
-       u8 val, count;
+       uint val, count;
 
        /* tmds software reset */
        writel((u8)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ, &regs->mc_swrstz);
@@ -614,7 +614,7 @@ static void hdmi_audio_fifo_reset(struct rk3288_hdmi *regs)
 
 static void hdmi_init_interrupt(struct rk3288_hdmi *regs)
 {
-       u8 ih_mute;
+       uint ih_mute;
 
        /*
         * boot up defaults are:
@@ -650,11 +650,11 @@ static void hdmi_init_interrupt(struct rk3288_hdmi *regs)
        writel(HDMI_IH_PHY_STAT0_HPD, &regs->ih_phy_stat0);
 }
 
-static u8 hdmi_get_plug_in_status(struct rk3288_hdmi *regs)
+static int hdmi_get_plug_in_status(struct rk3288_hdmi *regs)
 {
-       u8 val = readl(&regs->phy_stat0) & HDMI_PHY_HPD;
+       uint val = readl(&regs->phy_stat0) & HDMI_PHY_HPD;
 
-       return !!(val);
+       return !!val;
 }
 
 static int hdmi_wait_for_hpd(struct rk3288_hdmi *regs)
@@ -753,7 +753,7 @@ static int hdmi_read_edid(struct rk3288_hdmi *regs, int block, u8 *buff)
        return edid_read_err;
 }
 
-static u8 pre_buf[] = {
+static const u8 pre_buf[] = {
        0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
        0x04, 0x69, 0xfa, 0x23, 0xc8, 0x28, 0x01, 0x00,
        0x10, 0x17, 0x01, 0x03, 0x80, 0x33, 0x1d, 0x78,
@@ -899,7 +899,8 @@ static int rk_hdmi_probe(struct udevice *dev)
        rk_setreg(&priv->grf->soc_con6, 1 << 15);
 
        /* hdmi data from vop id */
-       rk_setreg(&priv->grf->soc_con6, (vop_id == 1) ? (1 << 4) : (1 << 4));
+       rk_clrsetreg(&priv->grf->soc_con6, 1 << 4,
+                    (vop_id == 1) ? (1 << 4) : 0);
 
        ret = hdmi_wait_for_hpd(priv->regs);
        if (ret < 0) {
index c6d88d9225d7c9fa66cf46208b7eb85e01b09d50..eab548699f74e1830966ebf08fa799c18a04c82f 100644 (file)
@@ -195,7 +195,6 @@ int rk_display_init(struct udevice *dev, ulong fbbase,
        struct udevice *disp;
        int ret, remote, i, offset;
        struct display_plat *disp_uc_plat;
-       struct udevice *dev_clk;
        struct clk clk;
 
        vop_id = fdtdec_get_int(blob, ep_node, "reg", -1);
@@ -222,6 +221,11 @@ int rk_display_init(struct udevice *dev, ulong fbbase,
 
        disp_uc_plat = dev_get_uclass_platdata(disp);
        debug("Found device '%s', disp_uc_priv=%p\n", disp->name, disp_uc_plat);
+       if (display_in_use(disp)) {
+               debug("   - device in use\n");
+               return -EBUSY;
+       }
+
        disp_uc_plat->source_id = remote_vop_id;
        disp_uc_plat->src_dev = dev;
 
@@ -238,11 +242,7 @@ int rk_display_init(struct udevice *dev, ulong fbbase,
                return ret;
        }
 
-       ret = rockchip_get_clk(&dev_clk);
-       if (!ret) {
-               clk.id = DCLK_VOP0 + remote_vop_id;
-               ret = clk_request(dev_clk, &clk);
-       }
+       ret = clk_get_by_index(dev, 1, &clk);
        if (!ret)
                ret = clk_set_rate(&clk, timing.pixelclock.typ);
        if (ret) {
@@ -316,6 +316,10 @@ static int rk_vop_probe(struct udevice *dev)
        /*
         * Try all the ports until we find one that works. In practice this
         * tries EDP first if available, then HDMI.
+        *
+        * Note that rockchip_vop_set_clk() always uses NPLL as the source
+        * clock so it is currently not possible to use more than one display
+        * device simultaneously.
         */
        port = fdt_subnode_offset(blob, dev->of_offset, "port");
        if (port < 0)
index 11ca7937dc817ed8c40c392182aa8bd38d4f5b8f..3036e3a1f25f054617bbf5852f762268bf72027e 100644 (file)
@@ -117,7 +117,8 @@ void video_sync(struct udevice *vid)
 
        if (priv->flush_dcache) {
                flush_dcache_range((ulong)priv->fb,
-                                  (ulong)priv->fb + priv->fb_size);
+                                  ALIGN((ulong)priv->fb + priv->fb_size,
+                                        CONFIG_SYS_CACHELINE_SIZE));
        }
 #elif defined(CONFIG_VIDEO_SANDBOX_SDL)
        struct video_priv *priv = dev_get_uclass_priv(vid);
index 4248ac1dcf500f7ad9b15d4f80c493304c36ce26..bfebe7e3799be3fa8735a2d8bdbc0dd6376863b2 100644 (file)
@@ -1617,12 +1617,13 @@ long int read_allocated_block(struct ext2_inode *inode, int fileblock)
                - get_fs()->dev_desc->log2blksz;
 
        if (le32_to_cpu(inode->flags) & EXT4_EXTENTS_FL) {
+               long int startblock, endblock;
                char *buf = zalloc(blksz);
                if (!buf)
                        return -ENOMEM;
                struct ext4_extent_header *ext_block;
                struct ext4_extent *extent;
-               int i = -1;
+               int i;
                ext_block =
                        ext4fs_get_extent_block(ext4fs_root, buf,
                                                (struct ext4_extent_header *)
@@ -1636,28 +1637,26 @@ long int read_allocated_block(struct ext2_inode *inode, int fileblock)
 
                extent = (struct ext4_extent *)(ext_block + 1);
 
-               do {
-                       i++;
-                       if (i >= le16_to_cpu(ext_block->eh_entries))
-                               break;
-               } while (fileblock >= le32_to_cpu(extent[i].ee_block));
-               if (--i >= 0) {
-                       fileblock -= le32_to_cpu(extent[i].ee_block);
-                       if (fileblock >= le16_to_cpu(extent[i].ee_len)) {
+               for (i = 0; i < le16_to_cpu(ext_block->eh_entries); i++) {
+                       startblock = le32_to_cpu(extent[i].ee_block);
+                       endblock = startblock + le16_to_cpu(extent[i].ee_len);
+
+                       if (startblock > fileblock) {
+                               /* Sparse file */
                                free(buf);
                                return 0;
-                       }
 
-                       start = le16_to_cpu(extent[i].ee_start_hi);
-                       start = (start << 32) +
+                       } else if (fileblock < endblock) {
+                               start = le16_to_cpu(extent[i].ee_start_hi);
+                               start = (start << 32) +
                                        le32_to_cpu(extent[i].ee_start_lo);
-                       free(buf);
-                       return fileblock + start;
+                               free(buf);
+                               return (fileblock - startblock) + start;
+                       }
                }
 
-               printf("Extent Error\n");
                free(buf);
-               return -1;
+               return 0;
        }
 
        /* Direct blocks. */
index 30787377708cb11db671a1342440faab16dcc662..7187dcfb0565566f0f778bd2191df7093a19a2e1 100644 (file)
@@ -65,8 +65,8 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
        short status;
 
        /* Adjust len so it we can't read past the end of the file. */
-       if (len > filesize)
-               len = filesize;
+       if (len + pos > filesize)
+               len = (filesize - pos);
 
        blockcnt = lldiv(((len + pos) + blocksize - 1), blocksize);
 
@@ -190,12 +190,12 @@ int ext4fs_size(const char *filename, loff_t *size)
        return ext4fs_open(filename, size);
 }
 
-int ext4fs_read(char *buf, loff_t len, loff_t *actread)
+int ext4fs_read(char *buf, loff_t offset, loff_t len, loff_t *actread)
 {
        if (ext4fs_root == NULL || ext4fs_file == NULL)
-               return 0;
+               return -1;
 
-       return ext4fs_read_file(ext4fs_file, 0, len, buf, actread);
+       return ext4fs_read_file(ext4fs_file, offset, len, buf, actread);
 }
 
 int ext4fs_probe(struct blk_desc *fs_dev_desc,
@@ -217,11 +217,6 @@ int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
        loff_t file_len;
        int ret;
 
-       if (offset != 0) {
-               printf("** Cannot support non-zero offset **\n");
-               return -1;
-       }
-
        ret = ext4fs_open(filename, &file_len);
        if (ret < 0) {
                printf("** File not found %s **\n", filename);
@@ -231,7 +226,7 @@ int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
        if (len == 0)
                len = file_len;
 
-       return ext4fs_read(buf, len, len_read);
+       return ext4fs_read(buf, offset, len, len_read);
 }
 
 int ext4fs_uuid(char *uuid_str)
index d69bc6035be944d41228cec5d420be2f951740ed..daf021b647e6fdfa6d6baf091eaad707f58b55bb 100644 (file)
@@ -22,6 +22,8 @@ extern char __kprobes_text_start[], __kprobes_text_end[];
 extern char __entry_text_start[], __entry_text_end[];
 extern char __initdata_begin[], __initdata_end[];
 extern char __start_rodata[], __end_rodata[];
+extern char __efi_hello_world_begin[];
+extern char __efi_hello_world_end[];
 
 /* Start and end of .ctors section - used for constructor calls. */
 extern char __ctors_start[], __ctors_end[];
index ec70b72970e39fffcda863e6d7e83e56e3540fb1..8fa8e39f71e4ebf3f8707f621badef2b2b8d5c69 100644 (file)
 
 /* USB gadget RNDIS */
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 #endif
 
 #ifdef CONFIG_NAND
index 32aa392e8b4d10801ee9378c35c9666eec24c222..16fb1ae8aa6a98147abd33b4e8f8fe2e1f031f8e 100644 (file)
 #undef CONFIG_USE_IRQ
 
 /* SPL */
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT     (CONFIG_SYS_NAND_BLOCK_SIZE / \
index 553aaa38a8cc75557b1aab42df3eb8038a75016f..48353e9d3d3dd162056352f945cba12246a7fd8f 100644 (file)
 
 /* SPL */
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 #ifndef CONFIG_SPL_USBETH_SUPPORT
 #define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
index 9795d4112baaf231c0a1736456b863f036004fe7..ca5bb1a77dac76e20716378eda9207918e701e01 100644 (file)
@@ -86,7 +86,7 @@
 #define CONFIG_BOOTCOUNT_AM33XX
 #define CONFIG_SYS_BOOTCOUNT_BE
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 #ifndef CONFIG_SPL_USBETH_SUPPORT
 #define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
index 6d271100c73e4b36f8b5b89772553be0e4c3e827..07ef9e98e9002f101c2ddb7a66ca4069292e01b3 100644 (file)
@@ -18,7 +18,6 @@
  */
 #define CONFIG_OMAP            1       /* in a TI OMAP core */
 #define CONFIG_OMAP3_AM3517CRANE       1       /* working with CRANEBOARD */
-#define CONFIG_OMAP_COMMON
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
 #define CONFIG_SPL_BSS_START_ADDR      0x80000000
 #define CONFIG_SPL_BSS_MAX_SIZE                0x80000         /* 512 KB */
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x200 /* 256 KB */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 /* NAND boot config */
 #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
index cc89a160db4bfe3d4f58357a4148ae88bbf0ee96..ad56d240c1e60401e313967354432199ee636f0d 100644 (file)
@@ -16,7 +16,6 @@
 /* High Level Configuration Options */
 
 #define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
 
 #define CONFIG_SYS_NO_FLASH
 
 #define CONFIG_SPL_BSS_START_ADDR      0x80000000
 #define CONFIG_SPL_BSS_MAX_SIZE                0x80000         /* 512 KB */
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x200 /* 256 KB */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 #endif /* __CONFIG_H */
index 20f207c3f3a7a9ecc50d26685318b9319bdee933..0a6c06a4bba2a146db1e7b13a1af1d36c9260ba2 100644 (file)
@@ -82,7 +82,7 @@
 #define FAT_ENV_FILE                   "uboot.env"
 #define CONFIG_FAT_WRITE
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 /* SPL USB Support */
 
index d865f415bccd38045ace835850c4433156602d05..d009900c3976a9c70a9d99d805508de8fa0839d4 100644 (file)
 
 /* Define the default GPT table for eMMC */
 #define PARTS_DEFAULT \
+       /* Linux partitions */ \
        "uuid_disk=${uuid_gpt_disk};" \
-       "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}"
+       "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
+       /* Android partitions */ \
+       "partitions_android=" \
+       "uuid_disk=${uuid_gpt_disk};" \
+       "name=xloader,start=128K,size=256K,uuid=${uuid_gpt_xloader};" \
+       "name=bootloader,size=768K,uuid=${uuid_gpt_bootloader};" \
+       "name=environment,size=128K,uuid=${uuid_gpt_environment};" \
+       "name=misc,size=128K,uuid=${uuid_gpt_misc};" \
+       "name=reserved,size=256K,uuid=${uuid_gpt_reserved};" \
+       "name=efs,size=16M,uuid=${uuid_gpt_efs};" \
+       "name=crypto,size=16K,uuid=${uuid_gpt_crypto};" \
+       "name=recovery,size=10M,uuid=${uuid_gpt_recovery};" \
+       "name=boot,size=10M,uuid=${uuid_gpt_boot};" \
+       "name=system,size=768M,uuid=${uuid_gpt_system};" \
+       "name=cache,size=256M,uuid=${uuid_gpt_cache};" \
+       "name=ipu1,size=1M,uuid=${uuid_gpt_ipu1};" \
+       "name=ipu2,size=1M,uuid=${uuid_gpt_ipu2};" \
+       "name=userdata,size=-,uuid=${uuid_gpt_userdata}"
 
 #include <configs/ti_omap5_common.h>
 
 /* Enhance our eMMC support / experience. */
 #define CONFIG_CMD_GPT
 #define CONFIG_EFI_PARTITION
+#define CONFIG_RANDOM_UUID
+#define CONFIG_HSMMC2_8BIT
 
 /* CPSW Ethernet */
 #define CONFIG_BOOTP_DNS               /* Configurable parts of CMD_DHCP */
index d38302d6c422f02540dfde42cb7ae0bf00f9f32d..f2a24c11de8683f79fa299c0989cfcfc23fd6960 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2015 Marcel Ziswiler
+ * Copyright (c) 2014-2016 Marcel Ziswiler
  *
  * Configuration settings for the Toradex Apalis T30 modules.
  *
@@ -16,7 +16,7 @@
 #define CONFIG_ARCH_MISC_INIT
 
 /* High-level configuration options */
-#define CONFIG_TEGRA_BOARD_STRING      "Toradex Apalis T30"
+#define CONFIG_DISPLAY_BOARDINFO_LATE  /* Calls show_board_info() */
 
 /* Board-specific serial config */
 #define CONFIG_TEGRA_ENABLE_UARTA
 #define CONFIG_GENERIC_MMC
 #define CONFIG_TEGRA_MMC
 
-/* Environment in eMMC, at the end of 2nd "boot sector" */
+/* Environment in eMMC, before config block at the end of 1st "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_ENV_OFFSET              (-CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OFFSET              (-CONFIG_ENV_SIZE + \
+                                        CONFIG_TDX_CFG_BLOCK_OFFSET)
 #define CONFIG_SYS_MMC_ENV_DEV         0
-#define CONFIG_SYS_MMC_ENV_PART                2
+#define CONFIG_SYS_MMC_ENV_PART                1
 
 /* USB host support */
 #define CONFIG_USB_EHCI
index 5e37e2a84230235904bbf9461d65016613a84698..fd0504d40b5da7a3fc43ee77a5d5af5016dd5205 100644 (file)
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00080000
 
 #define CONFIG_SPL_LDSCRIPT            arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
index 7fddf4f5daa81c720d7f8b81894df951c864a06a..b825464f704ff967e184ff7e3ab503d86bdd4f36 100644 (file)
 
 #ifdef CONFIG_SYS_USE_MMC
 #define CONFIG_SPL_LDSCRIPT            arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
index db9bdefa09192f157e85d79065b95ea38f9221f5..843f03a1ea7b2a8fb3130230d0dc3ff76f9bbb48 100644 (file)
 
 #ifdef CONFIG_SYS_USE_MMC
 #define CONFIG_SPL_LDSCRIPT            arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
index e69c1b63c1442710cd990bfb2928c1bdc9ef15ce..8efd513f324763830f63c2c070bbdeab6d758198 100644 (file)
 /* General network SPL, both CPSW and USB gadget RNDIS */
 #define CONFIG_SPL_NET_VCI_STRING      "AM335x U-Boot SPL"*/
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 #ifdef CONFIG_NAND
 #define CONFIG_NAND_OMAP_GPMC
index ac47decb6387814020b02b7c1d1d683d3f6b6b27..2f51e2cd5ae4cc7c72e1006df54d20396d1adecf 100644 (file)
@@ -357,7 +357,7 @@ DEFAULT_LINUX_BOOT_ENV \
 
 /* USB gadget RNDIS */
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 #endif
 
 #ifdef CONFIG_NAND
index 0e138648d52e346e19ec6baf9b6709932b6eea2b..a5fdbbba3a90203d7baba0edbd667643e625a974 100644 (file)
@@ -52,9 +52,6 @@
  #define CONFIG_GENERIC_MMC
  #define CONFIG_OMAP_HSMMC
  #define CONFIG_SUPPORT_EMMC_BOOT
-/* RAW SD card / eMMC locations. */
- #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR       0x300 /*addr. 0x60000 */
- #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS            0x200 /* 256 KB */
 #endif /* CONFIG_EMMC_BOOT */
 
 /*
index b9f69be27d36527185d5954ffc79950ae25b1645..a6369d63b8ee4fc8edff63f7282db8fd908bf776 100644 (file)
@@ -47,9 +47,6 @@
 #define CONFIG_GENERIC_MMC
 #define CONFIG_OMAP_HSMMC
 #define CONFIG_SUPPORT_EMMC_BOOT
-/* RAW SD card / eMMC locations. */
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /*addr. 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS             0x200 /* 256 KB */
 
 /* Always 64 KiB env size */
 #define CONFIG_ENV_SIZE                        (64 << 10)
index e425cb9193048d3d80d7bf25ef24dce24323df91..7afffa2ec647948cfa6a51465b56dbde6a441b99 100644 (file)
@@ -14,7 +14,6 @@
 /* ------------------------------------------------------------------------- */
 #define CONFIG_AM33XX
 #define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
 #define CONFIG_MAX_RAM_BANK_SIZE       (1024 << 20)    /* 1GB */
 
 /* Timer information */
 
 /* General parts of the framework, required. */
 #define CONFIG_SPL_BOARD_INIT
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 #endif /* ! __BUR_AM335X_COMMON_H__ */
index a8cda40f684ba444272946ac395edf07aeb43e26..c976ec867c50b685954a6a3e69c7fdc3be68451a 100644 (file)
 /* SPL related MMC defines */
 #define CONFIG_SYS_MMC_U_BOOT_OFFS             (160 << 10)
 #define CONFIG_SYS_U_BOOT_OFFS                 CONFIG_SYS_MMC_U_BOOT_OFFS
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        ((CONFIG_SYS_U_BOOT_OFFS / 512)\
-                                                + 1)
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     ((512 << 10) / 512) /* 512KiB */
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER      0x00180000      /* in SDRAM */
 #endif
index 0ac3ec7da4ccf2ff6995f65344bcd50a50ca9c55..0dad9c3bd755a37f875a15ebe4f9a70da35a606a 100644 (file)
 /* misc */
 #define CONFIG_STACKSIZE                       (128 * 1024)
 #define CONFIG_SYS_MALLOC_LEN                  (10 * 1024 * 1024)
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     800 /* 400 KB */
 #define CONFIG_MISC_INIT_R
 
 /* SPL */
 #include "imx6_spl.h"
-#undef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x80 /* offset 64 kb */
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     (64 * 1024)
 #define CONFIG_SPL_SPI_LOAD
 
index 7eed776f62faebf1b975f3698bfd4b0dfdc19c4c..8f24174a21e723ce8fc2354edb55a633013e9a06 100644 (file)
@@ -25,8 +25,6 @@
 #undef CONFIG_MAX_RAM_BANK_SIZE
 #define CONFIG_MAX_RAM_BANK_SIZE       (512 << 20)     /* 512MB */
 
-#define CONFIG_OMAP_COMMON
-
 #define MACH_TYPE_CM_T335              4586    /* Until the next sync */
 #define CONFIG_MACH_TYPE               MACH_TYPE_CM_T335
 
 #define CONFIG_SYS_I2C_EEPROM_BUS      0
 
 /* SPL */
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 /* Network. */
 #define CONFIG_PHY_GIGE
index 6caac1dfcacc962c35d8551fc5c6315adc01badb..da5a4b3fb8a3d9dd464bb86a88052f24e98b5439 100644 (file)
@@ -25,7 +25,6 @@
 #define CONFIG_OMAP    /* in a TI OMAP core */
 #define CONFIG_OMAP_GPIO
 #define CONFIG_CM_T3X  /* working with CM-T35 and CM-T3730 */
-#define CONFIG_OMAP_COMMON
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_NAND_SIMPLE
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x200 /* 256 KB */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
 #define CONFIG_SPL_OMAP3_ID_NAND
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 /* NAND boot config */
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
index edb52be5a83cc48ef0369ba81737a3ec59a254ac..1e2a47702756613e1d3d3f908bece74e1fb0f603 100644 (file)
@@ -15,7 +15,6 @@
  */
 #define CONFIG_OMAP    /* in a TI OMAP core */
 #define CONFIG_CM_T3517        /* working with CM-T3517 */
-#define CONFIG_OMAP_COMMON
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
index 3a605f7504b89c3bd464b883a350c63b9284f277..9c24ba9965480238de9ccd38a56d5d6062658049 100644 (file)
@@ -91,7 +91,6 @@
 
 #include <configs/ti_armv7_omap.h>
 #undef CONFIG_SYS_MONITOR_LEN
-#undef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
 
 #define CONFIG_ENV_SIZE                        (16 * 1024)
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_ENV_OFFSET              (768 * 1024)
 #define CONFIG_ENV_SPI_MAX_HZ           48000000
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 /* Enhance our eMMC support / experience. */
 #define CONFIG_CMD_GPT
 #define CONFIG_SYS_SPL_ARGS_ADDR       (CONFIG_SYS_SDRAM_BASE + (128 << 20))
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     (256 * 1024)
 #define CONFIG_SYS_MONITOR_LEN         (512 * 1024)
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x480
 #define CONFIG_SPL_SPI_LOAD
 
 /* EEPROM */
index a3b1e5fe8b83d5a14ea5eaec78b43a7322a8797d..952538d5a14040b505ec4b3805f11bdc2093f9c0 100644 (file)
 #define CONFIG_SYS_NS16550_COM4                UART4_BASE
 #define CONFIG_BAUDRATE                        115200
 
-/* SD/MMC RAW boot */
-#undef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
-#undef CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS
-
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x200 /* 0x40000 - 256 KB */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x300 /* 384 KB */
-
 /* MMC ENV related defines */
 #undef CONFIG_ENV_OFFSET
 #undef CONFIG_ENV_SIZE
index 309aef8405c761d4eb454ea703a93bdcda38518e..5ce0a34a5d178a34c430390771d328810f4f4aea 100644 (file)
 /*#define CONFIG_DBG_MONITOR*/
 #define PHYS_SDRAM_SIZE                        SZ_512M
 
+#define CONFIG_ARCH_MISC_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_BOARD_LATE_INIT
 
-#define CONFIG_DISPLAY_BOARDINFO_LATE
+#define CONFIG_DISPLAY_BOARDINFO_LATE  /* Calls show_board_info() */
+
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (32 * SZ_1M)
index e44a84729bc34b987663987cf444caa73a615f0c..51f7877908019fdc77c4cc9db103553dfc281fcf 100644 (file)
@@ -2,7 +2,7 @@
  * Toradex Colibri PXA270 configuration file
  *
  * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
- * Copyright (C) 2015 Marcel Ziswiler <marcel@ziswiler.com>
+ * Copyright (C) 2015-2016 Marcel Ziswiler <marcel@ziswiler.com>
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 /* We will never enable dcache because we have to setup MMU first */
 #define CONFIG_SYS_DCACHE_OFF
 
+#define CONFIG_DISPLAY_BOARDINFO_LATE  /* Calls show_board_info() */
+
 /*
  * Environment settings
  */
 #define        CONFIG_ENV_OVERWRITE
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define        CONFIG_SYS_MALLOC_LEN           (128 * 1024)
 #define        CONFIG_ARCH_CPU_INIT
 #define        CONFIG_BOOTCOMMAND                                              \
@@ -43,9 +47,6 @@
 /*
  * Serial Console Configuration
  */
-#define        CONFIG_PXA_SERIAL
-#define        CONFIG_FFUART                   1
-#define CONFIG_CONS_INDEX              3
 #define        CONFIG_BAUDRATE                 115200
 
 /*
@@ -94,8 +95,8 @@
 #define        CONFIG_SYS_MAXARGS              16
 #define        CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE
 #define        CONFIG_SYS_DEVICE_NULLDEV       1
-#define        CONFIG_CMDLINE_EDITING          1
-#define        CONFIG_AUTO_COMPLETE            1
+#undef CONFIG_CMDLINE_EDITING          /* Saves 2.5 KB */
+#undef CONFIG_AUTO_COMPLETE            /* Saves 2.5 KB */
 
 /*
  * Clock Configuration
index 46349896d777de1fd4afa7b9748f7acf3df1cbd4..6a528690268d1ed2d340e21c2da72faa8bf8fd09 100644 (file)
@@ -14,7 +14,7 @@
 #define CONFIG_ARCH_MISC_INIT
 
 /* High-level configuration options */
-#define CONFIG_TEGRA_BOARD_STRING      "Toradex Colibri T20"
+#define CONFIG_DISPLAY_BOARDINFO_LATE  /* Calls show_board_info() */
 
 /* Board-specific serial config */
 #define CONFIG_TEGRA_ENABLE_UARTA
index e2a2549fb65cad8cda812805a8b4c585123d25b9..e8b3f99f5323b1531a1ec104576a0045e282d0b0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2015 Stefan Agner
+ * Copyright (c) 2013-2016 Stefan Agner
  *
  * Configuration settings for the Toradex Colibri T30 modules.
  *
@@ -16,7 +16,7 @@
 #define CONFIG_ARCH_MISC_INIT
 
 /* High-level configuration options */
-#define CONFIG_TEGRA_BOARD_STRING      "Toradex Colibri T30"
+#define CONFIG_DISPLAY_BOARDINFO_LATE  /* Calls show_board_info() */
 
 /* Board-specific serial config */
 #define CONFIG_TEGRA_ENABLE_UARTA
 #define CONFIG_GENERIC_MMC
 #define CONFIG_TEGRA_MMC
 
-/* Environment in eMMC, at the end of 2nd "boot sector" */
+/* Environment in eMMC, before config block at the end of 1st "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_ENV_OFFSET              (-CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OFFSET              (-CONFIG_ENV_SIZE + \
+                                        CONFIG_TDX_CFG_BLOCK_OFFSET)
 #define CONFIG_SYS_MMC_ENV_DEV         0
-#define CONFIG_SYS_MMC_ENV_PART                2
+#define CONFIG_SYS_MMC_ENV_PART                1
 
 /* USB host support */
 #define CONFIG_USB_EHCI
index be773a311ae060cb316889db0765be07291a19ea..0cd77fff51ac2992c74e4b61574bab365e250703 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Copyright 2015 Toradex, Inc.
+ * Copyright 2015-2016 Toradex, Inc.
  *
- * Configuration settings for the Toradex VF50/VF61 module.
+ * Configuration settings for the Toradex VF50/VF61 modules.
  *
  * Based on vf610twr.h:
  * Copyright 2013 Freescale Semiconductor, Inc.
@@ -21,6 +21,7 @@
 #define CONFIG_SYS_FSL_CLK
 
 #define CONFIG_ARCH_MISC_INIT
+#define CONFIG_DISPLAY_BOARDINFO_LATE  /* Calls show_board_info() */
 
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
@@ -36,6 +37,7 @@
 
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_BAUDRATE                        115200
 
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 
-/* USB Client Support */
-#define CONFIG_TRDX_VID                  0x1B67
-#define CONFIG_TRDX_PID_COLIBRI_VF50     0x0016
-#define CONFIG_TRDX_PID_COLIBRI_VF61     0x0017
-#define CONFIG_TRDX_PID_COLIBRI_VF61IT   0x0018
-#define CONFIG_TRDX_PID_COLIBRI_VF50IT   0x0019
-
 /* USB DFU */
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024 * 1024)
 
index 2403ca3148ad048ba90013115ac76f0ce4aee643..35601159ddefb1e4957d4cc97c6ead8de91e729e 100644 (file)
 
 /* Load U-Boot Image From MMC */
 #ifdef CONFIG_SPL_MMC_LOAD
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x75
 #undef CONFIG_SPL_SPI_LOAD
 #endif
 
index 72c38e2407f32d635864ef9dc29e1a0d4152441e..b8c523217892fcd975762a71b1ce45ea7a2a79c6 100644 (file)
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 1
 #define CONFIG_SYS_MMC_U_BOOT_OFFS             (160 << 10)
 #define CONFIG_SYS_U_BOOT_OFFS                 CONFIG_SYS_MMC_U_BOOT_OFFS
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        (CONFIG_SYS_U_BOOT_OFFS / 512)
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     ((512 << 10) / 512) /* 512KiB */
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER      0x00180000      /* in SDRAM */
 #endif
index 798002d4cd884b3fb6e8c0426bdae30a528ea109..75a78542045bafba2998ec9983c1301fec0c7b92 100644 (file)
        /* Android partitions */ \
        "partitions_android=" \
        "uuid_disk=${uuid_gpt_disk};" \
-       "name=xloader,start=128K,size=128K,uuid=${uuid_gpt_xloader};" \
-       "name=bootloader,size=384K,uuid=${uuid_gpt_bootloader};" \
+       "name=xloader,start=128K,size=256K,uuid=${uuid_gpt_xloader};" \
+       "name=bootloader,size=768K,uuid=${uuid_gpt_bootloader};" \
        "name=environment,size=128K,uuid=${uuid_gpt_environment};" \
        "name=misc,size=128K,uuid=${uuid_gpt_misc};" \
-       "name=efs,start=1280K,size=16M,uuid=${uuid_gpt_efs};" \
+       "name=reserved,size=256K,uuid=${uuid_gpt_reserved};" \
+       "name=efs,size=16M,uuid=${uuid_gpt_efs};" \
        "name=crypto,size=16K,uuid=${uuid_gpt_crypto};" \
        "name=recovery,size=10M,uuid=${uuid_gpt_recovery};" \
        "name=boot,size=10M,uuid=${uuid_gpt_boot};" \
 #undef CONFIG_CMD_BOOTD
 #ifdef CONFIG_SPL_DFU_SUPPORT
 #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80200000
-#define CONFIG_SPL_HASH_SUPPORT
 #define DFU_ALT_INFO_RAM \
        "dfu_alt_info_ram=" \
        "kernel ram 0x80200000 0x4000000;" \
index 5e4bf484131461ddc8e085cf201c5e795aa80aac..7c4179d23f9ee33069153017d9462757c3e679e2 100644 (file)
@@ -45,8 +45,6 @@
 #define EEPROM_ADDR_DDR3 0x90
 #define EEPROM_ADDR_CHIP 0x120
 
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x300
-
 #undef CONFIG_MII
 #undef CONFIG_PHY_GIGE
 #define CONFIG_PHY_SMSC
index 9e5ee91c890b11a2a4c99ea52221e89ec09cec30..eb17d68d880dedafd27b944f743a7add022c4a62 100644 (file)
 #define EEPROM_ADDR_DDR3 0x90
 #define EEPROM_ADDR_CHIP 0x120
 
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x300
-
 #undef CONFIG_MII
 #undef CONFIG_PHY_GIGE
 #define CONFIG_PHY_SMSC
index f7c47094ae67cff9ed392fb382bd634058d53bae..1cea74e9542cd2667be3fce2a4589bf6de78d5d9 100644 (file)
@@ -47,6 +47,7 @@
 #define CONFIG_IRAM_BASE               0x02100000
 #define CONFIG_IRAM_SIZE               0x58000
 #define CONFIG_IRAM_END                        (CONFIG_IRAM_BASE + CONFIG_IRAM_SIZE)
+#define CPU_RELEASE_ADDR               secondary_boot_addr
 
 /* Number of CPUs available */
 #define CONFIG_CORE_COUNT              0x8
index 8e77982580fe1022b2e18491198ef4a402670889..18b5488392de04daf60f859fa3c370fb5f02edb9 100644 (file)
 /*
  * Serial port
  */
-
-#define CONFIG_PXA_SERIAL
 #define CONFIG_FFUART
 #define CONFIG_CONS_INDEX              3
 
index 76d1ca088d6603c26d51a1dcb023ed4c1d7c80f1..dce4438797959a9051a0f86d75c428ce5bc85b2f 100644 (file)
@@ -25,7 +25,7 @@
  *    or 64KB
  */
 #define CONFIG_SYS_THUMB_BUILD
-#define CONFIG_SPL_LDSCRIPT    "arch/arm/cpu/armv7/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT    "arch/arm/mach-omap2/u-boot-spl.lds"
 #define CONFIG_SPL_TEXT_BASE           0x00908000
 #define CONFIG_SPL_MAX_SIZE            0x10000
 #define CONFIG_SPL_STACK               0x0091FFB8
 
 /* MMC support */
 #if defined(CONFIG_SPL_MMC_SUPPORT)
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        138 /* offset 69KB */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     800 /* 400 KB */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
-#define CONFIG_SYS_MONITOR_LEN  (CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS/2*1024)
+#define CONFIG_SYS_MONITOR_LEN                 409600  /* 400 KB */
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 #endif
 
index 8d6471ae886546969a1fa3fb62d5b7b7985935cc..777f22540afb915a8e56e7dc05d3611fe2d8fb54 100644 (file)
@@ -12,7 +12,6 @@
 
 /* Platform type */
 #define CONFIG_SOC_K2E
-#define CONFIG_K2E_EVM
 
 /* U-Boot general configuration */
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
index a14544526c71757b2e1bfcda9cd5f7b03ffc1042..2da0d8dd7f007af647ccad9040048c09517ac118 100644 (file)
@@ -12,7 +12,6 @@
 
 /* Platform type */
 #define CONFIG_SOC_K2G
-#define CONFIG_K2G_EVM
 
 /* U-Boot general configuration */
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
index 913d4545b81f73f8e2d124c7969e2cee33325c57..4adb119b3066c3ec814ca2f617422d868b3b126f 100644 (file)
@@ -12,7 +12,6 @@
 
 /* Platform type */
 #define CONFIG_SOC_K2HK
-#define CONFIG_K2HK_EVM
 
 /* U-Boot general configuration */
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
index 395e61c21d55bf94f30f446ec7b9c26d9fe58bb7..9bdd56570be7cc2246695373151a29e7709960fe 100644 (file)
@@ -12,7 +12,6 @@
 
 /* Platform type */
 #define CONFIG_SOC_K2L
-#define CONFIG_K2L_EVM
 
 /* U-Boot general configuration */
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
index f8078eff942d22fb03f476db1043bc446a649090..76f2b8b7b4a08f9856d9f9a63e36c1f7b340ccc9 100644 (file)
@@ -31,7 +31,6 @@
 
 #define CONFIG_OMAP
 #define CONFIG_OMAP4430
-#define CONFIG_OMAP_COMMON
 
 /*
  * Board
 #define CONFIG_SYS_SPL_MALLOC_START    0x80208000
 #define CONFIG_SYS_SPL_MALLOC_SIZE     (1024 * 1024)
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 #define CONFIG_SPL_BOARD_INIT
 
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION     2
index 80603c9e467c568252e63d159fd38efe372f7a79..20f0c6143ca7f0feb401aa13892aec5d6b18f953 100644 (file)
        "kernel_size=0x2800000\0"               \
 
 #define CONFIG_BOOTARGS                "console=ttyS0,115200 root=/dev/ram0 " \
-                               "earlycon=uart8250,mmio,0x21c0500"
+                               "earlycon=uart8250,mmio,0x21c0500 quiet lpj=250000"
 #define CONFIG_BOOTCOMMAND             "sf probe 0:0; sf read $kernel_load "\
                                        "$kernel_start $kernel_size && "\
                                        "bootm $kernel_load"
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
new file mode 100644 (file)
index 0000000..7af4bc4
--- /dev/null
@@ -0,0 +1,366 @@
+/*
+ * Copyright 2016 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_LS102XA
+
+#define CONFIG_ARMV7_SECURE_BASE OCRAM_BASE_S_ADDR
+
+#define CONFIG_SYS_FSL_CLK
+
+#define CONFIG_BOARD_EARLY_INIT_F
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + 16 * 1024 * 1024)
+
+#define CONFIG_SYS_INIT_RAM_ADDR       OCRAM_BASE_ADDR
+#define CONFIG_SYS_INIT_RAM_SIZE       OCRAM_SIZE
+
+/* XHCI Support - enabled by default */
+#define CONFIG_HAS_FSL_XHCI_USB
+
+#ifdef CONFIG_HAS_FSL_XHCI_USB
+#define CONFIG_USB_XHCI_FSL
+#define CONFIG_USB_XHCI_DWC3
+#define CONFIG_USB_MAX_CONTROLLER_COUNT                1
+#define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS     2
+#endif
+
+#if defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_XHCI_USB)
+#define CONFIG_USB_STORAGE
+#define CONFIG_CMD_EXT2
+#endif
+
+/*
+ * Generic Timer Definitions
+ */
+#define GENERIC_TIMER_CLK              12500000
+
+#define CONFIG_SYS_CLK_FREQ            100000000
+#define CONFIG_DDR_CLK_FREQ            100000000
+
+/*
+ * DDR: 800 MHz ( 1600 MT/s data rate )
+ */
+
+#define DDR_SDRAM_CFG                  0x470c0008
+#define DDR_CS0_BNDS                   0x008000bf
+#define DDR_CS0_CONFIG                 0x80014302
+#define DDR_TIMING_CFG_0               0x50550004
+#define DDR_TIMING_CFG_1               0xbcb38c56
+#define DDR_TIMING_CFG_2               0x0040d120
+#define DDR_TIMING_CFG_3               0x010e1000
+#define DDR_TIMING_CFG_4               0x00000001
+#define DDR_TIMING_CFG_5               0x03401400
+#define DDR_SDRAM_CFG_2                        0x00401010
+#define DDR_SDRAM_MODE                 0x00061c60
+#define DDR_SDRAM_MODE_2               0x00180000
+#define DDR_SDRAM_INTERVAL             0x18600618
+#define DDR_DDR_WRLVL_CNTL             0x8655f605
+#define DDR_DDR_WRLVL_CNTL_2   0x05060607
+#define DDR_DDR_WRLVL_CNTL_3   0x05050505
+#define DDR_DDR_CDR1                   0x80040000
+#define DDR_DDR_CDR2                   0x00000001
+#define DDR_SDRAM_CLK_CNTL             0x02000000
+#define DDR_DDR_ZQ_CNTL                        0x89080600
+#define DDR_CS0_CONFIG_2               0
+#define DDR_SDRAM_CFG_MEM_EN   0x80000000
+#define SDRAM_CFG2_D_INIT              0x00000010
+#define DDR_CDR2_VREF_TRAIN_EN 0x00000080
+#define SDRAM_CFG2_FRC_SR              0x80000000
+#define SDRAM_CFG_BI                   0x00000001
+
+#ifdef CONFIG_RAMBOOT_PBL
+#define CONFIG_SYS_FSL_PBL_PBI \
+       board/freescale/ls1021aiot/ls102xa_pbi.cfg
+#endif
+
+#ifdef CONFIG_SD_BOOT
+#define CONFIG_SYS_FSL_PBL_RCW \
+       board/freescale/ls1021aiot/ls102xa_rcw_sd.cfg
+#define CONFIG_SPL_FRAMEWORK
+#define CONFIG_SPL_LDSCRIPT    "arch/$(ARCH)/cpu/u-boot-spl.lds"
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_ENV_SUPPORT
+#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
+#define CONFIG_SPL_I2C_SUPPORT
+#define CONFIG_SPL_WATCHDOG_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_MMC_SUPPORT
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0xe8
+
+#define CONFIG_SPL_TEXT_BASE   0x10000000
+#define CONFIG_SPL_MAX_SIZE            0x1a000
+#define CONFIG_SPL_STACK               0x1001d000
+#define CONFIG_SPL_PAD_TO              0x1c000
+#define CONFIG_SYS_TEXT_BASE   0x82000000
+
+#define CONFIG_SYS_SPL_MALLOC_START    (CONFIG_SYS_TEXT_BASE + \
+               CONFIG_SYS_MONITOR_LEN)
+#define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000
+#define CONFIG_SPL_BSS_START_ADDR      0x80100000
+#define CONFIG_SPL_BSS_MAX_SIZE                0x80000
+#define CONFIG_SYS_MONITOR_LEN         0x80000
+#define CONFIG_SYS_NO_FLASH
+#endif
+
+#ifdef CONFIG_QSPI_BOOT
+#define CONFIG_SYS_TEXT_BASE           0x40010000
+#endif
+
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
+#define CONFIG_SYS_NO_FLASH
+#endif
+
+#define CONFIG_NR_DRAM_BANKS           1
+
+#define CONFIG_SYS_DDR_SDRAM_BASE      0x80000000UL
+#define CONFIG_SYS_SDRAM_BASE          CONFIG_SYS_DDR_SDRAM_BASE
+
+#define CONFIG_FSL_CAAM                        /* Enable CAAM */
+
+/*
+ * Serial Port
+ */
+#define CONFIG_CONS_INDEX              1
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE    1
+#define CONFIG_SYS_NS16550_CLK         get_serial_clock()
+#define CONFIG_BAUDRATE                        115200
+
+/*
+ * I2C
+ */
+#define CONFIG_CMD_I2C
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_MXC
+#define CONFIG_SYS_I2C_MXC_I2C1                /* enable I2C bus 1 */
+#define CONFIG_SYS_I2C_MXC_I2C2                /* enable I2C bus 2 */
+#define CONFIG_SYS_I2C_MXC_I2C3                /* enable I2C bus 3 */
+
+/* EEPROM */
+#define CONFIG_ID_EEPROM
+#define CONFIG_SYS_I2C_EEPROM_NXID
+#define CONFIG_SYS_EEPROM_BUS_NUM              0
+#define CONFIG_SYS_I2C_EEPROM_ADDR             0x51
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
+
+/*
+ * MMC
+ */
+#define CONFIG_MMC
+#define CONFIG_CMD_MMC
+#define CONFIG_FSL_ESDHC
+#define CONFIG_GENERIC_MMC
+
+/* SATA */
+#define CONFIG_BOARD_LATE_INIT
+#define CONFIG_CMD_SCSI
+#define CONFIG_LIBATA
+#define CONFIG_SCSI_AHCI
+#define CONFIG_SCSI_AHCI_PLAT
+#ifndef PCI_DEVICE_ID_FREESCALE_AHCI
+#define PCI_DEVICE_ID_FREESCALE_AHCI   0x0440
+#endif
+#define CONFIG_SCSI_DEV_LIST           {PCI_VENDOR_ID_FREESCALE, \
+       PCI_DEVICE_ID_FREESCALE_AHCI}
+
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID    1
+#define CONFIG_SYS_SCSI_MAX_LUN                1
+#define CONFIG_SYS_SCSI_MAX_DEVICE     (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
+               CONFIG_SYS_SCSI_MAX_LUN)
+
+#define CONFIG_CMD_FAT
+#define CONFIG_DOS_PARTITION
+
+/* SPI */
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
+#define CONFIG_SPI_FLASH_SPANSION
+
+/* QSPI */
+#define QSPI0_AMBA_BASE                        0x40000000
+#define FSL_QSPI_FLASH_SIZE            (1 << 24)
+#define FSL_QSPI_FLASH_NUM             2
+#define CONFIG_SPI_FLASH_BAR
+#define CONFIG_SPI_FLASH_SPANSION
+#endif
+
+/* DM SPI */
+#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI)
+#define CONFIG_CMD_SF
+#define CONFIG_DM_SPI_FLASH
+#endif
+
+/*
+ * eTSEC
+ */
+#define CONFIG_TSEC_ENET
+
+#ifdef CONFIG_TSEC_ENET
+#define CONFIG_MII
+#define CONFIG_MII_DEFAULT_TSEC                1
+#define CONFIG_TSEC1                   1
+#define CONFIG_TSEC1_NAME              "eTSEC1"
+#define CONFIG_TSEC2                   1
+#define CONFIG_TSEC2_NAME              "eTSEC2"
+
+#define TSEC1_PHY_ADDR                 1
+#define TSEC2_PHY_ADDR                 3
+
+#define TSEC1_FLAGS                    (TSEC_GIGABIT | TSEC_REDUCED)
+#define TSEC2_FLAGS                    (TSEC_GIGABIT | TSEC_REDUCED)
+
+#define TSEC1_PHYIDX                   0
+#define TSEC2_PHYIDX                   0
+
+#define CONFIG_ETHPRIME                        "eTSEC2"
+
+#define CONFIG_PHY_GIGE
+#define CONFIG_PHYLIB
+#define CONFIG_PHY_ATHEROS
+
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
+#define CONFIG_HAS_ETH2
+#endif
+
+/* PCIe */
+#define CONFIG_PCI             /* Enable PCI/PCIE */
+#define CONFIG_PCIE1           /* PCIE controler 1 */
+#define CONFIG_PCIE2           /* PCIE controler 2 */
+
+/* Use common FSL Layerscape PCIe code */
+#define CONFIG_PCIE_LAYERSCAPE
+#define FSL_PCIE_COMPAT                "fsl,ls1021a-pcie"
+
+#define CONFIG_SYS_PCI_64BIT
+
+#define CONFIG_SYS_PCIE_CFG0_PHYS_OFF  0x00000000
+#define CONFIG_SYS_PCIE_CFG0_SIZE      0x00001000      /* 4k */
+#define CONFIG_SYS_PCIE_CFG1_PHYS_OFF  0x00001000
+#define CONFIG_SYS_PCIE_CFG1_SIZE      0x00001000      /* 4k */
+
+#define CONFIG_SYS_PCIE_IO_BUS         0x00000000
+#define CONFIG_SYS_PCIE_IO_PHYS_OFF    0x00010000
+#define CONFIG_SYS_PCIE_IO_SIZE                0x00010000      /* 64k */
+
+#define CONFIG_SYS_PCIE_MEM_BUS                0x08000000
+#define CONFIG_SYS_PCIE_MEM_PHYS_OFF   0x04000000
+#define CONFIG_SYS_PCIE_MEM_SIZE       0x08000000      /* 128M */
+
+#ifdef CONFIG_PCI
+#define CONFIG_PCI_PNP
+#define CONFIG_PCI_SCAN_SHOW
+#define CONFIG_CMD_PCI
+#endif
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_MII
+
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_CMDLINE_EDITING
+
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT)
+#undef CONFIG_CMD_IMLS
+#endif
+
+#define CONFIG_PEN_ADDR_BIG_ENDIAN
+#define CONFIG_LAYERSCAPE_NS_ACCESS
+#define CONFIG_SMP_PEN_ADDR            0x01ee0200
+#define CONFIG_TIMER_CLK_FREQ          12500000
+
+#define CONFIG_HWCONFIG
+#define HWCONFIG_BUFFER_SIZE           256
+
+#define CONFIG_FSL_DEVICE_DISABLE
+
+#define CONFIG_EXTRA_ENV_SETTINGS      \
+       "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \
+"initrd_high=0xffffffff\0"     \
+"fdt_high=0xffffffff\0"
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CONFIG_SYS_LONGHELP            /* undef to save memory */
+#define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_CBSIZE      256     /* Console I/O Buffer Size */
+#define CONFIG_SYS_PBSIZE              \
+       (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS     16      /* max number of command args */
+#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
+
+#define CONFIG_CMD_GREPENV
+#define CONFIG_CMD_MEMINFO
+
+#define CONFIG_SYS_LOAD_ADDR           0x82000000
+
+#define CONFIG_LS102XA_STREAM_ID
+
+/*
+ * Stack sizes
+ * The stack sizes are set up in start.S using the settings below
+ */
+#define CONFIG_STACKSIZE               (30 * 1024)
+
+#define CONFIG_SYS_INIT_SP_OFFSET \
+       (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP_ADDR \
+       (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
+
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
+#else
+/* start of monitor */
+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
+#endif
+
+#define CONFIG_SYS_QE_FW_ADDR  0x67f40000
+
+/*
+ * Environment
+ */
+
+#define CONFIG_ENV_OVERWRITE
+
+#if defined(CONFIG_SD_BOOT)
+#define CONFIG_ENV_OFFSET              0x100000
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV 0
+#define CONFIG_ENV_SIZE                        0x2000
+#elif defined(CONFIG_QSPI_BOOT)
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_SIZE                        0x2000
+#define CONFIG_ENV_OFFSET              0x100000
+#define CONFIG_ENV_SECT_SIZE   0x10000
+#endif
+
+#define CONFIG_OF_BOARD_SETUP
+#define CONFIG_OF_STDOUT_VIA_ALIAS
+#define CONFIG_CMD_BOOTZ
+
+#define CONFIG_MISC_INIT_R
+
+/* Hash command with SHA acceleration supported in hardware */
+
+#ifdef CONFIG_FSL_CAAM
+
+#define CONFIG_CMD_HASH
+
+#define CONFIG_SHA_HW_ACCEL
+
+#endif
+
+#include <asm/fsl_secure_boot.h>
+
+#endif
index 53f03688141e0db4ef06570eef32343e8b495e91..128da8a3528149ed0587c1f64f174caaed124d74 100644 (file)
@@ -61,8 +61,6 @@ unsigned long get_board_ddr_clk(void);
 #endif
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_LDSCRIPT    "arch/$(ARCH)/cpu/u-boot-spl.lds"
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR                0xe8
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS             0x600
 
 #define CONFIG_SPL_TEXT_BASE           0x10000000
 #define CONFIG_SPL_MAX_SIZE            0x1a000
index 4a579b1adbe8b6a7e6f6afa25778598488820e8f..145833287e56e9150c7e066cf13ffd0fc608740b 100644 (file)
 #endif
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_LDSCRIPT    "arch/$(ARCH)/cpu/u-boot-spl.lds"
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR                0xe8
 
 #ifdef CONFIG_SECURE_BOOT
-#define CONFIG_U_BOOT_HDR_SIZE                         (16 << 10)
 /*
  * HDR would be appended at end of image and copied to DDR along
  * with U-Boot image.
  */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS             (0x400 + \
-               (CONFIG_U_BOOT_HDR_SIZE / 512)
-#else
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS             0x400
+#define CONFIG_U_BOOT_HDR_SIZE                         (16 << 10)
 #endif /* ifdef CONFIG_SECURE_BOOT */
 
 #define CONFIG_SPL_TEXT_BASE           0x10000000
index 64682b187561c90d43f15602f201b329f53d7e8f..7a407aa70a244f68a994df870a98960bf63d3a81 100644 (file)
@@ -52,8 +52,6 @@
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_LDSCRIPT            "arch/arm/cpu/armv8/u-boot-spl.lds"
 #define CONFIG_SPL_TARGET              "u-boot-with-spl.bin"
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR                0xf0
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS             0x500
 
 #define CONFIG_SPL_TEXT_BASE           0x10000000
 #define CONFIG_SPL_MAX_SIZE            0x1d000
index c4bbd5600d3b308e2ff157736ac50703cc3f2bb3..3887faa97b05b93bf91898b5a5527624e456fae8 100644 (file)
@@ -61,8 +61,6 @@
 #define CONFIG_SPL_DRIVERS_MISC_SUPPORT
 
 #define CONFIG_SPL_MMC_SUPPORT
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR                0x110
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS             0x500
 #define CONFIG_SPL_TEXT_BASE           0x10000000
 #define CONFIG_SPL_MAX_SIZE            0x1f000         /* 124 KiB */
 #define CONFIG_SPL_STACK               0x10020000
index c0f5bd3562e72d96450aa7efa627388cc1c68bae..29e0aa5ee1e0941b6767b6ab78d13d5149998982 100644 (file)
@@ -127,6 +127,14 @@ unsigned long get_board_ddr_clk(void);
 #endif
 #endif
 
+/* LPUART */
+#ifdef CONFIG_LPUART
+#define CONFIG_LPUART_32B_REG
+#define CFG_UART_MUX_MASK      0x6
+#define CFG_UART_MUX_SHIFT     1
+#define CFG_LPUART_EN          0x2
+#endif
+
 /* SATA */
 #define CONFIG_LIBATA
 #define CONFIG_SCSI_AHCI
index b9cb6d38795f39890f53cdfdf1ddea46bb6eeecb..31df78193494b0fce62f11c37ce7baadba34cde6 100644 (file)
@@ -269,6 +269,7 @@ unsigned long get_board_sys_clk(void);
 #ifdef CONFIG_FSL_DSPI
 #define CONFIG_SPI_FLASH
 #define CONFIG_SPI_FLASH_BAR
+#define CONFIG_SPI_FLASH_STMICRO
 #endif
 
 /*
@@ -316,10 +317,25 @@ unsigned long get_board_sys_clk(void);
 #define CONFIG_USB_MAX_CONTROLLER_COUNT         2
 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS      2
 
+#undef CONFIG_CMDLINE_EDITING
+#include <config_distro_defaults.h>
+
+#define BOOT_TARGET_DEVICES(func) \
+       func(USB, usb, 0) \
+       func(MMC, mmc, 0) \
+       func(SCSI, scsi, 0) \
+       func(DHCP, dhcp, na)
+#include <config_distro_bootcmd.h>
+
 /* Initial environment variables */
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS              \
        "hwconfig=fsl_ddr:bank_intlv=auto\0"    \
+       "scriptaddr=0x80800000\0"               \
+       "kernel_addr_r=0x81000000\0"            \
+       "pxefile_addr_r=0x81000000\0"           \
+       "fdt_addr_r=0x88000000\0"               \
+       "ramdisk_addr_r=0x89000000\0"           \
        "loadaddr=0x80100000\0"                 \
        "kernel_addr=0x100000\0"                \
        "ramdisk_addr=0x800000\0"               \
@@ -329,8 +345,10 @@ unsigned long get_board_sys_clk(void);
        "kernel_start=0x581100000\0"            \
        "kernel_load=0xa0000000\0"              \
        "kernel_size=0x2800000\0"               \
+       "fdtfile=fsl-ls2080a-rdb.dtb\0"         \
        "mcinitcmd=fsl_mc start mc 0x580300000" \
-       " 0x580800000 \0"
+       " 0x580800000 \0"                       \
+       BOOTENV
 
 #undef CONFIG_BOOTARGS
 #define CONFIG_BOOTARGS                "console=ttyS1,115200 root=/dev/ram0 " \
@@ -338,6 +356,13 @@ unsigned long get_board_sys_clk(void);
                                "ramdisk_size=0x2000000 default_hugepagesz=2m" \
                                " hugepagesz=2m hugepages=256"
 
+#undef CONFIG_BOOTCOMMAND
+/* Try to boot an on-NOR kernel first, then do normal distro boot */
+#define CONFIG_BOOTCOMMAND "run mcinitcmd && fsl_mc lazyapply dpl 0x580700000" \
+                          " && cp.b $kernel_start $kernel_load $kernel_size" \
+                          " && bootm $kernel_load" \
+                          " || run distro_bootcmd"
+
 /* MAC/PHY configuration */
 #ifdef CONFIG_FSL_MC_ENET
 #define CONFIG_PHYLIB_10G
index b9a2ad35212789f3ee35a9ff1a52ede5a6f77659..0c6b1e89fc1116ebd22a9826b03268881f70b82d 100644 (file)
@@ -15,7 +15,6 @@
 #define CONFIG_OMAP                    /* in a TI OMAP core */
 #define CONFIG_OMAP3_MCX               /* working with mcx */
 #define CONFIG_OMAP_GPIO
-#define CONFIG_OMAP_COMMON
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 #define CONFIG_SPL_TEXT_BASE           0x40200000 /*CONFIG_SYS_SRAM_START*/
 #define CONFIG_SPL_MAX_SIZE            (54 * 1024)     /* 8 KB for stack */
 #define CONFIG_SPL_BSS_START_ADDR      0x8f080000 /* end of RAM */
 #define CONFIG_SPL_BSS_MAX_SIZE                0x80000
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 
index d1230a56f41bed320bd55368a2ad19d926e73768..4d5265f5409a620a9128b51090d748ef652eb879 100644 (file)
@@ -27,7 +27,6 @@
 #define CONFIG_OMAP3430                        /* which is in a 3430 */
 #define CONFIG_OMAP3_RX51              /* working with RX51 */
 #define CONFIG_SYS_L2CACHE_OFF         /* pretend there is no L2 CACHE */
-#define CONFIG_OMAP_COMMON
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
index 8a69a5f9764c1142868407e44137ca87cfa2fdc5..9850aa6c059a99d08c229199c26343516db8d8cb 100644 (file)
 #define CONFIG_SYS_MAX_NAND_DEVICE     1               /* Max number of NAND */
                                                        /* devices */
 
+#define BOOT_TARGET_DEVICES(func) \
+       func(MMC, mmc, 0)
+
+#define CONFIG_BOOTCOMMAND \
+       "run findfdt; " \
+       "run distro_bootcmd; " \
+       "mmc dev ${mmcdev}; if mmc rescan; then " \
+               "if run userbutton; then " \
+                       "setenv bootenv uEnv.txt;" \
+               "else " \
+                       "setenv bootenv user.txt;" \
+               "fi;" \
+               "echo SD/MMC found on device ${mmcdev};" \
+               "if run loadbootenv; then " \
+                       "echo Loaded environment from ${bootenv};" \
+                       "run importbootenv;" \
+               "fi;" \
+               "if test -n $uenvcmd; then " \
+                       "echo Running uenvcmd ...;" \
+                       "run uenvcmd;" \
+               "fi;" \
+               "if run loadbootscript; then " \
+                       "run bootscript; " \
+               "else " \
+                       "if run loadimage; then " \
+                               "run mmcboot;" \
+                       "fi;" \
+               "fi; " \
+       "fi;" \
+       "run nandboot;" \
+       "setenv bootfile zImage;" \
+       "if run loadimage; then " \
+               "run loadfdt;" \
+               "run mmcbootz; " \
+       "fi; " \
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "loadaddr=0x80200000\0" \
+       "kernel_addr_r=0x80200000\0" \
        "rdaddr=0x81000000\0" \
+       "initrd_addr_r=0x81000000\0" \
        "fdt_high=0xffffffff\0" \
        "fdtaddr=0x80f80000\0" \
+       "fdt_addr_r=0x80f80000\0" \
        "usbtty=cdc_acm\0" \
        "bootfile=uImage\0" \
        "ramdisk=ramdisk.gz\0" \
        "userbutton=if gpio input 173; then run userbutton_xm; " \
                "else run userbutton_nonxm; fi;\0" \
        "userbutton_xm=gpio input 4;\0" \
-       "userbutton_nonxm=gpio input 7;\0"
-/* "run userbutton" will return 1 (false) if pressed and 0 (true) if not */
-#define CONFIG_BOOTCOMMAND \
-       "run findfdt; " \
-       "mmc dev ${mmcdev}; if mmc rescan; then " \
-               "if run userbutton; then " \
-                       "setenv bootenv uEnv.txt;" \
-               "else " \
-                       "setenv bootenv user.txt;" \
-               "fi;" \
-               "echo SD/MMC found on device ${mmcdev};" \
-               "if run loadbootenv; then " \
-                       "echo Loaded environment from ${bootenv};" \
-                       "run importbootenv;" \
-               "fi;" \
-               "if test -n $uenvcmd; then " \
-                       "echo Running uenvcmd ...;" \
-                       "run uenvcmd;" \
-               "fi;" \
-               "if run loadbootscript; then " \
-                       "run bootscript; " \
-               "else " \
-                       "if run loadimage; then " \
-                               "run mmcboot;" \
-                       "fi;" \
-               "fi; " \
-       "fi;" \
-       "run nandboot;" \
-       "setenv bootfile zImage;" \
-       "if run loadimage; then " \
-               "run loadfdt;" \
-               "run mmcbootz; " \
-       "fi; " \
+       "userbutton_nonxm=gpio input 7;\0" \
+       BOOTENV
 
 /*
  * OMAP3 has 12 GP timers, they can be driven by the system clock
index b2a84125b6ba3cde0ccf8a633eee92870405f444..6388a9ccaf6a891bbde92c44d5a0811879103459 100644 (file)
@@ -52,8 +52,6 @@
 #define CONFIG_OMAP_HSMMC
 
 /* SPL */
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x200 /* 256 KB */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 
@@ -94,7 +92,6 @@
  */
 #define CONFIG_OMAP                    /* This is TI OMAP core */
 #define CONFIG_OMAP_GPIO
-#define CONFIG_OMAP_COMMON
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
 
 #define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_OMAP3_ID_NAND
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 /*
  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
index 0827ebedfd12d8bf557181550fb4531a63efb907..abce61ae36f2996d3b3672e837d1dbd39d3b76be 100644 (file)
 
 #define CONFIG_NR_DRAM_BANKS   2       /* CS1 may or may not be populated */
 
-/*
- * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
- * 64 bytes before this address should be set aside for u-boot.img's
- * header. That is 0x800FFFC0--0x80100000 should not be used for any
- * other needs.  We use this rather than the inherited defines from
- * ti_armv7_common.h for backwards compatibility.
- */
-#define CONFIG_SYS_TEXT_BASE           0x80100000
-#define CONFIG_SPL_BSS_START_ADDR      0x80000000
-#define CONFIG_SPL_BSS_MAX_SIZE                (512 << 10)     /* 512 KB */
-#define CONFIG_SYS_SPL_MALLOC_START    0x80208000
-#define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000
-
 #include <configs/ti_omap3_common.h>
 
 /*
 #define CONFIG_MTD_DEVICE              /* needed for mtdparts commands */
 #define CONFIG_MTD_PARTITIONS          /* required for UBI partition support */
 #define MTDIDS_DEFAULT                 "nand0=omap2-nand.0"
-#define MTDPARTS_DEFAULT               "mtdparts=omap2-nand.0:512k(MLO),"\
-                                       "1920k(u-boot),128k(u-boot-env),"\
-                                       "4m(kernel),-(fs)"
+#define MTDPARTS_DEFAULT       "mtdparts=omap2-nand.0:"\
+                                                       "512k(MLO),"\
+                                                       "1792k(u-boot),"\
+                                                       "128k(spl-os)," \
+                                                       "128k(u-boot-env),"\
+                                                       "6m(kernel),-(fs)"
 #endif
 
 /* Environment information */
index ef081b259be589cf208d239904038a755fe7d2f4..aff4635e90e6e36e3d9fe37e36406f59cdc727e3 100644 (file)
 /* CPU */
 #define CONFIG_ENV_IS_NOWHERE
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 #ifdef CONFIG_SPI_BOOT
 #define CONFIG_SPL_SPI_LOAD
index 4130f53582382d6f6d301c37969fb0a9f5f80311..f1db204910d25bdbdf6f819f602e6124cce761b5 100644 (file)
 
 /* CPSW support */
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 #endif /* ! __CONFIG_PENGWYN_H */
index e99188fc43e3f36130de1cfbeb8d7523bba17c50..d9c84f27ea9b59afebe46ad1d19c0f70254eee27 100644 (file)
@@ -90,6 +90,6 @@
 #define CONFIG_PHY_RESET_DELAY 1000
 
 /* SPL */
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 #endif /* __CONFIG_PEPPER_H */
index 64db0dac37b358427525a0b064fdde9470df48f5..9051c1cefcc6c3f93c076721a739fdf180e986c7 100644 (file)
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00080000
 
 #define CONFIG_SPL_LDSCRIPT    arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
index 2aa184a2c2d6f8001b3346ae130b04374d439b01..d797a2ce4d7b2774207fdbe5d0a1fc3bb68bfb08 100644 (file)
@@ -40,8 +40,6 @@
 #define CONFIG_SYS_I2C_SPEED           400000
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50
 
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x300
-
 #define CONFIG_PHY_ATHEROS
 
 #define CONFIG_FACTORYSET
index 5adad665566e85356861cc44988f2c970f3ce2bd..d6fead27db3b29b866c21db4f5f1b871b309ab0c 100644 (file)
@@ -48,8 +48,6 @@
 #define EEPROM_ADDR_DDR3 0x90
 #define EEPROM_ADDR_CHIP 0x120
 
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x300
-
 #undef CONFIG_MII
 #undef CONFIG_PHY_GIGE
 #define CONFIG_PHY_SMSC
index 4eef3f8cc6e8ac11eb03e05a9dd4ced960208840..92be29e7bbaa8696b66e37b65a78103ccb064be7 100644 (file)
 #define CONFIG_G_DNL_VENDOR_NUM                0x2207
 #define CONFIG_G_DNL_PRODUCT_NUM       0x310a
 
+/* usb host */
+#ifdef CONFIG_CMD_USB
+#define CONFIG_USB_DWC2
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_SMSC95XX
+#define CONFIG_USB_ETHER_ASIX
+#endif
 #define ENV_MEM_LAYOUT_SETTINGS \
        "scriptaddr=0x60000000\0" \
        "pxefile_addr_r=0x60100000\0" \
index 0868612c136c5f5f6c25bb1e56908e2b5d94a545..5358372587b0c2248bec78a34854909a41b33eb9 100644 (file)
@@ -50,7 +50,6 @@
 #define CONFIG_CMD_PART
 
 /* RAW SD card / eMMC locations. */
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        256
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     (128 << 10)
 
 /* FAT sd card locations. */
index d75feadab7c881d56e5ac03f4e605c152ce348ea..aa646c6f52da5ba8b3955aaeb42c968fc463531b 100644 (file)
@@ -41,7 +41,6 @@
 #define CONFIG_CMD_PART
 
 /* RAW SD card / eMMC locations. */
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        256
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     (128 << 10)
 
 /* FAT sd card locations. */
index 7ca1696a1630ad288d5f1ecc3fe1233be99015ef..9ec71c4baaae588c23410ea04b398ffe992be82c 100644 (file)
@@ -27,7 +27,7 @@
        "name=reserved2,size=4M,uuid=${uuid_gpt_reserved2};" \
        "name=loader2,size=4MB,uuid=${uuid_gpt_loader2};" \
        "name=atf,size=4M,uuid=${uuid_gpt_atf};" \
-       "name=boot,size=128M,bootable,uuid=${uuid_gpt_boot};" \
+       "name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};" \
        "name=rootfs,size=-,uuid=${uuid_gpt_rootfs};\0" \
 
 #endif
index 3d7b85f306ca98ffd040bc8709503810b2de7854..e5933b85ee120c41f3e39edf442efe9d7c26b174 100644 (file)
@@ -35,8 +35,6 @@
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS       6       /* 64 byte pages */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS   10      /* take up to 10 msec */
 
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x200
-
 #define CONFIG_PHY_NATSEMI
 
 #define CONFIG_FACTORYSET
index f6946453e5df9c584c198022810d2e2ff3eaf94f..61e337617cfdf4fcf62a66c7af99c157f6bfe76d 100644 (file)
 
 #ifdef CONFIG_SYS_USE_MMC
 #define CONFIG_SPL_LDSCRIPT            arch/arm/mach-at91/armv7/u-boot-spl.lds
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
index 5e6617410c40097ee32e0934424cc7f4184898b6..f48559e3219629e5ad1a7ec0aeaf844a55dfdf3b 100644 (file)
 
 #ifdef CONFIG_SYS_USE_MMC
 #define CONFIG_SPL_LDSCRIPT            arch/arm/mach-at91/armv7/u-boot-spl.lds
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 
index 1b053a6362c56db0ee0a60bcdea1f18caccb3ba5..ed91bdc12434b748b30315b7b52ea999b151a7e4 100644 (file)
 
 #ifdef CONFIG_SYS_USE_MMC
 #define CONFIG_SPL_LDSCRIPT            arch/arm/mach-at91/armv7/u-boot-spl.lds
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 
index 249e661d8b71501963b6d8addba0c25cc3ac7ee2..5d7884745086108215fba59a07d2605dd2905d4a 100644 (file)
 
 #ifdef CONFIG_SYS_USE_MMC
 #define CONFIG_SPL_LDSCRIPT            arch/arm/mach-at91/armv7/u-boot-spl.lds
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
index 00ed4009faa50618e6b7eccfde51032a87654f0f..498b32b639d695fe739eb09ae9732180760c9cb2 100644 (file)
 
 #ifdef CONFIG_SYS_USE_MMC
 #define CONFIG_SPL_LDSCRIPT            arch/arm/mach-at91/armv7/u-boot-spl.lds
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
index 7de3cf6d9ae6725d31267767f6b258b73fcc6c79..456429694e7fc2a91734b8e051ba2c694726a23f 100644 (file)
@@ -16,7 +16,6 @@
 
 #define CONFIG_AM33XX
 #define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
 
 #include <asm/arch/omap.h>
 
 #define CONFIG_SPL_BSS_START_ADDR      0x80000000
 #define CONFIG_SPL_BSS_MAX_SIZE                0x80000         /* 512 KB */
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 #define CONFIG_FS_FAT
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x20000
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
 
 #define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_AM33XX_BCH
index 7fada3fec0a7adc96a229ef2805fb9c5671e0af5..e12b101333920a83e26a7d4b318e1946361afe60 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 #define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
 
 /*
  * Board
 #define CONFIG_SYS_SPL_MALLOC_SIZE     (1024 * 1024)
 #define CONFIG_SPL_STACK               LOW_LEVEL_SRAM_STACK
 
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 #define CONFIG_SPL_BOARD_INIT
 
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION     2
index d37e5958b58689de116981529f8b37de9abc1c50..58a65508449148b2fe590d44fb5645d26019de4a 100644 (file)
@@ -320,7 +320,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot-dtb.img"
 #else
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION     1
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x200 /* offset 512 sect (256k) */
 #endif
 #endif
 
index 8363414828fa82f36575b377d68f12fbce2d691e..b0bfc0dfd7daecdf99a09a269e54532fa862833a 100644 (file)
 #define CONFIG_MMC_SUNXI_SLOT          0
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV         0       /* first detected MMC controller */
+#define CONFIG_SYS_MMC_MAX_DEVICE      4
 #endif
 
 /* 64MB of malloc() pool */
 #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds"
 #endif
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        80      /* 40KiB */
 #define CONFIG_SPL_PAD_TO              32768           /* decimal for 'dd' */
 
 #if defined(CONFIG_MACH_SUN9I) || defined(CONFIG_MACH_SUN50I)
index 1527d90afd715311fa2077718889845fe6e62ee9..ff0c60d01cf37daec0b72589e2686fa2cca24cc6 100644 (file)
@@ -15,7 +15,6 @@
  */
 #define CONFIG_OMAP            /* in a TI OMAP core */
 #define CONFIG_OMAP_GPIO
-#define CONFIG_OMAP_COMMON
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 #define CONFIG_SPL_TEXT_BASE           0x40200000 /*CONFIG_SYS_SRAM_START*/
 #define CONFIG_SPL_MAX_SIZE            (SRAM_SCRATCH_SPACE_ADDR - \
 #define CONFIG_SPL_BSS_START_ADDR      0x8f080000 /* end of RAM */
 #define CONFIG_SPL_BSS_MAX_SIZE                0x80000
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
index 9e85b1da0238b7ade83372d325c22709a83425da..a873e7b553d0536a05005540c10ee230b1473285 100644 (file)
@@ -19,7 +19,6 @@
 #define CONFIG_OMAP                    /* in a TI OMAP core */
 
 #define CONFIG_OMAP_GPIO
-#define CONFIG_OMAP_COMMON
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_NAND_SIMPLE
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x200 /* 256 KB */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
 #define CONFIG_SPL_OMAP3_ID_NAND
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 /* NAND boot config */
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
index e844cdd2792396725dd058a2d50ba5af8db9868b..a2352538dd9072d29d1ddff641e5a76f76d7c11c 100644 (file)
@@ -41,8 +41,6 @@
 #define EEPROM_ADDR_DDR3 0x90
 #define EEPROM_ADDR_CHIP 0x120
 
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x300
-
 #undef CONFIG_MII
 #undef CONFIG_PHY_GIGE
 #define CONFIG_PHY_SMSC
index e7f4fba132d58e4b8e3b956b39b365a46ba476eb..6a5ed196bf16dac21b803f52162a2f5fe44e9b9c 100644 (file)
@@ -20,7 +20,6 @@
 #define CONFIG_TI814X
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
 
 #include <asm/arch/omap.h>
 
 #define CONFIG_SPL_BSS_START_ADDR      0x80000000
 #define CONFIG_SPL_BSS_MAX_SIZE                0x80000         /* 512 KB */
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS      0x200 /* 256 KB */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x20000
 #define CONFIG_SYS_SPI_U_BOOT_SIZE     0x40000
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 
 #define CONFIG_SPL_BOARD_INIT
 
index 390c5aee26ef79c94c1ce0541bb80a24a2af4d5f..5db4c605466a564fd1334691b5844728287aab95 100644 (file)
@@ -14,7 +14,6 @@
 #define CONFIG_TI816X
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
 
 #define CONFIG_ARCH_CPU_INIT
 
 #define CONFIG_SPL_BSS_START_ADDR   0x80000000
 #define CONFIG_SPL_BSS_MAX_SIZE     0x80000     /* 512 KB */
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS      0x200 /* 256 KB */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 
 #define CONFIG_SYS_SPI_U_BOOT_OFFS  0x20000
 #define CONFIG_SYS_SPI_U_BOOT_SIZE  0x40000
-#define CONFIG_SPL_LDSCRIPT     "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT     "arch/arm/mach-omap2/u-boot-spl.lds"
 
 #define CONFIG_SPL_BOARD_INIT
 
index 0d74c50bffa75dca6fbc43974b1cbcf3ca45da95..1be8137e33f1f153572cdd49fda2d86bc1418b66 100644 (file)
 #endif
 
 
-/* RAW SD card / eMMC locations. */
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x200 /* 256 KB */
-
 /* FAT sd card locations. */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
index 7e365aa6c60aa9df20012cfe9b6175bb3909f1b5..cfb4b30da798ce61f1cdfb8197d5a18dc01565e1 100644 (file)
        "set_rd_spec=setenv rd_spec ${rdaddr}:${filesize}\0"            \
        "init_fw_rd_net=dhcp ${rdaddr} ${tftp_root}/${name_fw_rd}; "    \
                "run set_rd_spec\0"                                     \
+       "init_fw_rd_nfs=nfs ${rdaddr} ${nfs_root}/boot/${name_fw_rd}; " \
+               "run set_rd_spec\0"                                     \
        "init_fw_rd_ramfs=setenv rd_spec -\0"                           \
        "init_fw_rd_ubi=ubifsload ${rdaddr} ${bootdir}/${name_fw_rd}; " \
                "run set_rd_spec\0"                                     \
        "set_name_pmmc=setenv name_pmmc ti-sci-firmware-${soc_variant}.bin\0" \
        "dev_pmmc=0\0"                                                  \
        "get_pmmc_net=dhcp ${loadaddr} ${tftp_root}/${name_pmmc}\0"     \
+       "get_pmmc_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_pmmc}\0"  \
        "get_pmmc_ramfs=run get_pmmc_net\0"                             \
        "get_pmmc_mmc=load mmc ${bootpart} ${loadaddr} "                \
                        "${bootdir}/${name_pmmc}\0"                     \
index 7548170afcf7e3c0349894cc51324415c76d6da6..6d9d4b2d97abf479bd1308287620032ccfda40e9 100644 (file)
@@ -14,7 +14,6 @@
 
 /* Common defines for all OMAP architecture based SoCs */
 #define CONFIG_OMAP
-#define CONFIG_OMAP_COMMON
 
 /* I2C IP block */
 #define CONFIG_SYS_OMAP24_I2C_SPEED    100000
index d607f407fdf9b42cadd05dc202814a914a706a41..0ad32353bae25aed3210caeb0b0fc78171be004c 100644 (file)
@@ -68,7 +68,7 @@
 
 /* SPL */
 #define CONFIG_SPL_TEXT_BASE           0x40200800
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 #define CONFIG_SYS_SPL_ARGS_ADDR       (CONFIG_SYS_SDRAM_BASE + \
                                         (64 << 20))
 
index 3d2992f737dc47477c4a37d4e5315283822627d9..aa17c09ce96841651d62fb1a96b6f3fa8cf2d6c7 100644 (file)
  * So moving TEXT_BASE down to non-HS limit.
  */
 #define CONFIG_SPL_TEXT_BASE           0x40300000
-#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
 #define CONFIG_SYS_SPL_ARGS_ADDR       (CONFIG_SYS_SDRAM_BASE + \
                                         (128 << 20))
 
index 29b7d96d9622de87d04b23ff1cd74995c3053594..8322f645fe9667756ea324c007f2124c98aa9f9f 100644 (file)
        "if test ${dofastboot} -eq 1; then " \
                "echo Boot fastboot requested, resetting dofastboot ...;" \
                "setenv dofastboot 0; saveenv;" \
-               "echo Booting into fastboot ...; fastboot 0;" \
+               "echo Booting into fastboot ...; " \
+               "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \
        "fi;" \
        "run findfdt; " \
        "run envboot; " \
 #define CONFIG_SPL_TEXT_BASE   0x40300000
 #endif
 
-#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
 #define CONFIG_SYS_SPL_ARGS_ADDR       (CONFIG_SYS_SDRAM_BASE + \
                                         (128 << 20))
 
diff --git a/include/configs/topic_miami.h b/include/configs/topic_miami.h
new file mode 100644 (file)
index 0000000..3b0fa29
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * (C) Copyright 2014 Topic Embedded Products
+ *
+ * Configuration for Zynq Evaluation and Development Board - Miami
+ * See zynq-common.h for Zynq common configs
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_TOPIC_MIAMI_H
+#define __CONFIG_TOPIC_MIAMI_H
+
+#define CONFIG_ZYNQ_PS_CLK_FREQ                33333333UL
+
+#define CONFIG_ZYNQ_I2C0
+#define CONFIG_ZYNQ_I2C1
+
+/* Speed up boot time by ignoring the environment which we never used */
+#define CONFIG_ENV_IS_NOWHERE
+
+#include "zynq-common.h"
+
+/* Fixup settings */
+#undef CONFIG_ENV_SIZE
+#define CONFIG_ENV_SIZE                        0x8000
+#undef CONFIG_ENV_OFFSET
+#define CONFIG_ENV_OFFSET              0x80000
+
+/* SPL settings */
+#undef CONFIG_SPL_ETH_SUPPORT
+#undef CONFIG_SYS_SPI_U_BOOT_OFFS
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x20000
+#undef CONFIG_SPL_MAX_FOOTPRINT
+#define CONFIG_SPL_MAX_FOOTPRINT       CONFIG_SYS_SPI_U_BOOT_OFFS
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME     "u-boot.img"
+
+/* sspi command isn't useful */
+#undef CONFIG_CMD_SPI
+
+/* No useful gpio */
+#undef CONFIG_ZYNQ_GPIO
+#undef CONFIG_CMD_GPIO
+
+/* No falcon support */
+#undef CONFIG_SPL_OS_BOOT
+#undef CONFIG_SPL_FPGA_SUPPORT
+
+/* FPGA commands that we don't use */
+#undef CONFIG_CMD_FPGA_LOADMK
+#undef CONFIG_CMD_FPGA_LOADP
+#undef CONFIG_CMD_FPGA_LOADBP
+#undef CONFIG_CMD_FPGA_LOADFS
+
+/* Extras */
+#define CONFIG_CMD_MEMTEST
+#undef CONFIG_SYS_MEMTEST_START
+#define CONFIG_SYS_MEMTEST_START       0
+#undef CONFIG_SYS_MEMTEST_END
+#define CONFIG_SYS_MEMTEST_END 0x18000000
+
+/* Faster flash, ours may run at 108 MHz */
+#undef CONFIG_SF_DEFAULT_SPEED
+#define CONFIG_SF_DEFAULT_SPEED        108000000
+#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
+#undef CONFIG_SF_DUAL_FLASH
+#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
+#undef CONFIG_SPI_FLASH_WINBOND
+#undef CONFIG_SPI_FLASH_ISSI
+
+/* Setup proper boot sequences for Miami boards */
+
+#if defined(CONFIG_USB)
+# define EXTRA_ENV_USB \
+       "usbreset=i2c dev 1 && i2c mw 41 1 ff && i2c mw 41 3 fe && "\
+               "i2c mw 41 1 fe && i2c mw 41 1 ff\0" \
+       "usbboot=run usbreset && if usb start; then " \
+               "echo Booting from USB... && " \
+               "if load usb 0 0x1900000 ${bootscript}; then "\
+               "source 0x1900000; fi; " \
+               "load usb 0 ${kernel_addr} ${kernel_image} && " \
+               "load usb 0 ${devicetree_addr} ${devicetree_image} && " \
+               "load usb 0 ${ramdisk_load_address} ${ramdisk_image} && " \
+               "bootm ${kernel_addr} ${ramdisk_load_address} "\
+                       "${devicetree_addr}; " \
+       "fi\0"
+  /* Note that addresses here should match the addresses in the env */
+# undef DFU_ALT_INFO
+# define DFU_ALT_INFO \
+       "dfu_alt_info=" \
+       "uImage ram 0x2080000 0x500000;" \
+       "devicetree.dtb ram 0x2000000 0x20000;" \
+       "uramdisk.image.gz ram 0x4000000 0x10000000\0" \
+       "dfu_ram=run usbreset && dfu 0 ram 0\0" \
+       "thor_ram=run usbreset && thordown 0 ram 0\0"
+#else
+# define EXTRA_ENV_USB
+#endif
+
+#undef CONFIG_PREBOOT
+
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS      \
+       "kernel_image=uImage\0" \
+       "kernel_addr=0x2080000\0" \
+       "ramdisk_image=uramdisk.image.gz\0"     \
+       "ramdisk_load_address=0x4000000\0"      \
+       "devicetree_image=devicetree.dtb\0"     \
+       "devicetree_addr=0x2000000\0"   \
+       "bitstream_image=fpga.bin\0"    \
+       "bootscript=autorun.scr\0" \
+       "loadbit_addr=0x100000\0"       \
+       "loadbootenv_addr=0x2000000\0" \
+       "kernel_size=0x400000\0"        \
+       "devicetree_size=0x10000\0"     \
+       "boot_size=0xF00000\0"  \
+       "fdt_high=0x20000000\0" \
+       "initrd_high=0x20000000\0"      \
+       "mmc_loadbit=echo Loading bitstream from SD/MMC/eMMC to RAM.. && " \
+               "mmcinfo && " \
+               "load mmc 0 ${loadbit_addr} ${bitstream_image} && " \
+               "fpga load 0 ${loadbit_addr} ${filesize}\0" \
+       "qspiboot=echo Booting from QSPI flash... && " \
+               "sf probe && " \
+               "sf read ${devicetree_addr} 0xA0000 ${devicetree_size} && " \
+               "sf read ${kernel_addr} 0xC0000 ${kernel_size} && " \
+               "bootm ${kernel_addr} - ${devicetree_addr}\0" \
+       "sdboot=if mmcinfo; then " \
+                       "setenv bootargs console=ttyPS0,115200 " \
+                               "root=/dev/mmcblk0p2 rw rootfstype=ext4 " \
+                               "rootwait quiet ; " \
+                       "load mmc 0 ${kernel_addr} ${kernel_image}&& " \
+                       "load mmc 0 ${devicetree_addr} ${devicetree_image}&& " \
+                       "bootm ${kernel_addr} - ${devicetree_addr}; " \
+               "fi\0" \
+       EXTRA_ENV_USB \
+       DFU_ALT_INFO
+
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND     "if mmcinfo; then " \
+       "if fatload mmc 0 0x1900000 ${bootscript}; then source 0x1900000; " \
+       "fi; fi; run $modeboot"
+#undef CONFIG_DISPLAY_BOARDINFO
+
+/* Further tweaks to reduce image size */
+#undef CONFIG_CMD_BOOTZ
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_AES
+
+#endif /* __CONFIG_TOPIC_MIAMI_H */
diff --git a/include/configs/topic_miamiplus.h b/include/configs/topic_miamiplus.h
new file mode 100644 (file)
index 0000000..46ca6bd
--- /dev/null
@@ -0,0 +1,2 @@
+#include "topic_miami.h"
+#define CONFIG_SF_DUAL_FLASH
index 6cd3ca5328c6ec7503acb96ab44d2690978c1ffa..07a92ebcf8cf183e447b5e46c6853a0660b8061a 100644 (file)
@@ -19,7 +19,6 @@
 /* High Level Configuration Options */
 #define CONFIG_SYS_THUMB_BUILD
 #define CONFIG_OMAP                    /* in a TI OMAP core */
-#define CONFIG_OMAP_COMMON
 /* Common ARM Erratas */
 #define CONFIG_ARM_ERRATA_454179
 #define CONFIG_ARM_ERRATA_430973
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
-#define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/omap-common/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT            "arch/arm/mach-omap2/u-boot-spl.lds"
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
 
 #define CONFIG_SPL_TEXT_BASE           0x40200000 /*CONFIG_SYS_SRAM_START*/
 #define CONFIG_SPL_MAX_SIZE            (SRAM_SCRATCH_SPACE_ADDR - \
index 5be46e5c5a2e6063b36a51fc773a6fb271d8fd67..f9c9f821bfaae27069e19f9eb6f20f629085bb4b 100644 (file)
 
 /* subtract sizeof(struct image_header) */
 #define CONFIG_SYS_UBOOT_BASE                  (0x60000 - 0x40)
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x80
 
 #define CONFIG_SPL_TARGET                      "u-boot-with-spl.bin"
 #define CONFIG_SPL_MAX_FOOTPRINT               0x10000
index 5a04b99400adb60b924cceaafcb569566f70a5dd..eb42d8c347f66eeee26402c8377d53eb45e83e0c 100644 (file)
@@ -23,8 +23,6 @@
 #define CONFIG_SPL_FRAMEWORK
 #define        CONFIG_SPL_LDSCRIPT     "arch/arm/cpu/arm1136/u-boot-spl.lds"
 #define CONFIG_SPL_BOARD_INIT
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x100 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS     0x400 /* 512 KB */
 
 #define CONFIG_SPL_TEXT_BASE           0x10002300
 #define CONFIG_SPL_MAX_SIZE            (64 * 1024)     /* 8 KB for stack */
index 8e4b96033b8c9b04b1f614fee1b2b1db31680073..d0ce768e6e14f1e447f2989aa64735fa3e1e2d68 100644 (file)
@@ -14,7 +14,7 @@
 #define __CONFIG_ZYNQMP_EP_H
 
 #define CONFIG_ZYNQ_SDHCI_MAX_FREQ     52000000
-#define CONFIG_ZYNQ_SDHCI_MIN_FREQ     (CONFIG_ZYNQ_SDHCI_MAX_FREQ << 9)
+#define CONFIG_ZYNQ_SDHCI_MIN_FREQ     (CONFIG_ZYNQ_SDHCI_MAX_FREQ >> 9)
 #define CONFIG_ZYNQ_EEPROM
 #define CONFIG_SATA_CEVA
 #define CONFIG_ZYNQMP_XHCI_LIST {ZYNQMP_USB0_XHCI_BASEADDR, \
index ed2c9acdb1d9a0a3141f87f66fb6c5a567f520d1..97dfc0e6ec10c150a52522fe8fea038b1902d562 100644 (file)
@@ -49,7 +49,6 @@
  * Serial Console Configuration
  * STUART - the lower serial port on Colibri board
  */
-#define        CONFIG_PXA_SERIAL
 #define        CONFIG_STUART                   1
 #define CONFIG_CONS_INDEX              2
 #define        CONFIG_BAUDRATE                 115200
index 4f0253cd7d4c2576385f763c4ee4830241745568..8524b280b950049397498cc7d9ea716ea219c47b 100644 (file)
 # define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
 #endif
 
+#ifdef CONFIG_NAND_ZYNQ
+#define CONFIG_CMD_NAND_LOCK_UNLOCK
+#define CONFIG_SYS_MAX_NAND_DEVICE     1
+#define CONFIG_SYS_NAND_ONFI_DETECTION
+#define CONFIG_MTD_DEVICE
+#endif
+
 /* MMC */
 #if defined(CONFIG_ZYNQ_SDHCI)
 # define CONFIG_MMC
 
 /* MMC support */
 #ifdef CONFIG_ZYNQ_SDHCI
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
-#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS      0x200 /* 256 KB */
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME     "u-boot.img"
 #endif
index b1c476628b4f9aa0cb882e435f0535a681a92df3..d0a08d4aaa8f6e35b0891c776eeec161a95d5354 100644 (file)
@@ -16,10 +16,12 @@ struct display_timing;
  * @source_id: ID for the source of the display data, typically a video
  * controller
  * @src_dev:   Source device providing the video
+ * @in_use:    Display is being used
  */
 struct display_plat {
        int source_id;
        struct udevice *src_dev;
+       bool in_use;
 };
 
 /**
@@ -41,6 +43,14 @@ int display_read_timing(struct udevice *dev, struct display_timing *timing);
 int display_enable(struct udevice *dev, int panel_bpp,
                   const struct display_timing *timing);
 
+/**
+ * display_in_use() - Check if a display is in use by any device
+ *
+ * @return true if the device is in use (display_enable() has been called
+ * successfully), else false
+ */
+bool display_in_use(struct udevice *dev);
+
 struct dm_display_ops {
        /**
         * read_timing() - Read information directly
diff --git a/include/dm/platform_data/serial_pxa.h b/include/dm/platform_data/serial_pxa.h
new file mode 100644 (file)
index 0000000..b19a4a6
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2016 Marcel Ziswiler <marcel.ziswiler@toradex.com>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __SERIAL_PXA_H
+#define __SERIAL_PXA_H
+
+/*
+ * The numbering scheme differs here for PXA25x, PXA27x and PXA3xx so we can
+ * easily handle enabling of clock.
+ */
+#ifdef CONFIG_CPU_MONAHANS
+#define UART_CLK_BASE  CKENA_21_BTUART
+#define UART_CLK_REG   CKENA
+#define BTUART_INDEX   0
+#define FFUART_INDEX   1
+#define STUART_INDEX   2
+#elif CONFIG_CPU_PXA25X
+#define UART_CLK_BASE  (1 << 4)        /* HWUART */
+#define UART_CLK_REG   CKEN
+#define HWUART_INDEX   0
+#define STUART_INDEX   1
+#define FFUART_INDEX   2
+#define BTUART_INDEX   3
+#else /* PXA27x */
+#define UART_CLK_BASE  CKEN5_STUART
+#define UART_CLK_REG   CKEN
+#define STUART_INDEX   0
+#define FFUART_INDEX   1
+#define BTUART_INDEX   2
+#endif
+
+/*
+ * Only PXA250 has HWUART, to avoid poluting the code with more macros,
+ * artificially introduce this.
+ */
+#ifndef CONFIG_CPU_PXA25X
+#define HWUART_INDEX   0xff
+#endif
+
+/*
+ * struct pxa_serial_platdata - information about a PXA port
+ *
+ * @base:               Uart port base register address
+ * @port:               Uart port index, for cpu with pinmux for uart / gpio
+ * baudrtatre:          Uart port baudrate
+ */
+struct pxa_serial_platdata {
+       struct pxa_uart_regs *base;
+       int port;
+       int baudrate;
+};
+
+#endif /* __SERIAL_PXA_H */
index d07187c7dd06c000698f9ac40a18e338e81c1c34..3d587807e8c9bf34d7adc645fa16d8bd41e81335 100644 (file)
@@ -30,8 +30,11 @@ struct efi_device_path;
 
 #define EFI_BITS_PER_LONG      BITS_PER_LONG
 
-/* With 64-bit EFI stub, EFI_BITS_PER_LONG has to be 64 */
-#ifdef CONFIG_EFI_STUB_64BIT
+/*
+ * With 64-bit EFI stub, EFI_BITS_PER_LONG has to be 64. EFI_STUB is set
+ * in lib/efi/Makefile, when building the stub.
+ */
+#if defined(CONFIG_EFI_STUB_64BIT) && defined(EFI_STUB)
 #undef EFI_BITS_PER_LONG
 #define EFI_BITS_PER_LONG      64
 #endif
index bdb600e08d7ff9924207940d14d96f8121b9263c..5c3836a51be944d1a9296024d48f8101e992ba3b 100644 (file)
@@ -268,6 +268,19 @@ struct efi_device_path {
        u16 length;
 };
 
+struct efi_mac_addr {
+       u8 addr[32];
+};
+
+#define DEVICE_PATH_TYPE_MESSAGING_DEVICE      0x03
+#  define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR    0x0b
+
+struct efi_device_path_mac_addr {
+       struct efi_device_path dp;
+       struct efi_mac_addr mac;
+       u8 if_type;
+};
+
 #define DEVICE_PATH_TYPE_MEDIA_DEVICE          0x04
 #  define DEVICE_PATH_SUB_TYPE_FILE_PATH       0x04
 
index 35b3fe2d398a6bf91beabea08fa72ad05862f2e4..99619f53a94b99cd099a27f9f4a1545fcd315a0a 100644 (file)
@@ -181,7 +181,7 @@ void efi_get_time_init(void);
 /* Without CONFIG_EFI_LOADER we don't have a runtime section, stub it out */
 #define __efi_runtime_data
 #define __efi_runtime
-static inline void efi_add_runtime_mmio(void **mmio_ptr, u64 len) { }
+static inline void efi_add_runtime_mmio(void *mmio_ptr, u64 len) { }
 
 /* No loader configured, stub out EFI_ENTRY */
 static inline void efi_restore_gd(void) { }
index bcc5eb7b07927c9c84fc8f57da8d74e8c5a2e01b..aaecac799ef296717119e63556289f486b602a53 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef _ELF_H
 #define _ELF_H
 
+#ifndef __ASSEMBLER__
 #include "compiler.h"
 
 /*
@@ -517,6 +518,8 @@ unsigned long elf_hash(const unsigned char *name);
 
 #define ELF_TARG_VER   1       /* The ver for which this code is intended */
 
+#endif /* __ASSEMBLER */
+
 /*
  * XXX - PowerPC defines really don't belong in here,
  * but we'll put them in for simplicity.
@@ -602,6 +605,16 @@ unsigned long elf_hash(const unsigned char *name);
    that may still be in object files.  */
 #define R_PPC_TOC16             255
 
+ /* ARM relocs */
+#define R_ARM_NONE             0       /* No reloc */
+#define R_ARM_RELATIVE         23      /* Adjust by program base */
+
+/* AArch64 relocs */
+#define R_AARCH64_NONE         0       /* No relocation.  */
+#define R_AARCH64_RELATIVE     1027    /* Adjust by program base.  */
+
+#ifndef __ASSEMBLER__
 int valid_elf_image(unsigned long addr);
+#endif
 
 #endif /* _ELF_H */
index 965cd9e9c507affcd5316ca161499493aab386a5..bb556391072516a6fee6ffb662ab552e96ad7c9e 100644 (file)
@@ -135,7 +135,7 @@ int ext4_write_file(const char *filename, void *buf, loff_t offset, loff_t len,
 
 struct ext_filesystem *get_fs(void);
 int ext4fs_open(const char *filename, loff_t *len);
-int ext4fs_read(char *buf, loff_t len, loff_t *actread);
+int ext4fs_read(char *buf, loff_t offset, loff_t len, loff_t *actread);
 int ext4fs_mount(unsigned part_length);
 void ext4fs_close(void);
 void ext4fs_reinit_global(void);
index 2b1296c86c9407d13e2126f99ebfac85b2d1fece..81315959fe2a539a52ed113f6d5eef32d2f815c6 100644 (file)
@@ -1049,7 +1049,9 @@ struct image_sign_info {
        const char *keyname;            /* Name of key to use */
        void *fit;                      /* Pointer to FIT blob */
        int node_offset;                /* Offset of signature node */
-       struct image_sig_algo *algo;    /* Algorithm information */
+       const char *name;               /* Algorithm name */
+       struct checksum_algo *checksum; /* Checksum algorithm information */
+       struct crypto_algo *crypto;     /* Crypto algorithm information */
        const void *fdt_blob;           /* FDT containing public keys */
        int required_keynode;           /* Node offset of key to use: -1=any */
        const char *require_keys;       /* Value for 'required' property */
@@ -1070,18 +1072,19 @@ struct image_region {
 struct checksum_algo {
        const char *name;
        const int checksum_len;
-       const int pad_len;
+       const int der_len;
+       const uint8_t *der_prefix;
 #if IMAGE_ENABLE_SIGN
        const EVP_MD *(*calculate_sign)(void);
 #endif
        int (*calculate)(const char *name,
                         const struct image_region region[],
                         int region_count, uint8_t *checksum);
-       const uint8_t *rsa_padding;
 };
 
-struct image_sig_algo {
+struct crypto_algo {
        const char *name;               /* Name of algorithm */
+       const int key_len;
 
        /**
         * sign() - calculate and return signature for given input data
@@ -1130,18 +1133,23 @@ struct image_sig_algo {
        int (*verify)(struct image_sign_info *info,
                      const struct image_region region[], int region_count,
                      uint8_t *sig, uint sig_len);
-
-       /* pointer to checksum algorithm */
-       struct checksum_algo *checksum;
 };
 
 /**
- * image_get_sig_algo() - Look up a signature algortihm
+ * image_get_checksum_algo() - Look up a checksum algorithm
+ *
+ * @param full_name    Name of algorithm in the form "checksum,crypto"
+ * @return pointer to algorithm information, or NULL if not found
+ */
+struct checksum_algo *image_get_checksum_algo(const char *full_name);
+
+/**
+ * image_get_crypto_algo() - Look up a cryptosystem algorithm
  *
- * @param name         Name of algorithm
+ * @param full_name    Name of algorithm in the form "checksum,crypto"
  * @return pointer to algorithm information, or NULL if not found
  */
-struct image_sig_algo *image_get_sig_algo(const char *name);
+struct crypto_algo *image_get_crypto_algo(const char *full_name);
 
 /**
  * fit_image_verify_required_sigs() - Verify signatures marked as 'required'
index c7fd649f5ea79d7fe9e22443f60b24c73b87828f..533983faffc15deecff35587ae934c9c36a2f6a4 100644 (file)
@@ -15,7 +15,7 @@ struct p_current{
 
 extern struct p_current *current;
 
-#define ndelay(x)      udelay(1)
+#define ndelay(x)      udelay((x) < 1000 ? 1 : (x)/1000)
 
 #define dev_dbg(dev, fmt, args...)             \
        debug(fmt, ##args)
index e4d22d508c82a7bb92ae8ffc640b8103275fb70f..22e5756eddc25865fc594c12c979319b16d68829 100644 (file)
@@ -36,6 +36,11 @@ static inline long IS_ERR(const void *ptr)
        return IS_ERR_VALUE((unsigned long)ptr);
 }
 
+static inline bool IS_ERR_OR_NULL(const void *ptr)
+{
+       return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+}
+
 /**
  * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
  * @ptr: The pointer to cast.
index f47ab6740bdd6951056184b755831efe956d6ea6..1a8e5753d789f1cd786b0ad7e5564334bca460d4 100644 (file)
@@ -260,6 +260,16 @@ int regulator_get_value(struct udevice *dev);
  */
 int regulator_set_value(struct udevice *dev, int uV);
 
+/**
+ * regulator_set_value_force: set the microvoltage value of a given regulator
+ *                           without any min-,max condition check
+ *
+ * @dev    - pointer to the regulator device
+ * @uV     - the output value to set [micro Volts]
+ * @return - 0 on success or -errno val if fails
+ */
+int regulator_set_value_force(struct udevice *dev, int uV);
+
 /**
  * regulator_get_current: get microampere value of a given regulator
  *
index 4c179838eefcaa8f5ee44f542e52a1e219ae504d..deb65efdfb73c23841a6d64de6374a23cf66051d 100644 (file)
 #define SPI_RX_DUAL    BIT(12)                 /* receive with 2 wires */
 #define SPI_RX_QUAD    BIT(13)                 /* receive with 4 wires */
 
-/* SPI bus connection options - see enum spi_dual_flash */
-#define SPI_CONN_DUAL_SHARED           (1 << 0)
-#define SPI_CONN_DUAL_SEPARATED        (1 << 1)
-
 /* Header byte that marks the start of the message */
 #define SPI_PREAMBLE_END_BYTE  0xec
 
@@ -93,7 +89,6 @@ struct dm_spi_slave_platdata {
  * @max_write_size:    If non-zero, the maximum number of bytes which can
  *                     be written at once, excluding command bytes.
  * @memory_map:                Address of read-only SPI flash access.
- * @option:            Varies SPI bus options - separate, shared bus.
  * @flags:             Indication of SPI flags.
  */
 struct spi_slave {
@@ -117,7 +112,6 @@ struct spi_slave {
 #define SPI_XFER_ONCE          (SPI_XFER_BEGIN | SPI_XFER_END)
 #define SPI_XFER_MMAP          BIT(2)  /* Memory Mapped start */
 #define SPI_XFER_MMAP_END      BIT(3)  /* Memory Mapped End */
-#define SPI_XFER_U_PAGE                BIT(4)
 };
 
 /**
index 3c69d85ecbac7956a525b2e188943b46193259a3..c240720249623c39f102261381891c267e62d915 100644 (file)
 #include <u-boot/sha1.h>
 #include <u-boot/sha256.h>
 
-extern const uint8_t padding_sha256_rsa4096[];
-extern const uint8_t padding_sha256_rsa2048[];
-extern const uint8_t padding_sha1_rsa2048[];
-
 /**
  * hash_calculate() - Calculate hash over the data
  *
index b0d9ce9db9d575194a54e09ca3fe0920ac06fd82..2634a29c20d9d8c736f62a8d0725c33d04ae70fa 100644 (file)
@@ -21,6 +21,9 @@ extern "C" {
 
 #define SHA1_SUM_POS   -0x20
 #define SHA1_SUM_LEN   20
+#define SHA1_DER_LEN   15
+
+extern const uint8_t sha1_der_prefix[];
 
 /**
  * \brief         SHA-1 context structure
index beadab35ffc445a6b7d19b41cc9dc85f095facdd..9aa1251789a34f1b824fe0cd9f9c9445f4dde464 100644 (file)
@@ -2,6 +2,9 @@
 #define _SHA256_H
 
 #define SHA256_SUM_LEN 32
+#define SHA256_DER_LEN 19
+
+extern const uint8_t sha256_der_prefix[];
 
 /* Reset watchdog each time we process this many bytes */
 #define CHUNKSZ_SHA256 (64 * 1024)
index 542ace9a03b9b6d9262bc64b0191c758e28cb500..fb5200ec84a615db9d791e59381e8d4f3062b673 100644 (file)
 #define ZYNQMP_FPGA_OP_LOAD                    (1 << 1)
 #define ZYNQMP_FPGA_OP_DONE                    (1 << 2)
 
+#define ZYNQMP_CSU_IDCODE_DEVICE_CODE_SHIFT    15
+#define ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK     (0xf << \
+                                       ZYNQMP_CSU_IDCODE_DEVICE_CODE_SHIFT)
+#define ZYNQMP_CSU_IDCODE_SVD_SHIFT    12
+#define ZYNQMP_CSU_IDCODE_SVD_MASK     (0xe << ZYNQMP_CSU_IDCODE_SVD_SHIFT)
+
 extern struct xilinx_fpga_op zynqmp_op;
 
 #define XILINX_ZYNQMP_DESC \
index 1d37a51a04ef8e3f65f6cbddd166f7b27e227d55..5a34a17daefeb322861af3a16c967bad5fb9bd37 100644 (file)
@@ -19,7 +19,10 @@ extern struct xilinx_fpga_op zynq_op;
 # define FPGA_ZYNQPL_OPS       NULL
 #endif
 
+#define XILINX_ZYNQ_7007S      0x3
 #define XILINX_ZYNQ_7010       0x2
+#define XILINX_ZYNQ_7012S      0x1c
+#define XILINX_ZYNQ_7014S      0x8
 #define XILINX_ZYNQ_7015       0x1b
 #define XILINX_ZYNQ_7020       0x7
 #define XILINX_ZYNQ_7030       0xc
@@ -28,7 +31,10 @@ extern struct xilinx_fpga_op zynq_op;
 #define XILINX_ZYNQ_7100       0x16
 
 /* Device Image Sizes */
+#define XILINX_XC7Z007S_SIZE   16669920/8
 #define XILINX_XC7Z010_SIZE    16669920/8
+#define XILINX_XC7Z012S_SIZE   28085344/8
+#define XILINX_XC7Z014S_SIZE   32364512/8
 #define XILINX_XC7Z015_SIZE    28085344/8
 #define XILINX_XC7Z020_SIZE    32364512/8
 #define XILINX_XC7Z030_SIZE    47839328/8
@@ -37,10 +43,22 @@ extern struct xilinx_fpga_op zynq_op;
 #define XILINX_XC7Z100_SIZE    139330784/8
 
 /* Descriptor Macros */
+#define XILINX_XC7Z007S_DESC(cookie) \
+{ xilinx_zynq, devcfg, XILINX_XC7Z007S_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z007s" }
+
 #define XILINX_XC7Z010_DESC(cookie) \
 { xilinx_zynq, devcfg, XILINX_XC7Z010_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
        "7z010" }
 
+#define XILINX_XC7Z012S_DESC(cookie) \
+{ xilinx_zynq, devcfg, XILINX_XC7Z012S_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z012s" }
+
+#define XILINX_XC7Z014S_DESC(cookie) \
+{ xilinx_zynq, devcfg, XILINX_XC7Z014S_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
+       "7z014s" }
+
 #define XILINX_XC7Z015_DESC(cookie) \
 { xilinx_zynq, devcfg, XILINX_XC7Z015_SIZE, NULL, cookie, FPGA_ZYNQPL_OPS, \
        "7z015" }
index e32dc14f3d61645a22262d5ba38e1d29feaf5968..9449600b5bd7bfaed3f06de886a766a53a31e75b 100644 (file)
@@ -9,9 +9,9 @@ obj-$(CONFIG_EFI_STUB) += efi_info.o
 
 CFLAGS_REMOVE_efi_stub.o := -mregparm=3 \
        $(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
-CFLAGS_efi_stub.o := -fpic -fshort-wchar
+CFLAGS_efi_stub.o := -fpic -fshort-wchar -DEFI_STUB
 CFLAGS_REMOVE_efi.o := -mregparm=3 \
        $(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
-CFLAGS_efi.o := -fpic -fshort-wchar
+CFLAGS_efi.o := -fpic -fshort-wchar -DEFI_STUB
 
 extra-$(CONFIG_EFI_STUB) += efi_stub.o efi.o
index 37a0dd60a5e08747d16316deac34cbc6bca7b033..d2b6327119b401abf342da83c614bb26ea717158 100644 (file)
@@ -1,6 +1,6 @@
 config EFI_LOADER
        bool "Support running EFI Applications in U-Boot"
-       depends on (ARM64 || ARM) && OF_LIBFDT
+       depends on (ARM || X86) && OF_LIBFDT
        default y
        help
          Select this option if you want to run EFI applications (like grub2)
index 12159dd5ce84a03535e789a15a55b6388d404e41..fa8b91a526900eefb4302042f808a8a0f5ffa894 100644 (file)
@@ -7,6 +7,13 @@
 # This file only gets included with CONFIG_EFI_LOADER set, so all
 # object inclusion implicitly depends on it
 
+CFLAGS_helloworld.o := $(CFLAGS_EFI)
+CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI)
+
+efiprogs-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += helloworld.efi
+always := $(efiprogs-y)
+
+obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
 obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o
 obj-y += efi_memory.o
 obj-$(CONFIG_LCD) += efi_gop.o
index 1fdddf4591c000920a4ea09ad3cd05d798a771c6..51080cbeed2f35d03fb1deb983a0d0a26021a92b 100644 (file)
@@ -538,6 +538,8 @@ static efi_status_t EFIAPI efi_exit_boot_services(void *image_handle,
 {
        EFI_ENTRY("%p, %ld", image_handle, map_key);
 
+       board_quiesce_devices();
+
        /* Fix up caches for EFI payloads if necessary */
        efi_exit_caches();
 
index 2e0228c3e036b5a61a47f9173e1fa0b7cc2bd742..8ef7326fef2ec04df0da7866947cb047aca5d298 100644 (file)
@@ -9,11 +9,38 @@
 #include <common.h>
 #include <efi_loader.h>
 
-/* If we can't determine the console size, default to 80x24 */
-static int console_columns = 80;
-static int console_rows = 24;
 static bool console_size_queried;
 
+#define EFI_COUT_MODE_2 2
+#define EFI_MAX_COUT_MODE 3
+
+struct cout_mode {
+       unsigned long columns;
+       unsigned long rows;
+       int present;
+};
+
+static struct cout_mode efi_cout_modes[] = {
+       /* EFI Mode 0 is 80x25 and always present */
+       {
+               .columns = 80,
+               .rows = 25,
+               .present = 1,
+       },
+       /* EFI Mode 1 is always 80x50 */
+       {
+               .columns = 80,
+               .rows = 50,
+               .present = 0,
+       },
+       /* Value are unknown until we query the console */
+       {
+               .columns = 0,
+               .rows = 0,
+               .present = 0,
+       },
+};
+
 const efi_guid_t efi_guid_console_control = CONSOLE_CONTROL_GUID;
 
 #define cESC '\x1b'
@@ -56,8 +83,9 @@ const struct efi_console_control_protocol efi_console_control = {
        .lock_std_in = efi_cin_lock_std_in,
 };
 
+/* Default to mode 0 */
 static struct simple_text_output_mode efi_con_mode = {
-       .max_mode = 0,
+       .max_mode = 1,
        .mode = 0,
        .attribute = 0,
        .cursor_column = 0,
@@ -131,8 +159,10 @@ static efi_status_t EFIAPI efi_cout_output_string(
                        struct efi_simple_text_output_protocol *this,
                        const unsigned short *string)
 {
+       struct cout_mode *mode;
        u16 ch;
 
+       mode = &efi_cout_modes[efi_con_mode.mode];
        EFI_ENTRY("%p, %p", this, string);
        for (;(ch = *string); string++) {
                print_unicode_in_utf8(ch);
@@ -140,13 +170,12 @@ static efi_status_t EFIAPI efi_cout_output_string(
                if (ch == '\n') {
                        efi_con_mode.cursor_column = 1;
                        efi_con_mode.cursor_row++;
-               } else if (efi_con_mode.cursor_column > console_columns) {
+               } else if (efi_con_mode.cursor_column > mode->columns) {
                        efi_con_mode.cursor_column = 1;
                        efi_con_mode.cursor_row++;
                }
-               if (efi_con_mode.cursor_row > console_rows) {
-                       efi_con_mode.cursor_row = console_rows;
-               }
+               if (efi_con_mode.cursor_row > mode->rows)
+                       efi_con_mode.cursor_row = mode->rows;
        }
 
        return EFI_EXIT(EFI_SUCCESS);
@@ -160,6 +189,14 @@ static efi_status_t EFIAPI efi_cout_test_string(
        return EFI_EXIT(EFI_SUCCESS);
 }
 
+static bool cout_mode_matches(struct cout_mode *mode, int rows, int cols)
+{
+       if (!mode->present)
+               return false;
+
+       return (mode->rows == rows) && (mode->columns == cols);
+}
+
 static efi_status_t EFIAPI efi_cout_query_mode(
                        struct efi_simple_text_output_protocol *this,
                        unsigned long mode_number, unsigned long *columns,
@@ -170,6 +207,8 @@ static efi_status_t EFIAPI efi_cout_query_mode(
        if (!console_size_queried) {
                /* Ask the terminal about its size */
                int n[3];
+               int cols;
+               int rows;
                u64 timeout;
 
                console_size_queried = true;
@@ -191,15 +230,40 @@ static efi_status_t EFIAPI efi_cout_query_mode(
                        goto out;
                }
 
-               console_columns = n[2];
-               console_rows = n[1];
+               cols = n[2];
+               rows = n[1];
+
+               /* Test if we can have Mode 1 */
+               if (cols >= 80 && rows >= 50) {
+                       efi_cout_modes[1].present = 1;
+                       efi_con_mode.max_mode = 2;
+               }
+
+               /*
+                * Install our mode as mode 2 if it is different
+                * than mode 0 or 1 and set it  as the currently selected mode
+                */
+               if (!cout_mode_matches(&efi_cout_modes[0], rows, cols) &&
+                   !cout_mode_matches(&efi_cout_modes[1], rows, cols)) {
+                       efi_cout_modes[EFI_COUT_MODE_2].columns = cols;
+                       efi_cout_modes[EFI_COUT_MODE_2].rows = rows;
+                       efi_cout_modes[EFI_COUT_MODE_2].present = 1;
+                       efi_con_mode.max_mode = EFI_MAX_COUT_MODE;
+                       efi_con_mode.mode = EFI_COUT_MODE_2;
+               }
        }
 
+       if (mode_number >= efi_con_mode.max_mode)
+               return EFI_EXIT(EFI_UNSUPPORTED);
+
+       if (efi_cout_modes[mode_number].present != 1)
+               return EFI_EXIT(EFI_UNSUPPORTED);
+
 out:
        if (columns)
-               *columns = console_columns;
+               *columns = efi_cout_modes[mode_number].columns;
        if (rows)
-               *rows = console_rows;
+               *rows = efi_cout_modes[mode_number].rows;
 
        return EFI_EXIT(EFI_SUCCESS);
 }
@@ -210,11 +274,15 @@ static efi_status_t EFIAPI efi_cout_set_mode(
 {
        EFI_ENTRY("%p, %ld", this, mode_number);
 
-       /* We only support text output for now */
-       if (mode_number == EFI_CONSOLE_MODE_TEXT)
-               return EFI_EXIT(EFI_SUCCESS);
 
-       return EFI_EXIT(EFI_UNSUPPORTED);
+       if (mode_number > efi_con_mode.max_mode)
+               return EFI_EXIT(EFI_UNSUPPORTED);
+
+       efi_con_mode.mode = mode_number;
+       efi_con_mode.cursor_column = 0;
+       efi_con_mode.cursor_row = 0;
+
+       return EFI_EXIT(EFI_SUCCESS);
 }
 
 static efi_status_t EFIAPI efi_cout_set_attribute(
index 5165377eee662cd5dbf3101c85b5f4e2829efd76..3262d76bcac036b2a2f04fc93667c2e3f2e7bca5 100644 (file)
@@ -174,7 +174,8 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)
        efi_loader_relocate(rel, rel_size, efi_reloc);
 
        /* Flush cache */
-       flush_cache((ulong)efi_reloc, virt_size);
+       flush_cache((ulong)efi_reloc,
+                   ALIGN(virt_size, CONFIG_SYS_CACHELINE_SIZE));
        invalidate_icache_all();
 
        /* Populate the loaded image interface bits */
index 3796496caa142771168b0066034e8c195b07d205..604ac6e040821b423c7aa1c95e573d25ce01df90 100644 (file)
@@ -27,7 +27,8 @@ struct efi_net_obj {
        struct efi_simple_network net;
        struct efi_simple_network_mode net_mode;
        /* Device path to the network adapter */
-       struct efi_device_path_file_path dp[2];
+       struct efi_device_path_mac_addr dp_mac;
+       struct efi_device_path_file_path dp_end;
        /* PXE struct to transmit dhcp data */
        struct efi_pxe pxe;
        struct efi_pxe_mode pxe_mode;
@@ -205,7 +206,7 @@ static efi_status_t EFIAPI efi_net_open_dp(void *handle, efi_guid_t *protocol,
        struct efi_simple_network *net = handle;
        struct efi_net_obj *netobj = container_of(net, struct efi_net_obj, net);
 
-       *protocol_interface = netobj->dp;
+       *protocol_interface = &netobj->dp_mac;
 
        return EFI_SUCCESS;
 }
@@ -236,11 +237,10 @@ void efi_net_set_dhcp_ack(void *pkt, int len)
 int efi_net_register(void **handle)
 {
        struct efi_net_obj *netobj;
-       struct efi_device_path_file_path dp_net = {
-               .dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE,
-               .dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH,
+       struct efi_device_path_mac_addr dp_net = {
+               .dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE,
+               .dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR,
                .dp.length = sizeof(dp_net),
-               .str = { 'N', 'e', 't' },
        };
        struct efi_device_path_file_path dp_end = {
                .dp.type = DEVICE_PATH_TYPE_END,
@@ -279,8 +279,9 @@ int efi_net_register(void **handle)
        netobj->net.receive = efi_net_receive;
        netobj->net.mode = &netobj->net_mode;
        netobj->net_mode.state = EFI_NETWORK_STARTED;
-       netobj->dp[0] = dp_net;
-       netobj->dp[1] = dp_end;
+       netobj->dp_mac = dp_net;
+       netobj->dp_end = dp_end;
+       memcpy(netobj->dp_mac.mac.addr, eth_get_ethaddr(), 6);
        memcpy(netobj->net_mode.current_address.mac_addr, eth_get_ethaddr(), 6);
        netobj->net_mode.max_packet_size = PKTSIZE;
 
diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c
new file mode 100644 (file)
index 0000000..03e65ab
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * EFI hello world
+ *
+ * Copyright (c) 2016 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <part_efi.h>
+#include <efi_api.h>
+
+efi_status_t EFIAPI efi_main(efi_handle_t handle,
+                            struct efi_system_table *systable)
+{
+       struct efi_simple_text_output_protocol *con_out = systable->con_out;
+       struct efi_boot_services *boottime = systable->boottime;
+
+       con_out->output_string(con_out, L"Hello, world!\n");
+       boottime->exit(handle, 0, 0, NULL);
+
+       return EFI_SUCCESS;
+}
index db183ff2930da51beca8c286e9582d7547dd1c06..2bf28e2dafb45b0646de5855ce5f0ec2f94404ce 100644 (file)
 #include <hash.h>
 #else
 #include "fdt_host.h"
-#include <u-boot/sha1.h>
-#include <u-boot/sha256.h>
 #endif
 #include <u-boot/rsa.h>
 
-/* PKCS 1.5 paddings as described in the RSA PKCS#1 v2.1 standard. */
-
-const uint8_t padding_sha256_rsa2048[RSA2048_BYTES - SHA256_SUM_LEN] = {
-0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x30, 0x31, 0x30,
-0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05,
-0x00, 0x04, 0x20
-};
-
-const uint8_t padding_sha1_rsa2048[RSA2048_BYTES - SHA1_SUM_LEN] = {
-       0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0x00, 0x30, 0x21, 0x30,
-       0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a,
-       0x05, 0x00, 0x04, 0x14
-};
-
-const uint8_t padding_sha256_rsa4096[RSA4096_BYTES - SHA256_SUM_LEN] = {
-       0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-       0xff, 0xff, 0xff, 0xff, 0x00, 0x30, 0x31, 0x30,
-       0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65,
-       0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20
-};
-
 int hash_calculate(const char *name,
                    const struct image_region region[],
                    int region_count, uint8_t *checksum)
index c26f74128f2814e75e9032c89ffe569bb44eef8f..9a09280013084078ae76b17aba088cadf327784c 100644 (file)
@@ -244,7 +244,7 @@ int rsa_sign(struct image_sign_info *info,
        ret = rsa_get_priv_key(info->keydir, info->keyname, &rsa);
        if (ret)
                goto err_priv;
-       ret = rsa_sign_with_key(rsa, info->algo->checksum, region,
+       ret = rsa_sign_with_key(rsa, info->checksum, region,
                                region_count, sigp, sig_len);
        if (ret)
                goto err_sign;
@@ -508,7 +508,7 @@ int rsa_add_verify_data(struct image_sign_info *info, void *keydest)
        }
        if (!ret) {
                ret = fdt_setprop_string(keydest, node, FIT_ALGO_PROP,
-                                        info->algo->name);
+                                        info->name);
        }
        if (!ret && info->require_keys) {
                ret = fdt_setprop_string(keydest, node, "required",
index 442b7695639a20e189088af66a2d7d746c105eab..0d548f8b8f93deaa313a338df0f011b234998929 100644 (file)
 /* Default public exponent for backward compatibility */
 #define RSA_DEFAULT_PUBEXP     65537
 
+/**
+ * rsa_verify_padding() - Verify RSA message padding is valid
+ *
+ * Verify a RSA message's padding is consistent with PKCS1.5
+ * padding as described in the RSA PKCS#1 v2.1 standard.
+ *
+ * @msg:       Padded message
+ * @pad_len:   Number of expected padding bytes
+ * @algo:      Checksum algo structure having information on DER encoding etc.
+ * @return 0 on success, != 0 on failure
+ */
+static int rsa_verify_padding(const uint8_t *msg, const int pad_len,
+                             struct checksum_algo *algo)
+{
+       int ff_len;
+       int ret;
+
+       /* first byte must be 0x00 */
+       ret = *msg++;
+       /* second byte must be 0x01 */
+       ret |= *msg++ ^ 0x01;
+       /* next ff_len bytes must be 0xff */
+       ff_len = pad_len - algo->der_len - 3;
+       ret |= *msg ^ 0xff;
+       ret |= memcmp(msg, msg+1, ff_len-1);
+       msg += ff_len;
+       /* next byte must be 0x00 */
+       ret |= *msg++;
+       /* next der_len bytes must match der_prefix */
+       ret |= memcmp(msg, algo->der_prefix, algo->der_len);
+
+       return ret;
+}
+
 /**
  * rsa_verify_key() - Verify a signature against some data using RSA Key
  *
  * @sig:       Signature
  * @sig_len:   Number of bytes in signature
  * @hash:      Pointer to the expected hash
- * @algo:      Checksum algo structure having information on RSA padding etc.
+ * @key_len:   Number of bytes in rsa key
+ * @algo:      Checksum algo structure having information on DER encoding etc.
  * @return 0 if verified, -ve on error
  */
 static int rsa_verify_key(struct key_prop *prop, const uint8_t *sig,
                          const uint32_t sig_len, const uint8_t *hash,
-                         struct checksum_algo *algo)
+                         const uint32_t key_len, struct checksum_algo *algo)
 {
-       const uint8_t *padding;
        int pad_len;
        int ret;
 #if !defined(USE_HOSTCC)
@@ -83,11 +117,11 @@ static int rsa_verify_key(struct key_prop *prop, const uint8_t *sig,
                return ret;
        }
 
-       padding = algo->rsa_padding;
-       pad_len = algo->pad_len - algo->checksum_len;
+       pad_len = key_len - algo->checksum_len;
 
        /* Check pkcs1.5 padding bytes. */
-       if (memcmp(buf, padding, pad_len)) {
+       ret = rsa_verify_padding(buf, pad_len, algo);
+       if (ret) {
                debug("In RSAVerify(): Padding check failed!\n");
                return -EINVAL;
        }
@@ -149,7 +183,8 @@ static int rsa_verify_with_keynode(struct image_sign_info *info,
                return -EFAULT;
        }
 
-       ret = rsa_verify_key(&prop, sig, sig_len, hash, info->algo->checksum);
+       ret = rsa_verify_key(&prop, sig, sig_len, hash,
+                            info->crypto->key_len, info->checksum);
 
        return ret;
 }
@@ -160,7 +195,7 @@ int rsa_verify(struct image_sign_info *info,
 {
        const void *blob = info->fdt_blob;
        /* Reserve memory for maximum checksum-length */
-       uint8_t hash[info->algo->checksum->pad_len];
+       uint8_t hash[info->crypto->key_len];
        int ndepth, noffset;
        int sig_node, node;
        char name[100];
@@ -170,10 +205,10 @@ int rsa_verify(struct image_sign_info *info,
         * Verify that the checksum-length does not exceed the
         * rsa-signature-length
         */
-       if (info->algo->checksum->checksum_len >
-           info->algo->checksum->pad_len) {
+       if (info->checksum->checksum_len >
+           info->crypto->key_len) {
                debug("%s: invlaid checksum-algorithm %s for %s\n",
-                     __func__, info->algo->checksum->name, info->algo->name);
+                     __func__, info->checksum->name, info->crypto->name);
                return -EINVAL;
        }
 
@@ -184,7 +219,7 @@ int rsa_verify(struct image_sign_info *info,
        }
 
        /* Calculate checksum with checksum-algorithm */
-       ret = info->algo->checksum->calculate(info->algo->checksum->name,
+       ret = info->checksum->calculate(info->checksum->name,
                                        region, region_count, hash);
        if (ret < 0) {
                debug("%s: Error in checksum calculation\n", __func__);
index 72c5dea14f092cdb2ce72e260fe3ac67d30dc2b7..f54bb5be98195ad6493dab14e64fb9b86cde3b96 100644 (file)
 #include <watchdog.h>
 #include <u-boot/sha1.h>
 
+const uint8_t sha1_der_prefix[SHA1_DER_LEN] = {
+       0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e,
+       0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14
+};
+
 /*
  * 32-bit integer manipulation macros (big endian)
  */
index bb338baefa836a6a73d5872c9f7412536b0a25f2..7f5a3618d0da90686fe45eb3df5b671b2a64574d 100644 (file)
 #include <watchdog.h>
 #include <u-boot/sha256.h>
 
+const uint8_t sha256_der_prefix[SHA256_DER_LEN] = {
+       0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86,
+       0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05,
+       0x00, 0x04, 0x20
+};
+
 /*
  * 32-bit integer manipulation macros (big endian)
  */
index 45a0e1d486c0f50d8c8948b99257ca46046d6b53..956a8a9b04471fceabdc8ca659a577da6360af78 100644 (file)
@@ -321,6 +321,39 @@ cmd_S_ttf=                                         \
 $(obj)/%.S: $(src)/%.ttf
        $(call cmd,S_ttf)
 
+# EFI Hello World application
+# ---------------------------------------------------------------------------
+
+# Generate an assembly file to wrap the EFI app
+cmd_S_efi=                                             \
+(                                                      \
+       echo '.section .rodata.efi.init,"a"';           \
+       echo '.balign 16';                              \
+       echo '.global __efi_hello_world_begin';         \
+       echo '__efi_hello_world_begin:';                \
+       echo '.incbin "$<" ';                           \
+       echo '__efi_hello_world_end:';                  \
+       echo '.global __efi_hello_world_end';           \
+       echo '.balign 16';                              \
+) > $@
+
+$(obj)/%_efi.S: $(obj)/%.efi
+       $(call cmd,S_efi)
+
+$(obj)/%.efi: $(obj)/%.so
+       $(OBJCOPY) -j .header -j .text -j .sdata -j .data -j .dynamic \
+               -j .dynsym  -j .rel* -j .rela* -j .reloc \
+               $(if $(EFI_TARGET),$(EFI_TARGET),-O binary) $^ $@
+
+EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS)
+
+$(obj)/helloworld.so: $(EFI_LDS_PATH)
+
+$(obj)/helloworld.so: $(obj)/helloworld.o arch/$(ARCH)/lib/$(EFI_CRT0) \
+               arch/$(ARCH)/lib/$(EFI_RELOC)
+       $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared -Bsymbolic \
+               $^ -o $@
+
 # ACPI
 # ---------------------------------------------------------------------------
 quiet_cmd_acpi_c_asl= ASL     $<
index e0b0117dc9b6c35df0af6b421987c9ba0da04095..f379713ad33dba57e374f2e0d794faaec3a8a4a3 100644 (file)
@@ -66,10 +66,7 @@ endif
 
 libs-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/
 libs-y += drivers/
-libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/dfu/
-libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/gadget/
-libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/gadget/udc/
-libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/dwc3/
+libs-$(CONFIG_SPL_USB_GADGET_SUPPORT) += drivers/usb/dwc3/
 libs-y += dts/
 libs-y += fs/
 libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/
@@ -146,10 +143,10 @@ boot.bin: $(obj)/u-boot-spl.bin FORCE
        $(call if_changed,mkimage)
 else
 ifdef CONFIG_ARCH_ZYNQ
-MKIMAGEFLAGS_boot.bin = -T zynqimage
+MKIMAGEFLAGS_boot.bin = -T zynqimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE)
 endif
 ifdef CONFIG_ARCH_ZYNQMP
-MKIMAGEFLAGS_boot.bin = -T zynqmpimage
+MKIMAGEFLAGS_boot.bin = -T zynqmpimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE)
 endif
 
 spl/boot.bin: $(obj)/u-boot-spl.bin FORCE
index d476367088cc4dbac43b478a36cbb5b4d223d991..d0b5e7f3e4ae428d2d319d72563d5b167fbb5cb2 100644 (file)
@@ -3740,7 +3740,6 @@ CONFIG_PWM_IMX
 CONFIG_PXA_LCD
 CONFIG_PXA_MMC_GENERIC
 CONFIG_PXA_PWR_I2C
-CONFIG_PXA_SERIAL
 CONFIG_PXA_STD_I2C
 CONFIG_PXA_VGA
 CONFIG_PXA_VIDEO
@@ -4329,7 +4328,6 @@ CONFIG_STAMP_CF
 CONFIG_STANDALONE_LOAD_ADDR
 CONFIG_STATIC_BOARD_REV
 CONFIG_STATIC_RELA
-CONFIG_STATUSLED
 CONFIG_STATUS_LED
 CONFIG_STD_DEVICES_SETTINGS
 CONFIG_STK52XX
@@ -6482,7 +6480,6 @@ CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR
 CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS
 CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
-CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
 CONFIG_SYS_MMC_BASE
 CONFIG_SYS_MMC_CD_PIN
 CONFIG_SYS_MMC_CLK_OD
@@ -7831,7 +7828,6 @@ CONFIG_SYS_USE_SERIALFLASH
 CONFIG_SYS_USE_SPIFLASH
 CONFIG_SYS_USE_UBI
 CONFIG_SYS_USR_EXCEP
-CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS
 CONFIG_SYS_U_BOOT_OFFS
 CONFIG_SYS_VA_BITS
 CONFIG_SYS_VCXK_ACKNOWLEDGE_DDR
@@ -7985,11 +7981,6 @@ CONFIG_TRACE_EARLY_ADDR
 CONFIG_TRACE_EARLY_SIZE
 CONFIG_TRAILBLAZER
 CONFIG_TRATS
-CONFIG_TRDX_PID_COLIBRI_VF50
-CONFIG_TRDX_PID_COLIBRI_VF50IT
-CONFIG_TRDX_PID_COLIBRI_VF61
-CONFIG_TRDX_PID_COLIBRI_VF61IT
-CONFIG_TRDX_VID
 CONFIG_TSEC
 CONFIG_TSEC1
 CONFIG_TSEC1_NAME
index 6e71b61ce984f255fc62977b151134bee3f80988..b19486419e9209dce3386ca56fbf7ab540b23bce 100755 (executable)
 # Expected results are as follows:
 # EXT4 tests:
 # fs-test.sb.ext4.out: Summary: PASS: 23 FAIL: 0
-# fs-test.ext4.out: Summary: PASS: 14 FAIL: 9
-# fs-test.fs.ext4.out: Summary: PASS: 14 FAIL: 9
+# fs-test.ext4.out: Summary: PASS: 23 FAIL: 0
+# fs-test.fs.ext4.out: Summary: PASS: 23 FAIL: 0
 # FAT tests:
 # fs-test.sb.fat.out: Summary: PASS: 23 FAIL: 0
 # fs-test.fat.out: Summary: PASS: 20 FAIL: 3
 # fs-test.fs.fat.out: Summary: PASS: 20 FAIL: 3
-# Total Summary: TOTAL PASS: 114 TOTAL FAIL: 24
+# Total Summary: TOTAL PASS: 132 TOTAL FAIL: 6
 
 # pre-requisite binaries list.
 PREREQ_BINS="md5sum mkfs mount umount dd fallocate mkdir"
index 1f15e3e33dcf7e7c0dc6a9ceaaf3dd8d06ae6cd0..65e1d75626cf82105b11130458ac9b264e0ffaa1 100644 (file)
@@ -298,6 +298,32 @@ def pytest_generate_tests(metafunc):
             continue
         generate_config(metafunc, fn)
 
+@pytest.fixture(scope='session')
+def u_boot_log(request):
+     """Generate the value of a test's log fixture.
+
+     Args:
+         request: The pytest request.
+
+     Returns:
+         The fixture value.
+     """
+
+     return console.log
+
+@pytest.fixture(scope='session')
+def u_boot_config(request):
+     """Generate the value of a test's u_boot_config fixture.
+
+     Args:
+         request: The pytest request.
+
+     Returns:
+         The fixture value.
+     """
+
+     return console.config
+
 @pytest.fixture(scope='function')
 def u_boot_console(request):
     """Generate the value of a test's u_boot_console fixture.
diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py
new file mode 100644 (file)
index 0000000..5d7f5db
--- /dev/null
@@ -0,0 +1,195 @@
+# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
+# Copyright (c) 2016, Alexander Graf <agraf@suse.de>
+#
+# based on test_net.py.
+#
+# SPDX-License-Identifier: GPL-2.0
+
+# Test efi loader implementation
+
+import pytest
+import u_boot_utils
+
+"""
+Note: This test relies on boardenv_* containing configuration values to define
+which the network environment available for testing. Without this, the parts
+that rely on network will be automatically skipped.
+
+For example:
+
+# Boolean indicating whether the Ethernet device is attached to USB, and hence
+# USB enumeration needs to be performed prior to network tests.
+# This variable may be omitted if its value is False.
+env__net_uses_usb = False
+
+# Boolean indicating whether the Ethernet device is attached to PCI, and hence
+# PCI enumeration needs to be performed prior to network tests.
+# This variable may be omitted if its value is False.
+env__net_uses_pci = True
+
+# True if a DHCP server is attached to the network, and should be tested.
+# If DHCP testing is not possible or desired, this variable may be omitted or
+# set to False.
+env__net_dhcp_server = True
+
+# A list of environment variables that should be set in order to configure a
+# static IP. If solely relying on DHCP, this variable may be omitted or set to
+# an empty list.
+env__net_static_env_vars = [
+    ("ipaddr", "10.0.0.100"),
+    ("netmask", "255.255.255.0"),
+    ("serverip", "10.0.0.1"),
+]
+
+# Details regarding a file that may be read from a TFTP server. This variable
+# may be omitted or set to None if TFTP testing is not possible or desired.
+env__efi_loader_helloworld_file = {
+    "fn": "lib/efi_loader/helloworld.efi",
+    "size": 5058624,
+    "crc32": "c2244b26",
+}
+"""
+
+net_set_up = False
+
+def test_efi_pre_commands(u_boot_console):
+    """Execute any commands required to enable network hardware.
+
+    These commands are provided by the boardenv_* file; see the comment at the
+    beginning of this file.
+    """
+
+    init_usb = u_boot_console.config.env.get('env__net_uses_usb', False)
+    if init_usb:
+        u_boot_console.run_command('usb start')
+
+    init_pci = u_boot_console.config.env.get('env__net_uses_pci', False)
+    if init_pci:
+        u_boot_console.run_command('pci enum')
+
+@pytest.mark.buildconfigspec('cmd_dhcp')
+def test_efi_dhcp(u_boot_console):
+    """Test the dhcp command.
+
+    The boardenv_* file may be used to enable/disable this test; see the
+    comment at the beginning of this file.
+    """
+
+    test_dhcp = u_boot_console.config.env.get('env__net_dhcp_server', False)
+    if not test_dhcp:
+        pytest.skip('No DHCP server available')
+
+    u_boot_console.run_command('setenv autoload no')
+    output = u_boot_console.run_command('dhcp')
+    assert 'DHCP client bound to address ' in output
+
+    global net_set_up
+    net_set_up = True
+
+@pytest.mark.buildconfigspec('net')
+def test_efi_setup_static(u_boot_console):
+    """Set up a static IP configuration.
+
+    The configuration is provided by the boardenv_* file; see the comment at
+    the beginning of this file.
+    """
+
+    env_vars = u_boot_console.config.env.get('env__net_static_env_vars', None)
+    if not env_vars:
+        pytest.skip('No static network configuration is defined')
+
+    for (var, val) in env_vars:
+        u_boot_console.run_command('setenv %s %s' % (var, val))
+
+    global net_set_up
+    net_set_up = True
+
+def fetch_tftp_file(u_boot_console, env_conf):
+    """Grab an env described file via TFTP and return its address
+
+    A file as described by an env config <env_conf> is downloaded from the TFTP
+    server. The address to that file is returned.
+    """
+    if not net_set_up:
+        pytest.skip('Network not initialized')
+
+    f = u_boot_console.config.env.get(env_conf, None)
+    if not f:
+        pytest.skip('No %s binary specified in environment' % env_conf)
+
+    addr = f.get('addr', None)
+    if not addr:
+        addr = u_boot_utils.find_ram_base(u_boot_console) + (1024 * 1024 * 4)
+
+    fn = f['fn']
+    output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
+    expected_text = 'Bytes transferred = '
+    sz = f.get('size', None)
+    if sz:
+        expected_text += '%d' % sz
+    assert expected_text in output
+
+    expected_crc = f.get('crc32', None)
+    if not expected_crc:
+        return addr
+
+    if u_boot_console.config.buildconfig.get('config_cmd_crc32', 'n') != 'y':
+        return addr
+
+    output = u_boot_console.run_command('crc32 %x $filesize' % addr)
+    assert expected_crc in output
+
+    return addr
+
+@pytest.mark.buildconfigspec('cmd_bootefi_hello_compile')
+def test_efi_helloworld_net(u_boot_console):
+    """Run the helloworld.efi binary via TFTP.
+
+    The helloworld.efi file is downloaded from the TFTP server and gets
+    executed.
+    """
+
+    addr = fetch_tftp_file(u_boot_console, 'env__efi_loader_helloworld_file')
+
+    output = u_boot_console.run_command('bootefi %x' % addr)
+    expected_text = 'Hello, world'
+    assert expected_text in output
+
+@pytest.mark.buildconfigspec('cmd_bootefi_hello')
+def test_efi_helloworld_builtin(u_boot_console):
+    """Run the builtin helloworld.efi binary.
+
+    The helloworld.efi file is included in U-Boot, execute it using the
+    special "bootefi hello" command.
+    """
+
+    output = u_boot_console.run_command('bootefi hello')
+    expected_text = 'Hello, world'
+    assert expected_text in output
+
+@pytest.mark.buildconfigspec('cmd_bootefi')
+def test_efi_grub_net(u_boot_console):
+    """Run the grub.efi binary via TFTP.
+
+    The grub.efi file is downloaded from the TFTP server and gets
+    executed.
+    """
+
+    addr = fetch_tftp_file(u_boot_console, 'env__efi_loader_grub_file')
+
+    u_boot_console.run_command('bootefi %x' % addr, wait_for_prompt=False)
+
+    # Verify that we have an SMBIOS table
+    check_smbios = u_boot_console.config.env.get('env__efi_loader_check_smbios', False)
+    if check_smbios:
+        u_boot_console.wait_for('grub>')
+        output = u_boot_console.run_command('lsefisystab', wait_for_prompt=False, wait_for_echo=False)
+        u_boot_console.wait_for('SMBIOS')
+
+    # Then exit cleanly
+    u_boot_console.wait_for('grub>')
+    output = u_boot_console.run_command('exit', wait_for_prompt=False, wait_for_echo=False)
+    u_boot_console.wait_for('r = 0')
+
+    # And give us our U-Boot prompt back
+    u_boot_console.run_command('')
index 0884051614f05942bac58d72da668b977196f769..293b73a496d35062d0d660c779559f1f6e29a047 100644 (file)
@@ -147,7 +147,7 @@ def test_net_tftpboot(u_boot_console):
 
     addr = f.get('addr', None)
     if not addr:
-        addr = u_boot_utils.find_ram_base(u_boot_console)
+        addr = u_boot_utils.find_ram_base(u_boot_console) + (1024 * 1024 * 4)
 
     fn = f['fn']
     output = u_boot_console.run_command('tftpboot %x %s' % (addr, fn))
@@ -187,7 +187,7 @@ def test_net_nfs(u_boot_console):
 
     addr = f.get('addr', None)
     if not addr:
-        addr = u_boot_utils.find_ram_base(u_boot_console)
+        addr = u_boot_utils.find_ram_base(u_boot_console) + (1024 * 1024 * 4)
 
     fn = f['fn']
     output = u_boot_console.run_command('nfs %x %s' % (addr, fn))
index 9edb504fdd798b6da7fc74b8a3abae43e76e9e71..5b81dde4b069f51b5eff170285faedfbe94bc06d 100644 (file)
@@ -112,7 +112,7 @@ fit_check_sign-objs   := $(dumpimage-mkimage-objs) fit_check_sign.o
 # Build a libfdt Python module if swig is available
 # Use 'sudo apt-get install swig libpython-dev' to enable this
 hostprogs-$(CONFIG_SPL_OF_PLATDATA) += \
-       $(if $(shell which swig),_libfdt.so)
+       $(if $(shell which swig 2> /dev/null),_libfdt.so)
 _libfdt.so-sharedobjs += $(LIBFDT_OBJS)
 libfdt:
 
index 3dc0d5344cc888c33437164d1d32f39ed1906060..862a0b1a02a1b49840a6d0ab2107cb0556fbeeac 100644 (file)
@@ -1291,18 +1291,6 @@ static int check_device_config(int dev)
        struct stat st;
        int fd, rc = 0;
 
-       if (DEVOFFSET(dev) % DEVESIZE(dev) != 0) {
-               fprintf(stderr, "Environment does not start on (erase) block boundary\n");
-               errno = EINVAL;
-               return -1;
-       }
-
-       if (ENVSIZE(dev) > ENVSECTORS(dev) * DEVESIZE(dev)) {
-               fprintf(stderr, "Environment does not fit into available sectors\n");
-               errno = EINVAL;
-               return -1;
-       }
-
        fd = open(DEVNAME(dev), O_RDONLY);
        if (fd < 0) {
                fprintf(stderr,
@@ -1335,9 +1323,15 @@ static int check_device_config(int dev)
                        goto err;
                }
                DEVTYPE(dev) = mtdinfo.type;
+               if (DEVESIZE(dev) == 0)
+                       /* Assume the erase size is the same as the env-size */
+                       DEVESIZE(dev) = ENVSIZE(dev);
        } else {
                uint64_t size;
                DEVTYPE(dev) = MTD_ABSENT;
+               if (DEVESIZE(dev) == 0)
+                       /* Assume the erase size to be 512 bytes */
+                       DEVESIZE(dev) = 0x200;
 
                /*
                 * Check for negative offsets, treat it as backwards offset
@@ -1359,6 +1353,22 @@ static int check_device_config(int dev)
                }
        }
 
+       if (ENVSECTORS(dev) == 0)
+               /* Assume enough sectors to cover the environment */
+               ENVSECTORS(dev) = DIV_ROUND_UP(ENVSIZE(dev), DEVESIZE(dev));
+
+       if (DEVOFFSET(dev) % DEVESIZE(dev) != 0) {
+               fprintf(stderr, "Environment does not start on (erase) block boundary\n");
+               errno = EINVAL;
+               return -1;
+       }
+
+       if (ENVSIZE(dev) > ENVSECTORS(dev) * DEVESIZE(dev)) {
+               fprintf(stderr, "Environment does not fit into available sectors\n");
+               errno = EINVAL;
+               return -1;
+       }
+
 err:
        close(fd);
        return rc;
@@ -1382,10 +1392,10 @@ static int parse_config(struct env_opts *opts)
        DEVNAME (0) = DEVICE1_NAME;
        DEVOFFSET (0) = DEVICE1_OFFSET;
        ENVSIZE (0) = ENV1_SIZE;
-       /* Default values are: erase-size=env-size */
-       DEVESIZE (0) = ENVSIZE (0);
-       /* #sectors=env-size/erase-size (rounded up) */
-       ENVSECTORS (0) = (ENVSIZE(0) + DEVESIZE(0) - 1) / DEVESIZE(0);
+
+       /* Set defaults for DEVESIZE, ENVSECTORS later once we
+        * know DEVTYPE
+        */
 #ifdef DEVICE1_ESIZE
        DEVESIZE (0) = DEVICE1_ESIZE;
 #endif
@@ -1397,10 +1407,10 @@ static int parse_config(struct env_opts *opts)
        DEVNAME (1) = DEVICE2_NAME;
        DEVOFFSET (1) = DEVICE2_OFFSET;
        ENVSIZE (1) = ENV2_SIZE;
-       /* Default values are: erase-size=env-size */
-       DEVESIZE (1) = ENVSIZE (1);
-       /* #sectors=env-size/erase-size (rounded up) */
-       ENVSECTORS (1) = (ENVSIZE(1) + DEVESIZE(1) - 1) / DEVESIZE(1);
+
+       /* Set defaults for DEVESIZE, ENVSECTORS later once we
+        * know DEVTYPE
+        */
 #ifdef DEVICE2_ESIZE
        DEVESIZE (1) = DEVICE2_ESIZE;
 #endif
@@ -1466,13 +1476,9 @@ static int get_config (char *fname)
 
                DEVNAME(i) = devname;
 
-               if (rc < 4)
-                       /* Assume the erase size is the same as the env-size */
-                       DEVESIZE(i) = ENVSIZE(i);
-
-               if (rc < 5)
-                       /* Assume enough env sectors to cover the environment */
-                       ENVSECTORS (i) = (ENVSIZE(i) + DEVESIZE(i) - 1) / DEVESIZE(i);
+               /* Set defaults for DEVESIZE, ENVSECTORS later once we
+                * know DEVTYPE
+                */
 
                i++;
        }
index 11046952fcf0d4b65cdd85bd1362d5bc43c25c23..c1a01225e2bf14547391217b76709bd84c790a88 100644 (file)
@@ -166,9 +166,11 @@ static int fit_image_setup_sig(struct image_sign_info *info,
        info->keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
        info->fit = fit;
        info->node_offset = noffset;
-       info->algo = image_get_sig_algo(algo_name);
+       info->name = algo_name;
+       info->checksum = image_get_checksum_algo(algo_name);
+       info->crypto = image_get_crypto_algo(algo_name);
        info->require_keys = require_keys;
-       if (!info->algo) {
+       if (!info->checksum || !info->crypto) {
                printf("Unsupported signature algorithm (%s) for '%s' signature node in '%s' image node\n",
                       algo_name, node_name, image_name);
                return -1;
@@ -213,7 +215,7 @@ static int fit_image_process_sig(const char *keydir, void *keydest,
        node_name = fit_get_name(fit, noffset, NULL);
        region.data = data;
        region.size = size;
-       ret = info.algo->sign(&info, &region, 1, &value, &value_len);
+       ret = info.crypto->sign(&info, &region, 1, &value, &value_len);
        if (ret) {
                printf("Failed to sign '%s' signature node in '%s' image node: %d\n",
                       node_name, image_name, ret);
@@ -239,7 +241,7 @@ static int fit_image_process_sig(const char *keydir, void *keydest,
        info.keyname = fdt_getprop(fit, noffset, "key-name-hint", NULL);
 
        if (keydest)
-               ret = info.algo->add_verify_data(&info, keydest);
+               ret = info.crypto->add_verify_data(&info, keydest);
        else
                return -1;
 
@@ -588,7 +590,8 @@ static int fit_config_process_sig(const char *keydir, void *keydest,
                                require_keys ? "conf" : NULL))
                return -1;
 
-       ret = info.algo->sign(&info, region, region_count, &value, &value_len);
+       ret = info.crypto->sign(&info, region, region_count, &value,
+                               &value_len);
        free(region);
        if (ret) {
                printf("Failed to sign '%s' signature node in '%s' conf node\n",
@@ -617,7 +620,7 @@ static int fit_config_process_sig(const char *keydir, void *keydest,
 
        /* Write the public key into the supplied FDT file */
        if (keydest) {
-               ret = info.algo->add_verify_data(&info, keydest);
+               ret = info.crypto->add_verify_data(&info, keydest);
                if (ret == -ENOSPC)
                        return -ENOSPC;
                if (ret) {
index c43bd5d48820a1ba9337cc93b85fff08f21d461a..43876e7a302499fed65ac33ef0afdbc09f2376b9 100644 (file)
@@ -222,6 +222,30 @@ static int zynqimage_check_image_types(uint8_t type)
        return EXIT_FAILURE;
 }
 
+static void zynqimage_parse_initparams(struct zynq_header *zynqhdr,
+       const char *filename)
+{
+       /* Expect a table of register-value pairs, e.g. "0x12345678 0x4321" */
+       FILE *fp = fopen(filename, "r");
+       struct zynq_reginit reginit;
+       unsigned int reg_count = 0;
+       int r;
+
+       if (!fp) {
+               fprintf(stderr, "Cannot open initparams file: %s\n", filename);
+               exit(1);
+       }
+       do {
+               r = fscanf(fp, "%x %x", &reginit.address, &reginit.data);
+               if (r == 2) {
+                       zynqhdr->register_init[reg_count] = reginit;
+                       ++reg_count;
+               }
+               r = fscanf(fp, "%*[^\n]\n"); /* Skip to next line */
+       } while ((r != EOF) && (reg_count < HEADER_REGINITS));
+       fclose(fp);
+}
+
 static void zynqimage_set_header(void *ptr, struct stat *sbuf, int ifd,
                struct image_tool_params *params)
 {
@@ -237,6 +261,10 @@ static void zynqimage_set_header(void *ptr, struct stat *sbuf, int ifd,
        if (params->eflag)
                zynqhdr->image_load = cpu_to_le32((uint32_t)params->ep);
 
+       /* User can pass in text file with init list */
+       if (strlen(params->imagename2))
+               zynqimage_parse_initparams(zynqhdr, params->imagename2);
+
        zynqhdr->checksum = zynqimage_checksum(zynqhdr);
 }
 
index 3f28eb401d9b439007b98083843a97cdb0a9345c..202faea07295a39efde8d5e70775aa0656917630 100644 (file)
@@ -234,6 +234,36 @@ static int zynqmpimage_check_image_types(uint8_t type)
        return EXIT_FAILURE;
 }
 
+static void zynqmpimage_parse_initparams(struct zynqmp_header *zynqhdr,
+       const char *filename)
+{
+       FILE *fp;
+       struct zynqmp_reginit reginit;
+       unsigned int reg_count = 0;
+       int r;
+       struct stat path_stat;
+
+       stat(filename, &path_stat);
+       if (!S_ISREG(path_stat.st_mode))
+               return;
+
+       /* Expect a table of register-value pairs, e.g. "0x12345678 0x4321" */
+       fp = fopen(filename, "r");
+       if (!fp) {
+               fprintf(stderr, "Cannot open initparams file: %s\n", filename);
+               exit(1);
+       }
+       do {
+               r = fscanf(fp, "%x %x", &reginit.address, &reginit.data);
+               if (r == 2) {
+                       zynqhdr->register_init[reg_count] = reginit;
+                       ++reg_count;
+               }
+               r = fscanf(fp, "%*[^\n]\n"); /* Skip to next line */
+       } while ((r != EOF) && (reg_count < HEADER_REGINITS));
+       fclose(fp);
+}
+
 static void zynqmpimage_set_header(void *ptr, struct stat *sbuf, int ifd,
                struct image_tool_params *params)
 {
@@ -250,6 +280,10 @@ static void zynqmpimage_set_header(void *ptr, struct stat *sbuf, int ifd,
        if (params->eflag)
                zynqhdr->image_load = cpu_to_le32((uint32_t)params->ep);
 
+       /* User can pass in text file with init list */
+       if (strlen(params->imagename2))
+               zynqmpimage_parse_initparams(zynqhdr, params->imagename2);
+
        zynqhdr->checksum = zynqmpimage_checksum(zynqhdr);
 }