]> git.sur5r.net Git - u-boot/commitdiff
Merge branch 'rmobile' of git://git.denx.de/u-boot-sh
authorTom Rini <trini@konsulko.com>
Wed, 11 Oct 2017 00:14:38 +0000 (20:14 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 11 Oct 2017 00:14:38 +0000 (20:14 -0400)
1768 files changed:
.travis.yml
Kconfig
MAINTAINERS
Makefile
arch/arc/include/asm/io.h
arch/arm/Kconfig
arch/arm/cpu/armv8/fsl-layerscape/soc.c
arch/arm/dts/Makefile
arch/arm/dts/am3517-evm-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/am3517-evm.dts [new file with mode: 0644]
arch/arm/dts/am3517-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/am3517.dtsi [new file with mode: 0644]
arch/arm/dts/am35xx-clocks.dtsi [new file with mode: 0644]
arch/arm/dts/at91-sama5d2_xplained.dts
arch/arm/dts/at91-sama5d4_xplained.dts
arch/arm/dts/at91-sama5d4ek.dts
arch/arm/dts/axp223.dtsi [new file with mode: 0644]
arch/arm/dts/axp22x.dtsi
arch/arm/dts/da850-evm-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/da850-evm.dts [new file with mode: 0644]
arch/arm/dts/da850.dtsi [new file with mode: 0644]
arch/arm/dts/fsl-ls2081a-rdb.dts
arch/arm/dts/omap3.dtsi
arch/arm/dts/omap5-u-boot.dtsi
arch/arm/dts/rk3229-evb.dts
arch/arm/dts/rk3288-popmetal.dtsi
arch/arm/dts/rk3328-evb.dts
arch/arm/dts/rk3368-px5-evb.dts
arch/arm/dts/rk3368-sheep.dts
arch/arm/dts/rk3399-evb.dts
arch/arm/dts/rk3399-puma.dtsi
arch/arm/dts/rv1108-evb.dts
arch/arm/dts/rv1108.dtsi
arch/arm/dts/sama5d2.dtsi
arch/arm/dts/sama5d36ek_cmp.dts
arch/arm/dts/sama5d3_lcd.dtsi
arch/arm/dts/sama5d3xdm.dtsi
arch/arm/dts/sama5d4.dtsi
arch/arm/dts/stm32h743-pinctrl.dtsi
arch/arm/dts/stm32h743.dtsi
arch/arm/dts/stm32h743i-disco.dts
arch/arm/dts/stm32h743i-eval.dts
arch/arm/dts/sun7i-a20-bananapi-m1-plus.dts
arch/arm/dts/sun7i-a20-olinuxino-micro-emmc.dts [new file with mode: 0644]
arch/arm/dts/sun8i-a23-a33.dtsi
arch/arm/dts/sun8i-a23.dtsi
arch/arm/dts/sun8i-a33-sinlinx-sina33.dts
arch/arm/dts/sun8i-a33.dtsi
arch/arm/dts/sun8i-a83t-bananapi-m3.dts [new file with mode: 0644]
arch/arm/dts/sun8i-a83t-sinovoip-bpi-m3.dts [deleted file]
arch/arm/dts/tps6507x.dtsi [new file with mode: 0644]
arch/arm/include/asm/arch-fsl-layerscape/cpu.h
arch/arm/include/asm/arch-rockchip/bootrom.h
arch/arm/include/asm/arch-rockchip/cru_rk3368.h
arch/arm/include/asm/arch-rockchip/cru_rv1108.h
arch/arm/include/asm/arch-rockchip/grf_rk3036.h
arch/arm/include/asm/arch-rockchip/sdram_rk322x.h [new file with mode: 0644]
arch/arm/include/asm/arch-rockchip/sys_proto.h
arch/arm/include/asm/arch-sunxi/spl.h
arch/arm/include/asm/arch-sunxi/usb_phy.h
arch/arm/include/asm/armv7.h
arch/arm/include/asm/io.h
arch/arm/include/asm/macro.h
arch/arm/lib/crt0_64.S
arch/arm/lib/relocate_64.S
arch/arm/mach-at91/Kconfig
arch/arm/mach-imx/spl.c
arch/arm/mach-mvebu/cpu.c
arch/arm/mach-mvebu/dram.c
arch/arm/mach-mvebu/include/mach/config.h
arch/arm/mach-mvebu/include/mach/cpu.h
arch/arm/mach-mvebu/include/mach/soc.h
arch/arm/mach-mvebu/spl.c
arch/arm/mach-omap2/am33xx/board.c
arch/arm/mach-omap2/hwinit-common.c
arch/arm/mach-omap2/omap3/Kconfig
arch/arm/mach-omap2/sec-common.c
arch/arm/mach-omap2/utils.c
arch/arm/mach-qemu/Kconfig [new file with mode: 0644]
arch/arm/mach-rockchip/Makefile
arch/arm/mach-rockchip/rk3188-board-spl.c
arch/arm/mach-rockchip/rk3188-board.c
arch/arm/mach-rockchip/rk3188/Makefile
arch/arm/mach-rockchip/rk3188/sdram_rk3188.c [deleted file]
arch/arm/mach-rockchip/rk322x-board.c
arch/arm/mach-rockchip/rk3288-board-spl.c
arch/arm/mach-rockchip/rk3288-board-tpl.c [new file with mode: 0644]
arch/arm/mach-rockchip/rk3288/Kconfig
arch/arm/mach-rockchip/rk3288/Makefile
arch/arm/mach-rockchip/rk3288/sdram_rk3288.c [deleted file]
arch/arm/mach-rockchip/rk3328/Makefile
arch/arm/mach-rockchip/rk3328/sdram_rk3328.c [deleted file]
arch/arm/mach-rockchip/rk3368-board-spl.c
arch/arm/mach-rockchip/rk3399-board-spl.c
arch/arm/mach-rockchip/rk3399/Makefile
arch/arm/mach-rockchip/rk3399/sdram_rk3399.c [deleted file]
arch/arm/mach-rockchip/spl-boot-order.c
arch/arm/mach-socfpga/misc_gen5.c
arch/arm/mach-socfpga/reset_manager_arria10.c
arch/arm/mach-stm32/stm32f7/timer.c
arch/arm/mach-sunxi/board.c
arch/arm/mach-sunxi/usb_phy.c
arch/arm/mach-tegra/ivc.c
arch/arm/mach-tegra/tegra124/xusb-padctl.c
arch/arm/mach-tegra/tegra186/nvtboot_mem.c
arch/arm/mach-tegra/tegra20/clock.c
arch/arm/mach-tegra/tegra210/xusb-padctl.c
arch/arm/mach-tegra/tegra30/clock.c
arch/arm/mach-tegra/xusb-padctl-common.c
arch/arm/mach-uniphier/dram_init.c
arch/arm/mach-uniphier/init.h
arch/m68k/include/asm/io.h
arch/microblaze/include/asm/io.h
arch/mips/include/asm/io.h
arch/nds32/include/asm/io.h
arch/nios2/include/asm/io.h
arch/powerpc/include/asm/io.h
arch/sandbox/cpu/cpu.c
arch/sandbox/cpu/os.c
arch/sandbox/include/asm/io.h
arch/sh/include/asm/io.h
arch/x86/cpu/tangier/Makefile
arch/x86/cpu/tangier/acpi.c [new file with mode: 0644]
arch/x86/cpu/tangier/sdram.c
arch/x86/include/asm/arch-tangier/acpi/global_nvs.asl [new file with mode: 0644]
arch/x86/include/asm/arch-tangier/acpi/platform.asl [new file with mode: 0644]
arch/x86/include/asm/arch-tangier/acpi/southcluster.asl [new file with mode: 0644]
arch/x86/include/asm/arch-tangier/global_nvs.h [new file with mode: 0644]
arch/x86/include/asm/io.h
arch/xtensa/include/asm/io.h
board/amarula/vyasa-rk3288/vyasa-rk3288.c
board/atmel/at91sam9x5ek/at91sam9x5ek.c
board/atmel/common/video_display.c
board/atmel/sama5d2_xplained/sama5d2_xplained.c
board/atmel/sama5d3xek/sama5d3xek.c
board/atmel/sama5d4_xplained/sama5d4_xplained.c
board/atmel/sama5d4ek/sama5d4ek.c
board/davinci/da8xxevm/Kconfig
board/davinci/da8xxevm/da850evm.c
board/emulation/qemu-arm/MAINTAINERS [new file with mode: 0644]
board/emulation/qemu-arm/Makefile [new file with mode: 0644]
board/emulation/qemu-arm/qemu-arm.c [new file with mode: 0644]
board/freescale/ls2080ardb/ls2080ardb.c
board/intel/edison/.gitignore [new file with mode: 0644]
board/intel/edison/Kconfig
board/intel/edison/Makefile
board/intel/edison/dsdt.asl [new file with mode: 0644]
board/logicpd/am3517evm/am3517evm.c
board/nvidia/jetson-tk1/jetson-tk1.c
board/rockchip/evb_rk3399/evb-rk3399.c
board/samsung/common/exynos5-dt.c
board/samsung/common/gadget.c
board/samsung/common/misc.c
board/samsung/goni/goni.c
board/samsung/odroid/odroid.c
board/siemens/common/factoryset.c
board/solidrun/clearfog/README
board/sunxi/MAINTAINERS
board/sunxi/board.c
board/theadorable/MAINTAINERS
board/theobroma-systems/lion_rk3368/fit_spl_atf.its
board/theobroma-systems/puma_rk3399/puma-rk3399.c
board/ti/ks2_evm/board_k2e.c
board/ti/ks2_evm/board_k2g.c
board/ti/ks2_evm/board_k2hk.c
board/ti/ks2_evm/board_k2l.c
cmd/Kconfig
cmd/Makefile
cmd/bootefi.c
cmd/btrfs.c [new file with mode: 0644]
cmd/fastboot.c
cmd/fastboot/Kconfig
cmd/gpt.c
cmd/nvedit.c
cmd/pxe.c
cmd/regulator.c
cmd/thordown.c
cmd/time.c
cmd/tpm_test.c
cmd/usb_gadget_sdp.c
cmd/usb_mass_storage.c
common/Kconfig
common/Makefile
common/boot_fit.c
common/common_fit.c
common/dfu.c
common/fb_mmc.c
common/fb_nand.c
common/spl/Kconfig
common/spl/spl_dfu.c
common/spl/spl_mmc.c
common/spl/spl_sdp.c
common/update.c
common/usb.c
common/usb_hub.c
common/usb_storage.c
configs/10m50_defconfig
configs/3c120_defconfig
configs/A10-OLinuXino-Lime_defconfig
configs/A10s-OLinuXino-M_defconfig
configs/A13-OLinuXinoM_defconfig
configs/A13-OLinuXino_defconfig
configs/A20-OLinuXino-Lime2-eMMC_defconfig
configs/A20-OLinuXino-Lime2_defconfig
configs/A20-OLinuXino-Lime_defconfig
configs/A20-OLinuXino_MICRO-eMMC_defconfig [new file with mode: 0644]
configs/A20-OLinuXino_MICRO_defconfig
configs/A20-Olimex-SOM-EVB_defconfig
configs/A33-OLinuXino_defconfig
configs/Ainol_AW1_defconfig
configs/Ampe_A76_defconfig
configs/Auxtek-T003_defconfig
configs/Auxtek-T004_defconfig
configs/B4420QDS_NAND_defconfig
configs/B4420QDS_SPIFLASH_defconfig
configs/B4420QDS_defconfig
configs/B4860QDS_NAND_defconfig
configs/B4860QDS_SECURE_BOOT_defconfig
configs/B4860QDS_SPIFLASH_defconfig
configs/B4860QDS_SRIO_PCIE_BOOT_defconfig
configs/B4860QDS_defconfig
configs/BSC9131RDB_NAND_SYSCLK100_defconfig
configs/BSC9131RDB_NAND_defconfig
configs/BSC9131RDB_SPIFLASH_SYSCLK100_defconfig
configs/BSC9131RDB_SPIFLASH_defconfig
configs/BSC9132QDS_NAND_DDRCLK100_SECURE_defconfig
configs/BSC9132QDS_NAND_DDRCLK100_defconfig
configs/BSC9132QDS_NAND_DDRCLK133_SECURE_defconfig
configs/BSC9132QDS_NAND_DDRCLK133_defconfig
configs/BSC9132QDS_NOR_DDRCLK100_SECURE_defconfig
configs/BSC9132QDS_NOR_DDRCLK100_defconfig
configs/BSC9132QDS_NOR_DDRCLK133_SECURE_defconfig
configs/BSC9132QDS_NOR_DDRCLK133_defconfig
configs/BSC9132QDS_SDCARD_DDRCLK100_SECURE_defconfig
configs/BSC9132QDS_SDCARD_DDRCLK100_defconfig
configs/BSC9132QDS_SDCARD_DDRCLK133_SECURE_defconfig
configs/BSC9132QDS_SDCARD_DDRCLK133_defconfig
configs/BSC9132QDS_SPIFLASH_DDRCLK100_SECURE_defconfig
configs/BSC9132QDS_SPIFLASH_DDRCLK100_defconfig
configs/BSC9132QDS_SPIFLASH_DDRCLK133_SECURE_defconfig
configs/BSC9132QDS_SPIFLASH_DDRCLK133_defconfig
configs/Bananapi_M2_Ultra_defconfig
configs/Bananapi_defconfig
configs/Bananapro_defconfig
configs/C29XPCIE_NAND_defconfig
configs/C29XPCIE_NOR_SECBOOT_defconfig
configs/C29XPCIE_SPIFLASH_SECBOOT_defconfig
configs/C29XPCIE_SPIFLASH_defconfig
configs/C29XPCIE_defconfig
configs/CHIP_defconfig
configs/CHIP_pro_defconfig
configs/CSQ_CS908_defconfig
configs/Chuwi_V7_CW0825_defconfig
configs/Colombus_defconfig
configs/Cubieboard2_defconfig
configs/Cubieboard4_defconfig
configs/Cubieboard_defconfig
configs/Cubietruck_defconfig
configs/Cubietruck_plus_defconfig
configs/Cyrus_P5020_defconfig
configs/Cyrus_P5040_defconfig
configs/Empire_electronix_d709_defconfig
configs/Empire_electronix_m712_defconfig
configs/Hummingbird_A31_defconfig
configs/Hyundai_A7HD_defconfig
configs/Itead_Ibox_A20_defconfig
configs/Lamobo_R1_defconfig
configs/LicheePi_Zero_defconfig
configs/Linksprite_pcDuino3_Nano_defconfig
configs/Linksprite_pcDuino3_defconfig
configs/Linksprite_pcDuino_defconfig
configs/M5208EVBE_defconfig
configs/M52277EVB_defconfig
configs/M52277EVB_stmicro_defconfig
configs/M5235EVB_Flash32_defconfig
configs/M5235EVB_defconfig
configs/M5249EVB_defconfig
configs/M5253DEMO_defconfig
configs/M5253EVBE_defconfig
configs/M5272C3_defconfig
configs/M5275EVB_defconfig
configs/M5282EVB_defconfig
configs/M53017EVB_defconfig
configs/M5329AFEE_defconfig
configs/M5329BFEE_defconfig
configs/M5373EVB_defconfig
configs/M54418TWR_defconfig
configs/M54418TWR_nand_mii_defconfig
configs/M54418TWR_nand_rmii_defconfig
configs/M54418TWR_nand_rmii_lowfreq_defconfig
configs/M54418TWR_serial_mii_defconfig
configs/M54418TWR_serial_rmii_defconfig
configs/M54451EVB_defconfig
configs/M54451EVB_stmicro_defconfig
configs/M54455EVB_a66_defconfig
configs/M54455EVB_defconfig
configs/M54455EVB_i66_defconfig
configs/M54455EVB_intel_defconfig
configs/M54455EVB_stm33_defconfig
configs/M5475AFE_defconfig
configs/M5475BFE_defconfig
configs/M5475CFE_defconfig
configs/M5475DFE_defconfig
configs/M5475EFE_defconfig
configs/M5475FFE_defconfig
configs/M5475GFE_defconfig
configs/M5485AFE_defconfig
configs/M5485BFE_defconfig
configs/M5485CFE_defconfig
configs/M5485DFE_defconfig
configs/M5485EFE_defconfig
configs/M5485FFE_defconfig
configs/M5485GFE_defconfig
configs/M5485HFE_defconfig
configs/MCR3000_defconfig
configs/MK808C_defconfig
configs/MPC8308RDB_defconfig
configs/MPC8313ERDB_33_defconfig
configs/MPC8313ERDB_66_defconfig
configs/MPC8313ERDB_NAND_33_defconfig
configs/MPC8313ERDB_NAND_66_defconfig
configs/MPC8315ERDB_defconfig
configs/MPC8323ERDB_defconfig
configs/MPC832XEMDS_ATM_defconfig
configs/MPC832XEMDS_HOST_33_defconfig
configs/MPC832XEMDS_HOST_66_defconfig
configs/MPC832XEMDS_SLAVE_defconfig
configs/MPC832XEMDS_defconfig
configs/MPC8349EMDS_defconfig
configs/MPC8349ITXGP_defconfig
configs/MPC8349ITX_LOWBOOT_defconfig
configs/MPC8349ITX_defconfig
configs/MPC837XEMDS_HOST_defconfig
configs/MPC837XEMDS_defconfig
configs/MPC837XERDB_defconfig
configs/MPC8536DS_36BIT_defconfig
configs/MPC8536DS_SDCARD_defconfig
configs/MPC8536DS_SPIFLASH_defconfig
configs/MPC8536DS_defconfig
configs/MPC8541CDS_defconfig
configs/MPC8541CDS_legacy_defconfig
configs/MPC8544DS_defconfig
configs/MPC8548CDS_36BIT_defconfig
configs/MPC8548CDS_defconfig
configs/MPC8548CDS_legacy_defconfig
configs/MPC8555CDS_defconfig
configs/MPC8555CDS_legacy_defconfig
configs/MPC8568MDS_defconfig
configs/MPC8569MDS_ATM_defconfig
configs/MPC8569MDS_defconfig
configs/MPC8572DS_36BIT_defconfig
configs/MPC8572DS_defconfig
configs/MPC8610HPCD_defconfig
configs/MPC8641HPCN_36BIT_defconfig
configs/MPC8641HPCN_defconfig
configs/MSI_Primo73_defconfig
configs/MSI_Primo81_defconfig
configs/Marsboard_A10_defconfig
configs/Mele_A1000G_quad_defconfig
configs/Mele_A1000_defconfig
configs/Mele_I7_defconfig
configs/Mele_M3_defconfig
configs/Mele_M5_defconfig
configs/Mele_M9_defconfig
configs/Merrii_A80_Optimus_defconfig
configs/MigoR_defconfig
configs/Mini-X_defconfig
configs/Nintendo_NES_Classic_Edition_defconfig
configs/Orangepi_defconfig
configs/Orangepi_mini_defconfig
configs/P1010RDB-PA_36BIT_NAND_SECBOOT_defconfig
configs/P1010RDB-PA_36BIT_NAND_defconfig
configs/P1010RDB-PA_36BIT_NOR_SECBOOT_defconfig
configs/P1010RDB-PA_36BIT_NOR_defconfig
configs/P1010RDB-PA_36BIT_SDCARD_defconfig
configs/P1010RDB-PA_36BIT_SPIFLASH_SECBOOT_defconfig
configs/P1010RDB-PA_36BIT_SPIFLASH_defconfig
configs/P1010RDB-PA_NAND_SECBOOT_defconfig
configs/P1010RDB-PA_NAND_defconfig
configs/P1010RDB-PA_NOR_SECBOOT_defconfig
configs/P1010RDB-PA_NOR_defconfig
configs/P1010RDB-PA_SDCARD_defconfig
configs/P1010RDB-PA_SPIFLASH_SECBOOT_defconfig
configs/P1010RDB-PA_SPIFLASH_defconfig
configs/P1010RDB-PB_36BIT_NAND_SECBOOT_defconfig
configs/P1010RDB-PB_36BIT_NAND_defconfig
configs/P1010RDB-PB_36BIT_NOR_SECBOOT_defconfig
configs/P1010RDB-PB_36BIT_NOR_defconfig
configs/P1010RDB-PB_36BIT_SDCARD_defconfig
configs/P1010RDB-PB_36BIT_SPIFLASH_SECBOOT_defconfig
configs/P1010RDB-PB_36BIT_SPIFLASH_defconfig
configs/P1010RDB-PB_NAND_SECBOOT_defconfig
configs/P1010RDB-PB_NAND_defconfig
configs/P1010RDB-PB_NOR_SECBOOT_defconfig
configs/P1010RDB-PB_NOR_defconfig
configs/P1010RDB-PB_SDCARD_defconfig
configs/P1010RDB-PB_SPIFLASH_SECBOOT_defconfig
configs/P1010RDB-PB_SPIFLASH_defconfig
configs/P1020MBG-PC_36BIT_SDCARD_defconfig
configs/P1020MBG-PC_36BIT_defconfig
configs/P1020MBG-PC_SDCARD_defconfig
configs/P1020MBG-PC_defconfig
configs/P1020RDB-PC_36BIT_NAND_defconfig
configs/P1020RDB-PC_36BIT_SDCARD_defconfig
configs/P1020RDB-PC_36BIT_SPIFLASH_defconfig
configs/P1020RDB-PC_36BIT_defconfig
configs/P1020RDB-PC_NAND_defconfig
configs/P1020RDB-PC_SDCARD_defconfig
configs/P1020RDB-PC_SPIFLASH_defconfig
configs/P1020RDB-PC_defconfig
configs/P1020RDB-PD_NAND_defconfig
configs/P1020RDB-PD_SDCARD_defconfig
configs/P1020RDB-PD_SPIFLASH_defconfig
configs/P1020RDB-PD_defconfig
configs/P1020UTM-PC_36BIT_SDCARD_defconfig
configs/P1020UTM-PC_36BIT_defconfig
configs/P1020UTM-PC_SDCARD_defconfig
configs/P1020UTM-PC_defconfig
configs/P1021RDB-PC_36BIT_NAND_defconfig
configs/P1021RDB-PC_36BIT_SDCARD_defconfig
configs/P1021RDB-PC_36BIT_SPIFLASH_defconfig
configs/P1021RDB-PC_36BIT_defconfig
configs/P1021RDB-PC_NAND_defconfig
configs/P1021RDB-PC_SDCARD_defconfig
configs/P1021RDB-PC_SPIFLASH_defconfig
configs/P1021RDB-PC_defconfig
configs/P1022DS_36BIT_NAND_defconfig
configs/P1022DS_36BIT_SDCARD_defconfig
configs/P1022DS_36BIT_SPIFLASH_defconfig
configs/P1022DS_36BIT_defconfig
configs/P1022DS_NAND_defconfig
configs/P1022DS_SDCARD_defconfig
configs/P1022DS_SPIFLASH_defconfig
configs/P1022DS_defconfig
configs/P1023RDB_defconfig
configs/P1024RDB_36BIT_defconfig
configs/P1024RDB_NAND_defconfig
configs/P1024RDB_SDCARD_defconfig
configs/P1024RDB_SPIFLASH_defconfig
configs/P1024RDB_defconfig
configs/P1025RDB_36BIT_defconfig
configs/P1025RDB_NAND_defconfig
configs/P1025RDB_SDCARD_defconfig
configs/P1025RDB_SPIFLASH_defconfig
configs/P1025RDB_defconfig
configs/P2020RDB-PC_36BIT_NAND_defconfig
configs/P2020RDB-PC_36BIT_SDCARD_defconfig
configs/P2020RDB-PC_36BIT_SPIFLASH_defconfig
configs/P2020RDB-PC_36BIT_defconfig
configs/P2020RDB-PC_NAND_defconfig
configs/P2020RDB-PC_SDCARD_defconfig
configs/P2020RDB-PC_SPIFLASH_defconfig
configs/P2020RDB-PC_defconfig
configs/P2041RDB_NAND_defconfig
configs/P2041RDB_SDCARD_defconfig
configs/P2041RDB_SECURE_BOOT_defconfig
configs/P2041RDB_SPIFLASH_defconfig
configs/P2041RDB_SRIO_PCIE_BOOT_defconfig
configs/P2041RDB_defconfig
configs/P3041DS_NAND_SECURE_BOOT_defconfig
configs/P3041DS_NAND_defconfig
configs/P3041DS_SDCARD_defconfig
configs/P3041DS_SECURE_BOOT_defconfig
configs/P3041DS_SPIFLASH_defconfig
configs/P3041DS_SRIO_PCIE_BOOT_defconfig
configs/P3041DS_defconfig
configs/P4080DS_SDCARD_defconfig
configs/P4080DS_SECURE_BOOT_defconfig
configs/P4080DS_SPIFLASH_defconfig
configs/P4080DS_SRIO_PCIE_BOOT_defconfig
configs/P4080DS_defconfig
configs/P5020DS_NAND_SECURE_BOOT_defconfig
configs/P5020DS_NAND_defconfig
configs/P5020DS_SDCARD_defconfig
configs/P5020DS_SECURE_BOOT_defconfig
configs/P5020DS_SPIFLASH_defconfig
configs/P5020DS_SRIO_PCIE_BOOT_defconfig
configs/P5020DS_defconfig
configs/P5040DS_NAND_SECURE_BOOT_defconfig
configs/P5040DS_NAND_defconfig
configs/P5040DS_SDCARD_defconfig
configs/P5040DS_SECURE_BOOT_defconfig
configs/P5040DS_SPIFLASH_defconfig
configs/P5040DS_defconfig
configs/Sinlinx_SinA31s_defconfig
configs/Sinlinx_SinA33_defconfig
configs/Sinovoip_BPI_M2_Plus_defconfig
configs/Sinovoip_BPI_M2_defconfig
configs/Sinovoip_BPI_M3_defconfig
configs/Sunchip_CX-A99_defconfig
configs/T1023RDB_NAND_defconfig
configs/T1023RDB_SDCARD_defconfig
configs/T1023RDB_SECURE_BOOT_defconfig
configs/T1023RDB_SPIFLASH_defconfig
configs/T1023RDB_defconfig
configs/T1024QDS_DDR4_SECURE_BOOT_defconfig
configs/T1024QDS_DDR4_defconfig
configs/T1024QDS_NAND_defconfig
configs/T1024QDS_SDCARD_defconfig
configs/T1024QDS_SECURE_BOOT_defconfig
configs/T1024QDS_SPIFLASH_defconfig
configs/T1024QDS_defconfig
configs/T1024RDB_NAND_defconfig
configs/T1024RDB_SDCARD_defconfig
configs/T1024RDB_SECURE_BOOT_defconfig
configs/T1024RDB_SPIFLASH_defconfig
configs/T1024RDB_defconfig
configs/T1040D4RDB_NAND_defconfig
configs/T1040D4RDB_SDCARD_defconfig
configs/T1040D4RDB_SECURE_BOOT_defconfig
configs/T1040D4RDB_SPIFLASH_defconfig
configs/T1040D4RDB_defconfig
configs/T1040QDS_DDR4_defconfig
configs/T1040QDS_SECURE_BOOT_defconfig
configs/T1040QDS_defconfig
configs/T1040RDB_NAND_defconfig
configs/T1040RDB_SDCARD_defconfig
configs/T1040RDB_SECURE_BOOT_defconfig
configs/T1040RDB_SPIFLASH_defconfig
configs/T1040RDB_defconfig
configs/T1042D4RDB_NAND_defconfig
configs/T1042D4RDB_SDCARD_defconfig
configs/T1042D4RDB_SECURE_BOOT_defconfig
configs/T1042D4RDB_SPIFLASH_defconfig
configs/T1042D4RDB_defconfig
configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig
configs/T1042RDB_PI_NAND_defconfig
configs/T1042RDB_PI_SDCARD_defconfig
configs/T1042RDB_PI_SPIFLASH_defconfig
configs/T1042RDB_PI_defconfig
configs/T1042RDB_SECURE_BOOT_defconfig
configs/T1042RDB_defconfig
configs/T2080QDS_NAND_defconfig
configs/T2080QDS_SDCARD_defconfig
configs/T2080QDS_SECURE_BOOT_defconfig
configs/T2080QDS_SPIFLASH_defconfig
configs/T2080QDS_SRIO_PCIE_BOOT_defconfig
configs/T2080QDS_defconfig
configs/T2080RDB_NAND_defconfig
configs/T2080RDB_SDCARD_defconfig
configs/T2080RDB_SECURE_BOOT_defconfig
configs/T2080RDB_SPIFLASH_defconfig
configs/T2080RDB_SRIO_PCIE_BOOT_defconfig
configs/T2080RDB_defconfig
configs/T2081QDS_NAND_defconfig
configs/T2081QDS_SDCARD_defconfig
configs/T2081QDS_SPIFLASH_defconfig
configs/T2081QDS_SRIO_PCIE_BOOT_defconfig
configs/T2081QDS_defconfig
configs/T4160QDS_NAND_defconfig
configs/T4160QDS_SDCARD_defconfig
configs/T4160QDS_SECURE_BOOT_defconfig
configs/T4160QDS_defconfig
configs/T4160RDB_defconfig
configs/T4240QDS_NAND_defconfig
configs/T4240QDS_SDCARD_defconfig
configs/T4240QDS_SECURE_BOOT_defconfig
configs/T4240QDS_SRIO_PCIE_BOOT_defconfig
configs/T4240QDS_defconfig
configs/T4240RDB_SDCARD_defconfig
configs/T4240RDB_defconfig
configs/TQM834x_defconfig
configs/TWR-P1025_defconfig
configs/UCP1020_SPIFLASH_defconfig
configs/UCP1020_defconfig
configs/UTOO_P66_defconfig
configs/Wexler_TAB7200_defconfig
configs/Wits_Pro_A20_DKT_defconfig
configs/Wobo_i5_defconfig
configs/Yones_Toptech_BD1078_defconfig
configs/Yones_Toptech_BS1078_V2_defconfig
configs/a64-olinuxino_defconfig
configs/adp-ae3xx_defconfig
configs/adp-ag101p_defconfig
configs/alt_defconfig
configs/am335x_baltos_defconfig
configs/am335x_boneblack_defconfig
configs/am335x_boneblack_vboot_defconfig
configs/am335x_evm_defconfig
configs/am335x_evm_nor_defconfig
configs/am335x_evm_norboot_defconfig
configs/am335x_evm_spiboot_defconfig
configs/am335x_evm_usbspl_defconfig
configs/am335x_hs_evm_defconfig
configs/am335x_hs_evm_uart_defconfig [new file with mode: 0644]
configs/am335x_igep003x_defconfig
configs/am335x_shc_defconfig
configs/am335x_shc_ict_defconfig
configs/am335x_shc_netboot_defconfig
configs/am335x_shc_prompt_defconfig
configs/am335x_shc_sdboot_defconfig
configs/am335x_shc_sdboot_prompt_defconfig
configs/am335x_sl50_defconfig
configs/am3517_crane_defconfig
configs/am3517_evm_defconfig
configs/am43xx_evm_defconfig
configs/am43xx_evm_ethboot_defconfig
configs/am43xx_evm_qspiboot_defconfig
configs/am43xx_evm_usbhost_boot_defconfig
configs/am43xx_hs_evm_defconfig
configs/am57xx_evm_defconfig
configs/am57xx_evm_nodt_defconfig
configs/am57xx_hs_evm_defconfig
configs/amcore_defconfig
configs/ap121_defconfig
configs/ap143_defconfig
configs/ap325rxa_defconfig
configs/ap_sh4a_4a_defconfig
configs/apalis-tk1_defconfig
configs/apalis_imx6_defconfig
configs/apalis_imx6_nospl_com_defconfig
configs/apalis_imx6_nospl_it_defconfig
configs/apalis_t30_defconfig
configs/apf27_defconfig
configs/apx4devkit_defconfig
configs/aristainetos2_defconfig
configs/aristainetos2b_defconfig
configs/aristainetos_defconfig
configs/armadillo-800eva_defconfig
configs/arndale_defconfig
configs/aspenite_defconfig
configs/astro_mcf5373l_defconfig
configs/at91rm9200ek_defconfig
configs/at91rm9200ek_ram_defconfig
configs/at91sam9260ek_dataflash_cs0_defconfig
configs/at91sam9260ek_dataflash_cs1_defconfig
configs/at91sam9260ek_nandflash_defconfig
configs/at91sam9261ek_dataflash_cs0_defconfig
configs/at91sam9261ek_dataflash_cs3_defconfig
configs/at91sam9261ek_nandflash_defconfig
configs/at91sam9263ek_dataflash_cs0_defconfig
configs/at91sam9263ek_dataflash_defconfig
configs/at91sam9263ek_nandflash_defconfig
configs/at91sam9263ek_norflash_boot_defconfig
configs/at91sam9263ek_norflash_defconfig
configs/at91sam9g10ek_dataflash_cs0_defconfig
configs/at91sam9g10ek_dataflash_cs3_defconfig
configs/at91sam9g10ek_nandflash_defconfig
configs/at91sam9g20ek_2mmc_defconfig
configs/at91sam9g20ek_2mmc_nandflash_defconfig
configs/at91sam9g20ek_dataflash_cs0_defconfig
configs/at91sam9g20ek_dataflash_cs1_defconfig
configs/at91sam9g20ek_nandflash_defconfig
configs/at91sam9m10g45ek_mmc_defconfig
configs/at91sam9m10g45ek_nandflash_defconfig
configs/at91sam9n12ek_mmc_defconfig
configs/at91sam9n12ek_nandflash_defconfig
configs/at91sam9n12ek_spiflash_defconfig
configs/at91sam9rlek_dataflash_defconfig
configs/at91sam9rlek_mmc_defconfig
configs/at91sam9rlek_nandflash_defconfig
configs/at91sam9x5ek_dataflash_defconfig
configs/at91sam9x5ek_mmc_defconfig
configs/at91sam9x5ek_nandflash_defconfig
configs/at91sam9x5ek_spiflash_defconfig
configs/at91sam9xeek_dataflash_cs0_defconfig
configs/at91sam9xeek_dataflash_cs1_defconfig
configs/at91sam9xeek_nandflash_defconfig
configs/axm_defconfig
configs/axs101_defconfig
configs/axs103_defconfig
configs/ba10_tv_box_defconfig
configs/bananapi_m1_plus_defconfig [new file with mode: 0644]
configs/bananapi_m64_defconfig
configs/bayleybay_defconfig
configs/bcm11130_defconfig
configs/bcm11130_nand_defconfig
configs/bcm23550_w1d_defconfig
configs/bcm28155_ap_defconfig
configs/bcm28155_w1d_defconfig
configs/bcm911360_entphn-ns_defconfig
configs/bcm911360_entphn_defconfig
configs/bcm911360k_defconfig
configs/bcm958300k-ns_defconfig
configs/bcm958300k_defconfig
configs/bcm958305k_defconfig
configs/bcm958622hr_defconfig
configs/bcm958712k_defconfig
configs/beaver_defconfig
configs/bg0900_defconfig
configs/birdland_bav335a_defconfig
configs/birdland_bav335b_defconfig
configs/bk4r1_defconfig
configs/blanche_defconfig
configs/boston32r2_defconfig
configs/boston32r2el_defconfig
configs/boston64r2_defconfig
configs/boston64r2el_defconfig
configs/brppt1_mmc_defconfig
configs/brppt1_nand_defconfig
configs/brppt1_spi_defconfig
configs/brxre1_defconfig
configs/caddy2_defconfig
configs/cairo_defconfig
configs/calimain_defconfig
configs/cardhu_defconfig
configs/cei-tk1-som_defconfig
configs/cgtqmx6eval_defconfig
configs/cherryhill_defconfig
configs/chiliboard_defconfig
configs/chromebit_mickey_defconfig
configs/chromebook_jerry_defconfig
configs/chromebook_link64_defconfig
configs/chromebook_link_defconfig
configs/chromebook_minnie_defconfig
configs/chromebook_samus_defconfig
configs/chromebox_panther_defconfig
configs/cl-som-am57x_defconfig
configs/clearfog_defconfig
configs/cm_fx6_defconfig
configs/cm_t335_defconfig
configs/cm_t3517_defconfig
configs/cm_t35_defconfig
configs/cm_t43_defconfig
configs/cm_t54_defconfig
configs/cobra5272_defconfig
configs/colibri_imx6_defconfig
configs/colibri_imx6_nospl_defconfig
configs/colibri_imx7_defconfig
configs/colibri_pxa270_defconfig
configs/colibri_t20_defconfig
configs/colibri_t30_defconfig
configs/colibri_vf_defconfig
configs/colorfly_e708_q1_defconfig
configs/comtrend_ar5387un_ram_defconfig
configs/comtrend_ct5361_ram_defconfig
configs/comtrend_vr3032u_ram_defconfig
configs/conga-qeval20-qa3-e3845-internal-uart_defconfig
configs/conga-qeval20-qa3-e3845_defconfig
configs/controlcenterd_36BIT_SDCARD_DEVELOP_defconfig
configs/controlcenterd_36BIT_SDCARD_defconfig
configs/controlcenterd_TRAILBLAZER_DEVELOP_defconfig
configs/controlcenterd_TRAILBLAZER_defconfig
configs/controlcenterdc_defconfig
configs/coreboot-x86_defconfig
configs/corvus_defconfig
configs/cougarcanyon2_defconfig
configs/crownbay_defconfig
configs/d2net_v2_defconfig
configs/da850_am18xxevm_defconfig
configs/da850evm_defconfig
configs/da850evm_direct_nor_defconfig
configs/dalmore_defconfig
configs/db-88f6720_defconfig
configs/db-88f6820-amc_defconfig
configs/db-88f6820-gp_defconfig
configs/db-mv784mp-gp_defconfig
configs/dbau1000_defconfig
configs/dbau1100_defconfig
configs/dbau1500_defconfig
configs/dbau1550_defconfig
configs/dbau1550_el_defconfig
configs/devkit3250_defconfig
configs/devkit8000_defconfig
configs/dfi-bt700-q7x-151_defconfig
configs/difrnce_dit4350_defconfig
configs/dms-ba16-1g_defconfig
configs/dms-ba16_defconfig
configs/dns325_defconfig
configs/dockstar_defconfig
configs/dra7xx_evm_defconfig
configs/dra7xx_hs_evm_defconfig
configs/draco_defconfig
configs/dragonboard410c_defconfig
configs/dreamplug_defconfig
configs/ds109_defconfig
configs/ds414_defconfig
configs/dserve_dsrv9703c_defconfig
configs/duovero_defconfig
configs/e2220-1170_defconfig
configs/ea20_defconfig
configs/eb_cpu5282_defconfig
configs/eb_cpu5282_internal_defconfig
configs/eco5pk_defconfig
configs/ecovec_defconfig
configs/edb9315a_defconfig
configs/edison_defconfig
configs/edminiv2_defconfig
configs/efi-x86_defconfig
configs/espresso7420_defconfig
configs/espt_defconfig
configs/etamin_defconfig
configs/ethernut5_defconfig
configs/evb-ast2500_defconfig
configs/evb-px5_defconfig
configs/evb-rk3036_defconfig
configs/evb-rk3229_defconfig
configs/evb-rk3288_defconfig
configs/evb-rk3328_defconfig
configs/evb-rk3399_defconfig
configs/evb-rv1108_defconfig
configs/fennec-rk3288_defconfig
configs/firefly-rk3288_defconfig
configs/firefly-rk3399_defconfig
configs/flea3_defconfig
configs/ga10h_v1_1_defconfig
configs/galileo_defconfig
configs/ge_b450v3_defconfig
configs/ge_b650v3_defconfig
configs/ge_b850v3_defconfig
configs/geekbox_defconfig
configs/goflexhome_defconfig
configs/gose_defconfig
configs/gplugd_defconfig
configs/gt90h_v4_defconfig
configs/gurnard_defconfig
configs/guruplug_defconfig
configs/gwventana_emmc_defconfig
configs/gwventana_gw5904_defconfig
configs/gwventana_nand_defconfig
configs/h2200_defconfig
configs/h8_homlet_v2_defconfig
configs/harmony_defconfig
configs/highbank_defconfig
configs/hikey_defconfig
configs/hrcon_defconfig
configs/hrcon_dh_defconfig
configs/hsdk_defconfig
configs/huawei_hg556a_ram_defconfig
configs/i12-tvbox_defconfig
configs/iNet_3F_defconfig
configs/iNet_3W_defconfig
configs/iNet_86VS_defconfig
configs/iNet_D978_rev2_defconfig
configs/ib62x0_defconfig
configs/icnova-a20-swac_defconfig
configs/iconnect_defconfig
configs/ids8313_defconfig
configs/igep0032_defconfig
configs/igep00x0_defconfig
configs/imgtec_xilfpga_defconfig
configs/imx31_phycore_defconfig
configs/imx31_phycore_eet_defconfig
configs/imx6q_logic_defconfig
configs/imx6qdl_icore_mmc_defconfig
configs/imx6qdl_icore_nand_defconfig
configs/imx6qdl_icore_rqs_defconfig
configs/imx6ul_geam_mmc_defconfig
configs/imx6ul_geam_nand_defconfig
configs/imx6ul_isiot_emmc_defconfig
configs/imx6ul_isiot_mmc_defconfig
configs/imx6ul_isiot_nand_defconfig
configs/inet1_defconfig
configs/inet86dz_defconfig
configs/inet97fv2_defconfig
configs/inet98v_rev2_defconfig
configs/inet9f_rev03_defconfig
configs/inet_q972_defconfig
configs/inetspace_v2_defconfig
configs/integratorap_cm720t_defconfig
configs/integratorap_cm920t_defconfig
configs/integratorap_cm926ejs_defconfig
configs/integratorap_cm946es_defconfig
configs/integratorcp_cm1136_defconfig
configs/integratorcp_cm920t_defconfig
configs/integratorcp_cm926ejs_defconfig
configs/integratorcp_cm946es_defconfig
configs/ipam390_defconfig
configs/jesurun_q5_defconfig
configs/jetson-tk1_defconfig
configs/k2e_evm_defconfig
configs/k2e_hs_evm_defconfig
configs/k2g_evm_defconfig
configs/k2g_hs_evm_defconfig
configs/k2hk_evm_defconfig
configs/k2hk_hs_evm_defconfig
configs/k2l_evm_defconfig
configs/kc1_defconfig
configs/km_kirkwood_128m16_defconfig
configs/km_kirkwood_defconfig
configs/km_kirkwood_pci_defconfig
configs/kmcoge4_defconfig
configs/kmcoge5ne_defconfig
configs/kmcoge5un_defconfig
configs/kmeter1_defconfig
configs/kmlion1_defconfig
configs/kmnusa_defconfig
configs/kmopti2_defconfig
configs/kmsugp1_defconfig
configs/kmsupx5_defconfig
configs/kmsuv31_defconfig
configs/kmtegr1_defconfig
configs/kmtepr2_defconfig
configs/kmvect1_defconfig
configs/koelsch_defconfig
configs/kylin-rk3036_defconfig
configs/kzm9g_defconfig
configs/lager_defconfig
configs/legoev3_defconfig
configs/lion-rk3368_defconfig
configs/liteboard_defconfig
configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
configs/ls1021aqds_ddr4_nor_defconfig
configs/ls1021aqds_ddr4_nor_lpuart_defconfig
configs/ls1021aqds_nand_defconfig
configs/ls1021aqds_nor_SECURE_BOOT_defconfig
configs/ls1021aqds_nor_defconfig
configs/ls1021aqds_nor_lpuart_defconfig
configs/ls1021aqds_qspi_defconfig
configs/ls1021aqds_sdcard_ifc_defconfig
configs/ls1021aqds_sdcard_qspi_defconfig
configs/ls1021atwr_nor_SECURE_BOOT_defconfig
configs/ls1021atwr_nor_defconfig
configs/ls1021atwr_nor_lpuart_defconfig
configs/ls1021atwr_qspi_defconfig
configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
configs/ls1021atwr_sdcard_ifc_defconfig
configs/ls1021atwr_sdcard_qspi_defconfig
configs/ls1043aqds_defconfig
configs/ls1043aqds_lpuart_defconfig
configs/ls1043aqds_nand_defconfig
configs/ls1043aqds_nor_ddr3_defconfig
configs/ls1043aqds_qspi_defconfig
configs/ls1043aqds_sdcard_ifc_defconfig
configs/ls1043aqds_sdcard_qspi_defconfig
configs/ls1043ardb_SECURE_BOOT_defconfig
configs/ls1043ardb_defconfig
configs/ls1043ardb_nand_SECURE_BOOT_defconfig
configs/ls1043ardb_nand_defconfig
configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
configs/ls1043ardb_sdcard_defconfig
configs/ls1046aqds_SECURE_BOOT_defconfig
configs/ls1046aqds_defconfig
configs/ls1046aqds_lpuart_defconfig
configs/ls1046aqds_nand_defconfig
configs/ls1046aqds_qspi_defconfig
configs/ls1046aqds_sdcard_ifc_defconfig
configs/ls1046aqds_sdcard_qspi_defconfig
configs/ls1046ardb_emmc_defconfig
configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
configs/ls1046ardb_qspi_defconfig
configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
configs/ls1046ardb_sdcard_defconfig
configs/ls2080a_emu_defconfig
configs/ls2080a_simu_defconfig
configs/ls2080aqds_SECURE_BOOT_defconfig
configs/ls2080aqds_defconfig
configs/ls2080ardb_SECURE_BOOT_defconfig
configs/ls2080ardb_defconfig
configs/ls2080ardb_nand_defconfig
configs/ls2081ardb_defconfig
configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
configs/ls2088ardb_qspi_defconfig
configs/lschlv2_defconfig
configs/lsxhl_defconfig
configs/m28evk_defconfig
configs/m53evk_defconfig
configs/ma5d4evk_defconfig
configs/malta64_defconfig
configs/malta64el_defconfig
configs/malta_defconfig
configs/maltael_defconfig
configs/marsboard_defconfig
configs/maxbcm_defconfig
configs/mccmon6_nor_defconfig
configs/mccmon6_sd_defconfig
configs/mcx_defconfig
configs/medcom-wide_defconfig
configs/meesc_dataflash_defconfig
configs/meesc_defconfig
configs/mgcoge3un_defconfig
configs/microblaze-generic_defconfig
configs/minnowmax_defconfig
configs/miqi-rk3288_defconfig
configs/mixtile_loftq_defconfig
configs/mk802_a10s_defconfig
configs/mk802_defconfig
configs/mk802ii_defconfig
configs/mpc8308_p1m_defconfig
configs/mpr2_defconfig
configs/ms7720se_defconfig
configs/ms7722se_defconfig
configs/ms7750se_defconfig
configs/mt_ventoux_defconfig
configs/mvebu_db-88f3720_defconfig
configs/mvebu_db_armada8k_defconfig
configs/mvebu_espressobin-88f3720_defconfig
configs/mvebu_mcbin-88f8040_defconfig
configs/mx23_olinuxino_defconfig
configs/mx23evk_defconfig
configs/mx25pdk_defconfig
configs/mx28evk_auart_console_defconfig
configs/mx28evk_defconfig
configs/mx28evk_nand_defconfig
configs/mx28evk_spi_defconfig
configs/mx31ads_defconfig
configs/mx31pdk_defconfig
configs/mx35pdk_defconfig
configs/mx51evk_defconfig
configs/mx53ard_defconfig
configs/mx53cx9020_defconfig
configs/mx53evk_defconfig
configs/mx53loco_defconfig
configs/mx53smd_defconfig
configs/mx6cuboxi_defconfig
configs/mx6dlarm2_defconfig
configs/mx6dlarm2_lpddr2_defconfig
configs/mx6qarm2_defconfig
configs/mx6qarm2_lpddr2_defconfig
configs/mx6qsabrelite_defconfig
configs/mx6sabreauto_defconfig
configs/mx6sabresd_defconfig
configs/mx6slevk_defconfig
configs/mx6slevk_spinor_defconfig
configs/mx6slevk_spl_defconfig
configs/mx6sllevk_defconfig
configs/mx6sllevk_plugin_defconfig
configs/mx6sxsabreauto_defconfig
configs/mx6sxsabresd_defconfig
configs/mx6sxsabresd_spl_defconfig
configs/mx6ul_14x14_evk_defconfig
configs/mx6ul_9x9_evk_defconfig
configs/mx6ull_14x14_evk_defconfig
configs/mx6ull_14x14_evk_plugin_defconfig
configs/mx7dsabresd_defconfig
configs/mx7dsabresd_secure_defconfig
configs/nanopi_a64_defconfig
configs/nanopi_m1_defconfig
configs/nanopi_m1_plus_defconfig
configs/nanopi_neo2_defconfig
configs/nanopi_neo_air_defconfig
configs/nanopi_neo_defconfig
configs/nas220_defconfig
configs/net2big_v2_defconfig
configs/netgear_cg3100d_ram_defconfig
configs/netspace_lite_v2_defconfig
configs/netspace_max_v2_defconfig
configs/netspace_mini_v2_defconfig
configs/netspace_v2_defconfig
configs/nitrogen6dl2g_defconfig
configs/nitrogen6dl_defconfig
configs/nitrogen6q2g_defconfig
configs/nitrogen6q_defconfig
configs/nitrogen6s1g_defconfig
configs/nitrogen6s_defconfig
configs/nokia_rx51_defconfig
configs/novena_defconfig
configs/nsa310s_defconfig
configs/nsim_700_defconfig
configs/nsim_700be_defconfig
configs/nsim_hs38_defconfig
configs/nsim_hs38be_defconfig
configs/nyan-big_defconfig
configs/odroid-c2_defconfig
configs/odroid-xu3_defconfig
configs/odroid_defconfig
configs/omap3_beagle_defconfig
configs/omap3_evm_defconfig
configs/omap3_ha_defconfig
configs/omap3_logic_defconfig
configs/omap3_overo_defconfig
configs/omap3_pandora_defconfig
configs/omap3_zoom1_defconfig
configs/omap4_panda_defconfig
configs/omap4_sdp4430_defconfig
configs/omap5_uevm_defconfig
configs/omapl138_lcdk_defconfig
configs/openrd_base_defconfig
configs/openrd_client_defconfig
configs/openrd_ultimate_defconfig
configs/opos6uldev_defconfig
configs/orangepi_2_defconfig
configs/orangepi_lite_defconfig
configs/orangepi_one_defconfig
configs/orangepi_pc2_defconfig
configs/orangepi_pc_defconfig
configs/orangepi_pc_plus_defconfig
configs/orangepi_plus2e_defconfig
configs/orangepi_plus_defconfig
configs/orangepi_prime_defconfig
configs/orangepi_win_defconfig
configs/orangepi_zero_defconfig
configs/orangepi_zero_plus2_defconfig
configs/origen_defconfig
configs/ot1200_defconfig
configs/ot1200_spl_defconfig
configs/p2371-0000_defconfig
configs/p2371-2180_defconfig
configs/p2571_defconfig
configs/p2771-0000-000_defconfig
configs/p2771-0000-500_defconfig
configs/parrot_r16_defconfig
configs/paz00_defconfig
configs/pb1000_defconfig
configs/pcm051_rev1_defconfig
configs/pcm051_rev3_defconfig
configs/pcm052_defconfig
configs/pcm058_defconfig
configs/peach-pi_defconfig
configs/peach-pit_defconfig
configs/pengwyn_defconfig
configs/pepper_defconfig
configs/pfla02_defconfig
configs/phycore-rk3288_defconfig
configs/pic32mzdask_defconfig
configs/pico-imx6ul_defconfig
configs/pico-imx7d_defconfig
configs/picosam9g45_defconfig
configs/pine64_plus_defconfig
configs/platinum_picon_defconfig
configs/platinum_titanium_defconfig
configs/plutux_defconfig
configs/pm9261_defconfig
configs/pm9263_defconfig
configs/pm9g45_defconfig
configs/pogo_e02_defconfig
configs/polaroid_mid2407pxe03_defconfig
configs/polaroid_mid2809pxe04_defconfig
configs/poplar_defconfig
configs/popmetal-rk3288_defconfig
configs/porter_defconfig
configs/portl2_defconfig
configs/pov_protab2_ips9_defconfig
configs/puma-rk3399_defconfig
configs/pxm2_defconfig
configs/q8_a13_tablet_defconfig
configs/q8_a23_tablet_800x480_defconfig
configs/q8_a33_tablet_1024x600_defconfig
configs/q8_a33_tablet_800x480_defconfig
configs/qemu-ppce500_defconfig
configs/qemu-x86_64_defconfig
configs/qemu-x86_defconfig
configs/qemu-x86_efi_payload32_defconfig
configs/qemu-x86_efi_payload64_defconfig
configs/qemu_arm_defconfig [new file with mode: 0644]
configs/qemu_mips64_defconfig
configs/qemu_mips64el_defconfig
configs/qemu_mips_defconfig
configs/qemu_mipsel_defconfig
configs/r0p7734_defconfig
configs/r2dplus_defconfig
configs/r7-tv-dongle_defconfig
configs/r7780mp_defconfig
configs/r8a7795_salvator-x_defconfig
configs/r8a7795_ulcb_defconfig
configs/r8a7796_salvator-x_defconfig
configs/r8a7796_ulcb_defconfig
configs/rastaban_defconfig
configs/riotboard_defconfig
configs/rock2_defconfig
configs/rock_defconfig
configs/rpi_2_defconfig
configs/rpi_3_32b_defconfig
configs/rpi_3_defconfig
configs/rpi_defconfig
configs/rsk7203_defconfig
configs/rsk7264_defconfig
configs/rsk7269_defconfig
configs/rut_defconfig
configs/s5p_goni_defconfig
configs/s5pc210_universal_defconfig
configs/sagem_f@st1704_ram_defconfig
configs/sama5d27_som1_ek_mmc_defconfig
configs/sama5d2_ptc_nandflash_defconfig
configs/sama5d2_ptc_spiflash_defconfig
configs/sama5d2_xplained_mmc_defconfig
configs/sama5d2_xplained_spiflash_defconfig
configs/sama5d36ek_cmp_mmc_defconfig
configs/sama5d36ek_cmp_nandflash_defconfig
configs/sama5d36ek_cmp_spiflash_defconfig
configs/sama5d3_xplained_mmc_defconfig
configs/sama5d3_xplained_nandflash_defconfig
configs/sama5d3xek_mmc_defconfig
configs/sama5d3xek_nandflash_defconfig
configs/sama5d3xek_spiflash_defconfig
configs/sama5d4_xplained_mmc_defconfig
configs/sama5d4_xplained_nandflash_defconfig
configs/sama5d4_xplained_spiflash_defconfig
configs/sama5d4ek_mmc_defconfig
configs/sama5d4ek_nandflash_defconfig
configs/sama5d4ek_spiflash_defconfig
configs/sandbox_defconfig
configs/sandbox_flattree_defconfig
configs/sandbox_noblk_defconfig
configs/sandbox_spl_defconfig
configs/sansa_fuze_plus_defconfig
configs/sbc8349_PCI_33_defconfig
configs/sbc8349_PCI_66_defconfig
configs/sbc8349_defconfig
configs/sbc8548_PCI_33_PCIE_defconfig
configs/sbc8548_PCI_33_defconfig
configs/sbc8548_PCI_66_PCIE_defconfig
configs/sbc8548_PCI_66_defconfig
configs/sbc8548_defconfig
configs/sbc8641d_defconfig
configs/sc_sps_1_defconfig
configs/seaboard_defconfig
configs/secomx6quq7_defconfig
configs/sfr_nb4-ser_ram_defconfig
configs/sh7752evb_defconfig
configs/sh7753evb_defconfig
configs/sh7757lcr_defconfig
configs/sh7763rdp_defconfig
configs/sh7785lcr_32bit_defconfig
configs/sh7785lcr_defconfig
configs/sheep-rk3368_defconfig
configs/sheevaplug_defconfig
configs/shmin_defconfig
configs/silk_defconfig
configs/smartweb_defconfig
configs/smdk5250_defconfig
configs/smdk5420_defconfig
configs/smdkc100_defconfig
configs/smdkv310_defconfig
configs/snapper9260_defconfig
configs/snapper9g20_defconfig
configs/sniper_defconfig
configs/snow_defconfig
configs/socfpga_arria10_defconfig
configs/socfpga_arria5_defconfig
configs/socfpga_cyclone5_defconfig
configs/socfpga_de0_nano_soc_defconfig
configs/socfpga_de10_nano_defconfig
configs/socfpga_de1_soc_defconfig
configs/socfpga_is1_defconfig
configs/socfpga_mcvevk_defconfig
configs/socfpga_sockit_defconfig
configs/socfpga_socrates_defconfig
configs/socfpga_sr1500_defconfig
configs/socfpga_vining_fpga_defconfig
configs/socrates_defconfig
configs/som-db5800-som-6867_defconfig
configs/sopine_baseboard_defconfig
configs/spear300_defconfig
configs/spear300_nand_defconfig
configs/spear300_usbtty_defconfig
configs/spear300_usbtty_nand_defconfig
configs/spear310_defconfig
configs/spear310_nand_defconfig
configs/spear310_pnor_defconfig
configs/spear310_usbtty_defconfig
configs/spear310_usbtty_nand_defconfig
configs/spear310_usbtty_pnor_defconfig
configs/spear320_defconfig
configs/spear320_nand_defconfig
configs/spear320_pnor_defconfig
configs/spear320_usbtty_defconfig
configs/spear320_usbtty_nand_defconfig
configs/spear320_usbtty_pnor_defconfig
configs/spear600_defconfig
configs/spear600_nand_defconfig
configs/spear600_usbtty_defconfig
configs/spear600_usbtty_nand_defconfig
configs/spring_defconfig
configs/stih410-b2260_defconfig
configs/stm32f429-discovery_defconfig
configs/stm32f746-disco_defconfig
configs/stm32h743-disco_defconfig
configs/stm32h743-eval_defconfig
configs/stmark2_defconfig
configs/stout_defconfig
configs/strider_con_defconfig
configs/strider_con_dp_defconfig
configs/strider_cpu_defconfig
configs/strider_cpu_dp_defconfig
configs/stv0991_defconfig
configs/sun8i_a23_evb_defconfig
configs/sunxi_Gemei_G9_defconfig
configs/suvd3_defconfig
configs/tao3530_defconfig
configs/taurus_defconfig
configs/tb100_defconfig
configs/tbs2910_defconfig
configs/tec-ng_defconfig
configs/tec_defconfig
configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig
configs/theadorable-x86-conga-qa3-e3845_defconfig
configs/theadorable-x86-dfi-bt700_defconfig
configs/theadorable_debug_defconfig
configs/theadorable_defconfig [deleted file]
configs/thuban_defconfig
configs/thunderx_88xx_defconfig
configs/ti814x_evm_defconfig
configs/ti816x_evm_defconfig
configs/tinker-rk3288_defconfig
configs/titanium_defconfig
configs/topic_miami_defconfig
configs/topic_miamilite_defconfig
configs/topic_miamiplus_defconfig
configs/tplink_wdr4300_defconfig
configs/tqma6dl_mba6_mmc_defconfig
configs/tqma6dl_mba6_spi_defconfig
configs/tqma6q_mba6_mmc_defconfig
configs/tqma6q_mba6_spi_defconfig
configs/tqma6s_mba6_mmc_defconfig
configs/tqma6s_mba6_spi_defconfig
configs/tqma6s_wru4_mmc_defconfig
configs/trats2_defconfig
configs/trats_defconfig
configs/tricorder_defconfig
configs/tricorder_flash_defconfig
configs/trimslice_defconfig
configs/ts4600_defconfig
configs/ts4800_defconfig
configs/tuge1_defconfig
configs/turris_omnia_defconfig
configs/tuxx1_defconfig
configs/twister_defconfig
configs/udoo_defconfig
configs/udoo_neo_defconfig
configs/uniphier_ld4_sld8_defconfig
configs/uniphier_v7_defconfig
configs/uniphier_v8_defconfig
configs/usb_a9263_dataflash_defconfig
configs/usbarmory_defconfig
configs/vct_platinum_defconfig
configs/vct_platinum_onenand_defconfig
configs/vct_platinum_onenand_small_defconfig
configs/vct_platinum_small_defconfig
configs/vct_platinumavc_defconfig
configs/vct_platinumavc_onenand_defconfig
configs/vct_platinumavc_onenand_small_defconfig
configs/vct_platinumavc_small_defconfig
configs/vct_premium_defconfig
configs/vct_premium_onenand_defconfig
configs/vct_premium_onenand_small_defconfig
configs/vct_premium_small_defconfig
configs/ve8313_defconfig
configs/venice2_defconfig
configs/ventana_defconfig
configs/vexpress_aemv8a_dram_defconfig
configs/vexpress_aemv8a_juno_defconfig
configs/vexpress_aemv8a_semi_defconfig
configs/vexpress_ca15_tc2_defconfig
configs/vexpress_ca5x2_defconfig
configs/vexpress_ca9x4_defconfig
configs/vf610twr_defconfig
configs/vf610twr_nand_defconfig
configs/vinco_defconfig
configs/vining_2000_defconfig
configs/vme8349_defconfig
configs/vyasa-rk3288_defconfig
configs/wandboard_defconfig
configs/warp7_defconfig
configs/warp7_secure_defconfig
configs/warp_defconfig
configs/woodburn_defconfig
configs/woodburn_sd_defconfig
configs/work_92105_defconfig
configs/x600_defconfig
configs/xfi3_defconfig
configs/xilinx_zynqmp_ep_defconfig
configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig
configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig
configs/xilinx_zynqmp_zc1751_xm019_dc5_defconfig
configs/xilinx_zynqmp_zcu102_revA_defconfig
configs/xilinx_zynqmp_zcu102_revB_defconfig
configs/xpedite517x_defconfig
configs/xpedite520x_defconfig
configs/xpedite537x_defconfig
configs/xpedite550x_defconfig
configs/xpress_defconfig
configs/xpress_spl_defconfig
configs/xtfpga_defconfig
configs/zipitz2_defconfig
configs/zmx25_defconfig
configs/zynq_microzed_defconfig
configs/zynq_picozed_defconfig
configs/zynq_z_turn_defconfig
configs/zynq_zc702_defconfig
configs/zynq_zc706_defconfig
configs/zynq_zc770_xm010_defconfig
configs/zynq_zc770_xm011_defconfig
configs/zynq_zc770_xm012_defconfig
configs/zynq_zc770_xm013_defconfig
configs/zynq_zed_defconfig
configs/zynq_zybo_defconfig
disk/part.c
disk/part_dos.c
disk/part_efi.c
doc/README.android-fastboot
doc/README.multi-dtb-fit [new file with mode: 0644]
doc/README.rockchip
doc/device-tree-bindings/chosen.txt
doc/device-tree-bindings/regulator/regulator.txt
drivers/adc/Kconfig
drivers/adc/Makefile
drivers/adc/adc-uclass.c
drivers/adc/exynos-adc.c
drivers/adc/rockchip-saradc.c [new file with mode: 0644]
drivers/adc/sandbox.c
drivers/ata/dwc_ahci.c
drivers/bios_emulator/include/x86emu/x86emui.h
drivers/clk/clk_boston.c
drivers/clk/clk_stm32f7.c
drivers/clk/clk_stm32h7.c
drivers/clk/rockchip/clk_rk322x.c
drivers/clk/rockchip/clk_rk3288.c
drivers/clk/rockchip/clk_rk3328.c
drivers/clk/rockchip/clk_rk3368.c
drivers/clk/rockchip/clk_rk3399.c
drivers/clk/rockchip/clk_rv1108.c
drivers/core/Kconfig
drivers/core/Makefile
drivers/core/device.c
drivers/core/lists.c
drivers/core/ofnode.c
drivers/core/read.c
drivers/core/root.c
drivers/core/util.c
drivers/dfu/dfu.c
drivers/dfu/dfu_mmc.c
drivers/dfu/dfu_ram.c
drivers/dfu/dfu_tftp.c
drivers/dma/dma-uclass.c
drivers/dma/lpc32xx_dma.c
drivers/dma/ti-edma3.c
drivers/gpio/adi_gpio2.c
drivers/gpio/atmel_pio4.c
drivers/gpio/imx_rgpio2p.c
drivers/gpio/mxc_gpio.c
drivers/gpio/omap_gpio.c
drivers/gpio/pca953x_gpio.c
drivers/gpio/tegra186_gpio.c
drivers/gpio/vybrid_gpio.c
drivers/i2c/i2c-gpio.c
drivers/i2c/imx_lpi2c.c
drivers/i2c/mxc_i2c.c
drivers/i2c/omap24xx_i2c.c
drivers/i2c/rk_i2c.c
drivers/i2c/stm32f7_i2c.c
drivers/i2c/tegra186_bpmp_i2c.c
drivers/i2c/tegra_i2c.c
drivers/misc/tegra186_bpmp.c
drivers/mmc/Kconfig
drivers/mmc/Makefile
drivers/mmc/exynos_dw_mmc.c
drivers/mmc/hi6220_dw_mmc.c
drivers/mmc/sdhci-cadence.c
drivers/mmc/sti_sdhci.c
drivers/mmc/stm32_sdmmc2.c [new file with mode: 0644]
drivers/mmc/uniphier-sd.c
drivers/mmc/xenon_sdhci.c
drivers/mtd/cfi_flash.c
drivers/mtd/nand/lpc32xx_nand_mlc.c
drivers/mtd/nand/pxa3xx_nand.c
drivers/mtd/spi/spi_flash_ids.c
drivers/net/Kconfig
drivers/net/bcm-sf2-eth-gmac.c
drivers/net/bcm-sf2-eth.c
drivers/net/cpsw-common.c
drivers/net/cpsw.c
drivers/net/dwc_eth_qos.c
drivers/net/ep93xx_eth.c
drivers/net/keystone_net.c
drivers/pci/Kconfig
drivers/pci/Makefile
drivers/pci/pci-uclass.c
drivers/pci/pci_tegra.c
drivers/pci/pcie_ecam_generic.c [new file with mode: 0644]
drivers/pci/pcie_layerscape.c
drivers/pci/pcie_layerscape_fixup.c
drivers/pci/pcie_xilinx.c
drivers/phy/marvell/comphy_cp110.c
drivers/phy/sti_usb_phy.c
drivers/phy/ti-pipe3-phy.c
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
drivers/pinctrl/pinctrl-sti.c
drivers/pinctrl/pinctrl_stm32.c
drivers/pinctrl/rockchip/pinctrl_rk3368.c
drivers/power/pmic/as3722.c
drivers/power/pmic/as3722_gpio.c
drivers/power/pmic/i2c_pmic_emul.c
drivers/power/pmic/lp873x.c
drivers/power/pmic/lp87565.c
drivers/power/pmic/max77686.c
drivers/power/pmic/max8997.c
drivers/power/pmic/max8998.c
drivers/power/pmic/palmas.c
drivers/power/pmic/pfuze100.c
drivers/power/pmic/s2mps11.c
drivers/power/pmic/s5m8767.c
drivers/power/pmic/sandbox.c
drivers/power/pmic/tps65090.c
drivers/power/regulator/Kconfig
drivers/power/regulator/Makefile
drivers/power/regulator/fixed.c
drivers/power/regulator/gpio-regulator.c
drivers/power/regulator/max77686.c
drivers/power/regulator/pbias_regulator.c [new file with mode: 0644]
drivers/power/regulator/sandbox.c
drivers/ram/rockchip/Makefile
drivers/ram/rockchip/dmc-rk3368.c
drivers/ram/rockchip/sdram_rk3188.c [new file with mode: 0644]
drivers/ram/rockchip/sdram_rk322x.c [new file with mode: 0644]
drivers/ram/rockchip/sdram_rk3288.c [new file with mode: 0644]
drivers/ram/rockchip/sdram_rk3328.c [new file with mode: 0644]
drivers/ram/rockchip/sdram_rk3399.c [new file with mode: 0644]
drivers/ram/stm32_sdram.c
drivers/reset/sti-reset.c
drivers/serial/Kconfig
drivers/serial/serial_stm32x7.c
drivers/serial/serial_stm32x7.h
drivers/spi/atmel_spi.c
drivers/spi/davinci_spi.c
drivers/spi/fsl_qspi.c
drivers/spi/fsl_qspi.h
drivers/spi/lpc32xx_ssp.c
drivers/spi/mxc_spi.c
drivers/sysreset/sysreset_sti.c
drivers/sysreset/sysreset_syscon.c
drivers/sysreset/sysreset_watchdog.c
drivers/tpm/tpm_tis_infineon.c
drivers/usb/Kconfig
drivers/usb/common/common.c
drivers/usb/dwc3/Kconfig
drivers/usb/dwc3/Makefile
drivers/usb/dwc3/dwc3-uniphier.c [new file with mode: 0644]
drivers/usb/dwc3/linux-compat.h
drivers/usb/emul/sandbox_flash.c
drivers/usb/emul/sandbox_hub.c
drivers/usb/emul/sandbox_keyb.c
drivers/usb/emul/usb-emul-uclass.c
drivers/usb/eth/mcs7830.c
drivers/usb/gadget/Kconfig
drivers/usb/gadget/at91_udc.c
drivers/usb/gadget/atmel_usba_udc.c
drivers/usb/gadget/dwc2_udc_otg.c
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
drivers/usb/gadget/ether.c
drivers/usb/gadget/f_fastboot.c
drivers/usb/gadget/f_sdp.c
drivers/usb/gadget/f_thor.c
drivers/usb/gadget/g_dnl.c
drivers/usb/host/dwc2.c
drivers/usb/host/dwc3-sti-glue.c
drivers/usb/host/ehci-generic.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ohci-generic.c
drivers/usb/host/usb-sandbox.c
drivers/usb/host/usb-uclass.c
drivers/usb/host/xhci-dwc3.c
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci-rockchip.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h
drivers/usb/musb-new/linux-compat.h
drivers/usb/musb-new/sunxi.c
drivers/usb/musb-new/ti-musb.c
drivers/video/Kconfig
drivers/video/am335x-fb.c
drivers/video/vidconsole-uclass.c
drivers/video/video-uclass.c
dts/Kconfig
env/common.c
env/sf.c
fs/Kconfig
fs/Makefile
fs/btrfs/Kconfig [new file with mode: 0644]
fs/btrfs/Makefile [new file with mode: 0644]
fs/btrfs/btrfs.c [new file with mode: 0644]
fs/btrfs/btrfs.h [new file with mode: 0644]
fs/btrfs/btrfs_tree.h [new file with mode: 0644]
fs/btrfs/chunk-map.c [new file with mode: 0644]
fs/btrfs/compression.c [new file with mode: 0644]
fs/btrfs/conv-funcs.h [new file with mode: 0644]
fs/btrfs/ctree.c [new file with mode: 0644]
fs/btrfs/ctree.h [new file with mode: 0644]
fs/btrfs/dev.c [new file with mode: 0644]
fs/btrfs/dir-item.c [new file with mode: 0644]
fs/btrfs/extent-io.c [new file with mode: 0644]
fs/btrfs/hash.c [new file with mode: 0644]
fs/btrfs/inode.c [new file with mode: 0644]
fs/btrfs/root.c [new file with mode: 0644]
fs/btrfs/subvolume.c [new file with mode: 0644]
fs/btrfs/super.c [new file with mode: 0644]
fs/ext4/dev.c
fs/ext4/ext4_common.c
fs/ext4/ext4fs.c
fs/fat/fat.c
fs/fs.c
fs/fs_internal.c [new file with mode: 0644]
fs/jffs2/jffs2_nand_1pass.c
fs/reiserfs/dev.c
fs/yaffs2/yaffs_uboot_glue.c
fs/zfs/dev.c
include/asm-generic/io.h [new file with mode: 0644]
include/asm-generic/sections.h
include/blk.h
include/boot_fit.h
include/btrfs.h [new file with mode: 0644]
include/common.h
include/config_distro_bootcmd.h
include/configs/am335x_evm.h
include/configs/am3517_evm.h
include/configs/am43xx_evm.h
include/configs/am57xx_evm.h
include/configs/at91sam9x5ek.h
include/configs/baltos.h
include/configs/da850evm.h
include/configs/dra7xx_evm.h
include/configs/edison.h
include/configs/el6x_common.h
include/configs/evb_rk3399.h
include/configs/gw_ventana.h
include/configs/h2200.h
include/configs/k2g_evm.h
include/configs/ls1012a_common.h
include/configs/ls1021aiot.h
include/configs/ls1043a_common.h
include/configs/ls1088aqds.h
include/configs/ls1088ardb.h
include/configs/ls2080aqds.h
include/configs/ls2080ardb.h
include/configs/ma5d4evk.h
include/configs/mvebu_armada-37xx.h
include/configs/mx7ulp_evk.h
include/configs/nitrogen6x.h
include/configs/novena.h
include/configs/odroid.h
include/configs/odroid_xu3.h
include/configs/omap3_beagle.h
include/configs/omap3_evm.h
include/configs/omap3_logic.h
include/configs/pcm051.h
include/configs/qemu-arm.h [new file with mode: 0644]
include/configs/rk3288_common.h
include/configs/rockchip-common.h
include/configs/s32v234evb.h
include/configs/sama5d2_ptc.h
include/configs/sama5d2_xplained.h
include/configs/sama5d3xek.h
include/configs/sama5d4_xplained.h
include/configs/sama5d4ek.h
include/configs/sansa_fuze_plus.h
include/configs/siemens-am33x-common.h
include/configs/socfpga_common.h
include/configs/stih410-b2260.h
include/configs/stm32h743-disco.h
include/configs/stm32h743-eval.h
include/configs/sunxi-common.h
include/configs/tao3530.h
include/configs/theadorable-x86-common.h
include/configs/ti_armv7_keystone2.h
include/configs/trats.h
include/configs/trats2.h
include/configs/vinco.h
include/configs/vyasa-rk3288.h
include/configs/warp7.h
include/configs/xfi3.h
include/configs/xilinx_zynqmp.h
include/dm/device.h
include/dm/read.h
include/dm/util.h
include/dt-bindings/clock/rv1108-cru.h
include/dt-bindings/clock/sun8i-a23-a33-ccu.h [new file with mode: 0644]
include/dt-bindings/reset/sun8i-a23-a33-ccu.h [new file with mode: 0644]
include/efi.h
include/efi_api.h
include/efi_loader.h
include/efi_selftest.h [new file with mode: 0644]
include/environment/ti/boot.h
include/flash.h
include/fs.h
include/fs_internal.h [new file with mode: 0644]
include/image.h
include/linux/bitfield.h [new file with mode: 0644]
include/linux/bug.h
include/linux/build_bug.h [new file with mode: 0644]
include/linux/compat.h
include/linux/compiler.h
include/linux/kernel.h
include/linux/lzo.h
include/linux/mtd/mtd.h
include/linux/printk.h [new file with mode: 0644]
include/linux/usb/ch9.h
include/mtd/cfi_flash.h
include/part.h
include/part_efi.h
include/pci.h
include/pe.h
include/stdio.h [new file with mode: 0644]
include/u-boot/crc.h
include/u-boot/variadic-macro.h [new file with mode: 0644]
include/usb.h
include/usb/ehci-ci.h
include/video.h
include/video_console.h
include/vsprintf.h
lib/Kconfig
lib/Makefile
lib/asm-offsets.c
lib/crc32c.c [new file with mode: 0644]
lib/efi_loader/Makefile
lib/efi_loader/efi_bootmgr.c [new file with mode: 0644]
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_console.c
lib/efi_loader/efi_device_path.c [new file with mode: 0644]
lib/efi_loader/efi_device_path_to_text.c
lib/efi_loader/efi_disk.c
lib/efi_loader/efi_file.c [new file with mode: 0644]
lib/efi_loader/efi_image_loader.c
lib/efi_loader/efi_memory.c
lib/efi_loader/efi_net.c
lib/efi_loader/efi_runtime.c
lib/efi_loader/efi_variable.c [new file with mode: 0644]
lib/efi_selftest/Kconfig [new file with mode: 0644]
lib/efi_selftest/Makefile [new file with mode: 0644]
lib/efi_selftest/efi_selftest.c [new file with mode: 0644]
lib/efi_selftest/efi_selftest_console.c [new file with mode: 0644]
lib/efi_selftest/efi_selftest_events.c [new file with mode: 0644]
lib/efi_selftest/efi_selftest_exitbootservices.c [new file with mode: 0644]
lib/efi_selftest/efi_selftest_tpl.c [new file with mode: 0644]
lib/fdtdec.c
lib/gunzip.c
lib/lzo/lzo1x_decompress.c
scripts/Kbuild.include
scripts/Kconfig [deleted file]
scripts/Makefile
scripts/Makefile.extrawarn
scripts/Makefile.lib
scripts/Makefile.spl
scripts/config_whitelist.txt
scripts/dtc/.gitignore [new file with mode: 0644]
scripts/dtc/Makefile [new file with mode: 0644]
scripts/dtc/Makefile.dtc [new file with mode: 0644]
scripts/dtc/checks.c [new file with mode: 0644]
scripts/dtc/data.c [new file with mode: 0644]
scripts/dtc/dtc-lexer.l [new file with mode: 0644]
scripts/dtc/dtc-lexer.lex.c_shipped [new file with mode: 0644]
scripts/dtc/dtc-parser.tab.c_shipped [new file with mode: 0644]
scripts/dtc/dtc-parser.tab.h_shipped [new file with mode: 0644]
scripts/dtc/dtc-parser.y [new file with mode: 0644]
scripts/dtc/dtc.c [new file with mode: 0644]
scripts/dtc/dtc.h [new file with mode: 0644]
scripts/dtc/flattree.c [new file with mode: 0644]
scripts/dtc/fstree.c [new file with mode: 0644]
scripts/dtc/libfdt/Makefile.libfdt [new file with mode: 0644]
scripts/dtc/libfdt/fdt.c [new file with mode: 0644]
scripts/dtc/libfdt/fdt.h [new file with mode: 0644]
scripts/dtc/libfdt/fdt_empty_tree.c [new file with mode: 0644]
scripts/dtc/libfdt/fdt_ro.c [new file with mode: 0644]
scripts/dtc/libfdt/fdt_rw.c [new file with mode: 0644]
scripts/dtc/libfdt/fdt_strerror.c [new file with mode: 0644]
scripts/dtc/libfdt/fdt_sw.c [new file with mode: 0644]
scripts/dtc/libfdt/fdt_wip.c [new file with mode: 0644]
scripts/dtc/libfdt/libfdt.h [new file with mode: 0644]
scripts/dtc/libfdt/libfdt_env.h [new file with mode: 0644]
scripts/dtc/libfdt/libfdt_internal.h [new file with mode: 0644]
scripts/dtc/livetree.c [new file with mode: 0644]
scripts/dtc/srcpos.c [new file with mode: 0644]
scripts/dtc/srcpos.h [new file with mode: 0644]
scripts/dtc/treesource.c [new file with mode: 0644]
scripts/dtc/update-dtc-source.sh [new file with mode: 0755]
scripts/dtc/util.c [new file with mode: 0644]
scripts/dtc/util.h [new file with mode: 0644]
scripts/dtc/version_gen.h [new file with mode: 0644]
scripts/spelling.txt [new file with mode: 0644]
test/dm/eth.c
test/dm/usb.c
test/dm/video.c
test/fs/fs-test.sh
test/overlay/cmd_ut_overlay.c
test/print_ut.c
test/py/README.md
test/py/conftest.py
test/py/multiplexed_log.py
test/py/tests/test_dfu.py
test/py/tests/test_efi_selftest.py [new file with mode: 0644]
test/py/tests/test_fit.py
test/py/tests/test_gpt.py
test/py/tests/test_vboot.py
tools/Makefile
tools/buildman/kconfiglib.py
tools/fit_image.c
tools/moveconfig.py
tools/rkcommon.c

index 9dfd016da000e032dcea6ac2d964df5fc844bc76..0b7a0622bfd008f06044ecd651f1fa49bb9826aa 100644 (file)
@@ -26,11 +26,9 @@ addons:
     - grub-efi-ia32-bin
     - rpm2cpio
     - wget
+    - device-tree-compiler
 
 install:
- # install latest device tree compiler
- - git clone --depth=1 -b v1.4.3 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc
- - make -j4 -C /tmp/dtc
  # Clone uboot-test-hooks
  - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
  - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
@@ -51,7 +49,7 @@ install:
 
 env:
   global:
-    - PATH=/tmp/dtc:/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin
+    - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin
     - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
     - BUILD_DIR=build
     - HOSTCC="cc"
@@ -139,6 +137,12 @@ matrix:
         - BUILDMAN="atmel"
     - env:
         - BUILDMAN="aries"
+    - env:
+        - JOB="Boundary Devices"
+          BUILDMAN="boundary"
+    - env:
+        - JOB="engicam"
+          BUILDMAN="engicam"
     - env:
         - JOB="Freescale ARM32"
           BUILDMAN="freescale -x powerpc,m68k,aarch64"
@@ -147,12 +151,16 @@ matrix:
           BUILDMAN="freescale&aarch64"
     - env:
         - JOB="i.MX6 (non-Freescale)"
-          BUILDMAN="mx6 -x freescale"
+          BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
     - env:
         - JOB="i.MX (non-Freescale, non-i.MX6)"
-          BUILDMAN="mx -x freescale,mx6"
+          BUILDMAN="mx -x freescale,mx6,toradex"
+    - env:
+        - BUILDMAN="k2"
     - env:
         - BUILDMAN="samsung"
+    - env:
+        - BUILDMAN="socfpga"
     - env:
         - BUILDMAN="sun4i"
     - env:
@@ -169,16 +177,19 @@ matrix:
         - BUILDMAN="sun50i"
     - env:
         - JOB="Catch-all ARM"
-          BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,aries,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap3,omap4,omap5,pxa,rockchip"
+          BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,aries,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap3,omap4,omap5,pxa,rockchip,toradex,socfpga,k2,xilinx"
     - env:
         - BUILDMAN="sandbox x86"
           TOOLCHAIN="x86_64"
+    - env:
+        - BUILDMAN="toradex"
     - env:
         - BUILDMAN="kirkwood"
     - env:
         - BUILDMAN="mvebu"
     - env:
-        - BUILDMAN="pxa"
+        - JOB="PXA"
+        - BUILDMAN="pxa -x toradex"
     - env:
         - BUILDMAN="m68k"
           TOOLCHAIN="m68k"
@@ -209,7 +220,8 @@ matrix:
     - env:
         - BUILDMAN="siemens"
     - env:
-        - BUILDMAN="tegra"
+        - JOB="tegra"
+          BUILDMAN="tegra -x toradex"
     - env:
         - JOB="am33xx"
           BUILDMAN="am33xx -x siemens"
@@ -222,12 +234,16 @@ matrix:
     - env:
         - BUILDMAN="uniphier"
     - env:
-        - BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip"
+        - JOB="aarch64"
+          BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip"
     - env:
         - BUILDMAN="rockchip"
     - env:
         - BUILDMAN="sh4"
           TOOLCHAIN="sh4"
+    - env:
+        - JOB="Xilinx (ARM)"
+          BUILDMAN="xilinx -x microblaze"
     - env:
         - BUILDMAN="xtensa"
           TOOLCHAIN="xtensa"
@@ -287,6 +303,11 @@ matrix:
           TEST_PY_ID="--id qemu"
           QEMU_TARGET="arm-softmmu"
           BUILDMAN="^integratorcp_cm926ejs$"
+    - env:
+        - TEST_PY_BD="qemu_arm"
+          TEST_PY_TEST_SPEC="not sleep"
+          QEMU_TARGET="arm-softmmu"
+          BUILDMAN="^qemu_arm$"
     - env:
         - TEST_PY_BD="qemu_mips"
           TEST_PY_TEST_SPEC="not sleep"
diff --git a/Kconfig b/Kconfig
index 238fa3e1ed46caa14002bd8cb80dfceadea33d89..d951e9f8049203cf5c2cd7af0f30aa615e2da4d5 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -398,5 +398,3 @@ source "fs/Kconfig"
 source "lib/Kconfig"
 
 source "test/Kconfig"
-
-source "scripts/Kconfig"
index 04acf2b89dcbb17112e58085e9a853003a0f635f..b167b028ecf1c6cc0c01d719f83ca1d3299fbcce 100644 (file)
@@ -259,8 +259,9 @@ EFI PAYLOAD
 M:     Alexander Graf <agraf@suse.de>
 S:     Maintained
 T:     git git://github.com/agraf/u-boot.git
-F:     include/efi_loader.h
-F:     lib/efi_loader/
+F:     include/efi*
+F:     lib/efi*
+F:     test/py/tests/test_efi*
 F:     cmd/bootefi.c
 
 FLATTENED DEVICE TREE
@@ -419,6 +420,7 @@ F:  arch/arm/mach-omap2/omap5/sec-fxns.c
 F:     arch/arm/mach-omap2/sec-common.c
 F:     arch/arm/mach-omap2/config_secure.mk
 F:     configs/am335x_hs_evm_defconfig
+F:     configs/am335x_hs_evm_uart_defconfig
 F:     configs/am43xx_hs_evm_defconfig
 F:     configs/am57xx_hs_evm_defconfig
 F:     configs/dra7xx_hs_evm_defconfig
index e058e9854b7b3ed7d16971357de809961f655793..888486b29672ba440ae0032286dfea4c068d980f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,9 @@
 #
 
 VERSION = 2017
-PATCHLEVEL = 09
+PATCHLEVEL = 11
 SUBLEVEL =
-EXTRAVERSION =
+EXTRAVERSION = -rc1
 NAME =
 
 # *DOCUMENTATION*
@@ -349,7 +349,7 @@ OBJDUMP             = $(CROSS_COMPILE)objdump
 AWK            = awk
 PERL           = perl
 PYTHON         ?= python
-DTC            ?= dtc
+DTC            ?= $(objtree)/scripts/dtc/dtc
 CHECK          = sparse
 
 CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
@@ -872,13 +872,13 @@ endif
 PHONY += dtbs
 dtbs: dts/dt.dtb
        @:
-dts/dt.dtb: checkdtc u-boot
+dts/dt.dtb: u-boot
        $(Q)$(MAKE) $(build)=dts dtbs
 
 quiet_cmd_copy = COPY    $@
       cmd_copy = cp $< $@
 
-ifeq ($(CONFIG_FIT_EMBED),y)
+ifeq ($(CONFIG_MULTI_DTB_FIT),y)
 
 fit-dtb.blob: dts/dt.dtb FORCE
        $(call if_changed,mkimage)
@@ -1447,12 +1447,6 @@ SYSTEM_MAP = \
 System.map:    u-boot
                @$(call SYSTEM_MAP,$<) > $@
 
-checkdtc:
-       @if test $(call dtc-version) -lt 010403; then \
-               echo '*** Your dtc is too old, please upgrade to dtc 1.4.3 or newer'; \
-               false; \
-       fi
-
 #########################################################################
 
 # ARM relocations should all be R_ARM_RELATIVE (32-bit) or
index 42e7f22b28ddb4ea2db55b6eef8c5558bbb3ecf6..a12303bc7367cd1b709357ca402a57443b0e5363 100644 (file)
 #define __iowmb()              do { } while (0)
 #endif
 
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE    (0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
-
-static inline void *
-map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
-{
-       return (void *)((unsigned long)paddr);
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
-
 static inline void sync(void)
 {
        /* Not yet implemented */
@@ -302,9 +278,6 @@ static inline int __raw_writesl(unsigned int addr, void *data, int longlen)
 #define setbits_8(addr, set) setbits(8, addr, set)
 #define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set)
 
-static inline phys_addr_t virt_to_phys(void *vaddr)
-{
-       return (phys_addr_t)((unsigned long)vaddr);
-}
+#include <asm-generic/io.h>
 
 #endif /* __ASM_ARC_IO_H */
index bb64b9c160aeb37fa5fe10bb2e1f89606aacc33e..64e0ee43f1126cecde6e713d50f887b889a2564b 100644 (file)
@@ -588,6 +588,7 @@ config ARCH_OMAP2PLUS
        bool "TI OMAP2+"
        select CPU_V7
        select SPL_BOARD_INIT if SPL
+       select SPL_STACK_R if SPL
        select SUPPORT_SPL
        imply FIT
 
@@ -630,6 +631,14 @@ config ARCH_MX5
        select CPU_V7
        select BOARD_EARLY_INIT_F
 
+config ARCH_QEMU
+       bool "QEMU Virtual Platform"
+       select CPU_V7
+       select ARCH_SUPPORT_PSCI
+       select DM
+       select DM_SERIAL
+       select OF_CONTROL
+
 config ARCH_RMOBILE
        bool "Renesas ARM SoCs"
        select DM
@@ -693,8 +702,7 @@ config ARCH_SUNXI
        select USB_STORAGE if DISTRO_DEFAULTS
        select USB_KEYBOARD if DISTRO_DEFAULTS
        select USE_TINY_PRINTF
-       imply CMD_FASTBOOT
-       imply FASTBOOT
+       imply CMD_GPT
        imply FAT_WRITE
        imply PRE_CONSOLE_BUFFER
        imply SPL_GPIO_SUPPORT
@@ -704,7 +712,7 @@ config ARCH_SUNXI
        imply SPL_MMC_SUPPORT if MMC
        imply SPL_POWER_SUPPORT
        imply SPL_SERIAL_SUPPORT
-       imply USB_FUNCTION_FASTBOOT
+       imply USB_GADGET
 
 config TARGET_TS4600
        bool "Support TS4600"
@@ -1114,6 +1122,9 @@ config ARCH_ROCKCHIP
        imply FAT_WRITE
        imply USB_FUNCTION_FASTBOOT
        imply SPL_SYSRESET
+       imply TPL_SYSRESET
+       imply ADC
+       imply SARADC_ROCKCHIP
 
 config TARGET_THUNDERX_88XX
        bool "Support ThunderX 88xx"
@@ -1168,6 +1179,8 @@ source "arch/arm/mach-rmobile/Kconfig"
 
 source "arch/arm/mach-meson/Kconfig"
 
+source "arch/arm/mach-qemu/Kconfig"
+
 source "arch/arm/mach-rockchip/Kconfig"
 
 source "arch/arm/mach-s5pc1xx/Kconfig"
index 6698c0467d7c0240f2711b14457b2a7088668367..a90ee0afd7722c23f276de3a5a00c9ff54269ba8 100644 (file)
@@ -260,8 +260,8 @@ static void erratum_rcw_src(void)
 #ifdef CONFIG_SYS_FSL_ERRATUM_A009203
 static void erratum_a009203(void)
 {
-       u8 __iomem *ptr;
 #ifdef CONFIG_SYS_I2C
+       u8 __iomem *ptr;
 #ifdef I2C1_BASE_ADDR
        ptr = (u8 __iomem *)(I2C1_BASE_ADDR + I2C_DEBUG_REG);
 
@@ -297,7 +297,9 @@ void bypass_smmu(void)
 void fsl_lsch3_early_init_f(void)
 {
        erratum_rcw_src();
+#ifdef CONFIG_FSL_IFC
        init_early_memctl_regs();       /* tighten IFC timing */
+#endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A009203
        erratum_a009203();
 #endif
@@ -323,11 +325,14 @@ int sata_init(void)
 {
        struct ccsr_ahci __iomem *ccsr_ahci;
 
+#ifdef CONFIG_SYS_SATA2
        ccsr_ahci  = (void *)CONFIG_SYS_SATA2;
        out_le32(&ccsr_ahci->ppcfg, AHCI_PORT_PHY_1_CFG);
        out_le32(&ccsr_ahci->ptc, AHCI_PORT_TRANS_CFG);
        out_le32(&ccsr_ahci->axicc, AHCI_PORT_AXICC_CFG);
+#endif
 
+#ifdef CONFIG_SYS_SATA1
        ccsr_ahci  = (void *)CONFIG_SYS_SATA1;
        out_le32(&ccsr_ahci->ppcfg, AHCI_PORT_PHY_1_CFG);
        out_le32(&ccsr_ahci->ptc, AHCI_PORT_TRANS_CFG);
@@ -335,6 +340,7 @@ int sata_init(void)
 
        ahci_init((void __iomem *)CONFIG_SYS_SATA1);
        scsi_scan(false);
+#endif
 
        return 0;
 }
index 7c062f0cad854a2ca4e122842bfdb13b4f0da599..5b90280468c260b16fa40f0e244da516b5f9bff0 100644 (file)
@@ -313,8 +313,8 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \
        sun8i-r16-parrot.dtb
 dtb-$(CONFIG_MACH_SUN8I_A83T) += \
        sun8i-a83t-allwinner-h8homlet-v2.dtb \
-       sun8i-a83t-cubietruck-plus.dtb \
-       sun8i-a83t-sinovoip-bpi-m3.dtb
+       sun8i-a83t-bananapi-m3.dtb \
+       sun8i-a83t-cubietruck-plus.dtb
 dtb-$(CONFIG_MACH_SUN8I_H3) += \
        sun8i-h2-plus-orangepi-zero.dtb \
        sun8i-h3-bananapi-m2-plus.dtb \
diff --git a/arch/arm/dts/am3517-evm-u-boot.dtsi b/arch/arm/dts/am3517-evm-u-boot.dtsi
new file mode 100644 (file)
index 0000000..24a67db
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2017
+ * Logic PD - http://www.logicpd.com
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/ {
+       chosen {
+               stdout-path = &uart3;
+       };
+};
diff --git a/arch/arm/dts/am3517-evm.dts b/arch/arm/dts/am3517-evm.dts
new file mode 100644 (file)
index 0000000..0e4a125
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+
+#include "am3517.dtsi"
+
+/ {
+       model = "TI AM3517 EVM (AM3517/05 TMDSEVM3517)";
+       compatible = "ti,am3517-evm", "ti,am3517", "ti,omap3";
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x80000000 0x10000000>; /* 256 MB */
+       };
+
+        vmmc_fixed: vmmc {
+                compatible = "regulator-fixed";
+                regulator-name = "vmmc_fixed";
+                regulator-min-microvolt = <3300000>;
+                regulator-max-microvolt = <3300000>;
+        };
+};
+
+&davinci_emac {
+            status = "okay";
+};
+
+&davinci_mdio {
+            status = "okay";
+};
+
+&i2c1 {
+       clock-frequency = <400000>;
+};
+
+&i2c2 {
+       clock-frequency = <400000>;
+};
+
+&i2c3 {
+       clock-frequency = <400000>;
+};
+
+&mmc1 {
+       vmmc-supply = <&vmmc_fixed>;
+       bus-width = <4>;
+};
+
+&mmc2 {
+      status = "disabled";
+};
+
+&mmc3 {
+      status = "disabled";
+};
+
diff --git a/arch/arm/dts/am3517-u-boot.dtsi b/arch/arm/dts/am3517-u-boot.dtsi
new file mode 100644 (file)
index 0000000..2190052
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * Copyright (C) 2017
+ * Logic PD - http://www.logicpd.com
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+&uart4 {
+       reg-shift = <2>;
+};
diff --git a/arch/arm/dts/am3517.dtsi b/arch/arm/dts/am3517.dtsi
new file mode 100644 (file)
index 0000000..00da3f2
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Device Tree Source for am3517 SoC
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include "omap3.dtsi"
+
+/ {
+       aliases {
+               serial3 = &uart4;
+               can = &hecc;
+       };
+
+       ocp@68000000 {
+               am35x_otg_hs: am35x_otg_hs@5c040000 {
+                       compatible = "ti,omap3-musb";
+                       ti,hwmods = "am35x_otg_hs";
+                       status = "disabled";
+                       reg = <0x5c040000 0x1000>;
+                       interrupts = <71>;
+                       interrupt-names = "mc";
+               };
+
+               davinci_emac: ethernet@0x5c000000 {
+                       compatible = "ti,am3517-emac";
+                       ti,hwmods = "davinci_emac";
+                       status = "disabled";
+                       reg = <0x5c000000 0x30000>;
+                       interrupts = <67 68 69 70>;
+                       syscon = <&scm_conf>;
+                       ti,davinci-ctrl-reg-offset = <0x10000>;
+                       ti,davinci-ctrl-mod-reg-offset = <0>;
+                       ti,davinci-ctrl-ram-offset = <0x20000>;
+                       ti,davinci-ctrl-ram-size = <0x2000>;
+                       ti,davinci-rmii-en = /bits/ 8 <1>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+               };
+
+               davinci_mdio: ethernet@0x5c030000 {
+                       compatible = "ti,davinci_mdio";
+                       ti,hwmods = "davinci_mdio";
+                       status = "disabled";
+                       reg = <0x5c030000 0x1000>;
+                       bus_freq = <1000000>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               uart4: serial@4809e000 {
+                       compatible = "ti,omap3-uart";
+                       ti,hwmods = "uart4";
+                       status = "disabled";
+                       reg = <0x4809e000 0x400>;
+                       interrupts = <84>;
+                       dmas = <&sdma 55 &sdma 54>;
+                       dma-names = "tx", "rx";
+                       clock-frequency = <48000000>;
+               };
+
+               omap3_pmx_core2: pinmux@480025d8 {
+                       compatible = "ti,omap3-padconf", "pinctrl-single";
+                       reg = <0x480025d8 0x24>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #pinctrl-cells = <1>;
+                       #interrupt-cells = <1>;
+                       interrupt-controller;
+                       pinctrl-single,register-width = <16>;
+                       pinctrl-single,function-mask = <0xff1f>;
+               };
+
+               hecc: can@5c050000 {
+                       compatible = "ti,am3517-hecc";
+                       status = "disabled";
+                       reg = <0x5c050000 0x80>,
+                             <0x5c053000 0x180>,
+                             <0x5c052000 0x200>;
+                       reg-names = "hecc", "hecc-ram", "mbx";
+                       interrupts = <24>;
+                       clocks = <&hecc_ck>;
+               };
+       };
+};
+
+&iva {
+       status = "disabled";
+};
+
+&mailbox {
+       status = "disabled";
+};
+
+&mmu_isp {
+       status = "disabled";
+};
+
+&smartreflex_mpu_iva {
+       status = "disabled";
+};
+
+/include/ "am35xx-clocks.dtsi"
+/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
diff --git a/arch/arm/dts/am35xx-clocks.dtsi b/arch/arm/dts/am35xx-clocks.dtsi
new file mode 100644 (file)
index 0000000..00dd1f0
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Device Tree Source for OMAP3 clock data
+ *
+ * Copyright (C) 2013 Texas Instruments, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+&scm_clocks {
+       emac_ick: emac_ick@32c {
+               #clock-cells = <0>;
+               compatible = "ti,am35xx-gate-clock";
+               clocks = <&ipss_ick>;
+               reg = <0x032c>;
+               ti,bit-shift = <1>;
+       };
+
+       emac_fck: emac_fck@32c {
+               #clock-cells = <0>;
+               compatible = "ti,gate-clock";
+               clocks = <&rmii_ck>;
+               reg = <0x032c>;
+               ti,bit-shift = <9>;
+       };
+
+       vpfe_ick: vpfe_ick@32c {
+               #clock-cells = <0>;
+               compatible = "ti,am35xx-gate-clock";
+               clocks = <&ipss_ick>;
+               reg = <0x032c>;
+               ti,bit-shift = <2>;
+       };
+
+       vpfe_fck: vpfe_fck@32c {
+               #clock-cells = <0>;
+               compatible = "ti,gate-clock";
+               clocks = <&pclk_ck>;
+               reg = <0x032c>;
+               ti,bit-shift = <10>;
+       };
+
+       hsotgusb_ick_am35xx: hsotgusb_ick_am35xx@32c {
+               #clock-cells = <0>;
+               compatible = "ti,am35xx-gate-clock";
+               clocks = <&ipss_ick>;
+               reg = <0x032c>;
+               ti,bit-shift = <0>;
+       };
+
+       hsotgusb_fck_am35xx: hsotgusb_fck_am35xx@32c {
+               #clock-cells = <0>;
+               compatible = "ti,gate-clock";
+               clocks = <&sys_ck>;
+               reg = <0x032c>;
+               ti,bit-shift = <8>;
+       };
+
+       hecc_ck: hecc_ck@32c {
+               #clock-cells = <0>;
+               compatible = "ti,am35xx-gate-clock";
+               clocks = <&sys_ck>;
+               reg = <0x032c>;
+               ti,bit-shift = <3>;
+       };
+};
+&cm_clocks {
+       ipss_ick: ipss_ick@a10 {
+               #clock-cells = <0>;
+               compatible = "ti,am35xx-interface-clock";
+               clocks = <&core_l3_ick>;
+               reg = <0x0a10>;
+               ti,bit-shift = <4>;
+       };
+
+       rmii_ck: rmii_ck {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <50000000>;
+       };
+
+       pclk_ck: pclk_ck {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <27000000>;
+       };
+
+       uart4_ick_am35xx: uart4_ick_am35xx@a10 {
+               #clock-cells = <0>;
+               compatible = "ti,omap3-interface-clock";
+               clocks = <&core_l4_ick>;
+               reg = <0x0a10>;
+               ti,bit-shift = <23>;
+       };
+
+       uart4_fck_am35xx: uart4_fck_am35xx@a00 {
+               #clock-cells = <0>;
+               compatible = "ti,wait-gate-clock";
+               clocks = <&core_48m_fck>;
+               reg = <0x0a00>;
+               ti,bit-shift = <23>;
+       };
+};
+
+&cm_clockdomains {
+       core_l3_clkdm: core_l3_clkdm {
+               compatible = "ti,clockdomain";
+               clocks = <&sdrc_ick>, <&ipss_ick>, <&emac_ick>, <&vpfe_ick>,
+                        <&hsotgusb_ick_am35xx>, <&hsotgusb_fck_am35xx>,
+                        <&hecc_ck>;
+       };
+
+       core_l4_clkdm: core_l4_clkdm {
+               compatible = "ti,clockdomain";
+               clocks = <&cpefuse_fck>, <&ts_fck>, <&usbtll_fck>,
+                        <&usbtll_ick>, <&mmchs3_ick>, <&mmchs3_fck>,
+                        <&mmchs2_fck>, <&mmchs1_fck>, <&i2c3_fck>, <&i2c2_fck>,
+                        <&i2c1_fck>, <&mcspi4_fck>, <&mcspi3_fck>,
+                        <&mcspi2_fck>, <&mcspi1_fck>, <&uart2_fck>,
+                        <&uart1_fck>, <&hdq_fck>, <&mmchs2_ick>, <&mmchs1_ick>,
+                        <&hdq_ick>, <&mcspi4_ick>, <&mcspi3_ick>,
+                        <&mcspi2_ick>, <&mcspi1_ick>, <&i2c3_ick>, <&i2c2_ick>,
+                        <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>,
+                        <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>,
+                        <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>,
+                        <&uart4_ick_am35xx>, <&uart4_fck_am35xx>;
+       };
+};
index b00aaa2c79209eed3fd0ac313c4f9793a20b108c..01326a1ee03472250d4e2367e974b9064b362f4c 100644 (file)
                };
 
                apb {
+                       hlcdc: hlcdc@f0000000 {
+                               atmel,vl-bpix = <4>;
+                               atmel,guard-time = <1>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_pwm &pinctrl_lcd_rgb666>;
+                               status = "okay";
+                               u-boot,dm-pre-reloc;
+
+                               display-timings {
+                                       u-boot,dm-pre-reloc;
+                                       480x272 {
+                                               clock-frequency = <9000000>;
+                                               hactive = <480>;
+                                               vactive = <272>;
+                                               hsync-len = <41>;
+                                               hfront-porch = <2>;
+                                               hback-porch = <2>;
+                                               vfront-porch = <2>;
+                                               vback-porch = <2>;
+                                               vsync-len = <11>;
+                                               u-boot,dm-pre-reloc;
+                                       };
+                               };
+                       };
+
                        qspi0: spi@f0020000 {
                                status = "okay";
 
                                                bias-disable;
                                        };
 
+                                       pinctrl_lcd_base: pinctrl_lcd_base {
+                                               pinmux = <PIN_PC30__LCDVSYNC>,
+                                                       <PIN_PC31__LCDHSYNC>,
+                                                       <PIN_PD1__LCDDEN>,
+                                                       <PIN_PD0__LCDPCK>;
+                                               bias-disable;
+                                       };
+
+                                       pinctrl_lcd_pwm: pinctrl_lcd_pwm {
+                                               pinmux = <PIN_PC28__LCDPWM>;
+                                               bias-disable;
+                                       };
+
+                                       pinctrl_lcd_rgb666: pinctrl_lcd_rgb666 {
+                                               pinmux = <PIN_PC10__LCDDAT2>,
+                                                       <PIN_PC11__LCDDAT3>,
+                                                       <PIN_PC12__LCDDAT4>,
+                                                       <PIN_PC13__LCDDAT5>,
+                                                       <PIN_PC14__LCDDAT6>,
+                                                       <PIN_PC15__LCDDAT7>,
+                                                       <PIN_PC16__LCDDAT10>,
+                                                       <PIN_PC17__LCDDAT11>,
+                                                       <PIN_PC18__LCDDAT12>,
+                                                       <PIN_PC19__LCDDAT13>,
+                                                       <PIN_PC20__LCDDAT14>,
+                                                       <PIN_PC21__LCDDAT15>,
+                                                       <PIN_PC22__LCDDAT18>,
+                                                       <PIN_PC23__LCDDAT19>,
+                                                       <PIN_PC24__LCDDAT20>,
+                                                       <PIN_PC25__LCDDAT21>,
+                                                       <PIN_PC26__LCDDAT22>,
+                                                       <PIN_PC27__LCDDAT23>;
+                                               bias-disable;
+                                       };
+
                                        pinctrl_macb0_phy_irq: macb0_phy_irq {
                                                pinmux = <PIN_PC9__GPIO>;
                                                bias-disable;
index 0592b31b91733ef846dacdebc083175dd395b2e0..ea35dc21b6fe61e692302de7465b84c525d2ff35 100644 (file)
 
        ahb {
                apb {
+                       hlcdc: hlcdc@f0000000 {
+                               atmel,vl-bpix = <4>;
+                               atmel,guard-time = <1>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_pwm &pinctrl_lcd_rgb888>;
+                               status = "okay";
+                               u-boot,dm-pre-reloc;
+
+                               display-timings {
+                                       u-boot,dm-pre-reloc;
+                                       480x272 {
+                                               clock-frequency = <9000000>;
+                                               hactive = <480>;
+                                               vactive = <272>;
+                                               hsync-len = <41>;
+                                               hfront-porch = <2>;
+                                               hback-porch = <2>;
+                                               vfront-porch = <2>;
+                                               vback-porch = <2>;
+                                               vsync-len = <11>;
+                                               u-boot,dm-pre-reloc;
+                                       };
+                               };
+                       };
+
                        spi0: spi@f8010000 {
                                u-boot,dm-pre-reloc;
                                cs-gpios = <&pioC 3 0>, <0>, <0>, <0>;
index b965f5b39dc67437b103cc1695b06580548edc1f..a5d75452cf3e8fff1c845e672cf1009f3c27f3a4 100644 (file)
 
        ahb {
                apb {
+                       hlcdc: hlcdc@f0000000 {
+                               atmel,vl-bpix = <4>;
+                               atmel,output-mode = <18>;
+                               atmel,guard-time = <1>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_pwm &pinctrl_lcd_rgb666>;
+                               status = "okay";
+                               u-boot,dm-pre-reloc;
+
+                               display-timings {
+                                       u-boot,dm-pre-reloc;
+                                       800x480 {
+                                               clock-frequency = <33260000>;
+                                               hactive = <800>;
+                                               vactive = <480>;
+                                               hsync-len = <5>;
+                                               hfront-porch = <128>;
+                                               hback-porch = <0>;
+                                               vfront-porch = <23>;
+                                               vback-porch = <22>;
+                                               vsync-len = <5>;
+                                               u-boot,dm-pre-reloc;
+                                       };
+                               };
+                       };
+
                        adc0: adc@fc034000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <
diff --git a/arch/arm/dts/axp223.dtsi b/arch/arm/dts/axp223.dtsi
new file mode 100644 (file)
index 0000000..b91b6c1
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016 Free Electrons
+ *
+ * Quentin Schulz <quentin.schulz@free-electrons.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.
+ */
+
+/*
+ * AXP223 Integrated Power Management Chip
+ * http://www.x-powers.com/product/AXP22X.php
+ * http://dl.linux-sunxi.org/AXP/AXP223-en.pdf
+ *
+ * The AXP223 shares most of its logic with the AXP221 but it has some
+ * differences, for the VBUS driver for example.
+ */
+
+#include "axp22x.dtsi"
+
+&usb_power_supply {
+       compatible = "x-powers,axp223-usb-power-supply";
+};
index 458b6681e3ec54b37845b6245464e5385454c087..87fb08e812ecccfb21f5a2a47af751c889e1f7a3 100644 (file)
        interrupt-controller;
        #interrupt-cells = <1>;
 
+       ac_power_supply: ac-power-supply {
+               compatible = "x-powers,axp221-ac-power-supply";
+               status = "disabled";
+       };
+
+       battery_power_supply: battery-power-supply {
+               compatible = "x-powers,axp221-battery-power-supply";
+               status = "disabled";
+       };
+
        regulators {
                /* Default work frequency for buck regulators */
                x-powers,dcdc-freq = <3000>;
diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi b/arch/arm/dts/da850-evm-u-boot.dtsi
new file mode 100644 (file)
index 0000000..5cc5a81
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * da850-evm U-Boot Additions
+ *
+ * Copyright (C) 2017 Logic PD, Inc.
+ * Copyright (C) Adam Ford
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/ {
+       chosen {
+               stdout-path = &serial2;
+       };
+
+       aliases {
+               i2c0 = &i2c0;
+               spi0 = &spi1;
+       };
+};
+
+&flash {
+       compatible = "m25p64", "spi-flash";
+};
diff --git a/arch/arm/dts/da850-evm.dts b/arch/arm/dts/da850-evm.dts
new file mode 100644 (file)
index 0000000..67e72bc
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * Device Tree for DA850 EVM board
+ *
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program 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, version 2.
+ */
+/dts-v1/;
+#include "da850.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       compatible = "ti,da850-evm", "ti,da850";
+       model = "DA850/AM1808/OMAP-L138 EVM";
+
+       soc@1c00000 {
+               pmx_core: pinmux@14120 {
+                       status = "okay";
+
+                       mcasp0_pins: pinmux_mcasp0_pins {
+                               pinctrl-single,bits = <
+                                       /*
+                                        * AHCLKX, ACLKX, AFSX, AHCLKR, ACLKR,
+                                        * AFSR, AMUTE
+                                        */
+                                       0x00 0x11111111 0xffffffff
+                                       /* AXR11, AXR12 */
+                                       0x04 0x00011000 0x000ff000
+                               >;
+                       };
+                       nand_pins: nand_pins {
+                               pinctrl-single,bits = <
+                                       /* EMA_WAIT[0], EMA_OE, EMA_WE, EMA_CS[4], EMA_CS[3] */
+                                       0x1c 0x10110110  0xf0ff0ff0
+                                       /*
+                                        * EMA_D[0], EMA_D[1], EMA_D[2],
+                                        * EMA_D[3], EMA_D[4], EMA_D[5],
+                                        * EMA_D[6], EMA_D[7]
+                                        */
+                                       0x24 0x11111111  0xffffffff
+                                       /* EMA_A[1], EMA_A[2] */
+                                       0x30 0x01100000  0x0ff00000
+                               >;
+                       };
+               };
+               serial0: serial@42000 {
+                       status = "okay";
+               };
+               serial1: serial@10c000 {
+                       status = "okay";
+               };
+               serial2: serial@10d000 {
+                       status = "okay";
+               };
+               rtc0: rtc@23000 {
+                       status = "okay";
+               };
+               i2c0: i2c@22000 {
+                       status = "okay";
+                       clock-frequency = <100000>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c0_pins>;
+
+                       tps: tps@48 {
+                               reg = <0x48>;
+                       };
+                       tlv320aic3106: tlv320aic3106@18 {
+                               #sound-dai-cells = <0>;
+                               compatible = "ti,tlv320aic3106";
+                               reg = <0x18>;
+                               status = "okay";
+
+                               /* Regulators */
+                               IOVDD-supply = <&vdcdc2_reg>;
+                               /* Derived from VBAT: Baseboard 3.3V / 1.8V */
+                               AVDD-supply = <&vbat>;
+                               DRVDD-supply = <&vbat>;
+                               DVDD-supply = <&vbat>;
+                       };
+                       tca6416: gpio@20 {
+                               compatible = "ti,tca6416";
+                               reg = <0x20>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+               };
+               wdt: wdt@21000 {
+                       status = "okay";
+               };
+               mmc0: mmc@40000 {
+                       max-frequency = <50000000>;
+                       bus-width = <4>;
+                       status = "okay";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mmc0_pins>;
+               };
+               spi1: spi@30e000 {
+                       status = "okay";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi1_pins &spi1_cs0_pin>;
+                       flash: m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "m25p64";
+                               spi-max-frequency = <30000000>;
+                               m25p,fast-read;
+                               reg = <0>;
+                               partition@0 {
+                                       label = "U-Boot-SPL";
+                                       reg = <0x00000000 0x00010000>;
+                                       read-only;
+                               };
+                               partition@1 {
+                                       label = "U-Boot";
+                                       reg = <0x00010000 0x00080000>;
+                                       read-only;
+                               };
+                               partition@2 {
+                                       label = "U-Boot-Env";
+                                       reg = <0x00090000 0x00010000>;
+                                       read-only;
+                               };
+                               partition@3 {
+                                       label = "Kernel";
+                                       reg = <0x000a0000 0x00280000>;
+                               };
+                               partition@4 {
+                                       label = "Filesystem";
+                                       reg = <0x00320000 0x00400000>;
+                               };
+                               partition@5 {
+                                       label = "MAC-Address";
+                                       reg = <0x007f0000 0x00010000>;
+                                       read-only;
+                               };
+                       };
+               };
+               mdio: mdio@224000 {
+                       status = "okay";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mdio_pins>;
+                       bus_freq = <2200000>;
+               };
+               eth0: ethernet@220000 {
+                       status = "okay";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mii_pins>;
+               };
+               gpio: gpio@226000 {
+                       status = "okay";
+               };
+       };
+       vbat: fixedregulator0 {
+               compatible = "regulator-fixed";
+               regulator-name = "vbat";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-boot-on;
+       };
+
+       sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "DA850/OMAP-L138 EVM";
+               simple-audio-card,widgets =
+                       "Line", "Line In",
+                       "Line", "Line Out";
+               simple-audio-card,routing =
+                       "LINE1L", "Line In",
+                       "LINE1R", "Line In",
+                       "Line Out", "LLOUT",
+                       "Line Out", "RLOUT";
+               simple-audio-card,format = "dsp_b";
+               simple-audio-card,bitclock-master = <&link0_codec>;
+               simple-audio-card,frame-master = <&link0_codec>;
+               simple-audio-card,bitclock-inversion;
+
+               simple-audio-card,cpu {
+                       sound-dai = <&mcasp0>;
+                       system-clock-frequency = <24576000>;
+               };
+
+               link0_codec: simple-audio-card,codec {
+                       sound-dai = <&tlv320aic3106>;
+                       system-clock-frequency = <24576000>;
+               };
+       };
+};
+
+/include/ "tps6507x.dtsi"
+
+&tps {
+       vdcdc1_2-supply = <&vbat>;
+       vdcdc3-supply = <&vbat>;
+       vldo1_2-supply = <&vbat>;
+
+       regulators {
+               vdcdc1_reg: regulator@0 {
+                       regulator-name = "VDCDC1_3.3V";
+                       regulator-min-microvolt = <3150000>;
+                       regulator-max-microvolt = <3450000>;
+                       regulator-always-on;
+                       regulator-boot-on;
+               };
+
+               vdcdc2_reg: regulator@1 {
+                       regulator-name = "VDCDC2_3.3V";
+                       regulator-min-microvolt = <1710000>;
+                       regulator-max-microvolt = <3450000>;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       ti,defdcdc_default = <1>;
+               };
+
+               vdcdc3_reg: regulator@2 {
+                       regulator-name = "VDCDC3_1.2V";
+                       regulator-min-microvolt = <950000>;
+                       regulator-max-microvolt = <1350000>;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       ti,defdcdc_default = <1>;
+               };
+
+               ldo1_reg: regulator@3 {
+                       regulator-name = "LDO1_1.8V";
+                       regulator-min-microvolt = <1710000>;
+                       regulator-max-microvolt = <1890000>;
+                       regulator-always-on;
+                       regulator-boot-on;
+               };
+
+               ldo2_reg: regulator@4 {
+                       regulator-name = "LDO2_1.2V";
+                       regulator-min-microvolt = <1140000>;
+                       regulator-max-microvolt = <1320000>;
+                       regulator-always-on;
+                       regulator-boot-on;
+               };
+       };
+};
+
+&mcasp0 {
+       #sound-dai-cells = <0>;
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&mcasp0_pins>;
+
+       op-mode = <0>;          /* MCASP_IIS_MODE */
+       tdm-slots = <2>;
+       /* 4 serializer */
+       serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+               0 0 0 0
+               0 0 0 0
+               0 0 0 1
+               2 0 0 0
+       >;
+       tx-num-evt = <32>;
+       rx-num-evt = <32>;
+};
+
+&edma0 {
+       ti,edma-reserved-slot-ranges = <32 50>;
+};
+
+&edma1 {
+       ti,edma-reserved-slot-ranges = <32 90>;
+};
+
+&aemif {
+       pinctrl-names = "default";
+       pinctrl-0 = <&nand_pins>;
+       status = "ok";
+       cs3 {
+               #address-cells = <2>;
+               #size-cells = <1>;
+               clock-ranges;
+               ranges;
+
+               ti,cs-chipselect = <3>;
+
+               nand@2000000,0 {
+                       compatible = "ti,davinci-nand";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0 0x02000000 0x02000000
+                              1 0x00000000 0x00008000>;
+
+                       ti,davinci-chipselect = <1>;
+                       ti,davinci-mask-ale = <0>;
+                       ti,davinci-mask-cle = <0>;
+                       ti,davinci-mask-chipsel = <0>;
+                       ti,davinci-ecc-mode = "hw";
+                       ti,davinci-ecc-bits = <4>;
+                       ti,davinci-nand-use-bbt;
+               };
+       };
+};
+
+&vpif {
+       pinctrl-names = "default";
+       pinctrl-0 = <&vpif_capture_pins>, <&vpif_display_pins>;
+       status = "okay";
+};
diff --git a/arch/arm/dts/da850.dtsi b/arch/arm/dts/da850.dtsi
new file mode 100644 (file)
index 0000000..02e2f8f
--- /dev/null
@@ -0,0 +1,581 @@
+/*
+ * Copyright 2012 DENX Software Engineering GmbH
+ * Heiko Schocher <hs@denx.de>
+ *
+ * This program 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.
+ */
+#include "skeleton.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       arm {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               intc: interrupt-controller@fffee000 {
+                       compatible = "ti,cp-intc";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       ti,intc-size = <101>;
+                       reg = <0xfffee000 0x2000>;
+               };
+       };
+
+       aliases {
+               spi0 = &spi0;
+       };
+
+       soc@1c00000 {
+               compatible = "simple-bus";
+               model = "da850";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x01c00000 0x400000>;
+               interrupt-parent = <&intc>;
+
+               pmx_core: pinmux@14120 {
+                       compatible = "pinctrl-single";
+                       reg = <0x14120 0x50>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #pinctrl-cells = <2>;
+                       pinctrl-single,bit-per-mux;
+                       pinctrl-single,register-width = <32>;
+                       pinctrl-single,function-mask = <0xf>;
+                       status = "disabled";
+
+                       serial0_rtscts_pins: pinmux_serial0_rtscts_pins {
+                               pinctrl-single,bits = <
+                                       /* UART0_RTS UART0_CTS */
+                                       0x0c 0x22000000 0xff000000
+                               >;
+                       };
+                       serial0_rxtx_pins: pinmux_serial0_rxtx_pins {
+                               pinctrl-single,bits = <
+                                       /* UART0_TXD UART0_RXD */
+                                       0x0c 0x00220000 0x00ff0000
+                               >;
+                       };
+                       serial1_rtscts_pins: pinmux_serial1_rtscts_pins {
+                               pinctrl-single,bits = <
+                                       /* UART1_CTS UART1_RTS */
+                                       0x00 0x00440000 0x00ff0000
+                               >;
+                       };
+                       serial1_rxtx_pins: pinmux_serial1_rxtx_pins {
+                               pinctrl-single,bits = <
+                                       /* UART1_TXD UART1_RXD */
+                                       0x10 0x22000000 0xff000000
+                               >;
+                       };
+                       serial2_rtscts_pins: pinmux_serial2_rtscts_pins {
+                               pinctrl-single,bits = <
+                                       /* UART2_CTS UART2_RTS */
+                                       0x00 0x44000000 0xff000000
+                               >;
+                       };
+                       serial2_rxtx_pins: pinmux_serial2_rxtx_pins {
+                               pinctrl-single,bits = <
+                                       /* UART2_TXD UART2_RXD */
+                                       0x10 0x00220000 0x00ff0000
+                               >;
+                       };
+                       i2c0_pins: pinmux_i2c0_pins {
+                               pinctrl-single,bits = <
+                                       /* I2C0_SDA,I2C0_SCL */
+                                       0x10 0x00002200 0x0000ff00
+                               >;
+                       };
+                       i2c1_pins: pinmux_i2c1_pins {
+                               pinctrl-single,bits = <
+                                       /* I2C1_SDA, I2C1_SCL */
+                                       0x10 0x00440000 0x00ff0000
+                               >;
+                       };
+                       mmc0_pins: pinmux_mmc_pins {
+                               pinctrl-single,bits = <
+                                       /* MMCSD0_DAT[3] MMCSD0_DAT[2]
+                                        * MMCSD0_DAT[1] MMCSD0_DAT[0]
+                                        * MMCSD0_CMD    MMCSD0_CLK
+                                        */
+                                       0x28 0x00222222  0x00ffffff
+                               >;
+                       };
+                       ehrpwm0a_pins: pinmux_ehrpwm0a_pins {
+                               pinctrl-single,bits = <
+                                       /* EPWM0A */
+                                       0xc 0x00000002 0x0000000f
+                               >;
+                       };
+                       ehrpwm0b_pins: pinmux_ehrpwm0b_pins {
+                               pinctrl-single,bits = <
+                                       /* EPWM0B */
+                                       0xc 0x00000020 0x000000f0
+                               >;
+                       };
+                       ehrpwm1a_pins: pinmux_ehrpwm1a_pins {
+                               pinctrl-single,bits = <
+                                       /* EPWM1A */
+                                       0x14 0x00000002 0x0000000f
+                               >;
+                       };
+                       ehrpwm1b_pins: pinmux_ehrpwm1b_pins {
+                               pinctrl-single,bits = <
+                                       /* EPWM1B */
+                                       0x14 0x00000020 0x000000f0
+                               >;
+                       };
+                       ecap0_pins: pinmux_ecap0_pins {
+                               pinctrl-single,bits = <
+                                       /* ECAP0_APWM0 */
+                                       0x8 0x20000000 0xf0000000
+                               >;
+                       };
+                       ecap1_pins: pinmux_ecap1_pins {
+                               pinctrl-single,bits = <
+                                       /* ECAP1_APWM1 */
+                                       0x4 0x40000000 0xf0000000
+                               >;
+                       };
+                       ecap2_pins: pinmux_ecap2_pins {
+                               pinctrl-single,bits = <
+                                       /* ECAP2_APWM2 */
+                                       0x4 0x00000004 0x0000000f
+                               >;
+                       };
+                       spi0_pins: pinmux_spi0_pins {
+                               pinctrl-single,bits = <
+                                       /* SIMO, SOMI, CLK */
+                                       0xc 0x00001101 0x0000ff0f
+                               >;
+                       };
+                       spi0_cs0_pin: pinmux_spi0_cs0 {
+                               pinctrl-single,bits = <
+                                       /* CS0 */
+                                       0x10 0x00000010 0x000000f0
+                               >;
+                       };
+                       spi0_cs3_pin: pinmux_spi0_cs3_pin {
+                               pinctrl-single,bits = <
+                                       /* CS3 */
+                                       0xc 0x01000000 0x0f000000
+                               >;
+                       };
+                       spi1_pins: pinmux_spi1_pins {
+                               pinctrl-single,bits = <
+                                       /* SIMO, SOMI, CLK */
+                                       0x14 0x00110100 0x00ff0f00
+                               >;
+                       };
+                       spi1_cs0_pin: pinmux_spi1_cs0 {
+                               pinctrl-single,bits = <
+                                       /* CS0 */
+                                       0x14 0x00000010 0x000000f0
+                               >;
+                       };
+                       mdio_pins: pinmux_mdio_pins {
+                               pinctrl-single,bits = <
+                                       /* MDIO_CLK, MDIO_D */
+                                       0x10 0x00000088 0x000000ff
+                               >;
+                       };
+                       mii_pins: pinmux_mii_pins {
+                               pinctrl-single,bits = <
+                                       /*
+                                        * MII_TXEN, MII_TXCLK, MII_COL
+                                        * MII_TXD_3, MII_TXD_2, MII_TXD_1
+                                        * MII_TXD_0
+                                        */
+                                       0x8 0x88888880 0xfffffff0
+                                       /*
+                                        * MII_RXER, MII_CRS, MII_RXCLK
+                                        * MII_RXDV, MII_RXD_3, MII_RXD_2
+                                        * MII_RXD_1, MII_RXD_0
+                                        */
+                                       0xc 0x88888888 0xffffffff
+                               >;
+                       };
+                       lcd_pins: pinmux_lcd_pins {
+                               pinctrl-single,bits = <
+                                       /*
+                                        * LCD_D[2], LCD_D[3], LCD_D[4], LCD_D[5],
+                                        * LCD_D[6], LCD_D[7]
+                                        */
+                                       0x40 0x22222200 0xffffff00
+                                       /*
+                                        * LCD_D[10], LCD_D[11], LCD_D[12], LCD_D[13],
+                                        * LCD_D[14], LCD_D[15], LCD_D[0], LCD_D[1]
+                                        */
+                                       0x44 0x22222222 0xffffffff
+                                       /* LCD_D[8], LCD_D[9] */
+                                       0x48 0x00000022 0x000000ff
+
+                                       /* LCD_PCLK */
+                                       0x48 0x02000000 0x0f000000
+                                       /* LCD_AC_ENB_CS, LCD_VSYNC, LCD_HSYNC */
+                                       0x4c 0x02000022 0x0f0000ff
+                               >;
+                       };
+                       vpif_capture_pins: vpif_capture_pins {
+                               pinctrl-single,bits = <
+                                       /* VP_DIN[2..7], VP_CLKIN1, VP_CLKIN0 */
+                                       0x38 0x11111111 0xffffffff
+                                       /* VP_DIN[10..15,0..1] */
+                                       0x3c 0x11111111 0xffffffff
+                                       /* VP_DIN[8..9] */
+                                       0x40 0x00000011 0x000000ff
+                               >;
+                       };
+                       vpif_display_pins: vpif_display_pins {
+                               pinctrl-single,bits = <
+                                       /* VP_DOUT[2..7] */
+                                       0x40 0x11111100 0xffffff00
+                                       /* VP_DOUT[10..15,0..1] */
+                                       0x44 0x11111111 0xffffffff
+                                       /*  VP_DOUT[8..9] */
+                                       0x48 0x00000011 0x000000ff
+                                       /*
+                                        * VP_CLKOUT3, VP_CLKIN3,
+                                        * VP_CLKOUT2, VP_CLKIN2
+                                        */
+                                       0x4c 0x00111100 0x00ffff00
+                               >;
+                       };
+               };
+               prictrl: priority-controller@14110 {
+                       compatible = "ti,da850-mstpri";
+                       reg = <0x14110 0x0c>;
+                       status = "disabled";
+               };
+               cfgchip: chip-controller@1417c {
+                       compatible = "ti,da830-cfgchip", "syscon", "simple-mfd";
+                       reg = <0x1417c 0x14>;
+
+                       usb_phy: usb-phy {
+                               compatible = "ti,da830-usb-phy";
+                               #phy-cells = <1>;
+                               status = "disabled";
+                       };
+               };
+               edma0: edma@0 {
+                       compatible = "ti,edma3-tpcc";
+                       /* eDMA3 CC0: 0x01c0 0000 - 0x01c0 7fff */
+                       reg =   <0x0 0x8000>;
+                       reg-names = "edma3_cc";
+                       interrupts = <11 12>;
+                       interrupt-names = "edma3_ccint", "edma3_ccerrint";
+                       #dma-cells = <2>;
+
+                       ti,tptcs = <&edma0_tptc0 7>, <&edma0_tptc1 0>;
+               };
+               edma0_tptc0: tptc@8000 {
+                       compatible = "ti,edma3-tptc";
+                       reg =   <0x8000 0x400>;
+                       interrupts = <13>;
+                       interrupt-names = "edm3_tcerrint";
+               };
+               edma0_tptc1: tptc@8400 {
+                       compatible = "ti,edma3-tptc";
+                       reg =   <0x8400 0x400>;
+                       interrupts = <32>;
+                       interrupt-names = "edm3_tcerrint";
+               };
+               edma1: edma@230000 {
+                       compatible = "ti,edma3-tpcc";
+                       /* eDMA3 CC1: 0x01e3 0000 - 0x01e3 7fff */
+                       reg =   <0x230000 0x8000>;
+                       reg-names = "edma3_cc";
+                       interrupts = <93 94>;
+                       interrupt-names = "edma3_ccint", "edma3_ccerrint";
+                       #dma-cells = <2>;
+
+                       ti,tptcs = <&edma1_tptc0 7>;
+               };
+               edma1_tptc0: tptc@238000 {
+                       compatible = "ti,edma3-tptc";
+                       reg =   <0x238000 0x400>;
+                       interrupts = <95>;
+                       interrupt-names = "edm3_tcerrint";
+               };
+               serial0: serial@42000 {
+                       compatible = "ti,da830-uart", "ns16550a";
+                       reg = <0x42000 0x100>;
+                       reg-io-width = <4>;
+                       reg-shift = <2>;
+                       interrupts = <25>;
+                       status = "disabled";
+               };
+               serial1: serial@10c000 {
+                       compatible = "ti,da830-uart", "ns16550a";
+                       reg = <0x10c000 0x100>;
+                       reg-io-width = <4>;
+                       reg-shift = <2>;
+                       interrupts = <53>;
+                       status = "disabled";
+               };
+               serial2: serial@10d000 {
+                       compatible = "ti,da830-uart", "ns16550a";
+                       reg = <0x10d000 0x100>;
+                       reg-io-width = <4>;
+                       reg-shift = <2>;
+                       interrupts = <61>;
+                       status = "disabled";
+               };
+               rtc0: rtc@23000 {
+                       compatible = "ti,da830-rtc";
+                       reg = <0x23000 0x1000>;
+                       interrupts = <19
+                                     19>;
+                       status = "disabled";
+               };
+               i2c0: i2c@22000 {
+                       compatible = "ti,davinci-i2c";
+                       reg = <0x22000 0x1000>;
+                       interrupts = <15>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+               i2c1: i2c@228000 {
+                       compatible = "ti,davinci-i2c";
+                       reg = <0x228000 0x1000>;
+                       interrupts = <51>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+               wdt: wdt@21000 {
+                       compatible = "ti,davinci-wdt";
+                       reg = <0x21000 0x1000>;
+                       status = "disabled";
+               };
+               mmc0: mmc@40000 {
+                       compatible = "ti,da830-mmc";
+                       reg = <0x40000 0x1000>;
+                       cap-sd-highspeed;
+                       cap-mmc-highspeed;
+                       interrupts = <16>;
+                       dmas = <&edma0 16 0>, <&edma0 17 0>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+               vpif: video@217000 {
+                       compatible = "ti,da850-vpif";
+                       reg = <0x217000 0x1000>;
+                       interrupts = <92>;
+                       status = "disabled";
+
+                       /* VPIF capture port */
+                       port@0 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       /* VPIF display port */
+                       port@1 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+               mmc1: mmc@21b000 {
+                       compatible = "ti,da830-mmc";
+                       reg = <0x21b000 0x1000>;
+                       cap-sd-highspeed;
+                       cap-mmc-highspeed;
+                       interrupts = <72>;
+                       dmas = <&edma1 28 0>, <&edma1 29 0>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+               ehrpwm0: pwm@300000 {
+                       compatible = "ti,da850-ehrpwm", "ti,am3352-ehrpwm",
+                                    "ti,am33xx-ehrpwm";
+                       #pwm-cells = <3>;
+                       reg = <0x300000 0x2000>;
+                       status = "disabled";
+               };
+               ehrpwm1: pwm@302000 {
+                       compatible = "ti,da850-ehrpwm", "ti,am3352-ehrpwm",
+                                    "ti,am33xx-ehrpwm";
+                       #pwm-cells = <3>;
+                       reg = <0x302000 0x2000>;
+                       status = "disabled";
+               };
+               ecap0: ecap@306000 {
+                       compatible = "ti,da850-ecap", "ti,am3352-ecap",
+                                    "ti,am33xx-ecap";
+                       #pwm-cells = <3>;
+                       reg = <0x306000 0x80>;
+                       status = "disabled";
+               };
+               ecap1: ecap@307000 {
+                       compatible = "ti,da850-ecap", "ti,am3352-ecap",
+                                    "ti,am33xx-ecap";
+                       #pwm-cells = <3>;
+                       reg = <0x307000 0x80>;
+                       status = "disabled";
+               };
+               ecap2: ecap@308000 {
+                       compatible = "ti,da850-ecap", "ti,am3352-ecap",
+                                    "ti,am33xx-ecap";
+                       #pwm-cells = <3>;
+                       reg = <0x308000 0x80>;
+                       status = "disabled";
+               };
+               spi0: spi@41000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "ti,da830-spi";
+                       reg = <0x41000 0x1000>;
+                       num-cs = <6>;
+                       ti,davinci-spi-intr-line = <1>;
+                       interrupts = <20>;
+                       dmas = <&edma0 14 0>, <&edma0 15 0>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+               spi1: spi@30e000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "ti,da830-spi";
+                       reg = <0x30e000 0x1000>;
+                       num-cs = <4>;
+                       ti,davinci-spi-intr-line = <1>;
+                       interrupts = <56>;
+                       dmas = <&edma0 18 0>, <&edma0 19 0>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+               usb0: usb@200000 {
+                       compatible = "ti,da830-musb";
+                       reg = <0x200000 0x1000>;
+                       ranges;
+                       interrupts = <58>;
+                       interrupt-names = "mc";
+                       dr_mode = "otg";
+                       phys = <&usb_phy 0>;
+                       phy-names = "usb-phy";
+                       status = "disabled";
+
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       dmas = <&cppi41dma 0 0 &cppi41dma 1 0
+                               &cppi41dma 2 0 &cppi41dma 3 0
+                               &cppi41dma 0 1 &cppi41dma 1 1
+                               &cppi41dma 2 1 &cppi41dma 3 1>;
+                       dma-names =
+                               "rx1", "rx2", "rx3", "rx4",
+                               "tx1", "tx2", "tx3", "tx4";
+
+                       cppi41dma: dma-controller@201000 {
+                               compatible = "ti,da830-cppi41";
+                               reg =  <0x201000 0x1000
+                                       0x202000 0x1000
+                                       0x204000 0x4000>;
+                               reg-names = "controller",
+                                           "scheduler", "queuemgr";
+                               interrupts = <58>;
+                               #dma-cells = <2>;
+                               #dma-channels = <4>;
+                               status = "okay";
+                       };
+               };
+               sata: sata@218000 {
+                       compatible = "ti,da850-ahci";
+                       reg = <0x218000 0x2000>, <0x22c018 0x4>;
+                       interrupts = <67>;
+                       status = "disabled";
+               };
+               mdio: mdio@224000 {
+                       compatible = "ti,davinci_mdio";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x224000 0x1000>;
+                       status = "disabled";
+               };
+               eth0: ethernet@220000 {
+                       compatible = "ti,davinci-dm6467-emac";
+                       reg = <0x220000 0x4000>;
+                       ti,davinci-ctrl-reg-offset = <0x3000>;
+                       ti,davinci-ctrl-mod-reg-offset = <0x2000>;
+                       ti,davinci-ctrl-ram-offset = <0>;
+                       ti,davinci-ctrl-ram-size = <0x2000>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <33
+                                       34
+                                       35
+                                       36
+                                       >;
+                       status = "disabled";
+               };
+               usb1: usb@225000 {
+                       compatible = "ti,da830-ohci";
+                       reg = <0x225000 0x1000>;
+                       interrupts = <59>;
+                       phys = <&usb_phy 1>;
+                       phy-names = "usb-phy";
+                       status = "disabled";
+               };
+               gpio: gpio@226000 {
+                       compatible = "ti,dm6441-gpio";
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       reg = <0x226000 0x1000>;
+                       interrupts = <42 IRQ_TYPE_EDGE_BOTH
+                               43 IRQ_TYPE_EDGE_BOTH 44 IRQ_TYPE_EDGE_BOTH
+                               45 IRQ_TYPE_EDGE_BOTH 46 IRQ_TYPE_EDGE_BOTH
+                               47 IRQ_TYPE_EDGE_BOTH 48 IRQ_TYPE_EDGE_BOTH
+                               49 IRQ_TYPE_EDGE_BOTH 50 IRQ_TYPE_EDGE_BOTH>;
+                       ti,ngpio = <144>;
+                       ti,davinci-gpio-unbanked = <0>;
+                       status = "disabled";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+               pinconf: pin-controller@22c00c {
+                       compatible = "ti,da850-pupd";
+                       reg = <0x22c00c 0x8>;
+                       status = "disabled";
+               };
+
+               mcasp0: mcasp@100000 {
+                       compatible = "ti,da830-mcasp-audio";
+                       reg = <0x100000 0x2000>,
+                             <0x102000 0x400000>;
+                       reg-names = "mpu", "dat";
+                       interrupts = <54>;
+                       interrupt-names = "common";
+                       status = "disabled";
+                       dmas = <&edma0 1 1>,
+                               <&edma0 0 1>;
+                       dma-names = "tx", "rx";
+               };
+
+               lcdc: display@213000 {
+                       compatible = "ti,da850-tilcdc";
+                       reg = <0x213000 0x1000>;
+                       interrupts = <52>;
+                       max-pixelclock = <37500>;
+                       status = "disabled";
+               };
+       };
+       aemif: aemif@68000000 {
+               compatible = "ti,da850-aemif";
+               #address-cells = <2>;
+               #size-cells = <1>;
+
+               reg = <0x68000000 0x00008000>;
+               ranges = <0 0 0x60000000 0x08000000
+                         1 0 0x68000000 0x00008000>;
+               status = "disabled";
+       };
+       memctrl: memory-controller@b0000000 {
+               compatible = "ti,da850-ddr-controller";
+               reg = <0xb0000000 0xe8>;
+               status = "disabled";
+       };
+};
index 6489362fc0ca8f446f34bdd9d91e39b2a7f347ac..aa4aa68c9c3d11075d94d25a3502502379f4b00d 100644 (file)
@@ -41,7 +41,7 @@
        bus-num = <0>;
        status = "okay";
 
-       qflash0: n25q512a@0 {
+       qflash0: s25fs512s@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "spi-flash";
@@ -49,7 +49,7 @@
                reg = <0>;
        };
 
-       qflash1: n25q512a@1 {
+       qflash1: s25fs512s@1 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "spi-flash";
index e6f9c9a6ddca7c5dc22422ae97f33d7f7bbd53bd..56c94729bb962f9d7d90e1ed5269a230b7bc81ea 100644 (file)
                        usbhsohci: ohci@48064400 {
                                compatible = "ti,ohci-omap3";
                                reg = <0x48064400 0x400>;
-                               interrupt-parent = <&intc>;
                                interrupts = <76>;
                        };
 
                        usbhsehci: ehci@48064800 {
                                compatible = "ti,ehci-omap";
                                reg = <0x48064800 0x400>;
-                               interrupt-parent = <&intc>;
                                interrupts = <77>;
                        };
                };
                                reg-names = "tx",
                                            "rx";
 
-                               interrupt-parent = <&intc>;
                                interrupts = <67>,
                                             <68>;
                        };
                                reg-names = "tx",
                                            "rx";
 
-                               interrupt-parent = <&intc>;
                                interrupts = <69>,
                                             <70>;
                        };
index 2eeed6f4a0123e1e9e5b5c67a2298dc467d434ca..fdaa69297cc4fba736706b4f20e69e7c880d4029 100644 (file)
        };
 };
 
+&gpio1 {
+       u-boot,dm-spl;
+};
+
 &gpio2 {
        u-boot,dm-spl;
 };
 
+&gpio3 {
+       u-boot,dm-spl;
+};
+
+&gpio4 {
+       u-boot,dm-spl;
+};
+
+&gpio5 {
+       u-boot,dm-spl;
+};
+
+&gpio6 {
+       u-boot,dm-spl;
+};
+
 &gpio7 {
        u-boot,dm-spl;
 };
index 64f1c2d7dac2b854ef870cfbb99676e6a41bea7e..ae0b0a4b8e3fe15ff6b3ac2fbfee5c4e2fc9d0a4 100644 (file)
@@ -40,7 +40,6 @@
 };
 
 &dmc {
-       rockchip,sdram-channel = /bits/ 8 <1 10 3 2 1 0 15 15>;
        rockchip,pctl-timing = <0x96 0xC8 0x1F3 0xF 0x8000004D 0x4 0x4E 0x6 0x3
                0x0 0x6 0x5 0xC 0x10 0x6 0x4 0x4
                0x5 0x4 0x200 0x3 0xA 0x40 0x0 0x1
index dd6ce8b69e634c8fb9709e78d0ee4e5d04e9765d..63785eb55eff07dc0573b5581e9e3fd8d4ae55c8 100644 (file)
        };
 };
 
+&saradc {
+       status = "okay";
+};
+
 &tsadc {
        rockchip,hw-tshut-mode = <0>;
        rockchip,hw-tshut-polarity = <0>;
index 8a14c653e4697d8cd5e28330a1d38bbcf786d02f..3dd9d8196147926290d2e05ac749b12999c26455 100644 (file)
        };
 };
 
+&saradc {
+       status = "okay";
+};
+
 &uart2 {
        status = "okay";
 };
        vbus-supply = <&vcc5v0_host_xhci>;
        status = "okay";
 };
+
+&i2c1 {
+       clock-frequency = <400000>;
+       i2c-scl-rising-time-ns = <168>;
+       i2c-scl-falling-time-ns = <4>;
+       status = "okay";
+
+       rk805: pmic@18 {
+               compatible = "rockchip,rk805";
+               status = "okay";
+               reg = <0x18>;
+               interrupt-parent = <&gpio2>;
+               interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pmic_int_l>;
+               rockchip,system-power-controller;
+               wakeup-source;
+               gpio-controller;
+               #gpio-cells = <2>;
+               #clock-cells = <1>;
+               clock-output-names = "xin32k", "rk805-clkout2";
+
+               regulators {
+                       vdd_logic: DCDC_REG1 {
+                               regulator-name = "vdd_logic";
+                               regulator-min-microvolt = <712500>;
+                               regulator-max-microvolt = <1450000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1000000>;
+                               };
+                       };
+
+                       vdd_arm: DCDC_REG2 {
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <712500>;
+                               regulator-max-microvolt = <1450000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1000000>;
+                               };
+                       };
+
+                       vcc_ddr: DCDC_REG3 {
+                               regulator-name = "vcc_ddr";
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vcc_io: DCDC_REG4 {
+                               regulator-name = "vcc_io";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3300000>;
+                               };
+                       };
+
+                       vdd_18: LDO_REG1 {
+                               regulator-name = "vdd_18";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vcc_18emmc: LDO_REG2 {
+                               regulator-name = "vcc_18emmc";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vdd_10: LDO_REG3 {
+                               regulator-name = "vdd_10";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1000000>;
+                               };
+                       };
+               };
+       };
+};
+
+&pinctrl {
+       pmic {
+               pmic_int_l: pmic-int-l {
+               rockchip,pins =
+                       <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;  /* gpio2_a6 */
+               };
+       };
+};
+
index c7478f7ddb71746599809d017fa9e2c831f0dfe4..e9c5ebad4783ef6dfca8f0e0841182eed96041bf 100644 (file)
        };
 };
 
+&saradc {
+       status = "okay";
+};
+
 &tsadc {
        status = "okay";
        rockchip,hw-tshut-mode = <0>; /* CRU */
index 7c190f745660fd1c03f1ad8ff95916019d15efbf..27befadd67ceb152d03a2849bdd470b9ad0efa14 100644 (file)
        };
 };
 
+&saradc {
+       status = "okay";
+};
+
 &tsadc {
        status = "okay";
        rockchip,hw-tshut-mode = <0>; /* CRU */
index be0c6d98bd39945245552873c8cb8030c12771c0..0e5d8d79a19fa53d4c9c3d3d5a086528332d1a4b 100644 (file)
        status = "okay";
 };
 
+&saradc {
+       status = "okay";
+};
+
 &sdmmc {
        bus-width = <4>;
        status = "okay";
index a04878e223c007c1749e659a70f0be79fa6b281b..65ab3801391b50a238e196248db1eecbf0fbbf8b 100644 (file)
@@ -20,7 +20,8 @@
 
        chosen {
                stdout-path = "serial0:115200n8";
-               u-boot,spl-boot-order = &spiflash, &sdhci, &sdmmc;
+               u-boot,spl-boot-order = \
+                       "same-as-spl", &spiflash, &sdhci, &sdmmc;
        };
 
        aliases {
                regulator-max-microvolt = <3300000>;
        };
 
+       /*
+        * The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module
+        * eMMC and SPI flash powered-down initially (in fact it keeps the
+        * reset signal asserted).  Even though it is an enable signal, we
+        * model this as a regulator.
+        */
+       bios_enable: bios_enable {
+               compatible = "regulator-fixed";
+               u-boot,dm-pre-reloc;
+               regulator-name = "bios_enable";
+               enable-active-low;
+               gpio = <&gpio3 29 GPIO_ACTIVE_HIGH>;
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+
        vccadc_ref: vccadc-ref {
                compatible = "regulator-fixed";
                regulator-name = "vcc1v8_sys";
 };
 
 &pcie_phy {
-               status = "okay";
+               status = "okay";
 };
 
 &pmu_io_domains {
 };
 
 &sdmmc {
-        u-boot,dm-pre-reloc;
+       u-boot,dm-pre-reloc;
        clock-frequency = <150000000>;
        clock-freq-min-max = <100000 150000000>;
        supports-sd;
        status = "okay";
 };
 
+&gpio3 {
+       u-boot,dm-pre-reloc;
+};
+
 &pinctrl {
        /* Pins that are not explicitely used by any devices */
        pinctrl-names = "default";
        pinctrl-0 = <&puma_pin_hog>;
+
        hog {
                puma_pin_hog: puma_pin_hog {
                        rockchip,pins =
        i2c8 {
                i2c8_xfer_a: i2c8-xfer {
                        rockchip,pins = <1 21 RK_FUNC_1 &pcfg_pull_up>,
-                                       <1 20 RK_FUNC_1 &pcfg_pull_up>;
+                                       <1 20 RK_FUNC_1 &pcfg_pull_up>;
                };
        };
 };
 &spi5 {
        status = "okay";
 };
-
index 2b221b6d61eef5b4d739b3e152f41e624b5b2ba0..8e857b2c8913fee306dd2867377cc435388f8b22 100644 (file)
        snps,reset-gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_LOW>;
 };
 
+&saradc {
+       status = "okay";
+};
+
 &sfc {
        status = "okay";
        flash@0 {
index 3153dfe6584a17bf34f308fea3b2c492f1485d57..31b4d93b0763d49b16a82e235c73c252aa736da6 100644 (file)
                reg = <0x10300000 0x1000>;
        };
 
+       saradc: saradc@1038c000 {
+               compatible = "rockchip,rv1108-saradc", "rockchip,rk3399-saradc";
+               reg = <0x1038c000 0x100>;
+               interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+               #io-channel-cells = <1>;
+               clock-frequency = <1000000>;
+               clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>;
+               clock-names = "saradc", "apb_pclk";
+               status = "disabled";
+       };
+
        pmugrf: syscon@20060000 {
                compatible = "rockchip,rv1108-pmugrf", "syscon";
                reg = <0x20060000 0x1000>;
index b02a602378ee81304f0ca2e1f269173ef8b9342f..7520446dc1a5f79c9cc46c744c9dd7844e793715 100644 (file)
                        #size-cells = <1>;
                        u-boot,dm-pre-reloc;
 
+                       hlcdc: hlcdc@f0000000 {
+                               compatible = "atmel,at91sam9x5-hlcdc";
+                               reg = <0xf0000000 0x2000>;
+                               clocks = <&lcdc_clk>;
+                               status = "disabled";
+                       };
+
                        pmc: pmc@f0014000 {
                                compatible = "atmel,sama5d2-pmc", "syscon";
                                reg = <0xf0014000 0x160>;
index be41490f63fb0e7fa78e05ddb22d5d95ecc02301..c17bc9f0dce66ab0c714c45444e99aee69f89326 100644 (file)
@@ -8,6 +8,7 @@
 /dts-v1/;
 #include "sama5d36.dtsi"
 #include "sama5d3xmb_cmp.dtsi"
+#include "sama5d3xdm.dtsi"
 
 / {
        model = "Atmel SAMA5D36-EK";
index 14d7c2bc75ca8a5308b425c81ea7517d3e78219a..10fb3a97ea499f5cf0cbbe017856ac63d852aa26 100644 (file)
        ahb {
                apb {
                        hlcdc: hlcdc@f0030000 {
-                               compatible = "atmel,sama5d3-hlcdc";
+                               compatible = "atmel,at91sam9x5-hlcdc";
                                reg = <0xf0030000 0x2000>;
                                interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>;
                                clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>;
                                clock-names = "periph_clk","sys_clk", "slow_clk";
                                status = "disabled";
-
-                               hlcdc-display-controller {
-                                       compatible = "atmel,hlcdc-display-controller";
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-
-                                       port@0 {
-                                               #address-cells = <1>;
-                                               #size-cells = <0>;
-                                               reg = <0>;
-                                       };
-                               };
-
-                               hlcdc_pwm: hlcdc-pwm {
-                                       compatible = "atmel,hlcdc-pwm";
-                                       pinctrl-names = "default";
-                                       pinctrl-0 = <&pinctrl_lcd_pwm>;
-                                       #pwm-cells = <3>;
-                               };
                        };
 
                        pinctrl@fffff200 {
index 035ab72b39903c474aeb60c80a44ee0f9207d489..b3df9af2b42da3b566d258bc2b91f4578cd773d5 100644 (file)
 / {
        ahb {
                apb {
+                       hlcdc: hlcdc@f0030000 {
+                               atmel,vl-bpix = <4>;
+                               atmel,output-mode = <24>;
+                               atmel,guard-time = <1>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_pwm &pinctrl_lcd_rgb888_alt>;
+                               status = "okay";
+                               u-boot,dm-pre-reloc;
+
+                               display-timings {
+                                       u-boot,dm-pre-reloc;
+                                       800x480 {
+                                               clock-frequency = <24000000>;
+                                               hactive = <800>;
+                                               vactive = <480>;
+                                               hsync-len = <5>;
+                                               hfront-porch = <64>;
+                                               hback-porch = <64>;
+                                               vfront-porch = <22>;
+                                               vback-porch = <21>;
+                                               vsync-len = <5>;
+                                               u-boot,dm-pre-reloc;
+                                       };
+                               };
+                       };
+
                        i2c1: i2c@f0018000 {
                                qt1070: keyboard@1b {
                                        compatible = "qt1070";
index c6512ae437c6062e7be05b5c4e15060a890a5d7b..8072b8a4f23a037169abc32803eb178d9df65815 100644 (file)
                        u-boot,dm-pre-reloc;
 
                        hlcdc: hlcdc@f0000000 {
-                               compatible = "atmel,sama5d4-hlcdc";
+                               compatible = "atmel,at91sam9x5-hlcdc";
                                reg = <0xf0000000 0x4000>;
                                interrupts = <51 IRQ_TYPE_LEVEL_HIGH 0>;
                                clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>;
                                clock-names = "periph_clk","sys_clk", "slow_clk";
                                status = "disabled";
-
-                               hlcdc-display-controller {
-                                       compatible = "atmel,hlcdc-display-controller";
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-
-                                       port@0 {
-                                               #address-cells = <1>;
-                                               #size-cells = <0>;
-                                               reg = <0>;
-                                       };
-                               };
-
-                               hlcdc_pwm: hlcdc-pwm {
-                                       compatible = "atmel,hlcdc-pwm";
-                                       pinctrl-names = "default";
-                                       pinctrl-0 = <&pinctrl_lcd_pwm>;
-                                       #pwm-cells = <3>;
-                               };
                        };
 
                        dma1: dma-controller@f0004000 {
index d3e11d53ab40e438ce58702da47f721a6379ce05..e4f4aa579bd46ce808f6dcd76bff9247ece0dbf7 100644 (file)
                                          slew-rate = <3>;
                                };
                        };
+
+                       sdmmc1_pins: sdmmc@0 {
+                               pins {
+                                       pinmux = <STM32H7_PC8_FUNC_SDMMC1_D0>,
+                                                <STM32H7_PC9_FUNC_SDMMC1_D1>,
+                                                <STM32H7_PC10_FUNC_SDMMC1_D2>,
+                                                <STM32H7_PC11_FUNC_SDMMC1_D3>,
+                                                <STM32H7_PC12_FUNC_SDMMC1_CK>,
+                                                <STM32H7_PD2_FUNC_SDMMC1_CMD>;
+
+                                       slew-rate = <3>;
+                                       drive-push-pull;
+                                       bias-disable;
+                               };
+                       };
+
+                       pinctrl_sdmmc1_level_shifter: sdmmc0_ls@0 {
+                               pins {
+                                       pinmux = <STM32H7_PB8_FUNC_SDMMC1_CKIN>,
+                                                <STM32H7_PB9_FUNC_SDMMC1_CDIR>,
+                                                <STM32H7_PC6_FUNC_SDMMC1_D0DIR>,
+                                                <STM32H7_PC7_FUNC_SDMMC1_D123DIR>;
+                                       drive-push-pull;
+                                       slew-rate = <3>;
+                               };
+                       };
                };
        };
 };
index 16e93089d72666a1075b503366fd4327a53c1bee..d5b8d879ee2ac112705504ac8032b411995aa9d4 100644 (file)
@@ -43,6 +43,7 @@
 #include "skeleton.dtsi"
 #include "armv7-m.dtsi"
 #include <dt-bindings/clock/stm32h7-clks.h>
+#include <dt-bindings/mfd/stm32h7-rcc.h>
 
 / {
        clocks {
@@ -76,7 +77,7 @@
                };
 
                usart1: serial@40011000 {
-                       compatible = "st,stm32h7-usart", "st,stm32h7-uart";
+                       compatible = "st,stm32h7-uart";
                        reg = <0x40011000 0x400>;
                        interrupts = <37>;
                        status = "disabled";
@@ -84,7 +85,7 @@
                };
 
                usart2: serial@40004400 {
-                       compatible = "st,stm32h7-usart", "st,stm32h7-uart";
+                       compatible = "st,stm32h7-uart";
                        reg = <0x40004400 0x400>;
                        interrupts = <38>;
                        status = "disabled";
                        compatible = "fixed-clock";
                        clock-frequency = <4000000>;
                };
+
+               sdmmc1: sdmmc@52007000 {
+                       compatible = "st,stm32-sdmmc2";
+                       reg = <0x52007000 0x1000>;
+                       interrupts = <49>;
+                       clocks = <&rcc SDMMC1_CK>;
+                       resets = <&rcc STM32H7_AHB3_RESET(SDMMC1)>;
+                       st,idma = <1>;
+                       cap-sd-highspeed;
+                       cap-mmc-highspeed;
+                       status = "disabled";
+               };
        };
 };
 
index bef7e90f20683702b6e128727d5e4c40e17d709c..917a859a09f0fc7341c7d0fe4867f044b550c33a 100644 (file)
@@ -60,6 +60,7 @@
 
        aliases {
                serial0 = &usart2;
+               mmc0 = &sdmmc1;
                gpio0 = &gpioa;
                gpio1 = &gpiob;
                gpio2 = &gpioc;
                st,sdram-refcount = <1539>;
        };
 };
+
+&sdmmc1 {
+       status = "okay";
+       pinctrl-0 = <&sdmmc1_pins>;
+       pinctrl-names = "default";
+       bus-width = <4>;
+       cd-gpios = <&gpioi 8 1>;
+};
index 0e01ce51ab3338d1cd7de2798d7e6e6925999be7..28c876be27fc695da51644284f39589131073fd9 100644 (file)
                st,sdram-refcount = <1539>;
        };
 };
+
+&sdmmc1 {
+       status = "okay";
+       pinctrl-0 = <&sdmmc1_pins>,
+                   <&pinctrl_sdmmc1_level_shifter>;
+       pinctrl-names = "default";
+       bus-width = <4>;
+       st,dirpol;
+};
index ba5bca0fe997b755f113c14597588668f04e477d..4c03cc3fd7b36014fa0991138738d6b705ee843f 100644 (file)
        status = "okay";
 };
 
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
 &ehci0 {
        status = "okay";
 };
        status = "okay";
 
        axp209: pmic@34 {
-               compatible = "x-powers,axp209";
                reg = <0x34>;
                interrupt-parent = <&nmi_intc>;
                interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
-               interrupt-controller;
-               #interrupt-cells = <1>;
        };
 };
 
+#include "axp209.dtsi"
+
 &ir0 {
        pinctrl-names = "default";
        pinctrl-0 = <&ir0_rx_pins_a>;
        mmc-pwrseq = <&mmc3_pwrseq>;
        bus-width = <4>;
        non-removable;
-       enable-sdio-wakeup;
+       wakeup-source;
        status = "okay";
 
-       brcmf: bcrmf@1 {
+       brcmf: wifi@1 {
                reg = <1>;
                compatible = "brcm,bcm4329-fmac";
                interrupt-parent = <&pio>;
 
 &mmc3_pins_a {
        /* AP6210 requires pull-up */
-       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       bias-pull-up;
 };
 
 &ohci0 {
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        gmac_power_pin_bpi_m1p: gmac_power_pin@0 {
-               allwinner,pins = "PH23";
-               allwinner,function = "gpio_out";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+               pins = "PH23";
+               function = "gpio_out";
        };
 
        led_pins_bpi_m1p: led_pins@0 {
-               allwinner,pins = "PH24", "PH25";
-               allwinner,function = "gpio_out";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+               pins = "PH24", "PH25";
+               function = "gpio_out";
        };
 
        mmc0_cd_pin_bpi_m1p: mmc0_cd_pin@0 {
-               allwinner,pins = "PH10";
-               allwinner,function = "gpio_in";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+               pins = "PH10";
+               function = "gpio_in";
+               bias-pull-up;
        };
 
        mmc3_pwrseq_pin_bpi_m1p: mmc3_pwrseq_pin@0 {
-               allwinner,pins = "PH22";
-               allwinner,function = "gpio_out";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+               pins = "PH22";
+               function = "gpio_out";
        };
 };
 
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        status = "okay";
 };
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
+&usbphy {
+       usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_power-supply = <&usb_power_supply>;
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       /* VBUS on usb host ports are tied to DC5V and therefore always on */
+       status = "okay";
+};
diff --git a/arch/arm/dts/sun7i-a20-olinuxino-micro-emmc.dts b/arch/arm/dts/sun7i-a20-olinuxino-micro-emmc.dts
new file mode 100644 (file)
index 0000000..d99e7b1
--- /dev/null
@@ -0,0 +1,70 @@
+ /*
+ * Copyright 2017 Olimex Ltd.
+ * Stefan Mavrodiev <stefan@olimex.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.
+ */
+
+#include "sun7i-a20-olinuxino-micro.dts"
+
+/ {
+       model = "Olimex A20-OLinuXino-MICRO-eMMC";
+       compatible = "olimex,a20-olinuxino-micro-emmc", "allwinner,sun7i-a20";
+
+       mmc2_pwrseq: pwrseq {
+               compatible = "mmc-pwrseq-emmc";
+               reset-gpios = <&pio 2 16 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_pins_a>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       non-removable;
+       mmc-pwrseq = <&mmc2_pwrseq>;
+       status = "okay";
+
+       emmc: emmc@0 {
+               reg = <0>;
+               compatible = "mmc-card";
+               broken-hpi;
+       };
+};
index f97c38f097d17c6cb700654521a50c927857c1a2..ea50dda75adceba97c0d9f16ff4f90eab366c3d9 100644 (file)
@@ -46,7 +46,8 @@
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 
-#include <dt-bindings/pinctrl/sun4i-a10.h>
+#include <dt-bindings/clock/sun8i-a23-a33-ccu.h>
+#include <dt-bindings/reset/sun8i-a23-a33-ccu.h>
 
 / {
        interrupt-parent = <&gic>;
@@ -60,7 +61,9 @@
                        compatible = "allwinner,simple-framebuffer",
                                     "simple-framebuffer";
                        allwinner,pipeline = "de_be0-lcd0";
-                       clocks = <&pll6 0>;
+                       clocks = <&ccu CLK_BUS_LCD>, <&ccu CLK_BUS_DE_BE>,
+                                <&ccu CLK_LCD_CH0>, <&ccu CLK_DE_BE>,
+                                <&ccu CLK_DRAM_DE_BE>, <&ccu CLK_DRC>;
                        status = "disabled";
                };
        };
@@ -80,7 +83,7 @@
                #address-cells = <1>;
                #size-cells = <0>;
 
-               cpu@0 {
+               cpu0: cpu@0 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <0>;
                        #clock-cells = <0>;
                        compatible = "fixed-clock";
                        clock-frequency = <24000000>;
+                       clock-accuracy = <50000>;
                        clock-output-names = "osc24M";
                };
 
-               osc32k: osc32k_clk {
+               ext_osc32k: ext_osc32k_clk {
                        #clock-cells = <0>;
                        compatible = "fixed-clock";
                        clock-frequency = <32768>;
-                       clock-output-names = "osc32k";
-               };
-
-               pll1: clk@01c20000 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun8i-a23-pll1-clk";
-                       reg = <0x01c20000 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll1";
-               };
-
-               /* dummy clock until actually implemented */
-               pll5: pll5_clk {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <0>;
-                       clock-output-names = "pll5";
-               };
-
-               pll6: clk@01c20028 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun6i-a31-pll6-clk";
-                       reg = <0x01c20028 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll6", "pll6x2";
-               };
-
-               cpu: cpu_clk@01c20050 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-cpu-clk";
-                       reg = <0x01c20050 0x4>;
-
-                       /*
-                        * PLL1 is listed twice here.
-                        * While it looks suspicious, it's actually documented
-                        * that way both in the datasheet and in the code from
-                        * Allwinner.
-                        */
-                       clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>;
-                       clock-output-names = "cpu";
-               };
-
-               axi: axi_clk@01c20050 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun8i-a23-axi-clk";
-                       reg = <0x01c20050 0x4>;
-                       clocks = <&cpu>;
-                       clock-output-names = "axi";
-               };
-
-               ahb1: ahb1_clk@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun6i-a31-ahb1-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6 0>;
-                       clock-output-names = "ahb1";
-               };
-
-               apb1: apb1_clk@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-apb0-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&ahb1>;
-                       clock-output-names = "apb1";
-               };
-
-               apb1_gates: clk@01c20068 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun8i-a23-apb1-gates-clk";
-                       reg = <0x01c20068 0x4>;
-                       clocks = <&apb1>;
-                       clock-indices = <0>, <5>,
-                                       <12>, <13>;
-                       clock-output-names = "apb1_codec", "apb1_pio",
-                                       "apb1_daudio0", "apb1_daudio1";
-               };
-
-               apb2: clk@01c20058 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-apb1-clk";
-                       reg = <0x01c20058 0x4>;
-                       clocks = <&osc32k>, <&osc24M>, <&pll6 0>, <&pll6 0>;
-                       clock-output-names = "apb2";
-               };
-
-               apb2_gates: clk@01c2006c {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun8i-a23-apb2-gates-clk";
-                       reg = <0x01c2006c 0x4>;
-                       clocks = <&apb2>;
-                       clock-indices = <0>, <1>,
-                                       <2>, <16>,
-                                       <17>, <18>,
-                                       <19>, <20>;
-                       clock-output-names = "apb2_i2c0", "apb2_i2c1",
-                                       "apb2_i2c2", "apb2_uart0",
-                                       "apb2_uart1", "apb2_uart2",
-                                       "apb2_uart3", "apb2_uart4";
-               };
-
-               mmc0_clk: clk@01c20088 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c20088 0x4>;
-                       clocks = <&osc24M>, <&pll6 0>;
-                       clock-output-names = "mmc0",
-                                            "mmc0_output",
-                                            "mmc0_sample";
-               };
-
-               mmc1_clk: clk@01c2008c {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c2008c 0x4>;
-                       clocks = <&osc24M>, <&pll6 0>;
-                       clock-output-names = "mmc1",
-                                            "mmc1_output",
-                                            "mmc1_sample";
-               };
-
-               mmc2_clk: clk@01c20090 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c20090 0x4>;
-                       clocks = <&osc24M>, <&pll6 0>;
-                       clock-output-names = "mmc2",
-                                            "mmc2_output",
-                                            "mmc2_sample";
-               };
-
-               usb_clk: clk@01c200cc {
-                       #clock-cells = <1>;
-                       #reset-cells = <1>;
-                       compatible = "allwinner,sun8i-a23-usb-clk";
-                       reg = <0x01c200cc 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "usb_phy0", "usb_phy1", "usb_hsic",
-                                            "usb_hsic_12M", "usb_ohci0";
+                       clock-accuracy = <50000>;
+                       clock-output-names = "ext-osc32k";
                };
        };
 
                        compatible = "allwinner,sun8i-a23-dma";
                        reg = <0x01c02000 0x1000>;
                        interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ahb1_gates 6>;
-                       resets = <&ahb1_rst 6>;
+                       clocks = <&ccu CLK_BUS_DMA>;
+                       resets = <&ccu RST_BUS_DMA>;
                        #dma-cells = <1>;
                };
 
                mmc0: mmc@01c0f000 {
-                       compatible = "allwinner,sun7i-a20-mmc",
-                                    "allwinner,sun5i-a13-mmc";
+                       compatible = "allwinner,sun7i-a20-mmc";
                        reg = <0x01c0f000 0x1000>;
-                       clocks = <&ahb1_gates 8>,
-                                <&mmc0_clk 0>,
-                                <&mmc0_clk 1>,
-                                <&mmc0_clk 2>;
+                       clocks = <&ccu CLK_BUS_MMC0>,
+                                <&ccu CLK_MMC0>,
+                                <&ccu CLK_MMC0_OUTPUT>,
+                                <&ccu CLK_MMC0_SAMPLE>;
                        clock-names = "ahb",
                                      "mmc",
                                      "output",
                                      "sample";
-                       resets = <&ahb1_rst 8>;
+                       resets = <&ccu RST_BUS_MMC0>;
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
                mmc1: mmc@01c10000 {
-                       compatible = "allwinner,sun7i-a20-mmc",
-                                    "allwinner,sun5i-a13-mmc";
+                       compatible = "allwinner,sun7i-a20-mmc";
                        reg = <0x01c10000 0x1000>;
-                       clocks = <&ahb1_gates 9>,
-                                <&mmc1_clk 0>,
-                                <&mmc1_clk 1>,
-                                <&mmc1_clk 2>;
+                       clocks = <&ccu CLK_BUS_MMC1>,
+                                <&ccu CLK_MMC1>,
+                                <&ccu CLK_MMC1_OUTPUT>,
+                                <&ccu CLK_MMC1_SAMPLE>;
                        clock-names = "ahb",
                                      "mmc",
                                      "output",
                                      "sample";
-                       resets = <&ahb1_rst 9>;
+                       resets = <&ccu RST_BUS_MMC1>;
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
                mmc2: mmc@01c11000 {
-                       compatible = "allwinner,sun7i-a20-mmc",
-                                    "allwinner,sun5i-a13-mmc";
+                       compatible = "allwinner,sun7i-a20-mmc";
                        reg = <0x01c11000 0x1000>;
-                       clocks = <&ahb1_gates 10>,
-                                <&mmc2_clk 0>,
-                                <&mmc2_clk 1>,
-                                <&mmc2_clk 2>;
+                       clocks = <&ccu CLK_BUS_MMC2>,
+                                <&ccu CLK_MMC2>,
+                                <&ccu CLK_MMC2_OUTPUT>,
+                                <&ccu CLK_MMC2_SAMPLE>;
                        clock-names = "ahb",
                                      "mmc",
                                      "output",
                                      "sample";
-                       resets = <&ahb1_rst 10>;
+                       resets = <&ccu RST_BUS_MMC2>;
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                        #size-cells = <0>;
                };
 
+               nfc: nand@01c03000 {
+                       compatible = "allwinner,sun4i-a10-nand";
+                       reg = <0x01c03000 0x1000>;
+                       interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_NAND>, <&ccu CLK_NAND>;
+                       clock-names = "ahb", "mod";
+                       resets = <&ccu RST_BUS_NAND>;
+                       reset-names = "ahb";
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               usb_otg: usb@01c19000 {
+                       /* compatible gets set in SoC specific dtsi file */
+                       reg = <0x01c19000 0x0400>;
+                       clocks = <&ccu CLK_BUS_OTG>;
+                       resets = <&ccu RST_BUS_OTG>;
+                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "mc";
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
+                       extcon = <&usbphy 0>;
+                       status = "disabled";
+               };
+
+               usbphy: phy@01c19400 {
+                       /*
+                        * compatible and address regions get set in
+                        * SoC specific dtsi file
+                        */
+                       clocks = <&ccu CLK_USB_PHY0>,
+                                <&ccu CLK_USB_PHY1>;
+                       clock-names = "usb0_phy",
+                                     "usb1_phy";
+                       resets = <&ccu RST_USB_PHY0>,
+                                <&ccu RST_USB_PHY1>;
+                       reset-names = "usb0_reset",
+                                     "usb1_reset";
+                       status = "disabled";
+                       #phy-cells = <1>;
+               };
+
                ehci0: usb@01c1a000 {
                        compatible = "allwinner,sun8i-a23-ehci", "generic-ehci";
                        reg = <0x01c1a000 0x100>;
                        interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ahb1_gates 26>;
-                       resets = <&ahb1_rst 26>;
+                       clocks = <&ccu CLK_BUS_EHCI>;
+                       resets = <&ccu RST_BUS_EHCI>;
                        phys = <&usbphy 1>;
                        phy-names = "usb";
                        status = "disabled";
                        compatible = "allwinner,sun8i-a23-ohci", "generic-ohci";
                        reg = <0x01c1a400 0x100>;
                        interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ahb1_gates 29>, <&usb_clk 16>;
-                       resets = <&ahb1_rst 29>;
+                       clocks = <&ccu CLK_BUS_OHCI>, <&ccu CLK_USB_OHCI>;
+                       resets = <&ccu RST_BUS_OHCI>;
                        phys = <&usbphy 1>;
                        phy-names = "usb";
                        status = "disabled";
                };
 
+               ccu: clock@01c20000 {
+                       reg = <0x01c20000 0x400>;
+                       clocks = <&osc24M>, <&rtc 0>;
+                       clock-names = "hosc", "losc";
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+               };
+
                pio: pinctrl@01c20800 {
                        /* compatible gets set in SoC specific dtsi file */
                        reg = <0x01c20800 0x400>;
                        /* interrupts get set in SoC specific dtsi file */
-                       clocks = <&apb1_gates 5>;
+                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&rtc 0>;
+                       clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        interrupt-controller;
                        #interrupt-cells = <3>;
                        #gpio-cells = <3>;
 
                        uart0_pins_a: uart0@0 {
-                               allwinner,pins = "PF2", "PF4";
-                               allwinner,function = "uart0";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                               pins = "PF2", "PF4";
+                               function = "uart0";
+                       };
+
+                       uart1_pins_a: uart1@0 {
+                               pins = "PG6", "PG7";
+                               function = "uart1";
+                       };
+
+                       uart1_pins_cts_rts_a: uart1-cts-rts@0 {
+                               pins = "PG8", "PG9";
+                               function = "uart1";
                        };
 
                        mmc0_pins_a: mmc0@0 {
-                               allwinner,pins = "PF0", "PF1", "PF2",
-                                                "PF3", "PF4", "PF5";
-                               allwinner,function = "mmc0";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                               pins = "PF0", "PF1", "PF2",
+                                      "PF3", "PF4", "PF5";
+                               function = "mmc0";
+                               drive-strength = <30>;
+                               bias-pull-up;
                        };
 
                        mmc1_pins_a: mmc1@0 {
-                               allwinner,pins = "PG0", "PG1", "PG2",
-                                                "PG3", "PG4", "PG5";
-                               allwinner,function = "mmc1";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                               pins = "PG0", "PG1", "PG2",
+                                      "PG3", "PG4", "PG5";
+                               function = "mmc1";
+                               drive-strength = <30>;
+                               bias-pull-up;
                        };
 
                        mmc2_8bit_pins: mmc2_8bit {
-                               allwinner,pins = "PC5", "PC6", "PC8",
-                                                "PC9", "PC10", "PC11",
-                                                "PC12", "PC13", "PC14",
-                                                "PC15", "PC16";
-                               allwinner,function = "mmc2";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                               pins = "PC5", "PC6", "PC8",
+                                      "PC9", "PC10", "PC11",
+                                      "PC12", "PC13", "PC14",
+                                      "PC15", "PC16";
+                               function = "mmc2";
+                               drive-strength = <30>;
+                               bias-pull-up;
                        };
 
                        pwm0_pins: pwm0 {
-                               allwinner,pins = "PH0";
-                               allwinner,function = "pwm0";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                               pins = "PH0";
+                               function = "pwm0";
                        };
 
                        i2c0_pins_a: i2c0@0 {
-                               allwinner,pins = "PH2", "PH3";
-                               allwinner,function = "i2c0";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                               pins = "PH2", "PH3";
+                               function = "i2c0";
                        };
 
                        i2c1_pins_a: i2c1@0 {
-                               allwinner,pins = "PH4", "PH5";
-                               allwinner,function = "i2c1";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                               pins = "PH4", "PH5";
+                               function = "i2c1";
                        };
 
                        i2c2_pins_a: i2c2@0 {
-                               allwinner,pins = "PE12", "PE13";
-                               allwinner,function = "i2c2";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                               pins = "PE12", "PE13";
+                               function = "i2c2";
                        };
-               };
-
-               ahb1_rst: reset@01c202c0 {
-                       #reset-cells = <1>;
-                       compatible = "allwinner,sun6i-a31-clock-reset";
-                       reg = <0x01c202c0 0xc>;
-               };
 
-               apb1_rst: reset@01c202d0 {
-                       #reset-cells = <1>;
-                       compatible = "allwinner,sun6i-a31-clock-reset";
-                       reg = <0x01c202d0 0x4>;
-               };
-
-               apb2_rst: reset@01c202d8 {
-                       #reset-cells = <1>;
-                       compatible = "allwinner,sun6i-a31-clock-reset";
-                       reg = <0x01c202d8 0x4>;
+                       lcd_rgb666_pins: lcd-rgb666@0 {
+                               pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7",
+                                      "PD10", "PD11", "PD12", "PD13", "PD14", "PD15",
+                                      "PD18", "PD19", "PD20", "PD21", "PD22", "PD23",
+                                      "PD24", "PD25", "PD26", "PD27";
+                               function = "lcd0";
+                       };
                };
 
                timer@01c20c00 {
                        interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&apb2_gates 16>;
-                       resets = <&apb2_rst 16>;
+                       clocks = <&ccu CLK_BUS_UART0>;
+                       resets = <&ccu RST_BUS_UART0>;
                        dmas = <&dma 6>, <&dma 6>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&apb2_gates 17>;
-                       resets = <&apb2_rst 17>;
+                       clocks = <&ccu CLK_BUS_UART1>;
+                       resets = <&ccu RST_BUS_UART1>;
                        dmas = <&dma 7>, <&dma 7>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&apb2_gates 18>;
-                       resets = <&apb2_rst 18>;
+                       clocks = <&ccu CLK_BUS_UART2>;
+                       resets = <&ccu RST_BUS_UART2>;
                        dmas = <&dma 8>, <&dma 8>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&apb2_gates 19>;
-                       resets = <&apb2_rst 19>;
+                       clocks = <&ccu CLK_BUS_UART3>;
+                       resets = <&ccu RST_BUS_UART3>;
                        dmas = <&dma 9>, <&dma 9>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&apb2_gates 20>;
-                       resets = <&apb2_rst 20>;
+                       clocks = <&ccu CLK_BUS_UART4>;
+                       resets = <&ccu RST_BUS_UART4>;
                        dmas = <&dma 10>, <&dma 10>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        compatible = "allwinner,sun6i-a31-i2c";
                        reg = <0x01c2ac00 0x400>;
                        interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb2_gates 0>;
-                       resets = <&apb2_rst 0>;
+                       clocks = <&ccu CLK_BUS_I2C0>;
+                       resets = <&ccu RST_BUS_I2C0>;
                        status = "disabled";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "allwinner,sun6i-a31-i2c";
                        reg = <0x01c2b000 0x400>;
                        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb2_gates 1>;
-                       resets = <&apb2_rst 1>;
+                       clocks = <&ccu CLK_BUS_I2C1>;
+                       resets = <&ccu RST_BUS_I2C1>;
                        status = "disabled";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "allwinner,sun6i-a31-i2c";
                        reg = <0x01c2b400 0x400>;
                        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb2_gates 2>;
-                       resets = <&apb2_rst 2>;
+                       clocks = <&ccu CLK_BUS_I2C2>;
+                       resets = <&ccu RST_BUS_I2C2>;
                        status = "disabled";
                        #address-cells = <1>;
                        #size-cells = <0>;
                };
 
+               mali: gpu@1c40000 {
+                       compatible = "allwinner,sun8i-a23-mali",
+                                    "allwinner,sun7i-a20-mali", "arm,mali-400";
+                       reg = <0x01c40000 0x10000>;
+                       interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "gp",
+                                         "gpmmu",
+                                         "pp0",
+                                         "ppmmu0",
+                                         "pp1",
+                                         "ppmmu1",
+                                         "pmu";
+                       clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
+                       clock-names = "bus", "core";
+                       resets = <&ccu RST_BUS_GPU>;
+                       #cooling-cells = <2>;
+
+                       assigned-clocks = <&ccu CLK_GPU>;
+                       assigned-clock-rates = <384000000>;
+               };
+
                gic: interrupt-controller@01c81000 {
                        compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
                        reg = <0x01c81000 0x1000>,
-                             <0x01c82000 0x1000>,
+                             <0x01c82000 0x2000>,
                              <0x01c84000 0x2000>,
                              <0x01c86000 0x2000>;
                        interrupt-controller;
                        reg = <0x01f00000 0x54>;
                        interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-output-names = "osc32k";
+                       clocks = <&ext_osc32k>;
+                       #clock-cells = <1>;
                };
 
-               nmi_intc: interrupt-controller@01f00c0c {
-                       compatible = "allwinner,sun6i-a31-sc-nmi";
+               nmi_intc: interrupt-controller@1f00c00 {
+                       compatible = "allwinner,sun6i-a31-r-intc";
                        interrupt-controller;
                        #interrupt-cells = <2>;
-                       reg = <0x01f00c0c 0x38>;
+                       reg = <0x01f00c00 0x400>;
                        interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
                };
 
                                compatible = "allwinner,sun6i-a31-clock-reset";
                                #reset-cells = <1>;
                        };
+
+                       codec_analog: codec-analog {
+                               compatible = "allwinner,sun8i-a23-codec-analog";
+                       };
                };
 
                cpucfg@01f01c00 {
                        compatible = "allwinner,sun8i-a23-r-pinctrl";
                        reg = <0x01f02c00 0x400>;
                        interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb0_gates 0>;
+                       clocks = <&apb0_gates 0>, <&osc24M>, <&rtc 0>;
+                       clock-names = "apb", "hosc", "losc";
                        resets = <&apb0_rst 0>;
                        gpio-controller;
                        interrupt-controller;
                        #gpio-cells = <3>;
 
                        r_rsb_pins: r_rsb {
-                               allwinner,pins = "PL0", "PL1";
-                               allwinner,function = "s_rsb";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+                               pins = "PL0", "PL1";
+                               function = "s_rsb";
+                               drive-strength = <20>;
+                               bias-pull-up;
                        };
 
                        r_uart_pins_a: r_uart@0 {
-                               allwinner,pins = "PL2", "PL3";
-                               allwinner,function = "s_uart";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                               pins = "PL2", "PL3";
+                               function = "s_uart";
                        };
                };
 
index 92e6616979ea42868b3a6bcb77f76ed7ea8083bd..4d1f929780a8df4f831710c74cf6bbd0659c79dc 100644 (file)
                reg = <0x40000000 0x40000000>;
        };
 
-       clocks {
-               ahb1_gates: clk@01c20060 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
-                       reg = <0x01c20060 0x8>;
-                       clocks = <&ahb1>;
-                       clock-indices = <1>, <6>,
-                                       <8>, <9>, <10>,
-                                       <13>, <14>,
-                                       <19>, <20>,
-                                       <21>, <24>, <26>,
-                                       <29>, <32>, <36>,
-                                       <40>, <44>, <46>,
-                                       <52>, <53>,
-                                       <54>, <57>;
-                       clock-output-names = "ahb1_mipidsi", "ahb1_dma",
-                                       "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2",
-                                       "ahb1_nand", "ahb1_sdram",
-                                       "ahb1_hstimer", "ahb1_spi0",
-                                       "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
-                                       "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
-                                       "ahb1_csi", "ahb1_be",  "ahb1_fe",
-                                       "ahb1_gpu", "ahb1_msgbox",
-                                       "ahb1_spinlock", "ahb1_drc";
-               };
-
-               mbus_clk: clk@01c2015c {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun8i-a23-mbus-clk";
-                       reg = <0x01c2015c 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5>;
-                       clock-output-names = "mbus";
-               };
-       };
-
        soc@01c00000 {
-               usb_otg: usb@01c19000 {
-                       compatible = "allwinner,sun6i-a31-musb";
-                       reg = <0x01c19000 0x0400>;
-                       clocks = <&ahb1_gates 24>;
-                       resets = <&ahb1_rst 24>;
-                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
-                       interrupt-names = "mc";
-                       phys = <&usbphy 0>;
-                       phy-names = "usb";
-                       extcon = <&usbphy 0>;
-                       status = "disabled";
-               };
-
-               usbphy: phy@01c19400 {
-                       compatible = "allwinner,sun8i-a23-usb-phy";
-                       reg = <0x01c19400 0x10>,
-                             <0x01c1a800 0x4>;
-                       reg-names = "phy_ctrl",
-                                   "pmu1";
-                       clocks = <&usb_clk 8>,
-                                <&usb_clk 9>;
-                       clock-names = "usb0_phy",
-                                     "usb1_phy";
-                       resets = <&usb_clk 0>,
-                                <&usb_clk 1>;
-                       reset-names = "usb0_reset",
-                                     "usb1_reset";
+               codec: codec@01c22c00 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun8i-a23-codec";
+                       reg = <0x01c22c00 0x400>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
+                       clock-names = "apb", "codec";
+                       resets = <&ccu RST_BUS_CODEC>;
+                       dmas = <&dma 15>, <&dma 15>;
+                       dma-names = "rx", "tx";
+                       allwinner,codec-analog-controls = <&codec_analog>;
                        status = "disabled";
-                       #phy-cells = <1>;
                };
        };
 };
 
+&ccu {
+       compatible = "allwinner,sun8i-a23-ccu";
+};
+
 &pio {
        compatible = "allwinner,sun8i-a23-pinctrl";
        interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
 };
+
+&usb_otg {
+       compatible = "allwinner,sun6i-a31-musb";
+};
+
+&usbphy {
+       compatible = "allwinner,sun8i-a23-usb-phy";
+       reg = <0x01c19400 0x10>, <0x01c1a800 0x4>;
+       reg-names = "phy_ctrl", "pmu1";
+};
index fef6abc0a7038001180f8f5bfa3d5afcfdbd3c10..b1bc88c46c672b757f59f827f1b6aac4ceb91ca4 100644 (file)
        chosen {
                stdout-path = "serial0:115200n8";
        };
+
+       panel {
+               compatible = "netron-dy,e231732";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       panel_input: endpoint@0 {
+                               reg = <0>;
+                               remote-endpoint = <&tcon0_out_panel>;
+                       };
+               };
+       };
+};
+
+&de {
+       status = "okay";
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc3>;
 };
 
 &ehci0 {
        regulator-name = "vcc-rtc";
 };
 
+&tcon0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&lcd_rgb666_pins>;
+       status = "okay";
+};
+
+&tcon0_out {
+       tcon0_out_panel: endpoint@0 {
+               reg = <0>;
+               remote-endpoint = <&panel_input>;
+       };
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_b>;
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "peripheral";
+       status = "okay";
+};
+
 &usbphy {
        status = "okay";
        usb1_vbus-supply = <&reg_vcc5v0>; /* USB1 VBUS is always on */
index 001d8402ca1845bca126adab131d69d439ceab6a..22660919bd08ae8b9c43eff253a9180c16ab0202 100644 (file)
  */
 
 #include "sun8i-a23-a33.dtsi"
+#include <dt-bindings/thermal/thermal.h>
 
 / {
+       cpu0_opp_table: opp_table0 {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-120000000 {
+                       opp-hz = /bits/ 64 <120000000>;
+                       opp-microvolt = <1040000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-240000000 {
+                       opp-hz = /bits/ 64 <240000000>;
+                       opp-microvolt = <1040000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-312000000 {
+                       opp-hz = /bits/ 64 <312000000>;
+                       opp-microvolt = <1040000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-408000000 {
+                       opp-hz = /bits/ 64 <408000000>;
+                       opp-microvolt = <1040000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-480000000 {
+                       opp-hz = /bits/ 64 <480000000>;
+                       opp-microvolt = <1040000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-504000000 {
+                       opp-hz = /bits/ 64 <504000000>;
+                       opp-microvolt = <1040000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-600000000 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <1040000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-648000000 {
+                       opp-hz = /bits/ 64 <648000000>;
+                       opp-microvolt = <1040000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-720000000 {
+                       opp-hz = /bits/ 64 <720000000>;
+                       opp-microvolt = <1100000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-816000000 {
+                       opp-hz = /bits/ 64 <816000000>;
+                       opp-microvolt = <1100000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-912000000 {
+                       opp-hz = /bits/ 64 <912000000>;
+                       opp-microvolt = <1200000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp-1008000000 {
+                       opp-hz = /bits/ 64 <1008000000>;
+                       opp-microvolt = <1200000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+       };
+
        cpus {
+               cpu@0 {
+                       clocks = <&ccu CLK_CPUX>;
+                       clock-names = "cpu";
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       #cooling-cells = <2>;
+               };
+
+               cpu@1 {
+                       operating-points-v2 = <&cpu0_opp_table>;
+               };
+
                cpu@2 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <2>;
+                       operating-points-v2 = <&cpu0_opp_table>;
                };
 
                cpu@3 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <3>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+               };
+       };
+
+       de: display-engine {
+               compatible = "allwinner,sun8i-a33-display-engine";
+               allwinner,pipelines = <&fe0>;
+               status = "disabled";
+       };
+
+       iio-hwmon {
+               compatible = "iio-hwmon";
+               io-channels = <&ths>;
+       };
+
+       mali_opp_table: gpu-opp-table {
+               compatible = "operating-points-v2";
+
+               opp-144000000 {
+                       opp-hz = /bits/ 64 <144000000>;
+               };
+
+               opp-240000000 {
+                       opp-hz = /bits/ 64 <240000000>;
+               };
+
+               opp-384000000 {
+                       opp-hz = /bits/ 64 <384000000>;
                };
        };
 
                reg = <0x40000000 0x80000000>;
        };
 
-       clocks {
-               /* Dummy clock for pll11 (DDR1) until actually implemented */
-               pll11: pll11_clk {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <0>;
-                       clock-output-names = "pll11";
-               };
-
-               ahb1_gates: clk@01c20060 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun8i-a33-ahb1-gates-clk";
-                       reg = <0x01c20060 0x8>;
-                       clocks = <&ahb1>;
-                       clock-indices = <1>, <5>,
-                                       <6>, <8>, <9>,
-                                       <10>, <13>, <14>,
-                                       <19>, <20>,
-                                       <21>, <24>, <26>,
-                                       <29>, <32>, <36>,
-                                       <40>, <44>, <46>,
-                                       <52>, <53>,
-                                       <54>, <57>,
-                                       <58>;
-                       clock-output-names = "ahb1_mipidsi", "ahb1_ss",
-                                       "ahb1_dma","ahb1_mmc0", "ahb1_mmc1",
-                                       "ahb1_mmc2", "ahb1_nand", "ahb1_sdram",
-                                       "ahb1_hstimer", "ahb1_spi0",
-                                       "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
-                                       "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
-                                       "ahb1_csi", "ahb1_be",  "ahb1_fe",
-                                       "ahb1_gpu", "ahb1_msgbox",
-                                       "ahb1_spinlock", "ahb1_drc",
-                                       "ahb1_sat";
-               };
-
-               ss_clk: clk@01c2009c {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c2009c 0x4>;
-                       clocks = <&osc24M>, <&pll6 0>;
-                       clock-output-names = "ss";
-               };
-
-               mbus_clk: clk@01c2015c {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun8i-a23-mbus-clk";
-                       reg = <0x01c2015c 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5>, <&pll11>;
-                       clock-output-names = "mbus";
+       sound: sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "sun8i-a33-audio";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,frame-master = <&link_codec>;
+               simple-audio-card,bitclock-master = <&link_codec>;
+               simple-audio-card,mclk-fs = <512>;
+               simple-audio-card,aux-devs = <&codec_analog>;
+               simple-audio-card,routing =
+                       "Left DAC", "AIF1 Slot 0 Left",
+                       "Right DAC", "AIF1 Slot 0 Right";
+               status = "disabled";
+
+               simple-audio-card,cpu {
+                       sound-dai = <&dai>;
+               };
+
+               link_codec: simple-audio-card,codec {
+                       sound-dai = <&codec>;
                };
        };
 
        soc@01c00000 {
+               tcon0: lcd-controller@01c0c000 {
+                       compatible = "allwinner,sun8i-a33-tcon";
+                       reg = <0x01c0c000 0x1000>;
+                       interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_LCD>,
+                                <&ccu CLK_LCD_CH0>;
+                       clock-names = "ahb",
+                                     "tcon-ch0";
+                       clock-output-names = "tcon-pixel-clock";
+                       resets = <&ccu RST_BUS_LCD>;
+                       reset-names = "lcd";
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               tcon0_in: port@0 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <0>;
+
+                                       tcon0_in_drc0: endpoint@0 {
+                                               reg = <0>;
+                                               remote-endpoint = <&drc0_out_tcon0>;
+                                       };
+                               };
+
+                               tcon0_out: port@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <1>;
+                               };
+                       };
+               };
+
                crypto: crypto-engine@01c15000 {
                        compatible = "allwinner,sun4i-a10-crypto";
                        reg = <0x01c15000 0x1000>;
                        interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ahb1_gates 5>, <&ss_clk>;
+                       clocks = <&ccu CLK_BUS_SS>, <&ccu CLK_SS>;
                        clock-names = "ahb", "mod";
-                       resets = <&ahb1_rst 5>;
+                       resets = <&ccu RST_BUS_SS>;
                        reset-names = "ahb";
                };
 
-               usb_otg: usb@01c19000 {
-                       compatible = "allwinner,sun8i-a33-musb";
-                       reg = <0x01c19000 0x0400>;
-                       clocks = <&ahb1_gates 24>;
-                       resets = <&ahb1_rst 24>;
-                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
-                       interrupt-names = "mc";
-                       phys = <&usbphy 0>;
-                       phy-names = "usb";
-                       extcon = <&usbphy 0>;
+               dai: dai@01c22c00 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun6i-a31-i2s";
+                       reg = <0x01c22c00 0x200>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
+                       clock-names = "apb", "mod";
+                       resets = <&ccu RST_BUS_CODEC>;
+                       dmas = <&dma 15>, <&dma 15>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               codec: codec@01c22e00 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun8i-a33-codec";
+                       reg = <0x01c22e00 0x400>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
+                       clock-names = "bus", "mod";
                        status = "disabled";
                };
 
-               usbphy: phy@01c19400 {
-                       compatible = "allwinner,sun8i-a33-usb-phy";
-                       reg = <0x01c19400 0x14>,
-                             <0x01c1a800 0x4>;
-                       reg-names = "phy_ctrl",
-                                   "pmu1";
-                       clocks = <&usb_clk 8>,
-                                <&usb_clk 9>;
-                       clock-names = "usb0_phy",
-                                     "usb1_phy";
-                       resets = <&usb_clk 0>,
-                                <&usb_clk 1>;
-                       reset-names = "usb0_reset",
-                                     "usb1_reset";
+               ths: ths@01c25000 {
+                       compatible = "allwinner,sun8i-a33-ths";
+                       reg = <0x01c25000 0x100>;
+                       #thermal-sensor-cells = <0>;
+                       #io-channel-cells = <0>;
+               };
+
+               fe0: display-frontend@01e00000 {
+                       compatible = "allwinner,sun8i-a33-display-frontend";
+                       reg = <0x01e00000 0x20000>;
+                       interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_DE_FE>, <&ccu CLK_DE_FE>,
+                                <&ccu CLK_DRAM_DE_FE>;
+                       clock-names = "ahb", "mod",
+                                     "ram";
+                       resets = <&ccu RST_BUS_DE_FE>;
                        status = "disabled";
-                       #phy-cells = <1>;
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               fe0_out: port@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <1>;
+
+                                       fe0_out_be0: endpoint@0 {
+                                               reg = <0>;
+                                               remote-endpoint = <&be0_in_fe0>;
+                                       };
+                               };
+                       };
+               };
+
+               be0: display-backend@01e60000 {
+                       compatible = "allwinner,sun8i-a33-display-backend";
+                       reg = <0x01e60000 0x10000>, <0x01e80000 0x1000>;
+                       reg-names = "be", "sat";
+                       interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_DE_BE>, <&ccu CLK_DE_BE>,
+                                <&ccu CLK_DRAM_DE_BE>, <&ccu CLK_BUS_SAT>;
+                       clock-names = "ahb", "mod",
+                                     "ram", "sat";
+                       resets = <&ccu RST_BUS_DE_BE>, <&ccu RST_BUS_SAT>;
+                       reset-names = "be", "sat";
+                       assigned-clocks = <&ccu CLK_DE_BE>;
+                       assigned-clock-rates = <300000000>;
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               be0_in: port@0 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <0>;
+
+                                       be0_in_fe0: endpoint@0 {
+                                               reg = <0>;
+                                               remote-endpoint = <&fe0_out_be0>;
+                                       };
+                               };
+
+                               be0_out: port@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <1>;
+
+                                       be0_out_drc0: endpoint@0 {
+                                               reg = <0>;
+                                               remote-endpoint = <&drc0_in_be0>;
+                                       };
+                               };
+                       };
+               };
+
+               drc0: drc@01e70000 {
+                       compatible = "allwinner,sun8i-a33-drc";
+                       reg = <0x01e70000 0x10000>;
+                       interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_DRC>, <&ccu CLK_DRC>,
+                                <&ccu CLK_DRAM_DRC>;
+                       clock-names = "ahb", "mod", "ram";
+                       resets = <&ccu RST_BUS_DRC>;
+
+                       assigned-clocks = <&ccu CLK_DRC>;
+                       assigned-clock-rates = <300000000>;
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               drc0_in: port@0 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <0>;
+
+                                       drc0_in_be0: endpoint@0 {
+                                               reg = <0>;
+                                               remote-endpoint = <&be0_out_drc0>;
+                                       };
+                               };
+
+                               drc0_out: port@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <1>;
+
+                                       drc0_out_tcon0: endpoint@0 {
+                                               reg = <0>;
+                                               remote-endpoint = <&tcon0_in_drc0>;
+                                       };
+                               };
+                       };
+               };
+       };
+
+       thermal-zones {
+               cpu_thermal {
+                       /* milliseconds */
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&ths>;
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu_alert0>;
+                                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                               map1 {
+                                       trip = <&cpu_alert1>;
+                                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+
+                               map2 {
+                                       trip = <&gpu_alert0>;
+                                       cooling-device = <&mali 1 THERMAL_NO_LIMIT>;
+                               };
+
+                               map3 {
+                                       trip = <&gpu_alert1>;
+                                       cooling-device = <&mali 2 THERMAL_NO_LIMIT>;
+                               };
+                       };
+
+                       trips {
+                               cpu_alert0: cpu_alert0 {
+                                       /* milliCelsius */
+                                       temperature = <75000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               gpu_alert0: gpu_alert0 {
+                                       /* milliCelsius */
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu_alert1: cpu_alert1 {
+                                       /* milliCelsius */
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "hot";
+                               };
+
+                               gpu_alert1: gpu_alert1 {
+                                       /* milliCelsius */
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "hot";
+                               };
+
+                               cpu_crit: cpu_crit {
+                                       /* milliCelsius */
+                                       temperature = <110000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
                };
        };
 };
 
+&ccu {
+       compatible = "allwinner,sun8i-a33-ccu";
+};
+
+&mali {
+       operating-points-v2 = <&mali_opp_table>;
+};
+
 &pio {
        compatible = "allwinner,sun8i-a33-pinctrl";
        interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
 
        uart0_pins_b: uart0@1 {
-               allwinner,pins = "PB0", "PB1";
-               allwinner,function = "uart0";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+               pins = "PB0", "PB1";
+               function = "uart0";
        };
 
 };
+
+&usb_otg {
+       compatible = "allwinner,sun8i-a33-musb";
+};
+
+&usbphy {
+       compatible = "allwinner,sun8i-a33-usb-phy";
+       reg = <0x01c19400 0x14>, <0x01c1a800 0x4>;
+       reg-names = "phy_ctrl", "pmu1";
+};
diff --git a/arch/arm/dts/sun8i-a83t-bananapi-m3.dts b/arch/arm/dts/sun8i-a83t-bananapi-m3.dts
new file mode 100644 (file)
index 0000000..dfc16a0
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2015 Vishnu Patekar
+ * Vishnu Patekar <vishnupatekar0510@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-a83t.dtsi"
+
+/ {
+       model = "Allwinner A83T BananaPi M3 Board v1.2";
+       compatible = "bananapi,m3v1.2", "allwinner,sun8i-a83t";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_b>;
+       status = "okay";
+};
+
+&usb_otg {
+       status = "okay";
+};
diff --git a/arch/arm/dts/sun8i-a83t-sinovoip-bpi-m3.dts b/arch/arm/dts/sun8i-a83t-sinovoip-bpi-m3.dts
deleted file mode 100644 (file)
index dfc16a0..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2015 Vishnu Patekar
- * Vishnu Patekar <vishnupatekar0510@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-a83t.dtsi"
-
-/ {
-       model = "Allwinner A83T BananaPi M3 Board v1.2";
-       compatible = "bananapi,m3v1.2", "allwinner,sun8i-a83t";
-
-       aliases {
-               serial0 = &uart0;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-};
-
-&ehci0 {
-       status = "okay";
-};
-
-&uart0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&uart0_pins_b>;
-       status = "okay";
-};
-
-&usb_otg {
-       status = "okay";
-};
diff --git a/arch/arm/dts/tps6507x.dtsi b/arch/arm/dts/tps6507x.dtsi
new file mode 100644 (file)
index 0000000..4c326e5
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * Integrated Power Management Chip
+ * http://www.ti.com/lit/ds/symlink/tps65070.pdf
+ */
+
+&tps {
+       compatible = "ti,tps6507x";
+
+       regulators {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               vdcdc1_reg: regulator@0 {
+                       reg = <0>;
+                       regulator-compatible = "VDCDC1";
+               };
+
+               vdcdc2_reg: regulator@1 {
+                       reg = <1>;
+                       regulator-compatible = "VDCDC2";
+               };
+
+               vdcdc3_reg: regulator@2 {
+                       reg = <2>;
+                       regulator-compatible = "VDCDC3";
+               };
+
+               ldo1_reg: regulator@3 {
+                       reg = <3>;
+                       regulator-compatible = "LDO1";
+               };
+
+               ldo2_reg: regulator@4 {
+                       reg = <4>;
+                       regulator-compatible = "LDO2";
+               };
+
+       };
+};
index a0dac86babb7b9b02d62bb11f36d7293667f92fa..4d7992465a44537c44d4a05a7afd214a25ac21ef 100644 (file)
@@ -106,6 +106,7 @@ static struct mm_region early_map[] = {
        { CONFIG_SYS_FSL_QSPI_BASE1, CONFIG_SYS_FSL_QSPI_BASE1,
          CONFIG_SYS_FSL_QSPI_SIZE1,
          PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_NON_SHARE},
+#ifdef CONFIG_FSL_IFC
        /* For IFC Region #1, only the first 4MB is cache-enabled */
        { CONFIG_SYS_FSL_IFC_BASE1, CONFIG_SYS_FSL_IFC_BASE1,
          CONFIG_SYS_FSL_IFC_SIZE1_1,
@@ -120,6 +121,7 @@ static struct mm_region early_map[] = {
          CONFIG_SYS_FSL_IFC_SIZE1,
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | PTE_BLOCK_NON_SHARE
        },
+#endif
        { CONFIG_SYS_FSL_DRAM_BASE1, CONFIG_SYS_FSL_DRAM_BASE1,
          CONFIG_SYS_FSL_DRAM_SIZE1,
 #if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD)
@@ -129,11 +131,13 @@ static struct mm_region early_map[] = {
 #endif
          PTE_BLOCK_OUTER_SHARE | PTE_BLOCK_NS
        },
+#ifdef CONFIG_FSL_IFC
        /* Map IFC region #2 up to CONFIG_SYS_FLASH_BASE for NAND boot */
        { CONFIG_SYS_FSL_IFC_BASE2, CONFIG_SYS_FSL_IFC_BASE2,
          CONFIG_SYS_FLASH_BASE - CONFIG_SYS_FSL_IFC_BASE2,
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | PTE_BLOCK_NON_SHARE
        },
+#endif
        { CONFIG_SYS_FSL_DCSR_BASE, CONFIG_SYS_FSL_DCSR_BASE,
          CONFIG_SYS_FSL_DCSR_SIZE,
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
@@ -163,10 +167,12 @@ static struct mm_region early_map[] = {
          CONFIG_SYS_FSL_QSPI_SIZE,
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | PTE_BLOCK_NON_SHARE
        },
+#ifdef CONFIG_FSL_IFC
        { CONFIG_SYS_FSL_IFC_BASE, CONFIG_SYS_FSL_IFC_BASE,
          CONFIG_SYS_FSL_IFC_SIZE,
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | PTE_BLOCK_NON_SHARE
        },
+#endif
        { CONFIG_SYS_FSL_DRAM_BASE1, CONFIG_SYS_FSL_DRAM_BASE1,
          CONFIG_SYS_FSL_DRAM_SIZE1,
 #if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD)
@@ -211,11 +217,13 @@ static struct mm_region final_map[] = {
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
          PTE_BLOCK_NON_SHARE | PTE_BLOCK_PXN | PTE_BLOCK_UXN
        },
+#ifdef CONFIG_FSL_IFC
        { CONFIG_SYS_FSL_IFC_BASE2, CONFIG_SYS_FSL_IFC_BASE2,
          CONFIG_SYS_FSL_IFC_SIZE2,
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
          PTE_BLOCK_NON_SHARE | PTE_BLOCK_PXN | PTE_BLOCK_UXN
        },
+#endif
        { CONFIG_SYS_FSL_DCSR_BASE, CONFIG_SYS_FSL_DCSR_BASE,
          CONFIG_SYS_FSL_DCSR_SIZE,
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
@@ -310,10 +318,12 @@ static struct mm_region final_map[] = {
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
          PTE_BLOCK_NON_SHARE | PTE_BLOCK_PXN | PTE_BLOCK_UXN
        },
+#ifdef CONFIG_FSL_IFC
        { CONFIG_SYS_FSL_IFC_BASE, CONFIG_SYS_FSL_IFC_BASE,
          CONFIG_SYS_FSL_IFC_SIZE,
          PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | PTE_BLOCK_NON_SHARE
        },
+#endif
        { CONFIG_SYS_FSL_DRAM_BASE1, CONFIG_SYS_FSL_DRAM_BASE1,
          CONFIG_SYS_FSL_DRAM_SIZE1,
          PTE_BLOCK_MEMTYPE(MT_NORMAL) |
index 92eb8783a3ae3818399b54319911c2b28a0a6b33..169cc5e50b0e982be3132cb523ec8ceb4c62e948 100644 (file)
@@ -24,4 +24,22 @@ void back_to_bootrom(void);
  */
 void _back_to_bootrom_s(void);
 
+/**
+ * Boot-device identifiers as used by the BROM
+ */
+enum {
+       BROM_BOOTSOURCE_NAND = 1,
+       BROM_BOOTSOURCE_EMMC = 2,
+       BROM_BOOTSOURCE_SPINOR = 3,
+       BROM_BOOTSOURCE_SPINAND = 4,
+       BROM_BOOTSOURCE_SD = 5,
+       BROM_BOOTSOURCE_USB = 10,
+       BROM_LAST_BOOTSOURCE = BROM_BOOTSOURCE_USB
+};
+
+/**
+ * Locations of the boot-device identifier in SRAM
+ */
+#define RK3399_BROM_BOOTSOURCE_ID_ADDR   0xff8c0010
+
 #endif
index 2b1197fd4665a5686247f8e1d637ccab740b95a8..5f6a5fbe4cbaeb03c13aff46a88e9b2c0884c960 100644 (file)
@@ -89,6 +89,11 @@ enum {
        MCU_CLK_DIV_SHIFT               = 0,
        MCU_CLK_DIV_MASK                = GENMASK(4, 0),
 
+       /* CLKSEL_CON25 */
+       CLK_SARADC_DIV_CON_SHIFT        = 8,
+       CLK_SARADC_DIV_CON_MASK         = GENMASK(15, 8),
+       CLK_SARADC_DIV_CON_WIDTH        = 8,
+
        /* CLKSEL43_CON */
        GMAC_MUX_SEL_EXTCLK             = BIT(8),
 
index 2a1ae692bef47ac6b8ad2ffc0b80ab87f41788da..ad2dc96467543e183685e5dbc29c7cf69ae4ec27 100644 (file)
@@ -90,6 +90,11 @@ enum {
        CORE_CLK_DIV_SHIFT      = 0,
        CORE_CLK_DIV_MASK       = 0x1f << CORE_CLK_DIV_SHIFT,
 
+       /* CLKSEL_CON22 */
+       CLK_SARADC_DIV_CON_SHIFT= 0,
+       CLK_SARADC_DIV_CON_MASK = GENMASK(9, 0),
+       CLK_SARADC_DIV_CON_WIDTH= 10,
+
        /* CLKSEL24_CON */
        MAC_PLL_SEL_SHIFT       = 12,
        MAC_PLL_SEL_MASK        = 1 << MAC_PLL_SEL_SHIFT,
index 7625f249bd964d92d35b5cae5a4ed964d342712e..d995b7db14cfba72f1b09d091a19bad76442cd6d 100644 (file)
@@ -209,10 +209,10 @@ enum {
        GPIO1A3_I2S_LRCKTX,
 
        GPIO1A2_SHIFT           = 4,
-       GPIO1A2_MASK            = 6 << GPIO1A2_SHIFT,
+       GPIO1A2_MASK            = 3 << GPIO1A2_SHIFT,
        GPIO1A2_GPIO            = 0,
        GPIO1A2_I2S_LRCKRX,
-       GPIO1A2_I2S_PWM1_0,
+       GPIO1A2_PWM1_0,
 
        GPIO1A1_SHIFT           = 2,
        GPIO1A1_MASK            = 1 << GPIO1A1_SHIFT,
diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk322x.h b/arch/arm/include/asm/arch-rockchip/sdram_rk322x.h
new file mode 100644 (file)
index 0000000..b40da40
--- /dev/null
@@ -0,0 +1,581 @@
+/*
+ * (C) Copyright 2017 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+#ifndef _ASM_ARCH_SDRAM_RK322X_H
+#define _ASM_ARCH_SDRAM_RK322X_H
+
+#include <common.h>
+
+enum {
+       DDR3            = 3,
+       LPDDR2          = 5,
+       LPDDR3          = 6,
+       UNUSED          = 0xFF,
+};
+
+struct rk322x_sdram_channel {
+       /*
+        * bit width in address, eg:
+        * 8 banks using 3 bit to address,
+        * 2 cs using 1 bit to address.
+        */
+       u8 rank;
+       u8 col;
+       u8 bk;
+       u8 bw;
+       u8 dbw;
+       u8 row_3_4;
+       u8 cs0_row;
+       u8 cs1_row;
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       /*
+        * For of-platdata, which would otherwise convert this into two
+        * byte-swapped integers. With a size of 9 bytes, this struct will
+        * appear in of-platdata as a byte array.
+        *
+        * If OF_PLATDATA enabled, need to add a dummy byte in dts.(i.e 0xff)
+        */
+       u8 dummy;
+#endif
+};
+
+struct rk322x_ddr_pctl {
+       u32 scfg;
+       u32 sctl;
+       u32 stat;
+       u32 intrstat;
+       u32 reserved0[(0x40 - 0x10) / 4];
+       u32 mcmd;
+       u32 powctl;
+       u32 powstat;
+       u32 cmdtstat;
+       u32 cmdtstaten;
+       u32 reserved1[(0x60 - 0x54) / 4];
+       u32 mrrcfg0;
+       u32 mrrstat0;
+       u32 mrrstat1;
+       u32 reserved2[(0x7c - 0x6c) / 4];
+
+       u32 mcfg1;
+       u32 mcfg;
+       u32 ppcfg;
+       u32 mstat;
+       u32 lpddr2zqcfg;
+       u32 reserved3;
+
+       u32 dtupdes;
+       u32 dtuna;
+       u32 dtune;
+       u32 dtuprd0;
+       u32 dtuprd1;
+       u32 dtuprd2;
+       u32 dtuprd3;
+       u32 dtuawdt;
+       u32 reserved4[(0xc0 - 0xb4) / 4];
+
+       u32 togcnt1u;
+       u32 tinit;
+       u32 trsth;
+       u32 togcnt100n;
+       u32 trefi;
+       u32 tmrd;
+       u32 trfc;
+       u32 trp;
+       u32 trtw;
+       u32 tal;
+       u32 tcl;
+       u32 tcwl;
+       u32 tras;
+       u32 trc;
+       u32 trcd;
+       u32 trrd;
+       u32 trtp;
+       u32 twr;
+       u32 twtr;
+       u32 texsr;
+       u32 txp;
+       u32 txpdll;
+       u32 tzqcs;
+       u32 tzqcsi;
+       u32 tdqs;
+       u32 tcksre;
+       u32 tcksrx;
+       u32 tcke;
+       u32 tmod;
+       u32 trstl;
+       u32 tzqcl;
+       u32 tmrr;
+       u32 tckesr;
+       u32 tdpd;
+       u32 tref_mem_ddr3;
+       u32 reserved5[(0x180 - 0x14c) / 4];
+       u32 ecccfg;
+       u32 ecctst;
+       u32 eccclr;
+       u32 ecclog;
+       u32 reserved6[(0x200 - 0x190) / 4];
+       u32 dtuwactl;
+       u32 dturactl;
+       u32 dtucfg;
+       u32 dtuectl;
+       u32 dtuwd0;
+       u32 dtuwd1;
+       u32 dtuwd2;
+       u32 dtuwd3;
+       u32 dtuwdm;
+       u32 dturd0;
+       u32 dturd1;
+       u32 dturd2;
+       u32 dturd3;
+       u32 dtulfsrwd;
+       u32 dtulfsrrd;
+       u32 dtueaf;
+       /* dfi control registers */
+       u32 dfitctrldelay;
+       u32 dfiodtcfg;
+       u32 dfiodtcfg1;
+       u32 dfiodtrankmap;
+       /* dfi write data registers */
+       u32 dfitphywrdata;
+       u32 dfitphywrlat;
+       u32 reserved7[(0x260 - 0x258) / 4];
+       u32 dfitrddataen;
+       u32 dfitphyrdlat;
+       u32 reserved8[(0x270 - 0x268) / 4];
+       u32 dfitphyupdtype0;
+       u32 dfitphyupdtype1;
+       u32 dfitphyupdtype2;
+       u32 dfitphyupdtype3;
+       u32 dfitctrlupdmin;
+       u32 dfitctrlupdmax;
+       u32 dfitctrlupddly;
+       u32 reserved9;
+       u32 dfiupdcfg;
+       u32 dfitrefmski;
+       u32 dfitctrlupdi;
+       u32 reserved10[(0x2ac - 0x29c) / 4];
+       u32 dfitrcfg0;
+       u32 dfitrstat0;
+       u32 dfitrwrlvlen;
+       u32 dfitrrdlvlen;
+       u32 dfitrrdlvlgateen;
+       u32 dfiststat0;
+       u32 dfistcfg0;
+       u32 dfistcfg1;
+       u32 reserved11;
+       u32 dfitdramclken;
+       u32 dfitdramclkdis;
+       u32 dfistcfg2;
+       u32 dfistparclr;
+       u32 dfistparlog;
+       u32 reserved12[(0x2f0 - 0x2e4) / 4];
+
+       u32 dfilpcfg0;
+       u32 reserved13[(0x300 - 0x2f4) / 4];
+       u32 dfitrwrlvlresp0;
+       u32 dfitrwrlvlresp1;
+       u32 dfitrwrlvlresp2;
+       u32 dfitrrdlvlresp0;
+       u32 dfitrrdlvlresp1;
+       u32 dfitrrdlvlresp2;
+       u32 dfitrwrlvldelay0;
+       u32 dfitrwrlvldelay1;
+       u32 dfitrwrlvldelay2;
+       u32 dfitrrdlvldelay0;
+       u32 dfitrrdlvldelay1;
+       u32 dfitrrdlvldelay2;
+       u32 dfitrrdlvlgatedelay0;
+       u32 dfitrrdlvlgatedelay1;
+       u32 dfitrrdlvlgatedelay2;
+       u32 dfitrcmd;
+       u32 reserved14[(0x3f8 - 0x340) / 4];
+       u32 ipvr;
+       u32 iptr;
+};
+check_member(rk322x_ddr_pctl, iptr, 0x03fc);
+
+struct rk322x_ddr_phy {
+       u32 ddrphy_reg[0x100];
+};
+
+struct rk322x_pctl_timing {
+       u32 togcnt1u;
+       u32 tinit;
+       u32 trsth;
+       u32 togcnt100n;
+       u32 trefi;
+       u32 tmrd;
+       u32 trfc;
+       u32 trp;
+       u32 trtw;
+       u32 tal;
+       u32 tcl;
+       u32 tcwl;
+       u32 tras;
+       u32 trc;
+       u32 trcd;
+       u32 trrd;
+       u32 trtp;
+       u32 twr;
+       u32 twtr;
+       u32 texsr;
+       u32 txp;
+       u32 txpdll;
+       u32 tzqcs;
+       u32 tzqcsi;
+       u32 tdqs;
+       u32 tcksre;
+       u32 tcksrx;
+       u32 tcke;
+       u32 tmod;
+       u32 trstl;
+       u32 tzqcl;
+       u32 tmrr;
+       u32 tckesr;
+       u32 tdpd;
+       u32 trefi_mem_ddr3;
+};
+
+struct rk322x_phy_timing {
+       u32 mr[4];
+       u32 mr11;
+       u32 bl;
+       u32 cl_al;
+};
+
+struct rk322x_msch_timings {
+       u32 ddrtiming;
+       u32 ddrmode;
+       u32 readlatency;
+       u32 activate;
+       u32 devtodev;
+};
+
+struct rk322x_service_sys {
+       u32 id_coreid;
+       u32 id_revisionid;
+       u32 ddrconf;
+       u32 ddrtiming;
+       u32 ddrmode;
+       u32 readlatency;
+       u32 activate;
+       u32 devtodev;
+};
+
+struct rk322x_base_params {
+       struct rk322x_msch_timings noc_timing;
+       u32 ddrconfig;
+       u32 ddr_freq;
+       u32 dramtype;
+       /*
+        * unused for rk322x
+        */
+       u32 stride;
+       u32 odt;
+};
+
+/* PCT_DFISTCFG0 */
+#define DFI_INIT_START                 BIT(0)
+#define DFI_DATA_BYTE_DISABLE_EN       BIT(2)
+
+/* PCT_DFISTCFG1 */
+#define DFI_DRAM_CLK_SR_EN             BIT(0)
+#define DFI_DRAM_CLK_DPD_EN            BIT(1)
+
+/* PCT_DFISTCFG2 */
+#define DFI_PARITY_INTR_EN             BIT(0)
+#define DFI_PARITY_EN                  BIT(1)
+
+/* PCT_DFILPCFG0 */
+#define TLP_RESP_TIME_SHIFT            16
+#define LP_SR_EN                       BIT(8)
+#define LP_PD_EN                       BIT(0)
+
+/* PCT_DFITCTRLDELAY */
+#define TCTRL_DELAY_TIME_SHIFT         0
+
+/* PCT_DFITPHYWRDATA */
+#define TPHY_WRDATA_TIME_SHIFT         0
+
+/* PCT_DFITPHYRDLAT */
+#define TPHY_RDLAT_TIME_SHIFT          0
+
+/* PCT_DFITDRAMCLKDIS */
+#define TDRAM_CLK_DIS_TIME_SHIFT       0
+
+/* PCT_DFITDRAMCLKEN */
+#define TDRAM_CLK_EN_TIME_SHIFT                0
+
+/* PCTL_DFIODTCFG */
+#define RANK0_ODT_WRITE_SEL            BIT(3)
+#define RANK1_ODT_WRITE_SEL            BIT(11)
+
+/* PCTL_DFIODTCFG1 */
+#define ODT_LEN_BL8_W_SHIFT            16
+
+/* PUBL_ACDLLCR */
+#define ACDLLCR_DLLDIS                 BIT(31)
+#define ACDLLCR_DLLSRST                        BIT(30)
+
+/* PUBL_DXDLLCR */
+#define DXDLLCR_DLLDIS                 BIT(31)
+#define DXDLLCR_DLLSRST                        BIT(30)
+
+/* PUBL_DLLGCR */
+#define DLLGCR_SBIAS                   BIT(30)
+
+/* PUBL_DXGCR */
+#define DQSRTT                         BIT(9)
+#define DQRTT                          BIT(10)
+
+/* PIR */
+#define PIR_INIT                       BIT(0)
+#define PIR_DLLSRST                    BIT(1)
+#define PIR_DLLLOCK                    BIT(2)
+#define PIR_ZCAL                       BIT(3)
+#define PIR_ITMSRST                    BIT(4)
+#define PIR_DRAMRST                    BIT(5)
+#define PIR_DRAMINIT                   BIT(6)
+#define PIR_QSTRN                      BIT(7)
+#define PIR_RVTRN                      BIT(8)
+#define PIR_ICPC                       BIT(16)
+#define PIR_DLLBYP                     BIT(17)
+#define PIR_CTLDINIT                   BIT(18)
+#define PIR_CLRSR                      BIT(28)
+#define PIR_LOCKBYP                    BIT(29)
+#define PIR_ZCALBYP                    BIT(30)
+#define PIR_INITBYP                    BIT(31)
+
+/* PGCR */
+#define PGCR_DFTLMT_SHIFT              3
+#define PGCR_DFTCMP_SHIFT              2
+#define PGCR_DQSCFG_SHIFT              1
+#define PGCR_ITMDMD_SHIFT              0
+
+/* PGSR */
+#define PGSR_IDONE                     BIT(0)
+#define PGSR_DLDONE                    BIT(1)
+#define PGSR_ZCDONE                    BIT(2)
+#define PGSR_DIDONE                    BIT(3)
+#define PGSR_DTDONE                    BIT(4)
+#define PGSR_DTERR                     BIT(5)
+#define PGSR_DTIERR                    BIT(6)
+#define PGSR_DFTERR                    BIT(7)
+#define PGSR_RVERR                     BIT(8)
+#define PGSR_RVEIRR                    BIT(9)
+
+/* PTR0 */
+#define PRT_ITMSRST_SHIFT              18
+#define PRT_DLLLOCK_SHIFT              6
+#define PRT_DLLSRST_SHIFT              0
+
+/* PTR1 */
+#define PRT_DINIT0_SHIFT               0
+#define PRT_DINIT1_SHIFT               19
+
+/* PTR2 */
+#define PRT_DINIT2_SHIFT               0
+#define PRT_DINIT3_SHIFT               17
+
+/* DCR */
+#define DDRMD_LPDDR                    0
+#define DDRMD_DDR                      1
+#define DDRMD_DDR2                     2
+#define DDRMD_DDR3                     3
+#define DDRMD_LPDDR2_LPDDR3            4
+#define DDRMD_MASK                     7
+#define DDRMD_SHIFT                    0
+#define PDQ_MASK                       7
+#define PDQ_SHIFT                      4
+
+/* DXCCR */
+#define DQSNRES_MASK                   0xf
+#define DQSNRES_SHIFT                  8
+#define DQSRES_MASK                    0xf
+#define DQSRES_SHIFT                   4
+
+/* DTPR */
+#define TDQSCKMAX_SHIFT                        27
+#define TDQSCKMAX_MASK                 7
+#define TDQSCK_SHIFT                   24
+#define TDQSCK_MASK                    7
+
+/* DSGCR */
+#define DQSGX_SHIFT                    5
+#define DQSGX_MASK                     7
+#define DQSGE_SHIFT                    8
+#define DQSGE_MASK                     7
+
+/* SCTL */
+#define INIT_STATE                     0
+#define CFG_STATE                      1
+#define GO_STATE                       2
+#define SLEEP_STATE                    3
+#define WAKEUP_STATE                   4
+
+/* STAT */
+#define LP_TRIG_SHIFT                  4
+#define LP_TRIG_MASK                   7
+#define PCTL_STAT_MASK                 7
+#define INIT_MEM                       0
+#define CONFIG                         1
+#define CONFIG_REQ                     2
+#define ACCESS                         3
+#define ACCESS_REQ                     4
+#define LOW_POWER                      5
+#define LOW_POWER_ENTRY_REQ            6
+#define LOW_POWER_EXIT_REQ             7
+
+/* ZQCR*/
+#define PD_OUTPUT_SHIFT                        0
+#define PU_OUTPUT_SHIFT                        5
+#define PD_ONDIE_SHIFT                 10
+#define PU_ONDIE_SHIFT                 15
+#define ZDEN_SHIFT                     28
+
+/* DDLGCR */
+#define SBIAS_BYPASS                   BIT(23)
+
+/* MCFG */
+#define MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT        24
+#define PD_IDLE_SHIFT                  8
+#define MDDR_EN                                (2 << 22)
+#define LPDDR2_EN                      (3 << 22)
+#define LPDDR3_EN                      (1 << 22)
+#define DDR2_EN                                (0 << 5)
+#define DDR3_EN                                (1 << 5)
+#define LPDDR2_S2                      (0 << 6)
+#define LPDDR2_S4                      (1 << 6)
+#define MDDR_LPDDR2_BL_2               (0 << 20)
+#define MDDR_LPDDR2_BL_4               (1 << 20)
+#define MDDR_LPDDR2_BL_8               (2 << 20)
+#define MDDR_LPDDR2_BL_16              (3 << 20)
+#define DDR2_DDR3_BL_4                 0
+#define DDR2_DDR3_BL_8                 1
+#define TFAW_SHIFT                     18
+#define PD_EXIT_SLOW                   (0 << 17)
+#define PD_EXIT_FAST                   (1 << 17)
+#define PD_TYPE_SHIFT                  16
+#define BURSTLENGTH_SHIFT              20
+
+/* POWCTL */
+#define POWER_UP_START                 BIT(0)
+
+/* POWSTAT */
+#define POWER_UP_DONE                  BIT(0)
+
+/* MCMD */
+enum {
+       DESELECT_CMD                    = 0,
+       PREA_CMD,
+       REF_CMD,
+       MRS_CMD,
+       ZQCS_CMD,
+       ZQCL_CMD,
+       RSTL_CMD,
+       MRR_CMD                         = 8,
+       DPDE_CMD,
+};
+
+#define BANK_ADDR_MASK                 7
+#define BANK_ADDR_SHIFT                        17
+#define CMD_ADDR_MASK                  0x1fff
+#define CMD_ADDR_SHIFT                 4
+
+#define LPDDR23_MA_SHIFT               4
+#define LPDDR23_MA_MASK                        0xff
+#define LPDDR23_OP_SHIFT               12
+#define LPDDR23_OP_MASK                        0xff
+
+#define START_CMD                      (1u << 31)
+
+/* DDRPHY REG */
+enum {
+       /* DDRPHY_REG0 */
+       SOFT_RESET_MASK                         = 3,
+       SOFT_DERESET_ANALOG                     = 1 << 2,
+       SOFT_DERESET_DIGITAL                    = 1 << 3,
+       SOFT_RESET_SHIFT                        = 2,
+
+       /* DDRPHY REG1 */
+       PHY_DDR3                                = 0,
+       PHY_DDR2                                = 1,
+       PHY_LPDDR3                              = 2,
+       PHY_LPDDR2                              = 3,
+
+       PHT_BL_8                                = 1 << 2,
+       PHY_BL_4                                = 0 << 2,
+
+       /* DDRPHY_REG2 */
+       MEMORY_SELECT_DDR3                      = 0 << 0,
+       MEMORY_SELECT_LPDDR3                    = 2 << 0,
+       MEMORY_SELECT_LPDDR2                    = 3 << 0,
+       DQS_SQU_CAL_SEL_CS0_CS1                 = 0 << 4,
+       DQS_SQU_CAL_SEL_CS1                     = 1 << 4,
+       DQS_SQU_CAL_SEL_CS0                     = 2 << 4,
+       DQS_SQU_CAL_NORMAL_MODE                 = 0 << 1,
+       DQS_SQU_CAL_BYPASS_MODE                 = 1 << 1,
+       DQS_SQU_CAL_START                       = 1 << 0,
+       DQS_SQU_NO_CAL                          = 0 << 0,
+};
+
+/* CK pull up/down driver strength control */
+enum {
+       PHY_RON_RTT_DISABLE = 0,
+       PHY_RON_RTT_451OHM = 1,
+       PHY_RON_RTT_225OHM,
+       PHY_RON_RTT_150OHM,
+       PHY_RON_RTT_112OHM,
+       PHY_RON_RTT_90OHM,
+       PHY_RON_RTT_75OHM,
+       PHY_RON_RTT_64OHM = 7,
+
+       PHY_RON_RTT_56OHM = 16,
+       PHY_RON_RTT_50OHM,
+       PHY_RON_RTT_45OHM,
+       PHY_RON_RTT_41OHM,
+       PHY_RON_RTT_37OHM,
+       PHY_RON_RTT_34OHM,
+       PHY_RON_RTT_33OHM,
+       PHY_RON_RTT_30OHM = 23,
+
+       PHY_RON_RTT_28OHM = 24,
+       PHY_RON_RTT_26OHM,
+       PHY_RON_RTT_25OHM,
+       PHY_RON_RTT_23OHM,
+       PHY_RON_RTT_22OHM,
+       PHY_RON_RTT_21OHM,
+       PHY_RON_RTT_20OHM,
+       PHY_RON_RTT_19OHM = 31,
+};
+
+/* DQS squelch DLL delay */
+enum {
+       DQS_DLL_NO_DELAY        = 0,
+       DQS_DLL_22P5_DELAY,
+       DQS_DLL_45_DELAY,
+       DQS_DLL_67P5_DELAY,
+       DQS_DLL_90_DELAY,
+       DQS_DLL_112P5_DELAY,
+       DQS_DLL_135_DELAY,
+       DQS_DLL_157P5_DELAY,
+};
+
+/* GRF_SOC_CON0 */
+#define GRF_DDR_16BIT_EN               (((0x1 << 0) << 16) | (0x1 << 0))
+#define GRF_DDR_32BIT_EN               (((0x1 << 0) << 16) | (0x0 << 0))
+#define GRF_MSCH_NOC_16BIT_EN          (((0x1 << 7) << 16) | (0x1 << 7))
+#define GRF_MSCH_NOC_32BIT_EN          (((0x1 << 7) << 16) | (0x0 << 7))
+
+#define GRF_DDRPHY_BUFFEREN_CORE_EN    (((0x1 << 8) << 16) | (0x0 << 8))
+#define GRF_DDRPHY_BUFFEREN_CORE_DIS   (((0x1 << 8) << 16) | (0x1 << 8))
+
+#define GRF_DDR3_EN                    (((0x1 << 6) << 16) | (0x1 << 6))
+#define GRF_LPDDR2_3_EN                        (((0x1 << 6) << 16) | (0x0 << 6))
+
+#define PHY_DRV_ODT_SET(n)             (((n) << 4) | (n))
+#define DDR3_DLL_RESET                 (1 << 8)
+
+#endif /* _ASM_ARCH_SDRAM_RK322X_H */
index 35423e1ba07eaee7648016090771a4a054476b3f..e428d59336a87aa9aff0fa41e2b133b79f259ab5 100644 (file)
@@ -7,4 +7,27 @@
 #ifndef _ASM_ARCH_SYS_PROTO_H
 #define _ASM_ARCH_SYS_PROTO_H
 
+#ifdef CONFIG_ROCKCHIP_RK3288
+#include <asm/armv7.h>
+
+static void configure_l2ctlr(void)
+{
+       uint32_t l2ctlr;
+
+       l2ctlr = read_l2ctlr();
+       l2ctlr &= 0xfffc0000; /* clear bit0~bit17 */
+
+       /*
+       * Data RAM write latency: 2 cycles
+       * Data RAM read latency: 2 cycles
+       * Data RAM setup latency: 1 cycle
+       * Tag RAM write latency: 1 cycle
+       * Tag RAM read latency: 1 cycle
+       * Tag RAM setup latency: 1 cycle
+       */
+       l2ctlr |= (1 << 3 | 1 << 0);
+       write_l2ctlr(l2ctlr);
+}
+#endif /* CONFIG_ROCKCHIP_RK3288 */
+
 #endif /* _ASM_ARCH_SYS_PROTO_H */
index 9358397da27a70892bec341376bea3018c13e3d2..a70b1797e5d7dcd0b8997ee712d8e87001cb1fa4 100644 (file)
@@ -78,4 +78,6 @@ typedef char boot_file_head_not_multiple_of_32[1 - 2*(sizeof(struct boot_file_he
 
 #define is_boot0_magic(addr)   (memcmp((void *)addr, BOOT0_MAGIC, 8) == 0)
 
+uint32_t sunxi_get_boot_device(void);
+
 #endif
index cef6c985bc8d46c74dd11cdaac712e1b45f7975f..5a9cacb6f4a34af3d50975d442d7257ac9efbd0f 100644 (file)
@@ -19,10 +19,3 @@ void sunxi_usb_phy_power_off(int index);
 int sunxi_usb_phy_vbus_detect(int index);
 int sunxi_usb_phy_id_detect(int index);
 void sunxi_usb_phy_enable_squelch_detect(int index, int enable);
-
-/* Not really phy related, but we have to declare this somewhere ... */
-#if defined(CONFIG_USB_MUSB_HOST) || defined(CONFIG_USB_MUSB_GADGET)
-void sunxi_musb_board_init(void);
-#else
-#define sunxi_musb_board_init()
-#endif
index a20702e612b1b0a9fd31cc5a5eb141e1fa0894b1..efc515eb3348c902844d165f42f12e6c55ce177e 100644 (file)
 #include <asm/io.h>
 #include <asm/barriers.h>
 
+/* read L2 control register (L2CTLR) */
+static inline uint32_t read_l2ctlr(void)
+{
+       uint32_t val = 0;
+
+       asm volatile ("mrc p15, 1, %0, c9, c0, 2" : "=r" (val));
+
+       return val;
+}
+
+/* write L2 control register (L2CTLR) */
+static inline void write_l2ctlr(uint32_t val)
+{
+       /*
+        * Note: L2CTLR can only be written when the L2 memory system
+        * is idle, ie before the MMU is enabled.
+        */
+       asm volatile("mcr p15, 1, %0, c9, c0, 2" : : "r" (val) : "memory");
+       isb();
+}
+
 /*
  * Workaround for ARM errata # 798870
  * Set L2ACTLR[7] to reissue any memory transaction in the L2 that has been
index 5834f5b3dc9ae8a18c4ef9bde183e719fcc627c5..5df74728de13ceab510d4f45305b7ad189bb3065 100644 (file)
@@ -34,35 +34,6 @@ static inline void sync(void)
 {
 }
 
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE    (0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
-
-static inline void *
-map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
-{
-       return (void *)((unsigned long)paddr);
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
-
-static inline phys_addr_t virt_to_phys(void * vaddr)
-{
-       return (phys_addr_t)((unsigned long)vaddr);
-}
-
 /*
  * Generic virtual read/write.  Note that we don't support half-word
  * read/writes.  We define __arch_*[bl] here, and leave __arch_*w
@@ -426,6 +397,7 @@ out:
 #endif /* __mem_isa */
 #endif /* __KERNEL__ */
 
+#include <asm-generic/io.h>
 #include <iotrace.h>
 
 #endif /* __ASM_ARM_IO_H */
index e1916f7705d1c4a8ef830520b084356b83bd08ec..0c8652a675fa98ba399a98cfc7489c992ae33ef4 100644 (file)
@@ -131,6 +131,7 @@ lr  .req    x30
        /* NOTE: MPIDR handling will be erroneous on multi-cluster machines */
        mrs     \xreg1, mpidr_el1
        lsr     \xreg2, \xreg1, #32
+       lsl     \xreg2, \xreg2, #32
        lsl     \xreg1, \xreg1, #40
        lsr     \xreg1, \xreg1, #40
        orr     \xreg1, \xreg1, \xreg2
index 62fad452b2127b0f07c416ab085005246f18c424..9c46c93ca4c5857b9b62d431a7d214ee96754717 100644 (file)
@@ -95,8 +95,7 @@ ENTRY(_main)
  */
        ldr     x0, [x18, #GD_START_ADDR_SP]    /* x0 <- gd->start_addr_sp */
        bic     sp, x0, #0xf    /* 16-byte alignment for ABI compliance */
-       ldr     x18, [x18, #GD_BD]              /* x18 <- gd->bd */
-       sub     x18, x18, #GD_SIZE              /* new GD is below bd */
+       ldr     x18, [x18, #GD_NEW_GD]          /* x18 <- gd->new_gd */
 
        adr     lr, relocation_return
        ldr     x9, [x18, #GD_RELOC_OFF]        /* x9 <- gd->reloc_off */
index c7600537063f86b3297bc8a8a34af6db88e0bdca..fdba004363af38de84ad7d8cd33db556aa6de4d7 100644 (file)
@@ -73,6 +73,6 @@ relocate_done:
        isb     sy
 4:     ldp     x0, x1, [sp, #16]
        bl      __asm_flush_dcache_range
-5:     ldp     x29, x30, [sp],#16
+5:     ldp     x29, x30, [sp],#32
        ret
 ENDPROC(relocate_code)
index 0e71b69a1965b55c445d97f9628a708809f2c7ac..7e85b69679d2b4eb3bdcd005776042300ae5a3fc 100644 (file)
@@ -141,6 +141,7 @@ config TARGET_AT91SAM9X5EK
        select AT91SAM9X5
        select SUPPORT_SPL
        select BOARD_EARLY_INIT_F
+       select BOARD_LATE_INIT
 
 config TARGET_SAMA5D2_PTC
        bool "SAMA5D2 PTC board"
@@ -153,6 +154,7 @@ config TARGET_SAMA5D2_XPLAINED
        select SAMA5D2
        select SUPPORT_SPL
        select BOARD_EARLY_INIT_F
+       select BOARD_LATE_INIT
 
 config TARGET_SAMA5D27_SOM1_EK
        bool "SAMA5D27 SOM1 EK board"
@@ -185,12 +187,14 @@ config TARGET_SAMA5D4_XPLAINED
        select SAMA5D4
        select SUPPORT_SPL
        select BOARD_EARLY_INIT_F
+       select BOARD_LATE_INIT
 
 config TARGET_SAMA5D4EK
        bool "SAMA5D4 Evaluation Kit"
        select SAMA5D4
        select SUPPORT_SPL
        select BOARD_EARLY_INIT_F
+       select BOARD_LATE_INIT
 
 config TARGET_MA5D4EVK
        bool "Aries MA5D4EVK Evaluation Kit"
index 5944f99482607790aa6b40937fbbd9852af94b8c..fb94c969ecc6c4fb5d4873545a20ff4f22faeb4b 100644 (file)
@@ -99,7 +99,7 @@ u32 spl_boot_device(void)
 #ifdef CONFIG_SPL_USB_GADGET_SUPPORT
 int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 {
-       put_unaligned(CONFIG_G_DNL_PRODUCT_NUM + 0xfff, &dev->idProduct);
+       put_unaligned(CONFIG_USB_GADGET_PRODUCT_NUM + 0xfff, &dev->idProduct);
 
        return 0;
 }
index 14457317ce7660c1dfda7ad05b8fb1a6322bd2ca..74a63dd6560b922da6cc98a66df3387f2930536c 100644 (file)
@@ -62,6 +62,11 @@ int mvebu_soc_family(void)
        case SOC_88F6820_ID:
        case SOC_88F6828_ID:
                return MVEBU_SOC_A38X;
+
+       case SOC_98DX3236_ID:
+       case SOC_98DX3336_ID:
+       case SOC_98DX4251_ID:
+               return MVEBU_SOC_MSYS;
        }
 
        return MVEBU_SOC_UNKNOWN;
@@ -107,13 +112,15 @@ static const struct sar_freq_modes sar_freq_tab[] = {
 #elif defined(CONFIG_ARMADA_38X)
 /* SAR frequency values for Armada 38x */
 static const struct sar_freq_modes sar_freq_tab[] = {
-       {  0x0,  0x0,  666, 333, 333 },
-       {  0x2,  0x0,  800, 400, 400 },
-       {  0x4,  0x0, 1066, 533, 533 },
-       {  0x6,  0x0, 1200, 600, 600 },
-       {  0x8,  0x0, 1332, 666, 666 },
-       {  0xc,  0x0, 1600, 800, 800 },
-       { 0xff, 0xff,    0,   0,   0 }  /* 0xff marks end of array */
+       {  0x0,  0x0,  666,  333, 333 },
+       {  0x2,  0x0,  800,  400, 400 },
+       {  0x4,  0x0, 1066,  533, 533 },
+       {  0x6,  0x0, 1200,  600, 600 },
+       {  0x8,  0x0, 1332,  666, 666 },
+       {  0xc,  0x0, 1600,  800, 800 },
+       { 0x10,  0x0, 1866,  933, 933 },
+       { 0x13,  0x0, 2000, 1000, 933 },
+       { 0xff, 0xff,    0,    0,   0 } /* 0xff marks end of array */
 };
 #else
 /* SAR frequency values for Armada XP */
@@ -208,6 +215,15 @@ int print_cpuinfo(void)
        case SOC_88F6828_ID:
                puts("MV88F6828-");
                break;
+       case SOC_98DX3236_ID:
+               puts("98DX3236-");
+               break;
+       case SOC_98DX3336_ID:
+               puts("98DX3336-");
+               break;
+       case SOC_98DX4251_ID:
+               puts("98DX4251-");
+               break;
        default:
                puts("Unknown-");
                break;
index e3f304c36683bb67aceffc0f6bd9474fad195830..e63490561881101905ddbff2bfd798385e7eb7f7 100644 (file)
@@ -179,11 +179,11 @@ static void dram_ecc_scrubbing(void)
        reg_write(REG_SDRAM_CONFIG_ADDR, temp);
 
        for (cs = 0; cs < CONFIG_NR_DRAM_BANKS; cs++) {
-               size = mvebu_sdram_bs(cs) - 1;
+               size = mvebu_sdram_bs(cs);
                if (size == 0)
                        continue;
 
-               total = (u64)size + 1;
+               total = (u64)size;
                total_mem += (u32)(total / (1 << 30));
                start_addr = 0;
                mv_xor_init2(cs);
@@ -194,7 +194,7 @@ static void dram_ecc_scrubbing(void)
                        size -= start_addr;
                }
 
-               mv_xor_mem_init(SCRB_XOR_CHAN, start_addr, size,
+               mv_xor_mem_init(SCRB_XOR_CHAN, start_addr, size - 1,
                                SCRUB_MAGIC, SCRUB_MAGIC);
 
                /* Wait for previous transfer completion */
@@ -216,6 +216,35 @@ static int ecc_enabled(void)
 
        return 0;
 }
+
+/* Return the width of the DRAM bus, or 0 for unknown. */
+static int bus_width(void)
+{
+       int full_width = 0;
+
+       if (reg_read(REG_SDRAM_CONFIG_ADDR) & (1 << REG_SDRAM_CONFIG_WIDTH_OFFS))
+               full_width = 1;
+
+       switch (mvebu_soc_family()) {
+       case MVEBU_SOC_AXP:
+           return full_width ? 64 : 32;
+           break;
+       case MVEBU_SOC_A375:
+       case MVEBU_SOC_A38X:
+       case MVEBU_SOC_MSYS:
+           return full_width ? 32 : 16;
+       default:
+           return 0;
+       }
+}
+
+static int cycle_mode(void)
+{
+       int val = reg_read(REG_DUNIT_CTRL_LOW_ADDR);
+
+       return (val >> REG_DUNIT_CTRL_LOW_2T_OFFS) & REG_DUNIT_CTRL_LOW_2T_MASK;
+}
+
 #else
 static void dram_ecc_scrubbing(void)
 {
@@ -295,10 +324,26 @@ int dram_init_banksize(void)
 void board_add_ram_info(int use_default)
 {
        struct sar_freq_modes sar_freq;
+       int mode;
+       int width;
 
        get_sar_freq(&sar_freq);
        printf(" (%d MHz, ", sar_freq.d_clk);
 
+       width = bus_width();
+       if (width)
+               printf("%d-bit, ", width);
+
+       mode = cycle_mode();
+       /* Mode 0 = Single cycle
+        * Mode 1 = Two cycles   (2T)
+        * Mode 2 = Three cycles (3T)
+        */
+       if (mode == 1)
+               printf("2T, ");
+       if (mode == 2)
+               printf("3T, ");
+
        if (ecc_enabled())
                printf("ECC");
        else
index 2dc9b1dea3032d53819f46df34e10dae6bf6a208..cfd095247055fa381f1cd20cae7a904fc11c9a55 100644 (file)
@@ -76,9 +76,6 @@
  */
 #ifdef CONFIG_CMD_NET
 #define CONFIG_MII             /* expose smi ove miiphy interface */
-#if !defined(CONFIG_ARMADA_375)
-#define CONFIG_MVNETA          /* Enable Marvell Gbe Controller Driver */
-#endif
 #define CONFIG_ENV_OVERWRITE   /* ethaddr can be reprogrammed */
 #define CONFIG_ARP_TIMEOUT     200
 #define CONFIG_NET_RETRY_COUNT 50
index d241eea9568d87ce2acfc80501d7c1ef75963027..b67b77ae0df424266049a5f49dc138d28f13a714 100644 (file)
@@ -65,6 +65,7 @@ enum {
        MVEBU_SOC_AXP,
        MVEBU_SOC_A375,
        MVEBU_SOC_A38X,
+       MVEBU_SOC_MSYS,
        MVEBU_SOC_UNKNOWN,
 };
 
index 0900e4008c12ec3489c0b5357c43ada791cce711..1d302761f090f67ba71d498c619e6ba4471fdf75 100644 (file)
@@ -18,6 +18,9 @@
 #define SOC_88F6810_ID         0x6810
 #define SOC_88F6820_ID         0x6820
 #define SOC_88F6828_ID         0x6828
+#define SOC_98DX3236_ID                0xf410
+#define SOC_98DX3336_ID                0xf400
+#define SOC_98DX4251_ID                0xfc00
 
 /* A375 revisions */
 #define MV_88F67XX_A0_ID       0x3
 #define BOOT_DEV_SEL_MASK      (0x3f << BOOT_DEV_SEL_OFFS)
 
 #define BOOT_FROM_UART         0x28
+#define BOOT_FROM_UART_ALT     0x3f
 #define BOOT_FROM_SPI          0x32
 #define BOOT_FROM_MMC          0x30
 #define BOOT_FROM_MMC_ALT      0x31
index 3cf02a54cea2664423c5e7c669ccb6228756c76d..a72a769f7c740eeb8c4fabf46964c0ba913f2e3d 100644 (file)
@@ -42,6 +42,9 @@ static u32 get_boot_device(void)
                return BOOT_DEVICE_MMC1;
 #endif
        case BOOT_FROM_UART:
+#ifdef BOOT_FROM_UART_ALT
+       case BOOT_FROM_UART_ALT:
+#endif
                return BOOT_DEVICE_UART;
        case BOOT_FROM_SPI:
        default:
index 913a44ad64b4f0ece107a4c88ad17e13cc431504..ae86b69b9c71ff555989132826cac832bdbde95e 100644 (file)
@@ -241,7 +241,7 @@ int arch_misc_init(void)
 #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
        ret = usb_ether_init();
        if (ret) {
-               error("USB ether init failed\n");
+               pr_err("USB ether init failed\n");
                return ret;
        }
 #endif
index 7324d522ee6e06a61a9fc8f8860f4295bfbae9a5..56890a0c545caf215f16cc82c6248f044d5c519c 100644 (file)
@@ -165,9 +165,11 @@ void early_system_init(void)
         * to prevent overwrites.
         */
        save_omap_boot_params();
-       spl_early_init();
 #endif
        do_board_detect();
+#ifdef CONFIG_SPL_BUILD
+       spl_early_init();
+#endif
        vcores_init();
 #ifdef CONFIG_DEBUG_UART_OMAP
        debug_uart_init();
index 11f5f058b9e0c4772da7fd90c06570d16ba070f5..4dbf9a27da8b046a0221dd5d287715e7c305f09d 100644 (file)
@@ -22,6 +22,11 @@ choice
 
 config TARGET_AM3517_EVM
        bool "AM3517 EVM"
+       select DM
+       select DM_SERIAL
+       select DM_GPIO
+       select DM_I2C
+       select DM_MMC
 
 config TARGET_MT_VENTOUX
        bool "TeeJet Mt.Ventoux"
index 52e1785b4aaa73eae184f59c2d6b67f655d61cba..2630e7d316a0d34af2368d928c7ff12e0e6ab282 100644 (file)
@@ -41,6 +41,9 @@
 #define PPA_SERV_HAL_SETUP_EMIF_FW_REGION   (PPA_HAL_SERVICES_START_INDEX + 26)
 #define PPA_SERV_HAL_LOCK_EMIF_FW           (PPA_HAL_SERVICES_START_INDEX + 27)
 
+/* Offset of header size if image is signed as ISW */
+#define HEADER_SIZE_OFFSET     (0x6D)
+
 int tee_loaded = 0;
 
 /* Argument for PPA_SERV_HAL_TEE_LOAD_MASTER */
@@ -125,6 +128,9 @@ int secure_boot_verify_image(void **image, size_t *size)
        }
 
        *size = sig_addr - cert_addr;   /* Subtract out the signature size */
+       /* Subtract header if present */
+       if (strncmp((char *)sig_addr, "CERT_ISW_", 9) == 0)
+               *size = ((u32 *)*image)[HEADER_SIZE_OFFSET];
        cert_size = *size;
 
        /* Check if image load address is 32-bit aligned */
index 0b0bf1837c9cb89ac074356f9c3e081b858a63ff..d4f171b0ee15440a3d19495cabe6086198673532 100644 (file)
@@ -87,15 +87,14 @@ static u32 omap_mmc_get_part_size(const char *part)
 
        dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
        if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) {
-               error("invalid mmc device\n");
+               pr_err("invalid mmc device\n");
                return 0;
        }
 
-       res = part_get_info_by_name(dev_desc, part, &info);
-       if (res < 0) {
-               error("cannot find partition: '%s'\n", part);
+       /* Check only for EFI (GPT) partition table */
+       res = part_get_info_by_name_type(dev_desc, part, &info, PART_TYPE_EFI);
+       if (res < 0)
                return 0;
-       }
 
        /* Calculate size in bytes */
        sz = (info.size * (u64)info.blksz);
@@ -111,13 +110,10 @@ static void omap_set_fastboot_userdata_size(void)
        u32 sz_kb;
 
        sz_kb = omap_mmc_get_part_size("userdata");
-       if (sz_kb == 0) {
-               buf[0] = '\0';
-               printf("Warning: fastboot.userdata_size: unable to calc\n");
-       } else {
-               sprintf(buf, "%u", sz_kb);
-       }
+       if (sz_kb == 0)
+               return; /* probably it's not Android partition table */
 
+       sprintf(buf, "%u", sz_kb);
        env_set("fastboot.userdata_size", buf);
 }
 #else
diff --git a/arch/arm/mach-qemu/Kconfig b/arch/arm/mach-qemu/Kconfig
new file mode 100644 (file)
index 0000000..3500b56
--- /dev/null
@@ -0,0 +1,12 @@
+if ARCH_QEMU
+
+config SYS_VENDOR
+       default "emulation"
+
+config SYS_BOARD
+       default "qemu-arm"
+
+config SYS_CONFIG_NAME
+       default "qemu-arm"
+
+endif
index 79e9704a2c5fa58a7ec2d849ce564cf639bb9cd3..daafc8de6a8a059298bc942d34e102d144ca4ec8 100644 (file)
@@ -12,6 +12,7 @@ obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o save_boot_param.o
 obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o save_boot_param.o
 
 obj-tpl-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-tpl.o
+obj-tpl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-tpl.o
 obj-tpl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-tpl.o
 
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
index d3866bf029a53c993efeaf78416abab659ab07b4..406207ed21ce63f7aa718a12f1c61e36fab8a169 100644 (file)
@@ -151,7 +151,7 @@ void board_init_f(ulong dummy)
         */
        pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU);
        if (IS_ERR(pmu))
-               error("pmu syscon returned %ld\n", PTR_ERR(pmu));
+               pr_err("pmu syscon returned %ld\n", PTR_ERR(pmu));
        SAVE_SP_ADDR = readl(&pmu->sys_reg[2]);
 
        ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
index 622e046dc0a754444aea5441b52a20e33e059162..96859a5b4bc7f37ce263aa724ab9dec553625588 100644 (file)
@@ -26,7 +26,7 @@ int board_late_init(void)
 
        grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
        if (IS_ERR(grf)) {
-               error("grf syscon returned %ld\n", PTR_ERR(grf));
+               pr_err("grf syscon returned %ld\n", PTR_ERR(grf));
        } else {
                /* enable noc remap to mimic legacy loaders */
                rk_clrsetreg(&grf->soc_con0,
index 2dc9511de7f197445b6ff3074fcfd675a388272c..7fa010405b1c96d66a556c3302511c039df3e5f6 100644 (file)
@@ -6,6 +6,5 @@
 
 ifndef CONFIG_TPL_BUILD
 obj-y += clk_rk3188.o
-obj-y += sdram_rk3188.o
 obj-y += syscon_rk3188.o
 endif
diff --git a/arch/arm/mach-rockchip/rk3188/sdram_rk3188.c b/arch/arm/mach-rockchip/rk3188/sdram_rk3188.c
deleted file mode 100644 (file)
index 9d8b225..0000000
+++ /dev/null
@@ -1,953 +0,0 @@
-/*
- * (C) Copyright 2015 Google, Inc
- * Copyright 2014 Rockchip Inc.
- *
- * SPDX-License-Identifier:     GPL-2.0
- *
- * Adapted from the very similar rk3288 ddr init.
- */
-
-#include <common.h>
-#include <clk.h>
-#include <dm.h>
-#include <dt-structs.h>
-#include <errno.h>
-#include <ram.h>
-#include <regmap.h>
-#include <syscon.h>
-#include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3188.h>
-#include <asm/arch/ddr_rk3188.h>
-#include <asm/arch/grf_rk3188.h>
-#include <asm/arch/pmu_rk3188.h>
-#include <asm/arch/sdram.h>
-#include <asm/arch/sdram_common.h>
-#include <linux/err.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-struct chan_info {
-       struct rk3288_ddr_pctl *pctl;
-       struct rk3288_ddr_publ *publ;
-       struct rk3188_msch *msch;
-};
-
-struct dram_info {
-       struct chan_info chan[1];
-       struct ram_info info;
-       struct clk ddr_clk;
-       struct rk3188_cru *cru;
-       struct rk3188_grf *grf;
-       struct rk3188_sgrf *sgrf;
-       struct rk3188_pmu *pmu;
-};
-
-struct rk3188_sdram_params {
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-       struct dtd_rockchip_rk3188_dmc of_plat;
-#endif
-       struct rk3288_sdram_channel ch[2];
-       struct rk3288_sdram_pctl_timing pctl_timing;
-       struct rk3288_sdram_phy_timing phy_timing;
-       struct rk3288_base_params base;
-       int num_channels;
-       struct regmap *map;
-};
-
-const int ddrconf_table[] = {
-       /*
-        * [5:4] row(13+n)
-        * [1:0] col(9+n), assume bw=2
-        * row      col,bw
-        */
-       0,
-       ((2 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
-       ((1 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
-       ((0 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
-       ((2 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
-       ((1 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
-       ((0 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
-       ((1 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
-       ((0 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-};
-
-#define TEST_PATTEN    0x5aa5f00f
-#define DQS_GATE_TRAINING_ERROR_RANK0  (1 << 4)
-#define DQS_GATE_TRAINING_ERROR_RANK1  (2 << 4)
-
-#ifdef CONFIG_SPL_BUILD
-static void copy_to_reg(u32 *dest, const u32 *src, u32 n)
-{
-       int i;
-
-       for (i = 0; i < n / sizeof(u32); i++) {
-               writel(*src, dest);
-               src++;
-               dest++;
-       }
-}
-
-static void ddr_reset(struct rk3188_cru *cru, u32 ch, u32 ctl, u32 phy)
-{
-       u32 phy_ctl_srstn_shift = 13;
-       u32 ctl_psrstn_shift = 11;
-       u32 ctl_srstn_shift = 10;
-       u32 phy_psrstn_shift = 9;
-       u32 phy_srstn_shift = 8;
-
-       rk_clrsetreg(&cru->cru_softrst_con[5],
-                    1 << phy_ctl_srstn_shift | 1 << ctl_psrstn_shift |
-                    1 << ctl_srstn_shift | 1 << phy_psrstn_shift |
-                    1 << phy_srstn_shift,
-                    phy << phy_ctl_srstn_shift | ctl << ctl_psrstn_shift |
-                    ctl << ctl_srstn_shift | phy << phy_psrstn_shift |
-                    phy << phy_srstn_shift);
-}
-
-static void ddr_phy_ctl_reset(struct rk3188_cru *cru, u32 ch, u32 n)
-{
-       u32 phy_ctl_srstn_shift = 13;
-
-       rk_clrsetreg(&cru->cru_softrst_con[5],
-                    1 << phy_ctl_srstn_shift, n << phy_ctl_srstn_shift);
-}
-
-static void phy_pctrl_reset(struct rk3188_cru *cru,
-                           struct rk3288_ddr_publ *publ,
-                           int channel)
-{
-       int i;
-
-       ddr_reset(cru, channel, 1, 1);
-       udelay(1);
-       clrbits_le32(&publ->acdllcr, ACDLLCR_DLLSRST);
-       for (i = 0; i < 4; i++)
-               clrbits_le32(&publ->datx8[i].dxdllcr, DXDLLCR_DLLSRST);
-
-       udelay(10);
-       setbits_le32(&publ->acdllcr, ACDLLCR_DLLSRST);
-       for (i = 0; i < 4; i++)
-               setbits_le32(&publ->datx8[i].dxdllcr, DXDLLCR_DLLSRST);
-
-       udelay(10);
-       ddr_reset(cru, channel, 1, 0);
-       udelay(10);
-       ddr_reset(cru, channel, 0, 0);
-       udelay(10);
-}
-
-static void phy_dll_bypass_set(struct rk3288_ddr_publ *publ,
-       u32 freq)
-{
-       int i;
-
-       if (freq <= 250000000) {
-               if (freq <= 150000000)
-                       clrbits_le32(&publ->dllgcr, SBIAS_BYPASS);
-               else
-                       setbits_le32(&publ->dllgcr, SBIAS_BYPASS);
-               setbits_le32(&publ->acdllcr, ACDLLCR_DLLDIS);
-               for (i = 0; i < 4; i++)
-                       setbits_le32(&publ->datx8[i].dxdllcr,
-                                    DXDLLCR_DLLDIS);
-
-               setbits_le32(&publ->pir, PIR_DLLBYP);
-       } else {
-               clrbits_le32(&publ->dllgcr, SBIAS_BYPASS);
-               clrbits_le32(&publ->acdllcr, ACDLLCR_DLLDIS);
-               for (i = 0; i < 4; i++) {
-                       clrbits_le32(&publ->datx8[i].dxdllcr,
-                                    DXDLLCR_DLLDIS);
-               }
-
-               clrbits_le32(&publ->pir, PIR_DLLBYP);
-       }
-}
-
-static void dfi_cfg(struct rk3288_ddr_pctl *pctl, u32 dramtype)
-{
-       writel(DFI_INIT_START, &pctl->dfistcfg0);
-       writel(DFI_DRAM_CLK_SR_EN | DFI_DRAM_CLK_DPD_EN,
-              &pctl->dfistcfg1);
-       writel(DFI_PARITY_INTR_EN | DFI_PARITY_EN, &pctl->dfistcfg2);
-       writel(7 << TLP_RESP_TIME_SHIFT | LP_SR_EN | LP_PD_EN,
-              &pctl->dfilpcfg0);
-
-       writel(2 << TCTRL_DELAY_TIME_SHIFT, &pctl->dfitctrldelay);
-       writel(1 << TPHY_WRDATA_TIME_SHIFT, &pctl->dfitphywrdata);
-       writel(0xf << TPHY_RDLAT_TIME_SHIFT, &pctl->dfitphyrdlat);
-       writel(2 << TDRAM_CLK_DIS_TIME_SHIFT, &pctl->dfitdramclkdis);
-       writel(2 << TDRAM_CLK_EN_TIME_SHIFT, &pctl->dfitdramclken);
-       writel(1, &pctl->dfitphyupdtype0);
-
-       /* cs0 and cs1 write odt enable */
-       writel((RANK0_ODT_WRITE_SEL | RANK1_ODT_WRITE_SEL),
-              &pctl->dfiodtcfg);
-       /* odt write length */
-       writel(7 << ODT_LEN_BL8_W_SHIFT, &pctl->dfiodtcfg1);
-       /* phyupd and ctrlupd disabled */
-       writel(0, &pctl->dfiupdcfg);
-}
-
-static void ddr_set_enable(struct rk3188_grf *grf, uint channel, bool enable)
-{
-       uint val = 0;
-
-       if (enable)
-               val = 1 << DDR_16BIT_EN_SHIFT;
-
-       rk_clrsetreg(&grf->ddrc_con0, 1 << DDR_16BIT_EN_SHIFT, val);
-}
-
-static void ddr_set_ddr3_mode(struct rk3188_grf *grf, uint channel,
-                             bool ddr3_mode)
-{
-       uint mask, val;
-
-       mask = MSCH4_MAINDDR3_MASK << MSCH4_MAINDDR3_SHIFT;
-       val = ddr3_mode << MSCH4_MAINDDR3_SHIFT;
-       rk_clrsetreg(&grf->soc_con2, mask, val);
-}
-
-static void ddr_rank_2_row15en(struct rk3188_grf *grf, bool enable)
-{
-       uint mask, val;
-
-       mask = RANK_TO_ROW15_EN_MASK << RANK_TO_ROW15_EN_SHIFT;
-       val = enable << RANK_TO_ROW15_EN_SHIFT;
-       rk_clrsetreg(&grf->soc_con2, mask, val);
-}
-
-static void pctl_cfg(int channel, struct rk3288_ddr_pctl *pctl,
-                    struct rk3188_sdram_params *sdram_params,
-                    struct rk3188_grf *grf)
-{
-       copy_to_reg(&pctl->togcnt1u, &sdram_params->pctl_timing.togcnt1u,
-                   sizeof(sdram_params->pctl_timing));
-       switch (sdram_params->base.dramtype) {
-       case DDR3:
-               if (sdram_params->phy_timing.mr[1] & DDR3_DLL_DISABLE) {
-                       writel(sdram_params->pctl_timing.tcl - 3,
-                              &pctl->dfitrddataen);
-               } else {
-                       writel(sdram_params->pctl_timing.tcl - 2,
-                              &pctl->dfitrddataen);
-               }
-               writel(sdram_params->pctl_timing.tcwl - 1,
-                      &pctl->dfitphywrlat);
-               writel(0 << MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT | DDR3_EN |
-                      DDR2_DDR3_BL_8 | (6 - 4) << TFAW_SHIFT | PD_EXIT_SLOW |
-                      1 << PD_TYPE_SHIFT | 0 << PD_IDLE_SHIFT,
-                      &pctl->mcfg);
-               ddr_set_ddr3_mode(grf, channel, true);
-               ddr_set_enable(grf, channel, true);
-               break;
-       }
-
-       setbits_le32(&pctl->scfg, 1);
-}
-
-static void phy_cfg(const struct chan_info *chan, int channel,
-                   struct rk3188_sdram_params *sdram_params)
-{
-       struct rk3288_ddr_publ *publ = chan->publ;
-       struct rk3188_msch *msch = chan->msch;
-       uint ddr_freq_mhz = sdram_params->base.ddr_freq / 1000000;
-       u32 dinit2;
-       int i;
-
-       dinit2 = DIV_ROUND_UP(ddr_freq_mhz * 200000, 1000);
-       /* DDR PHY Timing */
-       copy_to_reg(&publ->dtpr[0], &sdram_params->phy_timing.dtpr0,
-                   sizeof(sdram_params->phy_timing));
-       writel(sdram_params->base.noc_timing, &msch->ddrtiming);
-       writel(0x3f, &msch->readlatency);
-       writel(DIV_ROUND_UP(ddr_freq_mhz * 5120, 1000) << PRT_DLLLOCK_SHIFT |
-              DIV_ROUND_UP(ddr_freq_mhz * 50, 1000) << PRT_DLLSRST_SHIFT |
-              8 << PRT_ITMSRST_SHIFT, &publ->ptr[0]);
-       writel(DIV_ROUND_UP(ddr_freq_mhz * 500000, 1000) << PRT_DINIT0_SHIFT |
-              DIV_ROUND_UP(ddr_freq_mhz * 400, 1000) << PRT_DINIT1_SHIFT,
-              &publ->ptr[1]);
-       writel(min(dinit2, 0x1ffffU) << PRT_DINIT2_SHIFT |
-              DIV_ROUND_UP(ddr_freq_mhz * 1000, 1000) << PRT_DINIT3_SHIFT,
-              &publ->ptr[2]);
-
-       switch (sdram_params->base.dramtype) {
-       case DDR3:
-               clrbits_le32(&publ->pgcr, 0x1f);
-               clrsetbits_le32(&publ->dcr, DDRMD_MASK << DDRMD_SHIFT,
-                               DDRMD_DDR3 << DDRMD_SHIFT);
-               break;
-       }
-       if (sdram_params->base.odt) {
-               /*dynamic RTT enable */
-               for (i = 0; i < 4; i++)
-                       setbits_le32(&publ->datx8[i].dxgcr, DQSRTT | DQRTT);
-       } else {
-               /*dynamic RTT disable */
-               for (i = 0; i < 4; i++)
-                       clrbits_le32(&publ->datx8[i].dxgcr, DQSRTT | DQRTT);
-       }
-}
-
-static void phy_init(struct rk3288_ddr_publ *publ)
-{
-       setbits_le32(&publ->pir, PIR_INIT | PIR_DLLSRST
-               | PIR_DLLLOCK | PIR_ZCAL | PIR_ITMSRST | PIR_CLRSR);
-       udelay(1);
-       while ((readl(&publ->pgsr) &
-               (PGSR_IDONE | PGSR_DLDONE | PGSR_ZCDONE)) !=
-               (PGSR_IDONE | PGSR_DLDONE | PGSR_ZCDONE))
-               ;
-}
-
-static void send_command(struct rk3288_ddr_pctl *pctl, u32 rank,
-                        u32 cmd, u32 arg)
-{
-       writel((START_CMD | (rank << 20) | arg | cmd), &pctl->mcmd);
-       udelay(1);
-       while (readl(&pctl->mcmd) & START_CMD)
-               ;
-}
-
-static inline void send_command_op(struct rk3288_ddr_pctl *pctl,
-                                  u32 rank, u32 cmd, u32 ma, u32 op)
-{
-       send_command(pctl, rank, cmd, (ma & LPDDR2_MA_MASK) << LPDDR2_MA_SHIFT |
-                    (op & LPDDR2_OP_MASK) << LPDDR2_OP_SHIFT);
-}
-
-static void memory_init(struct rk3288_ddr_publ *publ,
-                       u32 dramtype)
-{
-       setbits_le32(&publ->pir,
-                    (PIR_INIT | PIR_DRAMINIT | PIR_LOCKBYP
-                     | PIR_ZCALBYP | PIR_CLRSR | PIR_ICPC
-                     | (dramtype == DDR3 ? PIR_DRAMRST : 0)));
-       udelay(1);
-       while ((readl(&publ->pgsr) & (PGSR_IDONE | PGSR_DLDONE))
-               != (PGSR_IDONE | PGSR_DLDONE))
-               ;
-}
-
-static void move_to_config_state(struct rk3288_ddr_publ *publ,
-                                struct rk3288_ddr_pctl *pctl)
-{
-       unsigned int state;
-
-       while (1) {
-               state = readl(&pctl->stat) & PCTL_STAT_MSK;
-
-               switch (state) {
-               case LOW_POWER:
-                       writel(WAKEUP_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK)
-                               != ACCESS)
-                               ;
-                       /* wait DLL lock */
-                       while ((readl(&publ->pgsr) & PGSR_DLDONE)
-                               != PGSR_DLDONE)
-                               ;
-                       /*
-                        * if at low power state,need wakeup first,
-                        * and then enter the config, so
-                        * fallthrough
-                        */
-               case ACCESS:
-                       /* fallthrough */
-               case INIT_MEM:
-                       writel(CFG_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != CONFIG)
-                               ;
-                       break;
-               case CONFIG:
-                       return;
-               default:
-                       break;
-               }
-       }
-}
-
-static void set_bandwidth_ratio(const struct chan_info *chan, int channel,
-                               u32 n, struct rk3188_grf *grf)
-{
-       struct rk3288_ddr_pctl *pctl = chan->pctl;
-       struct rk3288_ddr_publ *publ = chan->publ;
-       struct rk3188_msch *msch = chan->msch;
-
-       if (n == 1) {
-               setbits_le32(&pctl->ppcfg, 1);
-               ddr_set_enable(grf, channel, 1);
-               setbits_le32(&msch->ddrtiming, 1 << 31);
-               /* Data Byte disable*/
-               clrbits_le32(&publ->datx8[2].dxgcr, 1);
-               clrbits_le32(&publ->datx8[3].dxgcr, 1);
-               /* disable DLL */
-               setbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLDIS);
-               setbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLDIS);
-       } else {
-               clrbits_le32(&pctl->ppcfg, 1);
-               ddr_set_enable(grf, channel, 0);
-               clrbits_le32(&msch->ddrtiming, 1 << 31);
-               /* Data Byte enable*/
-               setbits_le32(&publ->datx8[2].dxgcr, 1);
-               setbits_le32(&publ->datx8[3].dxgcr, 1);
-
-               /* enable DLL */
-               clrbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLDIS);
-               clrbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLDIS);
-               /* reset DLL */
-               clrbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLSRST);
-               clrbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLSRST);
-               udelay(10);
-               setbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLSRST);
-               setbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLSRST);
-       }
-       setbits_le32(&pctl->dfistcfg0, 1 << 2);
-}
-
-static int data_training(const struct chan_info *chan, int channel,
-                        struct rk3188_sdram_params *sdram_params)
-{
-       unsigned int j;
-       int ret = 0;
-       u32 rank;
-       int i;
-       u32 step[2] = { PIR_QSTRN, PIR_RVTRN };
-       struct rk3288_ddr_publ *publ = chan->publ;
-       struct rk3288_ddr_pctl *pctl = chan->pctl;
-
-       /* disable auto refresh */
-       writel(0, &pctl->trefi);
-
-       if (sdram_params->base.dramtype != LPDDR3)
-               setbits_le32(&publ->pgcr, 1 << PGCR_DQSCFG_SHIFT);
-       rank = sdram_params->ch[channel].rank | 1;
-       for (j = 0; j < ARRAY_SIZE(step); j++) {
-               /*
-                * trigger QSTRN and RVTRN
-                * clear DTDONE status
-                */
-               setbits_le32(&publ->pir, PIR_CLRSR);
-
-               /* trigger DTT */
-               setbits_le32(&publ->pir,
-                            PIR_INIT | step[j] | PIR_LOCKBYP | PIR_ZCALBYP |
-                            PIR_CLRSR);
-               udelay(1);
-               /* wait echo byte DTDONE */
-               while ((readl(&publ->datx8[0].dxgsr[0]) & rank)
-                       != rank)
-                       ;
-               while ((readl(&publ->datx8[1].dxgsr[0]) & rank)
-                       != rank)
-                       ;
-               if (!(readl(&pctl->ppcfg) & 1)) {
-                       while ((readl(&publ->datx8[2].dxgsr[0])
-                               & rank) != rank)
-                               ;
-                       while ((readl(&publ->datx8[3].dxgsr[0])
-                               & rank) != rank)
-                               ;
-               }
-               if (readl(&publ->pgsr) &
-                   (PGSR_DTERR | PGSR_RVERR | PGSR_RVEIRR)) {
-                       ret = -1;
-                       break;
-               }
-       }
-       /* send some auto refresh to complement the lost while DTT */
-       for (i = 0; i < (rank > 1 ? 8 : 4); i++)
-               send_command(pctl, rank, REF_CMD, 0);
-
-       if (sdram_params->base.dramtype != LPDDR3)
-               clrbits_le32(&publ->pgcr, 1 << PGCR_DQSCFG_SHIFT);
-
-       /* resume auto refresh */
-       writel(sdram_params->pctl_timing.trefi, &pctl->trefi);
-
-       return ret;
-}
-
-static void move_to_access_state(const struct chan_info *chan)
-{
-       struct rk3288_ddr_publ *publ = chan->publ;
-       struct rk3288_ddr_pctl *pctl = chan->pctl;
-       unsigned int state;
-
-       while (1) {
-               state = readl(&pctl->stat) & PCTL_STAT_MSK;
-
-               switch (state) {
-               case LOW_POWER:
-                       if (((readl(&pctl->stat) >> LP_TRIG_SHIFT) &
-                                       LP_TRIG_MASK) == 1)
-                               return;
-
-                       writel(WAKEUP_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != ACCESS)
-                               ;
-                       /* wait DLL lock */
-                       while ((readl(&publ->pgsr) & PGSR_DLDONE)
-                               != PGSR_DLDONE)
-                               ;
-                       break;
-               case INIT_MEM:
-                       writel(CFG_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != CONFIG)
-                               ;
-                       /* fallthrough */
-               case CONFIG:
-                       writel(GO_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) == CONFIG)
-                               ;
-                       break;
-               case ACCESS:
-                       return;
-               default:
-                       break;
-               }
-       }
-}
-
-static void dram_cfg_rbc(const struct chan_info *chan, u32 chnum,
-                        struct rk3188_sdram_params *sdram_params)
-{
-       struct rk3288_ddr_publ *publ = chan->publ;
-
-       if (sdram_params->ch[chnum].bk == 3)
-               clrsetbits_le32(&publ->dcr, PDQ_MASK << PDQ_SHIFT,
-                               1 << PDQ_SHIFT);
-       else
-               clrbits_le32(&publ->dcr, PDQ_MASK << PDQ_SHIFT);
-
-       writel(sdram_params->base.ddrconfig, &chan->msch->ddrconf);
-}
-
-static void dram_all_config(const struct dram_info *dram,
-                           struct rk3188_sdram_params *sdram_params)
-{
-       unsigned int chan;
-       u32 sys_reg = 0;
-
-       sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT;
-       sys_reg |= (sdram_params->num_channels - 1) << SYS_REG_NUM_CH_SHIFT;
-       for (chan = 0; chan < sdram_params->num_channels; chan++) {
-               const struct rk3288_sdram_channel *info =
-                       &sdram_params->ch[chan];
-
-               sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(chan);
-               sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(chan);
-               sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(chan);
-               sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(chan);
-               sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(chan);
-               sys_reg |= (info->cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(chan);
-               sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(chan);
-               sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(chan);
-               sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(chan);
-
-               dram_cfg_rbc(&dram->chan[chan], chan, sdram_params);
-       }
-       if (sdram_params->ch[0].rank == 2)
-               ddr_rank_2_row15en(dram->grf, 0);
-       else
-               ddr_rank_2_row15en(dram->grf, 1);
-
-       writel(sys_reg, &dram->pmu->sys_reg[2]);
-}
-
-static int sdram_rank_bw_detect(struct dram_info *dram, int channel,
-               struct rk3188_sdram_params *sdram_params)
-{
-       int reg;
-       int need_trainig = 0;
-       const struct chan_info *chan = &dram->chan[channel];
-       struct rk3288_ddr_publ *publ = chan->publ;
-
-       ddr_rank_2_row15en(dram->grf, 0);
-
-       if (data_training(chan, channel, sdram_params) < 0) {
-               printf("first data training fail!\n");
-               reg = readl(&publ->datx8[0].dxgsr[0]);
-               /* Check the result for rank 0 */
-               if ((channel == 0) && (reg & DQS_GATE_TRAINING_ERROR_RANK0)) {
-                       printf("data training fail!\n");
-                       return -EIO;
-               }
-
-               /* Check the result for rank 1 */
-               if (reg & DQS_GATE_TRAINING_ERROR_RANK1) {
-                       sdram_params->ch[channel].rank = 1;
-                       clrsetbits_le32(&publ->pgcr, 0xF << 18,
-                                       sdram_params->ch[channel].rank << 18);
-                       need_trainig = 1;
-               }
-               reg = readl(&publ->datx8[2].dxgsr[0]);
-               if (reg & (1 << 4)) {
-                       sdram_params->ch[channel].bw = 1;
-                       set_bandwidth_ratio(chan, channel,
-                                           sdram_params->ch[channel].bw,
-                                           dram->grf);
-                       need_trainig = 1;
-               }
-       }
-       /* Assume the Die bit width are the same with the chip bit width */
-       sdram_params->ch[channel].dbw = sdram_params->ch[channel].bw;
-
-       if (need_trainig &&
-           (data_training(chan, channel, sdram_params) < 0)) {
-               if (sdram_params->base.dramtype == LPDDR3) {
-                       ddr_phy_ctl_reset(dram->cru, channel, 1);
-                       udelay(10);
-                       ddr_phy_ctl_reset(dram->cru, channel, 0);
-                       udelay(10);
-               }
-               printf("2nd data training failed!");
-               return -EIO;
-       }
-
-       return 0;
-}
-
-/*
- * Detect ram columns and rows.
- * @dram: dram info struct
- * @channel: channel number to handle
- * @sdram_params: sdram parameters, function will fill in col and row values
- *
- * Returns 0 or negative on error.
- */
-static int sdram_col_row_detect(struct dram_info *dram, int channel,
-               struct rk3188_sdram_params *sdram_params)
-{
-       int row, col;
-       unsigned int addr;
-       const struct chan_info *chan = &dram->chan[channel];
-       struct rk3288_ddr_pctl *pctl = chan->pctl;
-       struct rk3288_ddr_publ *publ = chan->publ;
-       int ret = 0;
-
-       /* Detect col */
-       for (col = 11; col >= 9; col--) {
-               writel(0, CONFIG_SYS_SDRAM_BASE);
-               addr = CONFIG_SYS_SDRAM_BASE +
-                       (1 << (col + sdram_params->ch[channel].bw - 1));
-               writel(TEST_PATTEN, addr);
-               if ((readl(addr) == TEST_PATTEN) &&
-                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
-                       break;
-       }
-       if (col == 8) {
-               printf("Col detect error\n");
-               ret = -EINVAL;
-               goto out;
-       } else {
-               sdram_params->ch[channel].col = col;
-       }
-
-       ddr_rank_2_row15en(dram->grf, 1);
-       move_to_config_state(publ, pctl);
-       writel(1, &chan->msch->ddrconf);
-       move_to_access_state(chan);
-       /* Detect row, max 15,min13 in rk3188*/
-       for (row = 16; row >= 13; row--) {
-               writel(0, CONFIG_SYS_SDRAM_BASE);
-               addr = CONFIG_SYS_SDRAM_BASE + (1 << (row + 15 - 1));
-               writel(TEST_PATTEN, addr);
-               if ((readl(addr) == TEST_PATTEN) &&
-                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
-                       break;
-       }
-       if (row == 12) {
-               printf("Row detect error\n");
-               ret = -EINVAL;
-       } else {
-               sdram_params->ch[channel].cs1_row = row;
-               sdram_params->ch[channel].row_3_4 = 0;
-               debug("chn %d col %d, row %d\n", channel, col, row);
-               sdram_params->ch[channel].cs0_row = row;
-       }
-
-out:
-       return ret;
-}
-
-static int sdram_get_niu_config(struct rk3188_sdram_params *sdram_params)
-{
-       int i, tmp, size, ret = 0;
-
-       tmp = sdram_params->ch[0].col - 9;
-       tmp -= (sdram_params->ch[0].bw == 2) ? 0 : 1;
-       tmp |= ((sdram_params->ch[0].cs0_row - 13) << 4);
-       size = sizeof(ddrconf_table)/sizeof(ddrconf_table[0]);
-       for (i = 0; i < size; i++)
-               if (tmp == ddrconf_table[i])
-                       break;
-       if (i >= size) {
-               printf("niu config not found\n");
-               ret = -EINVAL;
-       } else {
-               debug("niu config %d\n", i);
-               sdram_params->base.ddrconfig = i;
-       }
-
-       return ret;
-}
-
-static int sdram_init(struct dram_info *dram,
-                     struct rk3188_sdram_params *sdram_params)
-{
-       int channel;
-       int zqcr;
-       int ret;
-
-       if ((sdram_params->base.dramtype == DDR3 &&
-            sdram_params->base.ddr_freq > 800000000)) {
-               printf("SDRAM frequency is too high!");
-               return -E2BIG;
-       }
-
-       ret = clk_set_rate(&dram->ddr_clk, sdram_params->base.ddr_freq);
-       if (ret) {
-               printf("Could not set DDR clock\n");
-               return ret;
-       }
-
-       for (channel = 0; channel < 1; channel++) {
-               const struct chan_info *chan = &dram->chan[channel];
-               struct rk3288_ddr_pctl *pctl = chan->pctl;
-               struct rk3288_ddr_publ *publ = chan->publ;
-
-               phy_pctrl_reset(dram->cru, publ, channel);
-               phy_dll_bypass_set(publ, sdram_params->base.ddr_freq);
-
-               dfi_cfg(pctl, sdram_params->base.dramtype);
-
-               pctl_cfg(channel, pctl, sdram_params, dram->grf);
-
-               phy_cfg(chan, channel, sdram_params);
-
-               phy_init(publ);
-
-               writel(POWER_UP_START, &pctl->powctl);
-               while (!(readl(&pctl->powstat) & POWER_UP_DONE))
-                       ;
-
-               memory_init(publ, sdram_params->base.dramtype);
-               move_to_config_state(publ, pctl);
-
-               /* Using 32bit bus width for detect */
-               sdram_params->ch[channel].bw = 2;
-               set_bandwidth_ratio(chan, channel,
-                                   sdram_params->ch[channel].bw, dram->grf);
-               /*
-                * set cs, using n=3 for detect
-                * CS0, n=1
-                * CS1, n=2
-                * CS0 & CS1, n = 3
-                */
-               sdram_params->ch[channel].rank = 2,
-               clrsetbits_le32(&publ->pgcr, 0xF << 18,
-                               (sdram_params->ch[channel].rank | 1) << 18);
-
-               /* DS=40ohm,ODT=155ohm */
-               zqcr = 1 << ZDEN_SHIFT | 2 << PU_ONDIE_SHIFT |
-                       2 << PD_ONDIE_SHIFT | 0x19 << PU_OUTPUT_SHIFT |
-                       0x19 << PD_OUTPUT_SHIFT;
-               writel(zqcr, &publ->zq1cr[0]);
-               writel(zqcr, &publ->zq0cr[0]);
-
-               /* Detect the rank and bit-width with data-training */
-               writel(1, &chan->msch->ddrconf);
-               sdram_rank_bw_detect(dram, channel, sdram_params);
-
-               if (sdram_params->base.dramtype == LPDDR3) {
-                       u32 i;
-                       writel(0, &pctl->mrrcfg0);
-                       for (i = 0; i < 17; i++)
-                               send_command_op(pctl, 1, MRR_CMD, i, 0);
-               }
-               writel(4, &chan->msch->ddrconf);
-               move_to_access_state(chan);
-               /* DDR3 and LPDDR3 are always 8 bank, no need detect */
-               sdram_params->ch[channel].bk = 3;
-               /* Detect Col and Row number*/
-               ret = sdram_col_row_detect(dram, channel, sdram_params);
-               if (ret)
-                       goto error;
-       }
-       /* Find NIU DDR configuration */
-       ret = sdram_get_niu_config(sdram_params);
-       if (ret)
-               goto error;
-
-       dram_all_config(dram, sdram_params);
-       debug("%s done\n", __func__);
-
-       return 0;
-error:
-       printf("DRAM init failed!\n");
-       hang();
-}
-
-static int setup_sdram(struct udevice *dev)
-{
-       struct dram_info *priv = dev_get_priv(dev);
-       struct rk3188_sdram_params *params = dev_get_platdata(dev);
-
-       return sdram_init(priv, params);
-}
-
-static int rk3188_dmc_ofdata_to_platdata(struct udevice *dev)
-{
-#if !CONFIG_IS_ENABLED(OF_PLATDATA)
-       struct rk3188_sdram_params *params = dev_get_platdata(dev);
-       int ret;
-
-       /* rk3188 supports only one-channel */
-       params->num_channels = 1;
-       ret = dev_read_u32_array(dev, "rockchip,pctl-timing",
-                                (u32 *)&params->pctl_timing,
-                                sizeof(params->pctl_timing) / sizeof(u32));
-       if (ret) {
-               printf("%s: Cannot read rockchip,pctl-timing\n", __func__);
-               return -EINVAL;
-       }
-       ret = dev_read_u32_array(dev, "rockchip,phy-timing",
-                                (u32 *)&params->phy_timing,
-                                sizeof(params->phy_timing) / sizeof(u32));
-       if (ret) {
-               printf("%s: Cannot read rockchip,phy-timing\n", __func__);
-               return -EINVAL;
-       }
-       ret = dev_read_u32_array(dev, "rockchip,sdram-params",
-                                (u32 *)&params->base,
-                                sizeof(params->base) / sizeof(u32));
-       if (ret) {
-               printf("%s: Cannot read rockchip,sdram-params\n", __func__);
-               return -EINVAL;
-       }
-       ret = regmap_init_mem(dev, &params->map);
-       if (ret)
-               return ret;
-#endif
-
-       return 0;
-}
-#endif /* CONFIG_SPL_BUILD */
-
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-static int conv_of_platdata(struct udevice *dev)
-{
-       struct rk3188_sdram_params *plat = dev_get_platdata(dev);
-       struct dtd_rockchip_rk3188_dmc *of_plat = &plat->of_plat;
-       int ret;
-
-       memcpy(&plat->pctl_timing, of_plat->rockchip_pctl_timing,
-              sizeof(plat->pctl_timing));
-       memcpy(&plat->phy_timing, of_plat->rockchip_phy_timing,
-              sizeof(plat->phy_timing));
-       memcpy(&plat->base, of_plat->rockchip_sdram_params, sizeof(plat->base));
-       /* rk3188 supports dual-channel, set default channel num to 2 */
-       plat->num_channels = 1;
-       ret = regmap_init_mem_platdata(dev, of_plat->reg,
-                                      ARRAY_SIZE(of_plat->reg) / 2,
-                                      &plat->map);
-       if (ret)
-               return ret;
-
-       return 0;
-}
-#endif
-
-static int rk3188_dmc_probe(struct udevice *dev)
-{
-#ifdef CONFIG_SPL_BUILD
-       struct rk3188_sdram_params *plat = dev_get_platdata(dev);
-       struct regmap *map;
-       struct udevice *dev_clk;
-       int ret;
-#endif
-       struct dram_info *priv = dev_get_priv(dev);
-
-       priv->pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU);
-
-#ifdef CONFIG_SPL_BUILD
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-       ret = conv_of_platdata(dev);
-       if (ret)
-               return ret;
-#endif
-       map = syscon_get_regmap_by_driver_data(ROCKCHIP_SYSCON_NOC);
-       if (IS_ERR(map))
-               return PTR_ERR(map);
-       priv->chan[0].msch = regmap_get_range(map, 0);
-
-       priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
-
-       priv->chan[0].pctl = regmap_get_range(plat->map, 0);
-       priv->chan[0].publ = regmap_get_range(plat->map, 1);
-
-       ret = rockchip_get_clk(&dev_clk);
-       if (ret)
-               return ret;
-       priv->ddr_clk.id = CLK_DDR;
-       ret = clk_request(dev_clk, &priv->ddr_clk);
-       if (ret)
-               return ret;
-
-       priv->cru = rockchip_get_cru();
-       if (IS_ERR(priv->cru))
-               return PTR_ERR(priv->cru);
-       ret = setup_sdram(dev);
-       if (ret)
-               return ret;
-#else
-       priv->info.base = CONFIG_SYS_SDRAM_BASE;
-       priv->info.size = rockchip_sdram_size(
-                               (phys_addr_t)&priv->pmu->sys_reg[2]);
-#endif
-
-       return 0;
-}
-
-static int rk3188_dmc_get_info(struct udevice *dev, struct ram_info *info)
-{
-       struct dram_info *priv = dev_get_priv(dev);
-
-       *info = priv->info;
-
-       return 0;
-}
-
-static struct ram_ops rk3188_dmc_ops = {
-       .get_info = rk3188_dmc_get_info,
-};
-
-static const struct udevice_id rk3188_dmc_ids[] = {
-       { .compatible = "rockchip,rk3188-dmc" },
-       { }
-};
-
-U_BOOT_DRIVER(dmc_rk3188) = {
-       .name = "rockchip_rk3188_dmc",
-       .id = UCLASS_RAM,
-       .of_match = rk3188_dmc_ids,
-       .ops = &rk3188_dmc_ops,
-#ifdef CONFIG_SPL_BUILD
-       .ofdata_to_platdata = rk3188_dmc_ofdata_to_platdata,
-#endif
-       .probe = rk3188_dmc_probe,
-       .priv_auto_alloc_size = sizeof(struct dram_info),
-#ifdef CONFIG_SPL_BUILD
-       .platdata_auto_alloc_size = sizeof(struct rk3188_sdram_params),
-#endif
-};
index dcd8cf805fe51aa2a1d2fa25aefdb6a3e37a758b..d44311457a4194dc0f99c635cac730ae19ac0e33 100644 (file)
@@ -21,12 +21,12 @@ DECLARE_GLOBAL_DATA_PTR;
 static void setup_boot_mode(void)
 {
        struct rk322x_grf *const grf = (void *)GRF_BASE;
-       int boot_mode = readl(&grf->os_reg[4]);
+       int boot_mode = readl(&grf->os_reg[0]);
 
        debug("boot mode %x.\n", boot_mode);
 
        /* Clear boot mode */
-       writel(BOOT_NORMAL, &grf->os_reg[4]);
+       writel(BOOT_NORMAL, &grf->os_reg[0]);
 
        switch (boot_mode) {
        case BOOT_FASTBOOT:
index 6b7bf85d8d3347aaa3f2363935f971978f1830c0..7b7fd5a6f1a03692f19dc9f21c191a1aa637b013 100644 (file)
 #include <asm/arch/clock.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/periph.h>
+#include <asm/arch/pmu_rk3288.h>
 #include <asm/arch/sdram.h>
+#include <asm/arch/sdram_common.h>
+#include <asm/arch/sys_proto.h>
 #include <asm/arch/timer.h>
 #include <dm/pinctrl.h>
 #include <dm/root.h>
@@ -80,46 +83,6 @@ u32 spl_boot_mode(const u32 boot_device)
        return MMCSD_MODE_RAW;
 }
 
-/* read L2 control register (L2CTLR) */
-static inline uint32_t read_l2ctlr(void)
-{
-       uint32_t val = 0;
-
-       asm volatile ("mrc p15, 1, %0, c9, c0, 2" : "=r" (val));
-
-       return val;
-}
-
-/* write L2 control register (L2CTLR) */
-static inline void write_l2ctlr(uint32_t val)
-{
-       /*
-        * Note: L2CTLR can only be written when the L2 memory system
-        * is idle, ie before the MMU is enabled.
-        */
-       asm volatile("mcr p15, 1, %0, c9, c0, 2" : : "r" (val) : "memory");
-       isb();
-}
-
-static void configure_l2ctlr(void)
-{
-       uint32_t l2ctlr;
-
-       l2ctlr = read_l2ctlr();
-       l2ctlr &= 0xfffc0000; /* clear bit0~bit17 */
-
-       /*
-       * Data RAM write latency: 2 cycles
-       * Data RAM read latency: 2 cycles
-       * Data RAM setup latency: 1 cycle
-       * Tag RAM write latency: 1 cycle
-       * Tag RAM read latency: 1 cycle
-       * Tag RAM setup latency: 1 cycle
-       */
-       l2ctlr |= (1 << 3 | 1 << 0);
-       write_l2ctlr(l2ctlr);
-}
-
 #ifdef CONFIG_SPL_MMC_SUPPORT
 static int configure_emmc(struct udevice *pinctrl)
 {
@@ -243,12 +206,15 @@ void board_init_f(ulong dummy)
        }
 #endif
 
+#if !defined(CONFIG_SUPPORT_TPL)
        debug("\nspl:init dram\n");
        ret = uclass_get_device(UCLASS_RAM, 0, &dev);
        if (ret) {
                debug("DRAM init failed: %d\n", ret);
                return;
        }
+#endif
+
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
        back_to_bootrom();
 #endif
@@ -326,3 +292,18 @@ err:
        /* No way to report error here */
        hang();
 }
+
+#ifdef CONFIG_SPL_OS_BOOT
+
+#define PMU_BASE               0xff730000
+int dram_init_banksize(void)
+{
+       struct rk3288_pmu *const pmu = (void *)PMU_BASE;
+       size_t size = rockchip_sdram_size((phys_addr_t)&pmu->sys_reg[2]);
+
+       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+       gd->bd->bi_dram[0].size = size;
+
+       return 0;
+}
+#endif
diff --git a/arch/arm/mach-rockchip/rk3288-board-tpl.c b/arch/arm/mach-rockchip/rk3288-board-tpl.c
new file mode 100644 (file)
index 0000000..3d08b5b
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2017 Amarula Solutions
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <debug_uart.h>
+#include <dm.h>
+#include <ram.h>
+#include <spl.h>
+#include <version.h>
+#include <asm/io.h>
+#include <asm/arch/bootrom.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/grf_rk3288.h>
+#include <asm/arch/periph.h>
+#include <asm/arch/pmu_rk3288.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/timer.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define GRF_BASE               0xff770000
+void board_init_f(ulong dummy)
+{
+       struct udevice *dev;
+       int ret;
+
+       /* Example code showing how to enable the debug UART on RK3288 */
+       /* Enable early UART on the RK3288 */
+       struct rk3288_grf * const grf = (void *)GRF_BASE;
+
+       rk_clrsetreg(&grf->gpio7ch_iomux, GPIO7C7_MASK << GPIO7C7_SHIFT |
+                    GPIO7C6_MASK << GPIO7C6_SHIFT,
+                    GPIO7C7_UART2DBG_SOUT << GPIO7C7_SHIFT |
+                    GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);
+       /*
+        * Debug UART can be used from here if required:
+        *
+        * debug_uart_init();
+        * printch('a');
+        * printhex8(0x1234);
+        * printascii("string");
+        */
+       debug_uart_init();
+
+       ret = spl_early_init();
+       if (ret) {
+               debug("spl_early_init() failed: %d\n", ret);
+               hang();
+       }
+
+       rockchip_timer_init();
+       configure_l2ctlr();
+
+       ret = rockchip_get_clk(&dev);
+       if (ret) {
+               debug("CLK init failed: %d\n", ret);
+               return;
+       }
+
+       ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+       if (ret) {
+               debug("DRAM init failed: %d\n", ret);
+               return;
+       }
+}
+
+void board_return_to_bootrom(void)
+{
+       back_to_bootrom();
+}
+
+u32 spl_boot_device(void)
+{
+       return BOOT_DEVICE_BOOTROM;
+}
+
+void spl_board_init(void)
+{
+       puts("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
+                               U_BOOT_TIME ")\n");
+}
index 4ad294006949672243638dca6227d43f8b524b3b..6beb26fd7a68a4a09616e2e332132ac25db492fd 100644 (file)
@@ -87,6 +87,22 @@ config TARGET_POPMETAL_RK3288
 config TARGET_VYASA_RK3288
        bool "Vyasa-RK3288"
        select BOARD_LATE_INIT
+       select TPL
+       select SUPPORT_TPL
+       select TPL_DM
+       select TPL_REGMAP
+       select TPL_SYSCON
+       select TPL_CLK
+       select TPL_RAM
+       select TPL_OF_PLATDATA
+       select TPL_OF_CONTROL
+       select TPL_BOOTROM_SUPPORT
+       select TPL_NEEDS_SEPARATE_TEXT_BASE if SPL
+       select ROCKCHIP_BROM_HELPER
+       select TPL_DRIVERS_MISC_SUPPORT
+       select TPL_LIBCOMMON_SUPPORT
+       select TPL_LIBGENERIC_SUPPORT
+       select TPL_SERIAL_SUPPORT
        help
          Vyasa is a RK3288-based development board with 2 USB ports,
          HDMI, VGA, micro-SD card, audio, WiFi  and Gigabit Ethernet, It
index b5b28efbe8163ee2f561ba486940e7e09b2aed6e..a0033a0d845cd5abb16bce30c7049b6c890d6c49 100644 (file)
@@ -6,5 +6,4 @@
 
 obj-y += clk_rk3288.o
 obj-y += rk3288.o
-obj-y += sdram_rk3288.o
 obj-y += syscon_rk3288.o
diff --git a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c b/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
deleted file mode 100644 (file)
index 95efb11..0000000
+++ /dev/null
@@ -1,1125 +0,0 @@
-/*
- * (C) Copyright 2015 Google, Inc
- * Copyright 2014 Rockchip Inc.
- *
- * SPDX-License-Identifier:     GPL-2.0
- *
- * Adapted from coreboot.
- */
-
-#include <common.h>
-#include <clk.h>
-#include <dm.h>
-#include <dt-structs.h>
-#include <errno.h>
-#include <ram.h>
-#include <regmap.h>
-#include <syscon.h>
-#include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/cru_rk3288.h>
-#include <asm/arch/ddr_rk3288.h>
-#include <asm/arch/grf_rk3288.h>
-#include <asm/arch/pmu_rk3288.h>
-#include <asm/arch/sdram.h>
-#include <asm/arch/sdram_common.h>
-#include <linux/err.h>
-#include <power/regulator.h>
-#include <power/rk8xx_pmic.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-struct chan_info {
-       struct rk3288_ddr_pctl *pctl;
-       struct rk3288_ddr_publ *publ;
-       struct rk3288_msch *msch;
-};
-
-struct dram_info {
-       struct chan_info chan[2];
-       struct ram_info info;
-       struct clk ddr_clk;
-       struct rk3288_cru *cru;
-       struct rk3288_grf *grf;
-       struct rk3288_sgrf *sgrf;
-       struct rk3288_pmu *pmu;
-       bool is_veyron;
-};
-
-struct rk3288_sdram_params {
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-       struct dtd_rockchip_rk3288_dmc of_plat;
-#endif
-       struct rk3288_sdram_channel ch[2];
-       struct rk3288_sdram_pctl_timing pctl_timing;
-       struct rk3288_sdram_phy_timing phy_timing;
-       struct rk3288_base_params base;
-       int num_channels;
-       struct regmap *map;
-};
-
-const int ddrconf_table[] = {
-       /* row      col,bw */
-       0,
-       ((1 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
-       ((2 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
-       ((3 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
-       ((4 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
-       ((1 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
-       ((2 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
-       ((3 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
-       ((1 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
-       ((2 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
-       ((3 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
-       0,
-       0,
-       0,
-       0,
-       ((4 << 4) | 2),
-};
-
-#define TEST_PATTEN    0x5aa5f00f
-#define DQS_GATE_TRAINING_ERROR_RANK0  (1 << 4)
-#define DQS_GATE_TRAINING_ERROR_RANK1  (2 << 4)
-
-#ifdef CONFIG_SPL_BUILD
-static void copy_to_reg(u32 *dest, const u32 *src, u32 n)
-{
-       int i;
-
-       for (i = 0; i < n / sizeof(u32); i++) {
-               writel(*src, dest);
-               src++;
-               dest++;
-       }
-}
-
-static void ddr_reset(struct rk3288_cru *cru, u32 ch, u32 ctl, u32 phy)
-{
-       u32 phy_ctl_srstn_shift = 4 + 5 * ch;
-       u32 ctl_psrstn_shift = 3 + 5 * ch;
-       u32 ctl_srstn_shift = 2 + 5 * ch;
-       u32 phy_psrstn_shift = 1 + 5 * ch;
-       u32 phy_srstn_shift = 5 * ch;
-
-       rk_clrsetreg(&cru->cru_softrst_con[10],
-                    1 << phy_ctl_srstn_shift | 1 << ctl_psrstn_shift |
-                    1 << ctl_srstn_shift | 1 << phy_psrstn_shift |
-                    1 << phy_srstn_shift,
-                    phy << phy_ctl_srstn_shift | ctl << ctl_psrstn_shift |
-                    ctl << ctl_srstn_shift | phy << phy_psrstn_shift |
-                    phy << phy_srstn_shift);
-}
-
-static void ddr_phy_ctl_reset(struct rk3288_cru *cru, u32 ch, u32 n)
-{
-       u32 phy_ctl_srstn_shift = 4 + 5 * ch;
-
-       rk_clrsetreg(&cru->cru_softrst_con[10],
-                    1 << phy_ctl_srstn_shift, n << phy_ctl_srstn_shift);
-}
-
-static void phy_pctrl_reset(struct rk3288_cru *cru,
-                           struct rk3288_ddr_publ *publ,
-                           int channel)
-{
-       int i;
-
-       ddr_reset(cru, channel, 1, 1);
-       udelay(1);
-       clrbits_le32(&publ->acdllcr, ACDLLCR_DLLSRST);
-       for (i = 0; i < 4; i++)
-               clrbits_le32(&publ->datx8[i].dxdllcr, DXDLLCR_DLLSRST);
-
-       udelay(10);
-       setbits_le32(&publ->acdllcr, ACDLLCR_DLLSRST);
-       for (i = 0; i < 4; i++)
-               setbits_le32(&publ->datx8[i].dxdllcr, DXDLLCR_DLLSRST);
-
-       udelay(10);
-       ddr_reset(cru, channel, 1, 0);
-       udelay(10);
-       ddr_reset(cru, channel, 0, 0);
-       udelay(10);
-}
-
-static void phy_dll_bypass_set(struct rk3288_ddr_publ *publ,
-       u32 freq)
-{
-       int i;
-
-       if (freq <= 250000000) {
-               if (freq <= 150000000)
-                       clrbits_le32(&publ->dllgcr, SBIAS_BYPASS);
-               else
-                       setbits_le32(&publ->dllgcr, SBIAS_BYPASS);
-               setbits_le32(&publ->acdllcr, ACDLLCR_DLLDIS);
-               for (i = 0; i < 4; i++)
-                       setbits_le32(&publ->datx8[i].dxdllcr,
-                                    DXDLLCR_DLLDIS);
-
-               setbits_le32(&publ->pir, PIR_DLLBYP);
-       } else {
-               clrbits_le32(&publ->dllgcr, SBIAS_BYPASS);
-               clrbits_le32(&publ->acdllcr, ACDLLCR_DLLDIS);
-               for (i = 0; i < 4; i++) {
-                       clrbits_le32(&publ->datx8[i].dxdllcr,
-                                    DXDLLCR_DLLDIS);
-               }
-
-               clrbits_le32(&publ->pir, PIR_DLLBYP);
-       }
-}
-
-static void dfi_cfg(struct rk3288_ddr_pctl *pctl, u32 dramtype)
-{
-       writel(DFI_INIT_START, &pctl->dfistcfg0);
-       writel(DFI_DRAM_CLK_SR_EN | DFI_DRAM_CLK_DPD_EN,
-              &pctl->dfistcfg1);
-       writel(DFI_PARITY_INTR_EN | DFI_PARITY_EN, &pctl->dfistcfg2);
-       writel(7 << TLP_RESP_TIME_SHIFT | LP_SR_EN | LP_PD_EN,
-              &pctl->dfilpcfg0);
-
-       writel(2 << TCTRL_DELAY_TIME_SHIFT, &pctl->dfitctrldelay);
-       writel(1 << TPHY_WRDATA_TIME_SHIFT, &pctl->dfitphywrdata);
-       writel(0xf << TPHY_RDLAT_TIME_SHIFT, &pctl->dfitphyrdlat);
-       writel(2 << TDRAM_CLK_DIS_TIME_SHIFT, &pctl->dfitdramclkdis);
-       writel(2 << TDRAM_CLK_EN_TIME_SHIFT, &pctl->dfitdramclken);
-       writel(1, &pctl->dfitphyupdtype0);
-
-       /* cs0 and cs1 write odt enable */
-       writel((RANK0_ODT_WRITE_SEL | RANK1_ODT_WRITE_SEL),
-              &pctl->dfiodtcfg);
-       /* odt write length */
-       writel(7 << ODT_LEN_BL8_W_SHIFT, &pctl->dfiodtcfg1);
-       /* phyupd and ctrlupd disabled */
-       writel(0, &pctl->dfiupdcfg);
-}
-
-static void ddr_set_enable(struct rk3288_grf *grf, uint channel, bool enable)
-{
-       uint val = 0;
-
-       if (enable) {
-               val = 1 << (channel ? DDR1_16BIT_EN_SHIFT :
-                               DDR0_16BIT_EN_SHIFT);
-       }
-       rk_clrsetreg(&grf->soc_con0,
-                    1 << (channel ? DDR1_16BIT_EN_SHIFT : DDR0_16BIT_EN_SHIFT),
-                    val);
-}
-
-static void ddr_set_ddr3_mode(struct rk3288_grf *grf, uint channel,
-                             bool ddr3_mode)
-{
-       uint mask, val;
-
-       mask = 1 << (channel ? MSCH1_MAINDDR3_SHIFT : MSCH0_MAINDDR3_SHIFT);
-       val = ddr3_mode << (channel ? MSCH1_MAINDDR3_SHIFT :
-                                       MSCH0_MAINDDR3_SHIFT);
-       rk_clrsetreg(&grf->soc_con0, mask, val);
-}
-
-static void ddr_set_en_bst_odt(struct rk3288_grf *grf, uint channel,
-                              bool enable, bool enable_bst, bool enable_odt)
-{
-       uint mask;
-       bool disable_bst = !enable_bst;
-
-       mask = channel ?
-               (1 << LPDDR3_EN1_SHIFT | 1 << UPCTL1_BST_DIABLE_SHIFT |
-                       1 << UPCTL1_LPDDR3_ODT_EN_SHIFT) :
-               (1 << LPDDR3_EN0_SHIFT | 1 << UPCTL0_BST_DIABLE_SHIFT |
-                       1 << UPCTL0_LPDDR3_ODT_EN_SHIFT);
-       rk_clrsetreg(&grf->soc_con2, mask,
-                    enable << (channel ? LPDDR3_EN1_SHIFT : LPDDR3_EN0_SHIFT) |
-                    disable_bst << (channel ? UPCTL1_BST_DIABLE_SHIFT :
-                               UPCTL0_BST_DIABLE_SHIFT) |
-                    enable_odt << (channel ? UPCTL1_LPDDR3_ODT_EN_SHIFT :
-                               UPCTL0_LPDDR3_ODT_EN_SHIFT));
-}
-
-static void pctl_cfg(int channel, struct rk3288_ddr_pctl *pctl,
-                    struct rk3288_sdram_params *sdram_params,
-                    struct rk3288_grf *grf)
-{
-       unsigned int burstlen;
-
-       burstlen = (sdram_params->base.noc_timing >> 18) & 0x7;
-       copy_to_reg(&pctl->togcnt1u, &sdram_params->pctl_timing.togcnt1u,
-                   sizeof(sdram_params->pctl_timing));
-       switch (sdram_params->base.dramtype) {
-       case LPDDR3:
-               writel(sdram_params->pctl_timing.tcl - 1,
-                      &pctl->dfitrddataen);
-               writel(sdram_params->pctl_timing.tcwl,
-                      &pctl->dfitphywrlat);
-               burstlen >>= 1;
-               writel(LPDDR2_S4 | 0 << MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT |
-                      LPDDR2_EN | burstlen << BURSTLENGTH_SHIFT |
-                      (6 - 4) << TFAW_SHIFT | PD_EXIT_FAST |
-                      1 << PD_TYPE_SHIFT | 0 << PD_IDLE_SHIFT,
-                      &pctl->mcfg);
-               ddr_set_ddr3_mode(grf, channel, false);
-               ddr_set_enable(grf, channel, true);
-               ddr_set_en_bst_odt(grf, channel, true, false,
-                                  sdram_params->base.odt);
-               break;
-       case DDR3:
-               if (sdram_params->phy_timing.mr[1] & DDR3_DLL_DISABLE) {
-                       writel(sdram_params->pctl_timing.tcl - 3,
-                              &pctl->dfitrddataen);
-               } else {
-                       writel(sdram_params->pctl_timing.tcl - 2,
-                              &pctl->dfitrddataen);
-               }
-               writel(sdram_params->pctl_timing.tcwl - 1,
-                      &pctl->dfitphywrlat);
-               writel(0 << MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT | DDR3_EN |
-                      DDR2_DDR3_BL_8 | (6 - 4) << TFAW_SHIFT | PD_EXIT_SLOW |
-                      1 << PD_TYPE_SHIFT | 0 << PD_IDLE_SHIFT,
-                      &pctl->mcfg);
-               ddr_set_ddr3_mode(grf, channel, true);
-               ddr_set_enable(grf, channel, true);
-
-               ddr_set_en_bst_odt(grf, channel, false, true, false);
-               break;
-       }
-
-       setbits_le32(&pctl->scfg, 1);
-}
-
-static void phy_cfg(const struct chan_info *chan, int channel,
-                   struct rk3288_sdram_params *sdram_params)
-{
-       struct rk3288_ddr_publ *publ = chan->publ;
-       struct rk3288_msch *msch = chan->msch;
-       uint ddr_freq_mhz = sdram_params->base.ddr_freq / 1000000;
-       u32 dinit2, tmp;
-       int i;
-
-       dinit2 = DIV_ROUND_UP(ddr_freq_mhz * 200000, 1000);
-       /* DDR PHY Timing */
-       copy_to_reg(&publ->dtpr[0], &sdram_params->phy_timing.dtpr0,
-                   sizeof(sdram_params->phy_timing));
-       writel(sdram_params->base.noc_timing, &msch->ddrtiming);
-       writel(0x3f, &msch->readlatency);
-       writel(sdram_params->base.noc_activate, &msch->activate);
-       writel(2 << BUSWRTORD_SHIFT | 2 << BUSRDTOWR_SHIFT |
-              1 << BUSRDTORD_SHIFT, &msch->devtodev);
-       writel(DIV_ROUND_UP(ddr_freq_mhz * 5120, 1000) << PRT_DLLLOCK_SHIFT |
-              DIV_ROUND_UP(ddr_freq_mhz * 50, 1000) << PRT_DLLSRST_SHIFT |
-              8 << PRT_ITMSRST_SHIFT, &publ->ptr[0]);
-       writel(DIV_ROUND_UP(ddr_freq_mhz * 500000, 1000) << PRT_DINIT0_SHIFT |
-              DIV_ROUND_UP(ddr_freq_mhz * 400, 1000) << PRT_DINIT1_SHIFT,
-              &publ->ptr[1]);
-       writel(min(dinit2, 0x1ffffU) << PRT_DINIT2_SHIFT |
-              DIV_ROUND_UP(ddr_freq_mhz * 1000, 1000) << PRT_DINIT3_SHIFT,
-              &publ->ptr[2]);
-
-       switch (sdram_params->base.dramtype) {
-       case LPDDR3:
-               clrsetbits_le32(&publ->pgcr, 0x1F,
-                               0 << PGCR_DFTLMT_SHIFT |
-                               0 << PGCR_DFTCMP_SHIFT |
-                               1 << PGCR_DQSCFG_SHIFT |
-                               0 << PGCR_ITMDMD_SHIFT);
-               /* DDRMODE select LPDDR3 */
-               clrsetbits_le32(&publ->dcr, DDRMD_MASK << DDRMD_SHIFT,
-                               DDRMD_LPDDR2_LPDDR3 << DDRMD_SHIFT);
-               clrsetbits_le32(&publ->dxccr,
-                               DQSNRES_MASK << DQSNRES_SHIFT |
-                               DQSRES_MASK << DQSRES_SHIFT,
-                               4 << DQSRES_SHIFT | 0xc << DQSNRES_SHIFT);
-               tmp = readl(&publ->dtpr[1]);
-               tmp = ((tmp >> TDQSCKMAX_SHIFT) & TDQSCKMAX_MASK) -
-                       ((tmp >> TDQSCK_SHIFT) & TDQSCK_MASK);
-               clrsetbits_le32(&publ->dsgcr,
-                               DQSGE_MASK << DQSGE_SHIFT |
-                               DQSGX_MASK << DQSGX_SHIFT,
-                               tmp << DQSGE_SHIFT | tmp << DQSGX_SHIFT);
-               break;
-       case DDR3:
-               clrbits_le32(&publ->pgcr, 0x1f);
-               clrsetbits_le32(&publ->dcr, DDRMD_MASK << DDRMD_SHIFT,
-                               DDRMD_DDR3 << DDRMD_SHIFT);
-               break;
-       }
-       if (sdram_params->base.odt) {
-               /*dynamic RTT enable */
-               for (i = 0; i < 4; i++)
-                       setbits_le32(&publ->datx8[i].dxgcr, DQSRTT | DQRTT);
-       } else {
-               /*dynamic RTT disable */
-               for (i = 0; i < 4; i++)
-                       clrbits_le32(&publ->datx8[i].dxgcr, DQSRTT | DQRTT);
-       }
-}
-
-static void phy_init(struct rk3288_ddr_publ *publ)
-{
-       setbits_le32(&publ->pir, PIR_INIT | PIR_DLLSRST
-               | PIR_DLLLOCK | PIR_ZCAL | PIR_ITMSRST | PIR_CLRSR);
-       udelay(1);
-       while ((readl(&publ->pgsr) &
-               (PGSR_IDONE | PGSR_DLDONE | PGSR_ZCDONE)) !=
-               (PGSR_IDONE | PGSR_DLDONE | PGSR_ZCDONE))
-               ;
-}
-
-static void send_command(struct rk3288_ddr_pctl *pctl, u32 rank,
-                        u32 cmd, u32 arg)
-{
-       writel((START_CMD | (rank << 20) | arg | cmd), &pctl->mcmd);
-       udelay(1);
-       while (readl(&pctl->mcmd) & START_CMD)
-               ;
-}
-
-static inline void send_command_op(struct rk3288_ddr_pctl *pctl,
-                                  u32 rank, u32 cmd, u32 ma, u32 op)
-{
-       send_command(pctl, rank, cmd, (ma & LPDDR2_MA_MASK) << LPDDR2_MA_SHIFT |
-                    (op & LPDDR2_OP_MASK) << LPDDR2_OP_SHIFT);
-}
-
-static void memory_init(struct rk3288_ddr_publ *publ,
-                       u32 dramtype)
-{
-       setbits_le32(&publ->pir,
-                    (PIR_INIT | PIR_DRAMINIT | PIR_LOCKBYP
-                     | PIR_ZCALBYP | PIR_CLRSR | PIR_ICPC
-                     | (dramtype == DDR3 ? PIR_DRAMRST : 0)));
-       udelay(1);
-       while ((readl(&publ->pgsr) & (PGSR_IDONE | PGSR_DLDONE))
-               != (PGSR_IDONE | PGSR_DLDONE))
-               ;
-}
-
-static void move_to_config_state(struct rk3288_ddr_publ *publ,
-                                struct rk3288_ddr_pctl *pctl)
-{
-       unsigned int state;
-
-       while (1) {
-               state = readl(&pctl->stat) & PCTL_STAT_MSK;
-
-               switch (state) {
-               case LOW_POWER:
-                       writel(WAKEUP_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK)
-                               != ACCESS)
-                               ;
-                       /* wait DLL lock */
-                       while ((readl(&publ->pgsr) & PGSR_DLDONE)
-                               != PGSR_DLDONE)
-                               ;
-                       /*
-                        * if at low power state,need wakeup first,
-                        * and then enter the config
-                        * so here no break.
-                        */
-               case ACCESS:
-                       /* no break */
-               case INIT_MEM:
-                       writel(CFG_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != CONFIG)
-                               ;
-                       break;
-               case CONFIG:
-                       return;
-               default:
-                       break;
-               }
-       }
-}
-
-static void set_bandwidth_ratio(const struct chan_info *chan, int channel,
-                               u32 n, struct rk3288_grf *grf)
-{
-       struct rk3288_ddr_pctl *pctl = chan->pctl;
-       struct rk3288_ddr_publ *publ = chan->publ;
-       struct rk3288_msch *msch = chan->msch;
-
-       if (n == 1) {
-               setbits_le32(&pctl->ppcfg, 1);
-               rk_setreg(&grf->soc_con0, 1 << (8 + channel));
-               setbits_le32(&msch->ddrtiming, 1 << 31);
-               /* Data Byte disable*/
-               clrbits_le32(&publ->datx8[2].dxgcr, 1);
-               clrbits_le32(&publ->datx8[3].dxgcr, 1);
-               /* disable DLL */
-               setbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLDIS);
-               setbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLDIS);
-       } else {
-               clrbits_le32(&pctl->ppcfg, 1);
-               rk_clrreg(&grf->soc_con0, 1 << (8 + channel));
-               clrbits_le32(&msch->ddrtiming, 1 << 31);
-               /* Data Byte enable*/
-               setbits_le32(&publ->datx8[2].dxgcr, 1);
-               setbits_le32(&publ->datx8[3].dxgcr, 1);
-
-               /* enable DLL */
-               clrbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLDIS);
-               clrbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLDIS);
-               /* reset DLL */
-               clrbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLSRST);
-               clrbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLSRST);
-               udelay(10);
-               setbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLSRST);
-               setbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLSRST);
-       }
-       setbits_le32(&pctl->dfistcfg0, 1 << 2);
-}
-
-static int data_training(const struct chan_info *chan, int channel,
-                        struct rk3288_sdram_params *sdram_params)
-{
-       unsigned int j;
-       int ret = 0;
-       u32 rank;
-       int i;
-       u32 step[2] = { PIR_QSTRN, PIR_RVTRN };
-       struct rk3288_ddr_publ *publ = chan->publ;
-       struct rk3288_ddr_pctl *pctl = chan->pctl;
-
-       /* disable auto refresh */
-       writel(0, &pctl->trefi);
-
-       if (sdram_params->base.dramtype != LPDDR3)
-               setbits_le32(&publ->pgcr, 1 << PGCR_DQSCFG_SHIFT);
-       rank = sdram_params->ch[channel].rank | 1;
-       for (j = 0; j < ARRAY_SIZE(step); j++) {
-               /*
-                * trigger QSTRN and RVTRN
-                * clear DTDONE status
-                */
-               setbits_le32(&publ->pir, PIR_CLRSR);
-
-               /* trigger DTT */
-               setbits_le32(&publ->pir,
-                            PIR_INIT | step[j] | PIR_LOCKBYP | PIR_ZCALBYP |
-                            PIR_CLRSR);
-               udelay(1);
-               /* wait echo byte DTDONE */
-               while ((readl(&publ->datx8[0].dxgsr[0]) & rank)
-                       != rank)
-                       ;
-               while ((readl(&publ->datx8[1].dxgsr[0]) & rank)
-                       != rank)
-                       ;
-               if (!(readl(&pctl->ppcfg) & 1)) {
-                       while ((readl(&publ->datx8[2].dxgsr[0])
-                               & rank) != rank)
-                               ;
-                       while ((readl(&publ->datx8[3].dxgsr[0])
-                               & rank) != rank)
-                               ;
-               }
-               if (readl(&publ->pgsr) &
-                   (PGSR_DTERR | PGSR_RVERR | PGSR_RVEIRR)) {
-                       ret = -1;
-                       break;
-               }
-       }
-       /* send some auto refresh to complement the lost while DTT */
-       for (i = 0; i < (rank > 1 ? 8 : 4); i++)
-               send_command(pctl, rank, REF_CMD, 0);
-
-       if (sdram_params->base.dramtype != LPDDR3)
-               clrbits_le32(&publ->pgcr, 1 << PGCR_DQSCFG_SHIFT);
-
-       /* resume auto refresh */
-       writel(sdram_params->pctl_timing.trefi, &pctl->trefi);
-
-       return ret;
-}
-
-static void move_to_access_state(const struct chan_info *chan)
-{
-       struct rk3288_ddr_publ *publ = chan->publ;
-       struct rk3288_ddr_pctl *pctl = chan->pctl;
-       unsigned int state;
-
-       while (1) {
-               state = readl(&pctl->stat) & PCTL_STAT_MSK;
-
-               switch (state) {
-               case LOW_POWER:
-                       if (((readl(&pctl->stat) >> LP_TRIG_SHIFT) &
-                                       LP_TRIG_MASK) == 1)
-                               return;
-
-                       writel(WAKEUP_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != ACCESS)
-                               ;
-                       /* wait DLL lock */
-                       while ((readl(&publ->pgsr) & PGSR_DLDONE)
-                               != PGSR_DLDONE)
-                               ;
-                       break;
-               case INIT_MEM:
-                       writel(CFG_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != CONFIG)
-                               ;
-               case CONFIG:
-                       writel(GO_STATE, &pctl->sctl);
-                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) == CONFIG)
-                               ;
-                       break;
-               case ACCESS:
-                       return;
-               default:
-                       break;
-               }
-       }
-}
-
-static void dram_cfg_rbc(const struct chan_info *chan, u32 chnum,
-                        struct rk3288_sdram_params *sdram_params)
-{
-       struct rk3288_ddr_publ *publ = chan->publ;
-
-       if (sdram_params->ch[chnum].bk == 3)
-               clrsetbits_le32(&publ->dcr, PDQ_MASK << PDQ_SHIFT,
-                               1 << PDQ_SHIFT);
-       else
-               clrbits_le32(&publ->dcr, PDQ_MASK << PDQ_SHIFT);
-
-       writel(sdram_params->base.ddrconfig, &chan->msch->ddrconf);
-}
-
-static void dram_all_config(const struct dram_info *dram,
-                           struct rk3288_sdram_params *sdram_params)
-{
-       unsigned int chan;
-       u32 sys_reg = 0;
-
-       sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT;
-       sys_reg |= (sdram_params->num_channels - 1) << SYS_REG_NUM_CH_SHIFT;
-       for (chan = 0; chan < sdram_params->num_channels; chan++) {
-               const struct rk3288_sdram_channel *info =
-                       &sdram_params->ch[chan];
-
-               sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(chan);
-               sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(chan);
-               sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(chan);
-               sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(chan);
-               sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(chan);
-               sys_reg |= (info->cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(chan);
-               sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(chan);
-               sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(chan);
-               sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(chan);
-
-               dram_cfg_rbc(&dram->chan[chan], chan, sdram_params);
-       }
-       writel(sys_reg, &dram->pmu->sys_reg[2]);
-       rk_clrsetreg(&dram->sgrf->soc_con2, 0x1f, sdram_params->base.stride);
-}
-
-static int sdram_rank_bw_detect(struct dram_info *dram, int channel,
-               struct rk3288_sdram_params *sdram_params)
-{
-       int reg;
-       int need_trainig = 0;
-       const struct chan_info *chan = &dram->chan[channel];
-       struct rk3288_ddr_publ *publ = chan->publ;
-
-       if (data_training(chan, channel, sdram_params) < 0) {
-               reg = readl(&publ->datx8[0].dxgsr[0]);
-               /* Check the result for rank 0 */
-               if ((channel == 0) && (reg & DQS_GATE_TRAINING_ERROR_RANK0)) {
-                       debug("data training fail!\n");
-                       return -EIO;
-               } else if ((channel == 1) &&
-                          (reg & DQS_GATE_TRAINING_ERROR_RANK0)) {
-                       sdram_params->num_channels = 1;
-               }
-
-               /* Check the result for rank 1 */
-               if (reg & DQS_GATE_TRAINING_ERROR_RANK1) {
-                       sdram_params->ch[channel].rank = 1;
-                       clrsetbits_le32(&publ->pgcr, 0xF << 18,
-                                       sdram_params->ch[channel].rank << 18);
-                       need_trainig = 1;
-               }
-               reg = readl(&publ->datx8[2].dxgsr[0]);
-               if (reg & (1 << 4)) {
-                       sdram_params->ch[channel].bw = 1;
-                       set_bandwidth_ratio(chan, channel,
-                                           sdram_params->ch[channel].bw,
-                                           dram->grf);
-                       need_trainig = 1;
-               }
-       }
-       /* Assume the Die bit width are the same with the chip bit width */
-       sdram_params->ch[channel].dbw = sdram_params->ch[channel].bw;
-
-       if (need_trainig &&
-           (data_training(chan, channel, sdram_params) < 0)) {
-               if (sdram_params->base.dramtype == LPDDR3) {
-                       ddr_phy_ctl_reset(dram->cru, channel, 1);
-                       udelay(10);
-                       ddr_phy_ctl_reset(dram->cru, channel, 0);
-                       udelay(10);
-               }
-               debug("2nd data training failed!");
-               return -EIO;
-       }
-
-       return 0;
-}
-
-static int sdram_col_row_detect(struct dram_info *dram, int channel,
-               struct rk3288_sdram_params *sdram_params)
-{
-       int row, col;
-       unsigned int addr;
-       const struct chan_info *chan = &dram->chan[channel];
-       struct rk3288_ddr_pctl *pctl = chan->pctl;
-       struct rk3288_ddr_publ *publ = chan->publ;
-       int ret = 0;
-
-       /* Detect col */
-       for (col = 11; col >= 9; col--) {
-               writel(0, CONFIG_SYS_SDRAM_BASE);
-               addr = CONFIG_SYS_SDRAM_BASE +
-                       (1 << (col + sdram_params->ch[channel].bw - 1));
-               writel(TEST_PATTEN, addr);
-               if ((readl(addr) == TEST_PATTEN) &&
-                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
-                       break;
-       }
-       if (col == 8) {
-               printf("Col detect error\n");
-               ret = -EINVAL;
-               goto out;
-       } else {
-               sdram_params->ch[channel].col = col;
-       }
-
-       move_to_config_state(publ, pctl);
-       writel(4, &chan->msch->ddrconf);
-       move_to_access_state(chan);
-       /* Detect row*/
-       for (row = 16; row >= 12; row--) {
-               writel(0, CONFIG_SYS_SDRAM_BASE);
-               addr = CONFIG_SYS_SDRAM_BASE + (1 << (row + 15 - 1));
-               writel(TEST_PATTEN, addr);
-               if ((readl(addr) == TEST_PATTEN) &&
-                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
-                       break;
-       }
-       if (row == 11) {
-               printf("Row detect error\n");
-               ret = -EINVAL;
-       } else {
-               sdram_params->ch[channel].cs1_row = row;
-               sdram_params->ch[channel].row_3_4 = 0;
-               debug("chn %d col %d, row %d\n", channel, col, row);
-               sdram_params->ch[channel].cs0_row = row;
-       }
-
-out:
-       return ret;
-}
-
-static int sdram_get_niu_config(struct rk3288_sdram_params *sdram_params)
-{
-       int i, tmp, size, ret = 0;
-
-       tmp = sdram_params->ch[0].col - 9;
-       tmp -= (sdram_params->ch[0].bw == 2) ? 0 : 1;
-       tmp |= ((sdram_params->ch[0].cs0_row - 12) << 4);
-       size = sizeof(ddrconf_table)/sizeof(ddrconf_table[0]);
-       for (i = 0; i < size; i++)
-               if (tmp == ddrconf_table[i])
-                       break;
-       if (i >= size) {
-               printf("niu config not found\n");
-               ret = -EINVAL;
-       } else {
-               sdram_params->base.ddrconfig = i;
-       }
-
-       return ret;
-}
-
-static int sdram_get_stride(struct rk3288_sdram_params *sdram_params)
-{
-       int stride = -1;
-       int ret = 0;
-       long cap = sdram_params->num_channels * (1u <<
-                       (sdram_params->ch[0].cs0_row +
-                        sdram_params->ch[0].col +
-                        (sdram_params->ch[0].rank - 1) +
-                        sdram_params->ch[0].bw +
-                        3 - 20));
-
-       switch (cap) {
-       case 512:
-               stride = 0;
-               break;
-       case 1024:
-               stride = 5;
-               break;
-       case 2048:
-               stride = 9;
-               break;
-       case 4096:
-               stride = 0xd;
-               break;
-       default:
-               stride = -1;
-               printf("could not find correct stride, cap error!\n");
-               ret = -EINVAL;
-               break;
-       }
-       sdram_params->base.stride = stride;
-
-       return ret;
-}
-
-static int sdram_init(struct dram_info *dram,
-                     struct rk3288_sdram_params *sdram_params)
-{
-       int channel;
-       int zqcr;
-       int ret;
-
-       debug("%s start\n", __func__);
-       if ((sdram_params->base.dramtype == DDR3 &&
-            sdram_params->base.ddr_freq > 800000000) ||
-           (sdram_params->base.dramtype == LPDDR3 &&
-            sdram_params->base.ddr_freq > 533000000)) {
-               debug("SDRAM frequency is too high!");
-               return -E2BIG;
-       }
-
-       debug("ddr clk dpll\n");
-       ret = clk_set_rate(&dram->ddr_clk, sdram_params->base.ddr_freq);
-       debug("ret=%d\n", ret);
-       if (ret) {
-               debug("Could not set DDR clock\n");
-               return ret;
-       }
-
-       for (channel = 0; channel < 2; channel++) {
-               const struct chan_info *chan = &dram->chan[channel];
-               struct rk3288_ddr_pctl *pctl = chan->pctl;
-               struct rk3288_ddr_publ *publ = chan->publ;
-
-               /* map all the 4GB space to the current channel */
-               if (channel)
-                       rk_clrsetreg(&dram->sgrf->soc_con2, 0x1f, 0x17);
-               else
-                       rk_clrsetreg(&dram->sgrf->soc_con2, 0x1f, 0x1a);
-               phy_pctrl_reset(dram->cru, publ, channel);
-               phy_dll_bypass_set(publ, sdram_params->base.ddr_freq);
-
-               dfi_cfg(pctl, sdram_params->base.dramtype);
-
-               pctl_cfg(channel, pctl, sdram_params, dram->grf);
-
-               phy_cfg(chan, channel, sdram_params);
-
-               phy_init(publ);
-
-               writel(POWER_UP_START, &pctl->powctl);
-               while (!(readl(&pctl->powstat) & POWER_UP_DONE))
-                       ;
-
-               memory_init(publ, sdram_params->base.dramtype);
-               move_to_config_state(publ, pctl);
-
-               if (sdram_params->base.dramtype == LPDDR3) {
-                       send_command(pctl, 3, DESELECT_CMD, 0);
-                       udelay(1);
-                       send_command(pctl, 3, PREA_CMD, 0);
-                       udelay(1);
-                       send_command_op(pctl, 3, MRS_CMD, 63, 0xfc);
-                       udelay(1);
-                       send_command_op(pctl, 3, MRS_CMD, 1,
-                                       sdram_params->phy_timing.mr[1]);
-                       udelay(1);
-                       send_command_op(pctl, 3, MRS_CMD, 2,
-                                       sdram_params->phy_timing.mr[2]);
-                       udelay(1);
-                       send_command_op(pctl, 3, MRS_CMD, 3,
-                                       sdram_params->phy_timing.mr[3]);
-                       udelay(1);
-               }
-
-               /* Using 32bit bus width for detect */
-               sdram_params->ch[channel].bw = 2;
-               set_bandwidth_ratio(chan, channel,
-                                   sdram_params->ch[channel].bw, dram->grf);
-               /*
-                * set cs, using n=3 for detect
-                * CS0, n=1
-                * CS1, n=2
-                * CS0 & CS1, n = 3
-                */
-               sdram_params->ch[channel].rank = 2,
-               clrsetbits_le32(&publ->pgcr, 0xF << 18,
-                               (sdram_params->ch[channel].rank | 1) << 18);
-
-               /* DS=40ohm,ODT=155ohm */
-               zqcr = 1 << ZDEN_SHIFT | 2 << PU_ONDIE_SHIFT |
-                       2 << PD_ONDIE_SHIFT | 0x19 << PU_OUTPUT_SHIFT |
-                       0x19 << PD_OUTPUT_SHIFT;
-               writel(zqcr, &publ->zq1cr[0]);
-               writel(zqcr, &publ->zq0cr[0]);
-
-               if (sdram_params->base.dramtype == LPDDR3) {
-                       /* LPDDR2/LPDDR3 need to wait DAI complete, max 10us */
-                       udelay(10);
-                       send_command_op(pctl,
-                                       sdram_params->ch[channel].rank | 1,
-                                       MRS_CMD, 11,
-                                       sdram_params->base.odt ? 3 : 0);
-                       if (channel == 0) {
-                               writel(0, &pctl->mrrcfg0);
-                               send_command_op(pctl, 1, MRR_CMD, 8, 0);
-                               /* S8 */
-                               if ((readl(&pctl->mrrstat0) & 0x3) != 3) {
-                                       debug("failed!");
-                                       return -EREMOTEIO;
-                               }
-                       }
-               }
-
-               /* Detect the rank and bit-width with data-training */
-               sdram_rank_bw_detect(dram, channel, sdram_params);
-
-               if (sdram_params->base.dramtype == LPDDR3) {
-                       u32 i;
-                       writel(0, &pctl->mrrcfg0);
-                       for (i = 0; i < 17; i++)
-                               send_command_op(pctl, 1, MRR_CMD, i, 0);
-               }
-               writel(15, &chan->msch->ddrconf);
-               move_to_access_state(chan);
-               /* DDR3 and LPDDR3 are always 8 bank, no need detect */
-               sdram_params->ch[channel].bk = 3;
-               /* Detect Col and Row number*/
-               ret = sdram_col_row_detect(dram, channel, sdram_params);
-               if (ret)
-                       goto error;
-       }
-       /* Find NIU DDR configuration */
-       ret = sdram_get_niu_config(sdram_params);
-       if (ret)
-               goto error;
-       /* Find stride setting */
-       ret = sdram_get_stride(sdram_params);
-       if (ret)
-               goto error;
-
-       dram_all_config(dram, sdram_params);
-       debug("%s done\n", __func__);
-
-       return 0;
-error:
-       printf("DRAM init failed!\n");
-       hang();
-}
-
-# ifdef CONFIG_ROCKCHIP_FAST_SPL
-static int veyron_init(struct dram_info *priv)
-{
-       struct udevice *pmic;
-       int ret;
-
-       ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
-       if (ret)
-               return ret;
-
-       /* Slowly raise to max CPU voltage to prevent overshoot */
-       ret = rk8xx_spl_configure_buck(pmic, 1, 1200000);
-       if (ret)
-               return ret;
-       udelay(175);/* Must wait for voltage to stabilize, 2mV/us */
-       ret = rk8xx_spl_configure_buck(pmic, 1, 1400000);
-       if (ret)
-               return ret;
-       udelay(100);/* Must wait for voltage to stabilize, 2mV/us */
-
-       rk3288_clk_configure_cpu(priv->cru, priv->grf);
-
-       return 0;
-}
-# endif
-
-static int setup_sdram(struct udevice *dev)
-{
-       struct dram_info *priv = dev_get_priv(dev);
-       struct rk3288_sdram_params *params = dev_get_platdata(dev);
-
-# ifdef CONFIG_ROCKCHIP_FAST_SPL
-       if (priv->is_veyron) {
-               int ret;
-
-               ret = veyron_init(priv);
-               if (ret)
-                       return ret;
-       }
-# endif
-
-       return sdram_init(priv, params);
-}
-
-static int rk3288_dmc_ofdata_to_platdata(struct udevice *dev)
-{
-#if !CONFIG_IS_ENABLED(OF_PLATDATA)
-       struct rk3288_sdram_params *params = dev_get_platdata(dev);
-       int ret;
-
-       /* Rk3288 supports dual-channel, set default channel num to 2 */
-       params->num_channels = 2;
-       ret = dev_read_u32_array(dev, "rockchip,pctl-timing",
-                                (u32 *)&params->pctl_timing,
-                                sizeof(params->pctl_timing) / sizeof(u32));
-       if (ret) {
-               debug("%s: Cannot read rockchip,pctl-timing\n", __func__);
-               return -EINVAL;
-       }
-       ret = dev_read_u32_array(dev, "rockchip,phy-timing",
-                                (u32 *)&params->phy_timing,
-                                sizeof(params->phy_timing) / sizeof(u32));
-       if (ret) {
-               debug("%s: Cannot read rockchip,phy-timing\n", __func__);
-               return -EINVAL;
-       }
-       ret = dev_read_u32_array(dev, "rockchip,sdram-params",
-                                (u32 *)&params->base,
-                                sizeof(params->base) / sizeof(u32));
-       if (ret) {
-               debug("%s: Cannot read rockchip,sdram-params\n", __func__);
-               return -EINVAL;
-       }
-#ifdef CONFIG_ROCKCHIP_FAST_SPL
-       struct dram_info *priv = dev_get_priv(dev);
-
-       priv->is_veyron = !fdt_node_check_compatible(blob, 0, "google,veyron");
-#endif
-       ret = regmap_init_mem(dev, &params->map);
-       if (ret)
-               return ret;
-#endif
-
-       return 0;
-}
-#endif /* CONFIG_SPL_BUILD */
-
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-static int conv_of_platdata(struct udevice *dev)
-{
-       struct rk3288_sdram_params *plat = dev_get_platdata(dev);
-       struct dtd_rockchip_rk3288_dmc *of_plat = &plat->of_plat;
-       int ret;
-
-       memcpy(&plat->pctl_timing, of_plat->rockchip_pctl_timing,
-              sizeof(plat->pctl_timing));
-       memcpy(&plat->phy_timing, of_plat->rockchip_phy_timing,
-              sizeof(plat->phy_timing));
-       memcpy(&plat->base, of_plat->rockchip_sdram_params, sizeof(plat->base));
-       /* Rk3288 supports dual-channel, set default channel num to 2 */
-       plat->num_channels = 2;
-       ret = regmap_init_mem_platdata(dev, of_plat->reg,
-                                      ARRAY_SIZE(of_plat->reg) / 2,
-                                      &plat->map);
-       if (ret)
-               return ret;
-
-       return 0;
-}
-#endif
-
-static int rk3288_dmc_probe(struct udevice *dev)
-{
-#ifdef CONFIG_SPL_BUILD
-       struct rk3288_sdram_params *plat = dev_get_platdata(dev);
-       struct udevice *dev_clk;
-       struct regmap *map;
-       int ret;
-#endif
-       struct dram_info *priv = dev_get_priv(dev);
-
-       priv->pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU);
-#ifdef CONFIG_SPL_BUILD
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-       ret = conv_of_platdata(dev);
-       if (ret)
-               return ret;
-#endif
-       map = syscon_get_regmap_by_driver_data(ROCKCHIP_SYSCON_NOC);
-       if (IS_ERR(map))
-               return PTR_ERR(map);
-       priv->chan[0].msch = regmap_get_range(map, 0);
-       priv->chan[1].msch = (struct rk3288_msch *)
-                       (regmap_get_range(map, 0) + 0x80);
-
-       priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
-       priv->sgrf = syscon_get_first_range(ROCKCHIP_SYSCON_SGRF);
-
-       priv->chan[0].pctl = regmap_get_range(plat->map, 0);
-       priv->chan[0].publ = regmap_get_range(plat->map, 1);
-       priv->chan[1].pctl = regmap_get_range(plat->map, 2);
-       priv->chan[1].publ = regmap_get_range(plat->map, 3);
-
-       ret = rockchip_get_clk(&dev_clk);
-       if (ret)
-               return ret;
-       priv->ddr_clk.id = CLK_DDR;
-       ret = clk_request(dev_clk, &priv->ddr_clk);
-       if (ret)
-               return ret;
-
-       priv->cru = rockchip_get_cru();
-       if (IS_ERR(priv->cru))
-               return PTR_ERR(priv->cru);
-       ret = setup_sdram(dev);
-       if (ret)
-               return ret;
-#else
-       priv->info.base = CONFIG_SYS_SDRAM_BASE;
-       priv->info.size = rockchip_sdram_size(
-                       (phys_addr_t)&priv->pmu->sys_reg[2]);
-#endif
-
-       return 0;
-}
-
-static int rk3288_dmc_get_info(struct udevice *dev, struct ram_info *info)
-{
-       struct dram_info *priv = dev_get_priv(dev);
-
-       *info = priv->info;
-
-       return 0;
-}
-
-static struct ram_ops rk3288_dmc_ops = {
-       .get_info = rk3288_dmc_get_info,
-};
-
-static const struct udevice_id rk3288_dmc_ids[] = {
-       { .compatible = "rockchip,rk3288-dmc" },
-       { }
-};
-
-U_BOOT_DRIVER(dmc_rk3288) = {
-       .name = "rockchip_rk3288_dmc",
-       .id = UCLASS_RAM,
-       .of_match = rk3288_dmc_ids,
-       .ops = &rk3288_dmc_ops,
-#ifdef CONFIG_SPL_BUILD
-       .ofdata_to_platdata = rk3288_dmc_ofdata_to_platdata,
-#endif
-       .probe = rk3288_dmc_probe,
-       .priv_auto_alloc_size = sizeof(struct dram_info),
-#ifdef CONFIG_SPL_BUILD
-       .platdata_auto_alloc_size = sizeof(struct rk3288_sdram_params),
-#endif
-};
index 72873e29e6aac1cabf860565cf73f268acb958a4..bbab036a12a5a992dcb160e3f654d7e5ac9aef21 100644 (file)
@@ -6,5 +6,4 @@
 
 obj-y += clk_rk3328.o
 obj-y += rk3328.o
-obj-y += sdram_rk3328.o
 obj-y += syscon_rk3328.o
diff --git a/arch/arm/mach-rockchip/rk3328/sdram_rk3328.c b/arch/arm/mach-rockchip/rk3328/sdram_rk3328.c
deleted file mode 100644 (file)
index 9637a35..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * (C) Copyright 2017 Rockchip Electronics Co., Ltd.
- *
- * SPDX-License-Identifier:     GPL-2.0
- */
-
-#include <common.h>
-#include <dm.h>
-#include <ram.h>
-#include <syscon.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/grf_rk3328.h>
-#include <asm/arch/sdram_common.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-struct dram_info {
-       struct ram_info info;
-       struct rk3328_grf_regs *grf;
-};
-
-static int rk3328_dmc_probe(struct udevice *dev)
-{
-       struct dram_info *priv = dev_get_priv(dev);
-
-       priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
-       debug("%s: grf=%p\n", __func__, priv->grf);
-       priv->info.base = CONFIG_SYS_SDRAM_BASE;
-       priv->info.size = rockchip_sdram_size(
-                               (phys_addr_t)&priv->grf->os_reg[2]);
-
-       return 0;
-}
-
-static int rk3328_dmc_get_info(struct udevice *dev, struct ram_info *info)
-{
-       struct dram_info *priv = dev_get_priv(dev);
-
-       *info = priv->info;
-
-       return 0;
-}
-
-static struct ram_ops rk3328_dmc_ops = {
-       .get_info = rk3328_dmc_get_info,
-};
-
-
-static const struct udevice_id rk3328_dmc_ids[] = {
-       { .compatible = "rockchip,rk3328-dmc" },
-       { }
-};
-
-U_BOOT_DRIVER(dmc_rk3328) = {
-       .name = "rockchip_rk3328_dmc",
-       .id = UCLASS_RAM,
-       .of_match = rk3328_dmc_ids,
-       .ops = &rk3328_dmc_ops,
-       .probe = rk3328_dmc_probe,
-       .priv_auto_alloc_size = sizeof(struct dram_info),
-};
index cabf34448643ef232288833321a0bbe218a803f6..72d2c97d36367a8df193feb4a9f01344a095501d 100644 (file)
@@ -38,13 +38,13 @@ void board_init_f(ulong dummy)
        /* Set up our preloader console */
        ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
        if (ret) {
-               error("%s: pinctrl init failed: %d\n", __func__, ret);
+               pr_err("%s: pinctrl init failed: %d\n", __func__, ret);
                hang();
        }
 
        ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART0);
        if (ret) {
-               error("%s: failed to set up console UART\n", __func__);
+               pr_err("%s: failed to set up console UART\n", __func__);
                hang();
        }
 
index 34061564478d165742f3f1abc719f017e77e7014..9c20f56dc949c468bab0589f06f480988d59ecef 100644 (file)
@@ -1,10 +1,12 @@
 /*
  * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
+#include <asm/arch/bootrom.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/grf_rk3399.h>
 #include <asm/arch/hardware.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+void board_return_to_bootrom(void)
+{
+       back_to_bootrom();
+}
+
+static const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
+       [BROM_BOOTSOURCE_EMMC] = "/sdhci@fe330000",
+       [BROM_BOOTSOURCE_SPINOR] = "/spi@ff1d0000",
+       [BROM_BOOTSOURCE_SD] = "/dwmmc@fe320000",
+};
+
+const char *board_spl_was_booted_from(void)
+{
+       u32  bootdevice_brom_id = readl(RK3399_BROM_BOOTSOURCE_ID_ADDR);
+       const char *bootdevice_ofpath = NULL;
+
+       if (bootdevice_brom_id < ARRAY_SIZE(boot_devices))
+               bootdevice_ofpath = boot_devices[bootdevice_brom_id];
+
+       if (bootdevice_ofpath)
+               debug("%s: brom_bootdevice_id %x maps to '%s'\n",
+                     __func__, bootdevice_brom_id, bootdevice_ofpath);
+       else
+               debug("%s: failed to resolve brom_bootdevice_id %x\n",
+                     __func__, bootdevice_brom_id);
+
+       return bootdevice_ofpath;
+}
+
 u32 spl_boot_device(void)
 {
-       return BOOT_DEVICE_MMC1;
+       u32 boot_device = BOOT_DEVICE_MMC1;
+
+       if (CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM))
+               return BOOT_DEVICE_BOOTROM;
+
+       return boot_device;
 }
 
 u32 spl_boot_mode(const u32 boot_device)
@@ -137,37 +173,6 @@ void board_init_f(ulong dummy)
        }
 }
 
-void spl_board_init(void)
-{
-       struct udevice *pinctrl;
-       int ret;
-
-       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-       if (ret) {
-               debug("%s: Cannot find pinctrl device\n", __func__);
-               goto err;
-       }
-
-       /* Enable debug UART */
-       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
-       if (ret) {
-               debug("%s: Failed to set up console UART\n", __func__);
-               goto err;
-       }
-
-       preloader_console_init();
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-       back_to_bootrom();
-#endif
-
-       return;
-err:
-       printf("spl_board_init: Error %d\n", ret);
-
-       /* No way to report error here */
-       hang();
-}
-
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
index 793ce31c12c553f6568cfee65dbaa773e063cec9..98ebeac340d8ccdebaafa003b3a8127ad21b3ce1 100644 (file)
@@ -6,5 +6,4 @@
 
 obj-y += clk_rk3399.o
 obj-y += rk3399.o
-obj-y += sdram_rk3399.o
 obj-y += syscon_rk3399.o
diff --git a/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c b/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c
deleted file mode 100644 (file)
index 5ed4b03..0000000
+++ /dev/null
@@ -1,1238 +0,0 @@
-/*
- * (C) Copyright 2016-2017 Rockchip Inc.
- *
- * SPDX-License-Identifier:     GPL-2.0
- *
- * Adapted from coreboot.
- */
-
-#include <common.h>
-#include <clk.h>
-#include <dm.h>
-#include <dt-structs.h>
-#include <ram.h>
-#include <regmap.h>
-#include <syscon.h>
-#include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/sdram_common.h>
-#include <asm/arch/sdram_rk3399.h>
-#include <asm/arch/cru_rk3399.h>
-#include <asm/arch/grf_rk3399.h>
-#include <asm/arch/hardware.h>
-#include <linux/err.h>
-#include <time.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-struct chan_info {
-       struct rk3399_ddr_pctl_regs *pctl;
-       struct rk3399_ddr_pi_regs *pi;
-       struct rk3399_ddr_publ_regs *publ;
-       struct rk3399_msch_regs *msch;
-};
-
-struct dram_info {
-#ifdef CONFIG_SPL_BUILD
-       struct chan_info chan[2];
-       struct clk ddr_clk;
-       struct rk3399_cru *cru;
-       struct rk3399_pmucru *pmucru;
-       struct rk3399_pmusgrf_regs *pmusgrf;
-       struct rk3399_ddr_cic_regs *cic;
-#endif
-       struct ram_info info;
-       struct rk3399_pmugrf_regs *pmugrf;
-};
-
-#define PRESET_SGRF_HOLD(n)    ((0x1 << (6 + 16)) | ((n) << 6))
-#define PRESET_GPIO0_HOLD(n)   ((0x1 << (7 + 16)) | ((n) << 7))
-#define PRESET_GPIO1_HOLD(n)   ((0x1 << (8 + 16)) | ((n) << 8))
-
-#define PHY_DRV_ODT_Hi_Z       0x0
-#define PHY_DRV_ODT_240                0x1
-#define PHY_DRV_ODT_120                0x8
-#define PHY_DRV_ODT_80         0x9
-#define PHY_DRV_ODT_60         0xc
-#define PHY_DRV_ODT_48         0xd
-#define PHY_DRV_ODT_40         0xe
-#define PHY_DRV_ODT_34_3       0xf
-
-#ifdef CONFIG_SPL_BUILD
-
-struct rockchip_dmc_plat {
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-       struct dtd_rockchip_rk3399_dmc dtplat;
-#else
-       struct rk3399_sdram_params sdram_params;
-#endif
-       struct regmap *map;
-};
-
-static void copy_to_reg(u32 *dest, const u32 *src, u32 n)
-{
-       int i;
-
-       for (i = 0; i < n / sizeof(u32); i++) {
-               writel(*src, dest);
-               src++;
-               dest++;
-       }
-}
-
-static void phy_dll_bypass_set(struct rk3399_ddr_publ_regs *ddr_publ_regs,
-                              u32 freq)
-{
-       u32 *denali_phy = ddr_publ_regs->denali_phy;
-
-       /* From IP spec, only freq small than 125 can enter dll bypass mode */
-       if (freq <= 125) {
-               /* phy_sw_master_mode_X PHY_86/214/342/470 4bits offset_8 */
-               setbits_le32(&denali_phy[86], (0x3 << 2) << 8);
-               setbits_le32(&denali_phy[214], (0x3 << 2) << 8);
-               setbits_le32(&denali_phy[342], (0x3 << 2) << 8);
-               setbits_le32(&denali_phy[470], (0x3 << 2) << 8);
-
-               /* phy_adrctl_sw_master_mode PHY_547/675/803 4bits offset_16 */
-               setbits_le32(&denali_phy[547], (0x3 << 2) << 16);
-               setbits_le32(&denali_phy[675], (0x3 << 2) << 16);
-               setbits_le32(&denali_phy[803], (0x3 << 2) << 16);
-       } else {
-               /* phy_sw_master_mode_X PHY_86/214/342/470 4bits offset_8 */
-               clrbits_le32(&denali_phy[86], (0x3 << 2) << 8);
-               clrbits_le32(&denali_phy[214], (0x3 << 2) << 8);
-               clrbits_le32(&denali_phy[342], (0x3 << 2) << 8);
-               clrbits_le32(&denali_phy[470], (0x3 << 2) << 8);
-
-               /* phy_adrctl_sw_master_mode PHY_547/675/803 4bits offset_16 */
-               clrbits_le32(&denali_phy[547], (0x3 << 2) << 16);
-               clrbits_le32(&denali_phy[675], (0x3 << 2) << 16);
-               clrbits_le32(&denali_phy[803], (0x3 << 2) << 16);
-       }
-}
-
-static void set_memory_map(const struct chan_info *chan, u32 channel,
-                          const struct rk3399_sdram_params *sdram_params)
-{
-       const struct rk3399_sdram_channel *sdram_ch =
-               &sdram_params->ch[channel];
-       u32 *denali_ctl = chan->pctl->denali_ctl;
-       u32 *denali_pi = chan->pi->denali_pi;
-       u32 cs_map;
-       u32 reduc;
-       u32 row;
-
-       /* Get row number from ddrconfig setting */
-       if (sdram_ch->ddrconfig < 2 || sdram_ch->ddrconfig == 4)
-               row = 16;
-       else if (sdram_ch->ddrconfig == 3)
-               row = 14;
-       else
-               row = 15;
-
-       cs_map = (sdram_ch->rank > 1) ? 3 : 1;
-       reduc = (sdram_ch->bw == 2) ? 0 : 1;
-
-       /* Set the dram configuration to ctrl */
-       clrsetbits_le32(&denali_ctl[191], 0xF, (12 - sdram_ch->col));
-       clrsetbits_le32(&denali_ctl[190], (0x3 << 16) | (0x7 << 24),
-                       ((3 - sdram_ch->bk) << 16) |
-                       ((16 - row) << 24));
-
-       clrsetbits_le32(&denali_ctl[196], 0x3 | (1 << 16),
-                       cs_map | (reduc << 16));
-
-       /* PI_199 PI_COL_DIFF:RW:0:4 */
-       clrsetbits_le32(&denali_pi[199], 0xF, (12 - sdram_ch->col));
-
-       /* PI_155 PI_ROW_DIFF:RW:24:3 PI_BANK_DIFF:RW:16:2 */
-       clrsetbits_le32(&denali_pi[155], (0x3 << 16) | (0x7 << 24),
-                       ((3 - sdram_ch->bk) << 16) |
-                       ((16 - row) << 24));
-       /* PI_41 PI_CS_MAP:RW:24:4 */
-       clrsetbits_le32(&denali_pi[41], 0xf << 24, cs_map << 24);
-       if ((sdram_ch->rank == 1) && (sdram_params->base.dramtype == DDR3))
-               writel(0x2EC7FFFF, &denali_pi[34]);
-}
-
-static void set_ds_odt(const struct chan_info *chan,
-                      const struct rk3399_sdram_params *sdram_params)
-{
-       u32 *denali_phy = chan->publ->denali_phy;
-
-       u32 tsel_idle_en, tsel_wr_en, tsel_rd_en;
-       u32 tsel_idle_select_p, tsel_wr_select_p, tsel_rd_select_p;
-       u32 ca_tsel_wr_select_p, ca_tsel_wr_select_n;
-       u32 tsel_idle_select_n, tsel_wr_select_n, tsel_rd_select_n;
-       u32 reg_value;
-
-       if (sdram_params->base.dramtype == LPDDR4) {
-               tsel_rd_select_p = PHY_DRV_ODT_Hi_Z;
-               tsel_wr_select_p = PHY_DRV_ODT_40;
-               ca_tsel_wr_select_p = PHY_DRV_ODT_40;
-               tsel_idle_select_p = PHY_DRV_ODT_Hi_Z;
-
-               tsel_rd_select_n = PHY_DRV_ODT_240;
-               tsel_wr_select_n = PHY_DRV_ODT_40;
-               ca_tsel_wr_select_n = PHY_DRV_ODT_40;
-               tsel_idle_select_n = PHY_DRV_ODT_240;
-       } else if (sdram_params->base.dramtype == LPDDR3) {
-               tsel_rd_select_p = PHY_DRV_ODT_240;
-               tsel_wr_select_p = PHY_DRV_ODT_34_3;
-               ca_tsel_wr_select_p = PHY_DRV_ODT_48;
-               tsel_idle_select_p = PHY_DRV_ODT_240;
-
-               tsel_rd_select_n = PHY_DRV_ODT_Hi_Z;
-               tsel_wr_select_n = PHY_DRV_ODT_34_3;
-               ca_tsel_wr_select_n = PHY_DRV_ODT_48;
-               tsel_idle_select_n = PHY_DRV_ODT_Hi_Z;
-       } else {
-               tsel_rd_select_p = PHY_DRV_ODT_240;
-               tsel_wr_select_p = PHY_DRV_ODT_34_3;
-               ca_tsel_wr_select_p = PHY_DRV_ODT_34_3;
-               tsel_idle_select_p = PHY_DRV_ODT_240;
-
-               tsel_rd_select_n = PHY_DRV_ODT_240;
-               tsel_wr_select_n = PHY_DRV_ODT_34_3;
-               ca_tsel_wr_select_n = PHY_DRV_ODT_34_3;
-               tsel_idle_select_n = PHY_DRV_ODT_240;
-       }
-
-       if (sdram_params->base.odt == 1)
-               tsel_rd_en = 1;
-       else
-               tsel_rd_en = 0;
-
-       tsel_wr_en = 0;
-       tsel_idle_en = 0;
-
-       /*
-        * phy_dq_tsel_select_X 24bits DENALI_PHY_6/134/262/390 offset_0
-        * sets termination values for read/idle cycles and drive strength
-        * for write cycles for DQ/DM
-        */
-       reg_value = tsel_rd_select_n | (tsel_rd_select_p << 0x4) |
-                   (tsel_wr_select_n << 8) | (tsel_wr_select_p << 12) |
-                   (tsel_idle_select_n << 16) | (tsel_idle_select_p << 20);
-       clrsetbits_le32(&denali_phy[6], 0xffffff, reg_value);
-       clrsetbits_le32(&denali_phy[134], 0xffffff, reg_value);
-       clrsetbits_le32(&denali_phy[262], 0xffffff, reg_value);
-       clrsetbits_le32(&denali_phy[390], 0xffffff, reg_value);
-
-       /*
-        * phy_dqs_tsel_select_X 24bits DENALI_PHY_7/135/263/391 offset_0
-        * sets termination values for read/idle cycles and drive strength
-        * for write cycles for DQS
-        */
-       clrsetbits_le32(&denali_phy[7], 0xffffff, reg_value);
-       clrsetbits_le32(&denali_phy[135], 0xffffff, reg_value);
-       clrsetbits_le32(&denali_phy[263], 0xffffff, reg_value);
-       clrsetbits_le32(&denali_phy[391], 0xffffff, reg_value);
-
-       /* phy_adr_tsel_select_ 8bits DENALI_PHY_544/672/800 offset_0 */
-       reg_value = ca_tsel_wr_select_n | (ca_tsel_wr_select_p << 0x4);
-       clrsetbits_le32(&denali_phy[544], 0xff, reg_value);
-       clrsetbits_le32(&denali_phy[672], 0xff, reg_value);
-       clrsetbits_le32(&denali_phy[800], 0xff, reg_value);
-
-       /* phy_pad_addr_drive 8bits DENALI_PHY_928 offset_0 */
-       clrsetbits_le32(&denali_phy[928], 0xff, reg_value);
-
-       /* phy_pad_rst_drive 8bits DENALI_PHY_937 offset_0 */
-       clrsetbits_le32(&denali_phy[937], 0xff, reg_value);
-
-       /* phy_pad_cke_drive 8bits DENALI_PHY_935 offset_0 */
-       clrsetbits_le32(&denali_phy[935], 0xff, reg_value);
-
-       /* phy_pad_cs_drive 8bits DENALI_PHY_939 offset_0 */
-       clrsetbits_le32(&denali_phy[939], 0xff, reg_value);
-
-       /* phy_pad_clk_drive 8bits DENALI_PHY_929 offset_0 */
-       clrsetbits_le32(&denali_phy[929], 0xff, reg_value);
-
-       /* phy_pad_fdbk_drive 23bit DENALI_PHY_924/925 */
-       clrsetbits_le32(&denali_phy[924], 0xff,
-                       tsel_wr_select_n | (tsel_wr_select_p << 4));
-       clrsetbits_le32(&denali_phy[925], 0xff,
-                       tsel_rd_select_n | (tsel_rd_select_p << 4));
-
-       /* phy_dq_tsel_enable_X 3bits DENALI_PHY_5/133/261/389 offset_16 */
-       reg_value = (tsel_rd_en | (tsel_wr_en << 1) | (tsel_idle_en << 2))
-               << 16;
-       clrsetbits_le32(&denali_phy[5], 0x7 << 16, reg_value);
-       clrsetbits_le32(&denali_phy[133], 0x7 << 16, reg_value);
-       clrsetbits_le32(&denali_phy[261], 0x7 << 16, reg_value);
-       clrsetbits_le32(&denali_phy[389], 0x7 << 16, reg_value);
-
-       /* phy_dqs_tsel_enable_X 3bits DENALI_PHY_6/134/262/390 offset_24 */
-       reg_value = (tsel_rd_en | (tsel_wr_en << 1) | (tsel_idle_en << 2))
-               << 24;
-       clrsetbits_le32(&denali_phy[6], 0x7 << 24, reg_value);
-       clrsetbits_le32(&denali_phy[134], 0x7 << 24, reg_value);
-       clrsetbits_le32(&denali_phy[262], 0x7 << 24, reg_value);
-       clrsetbits_le32(&denali_phy[390], 0x7 << 24, reg_value);
-
-       /* phy_adr_tsel_enable_ 1bit DENALI_PHY_518/646/774 offset_8 */
-       reg_value = tsel_wr_en << 8;
-       clrsetbits_le32(&denali_phy[518], 0x1 << 8, reg_value);
-       clrsetbits_le32(&denali_phy[646], 0x1 << 8, reg_value);
-       clrsetbits_le32(&denali_phy[774], 0x1 << 8, reg_value);
-
-       /* phy_pad_addr_term tsel 1bit DENALI_PHY_933 offset_17 */
-       reg_value = tsel_wr_en << 17;
-       clrsetbits_le32(&denali_phy[933], 0x1 << 17, reg_value);
-       /*
-        * pad_rst/cke/cs/clk_term tsel 1bits
-        * DENALI_PHY_938/936/940/934 offset_17
-        */
-       clrsetbits_le32(&denali_phy[938], 0x1 << 17, reg_value);
-       clrsetbits_le32(&denali_phy[936], 0x1 << 17, reg_value);
-       clrsetbits_le32(&denali_phy[940], 0x1 << 17, reg_value);
-       clrsetbits_le32(&denali_phy[934], 0x1 << 17, reg_value);
-
-       /* phy_pad_fdbk_term 1bit DENALI_PHY_930 offset_17 */
-       clrsetbits_le32(&denali_phy[930], 0x1 << 17, reg_value);
-}
-
-static int phy_io_config(const struct chan_info *chan,
-                         const struct rk3399_sdram_params *sdram_params)
-{
-       u32 *denali_phy = chan->publ->denali_phy;
-       u32 vref_mode_dq, vref_value_dq, vref_mode_ac, vref_value_ac;
-       u32 mode_sel;
-       u32 reg_value;
-       u32 drv_value, odt_value;
-       u32 speed;
-
-       /* vref setting */
-       if (sdram_params->base.dramtype == LPDDR4) {
-               /* LPDDR4 */
-               vref_mode_dq = 0x6;
-               vref_value_dq = 0x1f;
-               vref_mode_ac = 0x6;
-               vref_value_ac = 0x1f;
-       } else if (sdram_params->base.dramtype == LPDDR3) {
-               if (sdram_params->base.odt == 1) {
-                       vref_mode_dq = 0x5;  /* LPDDR3 ODT */
-                       drv_value = (readl(&denali_phy[6]) >> 12) & 0xf;
-                       odt_value = (readl(&denali_phy[6]) >> 4) & 0xf;
-                       if (drv_value == PHY_DRV_ODT_48) {
-                               switch (odt_value) {
-                               case PHY_DRV_ODT_240:
-                                       vref_value_dq = 0x16;
-                                       break;
-                               case PHY_DRV_ODT_120:
-                                       vref_value_dq = 0x26;
-                                       break;
-                               case PHY_DRV_ODT_60:
-                                       vref_value_dq = 0x36;
-                                       break;
-                               default:
-                                       debug("Invalid ODT value.\n");
-                                       return -EINVAL;
-                               }
-                       } else if (drv_value == PHY_DRV_ODT_40) {
-                               switch (odt_value) {
-                               case PHY_DRV_ODT_240:
-                                       vref_value_dq = 0x19;
-                                       break;
-                               case PHY_DRV_ODT_120:
-                                       vref_value_dq = 0x23;
-                                       break;
-                               case PHY_DRV_ODT_60:
-                                       vref_value_dq = 0x31;
-                                       break;
-                               default:
-                                       debug("Invalid ODT value.\n");
-                                       return -EINVAL;
-                               }
-                       } else if (drv_value == PHY_DRV_ODT_34_3) {
-                               switch (odt_value) {
-                               case PHY_DRV_ODT_240:
-                                       vref_value_dq = 0x17;
-                                       break;
-                               case PHY_DRV_ODT_120:
-                                       vref_value_dq = 0x20;
-                                       break;
-                               case PHY_DRV_ODT_60:
-                                       vref_value_dq = 0x2e;
-                                       break;
-                               default:
-                                       debug("Invalid ODT value.\n");
-                                       return -EINVAL;
-                               }
-                       } else {
-                               debug("Invalid DRV value.\n");
-                               return -EINVAL;
-                       }
-               } else {
-                       vref_mode_dq = 0x2;  /* LPDDR3 */
-                       vref_value_dq = 0x1f;
-               }
-               vref_mode_ac = 0x2;
-               vref_value_ac = 0x1f;
-       } else if (sdram_params->base.dramtype == DDR3) {
-               /* DDR3L */
-               vref_mode_dq = 0x1;
-               vref_value_dq = 0x1f;
-               vref_mode_ac = 0x1;
-               vref_value_ac = 0x1f;
-       } else {
-               debug("Unknown DRAM type.\n");
-               return -EINVAL;
-       }
-
-       reg_value = (vref_mode_dq << 9) | (0x1 << 8) | vref_value_dq;
-
-       /* PHY_913 PHY_PAD_VREF_CTRL_DQ_0 12bits offset_8 */
-       clrsetbits_le32(&denali_phy[913], 0xfff << 8, reg_value << 8);
-       /* PHY_914 PHY_PAD_VREF_CTRL_DQ_1 12bits offset_0 */
-       clrsetbits_le32(&denali_phy[914], 0xfff, reg_value);
-       /* PHY_914 PHY_PAD_VREF_CTRL_DQ_2 12bits offset_16 */
-       clrsetbits_le32(&denali_phy[914], 0xfff << 16, reg_value << 16);
-       /* PHY_915 PHY_PAD_VREF_CTRL_DQ_3 12bits offset_0 */
-       clrsetbits_le32(&denali_phy[915], 0xfff, reg_value);
-
-       reg_value = (vref_mode_ac << 9) | (0x1 << 8) | vref_value_ac;
-
-       /* PHY_915 PHY_PAD_VREF_CTRL_AC 12bits offset_16 */
-       clrsetbits_le32(&denali_phy[915], 0xfff << 16, reg_value << 16);
-
-       if (sdram_params->base.dramtype == LPDDR4)
-               mode_sel = 0x6;
-       else if (sdram_params->base.dramtype == LPDDR3)
-               mode_sel = 0x0;
-       else if (sdram_params->base.dramtype == DDR3)
-               mode_sel = 0x1;
-       else
-               return -EINVAL;
-
-       /* PHY_924 PHY_PAD_FDBK_DRIVE */
-       clrsetbits_le32(&denali_phy[924], 0x7 << 15, mode_sel << 15);
-       /* PHY_926 PHY_PAD_DATA_DRIVE */
-       clrsetbits_le32(&denali_phy[926], 0x7 << 6, mode_sel << 6);
-       /* PHY_927 PHY_PAD_DQS_DRIVE */
-       clrsetbits_le32(&denali_phy[927], 0x7 << 6, mode_sel << 6);
-       /* PHY_928 PHY_PAD_ADDR_DRIVE */
-       clrsetbits_le32(&denali_phy[928], 0x7 << 14, mode_sel << 14);
-       /* PHY_929 PHY_PAD_CLK_DRIVE */
-       clrsetbits_le32(&denali_phy[929], 0x7 << 14, mode_sel << 14);
-       /* PHY_935 PHY_PAD_CKE_DRIVE */
-       clrsetbits_le32(&denali_phy[935], 0x7 << 14, mode_sel << 14);
-       /* PHY_937 PHY_PAD_RST_DRIVE */
-       clrsetbits_le32(&denali_phy[937], 0x7 << 14, mode_sel << 14);
-       /* PHY_939 PHY_PAD_CS_DRIVE */
-       clrsetbits_le32(&denali_phy[939], 0x7 << 14, mode_sel << 14);
-
-
-       /* speed setting */
-       if (sdram_params->base.ddr_freq < 400)
-               speed = 0x0;
-       else if (sdram_params->base.ddr_freq < 800)
-               speed = 0x1;
-       else if (sdram_params->base.ddr_freq < 1200)
-               speed = 0x2;
-       else
-               speed = 0x3;
-
-       /* PHY_924 PHY_PAD_FDBK_DRIVE */
-       clrsetbits_le32(&denali_phy[924], 0x3 << 21, speed << 21);
-       /* PHY_926 PHY_PAD_DATA_DRIVE */
-       clrsetbits_le32(&denali_phy[926], 0x3 << 9, speed << 9);
-       /* PHY_927 PHY_PAD_DQS_DRIVE */
-       clrsetbits_le32(&denali_phy[927], 0x3 << 9, speed << 9);
-       /* PHY_928 PHY_PAD_ADDR_DRIVE */
-       clrsetbits_le32(&denali_phy[928], 0x3 << 17, speed << 17);
-       /* PHY_929 PHY_PAD_CLK_DRIVE */
-       clrsetbits_le32(&denali_phy[929], 0x3 << 17, speed << 17);
-       /* PHY_935 PHY_PAD_CKE_DRIVE */
-       clrsetbits_le32(&denali_phy[935], 0x3 << 17, speed << 17);
-       /* PHY_937 PHY_PAD_RST_DRIVE */
-       clrsetbits_le32(&denali_phy[937], 0x3 << 17, speed << 17);
-       /* PHY_939 PHY_PAD_CS_DRIVE */
-       clrsetbits_le32(&denali_phy[939], 0x3 << 17, speed << 17);
-
-       return 0;
-}
-
-static int pctl_cfg(const struct chan_info *chan, u32 channel,
-                   const struct rk3399_sdram_params *sdram_params)
-{
-       u32 *denali_ctl = chan->pctl->denali_ctl;
-       u32 *denali_pi = chan->pi->denali_pi;
-       u32 *denali_phy = chan->publ->denali_phy;
-       const u32 *params_ctl = sdram_params->pctl_regs.denali_ctl;
-       const u32 *params_phy = sdram_params->phy_regs.denali_phy;
-       u32 tmp, tmp1, tmp2;
-       u32 pwrup_srefresh_exit;
-       int ret;
-       const ulong timeout_ms = 200;
-
-       /*
-        * work around controller bug:
-        * Do not program DRAM_CLASS until NO_PHY_IND_TRAIN_INT is programmed
-        */
-       copy_to_reg(&denali_ctl[1], &params_ctl[1],
-                   sizeof(struct rk3399_ddr_pctl_regs) - 4);
-       writel(params_ctl[0], &denali_ctl[0]);
-       copy_to_reg(denali_pi, &sdram_params->pi_regs.denali_pi[0],
-                   sizeof(struct rk3399_ddr_pi_regs));
-       /* rank count need to set for init */
-       set_memory_map(chan, channel, sdram_params);
-
-       writel(sdram_params->phy_regs.denali_phy[910], &denali_phy[910]);
-       writel(sdram_params->phy_regs.denali_phy[911], &denali_phy[911]);
-       writel(sdram_params->phy_regs.denali_phy[912], &denali_phy[912]);
-
-       pwrup_srefresh_exit = readl(&denali_ctl[68]) & PWRUP_SREFRESH_EXIT;
-       clrbits_le32(&denali_ctl[68], PWRUP_SREFRESH_EXIT);
-
-       /* PHY_DLL_RST_EN */
-       clrsetbits_le32(&denali_phy[957], 0x3 << 24, 1 << 24);
-
-       setbits_le32(&denali_pi[0], START);
-       setbits_le32(&denali_ctl[0], START);
-
-       /* Wating for phy DLL lock */
-       while (1) {
-               tmp = readl(&denali_phy[920]);
-               tmp1 = readl(&denali_phy[921]);
-               tmp2 = readl(&denali_phy[922]);
-               if ((((tmp >> 16) & 0x1) == 0x1) &&
-                   (((tmp1 >> 16) & 0x1) == 0x1) &&
-                   (((tmp1 >> 0) & 0x1) == 0x1) &&
-                   (((tmp2 >> 0) & 0x1) == 0x1))
-                       break;
-       }
-
-       copy_to_reg(&denali_phy[896], &params_phy[896], (958 - 895) * 4);
-       copy_to_reg(&denali_phy[0], &params_phy[0], (90 - 0 + 1) * 4);
-       copy_to_reg(&denali_phy[128], &params_phy[128], (218 - 128 + 1) * 4);
-       copy_to_reg(&denali_phy[256], &params_phy[256], (346 - 256 + 1) * 4);
-       copy_to_reg(&denali_phy[384], &params_phy[384], (474 - 384 + 1) * 4);
-       copy_to_reg(&denali_phy[512], &params_phy[512], (549 - 512 + 1) * 4);
-       copy_to_reg(&denali_phy[640], &params_phy[640], (677 - 640 + 1) * 4);
-       copy_to_reg(&denali_phy[768], &params_phy[768], (805 - 768 + 1) * 4);
-       set_ds_odt(chan, sdram_params);
-
-       /*
-        * phy_dqs_tsel_wr_timing_X 8bits DENALI_PHY_84/212/340/468 offset_8
-        * dqs_tsel_wr_end[7:4] add Half cycle
-        */
-       tmp = (readl(&denali_phy[84]) >> 8) & 0xff;
-       clrsetbits_le32(&denali_phy[84], 0xff << 8, (tmp + 0x10) << 8);
-       tmp = (readl(&denali_phy[212]) >> 8) & 0xff;
-       clrsetbits_le32(&denali_phy[212], 0xff << 8, (tmp + 0x10) << 8);
-       tmp = (readl(&denali_phy[340]) >> 8) & 0xff;
-       clrsetbits_le32(&denali_phy[340], 0xff << 8, (tmp + 0x10) << 8);
-       tmp = (readl(&denali_phy[468]) >> 8) & 0xff;
-       clrsetbits_le32(&denali_phy[468], 0xff << 8, (tmp + 0x10) << 8);
-
-       /*
-        * phy_dqs_tsel_wr_timing_X 8bits DENALI_PHY_83/211/339/467 offset_8
-        * dq_tsel_wr_end[7:4] add Half cycle
-        */
-       tmp = (readl(&denali_phy[83]) >> 16) & 0xff;
-       clrsetbits_le32(&denali_phy[83], 0xff << 16, (tmp + 0x10) << 16);
-       tmp = (readl(&denali_phy[211]) >> 16) & 0xff;
-       clrsetbits_le32(&denali_phy[211], 0xff << 16, (tmp + 0x10) << 16);
-       tmp = (readl(&denali_phy[339]) >> 16) & 0xff;
-       clrsetbits_le32(&denali_phy[339], 0xff << 16, (tmp + 0x10) << 16);
-       tmp = (readl(&denali_phy[467]) >> 16) & 0xff;
-       clrsetbits_le32(&denali_phy[467], 0xff << 16, (tmp + 0x10) << 16);
-
-       ret = phy_io_config(chan, sdram_params);
-       if (ret)
-               return ret;
-
-       /* PHY_DLL_RST_EN */
-       clrsetbits_le32(&denali_phy[957], 0x3 << 24, 0x2 << 24);
-
-       /* Wating for PHY and DRAM init complete */
-       tmp = get_timer(0);
-       do {
-               if (get_timer(tmp) > timeout_ms) {
-                       error("DRAM (%s): phy failed to lock within  %ld ms\n",
-                             __func__, timeout_ms);
-                       return -ETIME;
-               }
-       } while (!(readl(&denali_ctl[203]) & (1 << 3)));
-       debug("DRAM (%s): phy locked after %ld ms\n", __func__, get_timer(tmp));
-
-       clrsetbits_le32(&denali_ctl[68], PWRUP_SREFRESH_EXIT,
-                       pwrup_srefresh_exit);
-       return 0;
-}
-
-static void select_per_cs_training_index(const struct chan_info *chan,
-                                        u32 rank)
-{
-       u32 *denali_phy = chan->publ->denali_phy;
-
-       /* PHY_84 PHY_PER_CS_TRAINING_EN_0 1bit offset_16 */
-       if ((readl(&denali_phy[84])>>16) & 1) {
-               /*
-                * PHY_8/136/264/392
-                * phy_per_cs_training_index_X 1bit offset_24
-                */
-               clrsetbits_le32(&denali_phy[8], 0x1 << 24, rank << 24);
-               clrsetbits_le32(&denali_phy[136], 0x1 << 24, rank << 24);
-               clrsetbits_le32(&denali_phy[264], 0x1 << 24, rank << 24);
-               clrsetbits_le32(&denali_phy[392], 0x1 << 24, rank << 24);
-       }
-}
-
-static void override_write_leveling_value(const struct chan_info *chan)
-{
-       u32 *denali_ctl = chan->pctl->denali_ctl;
-       u32 *denali_phy = chan->publ->denali_phy;
-       u32 byte;
-
-       /* PHY_896 PHY_FREQ_SEL_MULTICAST_EN 1bit offset_0 */
-       setbits_le32(&denali_phy[896], 1);
-
-       /*
-        * PHY_8/136/264/392
-        * phy_per_cs_training_multicast_en_X 1bit offset_16
-        */
-       clrsetbits_le32(&denali_phy[8], 0x1 << 16, 1 << 16);
-       clrsetbits_le32(&denali_phy[136], 0x1 << 16, 1 << 16);
-       clrsetbits_le32(&denali_phy[264], 0x1 << 16, 1 << 16);
-       clrsetbits_le32(&denali_phy[392], 0x1 << 16, 1 << 16);
-
-       for (byte = 0; byte < 4; byte++)
-               clrsetbits_le32(&denali_phy[63 + (128 * byte)], 0xffff << 16,
-                               0x200 << 16);
-
-       /* PHY_896 PHY_FREQ_SEL_MULTICAST_EN 1bit offset_0 */
-       clrbits_le32(&denali_phy[896], 1);
-
-       /* CTL_200 ctrlupd_req 1bit offset_8 */
-       clrsetbits_le32(&denali_ctl[200], 0x1 << 8, 0x1 << 8);
-}
-
-static int data_training_ca(const struct chan_info *chan, u32 channel,
-                           const struct rk3399_sdram_params *sdram_params)
-{
-       u32 *denali_pi = chan->pi->denali_pi;
-       u32 *denali_phy = chan->publ->denali_phy;
-       u32 i, tmp;
-       u32 obs_0, obs_1, obs_2, obs_err = 0;
-       u32 rank = sdram_params->ch[channel].rank;
-
-       for (i = 0; i < rank; i++) {
-               select_per_cs_training_index(chan, i);
-               /* PI_100 PI_CALVL_EN:RW:8:2 */
-               clrsetbits_le32(&denali_pi[100], 0x3 << 8, 0x2 << 8);
-               /* PI_92 PI_CALVL_REQ:WR:16:1,PI_CALVL_CS:RW:24:2 */
-               clrsetbits_le32(&denali_pi[92],
-                               (0x1 << 16) | (0x3 << 24),
-                               (0x1 << 16) | (i << 24));
-
-               /* Waiting for training complete */
-               while (1) {
-                       /* PI_174 PI_INT_STATUS:RD:8:18 */
-                       tmp = readl(&denali_pi[174]) >> 8;
-                       /*
-                        * check status obs
-                        * PHY_532/660/789 phy_adr_calvl_obs1_:0:32
-                        */
-                       obs_0 = readl(&denali_phy[532]);
-                       obs_1 = readl(&denali_phy[660]);
-                       obs_2 = readl(&denali_phy[788]);
-                       if (((obs_0 >> 30) & 0x3) ||
-                           ((obs_1 >> 30) & 0x3) ||
-                           ((obs_2 >> 30) & 0x3))
-                               obs_err = 1;
-                       if ((((tmp >> 11) & 0x1) == 0x1) &&
-                           (((tmp >> 13) & 0x1) == 0x1) &&
-                           (((tmp >> 5) & 0x1) == 0x0) &&
-                           (obs_err == 0))
-                               break;
-                       else if ((((tmp >> 5) & 0x1) == 0x1) ||
-                                (obs_err == 1))
-                               return -EIO;
-               }
-               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
-               writel(0x00003f7c, (&denali_pi[175]));
-       }
-       clrbits_le32(&denali_pi[100], 0x3 << 8);
-
-       return 0;
-}
-
-static int data_training_wl(const struct chan_info *chan, u32 channel,
-                           const struct rk3399_sdram_params *sdram_params)
-{
-       u32 *denali_pi = chan->pi->denali_pi;
-       u32 *denali_phy = chan->publ->denali_phy;
-       u32 i, tmp;
-       u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0;
-       u32 rank = sdram_params->ch[channel].rank;
-
-       for (i = 0; i < rank; i++) {
-               select_per_cs_training_index(chan, i);
-               /* PI_60 PI_WRLVL_EN:RW:8:2 */
-               clrsetbits_le32(&denali_pi[60], 0x3 << 8, 0x2 << 8);
-               /* PI_59 PI_WRLVL_REQ:WR:8:1,PI_WRLVL_CS:RW:16:2 */
-               clrsetbits_le32(&denali_pi[59],
-                               (0x1 << 8) | (0x3 << 16),
-                               (0x1 << 8) | (i << 16));
-
-               /* Waiting for training complete */
-               while (1) {
-                       /* PI_174 PI_INT_STATUS:RD:8:18 */
-                       tmp = readl(&denali_pi[174]) >> 8;
-
-                       /*
-                        * check status obs, if error maybe can not
-                        * get leveling done PHY_40/168/296/424
-                        * phy_wrlvl_status_obs_X:0:13
-                        */
-                       obs_0 = readl(&denali_phy[40]);
-                       obs_1 = readl(&denali_phy[168]);
-                       obs_2 = readl(&denali_phy[296]);
-                       obs_3 = readl(&denali_phy[424]);
-                       if (((obs_0 >> 12) & 0x1) ||
-                           ((obs_1 >> 12) & 0x1) ||
-                           ((obs_2 >> 12) & 0x1) ||
-                           ((obs_3 >> 12) & 0x1))
-                               obs_err = 1;
-                       if ((((tmp >> 10) & 0x1) == 0x1) &&
-                           (((tmp >> 13) & 0x1) == 0x1) &&
-                           (((tmp >> 4) & 0x1) == 0x0) &&
-                           (obs_err == 0))
-                               break;
-                       else if ((((tmp >> 4) & 0x1) == 0x1) ||
-                                (obs_err == 1))
-                               return -EIO;
-               }
-               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
-               writel(0x00003f7c, (&denali_pi[175]));
-       }
-
-       override_write_leveling_value(chan);
-       clrbits_le32(&denali_pi[60], 0x3 << 8);
-
-       return 0;
-}
-
-static int data_training_rg(const struct chan_info *chan, u32 channel,
-                           const struct rk3399_sdram_params *sdram_params)
-{
-       u32 *denali_pi = chan->pi->denali_pi;
-       u32 *denali_phy = chan->publ->denali_phy;
-       u32 i, tmp;
-       u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0;
-       u32 rank = sdram_params->ch[channel].rank;
-
-       for (i = 0; i < rank; i++) {
-               select_per_cs_training_index(chan, i);
-               /* PI_80 PI_RDLVL_GATE_EN:RW:24:2 */
-               clrsetbits_le32(&denali_pi[80], 0x3 << 24, 0x2 << 24);
-               /*
-                * PI_74 PI_RDLVL_GATE_REQ:WR:16:1
-                * PI_RDLVL_CS:RW:24:2
-                */
-               clrsetbits_le32(&denali_pi[74],
-                               (0x1 << 16) | (0x3 << 24),
-                               (0x1 << 16) | (i << 24));
-
-               /* Waiting for training complete */
-               while (1) {
-                       /* PI_174 PI_INT_STATUS:RD:8:18 */
-                       tmp = readl(&denali_pi[174]) >> 8;
-
-                       /*
-                        * check status obs
-                        * PHY_43/171/299/427
-                        *     PHY_GTLVL_STATUS_OBS_x:16:8
-                        */
-                       obs_0 = readl(&denali_phy[43]);
-                       obs_1 = readl(&denali_phy[171]);
-                       obs_2 = readl(&denali_phy[299]);
-                       obs_3 = readl(&denali_phy[427]);
-                       if (((obs_0 >> (16 + 6)) & 0x3) ||
-                           ((obs_1 >> (16 + 6)) & 0x3) ||
-                           ((obs_2 >> (16 + 6)) & 0x3) ||
-                           ((obs_3 >> (16 + 6)) & 0x3))
-                               obs_err = 1;
-                       if ((((tmp >> 9) & 0x1) == 0x1) &&
-                           (((tmp >> 13) & 0x1) == 0x1) &&
-                           (((tmp >> 3) & 0x1) == 0x0) &&
-                           (obs_err == 0))
-                               break;
-                       else if ((((tmp >> 3) & 0x1) == 0x1) ||
-                                (obs_err == 1))
-                               return -EIO;
-               }
-               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
-               writel(0x00003f7c, (&denali_pi[175]));
-       }
-       clrbits_le32(&denali_pi[80], 0x3 << 24);
-
-       return 0;
-}
-
-static int data_training_rl(const struct chan_info *chan, u32 channel,
-                           const struct rk3399_sdram_params *sdram_params)
-{
-       u32 *denali_pi = chan->pi->denali_pi;
-       u32 i, tmp;
-       u32 rank = sdram_params->ch[channel].rank;
-
-       for (i = 0; i < rank; i++) {
-               select_per_cs_training_index(chan, i);
-               /* PI_80 PI_RDLVL_EN:RW:16:2 */
-               clrsetbits_le32(&denali_pi[80], 0x3 << 16, 0x2 << 16);
-               /* PI_74 PI_RDLVL_REQ:WR:8:1,PI_RDLVL_CS:RW:24:2 */
-               clrsetbits_le32(&denali_pi[74],
-                               (0x1 << 8) | (0x3 << 24),
-                               (0x1 << 8) | (i << 24));
-
-               /* Waiting for training complete */
-               while (1) {
-                       /* PI_174 PI_INT_STATUS:RD:8:18 */
-                       tmp = readl(&denali_pi[174]) >> 8;
-
-                       /*
-                        * make sure status obs not report error bit
-                        * PHY_46/174/302/430
-                        *     phy_rdlvl_status_obs_X:16:8
-                        */
-                       if ((((tmp >> 8) & 0x1) == 0x1) &&
-                           (((tmp >> 13) & 0x1) == 0x1) &&
-                           (((tmp >> 2) & 0x1) == 0x0))
-                               break;
-                       else if (((tmp >> 2) & 0x1) == 0x1)
-                               return -EIO;
-               }
-               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
-               writel(0x00003f7c, (&denali_pi[175]));
-       }
-       clrbits_le32(&denali_pi[80], 0x3 << 16);
-
-       return 0;
-}
-
-static int data_training_wdql(const struct chan_info *chan, u32 channel,
-                             const struct rk3399_sdram_params *sdram_params)
-{
-       u32 *denali_pi = chan->pi->denali_pi;
-       u32 i, tmp;
-       u32 rank = sdram_params->ch[channel].rank;
-
-       for (i = 0; i < rank; i++) {
-               select_per_cs_training_index(chan, i);
-               /*
-                * disable PI_WDQLVL_VREF_EN before wdq leveling?
-                * PI_181 PI_WDQLVL_VREF_EN:RW:8:1
-                */
-               clrbits_le32(&denali_pi[181], 0x1 << 8);
-               /* PI_124 PI_WDQLVL_EN:RW:16:2 */
-               clrsetbits_le32(&denali_pi[124], 0x3 << 16, 0x2 << 16);
-               /* PI_121 PI_WDQLVL_REQ:WR:8:1,PI_WDQLVL_CS:RW:16:2 */
-               clrsetbits_le32(&denali_pi[121],
-                               (0x1 << 8) | (0x3 << 16),
-                               (0x1 << 8) | (i << 16));
-
-               /* Waiting for training complete */
-               while (1) {
-                       /* PI_174 PI_INT_STATUS:RD:8:18 */
-                       tmp = readl(&denali_pi[174]) >> 8;
-                       if ((((tmp >> 12) & 0x1) == 0x1) &&
-                           (((tmp >> 13) & 0x1) == 0x1) &&
-                           (((tmp >> 6) & 0x1) == 0x0))
-                               break;
-                       else if (((tmp >> 6) & 0x1) == 0x1)
-                               return -EIO;
-               }
-               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
-               writel(0x00003f7c, (&denali_pi[175]));
-       }
-       clrbits_le32(&denali_pi[124], 0x3 << 16);
-
-       return 0;
-}
-
-static int data_training(const struct chan_info *chan, u32 channel,
-                        const struct rk3399_sdram_params *sdram_params,
-                        u32 training_flag)
-{
-       u32 *denali_phy = chan->publ->denali_phy;
-
-       /* PHY_927 PHY_PAD_DQS_DRIVE  RPULL offset_22 */
-       setbits_le32(&denali_phy[927], (1 << 22));
-
-       if (training_flag == PI_FULL_TRAINING) {
-               if (sdram_params->base.dramtype == LPDDR4) {
-                       training_flag = PI_CA_TRAINING | PI_WRITE_LEVELING |
-                                       PI_READ_GATE_TRAINING |
-                                       PI_READ_LEVELING | PI_WDQ_LEVELING;
-               } else if (sdram_params->base.dramtype == LPDDR3) {
-                       training_flag = PI_CA_TRAINING | PI_WRITE_LEVELING |
-                                       PI_READ_GATE_TRAINING;
-               } else if (sdram_params->base.dramtype == DDR3) {
-                       training_flag = PI_WRITE_LEVELING |
-                                       PI_READ_GATE_TRAINING |
-                                       PI_READ_LEVELING;
-               }
-       }
-
-       /* ca training(LPDDR4,LPDDR3 support) */
-       if ((training_flag & PI_CA_TRAINING) == PI_CA_TRAINING)
-               data_training_ca(chan, channel, sdram_params);
-
-       /* write leveling(LPDDR4,LPDDR3,DDR3 support) */
-       if ((training_flag & PI_WRITE_LEVELING) == PI_WRITE_LEVELING)
-               data_training_wl(chan, channel, sdram_params);
-
-       /* read gate training(LPDDR4,LPDDR3,DDR3 support) */
-       if ((training_flag & PI_READ_GATE_TRAINING) == PI_READ_GATE_TRAINING)
-               data_training_rg(chan, channel, sdram_params);
-
-       /* read leveling(LPDDR4,LPDDR3,DDR3 support) */
-       if ((training_flag & PI_READ_LEVELING) == PI_READ_LEVELING)
-               data_training_rl(chan, channel, sdram_params);
-
-       /* wdq leveling(LPDDR4 support) */
-       if ((training_flag & PI_WDQ_LEVELING) == PI_WDQ_LEVELING)
-               data_training_wdql(chan, channel, sdram_params);
-
-       /* PHY_927 PHY_PAD_DQS_DRIVE  RPULL offset_22 */
-       clrbits_le32(&denali_phy[927], (1 << 22));
-
-       return 0;
-}
-
-static void set_ddrconfig(const struct chan_info *chan,
-                         const struct rk3399_sdram_params *sdram_params,
-                         unsigned char channel, u32 ddrconfig)
-{
-       /* only need to set ddrconfig */
-       struct rk3399_msch_regs *ddr_msch_regs = chan->msch;
-       unsigned int cs0_cap = 0;
-       unsigned int cs1_cap = 0;
-
-       cs0_cap = (1 << (sdram_params->ch[channel].cs0_row
-                       + sdram_params->ch[channel].col
-                       + sdram_params->ch[channel].bk
-                       + sdram_params->ch[channel].bw - 20));
-       if (sdram_params->ch[channel].rank > 1)
-               cs1_cap = cs0_cap >> (sdram_params->ch[channel].cs0_row
-                               - sdram_params->ch[channel].cs1_row);
-       if (sdram_params->ch[channel].row_3_4) {
-               cs0_cap = cs0_cap * 3 / 4;
-               cs1_cap = cs1_cap * 3 / 4;
-       }
-
-       writel(ddrconfig | (ddrconfig << 8), &ddr_msch_regs->ddrconf);
-       writel(((cs0_cap / 32) & 0xff) | (((cs1_cap / 32) & 0xff) << 8),
-              &ddr_msch_regs->ddrsize);
-}
-
-static void dram_all_config(struct dram_info *dram,
-                           const struct rk3399_sdram_params *sdram_params)
-{
-       u32 sys_reg = 0;
-       unsigned int channel, idx;
-
-       sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT;
-       sys_reg |= (sdram_params->base.num_channels - 1)
-                   << SYS_REG_NUM_CH_SHIFT;
-       for (channel = 0, idx = 0;
-            (idx < sdram_params->base.num_channels) && (channel < 2);
-            channel++) {
-               const struct rk3399_sdram_channel *info =
-                       &sdram_params->ch[channel];
-               struct rk3399_msch_regs *ddr_msch_regs;
-               const struct rk3399_msch_timings *noc_timing;
-
-               if (sdram_params->ch[channel].col == 0)
-                       continue;
-               idx++;
-               sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(channel);
-               sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(channel);
-               sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(channel);
-               sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(channel);
-               sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(channel);
-               sys_reg |= (info->cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(channel);
-               sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(channel);
-               sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(channel);
-               sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(channel);
-
-               ddr_msch_regs = dram->chan[channel].msch;
-               noc_timing = &sdram_params->ch[channel].noc_timings;
-               writel(noc_timing->ddrtiminga0,
-                      &ddr_msch_regs->ddrtiminga0);
-               writel(noc_timing->ddrtimingb0,
-                      &ddr_msch_regs->ddrtimingb0);
-               writel(noc_timing->ddrtimingc0,
-                      &ddr_msch_regs->ddrtimingc0);
-               writel(noc_timing->devtodev0,
-                      &ddr_msch_regs->devtodev0);
-               writel(noc_timing->ddrmode,
-                      &ddr_msch_regs->ddrmode);
-
-               /* rank 1 memory clock disable (dfi_dram_clk_disable = 1) */
-               if (sdram_params->ch[channel].rank == 1)
-                       setbits_le32(&dram->chan[channel].pctl->denali_ctl[276],
-                                    1 << 17);
-       }
-
-       writel(sys_reg, &dram->pmugrf->os_reg2);
-       rk_clrsetreg(&dram->pmusgrf->soc_con4, 0x1f << 10,
-                    sdram_params->base.stride << 10);
-
-       /* reboot hold register set */
-       writel(PRESET_SGRF_HOLD(0) | PRESET_GPIO0_HOLD(1) |
-               PRESET_GPIO1_HOLD(1),
-               &dram->pmucru->pmucru_rstnhold_con[1]);
-       clrsetbits_le32(&dram->cru->glb_rst_con, 0x3, 0x3);
-}
-
-static int switch_to_phy_index1(struct dram_info *dram,
-                                const struct rk3399_sdram_params *sdram_params)
-{
-       u32 channel;
-       u32 *denali_phy;
-       u32 ch_count = sdram_params->base.num_channels;
-       int ret;
-       int i = 0;
-
-       writel(RK_CLRSETBITS(0x03 << 4 | 1 << 2 | 1,
-                            1 << 4 | 1 << 2 | 1),
-                       &dram->cic->cic_ctrl0);
-       while (!(readl(&dram->cic->cic_status0) & (1 << 2))) {
-               mdelay(10);
-               i++;
-               if (i > 10) {
-                       debug("index1 frequency change overtime\n");
-                       return -ETIME;
-               }
-       }
-
-       i = 0;
-       writel(RK_CLRSETBITS(1 << 1, 1 << 1), &dram->cic->cic_ctrl0);
-       while (!(readl(&dram->cic->cic_status0) & (1 << 0))) {
-               mdelay(10);
-               if (i > 10) {
-                       debug("index1 frequency done overtime\n");
-                       return -ETIME;
-               }
-       }
-
-       for (channel = 0; channel < ch_count; channel++) {
-               denali_phy = dram->chan[channel].publ->denali_phy;
-               clrsetbits_le32(&denali_phy[896], (0x3 << 8) | 1, 1 << 8);
-               ret = data_training(&dram->chan[channel], channel,
-                                 sdram_params, PI_FULL_TRAINING);
-               if (ret) {
-                       debug("index1 training failed\n");
-                       return ret;
-               }
-       }
-
-       return 0;
-}
-
-static int sdram_init(struct dram_info *dram,
-                     const struct rk3399_sdram_params *sdram_params)
-{
-       unsigned char dramtype = sdram_params->base.dramtype;
-       unsigned int ddr_freq = sdram_params->base.ddr_freq;
-       int channel;
-
-       debug("Starting SDRAM initialization...\n");
-
-       if ((dramtype == DDR3 && ddr_freq > 933) ||
-           (dramtype == LPDDR3 && ddr_freq > 933) ||
-           (dramtype == LPDDR4 && ddr_freq > 800)) {
-               debug("SDRAM frequency is to high!");
-               return -E2BIG;
-       }
-
-       for (channel = 0; channel < 2; channel++) {
-               const struct chan_info *chan = &dram->chan[channel];
-               struct rk3399_ddr_publ_regs *publ = chan->publ;
-
-               phy_dll_bypass_set(publ, ddr_freq);
-
-               if (channel >= sdram_params->base.num_channels)
-                       continue;
-
-               if (pctl_cfg(chan, channel, sdram_params) != 0) {
-                       printf("pctl_cfg fail, reset\n");
-                       return -EIO;
-               }
-
-               /* LPDDR2/LPDDR3 need to wait DAI complete, max 10us */
-               if (dramtype == LPDDR3)
-                       udelay(10);
-
-               if (data_training(chan, channel,
-                                 sdram_params, PI_FULL_TRAINING)) {
-                       printf("SDRAM initialization failed, reset\n");
-                       return -EIO;
-               }
-
-               set_ddrconfig(chan, sdram_params, channel,
-                             sdram_params->ch[channel].ddrconfig);
-       }
-       dram_all_config(dram, sdram_params);
-       switch_to_phy_index1(dram, sdram_params);
-
-       debug("Finish SDRAM initialization...\n");
-       return 0;
-}
-
-static int rk3399_dmc_ofdata_to_platdata(struct udevice *dev)
-{
-#if !CONFIG_IS_ENABLED(OF_PLATDATA)
-       struct rockchip_dmc_plat *plat = dev_get_platdata(dev);
-       int ret;
-
-       ret = dev_read_u32_array(dev, "rockchip,sdram-params",
-                                (u32 *)&plat->sdram_params,
-                                sizeof(plat->sdram_params) / sizeof(u32));
-       if (ret) {
-               printf("%s: Cannot read rockchip,sdram-params %d\n",
-                      __func__, ret);
-               return ret;
-       }
-       ret = regmap_init_mem(dev, &plat->map);
-       if (ret)
-               printf("%s: regmap failed %d\n", __func__, ret);
-
-#endif
-       return 0;
-}
-
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-static int conv_of_platdata(struct udevice *dev)
-{
-       struct rockchip_dmc_plat *plat = dev_get_platdata(dev);
-       struct dtd_rockchip_rk3399_dmc *dtplat = &plat->dtplat;
-       int ret;
-
-       ret = regmap_init_mem_platdata(dev, dtplat->reg,
-                       ARRAY_SIZE(dtplat->reg) / 2,
-                       &plat->map);
-       if (ret)
-               return ret;
-
-       return 0;
-}
-#endif
-
-static int rk3399_dmc_init(struct udevice *dev)
-{
-       struct dram_info *priv = dev_get_priv(dev);
-       struct rockchip_dmc_plat *plat = dev_get_platdata(dev);
-       int ret;
-#if !CONFIG_IS_ENABLED(OF_PLATDATA)
-       struct rk3399_sdram_params *params = &plat->sdram_params;
-#else
-       struct dtd_rockchip_rk3399_dmc *dtplat = &plat->dtplat;
-       struct rk3399_sdram_params *params =
-                                       (void *)dtplat->rockchip_sdram_params;
-
-       ret = conv_of_platdata(dev);
-       if (ret)
-               return ret;
-#endif
-
-       priv->cic = syscon_get_first_range(ROCKCHIP_SYSCON_CIC);
-       priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
-       priv->pmusgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF);
-       priv->pmucru = rockchip_get_pmucru();
-       priv->cru = rockchip_get_cru();
-       priv->chan[0].pctl = regmap_get_range(plat->map, 0);
-       priv->chan[0].pi = regmap_get_range(plat->map, 1);
-       priv->chan[0].publ = regmap_get_range(plat->map, 2);
-       priv->chan[0].msch = regmap_get_range(plat->map, 3);
-       priv->chan[1].pctl = regmap_get_range(plat->map, 4);
-       priv->chan[1].pi = regmap_get_range(plat->map, 5);
-       priv->chan[1].publ = regmap_get_range(plat->map, 6);
-       priv->chan[1].msch = regmap_get_range(plat->map, 7);
-
-       debug("con reg %p %p %p %p %p %p %p %p\n",
-             priv->chan[0].pctl, priv->chan[0].pi,
-             priv->chan[0].publ, priv->chan[0].msch,
-             priv->chan[1].pctl, priv->chan[1].pi,
-             priv->chan[1].publ, priv->chan[1].msch);
-       debug("cru %p, cic %p, grf %p, sgrf %p, pmucru %p\n", priv->cru,
-             priv->cic, priv->pmugrf, priv->pmusgrf, priv->pmucru);
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
-       ret = clk_get_by_index_platdata(dev, 0, dtplat->clocks, &priv->ddr_clk);
-#else
-       ret = clk_get_by_index(dev, 0, &priv->ddr_clk);
-#endif
-       if (ret) {
-               printf("%s clk get failed %d\n", __func__, ret);
-               return ret;
-       }
-       ret = clk_set_rate(&priv->ddr_clk, params->base.ddr_freq * MHz);
-       if (ret < 0) {
-               printf("%s clk set failed %d\n", __func__, ret);
-               return ret;
-       }
-       ret = sdram_init(priv, params);
-       if (ret < 0) {
-               printf("%s DRAM init failed%d\n", __func__, ret);
-               return ret;
-       }
-
-       return 0;
-}
-#endif
-
-static int rk3399_dmc_probe(struct udevice *dev)
-{
-#ifdef CONFIG_SPL_BUILD
-       if (rk3399_dmc_init(dev))
-               return 0;
-#else
-       struct dram_info *priv = dev_get_priv(dev);
-
-       priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
-       debug("%s: pmugrf=%p\n", __func__, priv->pmugrf);
-       priv->info.base = CONFIG_SYS_SDRAM_BASE;
-       priv->info.size = rockchip_sdram_size(
-                       (phys_addr_t)&priv->pmugrf->os_reg2);
-#endif
-       return 0;
-}
-
-static int rk3399_dmc_get_info(struct udevice *dev, struct ram_info *info)
-{
-       struct dram_info *priv = dev_get_priv(dev);
-
-       *info = priv->info;
-
-       return 0;
-}
-
-static struct ram_ops rk3399_dmc_ops = {
-       .get_info = rk3399_dmc_get_info,
-};
-
-
-static const struct udevice_id rk3399_dmc_ids[] = {
-       { .compatible = "rockchip,rk3399-dmc" },
-       { }
-};
-
-U_BOOT_DRIVER(dmc_rk3399) = {
-       .name = "rockchip_rk3399_dmc",
-       .id = UCLASS_RAM,
-       .of_match = rk3399_dmc_ids,
-       .ops = &rk3399_dmc_ops,
-#ifdef CONFIG_SPL_BUILD
-       .ofdata_to_platdata = rk3399_dmc_ofdata_to_platdata,
-#endif
-       .probe = rk3399_dmc_probe,
-       .priv_auto_alloc_size = sizeof(struct dram_info),
-#ifdef CONFIG_SPL_BUILD
-       .platdata_auto_alloc_size = sizeof(struct rockchip_dmc_plat),
-#endif
-};
index 4f78c72720948e9adc77ae1c3437d096d5c5dca9..843998dfdcb8d256bbb5966761273e40805646c6 100644 (file)
 #include <spl.h>
 
 #if CONFIG_IS_ENABLED(OF_CONTROL)
+/**
+ * spl_node_to_boot_device() - maps from a DT-node to a SPL boot device
+ * @node:      of_offset of the node
+ *
+ * The SPL framework uses BOOT_DEVICE_... constants to identify its boot
+ * sources.  These may take on a device-specific meaning, depending on
+ * what nodes are enabled in a DTS (e.g. BOOT_DEVICE_MMC1 may refer to
+ * different controllers/block-devices, depending on which SD/MMC controllers
+ * are enabled in any given DTS).  This function maps from a DT-node back
+ * onto a BOOT_DEVICE_... constant, considering the currently active devices.
+ *
+ * Returns
+ *   -ENOENT, if no device matching the node could be found
+ *   -ENOSYS, if the device matching the node can not be mapped onto a
+ *            SPL boot device (e.g. the third MMC device)
+ *   -1, for unspecified failures
+ *   a positive integer (from the BOOT_DEVICE_... family) on succes.
+ */
+
 static int spl_node_to_boot_device(int node)
 {
        struct udevice *parent;
@@ -57,6 +76,24 @@ static int spl_node_to_boot_device(int node)
        return -1;
 }
 
+/**
+ * board_spl_was_booted_from() - retrieves the of-path the SPL was loaded from
+ *
+ * To support a 'same-as-spl' specification in the search-order for the next
+ * stage, we need a SoC- or board-specific way to handshake with what 'came
+ * before us' (either a BROM or TPL stage) and map the info retrieved onto
+ * a OF path.
+ *
+ * Returns
+ *   NULL, on failure or if the device could not be identified
+ *   a of_path (a string), on success
+ */
+__weak const char *board_spl_was_booted_from(void)
+{
+       debug("%s: no support for 'same-as-spl' for this board\n", __func__);
+       return NULL;
+}
+
 void board_boot_order(u32 *spl_boot_list)
 {
        const void *blob = gd->fdt_blob;
@@ -78,8 +115,17 @@ void board_boot_order(u32 *spl_boot_list)
             (conf = fdt_stringlist_get(blob, chosen_node,
                                        "u-boot,spl-boot-order", elem, NULL));
             elem++) {
+               const char *alias;
+
+               /* Handle the case of 'same device the SPL was loaded from' */
+               if (strncmp(conf, "same-as-spl", 11) == 0) {
+                       conf = board_spl_was_booted_from();
+                       if (!conf)
+                               continue;
+               }
+
                /* First check if the list element is an alias */
-               const char *alias = fdt_get_alias(blob, conf);
+               alias = fdt_get_alias(blob, conf);
                if (alias)
                        conf = alias;
 
index 2f1da740fbe0ffe53fdf70e270ad000b8772cab8..91ddb79f7310859f1d168be9e489951fd3d0ef5b 100644 (file)
@@ -144,7 +144,7 @@ static const struct {
        const u16       pn;
        const char      *name;
        const char      *var;
-} const socfpga_fpga_model[] = {
+} socfpga_fpga_model[] = {
        /* Cyclone V E */
        { 0x2b15, "Cyclone V, E/A2", "cv_e_a2" },
        { 0x2b05, "Cyclone V, E/A4", "cv_e_a4" },
index 66f1ec21f132eee1f5d9c57fdb1bd916e0af3830..ae16897494bdcb6429abd1085bac32a2b7c26af7 100644 (file)
@@ -174,7 +174,7 @@ void socfpga_emac_manage_reset(ulong emacbase, u32 state)
                emacmask = ALT_RSTMGR_PER0MODRST_EMAC2_SET_MSK;
                break;
        default:
-               error("emac base address unexpected! %lx", emacbase);
+               pr_err("emac base address unexpected! %lx", emacbase);
                hang();
                break;
        }
index c15f8bbe32da69cd2f004d185ebe45c40a50a5b8..b04c1013e9ce4cf23d4ed0cfe3faf924d3c15661 100644 (file)
@@ -26,7 +26,7 @@ int timer_init(void)
        /* Stop the timer */
        writel(readl(&gpt1_regs_ptr->cr1) & ~GPT_CR1_CEN, &gpt1_regs_ptr->cr1);
 
-       writel((CONFIG_SYS_CLK_FREQ/CONFIG_SYS_HZ_CLOCK) - 1,
+       writel((CONFIG_SYS_CLK_FREQ / 2 / CONFIG_SYS_HZ_CLOCK) - 1,
                                                &gpt1_regs_ptr->psc);
 
        /* Configure timer for auto-reload */
index 65b1ebd837871bccb2c0b73f52541da5bc6c192f..0c60ee04da54f1da84645bfb44243dd67ca05dec 100644 (file)
@@ -14,9 +14,7 @@
 #include <mmc.h>
 #include <i2c.h>
 #include <serial.h>
-#ifdef CONFIG_SPL_BUILD
 #include <spl.h>
-#endif
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
@@ -212,11 +210,12 @@ void s_init(void)
 
 #ifdef CONFIG_SPL_BUILD
 DECLARE_GLOBAL_DATA_PTR;
+#endif
 
 /* The sunxi internal brom will try to loader external bootloader
  * from mmc0, nand flash, mmc2.
  */
-u32 spl_boot_device(void)
+uint32_t sunxi_get_boot_device(void)
 {
        int boot_source;
 
@@ -255,6 +254,12 @@ u32 spl_boot_device(void)
        return -1;              /* Never reached */
 }
 
+#ifdef CONFIG_SPL_BUILD
+u32 spl_boot_device(void)
+{
+       return sunxi_get_boot_device();
+}
+
 /* No confirmation data available in SPL yet. Hardcode bootmode */
 u32 spl_boot_mode(const u32 boot_device)
 {
index 9bf0b5633d4a5b1462603d1033146248d9c76f12..2f1cad1aad9e5dc14b4666bf02317a5fea7363aa 100644 (file)
 #include <asm/io.h>
 #include <errno.h>
 
-#define SUNXI_USB_PMU_IRQ_ENABLE       0x800
-#ifdef CONFIG_MACH_SUN8I_A33
-#define SUNXI_USB_CSR                  0x410
-#else
+#if defined(CONFIG_MACH_SUN4I) ||                 \
+       defined(CONFIG_MACH_SUN5I) ||              \
+       defined(CONFIG_MACH_SUN6I) ||              \
+       defined(CONFIG_MACH_SUN7I) ||              \
+       defined(CONFIG_MACH_SUN8I_A23) ||          \
+       defined(CONFIG_MACH_SUN9I)
 #define SUNXI_USB_CSR                  0x404
+#else
+#define SUNXI_USB_CSR                  0x410
 #endif
+
+#define SUNXI_USB_PMU_IRQ_ENABLE       0x800
 #define SUNXI_USB_PASSBY_EN            1
 
 #define SUNXI_EHCI_AHB_ICHR8_EN                (1 << 10)
index cf6626fb12c7d60983ca8600d9d7e865c8a123f9..dec7d90c5d3b833ef304e19e42056a60f4f376c6 100644 (file)
@@ -493,7 +493,7 @@ static int check_ivc_params(ulong qbase1, ulong qbase2, uint32_t nframes,
               (TEGRA_IVC_ALIGN - 1));
 
        if ((uint64_t)nframes * (uint64_t)frame_size >= 0x100000000) {
-               error("tegra_ivc: nframes * frame_size overflows\n");
+               pr_err("tegra_ivc: nframes * frame_size overflows\n");
                return -EINVAL;
        }
 
@@ -503,12 +503,12 @@ static int check_ivc_params(ulong qbase1, ulong qbase2, uint32_t nframes,
         */
        if ((qbase1 & (TEGRA_IVC_ALIGN - 1)) ||
            (qbase2 & (TEGRA_IVC_ALIGN - 1))) {
-               error("tegra_ivc: channel start not aligned\n");
+               pr_err("tegra_ivc: channel start not aligned\n");
                return -EINVAL;
        }
 
        if (frame_size & (TEGRA_IVC_ALIGN - 1)) {
-               error("tegra_ivc: frame size not adequately aligned\n");
+               pr_err("tegra_ivc: frame size not adequately aligned\n");
                return -EINVAL;
        }
 
@@ -521,7 +521,7 @@ static int check_ivc_params(ulong qbase1, ulong qbase2, uint32_t nframes,
        }
 
        if (ret) {
-               error("tegra_ivc: queue regions overlap\n");
+               pr_err("tegra_ivc: queue regions overlap\n");
                return ret;
        }
 
index d326a6ae570191e6b8aaa11f57f0b90290188495..bfc0ab8f102ab5ba07cf13d1239d82bfdbc32163 100644 (file)
@@ -137,7 +137,7 @@ static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
        u32 value;
 
        if (padctl->enable == 0) {
-               error("unbalanced enable/disable");
+               pr_err("unbalanced enable/disable");
                return 0;
        }
 
index 966cf9f1c46029bdccfb08758c1edfa1ec6d30ec..5224ef641cd8f9610a86548dff12dc8a13b57084 100644 (file)
@@ -45,12 +45,12 @@ int dram_init(void)
 
        node = fdt_path_offset(nvtboot_blob, "/memory");
        if (node < 0) {
-               error("Can't find /memory node in nvtboot DTB");
+               pr_err("Can't find /memory node in nvtboot DTB");
                hang();
        }
        prop = fdt_getprop(nvtboot_blob, node, "reg", &len);
        if (!prop) {
-               error("Can't find /memory/reg property in nvtboot DTB");
+               pr_err("Can't find /memory/reg property in nvtboot DTB");
                hang();
        }
 
index ec04cf5261f7ad574f41b61d9f4457e0106b41b8..81fb1d840f28af2eea7d69133b4d3a54b47bbea9 100644 (file)
@@ -667,7 +667,7 @@ static int tegra_plle_train(void)
        } while (--timeout);
 
        if (timeout == 0) {
-               error("timeout waiting for PLLE to become ready");
+               pr_err("timeout waiting for PLLE to become ready");
                return -ETIMEDOUT;
        }
 
@@ -697,7 +697,7 @@ int tegra_plle_enable(void)
        if ((value & PLLE_MISC_PLL_READY) == 0) {
                err = tegra_plle_train();
                if (err < 0) {
-                       error("failed to train PLLE: %d", err);
+                       pr_err("failed to train PLLE: %d", err);
                        return err;
                }
        }
@@ -726,7 +726,7 @@ int tegra_plle_enable(void)
        } while (--timeout);
 
        if (timeout == 0) {
-               error("timeout waiting for PLLE to lock");
+               pr_err("timeout waiting for PLLE to lock");
                return -ETIMEDOUT;
        }
 
index bf85e075de2f648bfe2c3ebac3e87d0195e5e6ac..a3e3e378e18079390ca7df6030477047ec5155f0 100644 (file)
@@ -125,7 +125,7 @@ static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
        u32 value;
 
        if (padctl->enable == 0) {
-               error("unbalanced enable/disable");
+               pr_err("unbalanced enable/disable");
                return 0;
        }
 
index 4fd8b8a3b1fb69a15157ee80c88283d6455d9cd8..282f34fb89471b766e271245b5816bc258ee8401 100644 (file)
@@ -696,7 +696,7 @@ static int tegra_plle_train(void)
        } while (--timeout);
 
        if (timeout == 0) {
-               error("timeout waiting for PLLE to become ready");
+               pr_err("timeout waiting for PLLE to become ready");
                return -ETIMEDOUT;
        }
 
@@ -726,7 +726,7 @@ int tegra_plle_enable(void)
        if ((value & PLLE_MISC_PLL_READY) == 0) {
                err = tegra_plle_train();
                if (err < 0) {
-                       error("failed to train PLLE: %d", err);
+                       pr_err("failed to train PLLE: %d", err);
                        return err;
                }
        }
@@ -772,7 +772,7 @@ int tegra_plle_enable(void)
        } while (--timeout);
 
        if (timeout == 0) {
-               error("timeout waiting for PLLE to lock");
+               pr_err("timeout waiting for PLLE to lock");
                return -ETIMEDOUT;
        }
 
index abc18c03a5ebb65e7f1fedf028d9c0f58fb5a994..c8a468a034c31550b14734b0e1eb139c600bf991 100644 (file)
@@ -84,7 +84,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl,
 
        len = ofnode_read_string_count(node, "nvidia,lanes");
        if (len < 0) {
-               error("failed to parse \"nvidia,lanes\" property");
+               pr_err("failed to parse \"nvidia,lanes\" property");
                return -EINVAL;
        }
 
@@ -94,7 +94,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl,
                ret = ofnode_read_string_index(node, "nvidia,lanes", i,
                                               &group->pins[i]);
                if (ret) {
-                       error("failed to read string from \"nvidia,lanes\" property");
+                       pr_err("failed to read string from \"nvidia,lanes\" property");
                        return -EINVAL;
                }
        }
@@ -104,7 +104,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl,
        ret = ofnode_read_string_index(node, "nvidia,function", 0,
                                       &group->func);
        if (ret) {
-               error("failed to parse \"nvidia,func\" property");
+               pr_err("failed to parse \"nvidia,func\" property");
                return -EINVAL;
        }
 
@@ -157,14 +157,14 @@ tegra_xusb_padctl_group_apply(struct tegra_xusb_padctl *padctl,
 
                lane = tegra_xusb_padctl_find_lane(padctl, group->pins[i]);
                if (!lane) {
-                       error("no lane for pin %s", group->pins[i]);
+                       pr_err("no lane for pin %s", group->pins[i]);
                        continue;
                }
 
                func = tegra_xusb_padctl_lane_find_function(padctl, lane,
                                                            group->func);
                if (func < 0) {
-                       error("function %s invalid for lane %s: %d",
+                       pr_err("function %s invalid for lane %s: %d",
                              group->func, lane->name, func);
                        continue;
                }
@@ -206,7 +206,7 @@ tegra_xusb_padctl_config_apply(struct tegra_xusb_padctl *padctl,
 
                err = tegra_xusb_padctl_group_apply(padctl, group);
                if (err < 0) {
-                       error("failed to apply group %s: %d",
+                       pr_err("failed to apply group %s: %d",
                              group->name, err);
                        continue;
                }
@@ -232,7 +232,7 @@ tegra_xusb_padctl_config_parse_dt(struct tegra_xusb_padctl *padctl,
 
                err = tegra_xusb_padctl_group_parse_dt(padctl, group, subnode);
                if (err < 0) {
-                       error("failed to parse group %s", group->name);
+                       pr_err("failed to parse group %s", group->name);
                        return err;
                }
 
@@ -250,7 +250,7 @@ static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl,
 
        err = ofnode_read_resource(node, 0, &padctl->regs);
        if (err < 0) {
-               error("registers not found");
+               pr_err("registers not found");
                return err;
        }
 
@@ -261,7 +261,7 @@ static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl,
                err = tegra_xusb_padctl_config_parse_dt(padctl, config,
                                                        subnode);
                if (err < 0) {
-                       error("failed to parse entry %s: %d",
+                       pr_err("failed to parse entry %s: %d",
                              config->name, err);
                        continue;
                }
@@ -289,7 +289,7 @@ int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count,
 
                err = tegra_xusb_padctl_parse_dt(&padctl, nodes[i]);
                if (err < 0) {
-                       error("failed to parse DT: %d", err);
+                       pr_err("failed to parse DT: %d", err);
                        continue;
                }
 
@@ -298,7 +298,7 @@ int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count,
 
                err = tegra_xusb_padctl_config_apply(&padctl, &padctl.config);
                if (err < 0) {
-                       error("failed to apply pinmux: %d", err);
+                       pr_err("failed to apply pinmux: %d", err);
                        continue;
                }
 
index 32d359321ae2899b6f730c77f5604b63feb75e8d..22136855fa1a4ba04fdca5884b3978327992486b 100644 (file)
@@ -15,9 +15,6 @@
 #include "sg-regs.h"
 #include "soc-info.h"
 
-#define pr_warn(fmt, args...)  printf(fmt, ##args)
-#define pr_err(fmt, args...)   printf(fmt, ##args)
-
 DECLARE_GLOBAL_DATA_PTR;
 
 struct uniphier_memif_data {
index 29f638d94703a31a7ef27ada4e9141a39c53a469..da209354ed503424c95e3d2f1fd4a4607e14cb6d 100644 (file)
@@ -104,9 +104,4 @@ int uniphier_have_internal_stm(void);
 int uniphier_boot_from_backend(void);
 int uniphier_pin_init(const char *pinconfig_name);
 
-#undef pr_warn
-#define pr_warn(fmt, args...)  printf(fmt, ##args)
-#undef pr_err
-#define pr_err(fmt, args...)   printf(fmt, ##args)
-
 #endif /* __MACH_INIT_H */
index 384308b747d08785d701bf4d869ef28d4d69be6d..dfe77f07567425491ea506d18ec6e6f1ae20f300 100644 (file)
@@ -253,33 +253,6 @@ static inline void sync(void)
         */
 }
 
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE    (0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
-
-static inline void *map_physmem(phys_addr_t paddr, unsigned long len,
-                               unsigned long flags)
-{
-       return (void *)paddr;
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
-
-static inline phys_addr_t virt_to_phys(void * vaddr)
-{
-       return (phys_addr_t)(vaddr);
-}
+#include <asm-generic/io.h>
 
 #endif                         /* __ASM_M68K_IO_H__ */
index 584cbce358c5aedeff87fb780bf5f9c4b99e95ed..c7516a47e8ca696e81f707f4bc903cfade14cc30 100644 (file)
@@ -131,33 +131,6 @@ static inline void sync(void)
 {
 }
 
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE    (0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
-
-static inline void *
-map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
-{
-       return (void *)paddr;
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
-
-static inline phys_addr_t virt_to_phys(void * vaddr)
-{
-       return (phys_addr_t)(vaddr);
-}
+#include <asm-generic/io.h>
 
 #endif /* __MICROBLAZE_IO_H__ */
index ee7a59290deb7290e2151b9905f894dfd045344c..45d7ca0cc6118f4dd6aea5292767aad88f4cf631 100644 (file)
@@ -95,6 +95,7 @@ static inline unsigned long virt_to_phys(volatile const void *address)
 #endif
        return CPHYSADDR(addr);
 }
+#define virt_to_phys virt_to_phys
 
 /*
  *     phys_to_virt    -       map physical address to virtual
@@ -112,6 +113,7 @@ static inline void *phys_to_virt(unsigned long address)
 {
        return (void *)(address + PAGE_OFFSET - PHYS_OFFSET);
 }
+#define phys_to_virt phys_to_virt
 
 /*
  * ISA I/O bus memory addresses are 1:1 with the physical address.
@@ -490,10 +492,7 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
  */
 #define sync()         mmiowb()
 
-#define MAP_NOCACHE    (1)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
+#define MAP_NOCACHE    1
 
 static inline void *
 map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
@@ -503,13 +502,7 @@ map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
 
        return (void *)CKSEG0ADDR(paddr);
 }
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-}
+#define map_physmem map_physmem
 
 #define __BUILD_CLRBITS(bwlq, sfx, end, type)                          \
                                                                        \
@@ -566,4 +559,6 @@ BUILD_CLRSETBITS(q, le64, le64, u64)
 BUILD_CLRSETBITS(q, be64, be64, u64)
 BUILD_CLRSETBITS(q, 64, _, u64)
 
+#include <asm-generic/io.h>
+
 #endif /* _ASM_IO_H */
index e8ee9615264cf89c00e5e2f24680706d2c217495..c6d8d9b471dbb3829c80ac617597a57f3e80038e 100644 (file)
@@ -38,16 +38,6 @@ static inline void sync(void)
 {
 }
 
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE    (0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
-
 #ifdef CONFIG_ARCH_MAP_SYSMEM
 static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
 {
@@ -69,25 +59,6 @@ static inline phys_addr_t map_to_sysmem(const void *ptr)
 }
 #endif
 
-static inline void *
-map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
-{
-       return (void *)paddr;
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
-
-static inline phys_addr_t virt_to_phys(void *vaddr)
-{
-       return (phys_addr_t)(vaddr);
-}
-
 /*
  * Generic virtual read/write.  Note that we don't support half-word
  * read/writes.  We define __arch_*[bl] here, and leave __arch_*w
@@ -125,26 +96,26 @@ extern void __raw_readsl(unsigned int addr, void *data, int longlen);
 #define __iormb()      dmb()
 #define __iowmb()      dmb()
 
-static inline void writeb(unsigned char val, unsigned char *addr)
+static inline void writeb(u8 val, volatile void __iomem *addr)
 {
        __iowmb();
        __arch_putb(val, addr);
 }
 
-static inline void writew(unsigned short val, unsigned short *addr)
+static inline void writew(u16 val, volatile void __iomem *addr)
 {
        __iowmb();
        __arch_putw(val, addr);
 
 }
 
-static inline void writel(unsigned int val, unsigned int *addr)
+static inline void writel(u32 val, volatile void __iomem *addr)
 {
        __iowmb();
        __arch_putl(val, addr);
 }
 
-static inline unsigned char readb(unsigned char *addr)
+static inline u8 readb(const volatile void __iomem *addr)
 {
        u8      val;
 
@@ -153,7 +124,7 @@ static inline unsigned char readb(unsigned char *addr)
        return val;
 }
 
-static inline unsigned short readw(unsigned short *addr)
+static inline u16 readw(const volatile void __iomem *addr)
 {
        u16     val;
 
@@ -162,7 +133,7 @@ static inline unsigned short readw(unsigned short *addr)
        return val;
 }
 
-static inline unsigned int readl(unsigned int *addr)
+static inline u32 readl(const volatile void __iomem *addr)
 {
        u32     val;
 
@@ -480,5 +451,8 @@ out:
 #define isa_check_signature(io, sig, len)      (0)
 
 #endif /* __mem_isa */
+
+#include <asm-generic/io.h>
+
 #endif /* __KERNEL__ */
 #endif /* __ASM_NDS_IO_H */
index e951500190c046ccf5888778966311b8259c69a3..4e5b44a4e45855417e873dc77305ff02475aea43 100644 (file)
@@ -19,9 +19,6 @@ static inline void sync(void)
  * properties specified by "flags".
  */
 #define MAP_NOCACHE    1
-#define MAP_WRCOMBINE  0
-#define MAP_WRBACK     0
-#define MAP_WRTHROUGH  0
 
 static inline void *
 map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
@@ -32,20 +29,22 @@ map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
        else
                return (void *)(paddr | gd->arch.mem_region_base);
 }
+#define map_physmem map_physmem
 
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
+static inline void *phys_to_virt(phys_addr_t paddr)
 {
+       DECLARE_GLOBAL_DATA_PTR;
 
+       return (void *)(paddr | gd->arch.mem_region_base);
 }
+#define phys_to_virt phys_to_virt
 
 static inline phys_addr_t virt_to_phys(void * vaddr)
 {
        DECLARE_GLOBAL_DATA_PTR;
        return (phys_addr_t)vaddr & gd->arch.physaddr_mask;
 }
+#define virt_to_phys virt_to_phys
 
 #define __raw_writeb(v,a)       (*(volatile unsigned char  *)(a) = (v))
 #define __raw_writew(v,a)       (*(volatile unsigned short *)(a) = (v))
@@ -171,4 +170,6 @@ static inline void outsl (unsigned long port, const void *src, unsigned long cou
 #define memcpy_fromio(a, b, c)         memcpy((a), (void *)(b), (c))
 #define memcpy_toio(a, b, c)           memcpy((void *)(a), (b), (c))
 
+#include <asm-generic/io.h>
+
 #endif /* __ASM_NIOS2_IO_H_ */
index a54fc468d54c4e9a7679893cde95aed8e8fd8813..34fbfdf1cf0c7ee3e371109de04d3d9e078b612f 100644 (file)
@@ -282,18 +282,7 @@ static inline void out_be32(volatile unsigned __iomem *addr, u32 val)
 #define setbits_8(addr, set) setbits(8, addr, set)
 #define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set)
 
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE    (0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
-
-static inline void *
-map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
+static inline void *phys_to_virt(phys_addr_t paddr)
 {
 #ifdef CONFIG_ADDR_MAP
        return addrmap_phys_to_virt(paddr);
@@ -301,14 +290,7 @@ map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
        return (void *)((unsigned long)paddr);
 #endif
 }
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
+#define phys_to_virt phys_to_virt
 
 static inline phys_addr_t virt_to_phys(void * vaddr)
 {
@@ -318,5 +300,8 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
        return (phys_addr_t)((unsigned long)vaddr);
 #endif
 }
+#define virt_to_phys virt_to_phys
+
+#include <asm-generic/io.h>
 
 #endif
index 01991049ccf7773488328227e8c7ec0a46f5c994..66c3a6a88a7ced30da396dd48af2a816a3cdb9c7 100644 (file)
@@ -56,6 +56,16 @@ int cleanup_before_linux_select(int flags)
        return 0;
 }
 
+void *phys_to_virt(phys_addr_t paddr)
+{
+       return (void *)(gd->arch.ram_buf + paddr);
+}
+
+phys_addr_t virt_to_phys(void *vaddr)
+{
+       return (phys_addr_t)((uint8_t *)vaddr - gd->arch.ram_buf);
+}
+
 void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
 {
 #if defined(CONFIG_PCI) && !defined(CONFIG_SPL_BUILD)
@@ -73,7 +83,7 @@ void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
        }
 #endif
 
-       return (void *)(gd->arch.ram_buf + paddr);
+       return phys_to_virt(paddr);
 }
 
 void unmap_physmem(const void *vaddr, unsigned long flags)
index 22d6aab5348130d2f5dc1b7778051a2facff075a..c524957b6c531afcc1d5d68d0e52c09cadb7a0ba 100644 (file)
@@ -319,6 +319,7 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp)
        DIR *dir;
        int ret;
        char *fname;
+       char *old_fname;
        int len;
        int dirlen;
 
@@ -344,16 +345,23 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp)
                        break;
                }
                next = malloc(sizeof(*node) + strlen(entry->d_name) + 1);
-               if (dirlen + strlen(entry->d_name) > len) {
-                       len = dirlen + strlen(entry->d_name);
-                       fname = realloc(fname, len);
-               }
-               if (!next || !fname) {
-                       free(next);
+               if (!next) {
                        os_dirent_free(head);
                        ret = -ENOMEM;
                        goto done;
                }
+               if (dirlen + strlen(entry->d_name) > len) {
+                       len = dirlen + strlen(entry->d_name);
+                       old_fname = fname;
+                       fname = realloc(fname, len);
+                       if (!fname) {
+                               free(old_fname);
+                               free(next);
+                               os_dirent_free(head);
+                               ret = -ENOMEM;
+                               goto done;
+                       }
+               }
                next->next = NULL;
                strcpy(next->name, entry->d_name);
                switch (entry->d_type) {
index a6856356df199f75bd62c029c5147a8b067e5db5..ae6883f33dfa09880f63cf5d1b39872c3319e07d 100644 (file)
@@ -7,22 +7,22 @@
 #ifndef __SANDBOX_ASM_IO_H
 #define __SANDBOX_ASM_IO_H
 
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE    (0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
+void *phys_to_virt(phys_addr_t paddr);
+#define phys_to_virt phys_to_virt
+
+phys_addr_t virt_to_phys(void *vaddr);
+#define virt_to_phys virt_to_phys
 
 void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags);
+#define map_physmem map_physmem
 
 /*
  * Take down a mapping set up by map_physmem().
  */
 void unmap_physmem(const void *vaddr, unsigned long flags);
+#define unmap_physmem unmap_physmem
+
+#include <asm-generic/io.h>
 
 /* For sandbox, we want addresses to point into our RAM buffer */
 static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
@@ -56,6 +56,53 @@ void outl(unsigned int value, unsigned int addr);
 void outw(unsigned int value, unsigned int addr);
 void outb(unsigned int value, unsigned int addr);
 
+#define out_arch(type,endian,a,v)      write##type(cpu_to_##endian(v),a)
+#define in_arch(type,endian,a)         endian##_to_cpu(read##type(a))
+
+#define out_le32(a,v)  out_arch(l,le32,a,v)
+#define out_le16(a,v)  out_arch(w,le16,a,v)
+
+#define in_le32(a)     in_arch(l,le32,a)
+#define in_le16(a)     in_arch(w,le16,a)
+
+#define out_be32(a,v)  out_arch(l,be32,a,v)
+#define out_be16(a,v)  out_arch(w,be16,a,v)
+
+#define in_be32(a)     in_arch(l,be32,a)
+#define in_be16(a)     in_arch(w,be16,a)
+
+#define out_8(a,v)     writeb(v,a)
+#define in_8(a)                readb(a)
+
+#define clrbits(type, addr, clear) \
+       out_##type((addr), in_##type(addr) & ~(clear))
+
+#define setbits(type, addr, set) \
+       out_##type((addr), in_##type(addr) | (set))
+
+#define clrsetbits(type, addr, clear, set) \
+       out_##type((addr), (in_##type(addr) & ~(clear)) | (set))
+
+#define clrbits_be32(addr, clear) clrbits(be32, addr, clear)
+#define setbits_be32(addr, set) setbits(be32, addr, set)
+#define clrsetbits_be32(addr, clear, set) clrsetbits(be32, addr, clear, set)
+
+#define clrbits_le32(addr, clear) clrbits(le32, addr, clear)
+#define setbits_le32(addr, set) setbits(le32, addr, set)
+#define clrsetbits_le32(addr, clear, set) clrsetbits(le32, addr, clear, set)
+
+#define clrbits_be16(addr, clear) clrbits(be16, addr, clear)
+#define setbits_be16(addr, set) setbits(be16, addr, set)
+#define clrsetbits_be16(addr, clear, set) clrsetbits(be16, addr, clear, set)
+
+#define clrbits_le16(addr, clear) clrbits(le16, addr, clear)
+#define setbits_le16(addr, set) setbits(le16, addr, set)
+#define clrsetbits_le16(addr, clear, set) clrsetbits(le16, addr, clear, set)
+
+#define clrbits_8(addr, clear) clrbits(8, addr, clear)
+#define setbits_8(addr, set) setbits(8, addr, set)
+#define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set)
+
 static inline void _insw(volatile u16 *port, void *buf, int ns)
 {
 }
index 5cb000cada3f82a658a79b635afbf4a335321e9d..be1ff4ad700ed13c60c4bdaa4634957f827f3993 100644 (file)
@@ -231,34 +231,7 @@ static inline void sync(void)
 #define setbits_8(addr, set) setbits(8, addr, set)
 #define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set)
 
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE     (0)
-#define MAP_WRCOMBINE   (0)
-#define MAP_WRBACK      (0)
-#define MAP_WRTHROUGH   (0)
-
-static inline void *
-map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
-{
-       return (void *)paddr;
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
-
-static inline phys_addr_t virt_to_phys(void *vaddr)
-{
-       return (phys_addr_t)(vaddr);
-}
+#include <asm-generic/io.h>
 
 #endif /* __KERNEL__ */
 #endif /* __ASM_SH_IO_H */
index d146b3f5c28deb00ff04b2869147d10b4c822fef..92cfa555ed4d7300b30b2bf93633965bc2aade9b 100644 (file)
@@ -5,3 +5,4 @@
 #
 
 obj-y += car.o tangier.o sdram.o
+obj-$(CONFIG_GENERATE_ACPI_TABLE) += acpi.o
diff --git a/arch/x86/cpu/tangier/acpi.c b/arch/x86/cpu/tangier/acpi.c
new file mode 100644 (file)
index 0000000..75e777d
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2017 Intel Corporation
+ *
+ * Partially based on acpi.c for other x86 platforms
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <cpu.h>
+#include <dm.h>
+#include <dm/uclass-internal.h>
+#include <asm/acpi_table.h>
+#include <asm/ioapic.h>
+#include <asm/mpspec.h>
+#include <asm/tables.h>
+#include <asm/arch/global_nvs.h>
+
+void acpi_create_fadt(struct acpi_fadt *fadt, struct acpi_facs *facs,
+                     void *dsdt)
+{
+       struct acpi_table_header *header = &(fadt->header);
+
+       memset((void *)fadt, 0, sizeof(struct acpi_fadt));
+
+       acpi_fill_header(header, "FACP");
+       header->length = sizeof(struct acpi_fadt);
+       header->revision = 6;
+
+       fadt->firmware_ctrl = (u32)facs;
+       fadt->dsdt = (u32)dsdt;
+       fadt->preferred_pm_profile = ACPI_PM_UNSPECIFIED;
+
+       fadt->iapc_boot_arch = ACPI_FADT_VGA_NOT_PRESENT |
+                              ACPI_FADT_NO_PCIE_ASPM_CONTROL;
+       fadt->flags =
+               ACPI_FADT_WBINVD |
+               ACPI_FADT_POWER_BUTTON | ACPI_FADT_SLEEP_BUTTON |
+               ACPI_FADT_SEALED_CASE | ACPI_FADT_HEADLESS |
+               ACPI_FADT_HW_REDUCED_ACPI;
+
+       fadt->minor_revision = 2;
+
+       fadt->x_firmware_ctl_l = (u32)facs;
+       fadt->x_firmware_ctl_h = 0;
+       fadt->x_dsdt_l = (u32)dsdt;
+       fadt->x_dsdt_h = 0;
+
+       header->checksum = table_compute_checksum(fadt, header->length);
+}
+
+u32 acpi_fill_madt(u32 current)
+{
+       current += acpi_create_madt_lapics(current);
+
+       current += acpi_create_madt_ioapic((struct acpi_madt_ioapic *)current,
+                       io_apic_read(IO_APIC_ID) >> 24, IO_APIC_ADDR, 0);
+
+       return current;
+}
+
+u32 acpi_fill_mcfg(u32 current)
+{
+       /* TODO: Derive parameters from SFI MCFG table */
+       current += acpi_create_mcfg_mmconfig
+               ((struct acpi_mcfg_mmconfig *)current,
+               0x3f500000, 0x0, 0x0, 0x0);
+
+       return current;
+}
+
+void acpi_create_gnvs(struct acpi_global_nvs *gnvs)
+{
+       struct udevice *dev;
+       int ret;
+
+       /* at least we have one processor */
+       gnvs->pcnt = 1;
+
+       /* override the processor count with actual number */
+       ret = uclass_find_first_device(UCLASS_CPU, &dev);
+       if (ret == 0 && dev != NULL) {
+               ret = cpu_get_count(dev);
+               if (ret > 0)
+                       gnvs->pcnt = ret;
+       }
+}
index 5743077431d3da6b46b48bcadfbb41f8526f0f07..eae8d785df9ed431e1cb59b1cad528ff9b5875d8 100644 (file)
@@ -39,7 +39,7 @@ static int sfi_table_check(struct sfi_table_header *sbh)
                chksum += *pos++;
 
        if (chksum)
-               error("sfi: Invalid checksum\n");
+               pr_err("sfi: Invalid checksum\n");
 
        /* Checksum is OK if zero */
        return chksum ? -EILSEQ : 0;
@@ -76,7 +76,7 @@ static struct sfi_table_simple *sfi_search_mmap(void)
        /* Find SYST table */
        sb = sfi_get_table_by_sig(SFI_BASE_ADDR, SFI_SIG_SYST);
        if (!sb) {
-               error("sfi: failed to locate SYST table\n");
+               pr_err("sfi: failed to locate SYST table\n");
                return NULL;
        }
 
@@ -90,7 +90,7 @@ static struct sfi_table_simple *sfi_search_mmap(void)
                        return (struct sfi_table_simple *)sbh;
        }
 
-       error("sfi: failed to locate SFI MMAP table\n");
+       pr_err("sfi: failed to locate SFI MMAP table\n");
        return NULL;
 }
 
diff --git a/arch/x86/include/asm/arch-tangier/acpi/global_nvs.asl b/arch/x86/include/asm/arch-tangier/acpi/global_nvs.asl
new file mode 100644 (file)
index 0000000..b1f0f67
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2017 Intel Corporation
+ *
+ * Partially based on global_nvs.asl for other x86 platforms
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <asm/acpi/global_nvs.h>
+
+OperationRegion(GNVS, SystemMemory, ACPI_GNVS_ADDR, ACPI_GNVS_SIZE)
+Field(GNVS, ByteAcc, NoLock, Preserve)
+{
+    Offset (0x00),
+    PCNT, 8,    /* processor count */
+}
diff --git a/arch/x86/include/asm/arch-tangier/acpi/platform.asl b/arch/x86/include/asm/arch-tangier/acpi/platform.asl
new file mode 100644 (file)
index 0000000..a57b7cb
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017 Intel Corporation
+ *
+ * Partially based on platform.asl for other x86 platforms
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <asm/acpi/statdef.asl>
+
+/*
+ * The _PTS method (Prepare To Sleep) is called before the OS is
+ * entering a sleep state. The sleep state number is passed in Arg0.
+ */
+Method(_PTS, 1)
+{
+}
+
+/* The _WAK method is called on system wakeup */
+Method(_WAK, 1)
+{
+    Return (Package() {0, 0})
+}
+
+/* ACPI global NVS */
+#include "global_nvs.asl"
+
+Scope (\_SB)
+{
+    #include "southcluster.asl"
+}
diff --git a/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl b/arch/x86/include/asm/arch-tangier/acpi/southcluster.asl
new file mode 100644 (file)
index 0000000..e80ec0a
--- /dev/null
@@ -0,0 +1,298 @@
+/*
+ * Copyright (c) 2017 Intel Corporation
+ *
+ * Partially based on southcluster.asl for other x86 platforms
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+Device (PCI0)
+{
+    Name (_HID, EISAID("PNP0A08"))    /* PCIe */
+    Name (_CID, EISAID("PNP0A03"))    /* PCI */
+
+    Name (_ADR, 0)
+    Name (_BBN, 0)
+
+    Name (MCRS, ResourceTemplate()
+    {
+        /* Bus Numbers */
+        WordBusNumber(ResourceProducer, MinFixed, MaxFixed, PosDecode,
+                0x0000, 0x0000, 0x00ff, 0x0000, 0x0100, , , PB00)
+
+        /* IO Region 0 */
+        WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
+                0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8, , , PI00)
+
+        /* PCI Config Space */
+        IO(Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
+
+        /* IO Region 1 */
+        WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
+                0x0000, 0x0d00, 0xffff, 0x0000, 0xf300, , , PI01)
+
+        /* GPIO Low Memory Region */
+        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                Cacheable, ReadWrite,
+                0x00000000, 0x000ddcc0, 0x000ddccf, 0x00000000,
+                0x00000010, , , GP00)
+
+        /* PSH Memory Region 0 */
+        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                Cacheable, ReadWrite,
+                0x00000000, 0x04819000, 0x04898fff, 0x00000000,
+                0x00080000, , , PSH0)
+
+        /* PSH Memory Region 1 */
+        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                Cacheable, ReadWrite,
+                0x00000000, 0x04919000, 0x04920fff, 0x00000000,
+                0x00008000, , , PSH1)
+
+        /* SST Memory Region */
+        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                Cacheable, ReadWrite,
+                0x00000000, 0x05e00000, 0x05ffffff, 0x00000000,
+                0x00200000, , , SST0)
+
+        /* PCI Memory Region */
+        DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                Cacheable, ReadWrite,
+                0x00000000, 0x80000000, 0xffffffff, 0x00000000,
+                0x80000000, , , PMEM)
+    })
+
+    Method (_CRS, 0, Serialized)
+    {
+        Return (MCRS)
+    }
+
+    Method (_OSC, 4)
+    {
+        /* Check for proper GUID */
+        If (LEqual(Arg0, ToUUID("33db4d5b-1ff7-401c-9657-7441c03dd766"))) {
+            /* Let OS control everything */
+            Return (Arg3)
+        } Else {
+            /* Unrecognized UUID */
+            CreateDWordField(Arg3, 0, CDW1)
+            Or(CDW1, 4, CDW1)
+            Return (Arg3)
+        }
+    }
+
+    Device (SDHC)
+    {
+        Name (_ADR, 0x00010003)
+        Name (_DEP, Package (0x01)
+        {
+            GPIO
+        })
+        Name (PSTS, Zero)
+
+        Method (_STA)
+        {
+            Return (STA_VISIBLE)
+        }
+
+        Method (_PS3, 0, NotSerialized)
+        {
+        }
+
+        Method (_PS0, 0, NotSerialized)
+        {
+            If (PSTS == Zero)
+            {
+                If (^^GPIO.AVBL == One)
+                {
+                    ^^GPIO.WFD3 = One
+                    PSTS = One
+                }
+            }
+        }
+
+        /* BCM43340 */
+        Device (BRC1)
+        {
+            Name (_ADR, 0x01)
+            Name (_DEP, Package (0x01)
+            {
+                GPIO
+            })
+
+            Method (_STA)
+            {
+                Return (STA_VISIBLE)
+            }
+
+            Method (_RMV, 0, NotSerialized)
+            {
+                Return (Zero)
+            }
+
+            Method (_PS3, 0, NotSerialized)
+            {
+                If (^^^GPIO.AVBL == One)
+                {
+                    ^^^GPIO.WFD3 = Zero
+                    PSTS = Zero
+                }
+            }
+
+            Method (_PS0, 0, NotSerialized)
+            {
+                If (PSTS == Zero)
+                {
+                    If (^^^GPIO.AVBL == One)
+                    {
+                        ^^^GPIO.WFD3 = One
+                        PSTS = One
+                    }
+                }
+            }
+        }
+
+        Device (BRC2)
+        {
+            Name (_ADR, 0x02)
+            Method (_STA, 0, NotSerialized)
+            {
+                Return (STA_VISIBLE)
+            }
+
+            Method (_RMV, 0, NotSerialized)
+            {
+                Return (Zero)
+            }
+        }
+    }
+
+    Device (SPI5)
+    {
+        Name (_ADR, 0x00070001)
+        Name (RBUF, ResourceTemplate()
+        {
+            GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
+                "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 91 }
+            GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
+                "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 92 }
+            GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
+                "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 93 }
+            GpioIo(Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly,
+                "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 94 }
+        })
+
+        Method (_CRS, 0, NotSerialized)
+        {
+            Return (RBUF)
+        }
+
+        /*
+         * See
+         * http://www.kernel.org/doc/Documentation/acpi/gpio-properties.txt
+         * for more information about GPIO bindings.
+         */
+        Name (_DSD, Package () {
+            ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+            Package () {
+                Package () {
+                    "cs-gpios", Package () {
+                        ^SPI5, 0, 0, 0,
+                        ^SPI5, 1, 0, 0,
+                        ^SPI5, 2, 0, 0,
+                        ^SPI5, 3, 0, 0,
+                    },
+                },
+            }
+        })
+
+        Method (_STA, 0, NotSerialized)
+        {
+            Return (STA_VISIBLE)
+        }
+    }
+
+    Device (I2C1)
+    {
+        Name (_ADR, 0x00080000)
+
+        Method (_STA, 0, NotSerialized)
+        {
+            Return (STA_VISIBLE)
+        }
+    }
+
+    Device (GPIO)
+    {
+        Name (_ADR, 0x000c0000)
+
+        Method (_STA)
+        {
+            Return (STA_VISIBLE)
+        }
+
+        Name (AVBL, Zero)
+        Method (_REG, 2, NotSerialized)
+        {
+            If (Arg0 == 0x08)
+            {
+                AVBL = Arg1
+            }
+        }
+
+        OperationRegion (GPOP, GeneralPurposeIo, 0, 1)
+        Field (GPOP, ByteAcc, NoLock, Preserve)
+        {
+            Connection (
+                GpioIo(Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
+                    "\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 56 }
+            ),
+            WFD3, 1,
+        }
+    }
+
+    Device (PWM0)
+    {
+        Name (_ADR, 0x00170000)
+
+        Method (_STA, 0, NotSerialized)
+        {
+            Return (STA_VISIBLE)
+        }
+    }
+}
+
+Device (FLIS)
+{
+    Name (_HID, "PRP0001")
+    Name (_DDN, "Intel Merrifield Family-Level Interface Shim")
+    Name (RBUF, ResourceTemplate()
+    {
+        Memory32Fixed(ReadWrite, 0xFF0C0000, 0x00008000, )
+        PinGroup("spi5", ResourceProducer, ) { 90, 91, 92, 93, 94, 95, 96 }
+        PinGroup("uart0", ResourceProducer, ) { 115, 116, 117, 118 }
+        PinGroup("uart1", ResourceProducer, ) { 119, 120, 121, 122 }
+        PinGroup("uart2", ResourceProducer, ) { 123, 124, 125, 126 }
+        PinGroup("pwm0", ResourceProducer, ) { 144 }
+        PinGroup("pwm1", ResourceProducer, ) { 145 }
+        PinGroup("pwm2", ResourceProducer, ) { 132 }
+        PinGroup("pwm3", ResourceProducer, ) { 133 }
+    })
+
+    Method (_CRS, 0, NotSerialized)
+    {
+        Return (RBUF)
+    }
+
+    Name (_DSD, Package () {
+        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+        Package () {
+            Package () {"compatible", "intel,merrifield-pinctrl"},
+        }
+    })
+
+    Method (_STA, 0, NotSerialized)
+    {
+        Return (STA_VISIBLE)
+    }
+}
diff --git a/arch/x86/include/asm/arch-tangier/global_nvs.h b/arch/x86/include/asm/arch-tangier/global_nvs.h
new file mode 100644 (file)
index 0000000..8ab5cf2
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017 Intel Corporation
+ *
+ * Partially based on global_nvs.h for other x86 platforms
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef _GLOBAL_NVS_H_
+#define _GLOBAL_NVS_H_
+
+struct __packed acpi_global_nvs {
+       u8      pcnt;           /* processor count */
+
+       /*
+        * Add padding so sizeof(struct acpi_global_nvs) == 0x100.
+        * This must match the size defined in the global_nvs.asl.
+        */
+       u8      rsvd[255];
+};
+
+#endif /* _GLOBAL_NVS_H_ */
index a72daf226300c64e172046efb1bcfd4217b78956..263dd8fd170e9da45df1c6877202fdde5aec9086 100644 (file)
@@ -230,35 +230,6 @@ static inline void sync(void)
 {
 }
 
-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE    (0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
-
-static inline void *
-map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
-{
-       return (void *)(uintptr_t)paddr;
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
-
-static inline phys_addr_t virt_to_phys(void * vaddr)
-{
-       return (phys_addr_t)(uintptr_t)(vaddr);
-}
-
 /*
  * TODO: The kernel offers some more advanced versions of barriers, it might
  * have some advantages to use them instead of the simple one here.
@@ -267,4 +238,6 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
 #define __iormb()      dmb()
 #define __iowmb()      dmb()
 
+#include <asm-generic/io.h>
+
 #endif /* _ASM_IO_H */
index e34d6e1d7fa389469b83bd6194ef44358339adc6..c9e335f4f6658e0eaf2a987ae67b5f587c2f54b1 100644 (file)
@@ -115,29 +115,6 @@ void outsl(unsigned long port, const void *src, unsigned long count);
  */
 #define xlate_dev_kmem_ptr(p)   p
 
-#define MAP_NOCACHE    (0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK     (0)
-#define MAP_WRTHROUGH  (0)
-
-static inline void *
-map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
-{
-       return (void *)paddr;
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-}
-
-static inline phys_addr_t virt_to_phys(void *vaddr)
-{
-       return (phys_addr_t)((unsigned long)vaddr);
-}
-
 /*
  * Dummy function to keep U-Boot's cfi_flash.c driver happy.
  */
@@ -145,4 +122,6 @@ static inline void sync(void)
 {
 }
 
+#include <asm-generic/io.h>
+
 #endif /* _XTENSA_IO_H */
index ceee42c16e24591a57ebba90fb42e8b1cc036dfe..7985671fbd708a12bc0ea01d42729d77a6aeff1d 100644 (file)
@@ -5,3 +5,16 @@
  */
 
 #include <common.h>
+
+#ifndef CONFIG_TPL_BUILD
+#include <spl.h>
+
+int spl_start_uboot(void)
+{
+        /* break into full u-boot on 'c' */
+        if (serial_tstc() && serial_getc() == 'c')
+                return 1;
+
+        return 0;
+}
+#endif
index be6dd4a6d39223143af71bfd3778fa3f5358ea2d..d69831ad152edf7c16940903d61c1736c54f0def 100644 (file)
 #include <asm/arch/clk.h>
 #include <asm/arch/gpio.h>
 #include <debug_uart.h>
-#include <lcd.h>
-#include <atmel_hlcdc.h>
-#ifdef CONFIG_LCD_INFO
-#include <nand.h>
-#include <version.h>
-#endif
 #include <asm/mach-types.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -86,103 +80,15 @@ static void at91sam9x5ek_nand_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-       .vl_col = 800,
-       .vl_row = 480,
-       .vl_clk = 24000000,
-       .vl_sync = LCDC_LCDCFG5_HSPOL | LCDC_LCDCFG5_VSPOL,
-       .vl_bpix = LCD_BPP,
-       .vl_tft = 1,
-       .vl_clk_pol = 1,
-       .vl_hsync_len = 128,
-       .vl_left_margin = 64,
-       .vl_right_margin = 64,
-       .vl_vsync_len = 2,
-       .vl_upper_margin = 22,
-       .vl_lower_margin = 21,
-       .mmio = ATMEL_BASE_LCDC,
-};
-
-void lcd_enable(void)
-{
-       if (has_lcdc())
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 29, 1);  /* power up */
-}
-
-void lcd_disable(void)
-{
-       if (has_lcdc())
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 29, 0);  /* power down */
-}
-
-static void at91sam9x5ek_lcd_hw_init(void)
-{
-       if (has_lcdc()) {
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 26, 0);  /* LCDPWM */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 27, 0);  /* LCDVSYNC */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 28, 0);  /* LCDHSYNC */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 24, 0);  /* LCDDISP */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 29, 0);  /* LCDDEN */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 30, 0);  /* LCDPCK */
-
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 0, 0);   /* LCDD0 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 1, 0);   /* LCDD1 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 2, 0);   /* LCDD2 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 3, 0);   /* LCDD3 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 4, 0);   /* LCDD4 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 5, 0);   /* LCDD5 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 6, 0);   /* LCDD6 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 7, 0);   /* LCDD7 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 8, 0);   /* LCDD8 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 9, 0);   /* LCDD9 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 10, 0);  /* LCDD10 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 11, 0);  /* LCDD11 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 12, 0);  /* LCDD12 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 13, 0);  /* LCDD13 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 14, 0);  /* LCDD14 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 15, 0);  /* LCDD15 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 16, 0);  /* LCDD16 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 17, 0);  /* LCDD17 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 18, 0);  /* LCDD18 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 19, 0);  /* LCDD19 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 20, 0);  /* LCDD20 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 21, 0);  /* LCDD21 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 22, 0);  /* LCDD22 */
-               at91_pio3_set_a_periph(AT91_PIO_PORTC, 23, 0);  /* LCDD23 */
-
-               at91_periph_clk_enable(ATMEL_ID_LCDC);
-       }
-}
-
-#ifdef CONFIG_LCD_INFO
-void lcd_show_board_info(void)
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
 {
-       ulong dram_size, nand_size;
-       int i;
-       char temp[32];
-
-       if (has_lcdc()) {
-               lcd_printf("%s\n", U_BOOT_VERSION);
-               lcd_printf("(C) 2012 ATMEL Corp\n");
-               lcd_printf("at91support@atmel.com\n");
-               lcd_printf("%s CPU at %s MHz\n",
-                       get_cpu_name(),
-                       strmhz(temp, get_cpu_clk_rate()));
-
-               dram_size = 0;
-               for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
-                       dram_size += gd->bd->bi_dram[i].size;
-               nand_size = 0;
-               for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-                       nand_size += get_nand_dev_by_index(i)->size;
-               lcd_printf("  %ld MB SDRAM, %ld MB NAND\n",
-                       dram_size >> 20,
-                       nand_size >> 20);
-       }
+#ifdef CONFIG_DM_VIDEO
+       at91_video_show_board_info();
+#endif
+       return 0;
 }
-#endif /* CONFIG_LCD_INFO */
-#endif /* CONFIG_LCD */
+#endif
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
@@ -215,9 +121,6 @@ int board_init(void)
 
 #if defined(CONFIG_USB_OHCI_NEW) || defined(CONFIG_USB_EHCI_HCD)
        at91_uhp_hw_init();
-#endif
-#ifdef CONFIG_LCD
-       at91sam9x5ek_lcd_hw_init();
 #endif
        return 0;
 }
index 39ad6198192c507a7e3a8eeb0f48319114fc4768..b20abc738674a0d2cfa7e61d0ee4f8d309b467be 100644 (file)
@@ -43,7 +43,7 @@ int at91_video_show_board_info(void)
        nand_size = 0;
 #ifdef CONFIG_NAND_ATMEL
        for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-               nand_size += nand_info[i]->size;
+               nand_size += get_nand_dev_by_index(i)->size;
 #endif
 
        len += sprintf(&buf[len], "%ld MB SDRAM, %ld MB NAND\n",
index 57586530304531880c6a6f7b702b6d1b9d09c048..778142ac7161c2da494f101a31272daafb7e6464 100644 (file)
@@ -6,10 +6,7 @@
  */
 
 #include <common.h>
-#include <atmel_hlcdc.h>
 #include <debug_uart.h>
-#include <lcd.h>
-#include <version.h>
 #include <asm/io.h>
 #include <asm/arch/at91_common.h>
 #include <asm/arch/atmel_pio4.h>
@@ -26,90 +23,15 @@ static void board_usb_hw_init(void)
        atmel_pio4_set_pio_output(AT91_PIO_PORTB, 10, 1);
 }
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-       .vl_col = 480,
-       .vl_row = 272,
-       .vl_clk = 9000000,
-       .vl_bpix = LCD_BPP,
-       .vl_tft = 1,
-       .vl_hsync_len = 41,
-       .vl_left_margin = 2,
-       .vl_right_margin = 2,
-       .vl_vsync_len = 11,
-       .vl_upper_margin = 2,
-       .vl_lower_margin = 2,
-       .mmio = ATMEL_BASE_LCDC,
-};
-
-/* No power up/down pin for the LCD pannel */
-void lcd_enable(void)  { /* Empty! */ }
-void lcd_disable(void) { /* Empty! */ }
-
-unsigned int has_lcdc(void)
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
 {
-       return 1;
-}
-
-static void board_lcd_hw_init(void)
-{
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 28, 0); /* LCDPWM */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 29, 0); /* LCDDISP */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 30, 0); /* LCDVSYNC */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 31, 0); /* LCDHSYNC */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTD,  0, 0); /* LCDPCK */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTD,  1, 0); /* LCDDEN */
-
-       /* LCDDAT0 */
-       /* LCDDAT1 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 10, 0); /* LCDDAT2 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 11, 0); /* LCDDAT3 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 12, 0); /* LCDDAT4 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 13, 0); /* LCDDAT5 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 14, 0); /* LCDDAT6 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 15, 0); /* LCDDAT7 */
-
-       /* LCDDAT8 */
-       /* LCDDAT9 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 16, 0); /* LCDDAT10 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 17, 0); /* LCDDAT11 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 18, 0); /* LCDDAT12 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 19, 0); /* LCDDAT13 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 20, 0); /* LCDDAT14 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 21, 0); /* LCDDAT15 */
-
-       /* LCDD16 */
-       /* LCDD17 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 22, 0); /* LCDDAT18 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 23, 0); /* LCDDAT19 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 24, 0); /* LCDDAT20 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 25, 0); /* LCDDAT21 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 26, 0); /* LCDDAT22 */
-       atmel_pio4_set_a_periph(AT91_PIO_PORTC, 27, 0); /* LCDDAT23 */
-
-       at91_periph_clk_enable(ATMEL_ID_LCDC);
-}
-
-#ifdef CONFIG_LCD_INFO
-void lcd_show_board_info(void)
-{
-       ulong dram_size;
-       int i;
-       char temp[32];
-
-       lcd_printf("%s\n", U_BOOT_VERSION);
-       lcd_printf("2015 ATMEL Corp\n");
-       lcd_printf("%s CPU at %s MHz\n", get_cpu_name(),
-                  strmhz(temp, get_cpu_clk_rate()));
-
-       dram_size = 0;
-       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
-               dram_size += gd->bd->bi_dram[i].size;
-
-       lcd_printf("%ld MB SDRAM\n", dram_size >> 20);
+#ifdef CONFIG_DM_VIDEO
+       at91_video_show_board_info();
+#endif
+       return 0;
 }
-#endif /* CONFIG_LCD_INFO */
-#endif /* CONFIG_LCD */
+#endif
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 static void board_uart1_hw_init(void)
@@ -142,9 +64,6 @@ int board_init(void)
        /* address of boot parameters */
        gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-#ifdef CONFIG_LCD
-       board_lcd_hw_init();
-#endif
 #ifdef CONFIG_CMD_USB
        board_usb_hw_init();
 #endif
index 6d473fc06dbd94e67cc64796d55d0a642c300939..98d846fd79e250e3169f492674ebcfcec7d66865 100644 (file)
@@ -13,9 +13,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/arch/clk.h>
 #include <debug_uart.h>
-#include <lcd.h>
 #include <linux/ctype.h>
-#include <atmel_hlcdc.h>
 #include <phy.h>
 #include <micrel.h>
 #include <spl.h>
@@ -132,80 +130,6 @@ static void sama5d3xek_mci_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-       .vl_col = 800,
-       .vl_row = 480,
-       .vl_clk = 24000000,
-       .vl_bpix = LCD_BPP,
-       .vl_tft = 1,
-       .vl_hsync_len = 128,
-       .vl_left_margin = 64,
-       .vl_right_margin = 64,
-       .vl_vsync_len = 2,
-       .vl_upper_margin = 22,
-       .vl_lower_margin = 21,
-       .mmio = ATMEL_BASE_LCDC,
-};
-
-void lcd_enable(void)
-{
-}
-
-void lcd_disable(void)
-{
-}
-
-static void sama5d3xek_lcd_hw_init(void)
-{
-       gd->fb_base = CONFIG_SAMA5D3_LCD_BASE;
-
-       /* The higher 8 bit of LCD is board related */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 14, 0);  /* LCDD16 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 13, 0);  /* LCDD17 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 12, 0);  /* LCDD18 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 11, 0);  /* LCDD19 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 10, 0);  /* LCDD20 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTC, 15, 0);  /* LCDD21 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTE, 27, 0);  /* LCDD22 */
-       at91_pio3_set_c_periph(AT91_PIO_PORTE, 28, 0);  /* LCDD23 */
-
-       /* Configure lower 16 bit of LCD and enable clock */
-       at91_lcd_hw_init();
-}
-
-#ifdef CONFIG_LCD_INFO
-#include <nand.h>
-#include <version.h>
-
-void lcd_show_board_info(void)
-{
-       ulong dram_size;
-       uint64_t nand_size;
-       int i;
-       char temp[32];
-
-       lcd_printf("%s\n", U_BOOT_VERSION);
-       lcd_printf("(C) 2013 ATMEL Corp\n");
-       lcd_printf("at91@atmel.com\n");
-       lcd_printf("%s CPU at %s MHz\n", get_cpu_name(),
-                  strmhz(temp, get_cpu_clk_rate()));
-
-       dram_size = 0;
-       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
-               dram_size += gd->bd->bi_dram[i].size;
-
-       nand_size = 0;
-#ifdef CONFIG_NAND_ATMEL
-       for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-               nand_size += get_nand_dev_by_index(i)->size;
-#endif
-       lcd_printf("%ld MB SDRAM, %lld MB NAND\n",
-                  dram_size >> 20, nand_size >> 20);
-}
-#endif /* CONFIG_LCD_INFO */
-#endif /* CONFIG_LCD */
-
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 void board_debug_uart_init(void)
 {
@@ -239,10 +163,6 @@ int board_init(void)
 #endif
 #ifdef CONFIG_GENERIC_ATMEL_MCI
        sama5d3xek_mci_hw_init();
-#endif
-#ifdef CONFIG_LCD
-       if (has_lcdc())
-               sama5d3xek_lcd_hw_init();
 #endif
        return 0;
 }
@@ -268,6 +188,9 @@ int board_late_init(void)
 
        strcat(name, "ek.dtb");
        env_set("dtb_name", name);
+#endif
+#ifdef CONFIG_DM_VIDEO
+       at91_video_show_board_info();
 #endif
        return 0;
 }
index 9236a285492105224d3d40203f1e9f9eb3520410..78eddb8beb01f749829a20493c764ab2cb83e340 100644 (file)
 #include <asm/arch/clk.h>
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
-#include <atmel_hlcdc.h>
 #include <debug_uart.h>
-#include <lcd.h>
-#include <nand.h>
-#include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -73,98 +69,15 @@ static void sama5d4_xplained_usb_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-       .vl_col = 480,
-       .vl_row = 272,
-       .vl_clk = 9000000,
-       .vl_bpix = LCD_BPP,
-       .vl_tft = 1,
-       .vl_hsync_len = 41,
-       .vl_left_margin = 2,
-       .vl_right_margin = 2,
-       .vl_vsync_len = 11,
-       .vl_upper_margin = 2,
-       .vl_lower_margin = 2,
-       .mmio = ATMEL_BASE_LCDC,
-};
-
-/* No power up/down pin for the LCD pannel */
-void lcd_enable(void)  { /* Empty! */ }
-void lcd_disable(void) { /* Empty! */ }
-
-unsigned int has_lcdc(void)
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
 {
-       return 1;
-}
-
-static void sama5d4_xplained_lcd_hw_init(void)
-{
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 24, 0);  /* LCDPWM */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 25, 0);  /* LCDDISP */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 26, 0);  /* LCDVSYNC */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 27, 0);  /* LCDHSYNC */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 28, 0);  /* LCDDOTCK */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 29, 0);  /* LCDDEN */
-
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  0, 0);  /* LCDD0 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  1, 0);  /* LCDD1 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  2, 0);  /* LCDD2 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  3, 0);  /* LCDD3 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  4, 0);  /* LCDD4 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  5, 0);  /* LCDD5 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  6, 0);  /* LCDD6 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  7, 0);  /* LCDD7 */
-
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  8, 0);  /* LCDD9 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  9, 0);  /* LCDD8 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 10, 0);  /* LCDD10 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 11, 0);  /* LCDD11 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 12, 0);  /* LCDD12 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 13, 0);  /* LCDD13 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 14, 0);  /* LCDD14 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 15, 0);  /* LCDD15 */
-
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 16, 0);  /* LCDD16 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 17, 0);  /* LCDD17 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 18, 0);  /* LCDD18 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 19, 0);  /* LCDD19 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 20, 0);  /* LCDD20 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 21, 0);  /* LCDD21 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 22, 0);  /* LCDD22 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 23, 0);  /* LCDD23 */
-
-       /* Enable clock */
-       at91_periph_clk_enable(ATMEL_ID_LCDC);
-}
-
-#ifdef CONFIG_LCD_INFO
-void lcd_show_board_info(void)
-{
-       ulong dram_size, nand_size;
-       int i;
-       char temp[32];
-
-       lcd_printf("%s\n", U_BOOT_VERSION);
-       lcd_printf("2014 ATMEL Corp\n");
-       lcd_printf("%s CPU at %s MHz\n", get_cpu_name(),
-                  strmhz(temp, get_cpu_clk_rate()));
-
-       dram_size = 0;
-       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
-               dram_size += gd->bd->bi_dram[i].size;
-
-       nand_size = 0;
-#ifdef CONFIG_NAND_ATMEL
-       for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-               nand_size += get_nand_dev_by_index(i)->size;
+#ifdef CONFIG_DM_VIDEO
+       at91_video_show_board_info();
 #endif
-       lcd_printf("%ld MB SDRAM, %ld MB NAND\n",
-                  dram_size >> 20, nand_size >> 20);
+       return 0;
 }
-#endif /* CONFIG_LCD_INFO */
-
-#endif /* CONFIG_LCD */
+#endif
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 static void sama5d4_xplained_serial3_hw_init(void)
@@ -212,9 +125,6 @@ int board_init(void)
 #ifdef CONFIG_NAND_ATMEL
        sama5d4_xplained_nand_hw_init();
 #endif
-#ifdef CONFIG_LCD
-       sama5d4_xplained_lcd_hw_init();
-#endif
 #ifdef CONFIG_CMD_USB
        sama5d4_xplained_usb_hw_init();
 #endif
index ee07038e2e4f9e2270a94351297495bae6c6dc0b..48c43f01630a25c46fd72b4079c5777984ef34d6 100644 (file)
 #include <asm/arch/clk.h>
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
-#include <atmel_hlcdc.h>
 #include <debug_uart.h>
-#include <lcd.h>
-#include <nand.h>
-#include <version.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -74,93 +70,15 @@ static void sama5d4ek_usb_hw_init(void)
 }
 #endif
 
-#ifdef CONFIG_LCD
-vidinfo_t panel_info = {
-       .vl_col = 800,
-       .vl_row = 480,
-       .vl_clk = 33260000,
-       .vl_bpix = LCD_BPP,
-       .vl_tft = 1,
-       .vl_hsync_len = 5,
-       .vl_left_margin = 128,
-       .vl_right_margin = 0,
-       .vl_vsync_len = 5,
-       .vl_upper_margin = 23,
-       .vl_lower_margin = 22,
-       .mmio = ATMEL_BASE_LCDC,
-};
-
-/* No power up/down pin for the LCD pannel */
-void lcd_enable(void)  { /* Empty! */ }
-void lcd_disable(void) { /* Empty! */ }
-
-unsigned int has_lcdc(void)
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
 {
-       return 1;
-}
-
-static void sama5d4ek_lcd_hw_init(void)
-{
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 24, 0);  /* LCDPWM */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 25, 0);  /* LCDDISP */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 26, 0);  /* LCDVSYNC */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 27, 0);  /* LCDHSYNC */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 28, 0);  /* LCDDOTCK */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 29, 0);  /* LCDDEN */
-
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  2, 0);  /* LCDD2 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  3, 0);  /* LCDD3 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  4, 0);  /* LCDD4 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  5, 0);  /* LCDD5 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  6, 0);  /* LCDD6 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA,  7, 0);  /* LCDD7 */
-
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 10, 0);  /* LCDD10 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 11, 0);  /* LCDD11 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 12, 0);  /* LCDD12 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 13, 0);  /* LCDD13 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 14, 0);  /* LCDD14 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 15, 0);  /* LCDD15 */
-
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 18, 0);  /* LCDD18 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 19, 0);  /* LCDD19 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 20, 0);  /* LCDD20 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 21, 0);  /* LCDD21 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 22, 0);  /* LCDD22 */
-       at91_pio3_set_a_periph(AT91_PIO_PORTA, 23, 0);  /* LCDD23 */
-
-       /* Enable clock */
-       at91_periph_clk_enable(ATMEL_ID_LCDC);
-}
-
-#ifdef CONFIG_LCD_INFO
-void lcd_show_board_info(void)
-{
-       ulong dram_size, nand_size;
-       int i;
-       char temp[32];
-
-       lcd_printf("%s\n", U_BOOT_VERSION);
-       lcd_printf("2014 ATMEL Corp\n");
-       lcd_printf("at91@atmel.com\n");
-       lcd_printf("%s CPU at %s MHz\n", get_cpu_name(),
-                  strmhz(temp, get_cpu_clk_rate()));
-
-       dram_size = 0;
-       for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++)
-               dram_size += gd->bd->bi_dram[i].size;
-
-       nand_size = 0;
-#ifdef CONFIG_NAND_ATMEL
-       for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++)
-               nand_size += get_nand_dev_by_index(i)->size;
+#ifdef CONFIG_DM_VIDEO
+       at91_video_show_board_info();
 #endif
-       lcd_printf("%ld MB SDRAM, %ld MB NAND\n",
-                  dram_size >> 20, nand_size >> 20);
+       return 0;
 }
-#endif /* CONFIG_LCD_INFO */
-
-#endif /* CONFIG_LCD */
+#endif
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
 static void sama5d4ek_serial3_hw_init(void)
@@ -196,9 +114,6 @@ int board_init(void)
 #ifdef CONFIG_NAND_ATMEL
        sama5d4ek_nand_hw_init();
 #endif
-#ifdef CONFIG_LCD
-       sama5d4ek_lcd_hw_init();
-#endif
 #ifdef CONFIG_CMD_USB
        sama5d4ek_usb_hw_init();
 #endif
index bb1188b4ea2d27ed3efd8225301755b0adc1548c..e0df97ca0ea4558244fb7e9716aabf5df70f4514 100644 (file)
@@ -33,6 +33,8 @@ config MAC_ADDR_IN_EEPROM
 
 endif
 
+source "board/ti/common/Kconfig"
+
 endif
 
 if TARGET_OMAPL138_LCDK
index 516d86df5097208c7b0d93595934f44c17adf8f4..83c9f2940fe87791908d6c7a739ad14bd98ad4ee 100644 (file)
@@ -60,7 +60,7 @@ static int get_mac_addr(u8 *addr)
                return -1;
        }
 
-       ret = spi_flash_read(flash, CFG_MAC_ADDR_OFFSET, 6, addr);
+       ret = spi_flash_read(flash, (CFG_MAC_ADDR_OFFSET) + 1, 7, addr);
        if (ret) {
                printf("Error - unable to read MAC address from SPI flash.\n");
                return -1;
@@ -140,6 +140,7 @@ int misc_init_r(void)
        uchar buff[6];
 
        spi_mac_read = get_mac_addr(buff);
+       buff[0] = 0;
 
        /*
         * MAC address not present in the environment
diff --git a/board/emulation/qemu-arm/MAINTAINERS b/board/emulation/qemu-arm/MAINTAINERS
new file mode 100644 (file)
index 0000000..a803061
--- /dev/null
@@ -0,0 +1,6 @@
+QEMU ARM 'VIRT' BOARD
+M:     Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
+S:     Maintained
+F:     board/emulation/qemu-arm/
+F:     include/configs/qemu-arm.h
+F:     configs/qemu_arm_defconfig
diff --git a/board/emulation/qemu-arm/Makefile b/board/emulation/qemu-arm/Makefile
new file mode 100644 (file)
index 0000000..716a6e9
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  += qemu-arm.o
diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
new file mode 100644 (file)
index 0000000..e29ba46
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2017 Tuomas Tynkkynen
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+#include <common.h>
+#include <fdtdec.h>
+
+int board_init(void)
+{
+       return 0;
+}
+
+int dram_init(void)
+{
+       if (fdtdec_setup_memory_size() != 0)
+               return -EINVAL;
+
+       return 0;
+}
+
+int dram_init_banksize(void)
+{
+       fdtdec_setup_memory_banksize();
+
+       return 0;
+}
+
+void *board_fdt_blob_setup(void)
+{
+       /* QEMU loads a generated DTB for us at the start of RAM. */
+       return (void *)CONFIG_SYS_SDRAM_BASE;
+}
index 666562d106b178a16acc1499470f5eb38bd3b72d..827bfad521d47414ff8236bdeb894f4f9ec36411 100644 (file)
@@ -251,6 +251,8 @@ int misc_init_r(void)
        char *env_hwconfig;
        u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
        u32 val;
+       struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+       u32 svr = gur_in32(&gur->svr);
 
        val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4);
 
@@ -278,6 +280,16 @@ int misc_init_r(void)
 
        if (adjust_vdd(0))
                printf("Warning: Adjusting core voltage failed.\n");
+       /*
+        * Default value of board env is based on filename which is
+        * ls2080ardb. Modify board env for other supported SoCs
+        */
+       if ((SVR_SOC_VER(svr) == SVR_LS2088A) ||
+           (SVR_SOC_VER(svr) == SVR_LS2048A))
+               env_set("board", "ls2088ardb");
+       else if ((SVR_SOC_VER(svr) == SVR_LS2081A) ||
+           (SVR_SOC_VER(svr) == SVR_LS2041A))
+               env_set("board", "ls2081ardb");
 
        return 0;
 }
diff --git a/board/intel/edison/.gitignore b/board/intel/edison/.gitignore
new file mode 100644 (file)
index 0000000..6eb8a54
--- /dev/null
@@ -0,0 +1,3 @@
+dsdt.aml
+dsdt.asl.tmp
+dsdt.c
index 4ff9d5adece0654a54b6376e5b81409f89317fe5..ef9b14aa2bfde1c230af783611d9a44e2606a883 100644 (file)
@@ -15,6 +15,12 @@ config SYS_CONFIG_NAME
 config SYS_TEXT_BASE
        default 0x01101000
 
+config ROM_TABLE_ADDR
+       default 0x0e4500
+
+config ROM_TABLE_SIZE
+       default 0x007b00
+
 config BOARD_SPECIFIC_OPTIONS # dummy
        def_bool y
        select X86_LOAD_FROM_32_BIT
index dde159435b31f47c40d69138346e001fe1f45918..eed8d65eb6614be9d26088a91dbfffecedf2eedf 100644 (file)
@@ -5,3 +5,4 @@
 #
 
 obj-y  += start.o edison.o
+obj-$(CONFIG_GENERATE_ACPI_TABLE) += dsdt.o
diff --git a/board/intel/edison/dsdt.asl b/board/intel/edison/dsdt.asl
new file mode 100644 (file)
index 0000000..d2e0473
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2017 Intel Corporation
+ *
+ * Partially based on dsdt.asl for other x86 boards
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+DefinitionBlock("dsdt.aml", "DSDT", 2, "U-BOOT", "U-BOOTBL", 0x00010000)
+{
+       /* platform specific */
+       #include <asm/arch/acpi/platform.asl>
+}
index c18a5a3140b9323ce01535deabc0899d4e95d5d8..29f136a530686c95c553a0d0e05c4f5a436b2f75 100644 (file)
@@ -12,6 +12,8 @@
  */
 
 #include <common.h>
+#include <dm.h>
+#include <ns16550.h>
 #include <asm/io.h>
 #include <asm/omap_musb.h>
 #include <asm/arch/am35x_def.h>
@@ -34,6 +36,22 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define AM3517_IP_SW_RESET     0x48002598
 #define CPGMACSS_SW_RST                (1 << 1)
+#define PHY_GPIO               30
+
+/* This is only needed until SPL gets OF support */
+#ifdef CONFIG_SPL_BUILD
+static const struct ns16550_platdata am3517_serial = {
+       .base = OMAP34XX_UART3,
+       .reg_shift = 2,
+       .clock = V_NS16550_CLK,
+       .fcr = UART_FCR_DEFVAL,
+};
+
+U_BOOT_DEVICE(am3517_uart) = {
+       "ns16550_serial",
+       &am3517_serial
+};
+#endif
 
 /*
  * Routine: board_init
@@ -113,30 +131,35 @@ int misc_init_r(void)
 
        am3517_evm_musb_init();
 
-       /* activate PHY reset */
-       gpio_direction_output(30, 0);
-       gpio_set_value(30, 0);
-
-       ctr  = 0;
-       do {
-               udelay(1000);
-               ctr++;
-       } while (ctr < 300);
-
-       /* deactivate PHY reset */
-       gpio_set_value(30, 1);
-
-       /* allow the PHY to stabilize and settle down */
-       ctr = 0;
-       do {
-               udelay(1000);
-               ctr++;
-       } while (ctr < 300);
-
-       /* ensure that the module is out of reset */
-       reset = readl(AM3517_IP_SW_RESET);
-       reset &= (~CPGMACSS_SW_RST);
-       writel(reset,AM3517_IP_SW_RESET);
+       if (gpio_request(PHY_GPIO, "gpio_30") == 0) {
+               /* activate PHY reset */
+               gpio_direction_output(PHY_GPIO, 0);
+               gpio_set_value(PHY_GPIO, 0);
+
+               ctr  = 0;
+               do {
+                       udelay(1000);
+                       ctr++;
+               } while (ctr < 300);
+
+               /* deactivate PHY reset */
+               gpio_set_value(PHY_GPIO, 1);
+
+               /* allow the PHY to stabilize and settle down */
+               ctr = 0;
+               do {
+                       udelay(1000);
+                       ctr++;
+               } while (ctr < 300);
+
+               /* ensure that the module is out of reset */
+               reset = readl(AM3517_IP_SW_RESET);
+               reset &= (~CPGMACSS_SW_RST);
+               writel(reset, AM3517_IP_SW_RESET);
+
+               /* Free requested GPIO */
+               gpio_free(PHY_GPIO);
+       }
 
        return 0;
 }
index bd08a2eed4255a2422b0184d1661e015c0f4ce89..c20da29a98adc6572d271634f6036fd9829a8b6e 100644 (file)
@@ -49,7 +49,7 @@ static int as3722_sd_enable(struct udevice *pmic, unsigned int sd)
 
        err = pmic_clrsetbits(pmic, AS3722_SD_CONTROL, 0, 1 << sd);
        if (err) {
-               error("failed to update SD control register: %d", err);
+               pr_err("failed to update SD control register: %d", err);
                return err;
        }
 
@@ -70,13 +70,13 @@ int tegra_pcie_board_init(void)
 
        ret = as3722_sd_enable(dev, 4);
        if (ret < 0) {
-               error("failed to enable SD4: %d\n", ret);
+               pr_err("failed to enable SD4: %d\n", ret);
                return ret;
        }
 
        ret = as3722_sd_set_voltage(dev, 4, 0x24);
        if (ret < 0) {
-               error("failed to set SD4 voltage: %d\n", ret);
+               pr_err("failed to set SD4 voltage: %d\n", ret);
                return ret;
        }
 
index d50c59db8dde5df228324c5f99b7550657f26e3b..502dec325fc12d66a7e040e8cfd61b5e5b7c4e2d 100644 (file)
@@ -3,13 +3,14 @@
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
+
 #include <common.h>
 #include <dm.h>
-#include <ram.h>
 #include <dm/pinctrl.h>
 #include <dm/uclass-internal.h>
 #include <asm/arch/periph.h>
 #include <power/regulator.h>
+#include <spl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -67,3 +68,30 @@ int board_init(void)
 out:
        return 0;
 }
+
+void spl_board_init(void)
+{
+       struct udevice *pinctrl;
+       int ret;
+
+       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
+       if (ret) {
+               debug("%s: Cannot find pinctrl device\n", __func__);
+               goto err;
+       }
+
+       /* Enable debug UART */
+       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
+       if (ret) {
+               debug("%s: Failed to set up console UART\n", __func__);
+               goto err;
+       }
+
+       preloader_console_init();
+       return;
+err:
+       printf("%s: Error %d\n", __func__, ret);
+
+       /* No way to report error here */
+       hang();
+}
index ae2a6e6bfa637a82d8aa80b2de3b6b56edf97cdf..0d17f30712cdf2b3c33903c07f0ee4be52d2ffde 100644 (file)
@@ -161,7 +161,7 @@ int board_usb_init(int index, enum usb_init_type init)
                samsung_get_base_usb3_phy();
 
        if (!phy) {
-               error("usb3 phy not supported");
+               pr_err("usb3 phy not supported");
                return -ENODEV;
        }
 
index 6a1e57f1645cc2af873aa30c047a46550b207312..ef732befc44ee01f3b514e4b2fbe775c5ef94ea5 100644 (file)
@@ -17,8 +17,8 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
                put_unaligned(CONFIG_G_DNL_UMS_VENDOR_NUM, &dev->idVendor);
                put_unaligned(CONFIG_G_DNL_UMS_PRODUCT_NUM, &dev->idProduct);
        } else {
-               put_unaligned(CONFIG_G_DNL_VENDOR_NUM, &dev->idVendor);
-               put_unaligned(CONFIG_G_DNL_PRODUCT_NUM, &dev->idProduct);
+               put_unaligned(CONFIG_USB_GADGET_VENDOR_NUM, &dev->idVendor);
+               put_unaligned(CONFIG_USB_GADGET_PRODUCT_NUM, &dev->idProduct);
        }
        return 0;
 }
index 4157349d028b0c0eb488c1e6d364b3b36acfc742..eba25b7b980ae3e12c84bcf0e5151e3075c6f417 100644 (file)
@@ -457,7 +457,7 @@ void draw_logo(void)
 
        addr = panel_info.logo_addr;
        if (!addr) {
-               error("There is no logo data.");
+               pr_err("There is no logo data.");
                return;
        }
 
index d0247ac2571ae864254975110d59712197b6bb68..debc4c57ffa068c14b3f2f2b7047942895b10f63 100644 (file)
@@ -102,7 +102,7 @@ int board_mmc_init(bd_t *bis)
 
        ret = s5p_mmc_init(0, 4);
        if (ret)
-               error("MMC: Failed to init MMC:0.\n");
+               pr_err("MMC: Failed to init MMC:0.\n");
 
        /*
         * SD card (T_FLASH) detect and init
@@ -127,7 +127,7 @@ int board_mmc_init(bd_t *bis)
 
                ret_sd = s5p_mmc_init(2, 4);
                if (ret_sd)
-                       error("MMC: Failed to init SD card (MMC:2).\n");
+                       pr_err("MMC: Failed to init SD card (MMC:2).\n");
        }
 
        return ret & ret_sd;
index e40a2f6e3a6909663ad45d57ebe4f69ebb5841f4..0df96c1a3daf060f2d6211c577c36b8cdd968222 100644 (file)
@@ -429,7 +429,7 @@ int exynos_power_init(void)
        };
 
        if (regulator_list_autoset(mmc_regulators, NULL, true))
-               error("Unable to init all mmc regulators");
+               pr_err("Unable to init all mmc regulators");
 
        return 0;
 }
@@ -442,7 +442,7 @@ static int s5pc210_phy_control(int on)
 
        ret = regulator_get_by_platname("VDD_UOTG_3.0V", &dev);
        if (ret) {
-               error("Regulator get error: %d", ret);
+               pr_err("Regulator get error: %d", ret);
                return ret;
        }
 
@@ -487,25 +487,25 @@ int board_usb_init(int index, enum usb_init_type init)
 
        ret = regulator_get_by_platname("VCC_P3V3_2.85V", &dev);
        if (ret) {
-               error("Regulator get error: %d", ret);
+               pr_err("Regulator get error: %d", ret);
                return ret;
        }
 
        ret = regulator_set_enable(dev, true);
        if (ret) {
-               error("Regulator %s enable setting error: %d", dev->name, ret);
+               pr_err("Regulator %s enable setting error: %d", dev->name, ret);
                return ret;
        }
 
        ret = regulator_set_value(dev, 750000);
        if (ret) {
-               error("Regulator %s value setting error: %d", dev->name, ret);
+               pr_err("Regulator %s value setting error: %d", dev->name, ret);
                return ret;
        }
 
        ret = regulator_set_value(dev, 3300000);
        if (ret) {
-               error("Regulator %s value setting error: %d", dev->name, ret);
+               pr_err("Regulator %s value setting error: %d", dev->name, ret);
                return ret;
        }
 #endif
index b4f027af2862ae5af37263d0bfb92d3833de26f2..81bbb5758d0b0d1bf70ea24dd6ddf800f85d4f0c 100644 (file)
@@ -145,8 +145,8 @@ int factoryset_read_eeprom(int i2c_addr)
        unsigned char *cp, *cp1;
 
 #if defined(CONFIG_USB_FUNCTION_DFU)
-       factory_dat.usb_vendor_id = CONFIG_G_DNL_VENDOR_NUM;
-       factory_dat.usb_product_id = CONFIG_G_DNL_PRODUCT_NUM;
+       factory_dat.usb_vendor_id = CONFIG_USB_GADGET_VENDOR_NUM;
+       factory_dat.usb_product_id = CONFIG_USB_GADGET_PRODUCT_NUM;
 #endif
        if (i2c_probe(i2c_addr))
                goto err;
index 2cfa5bfc8637334869339a1bb0ad8135674e7441..ef1e3bf42666d29ce480d23a32fb4c16ff3394b3 100644 (file)
@@ -16,3 +16,23 @@ $ sudo dd if=u-boot-spl.kwb of=/dev/sdX bs=512 seek=1
 
 Please use the correct device node for your setup instead
 of "/dev/sdX" here!
+
+Boot from UART:
+---------------
+
+Connect the on-board micro-USB (CF Pro: CON11, CF Base: CON5)
+to your host.
+
+Set the SW1 DIP switches to UART boot (0: OFF, 1: ON):
+
+  ClearFog Base: 01001
+  ClearFog Pro:  11110
+
+Run the following command to initiate U-Boot download:
+
+  ./tools/kwboot -b u-boot-spl.kwb /dev/ttyUSBX
+
+Use the correct UART device node for /dev/ttyUSBX.
+
+When download finishes start your favorite terminal emulator
+on /dev/ttyUSBX.
index ff6eea24a5e75255d24d131d1cf2355904d906b3..26c452e1b3a29e4c35ddd9a88d29245515b394b1 100644 (file)
@@ -118,6 +118,11 @@ M: Paul Kocialkowski <contact@paulk.fr>
 S:     Maintained
 F:     configs/Ampe_A76_defconfig
 
+BANANAPI M1 PLUS
+M:     Jagan Teki <jagan@amarulasolutions.com>
+S:     Maintained
+F:     configs/bananapi_m1_plus_defconfig
+
 BANANAPI M2 ULTRA BOARD
 M:     Chen-Yu Tsai <wens@csie.org>
 S:     Maintained
index 70e01437c4f4efb9b6f4c1417be7133151983ac4..6e13ee32c14d7715739f2dcbdbbff4c54b839862 100644 (file)
@@ -32,6 +32,7 @@
 #include <libfdt.h>
 #include <nand.h>
 #include <net.h>
+#include <spl.h>
 #include <sy8106a.h>
 #include <asm/setup.h>
 
@@ -491,20 +492,6 @@ int board_mmc_init(bd_t *bis)
                return -1;
 #endif
 
-#if !defined(CONFIG_SPL_BUILD) && CONFIG_MMC_SUNXI_SLOT_EXTRA == 2
-       /*
-        * On systems with an emmc (mmc2), figure out if we are booting from
-        * the emmc and if we are make it "mmc dev 0" so that boot.scr, etc.
-        * are searched there first. Note we only do this for u-boot proper,
-        * not for the SPL, see spl_boot_device().
-        */
-       if (readb(SPL_ADDR + 0x28) == SUNXI_BOOTED_FROM_MMC2) {
-               /* Booting from emmc / mmc2, swap */
-               mmc0->block_dev.devnum = 1;
-               mmc1->block_dev.devnum = 0;
-       }
-#endif
-
        return 0;
 }
 #endif
@@ -720,13 +707,22 @@ static void setup_environment(const void *fdt)
 int misc_init_r(void)
 {
        __maybe_unused int ret;
+       uint boot;
 
        env_set("fel_booted", NULL);
        env_set("fel_scriptaddr", NULL);
+       env_set("mmc_bootdev", NULL);
+
+       boot = sunxi_get_boot_device();
        /* determine if we are running in FEL mode */
-       if (!is_boot0_magic(SPL_ADDR + 4)) { /* eGON.BT0 */
+       if (boot == BOOT_DEVICE_BOARD) {
                env_set("fel_booted", "1");
                parse_spl_header(SPL_ADDR);
+       /* or if we booted from MMC, and which one */
+       } else if (boot == BOOT_DEVICE_MMC1) {
+               env_set("mmc_bootdev", "0");
+       } else if (boot == BOOT_DEVICE_MMC2) {
+               env_set("mmc_bootdev", "1");
        }
 
        setup_environment(gd->fdt_blob);
@@ -736,7 +732,10 @@ int misc_init_r(void)
        if (ret)
                return ret;
 #endif
-       sunxi_musb_board_init();
+
+#ifdef CONFIG_USB_ETHER
+       usb_ether_init();
+#endif
 
        return 0;
 }
index 5ae6b6487c4bcc83a3b36226c33967d186cc007d..1e8df93d37992b5beee162f7d310951f2050406b 100644 (file)
@@ -4,4 +4,3 @@ S:      Maintained
 F:     board/theadorable/
 F:     include/configs/theadorable.h
 F:     configs/theadorable_debug_defconfig
-F:     configs/theadorable_defconfig
index 405750f3517b5588428626a9b136044b736d3868..60daddcc44143fb90d2ae75a3430ce7cf95c12b9 100644 (file)
@@ -27,8 +27,8 @@
                        type = "firmware";
                        arch = "arm64";
                        compression = "none";
-                       load = <0x00010000>;
-                       entry = <0x00010000>;
+                       load = <0x00100000>;
+                       entry = <0x00100000>;
                };
 
                fdt {
index 45d56cd99eb26adb15edfff8572e9ee9998972ce..2b4988e2d2255a306f4aa213c5cf450a65fca0f7 100644 (file)
@@ -3,60 +3,48 @@
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
+
 #include <common.h>
 #include <dm.h>
 #include <misc.h>
-#include <ram.h>
 #include <dm/pinctrl.h>
 #include <dm/uclass-internal.h>
 #include <asm/setup.h>
 #include <asm/arch/periph.h>
 #include <power/regulator.h>
+#include <spl.h>
 #include <u-boot/sha256.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 int board_init(void)
 {
-       struct udevice *pinctrl, *regulator;
        int ret;
 
        /*
-        * The PWM does not have decicated interrupt number in dts and can
-        * not get periph_id by pinctrl framework, so let's init them here.
-        * The PWM2 and PWM3 are for pwm regulators.
+        * We need to call into regulators_enable_boot_on() again, as the call
+        * during SPL may have not included all regulators.
         */
-       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-       if (ret) {
-               debug("%s: Cannot find pinctrl device\n", __func__);
-               goto out;
-       }
-
-       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM2);
-       if (ret) {
-               debug("%s PWM2 pinctrl init fail!\n", __func__);
-               goto out;
-       }
-
-       /* rk3399 need to init vdd_center to get the correct output voltage */
-       ret = regulator_get_by_platname("vdd_center", &regulator);
+       ret = regulators_enable_boot_on(false);
        if (ret)
-               debug("%s: Cannot get vdd_center regulator\n", __func__);
+               debug("%s: Cannot enable boot on regulator\n", __func__);
 
-       ret = regulator_get_by_platname("vcc5v0_host", &regulator);
-       if (ret) {
-               debug("%s vcc5v0_host init fail! ret %d\n", __func__, ret);
-               goto out;
-       }
+       return 0;
+}
 
-       ret = regulator_set_enable(regulator, true);
-       if (ret) {
-               debug("%s vcc5v0-host-en set fail!\n", __func__);
-               goto out;
-       }
+void spl_board_init(void)
+{
+       int  ret;
 
-out:
-       return 0;
+       /*
+        * Turning the eMMC and SPI back on (if disabled via the Qseven
+        * BIOS_ENABLE) signal is done through a always-on regulator).
+        */
+       ret = regulators_enable_boot_on(false);
+       if (ret)
+               debug("%s: Cannot enable boot on regulator\n", __func__);
+
+       preloader_console_init();
 }
 
 static void setup_macaddr(void)
@@ -91,8 +79,6 @@ static void setup_macaddr(void)
        mac_addr[0] |= 0x02;  /* set local assignment bit (IEEE802) */
        eth_env_set_enetaddr("ethaddr", mac_addr);
 #endif
-
-       return;
 }
 
 static void setup_serial(void)
@@ -147,8 +133,6 @@ static void setup_serial(void)
        env_set("cpuid#", cpuid_str);
        env_set("serial#", serialno_str);
 #endif
-
-       return;
 }
 
 int misc_init_r(void)
index 266a66b678f23ea9614045b955043dd3acfcab60..6c77d915e5b977c1f3fac3b2dbeaf366fec89a2e 100644 (file)
@@ -166,7 +166,7 @@ int get_num_eth_ports(void)
 }
 #endif
 
-#if defined(CONFIG_FIT_EMBED)
+#if defined(CONFIG_MULTI_DTB_FIT)
 int board_fit_config_name_match(const char *name)
 {
        if (!strcmp(name, "keystone-k2e-evm"))
index f1c4ddcd3098e1e4b080a4a066a7518168e48057..01328f1955c2be2fdee8728ebe9bb8f09a06bab7 100644 (file)
@@ -217,7 +217,7 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
-#if defined(CONFIG_FIT_EMBED)
+#if defined(CONFIG_MULTI_DTB_FIT)
 int board_fit_config_name_match(const char *name)
 {
        bool eeprom_read = board_ti_was_eeprom_read();
index c7330996d1abecd0e437679b14ab3dd9c0c24e3f..e99e6355b477610587698c673081efc7b41cb0bf 100644 (file)
@@ -150,7 +150,7 @@ int board_early_init_f(void)
 }
 #endif
 
-#if defined(CONFIG_FIT_EMBED)
+#if defined(CONFIG_MULTI_DTB_FIT)
 int board_fit_config_name_match(const char *name)
 {
        if (!strcmp(name, "keystone-k2hk-evm"))
index 166367bfb97e01c99b3c62dad9e0f9e36857b6d3..c65f33131da0cf21f4a654fac81188004b7581fc 100644 (file)
@@ -138,7 +138,7 @@ int board_early_init_f(void)
 }
 #endif
 
-#if defined(CONFIG_FIT_EMBED)
+#if defined(CONFIG_MULTI_DTB_FIT)
 int board_fit_config_name_match(const char *name)
 {
        if (!strcmp(name, "keystone-k2l-evm"))
index d6d130edfa917c7f6af938be710e0f4e581d8276..ce81b4c444a36d844263664f98c88c7b81782541 100644 (file)
@@ -116,6 +116,9 @@ endmenu
 
 source "cmd/fastboot/Kconfig"
 
+config BUILD_BIN2C
+       bool
+
 comment "Commands"
 
 menu "Info commands"
@@ -222,6 +225,8 @@ config CMD_BOOTEFI_HELLO
          for testing that EFI is working at a basic level, and for bringing
          up EFI support on a new architecture.
 
+source lib/efi_selftest/Kconfig
+
 config CMD_BOOTMENU
        bool "bootmenu"
        select MENU
@@ -261,7 +266,6 @@ config CMD_IMI
 
 config CMD_IMLS
        bool "imls"
-       default y
        help
          List all images found in flash
 
@@ -526,6 +530,7 @@ menu "Compression commands"
 
 config CMD_LZMADEC
        bool "lzmadec"
+       default y if CMD_BOOTI
        select LZMA
        help
          Support decompressing an LZMA (Lempel-Ziv-Markov chain algorithm)
@@ -533,6 +538,7 @@ config CMD_LZMADEC
 
 config CMD_UNZIP
        bool "unzip"
+       default y if CMD_BOOTI
        help
          Uncompress a zip-compressed memory region.
 
@@ -663,10 +669,17 @@ config CMD_GPT
        bool "GPT (GUID Partition Table) command"
        select PARTITION_UUIDS
        select EFI_PARTITION
+       imply RANDOM_UUID
        help
          Enable the 'gpt' command to ready and write GPT style partition
          tables.
 
+config RANDOM_UUID
+       bool "GPT Random UUID generation"
+       help
+         Enable the generation of partitions with random UUIDs if none
+         are provided.
+
 config CMD_GPT_RENAME
        bool "GPT partition renaming commands"
        depends on CMD_GPT
@@ -1311,6 +1324,16 @@ config CMD_CROS_EC
 endmenu
 
 menu "Filesystem commands"
+config CMD_BTRFS
+       bool "Enable the 'btrsubvol' command"
+       select FS_BTRFS
+       help
+         This enables the 'btrsubvol' command to list subvolumes
+         of a BTRFS filesystem. There are no special commands for
+         listing BTRFS directories or loading BTRFS files - this
+         can be done by the generic 'fs' commands (see CMD_FS_GENERIC)
+         when BTRFS is enabled (see FS_BTRFS).
+
 config CMD_CBFS
        bool "Enable the 'cbfs' command"
        depends on FS_CBFS
index 2a5b8ce82577528c4195adb1d887c94e01f7a416..2b0444d5b777819fb744318bd43843b131a877f5 100644 (file)
@@ -27,6 +27,7 @@ obj-$(CONFIG_CMD_BOOTMENU) += bootmenu.o
 obj-$(CONFIG_CMD_BOOTSTAGE) += bootstage.o
 obj-$(CONFIG_CMD_BOOTZ) += bootz.o
 obj-$(CONFIG_CMD_BOOTI) += booti.o
+obj-$(CONFIG_CMD_BTRFS) += btrfs.o
 obj-$(CONFIG_CMD_CACHE) += cache.o
 obj-$(CONFIG_CMD_CBFS) += cbfs.o
 obj-$(CONFIG_CMD_CLK) += clk.o
index 3196d86040729487186c241e9b7c36d597bbb6f2..b7087e3da874e7f14745dc63dfbf62458bf80795 100644 (file)
@@ -22,97 +22,14 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static uint8_t efi_obj_list_initalized;
 
-/*
- * When booting using the "bootefi" command, we don't know which
- * physical device the file came from. So we create a pseudo-device
- * called "bootefi" with the device path /bootefi.
- *
- * In addition to the originating device we also declare the file path
- * of "bootefi" based loads to be /bootefi.
- */
-static struct efi_device_path_file_path bootefi_image_path[] = {
-       {
-               .dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE,
-               .dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH,
-               .dp.length = sizeof(bootefi_image_path[0]),
-               .str = { 'b','o','o','t','e','f','i' },
-       }, {
-               .dp.type = DEVICE_PATH_TYPE_END,
-               .dp.sub_type = DEVICE_PATH_SUB_TYPE_END,
-               .dp.length = sizeof(bootefi_image_path[0]),
-       }
-};
-
-static struct efi_device_path_file_path bootefi_device_path[] = {
-       {
-               .dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE,
-               .dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH,
-               .dp.length = sizeof(bootefi_image_path[0]),
-               .str = { 'b','o','o','t','e','f','i' },
-       }, {
-               .dp.type = DEVICE_PATH_TYPE_END,
-               .dp.sub_type = DEVICE_PATH_SUB_TYPE_END,
-               .dp.length = sizeof(bootefi_image_path[0]),
-       }
-};
-
-/* The EFI loaded_image interface for the image executed via "bootefi" */
-static struct efi_loaded_image loaded_image_info = {
-       .device_handle = bootefi_device_path,
-       .file_path = bootefi_image_path,
-};
-
-/* The EFI object struct for the image executed via "bootefi" */
-static struct efi_object loaded_image_info_obj = {
-       .handle = &loaded_image_info,
-       .protocols = {
-               {
-                       /*
-                        * When asking for the loaded_image interface, just
-                        * return handle which points to loaded_image_info
-                        */
-                       .guid = &efi_guid_loaded_image,
-                       .protocol_interface = &loaded_image_info,
-               },
-               {
-                       /*
-                        * When asking for the device path interface, return
-                        * bootefi_device_path
-                        */
-                       .guid = &efi_guid_device_path,
-                       .protocol_interface = bootefi_device_path,
-               },
-               {
-                       .guid = &efi_guid_console_control,
-                       .protocol_interface = (void *) &efi_console_control
-               },
-               {
-                       .guid = &efi_guid_device_path_to_text_protocol,
-                       .protocol_interface = (void *) &efi_device_path_to_text
-               },
-       },
-};
-
-/* The EFI object struct for the device the "bootefi" image was loaded from */
-static struct efi_object bootefi_device_obj = {
-       .handle = bootefi_device_path,
-       .protocols = {
-               {
-                       /* When asking for the device path interface, return
-                        * bootefi_device_path */
-                       .guid = &efi_guid_device_path,
-                       .protocol_interface = bootefi_device_path
-               }
-       },
-};
+static struct efi_device_path *bootefi_image_path;
+static struct efi_device_path *bootefi_device_path;
 
 /* Initialize and populate EFI object list */
 static void efi_init_obj_list(void)
 {
        efi_obj_list_initalized = 1;
 
-       list_add_tail(&loaded_image_info_obj.link, &efi_obj_list);
-       list_add_tail(&bootefi_device_obj.link, &efi_obj_list);
        efi_console_register();
 #ifdef CONFIG_PARTITIONS
        efi_disk_register();
@@ -121,13 +38,7 @@ static void efi_init_obj_list(void)
        efi_gop_register();
 #endif
 #ifdef CONFIG_NET
-       void *nethandle = loaded_image_info.device_handle;
-       efi_net_register(&nethandle);
-
-       if (!memcmp(bootefi_device_path[0].str, "N\0e\0t", 6))
-               loaded_image_info.device_handle = nethandle;
-       else
-               loaded_image_info.device_handle = bootefi_device_path;
+       efi_net_register();
 #endif
 #ifdef CONFIG_GENERATE_SMBIOS_TABLE
        efi_smbios_register();
@@ -210,14 +121,27 @@ static unsigned long efi_run_in_el2(asmlinkage ulong (*entry)(
  * Load an EFI payload into a newly allocated piece of memory, register all
  * EFI objects it would want to access and jump to it.
  */
-static unsigned long do_bootefi_exec(void *efi, void *fdt)
+static unsigned long do_bootefi_exec(void *efi, void *fdt,
+                                    struct efi_device_path *device_path,
+                                    struct efi_device_path *image_path)
 {
+       struct efi_loaded_image loaded_image_info = {};
+       struct efi_object loaded_image_info_obj = {};
+       ulong ret;
+
        ulong (*entry)(void *image_handle, struct efi_system_table *st)
                asmlinkage;
        ulong fdt_pages, fdt_size, fdt_start, fdt_end;
        const efi_guid_t fdt_guid = EFI_FDT_GUID;
        bootm_headers_t img = { 0 };
 
+       /* Initialize and populate EFI object list */
+       if (!efi_obj_list_initalized)
+               efi_init_obj_list();
+
+       efi_setup_loaded_image(&loaded_image_info, &loaded_image_info_obj,
+                              device_path, image_path);
+
        /*
         * gd lives in a fixed register which may get clobbered while we execute
         * the payload. So save it here and restore it on every callback entry
@@ -252,18 +176,21 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
 
        /* Load the EFI payload */
        entry = efi_load_pe(efi, &loaded_image_info);
-       if (!entry)
-               return -ENOENT;
+       if (!entry) {
+               ret = -ENOENT;
+               goto exit;
+       }
 
-       /* Initialize and populate EFI object list */
-       if (!efi_obj_list_initalized)
-               efi_init_obj_list();
+       /* we don't support much: */
+       env_set("efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_OsIndicationsSupported",
+               "{ro,boot}(blob)0000000000000000");
 
        /* Call our payload! */
        debug("%s:%d Jumping to 0x%lx\n", __func__, __LINE__, (long)entry);
 
        if (setjmp(&loaded_image_info.exit_jmp)) {
-               return loaded_image_info.exit_status;
+               ret = loaded_image_info.exit_status;
+               goto exit;
        }
 
 #ifdef CONFIG_ARM64
@@ -282,9 +209,45 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
        }
 #endif
 
-       return efi_do_enter(&loaded_image_info, &systab, entry);
+       ret = efi_do_enter(&loaded_image_info, &systab, entry);
+
+exit:
+       /* image has returned, loaded-image obj goes *poof*: */
+       list_del(&loaded_image_info_obj.link);
+
+       return ret;
 }
 
+static int do_bootefi_bootmgr_exec(unsigned long fdt_addr)
+{
+       struct efi_device_path *device_path, *file_path;
+       void *addr;
+       efi_status_t r;
+
+       /* Initialize and populate EFI object list */
+       if (!efi_obj_list_initalized)
+               efi_init_obj_list();
+
+       /*
+        * gd lives in a fixed register which may get clobbered while we execute
+        * the payload. So save it here and restore it on every callback entry
+        */
+       efi_save_gd();
+
+       addr = efi_bootmgr_load(&device_path, &file_path);
+       if (!addr)
+               return 1;
+
+       printf("## Starting EFI application at %p ...\n", addr);
+       r = do_bootefi_exec(addr, (void *)fdt_addr, device_path, file_path);
+       printf("## Application terminated, r = %lu\n",
+              r & ~EFI_ERROR_MASK);
+
+       if (r != EFI_SUCCESS)
+               return 1;
+
+       return 0;
+}
 
 /* Interpreter command to boot an arbitrary EFI image from memory */
 static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
@@ -297,13 +260,44 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                return CMD_RET_USAGE;
 #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);
+               ulong size = __efi_helloworld_end - __efi_helloworld_begin;
+
+               saddr = env_get("loadaddr");
+               if (saddr)
+                       addr = simple_strtoul(saddr, NULL, 16);
+               else
+                       addr = CONFIG_SYS_LOAD_ADDR;
+               memcpy((char *)addr, __efi_helloworld_begin, size);
        } else
 #endif
-       {
+#ifdef CONFIG_CMD_BOOTEFI_SELFTEST
+       if (!strcmp(argv[1], "selftest")) {
+               struct efi_loaded_image loaded_image_info = {};
+               struct efi_object loaded_image_info_obj = {};
+
+               efi_setup_loaded_image(&loaded_image_info,
+                                      &loaded_image_info_obj,
+                                      bootefi_device_path, bootefi_image_path);
+               /*
+                * gd lives in a fixed register which may get clobbered while we
+                * execute the payload. So save it here and restore it on every
+                * callback entry
+                */
+               efi_save_gd();
+               /* Initialize and populate EFI object list */
+               if (!efi_obj_list_initalized)
+                       efi_init_obj_list();
+               return efi_selftest(&loaded_image_info, &systab);
+       } else
+#endif
+       if (!strcmp(argv[1], "bootmgr")) {
+               unsigned long fdt_addr = 0;
+
+               if (argc > 2)
+                       fdt_addr = simple_strtoul(argv[2], NULL, 16);
+
+               return do_bootefi_bootmgr_exec(fdt_addr);
+       } else {
                saddr = argv[1];
 
                addr = simple_strtoul(saddr, NULL, 16);
@@ -315,7 +309,8 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 
        printf("## Starting EFI application at %08lx ...\n", addr);
-       r = do_bootefi_exec((void *)addr, (void*)fdt_addr);
+       r = do_bootefi_exec((void *)addr, (void *)fdt_addr,
+                           bootefi_device_path, bootefi_image_path);
        printf("## Application terminated, r = %lu\n",
               r & ~EFI_ERROR_MASK);
 
@@ -332,10 +327,18 @@ static char bootefi_help_text[] =
        "    If specified, the device tree located at <fdt address> gets\n"
        "    exposed as EFI configuration table.\n"
 #ifdef CONFIG_CMD_BOOTEFI_HELLO
-       "hello\n"
-       "  - boot a sample Hello World application stored within U-Boot"
+       "bootefi hello\n"
+       "  - boot a sample Hello World application stored within U-Boot\n"
+#endif
+#ifdef CONFIG_CMD_BOOTEFI_SELFTEST
+       "bootefi selftest\n"
+       "  - boot an EFI selftest application stored within U-Boot\n"
 #endif
-       ;
+       "bootmgr [fdt addr]\n"
+       "  - load and boot EFI payload based on BootOrder/BootXXXX variables.\n"
+       "\n"
+       "    If specified, the device tree located at <fdt address> gets\n"
+       "    exposed as EFI configuration table.\n";
 #endif
 
 U_BOOT_CMD(
@@ -344,58 +347,47 @@ U_BOOT_CMD(
        bootefi_help_text
 );
 
-void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
+static int parse_partnum(const char *devnr)
 {
-       __maybe_unused struct blk_desc *desc;
-       char devname[32] = { 0 }; /* dp->str is u16[32] long */
-       char *colon, *s;
-
-#if defined(CONFIG_BLK) || CONFIG_IS_ENABLED(ISO_PARTITION)
-       desc = blk_get_dev(dev, simple_strtol(devnr, NULL, 10));
-#endif
-
-#ifdef CONFIG_BLK
-       if (desc) {
-               snprintf(devname, sizeof(devname), "%s", desc->bdev->name);
-       } else
-#endif
-
-       {
-               /* Assemble the condensed device name we use in efi_disk.c */
-               snprintf(devname, sizeof(devname), "%s%s", dev, devnr);
+       const char *str = strchr(devnr, ':');
+       if (str) {
+               str++;
+               return simple_strtoul(str, NULL, 16);
        }
+       return 0;
+}
+
+void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
+{
+       char filename[32] = { 0 }; /* dp->str is u16[32] long */
+       char *s;
 
-       colon = strchr(devname, ':');
+       if (strcmp(dev, "Net")) {
+               struct blk_desc *desc;
+               int part;
 
-#if CONFIG_IS_ENABLED(ISO_PARTITION)
-       /* For ISOs we create partition block devices */
-       if (desc && (desc->type != DEV_TYPE_UNKNOWN) &&
-           (desc->part_type == PART_TYPE_ISO)) {
-               if (!colon)
-                       snprintf(devname, sizeof(devname), "%s:1", devname);
+               desc = blk_get_dev(dev, simple_strtol(devnr, NULL, 10));
+               part = parse_partnum(devnr);
 
-               colon = NULL;
-       }
+               bootefi_device_path = efi_dp_from_part(desc, part);
+       } else {
+#ifdef CONFIG_NET
+               bootefi_device_path = efi_dp_from_eth();
 #endif
+       }
 
-       if (colon)
-               *colon = '\0';
-
-       /* Patch bootefi_device_path to the target device */
-       memset(bootefi_device_path[0].str, 0, sizeof(bootefi_device_path[0].str));
-       ascii2unicode(bootefi_device_path[0].str, devname);
+       if (!path)
+               return;
 
-       /* Patch bootefi_image_path to the target file path */
-       memset(bootefi_image_path[0].str, 0, sizeof(bootefi_image_path[0].str));
        if (strcmp(dev, "Net")) {
                /* Add leading / to fs paths, because they're absolute */
-               snprintf(devname, sizeof(devname), "/%s", path);
+               snprintf(filename, sizeof(filename), "/%s", path);
        } else {
-               snprintf(devname, sizeof(devname), "%s", path);
+               snprintf(filename, sizeof(filename), "%s", path);
        }
        /* DOS style file path: */
-       s = devname;
+       s = filename;
        while ((s = strchr(s, '/')))
                *s++ = '\\';
-       ascii2unicode(bootefi_image_path[0].str, devname);
+       bootefi_image_path = efi_dp_from_file(NULL, 0, filename);
 }
diff --git a/cmd/btrfs.c b/cmd/btrfs.c
new file mode 100644 (file)
index 0000000..3f4f1b7
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 2017 by Marek Behun <marek.behun@nic.cz>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <command.h>
+#include <btrfs.h>
+#include <fs.h>
+
+int do_btrsubvol(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+       if (argc != 3)
+               return CMD_RET_USAGE;
+
+       if (fs_set_blk_dev(argv[1], argv[2], FS_TYPE_BTRFS))
+               return 1;
+
+       btrfs_list_subvols();
+       return 0;
+}
+
+U_BOOT_CMD(btrsubvol, 3, 1, do_btrsubvol,
+       "list subvolumes of a BTRFS filesystem",
+       "<interface> <dev[:part]>\n"
+       "     - List subvolumes of a BTRFS filesystem."
+)
index 488822a2eed512f68360ed5838e2aa26d65ba546..8adcca592d586aa9cbfabe14caab3e99f77a4d73 100644 (file)
@@ -27,7 +27,7 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 
        ret = board_usb_init(controller_index, USB_INIT_DEVICE);
        if (ret) {
-               error("USB init failed: %d", ret);
+               pr_err("USB init failed: %d", ret);
                return CMD_RET_FAILURE;
        }
 
index fb0c5da94cdb36b70cf67b0a2df110e3299f7055..214bbc23fc5217a8ab2099bdbc722a91bcd404f9 100644 (file)
@@ -3,11 +3,16 @@ comment "FASTBOOT"
 menuconfig FASTBOOT
        bool "Fastboot support"
        depends on USB_GADGET
+       default y if ARCH_SUNXI && USB_MUSB_GADGET
 
 if FASTBOOT
 
 config USB_FUNCTION_FASTBOOT
        bool "Enable USB fastboot gadget"
+       default y
+       select USB_GADGET_DOWNLOAD
+       imply ANDROID_BOOT_IMAGE
+       imply CMD_FASTBOOT
        help
          This enables the USB part of the fastboot gadget.
 
@@ -69,6 +74,8 @@ config FASTBOOT_FLASH
 config FASTBOOT_FLASH_MMC_DEV
        int "Define FASTBOOT MMC FLASH default device"
        depends on FASTBOOT_FLASH && MMC
+       default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
+       default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
        help
          The fastboot "flash" command requires additional information
          regarding the non-volatile storage device. Define this to
index 638aa198267be46c365b4a5956ff858b4210e83a..27dd98755a2f9c108be408bf9e3d05407eb88ee6 100644 (file)
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -190,10 +190,9 @@ static void del_gpt_info(void)
 static struct disk_part *allocate_disk_part(disk_partition_t *info, int partnum)
 {
        struct disk_part *newpart;
-       newpart = malloc(sizeof(*newpart));
+       newpart = calloc(1, sizeof(struct disk_part));
        if (!newpart)
                return ERR_PTR(-ENOMEM);
-       memset(newpart, '\0', sizeof(newpart));
 
        newpart->gpt_part_info.start = info->start;
        newpart->gpt_part_info.size = info->size;
@@ -403,7 +402,7 @@ static int set_gpt_info(struct blk_desc *dev_desc,
        if (!val) {
 #ifdef CONFIG_RANDOM_UUID
                *str_disk_guid = malloc(UUID_STR_LEN + 1);
-               if (str_disk_guid == NULL)
+               if (*str_disk_guid == NULL)
                        return -ENOMEM;
                gen_rand_uuid_str(*str_disk_guid, UUID_STR_FORMAT_STD);
 #else
@@ -634,6 +633,21 @@ static int do_disk_guid(struct blk_desc *dev_desc, char * const namestr)
 }
 
 #ifdef CONFIG_CMD_GPT_RENAME
+/*
+ * There are 3 malloc() calls in set_gpt_info() and there is no info about which
+ * failed.
+ */
+static void set_gpt_cleanup(char **str_disk_guid,
+                           disk_partition_t **partitions)
+{
+#ifdef CONFIG_RANDOM_UUID
+       if (str_disk_guid)
+               free(str_disk_guid);
+#endif
+       if (partitions)
+               free(partitions);
+}
+
 static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
                               char *name1, char *name2)
 {
@@ -652,19 +666,27 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
        ret = get_disk_guid(dev_desc, disk_guid);
        if (ret < 0)
                return ret;
+       /*
+        * Allocates disk_partitions, requiring matching call to del_gpt_info()
+        * if successful.
+        */
        numparts = get_gpt_info(dev_desc);
        if (numparts <=  0)
                return numparts ? numparts : -ENODEV;
 
        partlistlen = calc_parts_list_len(numparts);
        partitions_list = malloc(partlistlen);
-       if (partitions_list == NULL)
+       if (!partitions_list) {
+               del_gpt_info();
                return -ENOMEM;
+       }
        memset(partitions_list, '\0', partlistlen);
 
        ret = create_gpt_partitions_list(numparts, disk_guid, partitions_list);
-       if (ret < 0)
+       if (ret < 0) {
+               free(partitions_list);
                return ret;
+       }
        /*
         * Uncomment the following line to print a string that 'gpt write'
         * or 'gpt verify' will accept as input.
@@ -672,15 +694,23 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
        debug("OLD partitions_list is %s with %u chars\n", partitions_list,
              (unsigned)strlen(partitions_list));
 
+       /* set_gpt_info allocates new_partitions and str_disk_guid */
        ret = set_gpt_info(dev_desc, partitions_list, &str_disk_guid,
                           &new_partitions, &part_count);
-       if (ret < 0)
-               return ret;
+       if (ret < 0) {
+               del_gpt_info();
+               free(partitions_list);
+               if (ret == -ENOMEM)
+                       set_gpt_cleanup(&str_disk_guid, &new_partitions);
+               else
+                       goto out;
+       }
 
        if (!strcmp(subcomm, "swap")) {
                if ((strlen(name1) > PART_NAME_LEN) || (strlen(name2) > PART_NAME_LEN)) {
                        printf("Names longer than %d characters are truncated.\n", PART_NAME_LEN);
-                       return -EINVAL;
+                       ret = -EINVAL;
+                       goto out;
                }
                list_for_each(pos, &disk_partitions) {
                        curr = list_entry(pos, struct disk_part, list);
@@ -694,21 +724,24 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
                }
                if ((ctr1 + ctr2 < 2) || (ctr1 != ctr2)) {
                        printf("Cannot swap partition names except in pairs.\n");
-                       return -EINVAL;
+                       ret = -EINVAL;
+                       goto out;
                }
        } else { /* rename */
                if (strlen(name2) > PART_NAME_LEN) {
                        printf("Names longer than %d characters are truncated.\n", PART_NAME_LEN);
-                       return -EINVAL;
+                       ret = -EINVAL;
+                       goto out;
                }
                partnum = (int)simple_strtol(name1, NULL, 10);
                if ((partnum < 0) || (partnum > numparts)) {
                        printf("Illegal partition number %s\n", name1);
-                       return -EINVAL;
+                       ret = -EINVAL;
+                       goto out;
                }
                ret = part_get_info(dev_desc, partnum, new_partitions);
                if (ret < 0)
-                       return ret;
+                       goto out;
 
                /* U-Boot partition numbering starts at 1 */
                list_for_each(pos, &disk_partitions) {
@@ -723,33 +756,50 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
 
        ret = create_gpt_partitions_list(numparts, disk_guid, partitions_list);
        if (ret < 0)
-               return ret;
+               goto out;
        debug("NEW partitions_list is %s with %u chars\n", partitions_list,
              (unsigned)strlen(partitions_list));
 
        ret = set_gpt_info(dev_desc, partitions_list, &str_disk_guid,
                           &new_partitions, &part_count);
-       if (ret < 0)
-               return ret;
+       /*
+        * Even though valid pointers are here passed into set_gpt_info(),
+        * it mallocs again, and there's no way to tell which failed.
+        */
+       if (ret < 0) {
+               del_gpt_info();
+               free(partitions_list);
+               if (ret == -ENOMEM)
+                       set_gpt_cleanup(&str_disk_guid, &new_partitions);
+               else
+                       goto out;
+       }
 
        debug("Writing new partition table\n");
        ret = gpt_restore(dev_desc, disk_guid, new_partitions, numparts);
        if (ret < 0) {
                printf("Writing new partition table failed\n");
-               return ret;
+               goto out;
        }
 
        debug("Reading back new partition table\n");
+       /*
+        * Empty the existing disk_partitions list, as otherwise the memory in
+        * the original list is unreachable.
+        */
+       del_gpt_info();
        numparts = get_gpt_info(dev_desc);
-       if (numparts <=  0)
-               return numparts ? numparts : -ENODEV;
+       if (numparts <=  0) {
+               ret = numparts ? numparts : -ENODEV;
+               goto out;
+       }
        printf("new partition table with %d partitions is:\n", numparts);
        print_gpt_info();
-
        del_gpt_info();
-       free(partitions_list);
-       free(str_disk_guid);
+ out:
        free(new_partitions);
+       free(str_disk_guid);
+       free(partitions_list);
        return ret;
 }
 #endif
index 4033d90c8e2dd043384b93ba005fd15e1e93447c..90f76bbc20afb4dd01e1d7483d0254c0308f33f0 100644 (file)
@@ -393,15 +393,18 @@ int do_env_ask(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                sprintf(message, "Please enter '%s': ", argv[1]);
        } else {
                /* env_ask envname message1 ... messagen [size] */
-               for (i = 2, pos = 0; i < argc; i++) {
+               for (i = 2, pos = 0; i < argc && pos+1 < sizeof(message); i++) {
                        if (pos)
                                message[pos++] = ' ';
 
-                       strcpy(message + pos, argv[i]);
+                       strncpy(message + pos, argv[i], sizeof(message) - pos);
                        pos += strlen(argv[i]);
                }
-               message[pos++] = ' ';
-               message[pos] = '\0';
+               if (pos < sizeof(message) - 1) {
+                       message[pos++] = ' ';
+                       message[pos] = '\0';
+               } else
+                       message[CONFIG_SYS_CBSIZE - 1] = '\0';
        }
 
        if (size >= CONFIG_SYS_CBSIZE)
@@ -927,7 +930,7 @@ NXTARG:             ;
                                H_MATCH_KEY | H_MATCH_IDENT,
                                &ptr, size, argc, argv);
                if (len < 0) {
-                       error("Cannot export environment: errno = %d\n", errno);
+                       pr_err("Cannot export environment: errno = %d\n", errno);
                        return 1;
                }
                sprintf(buf, "%zX", (size_t)len);
@@ -947,7 +950,7 @@ NXTARG:             ;
                        H_MATCH_KEY | H_MATCH_IDENT,
                        &res, ENV_SIZE, argc, argv);
        if (len < 0) {
-               error("Cannot export environment: errno = %d\n", errno);
+               pr_err("Cannot export environment: errno = %d\n", errno);
                return 1;
        }
 
@@ -1082,7 +1085,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
 
        if (himport_r(&env_htab, ptr, size, sep, del ? 0 : H_NOCLEAR,
                        crlf_is_lf, 0, NULL) == 0) {
-               error("Environment import failed: errno = %d\n", errno);
+               pr_err("Environment import failed: errno = %d\n", errno);
                return 1;
        }
        gd->flags |= GD_FLG_ENV_READY;
index c5a770a26995fabc5a1b3b0b7450997d29e110db..a62cbe192a321781eef0858defeb7b2fadb01bc5 100644 (file)
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -616,7 +616,7 @@ static int label_localboot(struct pxe_label *label)
 static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
 {
        char *bootm_argv[] = { "bootm", NULL, NULL, NULL, NULL };
-       char initrd_str[22];
+       char initrd_str[28];
        char mac_str[29] = "";
        char ip_str[68] = "";
        int bootm_argc = 2;
@@ -648,9 +648,9 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
                }
 
                bootm_argv[2] = initrd_str;
-               strcpy(bootm_argv[2], env_get("ramdisk_addr_r"));
+               strncpy(bootm_argv[2], env_get("ramdisk_addr_r"), 18);
                strcat(bootm_argv[2], ":");
-               strcat(bootm_argv[2], env_get("filesize"));
+               strncat(bootm_argv[2], env_get("filesize"), 9);
        }
 
        if (get_relfile_envaddr(cmdtp, label->kernel, "kernel_addr_r") < 0) {
@@ -689,9 +689,9 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
                }
 
                if (label->append)
-                       strcpy(bootargs, label->append);
-               strcat(bootargs, ip_str);
-               strcat(bootargs, mac_str);
+                       strncpy(bootargs, label->append, sizeof(bootargs));
+               strncat(bootargs, ip_str, sizeof(bootargs) - strlen(bootargs));
+               strncat(bootargs, mac_str, sizeof(bootargs) - strlen(bootargs));
 
                cli_simple_process_macros(bootargs, finalbootargs);
                env_set("bootargs", finalbootargs);
index 2ef5bc9a828967f913b3d13a16f62f05342ff839..b605255180d573a8b4746ebf34b5f1d84392973b 100644 (file)
@@ -71,7 +71,7 @@ static int curr_dev_and_platdata(struct udevice **devp,
 
        *uc_pdata = dev_get_uclass_platdata(*devp);
        if (!*uc_pdata) {
-               error("Regulator: %s - missing platform data!", currdev->name);
+               pr_err("Regulator: %s - missing platform data!", currdev->name);
                return CMD_RET_FAILURE;
        }
 
index 436b7f56315eb5985016d4d597c6c8ba94959885..1bb5fc2ec23b91d152098f5cfd54a65ab2a6856c 100644 (file)
@@ -33,7 +33,7 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        int controller_index = simple_strtoul(usb_controller, NULL, 0);
        ret = board_usb_init(controller_index, USB_INIT_DEVICE);
        if (ret) {
-               error("USB init failed: %d", ret);
+               pr_err("USB init failed: %d", ret);
                ret = CMD_RET_FAILURE;
                goto exit;
        }
@@ -42,14 +42,14 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        ret = thor_init();
        if (ret) {
-               error("THOR DOWNLOAD failed: %d", ret);
+               pr_err("THOR DOWNLOAD failed: %d", ret);
                ret = CMD_RET_FAILURE;
                goto exit;
        }
 
        ret = thor_handle();
        if (ret) {
-               error("THOR failed: %d", ret);
+               pr_err("THOR failed: %d", ret);
                ret = CMD_RET_FAILURE;
                goto exit;
        }
index de57e3b9dd5e05a1efc2b4b12741b9dc3d5eb03a..2cd8b1a57777e077f63ac9f918b26e405b200524 100644 (file)
@@ -28,7 +28,7 @@ static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong cycles = 0;
        int retval = 0;
-       int repeatable;
+       int repeatable = 0;
 
        if (argc == 1)
                return CMD_RET_USAGE;
index 330640594879d138a2d4b279f77d07c016d03b00..37ad2ff33d6598d4eb600155ababeefcf81ab2aa 100644 (file)
@@ -303,12 +303,12 @@ static int test_readonly(void)
        index_0 += 1;
        if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0) !=
                TPM_SUCCESS)) {
-               error("\tcould not write index 0\n");
+               pr_err("\tcould not write index 0\n");
        }
        tpm_nv_write_value_lock(INDEX0);
        if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0)) ==
                        TPM_SUCCESS)
-               error("\tindex 0 is not locked\n");
+               pr_err("\tindex 0 is not locked\n");
 
        printf("\tdone\n");
        return 0;
@@ -471,7 +471,7 @@ static int test_write_limit(void)
                case TPM_MAXNVWRITES:
                        assert(i >= TPM_MAX_NV_WRITES_NOOWNER);
                default:
-                       error("\tunexpected error code %d (0x%x)\n",
+                       pr_err("\tunexpected error code %d (0x%x)\n",
                              result, result);
                }
        }
index b1d8b2858e199a5132902130851d364a6bf79a36..ae4d73c1250d02eb082d65ea687c2d6ad663412e 100644 (file)
@@ -28,13 +28,13 @@ static int do_sdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        ret = sdp_init(controller_index);
        if (ret) {
-               error("SDP init failed: %d", ret);
+               pr_err("SDP init failed: %d", ret);
                goto exit;
        }
 
        /* This command typically does not return but jumps to an image */
        sdp_handle(controller_index);
-       error("SDP ended");
+       pr_err("SDP ended");
 
 exit:
        g_dnl_unregister();
index 3353f95c74505bd44decca9f253105221c265d84..cfeecb7068a6c7ed5170297ae6eceaceba477dd5 100644 (file)
@@ -162,21 +162,21 @@ static int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
        controller_index = (unsigned int)(simple_strtoul(
                                usb_controller, NULL, 0));
        if (board_usb_init(controller_index, USB_INIT_DEVICE)) {
-               error("Couldn't init USB controller.");
+               pr_err("Couldn't init USB controller.");
                rc = CMD_RET_FAILURE;
                goto cleanup_ums_init;
        }
 
        rc = fsg_init(ums, ums_count);
        if (rc) {
-               error("fsg_init failed");
+               pr_err("fsg_init failed");
                rc = CMD_RET_FAILURE;
                goto cleanup_board;
        }
 
        rc = g_dnl_register("usb_dnl_ums");
        if (rc) {
-               error("g_dnl_register failed");
+               pr_err("g_dnl_register failed");
                rc = CMD_RET_FAILURE;
                goto cleanup_board;
        }
index 540cc9999bc6df546fcf408d188cd4d91f192020..f96a25f582ba5ead249c4a5209bffde803710b8c 100644 (file)
@@ -241,6 +241,27 @@ config IDENT_STRING
        help
          This options adds the board specific name to u-boot version.
 
+config LOGLEVEL
+       int "loglevel"
+       default 4
+       range 0 8
+       help
+         All Messages with a loglevel smaller than the console loglevel will
+         be compiled in. The loglevels are defined as follows:
+
+         0 (KERN_EMERG)          system is unusable
+         1 (KERN_ALERT)          action must be taken immediately
+         2 (KERN_CRIT)           critical conditions
+         3 (KERN_ERR)            error conditions
+         4 (KERN_WARNING)        warning conditions
+         5 (KERN_NOTICE)         normal but significant condition
+         6 (KERN_INFO)           informational
+         7 (KERN_DEBUG)          debug-level messages
+
+config SPL_LOGLEVEL
+       int
+       default LOGLEVEL
+
 config SILENT_CONSOLE
        bool "Support a silent console"
        help
@@ -382,22 +403,6 @@ config SYS_STDIO_DEREGISTER
 
 endmenu
 
-config DTB_RESELECT
-       bool "Support swapping dtbs at a later point in boot"
-       depends on FIT_EMBED
-       help
-         It is possible during initial boot you may need to use a generic
-         dtb until you can fully determine the board your running on. This
-         config allows boards to implement a function at a later point
-         during boot to switch to the "correct" dtb.
-
-config FIT_EMBED
-       bool "Support a FIT image embedded in the U-boot image"
-       help
-         This option provides hooks to allow U-boot to parse an
-         appended FIT image and enable board specific code to then select
-         the correct DTB to be used.
-
 config DEFAULT_FDT_FILE
        string "Default fdt file"
        help
index 801ea3191f6782054dc469970ab90469440e3303..cec506fe3e1efe25149577708d2bd59d531f9d47 100644 (file)
@@ -103,7 +103,7 @@ obj-y += image.o
 obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o
 obj-$(CONFIG_$(SPL_TPL_)FIT) += image-fit.o
-obj-$(CONFIG_FIT_EMBED) += boot_fit.o common_fit.o
+obj-$(CONFIG_$(SPL_)MULTI_DTB_FIT) += boot_fit.o common_fit.o
 obj-$(CONFIG_$(SPL_TPL_)FIT_SIGNATURE) += image-sig.o
 obj-$(CONFIG_IO_TRACE) += iotrace.o
 obj-y += memsize.o
index 0a723150b5883f32301cf87ab2ccfede2949db35..add65c4baed7431be4c605e9189ef748eabccdca 100644 (file)
@@ -13,7 +13,7 @@
 #include <image.h>
 #include <libfdt.h>
 
-int fdt_offset(void *fit)
+static int fdt_offset(const void *fit)
 {
        int images, node, fdt_len, fdt_node, fdt_offset;
        const char *fdt_name;
@@ -55,7 +55,7 @@ int fdt_offset(void *fit)
        return fdt_offset;
 }
 
-void *locate_dtb_in_fit(void *fit)
+void *locate_dtb_in_fit(const void *fit)
 {
        struct image_header *header;
        int size;
@@ -73,7 +73,7 @@ void *locate_dtb_in_fit(void *fit)
 
        ret = fdt_offset(fit);
 
-       if (ret <= 0)
+       if (ret < 0)
                return NULL;
        else
                return (void *)fit+size+ret;
index 5f5f3f9a4475af7f0b2e6b9b2be71b09e4afdd35..85b33d8c3bc72685ede1e307b1f10b8cfe82ca84 100644 (file)
@@ -32,6 +32,9 @@ int fit_find_config_node(const void *fdt)
 {
        const char *name;
        int conf, node, len;
+       const char *dflt_conf_name;
+       const char *dflt_conf_desc = NULL;
+       int dflt_conf_node = -ENOENT;
 
        conf = fdt_path_offset(fdt, FIT_CONFS_PATH);
        if (conf < 0) {
@@ -39,6 +42,9 @@ int fit_find_config_node(const void *fdt)
                      conf);
                return -EINVAL;
        }
+
+       dflt_conf_name = fdt_getprop(fdt, conf, "default", &len);
+
        for (node = fdt_first_subnode(fdt, conf);
             node >= 0;
             node = fdt_next_subnode(fdt, node)) {
@@ -50,6 +56,15 @@ int fit_find_config_node(const void *fdt)
 #endif
                        return -EINVAL;
                }
+
+               if (dflt_conf_name) {
+                       const char *node_name = fdt_get_name(fdt, node, NULL);
+                       if (strcmp(dflt_conf_name, node_name) == 0) {
+                               dflt_conf_node = node;
+                               dflt_conf_desc = name;
+                       }
+               }
+
                if (board_fit_config_name_match(name))
                        continue;
 
@@ -58,5 +73,10 @@ int fit_find_config_node(const void *fdt)
                return node;
        }
 
+       if (dflt_conf_node != -ENOENT) {
+               debug("Selecting default config '%s'", dflt_conf_desc);
+               return dflt_conf_node;
+       }
+
        return -ENOENT;
 }
index 546a1ab9b4c0db72963ab7f14a24d86c6b6f47c6..07dff317a6c2708bb7f0deff133bae7f3bd8e11c 100644 (file)
@@ -26,13 +26,13 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget)
 
        ret = board_usb_init(usbctrl_index, USB_INIT_DEVICE);
        if (ret) {
-               error("board usb init failed\n");
+               pr_err("board usb init failed\n");
                return CMD_RET_FAILURE;
        }
        g_dnl_clear_detach();
        ret = g_dnl_register(usb_dnl_gadget);
        if (ret) {
-               error("g_dnl_register failed");
+               pr_err("g_dnl_register failed");
                return CMD_RET_FAILURE;
        }
 
@@ -75,7 +75,7 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget)
                        ret = dfu_flush(dfu_get_defer_flush(), NULL, 0, 0);
                        dfu_set_defer_flush(NULL);
                        if (ret) {
-                               error("Deferred dfu_flush() failed!");
+                               pr_err("Deferred dfu_flush() failed!");
                                goto exit;
                        }
                }
index 26d60b88d0cad12e5fa6bf8f0753be757f8c75f6..cf5b77ca287eee2ce446910f6f8b6c3580b1bd4a 100644 (file)
@@ -84,7 +84,7 @@ static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info,
        blkcnt = lldiv(blkcnt, info->blksz);
 
        if (blkcnt > info->size) {
-               error("too large for partition: '%s'\n", part_name);
+               pr_err("too large for partition: '%s'\n", part_name);
                fastboot_fail("too large for partition");
                return;
        }
@@ -93,7 +93,7 @@ static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info,
 
        blks = blk_dwrite(dev_desc, info->start, blkcnt, buffer);
        if (blks != blkcnt) {
-               error("failed writing to device %d\n", dev_desc->devnum);
+               pr_err("failed writing to device %d\n", dev_desc->devnum);
                fastboot_fail("failed writing to device");
                return;
        }
@@ -125,7 +125,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
        sector_size = info->blksz;
        hdr_sectors = DIV_ROUND_UP(sizeof(struct andr_img_hdr), sector_size);
        if (hdr_sectors == 0) {
-               error("invalid number of boot sectors: 0");
+               pr_err("invalid number of boot sectors: 0");
                fastboot_fail("invalid number of boot sectors: 0");
                return 0;
        }
@@ -133,7 +133,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
        /* Read the boot image header */
        res = blk_dread(dev_desc, info->start, hdr_sectors, (void *)hdr);
        if (res != hdr_sectors) {
-               error("cannot read header from boot partition");
+               pr_err("cannot read header from boot partition");
                fastboot_fail("cannot read header from boot partition");
                return 0;
        }
@@ -141,7 +141,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
        /* Check boot header magic string */
        res = android_image_check_header(hdr);
        if (res != 0) {
-               error("bad boot image magic");
+               pr_err("bad boot image magic");
                fastboot_fail("boot partition not initialized");
                return 0;
        }
@@ -179,7 +179,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
        /* Get boot partition info */
        res = part_get_info_by_name(dev_desc, BOOT_PARTITION_NAME, &info);
        if (res < 0) {
-               error("cannot find boot partition");
+               pr_err("cannot find boot partition");
                fastboot_fail("cannot find boot partition");
                return -1;
        }
@@ -191,14 +191,14 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
        /* Read boot image header */
        hdr_sectors = fb_mmc_get_boot_header(dev_desc, &info, hdr);
        if (hdr_sectors == 0) {
-               error("unable to read boot image header");
+               pr_err("unable to read boot image header");
                fastboot_fail("unable to read boot image header");
                return -1;
        }
 
        /* Check if boot image has second stage in it (we don't support it) */
        if (hdr->second_size > 0) {
-               error("moving second stage is not supported yet");
+               pr_err("moving second stage is not supported yet");
                fastboot_fail("moving second stage is not supported yet");
                return -1;
        }
@@ -216,7 +216,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
        res = blk_dread(dev_desc, ramdisk_sector_start, ramdisk_sectors,
                        ramdisk_buffer);
        if (res != ramdisk_sectors) {
-               error("cannot read ramdisk from boot partition");
+               pr_err("cannot read ramdisk from boot partition");
                fastboot_fail("cannot read ramdisk from boot partition");
                return -1;
        }
@@ -225,7 +225,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
        hdr->kernel_size = download_bytes;
        res = blk_dwrite(dev_desc, info.start, hdr_sectors, (void *)hdr);
        if (res == 0) {
-               error("cannot writeback boot image header");
+               pr_err("cannot writeback boot image header");
                fastboot_fail("cannot write back boot image header");
                return -1;
        }
@@ -237,7 +237,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
        res = blk_dwrite(dev_desc, kernel_sector_start, kernel_sectors,
                         download_buffer);
        if (res == 0) {
-               error("cannot write new kernel");
+               pr_err("cannot write new kernel");
                fastboot_fail("cannot write new kernel");
                return -1;
        }
@@ -249,7 +249,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
        res = blk_dwrite(dev_desc, ramdisk_sector_start, ramdisk_sectors,
                         ramdisk_buffer);
        if (res == 0) {
-               error("cannot write back original ramdisk");
+               pr_err("cannot write back original ramdisk");
                fastboot_fail("cannot write back original ramdisk");
                return -1;
        }
@@ -268,7 +268,7 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer,
 
        dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
        if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) {
-               error("invalid mmc device\n");
+               pr_err("invalid mmc device\n");
                fastboot_fail("invalid mmc device");
                return;
        }
@@ -322,7 +322,7 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer,
 #endif
 
        if (part_get_info_by_name_or_alias(dev_desc, cmd, &info) < 0) {
-               error("cannot find partition: '%s'\n", cmd);
+               pr_err("cannot find partition: '%s'\n", cmd);
                fastboot_fail("cannot find partition");
                return;
        }
@@ -360,21 +360,21 @@ void fb_mmc_erase(const char *cmd)
        struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV);
 
        if (mmc == NULL) {
-               error("invalid mmc device");
+               pr_err("invalid mmc device");
                fastboot_fail("invalid mmc device");
                return;
        }
 
        dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
        if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) {
-               error("invalid mmc device");
+               pr_err("invalid mmc device");
                fastboot_fail("invalid mmc device");
                return;
        }
 
        ret = part_get_info_by_name_or_alias(dev_desc, cmd, &info);
        if (ret < 0) {
-               error("cannot find partition: '%s'", cmd);
+               pr_err("cannot find partition: '%s'", cmd);
                fastboot_fail("cannot find partition");
                return;
        }
@@ -393,7 +393,7 @@ void fb_mmc_erase(const char *cmd)
 
        blks = blk_derase(dev_desc, blks_start, blks_size);
        if (blks != blks_size) {
-               error("failed erasing from device %d", dev_desc->devnum);
+               pr_err("failed erasing from device %d", dev_desc->devnum);
                fastboot_fail("failed erasing from device");
                return;
        }
index 3d027d43755486dcf53cdc31dbc728ba4191f33c..aa28046cbd83050b94f76306f6f448e97e5101fc 100644 (file)
@@ -40,20 +40,20 @@ static int fb_nand_lookup(const char *partname,
 
        ret = mtdparts_init();
        if (ret) {
-               error("Cannot initialize MTD partitions\n");
+               pr_err("Cannot initialize MTD partitions\n");
                fastboot_fail("cannot init mtdparts");
                return ret;
        }
 
        ret = find_dev_and_part(partname, &dev, &pnum, part);
        if (ret) {
-               error("cannot find partition: '%s'", partname);
+               pr_err("cannot find partition: '%s'", partname);
                fastboot_fail("cannot find partition");
                return ret;
        }
 
        if (dev->id->type != MTD_DEV_TYPE_NAND) {
-               error("partition '%s' is not stored on a NAND device",
+               pr_err("partition '%s' is not stored on a NAND device",
                      partname);
                fastboot_fail("not a NAND device");
                return -EINVAL;
@@ -154,7 +154,7 @@ void fb_nand_flash_write(const char *cmd, void *download_buffer,
 
        ret = fb_nand_lookup(cmd, &mtd, &part);
        if (ret) {
-               error("invalid NAND device");
+               pr_err("invalid NAND device");
                fastboot_fail("invalid NAND device");
                return;
        }
@@ -209,7 +209,7 @@ void fb_nand_erase(const char *cmd)
 
        ret = fb_nand_lookup(cmd, &mtd, &part);
        if (ret) {
-               error("invalid NAND device");
+               pr_err("invalid NAND device");
                fastboot_fail("invalid NAND device");
                return;
        }
@@ -220,7 +220,7 @@ void fb_nand_erase(const char *cmd)
 
        ret = _fb_nand_erase(mtd, part);
        if (ret) {
-               error("failed erasing from device %s", mtd->name);
+               pr_err("failed erasing from device %s", mtd->name);
                fastboot_fail("failed erasing from device");
                return;
        }
index b05ec21ed62e6a8157a498513880aea749f0b7c0..0bd8370337bcc5bd5d7d551abee2c49880535a76 100644 (file)
@@ -94,6 +94,7 @@ config SPL_STACK_R
 config SPL_STACK_R_ADDR
        depends on SPL_STACK_R
        hex "SDRAM location for SPL stack"
+       default 0x82000000 if ARCH_OMAP2PLUS
        help
          Specify the address in SDRAM for the SPL stack. This will be set up
          before board_init_r() is called.
index 2c974735b11a8daf4eccdd3289307a488ffaaeba..05bb21035df2781fb975057515af9135dd55e89c 100644 (file)
@@ -42,13 +42,13 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr)
        set_default_env(0);
        str_env = env_get(dfu_alt_info);
        if (!str_env) {
-               error("\"dfu_alt_info\" env variable not defined!\n");
+               pr_err("\"dfu_alt_info\" env variable not defined!\n");
                return -EINVAL;
        }
 
        ret = env_set("dfu_alt_info", str_env);
        if (ret) {
-               error("unable to set env variable \"dfu_alt_info\"!\n");
+               pr_err("unable to set env variable \"dfu_alt_info\"!\n");
                return -EINVAL;
        }
 
index b2cccc6c6e41ca450e49cd68fc28516187d8372e..b57e0b04e46a3174a5ccead5c2489eb9c2ade1f0 100644 (file)
@@ -52,8 +52,9 @@ static ulong h_spl_load_read(struct spl_load_info *load, ulong sector,
        return blk_dread(mmc_get_blk_desc(mmc), sector, count, buf);
 }
 
-static int mmc_load_image_raw_sector(struct spl_image_info *spl_image,
-                                    struct mmc *mmc, unsigned long sector)
+static __maybe_unused
+int mmc_load_image_raw_sector(struct spl_image_info *spl_image,
+                             struct mmc *mmc, unsigned long sector)
 {
        unsigned long count;
        struct image_header *header;
index 350bcdb056956d0ca6c61a3d4f11581730b7dce0..333d518f4d6e777aa603c024c985082db180b485 100644 (file)
@@ -24,13 +24,13 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image,
 
        ret = sdp_init(controller_index);
        if (ret) {
-               error("SDP init failed: %d", ret);
+               pr_err("SDP init failed: %d", ret);
                return -ENODEV;
        }
 
        /* This command typically does not return but jumps to an image */
        sdp_handle(controller_index);
-       error("SDP ended");
+       pr_err("SDP ended");
 
        return -EINVAL;
 }
index 974f4655e7ef1d492b9c589cdfe02738a9fd1134..33bffaa89eca52014e88fdab626912be8f55bbdf 100644 (file)
@@ -242,7 +242,7 @@ int update_tftp(ulong addr, char *interface, char *devstring)
        } else if (interface && devstring) {
                update_tftp_dfu = true;
        } else {
-               error("Interface: %s and devstring: %s not supported!\n",
+               pr_err("Interface: %s and devstring: %s not supported!\n",
                      interface, devstring);
                return -EINVAL;
        }
index 0904259757371a25b2cb25f2d1189b6a53a43d17..8d27bc70607560b7c52841f75c3f2fbecf191e94 100644 (file)
@@ -437,12 +437,13 @@ static int usb_parse_config(struct usb_device *dev,
                        }
                        break;
                case USB_DT_ENDPOINT:
-                       if (head->bLength != USB_DT_ENDPOINT_SIZE) {
+                       if (head->bLength != USB_DT_ENDPOINT_SIZE &&
+                           head->bLength != USB_DT_ENDPOINT_AUDIO_SIZE) {
                                printf("ERROR: Invalid USB EP length (%d)\n",
                                        head->bLength);
                                break;
                        }
-                       if (index + USB_DT_ENDPOINT_SIZE >
+                       if (index + head->bLength >
                            dev->config.desc.wTotalLength) {
                                puts("USB EP descriptor overflowed buffer!\n");
                                break;
@@ -969,23 +970,24 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read)
        dev->epmaxpacketin[0] = dev->descriptor.bMaxPacketSize0;
        dev->epmaxpacketout[0] = dev->descriptor.bMaxPacketSize0;
 
-       if (do_read) {
+       if (do_read && dev->speed == USB_SPEED_FULL) {
                int err;
 
                /*
-                * Validate we've received only at least 8 bytes, not that we've
-                * received the entire descriptor. The reasoning is:
-                * - The code only uses fields in the first 8 bytes, so that's all we
-                *   need to have fetched at this stage.
-                * - The smallest maxpacket size is 8 bytes. Before we know the actual
-                *   maxpacket the device uses, the USB controller may only accept a
-                *   single packet. Consequently we are only guaranteed to receive 1
-                *   packet (at least 8 bytes) even in a non-error case.
+                * Validate we've received only at least 8 bytes, not that
+                * we've received the entire descriptor. The reasoning is:
+                * - The code only uses fields in the first 8 bytes, so
+                *   that's all we need to have fetched at this stage.
+                * - The smallest maxpacket size is 8 bytes. Before we know
+                *   the actual maxpacket the device uses, the USB controller
+                *   may only accept a single packet. Consequently we are only
+                *   guaranteed to receive 1 packet (at least 8 bytes) even in
+                *   a non-error case.
                 *
-                * At least the DWC2 controller needs to be programmed with the number
-                * of packets in addition to the number of bytes. A request for 64
-                * bytes of data with the maxpacket guessed as 64 (above) yields a
-                * request for 1 packet.
+                * At least the DWC2 controller needs to be programmed with
+                * the number of packets in addition to the number of bytes.
+                * A request for 64 bytes of data with the maxpacket guessed
+                * as 64 (above) yields a request for 1 packet.
                 */
                err = get_descriptor_len(dev, 64, 8);
                if (err)
@@ -1008,7 +1010,7 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read)
                dev->maxpacketsize = PACKET_SIZE_64;
                break;
        default:
-               printf("usb_new_device: invalid max packet size\n");
+               printf("%s: invalid max packet size\n", __func__);
                return -EIO;
        }
 
@@ -1050,6 +1052,17 @@ static int usb_prepare_device(struct usb_device *dev, int addr, bool do_read,
 
        mdelay(10);     /* Let the SET_ADDRESS settle */
 
+       /*
+        * If we haven't read device descriptor before, read it here
+        * after device is assigned an address. This is only applicable
+        * to xHCI so far.
+        */
+       if (!do_read) {
+               err = usb_setup_descriptor(dev, true);
+               if (err)
+                       return err;
+       }
+
        return 0;
 }
 
index 86a347766432467dcd67f078d963fce1bffa561c..325d16dfc8682d3b5cc0e950e04d80d24ab0861e 100644 (file)
@@ -489,6 +489,17 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
                return 0;
        }
 
+       if (portchange & USB_PORT_STAT_C_RESET) {
+               debug("port %d reset change\n", i + 1);
+               usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);
+       }
+
+       if ((portchange & USB_SS_PORT_STAT_C_BH_RESET) &&
+           usb_hub_is_superspeed(dev)) {
+               debug("port %d BH reset change\n", i + 1);
+               usb_clear_port_feature(dev, i + 1, USB_SS_PORT_FEAT_C_BH_RESET);
+       }
+
        /* A new USB device is ready at this point */
        debug("devnum=%d port=%d: USB dev found\n", dev->devnum, i + 1);
 
@@ -543,11 +554,6 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
                       hub->overcurrent_count[i]);
        }
 
-       if (portchange & USB_PORT_STAT_C_RESET) {
-               debug("port %d reset change\n", i + 1);
-               usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);
-       }
-
        /*
         * We're done with this device, so let's remove this device from
         * scanning list
index df0b057308791f938592c3335d0362e424672d6b..a91b1c0d2f925eed06881d14ab85afe398eac423 100644 (file)
@@ -98,19 +98,9 @@ struct us_data {
        struct scsi_cmd *srb;                   /* current srb */
        trans_reset     transport_reset;        /* reset routine */
        trans_cmnd      transport;              /* transport routine */
+       unsigned short  max_xfer_blk;           /* maximum transfer blocks */
 };
 
-#ifdef CONFIG_USB_EHCI_HCD
-/*
- * The U-Boot EHCI driver can handle any transfer length as long as there is
- * enough free heap space left, but the SCSI READ(10) and WRITE(10) commands are
- * limited to 65535 blocks.
- */
-#define USB_MAX_XFER_BLK       65535
-#else
-#define USB_MAX_XFER_BLK       20
-#endif
-
 #ifndef CONFIG_BLK
 static struct us_data usb_stor[USB_MAX_STOR_DEV];
 #endif
@@ -949,6 +939,38 @@ do_retry:
        return USB_STOR_TRANSPORT_FAILED;
 }
 
+static void usb_stor_set_max_xfer_blk(struct usb_device *udev,
+                                     struct us_data *us)
+{
+       unsigned short blk;
+       size_t __maybe_unused size;
+       int __maybe_unused ret;
+
+#ifndef CONFIG_DM_USB
+#ifdef CONFIG_USB_EHCI_HCD
+       /*
+        * The U-Boot EHCI driver can handle any transfer length as long as
+        * there is enough free heap space left, but the SCSI READ(10) and
+        * WRITE(10) commands are limited to 65535 blocks.
+        */
+       blk = USHRT_MAX;
+#else
+       blk = 20;
+#endif
+#else
+       ret = usb_get_max_xfer_size(udev, (size_t *)&size);
+       if (ret < 0) {
+               /* unimplemented, let's use default 20 */
+               blk = 20;
+       } else {
+               if (size > USHRT_MAX * 512)
+                       size = USHRT_MAX * 512;
+               blk = size / 512;
+       }
+#endif
+
+       us->max_xfer_blk = blk;
+}
 
 static int usb_inquiry(struct scsi_cmd *srb, struct us_data *ss)
 {
@@ -1150,12 +1172,12 @@ static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr,
                /* XXX need some comment here */
                retry = 2;
                srb->pdata = (unsigned char *)buf_addr;
-               if (blks > USB_MAX_XFER_BLK)
-                       smallblks = USB_MAX_XFER_BLK;
+               if (blks > ss->max_xfer_blk)
+                       smallblks = ss->max_xfer_blk;
                else
                        smallblks = (unsigned short) blks;
 retry_it:
-               if (smallblks == USB_MAX_XFER_BLK)
+               if (smallblks == ss->max_xfer_blk)
                        usb_show_progress();
                srb->datalen = block_dev->blksz * smallblks;
                srb->pdata = (unsigned char *)buf_addr;
@@ -1178,7 +1200,7 @@ retry_it:
              start, smallblks, buf_addr);
 
        usb_disable_asynch(0); /* asynch transfer allowed */
-       if (blkcnt >= USB_MAX_XFER_BLK)
+       if (blkcnt >= ss->max_xfer_blk)
                debug("\n");
        return blkcnt;
 }
@@ -1236,12 +1258,12 @@ static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr,
                 */
                retry = 2;
                srb->pdata = (unsigned char *)buf_addr;
-               if (blks > USB_MAX_XFER_BLK)
-                       smallblks = USB_MAX_XFER_BLK;
+               if (blks > ss->max_xfer_blk)
+                       smallblks = ss->max_xfer_blk;
                else
                        smallblks = (unsigned short) blks;
 retry_it:
-               if (smallblks == USB_MAX_XFER_BLK)
+               if (smallblks == ss->max_xfer_blk)
                        usb_show_progress();
                srb->datalen = block_dev->blksz * smallblks;
                srb->pdata = (unsigned char *)buf_addr;
@@ -1263,7 +1285,7 @@ retry_it:
              PRIxPTR "\n", start, smallblks, buf_addr);
 
        usb_disable_asynch(0); /* asynch transfer allowed */
-       if (blkcnt >= USB_MAX_XFER_BLK)
+       if (blkcnt >= ss->max_xfer_blk)
                debug("\n");
        return blkcnt;
 
@@ -1384,6 +1406,10 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
                ss->irqmaxp = usb_maxpacket(dev, ss->irqpipe);
                dev->irq_handle = usb_stor_irq;
        }
+
+       /* Set the maximum transfer size per host controller setting */
+       usb_stor_set_max_xfer_blk(dev, ss);
+
        dev->privptr = (void *)ss;
        return 1;
 }
index 89f8068be62657c91bb9bb10e94dd05fdb6a9a77..fbc42ae58e2f2f736c7d6d6646d8f89c9f8c1e7e 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_BOOTD is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index dea6a9104706658ec340fde5608fec033b470b87..97f3a225241c73d5ec11c4e9a869ca69305927a6 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_BOOTD is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index aded95fcd570c6a57a9cb8b647f757cc2780581c..30e846cf4899520b291811b492c36959fe4cddc6 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 618883c4a296acbf7ff528216f7d1322eb9dc46f..0a0057ea94a7bdd412960fcf52529d063f5a18bb 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a10s-olinuxino-micro"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index d8d1040a909336757c7a239329345224aa5ef4a8..f6af9446cc09d1d648558eb05733f9534b97e4af 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino-micro"
 # 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_SPL_DOS_PARTITION is not set
index fbacce07cf0c7b2ec5081b059e11840b315faaba..866b0731828b60f86e17e58e1972089285adb73d 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -31,8 +30,3 @@ CONFIG_AXP_ALDO3_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=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 58aa988b2363b7a8d695d61350a98bc7e56bbc74..cd1fa64ecb0f7d205d4ab98783f099b31019fbfc 100644 (file)
@@ -14,8 +14,6 @@ CONFIG_AHCI=y
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_FASTBOOT_FLASH=y
-CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -33,8 +31,3 @@ CONFIG_SCSI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=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 6d7c58861373193f7ced7c29eb64cd9a0696bed8..bd2222bcff555367e1d22974b5c89de026b1e791 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -32,8 +31,3 @@ CONFIG_SCSI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=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 70a5e77f091b3cad084968da3d1ae17f9a36e87e..08b301a483b5288cf05ab944df050e1d8662ee2d 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
diff --git a/configs/A20-OLinuXino_MICRO-eMMC_defconfig b/configs/A20-OLinuXino_MICRO-eMMC_defconfig
new file mode 100644 (file)
index 0000000..2ff2723
--- /dev/null
@@ -0,0 +1,26 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN7I=y
+CONFIG_DRAM_CLK=384
+CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_I2C1_ENABLE=y
+CONFIG_VIDEO_VGA=y
+CONFIG_SATAPWR="PB8"
+CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-micro"
+CONFIG_AHCI=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL=y
+CONFIG_SPL_I2C_SUPPORT=y
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_ISO_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_SUN7I_GMAC=y
+CONFIG_AXP_ALDO3_VOLT=2800
+CONFIG_AXP_ALDO4_VOLT=2800
+CONFIG_SCSI=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
index 8d5df33906e51036e29afcdace7b34c793a39c1c..1a0ad5a6d412063f45b171a4633c718f7c451d89 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 6f57c3aee944fc5533b7a6738c86a86aaf72ef01..ee9415517f2a4255dc59ba0f08e1ae2dd7a09c8c 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index fafbeb282129866749df4e3c7fc9e08361697642..c11991de7e5aa4c3d2627d32a3c449408c70cebd 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-olinuxino"
 # 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_SPL_DOS_PARTITION is not set
index af2d593ae7289594d32ed6f77a5a59a8b3d2c57b..d21288c7742a3473fe8e1f427ef0e2c8734f1e09 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-ainol-aw1"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 03f51393bb80ad8733ddc6990cda55124d49ec52..f105b5ea8ac73831cf2d63ab1edafaba24d535ca 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-ampe-a76"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index badfd94a88e1bdbe007f7be06f29fe9e2edf3d3d..06538e50d976e739b8f64fd76440328537aad3c7 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a10s-auxtek-t003"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 48a8344e32d8cca00f9a835259155e12f7d2a47a..daea06e5f7de96f9adad3f2df6baa060eba059c4 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a10s-auxtek-t004"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 01af4aab865fa4e08865d19c298707a23cf22c91..3df45006e36d34afa38be84253c53c36f94b4eed 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index 6e37669e67031c5d7124c861abc2d3914891b452..db5cdf9f71de1ec51029bf02337de1729638c51c 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index beeaa821036b6091fef6d2775474cdfd13fb371b..6ce5b694c68d9b93ebcf1aa3f10d29761f50b252 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index be0011e036459d19a92c225cae7f3df5b9cebb7e..c09815183270e41acbd0324b1187d3f48e754bb9 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index f756d002be036ea914f231e726e3c3ca65b4cc4a..8354ae1b892ca75305c383c3797a107c68b3a633 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index e9a4a07e95ea227179094226c7127c621f507505..615e01acff9f90ea75e40077a01dfc5094a094b6 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index e89b13274dbfa639b3657a92ed101baf2c89e560..573fc2e000339dc8e5e1f03e28bb3769fee67c2b 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 5a22a8bc9591212576283c382d226afd3a38a283..8e7d868b12510779fe7445a870fb4533c71d017a 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index 25a8123db96ee9c33135e1e7a835f2d8c2c68a7d..2e99fc55381fa8102dba92e86280ed3af4c33803 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index 2dc73222575cc56fb24da49c487f2af7be9c3843..35d1b49337780acd2ef2d1954a44df0e522e958d 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index 6637e763688d55f4eadc54da3b4c3b96bc2e8386..e4777825f7d6ead28a6d2e1fb231361ca7c7a75d 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH,SYS_CLK_100"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index d06fbd11db31fde447582d5ad5ce676023c45587..b4cbdc548ea06b6cf27d5feadb2340c571b7a864 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index d86d7b1511a09a7ff172383399fe4d894607dfd4..c323a108608fb31a2e652f20533b3f6f465fe786 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="NAND_SECBOOT,SYS_CLK_100_DDR_100"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 4f46b25011bd5e33bd3f643b2f379969f2c75423..58ea3571391bdb0f0f59f511e35d35f69002777b 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index d23952f2f4fc10be5f2f07463b12a63e8fff4760..28313207571d2f74e77a61da08c1d02b5efbd649 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="NAND_SECBOOT,SYS_CLK_100_DDR_133"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 4f4431e88c57f7b685c3b0685927c2b84687c21f..dac1b31044dc54329ee12114a2081b7a35e86f46 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 69b9a0671d9c5222a44dc2394d407ec1533617f4..d4cd2c0648728ac94fb6eabe4491ca3bb29f16ef 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_CLK_100_DDR_100"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 3996e4d5dbe3cad8028a944276146d5a14ae7bc4..c8855f8c6b495bf24d45ba9120575425fc75c9a1 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_CLK_100_DDR_100"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 14885dc4609e5feeeb08144d7226514318692dfb..660f2244a48992ab02960b4c45e652e2beeef275 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_CLK_100_DDR_133"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 7cd0fdd7d2dc10528972e222c1d00650ee79b9db..d03f90a37554beb5e4b1bfc446fc7e9fdc68c259 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_CLK_100_DDR_133"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 4bbea52f8bbeb5855cdba9f1c6e05c30139a8346..9ff1b2004b8049ab3ecd619c7402c2b96583f811 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SDCARD,SYS_CLK_100_DDR_100"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index e1ec87420f5166375fb8e1cbeea4fd6cd3563df2..6e669d76300c4dd84d315f51ff30282ca5effe6c 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SDCARD,SYS_CLK_100_DDR_100"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 7a7e56d71fd87e7516649c309c6eb69668a32caf..007427418447dfd2359b329b90197bc3f7cfa20b 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SDCARD,SYS_CLK_100_DDR_133"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 665486b218f7e4baae6a13db60925f435b1165b8..b2efa93da2bd2b316885b6ce6357bf99413d2bd3 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SDCARD,SYS_CLK_100_DDR_133"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 3c684a03522f32b356228f78fd1919a8985ce4ec..909da8708784e514a7270097bb0d32b974003885 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH,SYS_CLK_100_DDR_100"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 713006a146a9ad1c70abb119d0c1b7681e37d817..365ad8921a25e50442a817a90e41891218512b2e 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH,SYS_CLK_100_DDR_100"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index dd801ab8e9dd84bc48f1c9f4579e0f5ef3dac286..8bc8ca0abc2b6f021c0504ae54ff47370509fe1a 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH,SYS_CLK_100_DDR_133"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 855102fbf3a33bce8643d522d5fb30505a602495..f91e40b5105aa9aa59be81f143ba43818b68a360 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH,SYS_CLK_100_DDR_133"
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 7899d20932319b1f1d15c8c7392dea54c6fa052c..4c2c05c4da06752100dbe56833410090e6a29f0a 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_AXP_DLDO4_VOLT=2500
index 83ca4e4befa5fac39de988f3c957f60ba7d11c2c..a5456127e2bf6dec85fcb1535429c7a32c32954d 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index bd1cc99bd509f303692026ac99f108193d359ae2..5c8e7594980b45b219b390915f96cf01dad7c3b5 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 6b3e0934d4e51e222d88d98cd7ed3f3b07cdaba4..8c4615c45668513a0704cd0f4ac9371789d352f7 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index 89d6fc3d4464b2bf44b0f2cc7e7fc53f023ebae9..29bcc9cf1910df1416b4fe9c6822b27bc9b67ff9 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=-1
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index cd366a709612934f5d2dd1aea327f16adf1618f8..a6f51cd321315ee1abf66fc1962e634da8ed136b 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH"
 CONFIG_BOOTDELAY=-1
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index cf47a125ddf7292d87d00e71f9a6f638a621ad6b..53d019f9059540c73badb6130d4b4fdeb8e6de40 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SPIFLASH"
 CONFIG_BOOTDELAY=-1
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index 7f5cea0f9dadb5e0828df4854c3c50a7f85d6656..c7422f6e23256b1799c1bb012bc1c33e5e3cc3a0 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=-1
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index 83228bd10f050d35264e438ba62e8ed4b71d893c..d057bee17241acb6fa07cc0f6e3913db8892f4f5 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-r8-chip"
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_FASTBOOT_FLASH=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_SPL_DOS_PARTITION is not set
@@ -22,9 +21,4 @@ CONFIG_AXP_ALDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=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
 CONFIG_OF_LIBFDT_OVERLAY=y
index 3a748fc27e07380da43111adf143e3ccee45e91f..fa572eac57d3205a44cd56de7393a65ece2996cf 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_NAND_BLOCK_SIZE=0x40000,SYS_NAND_PAGE_SIZE=4096,SY
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_FASTBOOT_FLASH=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADB is not set
@@ -27,9 +26,4 @@ CONFIG_AXP_ALDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=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
 CONFIG_OF_LIBFDT_OVERLAY=y
index 348abb5349e37c28844e481f397bc2d04d26732e..01a2ccd197d3108253bb68124487b20a2726f9a5 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_USB2_VBUS_PIN=""
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-cs908"
 # 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_SPL_DOS_PARTITION is not set
index 7ece4f9bc2af4ea2c477de8278e1870ec36563bc..3da1e8349f817d0e4df4cbaa8f5e4fb9b23e4bca 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-chuwi-v7-cw0825"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 21e87e638197368ec193f227486c797692325661..a7a3f4815498bca89f5a37a090257d8da2742daa 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804=y
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-colombus"
 # 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_SPL_DOS_PARTITION is not set
index 78eaaf4379e64572f92251c0ab62f34dd9bf1577..ef95ac6a5effcfed5ba1b868cc669e53d60a87d6 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 6f9fd2b5a030f5e180995126f93cf6500591cc85..cac415f3bd8a6170ad2cd3ccee8e4e5efc243c18 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_USB3_VBUS_PIN="PH15"
 CONFIG_AXP_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="sun9i-a80-cubieboard4"
 CONFIG_SPL=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 1e6b811be97344974f48a6b85e1c09470d31b539..c670ab851aece6b03a8b5de076f73d93636bd5aa 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index f93ff0d6c463ce74d1488d55251205adb708cee7..caf5f5fb105dde8489af2841fa8267fe94c87dc3 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -32,8 +31,3 @@ CONFIG_SCSI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=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 34444ec0bd09359d4d69f0d048436aaf58edaba1..12120c2ceda5f99b01baf1147abac07349bac40f 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_MACH_SUN8I_A83T=y
 CONFIG_DRAM_CLK=672
 CONFIG_DRAM_ZQ=15355
 CONFIG_DRAM_ODT_EN=y
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
 CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
 CONFIG_USB0_ID_DET="PH11"
@@ -15,7 +16,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-cubietruck-plus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 82da854386475135a6ccb917e1c32d1a3c24e662..6242c70c2b96761db9e1bdf50e905ab67d2f79a7 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOOTDELAY=10
 CONFIG_CONSOLE_MUX=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
@@ -34,5 +33,4 @@ CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_OF_LIBFDT=y
index 0fc9a07548988f6f0899a8dee37a1e72d4b2fcfb..0af8a90cc279ad4c68c43c0ed84c17ed67297602 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOOTDELAY=10
 CONFIG_CONSOLE_MUX=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
@@ -34,5 +33,4 @@ CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_OF_LIBFDT=y
index f83e33ad50847b397a1867f8db2d9e3b57d0e915..b981128303f0544a28fa8db709b0f502f94c1a27 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-empire-electronix-d709"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 5a7bc09ce3e9f51f869bf0d7f5bcd795a5fcfc52..5dd2d70a5e23cca2a73756d97bc4a6d62e64c1c0 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-empire-electronix-m712"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 45fd4f47a6c740f6ceaaf834dd7b1afe9b4611e4..a5058c8a1ac90e893ec7a4b768c72c0f35eb3fed 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VIDEO_VGA_EXTERNAL_DAC_EN="PH25"
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-hummingbird"
 # 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_SPL_DOS_PARTITION is not set
index 0808ada041834655c608bf7a84a2aa6a94323849..059361d4a8540780dbc9cf5129703acac3151147 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-hyundai-a7hd"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 7b746f058988cfea609e04eec3c410f08edcb737..8f7ee1d55f35ca24c1e0b92426eaf6a8a36b1ea6 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 64dc81332c9b7ffb486a22a0d3c0c6c348ee08ef..84007ad374b8bd0b228d8786f63b84a49fa1d1d9 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index bd754cb5b3c849611fd9be5773b3442a8b399e23..725f804d09152fcd08504f476cd6f4a83728417b 100644 (file)
@@ -4,8 +4,11 @@ CONFIG_MACH_SUN8I_V3S=y
 CONFIG_DRAM_CLK=360
 CONFIG_DRAM_ZQ=14779
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-v3s-licheepi-zero"
-# CONFIG_CMD_IMLS is not set
+CONFIG_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_NETDEVICES is not set
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_ISO_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
index d4911eaab136a7a4666597c31f59464d9a4ee9ca..08749b8f75982899e098f44ea306ee8c9102e2c1 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 1dbb25d00f74c777c4f6328ffa60651909bae76b..a54f9de3a6ee82e75c05a99cc40d0e336be219fd 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 06edc5e3a19eaf4f01fb5e42e3d0601656e572d3..717814607c371a4b65fdc1325e3f4aef88655146 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-pcduino"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 5756f82383010aee72bb5417775dbac7da97446c..f8494707361c217bb80cd2d5fda27679fa5f4880 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5208EVBE=y
 CONFIG_BOOTDELAY=1
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
index aaf7f96cdbf88b7724e542e862485e872f90bff7..74ea619008d968bdbdbd72f9e31071d7945a2248 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_SPANSION_BOOT"
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
index df97e20b743ef743ebd23a666caad4b75e8a5cae..13055c52f509944fbab094597903d6739b271ef7 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M52277EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="CF_SBF,SYS_STMICRO_BOOT"
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
index 144ca01e1f9f7350eb18940edd8f86f4b3384881..111bb23fd32e2a2927f8f67efba3affbd41fbb94 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5235EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="NORFLASH_PS32BIT"
 CONFIG_BOOTDELAY=1
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 0afaf7db00e7966f5fe2686a36a1afd77ac2d1b9..72d81ff199d72f0b2be3dc041cba0feaa10f2531 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5235EVB=y
 CONFIG_BOOTDELAY=1
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index b7eedcdacf464585be7a47cc6cfe42e9c863e017..ffdc81806e7fe741915471511f457c8b4fbdc3a4 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5249EVB=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_AUTOBOOT is not set
+CONFIG_CMD_IMLS=y
 CONFIG_LOOPW=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
index 09640de1ec72c26bee94479983ccb01ec62727d2..9ae903bb47cd59183f76e4e8f770407a3c7b5a7a 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_SYS_TEXT_BASE=0xFF800000
 CONFIG_TARGET_M5253DEMO=y
 CONFIG_BOOTDELAY=5
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_PING=y
index 79941a125355f76c2250558c543b4b90d5c5e9cc..88e16205ea6271c546dee9eabff11adc157c5c62 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_SYS_TEXT_BASE=0xFFE00000
 CONFIG_TARGET_M5253EVBE=y
 CONFIG_BOOTDELAY=5
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
index 478ccd72448a4685a09974f350007fe4d7f26387..fd273cb8af1782f559a33599d851571d9d001816 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5272C3=y
 CONFIG_BOOTDELAY=5
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 # CONFIG_CMD_SETEXPR is not set
index e19fe6f6bbd42aa750b58601334ede1fcde3b726..34405c28a08bcb834832dba029290b773250cbbd 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5275EVB=y
 CONFIG_BOOTDELAY=5
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index c3908107bbff9054789825c04260d235325868b1..c26e2ff07c94158a18be648319ec8746b9fcfe9c 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5282EVB=y
 CONFIG_BOOTDELAY=5
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 # CONFIG_CMD_SETEXPR is not set
index 72814301d19b35e94ce2aeca8a32f00987aefc9c..ebd21e1587af2dae4e1ffbda524b6336babb9594 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/mtdblock3 rw rootfstype=jffs2"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
index ab6936617446d39c63d8c0bac6e6df80cc9683e5..f6c22888d12c719ddbec672b660d663021562e86 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="NANDFLASH_SIZE=0"
 CONFIG_BOOTDELAY=1
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 6346c89661f185841155a98db73cbd5c64d880e9..2cad692003ea71ac92eddfa3cf86f85b8c5e3120 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="NANDFLASH_SIZE=16"
 CONFIG_BOOTDELAY=1
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 6dd1d7118310227214f200e11bde38b5521ad80e..0ec9e824dfc452708e2a3119e0d1ce2620ba6cb3 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="NANDFLASH_SIZE=16"
 CONFIG_BOOTDELAY=1
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index ee4dacd38c37bcb485bd6640da7d137cac7b3364..b26c94e060fde780dd2a0b900f2ff7bb2eb6294d 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=192.168.1.1:/tftpboot/192.168.1.2  ip=
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="-> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index efac720b7ac78fa0869a9939879d258c69096d63..cf015333cd2edc259c4f5e2614934d76edd8dc80 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTARGS="root=/dev/mtdblock2 rw rootfstype=jffs2 mtdparts=NAND:1M(u-boot
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="-> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 09419c23abef37b568027946c9eeb7c9d9f00939..bd36aaabe35af9c37b4fc7b85b7ce7cf7793fa5f 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTARGS="root=/dev/mtdblock2 rw rootfstype=jffs2 mtdparts=NAND:1M(u-boot
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="-> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 5da77034a6e55fe59571094138bf461f04147708..2b9e539e710537f45ae831fb006f4dfa7b6a18bc 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTARGS="root=/dev/mtdblock2 rw rootfstype=jffs2 mtdparts=NAND:1M(u-boot
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="-> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 4e8a1139757b189e7d5e23bc225972647b41bb7b..aa2107270309c1e1d2cbb69bb98fdb4e6a88305d 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=192.168.1.1:/tftpboot/192.168.1.2  ip=
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="-> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index ee4dacd38c37bcb485bd6640da7d137cac7b3364..b26c94e060fde780dd2a0b900f2ff7bb2eb6294d 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=192.168.1.1:/tftpboot/192.168.1.2  ip=
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="-> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 82f2dbe096fe69bf672444577dff79ccc6975313..d184bca01174c17930e739a504010778d3c9c643 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:2M(kernel)ro,-(jffs2)"
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 41cfe6821f51eb4c0e79ebe431a67957abd2d1c7..715b2c32a2f23cc1c91c9a4a8552cf6a9507c7d3 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="CF_SBF,SYS_STMICRO_BOOT,SYS_INPUT_CLKSRC=24000000"
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:2M(kernel)ro,-(jffs2)"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 4136482bf557ba1fe8d7d4d7e1100f3567f83a0f..2027481a2be544987bd70aa047e27daf7b24395f 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_ATMEL_BOOT,SYS_INPUT_CLKSRC=66666666"
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:5M(kernel)ro,-(jffs2)"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
index 46261961aa899ff175d937d92c2a59ea074e9071..ce7af8a3c801f3f4729a8c32ddd35a3834859d0c 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:5M(kernel)ro,-(jffs2)"
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
index 691f57c364872816ff058e0894cbd76428ac1751..b0eff24d96f6e8ca71d300b30fc846512b0ac765 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_INTEL_BOOT,SYS_INPUT_CLKSRC=66666666"
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:5M(kernel)ro,-(jffs2)"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
index 35f2dc08d037f75de0b5bf05edf14fc717acc195..279f71684749bdcdeacf33bf85789bd1ef267a11 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_INTEL_BOOT,SYS_INPUT_CLKSRC=33333333"
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:5M(kernel)ro,-(jffs2)"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
index 723692aa8364fd1bc269a7a8532d8e64d62f1534..fd36f22ab7c203b47b2bd09fdcb20853c76d8b79 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_STMICRO_BOOT,CF_SBF,SYS_INPUT_CLKSRC=33333333"
 CONFIG_BOOTDELAY=1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/mtdblock1 rw rootfstype=jffs2 ip=none mtdparts=physmap-flash.0:5M(kernel)ro,-(jffs2)"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
index 8361ae96c7f6c72d2105f030b4c6776054400771..ed8fb2d5920a9fd6eed284656612466361ad15bf 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5475EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=133333333,SYS_BOOTSZ=2,SYS_DRAMSZ=64"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index ce2fafaa2297ae6262f3aefe1ee9e60e92637659..fbf074f05f824e15cc87fe8c6582e47ea5b11edb 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5475EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=133333333,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_NOR1SZ=16"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index b13cf2659d9a0c4114d73884511022f8438120b3..0191d28b52bbf9d49752377f0b6283c651296a71 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5475EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=133333333,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_NOR1SZ=16,SYS_VIDEO,SYS_USBCTRL"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index de269c7afbeb267623091848b431ac1fa01176ad..91358fa340aec0526542401ed11eff11b161e1c6 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5475EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=133333333,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_USBCTRL"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index eb86f49d57a3ce051ba84028457892fee1236e95..c769bef11d87789d2a4bc0cad1ebffbb6b221d69 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5475EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=133333333,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_VIDEO,SYS_USBCTRL"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 757385ff3082de9ecf65f49430dfa109d912e163..0b4fcae1721ad453cab81ddb51ee7d2172e6c8f5 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5475EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=133333333,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_NOR1SZ=32,SYS_VIDEO,SYS_USBCTRL,SYS_DRAMSZ1=64"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index b9a4c3c36134e5366506f5b8abaa4f4dc3398284..902e831ddcfb261c4bd4728e027750c06317b8cf 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5475EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=133333333,SYS_BOOTSZ=4,SYS_DRAMSZ=64"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index f4e7879337aa6fdebdc836ec07be6f59a2be0f94..d0c817f9708da8c216f360eff1f5f870c80c228a 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5485EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=100000000,SYS_BOOTSZ=2,SYS_DRAMSZ=64"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 6774f47f6d01e42da3a4aadb0ef6418543ea8f1e..490a8e791732ad7d1a858ce0c14131f87d3e3cee 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5485EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=100000000,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_NOR1SZ=16"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 164aeb35e822515fee06620278d5e6edee2cc170..273db18de93b660bc25af9a0bbbd4333df0d297e 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5485EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=100000000,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_NOR1SZ=16,SYS_VIDEO,SYS_USBCTRL"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 63f2aafee360d3b51ce10d0eaf4a91b417bdff33..45c54d847936453a85d6020d74d9f185457c81d1 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5485EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=100000000,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_USBCTRL"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 989415a63cd0a426b5c4e9a8e7d2e8c74f35baac..85546ecd0a6d7b9537fd87f2e61e2332f2a4adde 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5485EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=100000000,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_VIDEO,SYS_USBCTRL"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 9d8a37ae6dad5aaf1c6a965df940e8d803ed93eb..0e24d61d199106942e455700bc03d7cf91aeb333 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5485EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=100000000,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_NOR1SZ=32,SYS_VIDEO,SYS_USBCTRL,SYS_DRAMSZ1=64"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 6100c0af753e70532be6bc190f6e86f605c47093..4054f2c0c5d87d92fb3f604bdfaa09c6a3d5aa70 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5485EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=100000000,SYS_BOOTSZ=4,SYS_DRAMSZ=64"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 9ccf26615410fe9adf56eaa5b3054bdb31e299c8..e659cf073d1dd0a6cdb3ddc232723472867dfa4e 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_M5485EVB=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_BUSCLK=100000000,SYS_BOOTSZ=2,SYS_DRAMSZ=64,SYS_NOR1SZ=16,SYS_VIDEO"
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_PROMPT="-> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 19fe2bd6bb726e4357c24f571b50ad829560b29e..ece240917ef4b54030c2e37e25c97b55c5f61cd5 100644 (file)
@@ -48,7 +48,6 @@ CONFIG_AUTOBOOT_DELAY_STR="root"
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADB is not set
index 790b1613a7ffb2a7a7fc029fedab52183ff5a155..14a786a6f4b9371c8305f80f78519118911a5faf 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-mk808c"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index bb124af50583b2899df4bf9bce7b0c7b98d667b7..908d1f42a8596bacc42cfe28fc763d0db135bdb0 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=5
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 6d34907ac66d28bcdcf9c7df7ce8cb4a30176d87..ea9c85633a2ea6c2696d0a715f84a198be947c7a 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_33MHZ"
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
index 8a78efdcb63984dc0719bc0fcf61229b3f9bb211..7eb5afbb7802e18c821701d30417fa922a58ff69 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_66MHZ"
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
index a8ed835e2a2b8347a2ccf76b32dcce5781422e02..016021af268e60923e21a47f038c2f8fa4063028 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_33MHZ"
 CONFIG_BOOTDELAY=6
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
index 88f81b4cf3c772c6b6509b38fca368a21cfef833..42f7b84729f8b33b0d94b4913c891df15f55eea4 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_66MHZ"
 CONFIG_BOOTDELAY=6
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
index 951910443c5fc04c16e0ce97e7dc144c23700fc1..7026be6dbfc27ccea2d0bca66367b5570ce2191e 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
index 3c2fd2e4697695ed65cc1752b6e06330ad0a8197..328c38e571d0f4d5363ce7344dc566059d642a93 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
index e3deec87a36aa67c5cdc0723783b4eef5a965ed8..3fd70be3d7b743737c2a18f48d15bd2b27554c75 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PQ_MDS_PIB=1,PQ_MDS_PIB_ATM=1"
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_SETEXPR is not set
index db36b078a94f46f9d7932ce245c7cc117d56bcf1..fcb9d038f6e55d8eaf0b57e43c5da282f4845605 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PCI_33M,PQ_MDS_PIB=1"
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
index cf0fc32d47388d1b8ad13dffa2253c6f2f4d1f36..ebcb548a79804dbaff2693e8a35c3662415a8130 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PCI_66M,PQ_MDS_PIB=1"
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
index df5af99900b8ba114283b5a36320c4e8672b0c19..feed53555b77e8e2676dacd93cc09a1ccc32e833 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PCISLAVE"
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
index 539e5a31f17d40b80cddc2263f0b45f1f820edec..26984f434bab41254721e9e45647a4fd5cc6b1c0 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_SETEXPR is not set
index 88edf5fcf081139246e6c56240a76492ae64a545..49542ca59c6775570ef2aaf8c323e9f02f7d4947 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_MII=y
index 3b90e15ae057ebc1f7969997f5793b8bdf59f536..319141de1bf3864b2de7045f68f0975fec0d5ad8 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs ip=::::mpc8349emitxgp:eth0:off console=ttyS0,115200"
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="MPC8349E-mITX-GP> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SDRAM=y
index e61dc0aff218c2b76f43a214979031f0ed19240c..0893c4ac026077a3b09adb9e174612e3b40096bf 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs ip=::::mpc8349emitx:eth0:off console=ttyS0,115200"
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="MPC8349E-mITX> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
index 63d8dcad4b44ddbed49ca3c53f0da6f5bc16837f..8a8f05544f2fdd395d51cd842f1e898b70b680d6 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs ip=::::mpc8349emitx:eth0:off console=ttyS0,115200"
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="MPC8349E-mITX> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
index 41e64065203e5127a2821eafeee00af9989c88db..36c2fae71081b1ae02cf95a82db3e09e26a6969d 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 784051630d2d1529d0fa536efcab65d7a8c53f17..b172b928b8db736d47fa826b90dfee5878841f82 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 48dcf7af889a8fa4a61629c568edd336fa1f89b2..14b7a5a8bae3fa3386e67e71e4989053d23f07d9 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 8c4bab2e5aa606ee92a3ec429ef3dff4908918fc..70ffda7b446861a3cdc2125fe0e342b20ee46a88 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 5ee64ccb344a8b981c7fb500ae54c588a841fe5e..328d3c6f78be311ec3670a0aae9fb0fa3a666fb7 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index cd25980b9f8496c7bd1c212c8dc413ed21f87980..02ccb1a8ab1a9743546a0ece5b6bafad90a0cc4b 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index e40208d89a26885afbbad17ba6d9c702f3870d78..d0c48495fb61a8168b77418ab198818a85957211 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index cb3d9d573314c6f467721e5e67916f1c077cabfd..96ea70a2af68b5a232458f50ba334abbbb5cebe4 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_MII=y
index b256b4225c6d6c737ee073000411a9105634d033..4f09a4afe423d80e3cadb28bba0e5d883e2aca36 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_SYS_EXTRA_OPTIONS="LEGACY"
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_MII=y
index 544632987a7612302323f070fc66181ad13038c7..0dc1e0b815ffebcfcd04606068bc09e2fa13bcd6 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index a138e52ce12d97659578739a86d09e30a86b8891..88100005900b4619d05b59b78deb7167aadb55f1 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_DHCP=y
index f49ddbc27f7049d2f8026d309153d47d3a0e7de8..28eb215f60b5731096cc17c4f548e8a0ed7f7010 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_DHCP=y
index 9c1421cdb78358103452c1e8039a9de6fb53d4fb..545d4a262a6b00cfd4a047284af28a00ef50d2ef 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="LEGACY"
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_MII=y
index 7acb94c808c68197464f680c460c5313895bf555..3a2e377a850c25f036e0e8e95f8de265a3375a61 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_MII=y
index ced68d83721ccffe17a47002be23e4de62847bd0..108ba37f1cd0ebb44b5fc2ebea57cddf36063d75 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_SYS_EXTRA_OPTIONS="LEGACY"
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_MII=y
index 63cc392aab83b61618c549165da060ee55c60225..b70feef2f49af76730ebace48c85e236756dcffa 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_DHCP=y
index e5d904432c6e10b1db1d6523d867eb8e666f118c..76822511fe73b4fc2254f043318e09a82a37ac8d 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index b8f87f9554d7bdffc3e1b3824da27e5b15b0fbed..7cd305f3d01012fac8834c3597477ead4b402445 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 1c4ab115c684738f8e18eba9ea1ec0e995aa191d..a7d1b0c732812cf973b4e2b9784431bce8ce10a9 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index 8881713c1c14e056171757fb78606a38030d89b9..ce88d8328e10fb1eaebbcb478af5bdcb180e221c 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
index fde837c0115ba6c87f11c4707595480318b102c5..3ffed30ae208ec545477247de8a458d17bddbb6b 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
@@ -22,5 +23,4 @@ CONFIG_SCSI=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_OF_LIBFDT=y
index 7318e723a8e52763c322bb0bdb4558b7d0d5201f..b8b3e5165c30e31730caf75c133ce9bbf1d676f0 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
@@ -21,5 +22,4 @@ CONFIG_PHYLIB=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_OF_LIBFDT=y
index def36e41712f306f9e99ab99a7b28df38bb3d81c..650141bc469089b09439f8f7332799a924d5aa9f 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
@@ -21,5 +22,4 @@ CONFIG_PHYLIB=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_OF_LIBFDT=y
index 6f23d877ab2b09db2f94391f369f25f589c8cf5e..8220db85effb8f573a6f0de8783220c7453c863c 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-primo73"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index ccdea4a60bac0f57b1d28aa70313223eaf9b4599..d323311951bb4a51fc6779ffc2470b7f740112c8 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828=y
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-primo81"
 # 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_SPL_DOS_PARTITION is not set
index 702592eb8180a2c4dd4e064132e7741139fe31da..8bce411663b9324b05ea47e237f6dab70db5dd51 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-marsboard"
 CONFIG_AHCI=y
 # 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_SPL_DOS_PARTITION is not set
index d908e33e665bea93e88c775b4d5b4982d56ab11c..837a79b5dd45e596f2259ef0407f77c55a6e8752 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_USB2_VBUS_PIN=""
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-mele-a1000g-quad"
 # 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_SPL_DOS_PARTITION is not set
index 206109a3fd3f241d559fa96932ece28f9dd22196..24a4aff478262ba27dc6418f94d95827df7ec024 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 3c337393cf0819dd807ff443dd8ab89bf6ba872f..6467969ec3baa3376f10d5076fa67941efd79cf9 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_USB2_VBUS_PIN=""
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-i7"
 # 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_SPL_DOS_PARTITION is not set
index b50061170ac4c9ade0b0b912e4ca29cfff09e964..ac7bb9f1042ac1152d04d3b2f9ef6fdf2e306d4f 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-m3"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index e7a940d6e5825ce83d572f8f5c15ef3cd07ba37b..84c83dab2ee0210e17274b7bff57db4a5fcfaa2f 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index d3575666bf33e901b1b567b32f20a2ccbb0b15b2..1516107d2eeac4a6fa463ff9d07fea2f5804fff3 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_USB2_VBUS_PIN=""
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-m9"
 # 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_SPL_DOS_PARTITION is not set
index 7bea3e200fa5e3a6a5ea59a9efec23e55efea0a7..819b6a17ac33fdefd0cae4b11ced765b22c403a5 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_USB3_VBUS_PIN="PH5"
 CONFIG_AXP_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="sun9i-a80-optimus"
 CONFIG_SPL=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index e4aef5a336f2dfdc8c5664085c4ab66e79d4edf7..9c254dfc51e060783f0862951ab7c45e4bca4a4c 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 67ae1021371a8494ae11991e3eee2b57bd9edc5c..6b34650740e609ad9e7ca6b30322a30600b04aca 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-mini-xplus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index d05375d0dbd5ea7c063c195943e7cc08aaf27f67..78aa0c732de958669bac250ac04af7ed078011ab 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-r16-nintendo-nes-classic-edition"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_FASTBOOT_FLASH=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
@@ -22,8 +21,3 @@ CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_AXP_ELDO2_VOLT=1800
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=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 6d5d19ce533649b16b604fb91edde2a93d2dfb10..d39cc66d8558714e5551719ae78ed73af46beba2 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index cd7750f6a713b91014efbbeead023d4da80e3543..17f825f241b55114b6b5de8ad4e43860ea8462c4 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 97c5e85f64f37fc4cc6a0955bb242ad69039642e..aa1f78a515f62fbe238123faa0d83e5379b1196c 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index e0626b29648ab3020e004c1b48122f228fe2e8ae..ead503f3d49cba41feb1dab6a9156c7123ca21f4 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index fa07a21ac034cd3b9cc6a76771dfd728490e0b5d..f628fd359daf642520c891aed4cfcff18370a4c6 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 6d8492963ec34f0f6cf8aa2a2cb6336e0969d905..710c2d6e765c78cd3975c04ffb6799a2eef4b259 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 4df6cbac2919e6596faf9a89993e33e3c34d99d9..68a5865b2f675940420263e35e6b4baa6da8d614 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index be3545c30a13b2967826a18ae9a39887ec6fab96..7e52c082224c5eae7c5c2bb70c1c60408dc8c892 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 073323bff5abd49bcfd38c896feb75ba5a4595ae..e7dee2571f5f00b440b876a71e7f8942362b317b 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 7aa6433a4cc5a8442d70e60e4be577ebde574dd9..d0273256fda440d1dbce2f9ee82b833efb148aaa 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 44da2304f8ec65bc0cd65bd287946338b4603dff..a8056caf80548d57cb0b80d886efc68f0c5b1ecd 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index f026bdad18877585cc90a32b6d3851ffc0fe614e..cd82c14912b780177668354f39409035e259f99b 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index efab49ff220d4e8e8ee1f303ce068d2b4e28d34b..d0b6646f6ab9cc308b134e7b8b79d3b5bebd71bf 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 4fc641dde1b3c60add3526a3b272c47d45690a44..8e98aa574fabd4f022b2faf5b41fbb33b42224ad 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index ecf525226fc6ab31cf46a5e2c4878e9f3f46a5ee..bfd6960b90d54ece0a4dff99b5c84c762fabe05c 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 60ba1ac203b4637240abbebd148baf61454f2da0..3691a2b31b6440cf7624319448199b312af2b5bb 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index f57c4f46fec744894750a0080f17b87638425cc9..29d2d3620fbcd071484cd396b2ebb658b78e2ce0 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index c2741fd1591d3b1ccfd6eef34f244ccc615efa02..7299d5b735eecbf023c8afddfe66cd9378c766a7 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index c7920adf8e18dab8f21b524947e1e1e74abd5f33..3824c12df7cc97755cb3c082aedc7452eb3e8781 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 619e54f0fc92cc0e990ef6456bab2dd86fe4c578..4b82ae71a49f99fd113084f5b15d1fc267516c0e 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 6a4154540dd68d27292903a0bf5e93b4bd39bbcd..9f8f01804d1ecb553cc10c388400a1678923a8ea 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 121504d467a643e54feaf9d9218fa9daf493bcc2..3df7461da45b1bbe7e7a39e0aa59b44287084027 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index e5b1e3bbd6fb07d1cbb97863fd327313ea495c2b..744f84c8f4cd719013cfd34ad0dd904d7289b00d 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 7612cc2db5376419c10b2020a3da673c3c3c1339..33ea6cbd8772bdb75f9fcb0d759d57031e60de4e 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index eb72affff8ef9d959e9bba4fe3fa2c0d1abacc6a..55bbbee84623bb95840735a006478d63dd4d5311 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index f1e3a14928d7a93bd4a1e8aeb4b85c58755c9d7e..179a0b5152a7d866a5c05b45d22e1cf2f261be45 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index b67873ef5bedee3e0ba4f0e1c56f50728cd64eed..6a7c9e26f97d93b8b348a2f957f1fad900484f75 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index a60c65490beeeee734fa36cb1a7da40ea2bf0dd7..b8e3ccd6d0d2f336e790710042f04fb3b3141214 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 2b22ab523a888be6f666bd46649fcacad54e2d22..b674798dbad9a5c587614fad9b0f98ad87e3101d 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 15a98be54e7194ba8e78b35606af3636ff8d760d..15aeec9407eb606ff021109078b991b9bc2cf023 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index fc852bdf8386b19be755cd38159a03cc8a45963e..734cca375a74b0158adc69b6bc0acbcd55517585 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_NAND is not set
index a0e5bb35932ee73156ba5f907d25c6b135f3bb9b..f8aaa2e0df4341044cb64a6f41204d0843d61f12 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_NAND is not set
index e9de40830e0b6e426ecd46b32ab8c346ccdaadbc..47b73cfed9587cd2049aafa60616da9f480db0fb 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_NAND is not set
index 7344dffb5710e2a0a97a53e134a71d250913b7d4..b874acdd286491368706a360cb293b21b90fca1c 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_NAND is not set
index cff7f598d92481b8e0a700f72d8d75fc1319a418..dff899efcfa29a5bb49e2c6ed22396d15432dcaa 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 65b1a27d11a80dff1d1a58d33c81716293047e96..5c146092fdfde9a2fbfe7484984a3e00573e0d8b 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 05e4dca0251faff4e658de8fff677d185956b5d9..6a5c1f9a90162b304e803676d136b26693c86a24 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 4cd265b065b38b25d08ad28178fc51a53f343937..058150756e13d555893ff96d2ae0619883ff58e2 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 2dfb76272c4b6cb9afd8a80b2e147ca242665375..7f05cea7046884756895e97b52cd115bff04ac83 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index aea0ab49ffe209ba71f008faeae3fc748e1aa381..eb9d9a8491daff177208737644a0e8586130e33f 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 4722fd65feef488fc37b987d1aed0bf4fbd1bd4d..256b71435239a871eee8dd3e1690df52b64f3995 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index cc7ba55b57019d889b69ff29fdd56801369eba1d..e39ad20bc0bb10181b013bf5ef5c7ba883547c2c 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index ee0fdb0946cd20b28684411899da81ac04836d6a..96ad965213e4d95369ddf8cf7cfbac5cf502ddf7 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 16cdf8e6b11c80abd77be5453d39fb330d4e0094..925363185cac20b025fbfc07bb5e06d133bc28e9 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 031afa4bd633618e31062f0b06e21d8abfd0ae1e..4912860b84c40eb78915f8cd60f091e3bbba0f3b 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index d2d8d91cb0fb296e746fae1b51bd02b72e94500b..0062ca0e0d185381b15fb95d93935f042f850843 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index e2fc46ac72786a2ebb9d3d92b52136fd098d0e5f..782bce4a24faf7aed7fd0f153dd6aa9cbf2e6c9c 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_NAND is not set
index ab3b97631ff7817392b3c11f4178978dfdc49923..5e97cc46479adc4b8b358c5bfe1b0b24e3a2980f 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_NAND is not set
index 6d23d4122e6d78ae9ab398491fd2a5d747a1ecb6..564686f09d55757a62d5f643ac55325bb94b2df6 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_NAND is not set
index bbc0631a1c035715ca6e49d3067a10dc0b8d2162..c5027da3c59ffad0196931618f89b506d4999699 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_NAND is not set
index e7e0ae003ef104b5d7b83c883bd201f18e2dd792..fb8398fa67dd206044b8e8496e2e62072d365d8d 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 72973f726d7f4149ffb48667bdad211240592600..1012cb56afd843b67c155bf2553747c1108908f4 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 7a0bfb0762a992ae1b88213d25601d6baf1236c0..92699c04b34611ba8bf3482cf5cd0d438015edea 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 3528db51b5819f4f8506d28f59120cd97dd1aead..0b6c851051a40638b3c9b3e65935e2f11e701dd5 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 0e80cf3468ad3ad08c12f39ddd8976e86eb5ccc6..f91c23c88ac23fc7027f282b0aa8eac0da461a58 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index f8899b232b45ccddbb85ed38c3966836eb8bcdfb..53caa4286bc8beecb7808da8e5b74eb1543911a3 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index e7408c23bafd5647b110cc023a6f47aa3614b850..45a7c203e8649795749fda4b3cf5e383440d2f3b 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 1648ad694fc3e9a2dd37bf763a4204e20d3d87b7..8faa1d490702554331417f60752cd66a0e5969cc 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 7cd4ebb8f95c4aa2a65c0ebd68144c0cf6fe18aa..8639cdb64fa45ee8930ffe92c8541c4e1e330033 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 5e510b9dc9e989ca8254ee4ed9e3d8bb1ca5f85e..e42b3ca834705e3cd6b8574d90224bba67cf8511 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index ec39ffbf2fb0b33164f4adc569e236ed08ba926b..8b631805bb12af93a57ae885e82f635467b1f762 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index d2922f3fde4c6fbf4e6de66d70cd478d67703a5c..569d92168aae53c9dbfd8b432135f837dcbb208c 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 27cf431fa7faaed5d1d63ac248e635975b79e428..b133911fec79da0301fe6d1ba485b7bec144bcaf 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 198968e0e7c908080c8d9e62a33cebbc8478523f..73aca67ac3d688104eb8bc253147be112ebac0d2 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 619b7ca5734f725a97c55b1a95cddaaca8696f4a..49f14133619d692d01151fa5c25090421eb5cb89 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 4b1b4c3389ef11c2fe19900b0dcc1421cfd97c24..d6f8a191c195184904542ccb4321a53e305a10d9 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 58bc67f3b1c99b9c847e6bffde47f5b5ecb9c00d..bfe84a98fbe48dcb547d7cf53e95e913c0144663 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_BOOTDELAY=-1
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_EEPROM is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
index 00ede85381a0aeeec519587afc422fd737674feb..a31019279626520b3d1b58d54cf09470e13f7640 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index a6eb7b85a9d11b193ae8cb56c8676f994c1b8d7e..474ca1d68790a592dfedf8e87571ad905d7b0d3e 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 0c7c326252b546ccb3cb17149ea8ea468965c728..0bf2c361e36a71ec03336574e361c7b9efa312cf 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 229604a60f5f676f662d6c0be3ed986607c42e5c..4f64c7e726375b542d3cfbefb9112eafe3c468f7 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index a2179470d621d0234fcd3f95a3a7b69db7a0f41d..aaa722849b255df851dc5781fbbbc65503dc5c67 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 1dabd6a5e44ed6c4084f7db7aed953d366533053..de6a9045bc9597354ff98b584743dc159a6bdfea 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 31f300e6f0103a5ff1276f37667309562728d964..2ddcef93beca48382a426b0e897d758ced060cd4 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 93801f0dcdc426cbc898cb3332306ae6c3748d88..8049e0ad62cf792c61f745aec9c6a3647203bbc9 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 63dc30508e2ee4258e1fb64950288671829b7620..3e1c62dc4099f15d1f9a9008fd4ae61306dc4eeb 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index c35c988855cfbf5b3bed04a84f81060576068ad7..91ab8b8a08946635228cd065e3d84cb6a3f75f59 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 3e33eae34f4d28dd660e8f2e3f8447f7119ddde6..aff79ecf2167f5429b3c3608fae6cf17235a331f 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 5ba0ff9b4f7b6573b05226ef23e3275b9abebb18..ceea0839ecd0864bdb6abc8ac3d7c82524430011 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 482b092528f0a049e7db571976dc41b8454cdb3a..f739dfc7306f98d25d658587102deee48b5cf5aa 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 1e074bcf494a5bc9d22dbbbe656babb03e57e9ac..37c9c04edd903582a5db8c7b36a68787b3792e6d 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 74555f9d9d5639bd52790315628e9907662bf6c6..1ba4dfded4a0ea1028f1fb9a932ccf2e43d70749 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_TPL_NAND_SUPPORT=y
 CONFIG_TPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 4646895edba036269354549f17853460a79cabce..4481c681c1c3bd6ecaf5ebb6aa0e41a2a26e4120 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 4f8a4aac8d6eab8448d15b0e846a0f774fafa3a8..12ee717f77c2551dc4e05fbab5971ec55cf6c202 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index b32dc629c7545173f4dbccce6f8f89c425372b7e..9af24cf4be660cbc7e316430a0e9416c4a91b445 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
index 64484b5ef9773b152f4268a91eba16baa2b0385a..43c26bd6be1c70daa8d30b99e285b812df1e07c9 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index a6e6066deb4ae2983537efa740ba8b8964b8907d..40f4e9fa369bc10d589af1d58ff9728b085f2d6a 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SDCARD,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 386c1b8c6ebcd15817d44c1125b20b801483966f..a63df614e2f1cfe22768a87e8aac4c0862b22d50 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index f1afc7767f26f0cb8e86475707d19de9ca053421..da963b3bc46b3d1f5f885c0545684a1202148dea 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 20333cd1744858671dddc9d602c8bec7ec6c7075..d5e958caec468894f95a22b566590b8e6172fadf 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 5f5b89865f1cfc63864757c42034b5b6ca610aa2..e693adcc4b8c521fa712d544d5afa540821fcf8c 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 0139522f8e136a378c64e8967817dc80cb621af0..f4f22ce8ca79fcbbe75998ac35d67542b204dd5e 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index eaad8aa11aec073f8e6e9baef37531f117a3d15e..60d74f169e0eb00134173857ee4c368a0adc69fe 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index fda997c9a4df7418aaf3cc4babfb396a06d5185c..09b17b5ce6ca5e43aecc9373bd8642516341a7b7 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SDCARD,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5bf425f728af0e4ae8feb154c3ed18cd3a46cf63..7befcb04b92844243b1a8a64ca82c020b4ee7309 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 1de4fe142502621baa67099d8bc3d338f13c349b..31ffc1c6c579db527ef0d95c0ea158a1258c3864 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index eaad4abe0c554494ade2f08ef240e6ffba85429a..8a66ba786b46b5adbb5b074266ad8122030011b0 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 823dfe392f51b1726fe849d267a402d6b595cddb..2f28f24001764e9ef6d80dd7251ff8c11ad6e0ee 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e5b0273a40b786adfa1ef6dfca0441e63153995f..b176f0551fac877fddd00fb9e890b76ac1f072a3 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SDCARD,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 97f05b5394095b2df17378d3a77c36067afd2a6f..125712a39b84f9799dc87b944000d37b76546dc6 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 780a36fe60f559c6d6a31614d1a3586623b1f015..55b95245407df303684dc6c96fd647c6bd185838 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 117e2f6ee626c17aefd5cf5d2659cf607467d2c9..fa4e6be1ffb80dc5c75802365fe3178518cdad54 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index be70a3601ce0f0ab79c8961e65e29279ec5b0e66..b89ba5bf9db4236b53c217a6e02957fc6af8ea7d 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 40924af48a3d78ca3e8c53afcb228b9647555714..37b92231640a61caeffc223fd4b8fc3829b6a0f0 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index b5f9ec4e3563b03b051fe772cdd697e3d52b6c26..9e40e1b7134553dd8ae579f146e65bfdae52d631 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index d7dfd16b570536109f93fe2095719ddd74d7252b..4e0fabd8396f9d15e82b20562b5e90e6d00242b7 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SDCARD,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 20bad18876d37180235b69bf0b4c5f1fde66603f..52aafe9b18b9e67da2d51c610904e467c004bed1 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 97511d839a04154e528306ab80e7ee690b5c850c..b52c41f678349e955e7e795d050fa10fad05a98a 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index ba75e95f7f235266f733d91b7330f16f5a49dcb6..ab04c2417e1a6f9988052e7dc593903ff9b95a3f 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index a9e9cfe35fb3e0f61e538e86435b8202b312e72d..04d97daf48a5d5921707ec92b2dd9c43fa5a5870 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 3b7934c0e621b1154d95615d8ec9a271137a9d51..eac9a7591835f15467cf594cf97b7749d89edcea 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index eef6e5542ad6675931eb3255eb03412356f3e417..d73fe8b624a49b1a98fef82404a615500c2ada66 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index be18f60f23092656b13741a9ac4133b22480d094..75cdd18da3e1009e2fbce08a9d8baa951e882aa6 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SDCARD,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 814a9a2ee7107047bbf4777f2693ab175ee71efc..9ccb18bb4d295b41cf7766213f5ef5e9a1eec81f 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index d42bd4c8f2f3d47694f02104e3a294f395d0cf51..cf35c255539ef7162666bc5109c2665edfc35894 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 4cfca6f61d34df6d1ef8f40bf043709d135895ab..7c94ecb322cb08daffa6bd946d892e71762cf0bd 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 0cb8c13fde5befa40a4dcb2f96fbdea07d9d260d..141fb484522e650fd92583b17525ed2d06b0569e 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_USB2_VBUS_PIN=""
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-sina31s"
 # 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_SPL_DOS_PARTITION is not set
index af00e5434763661132da51fecd80c957563600b2..7818e3cf79755c8fbb422b770acaa778d3109427 100644 (file)
@@ -15,8 +15,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-sinlinx-sina33"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_FASTBOOT_FLASH=y
-CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -27,8 +25,3 @@ CONFIG_DFU_RAM=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=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 43ae6cade3f845db257c160b89b6da0ae0c4e3c3..3338b64e03075c0ab89342b4af2f41cdcaeedd51 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-bananapi-m2-plus"
 # 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_SPL_DOS_PARTITION is not set
index feec46e9b9cacbb0d3130c1f59825acf37e54e7f..f745d6f84a155f07cc4a9f205f7461b0edc6734e 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_USB2_VBUS_PIN=""
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-sinovoip-bpi-m2"
 # 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_SPL_DOS_PARTITION is not set
index 04d81693ebd8f1283429d31bf0bbf071942a93ae..60aea1eb3d22cd6109cfe499f36744be04121003 100644 (file)
@@ -13,11 +13,10 @@ CONFIG_USB0_ID_DET="PH11"
 CONFIG_USB1_VBUS_PIN="PD24"
 CONFIG_AXP_GPIO=y
 CONFIG_SATAPWR="PD25"
-CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-sinovoip-bpi-m3"
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-bananapi-m3"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 2284bd31a30a1930b7c4ee832d42597ca95340a5..3cf3e42f1b56a3fc6a614aeaba17ad89324368a4 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_USB3_VBUS_PIN="PL8"
 CONFIG_DEFAULT_DEVICE_TREE="sun9i-a80-cx-a99"
 # 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_SPL_DOS_PARTITION is not set
index 7d2ae4d011cbbfbeb429c267ea87c049b501846b..e63c9d348ac5e2bbdddb7a2ebf980fa50f474018 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
index de61b589856ec5f6fbbdfddb91ebc285404aff2a..4c724dc0347c4dc3ee2fe7b5ca1b84b9608e4936 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
index 0c81e91e8438e103c049346507752b6045a09f9f..6fdebcfee2ea55a9a6ae07928c19b91cb32ad3fa 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
index 82dba0b3ee4ca80c5803f60564977c3a63b50ff1..97fcb7cd2ec3d9786398073df62702786b27d230 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
index ce0df6651b74cec329c2835f6f9bf3c339af58ec..7be10787f890034aade8d1fa72ce987b67621b85 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
index 8ec02060da8d68f9533ec276f87e09be0eb60927..999605ba6fd92c4fc3202d84e9cc01e22d4edc6a 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index bd71f9093521b020301ce697c08de98edc9f1457..e39f3dc023b3c50f89e40026ddc0daaf6e2aa182 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 16d35b2f680c41a43a5b080ef780d82f64d15ab7..b0fc859bb157543c3ea42a57649cc79ee532f714 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index d1fc51eb3ca0ebf3b178beb47f3d3a2f2327e536..1f8318b98f6317ffc3fa74161dac769304672eee 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 20b1e3d7b54b0b9f74d90e0e38acf83fe94ff8f0..c90d764fa9f801fbe713c445dabb74d434b66af9 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c2470800cebdd12dacf37db111abcfbfea954764..ed858badeaf838e24ae7d9c417e392dd4c9a3aaf 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index aee3c9238b3a3d310cbd342c1e4f95b8ba7f6222..8bc97450a2a93aeac7c6c013c5f198a06528967f 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 979dbce6bfed10a61ae70d7e7b15224ccd7b25d9..21c7af3fa24419d3c705c47027118f8bf9775cff 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
index 468a1bf5d0c63bb54f21f682ffc7b97705189954..8d27b30a47f1173ebca93b8d70d1f1d0b7c61a4c 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
index 0daabfcd19c1a8bfa48883fd34607ad08f986508..a960e0ec8f9cd4787b690fe72e85766a5ea23784 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
index 5b6bacb333731948d3a5c1bc3f8a50cdb7b6f3a5..6027bcf7cd3e1beed2a67e3cbc065b753230e1c8 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
index 5ba4fac8a3b4bcf81326d03af214acd2baff719a..67f54b740752d1b70208999c71da77245f832100 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
index f5229c6143ae3137a320bc381014fc6356577a51..45f17693c45cdbca84c7e016c8d4cc9a8492a1d7 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e9ad05af191b41b7216c12ea9400b2872d10992b..5cca1d30936b7eceafbee520cc6e4ca27552c1d8 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 91bc7a0587cbbcb18bec40cc6fa5b861f972d4e0..e36d88d4e3adac338eb1f2028271672f4762db5c 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 6d9ed8af191c891920b206d7712108f933d96d88..540b924cfc5ed737d3232442fb28b40a800ab309 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e67757c75adc3d18f133fd2d7b0377eeb6b47efb..690fb2fa2a14a06fbcf415d2ff3dacb2bdc85753 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 4506cd5acde0dca5e45528d757924cbbb62c63ce..7d66bd7a38b750378c498f58886b760a11cb0e21 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9910f24ff4845bc0915fba63d4978234993424bf..7bf27de587795de0d03ada0c594187c4f8152ec3 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 39e3018d6e7fa2a9557358dcf0322314a48d553b..25733bb416bece79c8ce31c4997182f12a910173 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index ca65c190a19382dbc6bb3c1879c5dabad4882bf2..b7be2d6d53d8961b866debda772868026dbaa98b 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 7ff52d299218fb5ff186e735b58f3fa672f43f5b..816b794344eb1c2aed8697bcb1e288cc639e691d 100644 (file)
@@ -20,6 +20,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index f6cf68fa94f790a6ed497d298fff092793fb6f2c..f483841c7a213c6d4dae2624170ee9718a340764 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 8c0f1d11b79685e40f7068dba0b1cb7655f2e603..f471f33832435d450819a0f00b50ba357296b041 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 3f19a7ed33253c17fd85f85a2d34a8bcce77dc05..99c46ac5709e2d2f9326f07db9ac957e7fadafab 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index dd4d748ce84592be69d5caa4301fd0cb8d3066e4..b9ab9a1d830d8517d903f154ac47435b2008a821 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9593d27cee87ca1f0d88a9a3ce09b6f760449473..9d2ee980ff4512282cb1236a7c68cbadbbd4bd55 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 1692b47fa59b87ca2064af1b0c2afdd67a0b9695..90a87007c31ee9d28a149df76b925121795fbfe6 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 316e14fe4bdaf31651ce8bf8d9ca91e0cb482eb2..5c6afcf9f9fa3e40faca0e257d770a3480d93bd0 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index d69c5910c04b33f7b1482eb0a8f40e67ea12d894..9861b1eeebeb2181dce20bfa1fedeb0e1dfbc612 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 3a8e7e7b9d563c47cd1a1e4b48fdda44cc79c194..a37d0dfceee20f1cbdb0a42ded94078afead354b 100644 (file)
@@ -25,6 +25,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9489972cfa6b708a5a4dd6c979cc881bc10935df..f8684e5c7c3428069e08e1f4727b58eecbc14c24 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5b678ed185ef081cceff35014f37133d37e24079..0ea2653ca3a676e82703a0f96d1c1b9af01d83f3 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index fd6bc4e9f702f0cd819673b028337aac214d5183..7158fa22f8b0fcc7842b89dea68ffecfaef1ee96 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9ab594c173e3f9a228d7f2cd57c74dbea6740dc0..33fa70af67fd2f55a6b3c7e85ae5a3b539426e0d 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index b43bfdd7d36f34df7ae6065778e4d5773b15ff3c..c561a43c8e230e837b1e1804140b7cb306e990c8 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index b103c43f3eaf6a2836c3ac1dccc13a05251f65c7..1436dc3c06bc74ae55823e344263b6744be4f8ac 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 671eacc050fdda2eda7581e68115292eda522792..8e93a150e64169a9a4ff002d62a01442c7f47316 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index faa43d3dbce4a459f91c1c6976b07871f64639cc..ba5658a0ece07c958554553627247e88f4525c8f 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5b341aa5d269321456ab7b7852ccf7f9f202a428..75f4ee1e6503a7382cfb461ccf7af70cb23ceb53 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c8a8095a31938ea41603482f18ebe0ab4e681e4b..1f856dbb9524ae3cd7a179c85cf5142d3c7c9e0e 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 51fc4f32c9b47787d347248356e9e5f307551c02..24794503954a299c767302837d46806c08604f18 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 985e98ae4be0f8a50a851f0577787f2847e277dc..c150c0f571abe1c5c7000be309bc36aca4910a33 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 72bfa0291417fafe59416c6c89e8aa4662f0fa4a..3221afbeb9cd3bb52962d3e48de90907d36770cd 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 2aee843342acde7f743efea3c131a33e65a4918c..a0ac48387b84c6ffbdede1be7f985afbfeeb775b 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index ec6f975ab1b41c1a38bd7d42025dd822696ee14e..76a0e3ae6e5048a62dc9f31d516c52910efe8b35 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 1186cc0b81f98aef793cfba163febad94c67d412..f4432b58487226bbae753e54aa0401b6edb4fc3f 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 7475af761a4bb69d852bfe3a981be282b02c58a5..073f4474b58293ca6cf8319b6e2c9b658db43c1d 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 58d16c67fb48484cbd7fe277fc34c86a8e29a330..127437a1d70a6b4e88c12922519015c6dc6d8f33 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 6a261afe85b04a22d62224da86ba1035bceccc34..1eb481702eec5f43dd247a37c9b17a3f94b37f22 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 2edd4174399ffe90c175fd6a5063f9de22603d95..add57d93508ddd2a7ffb666211e2679e595da64b 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index dee4b901a67d91af7e58ad492a0fa5a2070cd4f4..ece9c320a578e7ac7f5da176561cd71d7d898f5c 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 89147b7a6cf1b2d925931b15e31185378226ffad..8b1f6e406f398b07ce742469d292d19de9a766df 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 70c395944cead7093a1ae71f1f840796f0bfbdb3..e3dea0e25c8fdab5546d80110a04e1a16e8b4b06 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9b49c3d6ab2052d1d819902e7fdefc002a0e2695..ba1dfbc3854d7feb8e04c5fac2223a67e80d06cb 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e4b0912d8764c7497e5f82c237638bd3bbec2dc0..54222783937bf075bc4f279b6bd9c9844096966e 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 1d13bcfce30875addbf7b7a61dfd865c941fce33..8462ff5a9a71b7054403b6d55b1bdb085e5fd6c0 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index a9df2ad32290981e0f6f3c62143b76918f615335..c069cf5051fb4e570733d4b5321898faab21873e 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 11424912adce4187497b7becac764cf9727c54ef..cb5359ad9e7ca7736352b1fd453ec3571de07306 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 8552b81ee3d58b4d3b48a755a9d13af8d5c2eff1..cd03973fdf8d0574e338d43a2b0cca4e2858616a 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 6f0fcf261bacede6055d6e51caa07f562e113be8..95ca2a8609b9de70132ed78ef863541c4acf49d3 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 367ca863847c165edb731f3439a34e654f57eb8e..ff27ff5b80c3bb2d3d26ce4e83cdbbd86c010594 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 43320b5f4e06ecc064b574a11cb19e88273e9e6a..29c54899cb81cf7056d65d22f9d3292cd6c07ab8 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF40000"
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index d4d2cafff28042b5a1cd79477da55d77b481b3df..4dc8ccd63e40973cc1ac130d8c829bf955784904 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 18364a661a04f50489e403e6db6f61419bd66f66..4ac62752f353a71306ff19097a08498da9a71a0b 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e90208043ff35ed8a4b83abb976e53d805587269..efd6f78e645dc9e48a042d80b8cae68ddf7f5fc6 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index fe7819e5a0a9718967de29300c3bf88a4a126e4f..6351a7793defdfd0059035d90c57837aa24db458 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
index db60380fffc4dbc67c08ce0bbdb3921e4eac1e12..061760c7d4c7e231e636e9461623720876af6168 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_SYS_EXTRA_OPTIONS="TWR_P1025"
 CONFIG_BOOTDELAY=10
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 968186ffda0c84caff95566aed35ed1bc6694063..c8f22620a0900c32b620ba31309759a9be799ba9 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5feae26e66a8a1f881151e7041ce9678458dbacd..0092e99283182dd91a4df742f81c4f2c2abf3464 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_SYS_PROMPT="B$ "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index dcfd570f58eda459f1990f24c6a0b6787c68b6f4..9db69faede0a5a99e3e247e85a97d5dc16d44f89 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-utoo-p66"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 3f04c3982e5202d8d24d37105efb35e6b26a7025..f6da496d3761b0ffe1685beb6dbd26753c2b3b77 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-wexler-tab7200"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index cfc051fb3d70dfdb8d5dc2bf49ed253650f9e14d..2e96ba2a526437dc8a8c071bc27982ee9ba5e09c 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index e1746fbe0219388b3a1943cac2b59050726e2b62..69ab0d36dc59d95f07076931412238aea284a5c0 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a10s-wobo-i5"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 2d57784b2d2bc36da4cbec16616849d36c52b10f..dcdb51a396eacc5016d2a6976902ce02d2fdf03c 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-yones-toptech-bd1078"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 99481c951d7ccbbd8dbbbfb9772b97c78fd53684..bfbb38407095f2950797976b3b29fec810c746bd 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_PANEL_LVDS=y
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-yones-toptech-bs1078-v2"
 # 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_SPL_DOS_PARTITION is not set
index b5e5154febcc89a725ce3f3c13cfaea805d1974c..63a0048702f33ca6365d40be6ff7f48dd3776bb1 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-olinuxino"
 # 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_SPL_DOS_PARTITION is not set
index c1053958c47660c0f613b7e723fe9a53184bda5a..a3a40bf1e9b05413e97f038148cbb484d0ed4893 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_DEFAULT_DEVICE_TREE="ae3xx"
 CONFIG_FIT=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_PROMPT="NDS32 # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
index ced042e49f50f7059651e963412f02e52a6cf2b4..5cf2d265525a592a4ee30b2d81a4556344ac1efb 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_DEFAULT_DEVICE_TREE="ag101p"
 CONFIG_FIT=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_PROMPT="NDS32 # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
index b191564e9607f79125f4afa886fdd9bf3b6207bf..bf51e5388ccaf48a80c9420026f41fd9e0369307 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index eb8338f0f10d40d2a317fadb29fd7caa9eeedac6..35a9a1b7e8ccafe87914e970b3e12ec1b3f47232 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -18,7 +17,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MTD_SUPPORT=y
@@ -26,7 +24,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
@@ -59,9 +56,11 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0403
+CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
-CONFIG_G_DNL_VENDOR_NUM=0x0403
-CONFIG_G_DNL_PRODUCT_NUM=0xbd00
+CONFIG_USB_ETHER=y
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index b8526fc15ed3fe4567474bf799daa3ade48af3e4..55e0ebd69cd62063eddbb6de1f37634b63352512 100644 (file)
@@ -3,14 +3,12 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_AM33XX=y
 # CONFIG_SPL_NAND_SUPPORT is not set
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_AUTOBOOT_KEYED=y
@@ -18,8 +16,6 @@ CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
 CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -38,10 +34,11 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
 CONFIG_OF_LIBFDT_OVERLAY=y
index 0a239bb73399175569143388ef5487aaa168c6a7..fe5b9e76223487dde3528e70a8794eca6514fa26 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_AM33XX=y
 # CONFIG_SPL_NAND_SUPPORT is not set
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DEFAULT_DEVICE_TREE="am335x-boneblack"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT_SIGNATURE=y
@@ -13,7 +12,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_AUTOBOOT_KEYED=y
@@ -21,8 +19,6 @@ CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
 CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -48,8 +44,8 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_LZO=y
index 00c1af43449d74442feed23241b860375118035a..3e68dbdc45f409d6845c6a3535a587434b26c662 100644 (file)
@@ -2,7 +2,6 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_AM33XX=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SPL_LOAD_FIT=y
@@ -10,13 +9,10 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00080000
 # CONFIG_CMD_FLASH is not set
@@ -50,10 +46,10 @@ CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_TI=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_RSA=y
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT_OVERLAY=y
index 9f08edff4ca50da7f852e0d11f9e6bbfdb7fcd9c..6842bdb3fe9dad98dc45da433720c295f0f780ec 100644 (file)
@@ -3,19 +3,15 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_AM33XX=y
 CONFIG_NOR=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00080000
 CONFIG_CMD_NAND=y
@@ -37,10 +33,10 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
 CONFIG_OF_LIBFDT_OVERLAY=y
index c5e7425a7797e5d0adcf335ff94bd6e1b7ac50e3..ee1b1934b5372d9c6d43b6de9de409a2cfed0f43 100644 (file)
@@ -12,8 +12,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_FLASH=y
@@ -31,10 +29,11 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
 CONFIG_OF_LIBFDT_OVERLAY=y
index 501fb2b90f4d619515451c9cd154db915723b267..1170e50e7f4377d5fd371b1f6ca83ee7197efe7b 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_AM33XX=y
 # CONFIG_SPL_NAND_SUPPORT is not set
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="SPI_BOOT"
 CONFIG_SPI_BOOT=y
@@ -13,11 +12,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_MTDPARTS=y
@@ -35,10 +31,10 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
 CONFIG_OF_LIBFDT_OVERLAY=y
index 7c351382d96c1b5bff93b5eef34feaf75a92d20b..5fa3a11f70607d7cbbf0d9d89a0f0ef883ee682c 100644 (file)
@@ -3,14 +3,12 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_AM33XX=y
 # CONFIG_SPL_NAND_SUPPORT is not set
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_NET_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -18,8 +16,6 @@ CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_SPL_USBETH_SUPPORT=y
 # CONFIG_SPL_YMODEM_SUPPORT is not set
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00080000
 # CONFIG_CMD_FLASH is not set
@@ -41,10 +37,10 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
 CONFIG_OF_LIBFDT_OVERLAY=y
index acdd56b43558c04e7a90348d90e32567dd7b1726..6b7f446c56c1337cef8305000ebd976cc2c21333 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_AM33XX=y
 CONFIG_TI_SECURE_DEVICE=y
 CONFIG_ISW_ENTRY_ADDR=0x40300350
 # CONFIG_SPL_NAND_SUPPORT is not set
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_ANDROID_BOOT_IMAGE=y
@@ -16,12 +15,10 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 # CONFIG_SPL_ENV_SUPPORT is not set
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
 # CONFIG_SPL_YMODEM_SUPPORT is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
@@ -54,9 +51,10 @@ CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_TI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
-CONFIG_G_DNL_VENDOR_NUM=0x0451
-CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_RSA=y
 CONFIG_LZO=y
diff --git a/configs/am335x_hs_evm_uart_defconfig b/configs/am335x_hs_evm_uart_defconfig
new file mode 100644 (file)
index 0000000..59c7bb0
--- /dev/null
@@ -0,0 +1,66 @@
+CONFIG_ARM=y
+CONFIG_ARCH_OMAP2PLUS=y
+CONFIG_TI_COMMON_CMD_OPTIONS=y
+CONFIG_AM33XX=y
+# CONFIG_SPL_FAT_SUPPORT is not set
+# CONFIG_SPL_LIBDISK_SUPPORT is not set
+# CONFIG_SPL_MMC_SUPPORT is not set
+# CONFIG_SPL_NAND_SUPPORT is not set
+CONFIG_TI_SECURE_DEVICE=y
+CONFIG_ISW_ENTRY_ADDR=0x40301950
+CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT_IMAGE_POST_PROCESS=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_ARCH_MISC_INIT=y
+CONFIG_SPL=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_STACK_R=y
+# CONFIG_SPL_ENV_SUPPORT is not set
+# CONFIG_SPL_EXT_SUPPORT is not set
+CONFIG_SPL_MTD_SUPPORT=y
+# CONFIG_SPL_YMODEM_SUPPORT is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_NAND=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_MTDPARTS=y
+# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_OF_CONTROL=y
+CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2"
+# CONFIG_BLK is not set
+CONFIG_DFU_MMC=y
+CONFIG_DFU_NAND=y
+CONFIG_DFU_RAM=y
+CONFIG_DM_I2C=y
+CONFIG_MISC=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_OMAP_HS=y
+CONFIG_NAND=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_PHYLIB=y
+CONFIG_DM_ETH=y
+CONFIG_PHY_GIGE=y
+CONFIG_SYS_NS16550=y
+CONFIG_OMAP3_SPI=y
+CONFIG_TIMER=y
+CONFIG_OMAP_TIMER=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_MUSB_HOST=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_MUSB_TI=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_USE_TINY_PRINTF=y
+CONFIG_RSA=y
+CONFIG_LZO=y
+CONFIG_OF_LIBFDT_OVERLAY=y
index 1b03c334b4a49a81ca3993aa317b0500032a4103..a4d22fb58a1d82415c7803f2793dc13c5f3eac04 100644 (file)
@@ -11,14 +11,12 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="MACH_TYPE=MACH_TYPE_IGEP0033"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MTD_SUPPORT=y
@@ -27,7 +25,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
index c63e388ff51cd552b670242a14b4dfa23214630e..0906b668b4c3d7ffb1e9c56b989e741598c77880 100644 (file)
@@ -9,13 +9,11 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SERIES=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -27,7 +25,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter 'shc' to enter prompt (times out) %d \nEnter 'noautoboot' to enter prompt without timeout\n"
 CONFIG_AUTOBOOT_DELAY_STR="shc"
 CONFIG_AUTOBOOT_STOP_STR="noautoboot"
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 1bcf683e35e65633de7302015a30c3a6a4363e68..59b465d4aeeec8dcc8c2ac5c20d069c26cf02898 100644 (file)
@@ -9,14 +9,12 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SHC_ICT=y
 CONFIG_SERIES=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -27,7 +25,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter 'shc' to enter prompt (times out) %d \nEnter 'noautoboot' to enter prompt without timeout\n"
 CONFIG_AUTOBOOT_DELAY_STR="shc"
 CONFIG_AUTOBOOT_STOP_STR="noautoboot"
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 9528a8cd5cc46acfcadee4d3df8c19996014b532..7447895e3135d66b39ebee7a07d687a4b70c45ea 100644 (file)
@@ -9,14 +9,12 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SHC_NETBOOT=y
 CONFIG_SERIES=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
@@ -28,7 +26,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter 'shc' to enter prompt (times out) %d \nEnter 'noautoboot' to enter prompt without timeout\n"
 CONFIG_AUTOBOOT_DELAY_STR="shc"
 CONFIG_AUTOBOOT_STOP_STR="noautoboot"
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 8519282ecf80841af36a3f2296925dc8a45b82d6..94382faaab06811934e6f01839e3a8b4e2085519 100644 (file)
@@ -9,13 +9,11 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SERIES=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -25,7 +23,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter 'shc' to enter prompt (times out) %d \nEnter 'noautoboot' to enter prompt without timeout\n"
 CONFIG_AUTOBOOT_DELAY_STR="shc"
 CONFIG_AUTOBOOT_STOP_STR="noautoboot"
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index b00d6f6b226b171c681315ff2ea0a5cb46879eb1..8c90175393de419c3e42c779062497df05fc31e3 100644 (file)
@@ -9,14 +9,12 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SHC_SDBOOT=y
 CONFIG_SERIES=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -27,7 +25,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter 'shc' to enter prompt (times out) %d \nEnter 'noautoboot' to enter prompt without timeout\n"
 CONFIG_AUTOBOOT_DELAY_STR="shc"
 CONFIG_AUTOBOOT_STOP_STR="noautoboot"
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index b00d6f6b226b171c681315ff2ea0a5cb46879eb1..8c90175393de419c3e42c779062497df05fc31e3 100644 (file)
@@ -9,14 +9,12 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SHC_SDBOOT=y
 CONFIG_SERIES=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
@@ -27,7 +25,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter 'shc' to enter prompt (times out) %d \nEnter 'noautoboot' to enter prompt without timeout\n"
 CONFIG_AUTOBOOT_DELAY_STR="shc"
 CONFIG_AUTOBOOT_STOP_STR="noautoboot"
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 3fa5d5e5cc113a8cb890502cfa5a74d2e89ca3f0..c63d922dadffdde14f6640ac19749ec45a0c1866 100644 (file)
@@ -9,14 +9,12 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
@@ -27,7 +25,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
index 516ac2de3f04b764e1d6f0a5932811d1087244c3..252bbcb85570151cfc537cbf9f7b4cf7cb1db92f 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="AM3517_CRANE # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_I2C=y
index 920c61c39174185812b121b38cbf9ac40d3b24fd..92577283f4ad5151d6af5cdb4dbb02ad8351b992 100644 (file)
@@ -4,17 +4,19 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x80100000
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 # CONFIG_SPL_GPIO_SUPPORT is not set
+CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_AM3517_EVM=y
 CONFIG_EMIF4=y
+CONFIG_DEFAULT_DEVICE_TREE="am3517-evm"
 CONFIG_BOOTDELAY=10
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="AM3517_EVM # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_EEPROM is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -27,13 +29,12 @@ CONFIG_CMD_CACHE=y
 # CONFIG_CMD_TIME is not set
 CONFIG_CMD_UBI=y
 CONFIG_SPL_PARTITION_UUIDS=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_MUSB_HOST=y
-CONFIG_USB_STORAGE=y
 # CONFIG_FAT_WRITE is not set
 CONFIG_BCH=y
-CONFIG_OF_LIBFDT=y
index 15c25d39f1aef07df6718e393191f3e6c0d7f065..da823f9c3185f7ef8d132d324424e957f250b01d 100644 (file)
@@ -3,18 +3,15 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_AM43XX=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DEFAULT_DEVICE_TREE="am437x-gp-evm"
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00100000
 CONFIG_CMD_SPL_WRITE_SIZE=0x40000
@@ -52,7 +49,7 @@ CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0403
+CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
-CONFIG_G_DNL_VENDOR_NUM=0x0403
-CONFIG_G_DNL_PRODUCT_NUM=0xbd00
index 6c170888680c8b6c7e605539e29950195b138b63..6715b52f6869ecf2ef2988f4ba8f3ee20d280190 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SPL_NET_VCI_STRING="AM43xx U-Boot SPL"
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00100000
 CONFIG_CMD_SPL_WRITE_SIZE=0x40000
@@ -61,8 +60,8 @@ CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0403
+CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
-CONFIG_G_DNL_VENDOR_NUM=0x0403
-CONFIG_G_DNL_PRODUCT_NUM=0xbd00
 CONFIG_OF_LIBFDT=y
index fde41c5c7e1c9045fc1dd85e8e3c23ad25f6aa5c..d6a5263079425724bf1fda17dfb87525537c9850 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_DFU=y
@@ -52,9 +51,9 @@ CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0403
+CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
-CONFIG_G_DNL_VENDOR_NUM=0x0403
-CONFIG_G_DNL_PRODUCT_NUM=0xbd00
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index 0bed3357229703d1d9b86b4a7cc61afffaf9c47a..17d22a00f84ab3cac636d8179c7686d7f28eecdf 100644 (file)
@@ -3,21 +3,18 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_AM43XX=y
 CONFIG_ISW_ENTRY_ADDR=0x40300350
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DEFAULT_DEVICE_TREE="am437x-gp-evm"
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_USB_HOST_SUPPORT=y
 CONFIG_SPL_USB_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00100000
 CONFIG_CMD_SPL_WRITE_SIZE=0x40000
@@ -75,7 +72,7 @@ CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0403
+CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
-CONFIG_G_DNL_VENDOR_NUM=0x0403
-CONFIG_G_DNL_PRODUCT_NUM=0xbd00
index a4d23e10b60ecbe7d30d8debcfaced54971fce20..a293e140ce04e9c6a452188b246bea7fa6e66fb1 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_TI_SECURE_EMIF_REGION_START=0xbdb00000
 CONFIG_TI_SECURE_EMIF_TOTAL_REGION_SIZE=0x02000000
 CONFIG_TI_SECURE_EMIF_PROTECTED_REGION_SIZE=0x01c00000
 CONFIG_ISW_ENTRY_ADDR=0x403018e0
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DEFAULT_DEVICE_TREE="am437x-gp-evm"
 CONFIG_FIT_IMAGE_POST_PROCESS=y
 CONFIG_SPL_LOAD_FIT=y
@@ -18,7 +17,6 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_ETH_SUPPORT=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_NET_SUPPORT=y
@@ -28,7 +26,6 @@ CONFIG_SPL_USB_SUPPORT=y
 CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_SPL_USBETH_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
@@ -63,7 +60,7 @@ CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0403
+CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
-CONFIG_G_DNL_VENDOR_NUM=0x0403
-CONFIG_G_DNL_PRODUCT_NUM=0xbd00
index 0e4679abedf22788473a04a8bd0f1b80060b77d8..6e4d04c13b66c270d0ac45f69a1c20a4b3025498 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_TARGET_AM57XX_EVM=y
 # CONFIG_SPL_NAND_SUPPORT is not set
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_ARMV7_LPAE=y
 CONFIG_DEFAULT_DEVICE_TREE="am572x-idk"
 CONFIG_SPL_LOAD_FIT=y
@@ -19,19 +18,16 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=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_IMLS is not set
 CONFIG_CMD_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -72,7 +68,6 @@ 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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
index f96348699baddb651b0d1457989f02cf10b8b02f..20ee2d485de71a5f871b52b841121ad5430d8274 100644 (file)
@@ -15,15 +15,12 @@ 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_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_SPL=y
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
@@ -62,9 +59,8 @@ 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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index e7638b88c25dabd74e57184838793a363644b2e9..e36491086f0bb6d9084ba7c2a9988244b3a11dbd 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_TARGET_AM57XX_EVM=y
 # CONFIG_SPL_NAND_SUPPORT is not set
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_ARMV7_LPAE=y
 CONFIG_DEFAULT_DEVICE_TREE="am57xx-beagle-x15"
 CONFIG_FIT_IMAGE_POST_PROCESS=y
@@ -25,18 +24,15 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=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_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_ISO_PARTITION=y
@@ -75,7 +71,6 @@ 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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
index 48ef25b5217535aa3742e14fde565f3585032e0c..3332a31883664404dbd98922087ec0b1b41f27e2 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="amcore $ "
 # CONFIG_CMD_BOOTD is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_XIMG is not set
 CONFIG_LOOPW=y
 # CONFIG_CMD_FPGA is not set
index 62dd14752c54339df35198669e1cc458f609db65..cea9f2f408e430421d19b702e6b8654250c5ecf3 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SYS_PROMPT="ap121 # "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
index 143064dfc3329150e22cd0bce03114b2e47d420d..7e8db3cb0847d91b6257f480ae271888139cb3d4 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="ap143 # "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
index 85d1201f00a3aead3f490cd50471325180946532..28443e2aa39fc4a701e74d47a690164e273de051 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 40e58eebd0dda56a8ee11aa19031e2983a8c73cf..ef1412127310dfc78eeac97f62bac884134a1408 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index e6e3a9bfe932746229500689191515b84e8394bf..a75a168e1557c90da98bc5427544d81a032de6c0 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="Apalis TK1 # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -47,9 +46,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0xffff
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0xffff
 CONFIG_OF_LIBFDT_OVERLAY=y
index b2284acc34a31302947a8dfdb5c41e3fc91a7cf0..7c96cfa8ed82bec0c1a3ab5caaa3ea06b5f8b3cd 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_SYS_PROMPT="Apalis iMX6 # "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
@@ -54,13 +53,12 @@ CONFIG_NETDEVICES=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4000
 CONFIG_USB_HOST_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index 239605dadfaa4fea00ff08be25971e103b973c71..e3ad1771cec0027054991863d3b08f450c8d4a40 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_PROMPT="Apalis iMX6 # "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
@@ -43,13 +42,12 @@ CONFIG_NETDEVICES=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4020
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4020
 CONFIG_USB_HOST_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index 1bc05d7266d390bf52218eecf2e59b2e87d1fcf9..f961cdec2d7edb55e7346f33369671c5a51ab8a2 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_PROMPT="Apalis iMX6 # "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
@@ -43,13 +42,12 @@ CONFIG_NETDEVICES=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4020
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4020
 CONFIG_USB_HOST_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index e15e11ad929a59a08a5549f55392ae65438de6a6..39329350edf45991c2caadd3815882627bd1b22d 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SYS_PROMPT="Apalis T30 # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -40,9 +39,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4000
 CONFIG_OF_LIBFDT_OVERLAY=y
index 6533d851fb139929b21da6091b04df78c73ba169..e9a17730dba80f2a27be98784db6a2932e724237 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="BIOS> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
index 9a35238e2111c125d2e13efbc0cbe0804439cd64..a90997c09e3b9c010da6b4f5d837ea3e4e93c04c 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 8f76e2b31babda8738dfe07ce695a834c97796a6..dc6f94edfe8d9639bca6f1676a4bafc6f6fe1db6 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 829c00f9420bd834f352074fa57139331805e10f..aac06fce6dd9546c23935654bb0c30887755eef8 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 253202c62195271ec347e95d3a119caeaea616f6..6b316274a17b09e1178a4c0409bcf3d7aa43fae7 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 766505e7879a65418551e371cb6eae7873f46349..d9a516990557e2c9608da0057a71ea5cdae0dd17 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_SAVEENV is not set
index 64a526aeb24088fc10ace2322781d2d64bfec95d..f25fe7bf7d6c1a21274ff26ee0cd7b817a9a8637 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
 CONFIG_SYS_PROMPT="ARNDALE # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 0ac39eabd27b164896426f1f51ab4ad401a9c6a6..736c037299f6fa7c4dd68a40b537683d53a9bfea 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_IDENT_STRING="\nMarvell-Aspenite DB"
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
index f76df63d17a003117dec5bab2c06d80e6a073d75..cababcf9903cc166818ecc6542d57e9c2837ef5c 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_BOOTARGS=" console=ttyS2,115200 rootfstype=romfs loaderversion=$loaderver
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="URMEL > "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_SETEXPR is not set
index d5d5eb00194c188723b2c127d5c41562fa1bfc67..6e8145f4dd40c5a81c5eff63e555963d5a1078c3 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
index e56111a749073319715a0c9371d12b5b19f746b8..fceac0a9f5851cc68393f2cc8077013a47a5b786 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
index e3d46dca6a47792bbcebe083779ccd1560a39bd5..9aa3ae9f14393dd80765f3734998627fd88f46fa 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index b1903c23450115ca3ba203b78e50871e1fac06b7..908f208107186b524daf6cf7042d6c94f88d0e50 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 8cd839868526cf4e5035ff3cf8a6bed45c81409c..de8a0b047b26f76a967b9c66364db80358b1b4bc 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index a11bc91be190b77d96b748ac2456b0cc14deca6c..bac48f931fe55516bd82ae0978206c5f97f9f0c9 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 9cbf76710760c24a9904c591fe0883c3e2d6bb59..066de06f3a1ba298ca307b09d2cb3fa5cd99db28 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index b374cc578007f7d6cfae5f8094d276414d1dfe8e..b32db05b4ee65101b235c8e69393b76581b1df9f 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 20c07848ca318d7852911f4e71067bbcaf43a36d..bc2f24226ab30294b648d92572451382343875ed 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index 20c07848ca318d7852911f4e71067bbcaf43a36d..bc2f24226ab30294b648d92572451382343875ed 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index 3c3fda62078dd0233fd9caa154aca99ea327af01..2bc927d9ffdd97f65beb6dbe750cf98e202f28d6 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index edfa0ef02f9fae97d0137d96f0e469f1cfb9276c..03d6571e670a337d8a486002dbc80b864e658244 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index 579082d2427817169ef11cb808c569b2cf6c1cfb..b14d5165979035db0f9bc6e894ce4dc5e2225de5 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index 7aeccaff4a98f8dd84d10b9828054301b340d657..b81ce4646e048af21afd5fdd38797ab15451803a 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 2dfaa9ba2a2699499eb46e77364dbaaa424ad657..e599d3d654f6922a2740c8c8046389c03db97ad3 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 6ae7065cbaab5e8539d687b2b922d68b93065644..66deba42b3014e00e6fba09cdf26019851df079a 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index bf0b6b1724caf6f3d3b91694fa75f065db83903f..0b873c822ef437d9da32328210b225f9ed65002f 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index cf03371c72da34b6bd249a238bfcac1d46c0c135..cb4a123a4768d0908916614e05ba98ef957ffd8d 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index 8d40bd0b361bfab6205d63f688324610db0bd308..6af3e3181880436651338dcc581beae7081b4242 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index f68ed719109aa0b53a1ae9018e9d6b37c455bb0b..fddf1e2a84e5edef53e027cb5b95e49361d00a02 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index e8d02788283070cabfac29b35325ab152a192bd2..3b5d84e0a4b253dfeecfc5444730fb172bd9ba10 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 6740ec5b30d8222bad665371977ae1226b3664fe..64581c55b2ae1dd96df584e8ba8d30d2d85a5c43 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
index 63bb7990e3b030d4dc44c438d2ca005916c835cd..693054de172f3cb0474d105d383183a15854b655 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
index cc567c4dbf3f783af86f6dea94bc5e23a25061f1..5eeac0df99462229c0564daae79a6d9987d95546 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_MMC=y
index 663987bc299944812405dcb519a40becbda4a06c..1f0a6d953443c7c0e9d9cf41db4014ad28ad753a 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_MMC=y
index 94481ca2ae3599d89e1cbcba3306d0caaa551c8a..85c6ff076e14fe9753ea46a7329a2ed38b4709d4 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_MMC=y
index a06186c065b1e9d6d11185e37212cfe174b0f24f..e78ec06d16da27185cd23b6d6e484ab46247ea59 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index 0f59c7c29efbf9381ed42d21771d66c21d33dd80..929a2afbfda0455667ac1ace04200d6324d56547 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index d690358cd911d0abb960d9577cbd47b44b628b06..385660bf0713d509d6909503b14a9ef98dd94e79 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
index 9d61dd8de0007d70a6f475ddfbaec4e0f2d1becf..b34d0c0976f38ad2e25aff6b603be6d6dabab42d 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_MMC=y
@@ -60,4 +59,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 9fa4801480b92186b2c5b09d8ba12933997e60bb..553f69436aced368f0864c9837871f924ca4dc48 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_MMC=y
@@ -60,4 +59,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index b28bec7f0bf7ac719058596ca66a0fa3ab11ac2c..dd92f7ffa38d55a0bfaa47450a497b3b62501b2b 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_MMC=y
@@ -60,4 +59,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 838d8a0ad7007133515195e14fa0e8d5eaf7718e..609597c65ddfc0b400bb7ff8d73985315e585d87 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_MMC=y
@@ -60,4 +59,5 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 1478997f49b72801d0b0b70cfa6c17220cef0a72..2ebb4d4a41d17b069db23e6274b7ee9eb583f97c 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 7892cc358a634bc64849c5c96c925126b7c9b1cd..667d5cc0def548e3715d114ed9920624f54c2cea 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 9451db37a90b960391eb182279a2f450925888b1..8239827f2d2d79c71f22a4b6a4131661185e6699 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 81654b23043165081d5eb3c05621b376e9b4864e..b013ba2975391f172d5e38016913e0b0bf97dbcd 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index fd18c2c07833e2f4873697bc21096469745d0989..174b80aeed763b210bcea406c4bf8eebb2319670 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS3,115200n8"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="AXS# "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index ccfb53fa0bf55c17182f4dd2508592d207b0ead4..953006156895dcfd45770ac6d7b79648eebe2f42 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS3,115200n8"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="AXS# "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 083ead5a2eaebf8d60323fbf8dbfb68f074671c4..7e01af0f64cbe1fcf630c8a32657e253ec3c5c7a 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-ba10-tvbox"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
diff --git a/configs/bananapi_m1_plus_defconfig b/configs/bananapi_m1_plus_defconfig
new file mode 100644 (file)
index 0000000..79ff0aa
--- /dev/null
@@ -0,0 +1,23 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN7I=y
+CONFIG_DRAM_CLK=432
+CONFIG_MACPWR="PH23"
+CONFIG_VIDEO_COMPOSITE=y
+CONFIG_GMAC_TX_DELAY=3
+CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapi-m1-plus"
+CONFIG_AHCI=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL=y
+CONFIG_SPL_I2C_SUPPORT=y
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_ISO_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_NETCONSOLE=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_RGMII=y
+CONFIG_SUN7I_GMAC=y
+CONFIG_SCSI=y
+CONFIG_USB_EHCI_HCD=y
index 4a08c1e7700af006c2422f6b788255408ab2c15b..461567fe1e5a56c9e709f1f722612355150d6035 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64"
 # 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_SPL_DOS_PARTITION is not set
index 9d8f17079e02a1552a8f59540d9b486666b80238..c96c1b85011f27da7cc995bc9f58f062f52b3877 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index cf3a7cd74d09ebcb56c734a09c54515aa28c4b52..275092c4b8f8f3a60bd1622492853c836f543096 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -27,9 +26,9 @@ CONFIG_MMC_SDHCI_KONA=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Broadcom Corporation"
+CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0d02
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Broadcom Corporation"
-CONFIG_G_DNL_VENDOR_NUM=0x18d1
-CONFIG_G_DNL_PRODUCT_NUM=0x0d02
index 2ce917981ecb6a1905fd518525df9d21023b29cf..38022ff289c348d8d77fa2d0769acd005ea948e1 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -27,9 +26,9 @@ CONFIG_NAND=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Broadcom Corporation"
+CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0d02
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Broadcom Corporation"
-CONFIG_G_DNL_VENDOR_NUM=0x18d1
-CONFIG_G_DNL_PRODUCT_NUM=0x0d02
index 70918654f5cae8a3f8a902c5137603fd887da402..e28a7bf71176ae1dc8cb85740608fe0cd68f79a6 100644 (file)
@@ -7,14 +7,11 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x80000000
 CONFIG_FASTBOOT_BUF_SIZE=0x1D000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -34,11 +31,10 @@ CONFIG_MMC_SDHCI_KONA=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Broadcom Corporation"
+CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0d02
 CONFIG_USB_GADGET_BCM_UDC_OTG_PHY=y
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Broadcom Corporation"
-CONFIG_G_DNL_VENDOR_NUM=0x18d1
-CONFIG_G_DNL_PRODUCT_NUM=0x0d02
 CONFIG_OF_LIBFDT=y
index db1ad401324fbc0cbcb1286abd6184305a068fcd..5fab4330045f04c07e6b61248ff57509925a6366 100644 (file)
@@ -8,14 +8,11 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x80000000
 CONFIG_FASTBOOT_BUF_SIZE=0x7FF00000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -35,11 +32,10 @@ CONFIG_MMC_SDHCI_KONA=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Broadcom Corporation"
+CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0d02
 CONFIG_USB_GADGET_BCM_UDC_OTG_PHY=y
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Broadcom Corporation"
-CONFIG_G_DNL_VENDOR_NUM=0x18d1
-CONFIG_G_DNL_PRODUCT_NUM=0x0d02
 CONFIG_OF_LIBFDT=y
index 3684fae370053ac7c7fdf1793d5f6f535d96e5a8..0593fb027378d42db2936d9cab18834e90667cd1 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -29,9 +28,9 @@ CONFIG_BCM_SF2_ETH_GMAC=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Broadcom Corporation"
+CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0d02
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Broadcom Corporation"
-CONFIG_G_DNL_VENDOR_NUM=0x18d1
-CONFIG_G_DNL_PRODUCT_NUM=0x0d02
index 61336d38f0dd866a9df9a40268763f8abba1ba29..b26fceff123ef5455aa3d3abaea1f04895b3f4a8 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
index cbef3d8365028f7a8def569fc47f1f9066d24e60..ad280911d565a17ca773b597bd56b96be8564737 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
index b12420636193ab46d0e8b60aa82383532257b0af..b76be353a00821a0a37fb8f4aa31bebf2fe85866 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
index f271fa06e5c89542500f3cd53dac6627462df2f6..b22124a4a37272a51580710f400e61e322ad5fcc 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
index b12420636193ab46d0e8b60aa82383532257b0af..b76be353a00821a0a37fb8f4aa31bebf2fe85866 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
index b12420636193ab46d0e8b60aa82383532257b0af..b76be353a00821a0a37fb8f4aa31bebf2fe85866 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
index ffda22ed495ae019b33640d1c2171e273426460b..db61e222708ec0d40e0986721f33a97939ebf6c6 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_AUTOBOOT is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_FLASH is not set
index 96e4bce972f71a2f45613bd77a75039f8660a8e1..83ba9f7a6ba4a2bef7f0835dd1d0f622f576dcc3 100644 (file)
@@ -5,6 +5,5 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=5
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SYS_PROMPT="u-boot> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_SYS_NS16550=y
 CONFIG_OF_LIBFDT=y
index 7fb88e452b99a82b0c0b38754e5dda61aff05ac9..ac72547e01cfe98ce48e0e901005e78f989eac8b 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra30 (Beaver) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -45,10 +44,10 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
index 24e8bbde17f098878c2da551d3a95a4541e4e89a..72616ae5e50ad9a088f6cc00d77c6a35103bfa37 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_NAND=y
index 44f4eac6f63b96cae149e090642ac6428f907579..764caf219c04a64467a1ad4699ceaf01eb904c89 100644 (file)
@@ -24,11 +24,8 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
@@ -66,10 +63,9 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_FAT_WRITE=y
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
index 1dffd1a1950d25e8e2c525db897450ba857bc8b1..e786d0651d65488ac74cac18f95f966cba95ccb5 100644 (file)
@@ -24,11 +24,8 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
@@ -66,10 +63,9 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_FAT_WRITE=y
 CONFIG_LZO=y
 CONFIG_OF_LIBFDT=y
index 5d8b72e2882b004427e754d613d319fb6849b052..714029e3e4733550f1888d0a5bea7e11614a33a1 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
index 8d451dc8629454fd4f2aadd77378089c8b07d2db..d0779285e579c08f661c89a5b2179eb37698036a 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_TARGET_BLANCHE=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
index 150a9ea393ea129e28ccfdd318827d72cb6f3b3d..b8c87caaf860a77e823a725bcad08f4602ffc5e5 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_FIT_BEST_MATCH=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FPGA is not set
index dc75e7347e7e2961126b63e2d4e784b85d18ede1..5cc43880a3fe964319b8282ebc64145ddd0628f2 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_FIT_BEST_MATCH=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FPGA is not set
index ff753d1be8c570e4088eac0372711f1de5be5827..c30e0b09036319c605608142bfb565fb7b1fa937 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_FIT_BEST_MATCH=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FPGA is not set
index aa9887ef7517daad0cb8d42f297e9c9a45aa0922..b9506ccb7b43a30578707122c00eee67d478c310 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_FIT_BEST_MATCH=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FPGA is not set
index a8fa47183668b7a0d70fe155681b8aeb2b9b3641..40e59a4f3b660031d9f73d95f03f83fd81c00fab 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_CRC32 is not set
index f814f2b42c962d9a9c4d4fb622b16ccb487b6891..241adef220a49c3b7ddcb94043b524b2102cf0e0 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_CRC32 is not set
index 580b90da4da738c94f0479d3bb10a25fef296cf6..798dabdef8bbf50fbd6af738f95456ab78f3b328 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_CRC32 is not set
index 101cd90c936737b6329c7a370ef75f5aeed7669a..e61188223a4b26f7f7a11a282c30b9b8bf8f918e 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_GO is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_CRC32 is not set
index 32496e4d775d0838c001666164cd6f9499443542..efd065d39f375885c1198abd65244cfeb5a0cc2a 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="CADDY2"
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_TSI148=y
index 2a1b0f9917f7de9642f6369b4115038cd7494952..fe86f4c0907ed5c6ba696b9db465e8e21089bf24 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Cairo # "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x240000
 CONFIG_CMD_ASKENV=y
index 89c9e9c9fb775a24bdeaa5a76d1e4846d93eb3ac..a02926cb8951a0c93cd812dbe19267d47425dd72 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Calimain > "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR="\x0b"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_GPIO=y
index 32a1730b0012c7d21ec0c62b8550b01e60ef4a6f..ed653a71a988e1e59e22643afd4d29af85855213 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra30 (Cardhu) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 91b5647e64366683cab2638c87437ffa2285516e..1fb1a2c4898b62b65a672cf02cea9c01ab4e7205 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra124 (TK1-SOM) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -48,10 +47,10 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
index fc336103cf2b76a426a366d4bb1a6ec7bdc9a9b6..b083f6c424f3bfd4bf0b0a546386d1fc7f8cfc98 100644 (file)
@@ -24,11 +24,8 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CGT-QMX6-Quad U-Boot > "
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -57,11 +54,10 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Congatec"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Congatec"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 # CONFIG_VIDEO_SW_CURSOR is not set
index a2017acba52ea368ce4ef20f84d4300dacca6fca..2e067b7b507960bf0b3f402f1ac07fe6cf4e365e 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_GENERATE_MP_TABLE=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index ea729b015524b4ba0a3b7bdfb23477797a79e96d..ee5f80bc60115c97b694a1e100d1e908c5d7294c 100644 (file)
@@ -9,17 +9,14 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_BOOTDELAY=1
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index f40c0b9afa7db15f4dfaca8aab7ed884771e3b2b..c74a006bc9f8e768717448b516d88c02fcfdce8f 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -75,11 +74,10 @@ CONFIG_ROCKCHIP_SPI=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_DM_VIDEO=y
 CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROCKCHIP=y
index cdeabaa12aa649bb83257f9acaa1fee8a3f983d5..9576c30d889eac35a77481fe35699aacb94a4752 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -76,11 +75,10 @@ CONFIG_ROCKCHIP_SPI=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_DM_VIDEO=y
 CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROCKCHIP=y
index d7052a645c3b730470100f6aeef46790a5ab5954..db22ae5cc6bccb4063e2c556e2554f60f404462d 100644 (file)
@@ -32,7 +32,6 @@ CONFIG_SPL_RTC_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_SF=y
index f22a03e1cbd78674a08b6948960ae5edc50be577..61d184fca33d5f200b98f587d47ac7641b8ec857 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_PART=y
index c1e36fa8601d36c6d708265f0c2717382e0ef4e4..197c242e90f19e8fe1019d9930eb0e3f40c4f6d4 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -75,11 +74,10 @@ CONFIG_ROCKCHIP_SPI=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_DM_VIDEO=y
 CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROCKCHIP=y
index 8df2c4c5c1f245f22bdc1d5e491507ddee1d3cb3..225c38cc7df6b970ce2bd3fb18d330bfc51997e2 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_PART=y
index 2eb30bda6f1265df68e49e30f4a82db6d8c7a462..5bac4aa12128170df7e84c56d4f4259fef67e676 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_PART=y
index 0767e43785c57700aae0488cb82f80ae7d268317..8f0a7f68ce6fb4f0b9a33818b07848458f989907 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_EEPROM_LAYOUT=y
index 580eaf3e5730ba13fd815e0e831da272847c5b8b..fa9f04a9d8a2cf0d4016dc60c63cdc1f4f01d420 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_SPL=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x141
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -35,8 +34,8 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_MV=y
 CONFIG_SPI_FLASH=y
-CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
+CONFIG_MVNETA=y
 CONFIG_PCI=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
index 540d662dd12cae3310717c3927376a32a0ed8faa..dd539bce0f518bbf3aecba215ed3547bdc8874ca 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CM-FX6 # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index d0a9f69794661192508736224fd431830e10974e..2b302f4f73fcc9b8d6e3168bb244db50671291b4 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CM-T335 # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_EEPROM_LAYOUT=y
index 4df40d6dfdb28b0db7c771ee1e7ab50e1b979379..8eab8244c82a276b8711eea58ccbb7450310de25 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CM-T3517 # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_EEPROM_LAYOUT=y
 CONFIG_EEPROM_LAYOUT_HELP_STRING="v1, v2, v3"
index 382fc1ab3e1e9ffaa43c9800867c9b223bb18e24..916851e7aeeea56381e3f4457f74e441f4ad67a2 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CM-T3x # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_EEPROM_LAYOUT=y
 CONFIG_EEPROM_LAYOUT_HELP_STRING="v1, v2, v3"
index 27d9063a49dba6d39dae8eff3c13abfced0ce121..ccf85cad4bb5d9494ee19fc9e41a19dac821c79e 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CM-T43 # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_EEPROM_LAYOUT=y
index db34b2268a4b7f120e8ee57fdc1c8a4284d55800..69b1cbfdfe8bc843f9f8edff0f54fefea4648e74 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL_SATA_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="CM-T54 # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_EEPROM_LAYOUT=y
index 21d0126a5d94e55f0d462309077aa4c21f97d215..9033a729315989dbdccf2f76efb768cbbd252129 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_TARGET_COBRA5272=y
 CONFIG_BOOTDELAY=5
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="COBRA > "
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 # CONFIG_CMD_SETEXPR is not set
index 7d1e709d4c4782d6384f31390f1a6688636a202c..eab8e4fd42b64e6166b26508817d5b9eecbb4d68 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_SYS_PROMPT="Colibri iMX6 # "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
@@ -52,13 +51,12 @@ CONFIG_PHY_MICREL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4000
 CONFIG_USB_HOST_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index 6877993088f4156f9d3eaadaf432c5a2e9d38ce6..2bba9f0ebab4a26e0db7e25bd02facddb476cceb 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_PROMPT="Colibri iMX6 # "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
@@ -41,13 +40,12 @@ CONFIG_PHY_MICREL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4000
 CONFIG_USB_HOST_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index d0b6c681463196ab6fc4d5fd250532b0c4a0ca3e..00e7975652c35e332e6d2969bd33aa975a1a5855 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="Colibri iMX7 # "
 # CONFIG_CMD_BOOTD is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_MEMTEST=y
@@ -56,10 +55,10 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4000
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
index a2c5474f545b4c53a7016a7a4b507d74e47eda6b..9720b5fd358f92c3e42224dd9049b16543a1ba7f 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_BOOTARGS="console=tty0 console=ttyS0,115200"
 # CONFIG_DISPLAY_BOARDINFO is not set
 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_FPGA is not set
index 0b5604c851586b3cd42aa1849848d7dae92ffa19..57a2ecc5837f4e897828043d23aea57e8b4dc14c 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SYS_PROMPT="Colibri T20 # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -47,11 +46,11 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4000
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_DM_VIDEO=y
index 65fa90fa290998d428d93794d3406e7a270b1e81..1d065e5b79936bdb8883449dc8e076a474c0a54f 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SYS_PROMPT="Colibri T30 # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -34,11 +33,11 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4000
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_OF_LIBFDT_OVERLAY=y
index 1ffe8618097440608e3f2ca0080a5b010e81ea91..aabbffd1c5a52551d5de4bdee6a55d3d14fcde3c 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_TARGET_COLIBRI_VF=y
 CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,IMX_NAND"
 CONFIG_BOOTDELAY=1
+CONFIG_LOGLEVEL=3
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_ARCH_MISC_INIT=y
@@ -13,7 +14,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Colibri VFxx # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
@@ -53,11 +53,11 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Toradex"
-CONFIG_G_DNL_VENDOR_NUM=0x1b67
-CONFIG_G_DNL_PRODUCT_NUM=0x4000
 CONFIG_VIDEO_FSL_DCU_FB=y
 CONFIG_SYS_CONSOLE_FG_COL=0x00
 CONFIG_OF_LIBFDT_OVERLAY=y
index 9e62d3b87055bf2f753ca1be58d785cb67112a53..29f2f589481ad8a8836645aa5f209ee5b084e850 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_PANEL_LVDS=y
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-colorfly-e708-q1"
 # 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_SPL_DOS_PARTITION is not set
index 52e9d6c79752cc08d5514887796e9b9b2412dfaa..b64018ae7120b753ff6ba4da089288d7e4eba0ff 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
index 3a1aea9eb8928a1e3cd4692235af9693b25cc43b..ecbd77b5f2b38ab01a900d5b9c68110e2d2e6613 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
index 1326f7e2b42550b2100ffb338cee7367c677ba59..4f0e3f3d55c6183979dd9e7ee6eaedd06b0a24ce 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
index 9575c538ca5ee24797e87e3c0cf3985e0e2d124d..971cfc66e89f5a3d63ba4d74102afe17effdcab9 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_BOOTARGS="root=/dev/sda2 ro quiet"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index b12be650d88dafbba576f95eda4cd5033ba4a112..aeeb9f6cfbfdbc0b8e7c6fb0418d82b91229fda5 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_BOOTARGS="root=/dev/sda2 ro quiet"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 400941637c1398e0ef46ed8bee32487f15846be3..8e435889279820ef45f20e7ac0245e39544daba2 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 7e7b2b3c3c04f4593021b530077bb98d87f282d3..c9165d6f0e87e7e4caaa26183f0a79a608e712bc 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 614cdb620101fa550fe092d1306a8cf6c327cc4b..d94feb5c7ea1a186bce5ca7ed8a5db65f410bbf0 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 # CONFIG_CMD_BOOTM is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
index da657f142ff3e9ebbf6fa3b849a29bfa2b4dc157..07024dc113c3300610a8dbdfc1a56e0c3bc4ac96 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 # CONFIG_CMD_BOOTM is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
index 836e00b2b5ed1261dea99c5be1aa59cd98466122..f65e5259342551d9d61ff959c598897589848bdf 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_GO is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
@@ -46,8 +45,8 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_MV=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
-CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
+CONFIG_MVNETA=y
 CONFIG_SCSI=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
index 9f3bc3f874a9cbd9b6e705689c0da35b37bd55c6..afd46b89c28119b0f7d1785dd28b9f1441cbe592 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_PART=y
index 705e0014570059873986c3aac90528165b1e0c00..8c6ab93d03c12375cad79132876882ed8ada132e 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
@@ -49,9 +48,9 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0908
+CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Siemens AG"
-CONFIG_G_DNL_VENDOR_NUM=0x0908
-CONFIG_G_DNL_PRODUCT_NUM=0x02d2
 # CONFIG_EFI_LOADER is not set
index 2d8ebaeb2120cfc71dc226a33b64f19c9e4ac5b9..49e89f0b67cd80237e71944ce990005f46d00914 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_PART=y
index a46dd666963c103a16c384ac61d5bb54ecde0dbd..8668f2094134dcd335f4c5b07abd758633f1371c 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 5f3be0ea13f1abe8f53f9bd8ce868aad23530020..496c5c02d49400c893b7de62ed046705aef9228d 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="d2v2> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
index 27370e7c0c32623c8d820630fbff85edc87dc860..824c383bdf74782537f09bdf100bc1885a0ed990 100644 (file)
@@ -1,17 +1,16 @@
 CONFIG_ARM=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_TARGET_DA850EVM=y
-CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_MAC_ADDR_IN_EEPROM=y
+CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
 CONFIG_SYS_EXTRA_OPTIONS="DA850_AM18X_EVM,SYS_I2C_EEPROM_ADDR_LEN=2,SYS_I2C_EEPROM_ADDR=0x50"
 CONFIG_BOOTDELAY=3
-CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw noinitrd ip=dhcp"
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
@@ -19,24 +18,28 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_BOOTZ is not set
-# CONFIG_CMD_IMLS is not set
+CONFIG_SYS_PROMPT="U-Boot > "
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_EEPROM is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
-# CONFIG_CMD_I2C is not set
 # CONFIG_CMD_PART is not set
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_TIME is not set
 # CONFIG_CMD_EXT4 is not set
 # CONFIG_CMD_FS_GENERIC is not set
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_DM=y
+CONFIG_DM_I2C=y
+CONFIG_DM_I2C_COMPAT=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
 # CONFIG_FAT_WRITE is not set
-CONFIG_OF_LIBFDT=y
index bfa5ea1c4bc6f8b089b6421599ea10c1735388ef..3089b932f00b1eadaf8d64d0ee20fb5189231bbb 100644 (file)
@@ -7,9 +7,9 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
+CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH"
 CONFIG_BOOTDELAY=3
-CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw noinitrd ip=dhcp"
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
@@ -18,23 +18,29 @@ CONFIG_SPL=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot > "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_EEPROM is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
-# CONFIG_CMD_I2C is not set
 # CONFIG_CMD_PART is not set
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_TIME is not set
 # CONFIG_CMD_EXT4 is not set
 # CONFIG_CMD_FS_GENERIC is not set
+CONFIG_CMD_MTDPARTS=y
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_DM=y
+CONFIG_DM_I2C=y
+CONFIG_DM_I2C_COMPAT=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_MTD=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
 # CONFIG_FAT_WRITE is not set
-CONFIG_OF_LIBFDT=y
index 24ab89224df17824ad0ac732b78af4179c4a8cfa..b00eea76d9596e266464043fd1900a5f39030be2 100644 (file)
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_TARGET_DA850EVM=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
+CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
+# CONFIG_SYS_MALLOC_F is not set
 CONFIG_SYS_EXTRA_OPTIONS="USE_NOR,DIRECT_NOR_BOOT"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
@@ -13,11 +15,11 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot > "
 # CONFIG_CMD_BOOTZ is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_EEPROM is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
-# CONFIG_CMD_I2C is not set
 # CONFIG_CMD_MMC is not set
 # CONFIG_CMD_PART is not set
 # CONFIG_CMD_SPI is not set
@@ -28,11 +30,16 @@ CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_FAT is not set
 # CONFIG_CMD_FS_GENERIC is not set
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_DM=y
+CONFIG_DM_I2C=y
+CONFIG_DM_I2C_COMPAT=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SYS_NS16550=y
-CONFIG_OF_LIBFDT=y
+CONFIG_DM_SPI=y
index ba3d478b1e7b1e1ca0cbe4c66b50a8527bca3238..aedc04b19e50d0d246c5988e67fe440cf5800560 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra114 (Dalmore) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -39,10 +38,10 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
index 0dc4b2af07a737ca025ffc918fd6364a5649436c..0dbbe77aed25086a6b14ef497bd93704398cf051 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
index 3074994ec69525550b2c2c05b2167abed714c79d..abd793c2c16ed08622c07f298c53e1d52eaf94b5 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
@@ -47,8 +46,8 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
-CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
+CONFIG_MVNETA=y
 CONFIG_PCI=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=200000000
index 9d1771d2925af91a691eb8e1d3ca58b36b5fb80d..beac2661892951ef7486972c0da8db4d1fb50164 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_SPL=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -45,8 +44,8 @@ CONFIG_MMC_SDHCI_MV=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
-CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
+CONFIG_MVNETA=y
 CONFIG_PCI=y
 CONFIG_SCSI=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
index 9458f8c43893f4151325be319de0a1bfc9f20aac..23eaa123a2fdf2201440cfa7153145e99deb3ed3 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
@@ -44,8 +43,8 @@ CONFIG_NAND_PXA3XX=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
-CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
+CONFIG_MVNETA=y
 CONFIG_PCI=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
index 503cd595e9859ebb6511ea18b67c996eb31e413e..aeef00ba335d0e166b1a61804154c5da9935c923 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index 23225a0e80e895bda6267ebc579b0110503fe715..048d1f49660e7b71b4b56d4947cae4448381f7bf 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index 6d91d5ed409f0ba174efe3e0eef86da1e9481cc4..b1db972a86e758886db06317c6571255ce1c0ef7 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index 6a0c8e8c8a705571759d69a9723bc9bd3cbf95bf..4e6600d52ca6940aedfacfa821ab0d860984bb6a 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SETEXPR is not set
index e2e5eef38bfc31c2ed665bc691b613bb95d6adb7..fe1214b3d00e6a67064c234ec31d415e67a5ceeb 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SETEXPR is not set
index b46de7d6b96b98d85c7df2045fa50e0aa8d00d77..86f604d09602240e59788782405bcde558e7bef8 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 8f3888a6b82fa3e7f50af1012b375db906bc19ab..e9eedf17a5689466467f5a52f13c039473249f5b 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x680000
 CONFIG_CMD_SPL_WRITE_SIZE=0x400
index 4db9ce73c238c031f883bce53a4c26c4f8e75748..f69fee099f2e230affc2fc90b642d42860814d90 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_BOOTARGS="root=/dev/sda1 ro quiet"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index be16346cc67cff447262bae00ee2a046e2e105b4..0da88fbc9a73f184dea527dde2670259ee23f6a7 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-difrnce-dit4350"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 2342f34e78857b9744b12f4482c8567d5efa6775..beb6baf0adfaf69341bc0760f62061243e7c3fbb 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6q-dms-ba16.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -38,10 +37,10 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Advantech"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Advantech"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index 08d96add3b93a36571a4292c81f8a24553194753..597ff0db6ee6ed7887e59d8956b55cc9c21d4460 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6q-dms-ba16.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -37,10 +36,10 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Advantech"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Advantech"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index d2c085d502def98245b02805552842442788189d..d9813acc89c15d5c0bf6ec22b01d91cedc86f840 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_NAND=y
index 38c05ca9a80f61a09d21c529d2bd2eab64ecc778..1a3c7cc471c0eb55e33969a9c01fb62b84e71f27 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_IDENT_STRING="\nSeagate FreeAgent DockStar"
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="DockStar> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_NAND=y
 CONFIG_CMD_USB=y
index 53903bf7308498fe9129d585632193d0895fc8c1..f5ad0403e40460dce99794bb59205883ef577372 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_TARGET_DRA7XX_EVM=y
 # CONFIG_SPL_NAND_SUPPORT is not set
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_ARMV7_LPAE=y
 CONFIG_DEFAULT_DEVICE_TREE="dra7-evm"
 CONFIG_SPL_LOAD_FIT=y
@@ -19,18 +18,15 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=1
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -90,7 +86,6 @@ 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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
index 06d883411906c16a599acaf2efc46f514f8113c4..b046b569d9acb53b55184243c829753033a87f02 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_TARGET_DRA7XX_EVM=y
 # CONFIG_SPL_NAND_SUPPORT is not set
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_ARMV7_LPAE=y
 CONFIG_DEFAULT_DEVICE_TREE="dra7-evm"
 CONFIG_FIT_IMAGE_POST_PROCESS=y
@@ -25,17 +24,14 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=1
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_ISO_PARTITION=y
@@ -92,7 +88,6 @@ 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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
index f5a2c1b52621e6b2b06ae74e94cb34ec22cac0fd..b827ea68c7dc824112a16513179abe890d89e58a 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -66,7 +65,8 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0908
+CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Siemens AG"
-CONFIG_G_DNL_VENDOR_NUM=0x0908
-CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_USB_ETHER=y
index 2224b3850a0c1255b34e12204f8d223cdc11e5fe..6d44e0c607e7bec229a76864f4f351556fc8f1ad 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOOTARGS="console=ttyMSM0,115200n8"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="dragonboard410c => "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_UNZIP=y
index 5bcdfd02771162b1b73ef043e3e7002c073b1bd1..1130faa3923aad9cab31d83d646a341e881a86d8 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_IDENT_STRING="\nMarvell-DreamPlug"
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_SF=y
index 5f0ef7db7b7354c1108ae6b8b0c6eaa4ad9607cc..987a924b7e9ff6703c423cb7ebeb9a05b4f1ce88 100644 (file)
@@ -2,7 +2,6 @@ CONFIG_ARM=y
 CONFIG_KIRKWOOD=y
 CONFIG_TARGET_DS109=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
index 96bdbeb0ea797fb13b46f2353d39566e271f2686..eb3fe759e88d07f1f0fe93a7d7e94ff1ee471b8a 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_BOOTARGS="console=ttyS0,115200"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
@@ -38,8 +37,8 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_STMICRO=y
-CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
+CONFIG_MVNETA=y
 CONFIG_PCI=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
index 645bbbc8d072d7613699609e2b216d2d891af7c5..6c5908ddbfa62150e48695e60b858e445a57a147 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-dserve-dsrv9703c"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 6feb4861a7a568c9897044acd0ea01499cc16038..feec2cfb1ad8b20176ab467d3ec698271517de36 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 # CONFIG_SPL_I2C_SUPPORT is not set
 CONFIG_SYS_PROMPT="duovero # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index 41248189e3e4a0289f73533949d5d63842add979..9caaf15d9c3765770df30db9fc623c791dacdf6a 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra210 (E2220-1170) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -35,8 +34,8 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
index 7c9f78d8d6bbf5470c4d0814e1334eecac0a2f41..9d1f191ca1045fd0d99f7702bf114bdce6e45770 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ea20 > "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_FLASH is not set
index 979dd0e1712308417cf3c2a2ac67ef7941786a78..dd382c8d63c176b496eb1fb4dab407500a6859f7 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_BOOTDELAY=5
 # CONFIG_CONSOLE_MUX is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="\nEB+CPU5282> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_SETEXPR is not set
index bb5f2d1aaad2aa01f08e2bc5f844f02fab6a74fd..84feb1a4c6a840321f9f52e50ecb4c785444d0f5 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_MONITOR_BASE=0xF0000418"
 CONFIG_BOOTDELAY=5
 # CONFIG_CONSOLE_MUX is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_SETEXPR is not set
index 2bf48e0199215a228678b6869890e45fc3cdd5b1..dced115a433766dd8a327d10968cbf7ecef377e4 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SPL=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ECO5-PK # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index 9b045819b8cfcffc41c07749dd2662dad972e083..5d65e9dc306a59f7d3b0d50522ee1ac12afdfc4f 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index de952b7e9a03e9b6b77d506388504c3744542805..2d1173d8541c5a2870f4ebf7dc447d7fb0dca231 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="EDB9315A> "
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_USB=y
index d58700c204cb0a58319b5ed335808f68c605fd0e..aa8eedeebaa2eff31dbe8c85eec4d21000b7ee61 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_TARGET_EDISON=y
 CONFIG_SMP=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_ENV_CALLBACK=y
@@ -33,9 +32,9 @@ CONFIG_DM_PCI_COMPAT=y
 CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Intel"
-CONFIG_G_DNL_VENDOR_NUM=0x8087
-CONFIG_G_DNL_PRODUCT_NUM=0x0a99
+CONFIG_USB_GADGET_MANUFACTURER="Intel"
+CONFIG_USB_GADGET_VENDOR_NUM=0x8087
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0a99
 # CONFIG_USB_HOST_ETHER is not set
 CONFIG_FAT_WRITE=y
 CONFIG_SHA1=y
index 8e6b9d242138b0509d25011cc9b57fed5a3b8d89..14540ca3718a7973df798192c0dda1457dc66dd2 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="EDMiniV2> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
index 0e20e7214062d8ce13a33011b1477afd78146f5e..ed4faee0308d73b0bc9ea704883add9cbdf8048e 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTM is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
index 66f0d63a354fca3314920d73c42af74021b600d3..e86cc8dcdefe3d5f100ceada6b128f941d6c4d4f 100644 (file)
@@ -9,6 +9,5 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SYS_PROMPT="ESPRESSO7420 # "
 # CONFIG_AUTOBOOT is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_MMC is not set
index 081d4b7ec1186949a10681f3dab4fb72c7ade531..520bc9fa5366319fbfed3e74bb731abaee6706fb 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 148d4218c0905c415b781b4f74d9532c691c94c3..f068ce873e76a43241ede973bdae18d4afad876d 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -66,7 +65,8 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0908
+CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Siemens AG"
-CONFIG_G_DNL_VENDOR_NUM=0x0908
-CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_USB_ETHER=y
index e5fb0d221565a17108db28e229b723504a58e420..3be8add7112825200cffcad8b73364d44b3b19a7 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/mtdblock0 mtdparts=atmel_nand:-(
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_UNZIP=y
 # CONFIG_CMD_FPGA is not set
index 48007b89558ac10bcc8c584b49fd405df936252a..75c62a9a0053b5bdf3ba9d2913141736890b0085 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOOTARGS="console=ttyS4,115200n8 root=/dev/ram rw"
 CONFIG_PRE_CONSOLE_BUFFER=y
 CONFIG_PRE_CON_BUF_ADDR=0x1e720000
 # CONFIG_DISPLAY_CPUINFO is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_I2C=y
 CONFIG_REGMAP=y
 CONFIG_CLK=y
index 4323b7776831ae7469ce8b99d225cea31bb2b5b0..0e8594cbddc7664afc26de0a221116b20c41cd0c 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_DEBUG_UART=y
 CONFIG_ANDROID_BOOT_IMAGE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_ARCH_EARLY_INIT_R=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_CACHE=y
 CONFIG_REGMAP=y
index 5a53951314e202783667cad2bcbe53d8fa96fefc..783683aa4567d644c1b8110e02fcd7e9df96a257 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL_SYS_MALLOC_F_LEN=0x0
 CONFIG_SPL_STACK_R=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -44,11 +43,10 @@ CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x310a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x310a
 CONFIG_SPL_TINY_MEMSET=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
index 5a658a149522914ea3e84bd80d286a54ba315eb2..b226f66478c9d844f9cee7ee6be47debb2efff24 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x200
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
@@ -44,9 +43,8 @@ CONFIG_SYS_NS16550=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_ERRNO_STR=y
index 5294ba9f5febe7fe5dc97dce58d6312ba22ab51a..e944f979ba7ffe30466a8b213128dcb3c0ff4b54 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -66,11 +65,10 @@ CONFIG_SYS_NS16550=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_DM_VIDEO=y
 CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROCKCHIP=y
index 7bec00178692129301b82cbd7b47c8cd06582bf3..4015a417ca5335c18cece2d756bf84d0ca4430c7 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_FASTBOOT_BUF_ADDR=0x800800
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=1
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -22,12 +21,18 @@ CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 CONFIG_CLK=y
 CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_ROCKCHIP_RK3328=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_DM_REGULATOR=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_BASE=0xFF130000
@@ -47,8 +52,8 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x330a
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x330a
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_ERRNO_STR=y
index 7a0bd4aec97ce22822ecedd8c8969ba72a3bbab0..42df743cbe2469e835cf8b4c18e7f86c5a29c9dd 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 7036f433eeebcdf2bacbbdec24b1f095251c102c..653e00328e061c0a12c3b00cfaf42dc1d5a2504d 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_FASTBOOT_BUF_ADDR=0x62000000
 CONFIG_FASTBOOT_BUF_SIZE=0x08000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=1
-# CONFIG_CMD_IMLS is not set
+CONFIG_RANDOM_UUID=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -51,7 +51,7 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x110a
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x110a
 CONFIG_ERRNO_STR=y
index 96a07defce642ec969e603e6572c8d024aa7c5b0..008776e640baa64764566761627f13930c4ff008 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -69,11 +68,10 @@ CONFIG_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index 82da6016e6540b574ad520b003f56f1b161f7ee8..bd7e1a0c6593e29c23a3e8df6afb0232f41cd231 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -73,13 +72,11 @@ CONFIG_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index 94b9209cd742beaac41366364bbb5788898d0eeb..262048843fcf2c938207a8046f1a3aad9892f506 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
 CONFIG_SPL_ATF_SUPPORT=y
 CONFIG_SPL_ATF_TEXT_BASE=0x00010000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index ba3cd064341ffec08cf8346081a272a173f86294..29da42cb37b6f89354f093d8db7c98e79c6d428f 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="flea3 U-Boot > "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_SPI=y
index 99ef75b3b056a18cc75994ac7447c7da532ab5c5..f987a3f17fd11d351e067028d98d7025193f38f0 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_VIDEO_LCD_PANEL_LVDS=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-ga10h-v1.1"
 # 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_SPL_DOS_PARTITION is not set
index 514e3c5220b4e0b0c64cb36a81bfb201c1f98343..c1849e38bb8d41e632cf5351259fd7fe0bf70f0c 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index b6d0a003cece12b35ebbafbb7cd72ca957a9cee4..43a6c12708f00865f69ac51ad9144a3d04a7f0cb 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6q-b450v3.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 2ebfec036bc487b20ad826376e1a8f1da38cbfd5..4e22e9579a1a6340d9172bef739f2c5ad07fe416 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6q-b650v3.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 1793a064a0b80f3dbdd8819e19c40100e2e90db8..cb5899dc3a7515ebb901c4ed19575846937db399 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6q-b850v3.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 19255fb209ff1195d2a84f8902225282c67136c0..3baad0a5b7d16405ba00953a7c2dc22103aa1f7b 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_TARGET_GEEKBOX=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3368-geekbox"
 CONFIG_DEBUG_UART=y
 # CONFIG_DISPLAY_CPUINFO is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 CONFIG_CLK=y
index 73b36d73812494aa0972c7b65ce62d42d3031739..f6bf782a7155ca7ccc332fed0a0bda172129e023 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="GoFlexHome> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_NAND=y
index d887ee3bd354d97625937f94613c48dadba80cfe..bc3299033ab7fb320655f809437a1ea641530440 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index a2ebfe58c97878f5f8105c58242add25d17fc0cb..1ba595d5833429b14b60648c3f6800898a8d8f4d 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_IDENT_STRING="\nMarvell-gplugD"
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_USB=y
index a651fe509bdd2e44fa7236622a047785553de3ef..35543c72626ab6c20e459a79c5611caf0f978929 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-gt90h-v4"
 # 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_SPL_DOS_PARTITION is not set
index f5dc29e89a26ba1a39f92efe07f5de85bdc51351..c5afd4bf2371127db19ae8fd7443f0b14812cf23 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 086417f71c4962fe5aaa087feaae17b7a6f7b947..3fdd5f9af6c468c5d18659072df3cdeca28e0129 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_NAND=y
index 74aa2ef56621ce281359e8c0ea2ef7947f056e51..e075da7629553077c40dd9c317bc0a86c306ec7d 100644 (file)
@@ -30,7 +30,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Ventana > "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL_NAND_OFS=0x1100000
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 # CONFIG_CMD_FLASH is not set
@@ -63,11 +62,13 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Gateworks"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Gateworks"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index 7bbdd500a78cd00a86de1fbff2427d8d7d04b0b2..66af8614688a288bafea63922ea12c13b9893b0e 100644 (file)
@@ -30,7 +30,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Ventana > "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL_NAND_OFS=0x1100000
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 # CONFIG_CMD_FLASH is not set
@@ -67,11 +66,13 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Gateworks"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Gateworks"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index aaedf93eeac96fd8e7a5816c0f3e9865349abd40..5b3c90797cf6859a5bfc50555d2ccc416ce85460 100644 (file)
@@ -31,7 +31,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Ventana > "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL_NAND_OFS=0x1100000
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 # CONFIG_CMD_FLASH is not set
@@ -66,11 +65,13 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Gateworks"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Gateworks"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index 5d2189e589ce91f3801b31dd10badfbd1cf19d5d..07c0bff4088b7a9bc441d0143374532ce971f6f3 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SYS_PROMPT="> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_BOOTD is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_SAVEENV is not set
@@ -29,3 +28,6 @@ CONFIG_CMD_PING=y
 # CONFIG_CMD_MISC is not set
 # CONFIG_MMC is not set
 CONFIG_PXA_SERIAL=y
+CONFIG_USB=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_ETHER=y
index cd599add770879684cff9b7d0b1e14996942d5de..e71dd1f452740b04a13ee0df7269cedf1ed82dbc 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-allwinner-h8homlet-v2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 4d7882ce0d19a0ef20660f6c1a213c08122ec2ce..1a4df1e8d2ad1330cc6577c460b559749baa4f95 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra20 (Harmony) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 552bdcffadaf31ed31d46542be30fc7efe3cd5f3..20a7b71737175d23afb032ac21fc5eb41a850112 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds...\nPress <s> to stop or <d> to delay\n"
 CONFIG_AUTOBOOT_KEYED_CTRLC=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
index 8a7a1be0817979c68e7b2d672cb1de2058b3b615..ef5a64df536457331468b1c42cf22749057e8472 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTARGS="console=ttyAMA0,115200n8 root=/dev/mmcblk0p9 rw"
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_UNZIP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 99d71e7db389840cad6253cd0b03169019913d75..32a219c04bfb9e414d6e70933575c562443dfffe 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 123c41a8f4c83b29456acfe00c4c7ae1fca4a66e..f584b1ca54a979c1ddffc8e0008142daf885cf03 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 85a2b9d7737abdc08db2388b1c2b6846d743f181..a04cfee5f090e093b87a43bcefdc409b7286b6c4 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200n8"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="hsdk# "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
index 73e82bc4cdce1eb78701bb7e73d2a16ee97927e6..81883aa197cda0dd456700791a14a1c43bc26994 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
index 416d7712c7b464f9b264efef29cfd887ec6ca361..031937e66f317b1f32f99654036346b71a84d458 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-i12-tvbox"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 0c3d226b8c79d177290310c80733f4cfb12d7db9..c593c2caf20767632442bca060b841d0fb726617 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-inet-3f"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 5c1dc322eeaab889217ba68f27ea00d15d517fb5..05c255647bb8092f82155040073e22cf9881cd13 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-inet-3w"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 6beabdad339297dc7e0175749d75541cb8a460ab..b1dbbeb7af61334908e59399608e089e21569bfe 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-inet-86vs"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 907b6cd4dfa46df0b24d1aa2f1dd538fa25ab9f3..2287431bb3954cad02fc17603ee2730b08b18a3b 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_VIDEO_LCD_PANEL_LVDS=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-inet-d978-rev2"
 # 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_SPL_DOS_PARTITION is not set
index 0676fb545f5195cd235bd823d5722cc45a6556f9..6685c63aba89ae0624385c6e337a6a911168de36 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ib62x0 => "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_NAND=y
index f0c663ddd0243021ed98a4ae3bab088a93ecccd2..32db9d7d53128cfa43455e742dc15320df05830c 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-icnova-swac"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_UNZIP=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index 14e04d5faa5127dbd9275548076b87b84871d93b..728107087df9710a38465254114c72cc2f02714f 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_IDENT_STRING=" Iomega iConnect"
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="iconnect => "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_NAND=y
 CONFIG_CMD_USB=y
index 947cda2adbb724a7b547200469273205b8bdba3f..ac2a945fedcba1c20fe671be11303a34643d075b 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Enter password - autoboot in %d seconds...\n"
 CONFIG_AUTOBOOT_DELAY_STR="ids"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ENV_FLAGS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
index 6e3dcb08cac73becbdbf321b62c679c632157abf..3cff0578079333ebe870600eb04929817cb567f0 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SPL=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_ONENAND_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
index c504e75ad83100d0a4a899aae28e8ff9170f0bbb..0445b977bb06fc3dfb7afc4150a97694f128f146 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SPL=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_ONENAND_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
index 02969da9090fa4479dd230945850ad2a1e13522c..b1f48f38a3344bbc7d1fb85c359896dac1906310 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTDELAY=5
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="MIPSfpga # "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_SAVEENV is not set
 CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_FLASH is not set
index 652fe8662cb726f2cb6d69fe4ae6049107325440..7b17b663a49f22d5163f4be413aab894cd6d57f6 100644 (file)
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_IMX31_PHYCORE=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_PROMPT="uboot> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_SETEXPR is not set
index 83ec6254b6352813e82df79cbd05756d40d04299..b67dcd3d0af1f340ab93a8d0fdcd0ba1171e5805 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_VIDEO=y
 CONFIG_BOOTDELAY=3
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SPI=y
index 64757ad30e7214c416ae4da1591a68c25fbe413e..8018198f096e11b47a7f69ce74806019770b210c 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="i.MX6 Logic # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index 1bc9a06fc17d2325deba7be8e80e486dac8b0dd2..7a1735ad9f45c717ccd2192e1028122d7769d2c8 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="icorem6qdl> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
index e82debec125d543e6e00164ae849b343157811e5..c341b17daf7452ac6cec32ed06f37a8ff248a549 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="icorem6qdl> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index d26a463ff675e4a49904dadb4e7573cbc6c23562..1d02ad095e9295c5834e193e40ea57df16c953a8 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="icorem6qdl-rqs> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
index d3291278c4511644e8af580f0cbfe026041f3705..7c798730065f587a17d2e6d33708e0fd6bc7afcf 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="geam6ul> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
index d6edfbee7d9420221abf991b08437d1505499d34..d6038c11c580e9f6cb801d7d52495e1736583f88 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_SPL=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="geam6ul> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
index be1f23d56977686d7e44c38d0cd705c13a92d625..67fa9a038937e74e73e7d4fa1fa01ca5ff7b1694 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="isiotmx6ul> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
index 760bb2e5aad7986888e30505bba2346fbdf7b8aa..c673d93089e439e413c896dde21eecfbf4a91f76 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="isiotmx6ul> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
index 67026b8cd560995333822aeeaf397c824b6229b2..e481151bf315a8f708581fdac4d0cc0a1d803870 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_SPL=y
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="isiotmx6ul> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
index a8905ae8c37d0f9102c91a7ec121633cce669077..1dc9b55860822f2e490940932803629b07f976fd 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-inet1"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index a596e090d79156cdde6a1b9517136c016838547c..54e3d0eae407fea0ae04fe44bbcc98f89707d291 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-inet86dz"
 # 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_SPL_DOS_PARTITION is not set
index 6376f5f7b2e0f049870e77d1549650be524900da..5d6f858616950ba9d4ca776168104cb5ac783082 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-inet97fv2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 1b5dc9bbb9f17ee3a45132469ecb8b7223caebee..c765e686d3bf9130f15f5d488fce3686db68961f 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-inet-98v-rev2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 3265a440c3c6e7d6a29f63e90f5893c418ecdc0f..3a9b4bf830a22af191bc2f50e288d3f9d2f8b94f 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-inet9f-rev03"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 1d0fe8f1b8e22cfe150e8e6a4a62915ffaa0e286..599db542535a62ea5d1cbcb38ed747ecd31f6c1e 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH13"
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-inet-q972"
 # 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_SPL_DOS_PARTITION is not set
index 2bdf0e4bc720eece256391e41cdee3cded7fb11a..bac0d95b76bea022890209e85ce548b17e2e7cf2 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ns2> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
index ce946e524fd4e3c445661bcc874c23adcec2ed47..c9672e8392cea7c5af81996f69e794f5e7fb3390 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTARGS="root=/dev/mtdblock0 console=ttyAM0 console=tty"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Integrator-AP # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ARMFLASH=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index 43115f538deeb057520b35b5825b1233f46df266..3fa4d11f6dd690f02dd9f583ea1e109b7f64b016 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTARGS="root=/dev/mtdblock0 console=ttyAM0 console=tty"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Integrator-AP # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ARMFLASH=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index 067a3c5e45ab167f7489cc54212c3281a96e4e1c..33bd0868036011a35fe59838a3f58b39872f90ba 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTARGS="root=/dev/mtdblock0 console=ttyAM0 console=tty"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Integrator-AP # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ARMFLASH=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index b0e26237c2e81d39326b8031d80bad3787b26131..ddf6814970c381c043d09e2b46787dc9a4fb1818 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTARGS="root=/dev/mtdblock0 console=ttyAM0 console=tty"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Integrator-AP # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ARMFLASH=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index 8f315fb357d705f4847b34afd9f542d431e9b8e3..a630bcdc0c0697a46414ff87c61e195eb15720f6 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTARGS="root=/dev/mtdblock0 console=ttyAMA0 console=tty ip=dhcp netdev=
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Integrator-CP # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ARMFLASH=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_MMC is not set
index 47b44f19fb82a6f8ceb58d29bed9d88224f9f8df..ebcd3ec346ebbbb386a01e8e58e51b10f40de0a5 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTARGS="root=/dev/mtdblock0 console=ttyAMA0 console=tty ip=dhcp netdev=
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Integrator-CP # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ARMFLASH=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_MMC is not set
index f39f021d8964fd65c0ecee09c574157258e7c9ea..17811348b36d6b946784cd00f29b71bdcfed26f4 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTARGS="root=/dev/mtdblock0 console=ttyAMA0 console=tty ip=dhcp netdev=
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Integrator-CP # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ARMFLASH=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_MMC is not set
index c9c4d98d1f1cee4b83a6b10484d142a75deec185..74cbce2107fc8af2200c3ba3dfdfcb281c168937 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTARGS="root=/dev/mtdblock0 console=ttyAMA0 console=tty ip=dhcp netdev=
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Integrator-CP # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ARMFLASH=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_MMC is not set
index e9c82baf768f5df2cc00be1abedcf23e19df468e..a462d820082fb1187eda6e3e9110a8c41b7df7c1 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot > "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00180000
 CONFIG_CMD_SPL_WRITE_SIZE=0x400
index 68821447072bb56ca8d398b9558b516281eef877..680c70f0eb8561c578fb35fc923dc1aa4df499f6 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-jesurun-q5"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 1e3e4bed6af24cada80f2b32ab44d287482519be..c1efed0a2df43c3cd65f1e8a1d6a99758f6a2424 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra124 (Jetson TK1) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -49,10 +48,10 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
index fed6addab63b4b9385bf1cd3cd9951281c039fb9..49554001c4b9fd50a24f4bfab730320d748c727a 100644 (file)
@@ -12,14 +12,13 @@ CONFIG_DEFAULT_DEVICE_TREE="keystone-k2e-evm"
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DTB_RESELECT=y
-CONFIG_FIT_EMBED=y
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
index 43f9bd4abd0c4ab2159821d488e5f5ae35d86a58..97b8c065783d29abb8166becb810863bc05d2caa 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
index 2b29bf44912ad6c51d78ece561f73e19b975f0d0..fd19cb99361c678c39bd7ab98db30a44a5241a62 100644 (file)
@@ -12,14 +12,13 @@ CONFIG_DEFAULT_DEVICE_TREE="keystone-k2g-evm"
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DTB_RESELECT=y
-CONFIG_FIT_EMBED=y
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
index 52c1c63141fdb85309b3ee7c871102a174602bf0..f49afd18bd353724951551b556040b329fafe848 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
index 80546ecfc97b3b54679d1657a1862ebb11bc6638..20e428306d7bc284648b4a7e881744b8bb82b188 100644 (file)
@@ -12,14 +12,13 @@ CONFIG_DEFAULT_DEVICE_TREE="keystone-k2hk-evm"
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DTB_RESELECT=y
-CONFIG_FIT_EMBED=y
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
index f9f2f2712fce5b5f2213020936ee77f7abe17b89..5b0a68ed37021ca44523b11a445fd075871e323e 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
index 732c9d2f7fceda7594857f38b4b7165a2235c5c9..f8b435f69bda05a686c3fbafe075a368390ad391 100644 (file)
@@ -12,14 +12,13 @@ CONFIG_DEFAULT_DEVICE_TREE="keystone-k2l-evm"
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_DTB_RESELECT=y
-CONFIG_FIT_EMBED=y
+CONFIG_MULTI_DTB_FIT=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_GPIO is not set
 # CONFIG_CMD_GPT is not set
index d9c2efcf7cbea7fb68028c3621dd28c12d553e06..0ddf64c544b6c403ed1ee75952e694d0a35a653e 100644 (file)
@@ -12,14 +12,11 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=2
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="kc1 # "
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
@@ -42,8 +39,7 @@ CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_OF_LIBFDT=y
index dd67dcd492a46e94b7d29c4c935e5f1d91a20a87..c39d94949d0e3bb667544017a8ad2363bfc5fa22 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 223479cbf8d112b905d96a2d43ea4957bc60c207..a956e42abe0890d49464a53d0791be91883b78c1 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index f9d04d0ce903e373d98715242c3a3cd7ba6007f5..4a1c874456305db49265b92f9852d05b4364861e 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 2c0d7a0951797b2f70c1ae67938cac654a234a60..e1f6a2486d8ab005cd52bf1064dfcf7106829d98 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 5165496f5485e3e99dc4edb9a96596784eb08ba6..68d7aa6694809c8e9f280c668cc683db8793626a 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 31c571890b3818ebee9869b40b96ab0b5a60edc1..71ed2ea6aab484add726b8c5f9339480cca2f4d6 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 358e0cd5a54427a0e1f0cd84787514106f137103..44bb2dbda72e4846f76de9e5ae72220e3df95f93 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index d7150537b092b77b8ee5c6dc7954568ebbd28dac..66dbf623112a7435c4a92ce202f66cfbffce10a9 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 42becd939fd8a5ddde1b58ea2693175617e85747..1348973a4611a0f1f250d0c2ab6948f6d422421e 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index c16bef6cf1cc837f95a4ea039f34b1491faaa40f..5b405085d87374b67155f1aa0d0d4e54492813ad 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index c6924d536e5c9e3483579aee73bb0a7bc6d842f8..8d06ed4d50b1ddfd27902ee80ad959a55fea4862 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index e95aafcf0cece8d6334771c203b1885a48c05a59..aa63f8354d83d8029edb6401cedeae46d62a8032 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index aad7b4d893fe5cadac3f28e6b2d1feb3a5b0687c..d93e839bde1128f826f3733eb496750da5bf3904 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 5547920717af12059c903c3fe29bea0152aa762a..124cbe52aa6f2a45fa59336cff73db70f2b59a68 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 06d207ca1292585743b94854217599dfde138430..d4dd65f432ddadca3cd42af57611ce08a27a8b71 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 9b63a940e66f5d61dff9d0caa677732734a714d6..46e2345e6c1ba79eeffb88451041bf08da9802ae 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 119533f49e7d1ded7a222c0508e22c0398a9709d..5def33bac344d7e032edc1d814e9ebe6c63d8eb7 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index a42f5e0efb40639854300e0bc2afe05c96ca3408..7af01e26d53ffe2d0de7574135565742050b9487 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SPL_SYS_MALLOC_F_LEN=0x0
 CONFIG_SPL_STACK_R=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -44,11 +43,10 @@ CONFIG_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x310a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x310a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index 50a88e51593cce4ce3d276c1354504c1c9ecd12e..f4b8ccdf2fa6830df2ba855341f6878cc2724251 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTARGS="root=/dev/null console=ttySC4,115200"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SYS_PROMPT="KZM-A9-GT# "
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
index 37b9abfe92245b48b051a7319dd0a835677d4f3f..5072045e890d856d3401af2c68a0129c2740f276 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 589e8cf880be8a0cac59aa42e3e020b1ad6a4880..209250a73d54324256a1a33e73de5e4d9a2dd2a6 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autoboot in %d seconds - press 'l' to stop...\n"
 CONFIG_AUTOBOOT_STOP_STR="l"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_FLASH is not set
index c7ee7b3f97f4fe4c7dceeab2b63a846d642962f3..959180c7c83184edcad49fe2a8bdd2ab20413375 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_BOOTSTAGE=y
 CONFIG_SPL_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_BOOTSTAGE_FDT=y
-CONFIG_ENV_IS_IN_MMC=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_ARCH_EARLY_INIT_R=y
 CONFIG_SPL=y
@@ -38,7 +37,6 @@ CONFIG_SPL_ATF_TEXT_BASE=0x10000
 CONFIG_TPL=y
 CONFIG_TPL_BOOTROM_SUPPORT=y
 CONFIG_TPL_DRIVERS_MISC_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index d30cf67ec02be93be1fea6805db85118788be546..c34d3059c113ae619f2f7c2fc3821996a12a3b89 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 777a4518547c92be96c3608a2fec334037d93925..b6930be3381313b603cbd0fcdd1f1df0bf7642aa 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 quiet lpj=250000"
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
index 91b7ace4f42fb7e53c7779c41390b1f8e01e14a2..b25fab7ccfecd7894813fcc8032d271cca142757 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index a1f6ac43fee045d5c50f00825a2872984e28e4e6..7d46f3adbe5433cda41514af30878b6ca1e60489 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index d177edf39d5933a5a5266aae01cbb6a96deccff1..30dccea6faf109a6ccdc5a0133f70c18956e521b 100644 (file)
@@ -26,6 +26,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index b45e05db62e2451c7404a67ebddc936831518da8..530e0f58d6dd9291b4fbd5c3a4c046e6ae96dda5 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 55601cbaf07826748dfaef1aa808e9d12b9c9f67..dec80a1688db1c2b6a33a2b2b9fe40492923051e 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 5538d2509c8e5395084cdc99ecaf763ceeabae8e..acfb0454de5e30feaeb784a826947236c6fe7c12 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 77a430dbd649bee87b2da54805d22e1fed5ee0cc..23a1217e0c4624045532e39357fb83046502a60c 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index c9f7223562dfe84dcd8b057536fce1648257b082..467506023ac1c2cdb1d447d6a673d96b87e9607c 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index f0da0ba8fa7252884f32eb9990fdd34e7d9f2e65..879639c54f2f9d3f284ff6a391a497e477f56ab1 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 20f209280d98a1085b72ec33c1afeb631bb23d32..f2bcd52baddbbdb790bff89e9e897b66226de4a2 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0"
 CONFIG_SILENT_CONSOLE=y
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 777e61bf8d44bf4fb212ff88bdef5e25a17cc065..1230d8711d934908b60a88ee8b3f987ce35aa235 100644 (file)
@@ -13,6 +13,7 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0"
 CONFIG_SILENT_CONSOLE=y
 # CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index d1dda1cd66384670803315cff193d6588d2eb998..8062f56cd4791ce42acc092924a7232e58eaf82d 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index e4158400422a7e085636e64f316b352afedba6b4..e06cad800b7981fa6758f96154fdbc53a7f9caaf 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index e0483e0159e0c690322146fdcbf16e08b2678d20..3f412af981929504942ed94b4e5a814cb87d5987 100644 (file)
@@ -29,6 +29,7 @@ CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 6732381e4d9dd551b6fd34fda919f640d4c804fc..29fe4114296852d96808f610505dcb73bcfee6cd 100644 (file)
@@ -26,6 +26,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index b1267b684dbb3f4d9323858b56222d0fc750aae0..5b7cf447c8a2f8b1a3f9774d37512c5bc2d86c00 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 9265fb39e0fe99851c0a2739f95baef2391cc7c1..c1c837e05a2adacd6e0e51b64da49e60eb039d27 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 265550bf9ade795b460e75a2ec07f9a410ed5540..89447e1e200842917084d7271ef1b155d902de61 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 28791cfc52bbf34505a123cdfd2fd65651fe7b63..d0880a229779151706a1ee3b1b441811c0666b76 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 015340ee85d4e5247c794fc414785b08d81f8109..766e3a949edc4713e4446445426890ff953779c3 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 892aef1a2fe40198fcd5044404f5f3c40e5b1e1a..c4dfd1b6cca98669df68435631681725561ff013 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index a21589dc37a4d81c07f9d4ac6469d182cbb28933..cf0f8700e005829999b65044ec1c4f705d147c32 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index f432ebe35d0d10dbb266f2a2c7c8391cca88ee75..27a933f1f0d5be7bd60501bb95354a956d54139b 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 80ab13be84a431aa9c3226e79cded0deea4862fe..d6871c845faa3f97fac4cdfab47bbdc62306db55 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9c7e16dbf1d5ab8aa7aa75d107457c44b593dc6b..5113b12f7b1a49dbbcee62c0aea9805c3196ff1e 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5c8599ed0c3c72401a93c1502088a602f0b6fb4f..aeee86bf7050708405c5577515da77a9bff23dc9 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e5310febdb6a105bd3afe9da92a7662c4770b7b8..cc14e0364d5d72c7e17f650b1d9d45c87e69ab08 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index bdd7ea710e99c2439d37533c619d3051c5d276d6..c02af9ade841aa9b4a82a384f4dcca7bc7d2aa09 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_SPL_CRYPTO_SUPPORT=y
 CONFIG_SPL_HASH_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index efdaaa3d69883d0a51c2efdbb59289508af3e6ba..10aafe33b18e5e527a63a8ac286edde96e219d8c 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_TARGET_LS1043ARDB=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_FSL_LS_PPA=y
-CONFIG_SPL_FSL_LS_PPA=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
@@ -22,6 +21,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xf0
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5b2ca9273be0943774cbda873f973a685edaf6b8..54c61046dc0cd0e0977767656b1127862239758f 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:4m(nand_uboot),36m(nand_kernel),472m(nand_free);spi0.0:2m(uboot),14m(free)"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index abcf6857deb97764c65e5e472a04a3ffe2438e91..20e15e88b0bff0b2d4adf2faeca70a31623cc691 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:4m(nand_uboot),36m(nand_kernel),472m(nand_free);spi0.0:2m(uboot),14m(free)"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 17a53ef6b0bd731ee2533e23886761f478fc27b3..6efa766cf7c5025d6ae4d0af37ef45d91153b3b1 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=60000000.nor:2m@0x100000(nor_bank0_uboot),40m@0x1100000(nor_bank0_fit),7m(nor_bank0_user),2m@0x4100000(nor_bank4_uboot),40m@0x5100000(nor_bank4_fit),-(nor_bank4_user);7e800000.flash:4m(nand_uboot),36m(nand_kernel),472m(nand_free);spi0.0:2m(uboot),14m(free)"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 2b7ffce2672bd8dbaad244160473e60d613aab7d..722114bfa566e10b797a94ca2a5632fe9daca344 100644 (file)
@@ -15,6 +15,7 @@ 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=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 011e7108e0ad0747242fc85a2c08454ae593d9dc..8772399526ec5e88e8f019095728427d016210e3 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=1550000.quadspi:2m(uboot),14m(free)"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index c150807f2b618de554efb8040c62d3f5d9c6f5a0..5b3cd24e853c7562a524d8cd2260c097deae46c4 100644 (file)
@@ -15,6 +15,7 @@ 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=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index a91b4b9ca1ec3eb7f4defd8f4cfe439191e9b215..a54a8ebd67a110e4c71c87c0aeebe865658aab69 100644 (file)
@@ -15,7 +15,6 @@ 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
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
index 8c2213d486de0e4f32ec9716ed29f69b50ca2ba7..c339f2d5c3134026a499b8152af9689cbcc3b16e 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL_BOARD_INIT=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_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 1deabfab58f42f6a81c5462a846ed9a898a91b1e..dd6febb533776a74341b0f7d506a2388ba784764 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_QSPI_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=1550000.quadspi:1m(rcw),15m(u-boot),48m(kernel.itb);7e800000.flash:16m(nand_uboot),48m(nand_kernel),448m(nand_free)"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 821fad8152e63ad2279ccfff5ee712149c67f57f..03700ac8b1670b2a5633f9fe3a287831301cc741 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_QSPI_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 mtdparts=1550000.quadspi:1m(rcw),15m(u-boot),48m(kernel.itb);7e800000.flash:16m(nand_uboot),48m(nand_kernel),448m(nand_free)"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 600e999ecec86a5021fdfd012538fed2cc77a17f..4dd1b01e22d8b6167c6020241db2ef2351a1dbda 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x110
 CONFIG_SPL_CRYPTO_SUPPORT=y
 CONFIG_SPL_HASH_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 600990ea608c03b4727b41a26df92388009bf4ae..7f82d4a1dc9f9cae9f02ae00d33ad8ad1f64aa3c 100644 (file)
@@ -1,7 +1,6 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1046ARDB=y
 CONFIG_FSL_LS_PPA=y
-CONFIG_SPL_FSL_LS_PPA=y
 CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1046a-rdb"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT_VERBOSE=y
@@ -15,7 +14,6 @@ CONFIG_SPL=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x110
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 35016ce61caba64346f49b7f5936593bc886538a..516c8b9de59067714531cc9f02a619fcdb052f7d 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_CONSOLE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 CONFIG_CMD_GREPENV=y
index 23f3d42ee86b2821be0ff98d2d444e11ab887246..94ecdbae2e8d48b478b9fca1a0ad6442e5cde68c 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_CONSOLE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 CONFIG_CMD_GREPENV=y
index c80a83708b53522ca2ef6738f1bc81bf44bc5451..2937ba9fa40ebe8e2e8bc647d5e3121adebc0240 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_GPT=y
index ef1d9dcd3bab3df96e8017b8bf762ee87c490e80..58eea7f37258c432223d004d5f5f843dc1eb6380 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_GPT=y
index 4a462ce77e679d42ea5368e289b4418ca0a6974b..a8e4fdd5095291c1e2932f41431b7046475a8392 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS1,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0600 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_GPT=y
index c44ac48c4824f4c0d23b1945522bacc01401ca47..0fd3fee3b6751082486e2d1220ff42eb7a720869 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS1,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0600 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_GPT=y
index 454515251691060f49507a51627641191ae51e11..0f248a783309be32a1420c8185e40880e9fb8f76 100644 (file)
@@ -18,6 +18,7 @@ CONFIG_SPL=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_GPT=y
index 5b8e1aaafb8926114ac3aa4b99d5b34bd6409e6a..1848d3a0c19fd40b7e7b1febaba2de4f77e2930a 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_QSPI_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS1,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0600 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
index 05c799dfaff580d57519b91ef0eab11a916686d7..7b0e40919f607bf6ef6517c670baaad2aee46edb 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_QSPI_BOOT=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTDELAY=10
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
index 39c1d526c6c259bc8e8cfaa18b3b5a174abe069b..115a793453846e0ddf1c05ca111fcd175c817052 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_QSPI_BOOT=y
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS1,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0600 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
index 6d140d7471e6a90adae00dc62b933503c8b1f8a2..4df0a21298830d7d5fcedbad20fb68025f0c7928 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_SF=y
index 8da130a179ba0b2feb48e98a88aa2e0a2a4aaa44..5f2ac4fc99d820feecfef272d2c274dbbb49a8a9 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/sda2"
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_SF=y
index 94c205ec00f4d5069427acdfe2874ce9adf75290..ee9c78211584643299e0593dc3d162d9065b9189 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
index 3e001919fa3cecf56ac567f34625034f73db8824..3c5b0c850180866967adf89e4b1b99cc6d9293c0 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
index cbe76b624f09c6f81c01212b9e0cb5b784a4cb99..e7496741258ded028da44c75bd1563aee91eeca8 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_DFU=y
@@ -47,11 +46,12 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="AriesEmbedded"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_ATMEL_USBA=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="AriesEmbedded"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
 # CONFIG_EFI_LOADER is not set
index ab61a3c90a1ca6514d91be4de2b69c9c33bb836e..57c06115a90ff9488e5149b94c788ac5317636a3 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="malta # "
 # CONFIG_AUTOBOOT is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_LOADB is not set
index 733ddaf79d5a379f19369383a663a4c4d911361a..95087d1d18c78b934e7844000bd7483d1147e521 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="maltael # "
 # CONFIG_AUTOBOOT is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_LOADB is not set
index 39e875a8999ee4999b9d437c61cc23e78a879d1f..96e374f1ad61b8c923bb784c82dc1aa0159919db 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="malta # "
 # CONFIG_AUTOBOOT is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_LOADB is not set
index 99cf08381aae6f9c13b306eeae6285c8a814373e..18a9a759fc2a526a6b8b7361b7661bdb7785d9e1 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="maltael # "
 # CONFIG_AUTOBOOT is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_LOADB is not set
index 47b190f23246a03bbb8603ccdbfa21dd9cfc213e..18c827e51b8835e643ac9004c66f80393113e75e 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 131d5e1d8eba84d252747218525e48372198fda7..febcee0260eb8297d579449d969a541f5e6e84fa 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SF=y
@@ -32,8 +31,8 @@ CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
-CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
+CONFIG_MVNETA=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
 CONFIG_DEBUG_UART_SHIFT=2
index dd5511f91008f0f14260d05af29326a55ef2a412..0ecc926777d14aa2231e3c8d835dfb423edbefd9 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 61169c39d5d8f1d876732aa822f412627b2f40bd..eacd8dc518266dc43259c184f2912d767fef4aa0 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 972cb637f591fae455f5981622f721cc65cf95ab..2bfff28f12bc94f5a9ec6861b2fe17705af46fbc 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="mcx # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index a87037590574fc10d733349abfcbcdb434659f40..e4fe8517fc66e54c85bd9f97218e41c8b9d6de33 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra20 (Medcom-Wide) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 1cd23e7a0ea84e2870ff8e327543310a48a30112..0367b0cf09ba7f283da6466ae6509e1b812a7499 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_SF=y
index 7eca4d47ffef8deb4d622c1f820ee86b3f9aeafb..306b225a15c0de203217d7e83b0db86cce623cc0 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 910d09e969027642e1a89f8e2d6ef5186684a7c3..3da35cbdf6c3a1cdda51010fcd42db54a4730c6b 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 953801e6d0c36d766f2a5b91f8d0457937cf6c3f..faca66b2d106651a8da95badc86b5bb29062f032 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_OS_BASE=0x2c060000
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot-mONStR> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GPIO=y
index 7b237abfca62a27213d2e7fd220e740bf0270eb7..fc2564cd7dc3f13da97d21d805dcb17662935324 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index b0437e13a7a7720149b77dcd552b7eaa57e43942..7478f9b14eb74bd45017bed7ecda2ffb9c13f7aa 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -69,11 +68,10 @@ CONFIG_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index 00f6945867f3422aae138956fbc80324a9acb5d4..2d39179add132d004cf547cb6876a63cb700aab4 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_USB2_VBUS_PIN=""
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-mixtile-loftq"
 # 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_SPL_DOS_PARTITION is not set
index 9b358a435e9834ca07eac0e0f72a8c200a5f9cdb..1c2a993d4a3d24bcb83da922251b34cd578e3f67 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a10s-mk802"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index d8069168c310151674e2f70dc7187609be1c33ba..d02dc11bf35a67e4dfb35cb7dbf103b1c8ea738f 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_USB2_VBUS_PIN="PH12"
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-mk802"
 # 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_SPL_DOS_PARTITION is not set
index 286900dcbeb2118284ea587a459e1c0bba1d7fea..1e56d47fed19249d602d5d1b8a0562c5018ac353 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-mk802ii"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index b9336266115cb8a3b98f908bd5dea8ef2cd14bfb..2c20186b78f76696fd4c32949edb817ff7e81990 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=5
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index 8dd63ab5d722881a81a5b04d2be0f92c9242e8dd..2d6fb7d39b42a4d086bd7e3ccc99744f07a00198 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 24c0598269647f647cb704e1be1c68742110ca19..068eb5d274ff5512d4e2605a81cb8b00941adeb6 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index cb6f3bb756bc37014c41c17857d3f6de5fe5f6ee..61e6274932d42afbf89cbbe2c17b0bc5091c6c99 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 4f51c40975009b8fa5d83ff750308f9a0c773d19..8dcf2a2b6ddfaf620bb84a47edaa0c3a74cc8d2d 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTARGS="console=ttySC0,38400"
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 316e4f0b8432334ccc493ca44236569d5a9ea79d..55d39a01b493b03c5c149093b4113f7176b0517c 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SPL=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="mt_ventoux => "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_FPGA_LOADMK=y
index c0f013154760b8ea1209cf881aaa038b298b04ad..0fd4514c3748c0ebc8193130779de57705d264d9 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_ARCH_EARLY_INIT_R=y
 CONFIG_BOARD_EARLY_INIT_F=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 22dc914fc24a9ba9e76f97a92bee59cd1b13e15d..9fa4d9f98c16e48cb1387504cdb04fc4e5bb7a6d 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_ARCH_EARLY_INIT_R=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_I2C=y
index d25ebb1b8b3407f50a4ebc5d44579ecd07c0ea9f..95db6c610e3b2268361ccaf63637ed22cef4e8e7 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_ARCH_EARLY_INIT_R=y
 CONFIG_BOARD_EARLY_INIT_F=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_I2C=y
index ca62ae827bc3e7d72ea6d658880313409adb9e5d..9afe651872e33041868381d43f1b900a0ee8d447 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_ARCH_EARLY_INIT_R=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 3d6d7e156b68d3bbb8450a1ca50b2c66da0653f8..628c11d851dba8b93606fde0d2f2baba1900c75e 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index fb157e7c0aa88fae01755f0f03787561a7539857..47774b736f31cb25464069a4d3a7807fece9c758 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index e75a82c1997320065487a501d8f070f736d0c70e..1fd33dc89d4940a9c4f6b6fa91f562a07d5aab1d 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_BOOTDELAY=1
 CONFIG_DEFAULT_FDT_FILE="imx25-pdk.dtb"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c53cc59f14cce97afc84ef890d5d6c4402c2db33..b18d9f9df46489d46623bae2b2f0845bbc95cffa 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 999cb3482b32f88f78871f98b9200ec341da9296..3d9120238548835b8b4bca103ad754d5e0de246f 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 324d5666d646e5194863410f17e526d1c17c247c..9b00372c27c1946a228d63f9fbbc65142b736529 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 3dfb5409874b074ef6292fa017acc9882ab50eba..07ae3e68d5b0c43e2a54d7caed1404d7b964afcb 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 098a7635501db31e60627755fe553d4d485d273f..eb7c8d42ec1156072c9d1e711d0e973d763335bd 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_MX31ADS=y
 CONFIG_BOOTDELAY=3
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
index 2b70da564e8610e0eeab73d6efdd796f41148a52..5282aa4edcf7db52e4aa6dd094b97e8b72079012 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_BOOTDELAY=1
 CONFIG_SPL=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_NAND=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
index 3b9d10f411cb37f2123eb0388b367b3aee4d80c5..4ef54ddcfcd9db1b9723e0ed14790cd754f145c3 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_BOOTDELAY=1
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index f30d9200d7b40dcfb39b40f4f2db2c51b2292fb3..386eec4aa9e7815bc165480ca2ebd35f6c10af47 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SPI=y
index 20da6e2f3c2e42ba5d9d500f895562c1966f33f3..51941b9d2f97ca5c340e0a2cda05d5c68c402529 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_DEFAULT_FDT_FILE="imx53-ard.dtb"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
index 659d5e8249512cdea4da4169be52774b93629710..6c414874d5601d0f41079901446eec212d4b1ba8 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/beckhoff/mx53cx9020/imximage.cfg"
 CONFIG_BOOTDELAY=1
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
index 91fe1e89222b5594a6b0aa2f3a232d34d1258547..0134b43de1c6ec05fdf0b7c1d88d1539a6d7882b 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_TARGET_MX53EVK=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx53evk/imximage.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
index b431c89eef5a22dfc19da848f2a28ba31e7f6772..13a46193a08476bdf56e53c6fbbf47e7e04f7b68 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SATA=y
 CONFIG_CMD_USB=y
index ec2ba01d6626642792a2ef54792b69dc37d61662..537fa99702eb6eadf71138ae3dd3d4ea537c5b81 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_TARGET_MX53SMD=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx53smd/imximage.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
index 5490e3546bac46cc6a8f21de80807390fc21a175..4d334c32757c5fa70a9abda5a24a4c6d54d9c841 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
@@ -34,6 +33,5 @@ CONFIG_DM_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index 7219219b293e8992ddc5a93835304f4b2faad63d..6051e7d036380cfe1dc4ff478394ec21fe41ad13 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index c51445437e1f993bb589a5b7430850fbf61cfc08..4160388b6fe56ebe4a650725465d8afaa60c4843 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index c31d7f1dbb1219467018a52683a1609733bd9ed7..f227602efffff502a2d3fdb418bf7c96d6fcf53e 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 5894d6262097e5866a73e44e7925a63e72946af5..8eb3c35de96b1b4a70e414299e639d6c1d8f81be 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 57aba7e6d09a1c19bd08c4325d132c0695de39e7..1c688397555e9f1813f5eff63bb46f1350e4b9b6 100644 (file)
@@ -10,11 +10,8 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -49,10 +46,11 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Boundary"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Boundary"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index 8283189315607408f3688e03a309fe91cf705d32..cbe77ab9ecb9ef396569a656b51a43ea5605ae12 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -48,11 +47,11 @@ CONFIG_PHYLIB=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="FSL"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 # CONFIG_VIDEO_SW_CURSOR is not set
index ad5d4485398f7f896cd71bb5e5e357f0fec8ada5..9449693014d9428e1138be43c33be3d37da6aae5 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 # CONFIG_CMD_FLASH is not set
@@ -52,11 +51,11 @@ CONFIG_PCI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="FSL"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 # CONFIG_VIDEO_SW_CURSOR is not set
index 1c2894226c07fd76c4c2c30f5a499628d080460a..082f3170f834f06d8da5c6da6f579a8f699223c2 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index f8dcb753de9eb9ce35b6fd66f729cb5662f1b9d3..020d19f271e7b033348ce399acfd8da9e4c019c6 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 4d4f273f502d812dd28dc7cb9efa96036682a310..32f93df9704d3ae47a6d64e0fe8425c737e95b7c 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9ddd9d74450fa5d32e8dcd632901661ee30fb406..a7daafcc5c6a9dffed412d681b3cbe2397085245 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 5a1ebe3136f19e66ae23ea710ece2ee3f8a111a8..b8948d85635813c783a85236a78ee84aeca18014 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 5ae12d45bd35061500906b03778066c54a5a46c0..ca8453b057b3c1ecc78952de89a55c2b88e279ed 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6sxsabreauto/imximage.cfg
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 2ca6b8f8ad5a11b9b3019b268e50384abddc19f2..24583c4072902e8a7240dfe44df100df23840821 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 77d545f204c1466b82cf55a454310367979c6661..c431b247026a9056d8c280d8fcdd1fc09a55f4e2 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index c55b96c0740e0a5e6d34f550d7c2c50474cfbe6f..be801f3f051fb43de81534b28891896d59beea46 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index db255f8d72580ce29ca88114d315b42f06bf07a9..693f9ab311791b7dc8d920568fad9a2190a243ec 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index ec33429edf547ecd9e00e4f0bd232a2a135e61b5..115c926091b703c23e7dfcfbc131c18df3880328 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index ec35804ea252ad62c9391ea27c612b15b2ba0f3f..d6511ffc09552268977f46c08a83bbe6773aebfb 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 795c4f2b712408c1d7c7b8a63d8017fb39efba53..1917f4bbab0e13e6d453e01489bfdabaaacd9fdc 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTD is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
@@ -64,11 +63,11 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="FSL"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_ERRNO_STR=y
index bd68831db7cc1cd5b69cb758e99480df4a3791dc..416ddcfe73e39216b0ce1df44d6c90b2ae0d1141 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTD is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
@@ -66,11 +65,11 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="FSL"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_ERRNO_STR=y
index 347cc0022f58262a29723eb894b9707e4b7aaaf4..9b782f243663475bf3aeed2192344ca49f5ffbe0 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-nanopi-a64"
 # 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_SPL_DOS_PARTITION is not set
index b1fbc4d5122f5fcaf8084229d63fba6c11ef31f5..5d4915de74da1a8946a5dfb46d46c485a74a5e8c 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_DRAM_ODT_EN=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-m1"
 # 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_SPL_DOS_PARTITION is not set
index abe93f6706756c3fcdf3434612ab356caff676d3..7a37582f112ad4ce9337c750854b2cd403763a23 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-m1-plus"
 # 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_SPL_DOS_PARTITION is not set
index c7db07a10a2dc26df85b702c3235408c725bc01e..b8e089176f8a32b307f5809ad581ed2ce2e5361c 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_DRAM_ZQ=3881977
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-neo2"
 # 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_SPL_DOS_PARTITION is not set
index 0a3dbae32c28c850f156251f7aa034ef61527227..11eb3ab13bf771ad356c9c1c4b133b3dc2a49de2 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-neo-air"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index cc49aaf2076703ba4009d56b424b58cdbe49a806..ed30708f90f06bb9d597c34692e529f4a2c18b69 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-neo"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 736f352fdd52b0eaf23a9ec7fd7fe42882f959d8..09bb8f1e932a331e7f21f0107c4f7b9df576d1de 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="nas220> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_NAND=y
index e47c553bbe25056d9289fd420536aac144717d41..3e3150042d5e127158ede85156caa624c553569c 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="2big2> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
index 9eb2f3cf09be2e0b85ef081b5eadb057c4169e09..7665c78d3f2ec1a98b4c2cf6a3e799e46b0d45b0 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
index c3e689bbb5d50d456e2899ad92c61ef3551b323a..edd279ad6fe47a1bd9b05b55f8af329f089b6abd 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ns2> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
index 92aaa66358660ab79131ef94746702b0f8e245e4..2454c4f380ed0215310eef96c8e6c35e102a0e7c 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ns2> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
index 3ef8c8d3d180e963df8753d5c617757bbe1ffd92..6f67c5db6369c59709f6ae32230cc52409d4ca6b 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ns2> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
index 2df688c8e876836270d78ed05c2f7989926e2fdd..cdcc09641e92a30fc05d85cc39946b4fafd9ed3f 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_CONSOLE_MUX=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ns2> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
index 50e6b70bc9a025ade8e3dc7c1e277da8a81621e1..6a6ea29ec42588284dd5738fad5925c604b0d703 100644 (file)
@@ -10,11 +10,8 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -46,10 +43,11 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Boundary"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Boundary"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index 61e5ea4e21efd645ffcddf99183d549d90d61be8..ea8831665b1aabb42e6f7138bacb067d3b564084 100644 (file)
@@ -10,11 +10,8 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -46,10 +43,11 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Boundary"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Boundary"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index 9dbb7181ee23d0a89e418d28755713c731334a62..ceea2a4ea76dfc2ea79740860bf4accfc450dfcc 100644 (file)
@@ -10,11 +10,8 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -47,10 +44,11 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Boundary"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Boundary"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index 5478390fd8c35797e8c5b789a8ef38a1cb9525f1..75d4ef1ea9422d8b015944d14914ce692b856060 100644 (file)
@@ -10,11 +10,8 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -47,10 +44,11 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Boundary"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Boundary"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index 01881686429b9a17ab065bacd74f62563787e260..960f488648bae067d06a3edde7de07b2dc3d1206 100644 (file)
@@ -10,11 +10,8 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -46,10 +43,11 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Boundary"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Boundary"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index 51f1f91be85474e2e404e538f0b8fb1f39df2cb3..eb7f40a5b474c17ac21a9f3bc43974e08fb1b6fd 100644 (file)
@@ -10,11 +10,8 @@ CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -46,10 +43,11 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Boundary"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Boundary"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_OF_LIBFDT=y
index 44f8759adb029c6f1b23b4a45a67cd9acc196fa8..8b4d1d673de15281df2cb2487350d2b251e57ab7 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SYS_PROMPT="Nokia RX-51 # "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_CMD_BOOTMENU=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index 2921525f9fb0a9160456d70aeec7b43ddaeb2b85..81e2e14192834b31fa94da95df30bfecaa560b1d 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
@@ -48,6 +47,8 @@ CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index 6a841698f8af0a5fa2ee3999c655798e645b7297..3f592506bf8af7cf4cf5a1246848e80e61199b32 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="nsa310s => "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_NAND=y
index 83eb12b2c18dc205a2eb8663ab9968a74d7d1d21..12fe5f77c64f4a5009613bb9807d3a5f7e5b1323 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyARC0,115200n8"
 CONFIG_SYS_PROMPT="nsim# "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_OF_CONTROL=y
index 91e4e39d71d9216824a4a1b501ce2136c2dfc888..6c0dba7c6d0581da356609fcb2eca86096ad9868 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyARC0,115200n8"
 CONFIG_SYS_PROMPT="nsim# "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_OF_CONTROL=y
index c630ab70079509b53d519f2eaa37a10b6b599541..bb31adb381df03023cd72ccd930b329ea4d55652 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyARC0,115200n8"
 CONFIG_SYS_PROMPT="nsim# "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_OF_CONTROL=y
index 9d31f83733b3e4df4a5d3feada9d9a94fc3bcc5e..a2cc238433f7edf0da4e9d9d638829d9201bed12 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyARC0,115200n8"
 CONFIG_SYS_PROMPT="nsim# "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_OF_CONTROL=y
index 29d918d974e4fe01049b87667bb600681f2c68bf..64687fb4f42710d416d0229f94b26dc020e7e717 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_BOOTSTAGE_STASH_ADDR=0x83000000
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra124 (Nyan-big) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -65,11 +64,11 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_DM_VIDEO=y
index 52e0a67dc04584429392332cbf9d12dda6471f2d..f7f8016644077665e810e78f75759b55a8ce76dc 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEBUG_UART=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_LOADS is not set
index a5e47c84f24813ff08d4fe2850929547fd5ef8d5..5481188e64107613a8e81b270829e3fa0d35ac29 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_FIT_BEST_MATCH=y
 CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_PROMPT="ODROID-XU3 # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
@@ -43,10 +42,10 @@ CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_PHY_SAMSUNG=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Samsung"
+CONFIG_USB_GADGET_VENDOR_NUM=0x04e8
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6601
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Samsung"
-CONFIG_G_DNL_VENDOR_NUM=0x04e8
-CONFIG_G_DNL_PRODUCT_NUM=0x6601
 CONFIG_USB_HOST_ETHER=y
 CONFIG_VIDEO_BRIDGE=y
 CONFIG_ERRNO_STR=y
index 0dc1a250c5d0156851d8053964721db27c824778..bca423e4452b01d5fe2376950074d55514b2e95d 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Odroid # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
@@ -56,11 +55,11 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Samsung"
+CONFIG_USB_GADGET_VENDOR_NUM=0x04e8
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6601
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Samsung"
-CONFIG_G_DNL_VENDOR_NUM=0x04e8
-CONFIG_G_DNL_PRODUCT_NUM=0x6601
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_ERRNO_STR=y
index cf888f3491aa98395fc17c65996d5a5f44f5fe60..9e7e1545d00e839bf6b6285c28ea0f4314179703 100644 (file)
@@ -9,10 +9,7 @@ CONFIG_SPL=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x240000
 CONFIG_CMD_ASKENV=y
@@ -48,10 +45,10 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="TI"
-CONFIG_G_DNL_VENDOR_NUM=0x0451
-CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USB_GADGET_MANUFACTURER="TI"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_MCS7830=y
index 962ffa072996f5299f4f720fe2b20eca0fb39cde..8c5b2d7c94e4fe93b9320bfd338539061b2f5427 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_SYS_TEXT_BASE=0x80100000
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_OMAP3_EVM=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
@@ -13,12 +12,10 @@ CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SYS_PROMPT="OMAP3_EVM # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -52,10 +49,11 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0x5678
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
-CONFIG_G_DNL_VENDOR_NUM=0x0451
-CONFIG_G_DNL_PRODUCT_NUM=0x5678
+CONFIG_USB_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_BCH=y
 CONFIG_OF_LIBFDT=y
index 5e35efa417aa1403fb76320eb9dad00c31190fb4..af60ca84c2d414d0bfdfa29d9403e5ead7b3dd7e 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SPL=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_I2C=y
index b8f25883d8de14b26d6f1eb072b64c8d6bf5080f..bb7875f5a6ba80f1f67b8b8ac869bba893db7827 100644 (file)
@@ -3,22 +3,18 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_OMAP3_LOGIC=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_DEFAULT_DEVICE_TREE="logicpd-torpedo-37xx-devkit"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="OMAP Logic # "
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x240000
 # CONFIG_CMD_EEPROM is not set
@@ -46,8 +42,8 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="TI"
-CONFIG_G_DNL_VENDOR_NUM=0x0451
-CONFIG_G_DNL_PRODUCT_NUM=0xd022
+CONFIG_USB_GADGET_MANUFACTURER="TI"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
 CONFIG_BCH=y
index 5d1cbe993aaa81442b1edfda9251f1359d6a7ebe..4f6f32e210d711f57ba96f044c2482ead7c0ccbd 100644 (file)
@@ -2,19 +2,16 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_OMAP3_OVERO=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Overo # "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x240000
 CONFIG_CMD_ASKENV=y
index ae534a2c3e6347c9bfdb954ffe5589111e4fb4d2..2765f02d36c65e6ed5446256cc95a3f1bd287bd1 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SYS_PROMPT="Pandora # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index e0aa04b8bb9f1786d6b416c0963a859dd651ded3..e50de33d840b2b6fa7f130e212354f3b324b4f1c 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index b2d6c0aec7152acb4cbe9194c9148ea02ae30332..d208d0ca8ecf4baf1d673fa2f018b32c2a456ea1 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SPL=y
 # CONFIG_SPL_EXT_SUPPORT is not set
 # CONFIG_SPL_I2C_SUPPORT is not set
 CONFIG_SPL_OS_BOOT=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
index 13c4dd5b389b01f332ad28a2f155348ec62991ed..c92b842e8de12a19ad427241e8a51134455203ee 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 # CONFIG_SPL_I2C_SUPPORT is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index 6e860ef5e32d850dc75932dd3205d8853df4cca3..acf8962201f39eb9f9981a6670136294d758aa81 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
@@ -49,10 +48,10 @@ CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0403
+CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
-CONFIG_G_DNL_VENDOR_NUM=0x0403
-CONFIG_G_DNL_PRODUCT_NUM=0xbd00
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_FAT_WRITE=y
index c95134bcf9907c514249cb98683d0bd79534afc9..973c16fc0962ad5736cdbeb429adcda20caa73fd 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xb5
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_EEPROM is not set
 # CONFIG_CMD_FLASH is not set
index b2a0e04d36ce4829fb91309cf7a9059ed91e161f..e7c49f2c8ff953dc16359c0bf09b664d36c5ce73 100644 (file)
@@ -5,8 +5,8 @@ CONFIG_TARGET_OPENRD=y
 CONFIG_IDENT_STRING="\nOpenRD-Base"
 CONFIG_SYS_EXTRA_OPTIONS="BOARD_IS_OPENRD_BASE"
 CONFIG_BOOTDELAY=3
+CONFIG_LOGLEVEL=3
 # CONFIG_DISPLAY_BOARDINFO is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_MMC=y
index 8b1d35edd10f273efcf2282563e7cf9801cf5a46..c9233e062d7b9a601a9452558317acf6eddfeda4 100644 (file)
@@ -5,8 +5,8 @@ CONFIG_TARGET_OPENRD=y
 CONFIG_IDENT_STRING="\nOpenRD-Client"
 CONFIG_SYS_EXTRA_OPTIONS="BOARD_IS_OPENRD_CLIENT"
 CONFIG_BOOTDELAY=3
+CONFIG_LOGLEVEL=3
 # CONFIG_DISPLAY_BOARDINFO is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_MMC=y
index 4cc0205629f6bee42a72c5ef7254d93da08189db..5baada9216db06612c754f412b152fcb2fd254e1 100644 (file)
@@ -5,8 +5,8 @@ CONFIG_TARGET_OPENRD=y
 CONFIG_IDENT_STRING="\nOpenRD-Ultimate"
 CONFIG_SYS_EXTRA_OPTIONS="BOARD_IS_OPENRD_ULTIMATE"
 CONFIG_BOOTDELAY=3
+CONFIG_LOGLEVEL=3
 # CONFIG_DISPLAY_BOARDINFO is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_MMC=y
index a880c62eb6ac8cf18c2d9be77dc46fc0a352d4b6..6b1aa7bac2dd9c6efa4921c3c1eb6d932cd282d2 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_CONFIG=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
@@ -79,10 +78,10 @@ CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Armadeus Systems"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Armadeus Systems"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_OF_LIBFDT_OVERLAY=y
 # CONFIG_EFI_LOADER is not set
index 7c9cc454c30b451f27970e7898d6e4a4c2672199..efa631f8a543f9bae56f66a1f30504eea98457e2 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 04910bd90712235d1e55163f19692d4b91effe4d..875809e92b57c60bbcd2a57bf34c20d88ad1e3de 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_DRAM_ODT_EN=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-lite"
 # 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_SPL_DOS_PARTITION is not set
index 2e5eeee715f173b05b2c255fecb69aff1a148647..36feab204cb32b76b57a01f4a3e3904c33e6f9a2 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_DRAM_ODT_EN=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-one"
 # 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_SPL_DOS_PARTITION is not set
index 61b2d98705b90d87d50fbfce670acc742170bcc8..5918e729d126a1d16e6a26753834fd90f829e639 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_MACPWR="PD6"
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-pc2"
 # 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_SPL_DOS_PARTITION is not set
index df834a2c81addcc6f2365b4073eda5790a6a6703..b0d69946d59794b7d738eb1cd6d62b4f7ecf0b0a 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-pc"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 2fd2611769abd5e89b93d2f9cbd9f90b07ae98b3..c4646090baee55a038180204db25a6fdfb1575db 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-pc-plus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 89bb059a860f3a65c2df14f0c6d0a53c79776507..a852b4c3e8ad43eb1f4eb19675c2ed165762fbb8 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-plus2e"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index b9b420764d2d4d9f36e80a8a67a577af9d375303..70e189859eb916d701c99053dd90cb4f456c7c78 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-plus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 103936d77243d454de00afb57b9d93c476e465a1..3d87374002b96517bb0304baef44dfc94e530b61 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_DRAM_ZQ=3881977
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-prime"
 # 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_SPL_DOS_PARTITION is not set
index a3e278f72abf1591146408031b4ba45ea989963e..f9c3d4acf9fc1c16e446e586579c4c809d45a2b8 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-orangepi-win"
 # 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_SPL_DOS_PARTITION is not set
index 4d8d9262cbb486875546294d4bb8db190f57f214..1a16ed1ad6e0a59124b846e2ded49c2c4a5f90e7 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-zero"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_SPL_SPI_SUNXI=y
index 57c63b962aa074cf00a234e233cc4650e6d9bca3..a23a61169694fff0aee1f3925546124e9e4cc2dd 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-zero-plus2"
 # 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_SPL_DOS_PARTITION is not set
index 298e7a4943713e27cb0962db45df1914da493961..2cb55393712548f0b5f88100b3fecedd01dc96dc 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ORIGEN # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
@@ -41,8 +40,8 @@ CONFIG_MMC_SDHCI_S5P=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Samsung"
+CONFIG_USB_GADGET_VENDOR_NUM=0x04e8
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6601
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Samsung"
-CONFIG_G_DNL_VENDOR_NUM=0x04e8
-CONFIG_G_DNL_PRODUCT_NUM=0x6601
index 9ee8e18ed5a55bc1c281b2b503d1bb17cd328779..bc37f89f4898853dd9128c62df7cbed288a8c1c4 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index eea44fe1aa5ea8fd2a271ef7ae352e796fa0373c..518483c5d9855284a6fd81dc7d77287770c95df6 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index e499b82d344f0c649ea4f32f26a4422f40be9d8b..4ebfcf5667d55124e9a63aa5ef2af608db8f2ce6 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra210 (P2371-0000) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -36,8 +35,8 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
index 3330d23e40892701734eb9fc5e69dca2f9bcbc4b..8b3878ed374cbdc44a1c2c0348ba9f2da47ada55 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra210 (P2371-2180) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -43,8 +42,8 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
index 9259c1316e27f6c5262c17b35464e0c0acd3c276..b4fb16013f7cfcb3694f5b84a9c5c76c73f3e8fc 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra210 (P2571) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -36,8 +35,8 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
index c55fd6542ab4f8edd4e1a1713c3c802c5a3bba98..83f2ccc53d276a23b61f125e68206188695048c0 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra186 (P2771-0000-000) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 193d1782de294b1f69866490e11be5ce803b1e94..b684e33b1bcde60a91d1d05bef4eaa3694bf5525 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra186 (P2771-0000-500) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 53825eba33c369f58679b7a5d9d1df9a96984792..c7dc889a16371d22e8b34ba752e889749cd65c5b 100644 (file)
@@ -13,8 +13,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-r16-parrot"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_FASTBOOT_FLASH=y
-CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
@@ -23,8 +21,3 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=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 e05184c9993e29f1b6649d8ccaf6bcae71b96780..5db1a0f392e87f208e53d7f04e4360aad51d4908 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra20 (Paz00) MOD # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 46a2b3ebfbfae1b102f67cdcd484c2e40e0be14c..619e9a9c23cca8cf537e7e97615501c9d7495531 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_PROMPT="Pb1x00 # "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index 1683f88b690b6d0dc60d7be6dfef4c9f90ef7bdb..876241e1591f570b917e19fba55e8f6ff68b995d 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
@@ -60,5 +59,6 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index d082bb4af2041d3880deb96040f765f10f172484..71702d77f3e80b7f50f1f379d865dfc08ec7f8b1 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
@@ -60,5 +59,6 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_ETHER=y
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
index 94b7c2297678a6f95d75106e0365501ff9e86432..bd0048559c3a01cab9bf6107d11192cfda5e3a0f 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
index c219ee48449ba5cb94e027144fca5d09ac0edba7..5ed92b9ea8b37472be2fd313ed5758aa30451540 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 60339e7312a95b6eabc137e4141e989afb73bff4..6900f3d77ffa0e502669f78829639f1b1b0ad061 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_FIT_BEST_MATCH=y
 CONFIG_SILENT_CONSOLE=y
 CONFIG_SPL=y
 CONFIG_SYS_PROMPT="Peach-Pi # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 745840ece2914c7dfe765e3e145206cce8a12d28..b073d820a3f5502b0a0085ad59b94e6d7e831e4a 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_FIT_BEST_MATCH=y
 CONFIG_SILENT_CONSOLE=y
 CONFIG_SPL=y
 CONFIG_SYS_PROMPT="Peach-Pit # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 569f12c4b00fecd6c0fcf16334c35d6e263bc43b..0c8a6071a8167a436beadbfbebc6a299848f5e6d 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x240000
 CONFIG_CMD_ASKENV=y
index 7ca5fcc353d4ad70727b740a1d57b82d55b94eb1..0e7c35e015cb7eea4a8eb459c9311773085c9247 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="pepper# "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index bcd83edebb9f78fbb2d1ef995559f0961ca7f119..37ab8e244069d89c6e0519f4465223098a1cae3c 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 93ee353d0dc2005f9682b46dd1bcaa6836ec0022..bebc877ab809c116ce6e48c649b9776d4731305a 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -72,11 +71,10 @@ CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index c314f9614b7140a5798bad50faa210cd41597e8a..107579379640ce8c1770bb0f6085ee2f68d92bf0 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_DEFAULT_DEVICE_TREE="pic32mzda_sk"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=5
 CONFIG_SYS_PROMPT="dask # "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_SAVEENV is not set
 CONFIG_LOOPW=y
 CONFIG_CMD_MEMINFO=y
index abafc65f578c8f43c08d0e255be43448f365b688..09b36ccb09a55946fb3a19dbe653fa742c8d16e1 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-hobbit.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -32,9 +31,9 @@ CONFIG_PHY_MICREL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="FSL"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_OF_LIBFDT=y
index 114c397d2e9295bb4a40b40ce05d1a5272d34f35..c325e7f851713a1270ff3397d6a3e1c065aa3d04 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTD is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -28,9 +27,9 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="FSL"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_OF_LIBFDT=y
index 80dbbb65ba76291a16a060f342a8b86bb5824025..ae099c733b87f53143686326fffb7ecc4d2cfef0 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
index d0a957b9b7b493252287af7c98f3775f861430cb..01ed23844b36124c9c8d9cc6fd08bc7ede0c8759 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
 # 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_SPL_DOS_PARTITION is not set
index d9f65c21de86f2b3b681a4300727dcbbc82527cc..b6d6b58df1e57d16e96d20b60702236e9f420de7 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="picon > "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 5cf8d9ebe63ededc2783fd240fbe3319354541ba..38e228c16b6cd40df8cfc2182173996ebaf6d616 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="titanium > "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 1c3c8d4e539b22ec421d665b814032c0b7522796..a832e5271151508d6a0fa8df8151648f11c4ce1b 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra20 (Plutux) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 8b2f405e2686dc54aa9afaf33591bf6620b81b06..7dbd45a1106c29cb130efc668eb5b36c332649df 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="pm9261> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 21f57cb80238aea01e5b7c4b2bb0df9b1748e657..fc46de3775019e86cbf1511aac51b8e84df1f76b 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="u-boot-pm9263> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index e86b09cf05869f91eabf34104c1014a184dc486a..4e5181b762c7a5471ac4352e424d2f6b0481a5a1 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOOTARGS="fbcon=rotate:3 console=tty0 console=ttyS0,115200 root=/dev/mtdb
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_NAND=y
index 561cc768b58fc763a0d704c89a2ebfe3d696c283..82f68d9e0e82fc0c518c658970c38ce35c5623e7 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_IDENT_STRING="\nPogo E02"
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="PogoE02> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_NAND=y
 CONFIG_CMD_USB=y
index da120ede94d9e148a9525c5af41837c6ca6eb325..416c91ab03348f40d2a12692f0fd86acc66a89ea 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-polaroid-mid2407pxe03"
 # 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_SPL_DOS_PARTITION is not set
index 7b31abcdc305570f527bfbcda1cd72ef57ae859c..57648c9419343f49a51ffcf01bde807e9fd36f9e 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-polaroid-mid2809pxe04"
 # 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_SPL_DOS_PARTITION is not set
index 303743d94dd70bd6a99d8f0e3b1bd3043a97c6ac..4f8cc4c95e5bf713c489b232bcc089add40f134f 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_DEFAULT_DEVICE_TREE="hi3798cv200-poplar"
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SYS_PROMPT="poplar# "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_UNZIP=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
index 5e99f9c08922333d298991db139ce79be7e7fb6f..7453aca4361eed56a27559ba654dc2b9e4ac7bb5 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -69,11 +68,10 @@ CONFIG_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index 882ff2a9c171069ac20bed61c8f63b9344d6fb96..ac36dca9725e2f7a261162567b90894a93f92107 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 351f16b151e204ffd77d9c80d91e4c8c693e4a59..7731d35a7862a11f52db552904ef0fe294b195f2 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 16ac1a6ad5af2ba21f7a6bb39a8577d62292df36..94de25c188dab1195deca510202d70b474713817 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-pov-protab2-ips9"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 2ab2516c018426f60d567076624f35dc0aa0ecbb..d8b24f190527122ae6e129dc8949965f110b4644 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x4000
@@ -20,8 +21,9 @@ CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -63,8 +65,10 @@ CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_ROCKCHIP_RK3399=y
 CONFIG_DM_PMIC=y
 CONFIG_PMIC_RK8XX=y
-CONFIG_REGULATOR_PWM=y
+CONFIG_SPL_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_SPL_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
index 38370ee8d8f58dd728c92c66b559959617875f9e..9ad958af1fdb1ac978e285d13f9c212d31530584 100644 (file)
@@ -32,7 +32,6 @@ CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -70,10 +69,12 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0908
+CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Siemens AG"
-CONFIG_G_DNL_VENDOR_NUM=0x0908
-CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_USB_ETHER=y
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_SYS_CONSOLE_BG_COL=0xff
 CONFIG_SYS_CONSOLE_FG_COL=0x00
index 321c3a648baa16649908e59dd08e50ef756d6a13..f07eaa6d8bb2124e2c9d172d398eb2028f7c53ce 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-q8-tablet"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index bd95f9bc997b112c3cf1304261f813082198429b..7ee1ea3dacb0761dd8c99782ad7701cdb54f7530 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-q8-tablet"
 # 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_SPL_DOS_PARTITION is not set
index 51509d3acbc4f3b8a2bd088df71aefaa5a6da6ac..c4819b95c128b40686330dbd98a81744bd4620c9 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-q8-tablet"
 # 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_SPL_DOS_PARTITION is not set
index 1349269b4d12a40ee2ab9cd488d9453d9865ba6e..e3e6b943b9a605b6e2d26eed4c47c70c81692481 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-q8-tablet"
 # 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_SPL_DOS_PARTITION is not set
index e653bd4c9c35820c7d0dd6b7adc66f99f93b6104..f1db0d0fc9a24081a7ddb9e52461fb060190e387 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_PCI=y
index 67e9a45fbcc8b6cdf9f72df85445c7acd1ec8f2e..516929fd886c06bd6883a049aee240f2670ece7d 100644 (file)
@@ -31,7 +31,6 @@ CONFIG_SPL_RTC_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_SF=y
index 7ce97ff09134592c7d9b9f3ac4f9e0d5756a46e9..8acd9e101e6cba8ac27fb603c56ac463873019e6 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_PART=y
index 11a4a9e8323de0e2dc3b81cfeb523ec987ce4c23..0563164cdefb333ebc66f700d6ba71f0f7088ea1 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_PART=y
index d123de20110d8d88b82a2d34836420b7dd759c2e..8a4ac9de7c018d53fe514f2615e1a6e3ae75717c 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_PART=y
diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
new file mode 100644 (file)
index 0000000..f353eea
--- /dev/null
@@ -0,0 +1,27 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_ARCH_QEMU=y
+CONFIG_AHCI=y
+CONFIG_DISTRO_DEFAULTS=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB=y
+CONFIG_OF_BOARD=y
+CONFIG_AHCI_PCI=y
+CONFIG_BLK=y
+# CONFIG_MMC is not set
+CONFIG_DM_ETH=y
+CONFIG_E1000=y
+CONFIG_NVME=y
+CONFIG_PCI=y
+CONFIG_DM_PCI=y
+CONFIG_PCIE_ECAM_GENERIC=y
+CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_PSCI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_PCI=y
index 4966d69d2d52397a91bb7aa0c8bbe31c83abd748..9150df8899281625ee29e9423cc33f69dadbdced 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_CPU_MIPS64_R1=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="qemu-mips64 # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index b99ee21fb5314e59764abe133bff01f5089913d8..c5ada7b1d3016dda1cae6a8deb712b158b791611 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_CPU_MIPS64_R1=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="qemu-mips64el # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 9af92ad0df50fa024aadab6dab490962c1fa8300..caa15738eb3d8f9b279bc41f28aecc1b85d34d25 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_TARGET_QEMU_MIPS=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="qemu-mips # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index a68315ac7040587f33b28cf3e0f453f9879b0a4e..c2af8b8985e5de44c46be8f8c1a3fd2859921184 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_SYS_LITTLE_ENDIAN=y
 CONFIG_BOOTDELAY=10
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="qemu-mipsel # "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 77e7f0c7fc8d807071f5694b6b9d2a2d9613d2d7..e0b19bbb7f6159962e555867ea097c09801feac2 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 96d3b529e922174d620eefdc5f43183fc1be28a9..a0bbe74907daf9f9f84fe67b2d015f679bf1fae1 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_TARGET_R2DPLUS=y
 CONFIG_BOOTDELAY=-1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttySC0,115200"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_IDE=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index 137614cfa31fb87aea97e0678c2ad68a9b24b9ef..595f405d68f992ee36614b8944e6efc38022f43f 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a10s-r7-tv-dongle"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 8918aff9e016bf60171e8fff9589999a3a35cd01..46d59ae806655bee2280d938795e09988614ff83 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTARGS="console=ttySC0,115200"
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 0391e34639f00931ee028ab84d340eabe5a9c401..e32aceba5497215c892884eb55299a57a309d8b8 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_DEFAULT_FDT_FILE="r8a7795-salvator-x.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
index 643df71d37e4461b251f578a7488c3e9e51c6d74..50d36891cc3c63a56fa6901fd88305634574fed9 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_DEFAULT_FDT_FILE="r8a7795-h3ulcb.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
index 83ef46c13a081ac34a54361edc086cd4bf3b2948..8f22645efbd019ba5016a7d00117efbab2a57466 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_DEFAULT_FDT_FILE="r8a7796-salvator-x.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
index b7d6088224aaeeffaa395785b78824fa2ffde69c..c8edfabc91156c579d93a2c442d1e45b78e0f98e 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_DEFAULT_FDT_FILE="r8a7796-m3ulcb.dtb"
 CONFIG_VERSION_VARIABLE=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
index 5acfe22b0a6d4509e68783262fc332ff57e826ed..3c0b595859053252ea0343fe7ba0c737a39106f8 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -66,7 +65,9 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0908
+CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Siemens AG"
-CONFIG_G_DNL_VENDOR_NUM=0x0908
-CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_USB_ETHER=y
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
index 785dca922a7f237e91c928caaee595eb761c46f9..846c00afb3296581266b85392d92312e392e39d3 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_BOARD_EARLY_INIT_F=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index b41644ef5fb365d94f458675b2bdf7002c2337d1..c76a0b9592f1604b88b6270b257dbf1a6fd87176 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -67,11 +66,10 @@ CONFIG_SYS_NS16550=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_DM_VIDEO=y
 CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROCKCHIP=y
index aaf27751d4ecb5a99aa93985ad01740ea0aa6105..557ed880f22806d181566fd065f909fd99d0cf7d 100644 (file)
@@ -13,7 +13,7 @@ CONFIG_DEBUG_UART=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
-# CONFIG_CMD_IMLS is not set
+CONFIG_RANDOM_UUID=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 23456977011356bc4fed7252786aabff17f21d4f..c45ffb65aff74e0a827bcbc2cc6c514a97b15365 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
@@ -26,7 +25,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_DM_VIDEO=y
index bb56a9e4e10da245d1093ab57b082932f9691f06..f7aed3579748e74b50211733752fb056e8e659fc 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
@@ -28,7 +27,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_DM_VIDEO=y
index 6edacd69a2b419ea282de4bb35adbada215da352..9416e3b8fe9f2da6a3c6abc04e13da76e8cf6495 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
@@ -28,7 +27,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_DM_VIDEO=y
index 2e81966c1463adaeb32500592e5b7a9245ccf217..3bfa745c2eed7bb5e2c442348951e33f887b1544 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
@@ -26,7 +25,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_DM_VIDEO=y
index 1aa4676583a8948873d063cbc42afc5a908e9d26..7768e46716815140a1ada63a79db3faf3fdb4bdb 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 9a1db162fadca70b1c6b250adaacbd1c1a3c8384..38ae45f01a9d0911eafbb42c0d1e32f8ba96b72e 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_TARGET_RSK7264=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttySC3,115200"
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_SCIF_CONSOLE=y
index 4a78cb6a218c4479d174f71d60e2efe729008c37..a23f4aa64d02b3776787d9548df7b744467e32b4 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_TARGET_RSK7269=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttySC7,115200"
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_SCIF_CONSOLE=y
index 6ec8ff35710e117b31afd81c0c446846ee068b10..c1b9577e0bcef7855058b34356c16cf2b9de4320 100644 (file)
@@ -33,7 +33,6 @@ CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -71,10 +70,11 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0908
+CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Siemens AG"
-CONFIG_G_DNL_VENDOR_NUM=0x0908
-CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_USB_ETHER=y
 # CONFIG_VIDEO_SW_CURSOR is not set
 CONFIG_SYS_CONSOLE_BG_COL=0xff
 CONFIG_SYS_CONSOLE_FG_COL=0x00
index 7d8792cb0580688df765c5a9b4c5ee128f0f72dc..2749f2d893b165331312b5ca7a2466772ec6a1c1 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Goni # "
 # CONFIG_AUTOBOOT is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
@@ -35,9 +34,9 @@ CONFIG_DM_PMIC=y
 CONFIG_DM_PMIC_MAX8998=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Samsung"
+CONFIG_USB_GADGET_VENDOR_NUM=0x04e8
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6601
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Samsung"
-CONFIG_G_DNL_VENDOR_NUM=0x04e8
-CONFIG_G_DNL_PRODUCT_NUM=0x6601
 CONFIG_FAT_WRITE=y
index 16352ad7a0617e51fd48be96ec2e068db452fa87..09c5a50fc6b5a7a2d1a2e56f016c185addcca7f5 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Universal # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
@@ -46,8 +45,8 @@ CONFIG_DM_PMIC_MAX8998=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Samsung"
+CONFIG_USB_GADGET_VENDOR_NUM=0x04e8
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6601
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Samsung"
-CONFIG_G_DNL_VENDOR_NUM=0x04e8
-CONFIG_G_DNL_PRODUCT_NUM=0x6601
index a482f8f695cc2d7d63d20f8a382f972a658fee84..cfc56cba37c93b45d03795e0c3e3154d7bb57853 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
index 18d51131e6a686b4a60e5fbf7f046a8633f815f0..b9675a983d2be539443cdd78304642d613428d5d 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_I2C=y
index 3f1eb906488bd7a99598454dfe218cef5e9d4a1f..cfbdbb002517d2008e354171f88bcde6547a3159 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_BOOTARGS="console=ttyS0,57600 earlyprintk mtdparts=atmel_nand:6M(bootstra
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -29,4 +28,6 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_USB_ETHER=y
index ad62f47063e8369f78c98f94c0b066b119d93531..25ee07740ec6b550c12d9fb1cfecc46e20597fb7 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_BOOTARGS="console=ttyS0,57600 earlyprintk mtdparts=atmel_nand:6M(bootstra
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -30,4 +29,6 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Atmel SAMA5D2_PTC"
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_USB_ETHER=y
index 215961a65c0deb882cc496f9e7b51ff4fb70b19a..2248d672b155697ce17875ba3454e1e28ab74156 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_I2C=y
@@ -82,3 +81,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 869d405838e55e5dedbdb0ae5d7464a6eaef6829..4c5d0295e6b15d6bb548dd1bdf92614cb3dc5255 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_I2C=y
@@ -79,3 +78,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index b6c60cbcae69340b229ad3c51710882e3a1b0e40..18527f69d1190112ebc36090295db5edd61dc091 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
@@ -55,4 +54,5 @@ CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
 CONFIG_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 01b57efe03da530de16229930de6ed167bb4ac08..01c502d9fc806810151d01aa3364ef09e09f406f 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
@@ -55,5 +54,6 @@ CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
 CONFIG_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
-CONFIG_LCD=y
 CONFIG_FAT_WRITE=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index e29e3a809811fc1d8108d234d52ea2c06afb5ca1..c34de5b06607a3537e36d8a6fccd31effd061780 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
@@ -55,5 +54,6 @@ CONFIG_DM_SPI=y
 CONFIG_ATMEL_SPI=y
 CONFIG_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
 CONFIG_FAT_WRITE=y
index b30968d9cc383d2ce150ff615496681538339e37..8da4f4e850f672375823d9bcee5ca5cfbf8beba3 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
index 65af64f797492853aa94fd2889ff3ec9403bd4d5..98152afbbc7afe45cce574b2784c2deb9544c3f6 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
index f45449fd93f6514fb3ac4f564245b29083939b2e..cf57936cad3dbdf6c6d7ef74668fd98476411495 100644 (file)
@@ -25,6 +25,7 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
@@ -81,4 +82,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 6217600f01d2941513d9de23c1945554b1f738b6..c34ff17f8b8a81adca5a2e9b5e67cc35ca818009 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
@@ -76,5 +77,6 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
 CONFIG_FAT_WRITE=y
index 2fe08e4e59a30f07b67b9ac86a1313a27beb1ebc..e48813d7fc5c1eedf6ca1d2b9fbc98d45fc77ce1 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -77,5 +76,6 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
 CONFIG_FAT_WRITE=y
index dabbf605c5a928b5bb01ecd9e30cd8d1cf12de48..b7faf70c552fa0d6da867e5211a5bcc62b1908e6 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -78,3 +77,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 85157878cdab5962b236d1f3bac5569cb71bdd66..7255d473b09a3f9dc16749f2204153b50b042e24 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -75,3 +74,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 4061720b3a835a43696c7db9819f67e17f7d65ae..c93705ba2d3b5bb4f2ffd6cfb9f07a8029f1d299 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -77,3 +76,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index aaa5855b220617e9dc6d55787ebaecedb352949b..97c59bd9d7a552c3a233c12afadbab30fde0e49d 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -78,4 +77,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 901d17bfa337f50c1a40491cb866fe7d8d7bebd1..e4916082981f9e24267da895a8b5d80d18cb3b2e 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -75,4 +74,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 535031024b31f3ddc2afac67d764ef1cc42113db..8d7da40870753bece775af7b8beb33ff32f2f02b 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -74,4 +73,5 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_ATMEL_USBA=y
-CONFIG_LCD=y
+CONFIG_DM_VIDEO=y
+CONFIG_ATMEL_HLCD=y
index 310b8acc293a35bfea9a99dea2ebb2e758f9be5c..08eec8ecc6f9495353dc8e62b9445a543ae20e23 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_ENV_CALLBACK=y
@@ -60,6 +59,7 @@ CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_TPM=y
 CONFIG_CMD_TPM_TEST=y
+CONFIG_CMD_BTRFS=y
 CONFIG_CMD_CBFS=y
 CONFIG_CMD_CRAMFS=y
 CONFIG_CMD_EXT4_WRITE=y
@@ -175,7 +175,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_DM_VIDEO=y
 CONFIG_CONSOLE_ROTATION=y
 CONFIG_CONSOLE_TRUETYPE=y
index 50ea35e64bc72b7f09ddb5e31514e39ad0addf24..1aa28c7e9f28e26cd9afbaa7e9a912ad3ddfe5d0 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_LOOPW=y
@@ -160,7 +159,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_DM_VIDEO=y
 CONFIG_CONSOLE_ROTATION=y
 CONFIG_CONSOLE_TRUETYPE=y
index 693c14bc60034c070c8311ad694dbfaad9ee73c6..b2f55d9ba7da8eb099fcd41572046a1cfc9f2401 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_ENV_CALLBACK=y
@@ -168,7 +167,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_DM_VIDEO=y
 CONFIG_CONSOLE_ROTATION=y
 CONFIG_CONSOLE_TRUETYPE=y
index db9129456bfad9c359977c5fd2a3672d12e83386..dd0322015ecda30c896c5251753a42256e445279 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_ENV_CALLBACK=y
@@ -178,7 +177,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_DM_VIDEO=y
 CONFIG_CONSOLE_ROTATION=y
 CONFIG_CONSOLE_TRUETYPE=y
index f6ce09c366b465044d79a1521b7d51efd7801e21..0615cf385b17e4ff4baa4c0461d23684cf1900cb 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -32,4 +31,6 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 CONFIG_OF_LIBFDT=y
index 2f0991895cc7f50d012fd9a97e262b3e2f14adc0..b40d15365c29ac507c9a24bd481a3790c5ae896d 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PCI_33M"
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index 880f6da08ea791230eeec08a76fbac1637f219a6..854dc19219e44c89f79735503309b490af9032af 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PCI_66M"
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index 77955185433b4ca2dffffa642dbf54d6b5a83f26..0b6865aa0f55b7474c432e58088eee2d1f123cda 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_MII=y
index 21d172d04c78d5241b9759804930101a05c69143..66a101ad2e18a47b3e1df8ca2ddda698282079a9 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index ac4a37b34b6a94ca8e3e12da334b8af2c53989aa..4efb0729b5b78acae8bed05ef8d9d9266e018e11 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index 826d888f0a49b2fab043949f04c9f8c477c4420a..310500122843751cb8a8fd5ae015ebfd0ec6d962 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index 77ec0c81ba64246d56d6bea17bdf6dbcebba1c5d..78eccd87a71e9f67f032258517c91849b595a69b 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index c31ee2ea978e64fb81b630a53848fc50ea08236e..a2cedfc777195917e1e7a1cc4f80e898889e941a 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_BOOTDELAY=10
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_MII=y
index 6bb2ed6290e0fda34f2fede7a122fd2dfa83e296..4bebdb3054066466d4c2de338e4fbb6c65a6b7d4 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index b189e30052386d1c5d4d51d994691b12073c56b2..faebc04bd26d68630fb10db6ff22ba621fd7d15d 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index ea4546bce4a0cc8a7fae81c7b01966fd4e9dfc5f..c8cc3b600174fcf039ff259bbc61787abb984e48 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra20-seaboard"
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_PROMPT="Tegra20 (SeaBoard) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
@@ -36,7 +35,6 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_DM_VIDEO=y
index beee76ee4a6d6ba610d788750417df423a60cc5c..4810a70167c36a14a2431e2530871f443f20dd4d 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="SECO MX6Q uQ7 U-Boot > "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 37a85ccf44d2f6b2a658c1cd32c1f9d990e6518d..985b830b1808af8b847e4a992bc1837be5e4194f 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_LICENSE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
index a8286587c31606afe3fc5832277b8b479de1fbd0..3152859071d4e3edb04c878c821c4f2264027839 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index dd3522d75768463f73681bd43de37efb01075316..259d6a7e3dc4b8d388bff52b159732cfa346c735 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 231c0a1b5aa844bb84f5bd3e605047412749931b..b2e7362e2f58f1eccfb7a97d95342497ee3a8360 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 5aa008b95884d2bf4e0ee0bc98d072d26686e8fd..693a873ddd09e595a5b761f536cc6ca3c2bafe7c 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index a92f981ee660ecfa8b56b1973f866505f36e77e0..bc7234b950fa241185ea3c50adab4b4536917bb7 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index a6dbe896c4db04b86894de9b7b7d980320d0869d..8c8c2881402e593b0c041bf6d6dd57956a675efb 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index a7991afae29a8369f0b6e699c315511a0fb20552..f019b6878db82b90f080ed837cd0787e36844764 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_DEFAULT_DEVICE_TREE="rk3368-sheep"
 CONFIG_DEBUG_UART=y
 CONFIG_ANDROID_BOOT_IMAGE=y
 # CONFIG_DISPLAY_CPUINFO is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
index 4a9d05fe09d9afee686a063c701fd6e45670333b..ce56075a709f9e40cdb6c911371515fce392fa15 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_MMC=y
index 0c5fe39ed79c79d2520b414d6515950b683aa7d8..36f1413eb6354c9dedd0f69922716148552d5dfa 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_VERSION_VARIABLE=y
 # CONFIG_CMD_BOOTD is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index d72e48f7990dca96e9f501d74399744a39bca909..8af1e19d13677a9464fcb3cbf3edebf947ed059d 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index accdd5da8818bb551cffef56e54b5a0493c3d905..765d0fae227f6731f1fba70f30487be8ecb3e6e0 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -46,10 +45,10 @@ CONFIG_PHYLIB=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0908
+CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Siemens AG"
-CONFIG_G_DNL_VENDOR_NUM=0x0908
-CONFIG_G_DNL_PRODUCT_NUM=0x02d2
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_MCS7830=y
index 2207afaa12dad0384f7ebcfc93cc37df18767de6..57870e5a9f95fc78dd3e8d8f8d62c565dafea405 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
 CONFIG_SYS_PROMPT="SMDK5250 # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 3cc2413656ce75b2f9ce3239479a527192050f41..75b8c00e28e9c39cb5a65a4325bc5ef3039630cb 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SPL=y
 CONFIG_SYS_PROMPT="SMDK5420 # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 45b854a6ca12bb801293592d84b6b474e95c8a36..eef4aee919699c729b3fbc4467e621e6a6391c0b 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/mtdblock5 ubi.mtd=4 rootfstype=cramfs console=ttySAC0,115200n8 mem=128M  mtdparts=s3c-onenand:256k(bootloader),128k@0x40000(params),3m@0x60000(kernel),16m@0x360000(test),-(UBI)"
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="SMDKC100 # "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_ONENAND=y
 # CONFIG_CMD_SETEXPR is not set
index ae374985eb4b9777237c1401534b5ae31d68d5e7..31a5e99a40afda782548446b097b7bf45a6d4539 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="SMDKV310 # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPT=y
index 871290157e95e9d0a97620ff77d63da7c6379da5..8f9ff1f22923ff92a501a9a377beaf9d1f36ce38 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Snapper> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 93faa77baf29d324934eed3e2b4672c3a9fec022..6bb86287eceaac7fdc31542c85c73a8bc1b6431b 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOOTARGS="console=ttyS0,115200 ip=any"
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index f24153b56fd338448d829738c2a4907ac1b38edc..a8a592f0d10b97ae4f80c6a4739acbfd8699d2e2 100644 (file)
@@ -13,14 +13,11 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=2
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="sniper # "
 CONFIG_FASTBOOT=y
-CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
@@ -43,8 +40,7 @@ CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_MUSB_GADGET=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_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_OF_LIBFDT=y
index 921f89e1c06b72ee2e6698398f05783a9c81e3cb..66255ad4923aa22bb9fbeda71d43488144bfb8c3 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_FIT_BEST_MATCH=y
 CONFIG_SILENT_CONSOLE=y
 CONFIG_SPL=y
 CONFIG_SYS_PROMPT="snow # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 4c73d73cdc948187b58a45eeb2bdc52b87a9272e..d2e1ead76bb12743b6cac223316d6c29c9263af0 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_FDT_FILE="socfpga_arria10_socdk_sdmmc.dtb"
 CONFIG_SPL=y
 CONFIG_SPL_FPGA_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
index cf4fa20f2c1c76eae16311bd16d0a8b9aa837c1d..8e4df341db84353d0d9c6b6fe6ce9da72e64bb7f 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_DFU=y
@@ -64,9 +63,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="altera"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="altera"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
index 1cc6e161d96913cdf730515e02c473ac560a8cc4..97262d561667d3d1e7286fe6524366d6df4a8470 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_DFU=y
@@ -64,9 +63,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="altera"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="altera"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
index 0bb9121c262ee677d4d164d1bd5087c2bf0682b7..7022d6e37da5b4525a99c8799ed6c87f5ccf0f20 100644 (file)
@@ -12,11 +12,11 @@ CONFIG_DEFAULT_FDT_FILE="socfpga_cyclone5_de0_nano_soc.dtb"
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_DFU=y
@@ -24,6 +24,7 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -38,6 +39,7 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_EFI_PARTITION=y
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_FPGA_SOCFPGA=y
@@ -58,9 +60,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="terasic"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="terasic"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
index 16cff90369e73475537b4352c478dcf196b9ef53..3f20159702267f200c7cb57750962988fc451e2c 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_DFU=y
@@ -56,9 +55,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="terasic"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="terasic"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
index a0931458556f0ea4400438905c3c5bca59d16b60..8a33aee8973579c21f18e498af064b27d3b5be38 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
index 3de4274634529365afd39802b23b44ae7f92e61d..fa55ca2075c8dbcd85414c11b1bdcb587c7eec9d 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
index 0b4ad4118f24e57498a156cf21e1d39381c356bd..aa8f56479bda0eabddd081fca196d2102c9c43b4 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_DFU=y
@@ -58,9 +57,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="denx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="denx"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
index b22bf6f608c5f6bab570acbbfef7cbad66dc0b0d..65afa77482736cc44e5a793c64d09e5d88d38462 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_DFU=y
@@ -64,9 +63,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="terasic"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="terasic"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
index 335c9e8384e4935d84e933e766be36bd0355e4bc..81a66af3a874f9400dc59cde8e902912a48b88d6 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_DFU=y
@@ -64,9 +63,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="ebv"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="ebv"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
index eb9fc49b3a7beac453aefe2602ff86aaf867a958..09de96bb76aff92c7335aa4cf4f119e1ac188b3e 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
index 3bcedb6d1aeedcbd2d0420352d19cab5ff83638e..3f9bf749f56c2dbb87892062a85aef35648e5c7e 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
@@ -81,9 +80,9 @@ CONFIG_DM_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="samtec"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="samtec"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_USE_TINY_PRINTF=y
index 6c28e0e73580a63ac28ab7acc3ba57a3b13e58a6..6bbfc7155f71a13816575dd28eb791735c7d0808 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_BOOTDELAY=1
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
index 4489ddf5fb2f3d224cfac937ebf812c5727f710d..538dd2ae7d3432c41574bea57245a8490126588e 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_PART=y
index 7f1b0bb10792b3527efc95f625ad0ea07b951e16..f41e5df31739cf9212599757bf03f17ce47cdbd4 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
 # 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_SPL_DOS_PARTITION is not set
index a929b86cd1b6ad30ec7857b00e3b6d39ee280122..22a4685330b21c6a93d02da9463ba7fdb46abf53 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 4694ca9f5f9e1e2b2468343c9ab079501aafc42d..53dfc12a305b0f8607abd935e4749d103e037e43 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock7 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 8563ce2b48a0ff82e7a4d2371956e025ef2a4098..adbf4081fddaacc465c55b16f2223e5accd427d5 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index bc58c2431863146e9dde6b9f1ed2a200c3ad0534..e4e31df39eb9367d7b96abf5d1335850a5ac1a04 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock7 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 1b6062ebabf200e0fad6f4c618717b1cbc063d60..9517ac04d50112c1a0c9ab2fb139223ae2e77017 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 28d40d5f2719c226e8cf0bff65ad81347f95f52c..e601b04ef26d73dc17481f0f319ee42393d4a567 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock7 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 0a17d42c0a84007d1f370dba92eb35304fcc97a8..5c1b142504fe5ae60e1c0dd7815ceef3c6f496dc 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 0285ae910c4ba030e941bf33f8fad9076605f7e2..7b438ecabba7de07f52c5e67a6196eed4386f44d 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 8bea8253d6408ef78a498c0615bfe261068a1282..b7aac144a16d392738447d65f3c2579ad7aa8f9c 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock7 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 0dc3951e279387f1e16b5859f6e698c7237be761..611517d98fdaaa6ba98028e8a5a27a61390b27eb 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 87b009e23d0645295249aa2713239497711f7e1f..66fb6b726f7c9ad9101831e8fd535dc1f9a27df7 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 2384e525ac38e5b15da7808ec8941a35de987c90..cfe510b362fec0efed3e860870a7d69f706842ed 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock7 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 94ac19dce4ce5c4a01c6525262655eda57d14b58..a08cd7e85a79c33cf02b48fb1179306aa692ae68 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index b391ca698242c3b0977b12fd7de6ace682482dec..34b36227d84fc6dd3e88df5285c7b91a44049f75 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index f75776bfa6df4b8099c833efb2c1c9af1db46499..eb8ab9d42bfb5f8688534501d7024ddc489ced38 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock7 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 9499cb2059a4336f0828b99a1f8f8e981b6a0085..7f09cfb724086a8de690e0536eb754db4a96f104 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 64617c19e99520aeb32b0622cb18c7a719d8d9b5..dc581794a51e3c41d87f3b5caf0117a1a5207ddf 100644 (file)
@@ -10,6 +10,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 042eef5a72d0372cda4fac4a6ef605b57910947d..6e6e62b4043a1b59a52f7ab07573d97764d02996 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock7 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index e1689f9f9c9dcf8d425a7d42db17e3b3b290fe59..80e93e3f34def01337ade0eb72883b80b2f50105 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock3 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 8e3733fa5df0ba26ee7d21e212957a84253b0979..a2cf8666b64393c5fd948e7d5afce3554cf28e0e 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyAMA0,115200 mem=128M root=/dev/mtdblock7 rootfstype=jffs2"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
index 2ab678abd70ad5e941c5a38fdcb02c3efe6b7eb3..b5db3833cda595185e8704d535e16f99f1ef9238 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_FIT_BEST_MATCH=y
 CONFIG_SILENT_CONSOLE=y
 CONFIG_SPL=y
 CONFIG_SYS_PROMPT="spring # "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 8fd1ff26a2ba674524f05ed5a5d83c2a7b74c15b..720779894161444d2986b118626db727dd34f784 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk consoleblank=0 ignore_loglevel"
+CONFIG_BOOTARGS="console=ttyAS1,115200 CONSOLE=/dev/ttyAS1 consoleblank=0 root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait mem=992M@0x40000000 vmalloc=256m"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SYS_PROMPT="stih410-b2260 => "
 CONFIG_FASTBOOT=y
@@ -17,7 +17,6 @@ CONFIG_FASTBOOT_BUF_ADDR=0x40000000
 CONFIG_FASTBOOT_BUF_SIZE=0x3DF00000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -52,8 +51,8 @@ CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="STMicroelectronics"
-CONFIG_G_DNL_VENDOR_NUM=0x483
-CONFIG_G_DNL_PRODUCT_NUM=0x7270
+CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
+CONFIG_USB_GADGET_VENDOR_NUM=0x483
+CONFIG_USB_GADGET_PRODUCT_NUM=0x7270
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SPL_OF_LIBFDT=y
index f0ddeb27cf0e17cd8ffb5375ab4b796ad4dbbea5..9339e3670b636e5cdc79f673557581b1898cd04f 100644 (file)
@@ -11,6 +11,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot > "
 # CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIMER=y
 CONFIG_ENV_IS_IN_FLASH=y
index 2809464de092982b1e8921660c15abfbbec548ed..378cf83d1f973b1d7ec52c253e9548f94f92bb9d 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_PROMPT="U-Boot > "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_SF=y
 # CONFIG_CMD_SETEXPR is not set
index eed921d24b6c88599a6caf717e2e4d754f383478..e43187ee551ed7ef0476ea1f9d3bbcbbde045143 100644 (file)
@@ -14,14 +14,22 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_TIMER=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
+CONFIG_DM_MMC=y
+CONFIG_STM32_SDMMC2=y
 # CONFIG_PINCTRL_FULL is not set
 # CONFIG_SPL_SERIAL_PRESENT is not set
 CONFIG_REGEX=y
index 61e702e0013dbd9c82c4932956bc5bd195874796..983c26aeee40088924d9aefa2d7b99d457e84f7b 100644 (file)
@@ -14,14 +14,22 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_TIMER=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_EMBED=y
+CONFIG_DM_MMC=y
+CONFIG_STM32_SDMMC2=y
 # CONFIG_PINCTRL_FULL is not set
 # CONFIG_SPL_SERIAL_PRESENT is not set
 CONFIG_REGEX=y
index 2630865db91b5d95a8e095171476404e05c5c97f..3639aaa9e316ee660d3240bf34e661a05151fcd2 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="stmark2 $ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
 # CONFIG_CMD_FLASH is not set
index 9c18914626bd731ba4ed8df7c779421794cde4d3..b6e71e7186db0e234e5e9a442c06f66cd6af0fc3 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_VERSION_VARIABLE=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9c92fa5d08f6fa32b0a7b6993692a56b425a15a5..f4ee434de7fce8ca7fd7507162f7314ad9a3119f 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
index 030f3f579ccd9bfeb7a5aa12dfde536b55a17a0a..aec099b7afa7405f09a57abe0197fd9c5bb9358d 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
index 22bd3fa14979104940cb8d9a386d7855d6c913df..6ccc99fb96680ef25bb7fdba3a46e1ff184511a5 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
index 65301349393742bd7907be4b0f3778e5cb5b903d..11831a44147a99d78d331133bdf39ebd9953e333 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
index 22f75c4b944f4650660cb59bed81f1b17bb639d2..2d7d3bf70d962c17e71857c9762fc236723c7cf4 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SYS_PROMPT="STV0991> "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_SF=y
index 32254ef8b4eea536e2b032179c3ed27877f88e98..aaa56b51b4c78fcfad68ab492e09e5d66e7c8f7b 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_USB1_VBUS_PIN="PH7"
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-evb"
 # 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_SPL_DOS_PARTITION is not set
index 9dbf5d0a58343efc51d965873baa7d87d75b3f4b..eb4a74cecd6436a4cfc2b9e8f04e9513654c516a 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-gemei-g9"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index 4184998370cb86184693a663077335700ae41d2c..60576c4f62d3a5b9e49e5aec64fa5c4722452bed 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 31153acb30a41b58ad6397262f3148c44637210e..3d4e2a1e8c578ff846c3ea44507c0bab9eb3c202 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="TAO-3530 # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_I2C=y
index 71a382a3e132d274f5558e31171b9a5170534ef7..9e9f6fb7e5d6f627edbfc0ae6de8de9e7a01d3bd 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADS is not set
@@ -53,8 +52,8 @@ CONFIG_PHYLIB=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0908
+CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Siemens AG"
-CONFIG_G_DNL_VENDOR_NUM=0x0908
-CONFIG_G_DNL_PRODUCT_NUM=0x02d2
 CONFIG_USE_TINY_PRINTF=y
index 2f505d96782c1fdc4f2ce18beed648d97017f383..f55c94045353ed9fb3bafb2496c32795f79afae4 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200n8"
 CONFIG_SYS_PROMPT="[tb100]:~# "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
index 20814ccea33bec454017ab04ba196b3ff8b394a5..791af7c841e327f280ac9d6a816bb1f92b170041 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Matrix U-Boot> "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -45,10 +44,10 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="TBS"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="TBS"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_OF_LIBFDT=y
index 6ce7cb47276385be492269cbc527c31b260ff0be..f785757a5d2a8f89e16f99e31957d91600ce1b76 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra30 (TEC-NG) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index ff3bee1d26a4b482b3c1cd810c7158a588bf5b30..2f0e14f4c2b24453a6b29ecfda4ea538dea51195 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra20 (TEC) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 1888f0892845c2fb079f9c5db3d78e11a5a98d19..740ed064561079908e4356b72f0afcb3e2ed08a5 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -27,7 +26,6 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
-# CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_PING=y
index 4c9492cf1fd4f6ad8ef8f40ec5efc33af09cb5f2..0c85620586236576a978f6714996662e1a3d7aa2 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -26,7 +25,6 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
-# CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_PING=y
index 348d917b3b34695935de85267494e5e74c2479db..7847ff48cb0a0bd296967b6c1d9d09ab0ebbaf16 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
@@ -25,7 +24,6 @@ CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
-# CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_PING=y
index a39497984ba68780544fb970a7636c24537a1853..a091ddec3118b626fabb388432f7df1a321ee5ba 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -51,8 +50,8 @@ CONFIG_DM_GPIO=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
-CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
+CONFIG_MVNETA=y
 CONFIG_PCI=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
diff --git a/configs/theadorable_defconfig b/configs/theadorable_defconfig
deleted file mode 100644 (file)
index 0639f81..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-CONFIG_ARM=y
-CONFIG_ARCH_MVEBU=y
-CONFIG_SPL_LIBCOMMON_SUPPORT=y
-CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_TARGET_THEADORABLE=y
-CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_SPL_SPI_FLASH_SUPPORT=y
-CONFIG_SPL_SPI_SUPPORT=y
-CONFIG_VIDEO=y
-CONFIG_DEFAULT_DEVICE_TREE="armada-xp-theadorable"
-CONFIG_DEBUG_UART=y
-# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
-CONFIG_FIT=y
-CONFIG_BOOTDELAY=3
-# CONFIG_CONSOLE_MUX is not set
-CONFIG_SYS_CONSOLE_INFO_QUIET=y
-# CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_SPL=y
-CONFIG_SPL_I2C_SUPPORT=y
-CONFIG_HUSH_PARSER=y
-CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
-# CONFIG_CMD_FLASH is not set
-CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
-# CONFIG_CMD_SETEXPR is not set
-# CONFIG_CMD_NET is not set
-# CONFIG_CMD_NFS is not set
-CONFIG_CMD_BMP=y
-CONFIG_CMD_CACHE=y
-CONFIG_CMD_TIME=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
-CONFIG_EFI_PARTITION=y
-# CONFIG_PARTITION_UUIDS is not set
-# CONFIG_SPL_PARTITION_UUIDS is not set
-CONFIG_SPL_OF_TRANSLATE=y
-CONFIG_FPGA_ALTERA=y
-CONFIG_DM_GPIO=y
-# CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
-CONFIG_SPI_FLASH_MACRONIX=y
-CONFIG_SPI_FLASH_STMICRO=y
-CONFIG_DEBUG_UART_BASE=0xd0012000
-CONFIG_DEBUG_UART_CLOCK=250000000
-CONFIG_DEBUG_UART_SHIFT=2
-CONFIG_SYS_NS16550=y
-CONFIG_VIDEO_MVEBU=y
-# CONFIG_VIDEO_SW_CURSOR is not set
-CONFIG_REGEX=y
-CONFIG_LIB_RAND=y
index c30e924fb56fe5c8e751fc545e981fac0766d5ae..9a3c1460059e90db86a3decc83f47f3425ba11c8 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_SYS_PROMPT="U-Boot# "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press \"<Esc><Esc>\" to stop\n"
 CONFIG_AUTOBOOT_STOP_STR="\x1b\x1b"
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -66,7 +65,8 @@ CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Siemens AG"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0908
+CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Siemens AG"
-CONFIG_G_DNL_VENDOR_NUM=0x0908
-CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_USB_ETHER=y
index 19a7b922d06b41ea2fdf6f75fa5e7426c7d31e47..6ef83bf83015d8f81d4391a55fbcfe2a50e30ed2 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOOTARGS="console=ttyAMA0,115200n8 earlycon=pl011,0x87e024000000 debug ma
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="ThunderX_88XX> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
 # CONFIG_CMD_EDITENV is not set
index 92a7062c6df9d083b6a358ec57630c8b5186d9cb..3d398207458d27ccf542dd7b643077fba785de16 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot# "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
index 4341d8d01f8d6810d72b615c5e938c26c66b7f8e..fa97ad6f4c959a94824f6bd486fe661d8eca1ec5 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_NAND_SUPPORT=y
-CONFIG_SPL_STACK_R_ADDR=0x82000000
 CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="dm8168-evm"
 CONFIG_DISTRO_DEFAULTS=y
@@ -20,10 +19,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index 00e2d819543403c97d500ed9374d034e2ce91e95..1315be3ee8a5dac8e017595b037c56c0932243ff 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -72,11 +71,10 @@ CONFIG_USB=y
 CONFIG_USB_DWC2=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
+CONFIG_USB_GADGET_VENDOR_NUM=0x2207
+CONFIG_USB_GADGET_PRODUCT_NUM=0x320a
 CONFIG_USB_GADGET_DWC2_OTG=y
-CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Rockchip"
-CONFIG_G_DNL_VENDOR_NUM=0x2207
-CONFIG_G_DNL_PRODUCT_NUM=0x320a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_SMSC95XX=y
index a2197b59bcb08c100027aeeb26e546cff44c5a87..044a323da9b772604bc06ed8176b621a31b6361b 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Titanium > "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 1080554cba37789983a41fa10f5e93ef2001b754..fc06dc93c5fefeb9e84008ba166b8e3090b8cb6a 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_BOOTDELAY=0
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="zynq-uboot> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -46,8 +45,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 1450fbc61aa0a3643761302d6b5bd087ec23cf7d..6a5348ed504fc08a57458701a900453a4dd0856e 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_BOOTDELAY=0
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="zynq-uboot> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -47,8 +46,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 d3fc7ad63f32034ea373c3008b66384936880ff3..d8f6fcf782b921c203c1ee2ede22d3a28209c453 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_BOOTDELAY=0
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="zynq-uboot> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -46,8 +45,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 e973ef23ef67d57c8b8d7c41e1179300c2964990..45e2b4b0c033cf2a7a12eb918ae051e341be9af2 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_DISPLAY_CPUINFO=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index e915e8f38c31e4a61969c8777a810c59b7805618..936a8ac3463377512777b463b58f1157254e3a1c 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6dl-mba6x.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index 955873b31867ba024639b3d439d780b621aaeff6..4f3335151bf297dc7d20ec7935e95da614b21a7f 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6dl-mba6x.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index 9e491327a53d57a007da0c139ff96a5f0e1666cc..e134c256de2a03fb77a2e4b0d7c4f06dbe6c3880 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6q-mba6x.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index b3029f465d52b54f294577da8945620278e4173d..21731557392867ee2b375ce73c64d5c0939c8581 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6q-mba6x.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index 5c42851c3f7cb9ed11583e0f2d0a2f05662b57d9..42c004b550cb5dc810d2b5b7d61f184af25a4b33 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6dl-mba6x.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index 231fc0d86181193be77b1a56302d022b9805edcf..3912ec2730f624d227cb5c35cf8dd1372b2346c5 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_DEFAULT_FDT_FILE="imx6dl-mba6x.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index 0d7a765034c85743d1e58a8aec6c2d0c48b8e26a..4cf6693f5c92f22a0431ffe6fc83571b4826ca9a 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_AUTOBOOT_PROMPT="Enter password in %d seconds to stop autoboot\n"
 CONFIG_AUTOBOOT_ENCRYPTION=y
 CONFIG_AUTOBOOT_STOP_STR_SHA256="36a9e7f1c95b82ffb99743e0c5c4ce95d83c9a430aac59f84ef3cbfab6145068"
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index bcc73d4fa266d398f7eb70a14f015f219a855430..aaa25a9bc72c235a52515d3488254352c18a101c 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Trats2 # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
@@ -50,8 +49,8 @@ CONFIG_DM_PMIC_MAX77686=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Samsung"
+CONFIG_USB_GADGET_VENDOR_NUM=0x04e8
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6601
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Samsung"
-CONFIG_G_DNL_VENDOR_NUM=0x04e8
-CONFIG_G_DNL_PRODUCT_NUM=0x6601
index 3f0c59baadcfbece451688259b50fa950c756625..e0285aa8f656d96ea31546a6233b17a9db434004 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Trats # "
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
@@ -49,8 +48,8 @@ CONFIG_PMIC_MAX8997=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Samsung"
+CONFIG_USB_GADGET_VENDOR_NUM=0x04e8
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6601
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Samsung"
-CONFIG_G_DNL_VENDOR_NUM=0x04e8
-CONFIG_G_DNL_PRODUCT_NUM=0x6601
index 1a0748913adb1732def453d464d5bbb4cf043183..0d7334446c724e63aed39ffb2b172d0890b9f395 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="OMAP3 Tricorder # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index dba3b1d74342cc8f078e27f7247698cf25a294e2..7ce71145231664f1e7639d5af0c367f458557b7f 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
index 207c75cfdbd4650d499ccbf8822cd0c2f3e06e09..c2da302d21a302906dfedc069d589275f187a7b3 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra20 (TrimSlice) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
index a22d611a3e9f7845eb91b8bd664bb32f39fc52df..aab0737823f4e6bb1d08828f1d7b6daf7975b2c1 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_EXT4=y
index 55cadac59011a8f1fdfaaa51f0cf0f2bca9dbb60..17497ca52f750cde3e58a324a74a5ed60e1e1124 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_TARGET_TS4800=y
 CONFIG_BOOTDELAY=1
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
index e88c517f30c3f511edf65f3e32ffadbd1b9f825b..e13af620d04a28fd13dd919957a83db9c26e387a 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index a3834acb968d6c9f8812939af17df19d2b536cb4..b9b5cbc2c5c7c5236ce021b2d10b1e9067d15660 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
@@ -26,6 +25,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_BTRFS=y
 # CONFIG_SPL_PARTITION_UUIDS is not set
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SPL_OF_TRANSLATE=y
@@ -33,8 +33,8 @@ CONFIG_MISC=y
 CONFIG_ATSHA204A=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_MV=y
-CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
+CONFIG_MVNETA=y
 CONFIG_DEBUG_UART_BASE=0xd0012000
 CONFIG_DEBUG_UART_CLOCK=250000000
 CONFIG_DEBUG_UART_SHIFT=2
index 90de4adca86c817ddb4949af7d66ba9293c01676..422a943c01b7fb9a9f5bf4c3753b5b003d11c6ba 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit <SPACE> key to stop autoboot in %2ds\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
index 53edadb6481153aabdbae7a237b712ec8bd4633e..9933d640632aa9a732f5609501827cef79222561 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="twister => "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00800000
 CONFIG_CMD_SPL_WRITE_SIZE=0x400
index b241d3df2dc7a518625e4715fbd057182f76eb7c..f064928b79d37bcfb3cd1b1553e065a7ef92a0e8 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SATA=y
index 02897eb2b419e6860cbf05658baeae4b017253ad..2f75361d5d9303712955f19f6b54f9c0b0e91ccf 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_EXT_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index 16fbe8adc581560f172fa771e649baeb3678b744..cd0efe371b48939595e2e4366d2aa90625b2c9e0 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CONFIG=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_ENV_EXISTS is not set
 # CONFIG_CMD_FPGA is not set
index 3c254849391ca2a18a9121fa9552d835f3ccf19d..12b24bcbd4e27b1783a99efc95b98ed868ba9915 100644 (file)
@@ -14,6 +14,7 @@ CONFIG_SPL_NOR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CONFIG=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_ENV_EXISTS is not set
 # CONFIG_CMD_FPGA is not set
index f4f2ca062980ad0b89fb4caa71493606e42aeb61..796839bb71eb102ad8711862c3ecfd499f9c30b0 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_DEFAULT_DEVICE_TREE="uniphier-ld20-ref"
 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CONFIG=y
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_ENV_EXISTS is not set
 # CONFIG_CMD_FPGA is not set
index d49c68b2b5d61d2df45c8151e115a2453b67dc6e..2a9eeae063f490537fcb3d7bd592e13fec30abfa 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 98e216f3c1643d7eb9fd787043859efc8b783ceb..cc276b79157ffe68ce25c9617dc06846ba1992c4 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_ARCH_MX5=y
 CONFIG_TARGET_USBARMORY=y
 # CONFIG_CMD_BMODE is not set
 CONFIG_DISTRO_DEFAULTS=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_I2C=y
index 0e4fcbaa26ac211e739b6da48b2278740d234ac2..38b3e81ebc9328fa46b6e325ab2c2585c27e86f5 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_VCT_PLATINUM=y
 CONFIG_BOOTDELAY=5
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_SYS_PROMPT="$ "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
index 4a92b03621257da647bebc2c666ab5a9d23e14da..6b57ac51cc4cc4cf7a4000c2d3b6bc93a9b4b00b 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_VCT_ONENAND=y
 CONFIG_BOOTDELAY=5
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_SYS_PROMPT="$ "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 7125d070b13493382d54ef8f05d250be28711e69..49f83427baec4bb3a51815112ee7fa1fadcf160c 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
index eafece072300a5912b42608b8d5252de6ae614c0..103eccbae6a9fcaf315f4e185324f40f488f1e6b 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index ebbf6c1a0238e9f005ded36aa5e07c65f24e06d6..0610ecd9577be3c09f939bafd5ae9a9cf1b61fde 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_VCT_PLATINUMAVC=y
 CONFIG_BOOTDELAY=5
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_SYS_PROMPT="VCT# "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_SETEXPR is not set
index 7f194e8f2eb86614803b421099b213af5744c190..c2661371cfd3d58c876e8804a0edc9d04ea7da7a 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_VCT_ONENAND=y
 CONFIG_BOOTDELAY=5
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_SYS_PROMPT="$ "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index f5d2759545ef196221ee8cf5f4c9c16207f0f1af..6e3f0a7a3cc82bbc0ed310fd5f755fc6cb1370a8 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
index f7823ef050759deb7063ccf4591a3b14806712db..457baed88c61849a32235715f6c7aa36485826af 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index f89a0a5ee504c2651e79533e0e45412402984ec8..d962fd12068e71eaa8c0435b8be4c874e07fbb26 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_VCT_PREMIUM=y
 CONFIG_BOOTDELAY=5
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_SYS_PROMPT="$ "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
index 4d909741ba5ba92ca01e7570d72207045f1cb98d..a55cb5b38588a85e098a7127831b8c739b648628 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_VCT_ONENAND=y
 CONFIG_BOOTDELAY=5
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_SYS_PROMPT="$ "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
index 27e74742c87ea9da41ad62f26203b59ca8ea9d7d..68958bcd04b6a8f405bb749b5881cc38bc71915d 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
index 0420cd15a636f788ffb1d781c432281ecee35627..f006456dd9daae1bb0df72ea92992f726b3edcd7 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_ELF is not set
+CONFIG_CMD_IMLS=y
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index af4064929cab8681282e50411e5b63ac8baed71c..b93af8986cd76c3dd687ba90ec95dc58d34b53b8 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
 # CONFIG_CMD_SETEXPR is not set
index f90936e7440e53cb68eccb5b969310c6c6ae9bf3..3adb4c1c09fba53dafcd6a46ac4a6ce7277fde56 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra124 (Venice2) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
@@ -38,10 +37,10 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="NVIDIA"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0955
+CONFIG_USB_GADGET_PRODUCT_NUM=0x701a
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="NVIDIA"
-CONFIG_G_DNL_VENDOR_NUM=0x0955
-CONFIG_G_DNL_PRODUCT_NUM=0x701a
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
index 42353f034ed9f447301a3dad1c2f2f150cd3baae..d57543c1b934b06a19cf3b828a5310d1a9f3a5b4 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra20-ventana"
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_PROMPT="Tegra20 (Ventana) # "
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPIO=y
@@ -34,7 +33,6 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_DM_VIDEO=y
index 134147d57e15bdfec81ddc5c5e69b7352a4fd26c..86f2b09a9be4bc146312fa77ab6ec4bd0102db49 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOOTARGS="console=ttyAMA0 earlyprintk=pl011,0x1c090000 debug user_debug=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="VExpress64# "
 # CONFIG_CMD_CONSOLE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 291de6fab555d1fa532085a68c7a21c61053d412..e4aae05aa52f3d107f7d5a1c29ba3122c6b93535 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOOTARGS="console=ttyAMA0,115200n8 root=/dev/sda2 rw rootwait earlyprintk
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="VExpress64# "
 # CONFIG_CMD_CONSOLE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 51684b1e83e537592cce82072def7f4e4b822c45..f3d6d5bc115bbc416b9c75d3229a9a0792e2d4bb 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOOTARGS="console=ttyAMA0 earlyprintk=pl011,0x1c090000 debug user_debug=3
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="VExpress64# "
 # CONFIG_CMD_CONSOLE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index bcf31317ae708b3bdf732a2ab9095c740710804e..a0032ade5515295098bf6b6dc33c7a2972965ae8 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_OF_BOARD_SETUP=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_BOOTD is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 1afd32dd2ec94c1fd49989c820d91a0e89c80b7b..efa8c31ea69486ede8abd74fa72ad058441d6524 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_BOOTD is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 60af905cf4aa7b07b0a2e1e281fb1ce21459835a..4e7b9619976efe3033feae510cccfb7f99428baf 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_BOOTD is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_ENV_EXISTS is not set
index 948ea73edb91079b54e9d9b73b49109c6f6d6a77..79bb71d7474fe175cc5489bc2c20323d51e19fd7 100644 (file)
@@ -3,10 +3,10 @@ CONFIG_ARCH_VF610=y
 CONFIG_DEFAULT_DEVICE_TREE="vf610-twr"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg"
 CONFIG_BOOTDELAY=3
+CONFIG_LOGLEVEL=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
index 10cdf0646c984afeb8f511141434dd6d0eb589b0..da6fff41d605fa2d16683b71f8ea9e56168d4d41 100644 (file)
@@ -3,10 +3,10 @@ CONFIG_ARCH_VF610=y
 CONFIG_DEFAULT_DEVICE_TREE="vf610-twr"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg"
 CONFIG_BOOTDELAY=3
+CONFIG_LOGLEVEL=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
index 18eb1736779cb6eb2e9882b093eb737ba70de1b5..6174fcb604ac652903801e832191293e42eea4aa 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="vinco => "
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_CMD_GPT=y
@@ -31,6 +30,8 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="L+G VInCo"
 CONFIG_USB_GADGET_ATMEL_USBA=y
+CONFIG_USB_ETHER=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
index 72e782780d8865b7d566cb12c7256ba0d248e064..7a76e6d519a96705ba0c6c03a1d6551aba248b6f 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index b40ddae69524ca8a307d76797f4ad265847d8c19..426240fdd5f2b05565d6e08d384abfd400ec250b 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_TSI148=y
index 7db7b0b6f9f92af7cb2f382d472b1937c3724922..476f42768cb32f64d2c5de9111ba32d4a5bde90c 100644 (file)
@@ -1,8 +1,11 @@
 CONFIG_ARM=y
+# CONFIG_SPL_USE_ARCH_MEMCPY is not set
+# CONFIG_SPL_USE_ARCH_MEMSET is not set
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_TARGET_VYASA_RK3288=y
+CONFIG_TPL_TEXT_BASE=0xff704004
 CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-vyasa"
 CONFIG_DEBUG_UART=y
@@ -11,7 +14,6 @@ CONFIG_SILENT_CONSOLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_I2C=y
index 9765f13a696952f66dc92894f811681388fe83a6..72ff721b6cdc69000bae6b3005be3d2d9544186a 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 99fe800317c26a7e4b0d307fbe884e0f8957cf43..99f9b06165d7a72324c8923035d51f21ef2ee000 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTD is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
@@ -33,9 +32,12 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="FSL"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_OF_LIBFDT=y
index 8beda72cd88229ffffe6477d55b6896c92dbe839..45797b699cdec4a050f97e81fb40210588efd22a 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTD is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
@@ -31,9 +30,12 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="FSL"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
+CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
 CONFIG_OF_LIBFDT=y
index 8e58790269b8cedb997a0c913a62fd074af86c71..5e7eef0828a6458a610e78c85d20bc2b2827107d 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -30,9 +29,9 @@ CONFIG_DFU_MMC=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="FSL"
-CONFIG_G_DNL_VENDOR_NUM=0x0525
-CONFIG_G_DNL_PRODUCT_NUM=0xa4a5
 CONFIG_OF_LIBFDT=y
index 5139e40002fa0fc53b1e23c36868f046cad91991..2c20f607b956e1c875a4028e4fa68a2dbb46e421 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="woodburn U-Boot > "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 7518cea96877d092cc3450e8fc2c248caf2c4da9..b5670ad01cf284a03f63529b59e527de7f3c9c47 100644 (file)
@@ -15,6 +15,7 @@ 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_IMLS=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index a0a6e20cc56bcefdc08c0f6d9fd1459a91c2dfbf..1fccaacd82506f51b12a7e9fa6cc691a351e6c8d 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SPL=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
index bcb20facd4556df27068c03299051f4aea28edc6..3f81b18d4d91f8cf11fae01b8239b54b81046419 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_SYS_PROMPT="X600> "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_LOOPW=y
 CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_GPIO=y
index de80da69c68bc7548766fef22453c1651c38de27..4d6b25eaa5de4800346909ae4d8bfe91ab232b37 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
@@ -31,4 +30,6 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 CONFIG_OF_LIBFDT=y
index c3ba5bf632420cb6238cb96e0362358df5a2cd10..101c14c2ce833e94e88b88379d2f89afd2ab5974 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 # CONFIG_CMD_CONSOLE is not set
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 # CONFIG_CMD_EDITENV is not set
@@ -85,8 +84,8 @@ CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Xilinx"
-CONFIG_G_DNL_VENDOR_NUM=0x03fd
-CONFIG_G_DNL_PRODUCT_NUM=0x0300
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 # CONFIG_REGEX is not set
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
index 588b15430bf60bb279704eb61a18dc954894d272..4b6fef3af893e345d00a7cf3a233dc5442752058 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_UNZIP=y
@@ -77,7 +76,7 @@ CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Xilinx"
-CONFIG_G_DNL_VENDOR_NUM=0x03FD
-CONFIG_G_DNL_PRODUCT_NUM=0x0300
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03FD
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
index 0a3ac9dbeadc6b2e54a40fef6caf53685c809463..4824d2f8fd543c6dbec2476ff3a4ebcdfdaca956 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_FASTBOOT=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_UNZIP=y
@@ -75,7 +74,7 @@ CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Xilinx"
-CONFIG_G_DNL_VENDOR_NUM=0x03FD
-CONFIG_G_DNL_PRODUCT_NUM=0x0300
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03FD
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
index e7139f8879c2d849fba46331347c204979b7a050..9a1a7679e87d89f00c490de574492c3d74ec434c 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="ZynqMP> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_UNZIP=y
 # CONFIG_CMD_FLASH is not set
index 8769d416c2c12cef648ba80958f286855fd21615..05046dd6b241c18b57e9f428e1b764555256778d 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SYS_PROMPT="ZynqMP> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_UNZIP=y
 # CONFIG_CMD_FLASH is not set
index ee0beda47a8ed1e329e808e272cd67cc5d6740a7..38082333cbcc75553fecfa487107604553d08c8b 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_MEMTEST=y
@@ -80,7 +79,7 @@ CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Xilinx"
-CONFIG_G_DNL_VENDOR_NUM=0x03FD
-CONFIG_G_DNL_PRODUCT_NUM=0x0300
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03FD
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
index e47e4bf6e5e1f14978e741267206b538272dc5b8..0741f05a50c97cb93fe923565eb68b01849e2b06 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_CMD_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_MEMTEST=y
@@ -80,7 +79,7 @@ CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_G_DNL_MANUFACTURER="Xilinx"
-CONFIG_G_DNL_VENDOR_NUM=0x03FD
-CONFIG_G_DNL_PRODUCT_NUM=0x0300
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03FD
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
index d714c674f7addbfba689ee9300c80d595076374f..a2324c3e7994faefb65a3a817e6361aab1c08ab5 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
index b04063ae32ad7eaa37ccc8f307d54e6ca0c1b2cb..7518ef2e395621a627512a20553cde5fb6294991 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
index 657fdcc7fd56fc63c3565b3d9663f5390b4dce61..ead06a75f8532696dafd551acf766255ed3398a8 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_I2C=y
index 1e132177fcc240079ab5d8a7a98813d70427ecc2..80bc914eaeb55c1ce5ef8d12127686f40b653d1f 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
index 1b70ea70aede526441e42cffbb317d8da581ef98..92c5aa97be23afade1678ae639eb299ace2506f4 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5aa1de60392f54a6756467d19e2ab77496581287..7d72b96b88772f5d19de05f8baa827724e4fc6a0 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_SPL_EXT_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index f479c1a1e31cccf602f1e7fa401830d57e12d8a7..4f77e23ef5c52f63016f33c77c0d182137a151c3 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds, press <SPACE> to stop\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_SAVES=y
index d48406ea8f32fae311b86efee450203b72124ca2..515a3135f9b939e9fd1fa07ceea0eabb678e7675 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_BOOTARGS="console=tty0 console=ttyS2,115200 fbcon=rotate:3"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="$ "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
index 95b13096a424aeee6dbc67801378894358d14734..f323db3d8cd8f98e339e9e56e50c3b53987ed22f 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="boot in %d s\n"
 CONFIG_AUTOBOOT_DELAY_STR="delaygs"
 CONFIG_AUTOBOOT_STOP_STR="stopgs"
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
index ae248f51bc26f05748b93a97055f3281ae80f9aa..ad0ecc65b0c62707cb826ab8c3b938663d821f2f 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -53,8 +52,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03FD
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 0afdd1147a90d917e1a676de9392116dea454ad9..d4344d96dcf0b1a0efe6f029c5c1e10cea0aa6ee 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -42,8 +41,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 3684b8531fa99eef53584b625ef8a676b41131eb..af959275febd5611140c55815f3a0e16c3d1dd97 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -52,8 +51,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03FD
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 21852e55b6d402ca0b62e9308d6a25ef13946474..5fd1ff093e993d0f5a2ecaa8d07ee3ad6052d5b8 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_DFU=y
@@ -60,8 +59,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 dfafc9a9f6d5c910a6cfb7c92d25bab5ccd275ee..8964f57e1dcb93232c605d6c819e2bbee5f303cf 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_DFU=y
@@ -56,8 +55,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 e6845cbaca0ab04a272ee13236bae879159651c6..dbca4a62ef30a48f8aa2f7df881098adee6ec28f 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADFS=y
index 428670cbca125ed2cf84b25be545df40430e130c..b1511d81f774b1e163c8932a1a46e59b32feb586 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADFS=y
index 4d9320611e5d4199a0f10f2934b854ab11e4667f..71b379add3b2e25a1bb09a47d609b41880723bac 100644 (file)
@@ -12,6 +12,7 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
+CONFIG_CMD_IMLS=y
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADFS=y
 CONFIG_CMD_FPGA_LOADMK=y
index 5c029109e2b1e7af5975e0f5d0f12a6faa7001eb..4ffb2f971883cba43334d3b7925f819cccf13418 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADFS=y
index bb512aff09d19ca6cf021d4c933cb6dc586c3b7f..17a8809dd27d8681ac40150318f487e1d7aa05a9 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
@@ -53,8 +52,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 fd31b4dc14f0e3fd1a2bdc0af963275302937af3..9157d0cb8079c5c8b5518a5fa980d3e283549c56 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SPL=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="Zynq> "
-# CONFIG_CMD_IMLS is not set
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_DFU=y
@@ -58,8 +57,8 @@ CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Xilinx"
+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd
+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300
 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 aa9183d696406ab28c882100907e603d1e5d71aa..66b8101f98c7616410d7e1b97f5f68023cb035c9 100644 (file)
@@ -21,6 +21,9 @@
 #define PRINTF(fmt,args...)
 #endif
 
+/* Check all partition types */
+#define PART_TYPE_ALL          -1
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef HAVE_BLOCK_DEVICE
@@ -626,8 +629,8 @@ cleanup:
        return ret;
 }
 
-int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
-       disk_partition_t *info)
+int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name,
+                              disk_partition_t *info, int part_type)
 {
        struct part_driver *first_drv =
                ll_entry_start(struct part_driver, part_driver);
@@ -638,6 +641,8 @@ int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
                int ret;
                int i;
                for (i = 1; i < part_drv->max_entries; i++) {
+                       if (part_type >= 0 && part_type != part_drv->part_type)
+                               break;
                        ret = part_drv->get_info(dev_desc, i, info);
                        if (ret != 0) {
                                /* no more entries in table */
@@ -652,6 +657,12 @@ int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
        return -1;
 }
 
+int part_get_info_by_name(struct blk_desc *dev_desc, const char *name,
+                         disk_partition_t *info)
+{
+       return part_get_info_by_name_type(dev_desc, name, info, PART_TYPE_ALL);
+}
+
 void part_set_generic_name(const struct blk_desc *dev_desc,
        int part_num, char *name)
 {
index 7ede15ec261315e6922fdfd6298bf0f17f5220a4..6dd2c2d147d706824afa62364fe182973f93ac09 100644 (file)
@@ -44,7 +44,7 @@ static inline int is_extended(int part_type)
 
 static inline int is_bootable(dos_partition_t *p)
 {
-       return p->boot_ind == 0x80;
+       return (p->sys_ind == 0xef) || (p->boot_ind == 0x80);
 }
 
 static void print_one_part(dos_partition_t *p, lbaint_t ext_part_sector,
@@ -89,6 +89,21 @@ static int test_block_type(unsigned char *buffer)
 
 static int part_test_dos(struct blk_desc *dev_desc)
 {
+#ifndef CONFIG_SPL_BUILD
+       ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz);
+
+       if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1)
+               return -1;
+
+       if (test_block_type((unsigned char *)mbr) != DOS_MBR)
+               return -1;
+
+       if (dev_desc->sig_type == SIG_TYPE_NONE &&
+           mbr->unique_mbr_signature != 0) {
+               dev_desc->sig_type = SIG_TYPE_MBR;
+               dev_desc->mbr_sig = mbr->unique_mbr_signature;
+       }
+#else
        ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 
        if (blk_dread(dev_desc, 0, 1, (ulong *)buffer) != 1)
@@ -96,6 +111,7 @@ static int part_test_dos(struct blk_desc *dev_desc)
 
        if (test_block_type(buffer) != DOS_MBR)
                return -1;
+#endif
 
        return 0;
 }
index 2973d52f6abb278756a814057e3b77d7c08945ca..0abf48733d5d8fd731407ffb3a2db6c2d01adee1 100644 (file)
@@ -360,7 +360,7 @@ static int set_protective_mbr(struct blk_desc *dev_desc)
 
        /* Read MBR to backup boot code if it exists */
        if (blk_dread(dev_desc, 0, 1, p_mbr) != 1) {
-               error("** Can't read from device %d **\n", dev_desc->devnum);
+               pr_err("** Can't read from device %d **\n", dev_desc->devnum);
                return -1;
        }
 
@@ -716,7 +716,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
 
        for (i = 0; i < parts; i++) {
                if (i == gpt_head->num_partition_entries) {
-                       error("More partitions than allowed!\n");
+                       pr_err("More partitions than allowed!\n");
                        return -1;
                }
 
@@ -729,7 +729,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
 
                if (strncmp(efi_str, (char *)partitions[i].name,
                            sizeof(partitions->name))) {
-                       error("Partition name: %s does not match %s!\n",
+                       pr_err("Partition name: %s does not match %s!\n",
                              efi_str, (char *)partitions[i].name);
                        return -1;
                }
@@ -746,7 +746,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
                        if ((i == parts - 1) && (partitions[i].size == 0))
                                continue;
 
-                       error("Partition %s size: %llu does not match %llu!\n",
+                       pr_err("Partition %s size: %llu does not match %llu!\n",
                              efi_str, (unsigned long long)gpt_part_size,
                              (unsigned long long)partitions[i].size);
                        return -1;
@@ -767,7 +767,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
                      (unsigned long long)partitions[i].start);
 
                if (le64_to_cpu(gpt_e[i].starting_lba) != partitions[i].start) {
-                       error("Partition %s start: %llu does not match %llu!\n",
+                       pr_err("Partition %s start: %llu does not match %llu!\n",
                              efi_str, le64_to_cpu(gpt_e[i].starting_lba),
                              (unsigned long long)partitions[i].start);
                        return -1;
@@ -923,11 +923,19 @@ static int is_pmbr_valid(legacy_mbr * mbr)
 static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
                        gpt_header *pgpt_head, gpt_entry **pgpt_pte)
 {
+       ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz);
+
        if (!dev_desc || !pgpt_head) {
                printf("%s: Invalid Argument(s)\n", __func__);
                return 0;
        }
 
+       /* Read MBR Header from device */
+       if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1) {
+               printf("*** ERROR: Can't read MBR header ***\n");
+               return 0;
+       }
+
        /* Read GPT Header from device */
        if (blk_dread(dev_desc, (lbaint_t)lba, 1, pgpt_head) != 1) {
                printf("*** ERROR: Can't read GPT header ***\n");
@@ -937,6 +945,18 @@ static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
        if (validate_gpt_header(pgpt_head, (lbaint_t)lba, dev_desc->lba))
                return 0;
 
+       if (dev_desc->sig_type == SIG_TYPE_NONE) {
+               efi_guid_t empty = {};
+               if (memcmp(&pgpt_head->disk_guid, &empty, sizeof(empty))) {
+                       dev_desc->sig_type = SIG_TYPE_GUID;
+                       memcpy(&dev_desc->guid_sig, &pgpt_head->disk_guid,
+                             sizeof(empty));
+               } else if (mbr->unique_mbr_signature != 0) {
+                       dev_desc->sig_type = SIG_TYPE_MBR;
+                       dev_desc->mbr_sig = mbr->unique_mbr_signature;
+               }
+       }
+
        /* Read and allocate Partition Table Entries */
        *pgpt_pte = alloc_read_gpt_entries(dev_desc, pgpt_head);
        if (*pgpt_pte == NULL) {
index b8afa157624499054cd4771cc6d0a15e30380910..2c3ee7810a4fc8940e93e87e972f13fbac1a2423 100644 (file)
@@ -34,11 +34,11 @@ The fastboot gadget relies on the USB download gadget, so the following
 options must be configured:
 
 CONFIG_USB_GADGET_DOWNLOAD
-CONFIG_G_DNL_VENDOR_NUM
-CONFIG_G_DNL_PRODUCT_NUM
-CONFIG_G_DNL_MANUFACTURER
+CONFIG_USB_GADGET_VENDOR_NUM
+CONFIG_USB_GADGET_PRODUCT_NUM
+CONFIG_USB_GADGET_MANUFACTURER
 
-NOTE: The CONFIG_G_DNL_VENDOR_NUM must be one of the numbers supported by
+NOTE: The CONFIG_USB_GADGET_VENDOR_NUM must be one of the numbers supported by
 the fastboot client. The list of vendor IDs supported can be found in the
 fastboot client source code (fastboot.c) mentioned above.
 
diff --git a/doc/README.multi-dtb-fit b/doc/README.multi-dtb-fit
new file mode 100644 (file)
index 0000000..6cc4965
--- /dev/null
@@ -0,0 +1,65 @@
+MULTI DTB FIT and SPL_MULTI_DTB_FIT
+
+The purpose of this feature is to enable U-Boot or the SPL to select its DTB
+from a FIT appended at the end of the binary.
+It comes in two flavors: U-Boot (CONFIG_MULTI_DTB_FIT) and SPL
+(CONFIG_SPL_MULTI_DTB_FIT).
+
+U-Boot flavor:
+Usually the DTB is selected by the SPL and passed down to U-Boot. But some
+platforms don't use the SPL. In this case MULTI_DTB_FIT can used to provide
+U-Boot with a choice of DTBs.
+The relevant DTBs are packed into a FIT (list provided by CONFIG__OF_LIST). The
+FIT is automatically generated at the end of the compilation and appended to
+u-boot.bin so that U-Boot can locate it and select the correct DTB from inside
+the FIT.
+The selection is done using board_fit_config_name_match() (same as what the SPL
+uses to select the DTB for U-Boot). The selection happens during fdtdec_setup()
+which is called during before relocation by board_init_f().
+
+SPL flavor:
+the SPL uses only a small subset of the DTB and it usually depends more
+on the SOC than on the board. So it's usually fine to include a DTB in the
+SPL that doesn't exactly match the board. There are howerver some cases
+where it's not possible. In the later case, in order to support multiple
+boards (or board revisions) with the same SPL binary, SPL_MULTI_DTB_FIT
+can be used.
+The relevant DTBs are packed into a FIT. This FIT is automatically generated
+at the end of the compilation, compressed and appended to u-boot-spl.bin, so
+that SPL can locate it and select the correct DTB from inside the FIT.
+CONFIG_SPL__OF_LIST is used to list the relevant DTBs.
+The compression stage is optional but reduces the impact on the size of the
+SPL. LZO and GZIP compressions are supported. By default, the area where the
+FIT is uncompressed is dynamicaly allocated but this behaviour can be changed
+for platforms that don't provide a HEAP big enough to contain the uncompressed
+FIT.
+The SPL uses board_fit_config_name_match() to find the correct DTB within the
+FIT (same as what the SPL uses to select the DTB for U-Boot).
+Uncompression and selection stages happen in fdtdec_setup() which is called
+during the early initialization stage of the SPL (spl_early_init() or
+spl_init())
+
+Impacts and performances (SPL flavor):
+The impact of this option is relatively small. Here are some numbers measured
+for a TI DRA72 platform:
+
+                            +----------+------------+-----------+------------+
+                            |  size    | size delta | SPL boot  | boot time  |
+                            |  (bytes) | (bytes)    | time (s)  | delta (s)  |
++---------------------------+----------+------------+-----------+------------+
+| 1 DTB                     |          |            |           |            |
++---------------------------+----------+------------+-----------+------------+
+| reference                 |   125305 |          0 |     1.389 |          0 |
+| LZO (dynamic allocation)  |   125391 |         86 |     1.381 |     -0.008 |
++---------------------------+----------+------------+-----------+------------+
+| 4 DTBs (DRA7, DRA71,      |          |            |           |            |
+| DRA72, DRA72 revC)        |          |            |           |            |
++---------------------------+----------+------------+-----------+------------+
+| LZO (dynamic allocation)  |   125991 |        686 |      1.39 |      0.001 |
+| LZO (user defined area)   |   125927 |        622 |     1.403 |      0.014 |
+| GZIP (user defined area)  |   133880 |       8575 |     1.421 |      0.032 |
+| No compression (in place) |   137472 |      12167 |     1.412 |      0.023 |
++---------------------------+----------+------------+-----------+------------+
+
+Note: SPL boot time is the time elapsed between the 'reset' command is entered
+and the time when the first U-Boot (not SPL) version string is displayed.
index 12fec38139c827a2d4511b97a1694984d473ce15..4b7be0b715212bb122b929d4be8ddd9d34db7d89 100644 (file)
@@ -150,6 +150,24 @@ Note: rk3036 SDMMC and debug uart use the same iomux, so if you boot from SD, th
       debug uart must be disabled
 
 
+Booting from an SD card on RK3288 with TPL
+==========================================
+
+Since the size of SPL can't be exceeded 0x8000 bytes in RK3288, it is not possible add
+new SPL features like Falcon mode or etc.
+
+So introduce TPL so-that adding new features to SPL is possible because now TPL should
+run minimal with code like DDR, clock etc and rest of new features in SPL.
+
+As of now TPL is added on Vyasa-RK3288 board.
+
+To write an image that boots from an SD card (assumed to be /dev/mmcblk0):
+
+   ./tools/mkimage -n rk3288 -T rksd -d ./tpl/u-boot-tpl.bin out &&
+    cat ./spl/u-boot-spl-dtb.bin >> out &&
+    sudo dd if=out of=/dev/mmcblk0 seek=64 &&
+    sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 seek=256
+
 Booting from an SD card on RK3188
 =================================
 
index 5625d210e8ce3844d545b7ca200408698b37b8ee..c96b8f7109053e21edca880f580c21bbdd325946 100644 (file)
@@ -56,10 +56,20 @@ Each list element of the property should specify a device to be probed
 in the order they are listed: references (i.e. implicit paths), a full
 path or an alias is expected for each entry.
 
+A special specifier "same-as-spl" can be used at any position in the
+boot-order to direct U-Boot to insert the device the SPL was booted
+from there.  Whether this is indeed inserted or silently ignored (if
+it is not supported on any given SoC/board or if the boot-device is
+not available to continue booting from) is implementation-defined.
+Note that if "same-as-spl" expands to an actual node for a given
+board, the corresponding node may appear multiple times in the
+boot-order (as there currently exists no mechanism to suppress
+duplicates from the list).
+
 Example
 -------
 / {
        chosen {
-               u-boot,spl-boot-order = &sdmmc, "/sdhci@fe330000";
+               u-boot,spl-boot-order = "same-as-spl", &sdmmc, "/sdhci@fe330000";
        };
 };
index 2cf4b9de8bad8880f3c78504401aa4a76c9d34c8..918711eb4d86881f49abbf12f5872e227ad971c1 100644 (file)
@@ -10,10 +10,10 @@ pmic: drivers/power/pmic/max77686.c
 regulator: drivers/power/regulator/max77686.c
 
 For the node name e.g.: "prefix[:alpha:]num { ... }":
-- the driver prefix should be: "prefix" or "PREFIX" - case insensitive
+- the driver prefix should be: "prefix" - case sensitive
 - the node name's "num" is set as "dev->driver_data" on bind
 
-Example the prefix "ldo" will pass for: "ldo1", "ldo@1", "LDO1", "LDOREG@1"...
+Example the prefix "ldo" will pass for: "ldo1", "ldo@1", "ldoreg@1, ...
 
 Optional properties:
 - regulator-name: a string, required by the regulator uclass
index e5335f7234b779769f40d7a652c4dcd2fbea3157..80944205481eda28702f3b586b19c42f7f9e7eab 100644 (file)
@@ -28,3 +28,12 @@ config ADC_SANDBOX
          - 4 analog input channels
          - 16-bit resolution
          - single and multi-channel conversion mode
+
+config SARADC_ROCKCHIP
+       bool "Enable Rockchip SARADC driver"
+       help
+         This enables driver for Rockchip SARADC.
+         It provides:
+         - 2~6 analog input channels
+         - 1O or 12 bits resolution
+         - Up to 1MSPS of sample rate
index cebf26de078044dbcbecc1aea7c92172352d8037..4b5aa693ec1d12618339fc75432cf8f79d1d465d 100644 (file)
@@ -8,3 +8,4 @@
 obj-$(CONFIG_ADC) += adc-uclass.o
 obj-$(CONFIG_ADC_EXYNOS) += exynos-adc.o
 obj-$(CONFIG_ADC_SANDBOX) += sandbox.o
+obj-$(CONFIG_SARADC_ROCKCHIP) += rockchip-saradc.o
index a5ef722d2137d7e089ee69f727035f4df8d6f89f..a4c20f4d3520d3901a8d68e02c50492ec7d23b85 100644 (file)
@@ -64,7 +64,7 @@ static int adc_supply_enable(struct udevice *dev)
        }
 
        if (ret)
-               error("%s: can't enable %s-supply!", dev->name, supply_type);
+               pr_err("%s: can't enable %s-supply!", dev->name, supply_type);
 
        return ret;
 }
@@ -389,12 +389,12 @@ static int adc_pre_probe(struct udevice *dev)
        /* Set ADC VDD platdata: polarity, uV, regulator (phandle). */
        ret = adc_vdd_platdata_set(dev);
        if (ret)
-               error("%s: Can't update Vdd. Error: %d", dev->name, ret);
+               pr_err("%s: Can't update Vdd. Error: %d", dev->name, ret);
 
        /* Set ADC VSS platdata: polarity, uV, regulator (phandle). */
        ret = adc_vss_platdata_set(dev);
        if (ret)
-               error("%s: Can't update Vss. Error: %d", dev->name, ret);
+               pr_err("%s: Can't update Vss. Error: %d", dev->name, ret);
 
        return 0;
 }
index 324d72f3a95980c1124bdbe3a35f4a8694bf3ca8..3bb065d2155cd78cfb2504331a5e7d3757b75a05 100644 (file)
@@ -22,7 +22,7 @@ int exynos_adc_channel_data(struct udevice *dev, int channel,
        struct exynos_adc_v2 *regs = priv->regs;
 
        if (channel != priv->active_channel) {
-               error("Requested channel is not active!");
+               pr_err("Requested channel is not active!");
                return -EINVAL;
        }
 
@@ -80,7 +80,7 @@ int exynos_adc_probe(struct udevice *dev)
 
        /* Check HW version */
        if (readl(&regs->version) != ADC_V2_VERSION) {
-               error("This driver supports only ADC v2!");
+               pr_err("This driver supports only ADC v2!");
                return -ENXIO;
        }
 
@@ -109,7 +109,7 @@ int exynos_adc_ofdata_to_platdata(struct udevice *dev)
 
        priv->regs = (struct exynos_adc_v2 *)devfdt_get_addr(dev);
        if (priv->regs == (struct exynos_adc_v2 *)FDT_ADDR_T_NONE) {
-               error("Dev: %s - can't get address!", dev->name);
+               pr_err("Dev: %s - can't get address!", dev->name);
                return -ENODATA;
        }
 
diff --git a/drivers/adc/rockchip-saradc.c b/drivers/adc/rockchip-saradc.c
new file mode 100644 (file)
index 0000000..a2856db
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * (C) Copyright 2017, Fuzhou Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ *
+ * Rockchip SARADC driver for U-Boot
+ */
+
+#include <common.h>
+#include <adc.h>
+#include <clk.h>
+#include <dm.h>
+#include <errno.h>
+#include <asm/io.h>
+
+#define SARADC_CTRL_CHN_MASK           GENMASK(2, 0)
+#define SARADC_CTRL_POWER_CTRL         BIT(3)
+#define SARADC_CTRL_IRQ_ENABLE         BIT(5)
+#define SARADC_CTRL_IRQ_STATUS         BIT(6)
+
+#define SARADC_TIMEOUT                 (100 * 1000)
+
+struct rockchip_saradc_regs {
+       unsigned int data;
+       unsigned int stas;
+       unsigned int ctrl;
+       unsigned int dly_pu_soc;
+};
+
+struct rockchip_saradc_data {
+       int                             num_bits;
+       int                             num_channels;
+       unsigned long                   clk_rate;
+};
+
+struct rockchip_saradc_priv {
+       struct rockchip_saradc_regs             *regs;
+       int                                     active_channel;
+       const struct rockchip_saradc_data       *data;
+};
+
+int rockchip_saradc_channel_data(struct udevice *dev, int channel,
+                                unsigned int *data)
+{
+       struct rockchip_saradc_priv *priv = dev_get_priv(dev);
+       struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+
+       if (channel != priv->active_channel) {
+               pr_err("Requested channel is not active!");
+               return -EINVAL;
+       }
+
+       if ((readl(&priv->regs->ctrl) & SARADC_CTRL_IRQ_STATUS) !=
+           SARADC_CTRL_IRQ_STATUS)
+               return -EBUSY;
+
+       /* Read value */
+       *data = readl(&priv->regs->data);
+       *data &= uc_pdata->data_mask;
+
+       /* Power down adc */
+       writel(0, &priv->regs->ctrl);
+
+       return 0;
+}
+
+int rockchip_saradc_start_channel(struct udevice *dev, int channel)
+{
+       struct rockchip_saradc_priv *priv = dev_get_priv(dev);
+
+       if (channel < 0 || channel >= priv->data->num_channels) {
+               pr_err("Requested channel is invalid!");
+               return -EINVAL;
+       }
+
+       /* 8 clock periods as delay between power up and start cmd */
+       writel(8, &priv->regs->dly_pu_soc);
+
+       /* Select the channel to be used and trigger conversion */
+       writel(SARADC_CTRL_POWER_CTRL | (channel & SARADC_CTRL_CHN_MASK) |
+              SARADC_CTRL_IRQ_ENABLE, &priv->regs->ctrl);
+
+       priv->active_channel = channel;
+
+       return 0;
+}
+
+int rockchip_saradc_stop(struct udevice *dev)
+{
+       struct rockchip_saradc_priv *priv = dev_get_priv(dev);
+
+       /* Power down adc */
+       writel(0, &priv->regs->ctrl);
+
+       priv->active_channel = -1;
+
+       return 0;
+}
+
+int rockchip_saradc_probe(struct udevice *dev)
+{
+       struct rockchip_saradc_priv *priv = dev_get_priv(dev);
+       struct clk clk;
+       int ret;
+
+       ret = clk_get_by_index(dev, 0, &clk);
+       if (ret)
+               return ret;
+
+       ret = clk_set_rate(&clk, priv->data->clk_rate);
+       if (IS_ERR_VALUE(ret))
+               return ret;
+
+       priv->active_channel = -1;
+
+       return 0;
+}
+
+int rockchip_saradc_ofdata_to_platdata(struct udevice *dev)
+{
+       struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
+       struct rockchip_saradc_priv *priv = dev_get_priv(dev);
+       struct rockchip_saradc_data *data;
+
+       data = (struct rockchip_saradc_data *)dev_get_driver_data(dev);
+       priv->regs = (struct rockchip_saradc_regs *)dev_read_addr(dev);
+       if (priv->regs == (struct rockchip_saradc_regs *)FDT_ADDR_T_NONE) {
+               pr_err("Dev: %s - can't get address!", dev->name);
+               return -ENODATA;
+       }
+
+       priv->data = data;
+       uc_pdata->data_mask = (1 << priv->data->num_bits) - 1;;
+       uc_pdata->data_format = ADC_DATA_FORMAT_BIN;
+       uc_pdata->data_timeout_us = SARADC_TIMEOUT / 5;
+       uc_pdata->channel_mask = (1 << priv->data->num_channels) - 1;
+
+       return 0;
+}
+
+static const struct adc_ops rockchip_saradc_ops = {
+       .start_channel = rockchip_saradc_start_channel,
+       .channel_data = rockchip_saradc_channel_data,
+       .stop = rockchip_saradc_stop,
+};
+
+static const struct rockchip_saradc_data saradc_data = {
+       .num_bits = 10,
+       .num_channels = 3,
+       .clk_rate = 1000000,
+};
+
+static const struct rockchip_saradc_data rk3066_tsadc_data = {
+       .num_bits = 12,
+       .num_channels = 2,
+       .clk_rate = 50000,
+};
+
+static const struct rockchip_saradc_data rk3399_saradc_data = {
+       .num_bits = 10,
+       .num_channels = 6,
+       .clk_rate = 1000000,
+};
+
+static const struct udevice_id rockchip_saradc_ids[] = {
+       { .compatible = "rockchip,saradc",
+         .data = (ulong)&saradc_data },
+       { .compatible = "rockchip,rk3066-tsadc",
+         .data = (ulong)&rk3066_tsadc_data },
+       { .compatible = "rockchip,rk3399-saradc",
+         .data = (ulong)&rk3399_saradc_data },
+       { }
+};
+
+U_BOOT_DRIVER(rockchip_saradc) = {
+       .name           = "rockchip_saradc",
+       .id             = UCLASS_ADC,
+       .of_match       = rockchip_saradc_ids,
+       .ops            = &rockchip_saradc_ops,
+       .probe          = rockchip_saradc_probe,
+       .ofdata_to_platdata = rockchip_saradc_ofdata_to_platdata,
+       .priv_auto_alloc_size = sizeof(struct rockchip_saradc_priv),
+};
index 371892237aa429d293d31133c3e4e6a67543d4d9..80e8e3701a3453b41395ba839ef6bb0cf9b116eb 100644 (file)
@@ -61,7 +61,7 @@ int sandbox_adc_channel_data(struct udevice *dev, int channel,
        /* For single-channel conversion mode, check if channel was selected */
        if ((priv->conversion_mode == SANDBOX_ADC_MODE_SINGLE_CHANNEL) &&
            !(priv->active_channel_mask & (1 << channel))) {
-               error("Request for an inactive channel!");
+               pr_err("Request for an inactive channel!");
                return -EINVAL;
        }
 
@@ -82,12 +82,12 @@ int sandbox_adc_channels_data(struct udevice *dev, unsigned int channel_mask,
 
        /* Return error for single-channel conversion mode */
        if (priv->conversion_mode == SANDBOX_ADC_MODE_SINGLE_CHANNEL) {
-               error("ADC in single-channel mode!");
+               pr_err("ADC in single-channel mode!");
                return -EPERM;
        }
        /* Check channel selection */
        if (!(priv->active_channel_mask & channel_mask)) {
-               error("Request for an inactive channel!");
+               pr_err("Request for an inactive channel!");
                return -EINVAL;
        }
        /* The conversion must be started before reading the data */
index f6147989b1c811b01d474c325d6f735428297bbe..b16304baedbdf3dbc518f34f22b102c458fdab02 100644 (file)
@@ -58,19 +58,19 @@ static int dwc_ahci_probe(struct udevice *dev)
 
        ret = generic_phy_get_by_name(dev, "sata-phy", &phy);
        if (ret) {
-               error("can't get the phy from DT\n");
+               pr_err("can't get the phy from DT\n");
                return ret;
        }
 
        ret = generic_phy_init(&phy);
        if (ret) {
-               error("unable to initialize the sata phy\n");
+               pr_err("unable to initialize the sata phy\n");
                return ret;
        }
 
        ret = generic_phy_power_on(&phy);
        if (ret) {
-               error("unable to power on the sata phy\n");
+               pr_err("unable to power on the sata phy\n");
                return ret;
        }
 
index a74957d992aa97f96c54a2fca9081b76badd938f..3537255539fe9b9583176cbd769953bcd3758f5d 100644 (file)
@@ -72,9 +72,6 @@
 #include <string.h>
 #endif
 
-#define printk printf
-
-
 /*--------------------------- Inline Functions ----------------------------*/
 
 #ifdef  __cplusplus
index 78f1b759d838388a8fd293c333a856d01658f4e5..5c05e3d78d5b011ade36b4f1e6362c90f1e79efd 100644 (file)
@@ -67,13 +67,13 @@ static int clk_boston_ofdata_to_platdata(struct udevice *dev)
        err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
                                           "regmap", &syscon);
        if (err) {
-               error("unable to find syscon device\n");
+               pr_err("unable to find syscon device\n");
                return err;
        }
 
        state->regmap = syscon_get_regmap(syscon);
        if (!state->regmap) {
-               error("unable to find regmap\n");
+               pr_err("unable to find regmap\n");
                return -ENODEV;
        }
 
index 255a583c954586805a961e69caf16f6648124299..96a06b8f8cb11525a18cde1ba218c08cddc54e71 100644 (file)
@@ -224,7 +224,7 @@ static unsigned long stm32_clk_get_rate(struct clk *clk)
                return sysclk >>= shift;
                break;
        default:
-               error("clock index %ld out of range\n", clk->id);
+               pr_err("clock index %ld out of range\n", clk->id);
                return -EINVAL;
                break;
        }
@@ -310,10 +310,11 @@ static const struct udevice_id stm32_clk_ids[] = {
 };
 
 U_BOOT_DRIVER(stm32f7_clk) = {
-       .name           = "stm32f7_clk",
-       .id             = UCLASS_CLK,
-       .of_match       = stm32_clk_ids,
-       .ops            = &stm32_clk_ops,
-       .probe          = stm32_clk_probe,
-       .flags          = DM_FLAG_PRE_RELOC,
+       .name                   = "stm32f7_clk",
+       .id                     = UCLASS_CLK,
+       .of_match               = stm32_clk_ids,
+       .ops                    = &stm32_clk_ops,
+       .probe                  = stm32_clk_probe,
+       .priv_auto_alloc_size   = sizeof(struct stm32_clk),
+       .flags                  = DM_FLAG_PRE_RELOC,
 };
index fd0e3ab1005301b5936ba62f7984c8dfd821bef7..931e5ef904ec8de4ca213cd40690d7160c8137a3 100644 (file)
@@ -472,13 +472,13 @@ static ulong stm32_get_rate(struct stm32_rcc_regs *regs, enum pllsrc pllsrc)
        clk.id = 0;
        ret = uclass_get_device_by_name(UCLASS_CLK, name, &fixed_clock_dev);
        if (ret) {
-               error("Can't find clk %s (%d)", name, ret);
+               pr_err("Can't find clk %s (%d)", name, ret);
                return 0;
        }
 
        ret = clk_request(fixed_clock_dev, &clk);
        if (ret) {
-               error("Can't request %s clk (%d)", name, ret);
+               pr_err("Can't request %s clk (%d)", name, ret);
                return 0;
        }
 
@@ -518,7 +518,7 @@ static u32 stm32_get_PLL1_rate(struct stm32_rcc_regs *regs,
                break;
        case RCC_PLLCKSELR_PLLSRC_NO_CLK:
                /* shouldn't happen */
-               error("wrong value for RCC_PLLCKSELR register\n");
+               pr_err("wrong value for RCC_PLLCKSELR register\n");
                pllsrc = 0;
                break;
        }
@@ -695,7 +695,7 @@ static ulong stm32_clk_get_rate(struct clk *clk)
                break;
 
        default:
-               error("unexpected gate_offset value (0x%x)\n", gate_offset);
+               pr_err("unexpected gate_offset value (0x%x)\n", gate_offset);
                return -EINVAL;
                break;
        }
@@ -739,13 +739,13 @@ static int stm32_clk_probe(struct udevice *dev)
                                           "st,syscfg", &syscon);
 
        if (err) {
-               error("unable to find syscon device\n");
+               pr_err("unable to find syscon device\n");
                return err;
        }
 
        priv->pwr_regmap = syscon_get_regmap(syscon);
        if (!priv->pwr_regmap) {
-               error("unable to find regmap\n");
+               pr_err("unable to find regmap\n");
                return -ENODEV;
        }
 
index d7f6a3c313e6c86143dc3931fc00196981d8b534..e87267d239fe4433e3a43f88415ddecb8beb024a 100644 (file)
@@ -117,16 +117,16 @@ static void rkclk_init(struct rk322x_cru *cru)
                     pclk_div << CORE_PERI_DIV_SHIFT);
 
        /*
-        * select apll as pd_bus bus clock source and
+        * select gpll as pd_bus bus clock source and
         * set up dependent divisors for PCLK/HCLK and ACLK clocks.
         */
        aclk_div = GPLL_HZ / BUS_ACLK_HZ - 1;
        assert((aclk_div + 1) * BUS_ACLK_HZ == GPLL_HZ && aclk_div <= 0x1f);
 
-       pclk_div = GPLL_HZ / BUS_PCLK_HZ - 1;
+       pclk_div = BUS_ACLK_HZ / BUS_PCLK_HZ - 1;
        assert((pclk_div + 1) * BUS_PCLK_HZ == GPLL_HZ && pclk_div <= 0x7);
 
-       hclk_div = GPLL_HZ / BUS_HCLK_HZ - 1;
+       hclk_div = BUS_ACLK_HZ / BUS_HCLK_HZ - 1;
        assert((hclk_div + 1) * BUS_HCLK_HZ == GPLL_HZ && hclk_div <= 0x3);
 
        rk_clrsetreg(&cru->cru_clksel_con[0],
@@ -389,7 +389,7 @@ static int rk322x_clk_bind(struct udevice *dev)
        /* The reset driver does not have a device node, so bind it here */
        ret = device_bind_driver(gd->dm_root, "rk322x_sysreset", "reset", &dev);
        if (ret)
-               debug("Warning: No RK3036 reset driver: ret=%d\n", ret);
+               debug("Warning: No RK322x reset driver: ret=%d\n", ret);
 
        return 0;
 }
index 478195b10b0eb6175b86a8a0b599c1011af3671e..a133810bf6074416aae264302bab2bb16895c44f 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <bitfield.h>
 #include <clk-uclass.h>
 #include <dm.h>
 #include <dt-structs.h>
@@ -111,6 +112,15 @@ enum {
        PERI_ACLK_DIV_SHIFT     = 0,
        PERI_ACLK_DIV_MASK      = 0x1f << PERI_ACLK_DIV_SHIFT,
 
+       /*
+        * CLKSEL24
+        * saradc_div_con:
+        * clk_saradc=24MHz/(saradc_div_con+1)
+        */
+       CLK_SARADC_DIV_CON_SHIFT        = 8,
+       CLK_SARADC_DIV_CON_MASK         = GENMASK(15, 8),
+       CLK_SARADC_DIV_CON_WIDTH        = 8,
+
        SOCSTS_DPLL_LOCK        = 1 << 5,
        SOCSTS_APLL_LOCK        = 1 << 6,
        SOCSTS_CPLL_LOCK        = 1 << 7,
@@ -634,6 +644,31 @@ static ulong rockchip_spi_set_clk(struct rk3288_cru *cru, uint gclk_rate,
        return rockchip_spi_get_clk(cru, gclk_rate, periph);
 }
 
+static ulong rockchip_saradc_get_clk(struct rk3288_cru *cru)
+{
+       u32 div, val;
+
+       val = readl(&cru->cru_clksel_con[24]);
+       div = bitfield_extract(val, CLK_SARADC_DIV_CON_SHIFT,
+                              CLK_SARADC_DIV_CON_WIDTH);
+
+       return DIV_TO_RATE(OSC_HZ, div);
+}
+
+static ulong rockchip_saradc_set_clk(struct rk3288_cru *cru, uint hz)
+{
+       int src_clk_div;
+
+       src_clk_div = DIV_ROUND_UP(OSC_HZ, hz) - 1;
+       assert(src_clk_div < 128);
+
+       rk_clrsetreg(&cru->cru_clksel_con[24],
+                    CLK_SARADC_DIV_CON_MASK,
+                    src_clk_div << CLK_SARADC_DIV_CON_SHIFT);
+
+       return rockchip_saradc_get_clk(cru);
+}
+
 static ulong rk3288_clk_get_rate(struct clk *clk)
 {
        struct rk3288_clk_priv *priv = dev_get_priv(clk->dev);
@@ -666,6 +701,9 @@ static ulong rk3288_clk_get_rate(struct clk *clk)
                return gclk_rate;
        case PCLK_PWM:
                return PD_BUS_PCLK_HZ;
+       case SCLK_SARADC:
+               new_rate = rockchip_saradc_get_clk(priv->cru);
+               break;
        default:
                return -ENOENT;
        }
@@ -756,6 +794,9 @@ static ulong rk3288_clk_set_rate(struct clk *clk, ulong rate)
                new_rate = rate;
                break;
 #endif
+       case SCLK_SARADC:
+               new_rate = rockchip_saradc_set_clk(priv->cru, rate);
+               break;
        default:
                return -ENOENT;
        }
index c3a6650de0328d563bf869582b596c043d75d862..540d9104c3ccba4208b717fe3af4a3344ad67d25 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <bitfield.h>
 #include <clk-uclass.h>
 #include <dm.h>
 #include <errno.h>
@@ -114,7 +115,8 @@ enum {
 
        /* CLKSEL_CON23 */
        CLK_SARADC_DIV_CON_SHIFT        = 0,
-       CLK_SARADC_DIV_CON_MASK         = 0x3ff << CLK_SARADC_DIV_CON_SHIFT,
+       CLK_SARADC_DIV_CON_MASK         = GENMASK(9, 0),
+       CLK_SARADC_DIV_CON_WIDTH        = 10,
 
        /* CLKSEL_CON24 */
        CLK_PWM_PLL_SEL_CPLL            = 0,
@@ -478,6 +480,31 @@ static ulong rk3328_pwm_set_clk(struct rk3328_cru *cru, uint hz)
        return DIV_TO_RATE(GPLL_HZ, div);
 }
 
+static ulong rk3328_saradc_get_clk(struct rk3328_cru *cru)
+{
+       u32 div, val;
+
+       val = readl(&cru->clksel_con[23]);
+       div = bitfield_extract(val, CLK_SARADC_DIV_CON_SHIFT,
+                              CLK_SARADC_DIV_CON_WIDTH);
+
+       return DIV_TO_RATE(OSC_HZ, div);
+}
+
+static ulong rk3328_saradc_set_clk(struct rk3328_cru *cru, uint hz)
+{
+       int src_clk_div;
+
+       src_clk_div = DIV_ROUND_UP(OSC_HZ, hz) - 1;
+       assert(src_clk_div < 128);
+
+       rk_clrsetreg(&cru->clksel_con[23],
+                    CLK_SARADC_DIV_CON_MASK,
+                    src_clk_div << CLK_SARADC_DIV_CON_SHIFT);
+
+       return rk3328_saradc_get_clk(cru);
+}
+
 static ulong rk3328_clk_get_rate(struct clk *clk)
 {
        struct rk3328_clk_priv *priv = dev_get_priv(clk->dev);
@@ -501,6 +528,9 @@ static ulong rk3328_clk_get_rate(struct clk *clk)
        case SCLK_PWM:
                rate = rk3328_pwm_get_clk(priv->cru);
                break;
+       case SCLK_SARADC:
+               rate = rk3328_saradc_get_clk(priv->cru);
+               break;
        default:
                return -ENOENT;
        }
@@ -531,6 +561,9 @@ static ulong rk3328_clk_set_rate(struct clk *clk, ulong rate)
        case SCLK_PWM:
                ret = rk3328_pwm_set_clk(priv->cru, rate);
                break;
+       case SCLK_SARADC:
+               ret = rk3328_saradc_set_clk(priv->cru, rate);
+               break;
        default:
                return -ENOENT;
        }
index e2747816b9c7752f5f96eef4c518d4df6f878b54..3661769748f20532fec6e1719b3770a995828ad4 100644 (file)
@@ -12,6 +12,7 @@
 #include <errno.h>
 #include <mapmem.h>
 #include <syscon.h>
+#include <bitfield.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/cru_rk3368.h>
 #include <asm/arch/hardware.h>
@@ -301,7 +302,7 @@ static ulong rk3368_ddr_set_clk(struct rk3368_cru *cru, ulong set_rate)
                dpll_cfg = &dpll_1600;
                break;
        default:
-               error("Unsupported SDRAM frequency!,%ld\n", set_rate);
+               pr_err("Unsupported SDRAM frequency!,%ld\n", set_rate);
        }
        rkclk_set_pll(cru, DPLL, dpll_cfg);
 
@@ -359,7 +360,7 @@ static ulong rk3368_spi_get_clk(struct rk3368_cru *cru, ulong clk_id)
                break;
 
        default:
-               error("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
+               pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
                return -EINVAL;
        }
 
@@ -384,7 +385,7 @@ static ulong rk3368_spi_set_clk(struct rk3368_cru *cru, ulong clk_id, uint hz)
                break;
 
        default:
-               error("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
+               pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
                return -EINVAL;
        }
 
@@ -397,6 +398,31 @@ static ulong rk3368_spi_set_clk(struct rk3368_cru *cru, ulong clk_id, uint hz)
        return rk3368_spi_get_clk(cru, clk_id);
 }
 
+static ulong rk3368_saradc_get_clk(struct rk3368_cru *cru)
+{
+       u32 div, val;
+
+       val = readl(&cru->clksel_con[25]);
+       div = bitfield_extract(val, CLK_SARADC_DIV_CON_SHIFT,
+                              CLK_SARADC_DIV_CON_WIDTH);
+
+       return DIV_TO_RATE(OSC_HZ, div);
+}
+
+static ulong rk3368_saradc_set_clk(struct rk3368_cru *cru, uint hz)
+{
+       int src_clk_div;
+
+       src_clk_div = DIV_ROUND_UP(OSC_HZ, hz) - 1;
+       assert(src_clk_div < 128);
+
+       rk_clrsetreg(&cru->clksel_con[25],
+                    CLK_SARADC_DIV_CON_MASK,
+                    src_clk_div << CLK_SARADC_DIV_CON_SHIFT);
+
+       return rk3368_saradc_get_clk(cru);
+}
+
 static ulong rk3368_clk_get_rate(struct clk *clk)
 {
        struct rk3368_clk_priv *priv = dev_get_priv(clk->dev);
@@ -419,6 +445,9 @@ static ulong rk3368_clk_get_rate(struct clk *clk)
                rate = rk3368_mmc_get_clk(priv->cru, clk->id);
                break;
 #endif
+       case SCLK_SARADC:
+               rate = rk3368_saradc_get_clk(priv->cru);
+               break;
        default:
                return -ENOENT;
        }
@@ -453,6 +482,9 @@ static ulong rk3368_clk_set_rate(struct clk *clk, ulong rate)
                ret = rk3368_gmac_set_clk(priv->cru, clk->id, rate);
                break;
 #endif
+       case SCLK_SARADC:
+               ret =  rk3368_saradc_set_clk(priv->cru, rate);
+               break;
        default:
                return -ENOENT;
        }
@@ -498,7 +530,7 @@ static int rk3368_clk_bind(struct udevice *dev)
        /* The reset driver does not have a device node, so bind it here */
        ret = device_bind_driver(gd->dm_root, "rk3368_sysreset", "reset", &dev);
        if (ret)
-               error("bind RK3368 reset driver failed: ret=%d\n", ret);
+               pr_err("bind RK3368 reset driver failed: ret=%d\n", ret);
 
        return ret;
 }
index 9d963be5529a74a85767519b82e39a0a8c931dc5..f45bba44f13ec46804501ff6cb71cf7312e34e3e 100644 (file)
@@ -12,6 +12,7 @@
 #include <errno.h>
 #include <mapmem.h>
 #include <syscon.h>
+#include <bitfield.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/cru_rk3399.h>
@@ -181,7 +182,8 @@ enum {
 
        /* CLKSEL_CON26 */
        CLK_SARADC_DIV_CON_SHIFT        = 8,
-       CLK_SARADC_DIV_CON_MASK         = 0xff << CLK_SARADC_DIV_CON_SHIFT,
+       CLK_SARADC_DIV_CON_MASK         = GENMASK(15, 8),
+       CLK_SARADC_DIV_CON_WIDTH        = 8,
 
        /* CLKSEL_CON27 */
        CLK_TSADC_SEL_X24M              = 0x0,
@@ -661,7 +663,7 @@ static ulong rk3399_spi_get_clk(struct rk3399_cru *cru, ulong clk_id)
                break;
 
        default:
-               error("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
+               pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
                return -EINVAL;
        }
 
@@ -685,7 +687,7 @@ static ulong rk3399_spi_set_clk(struct rk3399_cru *cru, ulong clk_id, uint hz)
                break;
 
        default:
-               error("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
+               pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
                return -EINVAL;
        }
 
@@ -854,12 +856,38 @@ static ulong rk3399_ddr_set_clk(struct rk3399_cru *cru,
                {.refdiv = 1, .fbdiv = 116, .postdiv1 = 3, .postdiv2 = 1};
                break;
        default:
-               error("Unsupported SDRAM frequency!,%ld\n", set_rate);
+               pr_err("Unsupported SDRAM frequency!,%ld\n", set_rate);
        }
        rkclk_set_pll(&cru->dpll_con[0], &dpll_cfg);
 
        return set_rate;
 }
+
+static ulong rk3399_saradc_get_clk(struct rk3399_cru *cru)
+{
+       u32 div, val;
+
+       val = readl(&cru->clksel_con[26]);
+       div = bitfield_extract(val, CLK_SARADC_DIV_CON_SHIFT,
+                              CLK_SARADC_DIV_CON_WIDTH);
+
+       return DIV_TO_RATE(OSC_HZ, div);
+}
+
+static ulong rk3399_saradc_set_clk(struct rk3399_cru *cru, uint hz)
+{
+       int src_clk_div;
+
+       src_clk_div = DIV_ROUND_UP(OSC_HZ, hz) - 1;
+       assert(src_clk_div < 128);
+
+       rk_clrsetreg(&cru->clksel_con[26],
+                    CLK_SARADC_DIV_CON_MASK,
+                    src_clk_div << CLK_SARADC_DIV_CON_SHIFT);
+
+       return rk3399_saradc_get_clk(cru);
+}
+
 static ulong rk3399_clk_get_rate(struct clk *clk)
 {
        struct rk3399_clk_priv *priv = dev_get_priv(clk->dev);
@@ -895,6 +923,9 @@ static ulong rk3399_clk_get_rate(struct clk *clk)
                break;
        case PCLK_EFUSE1024NS:
                break;
+       case SCLK_SARADC:
+               rate = rk3399_saradc_get_clk(priv->cru);
+               break;
        default:
                return -ENOENT;
        }
@@ -943,6 +974,9 @@ static ulong rk3399_clk_set_rate(struct clk *clk, ulong rate)
                break;
        case PCLK_EFUSE1024NS:
                break;
+       case SCLK_SARADC:
+               ret = rk3399_saradc_set_clk(priv->cru, rate);
+               break;
        default:
                return -ENOENT;
        }
index cf966bbdc339924eba4ac8e73b630f41da53d5e2..55741c3a1e23ccde8770fa1c31d07b4d2e12fc51 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <bitfield.h>
 #include <clk-uclass.h>
 #include <dm.h>
 #include <errno.h>
@@ -36,7 +37,7 @@ enum {
                         #hz "Hz cannot be hit with PLL "\
                         "divisors on line " __stringify(__LINE__));
 
-/* use interge mode*/
+/* use integer mode */
 static inline int rv1108_pll_id(enum rk_clk_id clk_id)
 {
        int id = 0;
@@ -130,6 +131,31 @@ static int rv1108_sfc_set_clk(struct rv1108_cru *cru, uint rate)
        return DIV_TO_RATE(pll_rate, div);
 }
 
+static ulong rv1108_saradc_get_clk(struct rv1108_cru *cru)
+{
+       u32 div, val;
+
+       val = readl(&cru->clksel_con[22]);
+       div = bitfield_extract(val, CLK_SARADC_DIV_CON_SHIFT,
+                              CLK_SARADC_DIV_CON_WIDTH);
+
+       return DIV_TO_RATE(OSC_HZ, div);
+}
+
+static ulong rv1108_saradc_set_clk(struct rv1108_cru *cru, uint hz)
+{
+       int src_clk_div;
+
+       src_clk_div = DIV_ROUND_UP(OSC_HZ, hz) - 1;
+       assert(src_clk_div < 128);
+
+       rk_clrsetreg(&cru->clksel_con[22],
+                    CLK_SARADC_DIV_CON_MASK,
+                    src_clk_div << CLK_SARADC_DIV_CON_SHIFT);
+
+       return rv1108_saradc_get_clk(cru);
+}
+
 static ulong rv1108_clk_get_rate(struct clk *clk)
 {
        struct rv1108_clk_priv *priv = dev_get_priv(clk->dev);
@@ -137,6 +163,8 @@ static ulong rv1108_clk_get_rate(struct clk *clk)
        switch (clk->id) {
        case 0 ... 63:
                return rkclk_pll_get_rate(priv->cru, clk->id);
+       case SCLK_SARADC:
+               return rv1108_saradc_get_clk(priv->cru);
        default:
                return -ENOENT;
        }
@@ -154,6 +182,9 @@ static ulong rv1108_clk_set_rate(struct clk *clk, ulong rate)
        case SCLK_SFC:
                new_rate = rv1108_sfc_set_clk(priv->cru, rate);
                break;
+       case SCLK_SARADC:
+               new_rate = rv1108_saradc_set_clk(priv->cru, rate);
+               break;
        default:
                return -ENOENT;
        }
@@ -196,7 +227,7 @@ static int rv1108_clk_bind(struct udevice *dev)
        /* The reset driver does not have a device node, so bind it here */
        ret = device_bind_driver(gd->dm_root, "rv1108_sysreset", "reset", &dev);
        if (ret)
-               error("No Rv1108 reset driver: ret=%d\n", ret);
+               pr_err("No Rv1108 reset driver: ret=%d\n", ret);
 
        return 0;
 }
index 7afef1f9a3f6f273894ca9207d7de4a274ba0fa6..e8ba20ca82d362316e9edfc3e4e6967f04ea7559 100644 (file)
@@ -45,6 +45,12 @@ config DM_WARN
          This will cause dm_warn() to be compiled out - it will do nothing
          when called.
 
+config DM_DEBUG
+       bool "Enable debug messages in driver model core"
+       depends on DM
+       help
+         Say Y here if you want to compile in debug messages in DM core.
+
 config DM_DEVICE_REMOVE
        bool "Support device removal"
        depends on DM
index 3d68c70b57c5e6549e5d1f2f6f4ba5b81a060707..a5039c5bd3114eba461d81a10699f1fafe8fe2bc 100644 (file)
@@ -16,3 +16,5 @@ ifndef CONFIG_DM_DEV_READ_INLINE
 obj-$(CONFIG_OF_CONTROL) += read.o
 endif
 obj-$(CONFIG_OF_CONTROL) += of_extra.o ofnode.o read_extra.o
+
+ccflags-$(CONFIG_DM_DEBUG) += -DDEBUG
index 5463d1ffa508df95fb65f24f058ecbceb8387989..9a46a7bbe5e9dea953629413f35809d92def751e 100644 (file)
@@ -161,7 +161,7 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv,
        }
 
        if (parent)
-               dm_dbg("Bound device %s to %s\n", dev->name, parent->name);
+               pr_debug("Bound device %s to %s\n", dev->name, parent->name);
        if (devp)
                *devp = dev;
 
@@ -254,6 +254,7 @@ static void *alloc_priv(int size, uint flags)
        void *priv;
 
        if (flags & DM_FLAG_ALLOC_PRIV_DMA) {
+               size = ROUND(size, ARCH_DMA_MINALIGN);
                priv = memalign(ARCH_DMA_MINALIGN, size);
                if (priv) {
                        memset(priv, '\0', size);
index 6067914e8117e076cadd7daf109c06c16cece582..6fa5d1090ab0e0796bd3a1c820e8ebb7088dcccc 100644 (file)
@@ -139,12 +139,13 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp)
        if (devp)
                *devp = NULL;
        name = ofnode_get_name(node);
-       dm_dbg("bind node %s\n", name);
+       pr_debug("bind node %s\n", name);
 
        compat_list = ofnode_get_property(node, "compatible", &compat_length);
        if (!compat_list) {
                if (compat_length == -FDT_ERR_NOTFOUND) {
-                       dm_dbg("Device '%s' has no compatible string\n", name);
+                       pr_debug("Device '%s' has no compatible string\n",
+                                name);
                        return 0;
                }
 
@@ -159,8 +160,8 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp)
         */
        for (i = 0; i < compat_length; i += strlen(compat) + 1) {
                compat = compat_list + i;
-               dm_dbg("   - attempt to match compatible string '%s'\n",
-                      compat);
+               pr_debug("   - attempt to match compatible string '%s'\n",
+                        compat);
 
                for (entry = driver; entry != driver + n_ents; entry++) {
                        ret = driver_check_compatible(entry->of_match, &id,
@@ -171,11 +172,11 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp)
                if (entry == driver + n_ents)
                        continue;
 
-               dm_dbg("   - found match at '%s'\n", entry->name);
+               pr_debug("   - found match at '%s'\n", entry->name);
                ret = device_bind_with_driver_data(parent, entry, name,
                                                   id->data, node, &dev);
                if (ret == -ENODEV) {
-                       dm_dbg("Driver '%s' refuses to bind\n", entry->name);
+                       pr_debug("Driver '%s' refuses to bind\n", entry->name);
                        continue;
                }
                if (ret) {
@@ -191,7 +192,7 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp)
        }
 
        if (!found && !result && ret != -ENODEV)
-               dm_dbg("No match for node '%s'\n", name);
+               pr_debug("No match for node '%s'\n", name);
 
        return result;
 }
index c6ca13fabf1f7fbf1ab462d89a400057f89c98e7..0030ab962ef1912bbc75673ed2c09ec172053fcf 100644 (file)
@@ -468,8 +468,10 @@ fdt_addr_t ofnode_get_addr_size(ofnode node, const char *property,
                int na, ns;
                int psize;
                const struct device_node *np = ofnode_to_np(node);
-               const __be32 *prop = of_get_property(np, "reg", &psize);
+               const __be32 *prop = of_get_property(np, property, &psize);
 
+               if (!prop)
+                       return FDT_ADDR_T_NONE;
                na = of_n_addr_cells(np);
                ns = of_n_addr_cells(np);
                *sizep = of_read_number(prop + na, ns);
index 065589a6abcfa00de066fcad7d11c7197092e2d4..eacf1716fd72ac99a7ea3a82450853d6cc3bef16 100644 (file)
@@ -81,6 +81,17 @@ int dev_read_stringlist_search(struct udevice *dev, const char *property,
        return ofnode_stringlist_search(dev_ofnode(dev), property, string);
 }
 
+int dev_read_string_index(struct udevice *dev, const char *propname, int index,
+                         const char **outp)
+{
+       return ofnode_read_string_index(dev_ofnode(dev), propname, index, outp);
+}
+
+int dev_read_string_count(struct udevice *dev, const char *propname)
+{
+       return ofnode_read_string_count(dev_ofnode(dev), propname);
+}
+
 int dev_read_phandle_with_args(struct udevice *dev, const char *list_name,
                                const char *cells_name, int cell_count,
                                int index,
index 757d109e57a37399cafb5091273cf726759ce07d..976e2c4fdd9d6b3842f7db8a2781306a3739690f 100644 (file)
@@ -227,7 +227,7 @@ static int dm_scan_fdt_live(struct udevice *parent,
                    !of_find_property(np, "u-boot,dm-pre-reloc", NULL))
                        continue;
                if (!of_device_is_available(np)) {
-                       dm_dbg("   - ignoring disabled device\n");
+                       pr_debug("   - ignoring disabled device\n");
                        continue;
                }
                err = lists_bind_fdt(parent, np_to_ofnode(np), NULL);
@@ -270,7 +270,7 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
                    !dm_fdt_pre_reloc(blob, offset))
                        continue;
                if (!fdtdec_get_is_enabled(blob, offset)) {
-                       dm_dbg("   - ignoring disabled device\n");
+                       pr_debug("   - ignoring disabled device\n");
                        continue;
                }
                err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL);
index 2e232d57a14fac2db666586beb82796db241c2d1..aaaed4ec022586692a9ff9fe87ff885a82a11074 100644 (file)
@@ -20,17 +20,6 @@ void dm_warn(const char *fmt, ...)
 }
 #endif
 
-#ifdef DEBUG
-void dm_dbg(const char *fmt, ...)
-{
-       va_list args;
-
-       va_start(args, fmt);
-       vprintf(fmt, args);
-       va_end(args);
-}
-#endif
-
 int list_count_items(struct list_head *head)
 {
        struct list_head *node;
index ff732ac309fe2aa1604652fbd43a4a2a3caffb0d..2c22b625b8bdff3eeecc4d932570a711e8936b16 100644 (file)
@@ -64,14 +64,14 @@ int dfu_init_env_entities(char *interface, char *devstr)
 #endif
        str_env = env_get("dfu_alt_info");
        if (!str_env) {
-               error("\"dfu_alt_info\" env variable not defined!\n");
+               pr_err("\"dfu_alt_info\" env variable not defined!\n");
                return -EINVAL;
        }
 
        env_bkp = strdup(str_env);
        ret = dfu_config_entities(env_bkp, interface, devstr);
        if (ret) {
-               error("DFU entities configuration failed!\n");
+               pr_err("DFU entities configuration failed!\n");
                return ret;
        }
 
@@ -132,7 +132,7 @@ static char *dfu_get_hash_algo(void)
                return s;
        }
 
-       error("DFU hash method: %s not supported!\n", s);
+       pr_err("DFU hash method: %s not supported!\n", s);
        return NULL;
 }
 
@@ -273,7 +273,7 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
 
        /* we should be in buffer now (if not then size too large) */
        if ((dfu->i_buf + size) > dfu->i_buf_end) {
-               error("Buffer overflow! (0x%p + 0x%x > 0x%p)\n", dfu->i_buf,
+               pr_err("Buffer overflow! (0x%p + 0x%x > 0x%p)\n", dfu->i_buf,
                      size, dfu->i_buf_end);
                dfu_transaction_cleanup(dfu);
                return -1;
@@ -451,7 +451,7 @@ int dfu_config_entities(char *env, char *interface, char *devstr)
        if (s) {
                ret = hash_lookup_algo(s, &dfu_hash_algo);
                if (ret)
-                       error("Hash algorithm %s not supported\n", s);
+                       pr_err("Hash algorithm %s not supported\n", s);
        }
 
        dfu = calloc(sizeof(*dfu), dfu_alt_num);
@@ -576,7 +576,7 @@ int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size)
                      dp, left, write);
                ret = dfu_write(dfu, dp, write, i);
                if (ret) {
-                       error("DFU write failed\n");
+                       pr_err("DFU write failed\n");
                        return ret;
                }
 
@@ -586,7 +586,7 @@ int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size)
 
        ret = dfu_flush(dfu, NULL, 0, i);
        if (ret)
-               error("DFU flush failed!");
+               pr_err("DFU flush failed!");
 
        return ret;
 }
index 39e10b1a5a67ea209af02245c7e5b2437af4905c..47948d369d950b6b131d92aeb9e8e091ad35322a 100644 (file)
@@ -29,7 +29,7 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
 
        mmc = find_mmc_device(dfu->data.mmc.dev_num);
        if (!mmc) {
-               error("Device MMC %d - not found!", dfu->data.mmc.dev_num);
+               pr_err("Device MMC %d - not found!", dfu->data.mmc.dev_num);
                return -ENODEV;
        }
 
@@ -69,11 +69,11 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
                               buf);
                break;
        default:
-               error("Operation not supported\n");
+               pr_err("Operation not supported\n");
        }
 
        if (n != blk_count) {
-               error("MMC operation failed");
+               pr_err("MMC operation failed");
                if (dfu->data.mmc.hw_partition >= 0)
                        blk_select_hwpart_devnum(IF_TYPE_MMC,
                                                 dfu->data.mmc.dev_num,
@@ -312,7 +312,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
        for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) {
                *parg = strsep(&s, " ");
                if (*parg == NULL) {
-                       error("Invalid number of arguments.\n");
+                       pr_err("Invalid number of arguments.\n");
                        return -ENODEV;
                }
        }
@@ -327,13 +327,13 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
 
        mmc = find_mmc_device(dfu->data.mmc.dev_num);
        if (mmc == NULL) {
-               error("Couldn't find MMC device no. %d.\n",
+               pr_err("Couldn't find MMC device no. %d.\n",
                      dfu->data.mmc.dev_num);
                return -ENODEV;
        }
 
        if (mmc_init(mmc)) {
-               error("Couldn't init MMC device.\n");
+               pr_err("Couldn't init MMC device.\n");
                return -ENODEV;
        }
 
@@ -360,7 +360,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
                int mmcpart = third_arg;
 
                if (part_get_info(blk_dev, mmcpart, &partinfo) != 0) {
-                       error("Couldn't find part #%d on mmc device #%d\n",
+                       pr_err("Couldn't find part #%d on mmc device #%d\n",
                              mmcpart, mmcdev);
                        return -ENODEV;
                }
@@ -374,7 +374,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
        } else if (!strcmp(entity_type, "ext4")) {
                dfu->layout = DFU_FS_EXT4;
        } else {
-               error("Memory layout (%s) not supported!\n", entity_type);
+               pr_err("Memory layout (%s) not supported!\n", entity_type);
                return -ENODEV;
        }
 
@@ -397,7 +397,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
                dfu_file_buf = memalign(CONFIG_SYS_CACHELINE_SIZE,
                                        CONFIG_SYS_DFU_MAX_FILE_SIZE);
                if (!dfu_file_buf) {
-                       error("Could not memalign 0x%x bytes",
+                       pr_err("Could not memalign 0x%x bytes",
                              CONFIG_SYS_DFU_MAX_FILE_SIZE);
                        return -ENOMEM;
                }
index 6e3f5316f5ada793bcbcf02be408167a3cca2c37..2b5e05a913eeda5f4ed1b4a8ae501de78ee0d263 100644 (file)
@@ -18,12 +18,12 @@ static int dfu_transfer_medium_ram(enum dfu_op op, struct dfu_entity *dfu,
                                   u64 offset, void *buf, long *len)
 {
        if (dfu->layout != DFU_RAM_ADDR) {
-               error("unsupported layout: %s\n", dfu_get_layout(dfu->layout));
+               pr_err("unsupported layout: %s\n", dfu_get_layout(dfu->layout));
                return  -EINVAL;
        }
 
        if (offset > dfu->data.ram.size) {
-               error("request exceeds allowed area\n");
+               pr_err("request exceeds allowed area\n");
                return -EINVAL;
        }
 
@@ -62,14 +62,14 @@ int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr, char *s)
        for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) {
                *parg = strsep(&s, " ");
                if (*parg == NULL) {
-                       error("Invalid number of arguments.\n");
+                       pr_err("Invalid number of arguments.\n");
                        return -ENODEV;
                }
        }
 
        dfu->dev_type = DFU_DEV_RAM;
        if (strcmp(argv[0], "ram")) {
-               error("unsupported device: %s\n", argv[0]);
+               pr_err("unsupported device: %s\n", argv[0]);
                return -ENODEV;
        }
 
index cd71708231f57744fd895d16ddbc478746db01a7..62bf797dac9f11d26f5c325b457e03ce96565a8f 100644 (file)
@@ -43,7 +43,7 @@ int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len,
        alt_setting_num = dfu_get_alt(sb);
        free(sb);
        if (alt_setting_num < 0) {
-               error("Alt setting [%d] to write not found!",
+               pr_err("Alt setting [%d] to write not found!",
                      alt_setting_num);
                ret = -ENODEV;
                goto done;
@@ -51,7 +51,7 @@ int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len,
 
        dfu = dfu_get_entity(alt_setting_num);
        if (!dfu) {
-               error("DFU entity for alt: %d not found!", alt_setting_num);
+               pr_err("DFU entity for alt: %d not found!", alt_setting_num);
                ret = -ENODEV;
                goto done;
        }
index ea21fd9c6febdc0b08064419cbc178805ea09250..3d0ce22fbc2186c0caab158a00394081663b5a21 100644 (file)
@@ -33,7 +33,7 @@ int dma_get_device(u32 transfer_type, struct udevice **devp)
        }
 
        if (!dev) {
-               error("No DMA device found that supports %x type\n",
+               pr_err("No DMA device found that supports %x type\n",
                      transfer_type);
                return -EPROTONOSUPPORT;
        }
index 955adfeccda1e565c14eeee9cbcd7b785520a924..63a8a2f34080f96af695c2274c3b637cac48fdb3 100644 (file)
@@ -96,7 +96,7 @@ int lpc32xx_dma_start_xfer(unsigned int channel,
 {
        if (unlikely(((BIT_MASK(channel) & alloc_ch) == 0) ||
                     (channel >= DMA_NO_OF_CHANNELS))) {
-               error("Request for xfer on unallocated channel %d", channel);
+               pr_err("Request for xfer on unallocated channel %d", channel);
                return -1;
        }
        writel(BIT_MASK(channel), &dma->int_tc_clear);
@@ -117,7 +117,7 @@ int lpc32xx_dma_wait_status(unsigned int channel)
 
        /* Check if given channel is valid */
        if (unlikely(channel >= DMA_NO_OF_CHANNELS)) {
-               error("Request for status on unallocated channel %d", channel);
+               pr_err("Request for status on unallocated channel %d", channel);
                return -1;
        }
 
@@ -129,7 +129,7 @@ int lpc32xx_dma_wait_status(unsigned int channel)
                        break;
 
                if (get_timer(start) > CONFIG_SYS_HZ) {
-                       error("DMA status timeout channel %d\n", channel);
+                       pr_err("DMA status timeout channel %d\n", channel);
                        return -ETIMEDOUT;
                }
                udelay(1);
@@ -138,7 +138,7 @@ int lpc32xx_dma_wait_status(unsigned int channel)
        if (unlikely(readl(&dma->raw_err_stat) & BIT_MASK(channel))) {
                setbits_le32(&dma->int_err_clear, BIT_MASK(channel));
                setbits_le32(&dma->raw_err_stat, BIT_MASK(channel));
-               error("DMA error on channel %d\n", channel);
+               pr_err("DMA error on channel %d\n", channel);
                return -1;
        }
        setbits_le32(&dma->int_tc_clear, BIT_MASK(channel));
index 39e97930135a18576cae6b9dc4b94776f01b2189..635eb7876d5526965a1fcf3584bdfb5dd2c3bd89 100644 (file)
@@ -491,7 +491,7 @@ static int ti_edma3_transfer(struct udevice *dev, int direction, void *dst,
                __edma3_transfer(priv->base, 1, dst, src, len);
                break;
        default:
-               error("Transfer type not implemented in DMA driver\n");
+               pr_err("Transfer type not implemented in DMA driver\n");
                break;
        }
 
index 4db08a344adbfd8b6c80dcde7fd4bfd061afefbe..1012f2d8eb8d2093621976ed91c9b8dab3432f58 100644 (file)
@@ -138,7 +138,7 @@ int peripheral_request(unsigned short per, const char *label)
                return 0;
 
        if (!(per & P_DEFINED))
-               return -ENODEV;
+               return -EINVAL;
 
        BUG_ON(ident >= MAX_RESOURCES);
 
index f3689467f01fd9a2bf25e9dc0052108c6d01b88e..30bc4296e3aa4235ac57bc659e2f14f0552ed40e 100644 (file)
@@ -50,11 +50,11 @@ static int atmel_pio4_config_io_func(u32 port, u32 pin,
        u32 reg, mask;
 
        if (pin >= ATMEL_PIO_NPINS_PER_BANK)
-               return -ENODEV;
+               return -EINVAL;
 
        port_base = atmel_pio4_port_base(port);
        if (!port_base)
-               return -ENODEV;
+               return -EINVAL;
 
        mask = 1 << pin;
        reg = func;
@@ -128,11 +128,11 @@ int atmel_pio4_set_pio_output(u32 port, u32 pin, u32 value)
        u32 reg, mask;
 
        if (pin >= ATMEL_PIO_NPINS_PER_BANK)
-               return -ENODEV;
+               return -EINVAL;
 
        port_base = atmel_pio4_port_base(port);
        if (!port_base)
-               return -ENODEV;
+               return -EINVAL;
 
        mask = 0x01 << pin;
        reg = ATMEL_PIO_CFGR_FUNC_GPIO | ATMEL_PIO_DIR_MASK;
@@ -154,11 +154,11 @@ int atmel_pio4_get_pio_input(u32 port, u32 pin)
        u32 reg, mask;
 
        if (pin >= ATMEL_PIO_NPINS_PER_BANK)
-               return -ENODEV;
+               return -EINVAL;
 
        port_base = atmel_pio4_port_base(port);
        if (!port_base)
-               return -ENODEV;
+               return -EINVAL;
 
        mask = 0x01 << pin;
        reg = ATMEL_PIO_CFGR_FUNC_GPIO;
index 5abc88ba5477fec5e044765b0e93cc4836d0f9a5..7825714e8003c0e92573c11673013de58034e909 100644 (file)
@@ -168,13 +168,18 @@ static int imx_rgpio2p_bind(struct udevice *dev)
 
        addr = devfdt_get_addr_index(dev, 1);
        if (addr == FDT_ADDR_T_NONE)
-               return -ENODEV;
+               return -EINVAL;
 
        /*
         * TODO:
         * When every board is converted to driver model and DT is supported,
         * this can be done by auto-alloc feature, but not using calloc
         * to alloc memory for platdata.
+        *
+        * For example imx_rgpio2p_plat uses platform data rather than device
+        * tree.
+        *
+        * NOTE: DO NOT COPY this code if you are using device tree.
         */
        plat = calloc(1, sizeof(*plat));
        if (!plat)
index 0eb6c600f1ef4f446c4280becdb05870f6544f1b..c480eba9407a40c89575b72b94e0b2c4d01140c5 100644 (file)
@@ -304,13 +304,18 @@ static int mxc_gpio_bind(struct udevice *dev)
 
        addr = devfdt_get_addr(dev);
        if (addr == FDT_ADDR_T_NONE)
-               return -ENODEV;
+               return -EINVAL;
 
        /*
         * TODO:
         * When every board is converted to driver model and DT is supported,
         * this can be done by auto-alloc feature, but not using calloc
         * to alloc memory for platdata.
+        *
+        * For example mxc_plat below uses platform data rather than device
+        * tree.
+        *
+        * NOTE: DO NOT COPY this code if you are using device tree.
         */
        plat = calloc(1, sizeof(*plat));
        if (!plat)
index b423e34ca4bfc4ad3d2a6e0aa42eebae2b8e4e90..7243100219a99399dd7b9985ed393a944ca42883 100644 (file)
@@ -299,7 +299,7 @@ static int omap_gpio_probe(struct udevice *dev)
 
 static int omap_gpio_bind(struct udevice *dev)
 {
-       struct omap_gpio_platdata *plat = dev->platdata;
+       struct omap_gpio_platdata *plat = dev_get_platdata(dev);
        fdt_addr_t base_addr;
 
        if (plat)
@@ -307,13 +307,17 @@ static int omap_gpio_bind(struct udevice *dev)
 
        base_addr = devfdt_get_addr(dev);
        if (base_addr == FDT_ADDR_T_NONE)
-               return -ENODEV;
+               return -EINVAL;
 
        /*
        * TODO:
        * When every board is converted to driver model and DT is
        * supported, this can be done by auto-alloc feature, but
        * not using calloc to alloc memory for platdata.
+       *
+       * For example am33xx_gpio uses platform data rather than device tree.
+       *
+       * NOTE: DO NOT COPY this code if you are using device tree.
        */
        plat = calloc(1, sizeof(*plat));
        if (!plat)
index 4962f25230808d3c7fffba3a2eda89936007d025..791d1d15166f5585b5fe2df8537f43640144b2fd 100644 (file)
@@ -249,22 +249,11 @@ static int pca953x_probe(struct udevice *dev)
 {
        struct pca953x_info *info = dev_get_platdata(dev);
        struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
-       struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
        char name[32], *str;
        int addr;
        ulong driver_data;
        int ret;
 
-       if (!info) {
-               dev_err(dev, "platdata not ready\n");
-               return -ENOMEM;
-       }
-
-       if (!chip) {
-               dev_err(dev, "i2c not ready\n");
-               return -ENODEV;
-       }
-
        addr = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "reg", 0);
        if (addr == 0)
                return -ENODEV;
index c5a7e13cceb8f88aba4d52f3a4920232c586738e..deb59e8b32024842fdb860ec40952766395f5b95 100644 (file)
@@ -181,7 +181,7 @@ static int tegra186_gpio_bind(struct udevice *parent)
 
        regs = (uint32_t *)devfdt_get_addr_name(parent, "gpio");
        if (regs == (uint32_t *)FDT_ADDR_T_NONE)
-               return -ENODEV;
+               return -EINVAL;
 
        for (port = 0; port < ctlr_data->port_count; port++) {
                struct tegra186_gpio_platdata *plat;
index 89918e48ddc9e1b18898fe261072bea0ae358c32..030e8d08a453b88c210023fd905f819d9c5de69e 100644 (file)
@@ -105,32 +105,18 @@ static int vybrid_gpio_probe(struct udevice *dev)
        return 0;
 }
 
-static int vybrid_gpio_bind(struct udevice *dev)
+static int vybrid_gpio_odata_to_platdata(struct udevice *dev)
 {
-       struct vybrid_gpio_platdata *plat = dev->platdata;
+       struct vybrid_gpio_platdata *plat = dev_get_platdata(dev);
        fdt_addr_t base_addr;
 
-       if (plat)
-               return 0;
-
        base_addr = devfdt_get_addr(dev);
        if (base_addr == FDT_ADDR_T_NONE)
-               return -ENODEV;
-
-       /*
-       * TODO:
-       * When every board is converted to driver model and DT is
-       * supported, this can be done by auto-alloc feature, but
-       * not using calloc to alloc memory for platdata.
-       */
-       plat = calloc(1, sizeof(*plat));
-       if (!plat)
-               return -ENOMEM;
+               return -EINVAL;
 
        plat->base = base_addr;
        plat->chip = dev->req_seq;
        plat->port_name = fdt_get_name(gd->fdt_blob, dev_of_offset(dev), NULL);
-       dev->platdata = plat;
 
        return 0;
 }
@@ -144,8 +130,9 @@ U_BOOT_DRIVER(gpio_vybrid) = {
        .name   = "gpio_vybrid",
        .id     = UCLASS_GPIO,
        .ops    = &gpio_vybrid_ops,
+       .of_match = vybrid_gpio_ids,
+       .ofdata_to_platdata = vybrid_gpio_odata_to_platdata,
        .probe  = vybrid_gpio_probe,
        .priv_auto_alloc_size = sizeof(struct vybrid_gpios),
-       .of_match = vybrid_gpio_ids,
-       .bind   = vybrid_gpio_bind,
+       .platdata_auto_alloc_size = sizeof(struct vybrid_gpio_platdata),
 };
index aeeb304a876f13a44cbac1d0ccbecc1523b9b9a0..4e8fa214739a4bee0faa963bac3717f5090a9aae 100644 (file)
@@ -322,7 +322,7 @@ static int i2c_gpio_ofdata_to_platdata(struct udevice *dev)
 
        return 0;
 error:
-       error("Can't get %s gpios! Error: %d", dev->name, ret);
+       pr_err("Can't get %s gpios! Error: %d", dev->name, ret);
        return ret;
 }
 
index aa97196e237c903694e19cc8e0ab999f889b21a8..e7ec17fe9e1b1c83d3021fadcb0968955fa2f3c9 100644 (file)
@@ -412,7 +412,7 @@ static int imx_lpi2c_probe(struct udevice *bus)
 
        addr = devfdt_get_addr(bus);
        if (addr == FDT_ADDR_T_NONE)
-               return -ENODEV;
+               return -EINVAL;
 
        i2c_bus->base = addr;
        i2c_bus->index = bus->seq;
index b7bb76c0ed0c794ce1f7e183465e06ed397353e0..abf1da2ae3ee846cc8b4a88cd662fe5a8edd55a5 100644 (file)
@@ -176,7 +176,7 @@ static int bus_i2c_set_bus_speed(struct mxc_i2c_bus *i2c_bus, int speed)
        int reg_shift = quirk ? VF610_I2C_REGSHIFT : IMX_I2C_REGSHIFT;
 
        if (!base)
-               return -ENODEV;
+               return -EINVAL;
 
        /* Store divider value */
        writeb(idx, base + (IFDR << reg_shift));
@@ -239,7 +239,7 @@ static int tx_byte(struct mxc_i2c_bus *i2c_bus, u8 byte)
        if (ret < 0)
                return ret;
        if (ret & I2SR_RX_NO_AK)
-               return -ENODEV;
+               return -EREMOTEIO;
        return 0;
 }
 
@@ -418,14 +418,14 @@ static int i2c_init_transfer(struct mxc_i2c_bus *i2c_bus, u8 chip,
                        VF610_I2C_REGSHIFT : IMX_I2C_REGSHIFT;
 
        if (!i2c_bus->base)
-               return -ENODEV;
+               return -EINVAL;
 
        for (retry = 0; retry < 3; retry++) {
                ret = i2c_init_transfer_(i2c_bus, chip, addr, alen);
                if (ret >= 0)
                        return 0;
                i2c_imx_stop(i2c_bus);
-               if (ret == -ENODEV)
+               if (ret == -EREMOTEIO)
                        return ret;
 
                printf("%s: failed for chip 0x%x retry=%d\n", __func__, chip,
@@ -754,7 +754,7 @@ static int mxc_i2c_probe(struct udevice *bus)
 
        addr = devfdt_get_addr(bus);
        if (addr == FDT_ADDR_T_NONE)
-               return -ENODEV;
+               return -EINVAL;
 
        i2c_bus->base = addr;
        i2c_bus->index = bus->seq;
@@ -783,7 +783,7 @@ static int mxc_i2c_probe(struct udevice *bus)
                    !dm_gpio_is_valid(&i2c_bus->scl_gpio) |
                    ret | ret2) {
                        dev_err(dev, "i2c bus %d at %lu, fail to request scl/sda gpio\n", bus->seq, i2c_bus->base);
-                       return -ENODEV;
+                       return -EINVAL;
                }
        }
 
index c98c6276ddb48aab605e567cee21c99ed9299645..5d33815146216910f66a6a4cf91cd5b2447a06dd 100644 (file)
@@ -755,7 +755,7 @@ static uint omap24_i2c_setspeed(struct i2c_adapter *adap, uint speed)
 
        ret = __omap24_i2c_setspeed(i2c_base, speed, &adap->waitdelay);
        if (ret) {
-               error("%s: set i2c speed failed\n", __func__);
+               pr_err("%s: set i2c speed failed\n", __func__);
                return ret;
        }
 
index 840b3f6046bfe2005e4aafd3f73769680510c8ea..332280c220e7dc90af7d27b5aa2c983a3521460b 100644 (file)
@@ -396,6 +396,7 @@ static const struct udevice_id rockchip_i2c_ids[] = {
        { .compatible = "rockchip,rk3066-i2c" },
        { .compatible = "rockchip,rk3188-i2c" },
        { .compatible = "rockchip,rk3288-i2c" },
+       { .compatible = "rockchip,rk3328-i2c" },
        { .compatible = "rockchip,rk3399-i2c" },
        { }
 };
index bf5fefab7bfb72cb4acb1d5c48c1999819119ed1..196f2365ea5fad60140256b1dc89eed48ea4a5d2 100644 (file)
@@ -549,7 +549,7 @@ static int stm32_i2c_compute_solutions(struct stm32_i2c_setup *setup,
        }
 
        if (list_empty(solutions)) {
-               error("%s: no Prescaler solution\n", __func__);
+               pr_err("%s: no Prescaler solution\n", __func__);
                ret = -EPERM;
        }
 
@@ -627,7 +627,7 @@ static int stm32_i2c_choose_solution(struct stm32_i2c_setup *setup,
        }
 
        if (!s) {
-               error("%s: no solution at all\n", __func__);
+               pr_err("%s: no solution at all\n", __func__);
                ret = -EPERM;
        }
 
@@ -643,14 +643,14 @@ static int stm32_i2c_compute_timing(struct stm32_i2c_priv *i2c_priv,
        int ret;
 
        if (setup->speed >= STM32_I2C_SPEED_END) {
-               error("%s: speed out of bound {%d/%d}\n", __func__,
+               pr_err("%s: speed out of bound {%d/%d}\n", __func__,
                      setup->speed, STM32_I2C_SPEED_END - 1);
                return -EINVAL;
        }
 
        if ((setup->rise_time > i2c_specs[setup->speed].rise_max) ||
            (setup->fall_time > i2c_specs[setup->speed].fall_max)) {
-               error("%s :timings out of bound Rise{%d>%d}/Fall{%d>%d}\n",
+               pr_err("%s :timings out of bound Rise{%d>%d}/Fall{%d>%d}\n",
                      __func__,
                      setup->rise_time, i2c_specs[setup->speed].rise_max,
                      setup->fall_time, i2c_specs[setup->speed].fall_max);
@@ -658,13 +658,13 @@ static int stm32_i2c_compute_timing(struct stm32_i2c_priv *i2c_priv,
        }
 
        if (setup->dnf > STM32_I2C_DNF_MAX) {
-               error("%s: DNF out of bound %d/%d\n", __func__,
+               pr_err("%s: DNF out of bound %d/%d\n", __func__,
                      setup->dnf, STM32_I2C_DNF_MAX);
                return -EINVAL;
        }
 
        if (setup->speed_freq > i2c_specs[setup->speed].rate) {
-               error("%s: Freq {%d/%d}\n", __func__,
+               pr_err("%s: Freq {%d/%d}\n", __func__,
                      setup->speed_freq, i2c_specs[setup->speed].rate);
                return -EINVAL;
        }
@@ -711,7 +711,7 @@ static int stm32_i2c_setup_timing(struct stm32_i2c_priv *i2c_priv,
        setup->clock_src = clk_get_rate(&i2c_priv->clk);
 
        if (!setup->clock_src) {
-               error("%s: clock rate is 0\n", __func__);
+               pr_err("%s: clock rate is 0\n", __func__);
                return -EINVAL;
        }
 
@@ -734,7 +734,7 @@ static int stm32_i2c_setup_timing(struct stm32_i2c_priv *i2c_priv,
        } while (ret);
 
        if (ret) {
-               error("%s: impossible to compute I2C timings.\n", __func__);
+               pr_err("%s: impossible to compute I2C timings.\n", __func__);
                return ret;
        }
 
index 931c6de508c02b2c0c3475470908a61f7f59b1fe..b46a09a4e07e1638f076e531225e00b18da0b57e 100644 (file)
@@ -94,7 +94,7 @@ static int tegra186_bpmp_i2c_probe(struct udevice *dev)
                                            "nvidia,bpmp-bus-id", U32_MAX);
        if (priv->bpmp_bus_id == U32_MAX) {
                debug("%s: could not parse nvidia,bpmp-bus-id\n", __func__);
-               return -ENODEV;
+               return -EINVAL;
        }
 
        return 0;
index 3255e8ed37090f201b1b70845214576f9bdde8ae..7d23e51b69d2158ac7942cd936c045eb1a269060 100644 (file)
@@ -372,12 +372,12 @@ static int tegra_i2c_probe(struct udevice *dev)
 
        ret = reset_get_by_name(dev, "i2c", &i2c_bus->reset_ctl);
        if (ret) {
-               error("reset_get_by_name() failed: %d\n", ret);
+               pr_err("reset_get_by_name() failed: %d\n", ret);
                return ret;
        }
        ret = clk_get_by_name(dev, "div-clk", &i2c_bus->clk);
        if (ret) {
-               error("clk_get_by_name() failed: %d\n", ret);
+               pr_err("clk_get_by_name() failed: %d\n", ret);
                return ret;
        }
 
index d61bacfc44f2fbcc8dba608e76d499d08524d2c9..1fdf8efff3b9eb9b44b92156d243f2ec2be33ad4 100644 (file)
@@ -44,7 +44,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
 
        ret = tegra_ivc_write_get_next_frame(&priv->ivc, &ivc_frame);
        if (ret) {
-               error("tegra_ivc_write_get_next_frame() failed: %d\n", ret);
+               pr_err("tegra_ivc_write_get_next_frame() failed: %d\n", ret);
                return ret;
        }
 
@@ -55,7 +55,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
 
        ret = tegra_ivc_write_advance(&priv->ivc);
        if (ret) {
-               error("tegra_ivc_write_advance() failed: %d\n", ret);
+               pr_err("tegra_ivc_write_advance() failed: %d\n", ret);
                return ret;
        }
 
@@ -63,7 +63,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
        for (;;) {
                ret = tegra_ivc_channel_notified(&priv->ivc);
                if (ret) {
-                       error("tegra_ivc_channel_notified() failed: %d\n", ret);
+                       pr_err("tegra_ivc_channel_notified() failed: %d\n", ret);
                        return ret;
                }
 
@@ -73,7 +73,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
 
                /* Timeout 20ms; roughly 10x current max observed duration */
                if ((timer_get_us() - start_time) > 20 * 1000) {
-                       error("tegra_ivc_read_get_next_frame() timed out (%d)\n",
+                       pr_err("tegra_ivc_read_get_next_frame() timed out (%d)\n",
                              ret);
                        return -ETIMEDOUT;
                }
@@ -86,12 +86,12 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
 
        ret = tegra_ivc_read_advance(&priv->ivc);
        if (ret) {
-               error("tegra_ivc_write_advance() failed: %d\n", ret);
+               pr_err("tegra_ivc_write_advance() failed: %d\n", ret);
                return ret;
        }
 
        if (err) {
-               error("BPMP responded with error %d\n", err);
+               pr_err("BPMP responded with error %d\n", err);
                /* err isn't a U-Boot error code, so don't that */
                return -EIO;
        }
@@ -144,14 +144,14 @@ static ulong tegra186_bpmp_get_shmem(struct udevice *dev, int index)
        ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev_of_offset(dev),
                                              "shmem", NULL, 0, index, &args);
        if (ret < 0) {
-               error("fdtdec_parse_phandle_with_args() failed: %d\n", ret);
+               pr_err("fdtdec_parse_phandle_with_args() failed: %d\n", ret);
                return ret;
        }
 
        reg = fdtdec_get_addr_size_auto_noparent(gd->fdt_blob, args.node,
                                                 "reg", 0, NULL, true);
        if (reg == FDT_ADDR_T_NONE) {
-               error("fdtdec_get_addr_size_auto_noparent() failed\n");
+               pr_err("fdtdec_get_addr_size_auto_noparent() failed\n");
                return -ENODEV;
        }
 
@@ -166,7 +166,7 @@ static void tegra186_bpmp_ivc_notify(struct tegra_ivc *ivc)
 
        ret = mbox_send(&priv->mbox, NULL);
        if (ret)
-               error("mbox_send() failed: %d\n", ret);
+               pr_err("mbox_send() failed: %d\n", ret);
 }
 
 static int tegra186_bpmp_probe(struct udevice *dev)
@@ -179,18 +179,18 @@ static int tegra186_bpmp_probe(struct udevice *dev)
 
        ret = mbox_get_by_index(dev, 0, &priv->mbox);
        if (ret) {
-               error("mbox_get_by_index() failed: %d\n", ret);
+               pr_err("mbox_get_by_index() failed: %d\n", ret);
                return ret;
        }
 
        tx_base = tegra186_bpmp_get_shmem(dev, 0);
        if (IS_ERR_VALUE(tx_base)) {
-               error("tegra186_bpmp_get_shmem failed for tx_base\n");
+               pr_err("tegra186_bpmp_get_shmem failed for tx_base\n");
                return tx_base;
        }
        rx_base = tegra186_bpmp_get_shmem(dev, 1);
        if (IS_ERR_VALUE(rx_base)) {
-               error("tegra186_bpmp_get_shmem failed for rx_base\n");
+               pr_err("tegra186_bpmp_get_shmem failed for rx_base\n");
                return rx_base;
        }
        debug("shmem: rx=%lx, tx=%lx\n", rx_base, tx_base);
@@ -198,7 +198,7 @@ static int tegra186_bpmp_probe(struct udevice *dev)
        ret = tegra_ivc_init(&priv->ivc, rx_base, tx_base, BPMP_IVC_FRAME_COUNT,
                             BPMP_IVC_FRAME_SIZE, tegra186_bpmp_ivc_notify);
        if (ret) {
-               error("tegra_ivc_init() failed: %d\n", ret);
+               pr_err("tegra_ivc_init() failed: %d\n", ret);
                return ret;
        }
 
@@ -211,7 +211,7 @@ static int tegra186_bpmp_probe(struct udevice *dev)
 
                /* Timeout 100ms */
                if ((timer_get_us() - start_time) > 100 * 1000) {
-                       error("Initial IVC reset timed out (%d)\n", ret);
+                       pr_err("Initial IVC reset timed out (%d)\n", ret);
                        ret = -ETIMEDOUT;
                        goto err_free_mbox;
                }
index 6de927b8c6cb98ee71c60b8b6e22ec8ae3a7ffa7..940508364a51c1296504d5012f303aaf9b31fd87 100644 (file)
@@ -136,6 +136,7 @@ config MMC_PCI
 config MMC_OMAP_HS
        bool "TI OMAP High Speed Multimedia Card Interface support"
        select DM_REGULATOR_PBIAS if DM_MMC && DM_REGULATOR
+       select DM_REGULATOR_PBIAS if DM_MMC && DM_REGULATOR
        help
          This selects the TI OMAP High Speed Multimedia card Interface.
          If you have an omap2plus board with a Multimedia Card slot,
@@ -162,12 +163,13 @@ config SH_SDHI
          Support for the on-chip SDHI host controller on SuperH/Renesas ARM SoCs platform
 
 config MMC_UNIPHIER
-       bool "UniPhier SD/MMC Host Controller support"
-       depends on ARCH_UNIPHIER
+       bool "UniPhier/RCar SD/MMC Host Controller support"
+       depends on ARCH_UNIPHIER || ARCH_RMOBILE
        depends on BLK && DM_MMC
        depends on OF_CONTROL
        help
-         This selects support for the SD/MMC Host Controller on UniPhier SoCs.
+         This selects support for the Matsushita SD/MMC Host Controller on
+         SocioNext UniPhier and Renesas RCar SoCs.
 
 config MMC_SANDBOX
        bool "Sandbox MMC support"
@@ -382,6 +384,14 @@ config GENERIC_ATMEL_MCI
          the SD Memory Card Specification V2.0, the SDIO V2.0 specification
          and CE-ATA V1.1.
 
+config STM32_SDMMC2
+       bool "STMicroelectronics STM32H7 SD/MMC Host Controller support"
+       depends on DM_MMC && BLK && OF_CONTROL
+       help
+         This selects support for the SD/MMC controller on STM32H7 SoCs.
+         If you have a board based on such a SoC and with a SD/MMC slot,
+         say Y or M here.
+
 endif
 
 config TEGRA124_MMC_DISABLE_EXT_LOOPBACK
index a6becb230908844dac8c75607726af679dbed7c2..d505f37f0194ff152747fe8775c3c0cd5192f28f 100644 (file)
@@ -43,6 +43,7 @@ obj-$(CONFIG_SUPPORT_EMMC_RPMB) += rpmb.o
 obj-$(CONFIG_MMC_SANDBOX)              += sandbox_mmc.o
 obj-$(CONFIG_SH_MMCIF) += sh_mmcif.o
 obj-$(CONFIG_SH_SDHI) += sh_sdhi.o
+obj-$(CONFIG_STM32_SDMMC2) += stm32_sdmmc2.o
 
 # SDHCI
 obj-$(CONFIG_MMC_SDHCI)                        += sdhci.o
index 40f7892ac80b757ef95ca723a1495d56110f3a93..5edd383c68484e2096e6ca785039a90e42baee5e 100644 (file)
@@ -155,7 +155,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
 
        priv = malloc(sizeof(struct dwmci_exynos_priv_data));
        if (!priv) {
-               error("dwmci_exynos_priv_data malloc fail!\n");
+               pr_err("dwmci_exynos_priv_data malloc fail!\n");
                return -ENOMEM;
        }
 
index d795198534b7724d76bddbd506c2e81f4c20bc21..44a8ef825f32c55251d69b86c9fedb677b1f7c63 100644 (file)
@@ -44,7 +44,7 @@ int hi6220_dwmci_add_port(int index, u32 regbase, int bus_width)
 
        host = calloc(1, sizeof(struct dwmci_host));
        if (!host) {
-               error("dwmci_host calloc failed!\n");
+               pr_err("dwmci_host calloc failed!\n");
                return -ENOMEM;
        }
 
index f83c1d7241082c9351d2dba5d5a523c65b337476..72d1c646a2b64a132839d5df40486496face7802 100644 (file)
 #define   SDHCI_CDNS_HRS04_WDATA_SHIFT         8
 #define   SDHCI_CDNS_HRS04_ADDR_SHIFT          0
 
+#define SDHCI_CDNS_HRS06               0x18            /* eMMC control */
+#define   SDHCI_CDNS_HRS06_TUNE_UP             BIT(15)
+#define   SDHCI_CDNS_HRS06_TUNE_SHIFT          8
+#define   SDHCI_CDNS_HRS06_TUNE_MASK           0x3f
+#define   SDHCI_CDNS_HRS06_MODE_MASK           0x7
+#define   SDHCI_CDNS_HRS06_MODE_SD             0x0
+#define   SDHCI_CDNS_HRS06_MODE_MMC_SDR                0x2
+#define   SDHCI_CDNS_HRS06_MODE_MMC_DDR                0x3
+#define   SDHCI_CDNS_HRS06_MODE_MMC_HS200      0x4
+#define   SDHCI_CDNS_HRS06_MODE_MMC_HS400      0x5
+#define   SDHCI_CDNS_HRS06_MODE_MMC_HS400ES    0x6
+
 /* SRS - Slot Register Set (SDHCI-compatible) */
 #define SDHCI_CDNS_SRS_BASE            0x200
 
@@ -111,6 +123,44 @@ static int sdhci_cdns_phy_init(struct sdhci_cdns_plat *plat,
        return 0;
 }
 
+static void sdhci_cdns_set_control_reg(struct sdhci_host *host)
+{
+       struct mmc *mmc = host->mmc;
+       struct sdhci_cdns_plat *plat = dev_get_platdata(mmc->dev);
+       unsigned int clock = mmc->clock;
+       u32 mode, tmp;
+
+       /*
+        * REVISIT:
+        * The mode should be decided by MMC_TIMING_* like Linux, but
+        * U-Boot does not support timing.  Use the clock frequency instead.
+        */
+       if (clock <= 26000000)
+               mode = SDHCI_CDNS_HRS06_MODE_SD; /* use this for Legacy */
+       else if (clock <= 52000000) {
+               if (mmc->ddr_mode)
+                       mode = SDHCI_CDNS_HRS06_MODE_MMC_DDR;
+               else
+                       mode = SDHCI_CDNS_HRS06_MODE_MMC_SDR;
+       } else {
+               /*
+                * REVISIT:
+                * The IP supports HS200/HS400, revisit once U-Boot support it
+                */
+               printf("unsupported frequency %d\n", clock);
+               return;
+       }
+
+       tmp = readl(plat->hrs_addr + SDHCI_CDNS_HRS06);
+       tmp &= ~SDHCI_CDNS_HRS06_MODE_MASK;
+       tmp |= mode;
+       writel(tmp, plat->hrs_addr + SDHCI_CDNS_HRS06);
+}
+
+static const struct sdhci_ops sdhci_cdns_ops = {
+       .set_control_reg = sdhci_cdns_set_control_reg,
+};
+
 static int sdhci_cdns_bind(struct udevice *dev)
 {
        struct sdhci_cdns_plat *plat = dev_get_platdata(dev);
@@ -137,6 +187,7 @@ static int sdhci_cdns_probe(struct udevice *dev)
 
        host->name = dev->name;
        host->ioaddr = plat->hrs_addr + SDHCI_CDNS_SRS_BASE;
+       host->ops = &sdhci_cdns_ops;
        host->quirks |= SDHCI_QUIRK_WAIT_SEND_CMD;
 
        ret = sdhci_cdns_phy_init(plat, gd->fdt_blob, dev_of_offset(dev));
index d8b5888b7ce29860e029f9bf334c35fa7010e4f1..a98c1eba0f66eb1f54d6a234508b6f268be9ed7b 100644 (file)
@@ -43,7 +43,7 @@ static int sti_mmc_core_config(struct udevice *dev)
        if (plat->instance) {
                ret = reset_deassert(&plat->reset);
                if (ret < 0) {
-                       error("MMC1 deassert failed: %d", ret);
+                       pr_err("MMC1 deassert failed: %d", ret);
                        return ret;
                }
        }
diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c
new file mode 100644 (file)
index 0000000..0bf7135
--- /dev/null
@@ -0,0 +1,608 @@
+/*
+ * Copyright (C) STMicroelectronics SA 2017
+ * Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <clk.h>
+#include <dm.h>
+#include <fdtdec.h>
+#include <libfdt.h>
+#include <mmc.h>
+#include <reset.h>
+#include <asm/io.h>
+#include <asm/gpio.h>
+#include <linux/iopoll.h>
+
+struct stm32_sdmmc2_plat {
+       struct mmc_config cfg;
+       struct mmc mmc;
+};
+
+struct stm32_sdmmc2_priv {
+       fdt_addr_t base;
+       struct clk clk;
+       struct reset_ctl reset_ctl;
+       struct gpio_desc cd_gpio;
+       u32 clk_reg_msk;
+       u32 pwr_reg_msk;
+};
+
+struct stm32_sdmmc2_ctx {
+       u32 cache_start;
+       u32 cache_end;
+       u32 data_length;
+       bool dpsm_abort;
+};
+
+/* SDMMC REGISTERS OFFSET */
+#define SDMMC_POWER            0x00    /* SDMMC power control             */
+#define SDMMC_CLKCR            0x04    /* SDMMC clock control             */
+#define SDMMC_ARG              0x08    /* SDMMC argument                  */
+#define SDMMC_CMD              0x0C    /* SDMMC command                   */
+#define SDMMC_RESP1            0x14    /* SDMMC response 1                */
+#define SDMMC_RESP2            0x18    /* SDMMC response 2                */
+#define SDMMC_RESP3            0x1C    /* SDMMC response 3                */
+#define SDMMC_RESP4            0x20    /* SDMMC response 4                */
+#define SDMMC_DTIMER           0x24    /* SDMMC data timer                */
+#define SDMMC_DLEN             0x28    /* SDMMC data length               */
+#define SDMMC_DCTRL            0x2C    /* SDMMC data control              */
+#define SDMMC_DCOUNT           0x30    /* SDMMC data counter              */
+#define SDMMC_STA              0x34    /* SDMMC status                    */
+#define SDMMC_ICR              0x38    /* SDMMC interrupt clear           */
+#define SDMMC_MASK             0x3C    /* SDMMC mask                      */
+#define SDMMC_IDMACTRL         0x50    /* SDMMC DMA control               */
+#define SDMMC_IDMABASE0                0x58    /* SDMMC DMA buffer 0 base address */
+
+/* SDMMC_POWER register */
+#define SDMMC_POWER_PWRCTRL            GENMASK(1, 0)
+#define SDMMC_POWER_VSWITCH            BIT(2)
+#define SDMMC_POWER_VSWITCHEN          BIT(3)
+#define SDMMC_POWER_DIRPOL             BIT(4)
+
+/* SDMMC_CLKCR register */
+#define SDMMC_CLKCR_CLKDIV             GENMASK(9, 0)
+#define SDMMC_CLKCR_CLKDIV_MAX         SDMMC_CLKCR_CLKDIV
+#define SDMMC_CLKCR_PWRSAV             BIT(12)
+#define SDMMC_CLKCR_WIDBUS_4           BIT(14)
+#define SDMMC_CLKCR_WIDBUS_8           BIT(15)
+#define SDMMC_CLKCR_NEGEDGE            BIT(16)
+#define SDMMC_CLKCR_HWFC_EN            BIT(17)
+#define SDMMC_CLKCR_DDR                        BIT(18)
+#define SDMMC_CLKCR_BUSSPEED           BIT(19)
+#define SDMMC_CLKCR_SELCLKRX           GENMASK(21, 20)
+
+/* SDMMC_CMD register */
+#define SDMMC_CMD_CMDINDEX             GENMASK(5, 0)
+#define SDMMC_CMD_CMDTRANS             BIT(6)
+#define SDMMC_CMD_CMDSTOP              BIT(7)
+#define SDMMC_CMD_WAITRESP             GENMASK(9, 8)
+#define SDMMC_CMD_WAITRESP_0           BIT(8)
+#define SDMMC_CMD_WAITRESP_1           BIT(9)
+#define SDMMC_CMD_WAITINT              BIT(10)
+#define SDMMC_CMD_WAITPEND             BIT(11)
+#define SDMMC_CMD_CPSMEN               BIT(12)
+#define SDMMC_CMD_DTHOLD               BIT(13)
+#define SDMMC_CMD_BOOTMODE             BIT(14)
+#define SDMMC_CMD_BOOTEN               BIT(15)
+#define SDMMC_CMD_CMDSUSPEND           BIT(16)
+
+/* SDMMC_DCTRL register */
+#define SDMMC_DCTRL_DTEN               BIT(0)
+#define SDMMC_DCTRL_DTDIR              BIT(1)
+#define SDMMC_DCTRL_DTMODE             GENMASK(3, 2)
+#define SDMMC_DCTRL_DBLOCKSIZE         GENMASK(7, 4)
+#define SDMMC_DCTRL_DBLOCKSIZE_SHIFT   4
+#define SDMMC_DCTRL_RWSTART            BIT(8)
+#define SDMMC_DCTRL_RWSTOP             BIT(9)
+#define SDMMC_DCTRL_RWMOD              BIT(10)
+#define SDMMC_DCTRL_SDMMCEN            BIT(11)
+#define SDMMC_DCTRL_BOOTACKEN          BIT(12)
+#define SDMMC_DCTRL_FIFORST            BIT(13)
+
+/* SDMMC_STA register */
+#define SDMMC_STA_CCRCFAIL             BIT(0)
+#define SDMMC_STA_DCRCFAIL             BIT(1)
+#define SDMMC_STA_CTIMEOUT             BIT(2)
+#define SDMMC_STA_DTIMEOUT             BIT(3)
+#define SDMMC_STA_TXUNDERR             BIT(4)
+#define SDMMC_STA_RXOVERR              BIT(5)
+#define SDMMC_STA_CMDREND              BIT(6)
+#define SDMMC_STA_CMDSENT              BIT(7)
+#define SDMMC_STA_DATAEND              BIT(8)
+#define SDMMC_STA_DHOLD                        BIT(9)
+#define SDMMC_STA_DBCKEND              BIT(10)
+#define SDMMC_STA_DABORT               BIT(11)
+#define SDMMC_STA_DPSMACT              BIT(12)
+#define SDMMC_STA_CPSMACT              BIT(13)
+#define SDMMC_STA_TXFIFOHE             BIT(14)
+#define SDMMC_STA_RXFIFOHF             BIT(15)
+#define SDMMC_STA_TXFIFOF              BIT(16)
+#define SDMMC_STA_RXFIFOF              BIT(17)
+#define SDMMC_STA_TXFIFOE              BIT(18)
+#define SDMMC_STA_RXFIFOE              BIT(19)
+#define SDMMC_STA_BUSYD0               BIT(20)
+#define SDMMC_STA_BUSYD0END            BIT(21)
+#define SDMMC_STA_SDMMCIT              BIT(22)
+#define SDMMC_STA_ACKFAIL              BIT(23)
+#define SDMMC_STA_ACKTIMEOUT           BIT(24)
+#define SDMMC_STA_VSWEND               BIT(25)
+#define SDMMC_STA_CKSTOP               BIT(26)
+#define SDMMC_STA_IDMATE               BIT(27)
+#define SDMMC_STA_IDMABTC              BIT(28)
+
+/* SDMMC_ICR register */
+#define SDMMC_ICR_CCRCFAILC            BIT(0)
+#define SDMMC_ICR_DCRCFAILC            BIT(1)
+#define SDMMC_ICR_CTIMEOUTC            BIT(2)
+#define SDMMC_ICR_DTIMEOUTC            BIT(3)
+#define SDMMC_ICR_TXUNDERRC            BIT(4)
+#define SDMMC_ICR_RXOVERRC             BIT(5)
+#define SDMMC_ICR_CMDRENDC             BIT(6)
+#define SDMMC_ICR_CMDSENTC             BIT(7)
+#define SDMMC_ICR_DATAENDC             BIT(8)
+#define SDMMC_ICR_DHOLDC               BIT(9)
+#define SDMMC_ICR_DBCKENDC             BIT(10)
+#define SDMMC_ICR_DABORTC              BIT(11)
+#define SDMMC_ICR_BUSYD0ENDC           BIT(21)
+#define SDMMC_ICR_SDMMCITC             BIT(22)
+#define SDMMC_ICR_ACKFAILC             BIT(23)
+#define SDMMC_ICR_ACKTIMEOUTC          BIT(24)
+#define SDMMC_ICR_VSWENDC              BIT(25)
+#define SDMMC_ICR_CKSTOPC              BIT(26)
+#define SDMMC_ICR_IDMATEC              BIT(27)
+#define SDMMC_ICR_IDMABTCC             BIT(28)
+#define SDMMC_ICR_STATIC_FLAGS         ((GENMASK(28, 21)) | (GENMASK(11, 0)))
+
+/* SDMMC_MASK register */
+#define SDMMC_MASK_CCRCFAILIE          BIT(0)
+#define SDMMC_MASK_DCRCFAILIE          BIT(1)
+#define SDMMC_MASK_CTIMEOUTIE          BIT(2)
+#define SDMMC_MASK_DTIMEOUTIE          BIT(3)
+#define SDMMC_MASK_TXUNDERRIE          BIT(4)
+#define SDMMC_MASK_RXOVERRIE           BIT(5)
+#define SDMMC_MASK_CMDRENDIE           BIT(6)
+#define SDMMC_MASK_CMDSENTIE           BIT(7)
+#define SDMMC_MASK_DATAENDIE           BIT(8)
+#define SDMMC_MASK_DHOLDIE             BIT(9)
+#define SDMMC_MASK_DBCKENDIE           BIT(10)
+#define SDMMC_MASK_DABORTIE            BIT(11)
+#define SDMMC_MASK_TXFIFOHEIE          BIT(14)
+#define SDMMC_MASK_RXFIFOHFIE          BIT(15)
+#define SDMMC_MASK_RXFIFOFIE           BIT(17)
+#define SDMMC_MASK_TXFIFOEIE           BIT(18)
+#define SDMMC_MASK_BUSYD0ENDIE         BIT(21)
+#define SDMMC_MASK_SDMMCITIE           BIT(22)
+#define SDMMC_MASK_ACKFAILIE           BIT(23)
+#define SDMMC_MASK_ACKTIMEOUTIE                BIT(24)
+#define SDMMC_MASK_VSWENDIE            BIT(25)
+#define SDMMC_MASK_CKSTOPIE            BIT(26)
+#define SDMMC_MASK_IDMABTCIE           BIT(28)
+
+/* SDMMC_IDMACTRL register */
+#define SDMMC_IDMACTRL_IDMAEN          BIT(0)
+
+#define SDMMC_CMD_TIMEOUT              0xFFFFFFFF
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void stm32_sdmmc2_start_data(struct stm32_sdmmc2_priv *priv,
+                                   struct mmc_data *data,
+                                   struct stm32_sdmmc2_ctx *ctx)
+{
+       u32 data_ctrl, idmabase0;
+
+       /* Configure the SDMMC DPSM (Data Path State Machine) */
+       data_ctrl = (__ilog2(data->blocksize) <<
+                    SDMMC_DCTRL_DBLOCKSIZE_SHIFT) &
+                   SDMMC_DCTRL_DBLOCKSIZE;
+
+       if (data->flags & MMC_DATA_READ) {
+               data_ctrl |= SDMMC_DCTRL_DTDIR;
+               idmabase0 = (u32)data->dest;
+       } else {
+               idmabase0 = (u32)data->src;
+       }
+
+       /* Set the SDMMC Data TimeOut value */
+       writel(SDMMC_CMD_TIMEOUT, priv->base + SDMMC_DTIMER);
+
+       /* Set the SDMMC DataLength value */
+       writel(ctx->data_length, priv->base + SDMMC_DLEN);
+
+       /* Write to SDMMC DCTRL */
+       writel(data_ctrl, priv->base + SDMMC_DCTRL);
+
+       /* Cache align */
+       ctx->cache_start = rounddown(idmabase0, ARCH_DMA_MINALIGN);
+       ctx->cache_end = roundup(idmabase0 + ctx->data_length,
+                                ARCH_DMA_MINALIGN);
+
+       /*
+        * Flush data cache before DMA start (clean and invalidate)
+        * Clean also needed for read
+        * Avoid issue on buffer not cached-aligned
+        */
+       flush_dcache_range(ctx->cache_start, ctx->cache_end);
+
+       /* Enable internal DMA */
+       writel(idmabase0, priv->base + SDMMC_IDMABASE0);
+       writel(SDMMC_IDMACTRL_IDMAEN, priv->base + SDMMC_IDMACTRL);
+}
+
+static void stm32_sdmmc2_start_cmd(struct stm32_sdmmc2_priv *priv,
+                                  struct mmc_cmd *cmd, u32 cmd_param)
+{
+       if (readl(priv->base + SDMMC_ARG) & SDMMC_CMD_CPSMEN)
+               writel(0, priv->base + SDMMC_ARG);
+
+       cmd_param |= cmd->cmdidx | SDMMC_CMD_CPSMEN;
+       if (cmd->resp_type & MMC_RSP_PRESENT) {
+               if (cmd->resp_type & MMC_RSP_136)
+                       cmd_param |= SDMMC_CMD_WAITRESP;
+               else if (cmd->resp_type & MMC_RSP_CRC)
+                       cmd_param |= SDMMC_CMD_WAITRESP_0;
+               else
+                       cmd_param |= SDMMC_CMD_WAITRESP_1;
+       }
+
+       /* Clear flags */
+       writel(SDMMC_ICR_STATIC_FLAGS, priv->base + SDMMC_ICR);
+
+       /* Set SDMMC argument value */
+       writel(cmd->cmdarg, priv->base + SDMMC_ARG);
+
+       /* Set SDMMC command parameters */
+       writel(cmd_param, priv->base + SDMMC_CMD);
+}
+
+static int stm32_sdmmc2_end_cmd(struct stm32_sdmmc2_priv *priv,
+                               struct mmc_cmd *cmd,
+                               struct stm32_sdmmc2_ctx *ctx)
+{
+       u32 mask = SDMMC_STA_CTIMEOUT;
+       u32 status;
+       int ret;
+
+       if (cmd->resp_type & MMC_RSP_PRESENT) {
+               mask |= SDMMC_STA_CMDREND;
+               if (cmd->resp_type & MMC_RSP_CRC)
+                       mask |= SDMMC_STA_CCRCFAIL;
+       } else {
+               mask |= SDMMC_STA_CMDSENT;
+       }
+
+       /* Polling status register */
+       ret = readl_poll_timeout(priv->base + SDMMC_STA, status, status & mask,
+                                300);
+
+       if (ret < 0) {
+               debug("%s: timeout reading SDMMC_STA register\n", __func__);
+               ctx->dpsm_abort = true;
+               return ret;
+       }
+
+       /* Check status */
+       if (status & SDMMC_STA_CTIMEOUT) {
+               debug("%s: error SDMMC_STA_CTIMEOUT (0x%x) for cmd %d\n",
+                     __func__, status, cmd->cmdidx);
+               ctx->dpsm_abort = true;
+               return -ETIMEDOUT;
+       }
+
+       if (status & SDMMC_STA_CCRCFAIL && cmd->resp_type & MMC_RSP_CRC) {
+               debug("%s: error SDMMC_STA_CCRCFAIL (0x%x) for cmd %d\n",
+                     __func__, status, cmd->cmdidx);
+               ctx->dpsm_abort = true;
+               return -EILSEQ;
+       }
+
+       if (status & SDMMC_STA_CMDREND && cmd->resp_type & MMC_RSP_PRESENT) {
+               cmd->response[0] = readl(priv->base + SDMMC_RESP1);
+               if (cmd->resp_type & MMC_RSP_136) {
+                       cmd->response[1] = readl(priv->base + SDMMC_RESP2);
+                       cmd->response[2] = readl(priv->base + SDMMC_RESP3);
+                       cmd->response[3] = readl(priv->base + SDMMC_RESP4);
+               }
+       }
+
+       return 0;
+}
+
+static int stm32_sdmmc2_end_data(struct stm32_sdmmc2_priv *priv,
+                                struct mmc_cmd *cmd,
+                                struct mmc_data *data,
+                                struct stm32_sdmmc2_ctx *ctx)
+{
+       u32 mask = SDMMC_STA_DCRCFAIL | SDMMC_STA_DTIMEOUT |
+                  SDMMC_STA_IDMATE | SDMMC_STA_DATAEND;
+       u32 status;
+
+       if (data->flags & MMC_DATA_READ)
+               mask |= SDMMC_STA_RXOVERR;
+       else
+               mask |= SDMMC_STA_TXUNDERR;
+
+       status = readl(priv->base + SDMMC_STA);
+       while (!(status & mask))
+               status = readl(priv->base + SDMMC_STA);
+
+       /*
+        * Need invalidate the dcache again to avoid any
+        * cache-refill during the DMA operations (pre-fetching)
+        */
+       if (data->flags & MMC_DATA_READ)
+               invalidate_dcache_range(ctx->cache_start, ctx->cache_end);
+
+       if (status & SDMMC_STA_DCRCFAIL) {
+               debug("%s: error SDMMC_STA_DCRCFAIL (0x%x) for cmd %d\n",
+                     __func__, status, cmd->cmdidx);
+               if (readl(priv->base + SDMMC_DCOUNT))
+                       ctx->dpsm_abort = true;
+               return -EILSEQ;
+       }
+
+       if (status & SDMMC_STA_DTIMEOUT) {
+               debug("%s: error SDMMC_STA_DTIMEOUT (0x%x) for cmd %d\n",
+                     __func__, status, cmd->cmdidx);
+               ctx->dpsm_abort = true;
+               return -ETIMEDOUT;
+       }
+
+       if (status & SDMMC_STA_TXUNDERR) {
+               debug("%s: error SDMMC_STA_TXUNDERR (0x%x) for cmd %d\n",
+                     __func__, status, cmd->cmdidx);
+               ctx->dpsm_abort = true;
+               return -EIO;
+       }
+
+       if (status & SDMMC_STA_RXOVERR) {
+               debug("%s: error SDMMC_STA_RXOVERR (0x%x) for cmd %d\n",
+                     __func__, status, cmd->cmdidx);
+               ctx->dpsm_abort = true;
+               return -EIO;
+       }
+
+       if (status & SDMMC_STA_IDMATE) {
+               debug("%s: error SDMMC_STA_IDMATE (0x%x) for cmd %d\n",
+                     __func__, status, cmd->cmdidx);
+               ctx->dpsm_abort = true;
+               return -EIO;
+       }
+
+       return 0;
+}
+
+static int stm32_sdmmc2_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
+                                struct mmc_data *data)
+{
+       struct stm32_sdmmc2_priv *priv = dev_get_priv(dev);
+       struct stm32_sdmmc2_ctx ctx;
+       u32 cmdat = data ? SDMMC_CMD_CMDTRANS : 0;
+       int ret, retry = 3;
+
+retry_cmd:
+       ctx.data_length = 0;
+       ctx.dpsm_abort = false;
+
+       if (data) {
+               ctx.data_length = data->blocks * data->blocksize;
+               stm32_sdmmc2_start_data(priv, data, &ctx);
+       }
+
+       stm32_sdmmc2_start_cmd(priv, cmd, cmdat);
+
+       debug("%s: send cmd %d data: 0x%x @ 0x%x\n",
+             __func__, cmd->cmdidx,
+             data ? ctx.data_length : 0, (unsigned int)data);
+
+       ret = stm32_sdmmc2_end_cmd(priv, cmd, &ctx);
+
+       if (data && !ret)
+               ret = stm32_sdmmc2_end_data(priv, cmd, data, &ctx);
+
+       /* Clear flags */
+       writel(SDMMC_ICR_STATIC_FLAGS, priv->base + SDMMC_ICR);
+       if (data)
+               writel(0x0, priv->base + SDMMC_IDMACTRL);
+
+       /*
+        * To stop Data Path State Machine, a stop_transmission command
+        * shall be send on cmd or data errors.
+        */
+       if (ctx.dpsm_abort && (cmd->cmdidx != MMC_CMD_STOP_TRANSMISSION)) {
+               struct mmc_cmd stop_cmd;
+
+               stop_cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION;
+               stop_cmd.cmdarg = 0;
+               stop_cmd.resp_type = MMC_RSP_R1b;
+
+               debug("%s: send STOP command to abort dpsm treatments\n",
+                     __func__);
+
+               stm32_sdmmc2_start_cmd(priv, &stop_cmd, SDMMC_CMD_CMDSTOP);
+               stm32_sdmmc2_end_cmd(priv, &stop_cmd, &ctx);
+
+               writel(SDMMC_ICR_STATIC_FLAGS, priv->base + SDMMC_ICR);
+       }
+
+       if ((ret != -ETIMEDOUT) && (ret != 0) && retry) {
+               printf("%s: cmd %d failed, retrying ...\n",
+                      __func__, cmd->cmdidx);
+               retry--;
+               goto retry_cmd;
+       }
+
+       debug("%s: end for CMD %d, ret = %d\n", __func__, cmd->cmdidx, ret);
+
+       return ret;
+}
+
+static void stm32_sdmmc2_pwron(struct stm32_sdmmc2_priv *priv)
+{
+       /* Reset */
+       reset_assert(&priv->reset_ctl);
+       udelay(2);
+       reset_deassert(&priv->reset_ctl);
+
+       udelay(1000);
+
+       /* Set Power State to ON */
+       writel(SDMMC_POWER_PWRCTRL | priv->pwr_reg_msk, priv->base + SDMMC_POWER);
+
+       /*
+        * 1ms: required power up waiting time before starting the
+        * SD initialization sequence
+        */
+       udelay(1000);
+}
+
+#define IS_RISING_EDGE(reg) (reg & SDMMC_CLKCR_NEGEDGE ? 0 : 1)
+static int stm32_sdmmc2_set_ios(struct udevice *dev)
+{
+       struct mmc *mmc = mmc_get_mmc_dev(dev);
+       struct stm32_sdmmc2_priv *priv = dev_get_priv(dev);
+       struct stm32_sdmmc2_plat *plat = dev_get_platdata(dev);
+       struct mmc_config *cfg = &plat->cfg;
+       u32 desired = mmc->clock;
+       u32 sys_clock = clk_get_rate(&priv->clk);
+       u32 clk = 0;
+
+       debug("%s: bus_with = %d, clock = %d\n", __func__,
+             mmc->bus_width, mmc->clock);
+
+       if ((mmc->bus_width == 1) && (desired == cfg->f_min))
+               stm32_sdmmc2_pwron(priv);
+
+       /*
+        * clk_div = 0 => command and data generated on SDMMCCLK falling edge
+        * clk_div > 0 and NEGEDGE = 0 => command and data generated on
+        * SDMMCCLK rising edge
+        * clk_div > 0 and NEGEDGE = 1 => command and data generated on
+        * SDMMCCLK falling edge
+        */
+       if (desired && ((sys_clock > desired) ||
+                       IS_RISING_EDGE(priv->clk_reg_msk))) {
+               clk = DIV_ROUND_UP(sys_clock, 2 * desired);
+               if (clk > SDMMC_CLKCR_CLKDIV_MAX)
+                       clk = SDMMC_CLKCR_CLKDIV_MAX;
+       }
+
+       if (mmc->bus_width == 4)
+               clk |= SDMMC_CLKCR_WIDBUS_4;
+       if (mmc->bus_width == 8)
+               clk |= SDMMC_CLKCR_WIDBUS_8;
+
+       writel(clk | priv->clk_reg_msk, priv->base + SDMMC_CLKCR);
+
+       return 0;
+}
+
+static int stm32_sdmmc2_getcd(struct udevice *dev)
+{
+       struct stm32_sdmmc2_priv *priv = dev_get_priv(dev);
+
+       debug("stm32_sdmmc2_getcd called\n");
+
+       if (dm_gpio_is_valid(&priv->cd_gpio))
+               return dm_gpio_get_value(&priv->cd_gpio);
+
+       return 1;
+}
+
+static const struct dm_mmc_ops stm32_sdmmc2_ops = {
+       .send_cmd = stm32_sdmmc2_send_cmd,
+       .set_ios = stm32_sdmmc2_set_ios,
+       .get_cd = stm32_sdmmc2_getcd,
+};
+
+static int stm32_sdmmc2_probe(struct udevice *dev)
+{
+       struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
+       struct stm32_sdmmc2_plat *plat = dev_get_platdata(dev);
+       struct stm32_sdmmc2_priv *priv = dev_get_priv(dev);
+       struct mmc_config *cfg = &plat->cfg;
+       int ret;
+
+       priv->base = dev_read_addr(dev);
+       if (priv->base == FDT_ADDR_T_NONE)
+               return -EINVAL;
+
+       if (dev_read_bool(dev, "st,negedge"))
+               priv->clk_reg_msk |= SDMMC_CLKCR_NEGEDGE;
+       if (dev_read_bool(dev, "st,dirpol"))
+               priv->pwr_reg_msk |= SDMMC_POWER_DIRPOL;
+
+       ret = clk_get_by_index(dev, 0, &priv->clk);
+       if (ret)
+               return ret;
+
+       ret = clk_enable(&priv->clk);
+       if (ret)
+               goto clk_free;
+
+       ret = reset_get_by_index(dev, 0, &priv->reset_ctl);
+       if (ret)
+               goto clk_disable;
+
+       gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio,
+                            GPIOD_IS_IN);
+
+       cfg->f_min = 400000;
+       cfg->f_max = dev_read_u32_default(dev, "max-frequency", 52000000);
+       cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
+       cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
+       cfg->name = "STM32 SDMMC2";
+
+       cfg->host_caps = 0;
+       if (cfg->f_max > 25000000)
+               cfg->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
+
+       switch (dev_read_u32_default(dev, "bus-width", 1)) {
+       case 8:
+               cfg->host_caps |= MMC_MODE_8BIT;
+       case 4:
+               cfg->host_caps |= MMC_MODE_4BIT;
+               break;
+       case 1:
+               break;
+       default:
+               pr_err("invalid \"bus-width\" property, force to 1\n");
+       }
+
+       upriv->mmc = &plat->mmc;
+
+       return 0;
+
+clk_disable:
+       clk_disable(&priv->clk);
+clk_free:
+       clk_free(&priv->clk);
+
+       return ret;
+}
+
+int stm32_sdmmc_bind(struct udevice *dev)
+{
+       struct stm32_sdmmc2_plat *plat = dev_get_platdata(dev);
+
+       return mmc_bind(dev, &plat->mmc, &plat->cfg);
+}
+
+static const struct udevice_id stm32_sdmmc2_ids[] = {
+       { .compatible = "st,stm32-sdmmc2" },
+       { }
+};
+
+U_BOOT_DRIVER(stm32_sdmmc2) = {
+       .name = "stm32_sdmmc2",
+       .id = UCLASS_MMC,
+       .of_match = stm32_sdmmc2_ids,
+       .ops = &stm32_sdmmc2_ops,
+       .probe = stm32_sdmmc2_probe,
+       .bind = stm32_sdmmc_bind,
+       .priv_auto_alloc_size = sizeof(struct stm32_sdmmc2_priv),
+       .platdata_auto_alloc_size = sizeof(struct stm32_sdmmc2_plat),
+};
index 721b75fddace1ba5254fe6c22d196378d7ffb998..0d1203cb766ff0c045fc8e4857afe3e4ba60daf7 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/dma-direction.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
+#include <power/regulator.h>
 #include <asm/unaligned.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -132,8 +133,43 @@ struct uniphier_sd_priv {
 #define UNIPHIER_SD_CAP_NONREMOVABLE   BIT(0)  /* Nonremovable e.g. eMMC */
 #define UNIPHIER_SD_CAP_DMA_INTERNAL   BIT(1)  /* have internal DMA engine */
 #define UNIPHIER_SD_CAP_DIV1024                BIT(2)  /* divisor 1024 is available */
+#define UNIPHIER_SD_CAP_64BIT          BIT(3)  /* Controller is 64bit */
 };
 
+static u64 uniphier_sd_readq(struct uniphier_sd_priv *priv, unsigned int reg)
+{
+       if (priv->caps & UNIPHIER_SD_CAP_64BIT)
+               return readq(priv->regbase + (reg << 1));
+       else
+               return readq(priv->regbase + reg);
+}
+
+static void uniphier_sd_writeq(struct uniphier_sd_priv *priv,
+                              u64 val, unsigned int reg)
+{
+       if (priv->caps & UNIPHIER_SD_CAP_64BIT)
+               writeq(val, priv->regbase + (reg << 1));
+       else
+               writeq(val, priv->regbase + reg);
+}
+
+static u32 uniphier_sd_readl(struct uniphier_sd_priv *priv, unsigned int reg)
+{
+       if (priv->caps & UNIPHIER_SD_CAP_64BIT)
+               return readl(priv->regbase + (reg << 1));
+       else
+               return readl(priv->regbase + reg);
+}
+
+static void uniphier_sd_writel(struct uniphier_sd_priv *priv,
+                              u32 val, unsigned int reg)
+{
+       if (priv->caps & UNIPHIER_SD_CAP_64BIT)
+               writel(val, priv->regbase + (reg << 1));
+       else
+               writel(val, priv->regbase + reg);
+}
+
 static dma_addr_t __dma_map_single(void *ptr, size_t size,
                                   enum dma_data_direction dir)
 {
@@ -157,7 +193,7 @@ static void __dma_unmap_single(dma_addr_t addr, size_t size,
 static int uniphier_sd_check_error(struct udevice *dev)
 {
        struct uniphier_sd_priv *priv = dev_get_priv(dev);
-       u32 info2 = readl(priv->regbase + UNIPHIER_SD_INFO2);
+       u32 info2 = uniphier_sd_readl(priv, UNIPHIER_SD_INFO2);
 
        if (info2 & UNIPHIER_SD_INFO2_ERR_RTO) {
                /*
@@ -195,7 +231,7 @@ static int uniphier_sd_wait_for_irq(struct udevice *dev, unsigned int reg,
        long wait = 1000000;
        int ret;
 
-       while (!(readl(priv->regbase + reg) & flag)) {
+       while (!(uniphier_sd_readl(priv, reg) & flag)) {
                if (wait-- < 0) {
                        dev_err(dev, "timeout\n");
                        return -ETIMEDOUT;
@@ -211,7 +247,7 @@ static int uniphier_sd_wait_for_irq(struct udevice *dev, unsigned int reg,
        return 0;
 }
 
-static int uniphier_sd_pio_read_one_block(struct udevice *dev, u32 **pbuf,
+static int uniphier_sd_pio_read_one_block(struct udevice *dev, char *pbuf,
                                          uint blocksize)
 {
        struct uniphier_sd_priv *priv = dev_get_priv(dev);
@@ -227,22 +263,44 @@ static int uniphier_sd_pio_read_one_block(struct udevice *dev, u32 **pbuf,
         * Clear the status flag _before_ read the buffer out because
         * UNIPHIER_SD_INFO2_BRE is edge-triggered, not level-triggered.
         */
-       writel(0, priv->regbase + UNIPHIER_SD_INFO2);
-
-       if (likely(IS_ALIGNED((unsigned long)*pbuf, 4))) {
-               for (i = 0; i < blocksize / 4; i++)
-                       *(*pbuf)++ = readl(priv->regbase + UNIPHIER_SD_BUF);
+       uniphier_sd_writel(priv, 0, UNIPHIER_SD_INFO2);
+
+       if (priv->caps & UNIPHIER_SD_CAP_64BIT) {
+               u64 *buf = (u64 *)pbuf;
+               if (likely(IS_ALIGNED((uintptr_t)buf, 8))) {
+                       for (i = 0; i < blocksize / 8; i++) {
+                               *buf++ = uniphier_sd_readq(priv,
+                                                          UNIPHIER_SD_BUF);
+                       }
+               } else {
+                       for (i = 0; i < blocksize / 8; i++) {
+                               u64 data;
+                               data = uniphier_sd_readq(priv,
+                                                        UNIPHIER_SD_BUF);
+                               put_unaligned(data, buf++);
+                       }
+               }
        } else {
-               for (i = 0; i < blocksize / 4; i++)
-                       put_unaligned(readl(priv->regbase + UNIPHIER_SD_BUF),
-                                     (*pbuf)++);
+               u32 *buf = (u32 *)pbuf;
+               if (likely(IS_ALIGNED((uintptr_t)buf, 4))) {
+                       for (i = 0; i < blocksize / 4; i++) {
+                               *buf++ = uniphier_sd_readl(priv,
+                                                          UNIPHIER_SD_BUF);
+                       }
+               } else {
+                       for (i = 0; i < blocksize / 4; i++) {
+                               u32 data;
+                               data = uniphier_sd_readl(priv, UNIPHIER_SD_BUF);
+                               put_unaligned(data, buf++);
+                       }
+               }
        }
 
        return 0;
 }
 
 static int uniphier_sd_pio_write_one_block(struct udevice *dev,
-                                          const u32 **pbuf, uint blocksize)
+                                          const char *pbuf, uint blocksize)
 {
        struct uniphier_sd_priv *priv = dev_get_priv(dev);
        int i, ret;
@@ -253,15 +311,36 @@ static int uniphier_sd_pio_write_one_block(struct udevice *dev,
        if (ret)
                return ret;
 
-       writel(0, priv->regbase + UNIPHIER_SD_INFO2);
-
-       if (likely(IS_ALIGNED((unsigned long)*pbuf, 4))) {
-               for (i = 0; i < blocksize / 4; i++)
-                       writel(*(*pbuf)++, priv->regbase + UNIPHIER_SD_BUF);
+       uniphier_sd_writel(priv, 0, UNIPHIER_SD_INFO2);
+
+       if (priv->caps & UNIPHIER_SD_CAP_64BIT) {
+               const u64 *buf = (const u64 *)pbuf;
+               if (likely(IS_ALIGNED((uintptr_t)buf, 8))) {
+                       for (i = 0; i < blocksize / 8; i++) {
+                               uniphier_sd_writeq(priv, *buf++,
+                                                  UNIPHIER_SD_BUF);
+                       }
+               } else {
+                       for (i = 0; i < blocksize / 8; i++) {
+                               u64 data = get_unaligned(buf++);
+                               uniphier_sd_writeq(priv, data,
+                                                  UNIPHIER_SD_BUF);
+                       }
+               }
        } else {
-               for (i = 0; i < blocksize / 4; i++)
-                       writel(get_unaligned((*pbuf)++),
-                              priv->regbase + UNIPHIER_SD_BUF);
+               const u32 *buf = (const u32 *)pbuf;
+               if (likely(IS_ALIGNED((uintptr_t)buf, 4))) {
+                       for (i = 0; i < blocksize / 4; i++) {
+                               uniphier_sd_writel(priv, *buf++,
+                                                  UNIPHIER_SD_BUF);
+                       }
+               } else {
+                       for (i = 0; i < blocksize / 4; i++) {
+                               u32 data = get_unaligned(buf++);
+                               uniphier_sd_writel(priv, data,
+                                                  UNIPHIER_SD_BUF);
+                       }
+               }
        }
 
        return 0;
@@ -269,19 +348,24 @@ static int uniphier_sd_pio_write_one_block(struct udevice *dev,
 
 static int uniphier_sd_pio_xfer(struct udevice *dev, struct mmc_data *data)
 {
-       u32 *dest = (u32 *)data->dest;
-       const u32 *src = (const u32 *)data->src;
+       const char *src = data->src;
+       char *dest = data->dest;
        int i, ret;
 
        for (i = 0; i < data->blocks; i++) {
                if (data->flags & MMC_DATA_READ)
-                       ret = uniphier_sd_pio_read_one_block(dev, &dest,
+                       ret = uniphier_sd_pio_read_one_block(dev, dest,
                                                             data->blocksize);
                else
-                       ret = uniphier_sd_pio_write_one_block(dev, &src,
+                       ret = uniphier_sd_pio_write_one_block(dev, src,
                                                              data->blocksize);
                if (ret)
                        return ret;
+
+               if (data->flags & MMC_DATA_READ)
+                       dest += data->blocksize;
+               else
+                       src += data->blocksize;
        }
 
        return 0;
@@ -292,22 +376,22 @@ static void uniphier_sd_dma_start(struct uniphier_sd_priv *priv,
 {
        u32 tmp;
 
-       writel(0, priv->regbase + UNIPHIER_SD_DMA_INFO1);
-       writel(0, priv->regbase + UNIPHIER_SD_DMA_INFO2);
+       uniphier_sd_writel(priv, 0, UNIPHIER_SD_DMA_INFO1);
+       uniphier_sd_writel(priv, 0, UNIPHIER_SD_DMA_INFO2);
 
        /* enable DMA */
-       tmp = readl(priv->regbase + UNIPHIER_SD_EXTMODE);
+       tmp = uniphier_sd_readl(priv, UNIPHIER_SD_EXTMODE);
        tmp |= UNIPHIER_SD_EXTMODE_DMA_EN;
-       writel(tmp, priv->regbase + UNIPHIER_SD_EXTMODE);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_EXTMODE);
 
-       writel(dma_addr & U32_MAX, priv->regbase + UNIPHIER_SD_DMA_ADDR_L);
+       uniphier_sd_writel(priv, dma_addr & U32_MAX, UNIPHIER_SD_DMA_ADDR_L);
 
        /* suppress the warning "right shift count >= width of type" */
        dma_addr >>= min_t(int, 32, 8 * sizeof(dma_addr));
 
-       writel(dma_addr & U32_MAX, priv->regbase + UNIPHIER_SD_DMA_ADDR_H);
+       uniphier_sd_writel(priv, dma_addr & U32_MAX, UNIPHIER_SD_DMA_ADDR_H);
 
-       writel(UNIPHIER_SD_DMA_CTL_START, priv->regbase + UNIPHIER_SD_DMA_CTL);
+       uniphier_sd_writel(priv, UNIPHIER_SD_DMA_CTL_START, UNIPHIER_SD_DMA_CTL);
 }
 
 static int uniphier_sd_dma_wait_for_irq(struct udevice *dev, u32 flag,
@@ -316,7 +400,7 @@ static int uniphier_sd_dma_wait_for_irq(struct udevice *dev, u32 flag,
        struct uniphier_sd_priv *priv = dev_get_priv(dev);
        long wait = 1000000 + 10 * blocks;
 
-       while (!(readl(priv->regbase + UNIPHIER_SD_DMA_INFO1) & flag)) {
+       while (!(uniphier_sd_readl(priv, UNIPHIER_SD_DMA_INFO1) & flag)) {
                if (wait-- < 0) {
                        dev_err(dev, "timeout during DMA\n");
                        return -ETIMEDOUT;
@@ -325,7 +409,7 @@ static int uniphier_sd_dma_wait_for_irq(struct udevice *dev, u32 flag,
                udelay(10);
        }
 
-       if (readl(priv->regbase + UNIPHIER_SD_DMA_INFO2)) {
+       if (uniphier_sd_readl(priv, UNIPHIER_SD_DMA_INFO2)) {
                dev_err(dev, "error during DMA\n");
                return -EIO;
        }
@@ -343,7 +427,7 @@ static int uniphier_sd_dma_xfer(struct udevice *dev, struct mmc_data *data)
        u32 poll_flag, tmp;
        int ret;
 
-       tmp = readl(priv->regbase + UNIPHIER_SD_DMA_MODE);
+       tmp = uniphier_sd_readl(priv, UNIPHIER_SD_DMA_MODE);
 
        if (data->flags & MMC_DATA_READ) {
                buf = data->dest;
@@ -357,7 +441,7 @@ static int uniphier_sd_dma_xfer(struct udevice *dev, struct mmc_data *data)
                tmp &= ~UNIPHIER_SD_DMA_MODE_DIR_RD;
        }
 
-       writel(tmp, priv->regbase + UNIPHIER_SD_DMA_MODE);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_DMA_MODE);
 
        dma_addr = __dma_map_single(buf, len, dir);
 
@@ -396,27 +480,27 @@ static int uniphier_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
        int ret;
        u32 tmp;
 
-       if (readl(priv->regbase + UNIPHIER_SD_INFO2) & UNIPHIER_SD_INFO2_CBSY) {
+       if (uniphier_sd_readl(priv, UNIPHIER_SD_INFO2) & UNIPHIER_SD_INFO2_CBSY) {
                dev_err(dev, "command busy\n");
                return -EBUSY;
        }
 
        /* clear all status flags */
-       writel(0, priv->regbase + UNIPHIER_SD_INFO1);
-       writel(0, priv->regbase + UNIPHIER_SD_INFO2);
+       uniphier_sd_writel(priv, 0, UNIPHIER_SD_INFO1);
+       uniphier_sd_writel(priv, 0, UNIPHIER_SD_INFO2);
 
        /* disable DMA once */
-       tmp = readl(priv->regbase + UNIPHIER_SD_EXTMODE);
+       tmp = uniphier_sd_readl(priv, UNIPHIER_SD_EXTMODE);
        tmp &= ~UNIPHIER_SD_EXTMODE_DMA_EN;
-       writel(tmp, priv->regbase + UNIPHIER_SD_EXTMODE);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_EXTMODE);
 
-       writel(cmd->cmdarg, priv->regbase + UNIPHIER_SD_ARG);
+       uniphier_sd_writel(priv, cmd->cmdarg, UNIPHIER_SD_ARG);
 
        tmp = cmd->cmdidx;
 
        if (data) {
-               writel(data->blocksize, priv->regbase + UNIPHIER_SD_SIZE);
-               writel(data->blocks, priv->regbase + UNIPHIER_SD_SECCNT);
+               uniphier_sd_writel(priv, data->blocksize, UNIPHIER_SD_SIZE);
+               uniphier_sd_writel(priv, data->blocks, UNIPHIER_SD_SECCNT);
 
                /* Do not send CMD12 automatically */
                tmp |= UNIPHIER_SD_CMD_NOSTOP | UNIPHIER_SD_CMD_DATA;
@@ -457,7 +541,7 @@ static int uniphier_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 
        dev_dbg(dev, "sending CMD%d (SD_CMD=%08x, SD_ARG=%08x)\n",
                cmd->cmdidx, tmp, cmd->cmdarg);
-       writel(tmp, priv->regbase + UNIPHIER_SD_CMD);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_CMD);
 
        ret = uniphier_sd_wait_for_irq(dev, UNIPHIER_SD_INFO1,
                                       UNIPHIER_SD_INFO1_RSP);
@@ -465,10 +549,10 @@ static int uniphier_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
                return ret;
 
        if (cmd->resp_type & MMC_RSP_136) {
-               u32 rsp_127_104 = readl(priv->regbase + UNIPHIER_SD_RSP76);
-               u32 rsp_103_72 = readl(priv->regbase + UNIPHIER_SD_RSP54);
-               u32 rsp_71_40 = readl(priv->regbase + UNIPHIER_SD_RSP32);
-               u32 rsp_39_8 = readl(priv->regbase + UNIPHIER_SD_RSP10);
+               u32 rsp_127_104 = uniphier_sd_readl(priv, UNIPHIER_SD_RSP76);
+               u32 rsp_103_72 = uniphier_sd_readl(priv, UNIPHIER_SD_RSP54);
+               u32 rsp_71_40 = uniphier_sd_readl(priv, UNIPHIER_SD_RSP32);
+               u32 rsp_39_8 = uniphier_sd_readl(priv, UNIPHIER_SD_RSP10);
 
                cmd->response[0] = ((rsp_127_104 & 0x00ffffff) << 8) |
                                   ((rsp_103_72  & 0xff000000) >> 24);
@@ -479,7 +563,7 @@ static int uniphier_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
                cmd->response[3] = (rsp_39_8     & 0xffffff)   << 8;
        } else {
                /* bit 39-8 */
-               cmd->response[0] = readl(priv->regbase + UNIPHIER_SD_RSP10);
+               cmd->response[0] = uniphier_sd_readl(priv, UNIPHIER_SD_RSP10);
        }
 
        if (data) {
@@ -518,10 +602,10 @@ static int uniphier_sd_set_bus_width(struct uniphier_sd_priv *priv,
                return -EINVAL;
        }
 
-       tmp = readl(priv->regbase + UNIPHIER_SD_OPTION);
+       tmp = uniphier_sd_readl(priv, UNIPHIER_SD_OPTION);
        tmp &= ~UNIPHIER_SD_OPTION_WIDTH_MASK;
        tmp |= val;
-       writel(tmp, priv->regbase + UNIPHIER_SD_OPTION);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_OPTION);
 
        return 0;
 }
@@ -531,12 +615,12 @@ static void uniphier_sd_set_ddr_mode(struct uniphier_sd_priv *priv,
 {
        u32 tmp;
 
-       tmp = readl(priv->regbase + UNIPHIER_SD_IF_MODE);
+       tmp = uniphier_sd_readl(priv, UNIPHIER_SD_IF_MODE);
        if (mmc->ddr_mode)
                tmp |= UNIPHIER_SD_IF_MODE_DDR;
        else
                tmp &= ~UNIPHIER_SD_IF_MODE_DDR;
-       writel(tmp, priv->regbase + UNIPHIER_SD_IF_MODE);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_IF_MODE);
 }
 
 static void uniphier_sd_set_clk_rate(struct uniphier_sd_priv *priv,
@@ -573,21 +657,21 @@ static void uniphier_sd_set_clk_rate(struct uniphier_sd_priv *priv,
        else
                val = UNIPHIER_SD_CLKCTL_DIV1024;
 
-       tmp = readl(priv->regbase + UNIPHIER_SD_CLKCTL);
+       tmp = uniphier_sd_readl(priv, UNIPHIER_SD_CLKCTL);
        if (tmp & UNIPHIER_SD_CLKCTL_SCLKEN &&
            (tmp & UNIPHIER_SD_CLKCTL_DIV_MASK) == val)
                return;
 
        /* stop the clock before changing its rate to avoid a glitch signal */
        tmp &= ~UNIPHIER_SD_CLKCTL_SCLKEN;
-       writel(tmp, priv->regbase + UNIPHIER_SD_CLKCTL);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_CLKCTL);
 
        tmp &= ~UNIPHIER_SD_CLKCTL_DIV_MASK;
        tmp |= val | UNIPHIER_SD_CLKCTL_OFFEN;
-       writel(tmp, priv->regbase + UNIPHIER_SD_CLKCTL);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_CLKCTL);
 
        tmp |= UNIPHIER_SD_CLKCTL_SCLKEN;
-       writel(tmp, priv->regbase + UNIPHIER_SD_CLKCTL);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_CLKCTL);
 
        udelay(1000);
 }
@@ -617,7 +701,7 @@ static int uniphier_sd_get_cd(struct udevice *dev)
        if (priv->caps & UNIPHIER_SD_CAP_NONREMOVABLE)
                return 1;
 
-       return !!(readl(priv->regbase + UNIPHIER_SD_INFO1) &
+       return !!(uniphier_sd_readl(priv, UNIPHIER_SD_INFO1) &
                  UNIPHIER_SD_INFO1_CD);
 }
 
@@ -632,28 +716,28 @@ static void uniphier_sd_host_init(struct uniphier_sd_priv *priv)
        u32 tmp;
 
        /* soft reset of the host */
-       tmp = readl(priv->regbase + UNIPHIER_SD_SOFT_RST);
+       tmp = uniphier_sd_readl(priv, UNIPHIER_SD_SOFT_RST);
        tmp &= ~UNIPHIER_SD_SOFT_RST_RSTX;
-       writel(tmp, priv->regbase + UNIPHIER_SD_SOFT_RST);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_SOFT_RST);
        tmp |= UNIPHIER_SD_SOFT_RST_RSTX;
-       writel(tmp, priv->regbase + UNIPHIER_SD_SOFT_RST);
+       uniphier_sd_writel(priv, tmp, UNIPHIER_SD_SOFT_RST);
 
        /* FIXME: implement eMMC hw_reset */
 
-       writel(UNIPHIER_SD_STOP_SEC, priv->regbase + UNIPHIER_SD_STOP);
+       uniphier_sd_writel(priv, UNIPHIER_SD_STOP_SEC, UNIPHIER_SD_STOP);
 
        /*
         * Connected to 32bit AXI.
         * This register dropped backward compatibility at version 0x10.
         * Write an appropriate value depending on the IP version.
         */
-       writel(priv->version >= 0x10 ? 0x00000101 : 0x00000000,
-              priv->regbase + UNIPHIER_SD_HOST_MODE);
+       uniphier_sd_writel(priv, priv->version >= 0x10 ? 0x00000101 : 0x00000000,
+                          UNIPHIER_SD_HOST_MODE);
 
        if (priv->caps & UNIPHIER_SD_CAP_DMA_INTERNAL) {
-               tmp = readl(priv->regbase + UNIPHIER_SD_DMA_MODE);
+               tmp = uniphier_sd_readl(priv, UNIPHIER_SD_DMA_MODE);
                tmp |= UNIPHIER_SD_DMA_MODE_ADDR_INC;
-               writel(tmp, priv->regbase + UNIPHIER_SD_DMA_MODE);
+               uniphier_sd_writel(priv, tmp, UNIPHIER_SD_DMA_MODE);
        }
 }
 
@@ -669,9 +753,13 @@ static int uniphier_sd_probe(struct udevice *dev)
        struct uniphier_sd_plat *plat = dev_get_platdata(dev);
        struct uniphier_sd_priv *priv = dev_get_priv(dev);
        struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
+       const u32 quirks = dev_get_driver_data(dev);
        fdt_addr_t base;
        struct clk clk;
        int ret;
+#ifdef CONFIG_DM_REGULATOR
+       struct udevice *vqmmc_dev;
+#endif
 
        base = devfdt_get_addr(dev);
        if (base == FDT_ADDR_T_NONE)
@@ -681,6 +769,15 @@ static int uniphier_sd_probe(struct udevice *dev)
        if (!priv->regbase)
                return -ENOMEM;
 
+#ifdef CONFIG_DM_REGULATOR
+       ret = device_get_supply_regulator(dev, "vqmmc-supply", &vqmmc_dev);
+       if (!ret) {
+               /* Set the regulator to 3.3V until we support 1.8V modes */
+               regulator_set_value(vqmmc_dev, 3300000);
+               regulator_set_enable(vqmmc_dev, true);
+       }
+#endif
+
        ret = clk_get_by_index(dev, 0, &clk);
        if (ret < 0) {
                dev_err(dev, "failed to get host clock\n");
@@ -720,18 +817,22 @@ static int uniphier_sd_probe(struct udevice *dev)
                return -EINVAL;
        }
 
+       if (quirks) {
+               priv->caps = quirks;
+       } else {
+               priv->version = uniphier_sd_readl(priv, UNIPHIER_SD_VERSION) &
+                                                       UNIPHIER_SD_VERSION_IP;
+               dev_dbg(dev, "version %x\n", priv->version);
+               if (priv->version >= 0x10) {
+                       priv->caps |= UNIPHIER_SD_CAP_DMA_INTERNAL;
+                       priv->caps |= UNIPHIER_SD_CAP_DIV1024;
+               }
+       }
+
        if (fdt_get_property(gd->fdt_blob, dev_of_offset(dev), "non-removable",
                             NULL))
                priv->caps |= UNIPHIER_SD_CAP_NONREMOVABLE;
 
-       priv->version = readl(priv->regbase + UNIPHIER_SD_VERSION) &
-                                                       UNIPHIER_SD_VERSION_IP;
-       dev_dbg(dev, "version %x\n", priv->version);
-       if (priv->version >= 0x10) {
-               priv->caps |= UNIPHIER_SD_CAP_DMA_INTERNAL;
-               priv->caps |= UNIPHIER_SD_CAP_DIV1024;
-       }
-
        uniphier_sd_host_init(priv);
 
        plat->cfg.voltages = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34;
@@ -746,7 +847,9 @@ static int uniphier_sd_probe(struct udevice *dev)
 }
 
 static const struct udevice_id uniphier_sd_match[] = {
-       { .compatible = "socionext,uniphier-sdhc" },
+       { .compatible = "renesas,sdhi-r8a7795", .data = UNIPHIER_SD_CAP_64BIT },
+       { .compatible = "renesas,sdhi-r8a7796", .data = UNIPHIER_SD_CAP_64BIT },
+       { .compatible = "socionext,uniphier-sdhc", .data = 0 },
        { /* sentinel */ }
 };
 
index 2b7cb7f6b66ab0fe4df9226ddc1fc80d53da0c8b..490a01f9bdb80ce3f6475c3c15adf4a5e97b8a75 100644 (file)
@@ -159,7 +159,7 @@ static int xenon_mmc_phy_init(struct sdhci_host *host)
        }
 
        if (time <= 0) {
-               error("Failed to enable MMC internal clock in time\n");
+               pr_err("Failed to enable MMC internal clock in time\n");
                return -ETIMEDOUT;
        }
 
@@ -187,7 +187,7 @@ static int xenon_mmc_phy_init(struct sdhci_host *host)
        }
 
        if (time <= 0) {
-               error("Failed to init MMC PHY in time\n");
+               pr_err("Failed to init MMC PHY in time\n");
                return -ETIMEDOUT;
        }
 
index f3bb72788a9c34cac16cbf21393fe2870ddeeabe..8a5babea7b3593efc64717cdbf40a8f3be816e08 100644 (file)
@@ -111,11 +111,9 @@ static void cfi_flash_init_dm(void)
        }
 }
 
-static phys_addr_t cfi_flash_base[CFI_MAX_FLASH_BANKS];
-
 phys_addr_t cfi_flash_bank_addr(int i)
 {
-       return cfi_flash_base[i];
+       return flash_info[i].base;
 }
 #else
 __weak phys_addr_t cfi_flash_bank_addr(int i)
@@ -546,7 +544,16 @@ static int flash_is_busy (flash_info_t * info, flash_sect_t sect)
 #ifdef CONFIG_FLASH_CFI_LEGACY
        case CFI_CMDSET_AMD_LEGACY:
 #endif
-               retval = flash_toggle (info, sect, 0, AMD_STATUS_TOGGLE);
+               if (info->sr_supported) {
+                       flash_write_cmd (info, sect, info->addr_unlock1,
+                                        FLASH_CMD_READ_STATUS);
+                       retval = !flash_isset (info, sect, 0,
+                                              FLASH_STATUS_DONE);
+               } else {
+                       retval = flash_toggle (info, sect, 0,
+                                              AMD_STATUS_TOGGLE);
+               }
+
                break;
        default:
                retval = 0;
@@ -1687,6 +1694,7 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
 {
        ushort bankId = 0;
        uchar  manuId;
+       uchar  lsbits;
 
        flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
        flash_unlock_seq(info, 0);
@@ -1702,6 +1710,9 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
        }
        info->manufacturer_id = manuId;
 
+       lsbits = flash_read_uchar(info, FLASH_OFFSET_LOWER_SW_BITS);
+       info->sr_supported = lsbits & BIT(0);
+
        switch (info->chipwidth){
        case FLASH_CFI_8BIT:
                info->device_id = flash_read_uchar (info,
@@ -2458,10 +2469,12 @@ static int cfi_flash_probe(struct udevice *dev)
        while (idx < len) {
                addr = fdt_translate_address((void *)blob,
                                             node, cell + idx);
-               cfi_flash_base[cfi_flash_num_flash_banks++] = addr;
+               flash_info[cfi_flash_num_flash_banks].dev = dev;
+               flash_info[cfi_flash_num_flash_banks].base = addr;
+               cfi_flash_num_flash_banks++;
                idx += addrc + sizec;
        }
-       gd->bd->bi_flashstart = cfi_flash_base[0];
+       gd->bd->bi_flashstart = flash_info[0].base;
 
        return 0;
 }
index 3af7e6dfac69e0d67ed04685386fe95ca5cffbcc..e1b36706cab3c2a673b7c0a3e11ca2b3cfb51cc2 100644 (file)
@@ -583,21 +583,21 @@ void board_nand_init(void)
        /* identify chip */
        ret = nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_CHIPS, NULL);
        if (ret) {
-               error("nand_scan_ident returned %i", ret);
+               pr_err("nand_scan_ident returned %i", ret);
                return;
        }
 
        /* finish scanning the chip */
        ret = nand_scan_tail(mtd);
        if (ret) {
-               error("nand_scan_tail returned %i", ret);
+               pr_err("nand_scan_tail returned %i", ret);
                return;
        }
 
        /* chip is good, register it */
        ret = nand_register(0, mtd);
        if (ret)
-               error("nand_register returned %i", ret);
+               pr_err("nand_register returned %i", ret);
 }
 
 #else /* defined(CONFIG_SPL_BUILD) */
index 0042a7ba11df12a82c18a372d7c495deaf169b8a..6ab3c8a25add16857e225440f42ee381395046e4 100644 (file)
@@ -1559,7 +1559,7 @@ static int pxa3xx_nand_probe_dt(struct pxa3xx_nand_info *info)
 
                pdata->num_cs = fdtdec_get_int(blob, node, "num-cs", 1);
                if (pdata->num_cs != 1) {
-                       error("pxa3xx driver supports single CS only\n");
+                       pr_err("pxa3xx driver supports single CS only\n");
                        break;
                }
 
index b2ab43920ab04573a7e705eed89917467d8b7c54..13f64e773fed4c4c9213c3e201a81605fc7ca76e 100644 (file)
@@ -92,7 +92,7 @@ const struct spi_flash_info spi_flash_ids[] = {
        {"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) },
+       {"s25fl116k",      INFO(0x014015, 0x0, 64 * 1024,    32, 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) },
@@ -101,8 +101,8 @@ const struct spi_flash_info spi_flash_ids[] = {
        {"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) },
+       {"s25fl256s_64k",  INFO(0x010219, 0x4d01,  64 * 1024,   512, RD_FULL | WR_QPP) },
        {"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) },
@@ -135,6 +135,7 @@ const struct spi_flash_info spi_flash_ids[] = {
        {"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) },
+       {"mt35xu512g",     INFO6(0x2c5b1a, 0x104100,  128 * 1024,  512, E_FSR | SECT_4K) },
 #endif
 #ifdef CONFIG_SPI_FLASH_SST            /* SST */
        {"sst25vf040b",    INFO(0xbf258d, 0x0,  64 * 1024,     8, SECT_4K | SST_WR) },
index 5ceea44c60535c0ddae59bd663fdae7f39cf2478..d67927cd3b84272c50de254ece28bbec99bd7e70 100644 (file)
@@ -159,6 +159,14 @@ config FTMAC100
        help
          This MAC is present in Andestech SoCs.
 
+config MVNETA
+       bool "Marvell Armada 385 network interface support"
+       depends on ARMADA_XP || ARMADA_38X
+       select PHYLIB
+       help
+         This driver supports the network interface units in the
+         Marvell ARMADA XP and 38X SoCs
+
 config MVPP2
        bool "Marvell Armada 375/7K/8K network interface support"
        depends on ARMADA_375 || ARMADA_8K
index 9ff72fa1edc7d5d1ba19299289a81abc851621d1..a2b594ed739af7de7a577699b57648568e1c652a 100644 (file)
@@ -610,7 +610,7 @@ int gmac_miiphy_read(struct mii_dev *bus, int phyaddr, int devad, int reg)
 
        /* Busy wait timeout is 1ms */
        if (gmac_mii_busywait(1000)) {
-               error("%s: Prepare MII read: MII/MDIO busy\n", __func__);
+               pr_err("%s: Prepare MII read: MII/MDIO busy\n", __func__);
                return -1;
        }
 
@@ -622,7 +622,7 @@ int gmac_miiphy_read(struct mii_dev *bus, int phyaddr, int devad, int reg)
        writel(tmp, GMAC_MII_DATA_ADDR);
 
        if (gmac_mii_busywait(1000)) {
-               error("%s: MII read failure: MII/MDIO busy\n", __func__);
+               pr_err("%s: MII read failure: MII/MDIO busy\n", __func__);
                return -1;
        }
 
@@ -638,7 +638,7 @@ int gmac_miiphy_write(struct mii_dev *bus, int phyaddr, int devad, int reg,
 
        /* Busy wait timeout is 1ms */
        if (gmac_mii_busywait(1000)) {
-               error("%s: Prepare MII write: MII/MDIO busy\n", __func__);
+               pr_err("%s: Prepare MII write: MII/MDIO busy\n", __func__);
                return -1;
        }
 
@@ -651,7 +651,7 @@ int gmac_miiphy_write(struct mii_dev *bus, int phyaddr, int devad, int reg,
        writel(tmp, GMAC_MII_DATA_ADDR);
 
        if (gmac_mii_busywait(1000)) {
-               error("%s: MII write failure: MII/MDIO busy\n", __func__);
+               pr_err("%s: MII write failure: MII/MDIO busy\n", __func__);
                return -1;
        }
 
@@ -742,7 +742,7 @@ int gmac_set_speed(int speed, int duplex)
        } else if (speed == 10) {
                speed_cfg = 0;
        } else {
-               error("%s: Invalid GMAC speed(%d)!\n", __func__, speed);
+               pr_err("%s: Invalid GMAC speed(%d)!\n", __func__, speed);
                return -1;
        }
 
@@ -820,7 +820,7 @@ int gmac_mac_init(struct eth_device *dev)
        writel(0, GMAC0_INT_STATUS_ADDR);
 
        if (dma_init(dma) < 0) {
-               error("%s: GMAC dma_init failed\n", __func__);
+               pr_err("%s: GMAC dma_init failed\n", __func__);
                goto err_exit;
        }
 
@@ -855,7 +855,7 @@ int gmac_mac_init(struct eth_device *dev)
        writel(tmp, GMAC_MII_CTRL_ADDR);
 
        if (gmac_mii_busywait(1000)) {
-               error("%s: Configure MDIO: MII/MDIO busy\n", __func__);
+               pr_err("%s: Configure MDIO: MII/MDIO busy\n", __func__);
                goto err_exit;
        }
 
index e2747365a20b3d46389bb7384bc4c66e9de5c47c..9056f71b9aceb3732dd4a8fe9da1243d23779d21 100644 (file)
@@ -40,7 +40,7 @@ static int bcm_sf2_eth_init(struct eth_device *dev)
 
        rc = eth->mac_init(dev);
        if (rc) {
-               error("%s: Couldn't cofigure MAC!\n", __func__);
+               pr_err("%s: Couldn't cofigure MAC!\n", __func__);
                return rc;
        }
 
@@ -90,7 +90,7 @@ static int bcm_sf2_eth_send(struct eth_device *dev, void *packet, int length)
                debug(".");
                i++;
                if (i > 20) {
-                       error("%s: Tx timeout: retried 20 times\n", __func__);
+                       pr_err("%s: Tx timeout: retried 20 times\n", __func__);
                        rc = -1;
                        break;
                }
@@ -117,7 +117,7 @@ static int bcm_sf2_eth_receive(struct eth_device *dev)
                        debug("\nNO More Rx\n");
                        break;
                } else if ((rcvlen == 0) || (rcvlen > RX_BUF_SIZE)) {
-                       error("%s: Wrong Ethernet packet size (%d B), skip!\n",
+                       pr_err("%s: Wrong Ethernet packet size (%d B), skip!\n",
                              __func__, rcvlen);
                        break;
                } else {
@@ -166,9 +166,9 @@ static int bcm_sf2_eth_open(struct eth_device *dev, bd_t *bt)
         */
        for (i = 0; i < eth->port_num; i++) {
                if (phy_startup(eth->port[i])) {
-                       error("%s: PHY %d startup failed!\n", __func__, i);
+                       pr_err("%s: PHY %d startup failed!\n", __func__, i);
                        if (i == CONFIG_BCM_SF2_ETH_DEFAULT_PORT) {
-                               error("%s: No default port %d!\n", __func__, i);
+                               pr_err("%s: No default port %d!\n", __func__, i);
                                return -1;
                        }
                }
@@ -205,13 +205,13 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num)
 
        dev = (struct eth_device *)malloc(sizeof(struct eth_device));
        if (dev == NULL) {
-               error("%s: Not enough memory!\n", __func__);
+               pr_err("%s: Not enough memory!\n", __func__);
                return -1;
        }
 
        eth = (struct eth_info *)malloc(sizeof(struct eth_info));
        if (eth == NULL) {
-               error("%s: Not enough memory!\n", __func__);
+               pr_err("%s: Not enough memory!\n", __func__);
                return -1;
        }
 
@@ -234,7 +234,7 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num)
        if (gmac_add(dev)) {
                free(eth);
                free(dev);
-               error("%s: Adding GMAC failed!\n", __func__);
+               pr_err("%s: Adding GMAC failed!\n", __func__);
                return -1;
        }
 #else
@@ -263,7 +263,7 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num)
 
        rc = bcm_sf2_eth_init(dev);
        if (rc != 0) {
-               error("%s: configuration failed!\n", __func__);
+               pr_err("%s: configuration failed!\n", __func__);
                return -1;
        }
 
index 8970ee00af30b23caa4343cb7637258ec89723ed..0dc83ab820522bcd870e4fb30b9a83644284b59a 100644 (file)
@@ -29,14 +29,14 @@ static int davinci_emac_3517_get_macid(struct udevice *dev, u16 offset,
 
        syscon = fdtdec_lookup_phandle(fdt, node, "syscon");
        if (syscon < 0) {
-               error("Syscon offset not found\n");
+               pr_err("Syscon offset not found\n");
                return -ENOENT;
        }
 
        addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii),
                                sizeof(u32), MAP_NOCACHE);
        if (addr == FDT_ADDR_T_NONE) {
-               error("Not able to get syscon address to get mac efuse address\n");
+               pr_err("Not able to get syscon address to get mac efuse address\n");
                return -ENOENT;
        }
 
@@ -69,14 +69,14 @@ static int cpsw_am33xx_cm_get_macid(struct udevice *dev, u16 offset, int slave,
 
        syscon = fdtdec_lookup_phandle(fdt, node, "syscon");
        if (syscon < 0) {
-               error("Syscon offset not found\n");
+               pr_err("Syscon offset not found\n");
                return -ENOENT;
        }
 
        addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii),
                                sizeof(u32), MAP_NOCACHE);
        if (addr == FDT_ADDR_T_NONE) {
-               error("Not able to get syscon address to get mac efuse address\n");
+               pr_err("Not able to get syscon address to get mac efuse address\n");
                return -ENOENT;
        }
 
index d7db0fc432f7a93996cfbfd40439699f6de54e86..b72258f83bfec9694d42637da38620e35b1c09ed 100644 (file)
@@ -1368,7 +1368,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
 
                        mdio_base = cpsw_get_addr_by_node(fdt, subnode);
                        if (mdio_base == FDT_ADDR_T_NONE) {
-                               error("Not able to get MDIO address space\n");
+                               pr_err("Not able to get MDIO address space\n");
                                return -ENOENT;
                        }
                        priv->data.mdio_base = mdio_base;
@@ -1407,7 +1407,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
                                                                    subnode);
 
                        if (priv->data.gmii_sel == FDT_ADDR_T_NONE) {
-                               error("Not able to get gmii_sel reg address\n");
+                               pr_err("Not able to get gmii_sel reg address\n");
                                return -ENOENT;
                        }
 
@@ -1418,7 +1418,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
                        phy_sel_compat = fdt_getprop(fdt, subnode, "compatible",
                                                     NULL);
                        if (!phy_sel_compat) {
-                               error("Not able to get gmii_sel compatible\n");
+                               pr_err("Not able to get gmii_sel compatible\n");
                                return -ENOENT;
                        }
                }
@@ -1434,7 +1434,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
 
        ret = ti_cm_get_macid(dev, active_slave, pdata->enetaddr);
        if (ret < 0) {
-               error("cpsw read efuse mac failed\n");
+               pr_err("cpsw read efuse mac failed\n");
                return ret;
        }
 
index 5c4315ffeaad57e340295aa19583b49a40bbb411..00076cffbed2869a96fa33cc85ae60ea38ac64bd 100644 (file)
@@ -377,7 +377,7 @@ static int eqos_mdio_read(struct mii_dev *bus, int mdio_addr, int mdio_devad,
 
        ret = eqos_mdio_wait_idle(eqos);
        if (ret) {
-               error("MDIO not idle at entry");
+               pr_err("MDIO not idle at entry");
                return ret;
        }
 
@@ -397,7 +397,7 @@ static int eqos_mdio_read(struct mii_dev *bus, int mdio_addr, int mdio_devad,
 
        ret = eqos_mdio_wait_idle(eqos);
        if (ret) {
-               error("MDIO read didn't complete");
+               pr_err("MDIO read didn't complete");
                return ret;
        }
 
@@ -421,7 +421,7 @@ static int eqos_mdio_write(struct mii_dev *bus, int mdio_addr, int mdio_devad,
 
        ret = eqos_mdio_wait_idle(eqos);
        if (ret) {
-               error("MDIO not idle at entry");
+               pr_err("MDIO not idle at entry");
                return ret;
        }
 
@@ -443,7 +443,7 @@ static int eqos_mdio_write(struct mii_dev *bus, int mdio_addr, int mdio_devad,
 
        ret = eqos_mdio_wait_idle(eqos);
        if (ret) {
-               error("MDIO read didn't complete");
+               pr_err("MDIO read didn't complete");
                return ret;
        }
 
@@ -459,37 +459,37 @@ static int eqos_start_clks_tegra186(struct udevice *dev)
 
        ret = clk_enable(&eqos->clk_slave_bus);
        if (ret < 0) {
-               error("clk_enable(clk_slave_bus) failed: %d", ret);
+               pr_err("clk_enable(clk_slave_bus) failed: %d", ret);
                goto err;
        }
 
        ret = clk_enable(&eqos->clk_master_bus);
        if (ret < 0) {
-               error("clk_enable(clk_master_bus) failed: %d", ret);
+               pr_err("clk_enable(clk_master_bus) failed: %d", ret);
                goto err_disable_clk_slave_bus;
        }
 
        ret = clk_enable(&eqos->clk_rx);
        if (ret < 0) {
-               error("clk_enable(clk_rx) failed: %d", ret);
+               pr_err("clk_enable(clk_rx) failed: %d", ret);
                goto err_disable_clk_master_bus;
        }
 
        ret = clk_enable(&eqos->clk_ptp_ref);
        if (ret < 0) {
-               error("clk_enable(clk_ptp_ref) failed: %d", ret);
+               pr_err("clk_enable(clk_ptp_ref) failed: %d", ret);
                goto err_disable_clk_rx;
        }
 
        ret = clk_set_rate(&eqos->clk_ptp_ref, 125 * 1000 * 1000);
        if (ret < 0) {
-               error("clk_set_rate(clk_ptp_ref) failed: %d", ret);
+               pr_err("clk_set_rate(clk_ptp_ref) failed: %d", ret);
                goto err_disable_clk_ptp_ref;
        }
 
        ret = clk_enable(&eqos->clk_tx);
        if (ret < 0) {
-               error("clk_enable(clk_tx) failed: %d", ret);
+               pr_err("clk_enable(clk_tx) failed: %d", ret);
                goto err_disable_clk_ptp_ref;
        }
 
@@ -533,7 +533,7 @@ static int eqos_start_resets_tegra186(struct udevice *dev)
 
        ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 1);
        if (ret < 0) {
-               error("dm_gpio_set_value(phy_reset, assert) failed: %d", ret);
+               pr_err("dm_gpio_set_value(phy_reset, assert) failed: %d", ret);
                return ret;
        }
 
@@ -541,13 +541,13 @@ static int eqos_start_resets_tegra186(struct udevice *dev)
 
        ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 0);
        if (ret < 0) {
-               error("dm_gpio_set_value(phy_reset, deassert) failed: %d", ret);
+               pr_err("dm_gpio_set_value(phy_reset, deassert) failed: %d", ret);
                return ret;
        }
 
        ret = reset_assert(&eqos->reset_ctl);
        if (ret < 0) {
-               error("reset_assert() failed: %d", ret);
+               pr_err("reset_assert() failed: %d", ret);
                return ret;
        }
 
@@ -555,7 +555,7 @@ static int eqos_start_resets_tegra186(struct udevice *dev)
 
        ret = reset_deassert(&eqos->reset_ctl);
        if (ret < 0) {
-               error("reset_deassert() failed: %d", ret);
+               pr_err("reset_deassert() failed: %d", ret);
                return ret;
        }
 
@@ -591,14 +591,14 @@ static int eqos_calibrate_pads_tegra186(struct udevice *dev)
        ret = wait_for_bit(__func__, &eqos->tegra186_regs->auto_cal_status,
                           EQOS_AUTO_CAL_STATUS_ACTIVE, true, 10, false);
        if (ret) {
-               error("calibrate didn't start");
+               pr_err("calibrate didn't start");
                goto failed;
        }
 
        ret = wait_for_bit(__func__, &eqos->tegra186_regs->auto_cal_status,
                           EQOS_AUTO_CAL_STATUS_ACTIVE, false, 10, false);
        if (ret) {
-               error("calibrate didn't finish");
+               pr_err("calibrate didn't finish");
                goto failed;
        }
 
@@ -713,13 +713,13 @@ static int eqos_set_tx_clk_speed_tegra186(struct udevice *dev)
                rate = 2.5 * 1000 * 1000;
                break;
        default:
-               error("invalid speed %d", eqos->phy->speed);
+               pr_err("invalid speed %d", eqos->phy->speed);
                return -EINVAL;
        }
 
        ret = clk_set_rate(&eqos->clk_tx, rate);
        if (ret < 0) {
-               error("clk_set_rate(tx_clk, %lu) failed: %d", rate, ret);
+               pr_err("clk_set_rate(tx_clk, %lu) failed: %d", rate, ret);
                return ret;
        }
 
@@ -739,7 +739,7 @@ static int eqos_adjust_link(struct udevice *dev)
        else
                ret = eqos_set_half_duplex(dev);
        if (ret < 0) {
-               error("eqos_set_*_duplex() failed: %d", ret);
+               pr_err("eqos_set_*_duplex() failed: %d", ret);
                return ret;
        }
 
@@ -757,24 +757,24 @@ static int eqos_adjust_link(struct udevice *dev)
                ret = eqos_set_mii_speed_10(dev);
                break;
        default:
-               error("invalid speed %d", eqos->phy->speed);
+               pr_err("invalid speed %d", eqos->phy->speed);
                return -EINVAL;
        }
        if (ret < 0) {
-               error("eqos_set_*mii_speed*() failed: %d", ret);
+               pr_err("eqos_set_*mii_speed*() failed: %d", ret);
                return ret;
        }
 
        if (en_calibration) {
                ret = eqos_calibrate_pads_tegra186(dev);
                if (ret < 0) {
-                       error("eqos_calibrate_pads_tegra186() failed: %d", ret);
+                       pr_err("eqos_calibrate_pads_tegra186() failed: %d", ret);
                        return ret;
                }
        } else {
                ret = eqos_disable_calibration_tegra186(dev);
                if (ret < 0) {
-                       error("eqos_disable_calibration_tegra186() failed: %d",
+                       pr_err("eqos_disable_calibration_tegra186() failed: %d",
                              ret);
                        return ret;
                }
@@ -782,7 +782,7 @@ static int eqos_adjust_link(struct udevice *dev)
 
        ret = eqos_set_tx_clk_speed_tegra186(dev);
        if (ret < 0) {
-               error("eqos_set_tx_clk_speed_tegra186() failed: %d", ret);
+               pr_err("eqos_set_tx_clk_speed_tegra186() failed: %d", ret);
                return ret;
        }
 
@@ -848,13 +848,13 @@ static int eqos_start(struct udevice *dev)
 
        ret = eqos_start_clks_tegra186(dev);
        if (ret < 0) {
-               error("eqos_start_clks_tegra186() failed: %d", ret);
+               pr_err("eqos_start_clks_tegra186() failed: %d", ret);
                goto err;
        }
 
        ret = eqos_start_resets_tegra186(dev);
        if (ret < 0) {
-               error("eqos_start_resets_tegra186() failed: %d", ret);
+               pr_err("eqos_start_resets_tegra186() failed: %d", ret);
                goto err_stop_clks;
        }
 
@@ -865,13 +865,13 @@ static int eqos_start(struct udevice *dev)
        ret = wait_for_bit(__func__, &eqos->dma_regs->mode,
                           EQOS_DMA_MODE_SWR, false, 10, false);
        if (ret) {
-               error("EQOS_DMA_MODE_SWR stuck");
+               pr_err("EQOS_DMA_MODE_SWR stuck");
                goto err_stop_resets;
        }
 
        ret = eqos_calibrate_pads_tegra186(dev);
        if (ret < 0) {
-               error("eqos_calibrate_pads_tegra186() failed: %d", ret);
+               pr_err("eqos_calibrate_pads_tegra186() failed: %d", ret);
                goto err_stop_resets;
        }
 
@@ -881,28 +881,28 @@ static int eqos_start(struct udevice *dev)
 
        eqos->phy = phy_connect(eqos->mii, 0, dev, 0);
        if (!eqos->phy) {
-               error("phy_connect() failed");
+               pr_err("phy_connect() failed");
                goto err_stop_resets;
        }
        ret = phy_config(eqos->phy);
        if (ret < 0) {
-               error("phy_config() failed: %d", ret);
+               pr_err("phy_config() failed: %d", ret);
                goto err_shutdown_phy;
        }
        ret = phy_startup(eqos->phy);
        if (ret < 0) {
-               error("phy_startup() failed: %d", ret);
+               pr_err("phy_startup() failed: %d", ret);
                goto err_shutdown_phy;
        }
 
        if (!eqos->phy->link) {
-               error("No link");
+               pr_err("No link");
                goto err_shutdown_phy;
        }
 
        ret = eqos_adjust_link(dev);
        if (ret < 0) {
-               error("eqos_adjust_link() failed: %d", ret);
+               pr_err("eqos_adjust_link() failed: %d", ret);
                goto err_shutdown_phy;
        }
 
@@ -1119,7 +1119,7 @@ err_stop_resets:
 err_stop_clks:
        eqos_stop_clks_tegra186(dev);
 err:
-       error("FAILED: %d", ret);
+       pr_err("FAILED: %d", ret);
        return ret;
 }
 
@@ -1361,7 +1361,7 @@ static int eqos_probe_resources_tegra186(struct udevice *dev)
 
        ret = reset_get_by_name(dev, "eqos", &eqos->reset_ctl);
        if (ret) {
-               error("reset_get_by_name(rst) failed: %d", ret);
+               pr_err("reset_get_by_name(rst) failed: %d", ret);
                return ret;
        }
 
@@ -1369,38 +1369,38 @@ static int eqos_probe_resources_tegra186(struct udevice *dev)
                                   &eqos->phy_reset_gpio,
                                   GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
        if (ret) {
-               error("gpio_request_by_name(phy reset) failed: %d", ret);
+               pr_err("gpio_request_by_name(phy reset) failed: %d", ret);
                goto err_free_reset_eqos;
        }
 
        ret = clk_get_by_name(dev, "slave_bus", &eqos->clk_slave_bus);
        if (ret) {
-               error("clk_get_by_name(slave_bus) failed: %d", ret);
+               pr_err("clk_get_by_name(slave_bus) failed: %d", ret);
                goto err_free_gpio_phy_reset;
        }
 
        ret = clk_get_by_name(dev, "master_bus", &eqos->clk_master_bus);
        if (ret) {
-               error("clk_get_by_name(master_bus) failed: %d", ret);
+               pr_err("clk_get_by_name(master_bus) failed: %d", ret);
                goto err_free_clk_slave_bus;
        }
 
        ret = clk_get_by_name(dev, "rx", &eqos->clk_rx);
        if (ret) {
-               error("clk_get_by_name(rx) failed: %d", ret);
+               pr_err("clk_get_by_name(rx) failed: %d", ret);
                goto err_free_clk_master_bus;
        }
 
        ret = clk_get_by_name(dev, "ptp_ref", &eqos->clk_ptp_ref);
        if (ret) {
-               error("clk_get_by_name(ptp_ref) failed: %d", ret);
+               pr_err("clk_get_by_name(ptp_ref) failed: %d", ret);
                goto err_free_clk_rx;
                return ret;
        }
 
        ret = clk_get_by_name(dev, "tx", &eqos->clk_tx);
        if (ret) {
-               error("clk_get_by_name(tx) failed: %d", ret);
+               pr_err("clk_get_by_name(tx) failed: %d", ret);
                goto err_free_clk_ptp_ref;
        }
 
@@ -1454,7 +1454,7 @@ static int eqos_probe(struct udevice *dev)
 
        eqos->regs = devfdt_get_addr(dev);
        if (eqos->regs == FDT_ADDR_T_NONE) {
-               error("devfdt_get_addr() failed");
+               pr_err("devfdt_get_addr() failed");
                return -ENODEV;
        }
        eqos->mac_regs = (void *)(eqos->regs + EQOS_MAC_REGS_BASE);
@@ -1464,19 +1464,19 @@ static int eqos_probe(struct udevice *dev)
 
        ret = eqos_probe_resources_core(dev);
        if (ret < 0) {
-               error("eqos_probe_resources_core() failed: %d", ret);
+               pr_err("eqos_probe_resources_core() failed: %d", ret);
                return ret;
        }
 
        ret = eqos_probe_resources_tegra186(dev);
        if (ret < 0) {
-               error("eqos_probe_resources_tegra186() failed: %d", ret);
+               pr_err("eqos_probe_resources_tegra186() failed: %d", ret);
                goto err_remove_resources_core;
        }
 
        eqos->mii = mdio_alloc();
        if (!eqos->mii) {
-               error("mdio_alloc() failed");
+               pr_err("mdio_alloc() failed");
                goto err_remove_resources_tegra;
        }
        eqos->mii->read = eqos_mdio_read;
@@ -1486,7 +1486,7 @@ static int eqos_probe(struct udevice *dev)
 
        ret = mdio_register(eqos->mii);
        if (ret < 0) {
-               error("mdio_register() failed: %d", ret);
+               pr_err("mdio_register() failed: %d", ret);
                goto err_free_mdio;
        }
 
index a94191b9e6715e3a685f6c172f3f45d85544b919..bc4570624332c607af3e7faf2c923d3e4346fa99 100644 (file)
@@ -324,7 +324,7 @@ static int ep93xx_eth_rcv_packet(struct eth_device *dev)
                        debug("reporting %d bytes...\n", len);
                } else {
                        /* Do we have an erroneous packet? */
-                       error("packet rx error, status %08X %08X",
+                       pr_err("packet rx error, status %08X %08X",
                                priv->rx_sq.current->word1,
                                priv->rx_sq.current->word2);
                        dump_rx_descriptor_queue(dev);
@@ -401,7 +401,7 @@ static int ep93xx_eth_send_packet(struct eth_device *dev,
                ; /* noop */
 
        if (!TX_STATUS_TXWE(priv->tx_sq.current)) {
-               error("packet tx error, status %08X",
+               pr_err("packet tx error, status %08X",
                        priv->tx_sq.current->word1);
                dump_tx_descriptor_queue(dev);
                dump_tx_status_queue(dev);
@@ -452,7 +452,7 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr)
 
        priv = malloc(sizeof(*priv));
        if (!priv) {
-               error("malloc() failed");
+               pr_err("malloc() failed");
                goto eth_init_failed_0;
        }
        memset(priv, 0, sizeof(*priv));
@@ -462,34 +462,34 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr)
        priv->tx_dq.base = calloc(NUMTXDESC,
                                sizeof(struct tx_descriptor));
        if (priv->tx_dq.base == NULL) {
-               error("calloc() failed");
+               pr_err("calloc() failed");
                goto eth_init_failed_1;
        }
 
        priv->tx_sq.base = calloc(NUMTXDESC,
                                sizeof(struct tx_status));
        if (priv->tx_sq.base == NULL) {
-               error("calloc() failed");
+               pr_err("calloc() failed");
                goto eth_init_failed_2;
        }
 
        priv->rx_dq.base = calloc(NUMRXDESC,
                                sizeof(struct rx_descriptor));
        if (priv->rx_dq.base == NULL) {
-               error("calloc() failed");
+               pr_err("calloc() failed");
                goto eth_init_failed_3;
        }
 
        priv->rx_sq.base = calloc(NUMRXDESC,
                                sizeof(struct rx_status));
        if (priv->rx_sq.base == NULL) {
-               error("calloc() failed");
+               pr_err("calloc() failed");
                goto eth_init_failed_4;
        }
 
        dev = malloc(sizeof *dev);
        if (dev == NULL) {
-               error("malloc() failed");
+               pr_err("malloc() failed");
                goto eth_init_failed_5;
        }
        memset(dev, 0, sizeof *dev);
index 72ef42cca883a8853b6265fa5184f9681747302a..21ccab47ae2702b5ba81cba157d0c8036e763802 100644 (file)
@@ -757,7 +757,7 @@ static int ks2_eth_start(struct udevice *dev)
        qm_init();
 
        if (ksnav_init(priv->netcp_pktdma, &priv->net_rx_buffs)) {
-               error("ksnav_init failed\n");
+               pr_err("ksnav_init failed\n");
                goto err_knav_init;
        }
 
@@ -773,7 +773,7 @@ static int ks2_eth_start(struct udevice *dev)
 
                phy_startup(priv->phydev);
                if (priv->phydev->link == 0) {
-                       error("phy startup failed\n");
+                       pr_err("phy startup failed\n");
                        goto err_phy_start;
                }
        }
@@ -923,7 +923,7 @@ static int ks2_eth_probe(struct udevice *dev)
                 */
                mdio_bus = mdio_alloc();
                if (!mdio_bus) {
-                       error("MDIO alloc failed\n");
+                       pr_err("MDIO alloc failed\n");
                        return -ENOMEM;
                }
                priv->mdio_bus = mdio_bus;
@@ -935,7 +935,7 @@ static int ks2_eth_probe(struct udevice *dev)
 
                ret = mdio_register(mdio_bus);
                if (ret) {
-                       error("MDIO bus register failed\n");
+                       pr_err("MDIO bus register failed\n");
                        return ret;
                }
        } else {
@@ -1011,7 +1011,7 @@ static int ks2_eth_bind_slaves(struct udevice *dev, int gbe, int *gbe_0)
                                        slave_name, offset_to_ofnode(slave),
                                        &sl_dev);
                        if (ret) {
-                               error("ks2_net - not able to bind slave interfaces\n");
+                               pr_err("ks2_net - not able to bind slave interfaces\n");
                                return ret;
                        }
                }
@@ -1031,7 +1031,7 @@ static int ks2_eth_bind_slaves(struct udevice *dev, int gbe, int *gbe_0)
                ret = device_bind_driver_to_node(dev, "eth_ks2_sl", slave_name,
                                        offset_to_ofnode(slave), &sl_dev);
                if (ret) {
-                       error("ks2_net - not able to bind slave interfaces\n");
+                       pr_err("ks2_net - not able to bind slave interfaces\n");
                        return ret;
                }
        }
@@ -1074,7 +1074,7 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave,
 
                mdio = fdt_parent_offset(fdt, phy);
                if (mdio < 0) {
-                       error("mdio dt not found\n");
+                       pr_err("mdio dt not found\n");
                        return -ENODEV;
                }
                priv->mdio_base = (void *)fdtdec_get_addr(fdt, mdio, "reg");
index 8af2470268375d4b63f2e093848d08ec1b9f84f7..58f128d8a62c5a1e18101d01fc5ea3bb2ed241fe 100644 (file)
@@ -33,6 +33,14 @@ config PCI_PNP
        help
          Enable PCI memory and I/O space resource allocation and assignment.
 
+config PCIE_ECAM_GENERIC
+       bool "Generic ECAM-based PCI host controller support"
+       default n
+       depends on DM_PCI
+       help
+         Say Y here if you want to enable support for generic ECAM-based
+         PCIe host controllers, such as the one emulated by QEMU.
+
 config PCIE_DW_MVEBU
        bool "Enable Armada-8K PCIe driver (DesignWare core)"
        depends on DM_PCI
index ad44e83996c458ecf34f842c4fe5fc994918b34b..5eb12efbf5f275903ff59b4f44ce6f7ea60a4f8e 100644 (file)
@@ -17,6 +17,7 @@ obj-$(CONFIG_PCI) += pci.o pci_auto_old.o
 endif
 obj-$(CONFIG_PCI) += pci_auto_common.o pci_common.o
 
+obj-$(CONFIG_PCIE_ECAM_GENERIC) += pcie_ecam_generic.o
 obj-$(CONFIG_FSL_PCI_INIT) += fsl_pci_init.o
 obj-$(CONFIG_PCI_INDIRECT_BRIDGE) += pci_indirect.o
 obj-$(CONFIG_PCI_GT64120) += pci_gt64120.o
index 86df141d6071201d7aecf1d8817083db3d7e9d73..5a24eb6428f76b26b938ea63910744f74d64d20f 100644 (file)
@@ -518,6 +518,64 @@ int pci_auto_config_devices(struct udevice *bus)
        return sub_bus;
 }
 
+int pci_generic_mmap_write_config(
+       struct udevice *bus,
+       int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp),
+       pci_dev_t bdf,
+       uint offset,
+       ulong value,
+       enum pci_size_t size)
+{
+       void *address;
+
+       if (addr_f(bus, bdf, offset, &address) < 0)
+               return 0;
+
+       switch (size) {
+       case PCI_SIZE_8:
+               writeb(value, address);
+               return 0;
+       case PCI_SIZE_16:
+               writew(value, address);
+               return 0;
+       case PCI_SIZE_32:
+               writel(value, address);
+               return 0;
+       default:
+               return -EINVAL;
+       }
+}
+
+int pci_generic_mmap_read_config(
+       struct udevice *bus,
+       int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp),
+       pci_dev_t bdf,
+       uint offset,
+       ulong *valuep,
+       enum pci_size_t size)
+{
+       void *address;
+
+       if (addr_f(bus, bdf, offset, &address) < 0) {
+               *valuep = pci_get_ff(size);
+               return 0;
+       }
+
+       switch (size) {
+       case PCI_SIZE_8:
+               *valuep = readb(address);
+               return 0;
+       case PCI_SIZE_16:
+               *valuep = readw(address);
+               return 0;
+       case PCI_SIZE_32:
+               *valuep = readl(address);
+               return 0;
+       default:
+               return -EINVAL;
+       }
+}
+
 int dm_pci_hose_probe_bus(struct udevice *bus)
 {
        int sub_bus;
index 7d920d423d9d6169a917c18e1a2130e7b005d21c..b5bd25ec563a0e36425ec5fba70bbc702f715423 100644 (file)
@@ -369,7 +369,7 @@ static int tegra_pcie_port_parse_dt(ofnode node, struct tegra_pcie_port *port)
 
        addr = ofnode_get_property(node, "assigned-addresses", &len);
        if (!addr) {
-               error("property \"assigned-addresses\" not found");
+               pr_err("property \"assigned-addresses\" not found");
                return -FDT_ERR_NOTFOUND;
        }
 
@@ -460,7 +460,7 @@ static int tegra_pcie_parse_port_info(ofnode node, uint *index, uint *lanes)
 
        err = ofnode_read_u32_default(node, "nvidia,num-lanes", -1);
        if (err < 0) {
-               error("failed to parse \"nvidia,num-lanes\" property");
+               pr_err("failed to parse \"nvidia,num-lanes\" property");
                return err;
        }
 
@@ -468,7 +468,7 @@ static int tegra_pcie_parse_port_info(ofnode node, uint *index, uint *lanes)
 
        err = ofnode_read_pci_addr(node, 0, "reg", &addr);
        if (err < 0) {
-               error("failed to parse \"reg\" property");
+               pr_err("failed to parse \"reg\" property");
                return err;
        }
 
@@ -491,25 +491,25 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
 
        err = dev_read_resource(dev, 0, &pcie->pads);
        if (err < 0) {
-               error("resource \"pads\" not found");
+               pr_err("resource \"pads\" not found");
                return err;
        }
 
        err = dev_read_resource(dev, 1, &pcie->afi);
        if (err < 0) {
-               error("resource \"afi\" not found");
+               pr_err("resource \"afi\" not found");
                return err;
        }
 
        err = dev_read_resource(dev, 2, &pcie->cs);
        if (err < 0) {
-               error("resource \"cs\" not found");
+               pr_err("resource \"cs\" not found");
                return err;
        }
 
        err = tegra_pcie_board_init();
        if (err < 0) {
-               error("tegra_pcie_board_init() failed: err=%d", err);
+               pr_err("tegra_pcie_board_init() failed: err=%d", err);
                return err;
        }
 
@@ -518,7 +518,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
        if (pcie->phy) {
                err = tegra_xusb_phy_prepare(pcie->phy);
                if (err < 0) {
-                       error("failed to prepare PHY: %d", err);
+                       pr_err("failed to prepare PHY: %d", err);
                        return err;
                }
        }
@@ -530,7 +530,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
 
                err = tegra_pcie_parse_port_info(subnode, &index, &num_lanes);
                if (err < 0) {
-                       error("failed to obtain root port info");
+                       pr_err("failed to obtain root port info");
                        continue;
                }
 
@@ -560,7 +560,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
        err = tegra_pcie_get_xbar_config(dev_ofnode(dev), lanes, id,
                                         &pcie->xbar);
        if (err < 0) {
-               error("invalid lane configuration");
+               pr_err("invalid lane configuration");
                return err;
        }
 
@@ -574,31 +574,31 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie)
 
        ret = power_domain_on(&pcie->pwrdom);
        if (ret) {
-               error("power_domain_on() failed: %d\n", ret);
+               pr_err("power_domain_on() failed: %d\n", ret);
                return ret;
        }
 
        ret = clk_enable(&pcie->clk_afi);
        if (ret) {
-               error("clk_enable(afi) failed: %d\n", ret);
+               pr_err("clk_enable(afi) failed: %d\n", ret);
                return ret;
        }
 
        ret = clk_enable(&pcie->clk_pex);
        if (ret) {
-               error("clk_enable(pex) failed: %d\n", ret);
+               pr_err("clk_enable(pex) failed: %d\n", ret);
                return ret;
        }
 
        ret = reset_deassert(&pcie->reset_afi);
        if (ret) {
-               error("reset_deassert(afi) failed: %d\n", ret);
+               pr_err("reset_deassert(afi) failed: %d\n", ret);
                return ret;
        }
 
        ret = reset_deassert(&pcie->reset_pex);
        if (ret) {
-               error("reset_deassert(pex) failed: %d\n", ret);
+               pr_err("reset_deassert(pex) failed: %d\n", ret);
                return ret;
        }
 
@@ -618,14 +618,14 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie)
 
        err = tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
        if (err < 0) {
-               error("failed to power off PCIe partition: %d", err);
+               pr_err("failed to power off PCIe partition: %d", err);
                return err;
        }
 
        err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE,
                                                PERIPH_ID_PCIE);
        if (err < 0) {
-               error("failed to power up PCIe partition: %d", err);
+               pr_err("failed to power up PCIe partition: %d", err);
                return err;
        }
 
@@ -645,7 +645,7 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie)
 
        err = tegra_plle_enable();
        if (err < 0) {
-               error("failed to enable PLLE: %d\n", err);
+               pr_err("failed to enable PLLE: %d\n", err);
                return err;
        }
 
@@ -705,7 +705,7 @@ static int tegra_pcie_phy_enable(struct tegra_pcie *pcie)
        /* wait for the PLL to lock */
        err = tegra_pcie_pll_wait(pcie, 500);
        if (err < 0) {
-               error("PLL failed to lock: %d", err);
+               pr_err("PLL failed to lock: %d", err);
                return err;
        }
 
@@ -769,7 +769,7 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
                err = tegra_pcie_phy_enable(pcie);
 
        if (err < 0) {
-               error("failed to power on PHY: %d\n", err);
+               pr_err("failed to power on PHY: %d\n", err);
                return err;
        }
 #endif
@@ -778,7 +778,7 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
 #ifdef CONFIG_TEGRA186
        err = reset_deassert(&pcie->reset_pcie_x);
        if (err) {
-               error("reset_deassert(pcie_x) failed: %d\n", err);
+               pr_err("reset_deassert(pcie_x) failed: %d\n", err);
                return err;
        }
 #else
@@ -1143,25 +1143,25 @@ static int pci_tegra_probe(struct udevice *dev)
 
        err = tegra_pcie_power_on(pcie);
        if (err < 0) {
-               error("failed to power on");
+               pr_err("failed to power on");
                return err;
        }
 
        err = tegra_pcie_enable_controller(pcie);
        if (err < 0) {
-               error("failed to enable controller");
+               pr_err("failed to enable controller");
                return err;
        }
 
        err = tegra_pcie_setup_translations(dev);
        if (err < 0) {
-               error("failed to decode ranges");
+               pr_err("failed to decode ranges");
                return err;
        }
 
        err = tegra_pcie_enable(pcie);
        if (err < 0) {
-               error("failed to enable PCIe");
+               pr_err("failed to enable PCIe");
                return err;
        }
 
diff --git a/drivers/pci/pcie_ecam_generic.c b/drivers/pci/pcie_ecam_generic.c
new file mode 100644 (file)
index 0000000..c7540ff
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Generic PCIE host provided by e.g. QEMU
+ *
+ * Heavily based on drivers/pci/pcie_xilinx.c
+ *
+ * Copyright (C) 2016 Imagination Technologies
+ *
+ * SPDX-License-Identifier:    GPL-2.0
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <pci.h>
+
+#include <asm/io.h>
+
+/**
+ * struct generic_ecam_pcie - generic_ecam PCIe controller state
+ * @cfg_base: The base address of memory mapped configuration space
+ */
+struct generic_ecam_pcie {
+       void *cfg_base;
+};
+
+/**
+ * pci_generic_ecam_conf_address() - Calculate the address of a config access
+ * @bus: Pointer to the PCI bus
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @paddress: Pointer to the pointer to write the calculates address to
+ *
+ * Calculates the address that should be accessed to perform a PCIe
+ * configuration space access for a given device identified by the PCIe
+ * controller device @pcie and the bus, device & function numbers in @bdf. If
+ * access to the device is not valid then the function will return an error
+ * code. Otherwise the address to access will be written to the pointer pointed
+ * to by @paddress.
+ */
+static int pci_generic_ecam_conf_address(struct udevice *bus, pci_dev_t bdf,
+                                           uint offset, void **paddress)
+{
+       struct generic_ecam_pcie *pcie = dev_get_priv(bus);
+       void *addr;
+
+       addr = pcie->cfg_base;
+       addr += PCI_BUS(bdf) << 20;
+       addr += PCI_DEV(bdf) << 15;
+       addr += PCI_FUNC(bdf) << 12;
+       addr += offset;
+       *paddress = addr;
+
+       return 0;
+}
+
+/**
+ * pci_generic_ecam_read_config() - Read from configuration space
+ * @bus: Pointer to the PCI bus
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @valuep: A pointer at which to store the read value
+ * @size: Indicates the size of access to perform
+ *
+ * Read a value of size @size from offset @offset within the configuration
+ * space of the device identified by the bus, device & function numbers in @bdf
+ * on the PCI bus @bus.
+ */
+static int pci_generic_ecam_read_config(struct udevice *bus, pci_dev_t bdf,
+                                  uint offset, ulong *valuep,
+                                  enum pci_size_t size)
+{
+       return pci_generic_mmap_read_config(bus, pci_generic_ecam_conf_address,
+                                           bdf, offset, valuep, size);
+}
+
+/**
+ * pci_generic_ecam_write_config() - Write to configuration space
+ * @bus: Pointer to the PCI bus
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @value: The value to write
+ * @size: Indicates the size of access to perform
+ *
+ * Write the value @value of size @size from offset @offset within the
+ * configuration space of the device identified by the bus, device & function
+ * numbers in @bdf on the PCI bus @bus.
+ */
+static int pci_generic_ecam_write_config(struct udevice *bus, pci_dev_t bdf,
+                                   uint offset, ulong value,
+                                   enum pci_size_t size)
+{
+       return pci_generic_mmap_write_config(bus, pci_generic_ecam_conf_address,
+                                            bdf, offset, value, size);
+}
+
+/**
+ * pci_generic_ecam_ofdata_to_platdata() - Translate from DT to device state
+ * @dev: A pointer to the device being operated on
+ *
+ * Translate relevant data from the device tree pertaining to device @dev into
+ * state that the driver will later make use of. This state is stored in the
+ * device's private data structure.
+ *
+ * Return: 0 on success, else -EINVAL
+ */
+static int pci_generic_ecam_ofdata_to_platdata(struct udevice *dev)
+{
+       struct generic_ecam_pcie *pcie = dev_get_priv(dev);
+       struct fdt_resource reg_res;
+       DECLARE_GLOBAL_DATA_PTR;
+       int err;
+
+       err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
+                              0, &reg_res);
+       if (err < 0) {
+               pr_err("\"reg\" resource not found\n");
+               return err;
+       }
+
+       pcie->cfg_base = map_physmem(reg_res.start,
+                                    fdt_resource_size(&reg_res),
+                                    MAP_NOCACHE);
+
+       return 0;
+}
+
+static const struct dm_pci_ops pci_generic_ecam_ops = {
+       .read_config    = pci_generic_ecam_read_config,
+       .write_config   = pci_generic_ecam_write_config,
+};
+
+static const struct udevice_id pci_generic_ecam_ids[] = {
+       { .compatible = "pci-host-ecam-generic" },
+       { }
+};
+
+U_BOOT_DRIVER(pci_generic_ecam) = {
+       .name                   = "pci_generic_ecam",
+       .id                     = UCLASS_PCI,
+       .of_match               = pci_generic_ecam_ids,
+       .ops                    = &pci_generic_ecam_ops,
+       .ofdata_to_platdata     = pci_generic_ecam_ofdata_to_platdata,
+       .priv_auto_alloc_size   = sizeof(struct generic_ecam_pcie),
+};
index 610f85c4e8ea464edc531ba4af4fa252d5b24044..0cb7f6d5643f6930f04f91bed90054cd103d3816 100644 (file)
@@ -241,14 +241,19 @@ static int ls_pcie_addr_valid(struct ls_pcie *pcie, pci_dev_t bdf)
        return 0;
 }
 
-void *ls_pcie_conf_address(struct ls_pcie *pcie, pci_dev_t bdf,
-                                  int offset)
+int ls_pcie_conf_address(struct udevice *bus, pci_dev_t bdf,
+                        uint offset, void **paddress)
 {
-       struct udevice *bus = pcie->bus;
+       struct ls_pcie *pcie = dev_get_priv(bus);
        u32 busdev;
 
-       if (PCI_BUS(bdf) == bus->seq)
-               return pcie->dbi + offset;
+       if (ls_pcie_addr_valid(pcie, bdf))
+               return -EINVAL;
+
+       if (PCI_BUS(bdf) == bus->seq) {
+               *paddress = pcie->dbi + offset;
+               return 0;
+       }
 
        busdev = PCIE_ATU_BUS(PCI_BUS(bdf)) |
                 PCIE_ATU_DEV(PCI_DEV(bdf)) |
@@ -256,67 +261,28 @@ void *ls_pcie_conf_address(struct ls_pcie *pcie, pci_dev_t bdf,
 
        if (PCI_BUS(bdf) == bus->seq + 1) {
                ls_pcie_cfg0_set_busdev(pcie, busdev);
-               return pcie->cfg0 + offset;
+               *paddress = pcie->cfg0 + offset;
        } else {
                ls_pcie_cfg1_set_busdev(pcie, busdev);
-               return pcie->cfg1 + offset;
+               *paddress = pcie->cfg1 + offset;
        }
+       return 0;
 }
 
 static int ls_pcie_read_config(struct udevice *bus, pci_dev_t bdf,
                               uint offset, ulong *valuep,
                               enum pci_size_t size)
 {
-       struct ls_pcie *pcie = dev_get_priv(bus);
-       void *address;
-
-       if (ls_pcie_addr_valid(pcie, bdf)) {
-               *valuep = pci_get_ff(size);
-               return 0;
-       }
-
-       address = ls_pcie_conf_address(pcie, bdf, offset);
-
-       switch (size) {
-       case PCI_SIZE_8:
-               *valuep = readb(address);
-               return 0;
-       case PCI_SIZE_16:
-               *valuep = readw(address);
-               return 0;
-       case PCI_SIZE_32:
-               *valuep = readl(address);
-               return 0;
-       default:
-               return -EINVAL;
-       }
+       return pci_generic_mmap_read_config(bus, ls_pcie_conf_address,
+                                           bdf, offset, valuep, size);
 }
 
 static int ls_pcie_write_config(struct udevice *bus, pci_dev_t bdf,
                                uint offset, ulong value,
                                enum pci_size_t size)
 {
-       struct ls_pcie *pcie = dev_get_priv(bus);
-       void *address;
-
-       if (ls_pcie_addr_valid(pcie, bdf))
-               return 0;
-
-       address = ls_pcie_conf_address(pcie, bdf, offset);
-
-       switch (size) {
-       case PCI_SIZE_8:
-               writeb(value, address);
-               return 0;
-       case PCI_SIZE_16:
-               writew(value, address);
-               return 0;
-       case PCI_SIZE_32:
-               writel(value, address);
-               return 0;
-       default:
-               return -EINVAL;
-       }
+       return pci_generic_mmap_write_config(bus, ls_pcie_conf_address,
+                                            bdf, offset, value, size);
 }
 
 /* Clear multi-function bit */
index 9e6c2f5dfcf62e8b06935aa9ae3c40a734f9571d..3dae20103da64a95d5ec230265fd915b5b88b36d 100644 (file)
@@ -130,19 +130,28 @@ static void fdt_pcie_set_iommu_map_entry(void *blob, struct ls_pcie *pcie,
        u32 iommu_map[4];
        int nodeoffset;
        int lenp;
+       uint svr;
+       char *compat = NULL;
 
        /* find pci controller node */
        nodeoffset = fdt_node_offset_by_compat_reg(blob, "fsl,ls-pcie",
                                                   pcie->dbi_res.start);
        if (nodeoffset < 0) {
 #ifdef CONFIG_FSL_PCIE_COMPAT /* Compatible with older version of dts node */
-               nodeoffset = fdt_node_offset_by_compat_reg(blob,
-                               CONFIG_FSL_PCIE_COMPAT, pcie->dbi_res.start);
+               svr = (get_svr() >> SVR_VAR_PER_SHIFT) & 0xFFFFFE;
+               if (svr == SVR_LS2088A || svr == SVR_LS2084A ||
+                   svr == SVR_LS2048A || svr == SVR_LS2044A ||
+                   svr == SVR_LS2081A || svr == SVR_LS2041A)
+                       compat = "fsl,ls2088a-pcie";
+               else
+                       compat = CONFIG_FSL_PCIE_COMPAT;
+
+               if (compat)
+                       nodeoffset = fdt_node_offset_by_compat_reg(blob,
+                                               compat, pcie->dbi_res.start);
+#endif
                if (nodeoffset < 0)
                        return;
-#else
-               return;
-#endif
        }
 
        /* get phandle to iommu controller */
index 4ba32df516996b1725eddfdb2e23f218c3538202..57112f5333e3ed4bf921be86b53cfac1b359e289 100644 (file)
@@ -41,7 +41,7 @@ static bool pcie_xilinx_link_up(struct xilinx_pcie *pcie)
 
 /**
  * pcie_xilinx_config_address() - Calculate the address of a config access
- * @pcie: Pointer to the PCI controller state
+ * @udev: Pointer to the PCI bus
  * @bdf: Identifies the PCIe device to access
  * @offset: The offset into the device's configuration space
  * @paddress: Pointer to the pointer to write the calculates address to
@@ -55,9 +55,10 @@ static bool pcie_xilinx_link_up(struct xilinx_pcie *pcie)
  *
  * Return: 0 on success, else -ENODEV
  */
-static int pcie_xilinx_config_address(struct xilinx_pcie *pcie, pci_dev_t bdf,
+static int pcie_xilinx_config_address(struct udevice *udev, pci_dev_t bdf,
                                      uint offset, void **paddress)
 {
+       struct xilinx_pcie *pcie = dev_get_priv(udev);
        unsigned int bus = PCI_BUS(bdf);
        unsigned int dev = PCI_DEV(bdf);
        unsigned int func = PCI_FUNC(bdf);
@@ -101,29 +102,8 @@ static int pcie_xilinx_read_config(struct udevice *bus, pci_dev_t bdf,
                                   uint offset, ulong *valuep,
                                   enum pci_size_t size)
 {
-       struct xilinx_pcie *pcie = dev_get_priv(bus);
-       void *address;
-       int err;
-
-       err = pcie_xilinx_config_address(pcie, bdf, offset, &address);
-       if (err < 0) {
-               *valuep = pci_get_ff(size);
-               return 0;
-       }
-
-       switch (size) {
-       case PCI_SIZE_8:
-               *valuep = __raw_readb(address);
-               return 0;
-       case PCI_SIZE_16:
-               *valuep = __raw_readw(address);
-               return 0;
-       case PCI_SIZE_32:
-               *valuep = __raw_readl(address);
-               return 0;
-       default:
-               return -EINVAL;
-       }
+       return pci_generic_mmap_read_config(bus, pcie_xilinx_config_address,
+                                           bdf, offset, valuep, size);
 }
 
 /**
@@ -144,27 +124,8 @@ static int pcie_xilinx_write_config(struct udevice *bus, pci_dev_t bdf,
                                    uint offset, ulong value,
                                    enum pci_size_t size)
 {
-       struct xilinx_pcie *pcie = dev_get_priv(bus);
-       void *address;
-       int err;
-
-       err = pcie_xilinx_config_address(pcie, bdf, offset, &address);
-       if (err < 0)
-               return 0;
-
-       switch (size) {
-       case PCI_SIZE_8:
-               __raw_writeb(value, address);
-               return 0;
-       case PCI_SIZE_16:
-               __raw_writew(value, address);
-               return 0;
-       case PCI_SIZE_32:
-               __raw_writel(value, address);
-               return 0;
-       default:
-               return -EINVAL;
-       }
+       return pci_generic_mmap_write_config(bus, pcie_xilinx_config_address,
+                                            bdf, offset, value, size);
 }
 
 /**
@@ -187,7 +148,7 @@ static int pcie_xilinx_ofdata_to_platdata(struct udevice *dev)
        err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
                               0, &reg_res);
        if (err < 0) {
-               error("\"reg\" resource not found\n");
+               pr_err("\"reg\" resource not found\n");
                return err;
        }
 
index 3ac405a9be6ee44c87cb8139d255cf084ca028f1..37187885fa05e3248e97ff296f6c5d1e675a60bd 100644 (file)
@@ -509,7 +509,7 @@ static int comphy_pcie_power_up(u32 lane, u32 pcie_width, bool clk_src,
                                debug("Read from reg = %p - value = 0x%x\n",
                                      hpipe_addr + HPIPE_LANE_STATUS1_REG,
                                      data);
-                               error("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n");
+                               pr_err("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n");
                                ret = 0;
                        }
                }
@@ -633,7 +633,7 @@ static int comphy_usb3_power_up(u32 lane, void __iomem *hpipe_base,
        if (data != 0) {
                debug("Read from reg = %p - value = 0x%x\n",
                      hpipe_addr + HPIPE_LANE_STATUS1_REG, data);
-               error("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n");
+               pr_err("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n");
                ret = 0;
        }
 
@@ -666,14 +666,14 @@ static int comphy_sata_power_up(u32 lane, void __iomem *hpipe_base,
                        gd->fdt_blob, sata_node, "marvell,armada-8k-ahci");
 
        if (sata_node == 0) {
-               error("SATA node not found in FDT\n");
+               pr_err("SATA node not found in FDT\n");
                return 0;
        }
 
        sata_base = (void __iomem *)fdtdec_get_addr_size_auto_noparent(
                gd->fdt_blob, sata_node, "reg", 0, NULL, true);
        if (sata_base == NULL) {
-               error("SATA address not found in FDT\n");
+               pr_err("SATA address not found in FDT\n");
                return 0;
        }
 
@@ -976,7 +976,7 @@ static int comphy_sata_power_up(u32 lane, void __iomem *hpipe_base,
        if (data != 0) {
                debug("Read from reg = %p - value = 0x%x\n",
                      hpipe_addr + HPIPE_LANE_STATUS1_REG, data);
-               error("SD_EXTERNAL_STATUS0_PLL_TX is %d, SD_EXTERNAL_STATUS0_PLL_RX is %d\n",
+               pr_err("SD_EXTERNAL_STATUS0_PLL_TX is %d, SD_EXTERNAL_STATUS0_PLL_RX is %d\n",
                      (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK),
                      (data & SD_EXTERNAL_STATUS0_PLL_RX_MASK));
                ret = 0;
@@ -1099,7 +1099,7 @@ static int comphy_sgmii_power_up(u32 lane, u32 sgmii_speed,
        if (data != 0) {
                debug("Read from reg = %p - value = 0x%x\n",
                      sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
-               error("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
+               pr_err("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
                      (data & SD_EXTERNAL_STATUS0_PLL_RX_MASK),
                      (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK));
                ret = 0;
@@ -1117,7 +1117,7 @@ static int comphy_sgmii_power_up(u32 lane, u32 sgmii_speed,
        data = polling_with_timeout(addr, data, mask, 100);
        if (data != 0) {
                debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
-               error("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
+               pr_err("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
                ret = 0;
        }
 
@@ -1398,7 +1398,7 @@ static int comphy_sfi_power_up(u32 lane, void __iomem *hpipe_base,
        data = polling_with_timeout(addr, data, mask, 15000);
        if (data != 0) {
                debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
-               error("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
+               pr_err("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
                      (data & SD_EXTERNAL_STATUS0_PLL_RX_MASK),
                      (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK));
                ret = 0;
@@ -1418,7 +1418,7 @@ static int comphy_sfi_power_up(u32 lane, void __iomem *hpipe_base,
        if (data != 0) {
                debug("Read from reg = %p - value = 0x%x\n",
                      sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
-               error("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
+               pr_err("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
                ret = 0;
        }
 
@@ -1577,7 +1577,7 @@ static int comphy_rxauii_power_up(u32 lane, void __iomem *hpipe_base,
        if (data != 0) {
                debug("Read from reg = %p - value = 0x%x\n",
                      sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
-               error("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
+               pr_err("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
                      (data & SD_EXTERNAL_STATUS0_PLL_RX_MASK),
                      (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK));
                ret = 0;
@@ -1596,7 +1596,7 @@ static int comphy_rxauii_power_up(u32 lane, void __iomem *hpipe_base,
        if (data != 0) {
                debug("Read from reg = %p - value = 0x%x\n",
                      sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
-               error("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
+               pr_err("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
                ret = 0;
        }
 
@@ -1742,7 +1742,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr,
        mask = data;
        data = polling_with_timeout(addr, data, mask, 100);
        if (data != 0) {
-               error("Impedance calibration is not done\n");
+               pr_err("Impedance calibration is not done\n");
                debug("Read from reg = %p - value = 0x%x\n", addr, data);
                ret = 0;
        }
@@ -1751,7 +1751,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr,
        mask = data;
        data = polling_with_timeout(addr, data, mask, 100);
        if (data != 0) {
-               error("PLL calibration is not done\n");
+               pr_err("PLL calibration is not done\n");
                debug("Read from reg = %p - value = 0x%x\n", addr, data);
                ret = 0;
        }
@@ -1761,7 +1761,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr,
        mask = data;
        data = polling_with_timeout(addr, data, mask, 100);
        if (data != 0) {
-               error("PLL is not ready\n");
+               pr_err("PLL is not ready\n");
                debug("Read from reg = %p - value = 0x%x\n", addr, data);
                ret = 0;
        }
@@ -1818,7 +1818,7 @@ static void comphy_utmi_phy_init(u32 utmi_phy_count,
                                          cp110_utmi_data[i].usb_cfg_addr,
                                          cp110_utmi_data[i].utmi_cfg_addr,
                                          cp110_utmi_data[i].utmi_phy_port)) {
-                       error("Failed to initialize UTMI PHY %d\n", i);
+                       pr_err("Failed to initialize UTMI PHY %d\n", i);
                        continue;
                }
                printf("UTMI PHY %d initialized to ", i);
@@ -1864,7 +1864,7 @@ void comphy_dedicated_phys_init(void)
                        (void __iomem *)fdtdec_get_addr_size_auto_noparent(
                                gd->fdt_blob, node, "reg", 0, NULL, true);
                if (cp110_utmi_data[i].utmi_base_addr == NULL) {
-                       error("UTMI PHY base address is invalid\n");
+                       pr_err("UTMI PHY base address is invalid\n");
                        i++;
                        continue;
                }
@@ -1874,7 +1874,7 @@ void comphy_dedicated_phys_init(void)
                        (void __iomem *)fdtdec_get_addr_size_auto_noparent(
                                gd->fdt_blob, node, "reg", 1, NULL, true);
                if (cp110_utmi_data[i].usb_cfg_addr == NULL) {
-                       error("UTMI PHY base address is invalid\n");
+                       pr_err("UTMI PHY base address is invalid\n");
                        i++;
                        continue;
                }
@@ -1884,7 +1884,7 @@ void comphy_dedicated_phys_init(void)
                        (void __iomem *)fdtdec_get_addr_size_auto_noparent(
                                gd->fdt_blob, node, "reg", 2, NULL, true);
                if (cp110_utmi_data[i].utmi_cfg_addr == NULL) {
-                       error("UTMI PHY base address is invalid\n");
+                       pr_err("UTMI PHY base address is invalid\n");
                        i++;
                        continue;
                }
@@ -1896,7 +1896,7 @@ void comphy_dedicated_phys_init(void)
                cp110_utmi_data[i].utmi_phy_port = fdtdec_get_int(
                        gd->fdt_blob, node, "utmi-port", UTMI_PHY_INVALID);
                if (cp110_utmi_data[i].utmi_phy_port == UTMI_PHY_INVALID) {
-                       error("UTMI PHY port type is invalid\n");
+                       pr_err("UTMI PHY port type is invalid\n");
                        i++;
                        continue;
                }
@@ -2049,7 +2049,7 @@ int comphy_cp110_init(struct chip_serdes_phy_config *ptr_chip_cfg,
                         * PHY_TYPE_UNCONNECTED state.
                         */
                        ptr_comphy_map->type = PHY_TYPE_UNCONNECTED;
-                       error("PLL is not locked - Failed to initialize lane %d\n",
+                       pr_err("PLL is not locked - Failed to initialize lane %d\n",
                              lane);
                }
        }
index 0e0b1c02d2e1a102f89c5bc89c3063ac7dac26c4..88fcfbb3e5b9832c001d27babb1847f2620be343 100644 (file)
@@ -47,13 +47,13 @@ static int sti_usb_phy_deassert(struct sti_usb_phy *phy)
 
        ret = reset_deassert(&phy->global_ctl);
        if (ret < 0) {
-               error("PHY global deassert failed: %d", ret);
+               pr_err("PHY global deassert failed: %d", ret);
                return ret;
        }
 
        ret = reset_deassert(&phy->port_ctl);
        if (ret < 0)
-               error("PHY port deassert failed: %d", ret);
+               pr_err("PHY port deassert failed: %d", ret);
 
        return ret;
 }
@@ -85,13 +85,13 @@ static int sti_usb_phy_exit(struct phy *usb_phy)
 
        ret = reset_assert(&phy->port_ctl);
        if (ret < 0) {
-               error("PHY port assert failed: %d", ret);
+               pr_err("PHY port assert failed: %d", ret);
                return ret;
        }
 
        ret = reset_assert(&phy->global_ctl);
        if (ret < 0)
-               error("PHY global assert failed: %d", ret);
+               pr_err("PHY global assert failed: %d", ret);
 
        return ret;
 }
@@ -114,20 +114,20 @@ int sti_usb_phy_probe(struct udevice *dev)
                                         &syscfg_phandle);
 
        if (ret < 0) {
-               error("Can't get syscfg phandle: %d\n", ret);
+               pr_err("Can't get syscfg phandle: %d\n", ret);
                return ret;
        }
 
        ret = uclass_get_device_by_ofnode(UCLASS_SYSCON, syscfg_phandle.node,
                                          &syscon);
        if (ret) {
-               error("unable to find syscon device (%d)\n", ret);
+               pr_err("unable to find syscon device (%d)\n", ret);
                return ret;
        }
 
        priv->regmap = syscon_get_regmap(syscon);
        if (!priv->regmap) {
-               error("unable to find regmap\n");
+               pr_err("unable to find regmap\n");
                return -ENODEV;
        }
 
@@ -137,12 +137,12 @@ int sti_usb_phy_probe(struct udevice *dev)
                                           ARRAY_SIZE(cells));
 
        if (count < 0) {
-               error("Bad PHY st,syscfg property %d\n", count);
+               pr_err("Bad PHY st,syscfg property %d\n", count);
                return -EINVAL;
        }
 
        if (count > PHYPARAM_NB) {
-               error("Unsupported PHY param count %d\n", count);
+               pr_err("Unsupported PHY param count %d\n", count);
                return -EINVAL;
        }
 
@@ -152,14 +152,14 @@ int sti_usb_phy_probe(struct udevice *dev)
        /* get global reset control */
        ret = reset_get_by_name(dev, "global", &priv->global_ctl);
        if (ret) {
-               error("can't get global reset for %s (%d)", dev->name, ret);
+               pr_err("can't get global reset for %s (%d)", dev->name, ret);
                return ret;
        }
 
        /* get port reset control */
        ret = reset_get_by_name(dev, "port", &priv->port_ctl);
        if (ret) {
-               error("can't get port reset for %s (%d)", dev->name, ret);
+               pr_err("can't get port reset for %s (%d)", dev->name, ret);
                return ret;
        }
 
index 680e32f3ea6f46fa687ef2fd247af90fd4eae26f..babf2ffe393e602e4d1a06827c8638786a801aeb 100644 (file)
@@ -261,7 +261,7 @@ static int pipe3_exit(struct phy *phy)
        } while (--timeout);
 
        if (!(val & PLL_TICOPWDN) || !(val & PLL_LDOPWDN)) {
-               error("%s: Failed to power down DPLL: PLL_STATUS 0x%x\n",
+               pr_err("%s: Failed to power down DPLL: PLL_STATUS 0x%x\n",
                      __func__, val);
                return -EBUSY;
        }
@@ -284,14 +284,14 @@ static void *get_reg(struct udevice *dev, const char *name)
        err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
                                           name, &syscon);
        if (err) {
-               error("unable to find syscon device for %s (%d)\n",
+               pr_err("unable to find syscon device for %s (%d)\n",
                      name, err);
                return NULL;
        }
 
        regmap = syscon_get_regmap(syscon);
        if (IS_ERR(regmap)) {
-               error("unable to find regmap for %s (%ld)\n",
+               pr_err("unable to find regmap for %s (%ld)\n",
                      name, PTR_ERR(regmap));
                return NULL;
        }
@@ -299,7 +299,7 @@ static void *get_reg(struct udevice *dev, const char *name)
        cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), name,
                           &len);
        if (len < 2*sizeof(fdt32_t)) {
-               error("offset not available for %s\n", name);
+               pr_err("offset not available for %s\n", name);
                return NULL;
        }
 
@@ -318,13 +318,13 @@ static int pipe3_phy_probe(struct udevice *dev)
 
        addr = devfdt_get_addr_size_index(dev, 2, &sz);
        if (addr == FDT_ADDR_T_NONE) {
-               error("missing pll ctrl address\n");
+               pr_err("missing pll ctrl address\n");
                return -EINVAL;
        }
 
        pipe3->pll_ctrl_base = map_physmem(addr, sz, MAP_NOCACHE);
        if (!pipe3->pll_ctrl_base) {
-               error("unable to remap pll ctrl\n");
+               pr_err("unable to remap pll ctrl\n");
                return -EINVAL;
        }
 
index 27165b0007739b04785976e3d25d969076436ca9..2bf853eba13d237d3c6882daae08128fdb18e815 100644 (file)
@@ -578,7 +578,7 @@ int armada_37xx_pinctrl_probe(struct udevice *dev)
 
        info->base = (void __iomem *)devfdt_get_addr(dev);
        if (!info->base) {
-               error("unable to find regmap\n");
+               pr_err("unable to find regmap\n");
                return -ENODEV;
        }
 
index 40341b4eeb756e0ce7725484c0f867d1cfdbfe13..735e412f608e6682c1d5048f613f507a27ca4edf 100644 (file)
@@ -142,7 +142,7 @@ void sti_pin_configure(struct udevice *dev, struct sti_pin_desc *pin_desc)
                break;
 
        default:
-               error("%s invalid direction value: 0x%x\n",
+               pr_err("%s invalid direction value: 0x%x\n",
                      __func__, pin_desc->dir);
                BUG();
                break;
@@ -237,14 +237,14 @@ static int sti_pinctrl_set_state(struct udevice *dev, struct udevice *config)
                                                     prop_name, "#gpio-cells",
                                                     0, 0, &args);
                if (ret < 0) {
-                       error("Can't get the gpio bank phandle: %d\n", ret);
+                       pr_err("Can't get the gpio bank phandle: %d\n", ret);
                        return ret;
                }
 
                bank_name = fdt_getprop(blob, args.node, "st,bank-name",
                                        &count);
                if (count < 0) {
-                       error("Can't find bank-name property %d\n", count);
+                       pr_err("Can't find bank-name property %d\n", count);
                        return -EINVAL;
                }
 
@@ -254,12 +254,12 @@ static int sti_pinctrl_set_state(struct udevice *dev, struct udevice *config)
                                                   prop_name, cells,
                                                   ARRAY_SIZE(cells));
                if (count < 0) {
-                       error("Bad pin configuration array %d\n", count);
+                       pr_err("Bad pin configuration array %d\n", count);
                        return -EINVAL;
                }
 
                if (count > MAX_STI_PINCONF_ENTRIES) {
-                       error("Unsupported pinconf array count %d\n", count);
+                       pr_err("Unsupported pinconf array count %d\n", count);
                        return -EINVAL;
                }
 
@@ -284,13 +284,13 @@ static int sti_pinctrl_probe(struct udevice *dev)
        err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
                                           "st,syscfg", &syscon);
        if (err) {
-               error("unable to find syscon device\n");
+               pr_err("unable to find syscon device\n");
                return err;
        }
 
        plat->regmap = syscon_get_regmap(syscon);
        if (!plat->regmap) {
-               error("unable to find regmap\n");
+               pr_err("unable to find regmap\n");
                return -ENODEV;
        }
 
index bf2a86c6364bc61f94f5b9bbfe2256e42f1f410e..51fdfb3851cac3c9ca6b15ce5596823a9122151d 100644 (file)
@@ -160,7 +160,7 @@ static int stm32_pinctrl_set_state_simple(struct udevice *dev,
 
                config_node = fdt_node_offset_by_phandle(fdt, phandle);
                if (config_node < 0) {
-                       error("prop pinctrl-0 index %d invalid phandle\n", i);
+                       pr_err("prop pinctrl-0 index %d invalid phandle\n", i);
                        return -EINVAL;
                }
 
index b1f570416425390a2570534de06cdb803962a30b..25249e377a6459ac58e4ebe7a582621322863e37 100644 (file)
@@ -208,6 +208,29 @@ enum {
        GPIO2A0_FLASH_CSN0      = (1 << GPIO2A0_SHIFT),
 };
 
+/*GRF_GPIO2B_IOMUX*/
+enum {
+       GPIO2B3_SHIFT           = 6,
+       GPIO2B3_MASK            = GENMASK(GPIO2B3_SHIFT + 1, GPIO2B3_SHIFT),
+       GPIO2B3_GPIO            = 0,
+       GPIO2B3_SDMMC0_DTECTN   = (1 << GPIO2B3_SHIFT),
+
+       GPIO2B2_SHIFT           = 4,
+       GPIO2B2_MASK            = GENMASK(GPIO2B2_SHIFT + 1, GPIO2B2_SHIFT),
+       GPIO2B2_GPIO            = 0,
+       GPIO2B2_SDMMC0_CMD      = (1 << GPIO2B2_SHIFT),
+
+       GPIO2B1_SHIFT           = 2,
+       GPIO2B1_MASK            = GENMASK(GPIO2B1_SHIFT + 1, GPIO2B1_SHIFT),
+       GPIO2B1_GPIO            = 0,
+       GPIO2B1_SDMMC0_CLKOUT   = (1 << GPIO2B1_SHIFT),
+
+       GPIO2B0_SHIFT           = 0,
+       GPIO2B0_MASK            = GENMASK(GPIO2B0_SHIFT + 1, GPIO2B0_SHIFT),
+       GPIO2B0_GPIO            = 0,
+       GPIO2B0_SDMMC0_D3       = (1 << GPIO2B0_SHIFT),
+};
+
 /*GRF_GPIO2D_IOMUX*/
 enum {
        GPIO2D7_SHIFT           = 14,
@@ -580,11 +603,17 @@ static void pinctrl_rk3368_sdmmc_config(struct rk3368_grf *grf, int mmc_id)
                             GPIO2A4_EMMC_CLKOUT);
                break;
        case PERIPH_ID_SDCARD:
-               /*
-                * We assume that the BROM has already set this up
-                * correctly for us and that there's nothing to do
-                * here.
-                */
+               debug("mmc id = %d setting registers!\n", mmc_id);
+               rk_clrsetreg(&grf->gpio2a_iomux,
+                            GPIO2A5_MASK | GPIO2A7_MASK |
+                            GPIO2A7_MASK,
+                            GPIO2A5_SDMMC0_D0 | GPIO2A6_SDMMC0_D1 |
+                            GPIO2A7_SDMMC0_D2);
+               rk_clrsetreg(&grf->gpio2b_iomux,
+                            GPIO2B0_MASK | GPIO2B1_MASK |
+                            GPIO2B2_MASK | GPIO2B3_MASK,
+                            GPIO2B0_SDMMC0_D3 | GPIO2B1_SDMMC0_CLKOUT |
+                            GPIO2B2_SDMMC0_CMD | GPIO2B3_SDMMC0_DTECTN);
                break;
        default:
                debug("mmc id = %d iomux error!\n", mmc_id);
index 4efe8ee183d5b292ea3a35d0e87a8826a8d5ebf4..3b0427e0b9186f464dcc9d82fc34006bfd423f04 100644 (file)
@@ -46,14 +46,14 @@ static int as3722_read_id(struct udevice *dev, uint *idp, uint *revisionp)
 
        ret = pmic_reg_read(dev, AS3722_ASIC_ID1);
        if (ret < 0) {
-               error("failed to read ID1 register: %d", ret);
+               pr_err("failed to read ID1 register: %d", ret);
                return ret;
        }
        *idp = ret;
 
        ret = pmic_reg_read(dev, AS3722_ASIC_ID2);
        if (ret < 0) {
-               error("failed to read ID2 register: %d", ret);
+               pr_err("failed to read ID2 register: %d", ret);
                return ret;
        }
        *revisionp = ret;
@@ -71,7 +71,7 @@ int as3722_sd_set_voltage(struct udevice *dev, unsigned int sd, u8 value)
 
        ret = pmic_reg_write(dev, AS3722_SD_VOLTAGE(sd), value);
        if (ret < 0) {
-               error("failed to write SD%u voltage register: %d", sd, ret);
+               pr_err("failed to write SD%u voltage register: %d", sd, ret);
                return ret;
        }
 
@@ -87,7 +87,7 @@ int as3722_ldo_set_voltage(struct udevice *dev, unsigned int ldo, u8 value)
 
        ret = pmic_reg_write(dev, AS3722_LDO_VOLTAGE(ldo), value);
        if (ret < 0) {
-               error("failed to write LDO%u voltage register: %d", ldo,
+               pr_err("failed to write LDO%u voltage register: %d", ldo,
                      ret);
                return ret;
        }
@@ -102,12 +102,12 @@ static int as3722_probe(struct udevice *dev)
 
        ret = as3722_read_id(dev, &id, &revision);
        if (ret < 0) {
-               error("failed to read ID: %d", ret);
+               pr_err("failed to read ID: %d", ret);
                return ret;
        }
 
        if (id != AS3722_DEVICE_ID) {
-               error("unknown device");
+               pr_err("unknown device");
                return -ENOENT;
        }
 
index d0b681ca4ab939559077458639ac239c5d186421..5cf4cb6b518efde6d221c08d4f2c6f6889c6f75a 100644 (file)
@@ -26,7 +26,7 @@ int as3722_gpio_configure(struct udevice *pmic, unsigned int gpio,
 
        err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value);
        if (err) {
-               error("failed to configure GPIO#%u: %d", gpio, err);
+               pr_err("failed to configure GPIO#%u: %d", gpio, err);
                return err;
        }
 
@@ -46,7 +46,7 @@ static int as3722_gpio_set_value(struct udevice *dev, unsigned int gpio,
 
        err = pmic_reg_read(pmic, AS3722_GPIO_SIGNAL_OUT);
        if (err < 0) {
-               error("failed to read GPIO signal out register: %d", err);
+               pr_err("failed to read GPIO signal out register: %d", err);
                return err;
        }
        value = err;
@@ -61,7 +61,7 @@ static int as3722_gpio_set_value(struct udevice *dev, unsigned int gpio,
 
        err = pmic_reg_write(pmic, AS3722_GPIO_SIGNAL_OUT, value);
        if (err) {
-               error("failed to set GPIO#%u %s: %d", gpio, l, err);
+               pr_err("failed to set GPIO#%u %s: %d", gpio, l, err);
                return err;
        }
 
@@ -84,13 +84,13 @@ int as3722_gpio_direction_output(struct udevice *dev, unsigned int gpio,
 
        err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value);
        if (err) {
-               error("failed to configure GPIO#%u as output: %d", gpio, err);
+               pr_err("failed to configure GPIO#%u as output: %d", gpio, err);
                return err;
        }
 
        err = as3722_gpio_set_value(pmic, gpio, value);
        if (err < 0) {
-               error("failed to set GPIO#%u high: %d", gpio, err);
+               pr_err("failed to set GPIO#%u high: %d", gpio, err);
                return err;
        }
 
index 2d35d09d454cc0dff05bca46cac343615e9a05db..38a2a04f177660da2777b8604d8317b643db6f8c 100644 (file)
@@ -31,7 +31,7 @@ static int sandbox_i2c_pmic_read_data(struct udevice *emul, uchar chip,
        struct sandbox_i2c_pmic_plat_data *plat = dev_get_platdata(emul);
 
        if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) {
-               error("Request exceeds PMIC register range! Max register: %#x",
+               pr_err("Request exceeds PMIC register range! Max register: %#x",
                      SANDBOX_PMIC_REG_COUNT);
                return -EFAULT;
        }
@@ -68,7 +68,7 @@ static int sandbox_i2c_pmic_write_data(struct udevice *emul, uchar chip,
        len--;
 
        if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) {
-               error("Request exceeds PMIC register range! Max register: %#x",
+               pr_err("Request exceeds PMIC register range! Max register: %#x",
                      SANDBOX_PMIC_REG_COUNT);
        }
 
@@ -111,7 +111,7 @@ static int sandbox_i2c_pmic_ofdata_to_platdata(struct udevice *emul)
                                             SANDBOX_PMIC_REG_COUNT);
 
        if (!reg_defaults) {
-               error("Property \"reg-defaults\" not found for device: %s!",
+               pr_err("Property \"reg-defaults\" not found for device: %s!",
                      emul->name);
                return -EINVAL;
        }
index f5054683139a0a523f15ac71800bb977ad1dccca..95c2b7e8c74ce600685a51bf78fcd4a73c573615 100644 (file)
@@ -27,7 +27,7 @@ static int lp873x_write(struct udevice *dev, uint reg, const uint8_t *buff,
                          int len)
 {
        if (dm_i2c_write(dev, reg, buff, len)) {
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
@@ -37,7 +37,7 @@ static int lp873x_write(struct udevice *dev, uint reg, const uint8_t *buff,
 static int lp873x_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 {
        if (dm_i2c_read(dev, reg, buff, len)) {
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
index 782a46c4cc31d13e8e32ca3ecca48ab222754681..506769e362673608b27aee1358a76b544e8d14b5 100644 (file)
@@ -29,7 +29,7 @@ static int lp87565_write(struct udevice *dev, uint reg, const uint8_t *buff,
 
        ret = dm_i2c_write(dev, reg, buff, len);
        if (ret)
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
 
        return ret;
 }
@@ -40,7 +40,7 @@ static int lp87565_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 
        ret = dm_i2c_read(dev, reg, buff, len);
        if (ret)
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
 
        return ret;
 }
index ceca9f96a7f3c237ecd96a8bb24029aad79a9ef9..b3ed84992ff8a21db37f6d656c5e12599f9919c4 100644 (file)
@@ -31,7 +31,7 @@ static int max77686_write(struct udevice *dev, uint reg, const uint8_t *buff,
                          int len)
 {
        if (dm_i2c_write(dev, reg, buff, len)) {
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
@@ -41,7 +41,7 @@ static int max77686_write(struct udevice *dev, uint reg, const uint8_t *buff,
 static int max77686_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 {
        if (dm_i2c_read(dev, reg, buff, len)) {
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
index f749d7debfc3314be2028739e34fd10f7c9df413..5ebeb8a316be0f1ba1c8641aa58144f8c817f015 100644 (file)
@@ -26,7 +26,7 @@ static int max8997_write(struct udevice *dev, uint reg, const uint8_t *buff,
 
        ret = dm_i2c_write(dev, reg, buff, len);
        if (ret)
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
 
        return ret;
 }
@@ -37,7 +37,7 @@ static int max8997_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 
        ret = dm_i2c_read(dev, reg, buff, len);
        if (ret)
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
 
        return ret;
 }
index 7c4773c7b3aa7309fbe08776645eb26b61e3492e..a7e04699e8ba4212b0f4ebccf6655172af6b9790 100644 (file)
@@ -26,7 +26,7 @@ static int max8998_write(struct udevice *dev, uint reg, const uint8_t *buff,
 
        ret = dm_i2c_write(dev, reg, buff, len);
        if (ret)
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
 
        return ret;
 }
@@ -37,7 +37,7 @@ static int max8998_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 
        ret = dm_i2c_read(dev, reg, buff, len);
        if (ret)
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
 
        return ret;
 }
index 804c0d13a0c98bff39d7126f4cf1609bd984bcfa..1e1ecb382e3a9e87816ae009f510f2c9bff724c3 100644 (file)
@@ -27,7 +27,7 @@ static int palmas_write(struct udevice *dev, uint reg, const uint8_t *buff,
                          int len)
 {
        if (dm_i2c_write(dev, reg, buff, len)) {
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
@@ -37,7 +37,7 @@ static int palmas_write(struct udevice *dev, uint reg, const uint8_t *buff,
 static int palmas_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 {
        if (dm_i2c_read(dev, reg, buff, len)) {
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
index 5f361c7696f442cd053930b5ad738ae99a54c0c3..a06cbc07d491884089f91dd6daf40a378ad59878 100644 (file)
@@ -33,7 +33,7 @@ static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff,
                          int len)
 {
        if (dm_i2c_write(dev, reg, buff, len)) {
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
@@ -43,7 +43,7 @@ static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff,
 static int pfuze100_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 {
        if (dm_i2c_read(dev, reg, buff, len)) {
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
index 9d83059c403ab5e8fad52ab9a800eb646ecdcd11..522105e5ff05a0e9a14b2f31c75abd47bf4f9e0f 100644 (file)
@@ -27,7 +27,7 @@ static int s2mps11_write(struct udevice *dev, uint reg, const uint8_t *buff,
 
        ret = dm_i2c_write(dev, reg, buff, len);
        if (ret)
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
 
        return ret;
 }
@@ -38,7 +38,7 @@ static int s2mps11_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 
        ret = dm_i2c_read(dev, reg, buff, len);
        if (ret)
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
 
        return ret;
 }
index f8ae5ea2dba4c643072ea898159b44174218b086..3812e240ab085340b2ee932132690dce6dbe3041 100644 (file)
@@ -30,7 +30,7 @@ static int s5m8767_write(struct udevice *dev, uint reg, const uint8_t *buff,
                          int len)
 {
        if (dm_i2c_write(dev, reg, buff, len)) {
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
@@ -40,7 +40,7 @@ static int s5m8767_write(struct udevice *dev, uint reg, const uint8_t *buff,
 static int s5m8767_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 {
        if (dm_i2c_read(dev, reg, buff, len)) {
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
index 6763303c66710a6a7eaae73cb142a22c548d7714..e8d6faca160caf27ae3aecc84c11b8d13f4b8ea6 100644 (file)
@@ -31,7 +31,7 @@ static int sandbox_pmic_write(struct udevice *dev, uint reg,
                              const uint8_t *buff, int len)
 {
        if (dm_i2c_write(dev, reg, buff, len)) {
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
@@ -42,7 +42,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg,
                             uint8_t *buff, int len)
 {
        if (dm_i2c_read(dev, reg, buff, len)) {
-               error("read error from device: %p register: %#x!", dev, reg);
+               pr_err("read error from device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
@@ -52,7 +52,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg,
 static int sandbox_pmic_bind(struct udevice *dev)
 {
        if (!pmic_bind_children(dev, dev_ofnode(dev), pmic_children_info))
-               error("%s:%d PMIC: %s - no child found!", __func__, __LINE__,
+               pr_err("%s:%d PMIC: %s - no child found!", __func__, __LINE__,
                                                          dev->name);
 
        /* Always return success for this device - allows for PMIC I/O */
index 4565e3b54c1baf127f5838199a291fdb73ab3642..ee5358bcedc8f82da8f70204f723d363e3fce7f2 100644 (file)
@@ -29,7 +29,7 @@ static int tps65090_write(struct udevice *dev, uint reg, const uint8_t *buff,
                          int len)
 {
        if (dm_i2c_write(dev, reg, buff, len)) {
-               error("write error to device: %p register: %#x!", dev, reg);
+               pr_err("write error to device: %p register: %#x!", dev, reg);
                return -EIO;
        }
 
@@ -42,7 +42,7 @@ static int tps65090_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 
        ret = dm_i2c_read(dev, reg, buff, len);
        if (ret) {
-               error("read error %d from device: %p register: %#x!", ret, dev,
+               pr_err("read error %d from device: %p register: %#x!", ret, dev,
                      reg);
                return -EIO;
        }
index c82a936e8af3d30f7c57dc97c20a41aee7fdf8e3..8892fa14e0226868d1b1b88aec92d1258fbce76f 100644 (file)
@@ -77,6 +77,13 @@ config DM_REGULATOR_FIXED
        features for fixed value regulators. The driver implements get/set api
        for enable and get only for voltage value.
 
+config SPL_DM_REGULATOR_FIXED
+       bool "Enable Driver Model for REGULATOR Fixed value in SPL"
+       depends on DM_REGULATOR_FIXED
+       ---help---
+       This config enables implementation of driver-model regulator uclass
+       features for fixed value regulators in SPL.
+
 config DM_REGULATOR_GPIO
        bool "Enable Driver Model for GPIO REGULATOR"
        depends on DM_REGULATOR
@@ -151,6 +158,19 @@ config DM_REGULATOR_PALMAS
        features for REGULATOR PALMAS and the family of PALMAS PMICs.
        The driver implements get/set api for: value and enable.
 
+config DM_REGULATOR_PBIAS
+       bool "Enable driver for PBIAS regulator"
+       depends on DM_REGULATOR
+       select REGMAP
+       select SYSCON
+       ---help---
+       This enables implementation of driver-model regulator uclass
+       features for pseudo-regulator PBIAS found in the OMAP SOCs.
+       This pseudo-regulator is used to provide a BIAS voltage to MMC1
+       signal pads and must be configured properly during a voltage switch.
+       Voltage switching is required by some operating modes of SDcards and
+       eMMC.
+
 config DM_REGULATOR_LP873X
        bool "Enable driver for LP873X PMIC regulators"
         depends on PMIC_LP873X
index 18fb870e430ecce700a20bc18550a94e6abfdacb..6c149a9263473726578f461a9e4070d793e2c3a4 100644 (file)
@@ -18,5 +18,6 @@ obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
 obj-$(CONFIG_DM_REGULATOR_SANDBOX) += sandbox.o
 obj-$(CONFIG_REGULATOR_TPS65090) += tps65090_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_PALMAS) += palmas_regulator.o
+obj-$(CONFIG_$(SPL_)DM_REGULATOR_PBIAS) += pbias_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_LP873X) += lp873x_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_LP87565) += lp87565_regulator.o
index 35c292222b97eb8246af50dee64595a5a8620fb9..97b4a98bf0b63799ede846e15bfc0817493fe6d2 100644 (file)
@@ -117,7 +117,7 @@ static int fixed_regulator_set_enable(struct udevice *dev, bool enable)
 
        ret = dm_gpio_set_value(&dev_pdata->gpio, enable);
        if (ret) {
-               error("Can't set regulator : %s gpio to: %d\n", dev->name,
+               pr_err("Can't set regulator : %s gpio to: %d\n", dev->name,
                      enable);
                return ret;
        }
index 42391c69b4307bcf9eaf005570d56186db2469a6..1031a0362b676ff98cc92f653c6aefd2ef51c76f 100644 (file)
@@ -109,7 +109,7 @@ static int gpio_regulator_set_value(struct udevice *dev, int uV)
 
        ret = dm_gpio_set_value(&dev_pdata->gpio, enable);
        if (ret) {
-               error("Can't set regulator : %s gpio to: %d\n", dev->name,
+               pr_err("Can't set regulator : %s gpio to: %d\n", dev->name,
                      enable);
                return ret;
        }
index 8780806cff04fb810826645029d010552169549b..2212d36ed6a91a0324c93b29f9cc788c52717988 100644 (file)
@@ -98,7 +98,7 @@ static int max77686_buck_volt2hex(int buck, int uV)
        if (hex >= 0 && hex <= hex_max)
                return hex;
 
-       error("Value: %d uV is wrong for BUCK%d", uV, buck);
+       pr_err("Value: %d uV is wrong for BUCK%d", uV, buck);
        return -EINVAL;
 }
 
@@ -134,7 +134,7 @@ static int max77686_buck_hex2volt(int buck, int hex)
        return uV;
 
 bad_hex:
-       error("Value: %#x is wrong for BUCK%d", hex, buck);
+       pr_err("Value: %#x is wrong for BUCK%d", hex, buck);
        return -EINVAL;
 }
 
@@ -160,7 +160,7 @@ static int max77686_ldo_volt2hex(int ldo, int uV)
        if (hex >= 0 && hex <= MAX77686_LDO_VOLT_MAX_HEX)
                return hex;
 
-       error("Value: %d uV is wrong for LDO%d", uV, ldo);
+       pr_err("Value: %d uV is wrong for LDO%d", uV, ldo);
        return -EINVAL;
 }
 
@@ -189,7 +189,7 @@ static int max77686_ldo_hex2volt(int ldo, int hex)
        return uV;
 
 bad_hex:
-       error("Value: %#x is wrong for ldo%d", hex, ldo);
+       pr_err("Value: %#x is wrong for ldo%d", hex, ldo);
        return -EINVAL;
 }
 
@@ -328,7 +328,7 @@ static int max77686_ldo_val(struct udevice *dev, int op, int *uV)
 
        ldo = dev->driver_data;
        if (ldo < 1 || ldo > MAX77686_LDO_NUM) {
-               error("Wrong ldo number: %d", ldo);
+               pr_err("Wrong ldo number: %d", ldo);
                return -EINVAL;
        }
 
@@ -366,7 +366,7 @@ static int max77686_buck_val(struct udevice *dev, int op, int *uV)
 
        buck = dev->driver_data;
        if (buck < 1 || buck > MAX77686_BUCK_NUM) {
-               error("Wrong buck number: %d", buck);
+               pr_err("Wrong buck number: %d", buck);
                return -EINVAL;
        }
 
@@ -423,7 +423,7 @@ static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode)
 
        ldo = dev->driver_data;
        if (ldo < 1 || ldo > MAX77686_LDO_NUM) {
-               error("Wrong ldo number: %d", ldo);
+               pr_err("Wrong ldo number: %d", ldo);
                return -EINVAL;
        }
 
@@ -493,7 +493,7 @@ static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode)
        }
 
        if (mode == 0xff) {
-               error("Wrong mode: %d for ldo%d", *opmode, ldo);
+               pr_err("Wrong mode: %d for ldo%d", *opmode, ldo);
                return -EINVAL;
        }
 
@@ -545,7 +545,7 @@ static int max77686_buck_mode(struct udevice *dev, int op, int *opmode)
 
        buck = dev->driver_data;
        if (buck < 1 || buck > MAX77686_BUCK_NUM) {
-               error("Wrong buck number: %d", buck);
+               pr_err("Wrong buck number: %d", buck);
                return -EINVAL;
        }
 
@@ -614,7 +614,7 @@ static int max77686_buck_mode(struct udevice *dev, int op, int *opmode)
        }
 
        if (mode == 0xff) {
-               error("Wrong mode: %d for buck: %d\n", *opmode, buck);
+               pr_err("Wrong mode: %d for buck: %d\n", *opmode, buck);
                return -EINVAL;
        }
 
diff --git a/drivers/power/regulator/pbias_regulator.c b/drivers/power/regulator/pbias_regulator.c
new file mode 100644 (file)
index 0000000..116b7f4
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * (C) Copyright 2016 Texas Instruments Incorporated, <www.ti.com>
+ * Jean-Jacques Hiblot <jjhiblot@ti.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <dm.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+#include <regmap.h>
+#include <syscon.h>
+#include <linux/bitops.h>
+#include <linux/ioport.h>
+#include <dm/read.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct pbias_reg_info {
+       u32 enable;
+       u32 enable_mask;
+       u32 disable_val;
+       u32 vmode;
+       unsigned int enable_time;
+       char *name;
+};
+
+struct pbias_priv {
+       struct regmap *regmap;
+       int offset;
+};
+
+static const struct pmic_child_info pmic_children_info[] = {
+       { .prefix = "pbias", .driver = "pbias_regulator"},
+       { },
+};
+
+static int pbias_write(struct udevice *dev, uint reg, const uint8_t *buff,
+                      int len)
+{
+       struct pbias_priv *priv = dev_get_priv(dev);
+       u32 val = *(u32 *)buff;
+
+       if (len != 4)
+               return -EINVAL;
+
+       return regmap_write(priv->regmap, priv->offset, val);
+}
+
+static int pbias_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
+{
+       struct pbias_priv *priv = dev_get_priv(dev);
+
+       if (len != 4)
+               return -EINVAL;
+
+       return regmap_read(priv->regmap, priv->offset, (u32 *)buff);
+}
+
+static int pbias_ofdata_to_platdata(struct udevice *dev)
+{
+       struct pbias_priv *priv = dev_get_priv(dev);
+       struct udevice *syscon;
+       struct regmap *regmap;
+       struct resource res;
+       int err;
+
+       err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
+                                          "syscon", &syscon);
+       if (err) {
+               pr_err("%s: unable to find syscon device (%d)\n", __func__,
+                     err);
+               return err;
+       }
+
+       regmap = syscon_get_regmap(syscon);
+       if (IS_ERR(regmap)) {
+               pr_err("%s: unable to find regmap (%ld)\n", __func__,
+                     PTR_ERR(regmap));
+               return PTR_ERR(regmap);
+       }
+       priv->regmap = regmap;
+
+       err = dev_read_resource(dev, 0, &res);
+       if (err) {
+               pr_err("%s: unable to find offset (%d)\n", __func__, err);
+               return err;
+       }
+       priv->offset = res.start;
+
+       return 0;
+}
+
+static int pbias_bind(struct udevice *dev)
+{
+       int children;
+
+       children = pmic_bind_children(dev, dev->node, pmic_children_info);
+       if (!children)
+               debug("%s: %s - no child found\n", __func__, dev->name);
+
+       return 0;
+}
+
+static struct dm_pmic_ops pbias_ops = {
+       .read = pbias_read,
+       .write = pbias_write,
+};
+
+static const struct udevice_id pbias_ids[] = {
+       { .compatible = "ti,pbias-dra7" },
+       { }
+};
+
+U_BOOT_DRIVER(pbias_pmic) = {
+       .name = "pbias_pmic",
+       .id = UCLASS_PMIC,
+       .of_match = pbias_ids,
+       .bind = pbias_bind,
+       .ops = &pbias_ops,
+       .ofdata_to_platdata = pbias_ofdata_to_platdata,
+       .priv_auto_alloc_size = sizeof(struct pbias_priv),
+};
+
+static const struct pbias_reg_info pbias_mmc_omap2430 = {
+       .enable = BIT(1),
+       .enable_mask = BIT(1),
+       .vmode = BIT(0),
+       .disable_val = 0,
+       .enable_time = 100,
+       .name = "pbias_mmc_omap2430"
+};
+
+static const struct pbias_reg_info pbias_sim_omap3 = {
+       .enable = BIT(9),
+       .enable_mask = BIT(9),
+       .vmode = BIT(8),
+       .enable_time = 100,
+       .name = "pbias_sim_omap3"
+};
+
+static const struct pbias_reg_info pbias_mmc_omap4 = {
+       .enable = BIT(26) | BIT(22),
+       .enable_mask = BIT(26) | BIT(25) | BIT(22),
+       .disable_val = BIT(25),
+       .vmode = BIT(21),
+       .enable_time = 100,
+       .name = "pbias_mmc_omap4"
+};
+
+static const struct pbias_reg_info pbias_mmc_omap5 = {
+       .enable = BIT(27) | BIT(26),
+       .enable_mask = BIT(27) | BIT(25) | BIT(26),
+       .disable_val = BIT(25),
+       .vmode = BIT(21),
+       .enable_time = 100,
+       .name = "pbias_mmc_omap5"
+};
+
+static const struct pbias_reg_info *pbias_reg_infos[] = {
+       &pbias_mmc_omap5,
+       &pbias_mmc_omap4,
+       &pbias_sim_omap3,
+       &pbias_mmc_omap2430,
+       NULL
+};
+
+static int pbias_regulator_probe(struct udevice *dev)
+{
+       const struct pbias_reg_info **p = pbias_reg_infos;
+       struct dm_regulator_uclass_platdata *uc_pdata;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+
+       while (*p) {
+               int rc;
+
+               rc = dev_read_stringlist_search(dev, "regulator-name",
+                                               (*p)->name);
+               if (rc >= 0) {
+                       debug("found regulator %s\n", (*p)->name);
+                       break;
+               } else if (rc != -ENODATA) {
+                       return rc;
+               }
+               p++;
+       }
+       if (!*p) {
+               int i = 0;
+               const char *s;
+
+               debug("regulator ");
+               while (dev_read_string_index(dev, "regulator-name", i++, &s) >= 0)
+                       debug("%s'%s' ", (i > 1) ? ", " : "", s);
+               debug("%s not supported\n", (i > 2) ? "are" : "is");
+               return -EINVAL;
+       }
+
+       uc_pdata->type = REGULATOR_TYPE_OTHER;
+       dev->priv = (void *)*p;
+
+       return 0;
+}
+
+static int pbias_regulator_get_value(struct udevice *dev)
+{
+       const struct pbias_reg_info *p = dev_get_priv(dev);
+       int rc;
+       u32 reg;
+
+       rc = pmic_read(dev->parent, 0, (uint8_t *)&reg, sizeof(reg));
+       if (rc)
+               return rc;
+
+       debug("%s voltage id %s\n", p->name,
+             (reg & p->vmode) ? "3.0v" : "1.8v");
+       return (reg & p->vmode) ? 3000000 : 1800000;
+}
+
+static int pbias_regulator_set_value(struct udevice *dev, int uV)
+{
+       const struct pbias_reg_info *p = dev_get_priv(dev);
+       int rc;
+       u32 reg;
+
+       debug("Setting %s voltage to %s\n", p->name,
+             (reg & p->vmode) ? "3.0v" : "1.8v");
+
+       rc = pmic_read(dev->parent, 0, (uint8_t *)&reg, sizeof(reg));
+       if (rc)
+               return rc;
+
+       if (uV == 3000000)
+               reg |= p->vmode;
+       else if (uV == 1800000)
+               reg &= ~p->vmode;
+       else
+               return -EINVAL;
+
+       return pmic_write(dev->parent, 0, (uint8_t *)&reg, sizeof(reg));
+}
+
+static int pbias_regulator_get_enable(struct udevice *dev)
+{
+       const struct pbias_reg_info *p = dev_get_priv(dev);
+       int rc;
+       u32 reg;
+
+       rc = pmic_read(dev->parent, 0, (uint8_t *)&reg, sizeof(reg));
+       if (rc)
+               return rc;
+
+       debug("%s id %s\n", p->name,
+             (reg & p->enable_mask) == (p->disable_val) ? "on" : "off");
+
+       return (reg & p->enable_mask) == (p->disable_val);
+}
+
+static int pbias_regulator_set_enable(struct udevice *dev, bool enable)
+{
+       const struct pbias_reg_info *p = dev_get_priv(dev);
+       int rc;
+       u32 reg;
+
+       debug("Turning %s %s\n", enable ? "on" : "off", p->name);
+
+       rc = pmic_read(dev->parent, 0, (uint8_t *)&reg, sizeof(reg));
+       if (rc)
+               return rc;
+
+       reg &= ~p->enable_mask;
+       if (enable)
+               reg |= p->enable;
+       else
+               reg |= p->disable_val;
+
+       rc = pmic_write(dev->parent, 0, (uint8_t *)&reg, sizeof(reg));
+       if (rc)
+               return rc;
+
+       if (enable)
+               udelay(p->enable_time);
+
+       return 0;
+}
+
+static const struct dm_regulator_ops pbias_regulator_ops = {
+       .get_value  = pbias_regulator_get_value,
+       .set_value  = pbias_regulator_set_value,
+       .get_enable = pbias_regulator_get_enable,
+       .set_enable = pbias_regulator_set_enable,
+};
+
+U_BOOT_DRIVER(pbias_regulator) = {
+       .name = "pbias_regulator",
+       .id = UCLASS_REGULATOR,
+       .ops = &pbias_regulator_ops,
+       .probe = pbias_regulator_probe,
+};
index 06c09fd05151ce7b7ad0f7e638a310f6f54fef13..f980a17389ebbec62be112cdd442e99cb0812697 100644 (file)
@@ -87,7 +87,7 @@ int out_get_value(struct udevice *dev, int output_count, int reg_type,
        int ret;
 
        if (dev->driver_data > output_count) {
-               error("Unknown regulator number: %lu for PMIC %s!",
+               pr_err("Unknown regulator number: %lu for PMIC %s!",
                      dev->driver_data, dev->name);
                return -EINVAL;
        }
@@ -95,7 +95,7 @@ int out_get_value(struct udevice *dev, int output_count, int reg_type,
        reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type;
        ret = pmic_read(dev->parent, reg, &reg_val, 1);
        if (ret) {
-               error("PMIC read failed: %d\n",  ret);
+               pr_err("PMIC read failed: %d\n",  ret);
                return ret;
        }
 
@@ -115,14 +115,14 @@ static int out_set_value(struct udevice *dev, int output_count, int reg_type,
        int max_value;
 
        if (dev->driver_data > output_count) {
-               error("Unknown regulator number: %lu for PMIC %s!",
+               pr_err("Unknown regulator number: %lu for PMIC %s!",
                      dev->driver_data, dev->name);
                return -EINVAL;
        }
 
        max_value = range[dev->driver_data - 1].max;
        if (value > max_value) {
-               error("Wrong value for %s: %lu. Max is: %d.",
+               pr_err("Wrong value for %s: %lu. Max is: %d.",
                      dev->name, dev->driver_data, max_value);
                return -EINVAL;
        }
@@ -134,7 +134,7 @@ static int out_set_value(struct udevice *dev, int output_count, int reg_type,
        reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type;
        ret = pmic_write(dev->parent, reg, &reg_val, 1);
        if (ret) {
-               error("PMIC write failed: %d\n",  ret);
+               pr_err("PMIC write failed: %d\n",  ret);
                return ret;
        }
 
@@ -154,7 +154,7 @@ static int out_get_mode(struct udevice *dev)
        reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM;
        ret = pmic_read(dev->parent, reg, &reg_val, 1);
        if (ret) {
-               error("PMIC read failed: %d\n",  ret);
+               pr_err("PMIC read failed: %d\n",  ret);
                return ret;
        }
 
@@ -163,7 +163,7 @@ static int out_get_mode(struct udevice *dev)
                        return uc_pdata->mode[i].id;
        }
 
-       error("Unknown operation mode for %s!", dev->name);
+       pr_err("Unknown operation mode for %s!", dev->name);
        return -EINVAL;
 }
 
@@ -188,14 +188,14 @@ static int out_set_mode(struct udevice *dev, int mode)
        }
 
        if (reg_val == -1) {
-               error("Unknown operation mode for %s!", dev->name);
+               pr_err("Unknown operation mode for %s!", dev->name);
                return -EINVAL;
        }
 
        reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM;
        ret = pmic_write(dev->parent, reg, (uint8_t *)&reg_val, 1);
        if (ret) {
-               error("PMIC write failed: %d\n",  ret);
+               pr_err("PMIC write failed: %d\n",  ret);
                return ret;
        }
 
index b09d03c2c9d09bfbdf44d0f7afdebfd5c9139333..45b5fe724719ce74346b4dc7d15530add992f637 100644 (file)
@@ -5,3 +5,8 @@
 #
 
 obj-$(CONFIG_ROCKCHIP_RK3368) = dmc-rk3368.o
+obj-$(CONFIG_ROCKCHIP_RK3188) = sdram_rk3188.o
+obj-$(CONFIG_ROCKCHIP_RK322X) = sdram_rk322x.o
+obj-$(CONFIG_ROCKCHIP_RK3288) = sdram_rk3288.o
+obj-$(CONFIG_ROCKCHIP_RK3328) = sdram_rk3328.o
+obj-$(CONFIG_ROCKCHIP_RK3399) = sdram_rk3399.o
index 7577ff0363d66cedba303597bbba13340f2850a1..bfcb1ddefe3d4916d287791fe9508e375f1560b2 100644 (file)
@@ -230,7 +230,7 @@ static int memory_init(struct rk3368_ddr_pctl *pctl,
        tmp = get_timer(0);
        do {
                if (get_timer(tmp) > timeout_ms) {
-                       error("%s: POWER_UP_START did not complete in %ld ms\n",
+                       pr_err("%s: POWER_UP_START did not complete in %ld ms\n",
                              __func__, timeout_ms);
                        return -ETIME;
                }
@@ -422,7 +422,7 @@ static int dfi_cfg(struct rk3368_ddr_pctl *pctl)
        tmp = get_timer(0);
        do {
                if (get_timer(tmp) > timeout_ms) {
-                       error("%s: DFI init did not complete within %ld ms\n",
+                       pr_err("%s: DFI init did not complete within %ld ms\n",
                              __func__, timeout_ms);
                        return -ETIME;
                }
@@ -457,7 +457,7 @@ static int pctl_calc_timings(struct rk3368_sdram_params *params,
        u32 tfaw_as_ps;
 
        if (params->ddr_speed_bin != DDR3_1600K) {
-               error("%s: unimplemented DDR3 speed bin %d\n",
+               pr_err("%s: unimplemented DDR3 speed bin %d\n",
                      __func__, params->ddr_speed_bin);
                return -1;
        }
@@ -585,7 +585,7 @@ static int ddrphy_data_training(struct rk3368_ddr_pctl *pctl,
        tmp = get_timer(0);
        do {
                if (get_timer(tmp) > timeout_ms) {
-                       error("%s: did not complete within %ld ms\n",
+                       pr_err("%s: did not complete within %ld ms\n",
                              __func__, timeout_ms);
                        return -ETIME;
                }
@@ -625,7 +625,7 @@ static int sdram_col_row_detect(struct udevice *dev)
        }
 
        if (col == 8) {
-               error("%s: col detect error\n", __func__);
+               pr_err("%s: col detect error\n", __func__);
                return -EINVAL;
        }
 
@@ -644,7 +644,7 @@ static int sdram_col_row_detect(struct udevice *dev)
        }
 
        if (row == 11) {
-               error("%s: row detect error\n", __func__);
+               pr_err("%s: row detect error\n", __func__);
                return -EINVAL;
        }
 
@@ -764,7 +764,7 @@ static int msch_niu_config(struct rk3368_msch *msch,
                }
        }
 
-       error("%s: ddrconf (NIU config) not found\n", __func__);
+       pr_err("%s: ddrconf (NIU config) not found\n", __func__);
        return -EINVAL;
 }
 
diff --git a/drivers/ram/rockchip/sdram_rk3188.c b/drivers/ram/rockchip/sdram_rk3188.c
new file mode 100644 (file)
index 0000000..365d00e
--- /dev/null
@@ -0,0 +1,960 @@
+/*
+ * (C) Copyright 2015 Google, Inc
+ * Copyright 2014 Rockchip Inc.
+ *
+ * SPDX-License-Identifier:     GPL-2.0
+ *
+ * Adapted from the very similar rk3288 ddr init.
+ */
+
+#include <common.h>
+#include <clk.h>
+#include <dm.h>
+#include <dt-structs.h>
+#include <errno.h>
+#include <ram.h>
+#include <regmap.h>
+#include <syscon.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/cru_rk3188.h>
+#include <asm/arch/ddr_rk3188.h>
+#include <asm/arch/grf_rk3188.h>
+#include <asm/arch/pmu_rk3188.h>
+#include <asm/arch/sdram.h>
+#include <asm/arch/sdram_common.h>
+#include <linux/err.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct chan_info {
+       struct rk3288_ddr_pctl *pctl;
+       struct rk3288_ddr_publ *publ;
+       struct rk3188_msch *msch;
+};
+
+struct dram_info {
+       struct chan_info chan[1];
+       struct ram_info info;
+       struct clk ddr_clk;
+       struct rk3188_cru *cru;
+       struct rk3188_grf *grf;
+       struct rk3188_sgrf *sgrf;
+       struct rk3188_pmu *pmu;
+};
+
+struct rk3188_sdram_params {
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct dtd_rockchip_rk3188_dmc of_plat;
+#endif
+       struct rk3288_sdram_channel ch[2];
+       struct rk3288_sdram_pctl_timing pctl_timing;
+       struct rk3288_sdram_phy_timing phy_timing;
+       struct rk3288_base_params base;
+       int num_channels;
+       struct regmap *map;
+};
+
+const int ddrconf_table[] = {
+       /*
+        * [5:4] row(13+n)
+        * [1:0] col(9+n), assume bw=2
+        * row      col,bw
+        */
+       0,
+       ((2 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+       ((1 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+       ((0 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+       ((2 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
+       ((1 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
+       ((0 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
+       ((1 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
+       ((0 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,
+};
+
+#define TEST_PATTEN    0x5aa5f00f
+#define DQS_GATE_TRAINING_ERROR_RANK0  (1 << 4)
+#define DQS_GATE_TRAINING_ERROR_RANK1  (2 << 4)
+
+#ifdef CONFIG_SPL_BUILD
+static void copy_to_reg(u32 *dest, const u32 *src, u32 n)
+{
+       int i;
+
+       for (i = 0; i < n / sizeof(u32); i++) {
+               writel(*src, dest);
+               src++;
+               dest++;
+       }
+}
+
+static void ddr_reset(struct rk3188_cru *cru, u32 ch, u32 ctl, u32 phy)
+{
+       u32 phy_ctl_srstn_shift = 13;
+       u32 ctl_psrstn_shift = 11;
+       u32 ctl_srstn_shift = 10;
+       u32 phy_psrstn_shift = 9;
+       u32 phy_srstn_shift = 8;
+
+       rk_clrsetreg(&cru->cru_softrst_con[5],
+                    1 << phy_ctl_srstn_shift | 1 << ctl_psrstn_shift |
+                    1 << ctl_srstn_shift | 1 << phy_psrstn_shift |
+                    1 << phy_srstn_shift,
+                    phy << phy_ctl_srstn_shift | ctl << ctl_psrstn_shift |
+                    ctl << ctl_srstn_shift | phy << phy_psrstn_shift |
+                    phy << phy_srstn_shift);
+}
+
+static void ddr_phy_ctl_reset(struct rk3188_cru *cru, u32 ch, u32 n)
+{
+       u32 phy_ctl_srstn_shift = 13;
+
+       rk_clrsetreg(&cru->cru_softrst_con[5],
+                    1 << phy_ctl_srstn_shift, n << phy_ctl_srstn_shift);
+}
+
+static void phy_pctrl_reset(struct rk3188_cru *cru,
+                           struct rk3288_ddr_publ *publ,
+                           int channel)
+{
+       int i;
+
+       ddr_reset(cru, channel, 1, 1);
+       udelay(1);
+       clrbits_le32(&publ->acdllcr, ACDLLCR_DLLSRST);
+       for (i = 0; i < 4; i++)
+               clrbits_le32(&publ->datx8[i].dxdllcr, DXDLLCR_DLLSRST);
+
+       udelay(10);
+       setbits_le32(&publ->acdllcr, ACDLLCR_DLLSRST);
+       for (i = 0; i < 4; i++)
+               setbits_le32(&publ->datx8[i].dxdllcr, DXDLLCR_DLLSRST);
+
+       udelay(10);
+       ddr_reset(cru, channel, 1, 0);
+       udelay(10);
+       ddr_reset(cru, channel, 0, 0);
+       udelay(10);
+}
+
+static void phy_dll_bypass_set(struct rk3288_ddr_publ *publ,
+       u32 freq)
+{
+       int i;
+
+       if (freq <= 250000000) {
+               if (freq <= 150000000)
+                       clrbits_le32(&publ->dllgcr, SBIAS_BYPASS);
+               else
+                       setbits_le32(&publ->dllgcr, SBIAS_BYPASS);
+               setbits_le32(&publ->acdllcr, ACDLLCR_DLLDIS);
+               for (i = 0; i < 4; i++)
+                       setbits_le32(&publ->datx8[i].dxdllcr,
+                                    DXDLLCR_DLLDIS);
+
+               setbits_le32(&publ->pir, PIR_DLLBYP);
+       } else {
+               clrbits_le32(&publ->dllgcr, SBIAS_BYPASS);
+               clrbits_le32(&publ->acdllcr, ACDLLCR_DLLDIS);
+               for (i = 0; i < 4; i++) {
+                       clrbits_le32(&publ->datx8[i].dxdllcr,
+                                    DXDLLCR_DLLDIS);
+               }
+
+               clrbits_le32(&publ->pir, PIR_DLLBYP);
+       }
+}
+
+static void dfi_cfg(struct rk3288_ddr_pctl *pctl, u32 dramtype)
+{
+       writel(DFI_INIT_START, &pctl->dfistcfg0);
+       writel(DFI_DRAM_CLK_SR_EN | DFI_DRAM_CLK_DPD_EN,
+              &pctl->dfistcfg1);
+       writel(DFI_PARITY_INTR_EN | DFI_PARITY_EN, &pctl->dfistcfg2);
+       writel(7 << TLP_RESP_TIME_SHIFT | LP_SR_EN | LP_PD_EN,
+              &pctl->dfilpcfg0);
+
+       writel(2 << TCTRL_DELAY_TIME_SHIFT, &pctl->dfitctrldelay);
+       writel(1 << TPHY_WRDATA_TIME_SHIFT, &pctl->dfitphywrdata);
+       writel(0xf << TPHY_RDLAT_TIME_SHIFT, &pctl->dfitphyrdlat);
+       writel(2 << TDRAM_CLK_DIS_TIME_SHIFT, &pctl->dfitdramclkdis);
+       writel(2 << TDRAM_CLK_EN_TIME_SHIFT, &pctl->dfitdramclken);
+       writel(1, &pctl->dfitphyupdtype0);
+
+       /* cs0 and cs1 write odt enable */
+       writel((RANK0_ODT_WRITE_SEL | RANK1_ODT_WRITE_SEL),
+              &pctl->dfiodtcfg);
+       /* odt write length */
+       writel(7 << ODT_LEN_BL8_W_SHIFT, &pctl->dfiodtcfg1);
+       /* phyupd and ctrlupd disabled */
+       writel(0, &pctl->dfiupdcfg);
+}
+
+static void ddr_set_enable(struct rk3188_grf *grf, uint channel, bool enable)
+{
+       uint val = 0;
+
+       if (enable)
+               val = 1 << DDR_16BIT_EN_SHIFT;
+
+       rk_clrsetreg(&grf->ddrc_con0, 1 << DDR_16BIT_EN_SHIFT, val);
+}
+
+static void ddr_set_ddr3_mode(struct rk3188_grf *grf, uint channel,
+                             bool ddr3_mode)
+{
+       uint mask, val;
+
+       mask = MSCH4_MAINDDR3_MASK << MSCH4_MAINDDR3_SHIFT;
+       val = ddr3_mode << MSCH4_MAINDDR3_SHIFT;
+       rk_clrsetreg(&grf->soc_con2, mask, val);
+}
+
+static void ddr_rank_2_row15en(struct rk3188_grf *grf, bool enable)
+{
+       uint mask, val;
+
+       mask = RANK_TO_ROW15_EN_MASK << RANK_TO_ROW15_EN_SHIFT;
+       val = enable << RANK_TO_ROW15_EN_SHIFT;
+       rk_clrsetreg(&grf->soc_con2, mask, val);
+}
+
+static void pctl_cfg(int channel, struct rk3288_ddr_pctl *pctl,
+                    struct rk3188_sdram_params *sdram_params,
+                    struct rk3188_grf *grf)
+{
+       copy_to_reg(&pctl->togcnt1u, &sdram_params->pctl_timing.togcnt1u,
+                   sizeof(sdram_params->pctl_timing));
+       switch (sdram_params->base.dramtype) {
+       case DDR3:
+               if (sdram_params->phy_timing.mr[1] & DDR3_DLL_DISABLE) {
+                       writel(sdram_params->pctl_timing.tcl - 3,
+                              &pctl->dfitrddataen);
+               } else {
+                       writel(sdram_params->pctl_timing.tcl - 2,
+                              &pctl->dfitrddataen);
+               }
+               writel(sdram_params->pctl_timing.tcwl - 1,
+                      &pctl->dfitphywrlat);
+               writel(0 << MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT | DDR3_EN |
+                      DDR2_DDR3_BL_8 | (6 - 4) << TFAW_SHIFT | PD_EXIT_SLOW |
+                      1 << PD_TYPE_SHIFT | 0 << PD_IDLE_SHIFT,
+                      &pctl->mcfg);
+               ddr_set_ddr3_mode(grf, channel, true);
+               ddr_set_enable(grf, channel, true);
+               break;
+       }
+
+       setbits_le32(&pctl->scfg, 1);
+}
+
+static void phy_cfg(const struct chan_info *chan, int channel,
+                   struct rk3188_sdram_params *sdram_params)
+{
+       struct rk3288_ddr_publ *publ = chan->publ;
+       struct rk3188_msch *msch = chan->msch;
+       uint ddr_freq_mhz = sdram_params->base.ddr_freq / 1000000;
+       u32 dinit2;
+       int i;
+
+       dinit2 = DIV_ROUND_UP(ddr_freq_mhz * 200000, 1000);
+       /* DDR PHY Timing */
+       copy_to_reg(&publ->dtpr[0], &sdram_params->phy_timing.dtpr0,
+                   sizeof(sdram_params->phy_timing));
+       writel(sdram_params->base.noc_timing, &msch->ddrtiming);
+       writel(0x3f, &msch->readlatency);
+       writel(DIV_ROUND_UP(ddr_freq_mhz * 5120, 1000) << PRT_DLLLOCK_SHIFT |
+              DIV_ROUND_UP(ddr_freq_mhz * 50, 1000) << PRT_DLLSRST_SHIFT |
+              8 << PRT_ITMSRST_SHIFT, &publ->ptr[0]);
+       writel(DIV_ROUND_UP(ddr_freq_mhz * 500000, 1000) << PRT_DINIT0_SHIFT |
+              DIV_ROUND_UP(ddr_freq_mhz * 400, 1000) << PRT_DINIT1_SHIFT,
+              &publ->ptr[1]);
+       writel(min(dinit2, 0x1ffffU) << PRT_DINIT2_SHIFT |
+              DIV_ROUND_UP(ddr_freq_mhz * 1000, 1000) << PRT_DINIT3_SHIFT,
+              &publ->ptr[2]);
+
+       switch (sdram_params->base.dramtype) {
+       case DDR3:
+               clrbits_le32(&publ->pgcr, 0x1f);
+               clrsetbits_le32(&publ->dcr, DDRMD_MASK << DDRMD_SHIFT,
+                               DDRMD_DDR3 << DDRMD_SHIFT);
+               break;
+       }
+       if (sdram_params->base.odt) {
+               /*dynamic RTT enable */
+               for (i = 0; i < 4; i++)
+                       setbits_le32(&publ->datx8[i].dxgcr, DQSRTT | DQRTT);
+       } else {
+               /*dynamic RTT disable */
+               for (i = 0; i < 4; i++)
+                       clrbits_le32(&publ->datx8[i].dxgcr, DQSRTT | DQRTT);
+       }
+}
+
+static void phy_init(struct rk3288_ddr_publ *publ)
+{
+       setbits_le32(&publ->pir, PIR_INIT | PIR_DLLSRST
+               | PIR_DLLLOCK | PIR_ZCAL | PIR_ITMSRST | PIR_CLRSR);
+       udelay(1);
+       while ((readl(&publ->pgsr) &
+               (PGSR_IDONE | PGSR_DLDONE | PGSR_ZCDONE)) !=
+               (PGSR_IDONE | PGSR_DLDONE | PGSR_ZCDONE))
+               ;
+}
+
+static void send_command(struct rk3288_ddr_pctl *pctl, u32 rank,
+                        u32 cmd, u32 arg)
+{
+       writel((START_CMD | (rank << 20) | arg | cmd), &pctl->mcmd);
+       udelay(1);
+       while (readl(&pctl->mcmd) & START_CMD)
+               ;
+}
+
+static inline void send_command_op(struct rk3288_ddr_pctl *pctl,
+                                  u32 rank, u32 cmd, u32 ma, u32 op)
+{
+       send_command(pctl, rank, cmd, (ma & LPDDR2_MA_MASK) << LPDDR2_MA_SHIFT |
+                    (op & LPDDR2_OP_MASK) << LPDDR2_OP_SHIFT);
+}
+
+static void memory_init(struct rk3288_ddr_publ *publ,
+                       u32 dramtype)
+{
+       setbits_le32(&publ->pir,
+                    (PIR_INIT | PIR_DRAMINIT | PIR_LOCKBYP
+                     | PIR_ZCALBYP | PIR_CLRSR | PIR_ICPC
+                     | (dramtype == DDR3 ? PIR_DRAMRST : 0)));
+       udelay(1);
+       while ((readl(&publ->pgsr) & (PGSR_IDONE | PGSR_DLDONE))
+               != (PGSR_IDONE | PGSR_DLDONE))
+               ;
+}
+
+static void move_to_config_state(struct rk3288_ddr_publ *publ,
+                                struct rk3288_ddr_pctl *pctl)
+{
+       unsigned int state;
+
+       while (1) {
+               state = readl(&pctl->stat) & PCTL_STAT_MSK;
+
+               switch (state) {
+               case LOW_POWER:
+                       writel(WAKEUP_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK)
+                               != ACCESS)
+                               ;
+                       /* wait DLL lock */
+                       while ((readl(&publ->pgsr) & PGSR_DLDONE)
+                               != PGSR_DLDONE)
+                               ;
+                       /*
+                        * if at low power state,need wakeup first,
+                        * and then enter the config, so
+                        * fallthrough
+                        */
+               case ACCESS:
+                       /* fallthrough */
+               case INIT_MEM:
+                       writel(CFG_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != CONFIG)
+                               ;
+                       break;
+               case CONFIG:
+                       return;
+               default:
+                       break;
+               }
+       }
+}
+
+static void set_bandwidth_ratio(const struct chan_info *chan, int channel,
+                               u32 n, struct rk3188_grf *grf)
+{
+       struct rk3288_ddr_pctl *pctl = chan->pctl;
+       struct rk3288_ddr_publ *publ = chan->publ;
+       struct rk3188_msch *msch = chan->msch;
+
+       if (n == 1) {
+               setbits_le32(&pctl->ppcfg, 1);
+               ddr_set_enable(grf, channel, 1);
+               setbits_le32(&msch->ddrtiming, 1 << 31);
+               /* Data Byte disable*/
+               clrbits_le32(&publ->datx8[2].dxgcr, 1);
+               clrbits_le32(&publ->datx8[3].dxgcr, 1);
+               /* disable DLL */
+               setbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLDIS);
+               setbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLDIS);
+       } else {
+               clrbits_le32(&pctl->ppcfg, 1);
+               ddr_set_enable(grf, channel, 0);
+               clrbits_le32(&msch->ddrtiming, 1 << 31);
+               /* Data Byte enable*/
+               setbits_le32(&publ->datx8[2].dxgcr, 1);
+               setbits_le32(&publ->datx8[3].dxgcr, 1);
+
+               /* enable DLL */
+               clrbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLDIS);
+               clrbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLDIS);
+               /* reset DLL */
+               clrbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLSRST);
+               clrbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLSRST);
+               udelay(10);
+               setbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLSRST);
+               setbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLSRST);
+       }
+       setbits_le32(&pctl->dfistcfg0, 1 << 2);
+}
+
+static int data_training(const struct chan_info *chan, int channel,
+                        struct rk3188_sdram_params *sdram_params)
+{
+       unsigned int j;
+       int ret = 0;
+       u32 rank;
+       int i;
+       u32 step[2] = { PIR_QSTRN, PIR_RVTRN };
+       struct rk3288_ddr_publ *publ = chan->publ;
+       struct rk3288_ddr_pctl *pctl = chan->pctl;
+
+       /* disable auto refresh */
+       writel(0, &pctl->trefi);
+
+       if (sdram_params->base.dramtype != LPDDR3)
+               setbits_le32(&publ->pgcr, 1 << PGCR_DQSCFG_SHIFT);
+       rank = sdram_params->ch[channel].rank | 1;
+       for (j = 0; j < ARRAY_SIZE(step); j++) {
+               /*
+                * trigger QSTRN and RVTRN
+                * clear DTDONE status
+                */
+               setbits_le32(&publ->pir, PIR_CLRSR);
+
+               /* trigger DTT */
+               setbits_le32(&publ->pir,
+                            PIR_INIT | step[j] | PIR_LOCKBYP | PIR_ZCALBYP |
+                            PIR_CLRSR);
+               udelay(1);
+               /* wait echo byte DTDONE */
+               while ((readl(&publ->datx8[0].dxgsr[0]) & rank)
+                       != rank)
+                       ;
+               while ((readl(&publ->datx8[1].dxgsr[0]) & rank)
+                       != rank)
+                       ;
+               if (!(readl(&pctl->ppcfg) & 1)) {
+                       while ((readl(&publ->datx8[2].dxgsr[0])
+                               & rank) != rank)
+                               ;
+                       while ((readl(&publ->datx8[3].dxgsr[0])
+                               & rank) != rank)
+                               ;
+               }
+               if (readl(&publ->pgsr) &
+                   (PGSR_DTERR | PGSR_RVERR | PGSR_RVEIRR)) {
+                       ret = -1;
+                       break;
+               }
+       }
+       /* send some auto refresh to complement the lost while DTT */
+       for (i = 0; i < (rank > 1 ? 8 : 4); i++)
+               send_command(pctl, rank, REF_CMD, 0);
+
+       if (sdram_params->base.dramtype != LPDDR3)
+               clrbits_le32(&publ->pgcr, 1 << PGCR_DQSCFG_SHIFT);
+
+       /* resume auto refresh */
+       writel(sdram_params->pctl_timing.trefi, &pctl->trefi);
+
+       return ret;
+}
+
+static void move_to_access_state(const struct chan_info *chan)
+{
+       struct rk3288_ddr_publ *publ = chan->publ;
+       struct rk3288_ddr_pctl *pctl = chan->pctl;
+       unsigned int state;
+
+       while (1) {
+               state = readl(&pctl->stat) & PCTL_STAT_MSK;
+
+               switch (state) {
+               case LOW_POWER:
+                       if (((readl(&pctl->stat) >> LP_TRIG_SHIFT) &
+                                       LP_TRIG_MASK) == 1)
+                               return;
+
+                       writel(WAKEUP_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != ACCESS)
+                               ;
+                       /* wait DLL lock */
+                       while ((readl(&publ->pgsr) & PGSR_DLDONE)
+                               != PGSR_DLDONE)
+                               ;
+                       break;
+               case INIT_MEM:
+                       writel(CFG_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != CONFIG)
+                               ;
+                       /* fallthrough */
+               case CONFIG:
+                       writel(GO_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) == CONFIG)
+                               ;
+                       break;
+               case ACCESS:
+                       return;
+               default:
+                       break;
+               }
+       }
+}
+
+static void dram_cfg_rbc(const struct chan_info *chan, u32 chnum,
+                        struct rk3188_sdram_params *sdram_params)
+{
+       struct rk3288_ddr_publ *publ = chan->publ;
+
+       if (sdram_params->ch[chnum].bk == 3)
+               clrsetbits_le32(&publ->dcr, PDQ_MASK << PDQ_SHIFT,
+                               1 << PDQ_SHIFT);
+       else
+               clrbits_le32(&publ->dcr, PDQ_MASK << PDQ_SHIFT);
+
+       writel(sdram_params->base.ddrconfig, &chan->msch->ddrconf);
+}
+
+static void dram_all_config(const struct dram_info *dram,
+                           struct rk3188_sdram_params *sdram_params)
+{
+       unsigned int chan;
+       u32 sys_reg = 0;
+
+       sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT;
+       sys_reg |= (sdram_params->num_channels - 1) << SYS_REG_NUM_CH_SHIFT;
+       for (chan = 0; chan < sdram_params->num_channels; chan++) {
+               const struct rk3288_sdram_channel *info =
+                       &sdram_params->ch[chan];
+
+               sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(chan);
+               sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(chan);
+               sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(chan);
+               sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(chan);
+               sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(chan);
+               sys_reg |= (info->cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(chan);
+               sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(chan);
+               sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(chan);
+               sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(chan);
+
+               dram_cfg_rbc(&dram->chan[chan], chan, sdram_params);
+       }
+       if (sdram_params->ch[0].rank == 2)
+               ddr_rank_2_row15en(dram->grf, 0);
+       else
+               ddr_rank_2_row15en(dram->grf, 1);
+
+       writel(sys_reg, &dram->pmu->sys_reg[2]);
+}
+
+static int sdram_rank_bw_detect(struct dram_info *dram, int channel,
+               struct rk3188_sdram_params *sdram_params)
+{
+       int reg;
+       int need_trainig = 0;
+       const struct chan_info *chan = &dram->chan[channel];
+       struct rk3288_ddr_publ *publ = chan->publ;
+
+       ddr_rank_2_row15en(dram->grf, 0);
+
+       if (data_training(chan, channel, sdram_params) < 0) {
+               printf("first data training fail!\n");
+               reg = readl(&publ->datx8[0].dxgsr[0]);
+               /* Check the result for rank 0 */
+               if ((channel == 0) && (reg & DQS_GATE_TRAINING_ERROR_RANK0)) {
+                       printf("data training fail!\n");
+                       return -EIO;
+               }
+
+               /* Check the result for rank 1 */
+               if (reg & DQS_GATE_TRAINING_ERROR_RANK1) {
+                       sdram_params->ch[channel].rank = 1;
+                       clrsetbits_le32(&publ->pgcr, 0xF << 18,
+                                       sdram_params->ch[channel].rank << 18);
+                       need_trainig = 1;
+               }
+               reg = readl(&publ->datx8[2].dxgsr[0]);
+               if (reg & (1 << 4)) {
+                       sdram_params->ch[channel].bw = 1;
+                       set_bandwidth_ratio(chan, channel,
+                                           sdram_params->ch[channel].bw,
+                                           dram->grf);
+                       need_trainig = 1;
+               }
+       }
+       /* Assume the Die bit width are the same with the chip bit width */
+       sdram_params->ch[channel].dbw = sdram_params->ch[channel].bw;
+
+       if (need_trainig &&
+           (data_training(chan, channel, sdram_params) < 0)) {
+               if (sdram_params->base.dramtype == LPDDR3) {
+                       ddr_phy_ctl_reset(dram->cru, channel, 1);
+                       udelay(10);
+                       ddr_phy_ctl_reset(dram->cru, channel, 0);
+                       udelay(10);
+               }
+               printf("2nd data training failed!");
+               return -EIO;
+       }
+
+       return 0;
+}
+
+/*
+ * Detect ram columns and rows.
+ * @dram: dram info struct
+ * @channel: channel number to handle
+ * @sdram_params: sdram parameters, function will fill in col and row values
+ *
+ * Returns 0 or negative on error.
+ */
+static int sdram_col_row_detect(struct dram_info *dram, int channel,
+               struct rk3188_sdram_params *sdram_params)
+{
+       int row, col;
+       unsigned int addr;
+       const struct chan_info *chan = &dram->chan[channel];
+       struct rk3288_ddr_pctl *pctl = chan->pctl;
+       struct rk3288_ddr_publ *publ = chan->publ;
+       int ret = 0;
+
+       /* Detect col */
+       for (col = 11; col >= 9; col--) {
+               writel(0, CONFIG_SYS_SDRAM_BASE);
+               addr = CONFIG_SYS_SDRAM_BASE +
+                       (1 << (col + sdram_params->ch[channel].bw - 1));
+               writel(TEST_PATTEN, addr);
+               if ((readl(addr) == TEST_PATTEN) &&
+                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
+                       break;
+       }
+       if (col == 8) {
+               printf("Col detect error\n");
+               ret = -EINVAL;
+               goto out;
+       } else {
+               sdram_params->ch[channel].col = col;
+       }
+
+       ddr_rank_2_row15en(dram->grf, 1);
+       move_to_config_state(publ, pctl);
+       writel(1, &chan->msch->ddrconf);
+       move_to_access_state(chan);
+       /* Detect row, max 15,min13 in rk3188*/
+       for (row = 16; row >= 13; row--) {
+               writel(0, CONFIG_SYS_SDRAM_BASE);
+               addr = CONFIG_SYS_SDRAM_BASE + (1 << (row + 15 - 1));
+               writel(TEST_PATTEN, addr);
+               if ((readl(addr) == TEST_PATTEN) &&
+                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
+                       break;
+       }
+       if (row == 12) {
+               printf("Row detect error\n");
+               ret = -EINVAL;
+       } else {
+               sdram_params->ch[channel].cs1_row = row;
+               sdram_params->ch[channel].row_3_4 = 0;
+               debug("chn %d col %d, row %d\n", channel, col, row);
+               sdram_params->ch[channel].cs0_row = row;
+       }
+
+out:
+       return ret;
+}
+
+static int sdram_get_niu_config(struct rk3188_sdram_params *sdram_params)
+{
+       int i, tmp, size, row, ret = 0;
+
+       row = sdram_params->ch[0].cs0_row;
+       /*
+        * RK3188 share the rank and row bit15, we use same ddr config for 15bit
+        * and 16bit row
+        */
+       if (row == 16)
+               row = 15;
+       tmp = sdram_params->ch[0].col - 9;
+       tmp -= (sdram_params->ch[0].bw == 2) ? 0 : 1;
+       tmp |= ((row - 13) << 4);
+       size = sizeof(ddrconf_table)/sizeof(ddrconf_table[0]);
+       for (i = 0; i < size; i++)
+               if (tmp == ddrconf_table[i])
+                       break;
+       if (i >= size) {
+               printf("niu config not found\n");
+               ret = -EINVAL;
+       } else {
+               debug("niu config %d\n", i);
+               sdram_params->base.ddrconfig = i;
+       }
+
+       return ret;
+}
+
+static int sdram_init(struct dram_info *dram,
+                     struct rk3188_sdram_params *sdram_params)
+{
+       int channel;
+       int zqcr;
+       int ret;
+
+       if ((sdram_params->base.dramtype == DDR3 &&
+            sdram_params->base.ddr_freq > 800000000)) {
+               printf("SDRAM frequency is too high!");
+               return -E2BIG;
+       }
+
+       ret = clk_set_rate(&dram->ddr_clk, sdram_params->base.ddr_freq);
+       if (ret) {
+               printf("Could not set DDR clock\n");
+               return ret;
+       }
+
+       for (channel = 0; channel < 1; channel++) {
+               const struct chan_info *chan = &dram->chan[channel];
+               struct rk3288_ddr_pctl *pctl = chan->pctl;
+               struct rk3288_ddr_publ *publ = chan->publ;
+
+               phy_pctrl_reset(dram->cru, publ, channel);
+               phy_dll_bypass_set(publ, sdram_params->base.ddr_freq);
+
+               dfi_cfg(pctl, sdram_params->base.dramtype);
+
+               pctl_cfg(channel, pctl, sdram_params, dram->grf);
+
+               phy_cfg(chan, channel, sdram_params);
+
+               phy_init(publ);
+
+               writel(POWER_UP_START, &pctl->powctl);
+               while (!(readl(&pctl->powstat) & POWER_UP_DONE))
+                       ;
+
+               memory_init(publ, sdram_params->base.dramtype);
+               move_to_config_state(publ, pctl);
+
+               /* Using 32bit bus width for detect */
+               sdram_params->ch[channel].bw = 2;
+               set_bandwidth_ratio(chan, channel,
+                                   sdram_params->ch[channel].bw, dram->grf);
+               /*
+                * set cs, using n=3 for detect
+                * CS0, n=1
+                * CS1, n=2
+                * CS0 & CS1, n = 3
+                */
+               sdram_params->ch[channel].rank = 2,
+               clrsetbits_le32(&publ->pgcr, 0xF << 18,
+                               (sdram_params->ch[channel].rank | 1) << 18);
+
+               /* DS=40ohm,ODT=155ohm */
+               zqcr = 1 << ZDEN_SHIFT | 2 << PU_ONDIE_SHIFT |
+                       2 << PD_ONDIE_SHIFT | 0x19 << PU_OUTPUT_SHIFT |
+                       0x19 << PD_OUTPUT_SHIFT;
+               writel(zqcr, &publ->zq1cr[0]);
+               writel(zqcr, &publ->zq0cr[0]);
+
+               /* Detect the rank and bit-width with data-training */
+               writel(1, &chan->msch->ddrconf);
+               sdram_rank_bw_detect(dram, channel, sdram_params);
+
+               if (sdram_params->base.dramtype == LPDDR3) {
+                       u32 i;
+                       writel(0, &pctl->mrrcfg0);
+                       for (i = 0; i < 17; i++)
+                               send_command_op(pctl, 1, MRR_CMD, i, 0);
+               }
+               writel(4, &chan->msch->ddrconf);
+               move_to_access_state(chan);
+               /* DDR3 and LPDDR3 are always 8 bank, no need detect */
+               sdram_params->ch[channel].bk = 3;
+               /* Detect Col and Row number*/
+               ret = sdram_col_row_detect(dram, channel, sdram_params);
+               if (ret)
+                       goto error;
+       }
+       /* Find NIU DDR configuration */
+       ret = sdram_get_niu_config(sdram_params);
+       if (ret)
+               goto error;
+
+       dram_all_config(dram, sdram_params);
+       debug("%s done\n", __func__);
+
+       return 0;
+error:
+       printf("DRAM init failed!\n");
+       hang();
+}
+
+static int setup_sdram(struct udevice *dev)
+{
+       struct dram_info *priv = dev_get_priv(dev);
+       struct rk3188_sdram_params *params = dev_get_platdata(dev);
+
+       return sdram_init(priv, params);
+}
+
+static int rk3188_dmc_ofdata_to_platdata(struct udevice *dev)
+{
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct rk3188_sdram_params *params = dev_get_platdata(dev);
+       int ret;
+
+       /* rk3188 supports only one-channel */
+       params->num_channels = 1;
+       ret = dev_read_u32_array(dev, "rockchip,pctl-timing",
+                                (u32 *)&params->pctl_timing,
+                                sizeof(params->pctl_timing) / sizeof(u32));
+       if (ret) {
+               printf("%s: Cannot read rockchip,pctl-timing\n", __func__);
+               return -EINVAL;
+       }
+       ret = dev_read_u32_array(dev, "rockchip,phy-timing",
+                                (u32 *)&params->phy_timing,
+                                sizeof(params->phy_timing) / sizeof(u32));
+       if (ret) {
+               printf("%s: Cannot read rockchip,phy-timing\n", __func__);
+               return -EINVAL;
+       }
+       ret = dev_read_u32_array(dev, "rockchip,sdram-params",
+                                (u32 *)&params->base,
+                                sizeof(params->base) / sizeof(u32));
+       if (ret) {
+               printf("%s: Cannot read rockchip,sdram-params\n", __func__);
+               return -EINVAL;
+       }
+       ret = regmap_init_mem(dev, &params->map);
+       if (ret)
+               return ret;
+#endif
+
+       return 0;
+}
+#endif /* CONFIG_SPL_BUILD */
+
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+static int conv_of_platdata(struct udevice *dev)
+{
+       struct rk3188_sdram_params *plat = dev_get_platdata(dev);
+       struct dtd_rockchip_rk3188_dmc *of_plat = &plat->of_plat;
+       int ret;
+
+       memcpy(&plat->pctl_timing, of_plat->rockchip_pctl_timing,
+              sizeof(plat->pctl_timing));
+       memcpy(&plat->phy_timing, of_plat->rockchip_phy_timing,
+              sizeof(plat->phy_timing));
+       memcpy(&plat->base, of_plat->rockchip_sdram_params, sizeof(plat->base));
+       /* rk3188 supports dual-channel, set default channel num to 2 */
+       plat->num_channels = 1;
+       ret = regmap_init_mem_platdata(dev, of_plat->reg,
+                                      ARRAY_SIZE(of_plat->reg) / 2,
+                                      &plat->map);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+#endif
+
+static int rk3188_dmc_probe(struct udevice *dev)
+{
+#ifdef CONFIG_SPL_BUILD
+       struct rk3188_sdram_params *plat = dev_get_platdata(dev);
+       struct regmap *map;
+       struct udevice *dev_clk;
+       int ret;
+#endif
+       struct dram_info *priv = dev_get_priv(dev);
+
+       priv->pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU);
+
+#ifdef CONFIG_SPL_BUILD
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       ret = conv_of_platdata(dev);
+       if (ret)
+               return ret;
+#endif
+       map = syscon_get_regmap_by_driver_data(ROCKCHIP_SYSCON_NOC);
+       if (IS_ERR(map))
+               return PTR_ERR(map);
+       priv->chan[0].msch = regmap_get_range(map, 0);
+
+       priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+
+       priv->chan[0].pctl = regmap_get_range(plat->map, 0);
+       priv->chan[0].publ = regmap_get_range(plat->map, 1);
+
+       ret = rockchip_get_clk(&dev_clk);
+       if (ret)
+               return ret;
+       priv->ddr_clk.id = CLK_DDR;
+       ret = clk_request(dev_clk, &priv->ddr_clk);
+       if (ret)
+               return ret;
+
+       priv->cru = rockchip_get_cru();
+       if (IS_ERR(priv->cru))
+               return PTR_ERR(priv->cru);
+       ret = setup_sdram(dev);
+       if (ret)
+               return ret;
+#else
+       priv->info.base = CONFIG_SYS_SDRAM_BASE;
+       priv->info.size = rockchip_sdram_size(
+                               (phys_addr_t)&priv->pmu->sys_reg[2]);
+#endif
+
+       return 0;
+}
+
+static int rk3188_dmc_get_info(struct udevice *dev, struct ram_info *info)
+{
+       struct dram_info *priv = dev_get_priv(dev);
+
+       *info = priv->info;
+
+       return 0;
+}
+
+static struct ram_ops rk3188_dmc_ops = {
+       .get_info = rk3188_dmc_get_info,
+};
+
+static const struct udevice_id rk3188_dmc_ids[] = {
+       { .compatible = "rockchip,rk3188-dmc" },
+       { }
+};
+
+U_BOOT_DRIVER(dmc_rk3188) = {
+       .name = "rockchip_rk3188_dmc",
+       .id = UCLASS_RAM,
+       .of_match = rk3188_dmc_ids,
+       .ops = &rk3188_dmc_ops,
+#ifdef CONFIG_SPL_BUILD
+       .ofdata_to_platdata = rk3188_dmc_ofdata_to_platdata,
+#endif
+       .probe = rk3188_dmc_probe,
+       .priv_auto_alloc_size = sizeof(struct dram_info),
+#ifdef CONFIG_SPL_BUILD
+       .platdata_auto_alloc_size = sizeof(struct rk3188_sdram_params),
+#endif
+};
diff --git a/drivers/ram/rockchip/sdram_rk322x.c b/drivers/ram/rockchip/sdram_rk322x.c
new file mode 100644 (file)
index 0000000..cc3138b
--- /dev/null
@@ -0,0 +1,855 @@
+/*
+ * (C) Copyright 2017 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0
+ */
+#include <common.h>
+#include <clk.h>
+#include <dm.h>
+#include <dt-structs.h>
+#include <errno.h>
+#include <ram.h>
+#include <regmap.h>
+#include <syscon.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/cru_rk322x.h>
+#include <asm/arch/grf_rk322x.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/sdram_rk322x.h>
+#include <asm/arch/timer.h>
+#include <asm/arch/uart.h>
+#include <asm/arch/sdram_common.h>
+#include <asm/types.h>
+#include <linux/err.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+struct chan_info {
+       struct rk322x_ddr_pctl *pctl;
+       struct rk322x_ddr_phy *phy;
+       struct rk322x_service_sys *msch;
+};
+
+struct dram_info {
+       struct chan_info chan[1];
+       struct ram_info info;
+       struct clk ddr_clk;
+       struct rk322x_cru *cru;
+       struct rk322x_grf *grf;
+};
+
+struct rk322x_sdram_params {
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+               struct dtd_rockchip_rk3228_dmc of_plat;
+#endif
+               struct rk322x_sdram_channel ch[1];
+               struct rk322x_pctl_timing pctl_timing;
+               struct rk322x_phy_timing phy_timing;
+               struct rk322x_base_params base;
+               int num_channels;
+               struct regmap *map;
+};
+
+#ifdef CONFIG_TPL_BUILD
+/*
+ * [7:6]  bank(n:n bit bank)
+ * [5:4]  row(13+n)
+ * [3]    cs(0:1 cs, 1:2 cs)
+ * [2:1]  bank(n:n bit bank)
+ * [0]    col(10+n)
+ */
+const char ddr_cfg_2_rbc[] = {
+       ((0 << 6) | (0 << 4) | (0 << 3) | (1 << 2) | 1),
+       ((0 << 6) | (1 << 4) | (0 << 3) | (1 << 2) | 1),
+       ((0 << 6) | (2 << 4) | (0 << 3) | (1 << 2) | 1),
+       ((0 << 6) | (3 << 4) | (0 << 3) | (1 << 2) | 1),
+       ((0 << 6) | (1 << 4) | (0 << 3) | (1 << 2) | 2),
+       ((0 << 6) | (2 << 4) | (0 << 3) | (1 << 2) | 2),
+       ((0 << 6) | (3 << 4) | (0 << 3) | (1 << 2) | 2),
+       ((0 << 6) | (0 << 4) | (0 << 3) | (1 << 2) | 0),
+       ((0 << 6) | (1 << 4) | (0 << 3) | (1 << 2) | 0),
+       ((0 << 6) | (2 << 4) | (0 << 3) | (1 << 2) | 0),
+       ((0 << 6) | (3 << 4) | (0 << 3) | (1 << 2) | 0),
+       ((0 << 6) | (2 << 4) | (0 << 3) | (0 << 2) | 1),
+       ((1 << 6) | (1 << 4) | (0 << 3) | (0 << 2) | 2),
+       ((1 << 6) | (1 << 4) | (0 << 3) | (0 << 2) | 1),
+       ((0 << 6) | (3 << 4) | (1 << 3) | (1 << 2) | 1),
+       ((0 << 6) | (3 << 4) | (1 << 3) | (1 << 2) | 0),
+};
+
+static void copy_to_reg(u32 *dest, const u32 *src, u32 n)
+{
+       int i;
+
+       for (i = 0; i < n / sizeof(u32); i++) {
+               writel(*src, dest);
+               src++;
+               dest++;
+       }
+}
+
+void phy_pctrl_reset(struct rk322x_cru *cru,
+                    struct rk322x_ddr_phy *ddr_phy)
+{
+       rk_clrsetreg(&cru->cru_softrst_con[5], 1 << DDRCTRL_PSRST_SHIFT |
+                       1 << DDRCTRL_SRST_SHIFT | 1 << DDRPHY_PSRST_SHIFT |
+                       1 << DDRPHY_SRST_SHIFT,
+                       1 << DDRCTRL_PSRST_SHIFT | 1 << DDRCTRL_SRST_SHIFT |
+                       1 << DDRPHY_PSRST_SHIFT | 1 << DDRPHY_SRST_SHIFT);
+
+       rockchip_udelay(10);
+
+       rk_clrreg(&cru->cru_softrst_con[5], 1 << DDRPHY_PSRST_SHIFT |
+                                                 1 << DDRPHY_SRST_SHIFT);
+       rockchip_udelay(10);
+
+       rk_clrreg(&cru->cru_softrst_con[5], 1 << DDRCTRL_PSRST_SHIFT |
+                                                 1 << DDRCTRL_SRST_SHIFT);
+       rockchip_udelay(10);
+
+       clrbits_le32(&ddr_phy->ddrphy_reg[0],
+                    SOFT_RESET_MASK << SOFT_RESET_SHIFT);
+       rockchip_udelay(10);
+       setbits_le32(&ddr_phy->ddrphy_reg[0],
+                    SOFT_DERESET_ANALOG);
+       rockchip_udelay(5);
+       setbits_le32(&ddr_phy->ddrphy_reg[0],
+                    SOFT_DERESET_DIGITAL);
+
+       rockchip_udelay(1);
+}
+
+void phy_dll_bypass_set(struct rk322x_ddr_phy *ddr_phy, u32 freq)
+{
+       u32 tmp;
+
+       setbits_le32(&ddr_phy->ddrphy_reg[0x13], 0x10);
+       setbits_le32(&ddr_phy->ddrphy_reg[0x26], 0x10);
+       setbits_le32(&ddr_phy->ddrphy_reg[0x36], 0x10);
+       setbits_le32(&ddr_phy->ddrphy_reg[0x46], 0x10);
+       setbits_le32(&ddr_phy->ddrphy_reg[0x56], 0x10);
+
+       clrbits_le32(&ddr_phy->ddrphy_reg[0x14], 0x8);
+       clrbits_le32(&ddr_phy->ddrphy_reg[0x27], 0x8);
+       clrbits_le32(&ddr_phy->ddrphy_reg[0x37], 0x8);
+       clrbits_le32(&ddr_phy->ddrphy_reg[0x47], 0x8);
+       clrbits_le32(&ddr_phy->ddrphy_reg[0x57], 0x8);
+
+       if (freq <= 400)
+               setbits_le32(&ddr_phy->ddrphy_reg[0xa4], 0x1f);
+       else
+               clrbits_le32(&ddr_phy->ddrphy_reg[0xa4], 0x1f);
+
+       if (freq <= 680)
+               tmp = 3;
+       else
+               tmp = 2;
+
+       writel(tmp, &ddr_phy->ddrphy_reg[0x28]);
+       writel(tmp, &ddr_phy->ddrphy_reg[0x38]);
+       writel(tmp, &ddr_phy->ddrphy_reg[0x48]);
+       writel(tmp, &ddr_phy->ddrphy_reg[0x58]);
+}
+
+static void send_command(struct rk322x_ddr_pctl *pctl,
+                        u32 rank, u32 cmd, u32 arg)
+{
+       writel((START_CMD | (rank << 20) | arg | cmd), &pctl->mcmd);
+       rockchip_udelay(1);
+       while (readl(&pctl->mcmd) & START_CMD)
+               ;
+}
+
+static void memory_init(struct chan_info *chan,
+                       struct rk322x_sdram_params *sdram_params)
+{
+       struct rk322x_ddr_pctl *pctl = chan->pctl;
+       u32 dramtype = sdram_params->base.dramtype;
+
+       if (dramtype == DDR3) {
+               send_command(pctl, 3, DESELECT_CMD, 0);
+               rockchip_udelay(1);
+               send_command(pctl, 3, PREA_CMD, 0);
+               send_command(pctl, 3, MRS_CMD,
+                            (0x02 & BANK_ADDR_MASK) << BANK_ADDR_SHIFT |
+                            (sdram_params->phy_timing.mr[2] & CMD_ADDR_MASK) <<
+                            CMD_ADDR_SHIFT);
+
+               send_command(pctl, 3, MRS_CMD,
+                            (0x03 & BANK_ADDR_MASK) << BANK_ADDR_SHIFT |
+                            (sdram_params->phy_timing.mr[3] & CMD_ADDR_MASK) <<
+                            CMD_ADDR_SHIFT);
+
+               send_command(pctl, 3, MRS_CMD,
+                            (0x01 & BANK_ADDR_MASK) << BANK_ADDR_SHIFT |
+                            (sdram_params->phy_timing.mr[1] & CMD_ADDR_MASK) <<
+                            CMD_ADDR_SHIFT);
+
+               send_command(pctl, 3, MRS_CMD,
+                            (0x00 & BANK_ADDR_MASK) << BANK_ADDR_SHIFT |
+                            ((sdram_params->phy_timing.mr[0] |
+                              DDR3_DLL_RESET) &
+                            CMD_ADDR_MASK) << CMD_ADDR_SHIFT);
+
+               send_command(pctl, 3, ZQCL_CMD, 0);
+       } else {
+               send_command(pctl, 3, MRS_CMD,
+                            (0x63 & LPDDR23_MA_MASK) << LPDDR23_MA_SHIFT |
+                            (0 & LPDDR23_OP_MASK) <<
+                            LPDDR23_OP_SHIFT);
+               rockchip_udelay(10);
+               send_command(pctl, 3, MRS_CMD,
+                            (0x10 & LPDDR23_MA_MASK) << LPDDR23_MA_SHIFT |
+                            (0xff & LPDDR23_OP_MASK) <<
+                            LPDDR23_OP_SHIFT);
+               rockchip_udelay(1);
+               send_command(pctl, 3, MRS_CMD,
+                            (0x10 & LPDDR23_MA_MASK) << LPDDR23_MA_SHIFT |
+                            (0xff & LPDDR23_OP_MASK) <<
+                            LPDDR23_OP_SHIFT);
+               rockchip_udelay(1);
+               send_command(pctl, 3, MRS_CMD,
+                            (1 & LPDDR23_MA_MASK) << LPDDR23_MA_SHIFT |
+                            (sdram_params->phy_timing.mr[1] &
+                             LPDDR23_OP_MASK) << LPDDR23_OP_SHIFT);
+               send_command(pctl, 3, MRS_CMD,
+                            (2 & LPDDR23_MA_MASK) << LPDDR23_MA_SHIFT |
+                            (sdram_params->phy_timing.mr[2] &
+                             LPDDR23_OP_MASK) << LPDDR23_OP_SHIFT);
+               send_command(pctl, 3, MRS_CMD,
+                            (3 & LPDDR23_MA_MASK) << LPDDR23_MA_SHIFT |
+                            (sdram_params->phy_timing.mr[3] &
+                             LPDDR23_OP_MASK) << LPDDR23_OP_SHIFT);
+               if (dramtype == LPDDR3)
+                       send_command(pctl, 3, MRS_CMD, (11 & LPDDR23_MA_MASK) <<
+                                    LPDDR23_MA_SHIFT |
+                                    (sdram_params->phy_timing.mr11 &
+                                     LPDDR23_OP_MASK) << LPDDR23_OP_SHIFT);
+       }
+}
+
+static u32 data_training(struct chan_info *chan)
+{
+       struct rk322x_ddr_phy *ddr_phy = chan->phy;
+       struct rk322x_ddr_pctl *pctl = chan->pctl;
+       u32 value;
+       u32 bw = (readl(&ddr_phy->ddrphy_reg[0]) >> 4) & 0xf;
+       u32 ret;
+
+       /* disable auto refresh */
+       value = readl(&pctl->trefi) | (1 << 31);
+       writel(1 << 31, &pctl->trefi);
+
+       clrsetbits_le32(&ddr_phy->ddrphy_reg[2], 0x30,
+                       DQS_SQU_CAL_SEL_CS0);
+       setbits_le32(&ddr_phy->ddrphy_reg[2], DQS_SQU_CAL_START);
+
+       rockchip_udelay(30);
+       ret = readl(&ddr_phy->ddrphy_reg[0xff]);
+
+       clrbits_le32(&ddr_phy->ddrphy_reg[2],
+                    DQS_SQU_CAL_START);
+
+       /*
+        * since data training will take about 20us, so send some auto
+        * refresh(about 7.8us) to complement the lost time
+        */
+       send_command(pctl, 3, PREA_CMD, 0);
+       send_command(pctl, 3, REF_CMD, 0);
+
+       writel(value, &pctl->trefi);
+
+       if (ret & 0x10) {
+               ret = -1;
+       } else {
+               ret = (ret & 0xf) ^ bw;
+               ret = (ret == 0) ? 0 : -1;
+       }
+       return ret;
+}
+
+static void move_to_config_state(struct rk322x_ddr_pctl *pctl)
+{
+       unsigned int state;
+
+       while (1) {
+               state = readl(&pctl->stat) & PCTL_STAT_MASK;
+               switch (state) {
+               case LOW_POWER:
+                       writel(WAKEUP_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MASK)
+                               != ACCESS)
+                               ;
+                       /*
+                        * If at low power state, need wakeup first, and then
+                        * enter the config, so fallthrough
+                        */
+               case ACCESS:
+                       /* fallthrough */
+               case INIT_MEM:
+                       writel(CFG_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MASK) != CONFIG)
+                               ;
+                       break;
+               case CONFIG:
+                       return;
+               default:
+                       break;
+               }
+       }
+}
+
+static void move_to_access_state(struct rk322x_ddr_pctl *pctl)
+{
+       unsigned int state;
+
+       while (1) {
+               state = readl(&pctl->stat) & PCTL_STAT_MASK;
+               switch (state) {
+               case LOW_POWER:
+                       writel(WAKEUP_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MASK) != ACCESS)
+                               ;
+                       break;
+               case INIT_MEM:
+                       writel(CFG_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MASK) != CONFIG)
+                               ;
+                       /* fallthrough */
+               case CONFIG:
+                       writel(GO_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MASK) != ACCESS)
+                               ;
+                       break;
+               case ACCESS:
+                       return;
+               default:
+                       break;
+               }
+       }
+}
+
+static void move_to_lowpower_state(struct rk322x_ddr_pctl *pctl)
+{
+       unsigned int state;
+
+       while (1) {
+               state = readl(&pctl->stat) & PCTL_STAT_MASK;
+               switch (state) {
+               case INIT_MEM:
+                       writel(CFG_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MASK) != CONFIG)
+                               ;
+                       /* fallthrough */
+               case CONFIG:
+                       writel(GO_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MASK) != ACCESS)
+                               ;
+                       break;
+               case ACCESS:
+                       writel(SLEEP_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MASK) !=
+                              LOW_POWER)
+                               ;
+                       break;
+               case LOW_POWER:
+                       return;
+               default:
+                       break;
+               }
+       }
+}
+
+/* pctl should in low power mode when call this function */
+static void phy_softreset(struct dram_info *dram)
+{
+       struct rk322x_ddr_phy *ddr_phy = dram->chan[0].phy;
+       struct rk322x_grf *grf = dram->grf;
+
+       writel(GRF_DDRPHY_BUFFEREN_CORE_EN, &grf->soc_con[0]);
+       clrbits_le32(&ddr_phy->ddrphy_reg[0], 0x3 << 2);
+       rockchip_udelay(1);
+       setbits_le32(&ddr_phy->ddrphy_reg[0], 1 << 2);
+       rockchip_udelay(5);
+       setbits_le32(&ddr_phy->ddrphy_reg[0], 1 << 3);
+       writel(GRF_DDRPHY_BUFFEREN_CORE_DIS, &grf->soc_con[0]);
+}
+
+/* bw: 2: 32bit, 1:16bit */
+static void set_bw(struct dram_info *dram, u32 bw)
+{
+       struct rk322x_ddr_pctl *pctl = dram->chan[0].pctl;
+       struct rk322x_ddr_phy *ddr_phy = dram->chan[0].phy;
+       struct rk322x_grf *grf = dram->grf;
+
+       if (bw == 1) {
+               setbits_le32(&pctl->ppcfg, 1);
+               clrbits_le32(&ddr_phy->ddrphy_reg[0], 0xc << 4);
+               writel(GRF_MSCH_NOC_16BIT_EN, &grf->soc_con[0]);
+               clrbits_le32(&ddr_phy->ddrphy_reg[0x46], 0x8);
+               clrbits_le32(&ddr_phy->ddrphy_reg[0x56], 0x8);
+       } else {
+               clrbits_le32(&pctl->ppcfg, 1);
+               setbits_le32(&ddr_phy->ddrphy_reg[0], 0xf << 4);
+               writel(GRF_DDR_32BIT_EN | GRF_MSCH_NOC_32BIT_EN,
+                      &grf->soc_con[0]);
+               setbits_le32(&ddr_phy->ddrphy_reg[0x46], 0x8);
+               setbits_le32(&ddr_phy->ddrphy_reg[0x56], 0x8);
+       }
+}
+
+static void pctl_cfg(struct rk322x_ddr_pctl *pctl,
+                    struct rk322x_sdram_params *sdram_params,
+                    struct rk322x_grf *grf)
+{
+       u32 burst_len;
+       u32 bw;
+       u32 dramtype = sdram_params->base.dramtype;
+
+       if (sdram_params->ch[0].bw == 2)
+               bw = GRF_DDR_32BIT_EN | GRF_MSCH_NOC_32BIT_EN;
+       else
+               bw = GRF_MSCH_NOC_16BIT_EN;
+
+       writel(DFI_INIT_START | DFI_DATA_BYTE_DISABLE_EN, &pctl->dfistcfg0);
+       writel(DFI_DRAM_CLK_SR_EN | DFI_DRAM_CLK_DPD_EN, &pctl->dfistcfg1);
+       writel(DFI_PARITY_INTR_EN | DFI_PARITY_EN, &pctl->dfistcfg2);
+       writel(0x51010, &pctl->dfilpcfg0);
+
+       writel(1, &pctl->dfitphyupdtype0);
+       writel(0x0d, &pctl->dfitphyrdlat);
+       writel(0, &pctl->dfitphywrdata);
+
+       writel(0, &pctl->dfiupdcfg);
+       copy_to_reg(&pctl->togcnt1u, &sdram_params->pctl_timing.togcnt1u,
+                   sizeof(struct rk322x_pctl_timing));
+       if (dramtype == DDR3) {
+               writel((1 << 3) | (1 << 11),
+                      &pctl->dfiodtcfg);
+               writel(7 << 16, &pctl->dfiodtcfg1);
+               writel((readl(&pctl->tcl) - 1) / 2 - 1, &pctl->dfitrddataen);
+               writel((readl(&pctl->tcwl) - 1) / 2 - 1, &pctl->dfitphywrlat);
+               writel(500, &pctl->trsth);
+               writel(0 << MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT | DDR3_EN |
+                      DDR2_DDR3_BL_8 | (6 - 4) << TFAW_SHIFT | PD_EXIT_SLOW |
+                      1 << PD_TYPE_SHIFT | 0 << PD_IDLE_SHIFT,
+                      &pctl->mcfg);
+               writel(bw | GRF_DDR3_EN, &grf->soc_con[0]);
+       } else {
+               if (sdram_params->phy_timing.bl & PHT_BL_8)
+                       burst_len = MDDR_LPDDR2_BL_8;
+               else
+                       burst_len = MDDR_LPDDR2_BL_4;
+
+               writel(readl(&pctl->tcl) / 2 - 1, &pctl->dfitrddataen);
+               writel(readl(&pctl->tcwl) / 2 - 1, &pctl->dfitphywrlat);
+               writel(0, &pctl->trsth);
+               if (dramtype == LPDDR2) {
+                       writel(0 << MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT |
+                              LPDDR2_S4 | LPDDR2_EN | burst_len |
+                              (6 - 4) << TFAW_SHIFT | PD_EXIT_FAST |
+                              1 << PD_TYPE_SHIFT | 0 << PD_IDLE_SHIFT,
+                              &pctl->mcfg);
+                       writel(0, &pctl->dfiodtcfg);
+                       writel(0, &pctl->dfiodtcfg1);
+               } else {
+                       writel(0 << MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT |
+                              LPDDR2_S4 | LPDDR3_EN | burst_len |
+                              (6 - 4) << TFAW_SHIFT | PD_EXIT_FAST |
+                              1 << PD_TYPE_SHIFT | 0 << PD_IDLE_SHIFT,
+                              &pctl->mcfg);
+                       writel((1 << 3) | (1 << 2), &pctl->dfiodtcfg);
+                       writel((7 << 16) | 4, &pctl->dfiodtcfg1);
+               }
+               writel(bw | GRF_LPDDR2_3_EN, &grf->soc_con[0]);
+       }
+       setbits_le32(&pctl->scfg, 1);
+}
+
+static void phy_cfg(struct chan_info *chan,
+                   struct rk322x_sdram_params *sdram_params)
+{
+       struct rk322x_ddr_phy *ddr_phy = chan->phy;
+       struct rk322x_service_sys *axi_bus = chan->msch;
+       struct rk322x_msch_timings *noc_timing = &sdram_params->base.noc_timing;
+       struct rk322x_phy_timing *phy_timing = &sdram_params->phy_timing;
+       struct rk322x_pctl_timing *pctl_timing = &sdram_params->pctl_timing;
+       u32 cmd_drv, clk_drv, dqs_drv, dqs_odt;
+
+       writel(noc_timing->ddrtiming, &axi_bus->ddrtiming);
+       writel(noc_timing->ddrmode, &axi_bus->ddrmode);
+       writel(noc_timing->readlatency, &axi_bus->readlatency);
+       writel(noc_timing->activate, &axi_bus->activate);
+       writel(noc_timing->devtodev, &axi_bus->devtodev);
+
+       switch (sdram_params->base.dramtype) {
+       case DDR3:
+               writel(PHY_DDR3 | phy_timing->bl, &ddr_phy->ddrphy_reg[1]);
+               break;
+       case LPDDR2:
+               writel(PHY_LPDDR2 | phy_timing->bl, &ddr_phy->ddrphy_reg[1]);
+               break;
+       default:
+               writel(PHY_LPDDR2 | phy_timing->bl, &ddr_phy->ddrphy_reg[1]);
+               break;
+       }
+
+       writel(phy_timing->cl_al, &ddr_phy->ddrphy_reg[0xb]);
+       writel(pctl_timing->tcwl, &ddr_phy->ddrphy_reg[0xc]);
+
+       cmd_drv = PHY_RON_RTT_34OHM;
+       clk_drv = PHY_RON_RTT_45OHM;
+       dqs_drv = PHY_RON_RTT_34OHM;
+       if (sdram_params->base.dramtype == LPDDR2)
+               dqs_odt = PHY_RON_RTT_DISABLE;
+       else
+               dqs_odt = PHY_RON_RTT_225OHM;
+
+       writel(cmd_drv, &ddr_phy->ddrphy_reg[0x11]);
+       clrsetbits_le32(&ddr_phy->ddrphy_reg[0x12], (0x1f << 3), cmd_drv << 3);
+       writel(clk_drv, &ddr_phy->ddrphy_reg[0x16]);
+       writel(clk_drv, &ddr_phy->ddrphy_reg[0x18]);
+
+       writel(dqs_drv, &ddr_phy->ddrphy_reg[0x20]);
+       writel(dqs_drv, &ddr_phy->ddrphy_reg[0x2f]);
+       writel(dqs_drv, &ddr_phy->ddrphy_reg[0x30]);
+       writel(dqs_drv, &ddr_phy->ddrphy_reg[0x3f]);
+       writel(dqs_drv, &ddr_phy->ddrphy_reg[0x40]);
+       writel(dqs_drv, &ddr_phy->ddrphy_reg[0x4f]);
+       writel(dqs_drv, &ddr_phy->ddrphy_reg[0x50]);
+       writel(dqs_drv, &ddr_phy->ddrphy_reg[0x5f]);
+
+       writel(dqs_odt, &ddr_phy->ddrphy_reg[0x21]);
+       writel(dqs_odt, &ddr_phy->ddrphy_reg[0x2e]);
+       writel(dqs_odt, &ddr_phy->ddrphy_reg[0x31]);
+       writel(dqs_odt, &ddr_phy->ddrphy_reg[0x3e]);
+       writel(dqs_odt, &ddr_phy->ddrphy_reg[0x41]);
+       writel(dqs_odt, &ddr_phy->ddrphy_reg[0x4e]);
+       writel(dqs_odt, &ddr_phy->ddrphy_reg[0x51]);
+       writel(dqs_odt, &ddr_phy->ddrphy_reg[0x5e]);
+}
+
+void dram_cfg_rbc(struct chan_info *chan,
+                 struct rk322x_sdram_params *sdram_params)
+{
+       char noc_config;
+       int i = 0;
+       struct rk322x_sdram_channel *config = &sdram_params->ch[0];
+       struct rk322x_service_sys *axi_bus = chan->msch;
+
+       move_to_config_state(chan->pctl);
+
+       if ((config->rank == 2) && (config->cs1_row == config->cs0_row)) {
+               if ((config->col + config->bw) == 12) {
+                       i = 14;
+                       goto finish;
+               } else if ((config->col + config->bw) == 11) {
+                       i = 15;
+                       goto finish;
+               }
+       }
+       noc_config = ((config->cs0_row - 13) << 4) | ((config->bk - 2) << 2) |
+                               (config->col + config->bw - 11);
+       for (i = 0; i < 11; i++) {
+               if (noc_config == ddr_cfg_2_rbc[i])
+                       break;
+       }
+
+       if (i < 11)
+               goto finish;
+
+       noc_config = ((config->bk - 2) << 6) | ((config->cs0_row - 13) << 4) |
+                               (config->col + config->bw - 11);
+
+       for (i = 11; i < 14; i++) {
+               if (noc_config == ddr_cfg_2_rbc[i])
+                       break;
+       }
+       if (i < 14)
+               goto finish;
+       else
+               i = 0;
+
+finish:
+       writel(i, &axi_bus->ddrconf);
+       move_to_access_state(chan->pctl);
+}
+
+static void dram_all_config(const struct dram_info *dram,
+                           struct rk322x_sdram_params *sdram_params)
+{
+       struct rk322x_sdram_channel *info = &sdram_params->ch[0];
+       u32 sys_reg = 0;
+
+       sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT;
+       sys_reg |= (1 - 1) << SYS_REG_NUM_CH_SHIFT;
+       sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(0);
+       sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(0);
+       sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(0);
+       sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(0);
+       sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(0);
+       sys_reg |= (info->cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(0);
+       sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(0);
+       sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(0);
+       sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(0);
+
+       writel(sys_reg, &dram->grf->os_reg[2]);
+}
+
+#define TEST_PATTEN    0x5aa5f00f
+
+static int dram_cap_detect(struct dram_info *dram,
+                          struct rk322x_sdram_params *sdram_params)
+{
+       u32 bw, row, col, addr;
+       u32 ret = 0;
+       struct rk322x_service_sys *axi_bus = dram->chan[0].msch;
+
+       if (sdram_params->base.dramtype == DDR3)
+               sdram_params->ch[0].dbw = 1;
+       else
+               sdram_params->ch[0].dbw = 2;
+
+       move_to_config_state(dram->chan[0].pctl);
+       /* bw detect */
+       set_bw(dram, 2);
+       if (data_training(&dram->chan[0]) == 0) {
+               bw = 2;
+       } else {
+               bw = 1;
+               set_bw(dram, 1);
+               move_to_lowpower_state(dram->chan[0].pctl);
+               phy_softreset(dram);
+               move_to_config_state(dram->chan[0].pctl);
+               if (data_training(&dram->chan[0])) {
+                       printf("BW detect error\n");
+                       ret = -EINVAL;
+               }
+       }
+       sdram_params->ch[0].bw = bw;
+       sdram_params->ch[0].bk = 3;
+
+       if (bw == 2)
+               writel(6, &axi_bus->ddrconf);
+       else
+               writel(3, &axi_bus->ddrconf);
+       move_to_access_state(dram->chan[0].pctl);
+       for (col = 11; col >= 9; col--) {
+               writel(0, CONFIG_SYS_SDRAM_BASE);
+               addr = CONFIG_SYS_SDRAM_BASE +
+                       (1 << (col + bw - 1));
+               writel(TEST_PATTEN, addr);
+               if ((readl(addr) == TEST_PATTEN) &&
+                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
+                       break;
+       }
+       if (col == 8) {
+               printf("Col detect error\n");
+               ret = -EINVAL;
+               goto out;
+       } else {
+               sdram_params->ch[0].col = col;
+       }
+
+       writel(10, &axi_bus->ddrconf);
+
+       /* Detect row*/
+       for (row = 16; row >= 12; row--) {
+               writel(0, CONFIG_SYS_SDRAM_BASE);
+               addr = CONFIG_SYS_SDRAM_BASE + (1u << (row + 11 + 3 - 1));
+               writel(TEST_PATTEN, addr);
+               if ((readl(addr) == TEST_PATTEN) &&
+                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
+                       break;
+       }
+       if (row == 11) {
+               printf("Row detect error\n");
+               ret = -EINVAL;
+       } else {
+               sdram_params->ch[0].cs1_row = row;
+               sdram_params->ch[0].row_3_4 = 0;
+               sdram_params->ch[0].cs0_row = row;
+       }
+       /* cs detect */
+       writel(0, CONFIG_SYS_SDRAM_BASE);
+       writel(TEST_PATTEN, CONFIG_SYS_SDRAM_BASE + (1u << 30));
+       writel(~TEST_PATTEN, CONFIG_SYS_SDRAM_BASE + (1u << 30) + 4);
+       if ((readl(CONFIG_SYS_SDRAM_BASE + (1u << 30)) == TEST_PATTEN) &&
+           (readl(CONFIG_SYS_SDRAM_BASE) == 0))
+               sdram_params->ch[0].rank = 2;
+       else
+               sdram_params->ch[0].rank = 1;
+out:
+       return ret;
+}
+
+static int sdram_init(struct dram_info *dram,
+                     struct rk322x_sdram_params *sdram_params)
+{
+       int ret;
+
+       ret = clk_set_rate(&dram->ddr_clk,
+                          sdram_params->base.ddr_freq * MHz * 2);
+       if (ret < 0) {
+               printf("Could not set DDR clock\n");
+               return ret;
+       }
+
+       phy_pctrl_reset(dram->cru, dram->chan[0].phy);
+       phy_dll_bypass_set(dram->chan[0].phy, sdram_params->base.ddr_freq);
+       pctl_cfg(dram->chan[0].pctl, sdram_params, dram->grf);
+       phy_cfg(&dram->chan[0], sdram_params);
+       writel(POWER_UP_START, &dram->chan[0].pctl->powctl);
+       while (!(readl(&dram->chan[0].pctl->powstat) & POWER_UP_DONE))
+               ;
+       memory_init(&dram->chan[0], sdram_params);
+       move_to_access_state(dram->chan[0].pctl);
+       ret = dram_cap_detect(dram, sdram_params);
+       if (ret)
+               goto out;
+       dram_cfg_rbc(&dram->chan[0], sdram_params);
+       dram_all_config(dram, sdram_params);
+out:
+       return ret;
+}
+
+static int rk322x_dmc_ofdata_to_platdata(struct udevice *dev)
+{
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct rk322x_sdram_params *params = dev_get_platdata(dev);
+       const void *blob = gd->fdt_blob;
+       int node = dev_of_offset(dev);
+       int ret;
+
+       params->num_channels = 1;
+
+       ret = fdtdec_get_int_array(blob, node, "rockchip,pctl-timing",
+                                  (u32 *)&params->pctl_timing,
+                                  sizeof(params->pctl_timing) / sizeof(u32));
+       if (ret) {
+               printf("%s: Cannot read rockchip,pctl-timing\n", __func__);
+               return -EINVAL;
+       }
+       ret = fdtdec_get_int_array(blob, node, "rockchip,phy-timing",
+                                  (u32 *)&params->phy_timing,
+                                  sizeof(params->phy_timing) / sizeof(u32));
+       if (ret) {
+               printf("%s: Cannot read rockchip,phy-timing\n", __func__);
+               return -EINVAL;
+       }
+       ret = fdtdec_get_int_array(blob, node, "rockchip,sdram-params",
+                                  (u32 *)&params->base,
+                                  sizeof(params->base) / sizeof(u32));
+       if (ret) {
+               printf("%s: Cannot read rockchip,sdram-params\n", __func__);
+               return -EINVAL;
+       }
+       ret = regmap_init_mem(dev, &params->map);
+       if (ret)
+               return ret;
+#endif
+
+       return 0;
+}
+#endif /* CONFIG_TPL_BUILD */
+
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+static int conv_of_platdata(struct udevice *dev)
+{
+       struct rk322x_sdram_params *plat = dev_get_platdata(dev);
+       struct dtd_rockchip_rk322x_dmc *of_plat = &plat->of_plat;
+       int ret;
+
+       memcpy(&plat->pctl_timing, of_plat->rockchip_pctl_timing,
+              sizeof(plat->pctl_timing));
+       memcpy(&plat->phy_timing, of_plat->rockchip_phy_timing,
+              sizeof(plat->phy_timing));
+       memcpy(&plat->base, of_plat->rockchip_sdram_params, sizeof(plat->base));
+
+       plat->num_channels = 1;
+       ret = regmap_init_mem_platdata(dev, of_plat->reg,
+                                      ARRAY_SIZE(of_plat->reg) / 2,
+                                      &plat->map);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+#endif
+
+static int rk322x_dmc_probe(struct udevice *dev)
+{
+#ifdef CONFIG_TPL_BUILD
+       struct rk322x_sdram_params *plat = dev_get_platdata(dev);
+       int ret;
+       struct udevice *dev_clk;
+#endif
+       struct dram_info *priv = dev_get_priv(dev);
+
+       priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+#ifdef CONFIG_TPL_BUILD
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       ret = conv_of_platdata(dev);
+       if (ret)
+               return ret;
+#endif
+
+       priv->chan[0].msch = syscon_get_first_range(ROCKCHIP_SYSCON_MSCH);
+       priv->chan[0].pctl = regmap_get_range(plat->map, 0);
+       priv->chan[0].phy = regmap_get_range(plat->map, 1);
+       ret = rockchip_get_clk(&dev_clk);
+       if (ret)
+               return ret;
+       priv->ddr_clk.id = CLK_DDR;
+       ret = clk_request(dev_clk, &priv->ddr_clk);
+       if (ret)
+               return ret;
+
+       priv->cru = rockchip_get_cru();
+       if (IS_ERR(priv->cru))
+               return PTR_ERR(priv->cru);
+       ret = sdram_init(priv, plat);
+       if (ret)
+               return ret;
+#else
+       priv->info.base = CONFIG_SYS_SDRAM_BASE;
+       priv->info.size = rockchip_sdram_size(
+                       (phys_addr_t)&priv->grf->os_reg[2]);
+#endif
+
+       return 0;
+}
+
+static int rk322x_dmc_get_info(struct udevice *dev, struct ram_info *info)
+{
+       struct dram_info *priv = dev_get_priv(dev);
+
+       *info = priv->info;
+
+       return 0;
+}
+
+static struct ram_ops rk322x_dmc_ops = {
+       .get_info = rk322x_dmc_get_info,
+};
+
+static const struct udevice_id rk322x_dmc_ids[] = {
+       { .compatible = "rockchip,rk3228-dmc" },
+       { }
+};
+
+U_BOOT_DRIVER(dmc_rk322x) = {
+       .name = "rockchip_rk322x_dmc",
+       .id = UCLASS_RAM,
+       .of_match = rk322x_dmc_ids,
+       .ops = &rk322x_dmc_ops,
+#ifdef CONFIG_TPL_BUILD
+       .ofdata_to_platdata = rk322x_dmc_ofdata_to_platdata,
+#endif
+       .probe = rk322x_dmc_probe,
+       .priv_auto_alloc_size = sizeof(struct dram_info),
+#ifdef CONFIG_TPL_BUILD
+       .platdata_auto_alloc_size = sizeof(struct rk322x_sdram_params),
+#endif
+};
+
diff --git a/drivers/ram/rockchip/sdram_rk3288.c b/drivers/ram/rockchip/sdram_rk3288.c
new file mode 100644 (file)
index 0000000..95efb11
--- /dev/null
@@ -0,0 +1,1125 @@
+/*
+ * (C) Copyright 2015 Google, Inc
+ * Copyright 2014 Rockchip Inc.
+ *
+ * SPDX-License-Identifier:     GPL-2.0
+ *
+ * Adapted from coreboot.
+ */
+
+#include <common.h>
+#include <clk.h>
+#include <dm.h>
+#include <dt-structs.h>
+#include <errno.h>
+#include <ram.h>
+#include <regmap.h>
+#include <syscon.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/cru_rk3288.h>
+#include <asm/arch/ddr_rk3288.h>
+#include <asm/arch/grf_rk3288.h>
+#include <asm/arch/pmu_rk3288.h>
+#include <asm/arch/sdram.h>
+#include <asm/arch/sdram_common.h>
+#include <linux/err.h>
+#include <power/regulator.h>
+#include <power/rk8xx_pmic.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct chan_info {
+       struct rk3288_ddr_pctl *pctl;
+       struct rk3288_ddr_publ *publ;
+       struct rk3288_msch *msch;
+};
+
+struct dram_info {
+       struct chan_info chan[2];
+       struct ram_info info;
+       struct clk ddr_clk;
+       struct rk3288_cru *cru;
+       struct rk3288_grf *grf;
+       struct rk3288_sgrf *sgrf;
+       struct rk3288_pmu *pmu;
+       bool is_veyron;
+};
+
+struct rk3288_sdram_params {
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct dtd_rockchip_rk3288_dmc of_plat;
+#endif
+       struct rk3288_sdram_channel ch[2];
+       struct rk3288_sdram_pctl_timing pctl_timing;
+       struct rk3288_sdram_phy_timing phy_timing;
+       struct rk3288_base_params base;
+       int num_channels;
+       struct regmap *map;
+};
+
+const int ddrconf_table[] = {
+       /* row      col,bw */
+       0,
+       ((1 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+       ((2 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+       ((3 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+       ((4 << DDRCONF_ROW_SHIFT) | 1 << DDRCONF_COL_SHIFT),
+       ((1 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
+       ((2 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
+       ((3 << DDRCONF_ROW_SHIFT) | 2 << DDRCONF_COL_SHIFT),
+       ((1 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
+       ((2 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
+       ((3 << DDRCONF_ROW_SHIFT) | 0 << DDRCONF_COL_SHIFT),
+       0,
+       0,
+       0,
+       0,
+       ((4 << 4) | 2),
+};
+
+#define TEST_PATTEN    0x5aa5f00f
+#define DQS_GATE_TRAINING_ERROR_RANK0  (1 << 4)
+#define DQS_GATE_TRAINING_ERROR_RANK1  (2 << 4)
+
+#ifdef CONFIG_SPL_BUILD
+static void copy_to_reg(u32 *dest, const u32 *src, u32 n)
+{
+       int i;
+
+       for (i = 0; i < n / sizeof(u32); i++) {
+               writel(*src, dest);
+               src++;
+               dest++;
+       }
+}
+
+static void ddr_reset(struct rk3288_cru *cru, u32 ch, u32 ctl, u32 phy)
+{
+       u32 phy_ctl_srstn_shift = 4 + 5 * ch;
+       u32 ctl_psrstn_shift = 3 + 5 * ch;
+       u32 ctl_srstn_shift = 2 + 5 * ch;
+       u32 phy_psrstn_shift = 1 + 5 * ch;
+       u32 phy_srstn_shift = 5 * ch;
+
+       rk_clrsetreg(&cru->cru_softrst_con[10],
+                    1 << phy_ctl_srstn_shift | 1 << ctl_psrstn_shift |
+                    1 << ctl_srstn_shift | 1 << phy_psrstn_shift |
+                    1 << phy_srstn_shift,
+                    phy << phy_ctl_srstn_shift | ctl << ctl_psrstn_shift |
+                    ctl << ctl_srstn_shift | phy << phy_psrstn_shift |
+                    phy << phy_srstn_shift);
+}
+
+static void ddr_phy_ctl_reset(struct rk3288_cru *cru, u32 ch, u32 n)
+{
+       u32 phy_ctl_srstn_shift = 4 + 5 * ch;
+
+       rk_clrsetreg(&cru->cru_softrst_con[10],
+                    1 << phy_ctl_srstn_shift, n << phy_ctl_srstn_shift);
+}
+
+static void phy_pctrl_reset(struct rk3288_cru *cru,
+                           struct rk3288_ddr_publ *publ,
+                           int channel)
+{
+       int i;
+
+       ddr_reset(cru, channel, 1, 1);
+       udelay(1);
+       clrbits_le32(&publ->acdllcr, ACDLLCR_DLLSRST);
+       for (i = 0; i < 4; i++)
+               clrbits_le32(&publ->datx8[i].dxdllcr, DXDLLCR_DLLSRST);
+
+       udelay(10);
+       setbits_le32(&publ->acdllcr, ACDLLCR_DLLSRST);
+       for (i = 0; i < 4; i++)
+               setbits_le32(&publ->datx8[i].dxdllcr, DXDLLCR_DLLSRST);
+
+       udelay(10);
+       ddr_reset(cru, channel, 1, 0);
+       udelay(10);
+       ddr_reset(cru, channel, 0, 0);
+       udelay(10);
+}
+
+static void phy_dll_bypass_set(struct rk3288_ddr_publ *publ,
+       u32 freq)
+{
+       int i;
+
+       if (freq <= 250000000) {
+               if (freq <= 150000000)
+                       clrbits_le32(&publ->dllgcr, SBIAS_BYPASS);
+               else
+                       setbits_le32(&publ->dllgcr, SBIAS_BYPASS);
+               setbits_le32(&publ->acdllcr, ACDLLCR_DLLDIS);
+               for (i = 0; i < 4; i++)
+                       setbits_le32(&publ->datx8[i].dxdllcr,
+                                    DXDLLCR_DLLDIS);
+
+               setbits_le32(&publ->pir, PIR_DLLBYP);
+       } else {
+               clrbits_le32(&publ->dllgcr, SBIAS_BYPASS);
+               clrbits_le32(&publ->acdllcr, ACDLLCR_DLLDIS);
+               for (i = 0; i < 4; i++) {
+                       clrbits_le32(&publ->datx8[i].dxdllcr,
+                                    DXDLLCR_DLLDIS);
+               }
+
+               clrbits_le32(&publ->pir, PIR_DLLBYP);
+       }
+}
+
+static void dfi_cfg(struct rk3288_ddr_pctl *pctl, u32 dramtype)
+{
+       writel(DFI_INIT_START, &pctl->dfistcfg0);
+       writel(DFI_DRAM_CLK_SR_EN | DFI_DRAM_CLK_DPD_EN,
+              &pctl->dfistcfg1);
+       writel(DFI_PARITY_INTR_EN | DFI_PARITY_EN, &pctl->dfistcfg2);
+       writel(7 << TLP_RESP_TIME_SHIFT | LP_SR_EN | LP_PD_EN,
+              &pctl->dfilpcfg0);
+
+       writel(2 << TCTRL_DELAY_TIME_SHIFT, &pctl->dfitctrldelay);
+       writel(1 << TPHY_WRDATA_TIME_SHIFT, &pctl->dfitphywrdata);
+       writel(0xf << TPHY_RDLAT_TIME_SHIFT, &pctl->dfitphyrdlat);
+       writel(2 << TDRAM_CLK_DIS_TIME_SHIFT, &pctl->dfitdramclkdis);
+       writel(2 << TDRAM_CLK_EN_TIME_SHIFT, &pctl->dfitdramclken);
+       writel(1, &pctl->dfitphyupdtype0);
+
+       /* cs0 and cs1 write odt enable */
+       writel((RANK0_ODT_WRITE_SEL | RANK1_ODT_WRITE_SEL),
+              &pctl->dfiodtcfg);
+       /* odt write length */
+       writel(7 << ODT_LEN_BL8_W_SHIFT, &pctl->dfiodtcfg1);
+       /* phyupd and ctrlupd disabled */
+       writel(0, &pctl->dfiupdcfg);
+}
+
+static void ddr_set_enable(struct rk3288_grf *grf, uint channel, bool enable)
+{
+       uint val = 0;
+
+       if (enable) {
+               val = 1 << (channel ? DDR1_16BIT_EN_SHIFT :
+                               DDR0_16BIT_EN_SHIFT);
+       }
+       rk_clrsetreg(&grf->soc_con0,
+                    1 << (channel ? DDR1_16BIT_EN_SHIFT : DDR0_16BIT_EN_SHIFT),
+                    val);
+}
+
+static void ddr_set_ddr3_mode(struct rk3288_grf *grf, uint channel,
+                             bool ddr3_mode)
+{
+       uint mask, val;
+
+       mask = 1 << (channel ? MSCH1_MAINDDR3_SHIFT : MSCH0_MAINDDR3_SHIFT);
+       val = ddr3_mode << (channel ? MSCH1_MAINDDR3_SHIFT :
+                                       MSCH0_MAINDDR3_SHIFT);
+       rk_clrsetreg(&grf->soc_con0, mask, val);
+}
+
+static void ddr_set_en_bst_odt(struct rk3288_grf *grf, uint channel,
+                              bool enable, bool enable_bst, bool enable_odt)
+{
+       uint mask;
+       bool disable_bst = !enable_bst;
+
+       mask = channel ?
+               (1 << LPDDR3_EN1_SHIFT | 1 << UPCTL1_BST_DIABLE_SHIFT |
+                       1 << UPCTL1_LPDDR3_ODT_EN_SHIFT) :
+               (1 << LPDDR3_EN0_SHIFT | 1 << UPCTL0_BST_DIABLE_SHIFT |
+                       1 << UPCTL0_LPDDR3_ODT_EN_SHIFT);
+       rk_clrsetreg(&grf->soc_con2, mask,
+                    enable << (channel ? LPDDR3_EN1_SHIFT : LPDDR3_EN0_SHIFT) |
+                    disable_bst << (channel ? UPCTL1_BST_DIABLE_SHIFT :
+                               UPCTL0_BST_DIABLE_SHIFT) |
+                    enable_odt << (channel ? UPCTL1_LPDDR3_ODT_EN_SHIFT :
+                               UPCTL0_LPDDR3_ODT_EN_SHIFT));
+}
+
+static void pctl_cfg(int channel, struct rk3288_ddr_pctl *pctl,
+                    struct rk3288_sdram_params *sdram_params,
+                    struct rk3288_grf *grf)
+{
+       unsigned int burstlen;
+
+       burstlen = (sdram_params->base.noc_timing >> 18) & 0x7;
+       copy_to_reg(&pctl->togcnt1u, &sdram_params->pctl_timing.togcnt1u,
+                   sizeof(sdram_params->pctl_timing));
+       switch (sdram_params->base.dramtype) {
+       case LPDDR3:
+               writel(sdram_params->pctl_timing.tcl - 1,
+                      &pctl->dfitrddataen);
+               writel(sdram_params->pctl_timing.tcwl,
+                      &pctl->dfitphywrlat);
+               burstlen >>= 1;
+               writel(LPDDR2_S4 | 0 << MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT |
+                      LPDDR2_EN | burstlen << BURSTLENGTH_SHIFT |
+                      (6 - 4) << TFAW_SHIFT | PD_EXIT_FAST |
+                      1 << PD_TYPE_SHIFT | 0 << PD_IDLE_SHIFT,
+                      &pctl->mcfg);
+               ddr_set_ddr3_mode(grf, channel, false);
+               ddr_set_enable(grf, channel, true);
+               ddr_set_en_bst_odt(grf, channel, true, false,
+                                  sdram_params->base.odt);
+               break;
+       case DDR3:
+               if (sdram_params->phy_timing.mr[1] & DDR3_DLL_DISABLE) {
+                       writel(sdram_params->pctl_timing.tcl - 3,
+                              &pctl->dfitrddataen);
+               } else {
+                       writel(sdram_params->pctl_timing.tcl - 2,
+                              &pctl->dfitrddataen);
+               }
+               writel(sdram_params->pctl_timing.tcwl - 1,
+                      &pctl->dfitphywrlat);
+               writel(0 << MDDR_LPDDR2_CLK_STOP_IDLE_SHIFT | DDR3_EN |
+                      DDR2_DDR3_BL_8 | (6 - 4) << TFAW_SHIFT | PD_EXIT_SLOW |
+                      1 << PD_TYPE_SHIFT | 0 << PD_IDLE_SHIFT,
+                      &pctl->mcfg);
+               ddr_set_ddr3_mode(grf, channel, true);
+               ddr_set_enable(grf, channel, true);
+
+               ddr_set_en_bst_odt(grf, channel, false, true, false);
+               break;
+       }
+
+       setbits_le32(&pctl->scfg, 1);
+}
+
+static void phy_cfg(const struct chan_info *chan, int channel,
+                   struct rk3288_sdram_params *sdram_params)
+{
+       struct rk3288_ddr_publ *publ = chan->publ;
+       struct rk3288_msch *msch = chan->msch;
+       uint ddr_freq_mhz = sdram_params->base.ddr_freq / 1000000;
+       u32 dinit2, tmp;
+       int i;
+
+       dinit2 = DIV_ROUND_UP(ddr_freq_mhz * 200000, 1000);
+       /* DDR PHY Timing */
+       copy_to_reg(&publ->dtpr[0], &sdram_params->phy_timing.dtpr0,
+                   sizeof(sdram_params->phy_timing));
+       writel(sdram_params->base.noc_timing, &msch->ddrtiming);
+       writel(0x3f, &msch->readlatency);
+       writel(sdram_params->base.noc_activate, &msch->activate);
+       writel(2 << BUSWRTORD_SHIFT | 2 << BUSRDTOWR_SHIFT |
+              1 << BUSRDTORD_SHIFT, &msch->devtodev);
+       writel(DIV_ROUND_UP(ddr_freq_mhz * 5120, 1000) << PRT_DLLLOCK_SHIFT |
+              DIV_ROUND_UP(ddr_freq_mhz * 50, 1000) << PRT_DLLSRST_SHIFT |
+              8 << PRT_ITMSRST_SHIFT, &publ->ptr[0]);
+       writel(DIV_ROUND_UP(ddr_freq_mhz * 500000, 1000) << PRT_DINIT0_SHIFT |
+              DIV_ROUND_UP(ddr_freq_mhz * 400, 1000) << PRT_DINIT1_SHIFT,
+              &publ->ptr[1]);
+       writel(min(dinit2, 0x1ffffU) << PRT_DINIT2_SHIFT |
+              DIV_ROUND_UP(ddr_freq_mhz * 1000, 1000) << PRT_DINIT3_SHIFT,
+              &publ->ptr[2]);
+
+       switch (sdram_params->base.dramtype) {
+       case LPDDR3:
+               clrsetbits_le32(&publ->pgcr, 0x1F,
+                               0 << PGCR_DFTLMT_SHIFT |
+                               0 << PGCR_DFTCMP_SHIFT |
+                               1 << PGCR_DQSCFG_SHIFT |
+                               0 << PGCR_ITMDMD_SHIFT);
+               /* DDRMODE select LPDDR3 */
+               clrsetbits_le32(&publ->dcr, DDRMD_MASK << DDRMD_SHIFT,
+                               DDRMD_LPDDR2_LPDDR3 << DDRMD_SHIFT);
+               clrsetbits_le32(&publ->dxccr,
+                               DQSNRES_MASK << DQSNRES_SHIFT |
+                               DQSRES_MASK << DQSRES_SHIFT,
+                               4 << DQSRES_SHIFT | 0xc << DQSNRES_SHIFT);
+               tmp = readl(&publ->dtpr[1]);
+               tmp = ((tmp >> TDQSCKMAX_SHIFT) & TDQSCKMAX_MASK) -
+                       ((tmp >> TDQSCK_SHIFT) & TDQSCK_MASK);
+               clrsetbits_le32(&publ->dsgcr,
+                               DQSGE_MASK << DQSGE_SHIFT |
+                               DQSGX_MASK << DQSGX_SHIFT,
+                               tmp << DQSGE_SHIFT | tmp << DQSGX_SHIFT);
+               break;
+       case DDR3:
+               clrbits_le32(&publ->pgcr, 0x1f);
+               clrsetbits_le32(&publ->dcr, DDRMD_MASK << DDRMD_SHIFT,
+                               DDRMD_DDR3 << DDRMD_SHIFT);
+               break;
+       }
+       if (sdram_params->base.odt) {
+               /*dynamic RTT enable */
+               for (i = 0; i < 4; i++)
+                       setbits_le32(&publ->datx8[i].dxgcr, DQSRTT | DQRTT);
+       } else {
+               /*dynamic RTT disable */
+               for (i = 0; i < 4; i++)
+                       clrbits_le32(&publ->datx8[i].dxgcr, DQSRTT | DQRTT);
+       }
+}
+
+static void phy_init(struct rk3288_ddr_publ *publ)
+{
+       setbits_le32(&publ->pir, PIR_INIT | PIR_DLLSRST
+               | PIR_DLLLOCK | PIR_ZCAL | PIR_ITMSRST | PIR_CLRSR);
+       udelay(1);
+       while ((readl(&publ->pgsr) &
+               (PGSR_IDONE | PGSR_DLDONE | PGSR_ZCDONE)) !=
+               (PGSR_IDONE | PGSR_DLDONE | PGSR_ZCDONE))
+               ;
+}
+
+static void send_command(struct rk3288_ddr_pctl *pctl, u32 rank,
+                        u32 cmd, u32 arg)
+{
+       writel((START_CMD | (rank << 20) | arg | cmd), &pctl->mcmd);
+       udelay(1);
+       while (readl(&pctl->mcmd) & START_CMD)
+               ;
+}
+
+static inline void send_command_op(struct rk3288_ddr_pctl *pctl,
+                                  u32 rank, u32 cmd, u32 ma, u32 op)
+{
+       send_command(pctl, rank, cmd, (ma & LPDDR2_MA_MASK) << LPDDR2_MA_SHIFT |
+                    (op & LPDDR2_OP_MASK) << LPDDR2_OP_SHIFT);
+}
+
+static void memory_init(struct rk3288_ddr_publ *publ,
+                       u32 dramtype)
+{
+       setbits_le32(&publ->pir,
+                    (PIR_INIT | PIR_DRAMINIT | PIR_LOCKBYP
+                     | PIR_ZCALBYP | PIR_CLRSR | PIR_ICPC
+                     | (dramtype == DDR3 ? PIR_DRAMRST : 0)));
+       udelay(1);
+       while ((readl(&publ->pgsr) & (PGSR_IDONE | PGSR_DLDONE))
+               != (PGSR_IDONE | PGSR_DLDONE))
+               ;
+}
+
+static void move_to_config_state(struct rk3288_ddr_publ *publ,
+                                struct rk3288_ddr_pctl *pctl)
+{
+       unsigned int state;
+
+       while (1) {
+               state = readl(&pctl->stat) & PCTL_STAT_MSK;
+
+               switch (state) {
+               case LOW_POWER:
+                       writel(WAKEUP_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK)
+                               != ACCESS)
+                               ;
+                       /* wait DLL lock */
+                       while ((readl(&publ->pgsr) & PGSR_DLDONE)
+                               != PGSR_DLDONE)
+                               ;
+                       /*
+                        * if at low power state,need wakeup first,
+                        * and then enter the config
+                        * so here no break.
+                        */
+               case ACCESS:
+                       /* no break */
+               case INIT_MEM:
+                       writel(CFG_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != CONFIG)
+                               ;
+                       break;
+               case CONFIG:
+                       return;
+               default:
+                       break;
+               }
+       }
+}
+
+static void set_bandwidth_ratio(const struct chan_info *chan, int channel,
+                               u32 n, struct rk3288_grf *grf)
+{
+       struct rk3288_ddr_pctl *pctl = chan->pctl;
+       struct rk3288_ddr_publ *publ = chan->publ;
+       struct rk3288_msch *msch = chan->msch;
+
+       if (n == 1) {
+               setbits_le32(&pctl->ppcfg, 1);
+               rk_setreg(&grf->soc_con0, 1 << (8 + channel));
+               setbits_le32(&msch->ddrtiming, 1 << 31);
+               /* Data Byte disable*/
+               clrbits_le32(&publ->datx8[2].dxgcr, 1);
+               clrbits_le32(&publ->datx8[3].dxgcr, 1);
+               /* disable DLL */
+               setbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLDIS);
+               setbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLDIS);
+       } else {
+               clrbits_le32(&pctl->ppcfg, 1);
+               rk_clrreg(&grf->soc_con0, 1 << (8 + channel));
+               clrbits_le32(&msch->ddrtiming, 1 << 31);
+               /* Data Byte enable*/
+               setbits_le32(&publ->datx8[2].dxgcr, 1);
+               setbits_le32(&publ->datx8[3].dxgcr, 1);
+
+               /* enable DLL */
+               clrbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLDIS);
+               clrbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLDIS);
+               /* reset DLL */
+               clrbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLSRST);
+               clrbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLSRST);
+               udelay(10);
+               setbits_le32(&publ->datx8[2].dxdllcr, DXDLLCR_DLLSRST);
+               setbits_le32(&publ->datx8[3].dxdllcr, DXDLLCR_DLLSRST);
+       }
+       setbits_le32(&pctl->dfistcfg0, 1 << 2);
+}
+
+static int data_training(const struct chan_info *chan, int channel,
+                        struct rk3288_sdram_params *sdram_params)
+{
+       unsigned int j;
+       int ret = 0;
+       u32 rank;
+       int i;
+       u32 step[2] = { PIR_QSTRN, PIR_RVTRN };
+       struct rk3288_ddr_publ *publ = chan->publ;
+       struct rk3288_ddr_pctl *pctl = chan->pctl;
+
+       /* disable auto refresh */
+       writel(0, &pctl->trefi);
+
+       if (sdram_params->base.dramtype != LPDDR3)
+               setbits_le32(&publ->pgcr, 1 << PGCR_DQSCFG_SHIFT);
+       rank = sdram_params->ch[channel].rank | 1;
+       for (j = 0; j < ARRAY_SIZE(step); j++) {
+               /*
+                * trigger QSTRN and RVTRN
+                * clear DTDONE status
+                */
+               setbits_le32(&publ->pir, PIR_CLRSR);
+
+               /* trigger DTT */
+               setbits_le32(&publ->pir,
+                            PIR_INIT | step[j] | PIR_LOCKBYP | PIR_ZCALBYP |
+                            PIR_CLRSR);
+               udelay(1);
+               /* wait echo byte DTDONE */
+               while ((readl(&publ->datx8[0].dxgsr[0]) & rank)
+                       != rank)
+                       ;
+               while ((readl(&publ->datx8[1].dxgsr[0]) & rank)
+                       != rank)
+                       ;
+               if (!(readl(&pctl->ppcfg) & 1)) {
+                       while ((readl(&publ->datx8[2].dxgsr[0])
+                               & rank) != rank)
+                               ;
+                       while ((readl(&publ->datx8[3].dxgsr[0])
+                               & rank) != rank)
+                               ;
+               }
+               if (readl(&publ->pgsr) &
+                   (PGSR_DTERR | PGSR_RVERR | PGSR_RVEIRR)) {
+                       ret = -1;
+                       break;
+               }
+       }
+       /* send some auto refresh to complement the lost while DTT */
+       for (i = 0; i < (rank > 1 ? 8 : 4); i++)
+               send_command(pctl, rank, REF_CMD, 0);
+
+       if (sdram_params->base.dramtype != LPDDR3)
+               clrbits_le32(&publ->pgcr, 1 << PGCR_DQSCFG_SHIFT);
+
+       /* resume auto refresh */
+       writel(sdram_params->pctl_timing.trefi, &pctl->trefi);
+
+       return ret;
+}
+
+static void move_to_access_state(const struct chan_info *chan)
+{
+       struct rk3288_ddr_publ *publ = chan->publ;
+       struct rk3288_ddr_pctl *pctl = chan->pctl;
+       unsigned int state;
+
+       while (1) {
+               state = readl(&pctl->stat) & PCTL_STAT_MSK;
+
+               switch (state) {
+               case LOW_POWER:
+                       if (((readl(&pctl->stat) >> LP_TRIG_SHIFT) &
+                                       LP_TRIG_MASK) == 1)
+                               return;
+
+                       writel(WAKEUP_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != ACCESS)
+                               ;
+                       /* wait DLL lock */
+                       while ((readl(&publ->pgsr) & PGSR_DLDONE)
+                               != PGSR_DLDONE)
+                               ;
+                       break;
+               case INIT_MEM:
+                       writel(CFG_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) != CONFIG)
+                               ;
+               case CONFIG:
+                       writel(GO_STATE, &pctl->sctl);
+                       while ((readl(&pctl->stat) & PCTL_STAT_MSK) == CONFIG)
+                               ;
+                       break;
+               case ACCESS:
+                       return;
+               default:
+                       break;
+               }
+       }
+}
+
+static void dram_cfg_rbc(const struct chan_info *chan, u32 chnum,
+                        struct rk3288_sdram_params *sdram_params)
+{
+       struct rk3288_ddr_publ *publ = chan->publ;
+
+       if (sdram_params->ch[chnum].bk == 3)
+               clrsetbits_le32(&publ->dcr, PDQ_MASK << PDQ_SHIFT,
+                               1 << PDQ_SHIFT);
+       else
+               clrbits_le32(&publ->dcr, PDQ_MASK << PDQ_SHIFT);
+
+       writel(sdram_params->base.ddrconfig, &chan->msch->ddrconf);
+}
+
+static void dram_all_config(const struct dram_info *dram,
+                           struct rk3288_sdram_params *sdram_params)
+{
+       unsigned int chan;
+       u32 sys_reg = 0;
+
+       sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT;
+       sys_reg |= (sdram_params->num_channels - 1) << SYS_REG_NUM_CH_SHIFT;
+       for (chan = 0; chan < sdram_params->num_channels; chan++) {
+               const struct rk3288_sdram_channel *info =
+                       &sdram_params->ch[chan];
+
+               sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(chan);
+               sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(chan);
+               sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(chan);
+               sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(chan);
+               sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(chan);
+               sys_reg |= (info->cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(chan);
+               sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(chan);
+               sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(chan);
+               sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(chan);
+
+               dram_cfg_rbc(&dram->chan[chan], chan, sdram_params);
+       }
+       writel(sys_reg, &dram->pmu->sys_reg[2]);
+       rk_clrsetreg(&dram->sgrf->soc_con2, 0x1f, sdram_params->base.stride);
+}
+
+static int sdram_rank_bw_detect(struct dram_info *dram, int channel,
+               struct rk3288_sdram_params *sdram_params)
+{
+       int reg;
+       int need_trainig = 0;
+       const struct chan_info *chan = &dram->chan[channel];
+       struct rk3288_ddr_publ *publ = chan->publ;
+
+       if (data_training(chan, channel, sdram_params) < 0) {
+               reg = readl(&publ->datx8[0].dxgsr[0]);
+               /* Check the result for rank 0 */
+               if ((channel == 0) && (reg & DQS_GATE_TRAINING_ERROR_RANK0)) {
+                       debug("data training fail!\n");
+                       return -EIO;
+               } else if ((channel == 1) &&
+                          (reg & DQS_GATE_TRAINING_ERROR_RANK0)) {
+                       sdram_params->num_channels = 1;
+               }
+
+               /* Check the result for rank 1 */
+               if (reg & DQS_GATE_TRAINING_ERROR_RANK1) {
+                       sdram_params->ch[channel].rank = 1;
+                       clrsetbits_le32(&publ->pgcr, 0xF << 18,
+                                       sdram_params->ch[channel].rank << 18);
+                       need_trainig = 1;
+               }
+               reg = readl(&publ->datx8[2].dxgsr[0]);
+               if (reg & (1 << 4)) {
+                       sdram_params->ch[channel].bw = 1;
+                       set_bandwidth_ratio(chan, channel,
+                                           sdram_params->ch[channel].bw,
+                                           dram->grf);
+                       need_trainig = 1;
+               }
+       }
+       /* Assume the Die bit width are the same with the chip bit width */
+       sdram_params->ch[channel].dbw = sdram_params->ch[channel].bw;
+
+       if (need_trainig &&
+           (data_training(chan, channel, sdram_params) < 0)) {
+               if (sdram_params->base.dramtype == LPDDR3) {
+                       ddr_phy_ctl_reset(dram->cru, channel, 1);
+                       udelay(10);
+                       ddr_phy_ctl_reset(dram->cru, channel, 0);
+                       udelay(10);
+               }
+               debug("2nd data training failed!");
+               return -EIO;
+       }
+
+       return 0;
+}
+
+static int sdram_col_row_detect(struct dram_info *dram, int channel,
+               struct rk3288_sdram_params *sdram_params)
+{
+       int row, col;
+       unsigned int addr;
+       const struct chan_info *chan = &dram->chan[channel];
+       struct rk3288_ddr_pctl *pctl = chan->pctl;
+       struct rk3288_ddr_publ *publ = chan->publ;
+       int ret = 0;
+
+       /* Detect col */
+       for (col = 11; col >= 9; col--) {
+               writel(0, CONFIG_SYS_SDRAM_BASE);
+               addr = CONFIG_SYS_SDRAM_BASE +
+                       (1 << (col + sdram_params->ch[channel].bw - 1));
+               writel(TEST_PATTEN, addr);
+               if ((readl(addr) == TEST_PATTEN) &&
+                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
+                       break;
+       }
+       if (col == 8) {
+               printf("Col detect error\n");
+               ret = -EINVAL;
+               goto out;
+       } else {
+               sdram_params->ch[channel].col = col;
+       }
+
+       move_to_config_state(publ, pctl);
+       writel(4, &chan->msch->ddrconf);
+       move_to_access_state(chan);
+       /* Detect row*/
+       for (row = 16; row >= 12; row--) {
+               writel(0, CONFIG_SYS_SDRAM_BASE);
+               addr = CONFIG_SYS_SDRAM_BASE + (1 << (row + 15 - 1));
+               writel(TEST_PATTEN, addr);
+               if ((readl(addr) == TEST_PATTEN) &&
+                   (readl(CONFIG_SYS_SDRAM_BASE) == 0))
+                       break;
+       }
+       if (row == 11) {
+               printf("Row detect error\n");
+               ret = -EINVAL;
+       } else {
+               sdram_params->ch[channel].cs1_row = row;
+               sdram_params->ch[channel].row_3_4 = 0;
+               debug("chn %d col %d, row %d\n", channel, col, row);
+               sdram_params->ch[channel].cs0_row = row;
+       }
+
+out:
+       return ret;
+}
+
+static int sdram_get_niu_config(struct rk3288_sdram_params *sdram_params)
+{
+       int i, tmp, size, ret = 0;
+
+       tmp = sdram_params->ch[0].col - 9;
+       tmp -= (sdram_params->ch[0].bw == 2) ? 0 : 1;
+       tmp |= ((sdram_params->ch[0].cs0_row - 12) << 4);
+       size = sizeof(ddrconf_table)/sizeof(ddrconf_table[0]);
+       for (i = 0; i < size; i++)
+               if (tmp == ddrconf_table[i])
+                       break;
+       if (i >= size) {
+               printf("niu config not found\n");
+               ret = -EINVAL;
+       } else {
+               sdram_params->base.ddrconfig = i;
+       }
+
+       return ret;
+}
+
+static int sdram_get_stride(struct rk3288_sdram_params *sdram_params)
+{
+       int stride = -1;
+       int ret = 0;
+       long cap = sdram_params->num_channels * (1u <<
+                       (sdram_params->ch[0].cs0_row +
+                        sdram_params->ch[0].col +
+                        (sdram_params->ch[0].rank - 1) +
+                        sdram_params->ch[0].bw +
+                        3 - 20));
+
+       switch (cap) {
+       case 512:
+               stride = 0;
+               break;
+       case 1024:
+               stride = 5;
+               break;
+       case 2048:
+               stride = 9;
+               break;
+       case 4096:
+               stride = 0xd;
+               break;
+       default:
+               stride = -1;
+               printf("could not find correct stride, cap error!\n");
+               ret = -EINVAL;
+               break;
+       }
+       sdram_params->base.stride = stride;
+
+       return ret;
+}
+
+static int sdram_init(struct dram_info *dram,
+                     struct rk3288_sdram_params *sdram_params)
+{
+       int channel;
+       int zqcr;
+       int ret;
+
+       debug("%s start\n", __func__);
+       if ((sdram_params->base.dramtype == DDR3 &&
+            sdram_params->base.ddr_freq > 800000000) ||
+           (sdram_params->base.dramtype == LPDDR3 &&
+            sdram_params->base.ddr_freq > 533000000)) {
+               debug("SDRAM frequency is too high!");
+               return -E2BIG;
+       }
+
+       debug("ddr clk dpll\n");
+       ret = clk_set_rate(&dram->ddr_clk, sdram_params->base.ddr_freq);
+       debug("ret=%d\n", ret);
+       if (ret) {
+               debug("Could not set DDR clock\n");
+               return ret;
+       }
+
+       for (channel = 0; channel < 2; channel++) {
+               const struct chan_info *chan = &dram->chan[channel];
+               struct rk3288_ddr_pctl *pctl = chan->pctl;
+               struct rk3288_ddr_publ *publ = chan->publ;
+
+               /* map all the 4GB space to the current channel */
+               if (channel)
+                       rk_clrsetreg(&dram->sgrf->soc_con2, 0x1f, 0x17);
+               else
+                       rk_clrsetreg(&dram->sgrf->soc_con2, 0x1f, 0x1a);
+               phy_pctrl_reset(dram->cru, publ, channel);
+               phy_dll_bypass_set(publ, sdram_params->base.ddr_freq);
+
+               dfi_cfg(pctl, sdram_params->base.dramtype);
+
+               pctl_cfg(channel, pctl, sdram_params, dram->grf);
+
+               phy_cfg(chan, channel, sdram_params);
+
+               phy_init(publ);
+
+               writel(POWER_UP_START, &pctl->powctl);
+               while (!(readl(&pctl->powstat) & POWER_UP_DONE))
+                       ;
+
+               memory_init(publ, sdram_params->base.dramtype);
+               move_to_config_state(publ, pctl);
+
+               if (sdram_params->base.dramtype == LPDDR3) {
+                       send_command(pctl, 3, DESELECT_CMD, 0);
+                       udelay(1);
+                       send_command(pctl, 3, PREA_CMD, 0);
+                       udelay(1);
+                       send_command_op(pctl, 3, MRS_CMD, 63, 0xfc);
+                       udelay(1);
+                       send_command_op(pctl, 3, MRS_CMD, 1,
+                                       sdram_params->phy_timing.mr[1]);
+                       udelay(1);
+                       send_command_op(pctl, 3, MRS_CMD, 2,
+                                       sdram_params->phy_timing.mr[2]);
+                       udelay(1);
+                       send_command_op(pctl, 3, MRS_CMD, 3,
+                                       sdram_params->phy_timing.mr[3]);
+                       udelay(1);
+               }
+
+               /* Using 32bit bus width for detect */
+               sdram_params->ch[channel].bw = 2;
+               set_bandwidth_ratio(chan, channel,
+                                   sdram_params->ch[channel].bw, dram->grf);
+               /*
+                * set cs, using n=3 for detect
+                * CS0, n=1
+                * CS1, n=2
+                * CS0 & CS1, n = 3
+                */
+               sdram_params->ch[channel].rank = 2,
+               clrsetbits_le32(&publ->pgcr, 0xF << 18,
+                               (sdram_params->ch[channel].rank | 1) << 18);
+
+               /* DS=40ohm,ODT=155ohm */
+               zqcr = 1 << ZDEN_SHIFT | 2 << PU_ONDIE_SHIFT |
+                       2 << PD_ONDIE_SHIFT | 0x19 << PU_OUTPUT_SHIFT |
+                       0x19 << PD_OUTPUT_SHIFT;
+               writel(zqcr, &publ->zq1cr[0]);
+               writel(zqcr, &publ->zq0cr[0]);
+
+               if (sdram_params->base.dramtype == LPDDR3) {
+                       /* LPDDR2/LPDDR3 need to wait DAI complete, max 10us */
+                       udelay(10);
+                       send_command_op(pctl,
+                                       sdram_params->ch[channel].rank | 1,
+                                       MRS_CMD, 11,
+                                       sdram_params->base.odt ? 3 : 0);
+                       if (channel == 0) {
+                               writel(0, &pctl->mrrcfg0);
+                               send_command_op(pctl, 1, MRR_CMD, 8, 0);
+                               /* S8 */
+                               if ((readl(&pctl->mrrstat0) & 0x3) != 3) {
+                                       debug("failed!");
+                                       return -EREMOTEIO;
+                               }
+                       }
+               }
+
+               /* Detect the rank and bit-width with data-training */
+               sdram_rank_bw_detect(dram, channel, sdram_params);
+
+               if (sdram_params->base.dramtype == LPDDR3) {
+                       u32 i;
+                       writel(0, &pctl->mrrcfg0);
+                       for (i = 0; i < 17; i++)
+                               send_command_op(pctl, 1, MRR_CMD, i, 0);
+               }
+               writel(15, &chan->msch->ddrconf);
+               move_to_access_state(chan);
+               /* DDR3 and LPDDR3 are always 8 bank, no need detect */
+               sdram_params->ch[channel].bk = 3;
+               /* Detect Col and Row number*/
+               ret = sdram_col_row_detect(dram, channel, sdram_params);
+               if (ret)
+                       goto error;
+       }
+       /* Find NIU DDR configuration */
+       ret = sdram_get_niu_config(sdram_params);
+       if (ret)
+               goto error;
+       /* Find stride setting */
+       ret = sdram_get_stride(sdram_params);
+       if (ret)
+               goto error;
+
+       dram_all_config(dram, sdram_params);
+       debug("%s done\n", __func__);
+
+       return 0;
+error:
+       printf("DRAM init failed!\n");
+       hang();
+}
+
+# ifdef CONFIG_ROCKCHIP_FAST_SPL
+static int veyron_init(struct dram_info *priv)
+{
+       struct udevice *pmic;
+       int ret;
+
+       ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
+       if (ret)
+               return ret;
+
+       /* Slowly raise to max CPU voltage to prevent overshoot */
+       ret = rk8xx_spl_configure_buck(pmic, 1, 1200000);
+       if (ret)
+               return ret;
+       udelay(175);/* Must wait for voltage to stabilize, 2mV/us */
+       ret = rk8xx_spl_configure_buck(pmic, 1, 1400000);
+       if (ret)
+               return ret;
+       udelay(100);/* Must wait for voltage to stabilize, 2mV/us */
+
+       rk3288_clk_configure_cpu(priv->cru, priv->grf);
+
+       return 0;
+}
+# endif
+
+static int setup_sdram(struct udevice *dev)
+{
+       struct dram_info *priv = dev_get_priv(dev);
+       struct rk3288_sdram_params *params = dev_get_platdata(dev);
+
+# ifdef CONFIG_ROCKCHIP_FAST_SPL
+       if (priv->is_veyron) {
+               int ret;
+
+               ret = veyron_init(priv);
+               if (ret)
+                       return ret;
+       }
+# endif
+
+       return sdram_init(priv, params);
+}
+
+static int rk3288_dmc_ofdata_to_platdata(struct udevice *dev)
+{
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct rk3288_sdram_params *params = dev_get_platdata(dev);
+       int ret;
+
+       /* Rk3288 supports dual-channel, set default channel num to 2 */
+       params->num_channels = 2;
+       ret = dev_read_u32_array(dev, "rockchip,pctl-timing",
+                                (u32 *)&params->pctl_timing,
+                                sizeof(params->pctl_timing) / sizeof(u32));
+       if (ret) {
+               debug("%s: Cannot read rockchip,pctl-timing\n", __func__);
+               return -EINVAL;
+       }
+       ret = dev_read_u32_array(dev, "rockchip,phy-timing",
+                                (u32 *)&params->phy_timing,
+                                sizeof(params->phy_timing) / sizeof(u32));
+       if (ret) {
+               debug("%s: Cannot read rockchip,phy-timing\n", __func__);
+               return -EINVAL;
+       }
+       ret = dev_read_u32_array(dev, "rockchip,sdram-params",
+                                (u32 *)&params->base,
+                                sizeof(params->base) / sizeof(u32));
+       if (ret) {
+               debug("%s: Cannot read rockchip,sdram-params\n", __func__);
+               return -EINVAL;
+       }
+#ifdef CONFIG_ROCKCHIP_FAST_SPL
+       struct dram_info *priv = dev_get_priv(dev);
+
+       priv->is_veyron = !fdt_node_check_compatible(blob, 0, "google,veyron");
+#endif
+       ret = regmap_init_mem(dev, &params->map);
+       if (ret)
+               return ret;
+#endif
+
+       return 0;
+}
+#endif /* CONFIG_SPL_BUILD */
+
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+static int conv_of_platdata(struct udevice *dev)
+{
+       struct rk3288_sdram_params *plat = dev_get_platdata(dev);
+       struct dtd_rockchip_rk3288_dmc *of_plat = &plat->of_plat;
+       int ret;
+
+       memcpy(&plat->pctl_timing, of_plat->rockchip_pctl_timing,
+              sizeof(plat->pctl_timing));
+       memcpy(&plat->phy_timing, of_plat->rockchip_phy_timing,
+              sizeof(plat->phy_timing));
+       memcpy(&plat->base, of_plat->rockchip_sdram_params, sizeof(plat->base));
+       /* Rk3288 supports dual-channel, set default channel num to 2 */
+       plat->num_channels = 2;
+       ret = regmap_init_mem_platdata(dev, of_plat->reg,
+                                      ARRAY_SIZE(of_plat->reg) / 2,
+                                      &plat->map);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+#endif
+
+static int rk3288_dmc_probe(struct udevice *dev)
+{
+#ifdef CONFIG_SPL_BUILD
+       struct rk3288_sdram_params *plat = dev_get_platdata(dev);
+       struct udevice *dev_clk;
+       struct regmap *map;
+       int ret;
+#endif
+       struct dram_info *priv = dev_get_priv(dev);
+
+       priv->pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU);
+#ifdef CONFIG_SPL_BUILD
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       ret = conv_of_platdata(dev);
+       if (ret)
+               return ret;
+#endif
+       map = syscon_get_regmap_by_driver_data(ROCKCHIP_SYSCON_NOC);
+       if (IS_ERR(map))
+               return PTR_ERR(map);
+       priv->chan[0].msch = regmap_get_range(map, 0);
+       priv->chan[1].msch = (struct rk3288_msch *)
+                       (regmap_get_range(map, 0) + 0x80);
+
+       priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+       priv->sgrf = syscon_get_first_range(ROCKCHIP_SYSCON_SGRF);
+
+       priv->chan[0].pctl = regmap_get_range(plat->map, 0);
+       priv->chan[0].publ = regmap_get_range(plat->map, 1);
+       priv->chan[1].pctl = regmap_get_range(plat->map, 2);
+       priv->chan[1].publ = regmap_get_range(plat->map, 3);
+
+       ret = rockchip_get_clk(&dev_clk);
+       if (ret)
+               return ret;
+       priv->ddr_clk.id = CLK_DDR;
+       ret = clk_request(dev_clk, &priv->ddr_clk);
+       if (ret)
+               return ret;
+
+       priv->cru = rockchip_get_cru();
+       if (IS_ERR(priv->cru))
+               return PTR_ERR(priv->cru);
+       ret = setup_sdram(dev);
+       if (ret)
+               return ret;
+#else
+       priv->info.base = CONFIG_SYS_SDRAM_BASE;
+       priv->info.size = rockchip_sdram_size(
+                       (phys_addr_t)&priv->pmu->sys_reg[2]);
+#endif
+
+       return 0;
+}
+
+static int rk3288_dmc_get_info(struct udevice *dev, struct ram_info *info)
+{
+       struct dram_info *priv = dev_get_priv(dev);
+
+       *info = priv->info;
+
+       return 0;
+}
+
+static struct ram_ops rk3288_dmc_ops = {
+       .get_info = rk3288_dmc_get_info,
+};
+
+static const struct udevice_id rk3288_dmc_ids[] = {
+       { .compatible = "rockchip,rk3288-dmc" },
+       { }
+};
+
+U_BOOT_DRIVER(dmc_rk3288) = {
+       .name = "rockchip_rk3288_dmc",
+       .id = UCLASS_RAM,
+       .of_match = rk3288_dmc_ids,
+       .ops = &rk3288_dmc_ops,
+#ifdef CONFIG_SPL_BUILD
+       .ofdata_to_platdata = rk3288_dmc_ofdata_to_platdata,
+#endif
+       .probe = rk3288_dmc_probe,
+       .priv_auto_alloc_size = sizeof(struct dram_info),
+#ifdef CONFIG_SPL_BUILD
+       .platdata_auto_alloc_size = sizeof(struct rk3288_sdram_params),
+#endif
+};
diff --git a/drivers/ram/rockchip/sdram_rk3328.c b/drivers/ram/rockchip/sdram_rk3328.c
new file mode 100644 (file)
index 0000000..9637a35
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * (C) Copyright 2017 Rockchip Electronics Co., Ltd.
+ *
+ * SPDX-License-Identifier:     GPL-2.0
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <ram.h>
+#include <syscon.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/grf_rk3328.h>
+#include <asm/arch/sdram_common.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+struct dram_info {
+       struct ram_info info;
+       struct rk3328_grf_regs *grf;
+};
+
+static int rk3328_dmc_probe(struct udevice *dev)
+{
+       struct dram_info *priv = dev_get_priv(dev);
+
+       priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+       debug("%s: grf=%p\n", __func__, priv->grf);
+       priv->info.base = CONFIG_SYS_SDRAM_BASE;
+       priv->info.size = rockchip_sdram_size(
+                               (phys_addr_t)&priv->grf->os_reg[2]);
+
+       return 0;
+}
+
+static int rk3328_dmc_get_info(struct udevice *dev, struct ram_info *info)
+{
+       struct dram_info *priv = dev_get_priv(dev);
+
+       *info = priv->info;
+
+       return 0;
+}
+
+static struct ram_ops rk3328_dmc_ops = {
+       .get_info = rk3328_dmc_get_info,
+};
+
+
+static const struct udevice_id rk3328_dmc_ids[] = {
+       { .compatible = "rockchip,rk3328-dmc" },
+       { }
+};
+
+U_BOOT_DRIVER(dmc_rk3328) = {
+       .name = "rockchip_rk3328_dmc",
+       .id = UCLASS_RAM,
+       .of_match = rk3328_dmc_ids,
+       .ops = &rk3328_dmc_ops,
+       .probe = rk3328_dmc_probe,
+       .priv_auto_alloc_size = sizeof(struct dram_info),
+};
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
new file mode 100644 (file)
index 0000000..76c1fe8
--- /dev/null
@@ -0,0 +1,1238 @@
+/*
+ * (C) Copyright 2016-2017 Rockchip Inc.
+ *
+ * SPDX-License-Identifier:     GPL-2.0
+ *
+ * Adapted from coreboot.
+ */
+
+#include <common.h>
+#include <clk.h>
+#include <dm.h>
+#include <dt-structs.h>
+#include <ram.h>
+#include <regmap.h>
+#include <syscon.h>
+#include <asm/io.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/sdram_common.h>
+#include <asm/arch/sdram_rk3399.h>
+#include <asm/arch/cru_rk3399.h>
+#include <asm/arch/grf_rk3399.h>
+#include <asm/arch/hardware.h>
+#include <linux/err.h>
+#include <time.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+struct chan_info {
+       struct rk3399_ddr_pctl_regs *pctl;
+       struct rk3399_ddr_pi_regs *pi;
+       struct rk3399_ddr_publ_regs *publ;
+       struct rk3399_msch_regs *msch;
+};
+
+struct dram_info {
+#ifdef CONFIG_SPL_BUILD
+       struct chan_info chan[2];
+       struct clk ddr_clk;
+       struct rk3399_cru *cru;
+       struct rk3399_pmucru *pmucru;
+       struct rk3399_pmusgrf_regs *pmusgrf;
+       struct rk3399_ddr_cic_regs *cic;
+#endif
+       struct ram_info info;
+       struct rk3399_pmugrf_regs *pmugrf;
+};
+
+#define PRESET_SGRF_HOLD(n)    ((0x1 << (6 + 16)) | ((n) << 6))
+#define PRESET_GPIO0_HOLD(n)   ((0x1 << (7 + 16)) | ((n) << 7))
+#define PRESET_GPIO1_HOLD(n)   ((0x1 << (8 + 16)) | ((n) << 8))
+
+#define PHY_DRV_ODT_Hi_Z       0x0
+#define PHY_DRV_ODT_240                0x1
+#define PHY_DRV_ODT_120                0x8
+#define PHY_DRV_ODT_80         0x9
+#define PHY_DRV_ODT_60         0xc
+#define PHY_DRV_ODT_48         0xd
+#define PHY_DRV_ODT_40         0xe
+#define PHY_DRV_ODT_34_3       0xf
+
+#ifdef CONFIG_SPL_BUILD
+
+struct rockchip_dmc_plat {
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct dtd_rockchip_rk3399_dmc dtplat;
+#else
+       struct rk3399_sdram_params sdram_params;
+#endif
+       struct regmap *map;
+};
+
+static void copy_to_reg(u32 *dest, const u32 *src, u32 n)
+{
+       int i;
+
+       for (i = 0; i < n / sizeof(u32); i++) {
+               writel(*src, dest);
+               src++;
+               dest++;
+       }
+}
+
+static void phy_dll_bypass_set(struct rk3399_ddr_publ_regs *ddr_publ_regs,
+                              u32 freq)
+{
+       u32 *denali_phy = ddr_publ_regs->denali_phy;
+
+       /* From IP spec, only freq small than 125 can enter dll bypass mode */
+       if (freq <= 125) {
+               /* phy_sw_master_mode_X PHY_86/214/342/470 4bits offset_8 */
+               setbits_le32(&denali_phy[86], (0x3 << 2) << 8);
+               setbits_le32(&denali_phy[214], (0x3 << 2) << 8);
+               setbits_le32(&denali_phy[342], (0x3 << 2) << 8);
+               setbits_le32(&denali_phy[470], (0x3 << 2) << 8);
+
+               /* phy_adrctl_sw_master_mode PHY_547/675/803 4bits offset_16 */
+               setbits_le32(&denali_phy[547], (0x3 << 2) << 16);
+               setbits_le32(&denali_phy[675], (0x3 << 2) << 16);
+               setbits_le32(&denali_phy[803], (0x3 << 2) << 16);
+       } else {
+               /* phy_sw_master_mode_X PHY_86/214/342/470 4bits offset_8 */
+               clrbits_le32(&denali_phy[86], (0x3 << 2) << 8);
+               clrbits_le32(&denali_phy[214], (0x3 << 2) << 8);
+               clrbits_le32(&denali_phy[342], (0x3 << 2) << 8);
+               clrbits_le32(&denali_phy[470], (0x3 << 2) << 8);
+
+               /* phy_adrctl_sw_master_mode PHY_547/675/803 4bits offset_16 */
+               clrbits_le32(&denali_phy[547], (0x3 << 2) << 16);
+               clrbits_le32(&denali_phy[675], (0x3 << 2) << 16);
+               clrbits_le32(&denali_phy[803], (0x3 << 2) << 16);
+       }
+}
+
+static void set_memory_map(const struct chan_info *chan, u32 channel,
+                          const struct rk3399_sdram_params *sdram_params)
+{
+       const struct rk3399_sdram_channel *sdram_ch =
+               &sdram_params->ch[channel];
+       u32 *denali_ctl = chan->pctl->denali_ctl;
+       u32 *denali_pi = chan->pi->denali_pi;
+       u32 cs_map;
+       u32 reduc;
+       u32 row;
+
+       /* Get row number from ddrconfig setting */
+       if (sdram_ch->ddrconfig < 2 || sdram_ch->ddrconfig == 4)
+               row = 16;
+       else if (sdram_ch->ddrconfig == 3)
+               row = 14;
+       else
+               row = 15;
+
+       cs_map = (sdram_ch->rank > 1) ? 3 : 1;
+       reduc = (sdram_ch->bw == 2) ? 0 : 1;
+
+       /* Set the dram configuration to ctrl */
+       clrsetbits_le32(&denali_ctl[191], 0xF, (12 - sdram_ch->col));
+       clrsetbits_le32(&denali_ctl[190], (0x3 << 16) | (0x7 << 24),
+                       ((3 - sdram_ch->bk) << 16) |
+                       ((16 - row) << 24));
+
+       clrsetbits_le32(&denali_ctl[196], 0x3 | (1 << 16),
+                       cs_map | (reduc << 16));
+
+       /* PI_199 PI_COL_DIFF:RW:0:4 */
+       clrsetbits_le32(&denali_pi[199], 0xF, (12 - sdram_ch->col));
+
+       /* PI_155 PI_ROW_DIFF:RW:24:3 PI_BANK_DIFF:RW:16:2 */
+       clrsetbits_le32(&denali_pi[155], (0x3 << 16) | (0x7 << 24),
+                       ((3 - sdram_ch->bk) << 16) |
+                       ((16 - row) << 24));
+       /* PI_41 PI_CS_MAP:RW:24:4 */
+       clrsetbits_le32(&denali_pi[41], 0xf << 24, cs_map << 24);
+       if ((sdram_ch->rank == 1) && (sdram_params->base.dramtype == DDR3))
+               writel(0x2EC7FFFF, &denali_pi[34]);
+}
+
+static void set_ds_odt(const struct chan_info *chan,
+                      const struct rk3399_sdram_params *sdram_params)
+{
+       u32 *denali_phy = chan->publ->denali_phy;
+
+       u32 tsel_idle_en, tsel_wr_en, tsel_rd_en;
+       u32 tsel_idle_select_p, tsel_wr_select_p, tsel_rd_select_p;
+       u32 ca_tsel_wr_select_p, ca_tsel_wr_select_n;
+       u32 tsel_idle_select_n, tsel_wr_select_n, tsel_rd_select_n;
+       u32 reg_value;
+
+       if (sdram_params->base.dramtype == LPDDR4) {
+               tsel_rd_select_p = PHY_DRV_ODT_Hi_Z;
+               tsel_wr_select_p = PHY_DRV_ODT_40;
+               ca_tsel_wr_select_p = PHY_DRV_ODT_40;
+               tsel_idle_select_p = PHY_DRV_ODT_Hi_Z;
+
+               tsel_rd_select_n = PHY_DRV_ODT_240;
+               tsel_wr_select_n = PHY_DRV_ODT_40;
+               ca_tsel_wr_select_n = PHY_DRV_ODT_40;
+               tsel_idle_select_n = PHY_DRV_ODT_240;
+       } else if (sdram_params->base.dramtype == LPDDR3) {
+               tsel_rd_select_p = PHY_DRV_ODT_240;
+               tsel_wr_select_p = PHY_DRV_ODT_34_3;
+               ca_tsel_wr_select_p = PHY_DRV_ODT_48;
+               tsel_idle_select_p = PHY_DRV_ODT_240;
+
+               tsel_rd_select_n = PHY_DRV_ODT_Hi_Z;
+               tsel_wr_select_n = PHY_DRV_ODT_34_3;
+               ca_tsel_wr_select_n = PHY_DRV_ODT_48;
+               tsel_idle_select_n = PHY_DRV_ODT_Hi_Z;
+       } else {
+               tsel_rd_select_p = PHY_DRV_ODT_240;
+               tsel_wr_select_p = PHY_DRV_ODT_34_3;
+               ca_tsel_wr_select_p = PHY_DRV_ODT_34_3;
+               tsel_idle_select_p = PHY_DRV_ODT_240;
+
+               tsel_rd_select_n = PHY_DRV_ODT_240;
+               tsel_wr_select_n = PHY_DRV_ODT_34_3;
+               ca_tsel_wr_select_n = PHY_DRV_ODT_34_3;
+               tsel_idle_select_n = PHY_DRV_ODT_240;
+       }
+
+       if (sdram_params->base.odt == 1)
+               tsel_rd_en = 1;
+       else
+               tsel_rd_en = 0;
+
+       tsel_wr_en = 0;
+       tsel_idle_en = 0;
+
+       /*
+        * phy_dq_tsel_select_X 24bits DENALI_PHY_6/134/262/390 offset_0
+        * sets termination values for read/idle cycles and drive strength
+        * for write cycles for DQ/DM
+        */
+       reg_value = tsel_rd_select_n | (tsel_rd_select_p << 0x4) |
+                   (tsel_wr_select_n << 8) | (tsel_wr_select_p << 12) |
+                   (tsel_idle_select_n << 16) | (tsel_idle_select_p << 20);
+       clrsetbits_le32(&denali_phy[6], 0xffffff, reg_value);
+       clrsetbits_le32(&denali_phy[134], 0xffffff, reg_value);
+       clrsetbits_le32(&denali_phy[262], 0xffffff, reg_value);
+       clrsetbits_le32(&denali_phy[390], 0xffffff, reg_value);
+
+       /*
+        * phy_dqs_tsel_select_X 24bits DENALI_PHY_7/135/263/391 offset_0
+        * sets termination values for read/idle cycles and drive strength
+        * for write cycles for DQS
+        */
+       clrsetbits_le32(&denali_phy[7], 0xffffff, reg_value);
+       clrsetbits_le32(&denali_phy[135], 0xffffff, reg_value);
+       clrsetbits_le32(&denali_phy[263], 0xffffff, reg_value);
+       clrsetbits_le32(&denali_phy[391], 0xffffff, reg_value);
+
+       /* phy_adr_tsel_select_ 8bits DENALI_PHY_544/672/800 offset_0 */
+       reg_value = ca_tsel_wr_select_n | (ca_tsel_wr_select_p << 0x4);
+       clrsetbits_le32(&denali_phy[544], 0xff, reg_value);
+       clrsetbits_le32(&denali_phy[672], 0xff, reg_value);
+       clrsetbits_le32(&denali_phy[800], 0xff, reg_value);
+
+       /* phy_pad_addr_drive 8bits DENALI_PHY_928 offset_0 */
+       clrsetbits_le32(&denali_phy[928], 0xff, reg_value);
+
+       /* phy_pad_rst_drive 8bits DENALI_PHY_937 offset_0 */
+       clrsetbits_le32(&denali_phy[937], 0xff, reg_value);
+
+       /* phy_pad_cke_drive 8bits DENALI_PHY_935 offset_0 */
+       clrsetbits_le32(&denali_phy[935], 0xff, reg_value);
+
+       /* phy_pad_cs_drive 8bits DENALI_PHY_939 offset_0 */
+       clrsetbits_le32(&denali_phy[939], 0xff, reg_value);
+
+       /* phy_pad_clk_drive 8bits DENALI_PHY_929 offset_0 */
+       clrsetbits_le32(&denali_phy[929], 0xff, reg_value);
+
+       /* phy_pad_fdbk_drive 23bit DENALI_PHY_924/925 */
+       clrsetbits_le32(&denali_phy[924], 0xff,
+                       tsel_wr_select_n | (tsel_wr_select_p << 4));
+       clrsetbits_le32(&denali_phy[925], 0xff,
+                       tsel_rd_select_n | (tsel_rd_select_p << 4));
+
+       /* phy_dq_tsel_enable_X 3bits DENALI_PHY_5/133/261/389 offset_16 */
+       reg_value = (tsel_rd_en | (tsel_wr_en << 1) | (tsel_idle_en << 2))
+               << 16;
+       clrsetbits_le32(&denali_phy[5], 0x7 << 16, reg_value);
+       clrsetbits_le32(&denali_phy[133], 0x7 << 16, reg_value);
+       clrsetbits_le32(&denali_phy[261], 0x7 << 16, reg_value);
+       clrsetbits_le32(&denali_phy[389], 0x7 << 16, reg_value);
+
+       /* phy_dqs_tsel_enable_X 3bits DENALI_PHY_6/134/262/390 offset_24 */
+       reg_value = (tsel_rd_en | (tsel_wr_en << 1) | (tsel_idle_en << 2))
+               << 24;
+       clrsetbits_le32(&denali_phy[6], 0x7 << 24, reg_value);
+       clrsetbits_le32(&denali_phy[134], 0x7 << 24, reg_value);
+       clrsetbits_le32(&denali_phy[262], 0x7 << 24, reg_value);
+       clrsetbits_le32(&denali_phy[390], 0x7 << 24, reg_value);
+
+       /* phy_adr_tsel_enable_ 1bit DENALI_PHY_518/646/774 offset_8 */
+       reg_value = tsel_wr_en << 8;
+       clrsetbits_le32(&denali_phy[518], 0x1 << 8, reg_value);
+       clrsetbits_le32(&denali_phy[646], 0x1 << 8, reg_value);
+       clrsetbits_le32(&denali_phy[774], 0x1 << 8, reg_value);
+
+       /* phy_pad_addr_term tsel 1bit DENALI_PHY_933 offset_17 */
+       reg_value = tsel_wr_en << 17;
+       clrsetbits_le32(&denali_phy[933], 0x1 << 17, reg_value);
+       /*
+        * pad_rst/cke/cs/clk_term tsel 1bits
+        * DENALI_PHY_938/936/940/934 offset_17
+        */
+       clrsetbits_le32(&denali_phy[938], 0x1 << 17, reg_value);
+       clrsetbits_le32(&denali_phy[936], 0x1 << 17, reg_value);
+       clrsetbits_le32(&denali_phy[940], 0x1 << 17, reg_value);
+       clrsetbits_le32(&denali_phy[934], 0x1 << 17, reg_value);
+
+       /* phy_pad_fdbk_term 1bit DENALI_PHY_930 offset_17 */
+       clrsetbits_le32(&denali_phy[930], 0x1 << 17, reg_value);
+}
+
+static int phy_io_config(const struct chan_info *chan,
+                         const struct rk3399_sdram_params *sdram_params)
+{
+       u32 *denali_phy = chan->publ->denali_phy;
+       u32 vref_mode_dq, vref_value_dq, vref_mode_ac, vref_value_ac;
+       u32 mode_sel;
+       u32 reg_value;
+       u32 drv_value, odt_value;
+       u32 speed;
+
+       /* vref setting */
+       if (sdram_params->base.dramtype == LPDDR4) {
+               /* LPDDR4 */
+               vref_mode_dq = 0x6;
+               vref_value_dq = 0x1f;
+               vref_mode_ac = 0x6;
+               vref_value_ac = 0x1f;
+       } else if (sdram_params->base.dramtype == LPDDR3) {
+               if (sdram_params->base.odt == 1) {
+                       vref_mode_dq = 0x5;  /* LPDDR3 ODT */
+                       drv_value = (readl(&denali_phy[6]) >> 12) & 0xf;
+                       odt_value = (readl(&denali_phy[6]) >> 4) & 0xf;
+                       if (drv_value == PHY_DRV_ODT_48) {
+                               switch (odt_value) {
+                               case PHY_DRV_ODT_240:
+                                       vref_value_dq = 0x16;
+                                       break;
+                               case PHY_DRV_ODT_120:
+                                       vref_value_dq = 0x26;
+                                       break;
+                               case PHY_DRV_ODT_60:
+                                       vref_value_dq = 0x36;
+                                       break;
+                               default:
+                                       debug("Invalid ODT value.\n");
+                                       return -EINVAL;
+                               }
+                       } else if (drv_value == PHY_DRV_ODT_40) {
+                               switch (odt_value) {
+                               case PHY_DRV_ODT_240:
+                                       vref_value_dq = 0x19;
+                                       break;
+                               case PHY_DRV_ODT_120:
+                                       vref_value_dq = 0x23;
+                                       break;
+                               case PHY_DRV_ODT_60:
+                                       vref_value_dq = 0x31;
+                                       break;
+                               default:
+                                       debug("Invalid ODT value.\n");
+                                       return -EINVAL;
+                               }
+                       } else if (drv_value == PHY_DRV_ODT_34_3) {
+                               switch (odt_value) {
+                               case PHY_DRV_ODT_240:
+                                       vref_value_dq = 0x17;
+                                       break;
+                               case PHY_DRV_ODT_120:
+                                       vref_value_dq = 0x20;
+                                       break;
+                               case PHY_DRV_ODT_60:
+                                       vref_value_dq = 0x2e;
+                                       break;
+                               default:
+                                       debug("Invalid ODT value.\n");
+                                       return -EINVAL;
+                               }
+                       } else {
+                               debug("Invalid DRV value.\n");
+                               return -EINVAL;
+                       }
+               } else {
+                       vref_mode_dq = 0x2;  /* LPDDR3 */
+                       vref_value_dq = 0x1f;
+               }
+               vref_mode_ac = 0x2;
+               vref_value_ac = 0x1f;
+       } else if (sdram_params->base.dramtype == DDR3) {
+               /* DDR3L */
+               vref_mode_dq = 0x1;
+               vref_value_dq = 0x1f;
+               vref_mode_ac = 0x1;
+               vref_value_ac = 0x1f;
+       } else {
+               debug("Unknown DRAM type.\n");
+               return -EINVAL;
+       }
+
+       reg_value = (vref_mode_dq << 9) | (0x1 << 8) | vref_value_dq;
+
+       /* PHY_913 PHY_PAD_VREF_CTRL_DQ_0 12bits offset_8 */
+       clrsetbits_le32(&denali_phy[913], 0xfff << 8, reg_value << 8);
+       /* PHY_914 PHY_PAD_VREF_CTRL_DQ_1 12bits offset_0 */
+       clrsetbits_le32(&denali_phy[914], 0xfff, reg_value);
+       /* PHY_914 PHY_PAD_VREF_CTRL_DQ_2 12bits offset_16 */
+       clrsetbits_le32(&denali_phy[914], 0xfff << 16, reg_value << 16);
+       /* PHY_915 PHY_PAD_VREF_CTRL_DQ_3 12bits offset_0 */
+       clrsetbits_le32(&denali_phy[915], 0xfff, reg_value);
+
+       reg_value = (vref_mode_ac << 9) | (0x1 << 8) | vref_value_ac;
+
+       /* PHY_915 PHY_PAD_VREF_CTRL_AC 12bits offset_16 */
+       clrsetbits_le32(&denali_phy[915], 0xfff << 16, reg_value << 16);
+
+       if (sdram_params->base.dramtype == LPDDR4)
+               mode_sel = 0x6;
+       else if (sdram_params->base.dramtype == LPDDR3)
+               mode_sel = 0x0;
+       else if (sdram_params->base.dramtype == DDR3)
+               mode_sel = 0x1;
+       else
+               return -EINVAL;
+
+       /* PHY_924 PHY_PAD_FDBK_DRIVE */
+       clrsetbits_le32(&denali_phy[924], 0x7 << 15, mode_sel << 15);
+       /* PHY_926 PHY_PAD_DATA_DRIVE */
+       clrsetbits_le32(&denali_phy[926], 0x7 << 6, mode_sel << 6);
+       /* PHY_927 PHY_PAD_DQS_DRIVE */
+       clrsetbits_le32(&denali_phy[927], 0x7 << 6, mode_sel << 6);
+       /* PHY_928 PHY_PAD_ADDR_DRIVE */
+       clrsetbits_le32(&denali_phy[928], 0x7 << 14, mode_sel << 14);
+       /* PHY_929 PHY_PAD_CLK_DRIVE */
+       clrsetbits_le32(&denali_phy[929], 0x7 << 14, mode_sel << 14);
+       /* PHY_935 PHY_PAD_CKE_DRIVE */
+       clrsetbits_le32(&denali_phy[935], 0x7 << 14, mode_sel << 14);
+       /* PHY_937 PHY_PAD_RST_DRIVE */
+       clrsetbits_le32(&denali_phy[937], 0x7 << 14, mode_sel << 14);
+       /* PHY_939 PHY_PAD_CS_DRIVE */
+       clrsetbits_le32(&denali_phy[939], 0x7 << 14, mode_sel << 14);
+
+
+       /* speed setting */
+       if (sdram_params->base.ddr_freq < 400)
+               speed = 0x0;
+       else if (sdram_params->base.ddr_freq < 800)
+               speed = 0x1;
+       else if (sdram_params->base.ddr_freq < 1200)
+               speed = 0x2;
+       else
+               speed = 0x3;
+
+       /* PHY_924 PHY_PAD_FDBK_DRIVE */
+       clrsetbits_le32(&denali_phy[924], 0x3 << 21, speed << 21);
+       /* PHY_926 PHY_PAD_DATA_DRIVE */
+       clrsetbits_le32(&denali_phy[926], 0x3 << 9, speed << 9);
+       /* PHY_927 PHY_PAD_DQS_DRIVE */
+       clrsetbits_le32(&denali_phy[927], 0x3 << 9, speed << 9);
+       /* PHY_928 PHY_PAD_ADDR_DRIVE */
+       clrsetbits_le32(&denali_phy[928], 0x3 << 17, speed << 17);
+       /* PHY_929 PHY_PAD_CLK_DRIVE */
+       clrsetbits_le32(&denali_phy[929], 0x3 << 17, speed << 17);
+       /* PHY_935 PHY_PAD_CKE_DRIVE */
+       clrsetbits_le32(&denali_phy[935], 0x3 << 17, speed << 17);
+       /* PHY_937 PHY_PAD_RST_DRIVE */
+       clrsetbits_le32(&denali_phy[937], 0x3 << 17, speed << 17);
+       /* PHY_939 PHY_PAD_CS_DRIVE */
+       clrsetbits_le32(&denali_phy[939], 0x3 << 17, speed << 17);
+
+       return 0;
+}
+
+static int pctl_cfg(const struct chan_info *chan, u32 channel,
+                   const struct rk3399_sdram_params *sdram_params)
+{
+       u32 *denali_ctl = chan->pctl->denali_ctl;
+       u32 *denali_pi = chan->pi->denali_pi;
+       u32 *denali_phy = chan->publ->denali_phy;
+       const u32 *params_ctl = sdram_params->pctl_regs.denali_ctl;
+       const u32 *params_phy = sdram_params->phy_regs.denali_phy;
+       u32 tmp, tmp1, tmp2;
+       u32 pwrup_srefresh_exit;
+       int ret;
+       const ulong timeout_ms = 200;
+
+       /*
+        * work around controller bug:
+        * Do not program DRAM_CLASS until NO_PHY_IND_TRAIN_INT is programmed
+        */
+       copy_to_reg(&denali_ctl[1], &params_ctl[1],
+                   sizeof(struct rk3399_ddr_pctl_regs) - 4);
+       writel(params_ctl[0], &denali_ctl[0]);
+       copy_to_reg(denali_pi, &sdram_params->pi_regs.denali_pi[0],
+                   sizeof(struct rk3399_ddr_pi_regs));
+       /* rank count need to set for init */
+       set_memory_map(chan, channel, sdram_params);
+
+       writel(sdram_params->phy_regs.denali_phy[910], &denali_phy[910]);
+       writel(sdram_params->phy_regs.denali_phy[911], &denali_phy[911]);
+       writel(sdram_params->phy_regs.denali_phy[912], &denali_phy[912]);
+
+       pwrup_srefresh_exit = readl(&denali_ctl[68]) & PWRUP_SREFRESH_EXIT;
+       clrbits_le32(&denali_ctl[68], PWRUP_SREFRESH_EXIT);
+
+       /* PHY_DLL_RST_EN */
+       clrsetbits_le32(&denali_phy[957], 0x3 << 24, 1 << 24);
+
+       setbits_le32(&denali_pi[0], START);
+       setbits_le32(&denali_ctl[0], START);
+
+       /* Wating for phy DLL lock */
+       while (1) {
+               tmp = readl(&denali_phy[920]);
+               tmp1 = readl(&denali_phy[921]);
+               tmp2 = readl(&denali_phy[922]);
+               if ((((tmp >> 16) & 0x1) == 0x1) &&
+                   (((tmp1 >> 16) & 0x1) == 0x1) &&
+                   (((tmp1 >> 0) & 0x1) == 0x1) &&
+                   (((tmp2 >> 0) & 0x1) == 0x1))
+                       break;
+       }
+
+       copy_to_reg(&denali_phy[896], &params_phy[896], (958 - 895) * 4);
+       copy_to_reg(&denali_phy[0], &params_phy[0], (90 - 0 + 1) * 4);
+       copy_to_reg(&denali_phy[128], &params_phy[128], (218 - 128 + 1) * 4);
+       copy_to_reg(&denali_phy[256], &params_phy[256], (346 - 256 + 1) * 4);
+       copy_to_reg(&denali_phy[384], &params_phy[384], (474 - 384 + 1) * 4);
+       copy_to_reg(&denali_phy[512], &params_phy[512], (549 - 512 + 1) * 4);
+       copy_to_reg(&denali_phy[640], &params_phy[640], (677 - 640 + 1) * 4);
+       copy_to_reg(&denali_phy[768], &params_phy[768], (805 - 768 + 1) * 4);
+       set_ds_odt(chan, sdram_params);
+
+       /*
+        * phy_dqs_tsel_wr_timing_X 8bits DENALI_PHY_84/212/340/468 offset_8
+        * dqs_tsel_wr_end[7:4] add Half cycle
+        */
+       tmp = (readl(&denali_phy[84]) >> 8) & 0xff;
+       clrsetbits_le32(&denali_phy[84], 0xff << 8, (tmp + 0x10) << 8);
+       tmp = (readl(&denali_phy[212]) >> 8) & 0xff;
+       clrsetbits_le32(&denali_phy[212], 0xff << 8, (tmp + 0x10) << 8);
+       tmp = (readl(&denali_phy[340]) >> 8) & 0xff;
+       clrsetbits_le32(&denali_phy[340], 0xff << 8, (tmp + 0x10) << 8);
+       tmp = (readl(&denali_phy[468]) >> 8) & 0xff;
+       clrsetbits_le32(&denali_phy[468], 0xff << 8, (tmp + 0x10) << 8);
+
+       /*
+        * phy_dqs_tsel_wr_timing_X 8bits DENALI_PHY_83/211/339/467 offset_8
+        * dq_tsel_wr_end[7:4] add Half cycle
+        */
+       tmp = (readl(&denali_phy[83]) >> 16) & 0xff;
+       clrsetbits_le32(&denali_phy[83], 0xff << 16, (tmp + 0x10) << 16);
+       tmp = (readl(&denali_phy[211]) >> 16) & 0xff;
+       clrsetbits_le32(&denali_phy[211], 0xff << 16, (tmp + 0x10) << 16);
+       tmp = (readl(&denali_phy[339]) >> 16) & 0xff;
+       clrsetbits_le32(&denali_phy[339], 0xff << 16, (tmp + 0x10) << 16);
+       tmp = (readl(&denali_phy[467]) >> 16) & 0xff;
+       clrsetbits_le32(&denali_phy[467], 0xff << 16, (tmp + 0x10) << 16);
+
+       ret = phy_io_config(chan, sdram_params);
+       if (ret)
+               return ret;
+
+       /* PHY_DLL_RST_EN */
+       clrsetbits_le32(&denali_phy[957], 0x3 << 24, 0x2 << 24);
+
+       /* Wating for PHY and DRAM init complete */
+       tmp = get_timer(0);
+       do {
+               if (get_timer(tmp) > timeout_ms) {
+                       pr_err("DRAM (%s): phy failed to lock within  %ld ms\n",
+                             __func__, timeout_ms);
+                       return -ETIME;
+               }
+       } while (!(readl(&denali_ctl[203]) & (1 << 3)));
+       debug("DRAM (%s): phy locked after %ld ms\n", __func__, get_timer(tmp));
+
+       clrsetbits_le32(&denali_ctl[68], PWRUP_SREFRESH_EXIT,
+                       pwrup_srefresh_exit);
+       return 0;
+}
+
+static void select_per_cs_training_index(const struct chan_info *chan,
+                                        u32 rank)
+{
+       u32 *denali_phy = chan->publ->denali_phy;
+
+       /* PHY_84 PHY_PER_CS_TRAINING_EN_0 1bit offset_16 */
+       if ((readl(&denali_phy[84])>>16) & 1) {
+               /*
+                * PHY_8/136/264/392
+                * phy_per_cs_training_index_X 1bit offset_24
+                */
+               clrsetbits_le32(&denali_phy[8], 0x1 << 24, rank << 24);
+               clrsetbits_le32(&denali_phy[136], 0x1 << 24, rank << 24);
+               clrsetbits_le32(&denali_phy[264], 0x1 << 24, rank << 24);
+               clrsetbits_le32(&denali_phy[392], 0x1 << 24, rank << 24);
+       }
+}
+
+static void override_write_leveling_value(const struct chan_info *chan)
+{
+       u32 *denali_ctl = chan->pctl->denali_ctl;
+       u32 *denali_phy = chan->publ->denali_phy;
+       u32 byte;
+
+       /* PHY_896 PHY_FREQ_SEL_MULTICAST_EN 1bit offset_0 */
+       setbits_le32(&denali_phy[896], 1);
+
+       /*
+        * PHY_8/136/264/392
+        * phy_per_cs_training_multicast_en_X 1bit offset_16
+        */
+       clrsetbits_le32(&denali_phy[8], 0x1 << 16, 1 << 16);
+       clrsetbits_le32(&denali_phy[136], 0x1 << 16, 1 << 16);
+       clrsetbits_le32(&denali_phy[264], 0x1 << 16, 1 << 16);
+       clrsetbits_le32(&denali_phy[392], 0x1 << 16, 1 << 16);
+
+       for (byte = 0; byte < 4; byte++)
+               clrsetbits_le32(&denali_phy[63 + (128 * byte)], 0xffff << 16,
+                               0x200 << 16);
+
+       /* PHY_896 PHY_FREQ_SEL_MULTICAST_EN 1bit offset_0 */
+       clrbits_le32(&denali_phy[896], 1);
+
+       /* CTL_200 ctrlupd_req 1bit offset_8 */
+       clrsetbits_le32(&denali_ctl[200], 0x1 << 8, 0x1 << 8);
+}
+
+static int data_training_ca(const struct chan_info *chan, u32 channel,
+                           const struct rk3399_sdram_params *sdram_params)
+{
+       u32 *denali_pi = chan->pi->denali_pi;
+       u32 *denali_phy = chan->publ->denali_phy;
+       u32 i, tmp;
+       u32 obs_0, obs_1, obs_2, obs_err = 0;
+       u32 rank = sdram_params->ch[channel].rank;
+
+       for (i = 0; i < rank; i++) {
+               select_per_cs_training_index(chan, i);
+               /* PI_100 PI_CALVL_EN:RW:8:2 */
+               clrsetbits_le32(&denali_pi[100], 0x3 << 8, 0x2 << 8);
+               /* PI_92 PI_CALVL_REQ:WR:16:1,PI_CALVL_CS:RW:24:2 */
+               clrsetbits_le32(&denali_pi[92],
+                               (0x1 << 16) | (0x3 << 24),
+                               (0x1 << 16) | (i << 24));
+
+               /* Waiting for training complete */
+               while (1) {
+                       /* PI_174 PI_INT_STATUS:RD:8:18 */
+                       tmp = readl(&denali_pi[174]) >> 8;
+                       /*
+                        * check status obs
+                        * PHY_532/660/789 phy_adr_calvl_obs1_:0:32
+                        */
+                       obs_0 = readl(&denali_phy[532]);
+                       obs_1 = readl(&denali_phy[660]);
+                       obs_2 = readl(&denali_phy[788]);
+                       if (((obs_0 >> 30) & 0x3) ||
+                           ((obs_1 >> 30) & 0x3) ||
+                           ((obs_2 >> 30) & 0x3))
+                               obs_err = 1;
+                       if ((((tmp >> 11) & 0x1) == 0x1) &&
+                           (((tmp >> 13) & 0x1) == 0x1) &&
+                           (((tmp >> 5) & 0x1) == 0x0) &&
+                           (obs_err == 0))
+                               break;
+                       else if ((((tmp >> 5) & 0x1) == 0x1) ||
+                                (obs_err == 1))
+                               return -EIO;
+               }
+               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+               writel(0x00003f7c, (&denali_pi[175]));
+       }
+       clrbits_le32(&denali_pi[100], 0x3 << 8);
+
+       return 0;
+}
+
+static int data_training_wl(const struct chan_info *chan, u32 channel,
+                           const struct rk3399_sdram_params *sdram_params)
+{
+       u32 *denali_pi = chan->pi->denali_pi;
+       u32 *denali_phy = chan->publ->denali_phy;
+       u32 i, tmp;
+       u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0;
+       u32 rank = sdram_params->ch[channel].rank;
+
+       for (i = 0; i < rank; i++) {
+               select_per_cs_training_index(chan, i);
+               /* PI_60 PI_WRLVL_EN:RW:8:2 */
+               clrsetbits_le32(&denali_pi[60], 0x3 << 8, 0x2 << 8);
+               /* PI_59 PI_WRLVL_REQ:WR:8:1,PI_WRLVL_CS:RW:16:2 */
+               clrsetbits_le32(&denali_pi[59],
+                               (0x1 << 8) | (0x3 << 16),
+                               (0x1 << 8) | (i << 16));
+
+               /* Waiting for training complete */
+               while (1) {
+                       /* PI_174 PI_INT_STATUS:RD:8:18 */
+                       tmp = readl(&denali_pi[174]) >> 8;
+
+                       /*
+                        * check status obs, if error maybe can not
+                        * get leveling done PHY_40/168/296/424
+                        * phy_wrlvl_status_obs_X:0:13
+                        */
+                       obs_0 = readl(&denali_phy[40]);
+                       obs_1 = readl(&denali_phy[168]);
+                       obs_2 = readl(&denali_phy[296]);
+                       obs_3 = readl(&denali_phy[424]);
+                       if (((obs_0 >> 12) & 0x1) ||
+                           ((obs_1 >> 12) & 0x1) ||
+                           ((obs_2 >> 12) & 0x1) ||
+                           ((obs_3 >> 12) & 0x1))
+                               obs_err = 1;
+                       if ((((tmp >> 10) & 0x1) == 0x1) &&
+                           (((tmp >> 13) & 0x1) == 0x1) &&
+                           (((tmp >> 4) & 0x1) == 0x0) &&
+                           (obs_err == 0))
+                               break;
+                       else if ((((tmp >> 4) & 0x1) == 0x1) ||
+                                (obs_err == 1))
+                               return -EIO;
+               }
+               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+               writel(0x00003f7c, (&denali_pi[175]));
+       }
+
+       override_write_leveling_value(chan);
+       clrbits_le32(&denali_pi[60], 0x3 << 8);
+
+       return 0;
+}
+
+static int data_training_rg(const struct chan_info *chan, u32 channel,
+                           const struct rk3399_sdram_params *sdram_params)
+{
+       u32 *denali_pi = chan->pi->denali_pi;
+       u32 *denali_phy = chan->publ->denali_phy;
+       u32 i, tmp;
+       u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0;
+       u32 rank = sdram_params->ch[channel].rank;
+
+       for (i = 0; i < rank; i++) {
+               select_per_cs_training_index(chan, i);
+               /* PI_80 PI_RDLVL_GATE_EN:RW:24:2 */
+               clrsetbits_le32(&denali_pi[80], 0x3 << 24, 0x2 << 24);
+               /*
+                * PI_74 PI_RDLVL_GATE_REQ:WR:16:1
+                * PI_RDLVL_CS:RW:24:2
+                */
+               clrsetbits_le32(&denali_pi[74],
+                               (0x1 << 16) | (0x3 << 24),
+                               (0x1 << 16) | (i << 24));
+
+               /* Waiting for training complete */
+               while (1) {
+                       /* PI_174 PI_INT_STATUS:RD:8:18 */
+                       tmp = readl(&denali_pi[174]) >> 8;
+
+                       /*
+                        * check status obs
+                        * PHY_43/171/299/427
+                        *     PHY_GTLVL_STATUS_OBS_x:16:8
+                        */
+                       obs_0 = readl(&denali_phy[43]);
+                       obs_1 = readl(&denali_phy[171]);
+                       obs_2 = readl(&denali_phy[299]);
+                       obs_3 = readl(&denali_phy[427]);
+                       if (((obs_0 >> (16 + 6)) & 0x3) ||
+                           ((obs_1 >> (16 + 6)) & 0x3) ||
+                           ((obs_2 >> (16 + 6)) & 0x3) ||
+                           ((obs_3 >> (16 + 6)) & 0x3))
+                               obs_err = 1;
+                       if ((((tmp >> 9) & 0x1) == 0x1) &&
+                           (((tmp >> 13) & 0x1) == 0x1) &&
+                           (((tmp >> 3) & 0x1) == 0x0) &&
+                           (obs_err == 0))
+                               break;
+                       else if ((((tmp >> 3) & 0x1) == 0x1) ||
+                                (obs_err == 1))
+                               return -EIO;
+               }
+               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+               writel(0x00003f7c, (&denali_pi[175]));
+       }
+       clrbits_le32(&denali_pi[80], 0x3 << 24);
+
+       return 0;
+}
+
+static int data_training_rl(const struct chan_info *chan, u32 channel,
+                           const struct rk3399_sdram_params *sdram_params)
+{
+       u32 *denali_pi = chan->pi->denali_pi;
+       u32 i, tmp;
+       u32 rank = sdram_params->ch[channel].rank;
+
+       for (i = 0; i < rank; i++) {
+               select_per_cs_training_index(chan, i);
+               /* PI_80 PI_RDLVL_EN:RW:16:2 */
+               clrsetbits_le32(&denali_pi[80], 0x3 << 16, 0x2 << 16);
+               /* PI_74 PI_RDLVL_REQ:WR:8:1,PI_RDLVL_CS:RW:24:2 */
+               clrsetbits_le32(&denali_pi[74],
+                               (0x1 << 8) | (0x3 << 24),
+                               (0x1 << 8) | (i << 24));
+
+               /* Waiting for training complete */
+               while (1) {
+                       /* PI_174 PI_INT_STATUS:RD:8:18 */
+                       tmp = readl(&denali_pi[174]) >> 8;
+
+                       /*
+                        * make sure status obs not report error bit
+                        * PHY_46/174/302/430
+                        *     phy_rdlvl_status_obs_X:16:8
+                        */
+                       if ((((tmp >> 8) & 0x1) == 0x1) &&
+                           (((tmp >> 13) & 0x1) == 0x1) &&
+                           (((tmp >> 2) & 0x1) == 0x0))
+                               break;
+                       else if (((tmp >> 2) & 0x1) == 0x1)
+                               return -EIO;
+               }
+               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+               writel(0x00003f7c, (&denali_pi[175]));
+       }
+       clrbits_le32(&denali_pi[80], 0x3 << 16);
+
+       return 0;
+}
+
+static int data_training_wdql(const struct chan_info *chan, u32 channel,
+                             const struct rk3399_sdram_params *sdram_params)
+{
+       u32 *denali_pi = chan->pi->denali_pi;
+       u32 i, tmp;
+       u32 rank = sdram_params->ch[channel].rank;
+
+       for (i = 0; i < rank; i++) {
+               select_per_cs_training_index(chan, i);
+               /*
+                * disable PI_WDQLVL_VREF_EN before wdq leveling?
+                * PI_181 PI_WDQLVL_VREF_EN:RW:8:1
+                */
+               clrbits_le32(&denali_pi[181], 0x1 << 8);
+               /* PI_124 PI_WDQLVL_EN:RW:16:2 */
+               clrsetbits_le32(&denali_pi[124], 0x3 << 16, 0x2 << 16);
+               /* PI_121 PI_WDQLVL_REQ:WR:8:1,PI_WDQLVL_CS:RW:16:2 */
+               clrsetbits_le32(&denali_pi[121],
+                               (0x1 << 8) | (0x3 << 16),
+                               (0x1 << 8) | (i << 16));
+
+               /* Waiting for training complete */
+               while (1) {
+                       /* PI_174 PI_INT_STATUS:RD:8:18 */
+                       tmp = readl(&denali_pi[174]) >> 8;
+                       if ((((tmp >> 12) & 0x1) == 0x1) &&
+                           (((tmp >> 13) & 0x1) == 0x1) &&
+                           (((tmp >> 6) & 0x1) == 0x0))
+                               break;
+                       else if (((tmp >> 6) & 0x1) == 0x1)
+                               return -EIO;
+               }
+               /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+               writel(0x00003f7c, (&denali_pi[175]));
+       }
+       clrbits_le32(&denali_pi[124], 0x3 << 16);
+
+       return 0;
+}
+
+static int data_training(const struct chan_info *chan, u32 channel,
+                        const struct rk3399_sdram_params *sdram_params,
+                        u32 training_flag)
+{
+       u32 *denali_phy = chan->publ->denali_phy;
+
+       /* PHY_927 PHY_PAD_DQS_DRIVE  RPULL offset_22 */
+       setbits_le32(&denali_phy[927], (1 << 22));
+
+       if (training_flag == PI_FULL_TRAINING) {
+               if (sdram_params->base.dramtype == LPDDR4) {
+                       training_flag = PI_CA_TRAINING | PI_WRITE_LEVELING |
+                                       PI_READ_GATE_TRAINING |
+                                       PI_READ_LEVELING | PI_WDQ_LEVELING;
+               } else if (sdram_params->base.dramtype == LPDDR3) {
+                       training_flag = PI_CA_TRAINING | PI_WRITE_LEVELING |
+                                       PI_READ_GATE_TRAINING;
+               } else if (sdram_params->base.dramtype == DDR3) {
+                       training_flag = PI_WRITE_LEVELING |
+                                       PI_READ_GATE_TRAINING |
+                                       PI_READ_LEVELING;
+               }
+       }
+
+       /* ca training(LPDDR4,LPDDR3 support) */
+       if ((training_flag & PI_CA_TRAINING) == PI_CA_TRAINING)
+               data_training_ca(chan, channel, sdram_params);
+
+       /* write leveling(LPDDR4,LPDDR3,DDR3 support) */
+       if ((training_flag & PI_WRITE_LEVELING) == PI_WRITE_LEVELING)
+               data_training_wl(chan, channel, sdram_params);
+
+       /* read gate training(LPDDR4,LPDDR3,DDR3 support) */
+       if ((training_flag & PI_READ_GATE_TRAINING) == PI_READ_GATE_TRAINING)
+               data_training_rg(chan, channel, sdram_params);
+
+       /* read leveling(LPDDR4,LPDDR3,DDR3 support) */
+       if ((training_flag & PI_READ_LEVELING) == PI_READ_LEVELING)
+               data_training_rl(chan, channel, sdram_params);
+
+       /* wdq leveling(LPDDR4 support) */
+       if ((training_flag & PI_WDQ_LEVELING) == PI_WDQ_LEVELING)
+               data_training_wdql(chan, channel, sdram_params);
+
+       /* PHY_927 PHY_PAD_DQS_DRIVE  RPULL offset_22 */
+       clrbits_le32(&denali_phy[927], (1 << 22));
+
+       return 0;
+}
+
+static void set_ddrconfig(const struct chan_info *chan,
+                         const struct rk3399_sdram_params *sdram_params,
+                         unsigned char channel, u32 ddrconfig)
+{
+       /* only need to set ddrconfig */
+       struct rk3399_msch_regs *ddr_msch_regs = chan->msch;
+       unsigned int cs0_cap = 0;
+       unsigned int cs1_cap = 0;
+
+       cs0_cap = (1 << (sdram_params->ch[channel].cs0_row
+                       + sdram_params->ch[channel].col
+                       + sdram_params->ch[channel].bk
+                       + sdram_params->ch[channel].bw - 20));
+       if (sdram_params->ch[channel].rank > 1)
+               cs1_cap = cs0_cap >> (sdram_params->ch[channel].cs0_row
+                               - sdram_params->ch[channel].cs1_row);
+       if (sdram_params->ch[channel].row_3_4) {
+               cs0_cap = cs0_cap * 3 / 4;
+               cs1_cap = cs1_cap * 3 / 4;
+       }
+
+       writel(ddrconfig | (ddrconfig << 8), &ddr_msch_regs->ddrconf);
+       writel(((cs0_cap / 32) & 0xff) | (((cs1_cap / 32) & 0xff) << 8),
+              &ddr_msch_regs->ddrsize);
+}
+
+static void dram_all_config(struct dram_info *dram,
+                           const struct rk3399_sdram_params *sdram_params)
+{
+       u32 sys_reg = 0;
+       unsigned int channel, idx;
+
+       sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT;
+       sys_reg |= (sdram_params->base.num_channels - 1)
+                   << SYS_REG_NUM_CH_SHIFT;
+       for (channel = 0, idx = 0;
+            (idx < sdram_params->base.num_channels) && (channel < 2);
+            channel++) {
+               const struct rk3399_sdram_channel *info =
+                       &sdram_params->ch[channel];
+               struct rk3399_msch_regs *ddr_msch_regs;
+               const struct rk3399_msch_timings *noc_timing;
+
+               if (sdram_params->ch[channel].col == 0)
+                       continue;
+               idx++;
+               sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(channel);
+               sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(channel);
+               sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(channel);
+               sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(channel);
+               sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(channel);
+               sys_reg |= (info->cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(channel);
+               sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(channel);
+               sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(channel);
+               sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(channel);
+
+               ddr_msch_regs = dram->chan[channel].msch;
+               noc_timing = &sdram_params->ch[channel].noc_timings;
+               writel(noc_timing->ddrtiminga0,
+                      &ddr_msch_regs->ddrtiminga0);
+               writel(noc_timing->ddrtimingb0,
+                      &ddr_msch_regs->ddrtimingb0);
+               writel(noc_timing->ddrtimingc0,
+                      &ddr_msch_regs->ddrtimingc0);
+               writel(noc_timing->devtodev0,
+                      &ddr_msch_regs->devtodev0);
+               writel(noc_timing->ddrmode,
+                      &ddr_msch_regs->ddrmode);
+
+               /* rank 1 memory clock disable (dfi_dram_clk_disable = 1) */
+               if (sdram_params->ch[channel].rank == 1)
+                       setbits_le32(&dram->chan[channel].pctl->denali_ctl[276],
+                                    1 << 17);
+       }
+
+       writel(sys_reg, &dram->pmugrf->os_reg2);
+       rk_clrsetreg(&dram->pmusgrf->soc_con4, 0x1f << 10,
+                    sdram_params->base.stride << 10);
+
+       /* reboot hold register set */
+       writel(PRESET_SGRF_HOLD(0) | PRESET_GPIO0_HOLD(1) |
+               PRESET_GPIO1_HOLD(1),
+               &dram->pmucru->pmucru_rstnhold_con[1]);
+       clrsetbits_le32(&dram->cru->glb_rst_con, 0x3, 0x3);
+}
+
+static int switch_to_phy_index1(struct dram_info *dram,
+                                const struct rk3399_sdram_params *sdram_params)
+{
+       u32 channel;
+       u32 *denali_phy;
+       u32 ch_count = sdram_params->base.num_channels;
+       int ret;
+       int i = 0;
+
+       writel(RK_CLRSETBITS(0x03 << 4 | 1 << 2 | 1,
+                            1 << 4 | 1 << 2 | 1),
+                       &dram->cic->cic_ctrl0);
+       while (!(readl(&dram->cic->cic_status0) & (1 << 2))) {
+               mdelay(10);
+               i++;
+               if (i > 10) {
+                       debug("index1 frequency change overtime\n");
+                       return -ETIME;
+               }
+       }
+
+       i = 0;
+       writel(RK_CLRSETBITS(1 << 1, 1 << 1), &dram->cic->cic_ctrl0);
+       while (!(readl(&dram->cic->cic_status0) & (1 << 0))) {
+               mdelay(10);
+               if (i > 10) {
+                       debug("index1 frequency done overtime\n");
+                       return -ETIME;
+               }
+       }
+
+       for (channel = 0; channel < ch_count; channel++) {
+               denali_phy = dram->chan[channel].publ->denali_phy;
+               clrsetbits_le32(&denali_phy[896], (0x3 << 8) | 1, 1 << 8);
+               ret = data_training(&dram->chan[channel], channel,
+                                 sdram_params, PI_FULL_TRAINING);
+               if (ret) {
+                       debug("index1 training failed\n");
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+static int sdram_init(struct dram_info *dram,
+                     const struct rk3399_sdram_params *sdram_params)
+{
+       unsigned char dramtype = sdram_params->base.dramtype;
+       unsigned int ddr_freq = sdram_params->base.ddr_freq;
+       int channel;
+
+       debug("Starting SDRAM initialization...\n");
+
+       if ((dramtype == DDR3 && ddr_freq > 933) ||
+           (dramtype == LPDDR3 && ddr_freq > 933) ||
+           (dramtype == LPDDR4 && ddr_freq > 800)) {
+               debug("SDRAM frequency is to high!");
+               return -E2BIG;
+       }
+
+       for (channel = 0; channel < 2; channel++) {
+               const struct chan_info *chan = &dram->chan[channel];
+               struct rk3399_ddr_publ_regs *publ = chan->publ;
+
+               phy_dll_bypass_set(publ, ddr_freq);
+
+               if (channel >= sdram_params->base.num_channels)
+                       continue;
+
+               if (pctl_cfg(chan, channel, sdram_params) != 0) {
+                       printf("pctl_cfg fail, reset\n");
+                       return -EIO;
+               }
+
+               /* LPDDR2/LPDDR3 need to wait DAI complete, max 10us */
+               if (dramtype == LPDDR3)
+                       udelay(10);
+
+               if (data_training(chan, channel,
+                                 sdram_params, PI_FULL_TRAINING)) {
+                       printf("SDRAM initialization failed, reset\n");
+                       return -EIO;
+               }
+
+               set_ddrconfig(chan, sdram_params, channel,
+                             sdram_params->ch[channel].ddrconfig);
+       }
+       dram_all_config(dram, sdram_params);
+       switch_to_phy_index1(dram, sdram_params);
+
+       debug("Finish SDRAM initialization...\n");
+       return 0;
+}
+
+static int rk3399_dmc_ofdata_to_platdata(struct udevice *dev)
+{
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct rockchip_dmc_plat *plat = dev_get_platdata(dev);
+       int ret;
+
+       ret = dev_read_u32_array(dev, "rockchip,sdram-params",
+                                (u32 *)&plat->sdram_params,
+                                sizeof(plat->sdram_params) / sizeof(u32));
+       if (ret) {
+               printf("%s: Cannot read rockchip,sdram-params %d\n",
+                      __func__, ret);
+               return ret;
+       }
+       ret = regmap_init_mem(dev, &plat->map);
+       if (ret)
+               printf("%s: regmap failed %d\n", __func__, ret);
+
+#endif
+       return 0;
+}
+
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+static int conv_of_platdata(struct udevice *dev)
+{
+       struct rockchip_dmc_plat *plat = dev_get_platdata(dev);
+       struct dtd_rockchip_rk3399_dmc *dtplat = &plat->dtplat;
+       int ret;
+
+       ret = regmap_init_mem_platdata(dev, dtplat->reg,
+                       ARRAY_SIZE(dtplat->reg) / 2,
+                       &plat->map);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+#endif
+
+static int rk3399_dmc_init(struct udevice *dev)
+{
+       struct dram_info *priv = dev_get_priv(dev);
+       struct rockchip_dmc_plat *plat = dev_get_platdata(dev);
+       int ret;
+#if !CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct rk3399_sdram_params *params = &plat->sdram_params;
+#else
+       struct dtd_rockchip_rk3399_dmc *dtplat = &plat->dtplat;
+       struct rk3399_sdram_params *params =
+                                       (void *)dtplat->rockchip_sdram_params;
+
+       ret = conv_of_platdata(dev);
+       if (ret)
+               return ret;
+#endif
+
+       priv->cic = syscon_get_first_range(ROCKCHIP_SYSCON_CIC);
+       priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
+       priv->pmusgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF);
+       priv->pmucru = rockchip_get_pmucru();
+       priv->cru = rockchip_get_cru();
+       priv->chan[0].pctl = regmap_get_range(plat->map, 0);
+       priv->chan[0].pi = regmap_get_range(plat->map, 1);
+       priv->chan[0].publ = regmap_get_range(plat->map, 2);
+       priv->chan[0].msch = regmap_get_range(plat->map, 3);
+       priv->chan[1].pctl = regmap_get_range(plat->map, 4);
+       priv->chan[1].pi = regmap_get_range(plat->map, 5);
+       priv->chan[1].publ = regmap_get_range(plat->map, 6);
+       priv->chan[1].msch = regmap_get_range(plat->map, 7);
+
+       debug("con reg %p %p %p %p %p %p %p %p\n",
+             priv->chan[0].pctl, priv->chan[0].pi,
+             priv->chan[0].publ, priv->chan[0].msch,
+             priv->chan[1].pctl, priv->chan[1].pi,
+             priv->chan[1].publ, priv->chan[1].msch);
+       debug("cru %p, cic %p, grf %p, sgrf %p, pmucru %p\n", priv->cru,
+             priv->cic, priv->pmugrf, priv->pmusgrf, priv->pmucru);
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+       ret = clk_get_by_index_platdata(dev, 0, dtplat->clocks, &priv->ddr_clk);
+#else
+       ret = clk_get_by_index(dev, 0, &priv->ddr_clk);
+#endif
+       if (ret) {
+               printf("%s clk get failed %d\n", __func__, ret);
+               return ret;
+       }
+       ret = clk_set_rate(&priv->ddr_clk, params->base.ddr_freq * MHz);
+       if (ret < 0) {
+               printf("%s clk set failed %d\n", __func__, ret);
+               return ret;
+       }
+       ret = sdram_init(priv, params);
+       if (ret < 0) {
+               printf("%s DRAM init failed%d\n", __func__, ret);
+               return ret;
+       }
+
+       return 0;
+}
+#endif
+
+static int rk3399_dmc_probe(struct udevice *dev)
+{
+#ifdef CONFIG_SPL_BUILD
+       if (rk3399_dmc_init(dev))
+               return 0;
+#else
+       struct dram_info *priv = dev_get_priv(dev);
+
+       priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
+       debug("%s: pmugrf=%p\n", __func__, priv->pmugrf);
+       priv->info.base = CONFIG_SYS_SDRAM_BASE;
+       priv->info.size = rockchip_sdram_size(
+                       (phys_addr_t)&priv->pmugrf->os_reg2);
+#endif
+       return 0;
+}
+
+static int rk3399_dmc_get_info(struct udevice *dev, struct ram_info *info)
+{
+       struct dram_info *priv = dev_get_priv(dev);
+
+       *info = priv->info;
+
+       return 0;
+}
+
+static struct ram_ops rk3399_dmc_ops = {
+       .get_info = rk3399_dmc_get_info,
+};
+
+
+static const struct udevice_id rk3399_dmc_ids[] = {
+       { .compatible = "rockchip,rk3399-dmc" },
+       { }
+};
+
+U_BOOT_DRIVER(dmc_rk3399) = {
+       .name = "rockchip_rk3399_dmc",
+       .id = UCLASS_RAM,
+       .of_match = rk3399_dmc_ids,
+       .ops = &rk3399_dmc_ops,
+#ifdef CONFIG_SPL_BUILD
+       .ofdata_to_platdata = rk3399_dmc_ofdata_to_platdata,
+#endif
+       .probe = rk3399_dmc_probe,
+       .priv_auto_alloc_size = sizeof(struct dram_info),
+#ifdef CONFIG_SPL_BUILD
+       .platdata_auto_alloc_size = sizeof(struct rockchip_dmc_plat),
+#endif
+};
index b1b0289a1b05b178c71511b791aeada31d3125ba..fdf088e783362398dcdc69d7e41ba66d73c7311a 100644 (file)
@@ -262,7 +262,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev)
                bank_name = (char *)ofnode_get_name(bank_node);
                strsep(&bank_name, "@");
                if (!bank_name) {
-                       error("missing sdram bank index");
+                       pr_err("missing sdram bank index");
                        return -EINVAL;
                }
 
@@ -271,7 +271,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev)
                               (long unsigned int *)&bank_params->target_bank);
 
                if (bank_params->target_bank >= MAX_SDRAM_BANK) {
-                       error("Found bank %d , but only bank 0 and 1 are supported",
+                       pr_err("Found bank %d , but only bank 0 and 1 are supported",
                              bank_params->target_bank);
                        return -EINVAL;
                }
@@ -285,7 +285,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev)
                                                  sizeof(struct stm32_sdram_control));
 
                if (!params->bank_params[bank].sdram_control) {
-                       error("st,sdram-control not found for %s",
+                       pr_err("st,sdram-control not found for %s",
                              ofnode_get_name(bank_node));
                        return -EINVAL;
                }
@@ -298,7 +298,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev)
                                                  sizeof(struct stm32_sdram_timing));
 
                if (!params->bank_params[bank].sdram_timing) {
-                       error("st,sdram-timing not found for %s",
+                       pr_err("st,sdram-timing not found for %s",
                              ofnode_get_name(bank_node));
                        return -EINVAL;
                }
index a79708cde2800a7169e905396afb808b15aa6767..024b996f0c16d9f506f66dd12174cd762362f71f 100644 (file)
@@ -201,20 +201,20 @@ phys_addr_t sti_reset_get_regmap(const char *compatible)
        node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
                                             compatible);
        if (node < 0) {
-               error("unable to find %s node\n", compatible);
+               pr_err("unable to find %s node\n", compatible);
                return node;
        }
 
        ret = uclass_get_device_by_of_offset(UCLASS_SYSCON, node, &syscon);
        if (ret) {
-               error("%s: uclass_get_device_by_of_offset failed: %d\n",
+               pr_err("%s: uclass_get_device_by_of_offset failed: %d\n",
                      __func__, ret);
                return ret;
        }
 
        regmap = syscon_get_regmap(syscon);
        if (!regmap) {
-               error("unable to get regmap for %s\n", syscon->name);
+               pr_err("unable to get regmap for %s\n", syscon->name);
                return -ENODEV;
        }
 
@@ -251,7 +251,7 @@ static int sti_reset_program_hw(struct reset_ctl *reset_ctl, int assert)
                        if (ch->deassert_cnt > 0)
                                return 0;
                } else
-                       error("Reset balancing error: reset_ctl=%p dev=%p id=%lu\n",
+                       pr_err("Reset balancing error: reset_ctl=%p dev=%p id=%lu\n",
                              reset_ctl, reset_ctl->dev, reset_ctl->id);
        }
 
@@ -268,7 +268,7 @@ static int sti_reset_program_hw(struct reset_ctl *reset_ctl, int assert)
        reg = (void __iomem *)base + ch->ack_offset;
        if (wait_for_bit(__func__, reg, BIT(ch->ack_bit), ctrl_val,
                         1000, false)) {
-               error("Stuck on waiting ack reset_ctl=%p dev=%p id=%lu\n",
+               pr_err("Stuck on waiting ack reset_ctl=%p dev=%p id=%lu\n",
                      reset_ctl, reset_ctl->dev, reset_ctl->id);
 
                return -ETIMEDOUT;
index 9bf2e26e9d11e96cda926c2ee1616d0340d1a498..7c54a49bb32ec050a0dfd1968f7a1d55527e7d1a 100644 (file)
@@ -531,9 +531,9 @@ config STI_ASC_SERIAL
 
 config STM32X7_SERIAL
        bool "STMicroelectronics STM32 SoCs on-chip UART"
-       depends on DM_SERIAL && (STM32F7 || STM32H7)
+       depends on DM_SERIAL && (STM32F4 || STM32F7 || STM32H7)
        help
-         If you have a machine based on a STM32 F7 or H7 SoC you can
+         If you have a machine based on a STM32 F4, F7 or H7 SoC you can
          enable its onboard serial ports, say Y to this option.
          If unsure, say N.
 
index 2f4eafa885ac9c281c6f3e78c565c0506747d7d3..a5d529cab28d65fbc1d92a6c8cac5edaf8075b54 100644 (file)
@@ -17,71 +17,81 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static int stm32_serial_setbrg(struct udevice *dev, int baudrate)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
+       bool stm32f4 = plat->uart_info->stm32f4;
+       fdt_addr_t base = plat->base;
        u32 int_div, mantissa, fraction, oversampling;
 
        int_div = DIV_ROUND_CLOSEST(plat->clock_rate, baudrate);
 
        if (int_div < 16) {
                oversampling = 8;
-               setbits_le32(&usart->cr1, USART_CR1_OVER8);
+               setbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_OVER8);
        } else {
                oversampling = 16;
-               clrbits_le32(&usart->cr1, USART_CR1_OVER8);
+               clrbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_OVER8);
        }
 
        mantissa = (int_div / oversampling) << USART_BRR_M_SHIFT;
        fraction = int_div % oversampling;
 
-       writel(mantissa | fraction, &usart->brr);
+       writel(mantissa | fraction, base + BRR_OFFSET(stm32f4));
 
        return 0;
 }
 
 static int stm32_serial_getc(struct udevice *dev)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
+       bool stm32f4 = plat->uart_info->stm32f4;
+       fdt_addr_t base = plat->base;
 
-       if ((readl(&usart->sr) & USART_SR_FLAG_RXNE) == 0)
+       if ((readl(base + ISR_OFFSET(stm32f4)) & USART_SR_FLAG_RXNE) == 0)
                return -EAGAIN;
 
-       return readl(&usart->rd_dr);
+       return readl(base + RDR_OFFSET(stm32f4));
 }
 
 static int stm32_serial_putc(struct udevice *dev, const char c)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
+       bool stm32f4 = plat->uart_info->stm32f4;
+       fdt_addr_t base = plat->base;
 
-       if ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0)
+       if ((readl(base + ISR_OFFSET(stm32f4)) & USART_SR_FLAG_TXE) == 0)
                return -EAGAIN;
 
-       writel(c, &usart->tx_dr);
+       writel(c, base + TDR_OFFSET(stm32f4));
 
        return 0;
 }
 
 static int stm32_serial_pending(struct udevice *dev, bool input)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
+       bool stm32f4 = plat->uart_info->stm32f4;
+       fdt_addr_t base = plat->base;
 
        if (input)
-               return readl(&usart->sr) & USART_SR_FLAG_RXNE ? 1 : 0;
+               return readl(base + ISR_OFFSET(stm32f4)) &
+                       USART_SR_FLAG_RXNE ? 1 : 0;
        else
-               return readl(&usart->sr) & USART_SR_FLAG_TXE ? 0 : 1;
+               return readl(base + ISR_OFFSET(stm32f4)) &
+                       USART_SR_FLAG_TXE ? 0 : 1;
 }
 
 static int stm32_serial_probe(struct udevice *dev)
 {
-       struct stm32x7_serial_platdata *plat = dev->platdata;
-       struct stm32_usart *const usart = plat->base;
-
-#ifdef CONFIG_CLK
-       int ret;
+       struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
        struct clk clk;
+       fdt_addr_t base = plat->base;
+       int ret;
+       bool stm32f4;
+       u8 uart_enable_bit;
+
+       plat->uart_info = (struct stm32_uart_info *)dev_get_driver_data(dev);
+       stm32f4 = plat->uart_info->stm32f4;
+       uart_enable_bit = plat->uart_info->uart_enable_bit;
 
        ret = clk_get_by_index(dev, 0, &clk);
        if (ret < 0)
@@ -92,7 +102,6 @@ static int stm32_serial_probe(struct udevice *dev)
                dev_err(dev, "failed to enable clock\n");
                return ret;
        }
-#endif
 
        plat->clock_rate = clk_get_rate(&clk);
        if (plat->clock_rate < 0) {
@@ -100,37 +109,36 @@ static int stm32_serial_probe(struct udevice *dev)
                return plat->clock_rate;
        };
 
-       /* Disable usart-> disable overrun-> enable usart */
-       clrbits_le32(&usart->cr1, USART_CR1_RE | USART_CR1_TE | USART_CR1_UE);
-       setbits_le32(&usart->cr3, USART_CR3_OVRDIS);
-       setbits_le32(&usart->cr1, USART_CR1_RE | USART_CR1_TE | USART_CR1_UE);
+       /* Disable uart-> disable overrun-> enable uart */
+       clrbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_RE | USART_CR1_TE |
+                    BIT(uart_enable_bit));
+       if (plat->uart_info->has_overrun_disable)
+               setbits_le32(base + CR3_OFFSET(stm32f4), USART_CR3_OVRDIS);
+       if (plat->uart_info->has_fifo)
+               setbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_FIFOEN);
+       setbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_RE | USART_CR1_TE |
+                    BIT(uart_enable_bit));
 
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct udevice_id stm32_serial_id[] = {
-       {.compatible = "st,stm32f7-usart"},
-       {.compatible = "st,stm32f7-uart"},
-       {.compatible = "st,stm32h7-usart"},
-       {.compatible = "st,stm32h7-uart"},
+       { .compatible = "st,stm32-uart", .data = (ulong)&stm32f4_info},
+       { .compatible = "st,stm32f7-uart", .data = (ulong)&stm32f7_info},
+       { .compatible = "st,stm32h7-uart", .data = (ulong)&stm32h7_info},
        {}
 };
 
 static int stm32_serial_ofdata_to_platdata(struct udevice *dev)
 {
        struct stm32x7_serial_platdata *plat = dev_get_platdata(dev);
-       fdt_addr_t addr;
 
-       addr = devfdt_get_addr(dev);
-       if (addr == FDT_ADDR_T_NONE)
+       plat->base = devfdt_get_addr(dev);
+       if (plat->base == FDT_ADDR_T_NONE)
                return -EINVAL;
 
-       plat->base = (struct stm32_usart *)addr;
-
        return 0;
 }
-#endif
 
 static const struct dm_serial_ops stm32_serial_ops = {
        .putc = stm32_serial_putc,
index 9fe37af5cc998db1d3bb563fefe679a3a5364ca7..b914edf28a11905399c236a4312da671474bd797 100644 (file)
@@ -8,38 +8,65 @@
 #ifndef _SERIAL_STM32_X7_
 #define _SERIAL_STM32_X7_
 
-struct stm32_usart {
-       u32 cr1;
-       u32 cr2;
-       u32 cr3;
-       u32 brr;
-       u32 gtpr;
-       u32 rtor;
-       u32 rqr;
-       u32 sr;
-       u32 icr;
-       u32 rd_dr;
-       u32 tx_dr;
+#define CR1_OFFSET(x)  (x ? 0x0c : 0x00)
+#define CR3_OFFSET(x)  (x ? 0x14 : 0x08)
+#define BRR_OFFSET(x)  (x ? 0x08 : 0x0c)
+#define ISR_OFFSET(x)  (x ? 0x00 : 0x1c)
+/*
+ * STM32F4 has one Data Register (DR) for received or transmitted
+ * data, so map Receive Data Register (RDR) and Transmit Data
+ * Register (TDR) at the same offset
+ */
+#define RDR_OFFSET(x)  (x ? 0x04 : 0x24)
+#define TDR_OFFSET(x)  (x ? 0x04 : 0x28)
+
+struct stm32_uart_info {
+       u8 uart_enable_bit;     /* UART_CR1_UE */
+       bool stm32f4;           /* true for STM32F4, false otherwise */
+       bool has_overrun_disable;
+       bool has_fifo;
+};
+
+struct stm32_uart_info stm32f4_info = {
+       .stm32f4 = true,
+       .uart_enable_bit = 13,
+       .has_overrun_disable = false,
+       .has_fifo = false,
+};
+
+struct stm32_uart_info stm32f7_info = {
+       .uart_enable_bit = 0,
+       .stm32f4 = false,
+       .has_overrun_disable = true,
+       .has_fifo = false,
+};
+
+struct stm32_uart_info stm32h7_info = {
+       .uart_enable_bit = 0,
+       .stm32f4 = false,
+       .has_overrun_disable = true,
+       .has_fifo = true,
 };
 
 /* Information about a serial port */
 struct stm32x7_serial_platdata {
-       struct stm32_usart *base;  /* address of registers in physical memory */
+       fdt_addr_t base;  /* address of registers in physical memory */
+       struct stm32_uart_info *uart_info;
        unsigned long int clock_rate;
 };
 
-#define USART_CR1_OVER8                        (1 << 15)
-#define USART_CR1_TE                   (1 << 3)
-#define USART_CR1_RE                   (1 << 2)
-#define USART_CR1_UE                   (1 << 0)
+#define USART_CR1_FIFOEN               BIT(29)
+#define USART_CR1_OVER8                        BIT(15)
+#define USART_CR1_TE                   BIT(3)
+#define USART_CR1_RE                   BIT(2)
 
-#define USART_CR3_OVRDIS               (1 << 12)
+#define USART_CR3_OVRDIS               BIT(12)
 
-#define USART_SR_FLAG_RXNE             (1 << 5)
-#define USART_SR_FLAG_TXE              (1 << 7)
+#define USART_SR_FLAG_RXNE             BIT(5)
+#define USART_SR_FLAG_TXE              BIT(7)
 
-#define USART_BRR_F_MASK               0xFF
+#define USART_BRR_F_MASK               GENMASK(7, 0)
 #define USART_BRR_M_SHIFT              4
-#define USART_BRR_M_MASK               0xFFF0
+#define USART_BRR_M_MASK               GENMASK(15, 4)
 
 #endif
index e2f8342e887f1b03c0ddb124542a5cf30e1b9d12..228e714e093374a0494e8fd69cfe85330d92e5c4 100644 (file)
@@ -474,7 +474,7 @@ static int atmel_spi_probe(struct udevice *bus)
        ret = gpio_request_list_by_name(bus, "cs-gpios", priv->cs_gpios,
                                        ARRAY_SIZE(priv->cs_gpios), 0);
        if (ret < 0) {
-               error("Can't get %s gpios! Error: %d", bus->name, ret);
+               pr_err("Can't get %s gpios! Error: %d", bus->name, ret);
                return ret;
        }
 
index 291ef9576ad485511aad1a56a98cd756bff7d1e1..eda252d0b30f65f3fbc8724b8798ab9a699b0931 100644 (file)
@@ -563,6 +563,7 @@ static const struct dm_spi_ops davinci_spi_ops = {
 static const struct udevice_id davinci_spi_ids[] = {
        { .compatible = "ti,keystone-spi" },
        { .compatible = "ti,dm6441-spi" },
+       { .compatible = "ti,da830-spi" },
        { }
 };
 
index 1dfa89afc9c84eb6617359febef54687910ec064..0f3f7d97f0137fa7b258358119f8a0459d313a33 100644 (file)
@@ -14,6 +14,7 @@
 #include <dm.h>
 #include <errno.h>
 #include <watchdog.h>
+#include <wait_bit.h>
 #include "fsl_qspi.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -663,22 +664,20 @@ static void qspi_op_write(struct fsl_qspi_priv *priv, u8 *txbuf, u32 len)
        tx_size = (len > TX_BUFFER_SIZE) ?
                TX_BUFFER_SIZE : len;
 
-       size = tx_size / 4;
-       for (i = 0; i < size; i++) {
+       size = tx_size / 16;
+       /*
+        * There must be atleast 128bit data
+        * available in TX FIFO for any pop operation
+        */
+       if (tx_size % 16)
+               size++;
+       for (i = 0; i < size * 4; i++) {
                memcpy(&data, txbuf, 4);
                data = qspi_endian_xchg(data);
                qspi_write32(priv->flags, &regs->tbdr, data);
                txbuf += 4;
        }
 
-       size = tx_size % 4;
-       if (size) {
-               data = 0;
-               memcpy(&data, txbuf, size);
-               data = qspi_endian_xchg(data);
-               qspi_write32(priv->flags, &regs->tbdr, data);
-       }
-
        qspi_write32(priv->flags, &regs->ipcr,
                     (seqid << QSPI_IPCR_SEQID_SHIFT) | tx_size);
        while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
@@ -991,7 +990,7 @@ static int fsl_qspi_probe(struct udevice *bus)
        struct fsl_qspi_platdata *plat = dev_get_platdata(bus);
        struct fsl_qspi_priv *priv = dev_get_priv(bus);
        struct dm_spi_bus *dm_spi_bus;
-       int i;
+       int i, ret;
 
        dm_spi_bus = bus->uclass_priv;
 
@@ -1011,6 +1010,18 @@ static int fsl_qspi_probe(struct udevice *bus)
        priv->flash_num = plat->flash_num;
        priv->num_chipselect = plat->num_chipselect;
 
+       /* make sure controller is not busy anywhere */
+       ret = wait_for_bit(__func__, &priv->regs->sr,
+                          QSPI_SR_BUSY_MASK |
+                          QSPI_SR_AHB_ACC_MASK |
+                          QSPI_SR_IP_ACC_MASK,
+                          false, 100, false);
+
+       if (ret) {
+               debug("ERROR : The controller is busy\n");
+               return ret;
+       }
+
        mcr_val = qspi_read32(priv->flags, &priv->regs->mcr);
        qspi_write32(priv->flags, &priv->regs->mcr,
                     QSPI_MCR_RESERVED_MASK | QSPI_MCR_MDIS_MASK |
@@ -1156,10 +1167,23 @@ static int fsl_qspi_claim_bus(struct udevice *dev)
        struct fsl_qspi_priv *priv;
        struct udevice *bus;
        struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+       int ret;
 
        bus = dev->parent;
        priv = dev_get_priv(bus);
 
+       /* make sure controller is not busy anywhere */
+       ret = wait_for_bit(__func__, &priv->regs->sr,
+                          QSPI_SR_BUSY_MASK |
+                          QSPI_SR_AHB_ACC_MASK |
+                          QSPI_SR_IP_ACC_MASK,
+                          false, 100, false);
+
+       if (ret) {
+               debug("ERROR : The controller is busy\n");
+               return ret;
+       }
+
        priv->cur_amba_base = priv->amba_base[slave_plat->cs];
 
        qspi_module_disable(priv, 0);
index 6cb361018b46f783bf03afbdb29dbe0da0300ebf..e468eb2529b4a0f8e1a69803922d490170738868 100644 (file)
@@ -105,6 +105,10 @@ struct fsl_qspi_regs {
 #define QSPI_RBCT_RXBRD_SHIFT          8
 #define QSPI_RBCT_RXBRD_USEIPS         (1 << QSPI_RBCT_RXBRD_SHIFT)
 
+#define QSPI_SR_AHB_ACC_SHIFT          2
+#define QSPI_SR_AHB_ACC_MASK           (1 << QSPI_SR_AHB_ACC_SHIFT)
+#define QSPI_SR_IP_ACC_SHIFT           1
+#define QSPI_SR_IP_ACC_MASK            (1 << QSPI_SR_IP_ACC_SHIFT)
 #define QSPI_SR_BUSY_SHIFT             0
 #define QSPI_SR_BUSY_MASK              (1 << QSPI_SR_BUSY_SHIFT)
 
index c5b766c0dd003cc86a38c8ba041b95cfc960b3d3..e2a593b93444e82fa06d80a4e83acc8e80a7a423 100644 (file)
@@ -66,17 +66,17 @@ struct spi_slave *spi_setup_slave(uint bus, uint cs, uint max_hz, uint mode)
        /* we only set up SSP0 for now, so ignore bus */
 
        if (mode & SPI_3WIRE) {
-               error("3-wire mode not supported");
+               pr_err("3-wire mode not supported");
                return NULL;
        }
 
        if (mode & SPI_SLAVE) {
-               error("slave mode not supported\n");
+               pr_err("slave mode not supported\n");
                return NULL;
        }
 
        if (mode & SPI_PREAMBLE) {
-               error("preamble byte skipping not supported\n");
+               pr_err("preamble byte skipping not supported\n");
                return NULL;
        }
 
index e1562c36b7a6b5ecec5892d8ba85719cdda0e7f7..41f0cfcd6b7a6db5324be39f26b494c7548d1c48 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <malloc.h>
 #include <spi.h>
 #include <linux/errno.h>
@@ -14,6 +15,8 @@
 #include <asm/arch/clock.h>
 #include <asm/mach-imx/spi.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_MX27
 /* i.MX27 has a completely wrong register layout and register definitions in the
  * datasheet, the correct one is in the Freescale's Linux driver */
 "See linux mxc_spi driver from Freescale for details."
 #endif
 
-static unsigned long spi_bases[] = {
-       MXC_SPI_BASE_ADDRESSES
-};
-
 __weak int board_spi_cs_gpio(unsigned bus, unsigned cs)
 {
        return -1;
@@ -51,6 +50,7 @@ struct mxc_spi_slave {
        int             ss_pol;
        unsigned int    max_hz;
        unsigned int    mode;
+       struct gpio_desc ss;
 };
 
 static inline struct mxc_spi_slave *to_mxc_spi_slave(struct spi_slave *slave)
@@ -58,19 +58,24 @@ static inline struct mxc_spi_slave *to_mxc_spi_slave(struct spi_slave *slave)
        return container_of(slave, struct mxc_spi_slave, slave);
 }
 
-void spi_cs_activate(struct spi_slave *slave)
+static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
 {
-       struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave);
-       if (mxcs->gpio > 0)
-               gpio_set_value(mxcs->gpio, mxcs->ss_pol);
+       if (CONFIG_IS_ENABLED(DM_SPI)) {
+               dm_gpio_set_value(&mxcs->ss, mxcs->ss_pol);
+       } else {
+               if (mxcs->gpio > 0)
+                       gpio_set_value(mxcs->gpio, mxcs->ss_pol);
+       }
 }
 
-void spi_cs_deactivate(struct spi_slave *slave)
+static void mxc_spi_cs_deactivate(struct mxc_spi_slave *mxcs)
 {
-       struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave);
-       if (mxcs->gpio > 0)
-               gpio_set_value(mxcs->gpio,
-                             !(mxcs->ss_pol));
+       if (CONFIG_IS_ENABLED(DM_SPI)) {
+               dm_gpio_set_value(&mxcs->ss, !(mxcs->ss_pol));
+       } else {
+               if (mxcs->gpio > 0)
+                       gpio_set_value(mxcs->gpio, !(mxcs->ss_pol));
+       }
 }
 
 u32 get_cspi_div(u32 div)
@@ -211,10 +216,9 @@ static s32 spi_cfg_mxc(struct mxc_spi_slave *mxcs, unsigned int cs)
 }
 #endif
 
-int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen,
+int spi_xchg_single(struct mxc_spi_slave *mxcs, unsigned int bitlen,
        const u8 *dout, u8 *din, unsigned long flags)
 {
-       struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave);
        int nbytes = DIV_ROUND_UP(bitlen, 8);
        u32 data, cnt, i;
        struct cspi_regs *regs = (struct cspi_regs *)mxcs->base;
@@ -327,8 +331,9 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen,
 
 }
 
-int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
-               void *din, unsigned long flags)
+static int mxc_spi_xfer_internal(struct mxc_spi_slave *mxcs,
+                                unsigned int bitlen, const void *dout,
+                                void *din, unsigned long flags)
 {
        int n_bytes = DIV_ROUND_UP(bitlen, 8);
        int n_bits;
@@ -337,11 +342,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
        u8 *p_outbuf = (u8 *)dout;
        u8 *p_inbuf = (u8 *)din;
 
-       if (!slave)
-               return -1;
+       if (!mxcs)
+               return -EINVAL;
 
        if (flags & SPI_XFER_BEGIN)
-               spi_cs_activate(slave);
+               mxc_spi_cs_activate(mxcs);
 
        while (n_bytes > 0) {
                if (n_bytes < MAX_SPI_BYTES)
@@ -351,7 +356,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
 
                n_bits = blk_size * 8;
 
-               ret = spi_xchg_single(slave, n_bits, p_outbuf, p_inbuf, 0);
+               ret = spi_xchg_single(mxcs, n_bits, p_outbuf, p_inbuf, 0);
 
                if (ret)
                        return ret;
@@ -363,12 +368,39 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
        }
 
        if (flags & SPI_XFER_END) {
-               spi_cs_deactivate(slave);
+               mxc_spi_cs_deactivate(mxcs);
        }
 
        return 0;
 }
 
+static int mxc_spi_claim_bus_internal(struct mxc_spi_slave *mxcs, int cs)
+{
+       struct cspi_regs *regs = (struct cspi_regs *)mxcs->base;
+       int ret;
+
+       reg_write(&regs->rxdata, 1);
+       udelay(1);
+       ret = spi_cfg_mxc(mxcs, cs);
+       if (ret) {
+               printf("mxc_spi: cannot setup SPI controller\n");
+               return ret;
+       }
+       reg_write(&regs->period, MXC_CSPIPERIOD_32KHZ);
+       reg_write(&regs->intr, 0);
+
+       return 0;
+}
+
+#ifndef CONFIG_DM_SPI
+int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
+               void *din, unsigned long flags)
+{
+       struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave);
+
+       return mxc_spi_xfer_internal(mxcs, bitlen, dout, din, flags);
+}
+
 void spi_init(void)
 {
 }
@@ -390,6 +422,7 @@ static int setup_cs_gpio(struct mxc_spi_slave *mxcs,
        if (mxcs->gpio == -1)
                return 0;
 
+       gpio_request(mxcs->gpio, "spi-cs");
        ret = gpio_direction_output(mxcs->gpio, !(mxcs->ss_pol));
        if (ret) {
                printf("mxc_spi: cannot setup gpio %d\n", mxcs->gpio);
@@ -399,6 +432,10 @@ static int setup_cs_gpio(struct mxc_spi_slave *mxcs,
        return 0;
 }
 
+static unsigned long spi_bases[] = {
+       MXC_SPI_BASE_ADDRESSES
+};
+
 struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
                        unsigned int max_hz, unsigned int mode)
 {
@@ -443,24 +480,104 @@ void spi_free_slave(struct spi_slave *slave)
 
 int spi_claim_bus(struct spi_slave *slave)
 {
-       int ret;
        struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave);
-       struct cspi_regs *regs = (struct cspi_regs *)mxcs->base;
 
-       reg_write(&regs->rxdata, 1);
-       udelay(1);
-       ret = spi_cfg_mxc(mxcs, slave->cs);
+       return mxc_spi_claim_bus_internal(mxcs, slave->cs);
+}
+
+void spi_release_bus(struct spi_slave *slave)
+{
+       /* TODO: Shut the controller down */
+}
+#else
+
+static int mxc_spi_probe(struct udevice *bus)
+{
+       struct mxc_spi_slave *plat = bus->platdata;
+       struct mxc_spi_slave *mxcs = dev_get_platdata(bus);
+       int node = dev_of_offset(bus);
+       const void *blob = gd->fdt_blob;
+       int ret;
+
+       if (gpio_request_by_name(bus, "cs-gpios", 0, &plat->ss,
+                                GPIOD_IS_OUT)) {
+               dev_err(bus, "No cs-gpios property\n");
+               return -EINVAL;
+       }
+
+       plat->base = dev_get_addr(bus);
+       if (plat->base == FDT_ADDR_T_NONE)
+               return -ENODEV;
+
+       ret = dm_gpio_set_value(&plat->ss, !(mxcs->ss_pol));
        if (ret) {
-               printf("mxc_spi: cannot setup SPI controller\n");
+               dev_err(bus, "Setting cs error\n");
                return ret;
        }
-       reg_write(&regs->period, MXC_CSPIPERIOD_32KHZ);
-       reg_write(&regs->intr, 0);
+
+       mxcs->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency",
+                                     20000000);
 
        return 0;
 }
 
-void spi_release_bus(struct spi_slave *slave)
+static int mxc_spi_xfer(struct udevice *dev, unsigned int bitlen,
+               const void *dout, void *din, unsigned long flags)
 {
-       /* TODO: Shut the controller down */
+       struct mxc_spi_slave *mxcs = dev_get_platdata(dev->parent);
+
+
+       return mxc_spi_xfer_internal(mxcs, bitlen, dout, din, flags);
+}
+
+static int mxc_spi_claim_bus(struct udevice *dev)
+{
+       struct mxc_spi_slave *mxcs = dev_get_platdata(dev->parent);
+       struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+
+       return mxc_spi_claim_bus_internal(mxcs, slave_plat->cs);
 }
+
+static int mxc_spi_release_bus(struct udevice *dev)
+{
+       return 0;
+}
+
+static int mxc_spi_set_speed(struct udevice *bus, uint speed)
+{
+       /* Nothing to do */
+       return 0;
+}
+
+static int mxc_spi_set_mode(struct udevice *bus, uint mode)
+{
+       struct mxc_spi_slave *mxcs = dev_get_platdata(bus);
+
+       mxcs->mode = mode;
+       mxcs->ss_pol = (mode & SPI_CS_HIGH) ? 1 : 0;
+
+       return 0;
+}
+
+static const struct dm_spi_ops mxc_spi_ops = {
+       .claim_bus      = mxc_spi_claim_bus,
+       .release_bus    = mxc_spi_release_bus,
+       .xfer           = mxc_spi_xfer,
+       .set_speed      = mxc_spi_set_speed,
+       .set_mode       = mxc_spi_set_mode,
+};
+
+static const struct udevice_id mxc_spi_ids[] = {
+       { .compatible = "fsl,imx51-ecspi" },
+       { }
+};
+
+U_BOOT_DRIVER(mxc_spi) = {
+       .name   = "mxc_spi",
+       .id     = UCLASS_SPI,
+       .of_match = mxc_spi_ids,
+       .ops    = &mxc_spi_ops,
+       .platdata_auto_alloc_size = sizeof(struct mxc_spi_slave),
+       .probe  = mxc_spi_probe,
+};
+#endif
index 9b58aa8e97b2a4391fdc7b61a766242091d958fd..bf698a737bd74a24db377b21d178b6b5a0fbc576 100644 (file)
@@ -39,7 +39,7 @@ static int sti_sysreset_probe(struct udevice *dev)
                                             "st,syscfg", NULL, 0, 0,
                                             &syscfg_phandle);
        if (ret < 0) {
-               error("Can't get syscfg phandle: %d\n", ret);
+               pr_err("Can't get syscfg phandle: %d\n", ret);
                return ret;
        }
 
@@ -47,14 +47,14 @@ static int sti_sysreset_probe(struct udevice *dev)
                                             syscfg_phandle.node,
                                             &syscon);
        if (ret) {
-               error("%s: uclass_get_device_by_of_offset failed: %d\n",
+               pr_err("%s: uclass_get_device_by_of_offset failed: %d\n",
                      __func__, ret);
                return ret;
        }
 
        regmap = syscon_get_regmap(syscon);
        if (!regmap) {
-               error("unable to get regmap for %s\n", syscon->name);
+               pr_err("unable to get regmap for %s\n", syscon->name);
                return -ENODEV;
        }
 
index 3818faeb462fe7761c20c8b42e2e90f3dad2167c..3abce7f678679ac838476f77773eabefea9e9802 100644 (file)
@@ -45,13 +45,13 @@ int syscon_reboot_probe(struct udevice *dev)
        err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
                                           "regmap", &syscon);
        if (err) {
-               error("unable to find syscon device\n");
+               pr_err("unable to find syscon device\n");
                return err;
        }
 
        priv->regmap = syscon_get_regmap(syscon);
        if (!priv->regmap) {
-               error("unable to find regmap\n");
+               pr_err("unable to find regmap\n");
                return -ENODEV;
        }
 
index 304ed052a2c317faed4ab3d87fd3bdc853cf9c04..ab250aea292ffa3e41dc669cf8345d563c93cd2f 100644 (file)
@@ -38,7 +38,7 @@ int wdt_reboot_probe(struct udevice *dev)
        err = uclass_get_device_by_phandle(UCLASS_WDT, dev,
                                           "wdt", &priv->wdt);
        if (err) {
-               error("unable to find wdt device\n");
+               pr_err("unable to find wdt device\n");
                return err;
        }
 
index ef3ff0dbf67eb6705bf51e444661f8963a7ca4a7..e3e20d899689af107bf1abc9b10b538bb467146a 100644 (file)
@@ -539,7 +539,7 @@ static int tpm_tis_i2c_init(struct udevice *dev)
        }
 
        if (chip->chip_type != UNKNOWN && vendor != expected_did_vid) {
-               error("Vendor id did not match! ID was %08x\n", vendor);
+               pr_err("Vendor id did not match! ID was %08x\n", vendor);
                return -ENODEV;
        }
 
index 62126aad2fb414fac590144f9e76e264bf927dc1..e7658b4d95c9c90efb51dc726498489bc06b4aa5 100644 (file)
@@ -75,7 +75,7 @@ if USB_KEYBOARD
 
 choice
        prompt "USB keyboard polling"
-       optional
+       default SYS_USB_EVENT_POLL
        ---help---
          Enable a polling mechanism for USB keyboard.
 
index 35c2dc18d9554eb3b75f0eff4d65e0e2f8f99733..e8432bb016eb9f707e11d6fd8292c9e345366e94 100644 (file)
@@ -28,7 +28,7 @@ enum usb_dr_mode usb_get_dr_mode(int node)
 
        dr_mode = fdt_getprop(fdt, node, "dr_mode", NULL);
        if (!dr_mode) {
-               error("usb dr_mode not found\n");
+               pr_err("usb dr_mode not found\n");
                return USB_DR_MODE_UNKNOWN;
        }
 
index a291ceb6ae0b8ae1acb905d9bb01832c09834588..ae7fc1c6304d4138a4475cae7b897a0cea1bb8d2 100644 (file)
@@ -37,6 +37,13 @@ config USB_DWC3_OMAP
 
          Say 'Y' here if you have one such device
 
+config USB_DWC3_UNIPHIER
+       bool "DesignWare USB3 Host Support on UniPhier Platforms"
+       depends on ARCH_UNIPHIER && USB_XHCI_DWC3
+       help
+         Support of USB2/3 functionality in Socionext UniPhier platforms.
+         Say 'Y' here if you have one such device.
+
 menu "PHY Subsystem"
 
 config USB_DWC3_PHY_OMAP
index 2964bae0d8f4b7245a9faca3595543f7f096a5e4..51497768b21d43a30e6e38232a0f4779deadfa2e 100644 (file)
@@ -9,5 +9,6 @@ dwc3-y                                  := core.o
 obj-$(CONFIG_USB_DWC3_GADGET)          += gadget.o ep0.o
 
 obj-$(CONFIG_USB_DWC3_OMAP)            += dwc3-omap.o
+obj-$(CONFIG_USB_DWC3_UNIPHIER)                += dwc3-uniphier.o
 obj-$(CONFIG_USB_DWC3_PHY_OMAP)                += ti_usb_phy.o
 obj-$(CONFIG_USB_DWC3_PHY_SAMSUNG)     += samsung_usb_phy.o
diff --git a/drivers/usb/dwc3/dwc3-uniphier.c b/drivers/usb/dwc3/dwc3-uniphier.c
new file mode 100644 (file)
index 0000000..0d13770
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * UniPhier Specific Glue Layer for DWC3
+ *
+ * Copyright (C) 2016-2017 Socionext Inc.
+ *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <linux/errno.h>
+#include <linux/io.h>
+#include <linux/sizes.h>
+
+#define UNIPHIER_PRO4_DWC3_RESET       0x40
+#define   UNIPHIER_PRO4_DWC3_RESET_XIOMMU      BIT(5)
+#define   UNIPHIER_PRO4_DWC3_RESET_XLINK       BIT(4)
+#define   UNIPHIER_PRO4_DWC3_RESET_PHY_SS      BIT(2)
+
+#define UNIPHIER_PRO5_DWC3_RESET       0x00
+#define   UNIPHIER_PRO5_DWC3_RESET_PHY_S1      BIT(17)
+#define   UNIPHIER_PRO5_DWC3_RESET_PHY_S0      BIT(16)
+#define   UNIPHIER_PRO5_DWC3_RESET_XLINK       BIT(15)
+#define   UNIPHIER_PRO5_DWC3_RESET_XIOMMU      BIT(14)
+
+#define UNIPHIER_PXS2_DWC3_RESET       0x00
+#define   UNIPHIER_PXS2_DWC3_RESET_XLINK       BIT(15)
+
+static int uniphier_pro4_dwc3_init(void __iomem *regs)
+{
+       u32 tmp;
+
+       tmp = readl(regs + UNIPHIER_PRO4_DWC3_RESET);
+       tmp &= ~UNIPHIER_PRO4_DWC3_RESET_PHY_SS;
+       tmp |= UNIPHIER_PRO4_DWC3_RESET_XIOMMU | UNIPHIER_PRO4_DWC3_RESET_XLINK;
+       writel(tmp, regs + UNIPHIER_PRO4_DWC3_RESET);
+
+       return 0;
+}
+
+static int uniphier_pro5_dwc3_init(void __iomem *regs)
+{
+       u32 tmp;
+
+       tmp = readl(regs + UNIPHIER_PRO5_DWC3_RESET);
+       tmp &= ~(UNIPHIER_PRO5_DWC3_RESET_PHY_S1 |
+                UNIPHIER_PRO5_DWC3_RESET_PHY_S0);
+       tmp |= UNIPHIER_PRO5_DWC3_RESET_XLINK | UNIPHIER_PRO5_DWC3_RESET_XIOMMU;
+       writel(tmp, regs + UNIPHIER_PRO5_DWC3_RESET);
+
+       return 0;
+}
+
+static int uniphier_pxs2_dwc3_init(void __iomem *regs)
+{
+       u32 tmp;
+
+       tmp = readl(regs + UNIPHIER_PXS2_DWC3_RESET);
+       tmp |= UNIPHIER_PXS2_DWC3_RESET_XLINK;
+       writel(tmp, regs + UNIPHIER_PXS2_DWC3_RESET);
+
+       return 0;
+}
+
+static int uniphier_dwc3_probe(struct udevice *dev)
+{
+       fdt_addr_t base;
+       void __iomem *regs;
+       int (*init)(void __iomem *regs);
+       int ret;
+
+       base = devfdt_get_addr(dev);
+       if (base == FDT_ADDR_T_NONE)
+               return -EINVAL;
+
+       regs = ioremap(base, SZ_32K);
+       if (!regs)
+               return -ENOMEM;
+
+       init = (typeof(init))dev_get_driver_data(dev);
+       ret = init(regs);
+       if (ret)
+               dev_err(dev, "failed to init glue layer\n");
+
+       iounmap(regs);
+
+       return ret;
+}
+
+static const struct udevice_id uniphier_dwc3_match[] = {
+       {
+               .compatible = "socionext,uniphier-pro4-dwc3",
+               .data = (ulong)uniphier_pro4_dwc3_init,
+       },
+       {
+               .compatible = "socionext,uniphier-pro5-dwc3",
+               .data = (ulong)uniphier_pro5_dwc3_init,
+       },
+       {
+               .compatible = "socionext,uniphier-pxs2-dwc3",
+               .data = (ulong)uniphier_pxs2_dwc3_init,
+       },
+       {
+               .compatible = "socionext,uniphier-ld20-dwc3",
+               .data = (ulong)uniphier_pxs2_dwc3_init,
+       },
+       {
+               .compatible = "socionext,uniphier-pxs3-dwc3",
+               .data = (ulong)uniphier_pxs2_dwc3_init,
+       },
+       { /* sentinel */ }
+};
+
+U_BOOT_DRIVER(usb_xhci) = {
+       .name = "uniphier-dwc3",
+       .id = UCLASS_SIMPLE_BUS,
+       .of_match = uniphier_dwc3_match,
+       .probe = uniphier_dwc3_probe,
+};
index 9e944a31be11f4edaccbfc857c493e3808ee3c53..5cbe377e3cd9a17fa6b15c57d4c8efd35b4d8f86 100644 (file)
 #ifndef __DWC3_LINUX_COMPAT__
 #define __DWC3_LINUX_COMPAT__
 
-#define pr_debug(format)                debug(format)
 #define WARN(val, format, arg...)      debug(format, ##arg)
 #define dev_WARN(dev, format, arg...)  debug(format, ##arg)
-#define WARN_ON_ONCE(val)              debug("Error %d\n", val)
 
 static inline size_t strlcat(char *dest, const char *src, size_t n)
 {
index 98d20c0bc1500c3c120c8105b19f62d723538c46..2f84b360ec6b66320361215acebf1a5d70deec72 100644 (file)
@@ -390,8 +390,7 @@ static int sandbox_flash_bind(struct udevice *dev)
        fs[2].id = STRINGID_SERIAL;
        fs[2].s = dev->name;
 
-       return usb_emul_setup_device(dev, PACKET_SIZE_64, plat->flash_strings,
-                                    flash_desc_list);
+       return usb_emul_setup_device(dev, plat->flash_strings, flash_desc_list);
 }
 
 static int sandbox_flash_probe(struct udevice *dev)
index 1432858fd594cd3b70ba7b4a4b0ddb9334fd3f35..9a0f47b81c4d041b2d13b1329e3d2a0928e0a281 100644 (file)
@@ -121,9 +121,12 @@ struct sandbox_hub_priv {
        int change[SANDBOX_NUM_PORTS];
 };
 
-static struct udevice *hub_find_device(struct udevice *hub, int port)
+static struct udevice *hub_find_device(struct udevice *hub, int port,
+                                      enum usb_device_speed *speed)
 {
        struct udevice *dev;
+       struct usb_generic_descriptor **gen_desc;
+       struct usb_device_descriptor **dev_desc;
 
        for (device_find_first_child(hub, &dev);
             dev;
@@ -131,8 +134,27 @@ static struct udevice *hub_find_device(struct udevice *hub, int port)
                struct sandbox_hub_platdata *plat;
 
                plat = dev_get_parent_platdata(dev);
-               if (plat->port == port)
+               if (plat->port == port) {
+                       gen_desc = plat->plat.desc_list;
+                       gen_desc = usb_emul_find_descriptor(gen_desc,
+                                                           USB_DT_DEVICE, 0);
+                       dev_desc = (struct usb_device_descriptor **)gen_desc;
+
+                       switch (le16_to_cpu((*dev_desc)->bcdUSB)) {
+                       case 0x0100:
+                               *speed = USB_SPEED_LOW;
+                               break;
+                       case 0x0101:
+                               *speed = USB_SPEED_FULL;
+                               break;
+                       case 0x0200:
+                       default:
+                               *speed = USB_SPEED_HIGH;
+                               break;
+                       }
+
                        return dev;
+               }
        }
 
        return NULL;
@@ -146,7 +168,8 @@ static int clrset_post_state(struct udevice *hub, int port, int clear, int set)
        int ret = 0;
 
        if ((clear | set) & USB_PORT_STAT_POWER) {
-               struct udevice *dev = hub_find_device(hub, port);
+               enum usb_device_speed speed;
+               struct udevice *dev = hub_find_device(hub, port, &speed);
 
                if (dev) {
                        if (set & USB_PORT_STAT_POWER) {
@@ -156,6 +179,10 @@ static int clrset_post_state(struct udevice *hub, int port, int clear, int set)
                                if (!ret) {
                                        set |= USB_PORT_STAT_CONNECTION |
                                                USB_PORT_STAT_ENABLE;
+                                       if (speed == USB_SPEED_LOW)
+                                               set |= USB_PORT_STAT_LOW_SPEED;
+                                       else if (speed == USB_SPEED_HIGH)
+                                               set |= USB_PORT_STAT_HIGH_SPEED;
                                }
 
                        } else if (clear & USB_PORT_STAT_POWER) {
@@ -274,15 +301,16 @@ static int sandbox_hub_submit_control_msg(struct udevice *bus,
 
 static int sandbox_hub_bind(struct udevice *dev)
 {
-       return usb_emul_setup_device(dev, PACKET_SIZE_64, hub_strings,
-                                    hub_desc_list);
+       return usb_emul_setup_device(dev, hub_strings, hub_desc_list);
 }
 
 static int sandbox_child_post_bind(struct udevice *dev)
 {
        struct sandbox_hub_platdata *plat = dev_get_parent_platdata(dev);
+       struct usb_emul_platdata *emul = dev_get_uclass_platdata(dev);
 
        plat->port = dev_read_u32_default(dev, "reg", -1);
+       emul->port1 = plat->port + 1;
 
        return 0;
 }
index 27359851df8b231aef5d7c4b0c81c84d4168f017..cff017668f2d45bca6e79bf7f3869776b9deb1d5 100644 (file)
@@ -208,8 +208,7 @@ static int sandbox_keyb_bind(struct udevice *dev)
        fs[2].id = STRINGID_SERIAL;
        fs[2].s = dev->name;
 
-       return usb_emul_setup_device(dev, PACKET_SIZE_8, plat->keyb_strings,
-                                    keyb_desc_list);
+       return usb_emul_setup_device(dev, plat->keyb_strings, keyb_desc_list);
 }
 
 static int sandbox_keyb_probe(struct udevice *dev)
index 6e03c1e0d9e7f1273990fd2967e77a17c2efa862..fbe11f3135372ec259b33eb0ea26597a696a9507 100644 (file)
@@ -52,7 +52,7 @@ static int usb_emul_get_string(struct usb_string *strings, int index,
        return -EINVAL;
 }
 
-static struct usb_generic_descriptor **find_descriptor(
+struct usb_generic_descriptor **usb_emul_find_descriptor(
                struct usb_generic_descriptor **ptr, int type, int index)
 {
        debug("%s: type=%x, index=%d\n", __func__, type, index);
@@ -91,8 +91,7 @@ static int usb_emul_get_descriptor(struct usb_dev_platdata *plat, int value,
                                           length);
        }
 
-       ptr = find_descriptor((struct usb_generic_descriptor **)plat->desc_list,
-                             type, index);
+       ptr = usb_emul_find_descriptor(plat->desc_list, type, index);
        if (!ptr) {
                debug("%s: Could not find descriptor type %d, index %d\n",
                      __func__, type, index);
@@ -107,7 +106,7 @@ static int usb_emul_get_descriptor(struct usb_dev_platdata *plat, int value,
        return upto ? upto : length ? -EIO : 0;
 }
 
-static int usb_emul_find_devnum(int devnum, struct udevice **emulp)
+static int usb_emul_find_devnum(int devnum, int port1, struct udevice **emulp)
 {
        struct udevice *dev;
        struct uclass *uc;
@@ -120,7 +119,37 @@ static int usb_emul_find_devnum(int devnum, struct udevice **emulp)
        uclass_foreach_dev(dev, uc) {
                struct usb_dev_platdata *udev = dev_get_parent_platdata(dev);
 
-               if (udev->devnum == devnum) {
+               /*
+                * devnum is initialzied to zero at the beginning of the
+                * enumeration process in usb_setup_device(). At this
+                * point, udev->devnum has not been assigned to any valid
+                * USB address either, so we can't rely on the comparison
+                * result between udev->devnum and devnum to select an
+                * emulator device.
+                */
+               if (!devnum) {
+                       struct usb_emul_platdata *plat;
+
+                       /*
+                        * If the parent is sandbox USB controller, we are
+                        * the root hub. And there is only one root hub
+                        * in the system.
+                        */
+                       if (device_get_uclass_id(dev->parent) == UCLASS_USB) {
+                               debug("%s: Found emulator '%s'\n",
+                                     __func__, dev->name);
+                               *emulp = dev;
+                               return 0;
+                       }
+
+                       plat = dev_get_uclass_platdata(dev);
+                       if (plat->port1 == port1) {
+                               debug("%s: Found emulator '%s', port %d\n",
+                                     __func__, dev->name, port1);
+                               *emulp = dev;
+                               return 0;
+                       }
+               } else if (udev->devnum == devnum) {
                        debug("%s: Found emulator '%s', addr %d\n", __func__,
                              dev->name, udev->devnum);
                        *emulp = dev;
@@ -132,18 +161,19 @@ static int usb_emul_find_devnum(int devnum, struct udevice **emulp)
        return -ENOENT;
 }
 
-int usb_emul_find(struct udevice *bus, ulong pipe, struct udevice **emulp)
+int usb_emul_find(struct udevice *bus, ulong pipe, int port1,
+                 struct udevice **emulp)
 {
        int devnum = usb_pipedevice(pipe);
 
-       return usb_emul_find_devnum(devnum, emulp);
+       return usb_emul_find_devnum(devnum, port1, emulp);
 }
 
 int usb_emul_find_for_dev(struct udevice *dev, struct udevice **emulp)
 {
        struct usb_dev_platdata *udev = dev_get_parent_platdata(dev);
 
-       return usb_emul_find_devnum(udev->devnum, emulp);
+       return usb_emul_find_devnum(udev->devnum, 0, emulp);
 }
 
 int usb_emul_control(struct udevice *emul, struct usb_device *udev,
@@ -229,8 +259,8 @@ int usb_emul_int(struct udevice *emul, struct usb_device *udev,
        return ops->interrupt(emul, udev, pipe, buffer, length, interval);
 }
 
-int usb_emul_setup_device(struct udevice *dev, int maxpacketsize,
-                         struct usb_string *strings, void **desc_list)
+int usb_emul_setup_device(struct udevice *dev, struct usb_string *strings,
+                         void **desc_list)
 {
        struct usb_dev_platdata *plat = dev_get_parent_platdata(dev);
        struct usb_generic_descriptor **ptr;
@@ -264,18 +294,11 @@ int usb_emul_setup_device(struct udevice *dev, int maxpacketsize,
        return 0;
 }
 
-void usb_emul_reset(struct udevice *dev)
-{
-       struct usb_dev_platdata *plat = dev_get_parent_platdata(dev);
-
-       plat->devnum = 0;
-       plat->configno = 0;
-}
-
 UCLASS_DRIVER(usb_emul) = {
        .id             = UCLASS_USB_EMUL,
        .name           = "usb_emul",
        .post_bind      = dm_scan_fdt_dev,
+       .per_device_platdata_auto_alloc_size = sizeof(struct usb_emul_platdata),
        .per_child_auto_alloc_size = sizeof(struct usb_device),
        .per_child_platdata_auto_alloc_size = sizeof(struct usb_dev_platdata),
 };
index 4abef5d5c88ef58fa7f10f547ec7411c22558e1a..941d612a68a8e21162cd45606abadeeb560ba738 100644 (file)
@@ -418,25 +418,25 @@ static int mcs7830_basic_reset(struct usb_device *udev,
 
        rc = mcs7830_set_autoneg(udev);
        if (rc < 0) {
-               error("setting autoneg failed\n");
+               pr_err("setting autoneg failed\n");
                return rc;
        }
 
        rc = mcs7830_write_mchash(udev, priv);
        if (rc < 0) {
-               error("failed to set multicast hash\n");
+               pr_err("failed to set multicast hash\n");
                return rc;
        }
 
        rc = mcs7830_write_config(udev, priv);
        if (rc < 0) {
-               error("failed to set configuration\n");
+               pr_err("failed to set configuration\n");
                return rc;
        }
 
        rc = mcs7830_apply_fixup(udev);
        if (rc < 0) {
-               error("fixup application failed\n");
+               pr_err("fixup application failed\n");
                return rc;
        }
 
@@ -541,11 +541,11 @@ static int mcs7830_recv_common(struct ueth_data *ueth, uint8_t *buf)
        debug("%s() RX want len %d, got len %d, rc %d\n",
              __func__, wantlen, gotlen, rc);
        if (rc != 0) {
-               error("RX: failed to receive\n");
+               pr_err("RX: failed to receive\n");
                return rc;
        }
        if (gotlen > wantlen) {
-               error("RX: got too many bytes (%d)\n", gotlen);
+               pr_err("RX: got too many bytes (%d)\n", gotlen);
                return -EIO;
        }
 
index 225b66bc95ff3492dfff8b340d5130dc86d06b76..102a63b8eeb9e7547dbe7a89b43105c00bf2c278 100644 (file)
@@ -36,6 +36,30 @@ menuconfig USB_GADGET
 
 if USB_GADGET
 
+config USB_GADGET_MANUFACTURER
+       string "Vendor name of the USB device"
+       default "Allwinner Technology" if ARCH_SUNXI
+       default "U-Boot"
+       help
+         Vendor name of the USB device emulated, reported to the host device.
+         This is usually either the manufacturer of the device or the SoC.
+
+config USB_GADGET_VENDOR_NUM
+       hex "Vendor ID of the USB device"
+       default 0x1f3a if ARCH_SUNXI
+       default 0x0
+       help
+         Vendor ID of the USB device emulated, reported to the host device.
+         This is usually the board or SoC vendor's, unless you've registered
+         for one.
+
+config USB_GADGET_PRODUCT_NUM
+       hex "Product ID of the USB device"
+       default 0x1010 if ARCH_SUNXI
+       default 0x0
+       help
+         Product ID of the USB device emulated, reported to the host device.
+
 config USB_GADGET_ATMEL_USBA
        bool "Atmel USBA"
        select USB_GADGET_DUALSPEED
@@ -110,19 +134,63 @@ config USB_FUNCTION_SDP
          allows to download images into memory and execute (jump to) them
          using the same protocol as implemented by the i.MX family's boot ROM.
 
-config G_DNL_MANUFACTURER
-       string "Vendor name of USB device"
+endif # USB_GADGET_DOWNLOAD
 
-config G_DNL_VENDOR_NUM
-       hex "Vendor ID of USB device"
+config USB_ETHER
+       bool "USB Ethernet Gadget"
+       default y if ARCH_SUNXI && USB_MUSB_GADGET
+       help
+         Creates an Ethernet network device through a USB peripheral
+         controller. This will create a network interface on both the device
+         (U-Boot) and the host (remote device) that can be used just like any
+         other nework interface.
+         It will bind on the peripheral USB controller, ignoring the USB hosts
+         controllers in the system.
+
+if USB_ETHER
+
+choice
+       prompt "USB Ethernet Gadget Model"
+       default USB_ETH_RNDIS
+       help
+         There is several models (protocols) to implement Ethernet over USB
+         devices. The main ones are Microsoft's RNDIS and USB's CDC-Ethernet
+         (also called CDC-ECM). RNDIS is obviously compatible with Windows,
+         while CDC-ECM is not. Most other operating systems support both, so
+         if inter-operability is a concern, RNDIS is to be preferred.
+
+config USB_ETH_CDC
+       bool "CDC-ECM Protocol"
+       help
+         CDC (Communications Device Class) is the standard for Ethernet over
+         USB devices. While there's several alternatives, the most widely used
+         protocol is ECM (Ethernet Control Model). However, compatibility with
+         Windows is not that great.
+
+config USB_ETH_RNDIS
+       bool "RNDIS Protocol"
+       help
+         The RNDIS (Remote Network Driver Interface Specification) is a
+         Microsoft proprietary protocol to create an Ethernet device over USB.
+         Windows obviously supports it, as well as all the major operating
+         systems, so it's the best option for compatibility.
 
-config G_DNL_PRODUCT_NUM
-       hex "Product ID of USB device"
+endchoice
 
 config USBNET_DEVADDR
        string "USB Gadget Ethernet device mac address"
        default "de:ad:be:ef:00:01"
+       help
+         Ethernet MAC address of the device-side (ie. local board's) MAC
+         address of the usb_ether interface
 
-endif # USB_GADGET_DOWNLOAD
+config USBNET_HOST_ADDR
+       string "USB Gadget Ethernet host mac address"
+       default "de:ad:be:ef:00:00"
+       help
+         Ethernet MAC address of the host-side (ie. remote device's) MAC
+         address of the usb_ether interface
+
+endif # USB_ETHER
 
 endif # USB_GADGET
index 9df6d32c65f9b76be4d48e22ae2ed0a1303cd818..ad2f606b78bc97148e6c1cb9f169151f63ae1ee9 100644 (file)
@@ -1456,7 +1456,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
        ret = driver->bind(&udc->gadget);
        if (ret) {
-               error("driver->bind() returned %d\n", ret);
+               pr_err("driver->bind() returned %d\n", ret);
                udc->driver = NULL;
        }
 
@@ -1468,7 +1468,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
        struct at91_udc *udc = controller;
 
        if (!driver || !driver->unbind || !driver->disconnect) {
-               error("bad paramter\n");
+               pr_err("bad paramter\n");
                return -EINVAL;
        }
 
index ad31703c7376d78521103d188d572b195787e0bb..c0a95a97c9f4fe6cd97c173cda0bbb7174719a9c 100644 (file)
@@ -1228,7 +1228,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 
        ret = driver->bind(&udc->gadget);
        if (ret) {
-               error("driver->bind() returned %d\n", ret);
+               pr_err("driver->bind() returned %d\n", ret);
                udc->driver = NULL;
        }
 
@@ -1240,7 +1240,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
        struct usba_udc *udc = &controller;
 
        if (!driver || !driver->unbind || !driver->disconnect) {
-               error("bad paramter\n");
+               pr_err("bad paramter\n");
                return -EINVAL;
        }
 
@@ -1261,7 +1261,7 @@ static struct usba_ep *usba_udc_pdata(struct usba_platform_data *pdata,
 
        eps = malloc(sizeof(struct usba_ep) * pdata->num_ep);
        if (!eps) {
-               error("failed to alloc eps\n");
+               pr_err("failed to alloc eps\n");
                return NULL;
        }
 
index cb44374e81a615c2c4cccdc7cb526ee5b5444721..088811c191365adba3a4b9421fe84f8967ea81ba 100644 (file)
@@ -835,7 +835,7 @@ int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata)
                            ROUND(sizeof(struct usb_ctrlrequest),
                                  CONFIG_SYS_CACHELINE_SIZE));
        if (!usb_ctrl) {
-               error("No memory available for UDC!\n");
+               pr_err("No memory available for UDC!\n");
                return -ENOMEM;
        }
 
index 0d6d2fba8a0f3f22c8f69be5531a4f9282814be9..b6164afa9245a6c78775c65a7b90e4a76bf5000d 100644 (file)
@@ -111,7 +111,8 @@ static int setdma_rx(struct dwc2_ep *ep, struct dwc2_request *req)
        ctrl =  readl(&reg->out_endp[ep_num].doepctl);
 
        invalidate_dcache_range((unsigned long) ep->dma_buf,
-                               (unsigned long) ep->dma_buf + ep->len);
+                               (unsigned long) ep->dma_buf +
+                               ROUND(ep->len, CONFIG_SYS_CACHELINE_SIZE));
 
        writel((unsigned int) ep->dma_buf, &reg->out_endp[ep_num].doepdma);
        writel(DOEPT_SIZ_PKT_CNT(pktcnt) | DOEPT_SIZ_XFER_SIZE(length),
index 2cf5c8d31e25acb1c8a557d8e38e2ec7e84fa1ad..a80486e91f1a7ba4a79d2ff58b94f2f956192515 100644 (file)
@@ -273,8 +273,8 @@ static inline int BITRATE(struct usb_gadget *g)
  * static ushort idProduct;
  */
 
-#if defined(CONFIG_USBNET_MANUFACTURER)
-static char *iManufacturer = CONFIG_USBNET_MANUFACTURER;
+#if defined(CONFIG_USB_GADGET_MANUFACTURER)
+static char *iManufacturer = CONFIG_USB_GADGET_MANUFACTURER;
 #else
 static char *iManufacturer = "U-Boot";
 #endif
@@ -1059,7 +1059,7 @@ static int eth_set_config(struct eth_dev *dev, unsigned number,
                        && dev->config
                        && dev->tx_qlen != 0) {
                /* tx fifo is full, but we can't clear it...*/
-               error("can't change configurations");
+               pr_err("can't change configurations");
                return -ESPIPE;
        }
        eth_reset_config(dev);
@@ -1233,7 +1233,7 @@ static void rndis_command_complete(struct usb_ep *ep, struct usb_request *req)
        /* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */
        status = rndis_msg_parser(dev->rndis_config, (u8 *) req->buf);
        if (status < 0)
-               error("%s: rndis parse error %d", __func__, status);
+               pr_err("%s: rndis parse error %d", __func__, status);
 }
 
 #endif /* RNDIS */
@@ -1554,7 +1554,7 @@ static int rx_submit(struct eth_dev *dev, struct usb_request *req,
        retval = usb_ep_queue(dev->out_ep, req, gfp_flags);
 
        if (retval)
-               error("rx submit --> %d", retval);
+               pr_err("rx submit --> %d", retval);
 
        return retval;
 }
@@ -1624,7 +1624,7 @@ static int alloc_requests(struct eth_dev *dev, unsigned n, gfp_t gfp_flags)
 fail2:
        usb_ep_free_request(dev->in_ep, dev->tx_req);
 fail1:
-       error("can't alloc requests");
+       pr_err("can't alloc requests");
        return -1;
 }
 
@@ -2060,7 +2060,7 @@ static int eth_bind(struct usb_gadget *gadget)
                 * anything less functional on CDC-capable hardware,
                 * so we fail in this case.
                 */
-               error("controller '%s' not recognized",
+               pr_err("controller '%s' not recognized",
                        gadget->name);
                return -ENODEV;
        }
@@ -2073,11 +2073,11 @@ static int eth_bind(struct usb_gadget *gadget)
         * to choose the right configuration otherwise.
         */
        if (rndis) {
-#if defined(CONFIG_USB_RNDIS_VENDOR_ID) && defined(CONFIG_USB_RNDIS_PRODUCT_ID)
+#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && defined(CONFIG_USB_GADGET_PRODUCT_NUM)
                device_desc.idVendor =
-                       __constant_cpu_to_le16(CONFIG_USB_RNDIS_VENDOR_ID);
+                       __constant_cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM);
                device_desc.idProduct =
-                       __constant_cpu_to_le16(CONFIG_USB_RNDIS_PRODUCT_ID);
+                       __constant_cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM);
 #else
                device_desc.idVendor =
                        __constant_cpu_to_le16(RNDIS_VENDOR_NUM);
@@ -2092,9 +2092,9 @@ static int eth_bind(struct usb_gadget *gadget)
         * supporting one submode of the "SAFE" variant of MDLM.)
         */
        } else {
-#if defined(CONFIG_USB_CDC_VENDOR_ID) && defined(CONFIG_USB_CDC_PRODUCT_ID)
-               device_desc.idVendor = cpu_to_le16(CONFIG_USB_CDC_VENDOR_ID);
-               device_desc.idProduct = cpu_to_le16(CONFIG_USB_CDC_PRODUCT_ID);
+#if defined(CONFIG_USB_GADGET_VENDOR_NUM) && defined(CONFIG_USB_GADGET_PRODUCT_NUM)
+               device_desc.idVendor = cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM);
+               device_desc.idProduct = cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM);
 #else
                if (!cdc) {
                        device_desc.idVendor =
@@ -2121,7 +2121,7 @@ static int eth_bind(struct usb_gadget *gadget)
        in_ep = usb_ep_autoconfig(gadget, &fs_source_desc);
        if (!in_ep) {
 autoconf_fail:
-               error("can't autoconfigure on %s\n",
+               pr_err("can't autoconfigure on %s\n",
                        gadget->name);
                return -ENODEV;
        }
@@ -2142,7 +2142,7 @@ autoconf_fail:
                if (status_ep) {
                        status_ep->driver_data = status_ep;     /* claim */
                } else if (rndis) {
-                       error("can't run RNDIS on %s", gadget->name);
+                       pr_err("can't run RNDIS on %s", gadget->name);
                        return -ENODEV;
 #ifdef CONFIG_USB_ETH_CDC
                } else if (cdc) {
@@ -2244,7 +2244,7 @@ autoconf_fail:
        if (rndis) {
                status = rndis_init();
                if (status < 0) {
-                       error("can't init RNDIS, %d", status);
+                       pr_err("can't init RNDIS, %d", status);
                        goto fail;
                }
        }
@@ -2335,7 +2335,7 @@ fail0:
        return 0;
 
 fail:
-       error("%s failed, status = %d", __func__, status);
+       pr_err("%s failed, status = %d", __func__, status);
        eth_unbind(gadget);
        return status;
 }
@@ -2350,7 +2350,7 @@ int dm_usb_init(struct eth_dev *e_dev)
 
        ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, &dev);
        if (!dev || ret) {
-               error("No USB device found\n");
+               pr_err("No USB device found\n");
                return -ENODEV;
        }
 
@@ -2369,7 +2369,7 @@ static int _usb_eth_init(struct ether_priv *priv)
 
 #ifdef CONFIG_DM_USB
        if (dm_usb_init(dev)) {
-               error("USB ether not found\n");
+               pr_err("USB ether not found\n");
                return -ENODEV;
        }
 #else
@@ -2393,11 +2393,11 @@ static int _usb_eth_init(struct ether_priv *priv)
                        sizeof(host_addr));
 
        if (!is_eth_addr_valid(dev_addr)) {
-               error("Need valid 'usbnet_devaddr' to be set");
+               pr_err("Need valid 'usbnet_devaddr' to be set");
                goto fail;
        }
        if (!is_eth_addr_valid(host_addr)) {
-               error("Need valid 'usbnet_hostaddr' to be set");
+               pr_err("Need valid 'usbnet_hostaddr' to be set");
                goto fail;
        }
 
@@ -2427,7 +2427,7 @@ static int _usb_eth_init(struct ether_priv *priv)
        while (!dev->network_started) {
                /* Handle control-c and timeouts */
                if (ctrlc() || (get_timer(ts) > timeout)) {
-                       error("The remote end did not respond in time.");
+                       pr_err("The remote end did not respond in time.");
                        goto fail;
                }
                usb_gadget_handle_interrupts(0);
@@ -2456,7 +2456,7 @@ static int _usb_eth_send(struct ether_priv *priv, void *packet, int length)
                rndis_pkt = malloc(length +
                                        sizeof(struct rndis_packet_msg_type));
                if (!rndis_pkt) {
-                       error("No memory to alloc RNDIS packet");
+                       pr_err("No memory to alloc RNDIS packet");
                        goto drop;
                }
                rndis_add_hdr(rndis_pkt, length);
@@ -2574,7 +2574,7 @@ static int usb_eth_recv(struct eth_device *netdev)
 
        ret = _usb_eth_recv(priv);
        if (ret) {
-               error("error packet receive\n");
+               pr_err("error packet receive\n");
                return ret;
        }
 
@@ -2585,7 +2585,7 @@ static int usb_eth_recv(struct eth_device *netdev)
                net_process_received_packet(net_rx_packets[0],
                                            dev->rx_req->length);
        } else {
-               error("dev->rx_req invalid");
+               pr_err("dev->rx_req invalid");
        }
        packet_received = 0;
        rx_submit(dev, dev->rx_req, 0);
@@ -2641,7 +2641,7 @@ static int usb_eth_recv(struct udevice *dev, int flags, uchar **packetp)
 
        ret = _usb_eth_recv(priv);
        if (ret) {
-               error("error packet receive\n");
+               pr_err("error packet receive\n");
                return ret;
        }
 
@@ -2650,7 +2650,7 @@ static int usb_eth_recv(struct udevice *dev, int flags, uchar **packetp)
                        *packetp = (uchar *)net_rx_packets[0];
                        return ethdev->rx_req->length;
                } else {
-                       error("dev->rx_req invalid");
+                       pr_err("dev->rx_req invalid");
                        return -EFAULT;
                }
        }
@@ -2706,13 +2706,13 @@ int usb_ether_init(void)
 
        ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, &usb_dev);
        if (!usb_dev || ret) {
-               error("No USB device found\n");
+               pr_err("No USB device found\n");
                return ret;
        }
 
        ret = device_bind_driver(usb_dev, "usb_ether", "usb_ether", &dev);
        if (!dev || ret) {
-               error("usb - not able to bind usb_ether device\n");
+               pr_err("usb - not able to bind usb_ether device\n");
                return ret;
        }
 
index f3382a965bedb1128528279c245bcb8d65f6eeb3..7acffb6c87e062757f2bc820100b2896c75a0d27 100644 (file)
@@ -410,7 +410,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
 
        strsep(&cmd, ":");
        if (!cmd) {
-               error("missing variable");
+               pr_err("missing variable");
                fastboot_tx_write_str("FAILmissing var");
                return;
        }
@@ -593,7 +593,7 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req)
 
        strsep(&cmd, ":");
        if (!cmd) {
-               error("missing partition name");
+               pr_err("missing partition name");
                fastboot_tx_write_str("FAILmissing partition name");
                return;
        }
@@ -645,7 +645,7 @@ static void cb_erase(struct usb_ep *ep, struct usb_request *req)
 
        strsep(&cmd, ":");
        if (!cmd) {
-               error("missing partition name");
+               pr_err("missing partition name");
                fastboot_tx_write_str("FAILmissing partition name");
                return;
        }
@@ -718,7 +718,7 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
        }
 
        if (!func_cb) {
-               error("unknown command: %.*s", req->actual, cmdbuf);
+               pr_err("unknown command: %.*s", req->actual, cmdbuf);
                fastboot_tx_write_str("FAILunknown command");
        } else {
                if (req->actual < req->length) {
@@ -726,7 +726,7 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
                        buf[req->actual] = 0;
                        func_cb(ep, req);
                } else {
-                       error("buffer overflow");
+                       pr_err("buffer overflow");
                        fastboot_tx_write_str("FAILbuffer overflow");
                }
        }
index 0fae66beabab06b1d884a9543bd096509119a286..fd3da922a690ed1d80908a0e4fcd9af12012cc28 100644 (file)
@@ -237,12 +237,12 @@ static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req)
        u8 report = data[0];
 
        if (status != 0) {
-               error("Status: %d", status);
+               pr_err("Status: %d", status);
                return;
        }
 
        if (report != 1) {
-               error("Unexpected report %d", report);
+               pr_err("Unexpected report %d", report);
                return;
        }
 
@@ -309,7 +309,7 @@ static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req)
                sdp->next_state = SDP_STATE_IDLE;
                break;
        default:
-               error("Unknown command: %04x\n", be16_to_cpu(cmd->cmd));
+               pr_err("Unknown command: %04x\n", be16_to_cpu(cmd->cmd));
        }
 }
 
@@ -322,12 +322,12 @@ static void sdp_rx_data_complete(struct usb_ep *ep, struct usb_request *req)
        int datalen = req->length - 1;
 
        if (status != 0) {
-               error("Status: %d", status);
+               pr_err("Status: %d", status);
                return;
        }
 
        if (report != 2) {
-               error("Unexpected report %d", report);
+               pr_err("Unexpected report %d", report);
                return;
        }
 
@@ -360,7 +360,7 @@ static void sdp_rx_data_complete(struct usb_ep *ep, struct usb_request *req)
                sdp->state = SDP_STATE_TX_SEC_CONF;
                break;
        default:
-               error("Invalid state: %d", sdp->state);
+               pr_err("Invalid state: %d", sdp->state);
        }
 }
 
@@ -370,7 +370,7 @@ static void sdp_tx_complete(struct usb_ep *ep, struct usb_request *req)
        int status = req->status;
 
        if (status != 0) {
-               error("Status: %d", status);
+               pr_err("Status: %d", status);
                return;
        }
 
@@ -393,7 +393,7 @@ static void sdp_tx_complete(struct usb_ep *ep, struct usb_request *req)
                        sdp->state = SDP_STATE_IDLE;
                break;
        default:
-               error("Wrong State: %d", sdp->state);
+               pr_err("Wrong State: %d", sdp->state);
                sdp->state = SDP_STATE_IDLE;
                break;
        }
index cd4d9e659a39bb7b205a1898531194c71901c439..18f233ab587617cfb8e5d85780d47c91cd7b7f9e 100644 (file)
@@ -174,7 +174,7 @@ static long long int download_head(unsigned long long total,
                                        transfer_buffer, THOR_STORE_UNIT_SIZE,
                                        (*cnt)++);
                        if (ret) {
-                               error("DFU write failed [%d] cnt: %d",
+                               pr_err("DFU write failed [%d] cnt: %d",
                                      ret, *cnt);
                                return ret;
                        }
@@ -218,20 +218,20 @@ static int download_tail(long long int left, int cnt)
 
        dfu_entity = dfu_get_entity(alt_setting_num);
        if (!dfu_entity) {
-               error("Alt setting: %d entity not found!\n", alt_setting_num);
+               pr_err("Alt setting: %d entity not found!\n", alt_setting_num);
                return -ENOENT;
        }
 
        transfer_buffer = dfu_get_buf(dfu_entity);
        if (!transfer_buffer) {
-               error("Transfer buffer not allocated!");
+               pr_err("Transfer buffer not allocated!");
                return -ENXIO;
        }
 
        if (left) {
                ret = dfu_write(dfu_entity, transfer_buffer, left, cnt++);
                if (ret) {
-                       error("DFU write failed [%d]: left: %llu", ret, left);
+                       pr_err("DFU write failed [%d]: left: %llu", ret, left);
                        return ret;
                }
        }
@@ -245,7 +245,7 @@ static int download_tail(long long int left, int cnt)
         */
        ret = dfu_flush(dfu_entity, transfer_buffer, 0, cnt);
        if (ret)
-               error("DFU flush failed!");
+               pr_err("DFU flush failed!");
 
        return ret;
 }
@@ -285,7 +285,7 @@ static long long int process_rqt_download(const struct rqt_box *rqt)
 
                alt_setting_num = dfu_get_alt(f_name);
                if (alt_setting_num < 0) {
-                       error("Alt setting [%d] to write not found!",
+                       pr_err("Alt setting [%d] to write not found!",
                              alt_setting_num);
                        rsp->ack = -ENODEV;
                        ret = rsp->ack;
@@ -311,7 +311,7 @@ static long long int process_rqt_download(const struct rqt_box *rqt)
                debug("DL EXIT\n");
                break;
        default:
-               error("Operation not supported: %d", rqt->rqt_data);
+               pr_err("Operation not supported: %d", rqt->rqt_data);
                ret = -ENOTSUPP;
        }
 
@@ -342,7 +342,7 @@ static int process_data(void)
                puts("RQT: UPLOAD not supported!\n");
                break;
        default:
-               error("unknown request (%d)", rqt->rqt);
+               pr_err("unknown request (%d)", rqt->rqt);
        }
 
        return ret;
@@ -541,7 +541,7 @@ static int thor_rx_data(void)
 
                status = usb_ep_queue(dev->out_ep, dev->out_req, 0);
                if (status) {
-                       error("kill %s:  resubmit %d bytes --> %d",
+                       pr_err("kill %s:  resubmit %d bytes --> %d",
                              dev->out_ep->name, dev->out_req->length, status);
                        usb_ep_set_halt(dev->out_ep);
                        return -EAGAIN;
@@ -575,7 +575,7 @@ static void thor_tx_data(unsigned char *data, int len)
 
        status = usb_ep_queue(dev->in_ep, dev->in_req, 0);
        if (status) {
-               error("kill %s:  resubmit %d bytes --> %d",
+               pr_err("kill %s:  resubmit %d bytes --> %d",
                      dev->in_ep->name, dev->in_req->length, status);
                usb_ep_set_halt(dev->in_ep);
        }
@@ -608,7 +608,7 @@ static void thor_rx_tx_complete(struct usb_ep *ep, struct usb_request *req)
        case -ESHUTDOWN:                /* disconnect from host */
        case -EREMOTEIO:                /* short read */
        case -EOVERFLOW:
-               error("ERROR:%d", status);
+               pr_err("ERROR:%d", status);
                break;
        }
 
@@ -664,7 +664,7 @@ thor_func_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
                break;
 
        default:
-               error("thor_setup: unknown request: %d", ctrl->bRequest);
+               pr_err("thor_setup: unknown request: %d", ctrl->bRequest);
        }
 
        if (value >= 0) {
@@ -973,7 +973,7 @@ static int thor_func_set_alt(struct usb_function *f,
                debug("Communication Data interface\n");
                result = thor_eps_setup(f);
                if (result)
-                       error("%s: EPs setup failed!", __func__);
+                       pr_err("%s: EPs setup failed!", __func__);
                dev->configuration_done = 1;
                break;
        }
index 039331a5afd9cadc2b9306da9af848b218e397d6..99d500a6af4e71bb9a9c52463b8f06854fb02572 100644 (file)
@@ -26,9 +26,9 @@
 
 /*
  * One needs to define the following:
- * CONFIG_G_DNL_VENDOR_NUM
- * CONFIG_G_DNL_PRODUCT_NUM
- * CONFIG_G_DNL_MANUFACTURER
+ * CONFIG_USB_GADGET_VENDOR_NUM
+ * CONFIG_USB_GADGET_PRODUCT_NUM
+ * CONFIG_USB_GADGET_MANUFACTURER
  * at e.g. ./configs/<board>_defconfig
  */
 
@@ -46,7 +46,7 @@
 
 static const char product[] = "USB download gadget";
 static char g_dnl_serial[MAX_STRING_SERIAL];
-static const char manufacturer[] = CONFIG_G_DNL_MANUFACTURER;
+static const char manufacturer[] = CONFIG_USB_GADGET_MANUFACTURER;
 
 void g_dnl_set_serialnumber(char *s)
 {
@@ -62,8 +62,8 @@ static struct usb_device_descriptor device_desc = {
        .bDeviceClass = USB_CLASS_PER_INTERFACE,
        .bDeviceSubClass = 0, /*0x02:CDC-modem , 0x00:CDC-serial*/
 
-       .idVendor = __constant_cpu_to_le16(CONFIG_G_DNL_VENDOR_NUM),
-       .idProduct = __constant_cpu_to_le16(CONFIG_G_DNL_PRODUCT_NUM),
+       .idVendor = __constant_cpu_to_le16(CONFIG_USB_GADGET_VENDOR_NUM),
+       .idProduct = __constant_cpu_to_le16(CONFIG_USB_GADGET_PRODUCT_NUM),
        /* .iProduct = DYNAMIC */
        /* .iSerialNumber = DYNAMIC */
        .bNumConfigurations = 1,
index 64c42ac47153bd7f20b50f55e22efd3b99e02a70..1293e18f75e74da33ccdd3dea7bc8c779af02d21 100644 (file)
@@ -179,7 +179,7 @@ static int dwc_vbus_supply_init(struct udevice *dev)
 
        ret = regulator_set_enable(vbus_supply, true);
        if (ret) {
-               error("Error enabling vbus supply\n");
+               pr_err("Error enabling vbus supply\n");
                return ret;
        }
 
@@ -1245,7 +1245,7 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice *dev)
        struct dwc2_priv *priv = dev_get_priv(dev);
        fdt_addr_t addr;
 
-       addr = devfdt_get_addr(dev);
+       addr = dev_read_addr(dev);
        if (addr == FDT_ADDR_T_NONE)
                return -EINVAL;
        priv->regs = (struct dwc2_core_regs *)addr;
index 02ad3115df431ec4f46cd1b09271788dc9dcf2b2..6dc656af89b0fb0a1d838f790d37d4642543dbbc 100644 (file)
@@ -71,7 +71,7 @@ static int sti_dwc3_glue_drd_init(struct sti_dwc3_glue_platdata *plat)
                break;
 
        default:
-               error("Unsupported mode of operation %d\n", plat->mode);
+               pr_err("Unsupported mode of operation %d\n", plat->mode);
                return -EINVAL;
        }
        writel(val, plat->syscfg_base + plat->syscfg_offset);
@@ -113,7 +113,7 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
        ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(dev),
                                   "reg", reg, ARRAY_SIZE(reg));
        if (ret) {
-               error("unable to find st,stih407-dwc3 reg property(%d)\n", ret);
+               pr_err("unable to find st,stih407-dwc3 reg property(%d)\n", ret);
                return ret;
        }
 
@@ -124,14 +124,14 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
        ret = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, "st,syscfg",
                                           &syscon);
        if (ret) {
-               error("unable to find syscon device (%d)\n", ret);
+               pr_err("unable to find syscon device (%d)\n", ret);
                return ret;
        }
 
        /* get syscfg-reg base address */
        regmap = syscon_get_regmap(syscon);
        if (!regmap) {
-               error("unable to find regmap\n");
+               pr_err("unable to find regmap\n");
                return -ENODEV;
        }
        plat->syscfg_base = regmap->base;
@@ -139,14 +139,14 @@ static int sti_dwc3_glue_ofdata_to_platdata(struct udevice *dev)
        /* get powerdown reset */
        ret = reset_get_by_name(dev, "powerdown", &plat->powerdown_ctl);
        if (ret) {
-               error("can't get powerdown reset for %s (%d)", dev->name, ret);
+               pr_err("can't get powerdown reset for %s (%d)", dev->name, ret);
                return ret;
        }
 
        /* get softreset reset */
        ret = reset_get_by_name(dev, "softreset", &plat->softreset_ctl);
        if (ret)
-               error("can't get soft reset for %s (%d)", dev->name, ret);
+               pr_err("can't get soft reset for %s (%d)", dev->name, ret);
 
        return ret;
 };
@@ -159,14 +159,14 @@ static int sti_dwc3_glue_bind(struct udevice *dev)
        /* check if one subnode is present */
        dwc3_node = fdt_first_subnode(gd->fdt_blob, dev_of_offset(dev));
        if (dwc3_node <= 0) {
-               error("Can't find subnode for %s\n", dev->name);
+               pr_err("Can't find subnode for %s\n", dev->name);
                return -ENODEV;
        }
 
        /* check if the subnode compatible string is the dwc3 one*/
        if (fdt_node_check_compatible(gd->fdt_blob, dwc3_node,
                                      "snps,dwc3") != 0) {
-               error("Can't find dwc3 subnode for %s\n", dev->name);
+               pr_err("Can't find dwc3 subnode for %s\n", dev->name);
                return -ENODEV;
        }
 
@@ -187,13 +187,13 @@ static int sti_dwc3_glue_probe(struct udevice *dev)
        /* deassert both powerdown and softreset */
        ret = reset_deassert(&plat->powerdown_ctl);
        if (ret < 0) {
-               error("DWC3 powerdown reset deassert failed: %d", ret);
+               pr_err("DWC3 powerdown reset deassert failed: %d", ret);
                return ret;
        }
 
        ret = reset_deassert(&plat->softreset_ctl);
        if (ret < 0) {
-               error("DWC3 soft reset deassert failed: %d", ret);
+               pr_err("DWC3 soft reset deassert failed: %d", ret);
                goto softreset_err;
        }
 
@@ -208,14 +208,14 @@ static int sti_dwc3_glue_probe(struct udevice *dev)
 init_err:
        ret = reset_assert(&plat->softreset_ctl);
        if (ret < 0) {
-               error("DWC3 soft reset deassert failed: %d", ret);
+               pr_err("DWC3 soft reset deassert failed: %d", ret);
                return ret;
        }
 
 softreset_err:
        ret = reset_assert(&plat->powerdown_ctl);
        if (ret < 0)
-               error("DWC3 powerdown reset deassert failed: %d", ret);
+               pr_err("DWC3 powerdown reset deassert failed: %d", ret);
 
        return ret;
 }
@@ -228,13 +228,13 @@ static int sti_dwc3_glue_remove(struct udevice *dev)
        /* assert both powerdown and softreset */
        ret = reset_assert(&plat->powerdown_ctl);
        if (ret < 0) {
-               error("DWC3 powerdown reset deassert failed: %d", ret);
+               pr_err("DWC3 powerdown reset deassert failed: %d", ret);
                return ret;
        }
 
        ret = reset_assert(&plat->softreset_ctl);
        if (ret < 0)
-               error("DWC3 soft reset deassert failed: %d", ret);
+               pr_err("DWC3 soft reset deassert failed: %d", ret);
 
        return ret;
 }
index 03f8d321af13e3ddb04c46ae9a66d16b82defe73..1cb92c033870887939ee40915ce8af4562f8847b 100644 (file)
@@ -51,7 +51,7 @@ static int ehci_usb_probe(struct udevice *dev)
                                break;
                        err = clk_enable(&priv->clocks[i]);
                        if (err) {
-                               error("failed to enable clock %d\n", i);
+                               pr_err("failed to enable clock %d\n", i);
                                clk_free(&priv->clocks[i]);
                                goto clk_err;
                        }
@@ -59,7 +59,7 @@ static int ehci_usb_probe(struct udevice *dev)
                }
        } else {
                if (clock_nb != -ENOENT) {
-                       error("failed to get clock phandle(%d)\n", clock_nb);
+                       pr_err("failed to get clock phandle(%d)\n", clock_nb);
                        return clock_nb;
                }
        }
@@ -80,7 +80,7 @@ static int ehci_usb_probe(struct udevice *dev)
                                break;
 
                        if (reset_deassert(&priv->resets[i])) {
-                               error("failed to deassert reset %d\n", i);
+                               pr_err("failed to deassert reset %d\n", i);
                                reset_free(&priv->resets[i]);
                                goto reset_err;
                        }
@@ -88,7 +88,7 @@ static int ehci_usb_probe(struct udevice *dev)
                }
        } else {
                if (reset_nb != -ENOENT) {
-                       error("failed to get reset phandle(%d)\n", reset_nb);
+                       pr_err("failed to get reset phandle(%d)\n", reset_nb);
                        goto clk_err;
                }
        }
@@ -96,19 +96,19 @@ static int ehci_usb_probe(struct udevice *dev)
        err = generic_phy_get_by_index(dev, 0, &priv->phy);
        if (err) {
                if (err != -ENOENT) {
-                       error("failed to get usb phy\n");
+                       pr_err("failed to get usb phy\n");
                        goto reset_err;
                }
        } else {
 
                err = generic_phy_init(&priv->phy);
                if (err) {
-                       error("failed to init usb phy\n");
+                       pr_err("failed to init usb phy\n");
                        goto reset_err;
                }
        }
 
-       hccr = map_physmem(devfdt_get_addr(dev), 0x100, MAP_NOCACHE);
+       hccr = map_physmem(dev_read_addr(dev), 0x100, MAP_NOCACHE);
        hcor = (struct ehci_hcor *)((uintptr_t)hccr +
                                    HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
 
@@ -122,17 +122,17 @@ phy_err:
        if (generic_phy_valid(&priv->phy)) {
                ret = generic_phy_exit(&priv->phy);
                if (ret)
-                       error("failed to release phy\n");
+                       pr_err("failed to release phy\n");
        }
 
 reset_err:
        ret = reset_release_all(priv->resets, priv->reset_count);
        if (ret)
-               error("failed to assert all resets\n");
+               pr_err("failed to assert all resets\n");
 clk_err:
        ret = clk_release_all(priv->clocks, priv->clock_count);
        if (ret)
-               error("failed to disable all clocks\n");
+               pr_err("failed to disable all clocks\n");
 
        return err;
 }
index 3243c1d1cf250a9de353b8c05d46acd12b1efa6d..be3e842dcc30fddb2af2f47094f6fa0cd8ab1966 100644 (file)
@@ -1596,6 +1596,17 @@ static int ehci_destroy_int_queue(struct udevice *dev, struct usb_device *udev,
        return _ehci_destroy_int_queue(udev, queue);
 }
 
+static int ehci_get_max_xfer_size(struct udevice *dev, size_t *size)
+{
+       /*
+        * EHCD can handle any transfer length as long as there is enough
+        * free heap space left, hence set the theoretical max number here.
+        */
+       *size = SIZE_MAX;
+
+       return 0;
+}
+
 int ehci_register(struct udevice *dev, struct ehci_hccr *hccr,
                  struct ehci_hcor *hcor, const struct ehci_ops *ops,
                  uint tweaks, enum usb_init_type init)
@@ -1658,6 +1669,7 @@ struct dm_usb_ops ehci_usb_ops = {
        .create_int_queue = ehci_create_int_queue,
        .poll_int_queue = ehci_poll_int_queue,
        .destroy_int_queue = ehci_destroy_int_queue,
+       .get_max_xfer_size  = ehci_get_max_xfer_size,
 };
 
 #endif
index e22ee9793914d27b7b146303881a18054eacd695..bf55a71d66c22fb09ea5bd7ac5a15664d51b5b57 100644 (file)
@@ -47,14 +47,14 @@ static int ohci_usb_probe(struct udevice *dev)
 
                        err = clk_enable(&priv->clocks[i]);
                        if (err) {
-                               error("failed to enable clock %d\n", i);
+                               pr_err("failed to enable clock %d\n", i);
                                clk_free(&priv->clocks[i]);
                                goto clk_err;
                        }
                        priv->clock_count++;
                }
        } else if (clock_nb != -ENOENT) {
-               error("failed to get clock phandle(%d)\n", clock_nb);
+               pr_err("failed to get clock phandle(%d)\n", clock_nb);
                return clock_nb;
        }
 
@@ -74,28 +74,28 @@ static int ohci_usb_probe(struct udevice *dev)
 
                        err = reset_deassert(&priv->resets[i]);
                        if (err) {
-                               error("failed to deassert reset %d\n", i);
+                               pr_err("failed to deassert reset %d\n", i);
                                reset_free(&priv->resets[i]);
                                goto reset_err;
                        }
                        priv->reset_count++;
                }
        } else if (reset_nb != -ENOENT) {
-               error("failed to get reset phandle(%d)\n", reset_nb);
+               pr_err("failed to get reset phandle(%d)\n", reset_nb);
                goto clk_err;
        }
 
        err = generic_phy_get_by_index(dev, 0, &priv->phy);
        if (err) {
                if (err != -ENOENT) {
-                       error("failed to get usb phy\n");
+                       pr_err("failed to get usb phy\n");
                        goto reset_err;
                }
        } else {
 
                err = generic_phy_init(&priv->phy);
                if (err) {
-                       error("failed to init usb phy\n");
+                       pr_err("failed to init usb phy\n");
                        goto reset_err;
                }
        }
@@ -110,17 +110,17 @@ phy_err:
        if (generic_phy_valid(&priv->phy)) {
                ret = generic_phy_exit(&priv->phy);
                if (ret)
-                       error("failed to release phy\n");
+                       pr_err("failed to release phy\n");
        }
 
 reset_err:
        ret = reset_release_all(priv->resets, priv->reset_count);
        if (ret)
-               error("failed to assert all resets\n");
+               pr_err("failed to assert all resets\n");
 clk_err:
        ret = clk_release_all(priv->clocks, priv->clock_count);
        if (ret)
-               error("failed to disable all clocks\n");
+               pr_err("failed to disable all clocks\n");
 
        return err;
 }
index 5e3d96c208ef151f45d72a88a7b493da50b6ada4..15055b351a5a5a5b25724f3173422b2085991458 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+struct sandbox_usb_ctrl {
+       int rootdev;
+};
+
 static void usbmon_trace(struct udevice *bus, ulong pipe,
                         struct devrequest *setup, struct udevice *emul)
 {
@@ -40,15 +44,24 @@ static int sandbox_submit_control(struct udevice *bus,
                                      void *buffer, int length,
                                      struct devrequest *setup)
 {
+       struct sandbox_usb_ctrl *ctrl = dev_get_priv(bus);
        struct udevice *emul;
        int ret;
 
        /* Just use child of dev as emulator? */
        debug("%s: bus=%s\n", __func__, bus->name);
-       ret = usb_emul_find(bus, pipe, &emul);
+       ret = usb_emul_find(bus, pipe, udev->portnr, &emul);
        usbmon_trace(bus, pipe, setup, emul);
        if (ret)
                return ret;
+
+       if (usb_pipedevice(pipe) == ctrl->rootdev) {
+               if (setup->request == USB_REQ_SET_ADDRESS) {
+                       debug("%s: Set root hub's USB address\n", __func__);
+                       ctrl->rootdev = le16_to_cpu(setup->value);
+               }
+       }
+
        ret = usb_emul_control(emul, udev, pipe, buffer, length, setup);
        if (ret < 0) {
                debug("ret=%d\n", ret);
@@ -70,7 +83,7 @@ static int sandbox_submit_bulk(struct udevice *bus, struct usb_device *udev,
 
        /* Just use child of dev as emulator? */
        debug("%s: bus=%s\n", __func__, bus->name);
-       ret = usb_emul_find(bus, pipe, &emul);
+       ret = usb_emul_find(bus, pipe, udev->portnr, &emul);
        usbmon_trace(bus, pipe, NULL, emul);
        if (ret)
                return ret;
@@ -96,7 +109,7 @@ static int sandbox_submit_int(struct udevice *bus, struct usb_device *udev,
 
        /* Just use child of dev as emulator? */
        debug("%s: bus=%s\n", __func__, bus->name);
-       ret = usb_emul_find(bus, pipe, &emul);
+       ret = usb_emul_find(bus, pipe, udev->portnr, &emul);
        usbmon_trace(bus, pipe, NULL, emul);
        if (ret)
                return ret;
@@ -107,6 +120,16 @@ static int sandbox_submit_int(struct udevice *bus, struct usb_device *udev,
 
 static int sandbox_alloc_device(struct udevice *dev, struct usb_device *udev)
 {
+       struct sandbox_usb_ctrl *ctrl = dev_get_priv(dev);
+
+       /*
+        * Root hub will be the first device to be initailized.
+        * If this device is a root hub, initialize its device speed
+        * to high speed as we are a USB 2.0 controller.
+        */
+       if (ctrl->rootdev == 0)
+               udev->speed = USB_SPEED_HIGH;
+
        return 0;
 }
 
@@ -133,4 +156,5 @@ U_BOOT_DRIVER(usb_sandbox) = {
        .of_match = sandbox_usb_ids,
        .probe = sandbox_usb_probe,
        .ops    = &sandbox_usb_ops,
+       .priv_auto_alloc_size = sizeof(struct sandbox_usb_ctrl),
 };
index 0b8a501ce8851be7a0d0751c1f74fa7145ddf1d2..4e40f4bc3d2caf2d8803e1d0b4a2484fb3bec881 100644 (file)
@@ -150,9 +150,21 @@ int usb_update_hub_device(struct usb_device *udev)
        return ops->update_hub_device(bus, udev);
 }
 
+int usb_get_max_xfer_size(struct usb_device *udev, size_t *size)
+{
+       struct udevice *bus = udev->controller_dev;
+       struct dm_usb_ops *ops = usb_get_ops(bus);
+
+       if (!ops->get_max_xfer_size)
+               return -ENOSYS;
+
+       return ops->get_max_xfer_size(bus, size);
+}
+
 int usb_stop(void)
 {
        struct udevice *bus;
+       struct udevice *rh;
        struct uclass *uc;
        struct usb_uclass_priv *uc_priv;
        int err = 0, ret;
@@ -168,23 +180,20 @@ int usb_stop(void)
                ret = device_remove(bus, DM_REMOVE_NORMAL);
                if (ret && !err)
                        err = ret;
-       }
-#ifdef CONFIG_BLK
-       ret = blk_unbind_all(IF_TYPE_USB);
-       if (ret && !err)
-               err = ret;
-#endif
-#ifdef CONFIG_SANDBOX
-       struct udevice *dev;
 
-       /* Reset all enulation devices */
-       ret = uclass_get(UCLASS_USB_EMUL, &uc);
-       if (ret)
-               return ret;
+               /* Locate root hub device */
+               device_find_first_child(bus, &rh);
+               if (rh) {
+                       /*
+                        * All USB devices are children of root hub.
+                        * Unbinding root hub will unbind all of its children.
+                        */
+                       ret = device_unbind(rh);
+                       if (ret && !err)
+                               err = ret;
+               }
+       }
 
-       uclass_foreach_dev(dev, uc)
-               usb_emul_reset(dev);
-#endif
 #ifdef CONFIG_USB_STORAGE
        usb_stor_reset();
 #endif
@@ -251,6 +260,21 @@ int usb_init(void)
                /* init low_level USB */
                printf("USB%d:   ", count);
                count++;
+
+#ifdef CONFIG_SANDBOX
+               /*
+                * For Sandbox, we need scan the device tree each time when we
+                * start the USB stack, in order to re-create the emulated USB
+                * devices and bind drivers for them before we actually do the
+                * driver probe.
+                */
+               ret = dm_scan_fdt_dev(bus);
+               if (ret) {
+                       printf("Sandbox USB device scan failed (%d)\n", ret);
+                       continue;
+               }
+#endif
+
                ret = device_probe(bus);
                if (ret == -ENODEV) {   /* No such device. */
                        puts("Port not available.\n");
index 4191a894218f64141108b837b45f4d4112b11165..258d1cd00a085adaa9cf1c613947eaf43c3767aa 100644 (file)
@@ -128,13 +128,13 @@ static int xhci_dwc3_probe(struct udevice *dev)
        ret = generic_phy_get_by_index(dev, 0, &plat->usb_phy);
        if (ret) {
                if (ret != -ENOENT) {
-                       error("Failed to get USB PHY for %s\n", dev->name);
+                       pr_err("Failed to get USB PHY for %s\n", dev->name);
                        return ret;
                }
        } else {
                ret = generic_phy_init(&plat->usb_phy);
                if (ret) {
-                       error("Can't init USB PHY for %s\n", dev->name);
+                       pr_err("Can't init USB PHY for %s\n", dev->name);
                        return ret;
                }
        }
@@ -161,7 +161,7 @@ static int xhci_dwc3_remove(struct udevice *dev)
        if (generic_phy_valid(&plat->usb_phy)) {
                ret = generic_phy_exit(&plat->usb_phy);
                if (ret) {
-                       error("Can't deinit USB PHY for %s\n", dev->name);
+                       pr_err("Can't deinit USB PHY for %s\n", dev->name);
                        return ret;
                }
        }
index d5eab3a61545442ae31066e85b4584946bbdf54d..0582a9be40add12c86430bacd617e6ba07f28bef 100644 (file)
@@ -786,12 +786,22 @@ void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl,
 #ifdef CONFIG_DM_USB
        /* Set up TT fields to support FS/LS devices */
        if (speed == USB_SPEED_LOW || speed == USB_SPEED_FULL) {
-               dev = dev_get_parent_priv(udev->dev);
-               if (dev->speed == USB_SPEED_HIGH) {
-                       hub = dev_get_uclass_priv(udev->dev);
+               struct udevice *parent = udev->dev;
+
+               dev = udev;
+               do {
+                       port_num = dev->portnr;
+                       dev = dev_get_parent_priv(parent);
+                       if (usb_hub_is_root_hub(dev->dev))
+                               break;
+                       parent = dev->dev->parent;
+               } while (dev->speed != USB_SPEED_HIGH);
+
+               if (!usb_hub_is_root_hub(dev->dev)) {
+                       hub = dev_get_uclass_priv(dev->dev);
                        if (hub->tt.multi)
                                slot_ctx->dev_info |= cpu_to_le32(DEV_MTT);
-                       slot_ctx->tt_info |= cpu_to_le32(TT_PORT(udev->portnr));
+                       slot_ctx->tt_info |= cpu_to_le32(TT_PORT(port_num));
                        slot_ctx->tt_info |= cpu_to_le32(TT_SLOT(dev->slot_id));
                }
        }
@@ -840,6 +850,12 @@ void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl,
        trb_64 = (uintptr_t)virt_dev->eps[0].ring->first_seg->trbs;
        ep0_ctx->deq = cpu_to_le64(trb_64 | virt_dev->eps[0].ring->cycle_state);
 
+       /*
+        * xHCI spec 6.2.3:
+        * software shall set 'Average TRB Length' to 8 for control endpoints.
+        */
+       ep0_ctx->tx_info = cpu_to_le32(EP_AVG_TRB_LENGTH(8));
+
        /* Steps 7 and 8 were done in xhci_alloc_virt_device() */
 
        xhci_flush_cache((uintptr_t)ep0_ctx, sizeof(struct xhci_ep_ctx));
index ec55f4e59f75c95d12c2fedafdab64aa068c4726..b1f98842739735e08e086dae2d0f70752a0e7ba1 100644 (file)
@@ -6,8 +6,6 @@
  */
 #include <common.h>
 #include <dm.h>
-#include <fdtdec.h>
-#include <libfdt.h>
 #include <malloc.h>
 #include <usb.h>
 #include <watchdog.h>
@@ -46,9 +44,9 @@ static int xhci_usb_ofdata_to_platdata(struct udevice *dev)
        /*
         * Get the base address for XHCI controller from the device node
         */
-       plat->hcd_base = devfdt_get_addr(dev);
+       plat->hcd_base = dev_read_addr(dev);
        if (plat->hcd_base == FDT_ADDR_T_NONE) {
-               error("Can't get the XHCI register base address\n");
+               pr_err("Can't get the XHCI register base address\n");
                return -ENXIO;
        }
 
@@ -62,7 +60,7 @@ static int xhci_usb_ofdata_to_platdata(struct udevice *dev)
        }
 
        if (plat->phy_base == FDT_ADDR_T_NONE) {
-               error("Can't get the usbphy register address\n");
+               pr_err("Can't get the usbphy register address\n");
                return -ENXIO;
        }
 
@@ -119,7 +117,7 @@ static int rockchip_xhci_core_init(struct rockchip_xhci *rkxhci,
 
        ret = dwc3_core_init(rkxhci->dwc3_reg);
        if (ret) {
-               error("failed to initialize core\n");
+               pr_err("failed to initialize core\n");
                return ret;
        }
 
@@ -151,14 +149,14 @@ static int xhci_usb_probe(struct udevice *dev)
        if (plat->vbus_supply) {
                ret = regulator_set_enable(plat->vbus_supply, true);
                if (ret) {
-                       error("XHCI: failed to set VBus supply\n");
+                       pr_err("XHCI: failed to set VBus supply\n");
                        return ret;
                }
        }
 
        ret = rockchip_xhci_core_init(ctx, dev);
        if (ret) {
-               error("XHCI: failed to initialize controller\n");
+               pr_err("XHCI: failed to initialize controller\n");
                return ret;
        }
 
@@ -181,7 +179,7 @@ static int xhci_usb_remove(struct udevice *dev)
        if (plat->vbus_supply) {
                ret = regulator_set_enable(plat->vbus_supply, false);
                if (ret)
-                       error("XHCI: failed to set VBus supply\n");
+                       pr_err("XHCI: failed to set VBus supply\n");
        }
 
        return ret;
index 9b82ee5c602782a10876fbdd3995e5bd71be1495..4673738d1e8985411c77fe6a8a19a82e421b1308 100644 (file)
@@ -257,6 +257,188 @@ static unsigned int xhci_get_ep_index(struct usb_endpoint_descriptor *desc)
        return index;
 }
 
+/*
+ * Convert bInterval expressed in microframes (in 1-255 range) to exponent of
+ * microframes, rounded down to nearest power of 2.
+ */
+static unsigned int xhci_microframes_to_exponent(unsigned int desc_interval,
+                                                unsigned int min_exponent,
+                                                unsigned int max_exponent)
+{
+       unsigned int interval;
+
+       interval = fls(desc_interval) - 1;
+       interval = clamp_val(interval, min_exponent, max_exponent);
+       if ((1 << interval) != desc_interval)
+               debug("rounding interval to %d microframes, "\
+                     "ep desc says %d microframes\n",
+                     1 << interval, desc_interval);
+
+       return interval;
+}
+
+static unsigned int xhci_parse_microframe_interval(struct usb_device *udev,
+       struct usb_endpoint_descriptor *endpt_desc)
+{
+       if (endpt_desc->bInterval == 0)
+               return 0;
+
+       return xhci_microframes_to_exponent(endpt_desc->bInterval, 0, 15);
+}
+
+static unsigned int xhci_parse_frame_interval(struct usb_device *udev,
+       struct usb_endpoint_descriptor *endpt_desc)
+{
+       return xhci_microframes_to_exponent(endpt_desc->bInterval * 8, 3, 10);
+}
+
+/*
+ * Convert interval expressed as 2^(bInterval - 1) == interval into
+ * straight exponent value 2^n == interval.
+ */
+static unsigned int xhci_parse_exponent_interval(struct usb_device *udev,
+       struct usb_endpoint_descriptor *endpt_desc)
+{
+       unsigned int interval;
+
+       interval = clamp_val(endpt_desc->bInterval, 1, 16) - 1;
+       if (interval != endpt_desc->bInterval - 1)
+               debug("ep %#x - rounding interval to %d %sframes\n",
+                     endpt_desc->bEndpointAddress, 1 << interval,
+                     udev->speed == USB_SPEED_FULL ? "" : "micro");
+
+       if (udev->speed == USB_SPEED_FULL) {
+               /*
+                * Full speed isoc endpoints specify interval in frames,
+                * not microframes. We are using microframes everywhere,
+                * so adjust accordingly.
+                */
+               interval += 3;  /* 1 frame = 2^3 uframes */
+       }
+
+       return interval;
+}
+
+/*
+ * Return the polling or NAK interval.
+ *
+ * The polling interval is expressed in "microframes". If xHCI's Interval field
+ * is set to N, it will service the endpoint every 2^(Interval)*125us.
+ *
+ * The NAK interval is one NAK per 1 to 255 microframes, or no NAKs if interval
+ * is set to 0.
+ */
+static unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
+       struct usb_endpoint_descriptor *endpt_desc)
+{
+       unsigned int interval = 0;
+
+       switch (udev->speed) {
+       case USB_SPEED_HIGH:
+               /* Max NAK rate */
+               if (usb_endpoint_xfer_control(endpt_desc) ||
+                   usb_endpoint_xfer_bulk(endpt_desc)) {
+                       interval = xhci_parse_microframe_interval(udev,
+                                                                 endpt_desc);
+                       break;
+               }
+               /* Fall through - SS and HS isoc/int have same decoding */
+
+       case USB_SPEED_SUPER:
+               if (usb_endpoint_xfer_int(endpt_desc) ||
+                   usb_endpoint_xfer_isoc(endpt_desc)) {
+                       interval = xhci_parse_exponent_interval(udev,
+                                                               endpt_desc);
+               }
+               break;
+
+       case USB_SPEED_FULL:
+               if (usb_endpoint_xfer_isoc(endpt_desc)) {
+                       interval = xhci_parse_exponent_interval(udev,
+                                                               endpt_desc);
+                       break;
+               }
+               /*
+                * Fall through for interrupt endpoint interval decoding
+                * since it uses the same rules as low speed interrupt
+                * endpoints.
+                */
+
+       case USB_SPEED_LOW:
+               if (usb_endpoint_xfer_int(endpt_desc) ||
+                   usb_endpoint_xfer_isoc(endpt_desc)) {
+                       interval = xhci_parse_frame_interval(udev, endpt_desc);
+               }
+               break;
+
+       default:
+               BUG();
+       }
+
+       return interval;
+}
+
+/*
+ * The "Mult" field in the endpoint context is only set for SuperSpeed isoc eps.
+ * High speed endpoint descriptors can define "the number of additional
+ * transaction opportunities per microframe", but that goes in the Max Burst
+ * endpoint context field.
+ */
+static u32 xhci_get_endpoint_mult(struct usb_device *udev,
+       struct usb_endpoint_descriptor *endpt_desc,
+       struct usb_ss_ep_comp_descriptor *ss_ep_comp_desc)
+{
+       if (udev->speed < USB_SPEED_SUPER ||
+           !usb_endpoint_xfer_isoc(endpt_desc))
+               return 0;
+
+       return ss_ep_comp_desc->bmAttributes;
+}
+
+static u32 xhci_get_endpoint_max_burst(struct usb_device *udev,
+       struct usb_endpoint_descriptor *endpt_desc,
+       struct usb_ss_ep_comp_descriptor *ss_ep_comp_desc)
+{
+       /* Super speed and Plus have max burst in ep companion desc */
+       if (udev->speed >= USB_SPEED_SUPER)
+               return ss_ep_comp_desc->bMaxBurst;
+
+       if (udev->speed == USB_SPEED_HIGH &&
+           (usb_endpoint_xfer_isoc(endpt_desc) ||
+            usb_endpoint_xfer_int(endpt_desc)))
+               return usb_endpoint_maxp_mult(endpt_desc) - 1;
+
+       return 0;
+}
+
+/*
+ * Return the maximum endpoint service interval time (ESIT) payload.
+ * Basically, this is the maxpacket size, multiplied by the burst size
+ * and mult size.
+ */
+static u32 xhci_get_max_esit_payload(struct usb_device *udev,
+       struct usb_endpoint_descriptor *endpt_desc,
+       struct usb_ss_ep_comp_descriptor *ss_ep_comp_desc)
+{
+       int max_burst;
+       int max_packet;
+
+       /* Only applies for interrupt or isochronous endpoints */
+       if (usb_endpoint_xfer_control(endpt_desc) ||
+           usb_endpoint_xfer_bulk(endpt_desc))
+               return 0;
+
+       /* SuperSpeed Isoc ep with less than 48k per esit */
+       if (udev->speed >= USB_SPEED_SUPER)
+               return le16_to_cpu(ss_ep_comp_desc->wBytesPerInterval);
+
+       max_packet = usb_endpoint_maxp(endpt_desc);
+       max_burst = usb_endpoint_maxp_mult(endpt_desc);
+
+       /* A 0 in max burst means 1 transfer per ESIT */
+       return max_packet * max_burst;
+}
+
 /**
  * Issue a configure endpoint command or evaluate context command
  * and wait for it to finish.
@@ -324,6 +506,12 @@ static int xhci_set_configuration(struct usb_device *udev)
        int slot_id = udev->slot_id;
        struct xhci_virt_device *virt_dev = ctrl->devs[slot_id];
        struct usb_interface *ifdesc;
+       u32 max_esit_payload;
+       unsigned int interval;
+       unsigned int mult;
+       unsigned int max_burst;
+       unsigned int avg_trb_len;
+       unsigned int err_count = 0;
 
        out_ctx = virt_dev->out_ctx;
        in_ctx = virt_dev->in_ctx;
@@ -357,10 +545,28 @@ static int xhci_set_configuration(struct usb_device *udev)
        /* filling up ep contexts */
        for (cur_ep = 0; cur_ep < num_of_ep; cur_ep++) {
                struct usb_endpoint_descriptor *endpt_desc = NULL;
+               struct usb_ss_ep_comp_descriptor *ss_ep_comp_desc = NULL;
 
                endpt_desc = &ifdesc->ep_desc[cur_ep];
+               ss_ep_comp_desc = &ifdesc->ss_ep_comp_desc[cur_ep];
                trb_64 = 0;
 
+               /*
+                * Get values to fill the endpoint context, mostly from ep
+                * descriptor. The average TRB buffer lengt for bulk endpoints
+                * is unclear as we have no clue on scatter gather list entry
+                * size. For Isoc and Int, set it to max available.
+                * See xHCI 1.1 spec 4.14.1.1 for details.
+                */
+               max_esit_payload = xhci_get_max_esit_payload(udev, endpt_desc,
+                                                            ss_ep_comp_desc);
+               interval = xhci_get_endpoint_interval(udev, endpt_desc);
+               mult = xhci_get_endpoint_mult(udev, endpt_desc,
+                                             ss_ep_comp_desc);
+               max_burst = xhci_get_endpoint_max_burst(udev, endpt_desc,
+                                                       ss_ep_comp_desc);
+               avg_trb_len = max_esit_payload;
+
                ep_index = xhci_get_ep_index(endpt_desc);
                ep_ctx[ep_index] = xhci_get_ep_ctx(ctrl, in_ctx, ep_index);
 
@@ -372,20 +578,38 @@ static int xhci_set_configuration(struct usb_device *udev)
                /*NOTE: ep_desc[0] actually represents EP1 and so on */
                dir = (((endpt_desc->bEndpointAddress) & (0x80)) >> 7);
                ep_type = (((endpt_desc->bmAttributes) & (0x3)) | (dir << 2));
+
+               ep_ctx[ep_index]->ep_info =
+                       cpu_to_le32(EP_MAX_ESIT_PAYLOAD_HI(max_esit_payload) |
+                       EP_INTERVAL(interval) | EP_MULT(mult));
+
                ep_ctx[ep_index]->ep_info2 =
                        cpu_to_le32(ep_type << EP_TYPE_SHIFT);
                ep_ctx[ep_index]->ep_info2 |=
                        cpu_to_le32(MAX_PACKET
                        (get_unaligned(&endpt_desc->wMaxPacketSize)));
 
+               /* Allow 3 retries for everything but isoc, set CErr = 3 */
+               if (!usb_endpoint_xfer_isoc(endpt_desc))
+                       err_count = 3;
                ep_ctx[ep_index]->ep_info2 |=
-                       cpu_to_le32(((0 & MAX_BURST_MASK) << MAX_BURST_SHIFT) |
-                       ((3 & ERROR_COUNT_MASK) << ERROR_COUNT_SHIFT));
+                       cpu_to_le32(MAX_BURST(max_burst) |
+                       ERROR_COUNT(err_count));
 
                trb_64 = (uintptr_t)
                                virt_dev->eps[ep_index].ring->enqueue;
                ep_ctx[ep_index]->deq = cpu_to_le64(trb_64 |
                                virt_dev->eps[ep_index].ring->cycle_state);
+
+               /*
+                * xHCI spec 6.2.3:
+                * 'Average TRB Length' should be 8 for control endpoints.
+                */
+               if (usb_endpoint_xfer_control(endpt_desc))
+                       avg_trb_len = 8;
+               ep_ctx[ep_index]->tx_info =
+                       cpu_to_le32(EP_MAX_ESIT_PAYLOAD_LO(max_esit_payload) |
+                       EP_AVG_TRB_LENGTH(avg_trb_len));
        }
 
        return xhci_configure_endpoints(udev, false);
@@ -546,16 +770,13 @@ int xhci_check_maxpacket(struct usb_device *udev)
        int max_packet_size;
        int hw_max_packet_size;
        int ret = 0;
-       struct usb_interface *ifdesc;
-
-       ifdesc = &udev->config.if_desc[0];
 
        out_ctx = ctrl->devs[slot_id]->out_ctx;
        xhci_inval_cache((uintptr_t)out_ctx->bytes, out_ctx->size);
 
        ep_ctx = xhci_get_ep_ctx(ctrl, out_ctx, ep_index);
        hw_max_packet_size = MAX_PACKET_DECODED(le32_to_cpu(ep_ctx->ep_info2));
-       max_packet_size = usb_endpoint_maxp(&ifdesc->ep_desc[0]);
+       max_packet_size = udev->epmaxpacketin[0];
        if (hw_max_packet_size != max_packet_size) {
                debug("Max Packet Size for ep 0 changed.\n");
                debug("Max packet size in usb_device = %d\n", max_packet_size);
@@ -567,7 +788,8 @@ int xhci_check_maxpacket(struct usb_device *udev)
                                ctrl->devs[slot_id]->out_ctx, ep_index);
                in_ctx = ctrl->devs[slot_id]->in_ctx;
                ep_ctx = xhci_get_ep_ctx(ctrl, in_ctx, ep_index);
-               ep_ctx->ep_info2 &= cpu_to_le32(~MAX_PACKET_MASK);
+               ep_ctx->ep_info2 &= cpu_to_le32(~((0xffff & MAX_PACKET_MASK)
+                                               << MAX_PACKET_SHIFT));
                ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet_size));
 
                /*
@@ -890,11 +1112,18 @@ unknown:
 static int _xhci_submit_int_msg(struct usb_device *udev, unsigned long pipe,
                                void *buffer, int length, int interval)
 {
+       if (usb_pipetype(pipe) != PIPE_INTERRUPT) {
+               printf("non-interrupt pipe (type=%lu)", usb_pipetype(pipe));
+               return -EINVAL;
+       }
+
        /*
-        * TODO: Not addressing any interrupt type transfer requests
-        * Add support for it later.
+        * xHCI uses normal TRBs for both bulk and interrupt. When the
+        * interrupt endpoint is to be serviced, the xHC will consume
+        * (at most) one TD. A TD (comprised of sg list entries) can
+        * take several service intervals to transmit.
         */
-       return -EINVAL;
+       return xhci_bulk_tx(udev, pipe, length, buffer);
 }
 
 /**
@@ -1228,6 +1457,20 @@ static int xhci_update_hub_device(struct udevice *dev, struct usb_device *udev)
        return xhci_configure_endpoints(udev, false);
 }
 
+static int xhci_get_max_xfer_size(struct udevice *dev, size_t *size)
+{
+       /*
+        * xHCD allocates one segment which includes 64 TRBs for each endpoint
+        * and the last TRB in this segment is configured as a link TRB to form
+        * a TRB ring. Each TRB can transfer up to 64K bytes, however data
+        * buffers referenced by transfer TRBs shall not span 64KB boundaries.
+        * Hence the maximum number of TRBs we can use in one transfer is 62.
+        */
+       *size = (TRBS_PER_SEGMENT - 2) * TRB_MAX_BUFF_SIZE;
+
+       return 0;
+}
+
 int xhci_register(struct udevice *dev, struct xhci_hccr *hccr,
                  struct xhci_hcor *hcor)
 {
@@ -1281,6 +1524,7 @@ struct dm_usb_ops xhci_usb_ops = {
        .interrupt = xhci_submit_int_msg,
        .alloc_device = xhci_alloc_device,
        .update_hub_device = xhci_update_hub_device,
+       .get_max_xfer_size  = xhci_get_max_xfer_size,
 };
 
 #endif
index a497d9d830fa7be54b05ac79c5def17e1c3a9d04..ba5f650144f5d94ccf7a3ab7b02398bc3125a3b9 100644 (file)
@@ -663,8 +663,9 @@ struct xhci_ep_ctx {
 #define GET_MAX_PACKET(p)      ((p) & 0x7ff)
 
 /* tx_info bitmasks */
-#define AVG_TRB_LENGTH_FOR_EP(p)       ((p) & 0xffff)
-#define MAX_ESIT_PAYLOAD_FOR_EP(p)     (((p) & 0xffff) << 16)
+#define EP_AVG_TRB_LENGTH(p)           ((p) & 0xffff)
+#define EP_MAX_ESIT_PAYLOAD_LO(p)      (((p) & 0xffff) << 16)
+#define EP_MAX_ESIT_PAYLOAD_HI(p)      ((((p) >> 16) & 0xff) << 24)
 #define CTX_TO_MAX_ESIT_PAYLOAD(p)     (((p) >> 16) & 0xffff)
 
 /* deq bitmasks */
@@ -1045,9 +1046,9 @@ struct xhci_scratchpad {
  * (1K bytes * 8bytes/bit) / (4*32 bits) = 64 segment entries in the table,
  * meaning 64 ring segments.
  * Initial allocated size of the ERST, in number of entries */
-#define        ERST_NUM_SEGS   3
+#define        ERST_NUM_SEGS   1
 /* Initial number of event segment rings allocated */
-#define        ERST_ENTRIES    3
+#define        ERST_ENTRIES    1
 /* Initial allocated size of the ERST, in number of entries */
 #define        ERST_SIZE       64
 /* Poll every 60 seconds */
index 4dae83ed6850350470a334f2bbaf2dd5dd093f12..7bb53d2b198ed4269abdc6168a205774b1d281be 100644 (file)
@@ -5,8 +5,6 @@
 #include <linux/list.h>
 #include <linux/compat.h>
 
-#define pr_debug(fmt, args...) debug(fmt, ##args)
-
 #define WARN(condition, fmt, args...) ({       \
        int ret_warn = !!condition;             \
        if (ret_warn)                           \
index 5c1a902e42dcea5814fd6657ea210f3b8853db13..7ee44ea91900e882ce13f98feeeeb29730fe3284 100644 (file)
@@ -308,9 +308,6 @@ static struct musb_hdrc_platform_data musb_plat = {
        .platform_ops   = &sunxi_musb_ops,
 };
 
-#ifdef CONFIG_USB_MUSB_HOST
-static int musb_usb_remove(struct udevice *dev);
-
 static int musb_usb_probe(struct udevice *dev)
 {
        struct musb_host_data *host = dev_get_priv(dev);
@@ -319,16 +316,20 @@ static int musb_usb_probe(struct udevice *dev)
 
        priv->desc_before_addr = true;
 
+#ifdef CONFIG_USB_MUSB_HOST
        host->host = musb_init_controller(&musb_plat, NULL,
                                          (void *)SUNXI_USB0_BASE);
        if (!host->host)
                return -EIO;
 
        ret = musb_lowlevel_init(host);
-       if (ret == 0)
-               printf("MUSB OTG\n");
-       else
-               musb_usb_remove(dev);
+       if (!ret)
+               printf("Allwinner mUSB OTG (Host)\n");
+#else
+       ret = musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+       if (!ret)
+               printf("Allwinner mUSB OTG (Peripheral)\n");
+#endif
 
        return ret;
 }
@@ -352,30 +353,27 @@ static int musb_usb_remove(struct udevice *dev)
        return 0;
 }
 
-U_BOOT_DRIVER(usb_musb) = {
-       .name   = "sunxi-musb",
-       .id     = UCLASS_USB,
-       .probe = musb_usb_probe,
-       .remove = musb_usb_remove,
-       .ops    = &musb_usb_ops,
-       .platdata_auto_alloc_size = sizeof(struct usb_platdata),
-       .priv_auto_alloc_size = sizeof(struct musb_host_data),
+static const struct udevice_id sunxi_musb_ids[] = {
+       { .compatible = "allwinner,sun4i-a10-musb" },
+       { .compatible = "allwinner,sun6i-a31-musb" },
+       { .compatible = "allwinner,sun8i-a33-musb" },
+       { .compatible = "allwinner,sun8i-h3-musb" },
+       { }
 };
-#endif
 
-void sunxi_musb_board_init(void)
-{
+U_BOOT_DRIVER(usb_musb) = {
+       .name           = "sunxi-musb",
 #ifdef CONFIG_USB_MUSB_HOST
-       struct udevice *dev;
-
-       /*
-        * Bind the driver directly for now as musb linux kernel support is
-        * still pending upstream so our dts files do not have the necessary
-        * nodes yet. TODO: Remove this as soon as the dts nodes are in place
-        * and bind by compatible instead.
-        */
-       device_bind_driver(dm_root(), "sunxi-musb", "sunxi-musb", &dev);
+       .id             = UCLASS_USB,
 #else
-       musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
+       .id             = UCLASS_USB_DEV_GENERIC,
 #endif
-}
+       .of_match       = sunxi_musb_ids,
+       .probe          = musb_usb_probe,
+       .remove         = musb_usb_remove,
+#ifdef CONFIG_USB_MUSB_HOST
+       .ops            = &musb_usb_ops,
+#endif
+       .platdata_auto_alloc_size = sizeof(struct usb_platdata),
+       .priv_auto_alloc_size = sizeof(struct musb_host_data),
+};
index de101319cdaad82a9a570b4a1bfd25023934c58f..233857ad7a13ae4ee73ac08c7f965afe987eb922 100644 (file)
@@ -106,7 +106,7 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
                                                          "mentor,multipoint",
                                                          -1);
        if (platdata->musb_config.multipoint < 0) {
-               error("MUSB multipoint DT entry missing\n");
+               pr_err("MUSB multipoint DT entry missing\n");
                return -ENOENT;
        }
 
@@ -115,14 +115,14 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
        platdata->musb_config.num_eps = fdtdec_get_int(fdt, node,
                                                       "mentor,num-eps", -1);
        if (platdata->musb_config.num_eps < 0) {
-               error("MUSB num-eps DT entry missing\n");
+               pr_err("MUSB num-eps DT entry missing\n");
                return -ENOENT;
        }
 
        platdata->musb_config.ram_bits = fdtdec_get_int(fdt, node,
                                                        "mentor,ram-bits", -1);
        if (platdata->musb_config.ram_bits < 0) {
-               error("MUSB ram-bits DT entry missing\n");
+               pr_err("MUSB ram-bits DT entry missing\n");
                return -ENOENT;
        }
 
@@ -132,7 +132,7 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev)
 
        platdata->plat.power = fdtdec_get_int(fdt, node, "mentor,power", -1);
        if (platdata->plat.power < 0) {
-               error("MUSB mentor,power DT entry missing\n");
+               pr_err("MUSB mentor,power DT entry missing\n");
                return -ENOENT;
        }
 
@@ -183,7 +183,7 @@ static int ti_musb_host_ofdata_to_platdata(struct udevice *dev)
 
        ret = ti_musb_ofdata_to_platdata(dev);
        if (ret) {
-               error("platdata dt parse error\n");
+               pr_err("platdata dt parse error\n");
                return ret;
        }
 
@@ -229,7 +229,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
                        ret = device_bind_driver_to_node(parent, "ti-musb-host",
                                        name, offset_to_ofnode(node), &dev);
                        if (ret) {
-                               error("musb - not able to bind usb host node\n");
+                               pr_err("musb - not able to bind usb host node\n");
                                return ret;
                        }
                        break;
index 7ba7b580db1158f5ee4acaa8b004f603e7519efe..e6b7f11dc9d33401a3fefdfd49a59b0e4066d2b6 100644 (file)
@@ -65,6 +65,14 @@ config VIDEO_BPP32
          this option, such displays will not be supported and console output
          will be empty.
 
+config VIDEO_ANSI
+       bool "Support ANSI escape sequences in video console"
+       depends on DM_VIDEO
+       default y if DM_VIDEO
+       help
+         Enable ANSI escape sequence decoding for a more fully functional
+         console.
+
 config CONSOLE_NORMAL
        bool "Support a simple text console"
        depends on DM_VIDEO
index bb5cc9788abfa61dbe532d292eccbc64a7a44002..a8b3e747a032d8896722f0cbdfbc85b9ee65a4d3 100644 (file)
@@ -128,7 +128,7 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
                raster_ctrl |= LCD_TFT_24BPP_MODE;
                break;
        default:
-               error("am335x-fb: invalid bpp value: %d\n", panel->bpp);
+               pr_err("am335x-fb: invalid bpp value: %d\n", panel->bpp);
                return -1;
        }
 
index b5afd72227c7a6460cc5c5c0a268d93f84d990b0..5f63c12d6c5924bf19c72234abb06f57fcecb8ab 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <common.h>
+#include <linux/ctype.h>
 #include <dm.h>
 #include <video.h>
 #include <video_console.h>
@@ -107,12 +108,213 @@ static void vidconsole_newline(struct udevice *dev)
        video_sync(dev->parent);
 }
 
+static const struct {
+       unsigned r;
+       unsigned g;
+       unsigned b;
+} colors[] = {
+       { 0x00, 0x00, 0x00 },  /* black */
+       { 0xff, 0x00, 0x00 },  /* red */
+       { 0x00, 0xff, 0x00 },  /* green */
+       { 0xff, 0xff, 0x00 },  /* yellow */
+       { 0x00, 0x00, 0xff },  /* blue */
+       { 0xff, 0x00, 0xff },  /* magenta */
+       { 0x00, 0xff, 0xff },  /* cyan */
+       { 0xff, 0xff, 0xff },  /* white */
+};
+
+static void set_color(struct video_priv *priv, unsigned idx, unsigned *c)
+{
+       switch (priv->bpix) {
+       case VIDEO_BPP16:
+               *c = ((colors[idx].r >> 3) << 0) |
+                    ((colors[idx].g >> 2) << 5) |
+                    ((colors[idx].b >> 3) << 11);
+               break;
+       case VIDEO_BPP32:
+               *c = 0xff000000 |
+                    (colors[idx].r << 0) |
+                    (colors[idx].g << 8) |
+                    (colors[idx].b << 16);
+               break;
+       default:
+               /* unsupported, leave current color in place */
+               break;
+       }
+}
+
+static char *parsenum(char *s, int *num)
+{
+       char *end;
+       *num = simple_strtol(s, &end, 10);
+       return end;
+}
+
+/*
+ * Process a character while accumulating an escape string.  Chars are
+ * accumulated into escape_buf until the end of escape sequence is
+ * found, at which point the sequence is parsed and processed.
+ */
+static void vidconsole_escape_char(struct udevice *dev, char ch)
+{
+       struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
+
+       if (!IS_ENABLED(CONFIG_VIDEO_ANSI))
+               goto error;
+
+       /* Sanity checking for bogus ESC sequences: */
+       if (priv->escape_len >= sizeof(priv->escape_buf))
+               goto error;
+       if (priv->escape_len == 0 && ch != '[')
+               goto error;
+
+       priv->escape_buf[priv->escape_len++] = ch;
+
+       /*
+        * Escape sequences are terminated by a letter, so keep
+        * accumulating until we get one:
+        */
+       if (!isalpha(ch))
+               return;
+
+       /*
+        * clear escape mode first, otherwise things will get highly
+        * surprising if you hit any debug prints that come back to
+        * this console.
+        */
+       priv->escape = 0;
+
+       switch (ch) {
+       case 'H':
+       case 'f': {
+               int row, col;
+               char *s = priv->escape_buf;
+
+               /*
+                * Set cursor position: [%d;%df or [%d;%dH
+                */
+               s++;    /* [ */
+               s = parsenum(s, &row);
+               s++;    /* ; */
+               s = parsenum(s, &col);
+
+               priv->ycur = row * priv->y_charsize;
+               priv->xcur_frac = priv->xstart_frac +
+                       VID_TO_POS(col * priv->x_charsize);
+
+               break;
+       }
+       case 'J': {
+               int mode;
+
+               /*
+                * Clear part/all screen:
+                *   [J or [0J - clear screen from cursor down
+                *   [1J       - clear screen from cursor up
+                *   [2J       - clear entire screen
+                *
+                * TODO we really only handle entire-screen case, others
+                * probably require some additions to video-uclass (and
+                * are not really needed yet by efi_console)
+                */
+               parsenum(priv->escape_buf + 1, &mode);
+
+               if (mode == 2) {
+                       video_clear(dev->parent);
+                       video_sync(dev->parent);
+                       priv->ycur = 0;
+                       priv->xcur_frac = priv->xstart_frac;
+               } else {
+                       debug("unsupported clear mode: %d\n", mode);
+               }
+               break;
+       }
+       case 'm': {
+               struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
+               char *s = priv->escape_buf;
+               char *end = &priv->escape_buf[priv->escape_len];
+
+               /*
+                * Set graphics mode: [%d;...;%dm
+                *
+                * Currently only supports the color attributes:
+                *
+                * Foreground Colors:
+                *
+                *   30 Black
+                *   31 Red
+                *   32 Green
+                *   33 Yellow
+                *   34 Blue
+                *   35 Magenta
+                *   36 Cyan
+                *   37 White
+                *
+                * Background Colors:
+                *
+                *   40 Black
+                *   41 Red
+                *   42 Green
+                *   43 Yellow
+                *   44 Blue
+                *   45 Magenta
+                *   46 Cyan
+                *   47 White
+                */
+
+               s++;    /* [ */
+               while (s < end) {
+                       int val;
+
+                       s = parsenum(s, &val);
+                       s++;
+
+                       switch (val) {
+                       case 30 ... 37:
+                               /* fg color */
+                               set_color(vid_priv, val - 30,
+                                         (unsigned *)&vid_priv->colour_fg);
+                               break;
+                       case 40 ... 47:
+                               /* bg color */
+                               set_color(vid_priv, val - 40,
+                                         (unsigned *)&vid_priv->colour_bg);
+                               break;
+                       default:
+                               /* unknown/unsupported */
+                               break;
+                       }
+               }
+
+               break;
+       }
+       default:
+               debug("unrecognized escape sequence: %*s\n",
+                     priv->escape_len, priv->escape_buf);
+       }
+
+       return;
+
+error:
+       /* something went wrong, just revert to normal mode: */
+       priv->escape = 0;
+}
+
 int vidconsole_put_char(struct udevice *dev, char ch)
 {
        struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
        int ret;
 
+       if (priv->escape) {
+               vidconsole_escape_char(dev, ch);
+               return 0;
+       }
+
        switch (ch) {
+       case '\x1b':
+               priv->escape_len = 0;
+               priv->escape = 1;
+               break;
        case '\a':
                /* beep */
                break;
@@ -163,6 +365,7 @@ static void vidconsole_putc(struct stdio_dev *sdev, const char ch)
        struct udevice *dev = sdev->priv;
 
        vidconsole_put_char(dev, ch);
+       video_sync(dev->parent);
 }
 
 static void vidconsole_puts(struct stdio_dev *sdev, const char *s)
@@ -260,6 +463,8 @@ static int do_video_puts(cmd_tbl_t *cmdtp, int flag, int argc,
        for (s = argv[1]; *s; s++)
                vidconsole_put_char(dev, *s);
 
+       video_sync(dev->parent);
+
        return 0;
 }
 
index dfa39b0d1b893ad774e0fa35bb57760b34bf8973..dcaceed42c4e66821133fad83136c9aaf1b78b69 100644 (file)
@@ -87,7 +87,7 @@ int video_reserve(ulong *addrp)
        return 0;
 }
 
-static int video_clear(struct udevice *dev)
+void video_clear(struct udevice *dev)
 {
        struct video_priv *priv = dev_get_uclass_priv(dev);
 
@@ -100,8 +100,6 @@ static int video_clear(struct udevice *dev)
        } else {
                memset(priv->fb, priv->colour_bg, priv->fb_size);
        }
-
-       return 0;
 }
 
 /* Flush video activity to the caches */
index b4b7ddc1444a0b0b16e275fa0365322f5c05b1c0..daa757dd56631601faa437467ef26662e3ac97a9 100644 (file)
@@ -5,11 +5,15 @@
 config SUPPORT_OF_CONTROL
        bool
 
+config DTC
+       bool
+
 menu "Device Tree Control"
        depends on SUPPORT_OF_CONTROL
 
 config OF_CONTROL
        bool "Run-time configuration via Device Tree"
+       select DTC
        help
          This feature provides for run-time configuration of U-Boot
          via a flattened device tree.
@@ -98,7 +102,7 @@ config DEFAULT_DEVICE_TREE
 
 config OF_LIST
        string "List of device tree files to include for DT control"
-       depends on SPL_LOAD_FIT || FIT_EMBED
+       depends on SPL_LOAD_FIT || MULTI_DTB_FIT
        default DEFAULT_DEVICE_TREE
        help
          This option specifies a list of device tree files to use for DT
@@ -108,6 +112,107 @@ config OF_LIST
          device tree files (without the directory or .dtb suffix)
          separated by <space>.
 
+
+config DTB_RESELECT
+       bool "Support swapping dtbs at a later point in boot"
+       depends on MULTI_DTB_FIT
+       help
+         It is possible during initial boot you may need to use a generic
+         dtb until you can fully determine the board your running on. This
+         config allows boards to implement a function at a later point
+         during boot to switch to the "correct" dtb.
+
+config MULTI_DTB_FIT
+       bool "Support embedding several DTBs in a FIT image for u-boot"
+       help
+         This option provides hooks to allow U-boot to parse an
+         appended FIT image and enable board specific code to then select
+         the correct DTB to be used. Use this if you need to support
+         multiple DTBs but don't use the SPL.
+
+
+config SPL_MULTI_DTB_FIT
+       depends on SPL_LOAD_FIT && SPL_OF_CONTROL && !SPL_OF_PLATDATA
+       bool "Support embedding several DTBs in a FIT image for the SPL"
+       help
+         This option provides the SPL with the ability to select its own
+         DTB at runtime from an appended FIT image containing several DTBs.
+         This allows using the same SPL binary on multiple platforms.
+         The primary purpose is to handle different versions of
+         the same platform without tweaking the platform code if the
+         differences can be expressed in the DTBs (common examples are: bus
+         capabilities, pad configurations).
+
+config SPL_OF_LIST
+       string "List of device tree files to include for DT control in SPL"
+       depends on SPL_MULTI_DTB_FIT
+       default OF_LIST
+       help
+         This option specifies a list of device tree files to use for DT
+         control in the SPL. These will be packaged into a FIT. At run-time,
+         the SPL will select the correct DT to use by examining the
+         hardware (e.g. reading a board ID value). This is a list of
+         device tree files (without the directory or .dtb suffix)
+         separated by <space>.
+
+choice
+       prompt "SPL OF LIST compression"
+       depends on SPL_MULTI_DTB_FIT
+       default SPL_MULTI_DTB_FIT_LZO
+
+config SPL_MULTI_DTB_FIT_LZO
+       bool "LZO"
+       depends on SYS_MALLOC_F
+       select SPL_LZO
+       help
+         Compress the FIT image containing the DTBs available for the SPL
+         using LZO compression. (requires lzop on host).
+
+config SPL_MULTI_DTB_FIT_GZIP
+       bool "GZIP"
+       depends on SYS_MALLOC_F
+       select SPL_GZIP
+       help
+         Compress the FIT image containing the DTBs available for the SPL
+         using GZIP compression. (requires gzip on host)
+
+config SPL_MULTI_DTB_FIT_NO_COMPRESSION
+       bool "No compression"
+       help
+         Do not compress the FIT image containing the DTBs available for the SPL.
+         Use this options only if LZO is not available and the DTBs are very small.
+endchoice
+
+choice
+       prompt "Location of uncompressed DTBs "
+       depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
+       default SPL_MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
+
+config SPL_MULTI_DTB_FIT_DYN_ALLOC
+       bool "Dynamically allocate the memory"
+       depends on SYS_MALLOC_F
+
+config SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
+       bool "User-defined location"
+endchoice
+
+config SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ
+       hex "Size of memory reserved to uncompress the DTBs"
+       depends on (SPL_MULTI_DTB_FIT_GZIP || SPL_MULTI_DTB_FIT_LZO)
+       default 0x8000
+       help
+          This is the size of this area where the DTBs are uncompressed.
+          If this area is dynamically allocated, make sure that
+          SPL_SYS_MALLOC_F_LEN is big enough to contain it.
+
+config SPL_MULTI_DTB_FIT_USER_DEF_ADDR
+       hex "Address of memory where dtbs are uncompressed"
+       depends on SPL_MULTI_DTB_FIT_USER_DEFINED_AREA
+       help
+          the FIT image containing the DTBs is uncompressed in an area defined
+          at compilation time. This is the address of this area. It must be
+          aligned on 2-byte boundary.
+
 config OF_SPL_REMOVE_PROPS
        string "List of device tree properties to drop for SPL"
        depends on SPL_OF_CONTROL
@@ -166,3 +271,12 @@ config TPL_OF_PLATDATA
          information.
 
 endmenu
+
+config MKIMAGE_DTC_PATH
+       string "Path to dtc binary for use within mkimage"
+       default "dtc"
+       help
+         The mkimage host tool will, in order to generate FIT images make
+         calls to the dtc application in order to create the output.  In
+         some cases the system dtc may not support all required features
+         and the path to a different version should be given here.
index b403bd5f6c120f572df213978ca5cf2b0a9f774a..70715bb6e7564554c233ca3b9e08b928c7bf3925 100644 (file)
@@ -84,7 +84,7 @@ void set_default_env(const char *s)
        if (himport_r(&env_htab, (char *)default_environment,
                        sizeof(default_environment), '\0', flags, 0,
                        0, NULL) == 0)
-               error("Environment import failed: errno = %d\n", errno);
+               pr_err("Environment import failed: errno = %d\n", errno);
 
        gd->flags |= GD_FLG_ENV_READY;
        gd->flags |= GD_FLG_ENV_DEFAULT;
@@ -172,7 +172,7 @@ int env_import(const char *buf, int check)
        /* Decrypt the env if desired. */
        ret = env_aes_cbc_crypt(ep, 0);
        if (ret) {
-               error("Failed to decrypt env!\n");
+               pr_err("Failed to decrypt env!\n");
                set_default_env("!import failed");
                return ret;
        }
@@ -183,7 +183,7 @@ int env_import(const char *buf, int check)
                return 1;
        }
 
-       error("Cannot import environment: errno = %d\n", errno);
+       pr_err("Cannot import environment: errno = %d\n", errno);
 
        set_default_env("!import failed");
 
@@ -247,7 +247,7 @@ int env_export(env_t *env_out)
        res = (char *)env_out->data;
        len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL);
        if (len < 0) {
-               error("Cannot export environment: errno = %d\n", errno);
+               pr_err("Cannot export environment: errno = %d\n", errno);
                return 1;
        }
 
index 6f74371c098203e2ba9c805227da7a9a492bae7a..e51b1ae189164f9a0247ca5f2b12b6d7c1776600 100644 (file)
--- a/env/sf.c
+++ b/env/sf.c
@@ -236,7 +236,7 @@ static int env_sf_load(void)
 
        ret = env_import((char *)ep, 0);
        if (!ret) {
-               error("Cannot import environment: errno = %d\n", errno);
+               pr_err("Cannot import environment: errno = %d\n", errno);
                set_default_env("!env_import failed");
        }
 
index e6803ac8cb2bba4717cc2012d66ed6301a63cc41..1cb9831be8aefeeb19745fb16e6fc6f506a83528 100644 (file)
@@ -4,6 +4,8 @@
 
 menu "File systems"
 
+source "fs/btrfs/Kconfig"
+
 source "fs/cbfs/Kconfig"
 
 source "fs/ext4/Kconfig"
index 5770f41c0b01a1a9b87220b09a842bdec25f24b9..8a8175b7af3aec91cc4f14ef7ab44d268915ac77 100644 (file)
@@ -12,6 +12,7 @@ obj-$(CONFIG_SPL_EXT_SUPPORT) += ext4/
 else
 obj-y                          += fs.o
 
+obj-$(CONFIG_FS_BTRFS) += btrfs/
 obj-$(CONFIG_FS_CBFS) += cbfs/
 obj-$(CONFIG_CMD_CRAMFS) += cramfs/
 obj-$(CONFIG_FS_EXT4) += ext4/
@@ -23,3 +24,4 @@ obj-$(CONFIG_CMD_UBIFS) += ubifs/
 obj-$(CONFIG_YAFFS2) += yaffs2/
 obj-$(CONFIG_CMD_ZFS) += zfs/
 endif
+obj-y += fs_internal.o
diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
new file mode 100644 (file)
index 0000000..22909d9
--- /dev/null
@@ -0,0 +1,9 @@
+config FS_BTRFS
+       bool "Enable BTRFS filesystem support"
+       select CRC32C
+       select LZO
+       select RBTREE
+       help
+         This provides a single-device read-only BTRFS support. BTRFS is a
+         next-generation Linux file system based on the copy-on-write
+         principle.
diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
new file mode 100644 (file)
index 0000000..0173155
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y := btrfs.o chunk-map.o compression.o ctree.o dev.o dir-item.o \
+       extent-io.o hash.o inode.o root.o subvolume.o super.o
diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c
new file mode 100644 (file)
index 0000000..4140e2b
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+#include <config.h>
+#include <malloc.h>
+#include <linux/time.h>
+
+struct btrfs_info btrfs_info;
+
+static int readdir_callback(const struct btrfs_root *root,
+                           struct btrfs_dir_item *item)
+{
+       static const char typestr[BTRFS_FT_MAX][4] = {
+               [BTRFS_FT_UNKNOWN]  = " ? ",
+               [BTRFS_FT_REG_FILE] = "   ",
+               [BTRFS_FT_DIR]      = "DIR",
+               [BTRFS_FT_CHRDEV]   = "CHR",
+               [BTRFS_FT_BLKDEV]   = "BLK",
+               [BTRFS_FT_FIFO]     = "FIF",
+               [BTRFS_FT_SOCK]     = "SCK",
+               [BTRFS_FT_SYMLINK]  = "SYM",
+               [BTRFS_FT_XATTR]    = " ? ",
+       };
+       struct btrfs_inode_item inode;
+       const char *name = (const char *) (item + 1);
+       char filetime[32], *target = NULL;
+       time_t mtime;
+
+       if (btrfs_lookup_inode(root, &item->location, &inode, NULL)) {
+               printf("%s: Cannot find inode item for directory entry %.*s!\n",
+                      __func__, item->name_len, name);
+               return 0;
+       }
+
+       mtime = inode.mtime.sec;
+       ctime_r(&mtime, filetime);
+
+       if (item->type == BTRFS_FT_SYMLINK) {
+               target = malloc(min(inode.size + 1,
+                                   (u64) btrfs_info.sb.sectorsize));
+
+               if (target && btrfs_readlink(root, item->location.objectid,
+                                            target)) {
+                       free(target);
+                       target = NULL;
+               }
+
+               if (!target)
+                       printf("%s: Cannot read symlink target!\n", __func__);
+       }
+
+       printf("<%s> ", typestr[item->type]);
+       if (item->type == BTRFS_FT_CHRDEV || item->type == BTRFS_FT_BLKDEV)
+               printf("%4u,%5u  ", (unsigned int) (inode.rdev >> 20),
+                       (unsigned int) (inode.rdev & 0xfffff));
+       else
+               printf("%10llu  ", inode.size);
+
+       printf("%24.24s  %.*s", filetime, item->name_len, name);
+
+       if (item->type == BTRFS_FT_SYMLINK) {
+               printf(" -> %s", target ? target : "?");
+               if (target)
+                       free(target);
+       }
+
+       printf("\n");
+
+       return 0;
+}
+
+int btrfs_probe(struct blk_desc *fs_dev_desc, disk_partition_t *fs_partition)
+{
+       btrfs_blk_desc = fs_dev_desc;
+       btrfs_part_info = fs_partition;
+
+       memset(&btrfs_info, 0, sizeof(btrfs_info));
+
+       btrfs_hash_init();
+       if (btrfs_read_superblock())
+               return -1;
+
+       if (btrfs_chunk_map_init()) {
+               printf("%s: failed to init chunk map\n", __func__);
+               return -1;
+       }
+
+       btrfs_info.tree_root.objectid = 0;
+       btrfs_info.tree_root.bytenr = btrfs_info.sb.root;
+       btrfs_info.chunk_root.objectid = 0;
+       btrfs_info.chunk_root.bytenr = btrfs_info.sb.chunk_root;
+
+       if (btrfs_read_chunk_tree()) {
+               printf("%s: failed to read chunk tree\n", __func__);
+               return -1;
+       }
+
+       if (btrfs_find_root(btrfs_get_default_subvol_objectid(),
+                           &btrfs_info.fs_root, NULL)) {
+               printf("%s: failed to find default subvolume\n", __func__);
+               return -1;
+       }
+
+       return 0;
+}
+
+int btrfs_ls(const char *path)
+{
+       struct btrfs_root root = btrfs_info.fs_root;
+       u64 inr;
+       u8 type;
+
+       inr = btrfs_lookup_path(&root, root.root_dirid, path, &type, NULL, 40);
+
+       if (inr == -1ULL) {
+               printf("Cannot lookup path %s\n", path);
+               return 1;
+       }
+
+       if (type != BTRFS_FT_DIR) {
+               printf("Not a directory: %s\n", path);
+               return 1;
+       }
+
+       if (btrfs_readdir(&root, inr, readdir_callback)) {
+               printf("An error occured while listing directory %s\n", path);
+               return 1;
+       }
+
+       return 0;
+}
+
+int btrfs_exists(const char *file)
+{
+       struct btrfs_root root = btrfs_info.fs_root;
+       u64 inr;
+       u8 type;
+
+       inr = btrfs_lookup_path(&root, root.root_dirid, file, &type, NULL, 40);
+
+       return (inr != -1ULL && type == BTRFS_FT_REG_FILE);
+}
+
+int btrfs_size(const char *file, loff_t *size)
+{
+       struct btrfs_root root = btrfs_info.fs_root;
+       struct btrfs_inode_item inode;
+       u64 inr;
+       u8 type;
+
+       inr = btrfs_lookup_path(&root, root.root_dirid, file, &type, &inode,
+                               40);
+
+       if (inr == -1ULL) {
+               printf("Cannot lookup file %s\n", file);
+               return 1;
+       }
+
+       if (type != BTRFS_FT_REG_FILE) {
+               printf("Not a regular file: %s\n", file);
+               return 1;
+       }
+
+       *size = inode.size;
+       return 0;
+}
+
+int btrfs_read(const char *file, void *buf, loff_t offset, loff_t len,
+              loff_t *actread)
+{
+       struct btrfs_root root = btrfs_info.fs_root;
+       struct btrfs_inode_item inode;
+       u64 inr, rd;
+       u8 type;
+
+       inr = btrfs_lookup_path(&root, root.root_dirid, file, &type, &inode,
+                               40);
+
+       if (inr == -1ULL) {
+               printf("Cannot lookup file %s\n", file);
+               return 1;
+       }
+
+       if (type != BTRFS_FT_REG_FILE) {
+               printf("Not a regular file: %s\n", file);
+               return 1;
+       }
+
+       if (!len)
+               len = inode.size;
+
+       if (len > inode.size - offset)
+               len = inode.size - offset;
+
+       rd = btrfs_file_read(&root, inr, offset, len, buf);
+       if (rd == -1ULL) {
+               printf("An error occured while reading file %s\n", file);
+               return 1;
+       }
+
+       *actread = rd;
+       return 0;
+}
+
+void btrfs_close(void)
+{
+       btrfs_chunk_map_exit();
+}
+
+int btrfs_uuid(char *uuid_str)
+{
+#ifdef CONFIG_LIB_UUID
+       uuid_bin_to_str(btrfs_info.sb.fsid, uuid_str, UUID_STR_FORMAT_STD);
+       return 0;
+#endif
+       return -ENOSYS;
+}
+
+/*
+               btrfs_list_subvols();
+*/
diff --git a/fs/btrfs/btrfs.h b/fs/btrfs/btrfs.h
new file mode 100644 (file)
index 0000000..4247cbb
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __BTRFS_BTRFS_H__
+#define __BTRFS_BTRFS_H__
+
+#include <linux/rbtree.h>
+#include "conv-funcs.h"
+
+struct btrfs_info {
+       struct btrfs_super_block sb;
+       struct btrfs_root_backup *root_backup;
+
+       struct btrfs_root tree_root;
+       struct btrfs_root fs_root;
+       struct btrfs_root chunk_root;
+
+       struct rb_root chunks_root;
+};
+
+extern struct btrfs_info btrfs_info;
+
+/* hash.c */
+void btrfs_hash_init(void);
+u32 btrfs_crc32c(u32, const void *, size_t);
+u32 btrfs_csum_data(char *, u32, size_t);
+void btrfs_csum_final(u32, void *);
+
+static inline u64 btrfs_name_hash(const char *name, int len)
+{
+       return btrfs_crc32c((u32) ~1, name, len);
+}
+
+/* dev.c */
+extern struct blk_desc *btrfs_blk_desc;
+extern disk_partition_t *btrfs_part_info;
+
+int btrfs_devread(u64, int, void *);
+
+/* chunk-map.c */
+u64 btrfs_map_logical_to_physical(u64);
+int btrfs_chunk_map_init(void);
+void btrfs_chunk_map_exit(void);
+int btrfs_read_chunk_tree(void);
+
+/* compression.c */
+u32 btrfs_decompress(u8 type, const char *, u32, char *, u32);
+
+/* super.c */
+int btrfs_read_superblock(void);
+
+/* dir-item.c */
+typedef int (*btrfs_readdir_callback_t)(const struct btrfs_root *,
+                                       struct btrfs_dir_item *);
+
+int btrfs_lookup_dir_item(const struct btrfs_root *, u64, const char *, int,
+                          struct btrfs_dir_item *);
+int btrfs_readdir(const struct btrfs_root *, u64, btrfs_readdir_callback_t);
+
+/* root.c */
+int btrfs_find_root(u64, struct btrfs_root *, struct btrfs_root_item *);
+u64 btrfs_lookup_root_ref(u64, struct btrfs_root_ref *, char *);
+
+/* inode.c */
+u64 btrfs_lookup_inode_ref(struct btrfs_root *, u64, struct btrfs_inode_ref *,
+                           char *);
+int btrfs_lookup_inode(const struct btrfs_root *, struct btrfs_key *,
+                       struct btrfs_inode_item *, struct btrfs_root *);
+int btrfs_readlink(const struct btrfs_root *, u64, char *);
+u64 btrfs_lookup_path(struct btrfs_root *, u64, const char *, u8 *,
+                      struct btrfs_inode_item *, int);
+u64 btrfs_file_read(const struct btrfs_root *, u64, u64, u64, char *);
+
+/* subvolume.c */
+u64 btrfs_get_default_subvol_objectid(void);
+
+/* extent-io.c */
+u64 btrfs_read_extent_inline(struct btrfs_path *,
+                             struct btrfs_file_extent_item *, u64, u64,
+                             char *);
+u64 btrfs_read_extent_reg(struct btrfs_path *, struct btrfs_file_extent_item *,
+                          u64, u64, char *);
+
+#endif /* !__BTRFS_BTRFS_H__ */
diff --git a/fs/btrfs/btrfs_tree.h b/fs/btrfs/btrfs_tree.h
new file mode 100644 (file)
index 0000000..f171b24
--- /dev/null
@@ -0,0 +1,766 @@
+/*
+ * From linux/include/uapi/linux/btrfs_tree.h
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __BTRFS_BTRFS_TREE_H__
+#define __BTRFS_BTRFS_TREE_H__
+
+#include <common.h>
+
+#define BTRFS_VOL_NAME_MAX 255
+#define BTRFS_NAME_MAX 255
+#define BTRFS_LABEL_SIZE 256
+#define BTRFS_FSID_SIZE 16
+#define BTRFS_UUID_SIZE 16
+
+/*
+ * This header contains the structure definitions and constants used
+ * by file system objects that can be retrieved using
+ * the BTRFS_IOC_SEARCH_TREE ioctl.  That means basically anything that
+ * is needed to describe a leaf node's key or item contents.
+ */
+
+/* holds pointers to all of the tree roots */
+#define BTRFS_ROOT_TREE_OBJECTID 1ULL
+
+/* stores information about which extents are in use, and reference counts */
+#define BTRFS_EXTENT_TREE_OBJECTID 2ULL
+
+/*
+ * chunk tree stores translations from logical -> physical block numbering
+ * the super block points to the chunk tree
+ */
+#define BTRFS_CHUNK_TREE_OBJECTID 3ULL
+
+/*
+ * stores information about which areas of a given device are in use.
+ * one per device.  The tree of tree roots points to the device tree
+ */
+#define BTRFS_DEV_TREE_OBJECTID 4ULL
+
+/* one per subvolume, storing files and directories */
+#define BTRFS_FS_TREE_OBJECTID 5ULL
+
+/* directory objectid inside the root tree */
+#define BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL
+
+/* holds checksums of all the data extents */
+#define BTRFS_CSUM_TREE_OBJECTID 7ULL
+
+/* holds quota configuration and tracking */
+#define BTRFS_QUOTA_TREE_OBJECTID 8ULL
+
+/* for storing items that use the BTRFS_UUID_KEY* types */
+#define BTRFS_UUID_TREE_OBJECTID 9ULL
+
+/* tracks free space in block groups. */
+#define BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL
+
+/* device stats in the device tree */
+#define BTRFS_DEV_STATS_OBJECTID 0ULL
+
+/* for storing balance parameters in the root tree */
+#define BTRFS_BALANCE_OBJECTID -4ULL
+
+/* orhpan objectid for tracking unlinked/truncated files */
+#define BTRFS_ORPHAN_OBJECTID -5ULL
+
+/* does write ahead logging to speed up fsyncs */
+#define BTRFS_TREE_LOG_OBJECTID -6ULL
+#define BTRFS_TREE_LOG_FIXUP_OBJECTID -7ULL
+
+/* for space balancing */
+#define BTRFS_TREE_RELOC_OBJECTID -8ULL
+#define BTRFS_DATA_RELOC_TREE_OBJECTID -9ULL
+
+/*
+ * extent checksums all have this objectid
+ * this allows them to share the logging tree
+ * for fsyncs
+ */
+#define BTRFS_EXTENT_CSUM_OBJECTID -10ULL
+
+/* For storing free space cache */
+#define BTRFS_FREE_SPACE_OBJECTID -11ULL
+
+/*
+ * The inode number assigned to the special inode for storing
+ * free ino cache
+ */
+#define BTRFS_FREE_INO_OBJECTID -12ULL
+
+/* dummy objectid represents multiple objectids */
+#define BTRFS_MULTIPLE_OBJECTIDS -255ULL
+
+/*
+ * All files have objectids in this range.
+ */
+#define BTRFS_FIRST_FREE_OBJECTID 256ULL
+#define BTRFS_LAST_FREE_OBJECTID -256ULL
+#define BTRFS_FIRST_CHUNK_TREE_OBJECTID 256ULL
+
+
+/*
+ * the device items go into the chunk tree.  The key is in the form
+ * [ 1 BTRFS_DEV_ITEM_KEY device_id ]
+ */
+#define BTRFS_DEV_ITEMS_OBJECTID 1ULL
+
+#define BTRFS_BTREE_INODE_OBJECTID 1
+
+#define BTRFS_EMPTY_SUBVOL_DIR_OBJECTID 2
+
+#define BTRFS_DEV_REPLACE_DEVID 0ULL
+
+/*
+ * inode items have the data typically returned from stat and store other
+ * info about object characteristics.  There is one for every file and dir in
+ * the FS
+ */
+#define BTRFS_INODE_ITEM_KEY           1
+#define BTRFS_INODE_REF_KEY            12
+#define BTRFS_INODE_EXTREF_KEY         13
+#define BTRFS_XATTR_ITEM_KEY           24
+#define BTRFS_ORPHAN_ITEM_KEY          48
+/* reserve 2-15 close to the inode for later flexibility */
+
+/*
+ * dir items are the name -> inode pointers in a directory.  There is one
+ * for every name in a directory.
+ */
+#define BTRFS_DIR_LOG_ITEM_KEY  60
+#define BTRFS_DIR_LOG_INDEX_KEY 72
+#define BTRFS_DIR_ITEM_KEY     84
+#define BTRFS_DIR_INDEX_KEY    96
+/*
+ * extent data is for file data
+ */
+#define BTRFS_EXTENT_DATA_KEY  108
+
+/*
+ * extent csums are stored in a separate tree and hold csums for
+ * an entire extent on disk.
+ */
+#define BTRFS_EXTENT_CSUM_KEY  128
+
+/*
+ * root items point to tree roots.  They are typically in the root
+ * tree used by the super block to find all the other trees
+ */
+#define BTRFS_ROOT_ITEM_KEY    132
+
+/*
+ * root backrefs tie subvols and snapshots to the directory entries that
+ * reference them
+ */
+#define BTRFS_ROOT_BACKREF_KEY 144
+
+/*
+ * root refs make a fast index for listing all of the snapshots and
+ * subvolumes referenced by a given root.  They point directly to the
+ * directory item in the root that references the subvol
+ */
+#define BTRFS_ROOT_REF_KEY     156
+
+/*
+ * extent items are in the extent map tree.  These record which blocks
+ * are used, and how many references there are to each block
+ */
+#define BTRFS_EXTENT_ITEM_KEY  168
+
+/*
+ * The same as the BTRFS_EXTENT_ITEM_KEY, except it's metadata we already know
+ * the length, so we save the level in key->offset instead of the length.
+ */
+#define BTRFS_METADATA_ITEM_KEY        169
+
+#define BTRFS_TREE_BLOCK_REF_KEY       176
+
+#define BTRFS_EXTENT_DATA_REF_KEY      178
+
+#define BTRFS_EXTENT_REF_V0_KEY                180
+
+#define BTRFS_SHARED_BLOCK_REF_KEY     182
+
+#define BTRFS_SHARED_DATA_REF_KEY      184
+
+/*
+ * block groups give us hints into the extent allocation trees.  Which
+ * blocks are free etc etc
+ */
+#define BTRFS_BLOCK_GROUP_ITEM_KEY 192
+
+/*
+ * Every block group is represented in the free space tree by a free space info
+ * item, which stores some accounting information. It is keyed on
+ * (block_group_start, FREE_SPACE_INFO, block_group_length).
+ */
+#define BTRFS_FREE_SPACE_INFO_KEY 198
+
+/*
+ * A free space extent tracks an extent of space that is free in a block group.
+ * It is keyed on (start, FREE_SPACE_EXTENT, length).
+ */
+#define BTRFS_FREE_SPACE_EXTENT_KEY 199
+
+/*
+ * When a block group becomes very fragmented, we convert it to use bitmaps
+ * instead of extents. A free space bitmap is keyed on
+ * (start, FREE_SPACE_BITMAP, length); the corresponding item is a bitmap with
+ * (length / sectorsize) bits.
+ */
+#define BTRFS_FREE_SPACE_BITMAP_KEY 200
+
+#define BTRFS_DEV_EXTENT_KEY   204
+#define BTRFS_DEV_ITEM_KEY     216
+#define BTRFS_CHUNK_ITEM_KEY   228
+
+/*
+ * Records the overall state of the qgroups.
+ * There's only one instance of this key present,
+ * (0, BTRFS_QGROUP_STATUS_KEY, 0)
+ */
+#define BTRFS_QGROUP_STATUS_KEY         240
+/*
+ * Records the currently used space of the qgroup.
+ * One key per qgroup, (0, BTRFS_QGROUP_INFO_KEY, qgroupid).
+ */
+#define BTRFS_QGROUP_INFO_KEY           242
+/*
+ * Contains the user configured limits for the qgroup.
+ * One key per qgroup, (0, BTRFS_QGROUP_LIMIT_KEY, qgroupid).
+ */
+#define BTRFS_QGROUP_LIMIT_KEY          244
+/*
+ * Records the child-parent relationship of qgroups. For
+ * each relation, 2 keys are present:
+ * (childid, BTRFS_QGROUP_RELATION_KEY, parentid)
+ * (parentid, BTRFS_QGROUP_RELATION_KEY, childid)
+ */
+#define BTRFS_QGROUP_RELATION_KEY       246
+
+/*
+ * Obsolete name, see BTRFS_TEMPORARY_ITEM_KEY.
+ */
+#define BTRFS_BALANCE_ITEM_KEY 248
+
+/*
+ * The key type for tree items that are stored persistently, but do not need to
+ * exist for extended period of time. The items can exist in any tree.
+ *
+ * [subtype, BTRFS_TEMPORARY_ITEM_KEY, data]
+ *
+ * Existing items:
+ *
+ * - balance status item
+ *   (BTRFS_BALANCE_OBJECTID, BTRFS_TEMPORARY_ITEM_KEY, 0)
+ */
+#define BTRFS_TEMPORARY_ITEM_KEY       248
+
+/*
+ * Obsolete name, see BTRFS_PERSISTENT_ITEM_KEY
+ */
+#define BTRFS_DEV_STATS_KEY            249
+
+/*
+ * The key type for tree items that are stored persistently and usually exist
+ * for a long period, eg. filesystem lifetime. The item kinds can be status
+ * information, stats or preference values. The item can exist in any tree.
+ *
+ * [subtype, BTRFS_PERSISTENT_ITEM_KEY, data]
+ *
+ * Existing items:
+ *
+ * - device statistics, store IO stats in the device tree, one key for all
+ *   stats
+ *   (BTRFS_DEV_STATS_OBJECTID, BTRFS_DEV_STATS_KEY, 0)
+ */
+#define BTRFS_PERSISTENT_ITEM_KEY      249
+
+/*
+ * Persistantly stores the device replace state in the device tree.
+ * The key is built like this: (0, BTRFS_DEV_REPLACE_KEY, 0).
+ */
+#define BTRFS_DEV_REPLACE_KEY  250
+
+/*
+ * Stores items that allow to quickly map UUIDs to something else.
+ * These items are part of the filesystem UUID tree.
+ * The key is built like this:
+ * (UUID_upper_64_bits, BTRFS_UUID_KEY*, UUID_lower_64_bits).
+ */
+#if BTRFS_UUID_SIZE != 16
+#error "UUID items require BTRFS_UUID_SIZE == 16!"
+#endif
+#define BTRFS_UUID_KEY_SUBVOL  251     /* for UUIDs assigned to subvols */
+#define BTRFS_UUID_KEY_RECEIVED_SUBVOL 252     /* for UUIDs assigned to
+                                                * received subvols */
+
+/*
+ * string items are for debugging.  They just store a short string of
+ * data in the FS
+ */
+#define BTRFS_STRING_ITEM_KEY  253
+
+
+
+/* 32 bytes in various csum fields */
+#define BTRFS_CSUM_SIZE 32
+
+/* csum types */
+#define BTRFS_CSUM_TYPE_CRC32  0
+
+/*
+ * flags definitions for directory entry item type
+ *
+ * Used by:
+ * struct btrfs_dir_item.type
+ */
+#define BTRFS_FT_UNKNOWN       0
+#define BTRFS_FT_REG_FILE      1
+#define BTRFS_FT_DIR           2
+#define BTRFS_FT_CHRDEV                3
+#define BTRFS_FT_BLKDEV                4
+#define BTRFS_FT_FIFO          5
+#define BTRFS_FT_SOCK          6
+#define BTRFS_FT_SYMLINK       7
+#define BTRFS_FT_XATTR         8
+#define BTRFS_FT_MAX           9
+
+/*
+ * The key defines the order in the tree, and so it also defines (optimal)
+ * block layout.
+ *
+ * objectid corresponds to the inode number.
+ *
+ * type tells us things about the object, and is a kind of stream selector.
+ * so for a given inode, keys with type of 1 might refer to the inode data,
+ * type of 2 may point to file data in the btree and type == 3 may point to
+ * extents.
+ *
+ * offset is the starting byte offset for this key in the stream.
+ */
+
+struct btrfs_key {
+       __u64 objectid;
+       __u8 type;
+       __u64 offset;
+} __attribute__ ((__packed__));
+
+struct btrfs_dev_item {
+       /* the internal btrfs device id */
+       __u64 devid;
+
+       /* size of the device */
+       __u64 total_bytes;
+
+       /* bytes used */
+       __u64 bytes_used;
+
+       /* optimal io alignment for this device */
+       __u32 io_align;
+
+       /* optimal io width for this device */
+       __u32 io_width;
+
+       /* minimal io size for this device */
+       __u32 sector_size;
+
+       /* type and info about this device */
+       __u64 type;
+
+       /* expected generation for this device */
+       __u64 generation;
+
+       /*
+        * starting byte of this partition on the device,
+        * to allow for stripe alignment in the future
+        */
+       __u64 start_offset;
+
+       /* grouping information for allocation decisions */
+       __u32 dev_group;
+
+       /* seek speed 0-100 where 100 is fastest */
+       __u8 seek_speed;
+
+       /* bandwidth 0-100 where 100 is fastest */
+       __u8 bandwidth;
+
+       /* btrfs generated uuid for this device */
+       __u8 uuid[BTRFS_UUID_SIZE];
+
+       /* uuid of FS who owns this device */
+       __u8 fsid[BTRFS_UUID_SIZE];
+} __attribute__ ((__packed__));
+
+struct btrfs_stripe {
+       __u64 devid;
+       __u64 offset;
+       __u8 dev_uuid[BTRFS_UUID_SIZE];
+} __attribute__ ((__packed__));
+
+struct btrfs_chunk {
+       /* size of this chunk in bytes */
+       __u64 length;
+
+       /* objectid of the root referencing this chunk */
+       __u64 owner;
+
+       __u64 stripe_len;
+       __u64 type;
+
+       /* optimal io alignment for this chunk */
+       __u32 io_align;
+
+       /* optimal io width for this chunk */
+       __u32 io_width;
+
+       /* minimal io size for this chunk */
+       __u32 sector_size;
+
+       /* 2^16 stripes is quite a lot, a second limit is the size of a single
+        * item in the btree
+        */
+       __u16 num_stripes;
+
+       /* sub stripes only matter for raid10 */
+       __u16 sub_stripes;
+       struct btrfs_stripe stripe;
+       /* additional stripes go here */
+} __attribute__ ((__packed__));
+
+#define BTRFS_FREE_SPACE_EXTENT        1
+#define BTRFS_FREE_SPACE_BITMAP        2
+
+struct btrfs_free_space_entry {
+       __u64 offset;
+       __u64 bytes;
+       __u8 type;
+} __attribute__ ((__packed__));
+
+struct btrfs_free_space_header {
+       struct btrfs_key location;
+       __u64 generation;
+       __u64 num_entries;
+       __u64 num_bitmaps;
+} __attribute__ ((__packed__));
+
+#define BTRFS_HEADER_FLAG_WRITTEN      (1ULL << 0)
+#define BTRFS_HEADER_FLAG_RELOC                (1ULL << 1)
+
+/* Super block flags */
+/* Errors detected */
+#define BTRFS_SUPER_FLAG_ERROR         (1ULL << 2)
+
+#define BTRFS_SUPER_FLAG_SEEDING       (1ULL << 32)
+#define BTRFS_SUPER_FLAG_METADUMP      (1ULL << 33)
+
+
+/*
+ * items in the extent btree are used to record the objectid of the
+ * owner of the block and the number of references
+ */
+
+struct btrfs_extent_item {
+       __u64 refs;
+       __u64 generation;
+       __u64 flags;
+} __attribute__ ((__packed__));
+
+
+#define BTRFS_EXTENT_FLAG_DATA         (1ULL << 0)
+#define BTRFS_EXTENT_FLAG_TREE_BLOCK   (1ULL << 1)
+
+/* following flags only apply to tree blocks */
+
+/* use full backrefs for extent pointers in the block */
+#define BTRFS_BLOCK_FLAG_FULL_BACKREF  (1ULL << 8)
+
+/*
+ * this flag is only used internally by scrub and may be changed at any time
+ * it is only declared here to avoid collisions
+ */
+#define BTRFS_EXTENT_FLAG_SUPER                (1ULL << 48)
+
+struct btrfs_tree_block_info {
+       struct btrfs_key key;
+       __u8 level;
+} __attribute__ ((__packed__));
+
+struct btrfs_extent_data_ref {
+       __u64 root;
+       __u64 objectid;
+       __u64 offset;
+       __u32 count;
+} __attribute__ ((__packed__));
+
+struct btrfs_shared_data_ref {
+       __u32 count;
+} __attribute__ ((__packed__));
+
+struct btrfs_extent_inline_ref {
+       __u8 type;
+       __u64 offset;
+} __attribute__ ((__packed__));
+
+/* dev extents record free space on individual devices.  The owner
+ * field points back to the chunk allocation mapping tree that allocated
+ * the extent.  The chunk tree uuid field is a way to double check the owner
+ */
+struct btrfs_dev_extent {
+       __u64 chunk_tree;
+       __u64 chunk_objectid;
+       __u64 chunk_offset;
+       __u64 length;
+       __u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
+} __attribute__ ((__packed__));
+
+struct btrfs_inode_ref {
+       __u64 index;
+       __u16 name_len;
+       /* name goes here */
+} __attribute__ ((__packed__));
+
+struct btrfs_inode_extref {
+       __u64 parent_objectid;
+       __u64 index;
+       __u16 name_len;
+       __u8   name[0];
+       /* name goes here */
+} __attribute__ ((__packed__));
+
+struct btrfs_timespec {
+       __u64 sec;
+       __u32 nsec;
+} __attribute__ ((__packed__));
+
+struct btrfs_inode_item {
+       /* nfs style generation number */
+       __u64 generation;
+       /* transid that last touched this inode */
+       __u64 transid;
+       __u64 size;
+       __u64 nbytes;
+       __u64 block_group;
+       __u32 nlink;
+       __u32 uid;
+       __u32 gid;
+       __u32 mode;
+       __u64 rdev;
+       __u64 flags;
+
+       /* modification sequence number for NFS */
+       __u64 sequence;
+
+       /*
+        * a little future expansion, for more than this we can
+        * just grow the inode item and version it
+        */
+       __u64 reserved[4];
+       struct btrfs_timespec atime;
+       struct btrfs_timespec ctime;
+       struct btrfs_timespec mtime;
+       struct btrfs_timespec otime;
+} __attribute__ ((__packed__));
+
+struct btrfs_dir_log_item {
+       __u64 end;
+} __attribute__ ((__packed__));
+
+struct btrfs_dir_item {
+       struct btrfs_key location;
+       __u64 transid;
+       __u16 data_len;
+       __u16 name_len;
+       __u8 type;
+} __attribute__ ((__packed__));
+
+#define BTRFS_ROOT_SUBVOL_RDONLY       (1ULL << 0)
+
+/*
+ * Internal in-memory flag that a subvolume has been marked for deletion but
+ * still visible as a directory
+ */
+#define BTRFS_ROOT_SUBVOL_DEAD         (1ULL << 48)
+
+struct btrfs_root_item {
+       struct btrfs_inode_item inode;
+       __u64 generation;
+       __u64 root_dirid;
+       __u64 bytenr;
+       __u64 byte_limit;
+       __u64 bytes_used;
+       __u64 last_snapshot;
+       __u64 flags;
+       __u32 refs;
+       struct btrfs_key drop_progress;
+       __u8 drop_level;
+       __u8 level;
+
+       /*
+        * The following fields appear after subvol_uuids+subvol_times
+        * were introduced.
+        */
+
+       /*
+        * This generation number is used to test if the new fields are valid
+        * and up to date while reading the root item. Every time the root item
+        * is written out, the "generation" field is copied into this field. If
+        * anyone ever mounted the fs with an older kernel, we will have
+        * mismatching generation values here and thus must invalidate the
+        * new fields. See btrfs_update_root and btrfs_find_last_root for
+        * details.
+        * the offset of generation_v2 is also used as the start for the memset
+        * when invalidating the fields.
+        */
+       __u64 generation_v2;
+       __u8 uuid[BTRFS_UUID_SIZE];
+       __u8 parent_uuid[BTRFS_UUID_SIZE];
+       __u8 received_uuid[BTRFS_UUID_SIZE];
+       __u64 ctransid; /* updated when an inode changes */
+       __u64 otransid; /* trans when created */
+       __u64 stransid; /* trans when sent. non-zero for received subvol */
+       __u64 rtransid; /* trans when received. non-zero for received subvol */
+       struct btrfs_timespec ctime;
+       struct btrfs_timespec otime;
+       struct btrfs_timespec stime;
+       struct btrfs_timespec rtime;
+       __u64 reserved[8]; /* for future */
+} __attribute__ ((__packed__));
+
+/*
+ * this is used for both forward and backward root refs
+ */
+struct btrfs_root_ref {
+       __u64 dirid;
+       __u64 sequence;
+       __u16 name_len;
+} __attribute__ ((__packed__));
+
+#define BTRFS_FILE_EXTENT_INLINE 0
+#define BTRFS_FILE_EXTENT_REG 1
+#define BTRFS_FILE_EXTENT_PREALLOC 2
+
+enum btrfs_compression_type {
+       BTRFS_COMPRESS_NONE  = 0,
+       BTRFS_COMPRESS_ZLIB  = 1,
+       BTRFS_COMPRESS_LZO   = 2,
+       BTRFS_COMPRESS_TYPES = 2,
+       BTRFS_COMPRESS_LAST  = 3,
+};
+
+struct btrfs_file_extent_item {
+       /*
+        * transaction id that created this extent
+        */
+       __u64 generation;
+       /*
+        * max number of bytes to hold this extent in ram
+        * when we split a compressed extent we can't know how big
+        * each of the resulting pieces will be.  So, this is
+        * an upper limit on the size of the extent in ram instead of
+        * an exact limit.
+        */
+       __u64 ram_bytes;
+
+       /*
+        * 32 bits for the various ways we might encode the data,
+        * including compression and encryption.  If any of these
+        * are set to something a given disk format doesn't understand
+        * it is treated like an incompat flag for reading and writing,
+        * but not for stat.
+        */
+       __u8 compression;
+       __u8 encryption;
+       __u16 other_encoding; /* spare for later use */
+
+       /* are we inline data or a real extent? */
+       __u8 type;
+
+       /*
+        * disk space consumed by the extent, checksum blocks are included
+        * in these numbers
+        *
+        * At this offset in the structure, the inline extent data start.
+        */
+       __u64 disk_bytenr;
+       __u64 disk_num_bytes;
+       /*
+        * the logical offset in file blocks (no csums)
+        * this extent record is for.  This allows a file extent to point
+        * into the middle of an existing extent on disk, sharing it
+        * between two snapshots (useful if some bytes in the middle of the
+        * extent have changed
+        */
+       __u64 offset;
+       /*
+        * the logical number of file blocks (no csums included).  This
+        * always reflects the size uncompressed and without encoding.
+        */
+       __u64 num_bytes;
+
+} __attribute__ ((__packed__));
+
+struct btrfs_csum_item {
+       __u8 csum;
+} __attribute__ ((__packed__));
+
+/* different types of block groups (and chunks) */
+#define BTRFS_BLOCK_GROUP_DATA         (1ULL << 0)
+#define BTRFS_BLOCK_GROUP_SYSTEM       (1ULL << 1)
+#define BTRFS_BLOCK_GROUP_METADATA     (1ULL << 2)
+#define BTRFS_BLOCK_GROUP_RAID0                (1ULL << 3)
+#define BTRFS_BLOCK_GROUP_RAID1                (1ULL << 4)
+#define BTRFS_BLOCK_GROUP_DUP          (1ULL << 5)
+#define BTRFS_BLOCK_GROUP_RAID10       (1ULL << 6)
+#define BTRFS_BLOCK_GROUP_RAID5         (1ULL << 7)
+#define BTRFS_BLOCK_GROUP_RAID6         (1ULL << 8)
+#define BTRFS_BLOCK_GROUP_RESERVED     (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \
+                                        BTRFS_SPACE_INFO_GLOBAL_RSV)
+
+enum btrfs_raid_types {
+       BTRFS_RAID_RAID10,
+       BTRFS_RAID_RAID1,
+       BTRFS_RAID_DUP,
+       BTRFS_RAID_RAID0,
+       BTRFS_RAID_SINGLE,
+       BTRFS_RAID_RAID5,
+       BTRFS_RAID_RAID6,
+       BTRFS_NR_RAID_TYPES
+};
+
+#define BTRFS_BLOCK_GROUP_TYPE_MASK    (BTRFS_BLOCK_GROUP_DATA |    \
+                                        BTRFS_BLOCK_GROUP_SYSTEM |  \
+                                        BTRFS_BLOCK_GROUP_METADATA)
+
+#define BTRFS_BLOCK_GROUP_PROFILE_MASK (BTRFS_BLOCK_GROUP_RAID0 |   \
+                                        BTRFS_BLOCK_GROUP_RAID1 |   \
+                                        BTRFS_BLOCK_GROUP_RAID5 |   \
+                                        BTRFS_BLOCK_GROUP_RAID6 |   \
+                                        BTRFS_BLOCK_GROUP_DUP |     \
+                                        BTRFS_BLOCK_GROUP_RAID10)
+#define BTRFS_BLOCK_GROUP_RAID56_MASK  (BTRFS_BLOCK_GROUP_RAID5 |   \
+                                        BTRFS_BLOCK_GROUP_RAID6)
+
+/*
+ * We need a bit for restriper to be able to tell when chunks of type
+ * SINGLE are available.  This "extended" profile format is used in
+ * fs_info->avail_*_alloc_bits (in-memory) and balance item fields
+ * (on-disk).  The corresponding on-disk bit in chunk.type is reserved
+ * to avoid remappings between two formats in future.
+ */
+#define BTRFS_AVAIL_ALLOC_BIT_SINGLE   (1ULL << 48)
+
+/*
+ * A fake block group type that is used to communicate global block reserve
+ * size to userspace via the SPACE_INFO ioctl.
+ */
+#define BTRFS_SPACE_INFO_GLOBAL_RSV    (1ULL << 49)
+
+#define BTRFS_EXTENDED_PROFILE_MASK    (BTRFS_BLOCK_GROUP_PROFILE_MASK | \
+                                        BTRFS_AVAIL_ALLOC_BIT_SINGLE)
+
+#endif /* __BTRFS_BTRFS_TREE_H__ */
diff --git a/fs/btrfs/chunk-map.c b/fs/btrfs/chunk-map.c
new file mode 100644 (file)
index 0000000..48407f3
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+#include <malloc.h>
+
+struct chunk_map_item {
+       struct rb_node node;
+       u64 logical;
+       u64 length;
+       u64 physical;
+};
+
+static int add_chunk_mapping(struct btrfs_key *key, struct btrfs_chunk *chunk)
+{
+       struct btrfs_stripe *stripe;
+       u64 block_profile = chunk->type & BTRFS_BLOCK_GROUP_PROFILE_MASK;
+       struct rb_node **new = &(btrfs_info.chunks_root.rb_node), *prnt = NULL;
+       struct chunk_map_item *map_item;
+
+       if (block_profile && block_profile != BTRFS_BLOCK_GROUP_DUP) {
+               printf("%s: unsupported chunk profile %llu\n", __func__,
+                      block_profile);
+               return -1;
+       } else if (!chunk->length) {
+               printf("%s: zero length chunk\n", __func__);
+               return -1;
+       }
+
+       stripe = &chunk->stripe;
+       btrfs_stripe_to_cpu(stripe);
+
+       while (*new) {
+               struct chunk_map_item *this;
+
+               this = rb_entry(*new, struct chunk_map_item, node);
+
+               prnt = *new;
+               if (key->offset < this->logical) {
+                       new = &((*new)->rb_left);
+               } else if (key->offset > this->logical) {
+                       new = &((*new)->rb_right);
+               } else {
+                       debug("%s: Logical address %llu already in map!\n",
+                             __func__, key->offset);
+                       return 0;
+               }
+       }
+
+       map_item = malloc(sizeof(struct chunk_map_item));
+       if (!map_item)
+               return -1;
+
+       map_item->logical = key->offset;
+       map_item->length = chunk->length;
+       map_item->physical = le64_to_cpu(chunk->stripe.offset);
+       rb_link_node(&map_item->node, prnt, new);
+       rb_insert_color(&map_item->node, &btrfs_info.chunks_root);
+
+       debug("%s: Mapping %llu to %llu\n", __func__, map_item->logical,
+             map_item->physical);
+
+       return 0;
+}
+
+u64 btrfs_map_logical_to_physical(u64 logical)
+{
+       struct rb_node *node = btrfs_info.chunks_root.rb_node;
+
+       while (node) {
+               struct chunk_map_item *item;
+
+               item = rb_entry(node, struct chunk_map_item, node);
+
+               if (item->logical > logical)
+                       node = node->rb_left;
+               else if (logical > item->logical + item->length)
+                       node = node->rb_right;
+               else
+                       return item->physical + logical - item->logical;
+       }
+
+       printf("%s: Cannot map logical address %llu to physical\n", __func__,
+              logical);
+
+       return -1ULL;
+}
+
+void btrfs_chunk_map_exit(void)
+{
+       struct rb_node *now, *next;
+       struct chunk_map_item *item;
+
+       for (now = rb_first_postorder(&btrfs_info.chunks_root); now; now = next)
+       {
+               item = rb_entry(now, struct chunk_map_item, node);
+               next = rb_next_postorder(now);
+               free(item);
+       }
+}
+
+int btrfs_chunk_map_init(void)
+{
+       u8 sys_chunk_array_copy[sizeof(btrfs_info.sb.sys_chunk_array)];
+       u8 * const start = sys_chunk_array_copy;
+       u8 * const end = start + btrfs_info.sb.sys_chunk_array_size;
+       u8 *cur;
+       struct btrfs_key *key;
+       struct btrfs_chunk *chunk;
+
+       btrfs_info.chunks_root = RB_ROOT;
+
+       memcpy(sys_chunk_array_copy, btrfs_info.sb.sys_chunk_array,
+              sizeof(sys_chunk_array_copy));
+
+       for (cur = start; cur < end;) {
+               key = (struct btrfs_key *) cur;
+               cur += sizeof(struct btrfs_key);
+               chunk = (struct btrfs_chunk *) cur;
+
+               btrfs_key_to_cpu(key);
+               btrfs_chunk_to_cpu(chunk);
+
+               if (key->type != BTRFS_CHUNK_ITEM_KEY) {
+                       printf("%s: invalid key type %u\n", __func__,
+                              key->type);
+                       return -1;
+               }
+
+               if (add_chunk_mapping(key, chunk))
+                       return -1;
+
+               cur += sizeof(struct btrfs_chunk);
+               cur += sizeof(struct btrfs_stripe) * (chunk->num_stripes - 1);
+       }
+
+       return 0;
+}
+
+int btrfs_read_chunk_tree(void)
+{
+       struct btrfs_path path;
+       struct btrfs_key key, *found_key;
+       struct btrfs_chunk *chunk;
+       int res;
+
+       key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
+       key.type = BTRFS_CHUNK_ITEM_KEY;
+       key.offset = 0;
+
+       if (btrfs_search_tree(&btrfs_info.chunk_root, &key, &path))
+               return -1;
+
+       do {
+               found_key = btrfs_path_leaf_key(&path);
+               if (btrfs_comp_keys_type(&key, found_key))
+                       break;
+
+               chunk = btrfs_path_item_ptr(&path, struct btrfs_chunk);
+               btrfs_chunk_to_cpu(chunk);
+               if (add_chunk_mapping(found_key, chunk)) {
+                       res = -1;
+                       break;
+               }
+       } while (!(res = btrfs_next_slot(&path)));
+
+       btrfs_free_path(&path);
+
+       if (res < 0)
+               return -1;
+
+       return 0;
+}
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
new file mode 100644 (file)
index 0000000..a59ff5a
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+#include <linux/lzo.h>
+#include <u-boot/zlib.h>
+
+static u32 decompress_lzo(const u8 *cbuf, u32 clen, u8 *dbuf, u32 dlen)
+{
+       u32 tot_len, in_len, res;
+       size_t out_len;
+       int ret;
+
+       if (clen < 4)
+               return -1;
+
+       tot_len = le32_to_cpu(*(u32 *) cbuf);
+       cbuf += 4;
+       clen -= 4;
+       tot_len -= 4;
+
+       if (tot_len == 0 && dlen)
+               return -1;
+       if (tot_len < 4)
+               return -1;
+
+       res = 0;
+
+       while (tot_len > 4) {
+               in_len = le32_to_cpu(*(u32 *) cbuf);
+               cbuf += 4;
+               clen -= 4;
+
+               if (in_len > clen || tot_len < 4 + in_len)
+                       return -1;
+
+               tot_len -= 4 + in_len;
+
+               out_len = dlen;
+               ret = lzo1x_decompress_safe(cbuf, in_len, dbuf, &out_len);
+               if (ret != LZO_E_OK)
+                       return -1;
+
+               cbuf += in_len;
+               clen -= in_len;
+               dbuf += out_len;
+               dlen -= out_len;
+
+               res += out_len;
+       }
+
+       return res;
+}
+
+/* from zutil.h */
+#define PRESET_DICT 0x20
+
+static u32 decompress_zlib(const u8 *_cbuf, u32 clen, u8 *dbuf, u32 dlen)
+{
+       int wbits = MAX_WBITS, ret = -1;
+       z_stream stream;
+       u8 *cbuf;
+       u32 res;
+
+       memset(&stream, 0, sizeof(stream));
+
+       cbuf = (u8 *) _cbuf;
+
+       stream.total_in = 0;
+
+       stream.next_out = dbuf;
+       stream.avail_out = dlen;
+       stream.total_out = 0;
+
+       /* skip adler32 check if deflate and no dictionary */
+       if (clen > 2 && !(cbuf[1] & PRESET_DICT) &&
+           ((cbuf[0] & 0x0f) == Z_DEFLATED) &&
+           !(((cbuf[0] << 8) + cbuf[1]) % 31)) {
+               wbits = -((cbuf[0] >> 4) + 8);
+               cbuf += 2;
+               clen -= 2;
+       }
+
+       if (Z_OK != inflateInit2(&stream, wbits))
+               return -1;
+
+       while (stream.total_in < clen) {
+               stream.next_in = cbuf + stream.total_in;
+               stream.avail_in = min((u32) (clen - stream.total_in),
+                                     (u32) btrfs_info.sb.sectorsize);
+
+               ret = inflate(&stream, Z_NO_FLUSH);
+               if (ret != Z_OK)
+                       break;
+       }
+
+       res = stream.total_out;
+       inflateEnd(&stream);
+
+       if (ret != Z_STREAM_END)
+               return -1;
+
+       return res;
+}
+
+u32 btrfs_decompress(u8 type, const char *c, u32 clen, char *d, u32 dlen)
+{
+       u32 res;
+       const u8 *cbuf;
+       u8 *dbuf;
+
+       cbuf = (const u8 *) c;
+       dbuf = (u8 *) d;
+
+       switch (type) {
+       case BTRFS_COMPRESS_NONE:
+               res = dlen < clen ? dlen : clen;
+               memcpy(dbuf, cbuf, res);
+               return res;
+       case BTRFS_COMPRESS_ZLIB:
+               return decompress_zlib(cbuf, clen, dbuf, dlen);
+       case BTRFS_COMPRESS_LZO:
+               return decompress_lzo(cbuf, clen, dbuf, dlen);
+       default:
+               printf("%s: Unsupported compression in extent: %i\n", __func__,
+                      type);
+               return -1;
+       }
+}
diff --git a/fs/btrfs/conv-funcs.h b/fs/btrfs/conv-funcs.h
new file mode 100644 (file)
index 0000000..f2e7944
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * Functions to convert BTRFS structures from disk to CPU endianness and back.
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __BTRFS_CONV_FUNCS_H__
+#define __BTRFS_CONV_FUNCS_H__
+
+#include "ctree.h"
+#include <u-boot/variadic-macro.h>
+#include <asm/byteorder.h>
+
+/* We are using variadic macros and C11 _Generic to achieve compact code.
+
+   We want to define macro DEFINE_CONV(x, ...), where the first argument is the
+   name of the structure for which it shall define conversion functions (the
+   names of the functions shall be x_to_cpu and x_to_disk), and the other
+   arguments are names of the members on which the functions shall do
+   endianness conversion. */
+
+#if defined(__LITTLE_ENDIAN)
+
+/* If the target machine is little endian, the conversion functions do
+   nothing, since the on disk format is little endian. */
+
+# define DEFINE_CONV(n,...)                                    \
+       static inline struct n *n##_to_disk(struct n * r)       \
+       {                                                       \
+               return r;                                       \
+       }                                                       \
+       static inline struct n *n##_to_cpu(struct n * r)        \
+       {                                                       \
+               return r;                                       \
+       }
+
+# define DEFINE_CONV_ALT(n,a,...)                              \
+       static inline struct n *n##_to_disk_##a(struct n * r)   \
+       {                                                       \
+               return r;                                       \
+       }                                                       \
+       static inline struct n *n##_to_cpu_##a(struct n * r)    \
+       {                                                       \
+               return r;                                       \
+       }
+
+#else /* !defined(__LITTLE_ENDIAN) */
+
+/* Some structures contain not only scalar members, but compound types as well
+   (for example, struct btrfs_inode_item contains members of type struct
+   btrfs_timespec.
+
+   For these members we want to call the conversion function recursively, so
+   first we declare the functions taking pointers to this types (these function
+   will be defined later by the DEFINE_CONV macro) and then we define
+   correspond functions taking non-pointers, so that they can be used in the
+   expansion of the _Generic. */
+# define DEFINE_CONV_FOR_STRUCT(n)                             \
+       static inline struct n * n##_to_disk(struct n *);       \
+       static inline struct n * n##_to_cpu(struct n *);        \
+       static inline struct n n##_to_disk_v(struct n x) {      \
+               return *n##_to_disk(&x);                        \
+       }                                                       \
+       static inline struct n n##_to_cpu_v(struct n x) {       \
+               return *n##_to_cpu(&x);                         \
+       }
+
+DEFINE_CONV_FOR_STRUCT(btrfs_key)
+DEFINE_CONV_FOR_STRUCT(btrfs_stripe)
+DEFINE_CONV_FOR_STRUCT(btrfs_timespec)
+DEFINE_CONV_FOR_STRUCT(btrfs_inode_item)
+DEFINE_CONV_FOR_STRUCT(btrfs_root_backup)
+DEFINE_CONV_FOR_STRUCT(btrfs_dev_item)
+
+/* Now define the _Generic for both CPU to LE and LE to CPU */
+# define DEFINE_CONV_CPU_TO_LE(x)                                      \
+       (d->x) = _Generic((d->x),                                       \
+               __u16: cpu_to_le16,                                     \
+               __u32: cpu_to_le32,                                     \
+               __u64: cpu_to_le64,                                     \
+               struct btrfs_key: btrfs_key_to_disk_v,                  \
+               struct btrfs_stripe: btrfs_stripe_to_disk_v,            \
+               struct btrfs_timespec: btrfs_timespec_to_disk_v,        \
+               struct btrfs_inode_item: btrfs_inode_item_to_disk_v,    \
+               struct btrfs_root_backup: btrfs_root_backup_to_disk_v,  \
+               struct btrfs_dev_item: btrfs_dev_item_to_disk_v         \
+               )((d->x));
+
+# define DEFINE_CONV_LE_TO_CPU(x)                                      \
+       (d->x) = _Generic((d->x),                                       \
+               __u16: le16_to_cpu,                                     \
+               __u32: le32_to_cpu,                                     \
+               __u64: le64_to_cpu,                                     \
+               struct btrfs_key: btrfs_key_to_cpu_v,                   \
+               struct btrfs_stripe: btrfs_stripe_to_cpu_v,             \
+               struct btrfs_timespec: btrfs_timespec_to_cpu_v,         \
+               struct btrfs_inode_item: btrfs_inode_item_to_cpu_v,     \
+               struct btrfs_root_backup: btrfs_root_backup_to_cpu_v,   \
+               struct btrfs_dev_item: btrfs_dev_item_to_cpu_v          \
+               )((d->x));
+
+# define DEFINE_CONV_ONE(t,n,m,...)                    \
+       static inline struct t * n(struct t * d) {      \
+               CALL_MACRO_FOR_EACH(m, ##__VA_ARGS__)   \
+               return d;                               \
+       }
+
+/* Finally define the DEFINE_CONV macro */
+# define DEFINE_CONV(n,...) \
+       DEFINE_CONV_ONE(n,n##_to_disk,DEFINE_CONV_CPU_TO_LE,##__VA_ARGS__) \
+       DEFINE_CONV_ONE(n,n##_to_cpu,DEFINE_CONV_LE_TO_CPU,##__VA_ARGS__)
+
+# define DEFINE_CONV_ALT(n,a,...) \
+       DEFINE_CONV_ONE(n,n##_to_disk_##a,DEFINE_CONV_CPU_TO_LE, \
+               ##__VA_ARGS__) \
+       DEFINE_CONV_ONE(n,n##_to_cpu_##a,DEFINE_CONV_LE_TO_CPU,##__VA_ARGS__)
+
+#endif /* !defined(__LITTLE_ENDIAN) */
+
+DEFINE_CONV(btrfs_key, objectid, offset)
+DEFINE_CONV(btrfs_dev_item, devid, total_bytes, bytes_used, io_align, io_width,
+           sector_size, type, generation, start_offset, dev_group)
+DEFINE_CONV(btrfs_stripe, devid, offset)
+DEFINE_CONV(btrfs_chunk, length, owner, stripe_len, type, io_align, io_width,
+           sector_size, num_stripes, sub_stripes)
+DEFINE_CONV(btrfs_free_space_entry, offset, bytes)
+DEFINE_CONV(btrfs_free_space_header, location, generation, num_entries,
+           num_bitmaps)
+DEFINE_CONV(btrfs_extent_item, refs, generation, flags)
+DEFINE_CONV(btrfs_tree_block_info, key)
+DEFINE_CONV(btrfs_extent_data_ref, root, objectid, offset, count)
+DEFINE_CONV(btrfs_shared_data_ref, count)
+DEFINE_CONV(btrfs_extent_inline_ref, offset)
+DEFINE_CONV(btrfs_dev_extent, chunk_tree, chunk_objectid, chunk_offset, length)
+DEFINE_CONV(btrfs_inode_ref, index, name_len)
+DEFINE_CONV(btrfs_inode_extref, parent_objectid, index, name_len)
+DEFINE_CONV(btrfs_timespec, sec, nsec)
+DEFINE_CONV(btrfs_inode_item, generation, transid, size, nbytes, block_group,
+           nlink, uid, gid, mode, rdev, flags, sequence, atime, ctime, mtime,
+           otime)
+DEFINE_CONV(btrfs_dir_log_item, end)
+DEFINE_CONV(btrfs_dir_item, location, transid, data_len, name_len)
+DEFINE_CONV(btrfs_root_item, inode, generation, root_dirid, bytenr, byte_limit,
+           bytes_used, last_snapshot, flags, refs, drop_progress,
+           generation_v2, ctransid, otransid, stransid, rtransid, ctime,
+           otime, stime, rtime)
+DEFINE_CONV(btrfs_root_ref, dirid, sequence, name_len)
+DEFINE_CONV(btrfs_file_extent_item, generation, ram_bytes, other_encoding,
+           disk_bytenr, disk_num_bytes, offset, num_bytes)
+DEFINE_CONV_ALT(btrfs_file_extent_item, inl, generation, ram_bytes,
+               other_encoding)
+DEFINE_CONV(btrfs_dev_replace_item, src_devid, cursor_left, cursor_right,
+           cont_reading_from_srcdev_mode, replace_state, time_started,
+           time_stopped, num_write_errors, num_uncorrectable_read_errors)
+DEFINE_CONV(btrfs_block_group_item, used, chunk_objectid, flags)
+DEFINE_CONV(btrfs_free_space_info, extent_count, flags)
+
+DEFINE_CONV(btrfs_header, bytenr, flags, generation, owner, nritems)
+DEFINE_CONV(btrfs_root_backup, tree_root, tree_root_gen, chunk_root,
+           chunk_root_gen, extent_root, extent_root_gen, fs_root, fs_root_gen,
+           dev_root, dev_root_gen, csum_root, csum_root_gen, total_bytes,
+           bytes_used, num_devices)
+DEFINE_CONV(btrfs_super_block, bytenr, flags, magic, generation, root,
+           chunk_root, log_root, log_root_transid, total_bytes, bytes_used,
+           root_dir_objectid, num_devices, sectorsize, nodesize,
+           __unused_leafsize, stripesize, sys_chunk_array_size,
+           chunk_root_generation, compat_flags, compat_ro_flags,
+           incompat_flags, csum_type, dev_item, cache_generation,
+           uuid_tree_generation, super_roots[0], super_roots[1], 
+           super_roots[2], super_roots[3])
+DEFINE_CONV(btrfs_item, key, offset, size)
+DEFINE_CONV(btrfs_key_ptr, key, blockptr, generation)
+
+#endif /* __BTRFS_CONV_FUNCS_H__ */
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
new file mode 100644 (file)
index 0000000..b13ecb9
--- /dev/null
@@ -0,0 +1,289 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+#include <malloc.h>
+
+int btrfs_comp_keys(struct btrfs_key *a, struct btrfs_key *b)
+{
+       if (a->objectid > b->objectid)
+               return 1;
+       if (a->objectid < b->objectid)
+               return -1;
+       if (a->type > b->type)
+               return 1;
+       if (a->type < b->type)
+               return -1;
+       if (a->offset > b->offset)
+               return 1;
+       if (a->offset < b->offset)
+               return -1;
+       return 0;
+}
+
+int btrfs_comp_keys_type(struct btrfs_key *a, struct btrfs_key *b)
+{
+       if (a->objectid > b->objectid)
+               return 1;
+       if (a->objectid < b->objectid)
+               return -1;
+       if (a->type > b->type)
+               return 1;
+       if (a->type < b->type)
+               return -1;
+       return 0;
+}
+
+static int generic_bin_search(void *addr, int item_size, struct btrfs_key *key,
+                             int max, int *slot)
+{
+       int low = 0, high = max, mid, ret;
+       struct btrfs_key *tmp;
+
+       if (0) {
+               int i;
+               printf("\tsearching %llu %i\n", key->objectid, key->type);
+               for (i = 0; i < max; ++i) {
+                       tmp = (struct btrfs_key *) ((u8 *) addr + i*item_size);
+                       printf("\t\t%llu %i\n", tmp->objectid, tmp->type);
+               }
+               printf("\n");
+       }
+
+       while (low < high) {
+               mid = (low + high) / 2;
+
+               tmp = (struct btrfs_key *) ((u8 *) addr + mid*item_size);
+               ret = btrfs_comp_keys(tmp, key);
+
+               if (ret < 0) {
+                       low = mid + 1;
+               } else if (ret > 0) {
+                       high = mid;
+               } else {
+                       *slot = mid;
+                       return 0;
+               }
+       }
+
+       *slot = low;
+       return 1;
+}
+
+int btrfs_bin_search(union btrfs_tree_node *p, struct btrfs_key *key,
+                    int *slot)
+{
+       void *addr;
+       unsigned long size;
+
+       if (p->header.level) {
+               addr = p->node.ptrs;
+               size = sizeof(struct btrfs_key_ptr);
+       } else {
+               addr = p->leaf.items;
+               size = sizeof(struct btrfs_item);
+       }
+
+       return generic_bin_search(addr, size, key, p->header.nritems, slot);
+}
+
+static void clear_path(struct btrfs_path *p)
+{
+       int i;
+
+       for (i = 0; i < BTRFS_MAX_LEVEL; ++i) {
+               p->nodes[i] = NULL;
+               p->slots[i] = 0;
+       }
+}
+
+void btrfs_free_path(struct btrfs_path *p)
+{
+       int i;
+
+       for (i = 0; i < BTRFS_MAX_LEVEL; ++i) {
+               if (p->nodes[i])
+                       free(p->nodes[i]);
+       }
+
+       clear_path(p);
+}
+
+static int read_tree_node(u64 physical, union btrfs_tree_node **buf)
+{
+       struct btrfs_header hdr;
+       unsigned long size, offset = sizeof(hdr);
+       union btrfs_tree_node *res;
+       u32 i;
+
+       if (!btrfs_devread(physical, sizeof(hdr), &hdr))
+               return -1;
+
+       btrfs_header_to_cpu(&hdr);
+
+       if (hdr.level)
+               size = sizeof(struct btrfs_node)
+                      + hdr.nritems * sizeof(struct btrfs_key_ptr);
+       else
+               size = btrfs_info.sb.nodesize;
+
+       res = malloc(size);
+       if (!res) {
+               debug("%s: malloc failed\n", __func__);
+               return -1;
+       }
+
+       if (!btrfs_devread(physical + offset, size - offset,
+                          ((u8 *) res) + offset)) {
+               free(res);
+               return -1;
+       }
+
+       res->header = hdr;
+       if (hdr.level)
+               for (i = 0; i < hdr.nritems; ++i)
+                       btrfs_key_ptr_to_cpu(&res->node.ptrs[i]);
+       else
+               for (i = 0; i < hdr.nritems; ++i)
+                       btrfs_item_to_cpu(&res->leaf.items[i]);
+
+       *buf = res;
+
+       return 0;
+}
+
+int btrfs_search_tree(const struct btrfs_root *root, struct btrfs_key *key,
+                     struct btrfs_path *p)
+{
+       u8 lvl, prev_lvl;
+       int i, slot, ret;
+       u64 logical, physical;
+       union btrfs_tree_node *buf;
+
+       clear_path(p);
+
+       logical = root->bytenr;
+
+       for (i = 0; i < BTRFS_MAX_LEVEL; ++i) {
+               physical = btrfs_map_logical_to_physical(logical);
+               if (physical == -1ULL)
+                       goto err;
+
+               if (read_tree_node(physical, &buf))
+                       goto err;
+
+               lvl = buf->header.level;
+               if (i && prev_lvl != lvl + 1) {
+                       printf("%s: invalid level in header at %llu\n",
+                              __func__, logical);
+                       goto err;
+               }
+               prev_lvl = lvl;
+
+               ret = btrfs_bin_search(buf, key, &slot);
+               if (ret < 0)
+                       goto err;
+               if (ret && slot > 0 && lvl)
+                       slot -= 1;
+
+               p->slots[lvl] = slot;
+               p->nodes[lvl] = buf;
+
+               if (lvl)
+                       logical = buf->node.ptrs[slot].blockptr;
+               else
+                       break;
+       }
+
+       return 0;
+err:
+       btrfs_free_path(p);
+       return -1;
+}
+
+static int jump_leaf(struct btrfs_path *path, int dir)
+{
+       struct btrfs_path p;
+       u32 slot;
+       int level = 1, from_level, i;
+
+       dir = dir >= 0 ? 1 : -1;
+
+       p = *path;
+
+       while (level < BTRFS_MAX_LEVEL) {
+               if (!p.nodes[level])
+                       return 1;
+
+               slot = p.slots[level];
+               if ((dir > 0 && slot + dir >= p.nodes[level]->header.nritems)
+                   || (dir < 0 && !slot))
+                       level++;
+               else
+                       break;
+       }
+
+       if (level == BTRFS_MAX_LEVEL)
+               return 1;
+
+       p.slots[level] = slot + dir;
+       level--;
+       from_level = level;
+
+       while (level >= 0) {
+               u64 logical, physical;
+
+               slot = p.slots[level + 1];
+               logical = p.nodes[level + 1]->node.ptrs[slot].blockptr;
+               physical = btrfs_map_logical_to_physical(logical);
+               if (physical == -1ULL)
+                       goto err;
+
+               if (read_tree_node(physical, &p.nodes[level]))
+                       goto err;
+
+               if (dir > 0)
+                       p.slots[level] = 0;
+               else
+                       p.slots[level] = p.nodes[level]->header.nritems - 1;
+               level--;
+       }
+
+       /* Free rewritten nodes in path */
+       for (i = 0; i <= from_level; ++i)
+               free(path->nodes[i]);
+
+       *path = p;
+       return 0;
+
+err:
+       /* Free rewritten nodes in p */
+       for (i = level + 1; i <= from_level; ++i)
+               free(p.nodes[i]);
+       return -1;
+}
+
+int btrfs_prev_slot(struct btrfs_path *p)
+{
+       if (!p->slots[0])
+               return jump_leaf(p, -1);
+
+       p->slots[0]--;
+       return 0;
+}
+
+int btrfs_next_slot(struct btrfs_path *p)
+{
+       struct btrfs_leaf *leaf = &p->nodes[0]->leaf;
+
+       if (p->slots[0] >= leaf->header.nritems)
+               return jump_leaf(p, 1);
+
+       p->slots[0]++;
+       return 0;
+}
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
new file mode 100644 (file)
index 0000000..39f4473
--- /dev/null
@@ -0,0 +1,334 @@
+/*
+ * From linux/fs/btrfs/ctree.h
+ *   Copyright (C) 2007,2008 Oracle.  All rights reserved.
+ *
+ * Modified in 2017 by Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __BTRFS_CTREE_H__
+#define __BTRFS_CTREE_H__
+
+#include <common.h>
+#include <compiler.h>
+#include "btrfs_tree.h"
+
+#define BTRFS_MAGIC 0x4D5F53665248425FULL /* ascii _BHRfS_M, no null */
+
+#define BTRFS_MAX_MIRRORS 3
+
+#define BTRFS_MAX_LEVEL 8
+
+#define BTRFS_COMPAT_EXTENT_TREE_V0
+
+/*
+ * the max metadata block size.  This limit is somewhat artificial,
+ * but the memmove costs go through the roof for larger blocks.
+ */
+#define BTRFS_MAX_METADATA_BLOCKSIZE 65536
+
+/*
+ * we can actually store much bigger names, but lets not confuse the rest
+ * of linux
+ */
+#define BTRFS_NAME_LEN 255
+
+/*
+ * Theoretical limit is larger, but we keep this down to a sane
+ * value. That should limit greatly the possibility of collisions on
+ * inode ref items.
+ */
+#define BTRFS_LINK_MAX 65535U
+
+static const int btrfs_csum_sizes[] = { 4 };
+
+/* four bytes for CRC32 */
+#define BTRFS_EMPTY_DIR_SIZE 0
+
+/* ioprio of readahead is set to idle */
+#define BTRFS_IOPRIO_READA (IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0))
+
+#define BTRFS_DIRTY_METADATA_THRESH    SZ_32M
+
+#define BTRFS_MAX_EXTENT_SIZE SZ_128M
+
+/*
+ * File system states
+ */
+#define BTRFS_FS_STATE_ERROR           0
+#define BTRFS_FS_STATE_REMOUNTING      1
+#define BTRFS_FS_STATE_TRANS_ABORTED   2
+#define BTRFS_FS_STATE_DEV_REPLACING   3
+#define BTRFS_FS_STATE_DUMMY_FS_INFO   4
+
+#define BTRFS_BACKREF_REV_MAX          256
+#define BTRFS_BACKREF_REV_SHIFT                56
+#define BTRFS_BACKREF_REV_MASK         (((u64)BTRFS_BACKREF_REV_MAX - 1) << \
+                                        BTRFS_BACKREF_REV_SHIFT)
+
+#define BTRFS_OLD_BACKREF_REV          0
+#define BTRFS_MIXED_BACKREF_REV                1
+
+/*
+ * every tree block (leaf or node) starts with this header.
+ */
+struct btrfs_header {
+       /* these first four must match the super block */
+       __u8 csum[BTRFS_CSUM_SIZE];
+       __u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
+       __u64 bytenr; /* which block this node is supposed to live in */
+       __u64 flags;
+
+       /* allowed to be different from the super from here on down */
+       __u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
+       __u64 generation;
+       __u64 owner;
+       __u32 nritems;
+       __u8 level;
+} __attribute__ ((__packed__));
+
+/*
+ * this is a very generous portion of the super block, giving us
+ * room to translate 14 chunks with 3 stripes each.
+ */
+#define BTRFS_SYSTEM_CHUNK_ARRAY_SIZE 2048
+
+/*
+ * just in case we somehow lose the roots and are not able to mount,
+ * we store an array of the roots from previous transactions
+ * in the super.
+ */
+#define BTRFS_NUM_BACKUP_ROOTS 4
+struct btrfs_root_backup {
+       __u64 tree_root;
+       __u64 tree_root_gen;
+
+       __u64 chunk_root;
+       __u64 chunk_root_gen;
+
+       __u64 extent_root;
+       __u64 extent_root_gen;
+
+       __u64 fs_root;
+       __u64 fs_root_gen;
+
+       __u64 dev_root;
+       __u64 dev_root_gen;
+
+       __u64 csum_root;
+       __u64 csum_root_gen;
+
+       __u64 total_bytes;
+       __u64 bytes_used;
+       __u64 num_devices;
+       /* future */
+       __u64 unused_64[4];
+
+       __u8 tree_root_level;
+       __u8 chunk_root_level;
+       __u8 extent_root_level;
+       __u8 fs_root_level;
+       __u8 dev_root_level;
+       __u8 csum_root_level;
+       /* future and to align */
+       __u8 unused_8[10];
+} __attribute__ ((__packed__));
+
+/*
+ * the super block basically lists the main trees of the FS
+ * it currently lacks any block count etc etc
+ */
+struct btrfs_super_block {
+       __u8 csum[BTRFS_CSUM_SIZE];
+       /* the first 4 fields must match struct btrfs_header */
+       __u8 fsid[BTRFS_FSID_SIZE];    /* FS specific uuid */
+       __u64 bytenr; /* this block number */
+       __u64 flags;
+
+       /* allowed to be different from the btrfs_header from here own down */
+       __u64 magic;
+       __u64 generation;
+       __u64 root;
+       __u64 chunk_root;
+       __u64 log_root;
+
+       /* this will help find the new super based on the log root */
+       __u64 log_root_transid;
+       __u64 total_bytes;
+       __u64 bytes_used;
+       __u64 root_dir_objectid;
+       __u64 num_devices;
+       __u32 sectorsize;
+       __u32 nodesize;
+       __u32 __unused_leafsize;
+       __u32 stripesize;
+       __u32 sys_chunk_array_size;
+       __u64 chunk_root_generation;
+       __u64 compat_flags;
+       __u64 compat_ro_flags;
+       __u64 incompat_flags;
+       __u16 csum_type;
+       __u8 root_level;
+       __u8 chunk_root_level;
+       __u8 log_root_level;
+       struct btrfs_dev_item dev_item;
+
+       char label[BTRFS_LABEL_SIZE];
+
+       __u64 cache_generation;
+       __u64 uuid_tree_generation;
+
+       /* future expansion */
+       __u64 reserved[30];
+       __u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
+       struct btrfs_root_backup super_roots[BTRFS_NUM_BACKUP_ROOTS];
+} __attribute__ ((__packed__));
+
+/*
+ * Compat flags that we support.  If any incompat flags are set other than the
+ * ones specified below then we will fail to mount
+ */
+#define BTRFS_FEATURE_COMPAT_SUPP              0ULL
+#define BTRFS_FEATURE_COMPAT_SAFE_SET          0ULL
+#define BTRFS_FEATURE_COMPAT_SAFE_CLEAR                0ULL
+
+#define BTRFS_FEATURE_COMPAT_RO_SUPP                   \
+       (BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE |      \
+        BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID)
+
+#define BTRFS_FEATURE_COMPAT_RO_SAFE_SET       0ULL
+#define BTRFS_FEATURE_COMPAT_RO_SAFE_CLEAR     0ULL
+
+#define BTRFS_FEATURE_INCOMPAT_SUPP                    \
+       (BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF |         \
+        BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL |        \
+        BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS |          \
+        BTRFS_FEATURE_INCOMPAT_BIG_METADATA |          \
+        BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO |          \
+        BTRFS_FEATURE_INCOMPAT_RAID56 |                \
+        BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF |         \
+        BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA |       \
+        BTRFS_FEATURE_INCOMPAT_NO_HOLES)
+
+#define BTRFS_FEATURE_INCOMPAT_SAFE_SET                        \
+       (BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF)
+#define BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR              0ULL
+
+/*
+ * A leaf is full of items. offset and size tell us where to find
+ * the item in the leaf (relative to the start of the data area)
+ */
+struct btrfs_item {
+       struct btrfs_key key;
+       __u32 offset;
+       __u32 size;
+} __attribute__ ((__packed__));
+
+/*
+ * leaves have an item area and a data area:
+ * [item0, item1....itemN] [free space] [dataN...data1, data0]
+ *
+ * The data is separate from the items to get the keys closer together
+ * during searches.
+ */
+struct btrfs_leaf {
+       struct btrfs_header header;
+       struct btrfs_item items[];
+} __attribute__ ((__packed__));
+
+/*
+ * all non-leaf blocks are nodes, they hold only keys and pointers to
+ * other blocks
+ */
+struct btrfs_key_ptr {
+       struct btrfs_key key;
+       __u64 blockptr;
+       __u64 generation;
+} __attribute__ ((__packed__));
+
+struct btrfs_node {
+       struct btrfs_header header;
+       struct btrfs_key_ptr ptrs[];
+} __attribute__ ((__packed__));
+
+union btrfs_tree_node {
+       struct btrfs_header header;
+       struct btrfs_leaf leaf;
+       struct btrfs_node node;
+};
+
+typedef __u8 u8;
+typedef __u16 u16;
+typedef __u32 u32;
+typedef __u64 u64;
+
+struct btrfs_path {
+       union btrfs_tree_node *nodes[BTRFS_MAX_LEVEL];
+       u32 slots[BTRFS_MAX_LEVEL];
+};
+
+struct btrfs_root {
+       u64 objectid;
+       u64 bytenr;
+       u64 root_dirid;
+};
+
+int btrfs_comp_keys(struct btrfs_key *, struct btrfs_key *);
+int btrfs_comp_keys_type(struct btrfs_key *, struct btrfs_key *);
+int btrfs_bin_search(union btrfs_tree_node *, struct btrfs_key *, int *);
+void btrfs_free_path(struct btrfs_path *);
+int btrfs_search_tree(const struct btrfs_root *, struct btrfs_key *,
+                     struct btrfs_path *);
+int btrfs_prev_slot(struct btrfs_path *);
+int btrfs_next_slot(struct btrfs_path *);
+
+static inline struct btrfs_key *btrfs_path_leaf_key(struct btrfs_path *p) {
+       return &p->nodes[0]->leaf.items[p->slots[0]].key;
+}
+
+static inline struct btrfs_key *
+btrfs_search_tree_key_type(const struct btrfs_root *root, u64 objectid,
+                          u8 type, struct btrfs_path *path)
+{
+       struct btrfs_key key, *res;
+
+       key.objectid = objectid;
+       key.type = type;
+       key.offset = 0;
+
+       if (btrfs_search_tree(root, &key, path))
+               return NULL;
+
+       res = btrfs_path_leaf_key(path);
+       if (btrfs_comp_keys_type(&key, res)) {
+               btrfs_free_path(path);
+               return NULL;
+       }
+
+       return res;
+}
+
+static inline u32 btrfs_path_item_size(struct btrfs_path *p)
+{
+       return p->nodes[0]->leaf.items[p->slots[0]].size;
+}
+
+static inline void *btrfs_leaf_data(struct btrfs_leaf *leaf, u32 slot)
+{
+       return ((u8 *) leaf) + sizeof(struct btrfs_header)
+              + leaf->items[slot].offset;
+}
+
+static inline void *btrfs_path_leaf_data(struct btrfs_path *p)
+{
+       return btrfs_leaf_data(&p->nodes[0]->leaf, p->slots[0]);
+}
+
+#define btrfs_item_ptr(l,s,t)                  \
+       ((t *) btrfs_leaf_data((l),(s)))
+
+#define btrfs_path_item_ptr(p,t)               \
+       ((t *) btrfs_path_leaf_data((p)))
+
+#endif /* __BTRFS_CTREE_H__ */
diff --git a/fs/btrfs/dev.c b/fs/btrfs/dev.c
new file mode 100644 (file)
index 0000000..fd2e9b6
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <compiler.h>
+#include <fs_internal.h>
+
+struct blk_desc *btrfs_blk_desc;
+disk_partition_t *btrfs_part_info;
+
+int btrfs_devread(u64 address, int byte_len, void *buf)
+{
+       lbaint_t sector;
+       int byte_offset;
+
+       sector = address >> btrfs_blk_desc->log2blksz;
+       byte_offset = address % btrfs_blk_desc->blksz;
+
+       return fs_devread(btrfs_blk_desc, btrfs_part_info, sector, byte_offset,
+                         byte_len, buf);
+}
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c
new file mode 100644 (file)
index 0000000..decf86e
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+
+static int verify_dir_item(struct btrfs_dir_item *item, u32 start, u32 total)
+{
+       u16 max_len = BTRFS_NAME_LEN;
+       u32 end;
+
+       if (item->type >= BTRFS_FT_MAX) {
+               printf("%s: invalid dir item type: %i\n", __func__, item->type);
+               return 1;
+       }
+
+       if (item->type == BTRFS_FT_XATTR)
+               max_len = 255; /* XATTR_NAME_MAX */
+
+       end = start + sizeof(*item) + item->name_len;
+       if (item->name_len > max_len || end > total) {
+               printf("%s: invalid dir item name len: %u\n", __func__,
+                      item->name_len);
+               return 1;
+       }
+
+       return 0;
+}
+
+static struct btrfs_dir_item *
+btrfs_match_dir_item_name(struct btrfs_path *path, const char *name,
+                         int name_len)
+{
+       struct btrfs_dir_item *item;
+       u32 total_len, cur = 0, this_len;
+       const char *name_ptr;
+
+       item = btrfs_path_item_ptr(path, struct btrfs_dir_item);
+
+       total_len = btrfs_path_item_size(path);
+
+       while (cur < total_len) {
+               btrfs_dir_item_to_cpu(item);
+               this_len = sizeof(*item) + item->name_len + item->data_len;
+               name_ptr = (const char *) (item + 1);
+
+               if (verify_dir_item(item, cur, total_len))
+                       return NULL;
+               if (item->name_len == name_len && !memcmp(name_ptr, name,
+                                                         name_len))
+                       return item;
+
+               cur += this_len;
+               item = (struct btrfs_dir_item *) ((u8 *) item + this_len);
+       }
+
+       return NULL;
+}
+
+int btrfs_lookup_dir_item(const struct btrfs_root *root, u64 dir,
+                         const char *name, int name_len,
+                         struct btrfs_dir_item *item)
+{
+       struct btrfs_path path;
+       struct btrfs_key key;
+       struct btrfs_dir_item *res = NULL;
+
+       key.objectid = dir;
+       key.type = BTRFS_DIR_ITEM_KEY;
+       key.offset = btrfs_name_hash(name, name_len);
+
+       if (btrfs_search_tree(root, &key, &path))
+               return -1;
+
+       if (btrfs_comp_keys_type(&key, btrfs_path_leaf_key(&path)))
+               goto out;
+
+       res = btrfs_match_dir_item_name(&path, name, name_len);
+       if (res)
+               *item = *res;
+out:
+       btrfs_free_path(&path);
+       return res ? 0 : -1;
+}
+
+int btrfs_readdir(const struct btrfs_root *root, u64 dir,
+                 btrfs_readdir_callback_t callback)
+{
+       struct btrfs_path path;
+       struct btrfs_key key, *found_key;
+       struct btrfs_dir_item *item;
+       int res;
+
+       key.objectid = dir;
+       key.type = BTRFS_DIR_INDEX_KEY;
+       key.offset = 0;
+
+       if (btrfs_search_tree(root, &key, &path))
+               return -1;
+
+       do {
+               found_key = btrfs_path_leaf_key(&path);
+               if (btrfs_comp_keys_type(&key, found_key))
+                       break;
+
+               item = btrfs_path_item_ptr(&path, struct btrfs_dir_item);
+               btrfs_dir_item_to_cpu(item);
+
+               if (verify_dir_item(item, 0, sizeof(*item) + item->name_len))
+                       continue;
+               if (item->type == BTRFS_FT_XATTR)
+                       continue;
+
+               if (callback(root, item))
+                       break;
+       } while (!(res = btrfs_next_slot(&path)));
+
+       btrfs_free_path(&path);
+
+       return res < 0 ? -1 : 0;
+}
diff --git a/fs/btrfs/extent-io.c b/fs/btrfs/extent-io.c
new file mode 100644 (file)
index 0000000..feb9143
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+#include <malloc.h>
+
+u64 btrfs_read_extent_inline(struct btrfs_path *path,
+                            struct btrfs_file_extent_item *extent, u64 offset,
+                            u64 size, char *out)
+{
+       u32 clen, dlen, orig_size = size, res;
+       const char *cbuf;
+       char *dbuf;
+       const int data_off = offsetof(struct btrfs_file_extent_item,
+                                     disk_bytenr);
+
+       clen = btrfs_path_item_size(path) - data_off;
+       cbuf = (const char *) extent + data_off;
+       dlen = extent->ram_bytes;
+
+       if (offset > dlen)
+               return -1ULL;
+
+       if (size > dlen - offset)
+               size = dlen - offset;
+
+       if (extent->compression == BTRFS_COMPRESS_NONE) {
+               memcpy(out, cbuf + offset, size);
+               return size;
+       }
+
+       if (dlen > orig_size) {
+               dbuf = malloc(dlen);
+               if (!dbuf)
+                       return -1ULL;
+       } else {
+               dbuf = out;
+       }
+
+       res = btrfs_decompress(extent->compression, cbuf, clen, dbuf, dlen);
+       if (res == -1 || res != dlen)
+               goto err;
+
+       if (dlen > orig_size) {
+               memcpy(out, dbuf + offset, size);
+               free(dbuf);
+       } else if (offset) {
+               memmove(out, dbuf + offset, size);
+       }
+
+       return size;
+
+err:
+       if (dlen > orig_size)
+               free(dbuf);
+       return -1ULL;
+}
+
+u64 btrfs_read_extent_reg(struct btrfs_path *path,
+                         struct btrfs_file_extent_item *extent, u64 offset,
+                         u64 size, char *out)
+{
+       u64 physical, clen, dlen, orig_size = size;
+       u32 res;
+       char *cbuf, *dbuf;
+
+       clen = extent->disk_num_bytes;
+       dlen = extent->num_bytes;
+
+       if (offset > dlen)
+               return -1ULL;
+
+       if (size > dlen - offset)
+               size = dlen - offset;
+
+       physical = btrfs_map_logical_to_physical(extent->disk_bytenr);
+       if (physical == -1ULL)
+               return -1ULL;
+
+       if (extent->compression == BTRFS_COMPRESS_NONE) {
+               physical += extent->offset + offset;
+               if (!btrfs_devread(physical, size, out))
+                       return -1ULL;
+
+               return size;
+       }
+
+       cbuf = malloc(dlen > size ? clen + dlen : clen);
+       if (!cbuf)
+               return -1ULL;
+
+       if (dlen > orig_size)
+               dbuf = cbuf + clen;
+       else
+               dbuf = out;
+
+       if (!btrfs_devread(physical, clen, cbuf))
+               goto err;
+
+       res = btrfs_decompress(extent->compression, cbuf, clen, dbuf, dlen);
+       if (res == -1)
+               goto err;
+
+       if (dlen > orig_size)
+               memcpy(out, dbuf + offset, size);
+       else
+               memmove(out, dbuf + offset, size);
+
+       free(cbuf);
+       return res;
+
+err:
+       free(cbuf);
+       return -1ULL;
+}
diff --git a/fs/btrfs/hash.c b/fs/btrfs/hash.c
new file mode 100644 (file)
index 0000000..f8a50e5
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+#include <u-boot/crc.h>
+
+static u32 btrfs_crc32c_table[256];
+
+void btrfs_hash_init(void)
+{
+       static int inited = 0;
+
+       if (!inited) {
+               crc32c_init(btrfs_crc32c_table, 0x82F63B78);
+               inited = 1;
+       }
+}
+
+u32 btrfs_crc32c(u32 crc, const void *data, size_t length)
+{
+       return crc32c_cal(crc, (const char *) data, length,
+                         btrfs_crc32c_table);
+}
+
+u32 btrfs_csum_data(char *data, u32 seed, size_t len)
+{
+       return btrfs_crc32c(seed, data, len);
+}
+
+void btrfs_csum_final(u32 crc, void *result)
+{
+       *((u32 *) result) = cpu_to_le32(~crc);
+}
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
new file mode 100644 (file)
index 0000000..0d3da28
--- /dev/null
@@ -0,0 +1,385 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+#include <malloc.h>
+
+u64 btrfs_lookup_inode_ref(struct btrfs_root *root, u64 inr,
+                          struct btrfs_inode_ref *refp, char *name)
+{
+       struct btrfs_path path;
+       struct btrfs_key *key;
+       struct btrfs_inode_ref *ref;
+       u64 res = -1ULL;
+
+       key = btrfs_search_tree_key_type(root, inr, BTRFS_INODE_REF_KEY,
+                                              &path);
+
+       if (!key)
+               return -1ULL;
+
+       ref = btrfs_path_item_ptr(&path, struct btrfs_inode_ref);
+       btrfs_inode_ref_to_cpu(ref);
+
+       if (refp)
+               *refp = *ref;
+
+       if (name) {
+               if (ref->name_len > BTRFS_NAME_MAX) {
+                       printf("%s: inode name too long: %u\n", __func__,
+                               ref->name_len);
+                       goto out;
+               }
+
+               memcpy(name, ref + 1, ref->name_len);
+       }
+
+       res = key->offset;
+out:
+       btrfs_free_path(&path);
+       return res;
+}
+
+int btrfs_lookup_inode(const struct btrfs_root *root,
+                      struct btrfs_key *location,
+                      struct btrfs_inode_item *item,
+                      struct btrfs_root *new_root)
+{
+       struct btrfs_root tmp_root = *root;
+       struct btrfs_path path;
+       int res = -1;
+
+       if (location->type == BTRFS_ROOT_ITEM_KEY) {
+               if (btrfs_find_root(location->objectid, &tmp_root, NULL))
+                       return -1;
+
+               location->objectid = tmp_root.root_dirid;
+               location->type = BTRFS_INODE_ITEM_KEY;
+               location->offset = 0;
+       }
+
+       if (btrfs_search_tree(&tmp_root, location, &path))
+               return res;
+
+       if (btrfs_comp_keys(location, btrfs_path_leaf_key(&path)))
+               goto out;
+
+       if (item) {
+               *item = *btrfs_path_item_ptr(&path, struct btrfs_inode_item);
+               btrfs_inode_item_to_cpu(item);
+       }
+
+       if (new_root)
+               *new_root = tmp_root;
+
+       res = 0;
+
+out:
+       btrfs_free_path(&path);
+       return res;
+}
+
+int btrfs_readlink(const struct btrfs_root *root, u64 inr, char *target)
+{
+       struct btrfs_path path;
+       struct btrfs_key key;
+       struct btrfs_file_extent_item *extent;
+       const char *data_ptr;
+       int res = -1;
+
+       key.objectid = inr;
+       key.type = BTRFS_EXTENT_DATA_KEY;
+       key.offset = 0;
+
+       if (btrfs_search_tree(root, &key, &path))
+               return -1;
+
+       if (btrfs_comp_keys(&key, btrfs_path_leaf_key(&path)))
+               goto out;
+
+       extent = btrfs_path_item_ptr(&path, struct btrfs_file_extent_item);
+       if (extent->type != BTRFS_FILE_EXTENT_INLINE) {
+               printf("%s: Extent for symlink %llu not of INLINE type\n",
+                      __func__, inr);
+               goto out;
+       }
+
+       btrfs_file_extent_item_to_cpu_inl(extent);
+
+       if (extent->compression != BTRFS_COMPRESS_NONE) {
+               printf("%s: Symlink %llu extent data compressed!\n", __func__,
+                      inr);
+               goto out;
+       } else if (extent->encryption != 0) {
+               printf("%s: Symlink %llu extent data encrypted!\n", __func__,
+                      inr);
+               goto out;
+       } else if (extent->ram_bytes >= btrfs_info.sb.sectorsize) {
+               printf("%s: Symlink %llu extent data too long (%llu)!\n",
+                      __func__, inr, extent->ram_bytes);
+               goto out;
+       }
+
+       data_ptr = (const char *) extent
+                  + offsetof(struct btrfs_file_extent_item, disk_bytenr);
+
+       memcpy(target, data_ptr, extent->ram_bytes);
+       target[extent->ram_bytes] = '\0';
+       res = 0;
+out:
+       btrfs_free_path(&path);
+       return res;
+}
+
+/* inr must be a directory (for regular files with multiple hard links this
+   function returns only one of the parents of the file) */
+static u64 get_parent_inode(struct btrfs_root *root, u64 inr,
+                           struct btrfs_inode_item *inode_item)
+{
+       struct btrfs_key key;
+       u64 res;
+
+       if (inr == BTRFS_FIRST_FREE_OBJECTID) {
+               if (root->objectid != btrfs_info.fs_root.objectid) {
+                       u64 parent;
+                       struct btrfs_root_ref ref;
+
+                       parent = btrfs_lookup_root_ref(root->objectid, &ref,
+                                                      NULL);
+                       if (parent == -1ULL)
+                               return -1ULL;
+
+                       if (btrfs_find_root(parent, root, NULL))
+                               return -1ULL;
+
+                       inr = ref.dirid;
+               }
+
+               if (inode_item) {
+                       key.objectid = inr;
+                       key.type = BTRFS_INODE_ITEM_KEY;
+                       key.offset = 0;
+
+                       if (btrfs_lookup_inode(root, &key, inode_item, NULL))
+                               return -1ULL;
+               }
+
+               return inr;
+       }
+
+       res = btrfs_lookup_inode_ref(root, inr, NULL, NULL);
+       if (res == -1ULL)
+               return -1ULL;
+
+       if (inode_item) {
+               key.objectid = res;
+               key.type = BTRFS_INODE_ITEM_KEY;
+               key.offset = 0;
+
+               if (btrfs_lookup_inode(root, &key, inode_item, NULL))
+                       return -1ULL;
+       }
+
+       return res;
+}
+
+static inline int next_length(const char *path)
+{
+       int res = 0;
+       while (*path != '\0' && *path != '/' && res <= BTRFS_NAME_LEN)
+               ++res, ++path;
+       return res;
+}
+
+static inline const char *skip_current_directories(const char *cur)
+{
+       while (1) {
+               if (cur[0] == '/')
+                       ++cur;
+               else if (cur[0] == '.' && cur[1] == '/')
+                       cur += 2;
+               else
+                       break;
+       }
+
+       return cur;
+}
+
+/* inode.c, musi vratit aj root stromu kde sa inoda najde */
+u64 btrfs_lookup_path(struct btrfs_root *root, u64 inr, const char *path,
+                     u8 *type_p, struct btrfs_inode_item *inode_item_p,
+                     int symlink_limit)
+{
+       struct btrfs_dir_item item;
+       struct btrfs_inode_item inode_item;
+       u8 type = BTRFS_FT_DIR;
+       int len, have_inode = 0;
+       const char *cur = path;
+
+       if (*cur == '/') {
+               ++cur;
+               inr = root->root_dirid;
+       }
+
+       do {
+               cur = skip_current_directories(cur);
+
+               len = next_length(cur);
+               if (len > BTRFS_NAME_LEN) {
+                       printf("%s: Name too long at \"%.*s\"\n", __func__,
+                              BTRFS_NAME_LEN, cur);
+                       return -1ULL;
+               }
+
+               if (len == 1 && cur[0] == '.')
+                       break;
+
+               if (len == 2 && cur[0] == '.' && cur[1] == '.') {
+                       cur += 2;
+                       inr = get_parent_inode(root, inr, &inode_item);
+                       if (inr == -1ULL)
+                               return -1ULL;
+
+                       type = BTRFS_FT_DIR;
+                       continue;
+               }
+
+               if (!*cur)
+                       break;
+               
+               if (btrfs_lookup_dir_item(root, inr, cur, len, &item))
+                       return -1ULL;
+
+               type = item.type;
+               have_inode = 1;
+               if (btrfs_lookup_inode(root, &item.location, &inode_item, root))
+                       return -1ULL;
+
+               if (item.type == BTRFS_FT_SYMLINK && symlink_limit >= 0) {
+                       char *target;
+
+                       if (!symlink_limit) {
+                               printf("%s: Too much symlinks!\n", __func__);
+                               return -1ULL;
+                       }
+
+                       target = malloc(min(inode_item.size + 1,
+                                           (u64) btrfs_info.sb.sectorsize));
+                       if (!target)
+                               return -1ULL;
+
+                       if (btrfs_readlink(root, item.location.objectid,
+                                          target)) {
+                               free(target);
+                               return -1ULL;
+                       }
+
+                       inr = btrfs_lookup_path(root, inr, target, &type,
+                                               &inode_item, symlink_limit - 1);
+
+                       free(target);
+
+                       if (inr == -1ULL)
+                               return -1ULL;
+               } else if (item.type != BTRFS_FT_DIR && cur[len]) {
+                       printf("%s: \"%.*s\" not a directory\n", __func__,
+                              (int) (cur - path + len), path);
+                       return -1ULL;
+               } else {
+                       inr = item.location.objectid;
+               }
+
+               cur += len;
+       } while (*cur);
+
+       if (type_p)
+               *type_p = type;
+
+       if (inode_item_p) {
+               if (!have_inode) {
+                       struct btrfs_key key;
+
+                       key.objectid = inr;
+                       key.type = BTRFS_INODE_ITEM_KEY;
+                       key.offset = 0;
+
+                       if (btrfs_lookup_inode(root, &key, &inode_item, NULL))
+                               return -1ULL;
+               }
+
+               *inode_item_p = inode_item;
+       }
+
+       return inr;
+}
+
+u64 btrfs_file_read(const struct btrfs_root *root, u64 inr, u64 offset,
+                   u64 size, char *buf)
+{
+       struct btrfs_path path;
+       struct btrfs_key key;
+       struct btrfs_file_extent_item *extent;
+       int res;
+       u64 rd, rd_all = -1ULL;
+
+       key.objectid = inr;
+       key.type = BTRFS_EXTENT_DATA_KEY;
+       key.offset = offset;
+
+       if (btrfs_search_tree(root, &key, &path))
+               return -1ULL;
+
+       if (btrfs_comp_keys(&key, btrfs_path_leaf_key(&path)) < 0) {
+               if (btrfs_prev_slot(&path))
+                       goto out;
+
+               if (btrfs_comp_keys_type(&key, btrfs_path_leaf_key(&path)))
+                       goto out;
+       }
+
+       rd_all = 0;
+
+       do {
+               if (btrfs_comp_keys_type(&key, btrfs_path_leaf_key(&path)))
+                       break;
+
+               extent = btrfs_path_item_ptr(&path,
+                                            struct btrfs_file_extent_item);
+
+               if (extent->type == BTRFS_FILE_EXTENT_INLINE) {
+                       btrfs_file_extent_item_to_cpu_inl(extent);
+                       rd = btrfs_read_extent_inline(&path, extent, offset,
+                                                     size, buf);
+               } else {
+                       btrfs_file_extent_item_to_cpu(extent);
+                       rd = btrfs_read_extent_reg(&path, extent, offset, size,
+                                                  buf);
+               }
+
+               if (rd == -1ULL) {
+                       printf("%s: Error reading extent\n", __func__);
+                       rd_all = -1;
+                       goto out;
+               }
+
+               offset = 0;
+               buf += rd;
+               rd_all += rd;
+               size -= rd;
+
+               if (!size)
+                       break;
+       } while (!(res = btrfs_next_slot(&path)));
+
+       if (res)
+               return -1ULL;
+
+out:
+       btrfs_free_path(&path);
+       return rd_all;
+}
diff --git a/fs/btrfs/root.c b/fs/btrfs/root.c
new file mode 100644 (file)
index 0000000..c405813
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+
+static void read_root_item(struct btrfs_path *p, struct btrfs_root_item *item)
+{
+       u32 len;
+       int reset = 0;
+
+       len = btrfs_path_item_size(p);
+       memcpy(item, btrfs_path_item_ptr(p, struct btrfs_root_item), len);
+       btrfs_root_item_to_cpu(item);
+
+       if (len < sizeof(*item))
+               reset = 1;
+       if (!reset && item->generation != item->generation_v2) {
+               if (item->generation_v2 != 0)
+                       printf("%s: generation != generation_v2 in root item",
+                              __func__);
+               reset = 1;
+       }
+       if (reset) {
+               memset(&item->generation_v2, 0,
+                      sizeof(*item) - offsetof(struct btrfs_root_item,
+                                               generation_v2));
+       }
+}
+
+int btrfs_find_root(u64 objectid, struct btrfs_root *root,
+                   struct btrfs_root_item *root_item)
+{
+       struct btrfs_path path;
+       struct btrfs_root_item my_root_item;
+
+       if (!btrfs_search_tree_key_type(&btrfs_info.tree_root, objectid,
+                                       BTRFS_ROOT_ITEM_KEY, &path))
+               return -1;
+
+       if (!root_item)
+               root_item = &my_root_item;
+       read_root_item(&path, root_item);
+
+       if (root) {
+               root->objectid = objectid;
+               root->bytenr = root_item->bytenr;
+               root->root_dirid = root_item->root_dirid;
+       }
+
+       btrfs_free_path(&path);
+       return 0;
+}
+
+u64 btrfs_lookup_root_ref(u64 subvolid, struct btrfs_root_ref *refp, char *name)
+{
+       struct btrfs_path path;
+       struct btrfs_key *key;
+       struct btrfs_root_ref *ref;
+       u64 res = -1ULL;
+
+       key = btrfs_search_tree_key_type(&btrfs_info.tree_root, subvolid,
+                                              BTRFS_ROOT_BACKREF_KEY, &path);
+
+       if (!key)
+               return -1ULL;
+
+       ref = btrfs_path_item_ptr(&path, struct btrfs_root_ref);
+       btrfs_root_ref_to_cpu(ref);
+
+       if (refp)
+               *refp = *ref;
+
+       if (name) {
+               if (ref->name_len > BTRFS_VOL_NAME_MAX) {
+                       printf("%s: volume name too long: %u\n", __func__,
+                              ref->name_len);
+                       goto out;
+               }
+
+               memcpy(name, ref + 1, ref->name_len);
+       }
+
+       res = key->offset;
+out:
+       btrfs_free_path(&path);
+       return res;
+}
+
diff --git a/fs/btrfs/subvolume.c b/fs/btrfs/subvolume.c
new file mode 100644 (file)
index 0000000..54e0ab4
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+#include <malloc.h>
+
+static int get_subvol_name(u64 subvolid, char *name, int max_len)
+{
+       struct btrfs_root_ref rref;
+       struct btrfs_inode_ref iref;
+       struct btrfs_root root;
+       u64 dir;
+       char tmp[max(BTRFS_VOL_NAME_MAX, BTRFS_NAME_MAX)];
+       char *ptr;
+
+       ptr = name + max_len - 1;
+       *ptr = '\0';
+
+       while (subvolid != BTRFS_FS_TREE_OBJECTID) {
+               subvolid = btrfs_lookup_root_ref(subvolid, &rref, tmp);
+
+               if (subvolid == -1ULL)
+                       return -1;
+
+               ptr -= rref.name_len + 1;
+               if (ptr < name)
+                       goto too_long;
+
+               memcpy(ptr + 1, tmp, rref.name_len);
+               *ptr = '/';
+
+               if (btrfs_find_root(subvolid, &root, NULL))
+                       return -1;
+
+               dir = rref.dirid;
+
+               while (dir != BTRFS_FIRST_FREE_OBJECTID) {
+                       dir = btrfs_lookup_inode_ref(&root, dir, &iref, tmp);
+
+                       if (dir == -1ULL)
+                               return -1;
+
+                       ptr -= iref.name_len + 1;
+                       if (ptr < name)
+                               goto too_long;
+
+                       memcpy(ptr + 1, tmp, iref.name_len);
+                       *ptr = '/';
+               }
+       }
+
+       if (ptr == name + max_len - 1) {
+               name[0] = '/';
+               name[1] = '\0';
+       } else {
+               memmove(name, ptr, name + max_len - ptr);
+       }
+
+       return 0;
+
+too_long:
+       printf("%s: subvolume name too long\n", __func__);
+       return -1;
+}
+
+u64 btrfs_get_default_subvol_objectid(void)
+{
+       struct btrfs_dir_item item;
+
+       if (btrfs_lookup_dir_item(&btrfs_info.tree_root,
+                                 btrfs_info.sb.root_dir_objectid, "default", 7,
+                                 &item))
+               return BTRFS_FS_TREE_OBJECTID;
+       return item.location.objectid;
+}
+
+static void list_subvols(u64 tree, char *nameptr, int max_name_len, int level)
+{
+       struct btrfs_key key, *found_key;
+       struct btrfs_path path;
+       struct btrfs_root_ref *ref;
+       int res;
+
+       key.objectid = tree;
+       key.type = BTRFS_ROOT_REF_KEY;
+       key.offset = 0;
+
+       if (btrfs_search_tree(&btrfs_info.tree_root, &key, &path))
+               return;
+
+       do {
+               found_key = btrfs_path_leaf_key(&path);
+               if (btrfs_comp_keys_type(&key, found_key))
+                       break;
+
+               ref = btrfs_path_item_ptr(&path, struct btrfs_root_ref);
+               btrfs_root_ref_to_cpu(ref);
+
+               printf("ID %llu parent %llu name ", found_key->offset, tree);
+               if (nameptr && !get_subvol_name(found_key->offset, nameptr,
+                                               max_name_len))
+                       printf("%s\n", nameptr);
+               else
+                       printf("%.*s\n", (int) ref->name_len,
+                              (const char *) (ref + 1));
+
+               if (level > 0)
+                       list_subvols(found_key->offset, nameptr, max_name_len,
+                                    level - 1);
+               else
+                       printf("%s: Too much recursion, maybe skipping some "
+                              "subvolumes\n", __func__);
+       } while (!(res = btrfs_next_slot(&path)));
+
+       btrfs_free_path(&path);
+}
+
+void btrfs_list_subvols(void)
+{
+       char *nameptr = malloc(4096);
+
+       list_subvols(BTRFS_FS_TREE_OBJECTID, nameptr, nameptr ? 4096 : 0, 40);
+
+       if (nameptr)
+               free(nameptr);
+}
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
new file mode 100644 (file)
index 0000000..2529c2b
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include "btrfs.h"
+
+#define BTRFS_SUPER_FLAG_SUPP  (BTRFS_HEADER_FLAG_WRITTEN      \
+                                | BTRFS_HEADER_FLAG_RELOC      \
+                                | BTRFS_SUPER_FLAG_ERROR       \
+                                | BTRFS_SUPER_FLAG_SEEDING     \
+                                | BTRFS_SUPER_FLAG_METADUMP)
+
+#define BTRFS_SUPER_INFO_SIZE  4096
+
+static int btrfs_newest_root_backup(struct btrfs_super_block *sb)
+{
+       struct btrfs_root_backup *root_backup;
+       int i, newest = -1;
+
+       for (i = 0; i < BTRFS_NUM_BACKUP_ROOTS; ++i) {
+               root_backup = sb->super_roots + i;
+               if (root_backup->tree_root_gen == sb->generation)
+                       newest = i;
+       }
+
+       return newest;
+}
+
+static inline int is_power_of_2(u64 x)
+{
+       return !(x & (x - 1));
+}
+
+static int btrfs_check_super_csum(char *raw_disk_sb)
+{
+       struct btrfs_super_block *disk_sb =
+               (struct btrfs_super_block *) raw_disk_sb;
+       u16 csum_type = le16_to_cpu(disk_sb->csum_type);
+
+       if (csum_type == BTRFS_CSUM_TYPE_CRC32) {
+               u32 crc = ~(u32) 0;
+               const int csum_size = sizeof(crc);
+               char result[csum_size];
+
+               crc = btrfs_csum_data(raw_disk_sb + BTRFS_CSUM_SIZE, crc,
+                                     BTRFS_SUPER_INFO_SIZE - BTRFS_CSUM_SIZE);
+               btrfs_csum_final(crc, result);
+
+               if (memcmp(raw_disk_sb, result, csum_size))
+                       return -1;
+       } else {
+               return -1;
+       }
+
+       return 0;
+}
+
+static int btrfs_check_super(struct btrfs_super_block *sb)
+{
+       int ret = 0;
+
+       if (sb->flags & ~BTRFS_SUPER_FLAG_SUPP) {
+               printf("%s: Unsupported flags: %llu\n", __func__,
+                      sb->flags & ~BTRFS_SUPER_FLAG_SUPP);
+       }
+
+       if (sb->root_level > BTRFS_MAX_LEVEL) {
+               printf("%s: tree_root level too big: %d >= %d\n", __func__,
+                      sb->root_level, BTRFS_MAX_LEVEL);
+               ret = -1;
+       }
+
+       if (sb->chunk_root_level > BTRFS_MAX_LEVEL) {
+               printf("%s: chunk_root level too big: %d >= %d\n", __func__,
+                      sb->chunk_root_level, BTRFS_MAX_LEVEL);
+               ret = -1;
+       }
+
+       if (sb->log_root_level > BTRFS_MAX_LEVEL) {
+               printf("%s: log_root level too big: %d >= %d\n", __func__,
+                      sb->log_root_level, BTRFS_MAX_LEVEL);
+               ret = -1;
+       }
+
+       if (!is_power_of_2(sb->sectorsize) || sb->sectorsize < 4096 ||
+           sb->sectorsize > BTRFS_MAX_METADATA_BLOCKSIZE) {
+               printf("%s: invalid sectorsize %u\n", __func__,
+                      sb->sectorsize);
+               ret = -1;
+       }
+
+       if (!is_power_of_2(sb->nodesize) || sb->nodesize < sb->sectorsize ||
+           sb->nodesize > BTRFS_MAX_METADATA_BLOCKSIZE) {
+               printf("%s: invalid nodesize %u\n", __func__, sb->nodesize);
+               ret = -1;
+       }
+
+       if (sb->nodesize != sb->__unused_leafsize) {
+               printf("%s: invalid leafsize %u, should be %u\n", __func__,
+                      sb->__unused_leafsize, sb->nodesize);
+               ret = -1;
+       }
+
+       if (!IS_ALIGNED(sb->root, sb->sectorsize)) {
+               printf("%s: tree_root block unaligned: %llu\n", __func__,
+                      sb->root);
+               ret = -1;
+       }
+
+       if (!IS_ALIGNED(sb->chunk_root, sb->sectorsize)) {
+               printf("%s: chunk_root block unaligned: %llu\n", __func__,
+                      sb->chunk_root);
+               ret = -1;
+       }
+
+       if (!IS_ALIGNED(sb->log_root, sb->sectorsize)) {
+               printf("%s: log_root block unaligned: %llu\n", __func__,
+                      sb->log_root);
+               ret = -1;
+       }
+
+       if (memcmp(sb->fsid, sb->dev_item.fsid, BTRFS_UUID_SIZE) != 0) {
+               printf("%s: dev_item UUID does not match fsid\n", __func__);
+               ret = -1;
+       }
+
+       if (sb->bytes_used < 6*sb->nodesize) {
+               printf("%s: bytes_used is too small %llu\n", __func__,
+                      sb->bytes_used);
+               ret = -1;
+       }
+
+       if (!is_power_of_2(sb->stripesize)) {
+               printf("%s: invalid stripesize %u\n", __func__, sb->stripesize);
+               ret = -1;
+       }
+
+       if (sb->sys_chunk_array_size > BTRFS_SYSTEM_CHUNK_ARRAY_SIZE) {
+               printf("%s: system chunk array too big %u > %u\n", __func__,
+                      sb->sys_chunk_array_size, BTRFS_SYSTEM_CHUNK_ARRAY_SIZE);
+               ret = -1;
+       }
+
+       if (sb->sys_chunk_array_size < sizeof(struct btrfs_key) +
+           sizeof(struct btrfs_chunk)) {
+               printf("%s: system chunk array too small %u < %lu\n", __func__,
+                      sb->sys_chunk_array_size, (u32) sizeof(struct btrfs_key)
+                      + sizeof(struct btrfs_chunk));
+               ret = -1;
+       }
+
+       return ret;
+}
+
+int btrfs_read_superblock(void)
+{
+       const u64 superblock_offsets[4] = {
+               0x10000ull,
+               0x4000000ull,
+               0x4000000000ull,
+               0x4000000000000ull
+       };
+       char raw_sb[BTRFS_SUPER_INFO_SIZE];
+       struct btrfs_super_block *sb = (struct btrfs_super_block *) raw_sb;
+       u64 dev_total_bytes;
+       int i, root_backup_idx;
+
+       dev_total_bytes = (u64) btrfs_part_info->size * btrfs_part_info->blksz;
+
+       btrfs_info.sb.generation = 0;
+
+       for (i = 0; i < 4; ++i) {
+               if (superblock_offsets[i] + sizeof(sb) > dev_total_bytes)
+                       break;
+
+               if (!btrfs_devread(superblock_offsets[i], BTRFS_SUPER_INFO_SIZE,
+                                  raw_sb))
+                       break;
+
+               if (btrfs_check_super_csum(raw_sb)) {
+                       printf("%s: invalid checksum at superblock mirror %i\n",
+                              __func__, i);
+                       continue;
+               }
+
+               btrfs_super_block_to_cpu(sb);
+
+               if (sb->magic != BTRFS_MAGIC) {
+                       printf("%s: invalid BTRFS magic 0x%016llX at "
+                              "superblock mirror %i\n", __func__, sb->magic,
+                              i);
+               } else if (sb->bytenr != superblock_offsets[i]) {
+                       printf("%s: invalid bytenr 0x%016llX (expected "
+                              "0x%016llX) at superblock mirror %i\n",
+                              __func__, sb->bytenr, superblock_offsets[i], i);
+               } else if (btrfs_check_super(sb)) {
+                       printf("%s: Checking superblock mirror %i failed\n",
+                              __func__, i);
+               } else if (sb->generation > btrfs_info.sb.generation) {
+                       memcpy(&btrfs_info.sb, sb, sizeof(*sb));
+               } else {
+                       /* Nothing */
+               }
+       }
+
+       if (!btrfs_info.sb.generation) {
+               printf("%s: No valid BTRFS superblock found!\n", __func__);
+               return -1;
+       }
+
+       root_backup_idx = btrfs_newest_root_backup(&btrfs_info.sb);
+       if (root_backup_idx < 0) {
+               printf("%s: No valid root_backup found!\n", __func__);
+               return -1;
+       }
+       btrfs_info.root_backup = btrfs_info.sb.super_roots + root_backup_idx;
+
+       if (btrfs_info.root_backup->num_devices != 1) {
+               printf("%s: Unsupported number of devices (%lli). This driver "
+                      "only supports filesystem on one device.\n", __func__,
+                      btrfs_info.root_backup->num_devices);
+               return -1;
+       }
+
+       debug("Chosen superblock with generation = %llu\n",
+             btrfs_info.sb.generation);
+
+       return 0;
+}
index ae2ba6a9015c8bc3bd15cef9ca59a82680ddce33..f04fa08f64e4d61fc5fd49a36c5223a3189be453 100644 (file)
@@ -26,7 +26,7 @@
 #include <common.h>
 #include <blk.h>
 #include <config.h>
-#include <memalign.h>
+#include <fs_internal.h>
 #include <ext4fs.h>
 #include <ext_common.h>
 #include "ext4_common.h"
@@ -47,85 +47,11 @@ void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
                get_fs()->dev_desc->log2blksz;
 }
 
-int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
+int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len,
+                  char *buffer)
 {
-       unsigned block_len;
-       int log2blksz = ext4fs_blk_desc->log2blksz;
-       ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, (ext4fs_blk_desc ?
-                                                ext4fs_blk_desc->blksz :
-                                                0));
-       if (ext4fs_blk_desc == NULL) {
-               printf("** Invalid Block Device Descriptor (NULL)\n");
-               return 0;
-       }
-
-       /* Check partition boundaries */
-       if ((sector + ((byte_offset + byte_len - 1) >> log2blksz))
-           >= part_info->size) {
-               printf("%s read outside partition " LBAFU "\n", __func__,
-                      sector);
-               return 0;
-       }
-
-       /* Get the read to the beginning of a partition */
-       sector += byte_offset >> log2blksz;
-       byte_offset &= ext4fs_blk_desc->blksz - 1;
-
-       debug(" <" LBAFU ", %d, %d>\n", sector, byte_offset, byte_len);
-
-       if (byte_offset != 0) {
-               int readlen;
-               /* read first part which isn't aligned with start of sector */
-               if (blk_dread(ext4fs_blk_desc, part_info->start + sector, 1,
-                             (void *)sec_buf) != 1) {
-                       printf(" ** ext2fs_devread() read error **\n");
-                       return 0;
-               }
-               readlen = min((int)ext4fs_blk_desc->blksz - byte_offset,
-                             byte_len);
-               memcpy(buf, sec_buf + byte_offset, readlen);
-               buf += readlen;
-               byte_len -= readlen;
-               sector++;
-       }
-
-       if (byte_len == 0)
-               return 1;
-
-       /* read sector aligned part */
-       block_len = byte_len & ~(ext4fs_blk_desc->blksz - 1);
-
-       if (block_len == 0) {
-               ALLOC_CACHE_ALIGN_BUFFER(u8, p, ext4fs_blk_desc->blksz);
-
-               block_len = ext4fs_blk_desc->blksz;
-               blk_dread(ext4fs_blk_desc, part_info->start + sector, 1,
-                         (void *)p);
-               memcpy(buf, p, byte_len);
-               return 1;
-       }
-
-       if (blk_dread(ext4fs_blk_desc, part_info->start + sector,
-                     block_len >> log2blksz, (void *)buf) !=
-                       block_len >> log2blksz) {
-               printf(" ** %s read error - block\n", __func__);
-               return 0;
-       }
-       block_len = byte_len & ~(ext4fs_blk_desc->blksz - 1);
-       buf += block_len;
-       byte_len -= block_len;
-       sector += block_len / ext4fs_blk_desc->blksz;
-
-       if (byte_len != 0) {
-               /* read rest of data which are not in whole sector */
-               if (blk_dread(ext4fs_blk_desc, part_info->start + sector, 1,
-                             (void *)sec_buf) != 1) {
-                       printf("* %s read error - last part\n", __func__);
-                       return 0;
-               }
-               memcpy(buf, sec_buf, byte_len);
-       }
-       return 1;
+       return fs_devread(get_fs()->dev_desc, part_info, sector, byte_offset,
+                         byte_len, buffer);
 }
 
 int ext4_read_superblock(char *buffer)
index 621c61e5c7915529cf0bc92a7ab7d3fc31adc1c1..31952f48b90d50b3af6c119540247a486b596a99 100644 (file)
@@ -432,6 +432,10 @@ uint16_t ext4fs_checksum_update(uint32_t i)
                crc = ext2fs_crc16(crc, desc, offset);
                offset += sizeof(desc->bg_checksum);    /* skip checksum */
                assert(offset == sizeof(*desc));
+               if (offset < fs->gdsize) {
+                       crc = ext2fs_crc16(crc, (__u8 *)desc + offset,
+                                          fs->gdsize - offset);
+               }
        }
 
        return crc;
index 081509dbb4db8927b6a8fa26342c39be8bb22284..b0c7303aa410034fc6091a2a56d02f75def6936a 100644 (file)
@@ -167,6 +167,7 @@ int ext4fs_ls(const char *dirname)
                                  FILETYPE_DIRECTORY);
        if (status != 1) {
                printf("** Can not find directory. **\n");
+               ext4fs_free_node(dirnode, &ext4fs_root->diropen);
                return 1;
        }
 
index 36a309c73c2713f73a8f7f4f873b6e0d7ae21d68..7fe78439cf162bb264751cac0bb569521406c610 100644 (file)
@@ -495,7 +495,7 @@ read_bootsectandvi(boot_sector *bs, volume_info *volinfo, int *fatsize)
                return -1;
        }
 
-       block = memalign(ARCH_DMA_MINALIGN, cur_dev->blksz);
+       block = malloc_cache_aligned(cur_dev->blksz);
        if (block == NULL) {
                debug("Error: allocating block\n");
                return -1;
@@ -599,7 +599,7 @@ static int get_fs_info(fsdata *mydata)
 
        mydata->fatbufnum = -1;
        mydata->fat_dirty = 0;
-       mydata->fatbuf = memalign(ARCH_DMA_MINALIGN, FATBUFSIZE);
+       mydata->fatbuf = malloc_cache_aligned(FATBUFSIZE);
        if (mydata->fatbuf == NULL) {
                debug("Error: allocating memory\n");
                return -1;
@@ -710,13 +710,14 @@ static void fat_itr_child(fat_itr *itr, fat_itr *parent)
        itr->fsdata = parent->fsdata;
        if (clustnum > 0) {
                itr->clust = clustnum;
+               itr->is_root = 0;
        } else {
                itr->clust = parent->fsdata->root_cluster;
+               itr->is_root = 1;
        }
        itr->dent = NULL;
        itr->remaining = 0;
        itr->last_cluster = 0;
-       itr->is_root = 0;
 }
 
 static void *next_cluster(fat_itr *itr)
@@ -1037,13 +1038,16 @@ int fat_exists(const char *filename)
        fat_itr *itr;
        int ret;
 
-       itr = malloc(sizeof(fat_itr));
+       itr = malloc_cache_aligned(sizeof(fat_itr));
+       if (!itr)
+               return 0;
        ret = fat_itr_root(itr, &fsdata);
        if (ret)
-               return 0;
+               goto out;
 
        ret = fat_itr_resolve(itr, filename, TYPE_ANY);
        free(fsdata.fatbuf);
+out:
        free(itr);
        return ret == 0;
 }
@@ -1054,10 +1058,12 @@ int fat_size(const char *filename, loff_t *size)
        fat_itr *itr;
        int ret;
 
-       itr = malloc(sizeof(fat_itr));
+       itr = malloc_cache_aligned(sizeof(fat_itr));
+       if (!itr)
+               return -ENOMEM;
        ret = fat_itr_root(itr, &fsdata);
        if (ret)
-               return ret;
+               goto out_free_itr;
 
        ret = fat_itr_resolve(itr, filename, TYPE_FILE);
        if (ret) {
@@ -1071,12 +1077,13 @@ int fat_size(const char *filename, loff_t *size)
                        *size = 0;
                        ret = 0;
                }
-               goto out;
+               goto out_free_both;
        }
 
        *size = FAT2CPU32(itr->dent->size);
+out_free_both:
        free(fsdata.fatbuf);
-out:
+out_free_itr:
        free(itr);
        return ret;
 }
@@ -1088,20 +1095,23 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
        fat_itr *itr;
        int ret;
 
-       itr = malloc(sizeof(fat_itr));
+       itr = malloc_cache_aligned(sizeof(fat_itr));
+       if (!itr)
+               return -ENOMEM;
        ret = fat_itr_root(itr, &fsdata);
        if (ret)
-               return ret;
+               goto out_free_itr;
 
        ret = fat_itr_resolve(itr, filename, TYPE_FILE);
        if (ret)
-               goto out;
+               goto out_free_both;
 
        printf("reading %s\n", filename);
        ret = get_contents(&fsdata, itr->dent, pos, buffer, maxsize, actread);
 
-out:
+out_free_both:
        free(fsdata.fatbuf);
+out_free_itr:
        free(itr);
        return ret;
 }
@@ -1147,17 +1157,18 @@ int fat_opendir(const char *filename, struct fs_dir_stream **dirsp)
 
        ret = fat_itr_root(&dir->itr, &dir->fsdata);
        if (ret)
-               goto fail;
+               goto fail_free_dir;
 
        ret = fat_itr_resolve(&dir->itr, filename, TYPE_DIR);
        if (ret)
-               goto fail;
+               goto fail_free_both;
 
        *dirsp = (struct fs_dir_stream *)dir;
        return 0;
 
-fail:
+fail_free_both:
        free(dir->fsdata.fatbuf);
+fail_free_dir:
        free(dir);
        return ret;
 }
diff --git a/fs/fs.c b/fs/fs.c
index 3481229aa623bf80e0d26caf9cfc20a9d179ae0e..84349f3039856bae87822a3d9b86551a7bde9b72 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -14,6 +14,7 @@
 #include <fs.h>
 #include <sandboxfs.h>
 #include <ubifs_uboot.h>
+#include <btrfs.h>
 #include <asm/io.h>
 #include <div64.h>
 #include <linux/math64.h>
@@ -218,6 +219,21 @@ static struct fstype_info fstypes[] = {
                .uuid = fs_uuid_unsupported,
                .opendir = fs_opendir_unsupported,
        },
+#endif
+#ifdef CONFIG_FS_BTRFS
+       {
+               .fstype = FS_TYPE_BTRFS,
+               .name = "btrfs",
+               .null_dev_desc_ok = false,
+               .probe = btrfs_probe,
+               .close = btrfs_close,
+               .ls = btrfs_ls,
+               .exists = btrfs_exists,
+               .size = btrfs_size,
+               .read = btrfs_read,
+               .write = fs_write_unsupported,
+               .uuid = btrfs_uuid,
+       },
 #endif
        {
                .fstype = FS_TYPE_ANY,
diff --git a/fs/fs_internal.c b/fs/fs_internal.c
new file mode 100644 (file)
index 0000000..58b4410
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * 2017 by Marek Behun <marek.behun@nic.cz>
+ *
+ * Derived from code in ext4/dev.c, which was based on reiserfs/dev.c
+ *
+ * SPDX-License-Identifier:    GPL-2.0
+ */
+
+#include <common.h>
+#include <compiler.h>
+#include <part.h>
+#include <memalign.h>
+
+int fs_devread(struct blk_desc *blk, disk_partition_t *partition,
+              lbaint_t sector, int byte_offset, int byte_len, char *buf)
+{
+       unsigned block_len;
+       int log2blksz = blk->log2blksz;
+       ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, (blk ? blk->blksz : 0));
+       if (blk == NULL) {
+               printf("** Invalid Block Device Descriptor (NULL)\n");
+               return 0;
+       }
+
+       /* Check partition boundaries */
+       if ((sector + ((byte_offset + byte_len - 1) >> log2blksz))
+           >= partition->size) {
+               printf("%s read outside partition " LBAFU "\n", __func__,
+                      sector);
+               return 0;
+       }
+
+       /* Get the read to the beginning of a partition */
+       sector += byte_offset >> log2blksz;
+       byte_offset &= blk->blksz - 1;
+
+       debug(" <" LBAFU ", %d, %d>\n", sector, byte_offset, byte_len);
+
+       if (byte_offset != 0) {
+               int readlen;
+               /* read first part which isn't aligned with start of sector */
+               if (blk_dread(blk, partition->start + sector, 1,
+                             (void *)sec_buf) != 1) {
+                       printf(" ** %s read error **\n", __func__);
+                       return 0;
+               }
+               readlen = min((int)blk->blksz - byte_offset,
+                             byte_len);
+               memcpy(buf, sec_buf + byte_offset, readlen);
+               buf += readlen;
+               byte_len -= readlen;
+               sector++;
+       }
+
+       if (byte_len == 0)
+               return 1;
+
+       /* read sector aligned part */
+       block_len = byte_len & ~(blk->blksz - 1);
+
+       if (block_len == 0) {
+               ALLOC_CACHE_ALIGN_BUFFER(u8, p, blk->blksz);
+
+               block_len = blk->blksz;
+               blk_dread(blk, partition->start + sector, 1,
+                         (void *)p);
+               memcpy(buf, p, byte_len);
+               return 1;
+       }
+
+       if (blk_dread(blk, partition->start + sector,
+                     block_len >> log2blksz, (void *)buf) !=
+                       block_len >> log2blksz) {
+               printf(" ** %s read error - block\n", __func__);
+               return 0;
+       }
+       block_len = byte_len & ~(blk->blksz - 1);
+       buf += block_len;
+       byte_len -= block_len;
+       sector += block_len / blk->blksz;
+
+       if (byte_len != 0) {
+               /* read rest of data which are not in whole sector */
+               if (blk_dread(blk, partition->start + sector, 1,
+                             (void *)sec_buf) != 1) {
+                       printf("* %s read error - last part\n", __func__);
+                       return 0;
+               }
+               memcpy(buf, sec_buf, byte_len);
+       }
+       return 1;
+}
index 1d63fc94340ee8879e9c12814f33fbcca9b9a2f7..b16005e6045ffda2cdb6176bd856066be10b1556 100644 (file)
@@ -798,7 +798,7 @@ jffs2_1pass_build_lists(struct part_info * part)
        struct mtdids *id = part->dev->id;
        mtd = get_nand_dev_by_index(id->num);
        if (!mtd) {
-               error("\nno NAND devices available\n");
+               pr_err("\nno NAND devices available\n");
                return 0;
        }
 
index 5a1ab0a3648a12099283baf9a9e6c92b1416c114..7b786e4ed359f84bb55cbf5781a252e4d9c605eb 100644 (file)
@@ -9,7 +9,7 @@
 #include <common.h>
 #include <config.h>
 #include <reiserfs.h>
-
+#include <fs_internal.h>
 #include "reiserfs_private.h"
 
 static struct blk_desc *reiserfs_blk_desc;
@@ -22,78 +22,8 @@ void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
        part_info = info;
 }
 
-
-int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
+int reiserfs_devread(int sector, int byte_offset, int byte_len, char *buf)
 {
-       char sec_buf[SECTOR_SIZE];
-       unsigned block_len;
-/*
-       unsigned len = byte_len;
-       u8 *start = buf;
-*/
-       /*
-       *  Check partition boundaries
-       */
-       if (sector < 0
-           || ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS))
-           >= part_info->size)) {
-/*             errnum = ERR_OUTSIDE_PART; */
-               printf (" ** reiserfs_devread() read outside partition\n");
-               return 0;
-       }
-
-       /*
-        *  Get the read to the beginning of a partition.
-        */
-       sector += byte_offset >> SECTOR_BITS;
-       byte_offset &= SECTOR_SIZE - 1;
-
-#if defined(DEBUG)
-       printf (" <%d, %d, %d> ", sector, byte_offset, byte_len);
-#endif
-
-
-       if (reiserfs_blk_desc == NULL)
-               return 0;
-
-
-       if (byte_offset != 0) {
-               /* read first part which isn't aligned with start of sector */
-               if (reiserfs_blk_desc->block_read(reiserfs_blk_desc,
-                                                 part_info->start + sector,
-                                                 1, (void *)sec_buf) != 1) {
-                       printf (" ** reiserfs_devread() read error\n");
-                       return 0;
-               }
-               memcpy(buf, sec_buf+byte_offset, min(SECTOR_SIZE-byte_offset, byte_len));
-               buf+=min(SECTOR_SIZE-byte_offset, byte_len);
-               byte_len-=min(SECTOR_SIZE-byte_offset, byte_len);
-               sector++;
-       }
-
-       /* read sector aligned part */
-       block_len = byte_len & ~(SECTOR_SIZE-1);
-       if (reiserfs_blk_desc->block_read(reiserfs_blk_desc,
-                                         part_info->start + sector,
-                                         block_len / SECTOR_SIZE, (void *)buf)
-                       != block_len/SECTOR_SIZE) {
-               printf (" ** reiserfs_devread() read error - block\n");
-               return 0;
-       }
-       buf+=block_len;
-       byte_len-=block_len;
-       sector+= block_len/SECTOR_SIZE;
-
-       if ( byte_len != 0 ) {
-               /* read rest of data which are not in whole sector */
-               if (reiserfs_blk_desc->block_read(reiserfs_blk_desc,
-                                                 part_info->start + sector,
-                                                 1, (void *)sec_buf) != 1) {
-                       printf (" ** reiserfs_devread() read error - last part\n");
-                       return 0;
-               }
-               memcpy(buf, sec_buf, byte_len);
-       }
-
-       return 1;
+       return fs_devread(reiserfs_blk_desc, part_info, sector, byte_offset,
+                         byte_len, buf);
 }
index bd66d31697f5c3a4baf0441e3ca6c7585a651101..2a70e4a543e0b9e8608c6e6fd803988ac3af3a3e 100644 (file)
@@ -168,7 +168,7 @@ void cmd_yaffs_devconfig(char *_mp, int flash_dev,
 
        mtd = get_nand_dev_by_index(flash_dev);
        if (!mtd) {
-               error("\nno NAND devices available\n");
+               pr_err("\nno NAND devices available\n");
                return;
        }
 
index 2f409e66cddf0f6f5748144a962c1fd335c9f154..7dda42b48baf555adab71a8fbd4751f77766a8cf 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <config.h>
+#include <fs_internal.h>
 #include <zfs_common.h>
 
 static struct blk_desc *zfs_blk_desc;
@@ -25,87 +26,6 @@ void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
 /* err */
 int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
 {
-       short sec_buffer[SECTOR_SIZE/sizeof(short)];
-       char *sec_buf = (char *)sec_buffer;
-       unsigned block_len;
-
-       /*
-        *      Check partition boundaries
-        */
-       if ((sector < 0) ||
-               ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS)) >=
-                part_info->size)) {
-               /*              errnum = ERR_OUTSIDE_PART; */
-               printf(" ** zfs_devread() read outside partition sector %d\n", sector);
-               return 1;
-       }
-
-       /*
-        *      Get the read to the beginning of a partition.
-        */
-       sector += byte_offset >> SECTOR_BITS;
-       byte_offset &= SECTOR_SIZE - 1;
-
-       debug(" <%d, %d, %d>\n", sector, byte_offset, byte_len);
-
-       if (zfs_blk_desc == NULL) {
-               printf("** Invalid Block Device Descriptor (NULL)\n");
-               return 1;
-       }
-
-       if (byte_offset != 0) {
-               /* read first part which isn't aligned with start of sector */
-               if (zfs_blk_desc->block_read(zfs_blk_desc,
-                                            part_info->start + sector, 1,
-                                            (void *)sec_buf) != 1) {
-                       printf(" ** zfs_devread() read error **\n");
-                       return 1;
-               }
-               memcpy(buf, sec_buf + byte_offset,
-                          min(SECTOR_SIZE - byte_offset, byte_len));
-               buf += min(SECTOR_SIZE - byte_offset, byte_len);
-               byte_len -= min(SECTOR_SIZE - byte_offset, byte_len);
-               sector++;
-       }
-
-       if (byte_len == 0)
-               return 0;
-
-       /*      read sector aligned part */
-       block_len = byte_len & ~(SECTOR_SIZE - 1);
-
-       if (block_len == 0) {
-               u8 p[SECTOR_SIZE];
-
-               block_len = SECTOR_SIZE;
-               zfs_blk_desc->block_read(zfs_blk_desc,
-                                        part_info->start + sector,
-                                        1, (void *)p);
-               memcpy(buf, p, byte_len);
-               return 0;
-       }
-
-       if (zfs_blk_desc->block_read(zfs_blk_desc, part_info->start + sector,
-                                    block_len / SECTOR_SIZE,
-                                    (void *)buf) != block_len / SECTOR_SIZE) {
-               printf(" ** zfs_devread() read error - block\n");
-               return 1;
-       }
-
-       block_len = byte_len & ~(SECTOR_SIZE - 1);
-       buf += block_len;
-       byte_len -= block_len;
-       sector += block_len / SECTOR_SIZE;
-
-       if (byte_len != 0) {
-               /* read rest of data which are not in whole sector */
-               if (zfs_blk_desc->block_read(zfs_blk_desc,
-                                            part_info->start + sector,
-                                            1, (void *)sec_buf) != 1) {
-                       printf(" ** zfs_devread() read error - last part\n");
-                       return 1;
-               }
-               memcpy(buf, sec_buf, byte_len);
-       }
-       return 0;
+       return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
+                         byte_len, buf);
 }
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
new file mode 100644 (file)
index 0000000..0f5160c
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Generic I/O functions.
+ *
+ * Copyright (c) 2016 Imagination Technologies Ltd.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __ASM_GENERIC_IO_H__
+#define __ASM_GENERIC_IO_H__
+
+/*
+ * This file should be included at the end of each architecture-specific
+ * asm/io.h such that we may provide generic implementations without
+ * conflicting with architecture-specific code.
+ */
+
+#ifndef __ASSEMBLY__
+
+/**
+ * phys_to_virt() - Return a virtual address mapped to a given physical address
+ * @paddr: the physical address
+ *
+ * Returns a virtual address which the CPU can access that maps to the physical
+ * address @paddr. This should only be used where it is known that no dynamic
+ * mapping is required. In general, map_physmem should be used instead.
+ *
+ * Returns: a virtual address which maps to @paddr
+ */
+#ifndef phys_to_virt
+static inline void *phys_to_virt(phys_addr_t paddr)
+{
+       return (void *)(unsigned long)paddr;
+}
+#endif
+
+/**
+ * virt_to_phys() - Return the physical address that a virtual address maps to
+ * @vaddr: the virtual address
+ *
+ * Returns the physical address which the CPU-accessible virtual address @vaddr
+ * maps to.
+ *
+ * Returns: the physical address which @vaddr maps to
+ */
+#ifndef virt_to_phys
+static inline phys_addr_t virt_to_phys(void *vaddr)
+{
+       return (phys_addr_t)((unsigned long)vaddr);
+}
+#endif
+
+/*
+ * Flags for use with map_physmem() & unmap_physmem(). Architectures need not
+ * support all of these, in which case they will be defined as zero here &
+ * ignored. Callers that may run on multiple architectures should therefore
+ * treat them as hints rather than requirements.
+ */
+#ifndef MAP_NOCACHE
+# define MAP_NOCACHE   0       /* Produce an uncached mapping */
+#endif
+#ifndef MAP_WRCOMBINE
+# define MAP_WRCOMBINE 0       /* Allow write-combining on the mapping */
+#endif
+#ifndef MAP_WRBACK
+# define MAP_WRBACK    0       /* Map using write-back caching */
+#endif
+#ifndef MAP_WRTHROUGH
+# define MAP_WRTHROUGH 0       /* Map using write-through caching */
+#endif
+
+/**
+ * map_physmem() - Return a virtual address mapped to a given physical address
+ * @paddr: the physical address
+ * @len: the length of the required mapping
+ * @flags: flags affecting the type of mapping
+ *
+ * Return a virtual address through which the CPU may access the memory at
+ * physical address @paddr. The mapping will be valid for at least @len bytes,
+ * and may be affected by flags passed to the @flags argument. This function
+ * may create new mappings, so should generally be paired with a matching call
+ * to unmap_physmem once the caller is finished with the memory in question.
+ *
+ * Returns: a virtual address suitably mapped to @paddr
+ */
+#ifndef map_physmem
+static inline void *map_physmem(phys_addr_t paddr, unsigned long len,
+                               unsigned long flags)
+{
+       return phys_to_virt(paddr);
+}
+#endif
+
+/**
+ * unmap_physmem() - Remove mappings created by a prior call to map_physmem()
+ * @vaddr: the virtual address which map_physmem() previously returned
+ * @flags: flags matching those originally passed to map_physmem()
+ *
+ * Unmap memory which was previously mapped by a call to map_physmem(). If
+ * map_physmem() dynamically created a mapping for the memory in question then
+ * unmap_physmem() will remove that mapping.
+ */
+#ifndef unmap_physmem
+static inline void unmap_physmem(void *vaddr, unsigned long flags)
+{
+}
+#endif
+
+#endif /* !__ASSEMBLY__ */
+#endif /* __ASM_GENERIC_IO_H__ */
index daf021b647e6fdfa6d6baf091eaad707f58b55bb..b6535705a52003a5f047ec2d0aceb3af62abcc47 100644 (file)
@@ -22,8 +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[];
+extern char __efi_helloworld_begin[];
+extern char __efi_helloworld_end[];
 
 /* Start and end of .ctors section - used for constructor calls. */
 extern char __ctors_start[], __ctors_end[];
index 1965812a9d5a39f0148ce133a895a69b4058d07b..41b4d7efa82b3f88994b95a61071310ae51462fe 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef BLK_H
 #define BLK_H
 
+#include <efi.h>
+
 #ifdef CONFIG_SYS_64BIT_LBA
 typedef uint64_t lbaint_t;
 #define LBAFlength "ll"
@@ -40,6 +42,17 @@ enum if_type {
 #define BLK_PRD_SIZE           20
 #define BLK_REV_SIZE           8
 
+/*
+ * Identifies the partition table type (ie. MBR vs GPT GUID) signature
+ */
+enum sig_type {
+       SIG_TYPE_NONE,
+       SIG_TYPE_MBR,
+       SIG_TYPE_GUID,
+
+       SIG_TYPE_COUNT                  /* Number of signature types */
+};
+
 /*
  * With driver model (CONFIG_BLK) this is uclass platform data, accessible
  * with dev_get_uclass_platdata(dev)
@@ -67,6 +80,11 @@ struct blk_desc {
        char            vendor[BLK_VEN_SIZE + 1]; /* device vendor string */
        char            product[BLK_PRD_SIZE + 1]; /* device product number */
        char            revision[BLK_REV_SIZE + 1]; /* firmware revision */
+       enum sig_type   sig_type;       /* Partition table signature type */
+       union {
+               uint32_t mbr_sig;       /* MBR integer signature */
+               efi_guid_t guid_sig;    /* GPT GUID Signature */
+       };
 #if CONFIG_IS_ENABLED(BLK)
        /*
         * For now we have a few functions which take struct blk_desc as a
index b7d2462dd9b49de75db9c928d665bf5ad50e81bc..e16ae5bafae6482890f689fe141764a4da0ba1f8 100644 (file)
@@ -5,5 +5,10 @@
  * SPDX-License-Identifier:     GPL-2.0+
  */
 
-int fdt_offset(void *fit);
-void *locate_dtb_in_fit(void *fit);
+/**
+ * locate_dtb_in_fit - Find a DTB matching the board in a FIT image
+ * @fit:       pointer to the FIT image
+ *
+ * @return a pointer to a matching DTB blob if found, NULL otherwise
+ */
+void *locate_dtb_in_fit(const void *fit);
diff --git a/include/btrfs.h b/include/btrfs.h
new file mode 100644 (file)
index 0000000..7390975
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * BTRFS filesystem implementation for U-Boot
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __U_BOOT_BTRFS_H__
+#define __U_BOOT_BTRFS_H__
+
+int btrfs_probe(struct blk_desc *, disk_partition_t *);
+int btrfs_ls(const char *);
+int btrfs_exists(const char *);
+int btrfs_size(const char *, loff_t *);
+int btrfs_read(const char *, void *, loff_t, loff_t, loff_t *);
+void btrfs_close(void);
+int btrfs_uuid(char *);
+void btrfs_list_subvols(void);
+
+#endif /* __U_BOOT_BTRFS_H__ */
index aaed13167123b2bd5a0e8aeb5da2014c82720cdf..4b521e142a9e7d53c2093e4e160d5962a122bffe 100644 (file)
@@ -23,12 +23,15 @@ typedef volatile unsigned char      vu_char;
 #include <time.h>
 #include <asm-offsets.h>
 #include <linux/bitops.h>
+#include <linux/bug.h>
 #include <linux/delay.h>
 #include <linux/types.h>
+#include <linux/printk.h>
 #include <linux/string.h>
 #include <linux/stringify.h>
 #include <asm/ptrace.h>
 #include <stdarg.h>
+#include <stdio.h>
 #include <linux/kernel.h>
 
 #include <part.h>
@@ -54,11 +57,6 @@ typedef volatile unsigned char       vu_char;
 #define _SPL_BUILD     0
 #endif
 
-/* Define this at the top of a file to add a prefix to debug messages */
-#ifndef pr_fmt
-#define pr_fmt(fmt) fmt
-#endif
-
 /*
  * Output a debug text when condition "cond" is met. The "cond" should be
  * computed by a preprocessor in the best case, allowing for the best
@@ -93,19 +91,6 @@ void __assert_fail(const char *assertion, const char *file, unsigned line,
        ({ if (!(x) && _DEBUG) \
                __assert_fail(#x, __FILE__, __LINE__, __func__); })
 
-#define error(fmt, args...) do {                                       \
-               printf("ERROR: " pr_fmt(fmt) "\nat %s:%d/%s()\n",       \
-                       ##args, __FILE__, __LINE__, __func__);          \
-} while (0)
-
-#ifndef BUG
-#define BUG() do { \
-       printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
-       panic("BUG!"); \
-} while (0)
-#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
-#endif /* BUG */
-
 typedef void (interrupt_handler_t)(void *);
 
 #include <asm/u-boot.h> /* boot information for Linux kernel */
@@ -624,6 +609,7 @@ ulong       usec2ticks    (unsigned long usec);
 ulong  ticks2usec    (unsigned long ticks);
 
 /* lib/gunzip.c */
+int gzip_parse_header(const unsigned char *src, unsigned long len);
 int gunzip(void *, int, unsigned char *, unsigned long *);
 int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
                                                int stoponerr, int offset);
@@ -699,46 +685,6 @@ unsigned int rand_r(unsigned int *seedp);
 /* serial stuff */
 int    serial_printf (const char *fmt, ...)
                __attribute__ ((format (__printf__, 1, 2)));
-/* stdin */
-int    getc(void);
-int    tstc(void);
-
-/* stdout */
-#if !defined(CONFIG_SPL_BUILD) || \
-       (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL_SUPPORT)) || \
-       (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \
-               defined(CONFIG_SPL_SERIAL_SUPPORT))
-void   putc(const char c);
-void   puts(const char *s);
-int    printf(const char *fmt, ...)
-               __attribute__ ((format (__printf__, 1, 2)));
-int    vprintf(const char *fmt, va_list args);
-#else
-#define        putc(...) do { } while (0)
-#define puts(...) do { } while (0)
-#define printf(...) do { } while (0)
-#define vprintf(...) do { } while (0)
-#endif
-
-/* stderr */
-#define eputc(c)               fputc(stderr, c)
-#define eputs(s)               fputs(stderr, s)
-#define eprintf(fmt,args...)   fprintf(stderr,fmt ,##args)
-
-/*
- * FILE based functions (can only be used AFTER relocation!)
- */
-#define stdin          0
-#define stdout         1
-#define stderr         2
-#define MAX_FILES      3
-
-int    fprintf(int file, const char *fmt, ...)
-               __attribute__ ((format (__printf__, 2, 3)));
-void   fputs(int file, const char *s);
-void   fputc(int file, const char c);
-int    ftstc(int file);
-int    fgetc(int file);
 
 /* lib/gzip.c */
 int gzip(void *dst, unsigned long *lenp,
index 9ed6b9892cd4a1aca02119319c6eb080ec241208..e0d0034ed344df59391f26cd58f79454b28afa1a 100644 (file)
 
 #define BOOTENV_SHARED_EFI                                                \
        "boot_efi_binary="                                                \
+               "if fdt addr ${fdt_addr_r}; then "                        \
+                       "bootefi bootmgr ${fdt_addr_r};"                  \
+               "else "                                                   \
+                       "bootefi bootmgr ${fdtcontroladdr};"              \
+               "fi;"                                                     \
                "load ${devtype} ${devnum}:${distro_bootpart} "           \
                        "${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; "      \
                "if fdt addr ${fdt_addr_r}; then "                        \
index 415ce46e0d8dce1040d9b9e126863ff5651d0361..96294679bf9b615dfc0b85a50274cc86fb3c8933 100644 (file)
 #define CONFIG_AM335X_USB1
 #define CONFIG_AM335X_USB1_MODE MUSB_HOST
 
-#ifdef CONFIG_USB_MUSB_GADGET
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR        "de:ad:be:af:00:00"
-#endif /* CONFIG_USB_MUSB_GADGET */
-
 /*
  * Disable MMC DM for SPL build and can be re-enabled after adding
  * DM support in SPL
index 708a98f8270948e9edbe772528c1520e1e1061ef..43fcfb25937ffd1c802b5d321df363b290fb2b42 100644 (file)
@@ -21,6 +21,7 @@
  * header. That is 0x800FFFC0--0x80100000 should not be used for any
  * other needs.
  */
+
 #define CONFIG_SYS_TEXT_BASE           0x80100000
 #define CONFIG_SYS_SPL_MALLOC_START    0x80208000
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000
 
 /* Hardware drivers */
 
-/* NS16550 Configuration */
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    (-4)
-
-/* select serial console configuration */
-#define CONFIG_CONS_INDEX              3
-#define CONFIG_SYS_NS16550_COM3                OMAP34XX_UART3
-#define CONFIG_SERIAL3                 3       /* UART3 on AM3517 EVM */
-
-
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
 
 #endif /* CONFIG_USB_MUSB_HOST */
 
-#ifdef CONFIG_USB_MUSB_GADGET
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_RNDIS
-#endif /* CONFIG_USB_MUSB_GADGET */
-
 #endif /* CONFIG_USB_MUSB_AM35X */
 
 /* I2C */
-#define CONFIG_SYS_I2C
 #define CONFIG_SYS_OMAP24_I2C_SPEED    100000
 #define CONFIG_SYS_OMAP24_I2C_SLAVE    1
 
 #define CONFIG_SPL_FRAMEWORK
 #undef CONFIG_SPL_TEXT_BASE
 #define CONFIG_SPL_TEXT_BASE           0x40200000
-#define CONFIG_SPL_MAX_SIZE            (SRAM_SCRATCH_SPACE_ADDR - \
-                                        CONFIG_SPL_TEXT_BASE)
 
 #undef CONFIG_SPL_BSS_START_ADDR
 #define CONFIG_SPL_BSS_START_ADDR      0x80000000
index b84f6e3480cb118d9fbb14f9de249341c9d186b4..743f953602236f9d4d4277375844ac7997aa3830 100644 (file)
@@ -89,9 +89,9 @@
 
 #undef CONFIG_USB_GADGET_DOWNLOAD
 #undef CONFIG_USB_GADGET_VBUS_DRAW
-#undef CONFIG_G_DNL_MANUFACTURER
-#undef CONFIG_G_DNL_VENDOR_NUM
-#undef CONFIG_G_DNL_PRODUCT_NUM
+#undef CONFIG_USB_GADGET_MANUFACTURER
+#undef CONFIG_USB_GADGET_VENDOR_NUM
+#undef CONFIG_USB_GADGET_PRODUCT_NUM
 #undef CONFIG_USB_GADGET_DUALSPEED
 #endif
 
 #define NANDBOOT
 #endif /* CONFIG_NAND */
 
+#if defined(CONFIG_TI_SECURE_DEVICE)
+/* Avoid relocating onto firewalled area at end of DRAM */
+#define CONFIG_PRAM (64 * 1024)
+#endif /* CONFIG_TI_SECURE_DEVICE */
+
 #endif /* __CONFIG_AM43XX_EVM_H */
index 0c70c5305033e30fa757af80801148b648d507d8..5427974bd0f9dcaa3737dc7af225bbce03b8197f 100644 (file)
@@ -44,7 +44,8 @@
 #define PARTS_DEFAULT \
        /* Linux partitions */ \
        "uuid_disk=${uuid_gpt_disk};" \
-       "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
+       "name=bootloader,start=384K,size=1792K,uuid=${uuid_gpt_bootloader};" \
+       "name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}\0" \
        /* Android partitions */ \
        "partitions_android=" \
        "uuid_disk=${uuid_gpt_disk};" \
@@ -72,7 +73,6 @@
 #include <configs/ti_omap5_common.h>
 
 /* Enhance our eMMC support / experience. */
-#define CONFIG_RANDOM_UUID
 #define CONFIG_HSMMC2_8BIT
 
 /* CPSW Ethernet */
index 1d4971c59f9da21436e1e1992546d1b646700b89..9450784521dd05e57ca88bcaee775cc5eaf93103 100644 (file)
 /* general purpose I/O */
 #define CONFIG_ATMEL_LEGACY            /* required until (g)pio is fixed */
 
-/* LCD */
-#define LCD_BPP                        LCD_COLOR16
-#define LCD_OUTPUT_BPP         24
-#define CONFIG_LCD_LOGO
-#define CONFIG_LCD_INFO
-#define CONFIG_LCD_INFO_BELOW_LOGO
-#define CONFIG_ATMEL_HLCD
-#define CONFIG_ATMEL_LCD_RGB565
-
-
 /*
  * BOOTP options
  */
index 185c749d78681542dc5d34a581428479fba78d20..44af4d3deec8b95b5640be84f3c66de95d1eb076 100644 (file)
 #define CONFIG_AM335X_USB1
 #define CONFIG_AM335X_USB1_MODE MUSB_OTG
 
-#ifdef CONFIG_USB_MUSB_GADGET
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR        "de:ad:be:af:00:00"
-#endif /* CONFIG_USB_MUSB_GADGET */
-
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
 /* disable host part of MUSB in SPL */
 /* disable EFI partitions and partition UUID support */
index c05c64cad731bd7356f4097ee0b4adfae977352f..821b1fe53495527f9e0071ab1224d89008ddd3c4 100644 (file)
 #define CONFIG_USE_SPIFLASH
 #endif
 
+/*
+* Disable DM_* for SPL build and can be re-enabled after adding
+* DM support in SPL
+*/
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
+#undef CONFIG_DM_I2C
+#undef CONFIG_DM_I2C_COMPAT
+#endif
 /*
  * SoC Configuration
  */
 /*
  * Serial Driver info
  */
+
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_DIRECT_NOR_BOOT)
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE    -4      /* NS16550 register size */
 #define CONFIG_SYS_NS16550_COM1        DAVINCI_UART2_BASE /* Base address of UART2 */
+#endif
 #define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
 #define CONFIG_CONS_INDEX      1               /* use UART0 for console */
 
 #define CONFIG_SPI
 #define CONFIG_DAVINCI_SPI
-#define CONFIG_SYS_SPI_BASE            DAVINCI_SPI1_BASE
 #define CONFIG_SYS_SPI_CLK             clk_get(DAVINCI_SPI1_CLKID)
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_SPI_BASE            DAVINCI_SPI1_BASE
 #define CONFIG_SF_DEFAULT_SPEED                30000000
 #define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
+#endif
 
 #ifdef CONFIG_USE_SPIFLASH
 #define CONFIG_SPL_SPI_LOAD
 /*
  * I2C Configuration
  */
-#define CONFIG_SYS_I2C
+#ifndef CONFIG_SPL_BUILD
 #define CONFIG_SYS_I2C_DAVINCI
-#define CONFIG_SYS_DAVINCI_I2C_SPEED           25000
-#define CONFIG_SYS_DAVINCI_I2C_SLAVE   10 /* Bogus, master-only in U-Boot */
 #define CONFIG_SYS_I2C_EXPANDER_ADDR   0x20
+#endif
 
 /*
  * Flash & Environment
 #define CONFIG_ENV_SIZE                        (64 << 10)
 #define CONFIG_ENV_OFFSET              (512 << 10)
 #define CONFIG_ENV_SECT_SIZE           (64 << 10)
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_SPI_FLASH_MTD
+#endif
+#define CONFIG_MTD_DEVICE              /* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS          /* required for UBI partition support */
+#define MTDIDS_DEFAULT                 "nor0=spi0.0"
+#define MTDPARTS_DEFAULT               "mtdparts=spi0.0:"\
+                                               "512k(u-boot.ais),"\
+                                               "64k(u-boot-env),"\
+                                               "7552k(kernel-spare),"\
+                                               "64k(MAC-Address)"
 #endif
 
 /*
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_REVISION_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_EXTRA_ENV_SETTINGS      "hwconfig=dsp:wake=yes"
+
+#define CONFIG_BOOTCOMMAND \
+               "run envboot; " \
+               "run mmcboot; "
+
+#define DEFAULT_LINUX_BOOT_ENV \
+       "loadaddr=0xc0700000\0" \
+       "fdtaddr=0xc0600000\0" \
+       "scriptaddr=0xc0600000\0"
+
+#include <environment/ti/mmc.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       DEFAULT_LINUX_BOOT_ENV \
+       DEFAULT_MMC_TI_ARGS \
+       "bootpart=0:2\0" \
+       "bootdir=/boot\0" \
+       "bootfile=zImage\0" \
+       "fdtfile=da850-evm.dtb\0" \
+       "boot_fdt=yes\0" \
+       "boot_fit=0\0" \
+       "console=ttyS2,115200n8\0" \
+       "hwconfig=dsp:wake=yes"
 
 #ifdef CONFIG_CMD_BDI
 #define CONFIG_CLOCKS
index 6c0fc35d3a358bd54a9cf7c168ea74ed66cff34f..717861faeef7f47cfda47227fe97fbbd9c88e885 100644 (file)
@@ -51,7 +51,8 @@
 #define PARTS_DEFAULT \
        /* Linux partitions */ \
        "uuid_disk=${uuid_gpt_disk};" \
-       "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
+       "name=bootloader,start=384K,size=1792K,uuid=${uuid_gpt_bootloader};" \
+       "name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}\0" \
        /* Android partitions */ \
        "partitions_android=" \
        "uuid_disk=${uuid_gpt_disk};" \
@@ -91,7 +92,6 @@
 #include <configs/ti_omap5_common.h>
 
 /* Enhance our eMMC support / experience. */
-#define CONFIG_RANDOM_UUID
 #define CONFIG_HSMMC2_8BIT
 
 /* CPSW Ethernet */
index d25b50c0768bfa0fec5a51fed69cc25fd6af7a4c..79dd690e71efeb824655a6852ccaadeeb2c86feb 100644 (file)
@@ -9,11 +9,13 @@
 
 #include <asm/ibmpc.h>
 
+/* ACPI */
+#define CONFIG_LAST_STAGE_INIT
+
 /* Boot */
 #define CONFIG_BOOTCOMMAND "run bootcmd"
 
 /* DISK Partition support */
-#define CONFIG_RANDOM_UUID
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP
index 531f5bf5aab4c886f90f45acf3a8e2f3ad2ee183..01d75d6aa291c5b0b5048e47c1481be1cdce2ea2 100644 (file)
@@ -56,9 +56,6 @@
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_MXC_UART_BASE   UART2_BASE
 
-/* Command definition */
-#undef CONFIG_CMD_IMLS
-
 #define CONFIG_BOARD_NAME      EL6Q
 
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
index 015f25a774006dd290d8db0542b9f3ecffafbf5d..66ead6c117230aacede8099e0ee634a0bee9bd1d 100644 (file)
 #include <configs/rk3399_common.h>
 
 #define CONFIG_SYS_MMC_ENV_DEV 1
-/*
- * SPL @ 32k for ~36k
- * ENV @ 96k
- * u-boot @ 128K
- */
-#define CONFIG_ENV_OFFSET (96 * 1024)
 
 #define SDRAM_BANK_SIZE                        (2UL << 30)
 
index 128a6e5aec6eddaae93200f41ec2486e5be483b5..a93172ace1f7e90c3895d1db9cfdf24d9300fbd0 100644 (file)
 #define CONFIG_MXC_USB_PORTSC     (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS      0
 #define CONFIG_USBD_HS
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_CDC
 #define CONFIG_NETCONSOLE
 
 /* USB Mass Storage Gadget */
index 870014ddf4750d13bd999b27278bf789c5174c72..24ff53f6f1e90e2bb1b15e7f03a8bd071f4f95a0 100644 (file)
        "bootm ; "
 
 #define CONFIG_USB_GADGET_PXA2XX
-#define CONFIG_USB_ETHER
 #define CONFIG_USB_ETH_SUBSET
 
 #define CONFIG_USBNET_DEV_ADDR         "de:ad:be:ef:00:01"
-#define CONFIG_USBNET_HOST_ADDR        "de:ad:be:ef:00:02"
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "stdin=serial\0" \
        "stdout=serial\0" \
index 195074040573009a47c06728c0a91d5b860178f6..df81c09d8636e95e10e8324d5c972b01b972ca9e 100644 (file)
@@ -38,7 +38,7 @@
                         "setenv name_fdt keystone-k2g-ice.dtb; " \
                "else if test $name_fdt = undefined; then " \
                        "echo WARNING: Could not determine device tree to use;"\
-               "fi;fi;fi;\0" \
+               "fi;fi;fi; setenv fdtfile ${name_fdt}\0" \
        "name_mon=skern-k2g.bin\0"                                      \
        "name_ubi=k2g-evm-ubifs.ubi\0"                                  \
        "name_uboot=u-boot-spi-k2g-evm.gph\0"                           \
index 096799eb64b7f6a124ae46b2ca02cbb6a4961562..77bd9308562d1f23f63fd837395bc1ab24cb3f85 100644 (file)
@@ -82,9 +82,6 @@
 
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
 
-/* Command line configuration */
-#undef CONFIG_CMD_IMLS
-
 #define CONFIG_SYS_HZ                  1000
 
 #define CONFIG_HWCONFIG
index 3fe7b8f44c1b10d0c2bd552f162215ff40fe164e..0993898c3d656aa831da69874435734b671de2df 100644 (file)
 #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
index 002830c27e48f91aa5f39e04c4f0b95d9be3aa1d..1f9efffa5627ee877f5373d683b024fa6a5853ed 100644 (file)
@@ -22,7 +22,7 @@
 #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_NAND_BOOT))
 #define SPL_NO_MMC
 #endif
-#if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SD_BOOT))
+#if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SD_BOOT_QSPI))
 #define SPL_NO_IFC
 #endif
 
index 3547b0bbbcddfb4849be6b5e7effc696900b0ec8..71d0e4e7d19f3f4471ab0b9b774cc90cffda3766 100644 (file)
@@ -35,7 +35,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_QIXIS_I2C_ACCESS
 #define SYS_NO_FLASH
 
-#undef CONFIG_CMD_IMLS
 #define CONFIG_SYS_CLK_FREQ            100000000
 #define CONFIG_DDR_CLK_FREQ            100000000
 #else
index 3223278dfd434e1635c863f8231cb58ccb28f834..39f1345f9793e85a7d307be4f9bdf3cc5c6c9dc8 100644 (file)
@@ -26,7 +26,6 @@
 #if defined(CONFIG_QSPI_BOOT)
 #define CONFIG_QIXIS_I2C_ACCESS
 #define SYS_NO_FLASH
-#undef CONFIG_CMD_IMLS
 #endif
 
 #define CONFIG_SYS_CLK_FREQ            100000000
index dcd1b0c35c5e5db0f1935f0c0d8431c6b55a183d..54d6b51c5528ff601e3b55e7e25d8d2e8c248f76 100644 (file)
@@ -16,7 +16,6 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 #ifdef CONFIG_FSL_QSPI
-#undef CONFIG_CMD_IMLS
 #define CONFIG_QIXIS_I2C_ACCESS
 #define CONFIG_SYS_I2C_EARLY_INIT
 #define CONFIG_SYS_I2C_IFDR_DIV                0x7e
index 145b2856850c48ca6bc2d6b70c33cc87494376a4..9e9979e1c7fc1259fa208fc923ca31866061288d 100644 (file)
@@ -18,7 +18,6 @@
 #define CONFIG_QIXIS_I2C_ACCESS
 #endif
 #define CONFIG_SYS_I2C_EARLY_INIT
-#define CONFIG_DISPLAY_BOARDINFO_LATE
 #endif
 
 #define I2C_MUX_CH_VOL_MONITOR         0xa
@@ -289,19 +288,15 @@ unsigned long get_board_sys_clk(void);
 /* SPI */
 #if defined(CONFIG_FSL_QSPI) || defined(CONFIG_FSL_DSPI)
 #define CONFIG_SPI_FLASH
-#ifdef CONFIG_FSL_QSPI
+#ifdef CONFIG_FSL_DSPI
 #define CONFIG_SPI_FLASH_STMICRO
 #endif
 #ifdef CONFIG_FSL_QSPI
-#ifdef CONFIG_TARGET_LS2081ARDB
-#define CONFIG_SPI_FLASH_STMICRO
-#else
 #define CONFIG_SPI_FLASH_SPANSION
 #endif
 #define FSL_QSPI_FLASH_SIZE            SZ_64M  /* 64MB */
 #define FSL_QSPI_FLASH_NUM             2
 #endif
-#endif
 
 /*
  * RTC configuration
@@ -392,6 +387,7 @@ unsigned long get_board_sys_clk(void);
        "load_addr=0xa0000000\0"                \
        "kernel_size=0x2800000\0"               \
        "console=ttyAMA0,38400n8\0"             \
+       "mcmemsize=0x70000000\0"                \
        MC_INIT_CMD                             \
        BOOTENV                                 \
        "boot_scripts=ls2088ardb_boot.scr\0"    \
index 0fe1bc1c1df2c8fd564a40735a33d0782f423447..5ecc97fbe778849dc127ff6dc667ce7664f2da37 100644 (file)
 #ifdef CONFIG_CMD_USB
 
 /* USB device */
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_MANUFACTURER      "AriesEmbedded"
 #define CONFIG_USB_FUNCTION_MASS_STORAGE
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE   (1 * 1024 * 1024)
 #define DFU_DEFAULT_POLL_TIMEOUT       300
index 66c7001f09c35c13bc37cdd1e5a63093fee2bff3..1b2e0d71b4583a8a80ac85e2e43c7f3e1db1dde7 100644 (file)
@@ -84,7 +84,6 @@
 /*
  * Ethernet Driver configuration
  */
-#define CONFIG_MVNETA          /* Enable Marvell Gbe Controller Driver */
 #define CONFIG_ENV_OVERWRITE   /* ethaddr can be reprogrammed */
 #define CONFIG_ARP_TIMEOUT     200
 #define CONFIG_NET_RETRY_COUNT 50
index a7992ea852c553ac109a7a44513d9d49efa77066..e624ebee71ebc3c57bf89bcb69f7d14f15789e2e 100644 (file)
@@ -68,7 +68,6 @@
 #define CONFIG_CONS_INDEX              1
 #define CONFIG_BAUDRATE                        115200
 
-#undef CONFIG_CMD_IMLS
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_AUTO_COMPLETE
 
index 520a52cbc6cf03a1dee38f1079c2b359cb02b904..b847906310058ebf999f3834b5ff4fe43b327b90 100644 (file)
@@ -19,8 +19,6 @@
 
 #define CONFIG_MISC_INIT_R
 #define CONFIG_USBD_HS
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_CDC
 #define CONFIG_NETCONSOLE
 
 #define CONFIG_MXC_UART
index 4480aaffa0e317ef72e3904536d89d01b6528011..ac00975a8c3f6da951edfbaacfc42b1ed372b39f 100644 (file)
 #define CONFIG_MXC_USB_FLAGS           0
 /* Gadget part */
 #define CONFIG_USBD_HS
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_CDC
 #define CONFIG_NETCONSOLE
 #endif
 
index 2afb19f84a7a9e7f70cc7be19cef212aa060493e..22e9c82497357c5b4226ede394998f2138bd08ec 100644 (file)
        "fdtaddr=40800000\0"
 
 /* GPT */
-#define CONFIG_RANDOM_UUID
 
 /* Security subsystem - enable hw_rand() */
 #define CONFIG_EXYNOS_ACE_SHA
index 8bc7fbde9e36ba93c755c10f8d45ffdbc7314a62..13a45010bf5b3ff0dcd470f4781e63db213f405f 100644 (file)
@@ -45,7 +45,7 @@
 #define DFU_MANIFEST_POLL_TIMEOUT       25000
 
 /* THOR */
-#define CONFIG_G_DNL_THOR_VENDOR_NUM   CONFIG_G_DNL_VENDOR_NUM
+#define CONFIG_G_DNL_THOR_VENDOR_NUM   CONFIG_USB_GADGET_VENDOR_NUM
 #define CONFIG_G_DNL_THOR_PRODUCT_NUM  0x685D
 #define CONFIG_USB_FUNCTION_THOR
 
index 47a50bdaa650fe0583ba4dc41a6c5d90394364bc..06232bdfeacd227bde79fba762889dbdd08da0e9 100644 (file)
@@ -46,7 +46,6 @@
 #define CONFIG_USB_MUSB_OMAP2PLUS
 #define CONFIG_USB_MUSB_PIO_ONLY
 #define CONFIG_TWL4030_USB             1
-#define CONFIG_USB_ETHER
 
 /* USB EHCI */
 
index e9a1cad0f7df7ad4012928455c5e2183b5dc4903..3618d0ec1ad1ce08868a57971e1ba5e857c37e77 100644 (file)
@@ -81,7 +81,6 @@
 #define CONFIG_USB_OMAP3
 #define CONFIG_USB_MUSB_OMAP2PLUS
 #define CONFIG_USB_MUSB_PIO_ONLY
-#define CONFIG_USB_ETHER
 
 /* USB EHCI */
 #define CONFIG_SYS_USB_FAT_BOOT_PARTITION  1
index 5b31223b9ed2de2cd194afeea87bd359932d8f16..f7db79d11c240c1d40ec7567b9e7631836c4ba50 100644 (file)
@@ -57,7 +57,6 @@
 /* USB */
 #define CONFIG_USB_MUSB_OMAP2PLUS
 #define CONFIG_USB_MUSB_PIO_ONLY
-#define CONFIG_USB_ETHER
 
 /* TWL4030 */
 #define CONFIG_TWL4030_USB
index f678b2944dd09f41a8bffc71c9a3ad99ca4eddaa..79f3f48df87e4f8250a15b35d99becd56f162bf1 100644 (file)
 #define CONFIG_AM335X_USB1
 #define CONFIG_AM335X_USB1_MODE MUSB_HOST
 
-#ifdef CONFIG_USB_MUSB_GADGET
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_RNDIS
-#endif /* CONFIG_USB_MUSB_GADGET */
-
 #define CONFIG_PHY_SMSC
 
 #endif /* ! __CONFIG_PCM051_H */
diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
new file mode 100644 (file)
index 0000000..4376a24
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017 Tuomas Tynkkynen
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <linux/sizes.h>
+
+/* Physical memory map */
+#define CONFIG_SYS_TEXT_BASE           0x00000000
+
+#define CONFIG_NR_DRAM_BANKS           1
+#define CONFIG_SYS_SDRAM_BASE          0x40000000
+
+/* The DTB generated by QEMU is placed at start of RAM, stay away from there */
+#define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + SZ_2M)
+#define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + SZ_2M)
+#define CONFIG_SYS_MALLOC_LEN          SZ_16M
+
+/* QEMU's PL011 serial port is detected via FDT using the device model */
+#define CONFIG_PL01X_SERIAL
+
+/* QEMU implements a 62.5MHz architected timer */
+/* FIXME: can we rely on CNTFREQ instead of hardcoding this fact here? */
+#define CONFIG_SYS_ARCH_TIMER
+#define CONFIG_SYS_HZ                       1000
+#define CONFIG_SYS_HZ_CLOCK                 62500000
+
+/* For block devices, QEMU emulates an ICH9 AHCI controller over PCI */
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID 6
+#define CONFIG_SCSI_AHCI
+#define CONFIG_LIBATA
+
+/* Environment options */
+#define CONFIG_ENV_SIZE                                SZ_64K
+
+#include <config_distro_defaults.h>
+
+#define BOOT_TARGET_DEVICES(func) \
+       func(SCSI, scsi, 0)
+
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_PREBOOT "pci enum"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       "fdt_high=0xffffffff\0" \
+       "initrd_high=0xffffffff\0" \
+       "fdt_addr=0x40000000\0" \
+       "scriptaddr=0x40200000\0" \
+       "pxefile_addr_r=0x40300000\0" \
+       "kernel_addr_r=0x40400000\0" \
+       "ramdisk_addr_r=0x44000000\0" \
+       BOOTENV
+
+#endif /* __CONFIG_H */
index e9e3c4013c3c9637e7dbc0de2fd7f480bbb89a1d..34f255847a8c940c793a291c1da72e69795f9804 100644 (file)
 #define CONFIG_SYS_INIT_SP_ADDR                0x00100000
 #define CONFIG_SYS_LOAD_ADDR           0x00800800
 #define CONFIG_SPL_STACK               0xff718000
-#define CONFIG_SPL_TEXT_BASE           0xff704004
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_TPL_BOOTROM_SUPPORT)
+# define CONFIG_SPL_TEXT_BASE          0x0
+#else
+# define CONFIG_SPL_TEXT_BASE          0xff704004
+#endif
 
 /* MMC/SD IP block */
 #define CONFIG_BOUNCE_BUFFER
index b3986c28af43886cc42271bd762f27b7f2735ed3..5e9b6deb48532e514a17890543464d04c509b99a 100644 (file)
@@ -27,8 +27,6 @@
        func(DHCP, dchp, na)
 #endif
 
-#define CONFIG_RANDOM_UUID
-
 #ifdef CONFIG_ARM64
 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"
 #else
index 246b179766f4ee8508d4b6878a139853507df55f..fd1527ce7045de8dc6df18fc48e1ad77f590cc79 100644 (file)
@@ -73,8 +73,6 @@
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_UART_PORT           (1)
 
-#undef CONFIG_CMD_IMLS
-
 #define CONFIG_FSL_ESDHC
 #define CONFIG_FSL_USDHC
 #define CONFIG_SYS_FSL_ESDHC_ADDR      USDHC_BASE_ADDR
index 3ae16dfc6318734a671c3f3c93a26363e69fd077..c52dcd4e8fd21613cd8354f37e83253df550be4e 100644 (file)
@@ -62,9 +62,6 @@
 #endif
 
 /* USB device */
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_MANUFACTURER      "Atmel SAMA5D2_PTC"
 
 /* Ethernet Hardware */
 #define CONFIG_MACB
index 4f24a56899a982caed671cf5d656ada8a3fa4cee..545ba1740de8a5a7efa7e4fb778b45d53ad931b7 100644 (file)
 #define CONFIG_SF_DEFAULT_SPEED                30000000
 #endif
 
-/* LCD */
-
-#ifdef CONFIG_LCD
-#define LCD_BPP                                LCD_COLOR16
-#define LCD_OUTPUT_BPP                  24
-#define CONFIG_LCD_LOGO
-#define CONFIG_LCD_INFO
-#define CONFIG_LCD_INFO_BELOW_LOGO
-#define CONFIG_ATMEL_HLCD
-#define CONFIG_ATMEL_LCD_RGB565
-#endif
-
 #ifdef CONFIG_SD_BOOT
 
 /* bootstrap + u-boot + env in sd card */
index bd93a1e84c37aaff8eabf9e2877ac9b7eef9490c..9ec1e76052685855713fc27d0b0b1ec7fd57a11e 100644 (file)
  */
 #define ATMEL_PMC_UHP                  (1 <<  6)
 
-/* LCD */
-#define LCD_BPP                                LCD_COLOR16
-#define LCD_OUTPUT_BPP                  24
-#define CONFIG_LCD_LOGO
-#define CONFIG_LCD_INFO
-#define CONFIG_LCD_INFO_BELOW_LOGO
-#define CONFIG_ATMEL_HLCD
-#define CONFIG_ATMEL_LCD_RGB565
-
 /* board specific (not enough SRAM) */
 #define CONFIG_SAMA5D3_LCD_BASE                0x23E00000
 
index 5dc5e7dd0c575415ff9e7bc835a8d6a39fc77dd2..6aa4bcc5c55e10b5fbab0343915b99a74cc019f1 100644 (file)
 #define CONFIG_ATMEL_NAND_HW_PMECC
 #endif
 
-/* LCD */
-#ifdef CONFIG_LCD
-#define LCD_BPP                                LCD_COLOR16
-#define LCD_OUTPUT_BPP                  24
-#define CONFIG_LCD_LOGO
-#define CONFIG_LCD_INFO
-#define CONFIG_LCD_INFO_BELOW_LOGO
-#define CONFIG_ATMEL_HLCD
-#define CONFIG_ATMEL_LCD_RGB565
-#endif
-
 /* SPL */
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE           0x200000
index 94e8e893c0619782f8700a74f59dffc3b9ebcf3a..a46e3508bf5a1ec690a946fc390711d91204633c 100644 (file)
 #define CONFIG_ATMEL_NAND_HW_PMECC
 #endif
 
-/* LCD */
-#define LCD_BPP                                LCD_COLOR16
-#define LCD_OUTPUT_BPP                  18
-#define CONFIG_LCD_LOGO
-#define CONFIG_LCD_INFO
-#define CONFIG_LCD_INFO_BELOW_LOGO
-#define CONFIG_ATMEL_HLCD
-#define CONFIG_ATMEL_LCD_RGB565
-
 /* SPL */
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE           0x200000
index 250917b1dc05c8bd6e9fe4b2f395e242b42e5c60..99200140fe5ed4d1b99bcba6c5892e60d7e9d95b 100644 (file)
@@ -39,8 +39,6 @@
 #define CONFIG_EHCI_MXS_PORT0
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_CDC
 #define CONFIG_NETCONSOLE
 #endif
 
index 2314a2d2ef35473626ee7995874f3ad34ccad0b8..1997c2dd5ae4d84e1bb03afc1d4dee03ed5ac9ea 100644 (file)
 #define CONFIG_AM335X_USB1
 #define CONFIG_AM335X_USB1_MODE MUSB_HOST
 
-#ifdef CONFIG_USB_MUSB_GADGET
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR        "de:ad:be:af:00:00"
-#endif /* CONFIG_USB_MUSB_GADGET */
-
 /* USB DRACO ID as default */
 #define CONFIG_USBD_HS
 
index 9897e11b5913461c4ced0d99e4b495249da98099..7b5417a75bca351ad233fcd771857d346a890fb3 100644 (file)
  */
 #ifdef CONFIG_NAND_DENALI
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define CONFIG_SYS_NAND_MAX_CHIPS      1
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_NAND_DENALI_ECC_SIZE    512
 #define CONFIG_SYS_NAND_REGS_BASE      SOCFPGA_NANDREGS_ADDRESS
 #define CONFIG_SYS_NAND_DATA_BASE      SOCFPGA_NANDDATA_ADDRESS
-#define CONFIG_SYS_NAND_BASE           (CONFIG_SYS_NAND_DATA_BASE + 0x10)
 #endif
 
 /*
index 372c08360122b59b0b7f6323dfba5df49bab8afc..958d5cc54c84ea1a0f27f8960c3d33c5debb0685 100644 (file)
 #define CONFIG_NR_DRAM_BANKS           1
 #define PHYS_SDRAM_1                   0x40000000
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
-#define PHYS_SDRAM_1_SIZE              0x3FE00000
+#define PHYS_SDRAM_1_SIZE              0x3E000000
 #define CONFIG_SYS_TEXT_BASE           0x7D600000
 #define CONFIG_SYS_LOAD_ADDR           PHYS_SDRAM_1    /* default load addr */
 
 #define CONFIG_SYS_HZ_CLOCK            1000000000      /* 1 GHz */
 
+#include <config_distro_defaults.h>
 /* Environment */
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       "board= B2260" \
-       "load_addr= #CONFIG_SYS_LOAD_ADDR \0"
+
+#define CONFIG_LOADADDR                        CONFIG_SYS_LOAD_ADDR
+
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+
+#define BOOT_TARGET_DEVICES(func) \
+       func(MMC, mmc, 0) \
+       func(USB, usb, 0) \
+       func(DHCP, dhcp, na)
+#include <config_distro_bootcmd.h>
+#define CONFIG_BOOTFILE                        "uImage"
+#define CONFIG_EXTRA_ENV_SETTINGS                              \
+                       "kernel_addr_r=0x40000000\0"            \
+                       "fdtfile=stih410-b2260.dtb\0"           \
+                       "fdt_addr_r=0x47000000\0"               \
+                       "scriptaddr=0x50000000\0"               \
+                       "fdt_high=0xffffffffffffffff\0"         \
+                       "initrd_high=0xffffffffffffffff\0"      \
+                       "ramdisk_addr_r=0x48000000\0"           \
+                       BOOTENV
+
 
 #define CONFIG_ENV_SIZE 0x4000
 
index b0061cd0de1f8efd360856d1ac5010d2b81990a5..967c5e570210dfa4cfe6233da9d21f97f32c63ff 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #define CONFIG_SYS_FLASH_BASE          0x08000000
-#define CONFIG_SYS_INIT_SP_ADDR                0x30020000
+#define CONFIG_SYS_INIT_SP_ADDR                0x24040000
 #define CONFIG_SYS_TEXT_BASE           0x08000000
 
 /*
index b0061cd0de1f8efd360856d1ac5010d2b81990a5..967c5e570210dfa4cfe6233da9d21f97f32c63ff 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #define CONFIG_SYS_FLASH_BASE          0x08000000
-#define CONFIG_SYS_INIT_SP_ADDR                0x30020000
+#define CONFIG_SYS_INIT_SP_ADDR                0x24040000
 #define CONFIG_SYS_TEXT_BASE           0x08000000
 
 /*
index 02d7be08495d7c9661604ffb65db956aeadfc7e2..91751171ec2bb791256da43359953d719b2f115d 100644 (file)
 #endif
 
 #if defined(CONFIG_ENV_IS_IN_MMC)
-#define CONFIG_SYS_MMC_ENV_DEV         0       /* first detected MMC controller */
+#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
+/* If we have two devices (most likely eMMC + MMC), favour the eMMC */
+#define CONFIG_SYS_MMC_ENV_DEV         1
+#else
+/* Otherwise, use the only device we have */
+#define CONFIG_SYS_MMC_ENV_DEV         0
+#endif
 #define CONFIG_SYS_MMC_MAX_DEVICE      4
 #elif defined(CONFIG_ENV_IS_NOWHERE)
 #define CONFIG_ENV_SIZE                        (128 << 10)
@@ -382,15 +388,28 @@ extern int soft_i2c_gpio_scl;
        "ramdisk ram " RAMDISK_ADDR_R " 0x4000000\0"
 
 #ifdef CONFIG_MMC
-#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
 #if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
-#define BOOT_TARGET_DEVICES_MMC_EXTRA(func) func(MMC, mmc, 1)
+#define BOOTENV_DEV_MMC_AUTO(devtypeu, devtypel, instance)             \
+       BOOTENV_DEV_MMC(MMC, mmc, 0)                                    \
+       BOOTENV_DEV_MMC(MMC, mmc, 1)                                    \
+       "bootcmd_mmc_auto="                                             \
+               "if test ${mmc_bootdev} -eq 1; then "                   \
+                       "run bootcmd_mmc1; "                            \
+                       "run bootcmd_mmc0; "                            \
+               "elif test ${mmc_bootdev} -eq 0; then "                 \
+                       "run bootcmd_mmc0; "                            \
+                       "run bootcmd_mmc1; "                            \
+               "fi\0"
+
+#define BOOTENV_DEV_NAME_MMC_AUTO(devtypeu, devtypel, instance) \
+       "mmc_auto "
+
+#define BOOT_TARGET_DEVICES_MMC(func) func(MMC_AUTO, mmc_auto, na)
 #else
-#define BOOT_TARGET_DEVICES_MMC_EXTRA(func)
+#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
 #endif
 #else
 #define BOOT_TARGET_DEVICES_MMC(func)
-#define BOOT_TARGET_DEVICES_MMC_EXTRA(func)
 #endif
 
 #ifdef CONFIG_AHCI
@@ -418,7 +437,6 @@ extern int soft_i2c_gpio_scl;
 #define BOOT_TARGET_DEVICES(func) \
        func(FEL, fel, na) \
        BOOT_TARGET_DEVICES_MMC(func) \
-       BOOT_TARGET_DEVICES_MMC_EXTRA(func) \
        BOOT_TARGET_DEVICES_SCSI(func) \
        BOOT_TARGET_DEVICES_USB(func) \
        func(PXE, pxe, na) \
index b4311d94cc2a90c41dd281ec77e7234f6e004580..f19a230b7a92ef4b192354c114af7df0a39c5667 100644 (file)
 /* USB EHCI */
 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO       162
 
-#define CONFIG_USB_ETHER
-
 /* Defines for SPL */
 #define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_NAND_SIMPLE
index 238056a65f7f86e1a8a341e826e103ce67adc65a..c20803c5351e96053e9c01530d9cc3bbfc821981 100644 (file)
@@ -46,7 +46,7 @@
        "yocto_tty=" __stringify(DEF_ENV_YOCTO_TTY) "\0"        \
        "start_eth=if test -n \"${eth_init}\";"                 \
                "then run eth_init;else sleep 0;fi\0"           \
-       "kernel-ver=4.8.0-54\0"                                 \
+       "kernel-ver=4.8.0-54-generic\0"                         \
        "boot=zboot 03000000 0 04000000 ${filesize}\0"          \
        "mtdparts=mtdparts=intel-spi:4k(descriptor),7084k(me)," \
                "8k(env1),8k(env2),64k(mrc),640k(u-boot),"      \
@@ -58,7 +58,8 @@
        "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"      \
        "addmisc=setenv bootargs ${bootargs} "                  \
                "intel-spi.writeable=1 vmalloc=300M "           \
-               "pci=realloc=on,hpmemsize=0x12000000\0"         \
+               "pci=realloc=on,hpmemsize=0x12000000,"          \
+               "hpmemprefsize=0,hpiosize=0\0"                  \
        "bootcmd=if env exists recovery_status;"                \
                "then run swupdate;"                            \
                "else run yocto_boot;run swupdate;"             \
@@ -68,9 +69,9 @@
        "ubuntu_args_quiet=setenv bootargs "                    \
                "root=/dev/sda${ubuntu_part} ro quiet\0"        \
        "ubuntu_load=load scsi 0:${ubuntu_part} 03000000 "      \
-               "/boot/vmlinuz-${kernel-ver}-generic;"          \
+               "/boot/vmlinuz-${kernel-ver};"                  \
                "load scsi 0:${ubuntu_part} 04000000 "          \
-               "/boot/initrd.img-${kernel-ver}-generic\0"      \
+               "/boot/initrd.img-${kernel-ver}\0"              \
        "ubuntu_boot=run ubuntu_args_quiet addmtd addmisc "     \
                "ubuntu_load boot\0"                            \
        "ubuntu_boot_console=run ubuntu_args addtty_ubuntu "    \
@@ -79,7 +80,7 @@
        "net_boot=run start_eth net_args addtty_yocto addmtd addmisc;" \
                "tftp 03000000 ${tftpdir}/bzImage;"             \
                "load scsi 0:${ubuntu_part} 04000000 "          \
-               "/boot/initrd.img-${kernel-ver}-generic;"       \
+               "/boot/initrd.img-${kernel-ver};"               \
                "run boot\0"                                    \
        "yocto_args=setenv bootargs root=/dev/sda${yocto_part} " \
                "panic=1\0"                             \
index 2b2b85d085b4d4f3b7520e410c7e6b429202ec13..53046a2110ed6fc68503efc286a354ddabebd5f8 100644 (file)
                                        "${bootdir}/${fit_bootfile}\0"  \
        "get_uboot_net=dhcp ${loadaddr} ${tftp_root}/${name_uboot}\0"   \
        "get_uboot_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_uboot}\0" \
-       "burn_uboot_spi=sf probe; sf erase 0 0x80000; "         \
+       "burn_uboot_spi=sf probe; sf erase 0 0x90000; "         \
                "sf write ${loadaddr} 0 ${filesize}\0"          \
        "burn_uboot_nand=nand erase 0 0x100000; "                       \
                "nand write ${loadaddr} 0 ${filesize}\0"                \
index 5d0a3240a66ae27d4d11a67d71fafc0d027fea8d..5b33a3b18e77a4348ab390e8ba92f35369aebf49 100644 (file)
 #define CONFIG_SYS_SPL_ARGS_ADDR        CONFIG_SYS_SDRAM_BASE + 0x100
 
 /* GPT */
-#define CONFIG_RANDOM_UUID
 
 /* Security subsystem - enable hw_rand() */
 #define CONFIG_EXYNOS_ACE_SHA
index 7f6a61a1db63406a4e3ae627daaebf1f9896bc76..95c011f9a90558ce73b0ad0d945fe661fd278d11 100644 (file)
        "fdtaddr=40800000\0" \
 
 /* GPT */
-#define CONFIG_RANDOM_UUID
 
 /* Security subsystem - enable hw_rand() */
 #define CONFIG_EXYNOS_ACE_SHA
index aaed8150b53e814d3f7a766d350c05447a61fbcc..0084051ba167d7079a1a9bae0cc98221c9b02088 100644 (file)
 #define CONFIG_SYS_MMC_CLK_OD          500000
 
 /* For generating MMC partitions */
-#define CONFIG_RANDOM_UUID
 
 #endif
 
 /* USB device */
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_MANUFACTURER      "L+G VInCo"
 
 /* Ethernet Hardware */
 #define CONFIG_PHY_SMSC
index 9d6c80f5499468cf12f4bcd25b6bb7bc3c0a3775..8774e4243042ee1a2dfc18bb9dd3269645193435 100644 (file)
 #define CONFIG_SYS_MMC_ENV_DEV 1
 #undef CONFIG_CMD_USB_MASS_STORAGE
 
+#ifndef CONFIG_TPL_BUILD
+
+#define CONFIG_SPL_OS_BOOT
+
+/* Falcon Mode */
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME   "args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_CMD_SPL
+#define CONFIG_SYS_SPL_ARGS_ADDR       0x0ffe5000
+#define CONFIG_CMD_SPL_WRITE_SIZE      (128 * SZ_1K)
+
+/* Falcon Mode - MMC support: args@1MB kernel@2MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x800   /* 1MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR        0x1000  /* 2MB */
+#endif
+
 #endif
index 75ae8a3e3338be93cdaf6b851fdf9587a1cc8627..11f1bc3eab75c9f3f95416da5c5dae387e8593eb 100644 (file)
 #define CONFIG_SYS_DFU_DATA_BUF_SIZE   SZ_16M
 #define DFU_DEFAULT_POLL_TIMEOUT       300
 
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_CDC
-#define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR                "de:ad:be:af:00:00"
 #define CONFIG_USBNET_DEV_ADDR         "de:ad:be:af:00:01"
 
 #endif
index 73f431681db3cf8c25baee72eec59ca2a70035b0..1e70a762e0d9e6991044f338914633dfd35f7913 100644 (file)
@@ -39,8 +39,6 @@
 #define CONFIG_EHCI_MXS_PORT0
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
 
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_CDC
 #define CONFIG_NETCONSOLE
 #endif
 
index 6025706964a3a255b483200ef7689782f6365539..1399dfd436bc8697e7ab0a3c7f973beb8aa5dcec 100644 (file)
                DFU_ALT_INFO_RAM
 
 #ifndef CONFIG_SPL_BUILD
-# define CONFIG_RANDOM_UUID
 # define PARTS_DEFAULT \
        "partitions=uuid_disk=${uuid_gpt_disk};" \
        "name=""boot"",size=16M,uuid=${uuid_gpt_boot};" \
index 4866f7c0028b9c81ad85cc10468ce60713e707a3..813e49f330fa3d7730e6da992d51dbdff3e0e36b 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/compat.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
+#include <linux/printk.h>
 
 struct driver_info;
 
@@ -879,4 +880,75 @@ static inline void devm_kfree(struct udevice *dev, void *ptr)
 
 #endif /* ! CONFIG_DEVRES */
 
+/*
+ * REVISIT:
+ * remove the following after resolving conflicts with <linux/compat.h>
+ */
+#ifdef dev_dbg
+#undef dev_dbg
+#endif
+#ifdef dev_vdbg
+#undef dev_vdbg
+#endif
+#ifdef dev_info
+#undef dev_info
+#endif
+#ifdef dev_err
+#undef dev_err
+#endif
+#ifdef dev_warn
+#undef dev_warn
+#endif
+
+/*
+ * REVISIT:
+ * print device name like Linux
+ */
+#define dev_printk(dev, fmt, ...)                              \
+({                                                             \
+       printk(fmt, ##__VA_ARGS__);                             \
+})
+
+#define __dev_printk(level, dev, fmt, ...)                     \
+({                                                             \
+       if (level < CONFIG_VAL(LOGLEVEL))                       \
+               dev_printk(dev, fmt, ##__VA_ARGS__);            \
+})
+
+#define dev_emerg(dev, fmt, ...) \
+       __dev_printk(0, dev, fmt, ##__VA_ARGS__)
+#define dev_alert(dev, fmt, ...) \
+       __dev_printk(1, dev, fmt, ##__VA_ARGS__)
+#define dev_crit(dev, fmt, ...) \
+       __dev_printk(2, dev, fmt, ##__VA_ARGS__)
+#define dev_err(dev, fmt, ...) \
+       __dev_printk(3, dev, fmt, ##__VA_ARGS__)
+#define dev_warn(dev, fmt, ...) \
+       __dev_printk(4, dev, fmt, ##__VA_ARGS__)
+#define dev_notice(dev, fmt, ...) \
+       __dev_printk(5, dev, fmt, ##__VA_ARGS__)
+#define dev_info(dev, fmt, ...) \
+       __dev_printk(6, dev, fmt, ##__VA_ARGS__)
+
+#ifdef DEBUG
+#define dev_dbg(dev, fmt, ...) \
+       __dev_printk(7, dev, fmt, ##__VA_ARGS__)
+#else
+#define dev_dbg(dev, fmt, ...)                                 \
+({                                                             \
+       if (0)                                                  \
+               __dev_printk(7, dev, fmt, ##__VA_ARGS__);       \
+})
+#endif
+
+#ifdef VERBOSE_DEBUG
+#define dev_vdbg       dev_dbg
+#else
+#define dev_vdbg(dev, fmt, ...)                                        \
+({                                                             \
+       if (0)                                                  \
+               __dev_printk(7, dev, fmt, ##__VA_ARGS__);       \
+})
+#endif
+
 #endif
index e7f71256a8c2c91ccfdf03df159dba96bed6d265..8114037e9771d1110b45a648f82cdf8358666bfb 100644 (file)
@@ -165,6 +165,29 @@ const char *dev_read_name(struct udevice *dev);
 int dev_read_stringlist_search(struct udevice *dev, const char *property,
                          const char *string);
 
+/**
+ * dev_read_string_index() - obtain an indexed string from a string list
+ *
+ * @dev: device to examine
+ * @propname: name of the property containing the string list
+ * @index: index of the string to return
+ * @out: return location for the string
+ *
+ * @return:
+ *   length of string, if found or -ve error value if not found
+ */
+int dev_read_string_index(struct udevice *dev, const char *propname, int index,
+                         const char **outp);
+
+/**
+ * dev_read_string_count() - find the number of strings in a string list
+ *
+ * @dev: device to examine
+ * @propname: name of the property containing the string list
+ * @return:
+ *   number of strings in the list, or -ve error value if not found
+ */
+int dev_read_string_count(struct udevice *dev, const char *propname);
 /**
  * dev_read_phandle_with_args() - Find a node pointed by phandle in a list
  *
@@ -451,6 +474,19 @@ static inline int dev_read_stringlist_search(struct udevice *dev,
        return ofnode_stringlist_search(dev_ofnode(dev), propname, string);
 }
 
+static inline int dev_read_string_index(struct udevice *dev,
+                                       const char *propname, int index,
+                                       const char **outp)
+{
+       return ofnode_read_string_index(dev_ofnode(dev), propname, index, outp);
+}
+
+static inline int dev_read_string_count(struct udevice *dev,
+                                       const char *propname)
+{
+       return ofnode_read_string_count(dev_ofnode(dev), propname);
+}
+
 static inline int dev_read_phandle_with_args(struct udevice *dev,
                const char *list_name, const char *cells_name, int cell_count,
                int index, struct ofnode_phandle_args *out_args)
index 45529ce0e6a17db2653a56aa919ea898da674518..0d4ce8f4e6fe042bfab4242a26a4028a892541c3 100644 (file)
@@ -15,14 +15,6 @@ static inline void dm_warn(const char *fmt, ...)
 }
 #endif
 
-#ifdef DEBUG
-void dm_dbg(const char *fmt, ...);
-#else
-static inline void dm_dbg(const char *fmt, ...)
-{
-}
-#endif
-
 struct list_head;
 
 /**
index d2ad3bb52dcf4c1d8ec749b7ae2f4446a7b5a0fb..7defc6b282c46adf11f9e8ab58fc939aa30a3062 100644 (file)
@@ -39,6 +39,7 @@
 #define SCLK_MAC_TX                    88
 #define SCLK_MACREF                    89
 #define SCLK_MACREF_OUT                        90
+#define SCLK_SARADC                    91
 
 
 /* aclk gates */
@@ -67,6 +68,7 @@
 #define PCLK_TIMER                     270
 #define PCLK_PERI                      271
 #define PCLK_GMAC                      272
+#define PCLK_SARADC                    273
 
 /* hclk gates */
 #define HCLK_I2S0_8CH                  320
diff --git a/include/dt-bindings/clock/sun8i-a23-a33-ccu.h b/include/dt-bindings/clock/sun8i-a23-a33-ccu.h
new file mode 100644 (file)
index 0000000..f8222b6
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2016 Maxime Ripard <maxime.ripard@free-electrons.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.
+ */
+
+#ifndef _DT_BINDINGS_CLK_SUN8I_A23_A33_H_
+#define _DT_BINDINGS_CLK_SUN8I_A23_A33_H_
+
+#define CLK_CPUX               18
+
+#define CLK_BUS_MIPI_DSI       23
+#define CLK_BUS_SS             24
+#define CLK_BUS_DMA            25
+#define CLK_BUS_MMC0           26
+#define CLK_BUS_MMC1           27
+#define CLK_BUS_MMC2           28
+#define CLK_BUS_NAND           29
+#define CLK_BUS_DRAM           30
+#define CLK_BUS_HSTIMER                31
+#define CLK_BUS_SPI0           32
+#define CLK_BUS_SPI1           33
+#define CLK_BUS_OTG            34
+#define CLK_BUS_EHCI           35
+#define CLK_BUS_OHCI           36
+#define CLK_BUS_VE             37
+#define CLK_BUS_LCD            38
+#define CLK_BUS_CSI            39
+#define CLK_BUS_DE_BE          40
+#define CLK_BUS_DE_FE          41
+#define CLK_BUS_GPU            42
+#define CLK_BUS_MSGBOX         43
+#define CLK_BUS_SPINLOCK       44
+#define CLK_BUS_DRC            45
+#define CLK_BUS_SAT            46
+#define CLK_BUS_CODEC          47
+#define CLK_BUS_PIO            48
+#define CLK_BUS_I2S0           49
+#define CLK_BUS_I2S1           50
+#define CLK_BUS_I2C0           51
+#define CLK_BUS_I2C1           52
+#define CLK_BUS_I2C2           53
+#define CLK_BUS_UART0          54
+#define CLK_BUS_UART1          55
+#define CLK_BUS_UART2          56
+#define CLK_BUS_UART3          57
+#define CLK_BUS_UART4          58
+#define CLK_NAND               59
+#define CLK_MMC0               60
+#define CLK_MMC0_SAMPLE                61
+#define CLK_MMC0_OUTPUT                62
+#define CLK_MMC1               63
+#define CLK_MMC1_SAMPLE                64
+#define CLK_MMC1_OUTPUT                65
+#define CLK_MMC2               66
+#define CLK_MMC2_SAMPLE                67
+#define CLK_MMC2_OUTPUT                68
+#define CLK_SS                 69
+#define CLK_SPI0               70
+#define CLK_SPI1               71
+#define CLK_I2S0               72
+#define CLK_I2S1               73
+#define CLK_USB_PHY0           74
+#define CLK_USB_PHY1           75
+#define CLK_USB_HSIC           76
+#define CLK_USB_HSIC_12M       77
+#define CLK_USB_OHCI           78
+
+#define CLK_DRAM_VE            80
+#define CLK_DRAM_CSI           81
+#define CLK_DRAM_DRC           82
+#define CLK_DRAM_DE_FE         83
+#define CLK_DRAM_DE_BE         84
+#define CLK_DE_BE              85
+#define CLK_DE_FE              86
+#define CLK_LCD_CH0            87
+#define CLK_LCD_CH1            88
+#define CLK_CSI_SCLK           89
+#define CLK_CSI_MCLK           90
+#define CLK_VE                 91
+#define CLK_AC_DIG             92
+#define CLK_AC_DIG_4X          93
+#define CLK_AVS                        94
+
+#define CLK_DSI_SCLK           96
+#define CLK_DSI_DPHY           97
+#define CLK_DRC                        98
+#define CLK_GPU                        99
+#define CLK_ATS                        100
+
+#endif /* _DT_BINDINGS_CLK_SUN8I_A23_A33_H_ */
diff --git a/include/dt-bindings/reset/sun8i-a23-a33-ccu.h b/include/dt-bindings/reset/sun8i-a23-a33-ccu.h
new file mode 100644 (file)
index 0000000..6121f2b
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2016 Maxime Ripard <maxime.ripard@free-electrons.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.
+ */
+
+#ifndef _DT_BINDINGS_RST_SUN8I_A23_A33_H_
+#define _DT_BINDINGS_RST_SUN8I_A23_A33_H_
+
+#define RST_USB_PHY0           0
+#define RST_USB_PHY1           1
+#define RST_USB_HSIC           2
+#define RST_MBUS               3
+#define RST_BUS_MIPI_DSI       4
+#define RST_BUS_SS             5
+#define RST_BUS_DMA            6
+#define RST_BUS_MMC0           7
+#define RST_BUS_MMC1           8
+#define RST_BUS_MMC2           9
+#define RST_BUS_NAND           10
+#define RST_BUS_DRAM           11
+#define RST_BUS_HSTIMER                12
+#define RST_BUS_SPI0           13
+#define RST_BUS_SPI1           14
+#define RST_BUS_OTG            15
+#define RST_BUS_EHCI           16
+#define RST_BUS_OHCI           17
+#define RST_BUS_VE             18
+#define RST_BUS_LCD            19
+#define RST_BUS_CSI            20
+#define RST_BUS_DE_BE          21
+#define RST_BUS_DE_FE          22
+#define RST_BUS_GPU            23
+#define RST_BUS_MSGBOX         24
+#define RST_BUS_SPINLOCK       25
+#define RST_BUS_DRC            26
+#define RST_BUS_SAT            27
+#define RST_BUS_LVDS           28
+#define RST_BUS_CODEC          29
+#define RST_BUS_I2S0           30
+#define RST_BUS_I2S1           31
+#define RST_BUS_I2C0           32
+#define RST_BUS_I2C1           33
+#define RST_BUS_I2C2           34
+#define RST_BUS_UART0          35
+#define RST_BUS_UART1          36
+#define RST_BUS_UART2          37
+#define RST_BUS_UART3          38
+#define RST_BUS_UART4          39
+
+#endif /* _DT_BINDINGS_RST_SUN8I_A23_A33_H_ */
index 02b78b31b129928446ff1f71297b5d2b8e7e2eb3..dc8edc8743aca2f1b30f967c268c63ee616dbaa2 100644 (file)
 
 struct efi_device_path;
 
+typedef struct {
+       u8 b[16];
+} efi_guid_t;
+
 #define EFI_BITS_PER_LONG      BITS_PER_LONG
 
 /*
@@ -77,6 +81,8 @@ struct efi_device_path;
 #define EFI_IP_ADDRESS_CONFLICT                (EFI_ERROR_MASK | 34)
 #define EFI_HTTP_ERROR                 (EFI_ERROR_MASK | 35)
 
+#define EFI_WARN_DELETE_FAILURE        2
+
 typedef unsigned long efi_status_t;
 typedef u64 efi_physical_addr_t;
 typedef u64 efi_virtual_addr_t;
@@ -116,7 +122,7 @@ enum efi_mem_type {
        /* The code portions of a loaded Boot Services Driver */
        EFI_BOOT_SERVICES_CODE,
        /*
-        * The data portions of a loaded Boot Serves Driver and
+        * The data portions of a loaded Boot Services Driver and
         * the default data allocation type used by a Boot Services
         * Driver to allocate pool memory.
         */
@@ -318,6 +324,25 @@ extern char image_base[];
 /* Start and end of U-Boot image (for payload) */
 extern char _binary_u_boot_bin_start[], _binary_u_boot_bin_end[];
 
+/*
+ * Variable Attributes
+ */
+#define EFI_VARIABLE_NON_VOLATILE       0x0000000000000001
+#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
+#define EFI_VARIABLE_RUNTIME_ACCESS     0x0000000000000004
+#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x0000000000000008
+#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x0000000000000010
+#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000000000000020
+#define EFI_VARIABLE_APPEND_WRITE      0x0000000000000040
+
+#define EFI_VARIABLE_MASK      (EFI_VARIABLE_NON_VOLATILE | \
+                               EFI_VARIABLE_BOOTSERVICE_ACCESS | \
+                               EFI_VARIABLE_RUNTIME_ACCESS | \
+                               EFI_VARIABLE_HARDWARE_ERROR_RECORD | \
+                               EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS | \
+                               EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | \
+                               EFI_VARIABLE_APPEND_WRITE)
+
 /**
  * efi_get_sys_table() - Get access to the main EFI system table
  *
index ec1b321e8e70bc1158fe6503bfaf9f0afc94bcb0..c3b9032a48d2919d6c0cf5a673bc9319f6a5ce1f 100644 (file)
@@ -29,6 +29,8 @@ enum efi_timer_delay {
 };
 
 #define UINTN size_t
+typedef long INTN;
+typedef uint16_t *efi_string_t;
 
 #define EVT_TIMER                              0x80000000
 #define EVT_RUNTIME                            0x40000000
@@ -211,6 +213,10 @@ struct efi_runtime_services {
        EFI_GUID(0x00000000, 0x0000, 0x0000, 0x00, 0x00, \
                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
 
+#define EFI_GLOBAL_VARIABLE_GUID \
+       EFI_GUID(0x8be4df61, 0x93ca, 0x11d2, 0xaa, 0x0d, \
+                0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c)
+
 #define LOADED_IMAGE_PROTOCOL_GUID \
        EFI_GUID(0x5b1b31a1, 0x9562, 0x11d2, 0x8e, 0x3f, \
                 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
@@ -284,28 +290,93 @@ struct efi_device_path {
        u8 type;
        u8 sub_type;
        u16 length;
-};
+} __packed;
 
 struct efi_mac_addr {
        u8 addr[32];
-};
+} __packed;
+
+#define DEVICE_PATH_TYPE_HARDWARE_DEVICE       0x01
+#  define DEVICE_PATH_SUB_TYPE_VENDOR          0x04
+
+struct efi_device_path_vendor {
+       struct efi_device_path dp;
+       efi_guid_t guid;
+       u8 vendor_data[];
+} __packed;
+
+#define DEVICE_PATH_TYPE_ACPI_DEVICE           0x02
+#  define DEVICE_PATH_SUB_TYPE_ACPI_DEVICE     0x01
+
+#define EFI_PNP_ID(ID)                         (u32)(((ID) << 16) | 0x41D0)
+#define EISA_PNP_ID(ID)                                EFI_PNP_ID(ID)
+#define EISA_PNP_NUM(ID)                       ((ID) >> 16)
+
+struct efi_device_path_acpi_path {
+       struct efi_device_path dp;
+       u32 hid;
+       u32 uid;
+} __packed;
 
 #define DEVICE_PATH_TYPE_MESSAGING_DEVICE      0x03
+#  define DEVICE_PATH_SUB_TYPE_MSG_USB         0x05
 #  define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR    0x0b
+#  define DEVICE_PATH_SUB_TYPE_MSG_USB_CLASS   0x0f
+#  define DEVICE_PATH_SUB_TYPE_MSG_SD          0x1a
+#  define DEVICE_PATH_SUB_TYPE_MSG_MMC         0x1d
+
+struct efi_device_path_usb {
+       struct efi_device_path dp;
+       u8 parent_port_number;
+       u8 usb_interface;
+} __packed;
 
 struct efi_device_path_mac_addr {
        struct efi_device_path dp;
        struct efi_mac_addr mac;
        u8 if_type;
-};
+} __packed;
+
+struct efi_device_path_usb_class {
+       struct efi_device_path dp;
+       u16 vendor_id;
+       u16 product_id;
+       u8 device_class;
+       u8 device_subclass;
+       u8 device_protocol;
+} __packed;
+
+struct efi_device_path_sd_mmc_path {
+       struct efi_device_path dp;
+       u8 slot_number;
+} __packed;
 
 #define DEVICE_PATH_TYPE_MEDIA_DEVICE          0x04
+#  define DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH 0x01
+#  define DEVICE_PATH_SUB_TYPE_CDROM_PATH      0x02
 #  define DEVICE_PATH_SUB_TYPE_FILE_PATH       0x04
 
+struct efi_device_path_hard_drive_path {
+       struct efi_device_path dp;
+       u32 partition_number;
+       u64 partition_start;
+       u64 partition_end;
+       u8 partition_signature[16];
+       u8 partmap_type;
+       u8 signature_type;
+} __packed;
+
+struct efi_device_path_cdrom_path {
+       struct efi_device_path dp;
+       u32 boot_entry;
+       u64 partition_start;
+       u64 partition_end;
+} __packed;
+
 struct efi_device_path_file_path {
        struct efi_device_path dp;
-       u16 str[32];
-};
+       u16 str[];
+} __packed;
 
 #define BLOCK_IO_GUID \
        EFI_GUID(0x964e5b21, 0x6459, 0x11d2, \
@@ -358,10 +429,10 @@ struct efi_simple_text_output_protocol {
        void *reset;
        efi_status_t (EFIAPI *output_string)(
                        struct efi_simple_text_output_protocol *this,
-                       const unsigned short *str);
+                       const efi_string_t str);
        efi_status_t (EFIAPI *test_string)(
                        struct efi_simple_text_output_protocol *this,
-                       const unsigned short *str);
+                       const efi_string_t str);
        efi_status_t(EFIAPI *query_mode)(
                        struct efi_simple_text_output_protocol *this,
                        unsigned long mode_number, unsigned long *columns,
@@ -423,22 +494,14 @@ struct efi_console_control_protocol
        EFI_GUID(0x8b843e20, 0x8132, 0x4852, \
                 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c)
 
-struct efi_device_path_protocol
-{
-       uint8_t type;
-       uint8_t sub_type;
-       uint16_t length;
-       uint8_t data[];
-};
-
 struct efi_device_path_to_text_protocol
 {
        uint16_t *(EFIAPI *convert_device_node_to_text)(
-                       struct efi_device_path_protocol *device_node,
+                       struct efi_device_path *device_node,
                        bool display_only,
                        bool allow_shortcuts);
        uint16_t *(EFIAPI *convert_device_path_to_text)(
-                       struct efi_device_path_protocol *device_path,
+                       struct efi_device_path *device_path,
                        bool display_only,
                        bool allow_shortcuts);
 };
@@ -609,4 +672,69 @@ struct efi_pxe {
        struct efi_pxe_mode *mode;
 };
 
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
+       EFI_GUID(0x964e5b22, 0x6459, 0x11d2, \
+                0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
+#define EFI_FILE_PROTOCOL_REVISION 0x00010000
+
+struct efi_file_handle {
+       u64 rev;
+       efi_status_t (EFIAPI *open)(struct efi_file_handle *file,
+                       struct efi_file_handle **new_handle,
+                       s16 *file_name, u64 open_mode, u64 attributes);
+       efi_status_t (EFIAPI *close)(struct efi_file_handle *file);
+       efi_status_t (EFIAPI *delete)(struct efi_file_handle *file);
+       efi_status_t (EFIAPI *read)(struct efi_file_handle *file,
+                       u64 *buffer_size, void *buffer);
+       efi_status_t (EFIAPI *write)(struct efi_file_handle *file,
+                       u64 *buffer_size, void *buffer);
+       efi_status_t (EFIAPI *getpos)(struct efi_file_handle *file,
+                       u64 *pos);
+       efi_status_t (EFIAPI *setpos)(struct efi_file_handle *file,
+                       u64 pos);
+       efi_status_t (EFIAPI *getinfo)(struct efi_file_handle *file,
+                       efi_guid_t *info_type, u64 *buffer_size, void *buffer);
+       efi_status_t (EFIAPI *setinfo)(struct efi_file_handle *file,
+                       efi_guid_t *info_type, u64 buffer_size, void *buffer);
+       efi_status_t (EFIAPI *flush)(struct efi_file_handle *file);
+};
+
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
+       EFI_GUID(0x964e5b22, 0x6459, 0x11d2, \
+                0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000
+
+struct efi_simple_file_system_protocol {
+       u64 rev;
+       efi_status_t (EFIAPI *open_volume)(struct efi_simple_file_system_protocol *this,
+                       struct efi_file_handle **root);
+};
+
+#define EFI_FILE_INFO_GUID \
+       EFI_GUID(0x9576e92, 0x6d3f, 0x11d2, \
+                0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
+
+#define EFI_FILE_MODE_READ     0x0000000000000001
+#define EFI_FILE_MODE_WRITE    0x0000000000000002
+#define EFI_FILE_MODE_CREATE   0x8000000000000000
+
+#define EFI_FILE_READ_ONLY     0x0000000000000001
+#define EFI_FILE_HIDDEN                0x0000000000000002
+#define EFI_FILE_SYSTEM                0x0000000000000004
+#define EFI_FILE_RESERVED      0x0000000000000008
+#define EFI_FILE_DIRECTORY     0x0000000000000010
+#define EFI_FILE_ARCHIVE       0x0000000000000020
+#define EFI_FILE_VALID_ATTR    0x0000000000000037
+
+struct efi_file_info {
+       u64 size;
+       u64 file_size;
+       u64 physical_size;
+       struct efi_time create_time;
+       struct efi_time last_access_time;
+       struct efi_time modification_time;
+       u64 attribute;
+       s16 file_name[0];
+};
+
 #endif
index 1179234f6836b6e7aaa942cbed3e1a701aee2737..2f081f899658ceca83fa8f0abbf96c5c87f43814 100644 (file)
@@ -17,6 +17,7 @@
 
 int __efi_entry_check(void);
 int __efi_exit_check(void);
+const char *__efi_nesting(void);
 const char *__efi_nesting_inc(void);
 const char *__efi_nesting_dec(void);
 
@@ -41,9 +42,22 @@ const char *__efi_nesting_dec(void);
        })
 
 /*
- * Callback into UEFI world from u-boot:
+ * Call non-void UEFI function from u-boot and retrieve return value:
  */
-#define EFI_CALL(exp) do { \
+#define EFI_CALL(exp) ({ \
+       debug("%sEFI: Call: %s\n", __efi_nesting_inc(), #exp); \
+       assert(__efi_exit_check()); \
+       typeof(exp) _r = exp; \
+       assert(__efi_entry_check()); \
+       debug("%sEFI: %lu returned by %s\n", __efi_nesting_dec(), \
+             (unsigned long)((uintptr_t)_r & ~EFI_ERROR_MASK), #exp); \
+       _r; \
+})
+
+/*
+ * Call void UEFI function from u-boot:
+ */
+#define EFI_CALL_VOID(exp) do { \
        debug("%sEFI: Call: %s\n", __efi_nesting_inc(), #exp); \
        assert(__efi_exit_check()); \
        exp; \
@@ -51,6 +65,13 @@ const char *__efi_nesting_dec(void);
        debug("%sEFI: Return From: %s\n", __efi_nesting_dec(), #exp); \
        } while(0)
 
+/*
+ * Write GUID
+ */
+#define EFI_PRINT_GUID(txt, guid) ({ \
+       debug("%sEFI: %s %pUl\n", __efi_nesting(), txt, guid); \
+       })
+
 extern struct efi_runtime_services efi_runtime_services;
 extern struct efi_system_table systab;
 
@@ -59,10 +80,15 @@ extern struct efi_simple_input_interface efi_con_in;
 extern const struct efi_console_control_protocol efi_console_control;
 extern const struct efi_device_path_to_text_protocol efi_device_path_to_text;
 
+uint16_t *efi_dp_str(struct efi_device_path *dp);
+
+extern const efi_guid_t efi_global_variable_guid;
 extern const efi_guid_t efi_guid_console_control;
 extern const efi_guid_t efi_guid_device_path;
 extern const efi_guid_t efi_guid_loaded_image;
 extern const efi_guid_t efi_guid_device_path_to_text_protocol;
+extern const efi_guid_t efi_simple_file_system_protocol_guid;
+extern const efi_guid_t efi_file_info_guid;
 
 extern unsigned int __efi_runtime_start, __efi_runtime_stop;
 extern unsigned int __efi_runtime_rel_start, __efi_runtime_rel_stop;
@@ -110,7 +136,8 @@ struct efi_object {
  * @nofify_function:   Function to call when the event is triggered
  * @notify_context:    Data to be passed to the notify function
  * @trigger_type:      Type of timer, see efi_set_timer
- * @signaled:          The notify function was already called
+ * @queued:            The notification functionis queued
+ * @signaled:          The event occured
  */
 struct efi_event {
        uint32_t type;
@@ -120,6 +147,7 @@ struct efi_event {
        u64 trigger_next;
        u64 trigger_time;
        enum efi_timer_delay trigger_type;
+       int queued;
        int signaled;
 };
 
@@ -134,10 +162,13 @@ int efi_disk_register(void);
 /* Called by bootefi to make GOP (graphical) interface available */
 int efi_gop_register(void);
 /* Called by bootefi to make the network interface available */
-int efi_net_register(void **handle);
+int efi_net_register(void);
 /* Called by bootefi to make SMBIOS tables available */
 void efi_smbios_register(void);
 
+struct efi_simple_file_system_protocol *
+efi_fs_from_path(struct efi_device_path *fp);
+
 /* Called by networking code to memorize the dhcp ack package */
 void efi_net_set_dhcp_ack(void *pkt, int len);
 
@@ -166,6 +197,14 @@ efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,
 /* Call this to signal an event */
 void efi_signal_event(struct efi_event *event);
 
+/* open file system: */
+struct efi_simple_file_system_protocol *efi_simple_file_system(
+               struct blk_desc *desc, int part, struct efi_device_path *dp);
+
+/* open file from device-path: */
+struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp);
+
+
 /* Generic EFI memory allocator, call this to get memory */
 void *efi_alloc(uint64_t len, int memory_type);
 /* More specific EFI memory allocator, called by EFI payloads */
@@ -191,12 +230,43 @@ uint64_t efi_add_memory_map(uint64_t start, uint64_t pages, int memory_type,
 int efi_memory_init(void);
 /* Adds new or overrides configuration table entry to the system table */
 efi_status_t efi_install_configuration_table(const efi_guid_t *guid, void *table);
+void efi_setup_loaded_image(struct efi_loaded_image *info, struct efi_object *obj,
+                           struct efi_device_path *device_path,
+                           struct efi_device_path *file_path);
+efi_status_t efi_load_image_from_path(struct efi_device_path *file_path,
+                                     void **buffer);
 
 #ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER
 extern void *efi_bounce_buffer;
 #define EFI_LOADER_BOUNCE_BUFFER_SIZE (64 * 1024 * 1024)
 #endif
 
+
+struct efi_device_path *efi_dp_next(const struct efi_device_path *dp);
+int efi_dp_match(struct efi_device_path *a, struct efi_device_path *b);
+struct efi_object *efi_dp_find_obj(struct efi_device_path *dp,
+                                  struct efi_device_path **rem);
+unsigned efi_dp_size(const struct efi_device_path *dp);
+struct efi_device_path *efi_dp_dup(const struct efi_device_path *dp);
+struct efi_device_path *efi_dp_append(const struct efi_device_path *dp1,
+                                     const struct efi_device_path *dp2);
+struct efi_device_path *efi_dp_append_node(const struct efi_device_path *dp,
+                                          const struct efi_device_path *node);
+
+
+struct efi_device_path *efi_dp_from_dev(struct udevice *dev);
+struct efi_device_path *efi_dp_from_part(struct blk_desc *desc, int part);
+struct efi_device_path *efi_dp_from_file(struct blk_desc *desc, int part,
+                                        const char *path);
+struct efi_device_path *efi_dp_from_eth(void);
+void efi_dp_split_file_path(struct efi_device_path *full_path,
+                           struct efi_device_path **device_path,
+                           struct efi_device_path **file_path);
+
+#define EFI_DP_TYPE(_dp, _type, _subtype) \
+       (((_dp)->type == DEVICE_PATH_TYPE_##_type) && \
+        ((_dp)->sub_type == DEVICE_PATH_SUB_TYPE_##_subtype))
+
 /* Convert strings from normal C strings to uEFI strings */
 static inline void ascii2unicode(u16 *unicode, const char *ascii)
 {
@@ -233,6 +303,28 @@ efi_status_t __efi_runtime EFIAPI efi_get_time(
                        struct efi_time_cap *capabilities);
 void efi_get_time_init(void);
 
+#ifdef CONFIG_CMD_BOOTEFI_SELFTEST
+/*
+ * Entry point for the tests of the EFI API.
+ * It is called by 'bootefi selftest'
+ */
+efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
+                                struct efi_system_table *systab);
+#endif
+
+efi_status_t EFIAPI efi_get_variable(s16 *variable_name,
+               efi_guid_t *vendor, u32 *attributes,
+               unsigned long *data_size, void *data);
+efi_status_t EFIAPI efi_get_next_variable(
+               unsigned long *variable_name_size,
+               s16 *variable_name, efi_guid_t *vendor);
+efi_status_t EFIAPI efi_set_variable(s16 *variable_name,
+               efi_guid_t *vendor, u32 attributes,
+               unsigned long data_size, void *data);
+
+void *efi_bootmgr_load(struct efi_device_path **device_path,
+                      struct efi_device_path **file_path);
+
 #else /* defined(EFI_LOADER) && !defined(CONFIG_SPL_BUILD) */
 
 /* Without CONFIG_EFI_LOADER we don't have a runtime section, stub it out */
diff --git a/include/efi_selftest.h b/include/efi_selftest.h
new file mode 100644 (file)
index 0000000..76304a2
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ *  EFI application loader
+ *
+ *  Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
+ *
+ *  SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef _EFI_SELFTEST_H
+#define _EFI_SELFTEST_H
+
+#include <common.h>
+#include <efi.h>
+#include <efi_api.h>
+#include <linker_lists.h>
+
+/*
+ * Prints an error message.
+ *
+ * @...        format string followed by fields to print
+ */
+#define efi_st_error(...) \
+       efi_st_printf("%s(%u):\nERROR: ", __FILE__, __LINE__); \
+       efi_st_printf(__VA_ARGS__) \
+
+/*
+ * A test may be setup and executed at boottime,
+ * it may be setup at boottime and executed at runtime,
+ * or it may be setup and executed at runtime.
+ */
+enum efi_test_phase {
+       EFI_EXECUTE_BEFORE_BOOTTIME_EXIT = 1,
+       EFI_SETUP_BEFORE_BOOTTIME_EXIT,
+       EFI_SETUP_AFTER_BOOTTIME_EXIT,
+};
+
+extern struct efi_simple_text_output_protocol *con_out;
+extern struct efi_simple_input_interface *con_in;
+
+/*
+ * Exit the boot services.
+ *
+ * The size of the memory map is determined.
+ * Pool memory is allocated to copy the memory map.
+ * The memory amp is copied and the map key is obtained.
+ * The map key is used to exit the boot services.
+ */
+void efi_st_exit_boot_services(void);
+
+/*
+ * Print a pointer to an u16 string
+ *
+ * @pointer: pointer
+ * @buf: pointer to buffer address
+ * on return position of terminating zero word
+ */
+void efi_st_printf(const char *fmt, ...)
+                __attribute__ ((format (__printf__, 1, 2)));
+
+/*
+ * Reads an Unicode character from the input device.
+ *
+ * @return: Unicode character
+ */
+u16 efi_st_get_key(void);
+
+/**
+ * struct efi_unit_test - EFI unit test
+ *
+ * An efi_unit_test provides a interface to an EFI unit test.
+ *
+ * @name:      name of unit test
+ * @phase:     specifies when setup and execute are executed
+ * @setup:     set up the unit test
+ * @teardown:  tear down the unit test
+ * @execute:   execute the unit test
+ */
+struct efi_unit_test {
+       const char *name;
+       const enum efi_test_phase phase;
+       int (*setup)(const efi_handle_t handle,
+                    const struct efi_system_table *systable);
+       int (*execute)(void);
+       int (*teardown)(void);
+};
+
+/* Declare a new EFI unit test */
+#define EFI_UNIT_TEST(__name)                                          \
+       ll_entry_declare(struct efi_unit_test, __name, efi_unit_test)
+
+#endif /* _EFI_SELFTEST_H */
index 5b1b97bafef2433dfd58e6cddf891f46e40f1946..799d9840aa2ebf0c8d2dc6d6150fae0356cac595 100644 (file)
        "partitions=" PARTS_DEFAULT "\0" \
        "optargs=\0" \
        "dofastboot=0\0" \
+       "emmc_linux_boot=" \
+               "echo Trying to boot Linux from eMMC ...; " \
+               "setenv mmcdev 1; " \
+               "setenv bootpart 1:2; " \
+               "setenv mmcroot /dev/mmcblk0p2 rw; " \
+               "run mmcboot;\0" \
        "emmc_android_boot=" \
+               "echo Trying to boot Android from eMMC ...; " \
                "setenv eval_bootargs setenv bootargs $bootargs; " \
                "run eval_bootargs; " \
                "setenv mmcdev 1; " \
@@ -44,7 +51,6 @@
                "part size mmc ${mmcdev} ${boot_part} boot_size; " \
                "mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; " \
                "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
-               "echo Booting from eMMC ...; " \
                "bootm $loadaddr $loadaddr $fdtaddr;\0"
 
 #ifdef CONFIG_OMAP54XX
        "run findfdt; " \
        "run envboot; " \
        "run mmcboot;" \
-       "setenv mmcdev 1; " \
-       "setenv bootpart 1:2; " \
-       "setenv mmcroot /dev/mmcblk0p2 rw; " \
-       "run mmcboot;" \
+       "run emmc_linux_boot; " \
        "run emmc_android_boot; " \
        ""
 
index f53fe913496b877a5c7d1814295f34a4c0d26818..dc67cb2df61672272f2fec51a77c3a888c0c633e 100644 (file)
@@ -42,11 +42,16 @@ typedef struct {
        ushort  cfi_offset;             /* offset for cfi query                 */
        ulong   addr_unlock1;           /* unlock address 1 for AMD flash roms  */
        ulong   addr_unlock2;           /* unlock address 2 for AMD flash roms  */
+       uchar   sr_supported;           /* status register supported            */
        const char *name;               /* human-readable name                  */
 #endif
 #ifdef CONFIG_MTD
        struct mtd_info *mtd;
 #endif
+#ifdef CONFIG_CFI_FLASH                        /* DM-specific parts */
+       struct udevice *dev;
+       phys_addr_t base;
+#endif
 } flash_info_t;
 
 extern flash_info_t flash_info[]; /* info for FLASH chips      */
index 0869ad6e80cf117799686cf1790ca61aa01f3826..32fc480135841333015b8628b4cfc889ba5f2ab8 100644 (file)
@@ -13,6 +13,7 @@
 #define FS_TYPE_EXT    2
 #define FS_TYPE_SANDBOX        3
 #define FS_TYPE_UBIFS  4
+#define FS_TYPE_BTRFS  5
 
 /*
  * Tell the fs layer which block device an partition to use for future
diff --git a/include/fs_internal.h b/include/fs_internal.h
new file mode 100644 (file)
index 0000000..9d6dddd
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * 2017 by Marek Behun <marek.behun@nic.cz>
+ *
+ * Derived from code in ext4/dev.c, which was based on reiserfs/dev.c
+ *
+ * SPDX-License-Identifier:    GPL-2.0
+ */
+
+#ifndef __U_BOOT_FS_INTERNAL_H__
+#define __U_BOOT_FS_INTERNAL_H__
+
+#include <part.h>
+
+int fs_devread(struct blk_desc *, disk_partition_t *, lbaint_t, int, int,
+              char *);
+
+#endif /* __U_BOOT_FS_INTERNAL_H__ */
index af98ed9f25c860111f8e42f2c5813cbdd54e255d..93451dd8a409cc45816e7ef11ece3d12ffd54ed7 100644 (file)
@@ -1299,6 +1299,19 @@ void board_fit_image_post_process(void **p_image, size_t *p_size);
 #define FDT_ERROR      ((ulong)(-1))
 
 ulong fdt_getprop_u32(const void *fdt, int node, const char *prop);
+
+/**
+ * fit_find_config_node() - Find the node for the best DTB in a FIT image
+ *
+ * A FIT image contains one or more DTBs. This function parses the
+ * configurations described in the FIT images and returns the node of
+ * the first matching DTB. To check if a DTB matches a board, this function
+ * calls board_fit_config_name_match(). If no matching DTB is found, it returns
+ * the node described by the default configuration if it exists.
+ *
+ * @fdt: pointer to flat device tree
+ * @return the node if found, -ve otherwise
+ */
 int fit_find_config_node(const void *fdt);
 
 /**
diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h
new file mode 100644 (file)
index 0000000..8b9d6ff
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@nbd.name>
+ * Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation
+ *
+ * This program 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.
+ */
+
+#ifndef _LINUX_BITFIELD_H
+#define _LINUX_BITFIELD_H
+
+#include <linux/bug.h>
+
+/*
+ * Bitfield access macros
+ *
+ * FIELD_{GET,PREP} macros take as first parameter shifted mask
+ * from which they extract the base mask and shift amount.
+ * Mask must be a compilation time constant.
+ *
+ * Example:
+ *
+ *  #define REG_FIELD_A  GENMASK(6, 0)
+ *  #define REG_FIELD_B  BIT(7)
+ *  #define REG_FIELD_C  GENMASK(15, 8)
+ *  #define REG_FIELD_D  GENMASK(31, 16)
+ *
+ * Get:
+ *  a = FIELD_GET(REG_FIELD_A, reg);
+ *  b = FIELD_GET(REG_FIELD_B, reg);
+ *
+ * Set:
+ *  reg = FIELD_PREP(REG_FIELD_A, 1) |
+ *       FIELD_PREP(REG_FIELD_B, 0) |
+ *       FIELD_PREP(REG_FIELD_C, c) |
+ *       FIELD_PREP(REG_FIELD_D, 0x40);
+ *
+ * Modify:
+ *  reg &= ~REG_FIELD_C;
+ *  reg |= FIELD_PREP(REG_FIELD_C, c);
+ */
+
+#define __bf_shf(x) (__builtin_ffsll(x) - 1)
+
+#define __BF_FIELD_CHECK(_mask, _reg, _val, _pfx)                      \
+       ({                                                              \
+               BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),          \
+                                _pfx "mask is not constant");          \
+               BUILD_BUG_ON_MSG(!(_mask), _pfx "mask is zero");        \
+               BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ?           \
+                                ~((_mask) >> __bf_shf(_mask)) & (_val) : 0, \
+                                _pfx "value too large for the field"); \
+               BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull,         \
+                                _pfx "type of reg too small for mask"); \
+               __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +                 \
+                                             (1ULL << __bf_shf(_mask))); \
+       })
+
+/**
+ * FIELD_FIT() - check if value fits in the field
+ * @_mask: shifted mask defining the field's length and position
+ * @_val:  value to test against the field
+ *
+ * Return: true if @_val can fit inside @_mask, false if @_val is too big.
+ */
+#define FIELD_FIT(_mask, _val)                                         \
+       ({                                                              \
+               __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_FIT: ");     \
+               !((((typeof(_mask))_val) << __bf_shf(_mask)) & ~(_mask)); \
+       })
+
+/**
+ * FIELD_PREP() - prepare a bitfield element
+ * @_mask: shifted mask defining the field's length and position
+ * @_val:  value to put in the field
+ *
+ * FIELD_PREP() masks and shifts up the value.  The result should
+ * be combined with other fields of the bitfield using logical OR.
+ */
+#define FIELD_PREP(_mask, _val)                                                \
+       ({                                                              \
+               __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: ");    \
+               ((typeof(_mask))(_val) << __bf_shf(_mask)) & (_mask);   \
+       })
+
+/**
+ * FIELD_GET() - extract a bitfield element
+ * @_mask: shifted mask defining the field's length and position
+ * @_reg:  32bit value of entire bitfield
+ *
+ * FIELD_GET() extracts the field specified by @_mask from the
+ * bitfield passed in as @_reg by masking and shifting it down.
+ */
+#define FIELD_GET(_mask, _reg)                                         \
+       ({                                                              \
+               __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
+               (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \
+       })
+
+#endif
index 920e3796c38dd3bf805e2e11443faec7d128b064..f07bb716fc044bf7b68700b2fc1f481f25efe5d3 100644 (file)
@@ -1,55 +1,34 @@
 #ifndef _LINUX_BUG_H
 #define _LINUX_BUG_H
 
+#include <vsprintf.h> /* for panic() */
+#include <linux/build_bug.h>
 #include <linux/compiler.h>
-
-#ifdef __CHECKER__
-#define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0)
-#define BUILD_BUG_ON_ZERO(e) (0)
-#define BUILD_BUG_ON_NULL(e) ((void*)0)
-#define BUILD_BUG_ON_INVALID(e) (0)
-#define BUILD_BUG_ON(condition) (0)
-#define BUILD_BUG() (0)
-#else /* __CHECKER__ */
-
-/* Force a compilation error if a constant expression is not a power of 2 */
-#define BUILD_BUG_ON_NOT_POWER_OF_2(n)                 \
-       BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
-
-/* Force a compilation error if condition is true, but also produce a
-   result (of value 0 and type size_t), so the expression can be used
-   e.g. in a structure initializer (or where-ever else comma expressions
-   aren't permitted). */
-#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
-#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
-
-/*
- * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
- * expression but avoids the generation of any code, even if that expression
- * has side-effects.
- */
-#define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
-
-/**
- * BUILD_BUG_ON - break compile if a condition is true.
- * @condition: the condition which the compiler should know is false.
- *
- * If you have some code which relies on certain constants being equal, or
- * some other compile-time-evaluated condition, you should use BUILD_BUG_ON to
- * detect if someone changes it.
- *
- * The implementation uses gcc's reluctance to create a negative array, but gcc
- * (as of 4.4) only emits that error for obvious cases (e.g. not arguments to
- * inline functions).  Luckily, in 4.3 they added the "error" function
- * attribute just for this type of case.  Thus, we use a negative sized array
- * (should always create an error on gcc versions older than 4.4) and then call
- * an undefined function with the error attribute (should always create an
- * error on gcc 4.3 and later).  If for some reason, neither creates a
- * compile-time error, we'll still have a link-time error, which is harder to
- * track down.
- */
-#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
-
-#endif /* __CHECKER__ */
+#include <linux/printk.h>
+
+#define BUG() do { \
+       printk("BUG at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
+       panic("BUG!"); \
+} while (0)
+
+#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
+
+#define WARN_ON(condition) ({                                          \
+       int __ret_warn_on = !!(condition);                              \
+       if (unlikely(__ret_warn_on))                                    \
+               printk("WARNING at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \
+       unlikely(__ret_warn_on);                                        \
+})
+
+#define WARN_ON_ONCE(condition)        ({                              \
+       static bool __warned;                                   \
+       int __ret_warn_once = !!(condition);                    \
+                                                               \
+       if (unlikely(__ret_warn_once && !__warned)) {           \
+               __warned = true;                                \
+               WARN_ON(1);                                     \
+       }                                                       \
+       unlikely(__ret_warn_once);                              \
+})
 
 #endif /* _LINUX_BUG_H */
diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h
new file mode 100644 (file)
index 0000000..b7d22d6
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef _LINUX_BUILD_BUG_H
+#define _LINUX_BUILD_BUG_H
+
+#include <linux/compiler.h>
+
+#ifdef __CHECKER__
+#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) (0)
+#define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0)
+#define BUILD_BUG_ON_ZERO(e) (0)
+#define BUILD_BUG_ON_NULL(e) ((void *)0)
+#define BUILD_BUG_ON_INVALID(e) (0)
+#define BUILD_BUG_ON_MSG(cond, msg) (0)
+#define BUILD_BUG_ON(condition) (0)
+#define BUILD_BUG() (0)
+#else /* __CHECKER__ */
+
+/* Force a compilation error if a constant expression is not a power of 2 */
+#define __BUILD_BUG_ON_NOT_POWER_OF_2(n)       \
+       BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
+#define BUILD_BUG_ON_NOT_POWER_OF_2(n)                 \
+       BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
+
+/*
+ * Force a compilation error if condition is true, but also produce a
+ * result (of value 0 and type size_t), so the expression can be used
+ * e.g. in a structure initializer (or where-ever else comma expressions
+ * aren't permitted).
+ */
+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
+#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:(-!!(e)); }))
+
+/*
+ * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
+ * expression but avoids the generation of any code, even if that expression
+ * has side-effects.
+ */
+#define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
+
+/**
+ * BUILD_BUG_ON_MSG - break compile if a condition is true & emit supplied
+ *                   error message.
+ * @condition: the condition which the compiler should know is false.
+ *
+ * See BUILD_BUG_ON for description.
+ */
+#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
+
+/**
+ * BUILD_BUG_ON - break compile if a condition is true.
+ * @condition: the condition which the compiler should know is false.
+ *
+ * If you have some code which relies on certain constants being equal, or
+ * some other compile-time-evaluated condition, you should use BUILD_BUG_ON to
+ * detect if someone changes it.
+ *
+ * The implementation uses gcc's reluctance to create a negative array, but gcc
+ * (as of 4.4) only emits that error for obvious cases (e.g. not arguments to
+ * inline functions).  Luckily, in 4.3 they added the "error" function
+ * attribute just for this type of case.  Thus, we use a negative sized array
+ * (should always create an error on gcc versions older than 4.4) and then call
+ * an undefined function with the error attribute (should always create an
+ * error on gcc 4.3 and later).  If for some reason, neither creates a
+ * compile-time error, we'll still have a link-time error, which is harder to
+ * track down.
+ */
+#ifndef __OPTIMIZE__
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+#else
+#define BUILD_BUG_ON(condition) \
+       BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
+#endif
+
+/**
+ * BUILD_BUG - break compile if used.
+ *
+ * If you have some code that you expect the compiler to eliminate at
+ * build time, you should use BUILD_BUG to detect if it is
+ * unexpectedly used.
+ */
+#define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
+
+#endif /* __CHECKER__ */
+
+#endif /* _LINUX_BUILD_BUG_H */
index 2336b56cf5c170ee75f7b9a7e1f5655adb3f3f03..8711fe2b48c46256fd1a7cd1b7535e77a7d0bd29 100644 (file)
@@ -15,6 +15,23 @@ struct p_current{
 
 extern struct p_current *current;
 
+/* avoid conflict with <dm/device.h> */
+#ifdef dev_dbg
+#undef dev_dbg
+#endif
+#ifdef dev_vdbg
+#undef dev_vdbg
+#endif
+#ifdef dev_info
+#undef dev_info
+#endif
+#ifdef dev_err
+#undef dev_err
+#endif
+#ifdef dev_warn
+#undef dev_warn
+#endif
+
 #define dev_dbg(dev, fmt, args...)             \
        debug(fmt, ##args)
 #define dev_vdbg(dev, fmt, args...)            \
@@ -25,17 +42,6 @@ extern struct p_current *current;
        printf(fmt, ##args)
 #define dev_warn(dev, fmt, args...)            \
        printf(fmt, ##args)
-#define printk printf
-#define printk_once    printf
-
-#define KERN_EMERG
-#define KERN_ALERT
-#define KERN_CRIT
-#define KERN_ERR
-#define KERN_WARNING
-#define KERN_NOTICE
-#define KERN_INFO
-#define KERN_DEBUG
 
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
@@ -98,21 +104,6 @@ static inline void kmem_cache_destroy(struct kmem_cache *cachep)
 
 #define KERNEL_VERSION(a,b,c)  (((a) << 16) + ((b) << 8) + (c))
 
-#ifndef BUG
-#define BUG() do { \
-       printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \
-} while (0)
-
-#define BUG_ON(condition) do { if (condition) BUG(); } while(0)
-#endif /* BUG */
-
-#define WARN_ON(condition) ({                                          \
-       int __ret_warn_on = !!(condition);                              \
-       if (unlikely(__ret_warn_on))                                    \
-               printf("WARNING in %s line %d\n", __FILE__, __LINE__);  \
-       unlikely(__ret_warn_on);                                        \
-})
-
 #define PAGE_SIZE      4096
 
 /* drivers/char/random.c */
index 020ad16a0493e0348608d7f98c529d249cb6d609..0ea6c8fccaab9bbda4425434d830aa25ac6f28d5 100644 (file)
@@ -476,7 +476,8 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
 # define __compiletime_error_fallback(condition) do { } while (0)
 #endif
 
-#define __compiletime_assert(condition, msg, prefix, suffix)           \
+#ifdef __OPTIMIZE__
+# define __compiletime_assert(condition, msg, prefix, suffix)          \
        do {                                                            \
                bool __cond = !(condition);                             \
                extern void prefix ## suffix(void) __compiletime_error(msg); \
@@ -484,6 +485,9 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
                        prefix ## suffix();                             \
                __compiletime_error_fallback(__cond);                   \
        } while (0)
+#else
+# define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0)
+#endif
 
 #define _compiletime_assert(condition, msg, prefix, suffix) \
        __compiletime_assert(condition, msg, prefix, suffix)
index 0b616713cc3b77d8d9f8d3da7e6445f5bf72879d..87d2d9554dbb7947aeb9aa61cf9cb437765bdcdd 100644 (file)
 #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
 
+#define DIV_ROUND_DOWN_ULL(ll, d) \
+       ({ unsigned long long _tmp = (ll); do_div(_tmp, d); _tmp; })
+
+#define DIV_ROUND_UP_ULL(ll, d)                DIV_ROUND_DOWN_ULL((ll) + (d) - 1, (d))
+
 #if BITS_PER_LONG == 32
 # define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
 #else
index 88687faba10bb9ed9d4862142f5161ec0837a8d2..8981d04f96c9b3fdf260568d5af264b11baea4b0 100644 (file)
@@ -31,6 +31,9 @@ int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
 int lzop_decompress(const unsigned char *src, size_t src_len,
                    unsigned char *dst, size_t *dst_len);
 
+/* check if the header is valid (based on magic numbers) */
+bool lzop_is_valid_header(const unsigned char *src);
+
 /*
  * Return values (< 0 = Error)
  */
index 1fd17c303a8d7ae9c64b271711647d6fed686dd2..3e1694b3a5d33802fcecd32ad0b38556571a8e0d 100644 (file)
@@ -452,28 +452,20 @@ static inline void mtd_erase_callback(struct erase_info *instr)
 #define MTD_DEBUG_LEVEL3       (3)     /* Noisy   */
 
 #ifdef CONFIG_MTD_DEBUG
-#define pr_debug(args...)      MTDDEBUG(MTD_DEBUG_LEVEL0, args)
 #define MTDDEBUG(n, args...)                           \
        do {                                            \
                if (n <= CONFIG_MTD_DEBUG_VERBOSE)      \
                        printk(KERN_INFO args);         \
        } while(0)
 #else /* CONFIG_MTD_DEBUG */
-#define pr_debug(args...)
 #define MTDDEBUG(n, args...)                           \
        do {                                            \
                if (0)                                  \
                        printk(KERN_INFO args);         \
        } while(0)
 #endif /* CONFIG_MTD_DEBUG */
-#define pr_info(args...)       MTDDEBUG(MTD_DEBUG_LEVEL0, args)
-#define pr_warn(args...)       MTDDEBUG(MTD_DEBUG_LEVEL0, args)
-#define pr_err(args...)                MTDDEBUG(MTD_DEBUG_LEVEL0, args)
-#define pr_crit(args...)       MTDDEBUG(MTD_DEBUG_LEVEL0, args)
-#define pr_cont(args...)       MTDDEBUG(MTD_DEBUG_LEVEL0, args)
-#define pr_notice(args...)     MTDDEBUG(MTD_DEBUG_LEVEL0, args)
 #endif
+
 static inline int mtd_is_bitflip(int err) {
        return err == -EUCLEAN;
 }
diff --git a/include/linux/printk.h b/include/linux/printk.h
new file mode 100644 (file)
index 0000000..088513a
--- /dev/null
@@ -0,0 +1,79 @@
+#ifndef __KERNEL_PRINTK__
+#define __KERNEL_PRINTK__
+
+#include <stdio.h>
+#include <linux/compiler.h>
+
+#define KERN_EMERG
+#define KERN_ALERT
+#define KERN_CRIT
+#define KERN_ERR
+#define KERN_WARNING
+#define KERN_NOTICE
+#define KERN_INFO
+#define KERN_DEBUG
+#define KERN_CONT
+
+#define printk(fmt, ...) \
+       printf(fmt, ##__VA_ARGS__)
+
+/*
+ * Dummy printk for disabled debugging statements to use whilst maintaining
+ * gcc's format checking.
+ */
+#define no_printk(fmt, ...)                            \
+({                                                     \
+       if (0)                                          \
+               printk(fmt, ##__VA_ARGS__);             \
+       0;                                              \
+})
+
+#define __printk(level, fmt, ...)                                      \
+({                                                                     \
+       level < CONFIG_LOGLEVEL ? printk(fmt, ##__VA_ARGS__) : 0;       \
+})
+
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_emerg(fmt, ...) \
+       __printk(0, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_alert(fmt, ...) \
+       __printk(1, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_crit(fmt, ...) \
+       __printk(2, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_err(fmt, ...) \
+       __printk(3, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warning(fmt, ...) \
+       __printk(4, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warn pr_warning
+#define pr_notice(fmt, ...) \
+       __printk(5, pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_info(fmt, ...) \
+       __printk(6, pr_fmt(fmt), ##__VA_ARGS__)
+
+#define pr_cont(fmt, ...) \
+       printk(fmt, ##__VA_ARGS__)
+
+/* pr_devel() should produce zero code unless DEBUG is defined */
+#ifdef DEBUG
+#define pr_devel(fmt, ...) \
+       __printk(7, pr_fmt(fmt), ##__VA_ARGS__)
+#else
+#define pr_devel(fmt, ...) \
+       no_printk(pr_fmt(fmt), ##__VA_ARGS__)
+#endif
+
+#ifdef DEBUG
+#define pr_debug(fmt, ...) \
+       __printk(7, pr_fmt(fmt), ##__VA_ARGS__)
+#else
+#define pr_debug(fmt, ...) \
+       no_printk(pr_fmt(fmt), ##__VA_ARGS__)
+#endif
+
+#define printk_once(fmt, ...) \
+       printk(fmt, ##__VA_ARGS__)
+
+#endif
index 0ad4782a36e820731e5dd4436ba5c598c92da50d..264c9712a33a68996de6fd2bb445b278e9f68a81 100644 (file)
@@ -418,6 +418,12 @@ struct __packed usb_class_report_descriptor {
 #define USB_ENDPOINT_XFER_INT          3
 #define USB_ENDPOINT_MAX_ADJUSTABLE    0x80
 
+#define USB_ENDPOINT_MAXP_MASK         0x07ff
+#define USB_EP_MAXP_MULT_SHIFT         11
+#define USB_EP_MAXP_MULT_MASK          (3 << USB_EP_MAXP_MULT_SHIFT)
+#define USB_EP_MAXP_MULT(m)            \
+       (((m) & USB_EP_MAXP_MULT_MASK) >> USB_EP_MAXP_MULT_SHIFT)
+
 /* The USB 3.0 spec redefines bits 5:4 of bmAttributes as interrupt ep type. */
 #define USB_ENDPOINT_INTRTYPE          0x30
 #define USB_ENDPOINT_INTR_PERIODIC     (0 << 4)
@@ -625,6 +631,20 @@ static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
        return __le16_to_cpu(get_unaligned(&epd->wMaxPacketSize));
 }
 
+/**
+ * usb_endpoint_maxp_mult - get endpoint's transactional opportunities
+ * @epd: endpoint to be checked
+ *
+ * Return @epd's wMaxPacketSize[12:11] + 1
+ */
+static inline int
+usb_endpoint_maxp_mult(const struct usb_endpoint_descriptor *epd)
+{
+       int maxp = __le16_to_cpu(epd->wMaxPacketSize);
+
+       return USB_EP_MAXP_MULT(maxp) + 1;
+}
+
 static inline int usb_endpoint_interrupt_type(
                const struct usb_endpoint_descriptor *epd)
 {
index eade2b3614f2931efdb7d461a0dccec07792b468..095725a805e9bac9f610d0369f58d14baa3f582b 100644 (file)
@@ -62,6 +62,7 @@
 
 #define FLASH_OFFSET_MANUFACTURER_ID   0x00
 #define FLASH_OFFSET_DEVICE_ID         0x01
+#define FLASH_OFFSET_LOWER_SW_BITS     0x0C
 #define FLASH_OFFSET_DEVICE_ID2                0x0E
 #define FLASH_OFFSET_DEVICE_ID3                0x0F
 #define FLASH_OFFSET_CFI               0x55
index 86117a7ce5d3c57e80c1ec9dc8293718b5c78c32..0caceafc5f70800876d04c015496d4ff50c114ad 100644 (file)
@@ -173,6 +173,21 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
                            struct blk_desc **dev_desc,
                            disk_partition_t *info, int allow_whole_dev);
 
+/**
+ * part_get_info_by_name_type() - Search for a partition by name
+ *                                for only specified partition type
+ *
+ * @param dev_desc - block device descriptor
+ * @param gpt_name - the specified table entry name
+ * @param info - returns the disk partition info
+ * @param part_type - only search in partitions of this type
+ *
+ * @return - the partition number on match (starting on 1), -1 on no match,
+ * otherwise error
+ */
+int part_get_info_by_name_type(struct blk_desc *dev_desc, const char *name,
+                              disk_partition_t *info, int part_type);
+
 /**
  * part_get_info_by_name() - Search for a partition by name
  *                           among all available registered partitions
@@ -280,8 +295,9 @@ struct part_driver {
 #define U_BOOT_PART_TYPE(__name)                                       \
        ll_entry_declare(struct part_driver, __name, part_driver)
 
-#if CONFIG_IS_ENABLED(EFI_PARTITION)
 #include <part_efi.h>
+
+#if CONFIG_IS_ENABLED(EFI_PARTITION)
 /* disk/part_efi.c */
 /**
  * write_gpt_table() - Write the GUID Partition Table to disk
index 317c044795caf68081aee879dc20c40835091256..31e6bc6e140fe2956b15da1012b74be71bf422c0 100644 (file)
 /* linux/include/efi.h */
 typedef u16 efi_char16_t;
 
-typedef struct {
-       u8 b[16];
-} efi_guid_t;
-
 /* based on linux/include/genhd.h */
 struct partition {
        u8 boot_ind;            /* 0x80 - active */
index c8ef997d0de91ce0a9be21df5ece3e6d704c2c92..7adc04301c06a90f582622d26bb17f770781a699 100644 (file)
@@ -1086,6 +1086,57 @@ int pci_read_config32(pci_dev_t pcidev, int offset, u32 *valuep);
 int pci_read_config16(pci_dev_t pcidev, int offset, u16 *valuep);
 int pci_read_config8(pci_dev_t pcidev, int offset, u8 *valuep);
 
+/**
+ * pci_generic_mmap_write_config() - Generic helper for writing to
+ * memory-mapped PCI configuration space.
+ * @bus: Pointer to the PCI bus
+ * @addr_f: Callback for calculating the config space address
+ * @bdf: Identifies the PCI device to access
+ * @offset: The offset into the device's configuration space
+ * @value: The value to write
+ * @size: Indicates the size of access to perform
+ *
+ * Write the value @value of size @size from offset @offset within the
+ * configuration space of the device identified by the bus, device & function
+ * numbers in @bdf on the PCI bus @bus. The callback function @addr_f is
+ * responsible for calculating the CPU address of the respective configuration
+ * space offset.
+ *
+ * Return: 0 on success, else -EINVAL
+ */
+int pci_generic_mmap_write_config(
+       struct udevice *bus,
+       int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp),
+       pci_dev_t bdf,
+       uint offset,
+       ulong value,
+       enum pci_size_t size);
+
+/**
+ * pci_generic_mmap_read_config() - Generic helper for reading from
+ * memory-mapped PCI configuration space.
+ * @bus: Pointer to the PCI bus
+ * @addr_f: Callback for calculating the config space address
+ * @bdf: Identifies the PCI device to access
+ * @offset: The offset into the device's configuration space
+ * @valuep: A pointer at which to store the read value
+ * @size: Indicates the size of access to perform
+ *
+ * Read a value of size @size from offset @offset within the configuration
+ * space of the device identified by the bus, device & function numbers in @bdf
+ * on the PCI bus @bus. The callback function @addr_f is responsible for
+ * calculating the CPU address of the respective configuration space offset.
+ *
+ * Return: 0 on success, else -EINVAL
+ */
+int pci_generic_mmap_read_config(
+       struct udevice *bus,
+       int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp),
+       pci_dev_t bdf,
+       uint offset,
+       ulong *valuep,
+       enum pci_size_t size);
+
 #ifdef CONFIG_DM_PCI_COMPAT
 /* Compatibility with old naming */
 static inline int pci_write_config_dword(pci_dev_t pcidev, int offset,
index deb35a0ea452e43ce99c7ba31cae621c5f271a5f..4ef3e92efafcbc29d7c1453c5a41bc7ecd47fe48 100644 (file)
@@ -62,6 +62,12 @@ typedef struct _IMAGE_DATA_DIRECTORY {
 
 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
 
+/* PE32+ Subsystem type for EFI images */
+#define IMAGE_SUBSYSTEM_EFI_APPLICATION         10
+#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
+#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER      12
+#define IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER      13
+
 typedef struct _IMAGE_OPTIONAL_HEADER64 {
        uint16_t Magic; /* 0x20b */
        uint8_t  MajorLinkerVersion;
diff --git a/include/stdio.h b/include/stdio.h
new file mode 100644 (file)
index 0000000..aedf374
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef __STDIO_H
+#define __STDIO_H
+
+#include <stdarg.h>
+#include <linux/compiler.h>
+
+/* stdin */
+int getc(void);
+int tstc(void);
+
+/* stdout */
+#if !defined(CONFIG_SPL_BUILD) || \
+       (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL_SUPPORT)) || \
+       (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \
+               defined(CONFIG_SPL_SERIAL_SUPPORT))
+void putc(const char c);
+void puts(const char *s);
+int __printf(1, 2) printf(const char *fmt, ...);
+int vprintf(const char *fmt, va_list args);
+#else
+static inline void putc(const char c)
+{
+}
+
+static inline void puts(const char *s)
+{
+}
+
+static inline int __printf(1, 2) printf(const char *fmt, ...)
+{
+       return 0;
+}
+
+static inline int vprintf(const char *fmt, va_list args)
+{
+       return 0;
+}
+#endif
+
+/*
+ * FILE based functions (can only be used AFTER relocation!)
+ */
+#define stdin          0
+#define stdout         1
+#define stderr         2
+#define MAX_FILES      3
+
+/* stderr */
+#define eputc(c)               fputc(stderr, c)
+#define eputs(s)               fputs(stderr, s)
+#define eprintf(fmt, args...)  fprintf(stderr, fmt, ##args)
+
+int __printf(2, 3) fprintf(int file, const char *fmt, ...);
+void fputs(int file, const char *s);
+void fputc(int file, const char c);
+int ftstc(int file);
+int fgetc(int file);
+
+#endif /* __STDIO_H */
index 6764d58babac8197dbe8f593fdf70658c4419414..6d08f5df98f6e678a61e3e664ebeb85166a0fb96 100644 (file)
@@ -28,4 +28,8 @@ uint32_t crc32_no_comp (uint32_t, const unsigned char *, uint);
 void crc32_wd_buf(const unsigned char *input, uint ilen,
                    unsigned char *output, uint chunk_sz);
 
+/* lib/crc32c.c */
+void crc32c_init(uint32_t *, uint32_t);
+uint32_t crc32c_cal(uint32_t, const char *, int, uint32_t *);
+
 #endif /* _UBOOT_CRC_H */
diff --git a/include/u-boot/variadic-macro.h b/include/u-boot/variadic-macro.h
new file mode 100644 (file)
index 0000000..922beaf
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Helper for work with variadic macros
+ *
+ * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __VARIADIC_MACRO_H__
+#define __VARIADIC_MACRO_H__
+
+#define _VM_GET_NTH_ARG(_1, _2, _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, N, ...) N
+
+#define _VM_HELP_0(_call, ...)
+#define _VM_HELP_1(_call, x, ...) _call(x)
+#define _VM_HELP_2(_call, x, ...) _call(x) _VM_HELP_1(_call, __VA_ARGS__)
+#define _VM_HELP_3(_call, x, ...) _call(x) _VM_HELP_2(_call, __VA_ARGS__)
+#define _VM_HELP_4(_call, x, ...) _call(x) _VM_HELP_3(_call, __VA_ARGS__)
+#define _VM_HELP_5(_call, x, ...) _call(x) _VM_HELP_4(_call, __VA_ARGS__)
+#define _VM_HELP_6(_call, x, ...) _call(x) _VM_HELP_5(_call, __VA_ARGS__)
+#define _VM_HELP_7(_call, x, ...) _call(x) _VM_HELP_6(_call, __VA_ARGS__)
+#define _VM_HELP_8(_call, x, ...) _call(x) _VM_HELP_7(_call, __VA_ARGS__)
+#define _VM_HELP_9(_call, x, ...) _call(x) _VM_HELP_8(_call, __VA_ARGS__)
+#define _VM_HELP_10(_call, x, ...) _call(x) _VM_HELP_9(_call, __VA_ARGS__)
+#define _VM_HELP_11(_call, x, ...) _call(x) _VM_HELP_10(_call, __VA_ARGS__)
+#define _VM_HELP_12(_call, x, ...) _call(x) _VM_HELP_11(_call, __VA_ARGS__)
+#define _VM_HELP_13(_call, x, ...) _call(x) _VM_HELP_12(_call, __VA_ARGS__)
+#define _VM_HELP_14(_call, x, ...) _call(x) _VM_HELP_13(_call, __VA_ARGS__)
+#define _VM_HELP_15(_call, x, ...) _call(x) _VM_HELP_14(_call, __VA_ARGS__)
+#define _VM_HELP_16(_call, x, ...) _call(x) _VM_HELP_15(_call, __VA_ARGS__)
+#define _VM_HELP_17(_call, x, ...) _call(x) _VM_HELP_16(_call, __VA_ARGS__)
+#define _VM_HELP_18(_call, x, ...) _call(x) _VM_HELP_17(_call, __VA_ARGS__)
+#define _VM_HELP_19(_call, x, ...) _call(x) _VM_HELP_18(_call, __VA_ARGS__)
+#define _VM_HELP_20(_call, x, ...) _call(x) _VM_HELP_19(_call, __VA_ARGS__)
+#define _VM_HELP_21(_call, x, ...) _call(x) _VM_HELP_20(_call, __VA_ARGS__)
+#define _VM_HELP_22(_call, x, ...) _call(x) _VM_HELP_21(_call, __VA_ARGS__)
+#define _VM_HELP_23(_call, x, ...) _call(x) _VM_HELP_22(_call, __VA_ARGS__)
+#define _VM_HELP_24(_call, x, ...) _call(x) _VM_HELP_23(_call, __VA_ARGS__)
+#define _VM_HELP_25(_call, x, ...) _call(x) _VM_HELP_24(_call, __VA_ARGS__)
+#define _VM_HELP_26(_call, x, ...) _call(x) _VM_HELP_25(_call, __VA_ARGS__)
+#define _VM_HELP_27(_call, x, ...) _call(x) _VM_HELP_26(_call, __VA_ARGS__)
+#define _VM_HELP_28(_call, x, ...) _call(x) _VM_HELP_27(_call, __VA_ARGS__)
+#define _VM_HELP_29(_call, x, ...) _call(x) _VM_HELP_28(_call, __VA_ARGS__)
+#define _VM_HELP_30(_call, x, ...) _call(x) _VM_HELP_29(_call, __VA_ARGS__)
+#define _VM_HELP_31(_call, x, ...) _call(x) _VM_HELP_30(_call, __VA_ARGS__)
+
+#define CALL_MACRO_FOR_EACH(x, ...)                                     \
+       _VM_GET_NTH_ARG("", ##__VA_ARGS__, _VM_HELP_31, _VM_HELP_30,     \
+       _VM_HELP_29, _VM_HELP_28, _VM_HELP_27, _VM_HELP_26, _VM_HELP_25, \
+       _VM_HELP_24, _VM_HELP_23, _VM_HELP_22, _VM_HELP_21, _VM_HELP_20, \
+       _VM_HELP_19, _VM_HELP_18, _VM_HELP_17, _VM_HELP_16, _VM_HELP_15, \
+       _VM_HELP_14, _VM_HELP_13, _VM_HELP_12, _VM_HELP_11, _VM_HELP_10, \
+       _VM_HELP_9, _VM_HELP_8, _VM_HELP_7, _VM_HELP_6, _VM_HELP_5,      \
+       _VM_HELP_4, _VM_HELP_3, _VM_HELP_2, _VM_HELP_1,                  \
+       _VM_HELP_0)(x, __VA_ARGS__)
+
+#endif /* __VARIADIC_MACRO_H__ */
index fad04016a348fe1a8afb8f3f4783873c18a47678..57a7d8d0ea3bd12d737c901909607df8b0ecd2f1 100644 (file)
@@ -652,6 +652,18 @@ struct usb_bus_priv {
        bool companion;
 };
 
+/**
+ * struct usb_emul_platdata - platform data about the USB emulator
+ *
+ * Given a USB emulator (UCLASS_USB_EMUL) 'dev', this is
+ * dev_get_uclass_platdata(dev).
+ *
+ * @port1:     USB emulator device port number on the parent hub
+ */
+struct usb_emul_platdata {
+       int port1;      /* Port number (numbered from 1) */
+};
+
 /**
  * struct dm_usb_ops - USB controller operations
  *
@@ -766,6 +778,14 @@ struct dm_usb_ops {
         * representation of this hub can be updated (xHCI)
         */
        int (*update_hub_device)(struct udevice *bus, struct usb_device *udev);
+
+       /**
+        * get_max_xfer_size() - Get HCD's maximum transfer bytes
+        *
+        * The HCD may have limitation on the maximum bytes to be transferred
+        * in a USB transfer. USB class driver needs to be aware of this.
+        */
+       int (*get_max_xfer_size)(struct udevice *bus, size_t *size);
 };
 
 #define usb_get_ops(dev)       ((struct dm_usb_ops *)(dev)->driver->ops)
@@ -939,7 +959,7 @@ int usb_new_device(struct usb_device *dev);
 int usb_alloc_device(struct usb_device *dev);
 
 /**
- * update_hub_device() - Update HCD's internal representation of hub
+ * usb_update_hub_device() - Update HCD's internal representation of hub
  *
  * After a hub descriptor is fetched, notify HCD so that its internal
  * representation of this hub can be updated.
@@ -949,6 +969,18 @@ int usb_alloc_device(struct usb_device *dev);
  */
 int usb_update_hub_device(struct usb_device *dev);
 
+/**
+ * usb_get_max_xfer_size() - Get HCD's maximum transfer bytes
+ *
+ * The HCD may have limitation on the maximum bytes to be transferred
+ * in a USB transfer. USB class driver needs to be aware of this.
+ *
+ * @dev:               USB device
+ * @size:              maximum transfer bytes
+ * @return 0 if OK, -ve on error
+ */
+int usb_get_max_xfer_size(struct usb_device *dev, size_t *size);
+
 /**
  * usb_emul_setup_device() - Set up a new USB device emulation
  *
@@ -956,7 +988,6 @@ int usb_update_hub_device(struct usb_device *dev);
  * the USB emulation uclass about the features of the emulator.
  *
  * @dev:               Emulation device
- * @maxpacketsize:     Maximum packet size (e.g. PACKET_SIZE_64)
  * @strings:           List of USB string descriptors, terminated by a NULL
  *                     entry
  * @desc_list:         List of points or USB descriptors, terminated by NULL.
@@ -964,8 +995,8 @@ int usb_update_hub_device(struct usb_device *dev);
  *                     and others follow on after that.
  * @return 0 if OK, -ENOSYS if not implemented, other -ve on error
  */
-int usb_emul_setup_device(struct udevice *dev, int maxpacketsize,
-                         struct usb_string *strings, void **desc_list);
+int usb_emul_setup_device(struct udevice *dev, struct usb_string *strings,
+                         void **desc_list);
 
 /**
  * usb_emul_control() - Send a control packet to an emulator
@@ -1004,19 +1035,20 @@ int usb_emul_int(struct udevice *emul, struct usb_device *udev,
 /**
  * usb_emul_find() - Find an emulator for a particular device
  *
- * Check @pipe to find a device number on bus @bus and return it.
+ * Check @pipe and @port1 to find a device number on bus @bus and return it.
  *
  * @bus:       USB bus (controller)
  * @pipe:      Describes pipe being used, and includes the device number
+ * @port1:     Describes port number on the parent hub
  * @emulp:     Returns pointer to emulator, or NULL if not found
  * @return 0 if found, -ve on error
  */
-int usb_emul_find(struct udevice *bus, ulong pipe, struct udevice **emulp);
+int usb_emul_find(struct udevice *bus, ulong pipe, int port1,
+                 struct udevice **emulp);
 
 /**
  * usb_emul_find_for_dev() - Find an emulator for a particular device
  *
- * @bus:       USB bus (controller)
  * @dev:       USB device to check
  * @emulp:     Returns pointer to emulator, or NULL if not found
  * @return 0 if found, -ve on error
@@ -1024,12 +1056,15 @@ int usb_emul_find(struct udevice *bus, ulong pipe, struct udevice **emulp);
 int usb_emul_find_for_dev(struct udevice *dev, struct udevice **emulp);
 
 /**
- * usb_emul_reset() - Reset all emulators ready for use
+ * usb_emul_find_descriptor() - Find a USB descriptor of a particular device
  *
- * Clear out any address information in the emulators and make then ready for
- * a new USB scan
+ * @ptr:       a pointer to a list of USB descriptor pointers
+ * @type:      type of USB descriptor to find
+ * @index:     if @type is USB_DT_CONFIG, this is the configuration value
+ * @return a pointer to the USB descriptor found, NULL if not found
  */
-void usb_emul_reset(struct udevice *dev);
+struct usb_generic_descriptor **usb_emul_find_descriptor(
+               struct usb_generic_descriptor **ptr, int type, int index);
 
 /**
  * usb_show_tree() - show the USB device tree
index cd3eb47da4a2de108f41411b98a8328d5fa2015a..59bfc14df68565788bd0eb19ac33e268774a52ab 100644 (file)
 #elif defined(CONFIG_MPC85xx)
 #define CONFIG_SYS_FSL_USB1_ADDR CONFIG_SYS_MPC85xx_USB1_ADDR
 #define CONFIG_SYS_FSL_USB2_ADDR CONFIG_SYS_MPC85xx_USB2_ADDR
-#elif defined(CONFIG_LS102XA) || defined(CONFIG_ARCH_LS1012A)
+#elif defined(CONFIG_ARCH_LS1021A) || defined(CONFIG_ARCH_LS1012A)
 #define CONFIG_SYS_FSL_USB1_ADDR CONFIG_SYS_EHCI_USB1_ADDR
 #define CONFIG_SYS_FSL_USB2_ADDR        0
 #endif
index 5b4e78b18257b40805ff3e84ddb3fec52ac14186..61ff6531215aca9b083431f1c800f4ce222ea830 100644 (file)
@@ -114,6 +114,13 @@ struct video_ops {
  */
 int video_reserve(ulong *addrp);
 
+/**
+ * video_clear() - Clear a device's frame buffer to background color.
+ *
+ * @dev:       Device to clear
+ */
+void video_clear(struct udevice *dev);
+
 /**
  * video_sync() - Sync a device's frame buffer with its hardware
  *
index 26047934da8c59b4646caa6cb9f8a631d1ce0561..9dce234bd928cf24372532c0923f868f44b1a326 100644 (file)
@@ -29,6 +29,9 @@
  * @xsize_frac:        Width of the display in fractional units
  * @xstart_frac:       Left margin for the text console in fractional units
  * @last_ch:   Last character written to the text console on this line
+ * @escape:    TRUE if currently accumulating an ANSI escape sequence
+ * @escape_len:        Length of accumulated escape sequence so far
+ * @escape_buf:        Buffer to accumulate escape sequence
  */
 struct vidconsole_priv {
        struct stdio_dev sdev;
@@ -42,6 +45,14 @@ struct vidconsole_priv {
        int xsize_frac;
        int xstart_frac;
        int last_ch;
+       /*
+        * ANSI escape sequences are accumulated character by character,
+        * starting after the ESC char (0x1b) until the entire sequence
+        * is consumed at which point it is acted upon.
+        */
+       int escape;
+       int escape_len;
+       char escape_buf[32];
 };
 
 /**
index 490c96ca6d1fcb32c4a0c0b3c0f53ba1f65f15c3..33d05aa0c65cb6f7a0b4a7d7fb32b269f6b2100b 100644 (file)
@@ -9,6 +9,7 @@
 #define __VSPRINTF_H
 
 #include <stdarg.h>
+#include <linux/types.h>
 
 ulong simple_strtoul(const char *cp, char **endp, unsigned int base);
 
index 628ef8ddb642d3721d3dd83e010f3b2e4dcb5ba4..18663badb25c8db8bd89157dc8db25bdc42786cd 100644 (file)
@@ -146,6 +146,9 @@ config SHA_PROG_HW_ACCEL
 config MD5
        bool
 
+config CRC32C
+       bool
+
 endmenu
 
 menu "Compression Support"
@@ -177,6 +180,11 @@ config LZO
        help
          This enables support for LZO compression algorithm.r
 
+config SPL_LZO
+       bool "Enable LZO decompression support in SPL"
+       help
+         This enables support for LZO compression algorithm in the SPL.
+
 config SPL_GZIP
        bool "Enable gzip decompression support for SPL build"
        select SPL_ZLIB
index faf4538fb5fe200146809a8ae6afd0affe97a397..8cd779f8cad16d43d27084ade912b86bb5786880 100644 (file)
@@ -9,8 +9,8 @@ ifndef CONFIG_SPL_BUILD
 
 obj-$(CONFIG_EFI) += efi/
 obj-$(CONFIG_EFI_LOADER) += efi_loader/
+obj-$(CONFIG_EFI_LOADER) += efi_selftest/
 obj-$(CONFIG_LZMA) += lzma/
-obj-$(CONFIG_LZO) += lzo/
 obj-$(CONFIG_BZIP2) += bzip2/
 obj-$(CONFIG_TIZEN) += tizen/
 obj-$(CONFIG_FIT) += libfdt/
@@ -51,6 +51,8 @@ obj-$(CONFIG_SHA256) += sha256.o
 
 obj-$(CONFIG_$(SPL_)ZLIB) += zlib/
 obj-$(CONFIG_$(SPL_)GZIP) += gunzip.o
+obj-$(CONFIG_$(SPL_)LZO) += lzo/
+
 
 obj-$(CONFIG_$(SPL_TPL_)SAVEENV) += qsort.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += libfdt/
@@ -70,6 +72,7 @@ obj-y += display_options.o
 CFLAGS_display_options.o := $(if $(BUILD_TAG),-DBUILD_TAG='"$(BUILD_TAG)"')
 obj-$(CONFIG_BCH) += bch.o
 obj-y += crc32.o
+obj-$(CONFIG_CRC32C) += crc32c.o
 obj-y += ctype.o
 obj-y += div64.o
 obj-y += hang.o
index b04f7c6297598b51372eeb586a112b1db83cfae5..f4f1bb8ffd5a54fe102a281e718888f6ea6c62d9 100644 (file)
@@ -38,5 +38,7 @@ int main(void)
 
        DEFINE(GD_START_ADDR_SP, offsetof(struct global_data, start_addr_sp));
 
+       DEFINE(GD_NEW_GD, offsetof(struct global_data, new_gd));
+
        return 0;
 }
diff --git a/lib/crc32c.c b/lib/crc32c.c
new file mode 100644 (file)
index 0000000..322c08f
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copied from Linux kernel crypto/crc32c.c
+ * Copyright (c) 2004 Cisco Systems, Inc.
+ * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
+ *
+ * This program 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.
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <compiler.h>
+
+uint32_t crc32c_cal(uint32_t crc, const char *data, int length,
+                   uint32_t *crc32c_table)
+{
+       while (length--)
+               crc = crc32c_table[(u8)(crc ^ *data++)] ^ (crc >> 8);
+
+       return crc;
+}
+
+void crc32c_init(uint32_t *crc32c_table, uint32_t pol)
+{
+       int i, j;
+       uint32_t v;
+       const uint32_t poly = pol; /* Bit-reflected CRC32C polynomial */
+
+       for (i = 0; i < 256; i++) {
+               v = i;
+               for (j = 0; j < 8; j++)
+                       v = (v >> 1) ^ ((v & 1) ? poly : 0);
+
+               crc32c_table[i] = v;
+       }
+}
index 30bf343a36522d24bbb5e655b6451cae2eeccd70..ddb978f650fffb308084cc56225594a0e3d2d5d3 100644 (file)
 CFLAGS_helloworld.o := $(CFLAGS_EFI)
 CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI)
 
-efiprogs-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += helloworld.efi
-always := $(efiprogs-y)
+ifneq ($(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
+always += helloworld.efi
+endif
 
 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 efi_device_path_to_text.o
+obj-y += efi_memory.o efi_device_path_to_text.o efi_device_path.o
+obj-y += efi_file.o efi_variable.o efi_bootmgr.o
 obj-$(CONFIG_LCD) += efi_gop.o
 obj-$(CONFIG_DM_VIDEO) += efi_gop.o
 obj-$(CONFIG_PARTITIONS) += efi_disk.o
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
new file mode 100644 (file)
index 0000000..857d88a
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ *  EFI utils
+ *
+ *  Copyright (c) 2017 Rob Clark
+ *
+ *  SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <charset.h>
+#include <malloc.h>
+#include <efi_loader.h>
+
+static const struct efi_boot_services *bs;
+static const struct efi_runtime_services *rs;
+
+#define LOAD_OPTION_ACTIVE             0x00000001
+#define LOAD_OPTION_FORCE_RECONNECT    0x00000002
+#define LOAD_OPTION_HIDDEN             0x00000008
+
+/*
+ * bootmgr implements the logic of trying to find a payload to boot
+ * based on the BootOrder + BootXXXX variables, and then loading it.
+ *
+ * TODO detecting a special key held (f9?) and displaying a boot menu
+ * like you would get on a PC would be clever.
+ *
+ * TODO if we had a way to write and persist variables after the OS
+ * has started, we'd also want to check OsIndications to see if we
+ * should do normal or recovery boot.
+ */
+
+
+/*
+ * See section 3.1.3 in the v2.7 UEFI spec for more details on
+ * the layout of EFI_LOAD_OPTION.  In short it is:
+ *
+ *    typedef struct _EFI_LOAD_OPTION {
+ *        UINT32 Attributes;
+ *        UINT16 FilePathListLength;
+ *        // CHAR16 Description[];   <-- variable length, NULL terminated
+ *        // EFI_DEVICE_PATH_PROTOCOL FilePathList[];  <-- FilePathListLength bytes
+ *        // UINT8 OptionalData[];
+ *    } EFI_LOAD_OPTION;
+ */
+struct load_option {
+       u32 attributes;
+       u16 file_path_length;
+       u16 *label;
+       struct efi_device_path *file_path;
+       u8 *optional_data;
+};
+
+/* parse an EFI_LOAD_OPTION, as described above */
+static void parse_load_option(struct load_option *lo, void *ptr)
+{
+       lo->attributes = *(u32 *)ptr;
+       ptr += sizeof(u32);
+
+       lo->file_path_length = *(u16 *)ptr;
+       ptr += sizeof(u16);
+
+       lo->label = ptr;
+       ptr += (utf16_strlen(lo->label) + 1) * 2;
+
+       lo->file_path = ptr;
+       ptr += lo->file_path_length;
+
+       lo->optional_data = ptr;
+}
+
+/* free() the result */
+static void *get_var(u16 *name, const efi_guid_t *vendor,
+                    unsigned long *size)
+{
+       efi_guid_t *v = (efi_guid_t *)vendor;
+       efi_status_t ret;
+       void *buf = NULL;
+
+       *size = 0;
+       EFI_CALL(ret = rs->get_variable((s16 *)name, v, NULL, size, buf));
+       if (ret == EFI_BUFFER_TOO_SMALL) {
+               buf = malloc(*size);
+               EFI_CALL(ret = rs->get_variable((s16 *)name, v, NULL, size, buf));
+       }
+
+       if (ret != EFI_SUCCESS) {
+               free(buf);
+               *size = 0;
+               return NULL;
+       }
+
+       return buf;
+}
+
+/*
+ * Attempt to load load-option number 'n', returning device_path and file_path
+ * if successful.  This checks that the EFI_LOAD_OPTION is active (enabled)
+ * and that the specified file to boot exists.
+ */
+static void *try_load_entry(uint16_t n, struct efi_device_path **device_path,
+                           struct efi_device_path **file_path)
+{
+       struct load_option lo;
+       u16 varname[] = L"Boot0000";
+       u16 hexmap[] = L"0123456789ABCDEF";
+       void *load_option, *image = NULL;
+       unsigned long size;
+
+       varname[4] = hexmap[(n & 0xf000) >> 12];
+       varname[5] = hexmap[(n & 0x0f00) >> 8];
+       varname[6] = hexmap[(n & 0x00f0) >> 4];
+       varname[7] = hexmap[(n & 0x000f) >> 0];
+
+       load_option = get_var(varname, &efi_global_variable_guid, &size);
+       if (!load_option)
+               return NULL;
+
+       parse_load_option(&lo, load_option);
+
+       if (lo.attributes & LOAD_OPTION_ACTIVE) {
+               efi_status_t ret;
+               u16 *str = NULL;
+
+               debug("%s: trying to load \"%ls\" from: %ls\n", __func__,
+                     lo.label, (str = efi_dp_str(lo.file_path)));
+               efi_free_pool(str);
+
+               ret = efi_load_image_from_path(lo.file_path, &image);
+
+               if (ret != EFI_SUCCESS)
+                       goto error;
+
+               printf("Booting: %ls\n", lo.label);
+               efi_dp_split_file_path(lo.file_path, device_path, file_path);
+       }
+
+error:
+       free(load_option);
+
+       return image;
+}
+
+/*
+ * Attempt to load, in the order specified by BootOrder EFI variable, the
+ * available load-options, finding and returning the first one that can
+ * be loaded successfully.
+ */
+void *efi_bootmgr_load(struct efi_device_path **device_path,
+                      struct efi_device_path **file_path)
+{
+       uint16_t *bootorder;
+       unsigned long size;
+       void *image = NULL;
+       int i, num;
+
+       __efi_entry_check();
+
+       bs = systab.boottime;
+       rs = systab.runtime;
+
+       bootorder = get_var(L"BootOrder", &efi_global_variable_guid, &size);
+       if (!bootorder)
+               goto error;
+
+       num = size / sizeof(uint16_t);
+       for (i = 0; i < num; i++) {
+               debug("%s: trying to load Boot%04X\n", __func__, bootorder[i]);
+               image = try_load_entry(bootorder[i], device_path, file_path);
+               if (image)
+                       break;
+       }
+
+       free(bootorder);
+
+error:
+       __efi_exit_check();
+
+       return image;
+}
index 43f32385fae01fbdbbcfdbae2e9c4d78e7918477..9e741c3cf3c73b008ce9e4186c6bf448bf803f8a 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <efi_loader.h>
+#include <environment.h>
 #include <malloc.h>
 #include <asm/global_data.h>
 #include <libfdt_env.h>
@@ -18,6 +19,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* Task priority level */
+static UINTN efi_tpl = TPL_APPLICATION;
+
 /* This list contains all the EFI objects our payload has access to */
 LIST_HEAD(efi_obj_list);
 
@@ -109,6 +113,11 @@ static const char *indent_string(int level)
        return &indent[max - level];
 }
 
+const char *__efi_nesting(void)
+{
+       return indent_string(nesting_level);
+}
+
 const char *__efi_nesting_inc(void)
 {
        return indent_string(nesting_level++);
@@ -154,12 +163,15 @@ static u64 efi_div10(u64 a)
 
 void efi_signal_event(struct efi_event *event)
 {
-       if (event->signaled)
-               return;
-       event->signaled = 1;
-       if (event->type & EVT_NOTIFY_SIGNAL) {
-               EFI_CALL(event->notify_function(event, event->notify_context));
+       if (event->notify_function) {
+               event->queued = 1;
+               /* Check TPL */
+               if (efi_tpl >= event->notify_tpl)
+                       return;
+               EFI_CALL_VOID(event->notify_function(event,
+                                                    event->notify_context));
        }
+       event->queued = 0;
 }
 
 static efi_status_t efi_unsupported(const char *funcname)
@@ -170,14 +182,31 @@ static efi_status_t efi_unsupported(const char *funcname)
 
 static unsigned long EFIAPI efi_raise_tpl(UINTN new_tpl)
 {
+       UINTN old_tpl = efi_tpl;
+
        EFI_ENTRY("0x%zx", new_tpl);
-       return EFI_EXIT(0);
+
+       if (new_tpl < efi_tpl)
+               debug("WARNING: new_tpl < current_tpl in %s\n", __func__);
+       efi_tpl = new_tpl;
+       if (efi_tpl > TPL_HIGH_LEVEL)
+               efi_tpl = TPL_HIGH_LEVEL;
+
+       EFI_EXIT(EFI_SUCCESS);
+       return old_tpl;
 }
 
 static void EFIAPI efi_restore_tpl(UINTN old_tpl)
 {
        EFI_ENTRY("0x%zx", old_tpl);
-       efi_unsupported(__func__);
+
+       if (old_tpl > efi_tpl)
+               debug("WARNING: old_tpl > current_tpl in %s\n", __func__);
+       efi_tpl = old_tpl;
+       if (efi_tpl > TPL_HIGH_LEVEL)
+               efi_tpl = TPL_HIGH_LEVEL;
+
+       EFI_EXIT(EFI_SUCCESS);
 }
 
 static efi_status_t EFIAPI efi_allocate_pages_ext(int type, int memory_type,
@@ -270,6 +299,7 @@ efi_status_t efi_create_event(uint32_t type, UINTN notify_tpl,
                efi_events[i].notify_context = notify_context;
                /* Disable timers on bootup */
                efi_events[i].trigger_next = -1ULL;
+               efi_events[i].queued = 0;
                efi_events[i].signaled = 0;
                *event = &efi_events[i];
                return EFI_SUCCESS;
@@ -301,16 +331,25 @@ void efi_timer_check(void)
        u64 now = timer_get_us();
 
        for (i = 0; i < ARRAY_SIZE(efi_events); ++i) {
-               if (!efi_events[i].type ||
-                   !(efi_events[i].type & EVT_TIMER) ||
-                   efi_events[i].trigger_type == EFI_TIMER_STOP ||
+               if (!efi_events[i].type)
+                       continue;
+               if (efi_events[i].queued)
+                       efi_signal_event(&efi_events[i]);
+               if (!(efi_events[i].type & EVT_TIMER) ||
                    now < efi_events[i].trigger_next)
                        continue;
-               if (efi_events[i].trigger_type == EFI_TIMER_PERIODIC) {
+               switch (efi_events[i].trigger_type) {
+               case EFI_TIMER_RELATIVE:
+                       efi_events[i].trigger_type = EFI_TIMER_STOP;
+                       break;
+               case EFI_TIMER_PERIODIC:
                        efi_events[i].trigger_next +=
                                efi_events[i].trigger_time;
-                       efi_events[i].signaled = 0;
+                       break;
+               default:
+                       continue;
                }
+               efi_events[i].signaled = 1;
                efi_signal_event(&efi_events[i]);
        }
        WATCHDOG_RESET();
@@ -347,6 +386,7 @@ efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,
                }
                event->trigger_type = type;
                event->trigger_time = trigger_time;
+               event->signaled = 0;
                return EFI_SUCCESS;
        }
        return EFI_INVALID_PARAMETER;
@@ -371,6 +411,9 @@ static efi_status_t EFIAPI efi_wait_for_event(unsigned long num_events,
        /* Check parameters */
        if (!num_events || !event)
                return EFI_EXIT(EFI_INVALID_PARAMETER);
+       /* Check TPL */
+       if (efi_tpl != TPL_APPLICATION)
+               return EFI_EXIT(EFI_UNSUPPORTED);
        for (i = 0; i < num_events; ++i) {
                for (j = 0; j < ARRAY_SIZE(efi_events); ++j) {
                        if (event[i] == &efi_events[j])
@@ -380,6 +423,8 @@ static efi_status_t EFIAPI efi_wait_for_event(unsigned long num_events,
 known_event:
                if (!event[i]->type || event[i]->type & EVT_NOTIFY_SIGNAL)
                        return EFI_EXIT(EFI_INVALID_PARAMETER);
+               if (!event[i]->signaled)
+                       efi_signal_event(event[i]);
        }
 
        /* Wait for signal */
@@ -412,7 +457,11 @@ static efi_status_t EFIAPI efi_signal_event_ext(struct efi_event *event)
        for (i = 0; i < ARRAY_SIZE(efi_events); ++i) {
                if (event != &efi_events[i])
                        continue;
-               efi_signal_event(event);
+               if (event->signaled)
+                       break;
+               event->signaled = 1;
+               if (event->type & EVT_NOTIFY_SIGNAL)
+                       efi_signal_event(event);
                break;
        }
        return EFI_EXIT(EFI_SUCCESS);
@@ -427,6 +476,7 @@ static efi_status_t EFIAPI efi_close_event(struct efi_event *event)
                if (event == &efi_events[i]) {
                        event->type = 0;
                        event->trigger_next = -1ULL;
+                       event->queued = 0;
                        event->signaled = 0;
                        return EFI_EXIT(EFI_SUCCESS);
                }
@@ -445,6 +495,8 @@ static efi_status_t EFIAPI efi_check_event(struct efi_event *event)
                        continue;
                if (!event->type || event->type & EVT_NOTIFY_SIGNAL)
                        break;
+               if (!event->signaled)
+                       efi_signal_event(event);
                if (event->signaled)
                        return EFI_EXIT(EFI_SUCCESS);
                return EFI_EXIT(EFI_NOT_READY);
@@ -513,7 +565,7 @@ static efi_status_t EFIAPI efi_install_protocol_interface_ext(void **handle,
                        efi_guid_t *protocol, int protocol_interface_type,
                        void *protocol_interface)
 {
-       EFI_ENTRY("%p, %p, %d, %p", handle, protocol, protocol_interface_type,
+       EFI_ENTRY("%p, %pUl, %d, %p", handle, protocol, protocol_interface_type,
                  protocol_interface);
 
        return EFI_EXIT(efi_install_protocol_interface(handle, protocol,
@@ -525,7 +577,7 @@ static efi_status_t EFIAPI efi_reinstall_protocol_interface(void *handle,
                        efi_guid_t *protocol, void *old_interface,
                        void *new_interface)
 {
-       EFI_ENTRY("%p, %p, %p, %p", handle, protocol, old_interface,
+       EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, old_interface,
                  new_interface);
        return EFI_EXIT(EFI_ACCESS_DENIED);
 }
@@ -574,7 +626,7 @@ out:
 static efi_status_t EFIAPI efi_uninstall_protocol_interface_ext(void *handle,
                        efi_guid_t *protocol, void *protocol_interface)
 {
-       EFI_ENTRY("%p, %p, %p", handle, protocol, protocol_interface);
+       EFI_ENTRY("%p, %pUl, %p", handle, protocol, protocol_interface);
 
        return EFI_EXIT(efi_uninstall_protocol_interface(handle, protocol,
                                                         protocol_interface));
@@ -584,7 +636,7 @@ static efi_status_t EFIAPI efi_register_protocol_notify(efi_guid_t *protocol,
                                                        struct efi_event *event,
                                                        void **registration)
 {
-       EFI_ENTRY("%p, %p, %p", protocol, event, registration);
+       EFI_ENTRY("%pUl, %p, %p", protocol, event, registration);
        return EFI_EXIT(EFI_OUT_OF_RESOURCES);
 }
 
@@ -654,7 +706,7 @@ static efi_status_t EFIAPI efi_locate_handle_ext(
                        efi_guid_t *protocol, void *search_key,
                        unsigned long *buffer_size, efi_handle_t *buffer)
 {
-       EFI_ENTRY("%d, %p, %p, %p, %p", search_type, protocol, search_key,
+       EFI_ENTRY("%d, %pUl, %p, %p, %p", search_type, protocol, search_key,
                  buffer_size, buffer);
 
        return EFI_EXIT(efi_locate_handle(search_type, protocol, search_key,
@@ -665,8 +717,17 @@ static efi_status_t EFIAPI efi_locate_device_path(efi_guid_t *protocol,
                        struct efi_device_path **device_path,
                        efi_handle_t *device)
 {
-       EFI_ENTRY("%p, %p, %p", protocol, device_path, device);
-       return EFI_EXIT(EFI_NOT_FOUND);
+       struct efi_object *efiobj;
+
+       EFI_ENTRY("%pUl, %p, %p", protocol, device_path, device);
+
+       efiobj = efi_dp_find_obj(*device_path, device_path);
+       if (!efiobj)
+               return EFI_EXIT(EFI_NOT_FOUND);
+
+       *device = efiobj->handle;
+
+       return EFI_EXIT(EFI_SUCCESS);
 }
 
 /* Collapses configuration table entries, removing index i */
@@ -713,10 +774,87 @@ efi_status_t efi_install_configuration_table(const efi_guid_t *guid, void *table
 static efi_status_t EFIAPI efi_install_configuration_table_ext(efi_guid_t *guid,
                                                               void *table)
 {
-       EFI_ENTRY("%p, %p", guid, table);
+       EFI_ENTRY("%pUl, %p", guid, table);
        return EFI_EXIT(efi_install_configuration_table(guid, table));
 }
 
+/* Initialize a loaded_image_info + loaded_image_info object with correct
+ * protocols, boot-device, etc.
+ */
+void efi_setup_loaded_image(struct efi_loaded_image *info, struct efi_object *obj,
+                           struct efi_device_path *device_path,
+                           struct efi_device_path *file_path)
+{
+       obj->handle = info;
+
+       /*
+        * When asking for the device path interface, return
+        * bootefi_device_path
+        */
+       obj->protocols[0].guid = &efi_guid_device_path;
+       obj->protocols[0].protocol_interface = device_path;
+
+       /*
+        * When asking for the loaded_image interface, just
+        * return handle which points to loaded_image_info
+        */
+       obj->protocols[1].guid = &efi_guid_loaded_image;
+       obj->protocols[1].protocol_interface = info;
+
+       obj->protocols[2].guid = &efi_guid_console_control;
+       obj->protocols[2].protocol_interface = (void *)&efi_console_control;
+
+       obj->protocols[3].guid = &efi_guid_device_path_to_text_protocol;
+       obj->protocols[3].protocol_interface =
+               (void *)&efi_device_path_to_text;
+
+       info->file_path = file_path;
+       info->device_handle = efi_dp_find_obj(device_path, NULL);
+
+       list_add_tail(&obj->link, &efi_obj_list);
+}
+
+efi_status_t efi_load_image_from_path(struct efi_device_path *file_path,
+                                     void **buffer)
+{
+       struct efi_file_info *info = NULL;
+       struct efi_file_handle *f;
+       static efi_status_t ret;
+       uint64_t bs;
+
+       f = efi_file_from_path(file_path);
+       if (!f)
+               return EFI_DEVICE_ERROR;
+
+       bs = 0;
+       EFI_CALL(ret = f->getinfo(f, (efi_guid_t *)&efi_file_info_guid,
+                                 &bs, info));
+       if (ret == EFI_BUFFER_TOO_SMALL) {
+               info = malloc(bs);
+               EFI_CALL(ret = f->getinfo(f, (efi_guid_t *)&efi_file_info_guid,
+                                         &bs, info));
+       }
+       if (ret != EFI_SUCCESS)
+               goto error;
+
+       ret = efi_allocate_pool(EFI_LOADER_DATA, info->file_size, buffer);
+       if (ret)
+               goto error;
+
+       EFI_CALL(ret = f->read(f, &info->file_size, *buffer));
+
+error:
+       free(info);
+       EFI_CALL(f->close(f));
+
+       if (ret != EFI_SUCCESS) {
+               efi_free_pool(*buffer);
+               *buffer = NULL;
+       }
+
+       return ret;
+}
+
 static efi_status_t EFIAPI efi_load_image(bool boot_policy,
                                          efi_handle_t parent_image,
                                          struct efi_device_path *file_path,
@@ -724,25 +862,40 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy,
                                          unsigned long source_size,
                                          efi_handle_t *image_handle)
 {
-       static struct efi_object loaded_image_info_obj = {
-               .protocols = {
-                       {
-                               .guid = &efi_guid_loaded_image,
-                       },
-               },
-       };
        struct efi_loaded_image *info;
        struct efi_object *obj;
 
        EFI_ENTRY("%d, %p, %p, %p, %ld, %p", boot_policy, parent_image,
                  file_path, source_buffer, source_size, image_handle);
-       info = malloc(sizeof(*info));
-       loaded_image_info_obj.protocols[0].protocol_interface = info;
-       obj = malloc(sizeof(loaded_image_info_obj));
-       memset(info, 0, sizeof(*info));
-       memcpy(obj, &loaded_image_info_obj, sizeof(loaded_image_info_obj));
-       obj->handle = info;
-       info->file_path = file_path;
+
+       info = calloc(1, sizeof(*info));
+       obj = calloc(1, sizeof(*obj));
+
+       if (!source_buffer) {
+               struct efi_device_path *dp, *fp;
+               efi_status_t ret;
+
+               ret = efi_load_image_from_path(file_path, &source_buffer);
+               if (ret != EFI_SUCCESS) {
+                       free(info);
+                       free(obj);
+                       return EFI_EXIT(ret);
+               }
+
+               /*
+                * split file_path which contains both the device and
+                * file parts:
+                */
+               efi_dp_split_file_path(file_path, &dp, &fp);
+
+               efi_setup_loaded_image(info, obj, dp, fp);
+       } else {
+               /* In this case, file_path is the "device" path, ie.
+                * something like a HARDWARE_DEVICE:MEMORY_MAPPED
+                */
+               efi_setup_loaded_image(info, obj, file_path, NULL);
+       }
+
        info->reserved = efi_load_pe(source_buffer, info);
        if (!info->reserved) {
                free(info);
@@ -751,7 +904,6 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy,
        }
 
        *image_handle = info;
-       list_add_tail(&obj->link, &efi_obj_list);
 
        return EFI_EXIT(EFI_SUCCESS);
 }
@@ -793,6 +945,15 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle,
        EFI_ENTRY("%p, %ld, %ld, %p", image_handle, exit_status,
                  exit_data_size, exit_data);
 
+       /* Make sure entry/exit counts for EFI world cross-overs match */
+       __efi_exit_check();
+
+       /*
+        * But longjmp out with the U-Boot gd, not the application's, as
+        * the other end is a setjmp call inside EFI context.
+        */
+       efi_restore_gd();
+
        loaded_image_info->exit_status = exit_status;
        longjmp(&loaded_image_info->exit_jmp, 1);
 
@@ -840,8 +1001,24 @@ static void efi_exit_caches(void)
 static efi_status_t EFIAPI efi_exit_boot_services(void *image_handle,
                                                  unsigned long map_key)
 {
+       int i;
+
        EFI_ENTRY("%p, %ld", image_handle, map_key);
 
+       /* Notify that ExitBootServices is invoked. */
+       for (i = 0; i < ARRAY_SIZE(efi_events); ++i) {
+               if (efi_events[i].type != EVT_SIGNAL_EXIT_BOOT_SERVICES)
+                       continue;
+               efi_signal_event(&efi_events[i]);
+       }
+       /* Make sure that notification functions are not called anymore */
+       efi_tpl = TPL_HIGH_LEVEL;
+
+#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
+       /* save any EFI variables that have been written: */
+       env_save();
+#endif
+
        board_quiesce_devices();
 
        /* Fix up caches for EFI payloads if necessary */
@@ -906,7 +1083,7 @@ static efi_status_t EFIAPI efi_close_protocol(void *handle,
                                              void *agent_handle,
                                              void *controller_handle)
 {
-       EFI_ENTRY("%p, %p, %p, %p", handle, protocol, agent_handle,
+       EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, agent_handle,
                  controller_handle);
        return EFI_EXIT(EFI_NOT_FOUND);
 }
@@ -916,7 +1093,7 @@ static efi_status_t EFIAPI efi_open_protocol_information(efi_handle_t handle,
                        struct efi_open_protocol_info_entry **entry_buffer,
                        unsigned long *entry_count)
 {
-       EFI_ENTRY("%p, %p, %p, %p", handle, protocol, entry_buffer,
+       EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, entry_buffer,
                  entry_count);
        return EFI_EXIT(EFI_NOT_FOUND);
 }
@@ -982,7 +1159,7 @@ static efi_status_t EFIAPI efi_locate_handle_buffer(
        efi_status_t r;
        unsigned long buffer_size = 0;
 
-       EFI_ENTRY("%d, %p, %p, %p, %p", search_type, protocol, search_key,
+       EFI_ENTRY("%d, %pUl, %p, %p, %p", search_type, protocol, search_key,
                  no_handles, buffer);
 
        if (!no_handles || !buffer) {
@@ -1014,11 +1191,13 @@ static efi_status_t EFIAPI efi_locate_protocol(efi_guid_t *protocol,
        struct list_head *lhandle;
        int i;
 
-       EFI_ENTRY("%p, %p, %p", protocol, registration, protocol_interface);
+       EFI_ENTRY("%pUl, %p, %p", protocol, registration, protocol_interface);
 
        if (!protocol || !protocol_interface)
                return EFI_EXIT(EFI_INVALID_PARAMETER);
 
+       EFI_PRINT_GUID("protocol", protocol);
+
        list_for_each(lhandle, &efi_obj_list) {
                struct efi_object *efiobj;
 
@@ -1122,7 +1301,7 @@ static efi_status_t EFIAPI efi_open_protocol(
        int i;
        efi_status_t r = EFI_INVALID_PARAMETER;
 
-       EFI_ENTRY("%p, %p, %p, %p, %p, 0x%x", handle, protocol,
+       EFI_ENTRY("%p, %pUl, %p, %p, %p, 0x%x", handle, protocol,
                  protocol_interface, agent_handle, controller_handle,
                  attributes);
 
@@ -1132,6 +1311,8 @@ static efi_status_t EFIAPI efi_open_protocol(
                goto out;
        }
 
+       EFI_PRINT_GUID("protocol", protocol);
+
        switch (attributes) {
        case EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL:
        case EFI_OPEN_PROTOCOL_GET_PROTOCOL:
index 3fc82b87261cba504da576393fb589d769b6eaa1..fd5398d61d94ff40fa83884de8c3dea26a8944c2 100644 (file)
@@ -8,7 +8,10 @@
 
 #include <common.h>
 #include <charset.h>
+#include <dm/device.h>
 #include <efi_loader.h>
+#include <stdio_dev.h>
+#include <video_console.h>
 
 static bool console_size_queried;
 
@@ -137,34 +140,46 @@ static efi_status_t EFIAPI efi_cout_reset(
        return EFI_EXIT(EFI_UNSUPPORTED);
 }
 
-static void print_unicode_in_utf8(u16 c)
-{
-       char utf8[MAX_UTF8_PER_UTF16] = { 0 };
-       utf16_to_utf8((u8 *)utf8, &c, 1);
-       puts(utf8);
-}
-
 static efi_status_t EFIAPI efi_cout_output_string(
                        struct efi_simple_text_output_protocol *this,
-                       const unsigned short *string)
+                       const efi_string_t string)
 {
-       struct cout_mode *mode;
-       u16 ch;
+       struct simple_text_output_mode *con = &efi_con_mode;
+       struct cout_mode *mode = &efi_cout_modes[con->mode];
 
-       mode = &efi_cout_modes[efi_con_mode.mode];
        EFI_ENTRY("%p, %p", this, string);
-       for (;(ch = *string); string++) {
-               print_unicode_in_utf8(ch);
-               efi_con_mode.cursor_column++;
-               if (ch == '\n') {
-                       efi_con_mode.cursor_column = 1;
-                       efi_con_mode.cursor_row++;
-               } else if (efi_con_mode.cursor_column > mode->columns) {
-                       efi_con_mode.cursor_column = 1;
-                       efi_con_mode.cursor_row++;
+
+       unsigned int n16 = utf16_strlen(string);
+       char buf[MAX_UTF8_PER_UTF16 * n16 + 1];
+       char *p;
+
+       *utf16_to_utf8((u8 *)buf, string, n16) = '\0';
+
+       fputs(stdout, buf);
+
+       for (p = buf; *p; p++) {
+               switch (*p) {
+               case '\r':   /* carriage-return */
+                       con->cursor_column = 0;
+                       break;
+               case '\n':   /* newline */
+                       con->cursor_column = 0;
+                       con->cursor_row++;
+                       break;
+               case '\t':   /* tab, assume 8 char align */
+                       break;
+               case '\b':   /* backspace */
+                       con->cursor_column = max(0, con->cursor_column - 1);
+                       break;
+               default:
+                       con->cursor_column++;
+                       break;
                }
-               if (efi_con_mode.cursor_row > mode->rows)
-                       efi_con_mode.cursor_row = mode->rows;
+               if (con->cursor_column >= mode->columns) {
+                       con->cursor_column = 0;
+                       con->cursor_row++;
+               }
+               con->cursor_row = min(con->cursor_row, (s32)mode->rows - 1);
        }
 
        return EFI_EXIT(EFI_SUCCESS);
@@ -172,7 +187,7 @@ static efi_status_t EFIAPI efi_cout_output_string(
 
 static efi_status_t EFIAPI efi_cout_test_string(
                        struct efi_simple_text_output_protocol *this,
-                       const unsigned short *string)
+                       const efi_string_t string)
 {
        EFI_ENTRY("%p, %p", this, string);
        return EFI_EXIT(EFI_SUCCESS);
@@ -186,6 +201,34 @@ static bool cout_mode_matches(struct cout_mode *mode, int rows, int cols)
        return (mode->rows == rows) && (mode->columns == cols);
 }
 
+static int query_console_serial(int *rows, int *cols)
+{
+       /* Ask the terminal about its size */
+       int n[3];
+       u64 timeout;
+
+       /* Empty input buffer */
+       while (tstc())
+               getc();
+
+       printf(ESC"[18t");
+
+       /* Check if we have a terminal that understands */
+       timeout = timer_get_us() + 1000000;
+       while (!tstc())
+               if (timer_get_us() > timeout)
+                       return -1;
+
+       /* Read {depth,rows,cols} */
+       if (term_read_reply(n, 3, 't'))
+               return -1;
+
+       *cols = n[2];
+       *rows = n[1];
+
+       return 0;
+}
+
 static efi_status_t EFIAPI efi_cout_query_mode(
                        struct efi_simple_text_output_protocol *this,
                        unsigned long mode_number, unsigned long *columns,
@@ -194,34 +237,24 @@ static efi_status_t EFIAPI efi_cout_query_mode(
        EFI_ENTRY("%p, %ld, %p, %p", this, mode_number, columns, rows);
 
        if (!console_size_queried) {
-               /* Ask the terminal about its size */
-               int n[3];
-               int cols;
-               int rows;
-               u64 timeout;
+               const char *stdout_name = env_get("stdout");
+               int rows, cols;
 
                console_size_queried = true;
 
-               /* Empty input buffer */
-               while (tstc())
-                       getc();
-
-               printf(ESC"[18t");
-
-               /* Check if we have a terminal that understands */
-               timeout = timer_get_us() + 1000000;
-               while (!tstc())
-                       if (timer_get_us() > timeout)
-                               goto out;
-
-               /* Read {depth,rows,cols} */
-               if (term_read_reply(n, 3, 't')) {
+               if (stdout_name && !strcmp(stdout_name, "vidconsole") &&
+                   IS_ENABLED(CONFIG_DM_VIDEO)) {
+                       struct stdio_dev *stdout_dev =
+                               stdio_get_by_name("vidconsole");
+                       struct udevice *dev = stdout_dev->priv;
+                       struct vidconsole_priv *priv =
+                               dev_get_uclass_priv(dev);
+                       rows = priv->rows;
+                       cols = priv->cols;
+               } else if (query_console_serial(&rows, &cols)) {
                        goto out;
                }
 
-               cols = n[2];
-               rows = n[1];
-
                /* Test if we can have Mode 1 */
                if (cols >= 80 && rows >= 50) {
                        efi_cout_modes[1].present = 1;
@@ -426,8 +459,10 @@ static void EFIAPI efi_console_timer_notify(struct efi_event *event,
                                            void *context)
 {
        EFI_ENTRY("%p, %p", event, context);
-       if (tstc())
+       if (tstc()) {
+               efi_con_in.wait_for_key->signaled = 1;
                efi_signal_event(efi_con_in.wait_for_key);
+               }
        EFI_EXIT(EFI_SUCCESS);
 }
 
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
new file mode 100644 (file)
index 0000000..5d5c3b3
--- /dev/null
@@ -0,0 +1,563 @@
+/*
+ * EFI device path from u-boot device-model mapping
+ *
+ * (C) Copyright 2017 Rob Clark
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <common.h>
+#include <blk.h>
+#include <dm.h>
+#include <usb.h>
+#include <mmc.h>
+#include <efi_loader.h>
+#include <inttypes.h>
+#include <part.h>
+
+/* template END node: */
+static const struct efi_device_path END = {
+       .type     = DEVICE_PATH_TYPE_END,
+       .sub_type = DEVICE_PATH_SUB_TYPE_END,
+       .length   = sizeof(END),
+};
+
+#define U_BOOT_GUID \
+       EFI_GUID(0xe61d73b9, 0xa384, 0x4acc, \
+                0xae, 0xab, 0x82, 0xe8, 0x28, 0xf3, 0x62, 0x8b)
+
+/* template ROOT node: */
+static const struct efi_device_path_vendor ROOT = {
+       .dp = {
+               .type     = DEVICE_PATH_TYPE_HARDWARE_DEVICE,
+               .sub_type = DEVICE_PATH_SUB_TYPE_VENDOR,
+               .length   = sizeof(ROOT),
+       },
+       .guid = U_BOOT_GUID,
+};
+
+static void *dp_alloc(size_t sz)
+{
+       void *buf;
+
+       if (efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, sz, &buf) != EFI_SUCCESS)
+               return NULL;
+
+       return buf;
+}
+
+/*
+ * Iterate to next block in device-path, terminating (returning NULL)
+ * at /End* node.
+ */
+struct efi_device_path *efi_dp_next(const struct efi_device_path *dp)
+{
+       if (dp == NULL)
+               return NULL;
+       if (dp->type == DEVICE_PATH_TYPE_END)
+               return NULL;
+       dp = ((void *)dp) + dp->length;
+       if (dp->type == DEVICE_PATH_TYPE_END)
+               return NULL;
+       return (struct efi_device_path *)dp;
+}
+
+/*
+ * Compare two device-paths, stopping when the shorter of the two hits
+ * an End* node.  This is useful to, for example, compare a device-path
+ * representing a device with one representing a file on the device, or
+ * a device with a parent device.
+ */
+int efi_dp_match(struct efi_device_path *a, struct efi_device_path *b)
+{
+       while (1) {
+               int ret;
+
+               ret = memcmp(&a->length, &b->length, sizeof(a->length));
+               if (ret)
+                       return ret;
+
+               ret = memcmp(a, b, a->length);
+               if (ret)
+                       return ret;
+
+               a = efi_dp_next(a);
+               b = efi_dp_next(b);
+
+               if (!a || !b)
+                       return 0;
+       }
+}
+
+
+/*
+ * See UEFI spec (section 3.1.2, about short-form device-paths..
+ * tl;dr: we can have a device-path that starts with a USB WWID
+ * or USB Class node, and a few other cases which don't encode
+ * the full device path with bus hierarchy:
+ *
+ *   - MESSAGING:USB_WWID
+ *   - MESSAGING:USB_CLASS
+ *   - MEDIA:FILE_PATH
+ *   - MEDIA:HARD_DRIVE
+ *   - MESSAGING:URI
+ */
+static struct efi_device_path *shorten_path(struct efi_device_path *dp)
+{
+       while (dp) {
+               /*
+                * TODO: Add MESSAGING:USB_WWID and MESSAGING:URI..
+                * in practice fallback.efi just uses MEDIA:HARD_DRIVE
+                * so not sure when we would see these other cases.
+                */
+               if (EFI_DP_TYPE(dp, MESSAGING_DEVICE, MSG_USB_CLASS) ||
+                   EFI_DP_TYPE(dp, MEDIA_DEVICE, HARD_DRIVE_PATH) ||
+                   EFI_DP_TYPE(dp, MEDIA_DEVICE, FILE_PATH))
+                       return dp;
+
+               dp = efi_dp_next(dp);
+       }
+
+       return dp;
+}
+
+static struct efi_object *find_obj(struct efi_device_path *dp, bool short_path,
+                                  struct efi_device_path **rem)
+{
+       struct efi_object *efiobj;
+
+       list_for_each_entry(efiobj, &efi_obj_list, link) {
+               int i;
+
+               for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) {
+                       struct efi_handler *handler = &efiobj->protocols[i];
+                       struct efi_device_path *obj_dp;
+
+                       if (!handler->guid)
+                               break;
+
+                       if (guidcmp(handler->guid, &efi_guid_device_path))
+                               continue;
+
+                       obj_dp = handler->protocol_interface;
+
+                       do {
+                               if (efi_dp_match(dp, obj_dp) == 0) {
+                                       if (rem) {
+                                               *rem = ((void *)dp) +
+                                                       efi_dp_size(obj_dp);
+                                       }
+                                       return efiobj;
+                               }
+
+                               obj_dp = shorten_path(efi_dp_next(obj_dp));
+                       } while (short_path && obj_dp);
+               }
+       }
+
+       return NULL;
+}
+
+
+/*
+ * Find an efiobj from device-path, if 'rem' is not NULL, returns the
+ * remaining part of the device path after the matched object.
+ */
+struct efi_object *efi_dp_find_obj(struct efi_device_path *dp,
+                                  struct efi_device_path **rem)
+{
+       struct efi_object *efiobj;
+
+       efiobj = find_obj(dp, false, rem);
+
+       if (!efiobj)
+               efiobj = find_obj(dp, true, rem);
+
+       return efiobj;
+}
+
+/* return size not including End node: */
+unsigned efi_dp_size(const struct efi_device_path *dp)
+{
+       unsigned sz = 0;
+
+       while (dp) {
+               sz += dp->length;
+               dp = efi_dp_next(dp);
+       }
+
+       return sz;
+}
+
+struct efi_device_path *efi_dp_dup(const struct efi_device_path *dp)
+{
+       struct efi_device_path *ndp;
+       unsigned sz = efi_dp_size(dp) + sizeof(END);
+
+       if (!dp)
+               return NULL;
+
+       ndp = dp_alloc(sz);
+       memcpy(ndp, dp, sz);
+
+       return ndp;
+}
+
+struct efi_device_path *efi_dp_append(const struct efi_device_path *dp1,
+                                     const struct efi_device_path *dp2)
+{
+       struct efi_device_path *ret;
+
+       if (!dp1) {
+               ret = efi_dp_dup(dp2);
+       } else if (!dp2) {
+               ret = efi_dp_dup(dp1);
+       } else {
+               /* both dp1 and dp2 are non-null */
+               unsigned sz1 = efi_dp_size(dp1);
+               unsigned sz2 = efi_dp_size(dp2);
+               void *p = dp_alloc(sz1 + sz2 + sizeof(END));
+               memcpy(p, dp1, sz1);
+               memcpy(p + sz1, dp2, sz2);
+               memcpy(p + sz1 + sz2, &END, sizeof(END));
+               ret = p;
+       }
+
+       return ret;
+}
+
+struct efi_device_path *efi_dp_append_node(const struct efi_device_path *dp,
+                                          const struct efi_device_path *node)
+{
+       struct efi_device_path *ret;
+
+       if (!node && !dp) {
+               ret = efi_dp_dup(&END);
+       } else if (!node) {
+               ret = efi_dp_dup(dp);
+       } else if (!dp) {
+               unsigned sz = node->length;
+               void *p = dp_alloc(sz + sizeof(END));
+               memcpy(p, node, sz);
+               memcpy(p + sz, &END, sizeof(END));
+               ret = p;
+       } else {
+               /* both dp and node are non-null */
+               unsigned sz = efi_dp_size(dp);
+               void *p = dp_alloc(sz + node->length + sizeof(END));
+               memcpy(p, dp, sz);
+               memcpy(p + sz, node, node->length);
+               memcpy(p + sz + node->length, &END, sizeof(END));
+               ret = p;
+       }
+
+       return ret;
+}
+
+#ifdef CONFIG_DM
+/* size of device-path not including END node for device and all parents
+ * up to the root device.
+ */
+static unsigned dp_size(struct udevice *dev)
+{
+       if (!dev || !dev->driver)
+               return sizeof(ROOT);
+
+       switch (dev->driver->id) {
+       case UCLASS_ROOT:
+       case UCLASS_SIMPLE_BUS:
+               /* stop traversing parents at this point: */
+               return sizeof(ROOT);
+       case UCLASS_MMC:
+               return dp_size(dev->parent) +
+                       sizeof(struct efi_device_path_sd_mmc_path);
+       case UCLASS_MASS_STORAGE:
+       case UCLASS_USB_HUB:
+               return dp_size(dev->parent) +
+                       sizeof(struct efi_device_path_usb_class);
+       default:
+               /* just skip over unknown classes: */
+               return dp_size(dev->parent);
+       }
+}
+
+static void *dp_fill(void *buf, struct udevice *dev)
+{
+       if (!dev || !dev->driver)
+               return buf;
+
+       switch (dev->driver->id) {
+       case UCLASS_ROOT:
+       case UCLASS_SIMPLE_BUS: {
+               /* stop traversing parents at this point: */
+               struct efi_device_path_vendor *vdp = buf;
+               *vdp = ROOT;
+               return &vdp[1];
+       }
+#if defined(CONFIG_DM_MMC) && defined(CONFIG_MMC)
+       case UCLASS_MMC: {
+               struct efi_device_path_sd_mmc_path *sddp =
+                       dp_fill(buf, dev->parent);
+               struct mmc *mmc = mmc_get_mmc_dev(dev);
+               struct blk_desc *desc = mmc_get_blk_desc(mmc);
+
+               sddp->dp.type     = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
+               sddp->dp.sub_type = (desc->if_type == IF_TYPE_MMC) ?
+                       DEVICE_PATH_SUB_TYPE_MSG_MMC :
+                       DEVICE_PATH_SUB_TYPE_MSG_SD;
+               sddp->dp.length   = sizeof(*sddp);
+               sddp->slot_number = dev->seq;
+
+               return &sddp[1];
+       }
+#endif
+       case UCLASS_MASS_STORAGE:
+       case UCLASS_USB_HUB: {
+               struct efi_device_path_usb_class *udp =
+                       dp_fill(buf, dev->parent);
+               struct usb_device *udev = dev_get_parent_priv(dev);
+               struct usb_device_descriptor *desc = &udev->descriptor;
+
+               udp->dp.type     = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
+               udp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_USB_CLASS;
+               udp->dp.length   = sizeof(*udp);
+               udp->vendor_id   = desc->idVendor;
+               udp->product_id  = desc->idProduct;
+               udp->device_class    = desc->bDeviceClass;
+               udp->device_subclass = desc->bDeviceSubClass;
+               udp->device_protocol = desc->bDeviceProtocol;
+
+               return &udp[1];
+       }
+       default:
+               debug("unhandled device class: %s (%u)\n",
+                     dev->name, dev->driver->id);
+               return dp_fill(buf, dev->parent);
+       }
+}
+
+/* Construct a device-path from a device: */
+struct efi_device_path *efi_dp_from_dev(struct udevice *dev)
+{
+       void *buf, *start;
+
+       start = buf = dp_alloc(dp_size(dev) + sizeof(END));
+       buf = dp_fill(buf, dev);
+       *((struct efi_device_path *)buf) = END;
+
+       return start;
+}
+#endif
+
+static unsigned dp_part_size(struct blk_desc *desc, int part)
+{
+       unsigned dpsize;
+
+#ifdef CONFIG_BLK
+       dpsize = dp_size(desc->bdev->parent);
+#else
+       dpsize = sizeof(ROOT) + sizeof(struct efi_device_path_usb);
+#endif
+
+       if (part == 0) /* the actual disk, not a partition */
+               return dpsize;
+
+       if (desc->part_type == PART_TYPE_ISO)
+               dpsize += sizeof(struct efi_device_path_cdrom_path);
+       else
+               dpsize += sizeof(struct efi_device_path_hard_drive_path);
+
+       return dpsize;
+}
+
+static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)
+{
+       disk_partition_t info;
+
+#ifdef CONFIG_BLK
+       buf = dp_fill(buf, desc->bdev->parent);
+#else
+       /*
+        * We *could* make a more accurate path, by looking at if_type
+        * and handling all the different cases like we do for non-
+        * legacy (ie CONFIG_BLK=y) case.  But most important thing
+        * is just to have a unique device-path for if_type+devnum.
+        * So map things to a fictional USB device:
+        */
+       struct efi_device_path_usb *udp;
+
+       memcpy(buf, &ROOT, sizeof(ROOT));
+       buf += sizeof(ROOT);
+
+       udp = buf;
+       udp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
+       udp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_USB;
+       udp->dp.length = sizeof(*udp);
+       udp->parent_port_number = desc->if_type;
+       udp->usb_interface = desc->devnum;
+       buf = &udp[1];
+#endif
+
+       if (part == 0) /* the actual disk, not a partition */
+               return buf;
+
+       part_get_info(desc, part, &info);
+
+       if (desc->part_type == PART_TYPE_ISO) {
+               struct efi_device_path_cdrom_path *cddp = buf;
+
+               cddp->boot_entry = part - 1;
+               cddp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
+               cddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_CDROM_PATH;
+               cddp->dp.length = sizeof(*cddp);
+               cddp->partition_start = info.start;
+               cddp->partition_end = info.size;
+
+               buf = &cddp[1];
+       } else {
+               struct efi_device_path_hard_drive_path *hddp = buf;
+
+               hddp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
+               hddp->dp.sub_type = DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH;
+               hddp->dp.length = sizeof(*hddp);
+               hddp->partition_number = part - 1;
+               hddp->partition_start = info.start;
+               hddp->partition_end = info.size;
+               if (desc->part_type == PART_TYPE_EFI)
+                       hddp->partmap_type = 2;
+               else
+                       hddp->partmap_type = 1;
+               hddp->signature_type = desc->sig_type;
+               if (hddp->signature_type != 0)
+                       memcpy(hddp->partition_signature, &desc->guid_sig,
+                              sizeof(hddp->partition_signature));
+
+               buf = &hddp[1];
+       }
+
+       return buf;
+}
+
+
+/* Construct a device-path from a partition on a blk device: */
+struct efi_device_path *efi_dp_from_part(struct blk_desc *desc, int part)
+{
+       void *buf, *start;
+
+       start = buf = dp_alloc(dp_part_size(desc, part) + sizeof(END));
+
+       buf = dp_part_fill(buf, desc, part);
+
+       *((struct efi_device_path *)buf) = END;
+
+       return start;
+}
+
+/* convert path to an UEFI style path (ie. DOS style backslashes and utf16) */
+static void path_to_uefi(u16 *uefi, const char *path)
+{
+       while (*path) {
+               char c = *(path++);
+               if (c == '/')
+                       c = '\\';
+               *(uefi++) = c;
+       }
+       *uefi = '\0';
+}
+
+/*
+ * If desc is NULL, this creates a path with only the file component,
+ * otherwise it creates a full path with both device and file components
+ */
+struct efi_device_path *efi_dp_from_file(struct blk_desc *desc, int part,
+               const char *path)
+{
+       struct efi_device_path_file_path *fp;
+       void *buf, *start;
+       unsigned dpsize = 0, fpsize;
+
+       if (desc)
+               dpsize = dp_part_size(desc, part);
+
+       fpsize = sizeof(struct efi_device_path) + 2 * (strlen(path) + 1);
+       dpsize += fpsize;
+
+       start = buf = dp_alloc(dpsize + sizeof(END));
+
+       if (desc)
+               buf = dp_part_fill(buf, desc, part);
+
+       /* add file-path: */
+       fp = buf;
+       fp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
+       fp->dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH;
+       fp->dp.length = fpsize;
+       path_to_uefi(fp->str, path);
+       buf += fpsize;
+
+       *((struct efi_device_path *)buf) = END;
+
+       return start;
+}
+
+#ifdef CONFIG_NET
+struct efi_device_path *efi_dp_from_eth(void)
+{
+       struct efi_device_path_mac_addr *ndp;
+       void *buf, *start;
+       unsigned dpsize = 0;
+
+       assert(eth_get_dev());
+
+#ifdef CONFIG_DM_ETH
+       dpsize += dp_size(eth_get_dev());
+#else
+       dpsize += sizeof(ROOT);
+#endif
+       dpsize += sizeof(*ndp);
+
+       start = buf = dp_alloc(dpsize + sizeof(END));
+
+#ifdef CONFIG_DM_ETH
+       buf = dp_fill(buf, eth_get_dev());
+#else
+       memcpy(buf, &ROOT, sizeof(ROOT));
+       buf += sizeof(ROOT);
+#endif
+
+       ndp = buf;
+       ndp->dp.type = DEVICE_PATH_TYPE_MESSAGING_DEVICE;
+       ndp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR;
+       ndp->dp.length = sizeof(*ndp);
+       memcpy(ndp->mac.addr, eth_get_ethaddr(), ARP_HLEN);
+       buf = &ndp[1];
+
+       *((struct efi_device_path *)buf) = END;
+
+       return start;
+}
+#endif
+
+/*
+ * Helper to split a full device path (containing both device and file
+ * parts) into it's constituent parts.
+ */
+void efi_dp_split_file_path(struct efi_device_path *full_path,
+                           struct efi_device_path **device_path,
+                           struct efi_device_path **file_path)
+{
+       struct efi_device_path *p, *dp, *fp;
+
+       dp = efi_dp_dup(full_path);
+       p = dp;
+       while (!EFI_DP_TYPE(p, MEDIA_DEVICE, FILE_PATH))
+               p = efi_dp_next(p);
+       fp = efi_dp_dup(p);
+
+       p->type = DEVICE_PATH_TYPE_END;
+       p->sub_type = DEVICE_PATH_SUB_TYPE_END;
+       p->length = sizeof(*p);
+
+       *device_path = dp;
+       *file_path = fp;
+}
index 4b2f43f0c8a65e037eed759426ffa8cb13ff66d4..1a5ef3919bac92035c7a1a112b08a4313a8d6c71 100644 (file)
 const efi_guid_t efi_guid_device_path_to_text_protocol =
                EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID;
 
-static uint16_t *efi_convert_device_node_to_text(
-               struct efi_device_path_protocol *device_node,
-               bool display_only,
-               bool allow_shortcuts)
+static char *dp_unknown(char *s, struct efi_device_path *dp)
 {
-       unsigned long buffer_size;
-       efi_status_t r;
-       uint16_t *buffer = NULL;
-       int i;
+       s += sprintf(s, "/UNKNOWN(%04x,%04x)", dp->type, dp->sub_type);
+       return s;
+}
 
-       switch (device_node->type) {
-       case DEVICE_PATH_TYPE_END:
-               return NULL;
-       case DEVICE_PATH_TYPE_MESSAGING_DEVICE:
-               switch (device_node->sub_type) {
-               case DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR: {
-                       struct efi_device_path_mac_addr *dp =
-                               (struct efi_device_path_mac_addr *)device_node;
-
-                       if (dp->if_type != 0 && dp->if_type != 1)
-                               break;
-                       r = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES,
-                                             2 * MAC_OUTPUT_LEN,
-                                             (void **)&buffer);
-                       if (r != EFI_SUCCESS)
-                               return NULL;
-                       sprintf((char *)buffer,
-                               "MAC(%02x%02x%02x%02x%02x%02x,0x%1x)",
-                               dp->mac.addr[0], dp->mac.addr[1],
-                               dp->mac.addr[2], dp->mac.addr[3],
-                               dp->mac.addr[4], dp->mac.addr[5],
-                               dp->if_type);
-                       for (i = MAC_OUTPUT_LEN - 1; i >= 0; --i)
-                               buffer[i] = ((uint8_t *)buffer)[i];
+static char *dp_hardware(char *s, struct efi_device_path *dp)
+{
+       switch (dp->sub_type) {
+       case DEVICE_PATH_SUB_TYPE_VENDOR: {
+               struct efi_device_path_vendor *vdp =
+                       (struct efi_device_path_vendor *)dp;
+               s += sprintf(s, "/VenHw(%pUl)", &vdp->guid);
+               break;
+       }
+       default:
+               s = dp_unknown(s, dp);
+               break;
+       }
+       return s;
+}
+
+static char *dp_acpi(char *s, struct efi_device_path *dp)
+{
+       switch (dp->sub_type) {
+       case DEVICE_PATH_SUB_TYPE_ACPI_DEVICE: {
+               struct efi_device_path_acpi_path *adp =
+                       (struct efi_device_path_acpi_path *)dp;
+               s += sprintf(s, "/Acpi(PNP%04x", EISA_PNP_NUM(adp->hid));
+               if (adp->uid)
+                       s += sprintf(s, ",%d", adp->uid);
+               s += sprintf(s, ")");
+               break;
+       }
+       default:
+               s = dp_unknown(s, dp);
+               break;
+       }
+       return s;
+}
+
+static char *dp_msging(char *s, struct efi_device_path *dp)
+{
+       switch (dp->sub_type) {
+       case DEVICE_PATH_SUB_TYPE_MSG_USB: {
+               struct efi_device_path_usb *udp =
+                       (struct efi_device_path_usb *)dp;
+               s += sprintf(s, "/Usb(0x%x,0x%x)", udp->parent_port_number,
+                            udp->usb_interface);
+               break;
+       }
+       case DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR: {
+               struct efi_device_path_mac_addr *mdp =
+                       (struct efi_device_path_mac_addr *)dp;
+
+               if (mdp->if_type != 0 && mdp->if_type != 1)
                        break;
-                       }
-               }
+
+               s += sprintf(s, "/MAC(%02x%02x%02x%02x%02x%02x,0x%1x)",
+                       mdp->mac.addr[0], mdp->mac.addr[1],
+                       mdp->mac.addr[2], mdp->mac.addr[3],
+                       mdp->mac.addr[4], mdp->mac.addr[5],
+                       mdp->if_type);
+
+               break;
+       }
+       case DEVICE_PATH_SUB_TYPE_MSG_USB_CLASS: {
+               struct efi_device_path_usb_class *ucdp =
+                       (struct efi_device_path_usb_class *)dp;
+
+               s += sprintf(s, "/USBClass(%x,%x,%x,%x,%x)",
+                       ucdp->vendor_id, ucdp->product_id,
+                       ucdp->device_class, ucdp->device_subclass,
+                       ucdp->device_protocol);
+
+               break;
+       }
+       case DEVICE_PATH_SUB_TYPE_MSG_SD:
+       case DEVICE_PATH_SUB_TYPE_MSG_MMC: {
+               const char *typename =
+                       (dp->sub_type == DEVICE_PATH_SUB_TYPE_MSG_SD) ?
+                                       "SDCard" : "MMC";
+               struct efi_device_path_sd_mmc_path *sddp =
+                       (struct efi_device_path_sd_mmc_path *)dp;
+               s += sprintf(s, "/%s(Slot%u)", typename, sddp->slot_number);
+               break;
+       }
+       default:
+               s = dp_unknown(s, dp);
                break;
-       case DEVICE_PATH_TYPE_MEDIA_DEVICE:
-               switch (device_node->sub_type) {
-               case DEVICE_PATH_SUB_TYPE_FILE_PATH:
-                       buffer_size = device_node->length - 4;
-                       r = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES,
-                                             buffer_size, (void **) &buffer);
-                       if (r != EFI_SUCCESS)
-                               return NULL;
-                       memcpy(buffer, device_node->data, buffer_size);
+       }
+       return s;
+}
+
+static char *dp_media(char *s, struct efi_device_path *dp)
+{
+       switch (dp->sub_type) {
+       case DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH: {
+               struct efi_device_path_hard_drive_path *hddp =
+                       (struct efi_device_path_hard_drive_path *)dp;
+               void *sig = hddp->partition_signature;
+
+               switch (hddp->signature_type) {
+               case SIG_TYPE_MBR:
+                       s += sprintf(s, "/HD(Part%d,Sig%08x)",
+                                    hddp->partition_number,
+                                    *(uint32_t *)sig);
                        break;
+               case SIG_TYPE_GUID:
+                       s += sprintf(s, "/HD(Part%d,Sig%pUl)",
+                                    hddp->partition_number, sig);
+               default:
+                       s += sprintf(s, "/HD(Part%d,MBRType=%02x,SigType=%02x)",
+                                    hddp->partition_number, hddp->partmap_type,
+                                    hddp->signature_type);
                }
+
+               break;
+       }
+       case DEVICE_PATH_SUB_TYPE_CDROM_PATH: {
+               struct efi_device_path_cdrom_path *cddp =
+                       (struct efi_device_path_cdrom_path *)dp;
+               s += sprintf(s, "/CDROM(0x%x)", cddp->boot_entry);
+               break;
+       }
+       case DEVICE_PATH_SUB_TYPE_FILE_PATH: {
+               struct efi_device_path_file_path *fp =
+                       (struct efi_device_path_file_path *)dp;
+               int slen = (dp->length - sizeof(*dp)) / 2;
+               s += sprintf(s, "/%-*ls", slen, fp->str);
                break;
        }
+       default:
+               s = dp_unknown(s, dp);
+               break;
+       }
+       return s;
+}
 
-       /*
-        * For all node types that we do not yet support return
-        * 'UNKNOWN(type,subtype)'.
-        */
-       if (!buffer) {
-               r = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES,
-                                     2 * UNKNOWN_OUTPUT_LEN,
-                                     (void **)&buffer);
-               if (r != EFI_SUCCESS)
-                       return NULL;
-               sprintf((char *)buffer,
-                       "UNKNOWN(%04x,%04x)",
-                       device_node->type,
-                       device_node->sub_type);
-               for (i = UNKNOWN_OUTPUT_LEN - 1; i >= 0; --i)
-                       buffer[i] = ((uint8_t *)buffer)[i];
+static uint16_t *efi_convert_device_node_to_text(
+               struct efi_device_path *dp,
+               bool display_only,
+               bool allow_shortcuts)
+{
+       unsigned long len;
+       efi_status_t r;
+       char buf[512];  /* this ought be be big enough for worst case */
+       char *str = buf;
+       uint16_t *out;
+
+       while (dp) {
+               switch (dp->type) {
+               case DEVICE_PATH_TYPE_HARDWARE_DEVICE:
+                       str = dp_hardware(str, dp);
+                       break;
+               case DEVICE_PATH_TYPE_ACPI_DEVICE:
+                       str = dp_acpi(str, dp);
+                       break;
+               case DEVICE_PATH_TYPE_MESSAGING_DEVICE:
+                       str = dp_msging(str, dp);
+                       break;
+               case DEVICE_PATH_TYPE_MEDIA_DEVICE:
+                       str = dp_media(str, dp);
+                       break;
+               default:
+                       str = dp_unknown(str, dp);
+               }
+
+               dp = efi_dp_next(dp);
        }
 
-       return buffer;
+       *str++ = '\0';
+
+       len = str - buf;
+       r = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, 2 * len, (void **)&out);
+       if (r != EFI_SUCCESS)
+               return NULL;
+
+       ascii2unicode(out, buf);
+       out[len - 1] = 0;
+
+       return out;
 }
 
+/* helper for debug prints.. efi_free_pool() the result. */
+uint16_t *efi_dp_str(struct efi_device_path *dp)
+{
+       return efi_convert_device_node_to_text(dp, true, true);
+}
+
+
 static uint16_t EFIAPI *efi_convert_device_node_to_text_ext(
-               struct efi_device_path_protocol *device_node,
+               struct efi_device_path *device_node,
                bool display_only,
                bool allow_shortcuts)
 {
@@ -105,7 +223,7 @@ static uint16_t EFIAPI *efi_convert_device_node_to_text_ext(
 }
 
 static uint16_t EFIAPI *efi_convert_device_path_to_text(
-               struct efi_device_path_protocol *device_path,
+               struct efi_device_path *device_path,
                bool display_only,
                bool allow_shortcuts)
 {
index ed06485e334b771b2e2e8872615952b19735c0f2..eb9ce772d1d6fe00830e9bbc2732917e8136b8af 100644 (file)
@@ -28,11 +28,15 @@ struct efi_disk_obj {
        /* EFI Interface Media descriptor struct, referenced by ops */
        struct efi_block_io_media media;
        /* EFI device path to this block device */
-       struct efi_device_path_file_path *dp;
+       struct efi_device_path *dp;
+       /* partition # */
+       unsigned int part;
+       /* handle to filesys proto (for partition objects) */
+       struct efi_simple_file_system_protocol *volume;
        /* Offset into disk for simple partitions */
        lbaint_t offset;
        /* Internal block device */
-       const struct blk_desc *desc;
+       struct blk_desc *desc;
 };
 
 static efi_status_t EFIAPI efi_disk_reset(struct efi_block_io *this,
@@ -47,7 +51,7 @@ enum efi_disk_direction {
        EFI_DISK_WRITE,
 };
 
-static efi_status_t EFIAPI efi_disk_rw_blocks(struct efi_block_io *this,
+static efi_status_t efi_disk_rw_blocks(struct efi_block_io *this,
                        u32 media_id, u64 lba, unsigned long buffer_size,
                        void *buffer, enum efi_disk_direction direction)
 {
@@ -170,28 +174,58 @@ static const struct efi_block_io block_io_disk_template = {
        .flush_blocks = &efi_disk_flush_blocks,
 };
 
+/*
+ * Find filesystem from a device-path.  The passed in path 'p' probably
+ * contains one or more /File(name) nodes, so the comparison stops at
+ * the first /File() node, and returns the pointer to that via 'rp'.
+ * This is mostly intended to be a helper to map a device-path to an
+ * efi_file_handle object.
+ */
+struct efi_simple_file_system_protocol *
+efi_fs_from_path(struct efi_device_path *fp)
+{
+       struct efi_object *efiobj;
+       struct efi_disk_obj *diskobj;
+
+       efiobj = efi_dp_find_obj(fp, NULL);
+       if (!efiobj)
+               return NULL;
+
+       diskobj = container_of(efiobj, struct efi_disk_obj, parent);
+
+       return diskobj->volume;
+}
+
 static void efi_disk_add_dev(const char *name,
                             const char *if_typename,
-                            const struct blk_desc *desc,
+                            struct blk_desc *desc,
                             int dev_index,
-                            lbaint_t offset)
+                            lbaint_t offset,
+                            unsigned int part)
 {
        struct efi_disk_obj *diskobj;
-       struct efi_device_path_file_path *dp;
-       int objlen = sizeof(*diskobj) + (sizeof(*dp) * 2);
 
        /* Don't add empty devices */
        if (!desc->lba)
                return;
 
-       diskobj = calloc(1, objlen);
+       diskobj = calloc(1, sizeof(*diskobj));
 
        /* Fill in object data */
-       dp = (void *)&diskobj[1];
+       diskobj->dp = efi_dp_from_part(desc, part);
+       diskobj->part = part;
        diskobj->parent.protocols[0].guid = &efi_block_io_guid;
        diskobj->parent.protocols[0].protocol_interface = &diskobj->ops;
        diskobj->parent.protocols[1].guid = &efi_guid_device_path;
-       diskobj->parent.protocols[1].protocol_interface = dp;
+       diskobj->parent.protocols[1].protocol_interface = diskobj->dp;
+       if (part >= 1) {
+               diskobj->volume = efi_simple_file_system(desc, part,
+                                                        diskobj->dp);
+               diskobj->parent.protocols[2].guid =
+                       &efi_simple_file_system_protocol_guid;
+               diskobj->parent.protocols[2].protocol_interface =
+                       diskobj->volume;
+       }
        diskobj->parent.handle = diskobj;
        diskobj->ops = block_io_disk_template;
        diskobj->ifname = if_typename;
@@ -207,17 +241,6 @@ static void efi_disk_add_dev(const char *name,
        diskobj->media.last_block = desc->lba - offset;
        diskobj->ops.media = &diskobj->media;
 
-       /* Fill in device path */
-       diskobj->dp = dp;
-       dp[0].dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
-       dp[0].dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH;
-       dp[0].dp.length = sizeof(*dp);
-       ascii2unicode(dp[0].str, name);
-
-       dp[1].dp.type = DEVICE_PATH_TYPE_END;
-       dp[1].dp.sub_type = DEVICE_PATH_SUB_TYPE_END;
-       dp[1].dp.length = sizeof(*dp);
-
        /* Hook up to the device list */
        list_add_tail(&diskobj->parent.link, &efi_obj_list);
 }
@@ -236,14 +259,18 @@ static int efi_disk_create_eltorito(struct blk_desc *desc,
        if (desc->part_type != PART_TYPE_ISO)
                return 0;
 
+       /* and devices for each partition: */
        while (!part_get_info(desc, part, &info)) {
                snprintf(devname, sizeof(devname), "%s:%d", pdevname,
                         part);
                efi_disk_add_dev(devname, if_typename, desc, diskid,
-                                info.start);
+                                info.start, part);
                part++;
                disks++;
        }
+
+       /* ... and add block device: */
+       efi_disk_add_dev(devname, if_typename, desc, diskid, 0, 0);
 #endif
 
        return disks;
@@ -271,9 +298,22 @@ int efi_disk_register(void)
             uclass_next_device_check(&dev)) {
                struct blk_desc *desc = dev_get_uclass_platdata(dev);
                const char *if_typename = dev->driver->name;
+               disk_partition_t info;
+               int part = 1;
 
                printf("Scanning disk %s...\n", dev->name);
-               efi_disk_add_dev(dev->name, if_typename, desc, desc->devnum, 0);
+
+               /* add devices for each partition: */
+               while (!part_get_info(desc, part, &info)) {
+                       efi_disk_add_dev(dev->name, if_typename, desc,
+                                        desc->devnum, 0, part);
+                       part++;
+               }
+
+               /* ... and add block device: */
+               efi_disk_add_dev(dev->name, if_typename, desc,
+                                desc->devnum, 0, 0);
+
                disks++;
 
                /*
@@ -309,7 +349,7 @@ int efi_disk_register(void)
 
                        snprintf(devname, sizeof(devname), "%s%d",
                                 if_typename, i);
-                       efi_disk_add_dev(devname, if_typename, desc, i, 0);
+                       efi_disk_add_dev(devname, if_typename, desc, i, 0, 0);
                        disks++;
 
                        /*
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
new file mode 100644 (file)
index 0000000..52a4e74
--- /dev/null
@@ -0,0 +1,560 @@
+/*
+ *  EFI utils
+ *
+ *  Copyright (c) 2017 Rob Clark
+ *
+ *  SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <charset.h>
+#include <efi_loader.h>
+#include <malloc.h>
+#include <fs.h>
+
+struct file_system {
+       struct efi_simple_file_system_protocol base;
+       struct efi_device_path *dp;
+       struct blk_desc *desc;
+       int part;
+};
+#define to_fs(x) container_of(x, struct file_system, base)
+
+struct file_handle {
+       struct efi_file_handle base;
+       struct file_system *fs;
+       loff_t offset;       /* current file position/cursor */
+       int isdir;
+
+       /* for reading a directory: */
+       struct fs_dir_stream *dirs;
+       struct fs_dirent *dent;
+
+       char path[0];
+};
+#define to_fh(x) container_of(x, struct file_handle, base)
+
+static const struct efi_file_handle efi_file_handle_protocol;
+
+static char *basename(struct file_handle *fh)
+{
+       char *s = strrchr(fh->path, '/');
+       if (s)
+               return s + 1;
+       return fh->path;
+}
+
+static int set_blk_dev(struct file_handle *fh)
+{
+       return fs_set_blk_dev_with_part(fh->fs->desc, fh->fs->part);
+}
+
+static int is_dir(struct file_handle *fh)
+{
+       struct fs_dir_stream *dirs;
+
+       set_blk_dev(fh);
+       dirs = fs_opendir(fh->path);
+       if (!dirs)
+               return 0;
+
+       fs_closedir(dirs);
+
+       return 1;
+}
+
+/*
+ * Normalize a path which may include either back or fwd slashes,
+ * double slashes, . or .. entries in the path, etc.
+ */
+static int sanitize_path(char *path)
+{
+       char *p;
+
+       /* backslash to slash: */
+       p = path;
+       while ((p = strchr(p, '\\')))
+               *p++ = '/';
+
+       /* handle double-slashes: */
+       p = path;
+       while ((p = strstr(p, "//"))) {
+               char *src = p + 1;
+               memmove(p, src, strlen(src) + 1);
+       }
+
+       /* handle extra /.'s */
+       p = path;
+       while ((p = strstr(p, "/."))) {
+               /*
+                * You'd be tempted to do this *after* handling ".."s
+                * below to avoid having to check if "/." is start of
+                * a "/..", but that won't have the correct results..
+                * for example, "/foo/./../bar" would get resolved to
+                * "/foo/bar" if you did these two passes in the other
+                * order
+                */
+               if (p[2] == '.') {
+                       p += 2;
+                       continue;
+               }
+               char *src = p + 2;
+               memmove(p, src, strlen(src) + 1);
+       }
+
+       /* handle extra /..'s: */
+       p = path;
+       while ((p = strstr(p, "/.."))) {
+               char *src = p + 3;
+
+               p--;
+
+               /* find beginning of previous path entry: */
+               while (true) {
+                       if (p < path)
+                               return -1;
+                       if (*p == '/')
+                               break;
+                       p--;
+               }
+
+               memmove(p, src, strlen(src) + 1);
+       }
+
+       return 0;
+}
+
+/* NOTE: despite what you would expect, 'file_name' is actually a path.
+ * With windoze style backlashes, ofc.
+ */
+static struct efi_file_handle *file_open(struct file_system *fs,
+               struct file_handle *parent, s16 *file_name, u64 mode)
+{
+       struct file_handle *fh;
+       char f0[MAX_UTF8_PER_UTF16] = {0};
+       int plen = 0;
+       int flen = 0;
+
+       if (file_name) {
+               utf16_to_utf8((u8 *)f0, (u16 *)file_name, 1);
+               flen = utf16_strlen((u16 *)file_name);
+       }
+
+       /* we could have a parent, but also an absolute path: */
+       if (f0[0] == '\\') {
+               plen = 0;
+       } else if (parent) {
+               plen = strlen(parent->path) + 1;
+       }
+
+       /* +2 is for null and '/' */
+       fh = calloc(1, sizeof(*fh) + plen + (flen * MAX_UTF8_PER_UTF16) + 2);
+
+       fh->base = efi_file_handle_protocol;
+       fh->fs = fs;
+
+       if (parent) {
+               char *p = fh->path;
+
+               if (plen > 0) {
+                       strcpy(p, parent->path);
+                       p += plen - 1;
+                       *p++ = '/';
+               }
+
+               utf16_to_utf8((u8 *)p, (u16 *)file_name, flen);
+
+               if (sanitize_path(fh->path))
+                       goto error;
+
+               /* check if file exists: */
+               if (set_blk_dev(fh))
+                       goto error;
+
+               if (!((mode & EFI_FILE_MODE_CREATE) || fs_exists(fh->path)))
+                       goto error;
+
+               /* figure out if file is a directory: */
+               fh->isdir = is_dir(fh);
+       } else {
+               fh->isdir = 1;
+               strcpy(fh->path, "");
+       }
+
+       return &fh->base;
+
+error:
+       free(fh);
+       return NULL;
+}
+
+static efi_status_t EFIAPI efi_file_open(struct efi_file_handle *file,
+               struct efi_file_handle **new_handle,
+               s16 *file_name, u64 open_mode, u64 attributes)
+{
+       struct file_handle *fh = to_fh(file);
+
+       EFI_ENTRY("%p, %p, \"%ls\", %llx, %llu", file, new_handle, file_name,
+                 open_mode, attributes);
+
+       *new_handle = file_open(fh->fs, fh, file_name, open_mode);
+       if (!*new_handle)
+               return EFI_EXIT(EFI_NOT_FOUND);
+
+       return EFI_EXIT(EFI_SUCCESS);
+}
+
+static efi_status_t file_close(struct file_handle *fh)
+{
+       fs_closedir(fh->dirs);
+       free(fh);
+       return EFI_SUCCESS;
+}
+
+static efi_status_t EFIAPI efi_file_close(struct efi_file_handle *file)
+{
+       struct file_handle *fh = to_fh(file);
+       EFI_ENTRY("%p", file);
+       return EFI_EXIT(file_close(fh));
+}
+
+static efi_status_t EFIAPI efi_file_delete(struct efi_file_handle *file)
+{
+       struct file_handle *fh = to_fh(file);
+       EFI_ENTRY("%p", file);
+       file_close(fh);
+       return EFI_EXIT(EFI_WARN_DELETE_FAILURE);
+}
+
+static efi_status_t file_read(struct file_handle *fh, u64 *buffer_size,
+               void *buffer)
+{
+       loff_t actread;
+
+       if (fs_read(fh->path, (ulong)buffer, fh->offset,
+                   *buffer_size, &actread))
+               return EFI_DEVICE_ERROR;
+
+       *buffer_size = actread;
+       fh->offset += actread;
+
+       return EFI_SUCCESS;
+}
+
+static efi_status_t dir_read(struct file_handle *fh, u64 *buffer_size,
+               void *buffer)
+{
+       struct efi_file_info *info = buffer;
+       struct fs_dirent *dent;
+       unsigned int required_size;
+
+       if (!fh->dirs) {
+               assert(fh->offset == 0);
+               fh->dirs = fs_opendir(fh->path);
+               if (!fh->dirs)
+                       return EFI_DEVICE_ERROR;
+       }
+
+       /*
+        * So this is a bit awkward.  Since fs layer is stateful and we
+        * can't rewind an entry, in the EFI_BUFFER_TOO_SMALL case below
+        * we might have to return without consuming the dent.. so we
+        * have to stash it for next call.
+        */
+       if (fh->dent) {
+               dent = fh->dent;
+               fh->dent = NULL;
+       } else {
+               dent = fs_readdir(fh->dirs);
+       }
+
+
+       if (!dent) {
+               /* no more files in directory: */
+               /* workaround shim.efi bug/quirk.. as find_boot_csv()
+                * loops through directory contents, it initially calls
+                * read w/ zero length buffer to find out how much mem
+                * to allocate for the EFI_FILE_INFO, then allocates,
+                * and then calls a 2nd time.  If we return size of
+                * zero the first time, it happily passes that to
+                * AllocateZeroPool(), and when that returns NULL it
+                * thinks it is EFI_OUT_OF_RESOURCES.  So on first
+                * call return a non-zero size:
+                */
+               if (*buffer_size == 0)
+                       *buffer_size = sizeof(*info);
+               else
+                       *buffer_size = 0;
+               return EFI_SUCCESS;
+       }
+
+       /* check buffer size: */
+       required_size = sizeof(*info) + 2 * (strlen(dent->name) + 1);
+       if (*buffer_size < required_size) {
+               *buffer_size = required_size;
+               fh->dent = dent;
+               return EFI_BUFFER_TOO_SMALL;
+       }
+
+       *buffer_size = required_size;
+       memset(info, 0, required_size);
+
+       info->size = required_size;
+       info->file_size = dent->size;
+       info->physical_size = dent->size;
+
+       if (dent->type == FS_DT_DIR)
+               info->attribute |= EFI_FILE_DIRECTORY;
+
+       ascii2unicode((u16 *)info->file_name, dent->name);
+
+       fh->offset++;
+
+       return EFI_SUCCESS;
+}
+
+static efi_status_t EFIAPI efi_file_read(struct efi_file_handle *file,
+               u64 *buffer_size, void *buffer)
+{
+       struct file_handle *fh = to_fh(file);
+       efi_status_t ret = EFI_SUCCESS;
+
+       EFI_ENTRY("%p, %p, %p", file, buffer_size, buffer);
+
+       if (set_blk_dev(fh)) {
+               ret = EFI_DEVICE_ERROR;
+               goto error;
+       }
+
+       if (fh->isdir)
+               ret = dir_read(fh, buffer_size, buffer);
+       else
+               ret = file_read(fh, buffer_size, buffer);
+
+error:
+       return EFI_EXIT(ret);
+}
+
+static efi_status_t EFIAPI efi_file_write(struct efi_file_handle *file,
+               u64 *buffer_size, void *buffer)
+{
+       struct file_handle *fh = to_fh(file);
+       efi_status_t ret = EFI_SUCCESS;
+       loff_t actwrite;
+
+       EFI_ENTRY("%p, %p, %p", file, buffer_size, buffer);
+
+       if (set_blk_dev(fh)) {
+               ret = EFI_DEVICE_ERROR;
+               goto error;
+       }
+
+       if (fs_write(fh->path, (ulong)buffer, fh->offset, *buffer_size,
+                    &actwrite)) {
+               ret = EFI_DEVICE_ERROR;
+               goto error;
+       }
+
+       *buffer_size = actwrite;
+       fh->offset += actwrite;
+
+error:
+       return EFI_EXIT(ret);
+}
+
+static efi_status_t EFIAPI efi_file_getpos(struct efi_file_handle *file,
+               u64 *pos)
+{
+       struct file_handle *fh = to_fh(file);
+       EFI_ENTRY("%p, %p", file, pos);
+       *pos = fh->offset;
+       return EFI_EXIT(EFI_SUCCESS);
+}
+
+static efi_status_t EFIAPI efi_file_setpos(struct efi_file_handle *file,
+               u64 pos)
+{
+       struct file_handle *fh = to_fh(file);
+       efi_status_t ret = EFI_SUCCESS;
+
+       EFI_ENTRY("%p, %llu", file, pos);
+
+       if (fh->isdir) {
+               if (pos != 0) {
+                       ret = EFI_UNSUPPORTED;
+                       goto error;
+               }
+               fs_closedir(fh->dirs);
+               fh->dirs = NULL;
+       }
+
+       if (pos == ~0ULL) {
+               loff_t file_size;
+
+               if (set_blk_dev(fh)) {
+                       ret = EFI_DEVICE_ERROR;
+                       goto error;
+               }
+
+               if (fs_size(fh->path, &file_size)) {
+                       ret = EFI_DEVICE_ERROR;
+                       goto error;
+               }
+
+               pos = file_size;
+       }
+
+       fh->offset = pos;
+
+error:
+       return EFI_EXIT(ret);
+}
+
+static efi_status_t EFIAPI efi_file_getinfo(struct efi_file_handle *file,
+               efi_guid_t *info_type, u64 *buffer_size, void *buffer)
+{
+       struct file_handle *fh = to_fh(file);
+       efi_status_t ret = EFI_SUCCESS;
+
+       EFI_ENTRY("%p, %p, %p, %p", file, info_type, buffer_size, buffer);
+
+       if (!guidcmp(info_type, &efi_file_info_guid)) {
+               struct efi_file_info *info = buffer;
+               char *filename = basename(fh);
+               unsigned int required_size;
+               loff_t file_size;
+
+               /* check buffer size: */
+               required_size = sizeof(*info) + 2 * (strlen(filename) + 1);
+               if (*buffer_size < required_size) {
+                       *buffer_size = required_size;
+                       ret = EFI_BUFFER_TOO_SMALL;
+                       goto error;
+               }
+
+               if (set_blk_dev(fh)) {
+                       ret = EFI_DEVICE_ERROR;
+                       goto error;
+               }
+
+               if (fs_size(fh->path, &file_size)) {
+                       ret = EFI_DEVICE_ERROR;
+                       goto error;
+               }
+
+               memset(info, 0, required_size);
+
+               info->size = required_size;
+               info->file_size = file_size;
+               info->physical_size = file_size;
+
+               if (fh->isdir)
+                       info->attribute |= EFI_FILE_DIRECTORY;
+
+               ascii2unicode((u16 *)info->file_name, filename);
+       } else {
+               ret = EFI_UNSUPPORTED;
+       }
+
+error:
+       return EFI_EXIT(ret);
+}
+
+static efi_status_t EFIAPI efi_file_setinfo(struct efi_file_handle *file,
+               efi_guid_t *info_type, u64 buffer_size, void *buffer)
+{
+       EFI_ENTRY("%p, %p, %llu, %p", file, info_type, buffer_size, buffer);
+       return EFI_EXIT(EFI_UNSUPPORTED);
+}
+
+static efi_status_t EFIAPI efi_file_flush(struct efi_file_handle *file)
+{
+       EFI_ENTRY("%p", file);
+       return EFI_EXIT(EFI_SUCCESS);
+}
+
+static const struct efi_file_handle efi_file_handle_protocol = {
+       .rev = EFI_FILE_PROTOCOL_REVISION,
+       .open = efi_file_open,
+       .close = efi_file_close,
+       .delete = efi_file_delete,
+       .read = efi_file_read,
+       .write = efi_file_write,
+       .getpos = efi_file_getpos,
+       .setpos = efi_file_setpos,
+       .getinfo = efi_file_getinfo,
+       .setinfo = efi_file_setinfo,
+       .flush = efi_file_flush,
+};
+
+struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp)
+{
+       struct efi_simple_file_system_protocol *v;
+       struct efi_file_handle *f;
+       efi_status_t ret;
+
+       v = efi_fs_from_path(fp);
+       if (!v)
+               return NULL;
+
+       EFI_CALL(ret = v->open_volume(v, &f));
+       if (ret != EFI_SUCCESS)
+               return NULL;
+
+       /* skip over device-path nodes before the file path: */
+       while (fp && !EFI_DP_TYPE(fp, MEDIA_DEVICE, FILE_PATH))
+               fp = efi_dp_next(fp);
+
+       while (fp) {
+               struct efi_device_path_file_path *fdp =
+                       container_of(fp, struct efi_device_path_file_path, dp);
+               struct efi_file_handle *f2;
+
+               if (!EFI_DP_TYPE(fp, MEDIA_DEVICE, FILE_PATH)) {
+                       printf("bad file path!\n");
+                       f->close(f);
+                       return NULL;
+               }
+
+               EFI_CALL(ret = f->open(f, &f2, (s16 *)fdp->str,
+                                      EFI_FILE_MODE_READ, 0));
+               if (ret != EFI_SUCCESS)
+                       return NULL;
+
+               fp = efi_dp_next(fp);
+
+               EFI_CALL(f->close(f));
+               f = f2;
+       }
+
+       return f;
+}
+
+static efi_status_t EFIAPI
+efi_open_volume(struct efi_simple_file_system_protocol *this,
+               struct efi_file_handle **root)
+{
+       struct file_system *fs = to_fs(this);
+
+       EFI_ENTRY("%p, %p", this, root);
+
+       *root = file_open(fs, NULL, NULL, 0);
+
+       return EFI_EXIT(EFI_SUCCESS);
+}
+
+struct efi_simple_file_system_protocol *
+efi_simple_file_system(struct blk_desc *desc, int part,
+                      struct efi_device_path *dp)
+{
+       struct file_system *fs;
+
+       fs = calloc(1, sizeof(*fs));
+       fs->base.rev = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION;
+       fs->base.open_volume = efi_open_volume;
+       fs->desc = desc;
+       fs->part = part;
+       fs->dp = dp;
+
+       return &fs->base;
+}
index f961407f50ab8e59301aebdf30db57115d170040..af29cc4f04e9849c1ca5a84805a2eab01f28ed02 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+const efi_guid_t efi_global_variable_guid = EFI_GLOBAL_VARIABLE_GUID;
 const efi_guid_t efi_guid_device_path = DEVICE_PATH_GUID;
 const efi_guid_t efi_guid_loaded_image = LOADED_IMAGE_GUID;
+const efi_guid_t efi_simple_file_system_protocol_guid =
+               EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
+const efi_guid_t efi_file_info_guid = EFI_FILE_INFO_GUID;
 
 static efi_status_t efi_loader_relocate(const IMAGE_BASE_RELOCATION *rel,
                        unsigned long rel_size, void *efi_reloc)
@@ -90,6 +94,7 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)
        unsigned long virt_size = 0;
        bool can_run_nt64 = true;
        bool can_run_nt32 = true;
+       uint16_t image_type;
 
 #if defined(CONFIG_ARM64)
        can_run_nt32 = false;
@@ -135,6 +140,7 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)
                entry = efi_reloc + opt->AddressOfEntryPoint;
                rel_size = opt->DataDirectory[rel_idx].Size;
                rel = efi_reloc + opt->DataDirectory[rel_idx].VirtualAddress;
+               image_type = opt->Subsystem;
        } else if (can_run_nt32 &&
                   (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)) {
                IMAGE_OPTIONAL_HEADER32 *opt = &nt->OptionalHeader;
@@ -148,12 +154,32 @@ void *efi_load_pe(void *efi, struct efi_loaded_image *loaded_image_info)
                entry = efi_reloc + opt->AddressOfEntryPoint;
                rel_size = opt->DataDirectory[rel_idx].Size;
                rel = efi_reloc + opt->DataDirectory[rel_idx].VirtualAddress;
+               image_type = opt->Subsystem;
        } else {
                printf("%s: Invalid optional header magic %x\n", __func__,
                       nt->OptionalHeader.Magic);
                return NULL;
        }
 
+       switch (image_type) {
+       case IMAGE_SUBSYSTEM_EFI_APPLICATION:
+               loaded_image_info->image_code_type = EFI_LOADER_CODE;
+               loaded_image_info->image_data_type = EFI_LOADER_DATA;
+               break;
+       case IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER:
+               loaded_image_info->image_code_type = EFI_BOOT_SERVICES_CODE;
+               loaded_image_info->image_data_type = EFI_BOOT_SERVICES_DATA;
+               break;
+       case IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER:
+       case IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER:
+               loaded_image_info->image_code_type = EFI_RUNTIME_SERVICES_CODE;
+               loaded_image_info->image_data_type = EFI_RUNTIME_SERVICES_DATA;
+               break;
+       default:
+               printf("%s: invalid image type: %u\n", __func__, image_type);
+               break;
+       }
+
        /* Load sections into RAM */
        for (i = num_sections - 1; i >= 0; i--) {
                IMAGE_SECTION_HEADER *sec = &sections[i];
index 9e079f1fa3a66cc301cd1bf039b7896f97f473f4..d47759e08edc62104db13b0c4cef4ae9234abf82 100644 (file)
@@ -43,7 +43,7 @@ void *efi_bounce_buffer;
  */
 struct efi_pool_allocation {
        u64 num_pages;
-       char data[];
+       char data[] __aligned(ARCH_DMA_MINALIGN);
 };
 
 /*
@@ -356,7 +356,8 @@ efi_status_t efi_allocate_pool(int pool_type, unsigned long size,
 {
        efi_status_t r;
        efi_physical_addr_t t;
-       u64 num_pages = (size + sizeof(u64) + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
+       u64 num_pages = (size + sizeof(struct efi_pool_allocation) +
+                        EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
 
        if (size == 0) {
                *buffer = NULL;
index 0b949d86e8d5386dfa14c51dd30806994a40d51b..91f1e4a69e15aad0c79e50ad9edbe6473e8ae7ae 100644 (file)
@@ -26,9 +26,6 @@ struct efi_net_obj {
        /* EFI Interface callback struct for network */
        struct efi_simple_network net;
        struct efi_simple_network_mode net_mode;
-       /* Device path to the network adapter */
-       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;
@@ -210,19 +207,9 @@ void efi_net_set_dhcp_ack(void *pkt, int len)
 }
 
 /* This gets called from do_bootefi_exec(). */
-int efi_net_register(void **handle)
+int efi_net_register(void)
 {
        struct efi_net_obj *netobj;
-       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),
-       };
-       struct efi_device_path_file_path dp_end = {
-               .dp.type = DEVICE_PATH_TYPE_END,
-               .dp.sub_type = DEVICE_PATH_SUB_TYPE_END,
-               .dp.length = sizeof(dp_end),
-       };
 
        if (!eth_get_dev()) {
                /* No eth device active, don't expose any */
@@ -236,7 +223,8 @@ int efi_net_register(void **handle)
        netobj->parent.protocols[0].guid = &efi_net_guid;
        netobj->parent.protocols[0].protocol_interface = &netobj->net;
        netobj->parent.protocols[1].guid = &efi_guid_device_path;
-       netobj->parent.protocols[1].protocol_interface = &netobj->dp_mac;
+       netobj->parent.protocols[1].protocol_interface =
+               efi_dp_from_eth();
        netobj->parent.protocols[2].guid = &efi_pxe_guid;
        netobj->parent.protocols[2].protocol_interface = &netobj->pxe;
        netobj->parent.handle = &netobj->net;
@@ -255,9 +243,6 @@ 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_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;
 
@@ -268,8 +253,5 @@ int efi_net_register(void **handle)
        /* Hook net up to the device list */
        list_add_tail(&netobj->parent.link, &efi_obj_list);
 
-       if (handle)
-               *handle = &netobj->net;
-
        return 0;
 }
index ad7f3754bd0970b5209f756d5f1d7ce4883e4587..8104e08c466ca1853bcc6461cb696c99b15814b7 100644 (file)
@@ -184,7 +184,16 @@ static const struct efi_runtime_detach_list_struct efi_runtime_detach_list[] = {
                /* Clean up system table */
                .ptr = &systab.boottime,
                .patchto = NULL,
-       },
+       }, {
+               .ptr = &efi_runtime_services.get_variable,
+               .patchto = &efi_device_error,
+       }, {
+               .ptr = &efi_runtime_services.get_next_variable,
+               .patchto = &efi_device_error,
+       }, {
+               .ptr = &efi_runtime_services.set_variable,
+               .patchto = &efi_device_error,
+       }
 };
 
 static bool efi_runtime_tobedetached(void *p)
@@ -243,7 +252,8 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
 
                /* Check if the relocation is inside bounds */
                if (map && ((newaddr < map->virtual_start) ||
-                   newaddr > (map->virtual_start + (map->num_pages << 12)))) {
+                   newaddr > (map->virtual_start +
+                             (map->num_pages << EFI_PAGE_SHIFT)))) {
                        if (!efi_runtime_tobedetached(p))
                                printf("U-Boot EFI: Relocation at %p is out of "
                                       "range (%lx)\n", p, newaddr);
@@ -269,7 +279,8 @@ static efi_status_t EFIAPI efi_set_virtual_address_map(
                        uint32_t descriptor_version,
                        struct efi_mem_desc *virtmap)
 {
-       ulong runtime_start = (ulong)&__efi_runtime_start & ~0xfffULL;
+       ulong runtime_start = (ulong)&__efi_runtime_start &
+                             ~(ulong)EFI_PAGE_MASK;
        int n = memory_map_size / descriptor_size;
        int i;
 
@@ -382,9 +393,9 @@ struct efi_runtime_services __efi_runtime_data efi_runtime_services = {
        .set_wakeup_time = (void *)&efi_unimplemented,
        .set_virtual_address_map = &efi_set_virtual_address_map,
        .convert_pointer = (void *)&efi_invalid_parameter,
-       .get_variable = (void *)&efi_device_error,
-       .get_next_variable = (void *)&efi_device_error,
-       .set_variable = (void *)&efi_device_error,
+       .get_variable = efi_get_variable,
+       .get_next_variable = efi_get_next_variable,
+       .set_variable = efi_set_variable,
        .get_next_high_mono_count = (void *)&efi_device_error,
        .reset_system = &efi_reset_system_boottime,
 };
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
new file mode 100644 (file)
index 0000000..6c177da
--- /dev/null
@@ -0,0 +1,335 @@
+/*
+ *  EFI utils
+ *
+ *  Copyright (c) 2017 Rob Clark
+ *
+ *  SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <malloc.h>
+#include <charset.h>
+#include <efi_loader.h>
+
+#define READ_ONLY BIT(31)
+
+/*
+ * Mapping between EFI variables and u-boot variables:
+ *
+ *   efi_$guid_$varname = {attributes}(type)value
+ *
+ * For example:
+ *
+ *   efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_OsIndicationsSupported=
+ *      "{ro,boot,run}(blob)0000000000000000"
+ *   efi_8be4df61-93ca-11d2-aa0d-00e098032b8c_BootOrder=
+ *      "(blob)00010000"
+ *
+ * The attributes are a comma separated list of these possible
+ * attributes:
+ *
+ *   + ro   - read-only
+ *   + boot - boot-services access
+ *   + run  - runtime access
+ *
+ * NOTE: with current implementation, no variables are available after
+ * ExitBootServices, and all are persisted (if possible).
+ *
+ * If not specified, the attributes default to "{boot}".
+ *
+ * The required type is one of:
+ *
+ *   + utf8 - raw utf8 string
+ *   + blob - arbitrary length hex string
+ *
+ * Maybe a utf16 type would be useful to for a string value to be auto
+ * converted to utf16?
+ */
+
+#define MAX_VAR_NAME 31
+#define MAX_NATIVE_VAR_NAME \
+       (strlen("efi_xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx_") + \
+               (MAX_VAR_NAME * MAX_UTF8_PER_UTF16))
+
+static int hex(unsigned char ch)
+{
+       if (ch >= 'a' && ch <= 'f')
+               return ch-'a'+10;
+       if (ch >= '0' && ch <= '9')
+               return ch-'0';
+       if (ch >= 'A' && ch <= 'F')
+               return ch-'A'+10;
+       return -1;
+}
+
+static const char *hex2mem(u8 *mem, const char *hexstr, int count)
+{
+       memset(mem, 0, count/2);
+
+       do {
+               int nibble;
+
+               *mem = 0;
+
+               if (!count || !*hexstr)
+                       break;
+
+               nibble = hex(*hexstr);
+               if (nibble < 0)
+                       break;
+
+               *mem = nibble;
+               count--;
+               hexstr++;
+
+               if (!count || !*hexstr)
+                       break;
+
+               nibble = hex(*hexstr);
+               if (nibble < 0)
+                       break;
+
+               *mem = (*mem << 4) | nibble;
+               count--;
+               hexstr++;
+               mem++;
+
+       } while (1);
+
+       if (*hexstr)
+               return hexstr;
+
+       return NULL;
+}
+
+static char *mem2hex(char *hexstr, const u8 *mem, int count)
+{
+       static const char hexchars[] = "0123456789abcdef";
+
+       while (count-- > 0) {
+               u8 ch = *mem++;
+               *hexstr++ = hexchars[ch >> 4];
+               *hexstr++ = hexchars[ch & 0xf];
+       }
+
+       return hexstr;
+}
+
+static efi_status_t efi_to_native(char *native, s16 *variable_name,
+               efi_guid_t *vendor)
+{
+       size_t len;
+
+       len = utf16_strlen((u16 *)variable_name);
+       if (len >= MAX_VAR_NAME)
+               return EFI_DEVICE_ERROR;
+
+       native += sprintf(native, "efi_%pUl_", vendor);
+       native  = (char *)utf16_to_utf8((u8 *)native, (u16 *)variable_name, len);
+       *native = '\0';
+
+       return EFI_SUCCESS;
+}
+
+static const char *prefix(const char *str, const char *prefix)
+{
+       size_t n = strlen(prefix);
+       if (!strncmp(prefix, str, n))
+               return str + n;
+       return NULL;
+}
+
+/* parse attributes part of variable value, if present: */
+static const char *parse_attr(const char *str, u32 *attrp)
+{
+       u32 attr = 0;
+       char sep = '{';
+
+       if (*str != '{') {
+               *attrp = EFI_VARIABLE_BOOTSERVICE_ACCESS;
+               return str;
+       }
+
+       while (*str == sep) {
+               const char *s;
+
+               str++;
+
+               if ((s = prefix(str, "ro"))) {
+                       attr |= READ_ONLY;
+               } else if ((s = prefix(str, "boot"))) {
+                       attr |= EFI_VARIABLE_BOOTSERVICE_ACCESS;
+               } else if ((s = prefix(str, "run"))) {
+                       attr |= EFI_VARIABLE_RUNTIME_ACCESS;
+               } else {
+                       printf("invalid attribute: %s\n", str);
+                       break;
+               }
+
+               str = s;
+               sep = ',';
+       }
+
+       str++;
+
+       *attrp = attr;
+
+       return str;
+}
+
+/* http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#GetVariable.28.29 */
+efi_status_t EFIAPI efi_get_variable(s16 *variable_name,
+               efi_guid_t *vendor, u32 *attributes,
+               unsigned long *data_size, void *data)
+{
+       char native_name[MAX_NATIVE_VAR_NAME + 1];
+       efi_status_t ret;
+       unsigned long in_size;
+       const char *val, *s;
+       u32 attr;
+
+       EFI_ENTRY("\"%ls\" %pUl %p %p %p", variable_name, vendor, attributes,
+                 data_size, data);
+
+       if (!variable_name || !vendor || !data_size)
+               return EFI_EXIT(EFI_INVALID_PARAMETER);
+
+       ret = efi_to_native(native_name, variable_name, vendor);
+       if (ret)
+               return EFI_EXIT(ret);
+
+       debug("%s: get '%s'\n", __func__, native_name);
+
+       val = env_get(native_name);
+       if (!val)
+               return EFI_EXIT(EFI_NOT_FOUND);
+
+       val = parse_attr(val, &attr);
+
+       in_size = *data_size;
+
+       if ((s = prefix(val, "(blob)"))) {
+               unsigned len = strlen(s);
+
+               /* two characters per byte: */
+               len = DIV_ROUND_UP(len, 2);
+               *data_size = len;
+
+               if (in_size < len)
+                       return EFI_EXIT(EFI_BUFFER_TOO_SMALL);
+
+               if (!data)
+                       return EFI_EXIT(EFI_INVALID_PARAMETER);
+
+               if (hex2mem(data, s, len * 2))
+                       return EFI_EXIT(EFI_DEVICE_ERROR);
+
+               debug("%s: got value: \"%s\"\n", __func__, s);
+       } else if ((s = prefix(val, "(utf8)"))) {
+               unsigned len = strlen(s) + 1;
+
+               *data_size = len;
+
+               if (in_size < len)
+                       return EFI_EXIT(EFI_BUFFER_TOO_SMALL);
+
+               if (!data)
+                       return EFI_EXIT(EFI_INVALID_PARAMETER);
+
+               memcpy(data, s, len);
+               ((char *)data)[len] = '\0';
+
+               debug("%s: got value: \"%s\"\n", __func__, (char *)data);
+       } else {
+               debug("%s: invalid value: '%s'\n", __func__, val);
+               return EFI_EXIT(EFI_DEVICE_ERROR);
+       }
+
+       if (attributes)
+               *attributes = attr & EFI_VARIABLE_MASK;
+
+       return EFI_EXIT(EFI_SUCCESS);
+}
+
+/* http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#GetNextVariableName.28.29 */
+efi_status_t EFIAPI efi_get_next_variable(
+               unsigned long *variable_name_size,
+               s16 *variable_name, efi_guid_t *vendor)
+{
+       EFI_ENTRY("%p \"%ls\" %pUl", variable_name_size, variable_name, vendor);
+
+       return EFI_EXIT(EFI_DEVICE_ERROR);
+}
+
+/* http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#SetVariable.28.29 */
+efi_status_t EFIAPI efi_set_variable(s16 *variable_name,
+               efi_guid_t *vendor, u32 attributes,
+               unsigned long data_size, void *data)
+{
+       char native_name[MAX_NATIVE_VAR_NAME + 1];
+       efi_status_t ret = EFI_SUCCESS;
+       char *val, *s;
+       u32 attr;
+
+       EFI_ENTRY("\"%ls\" %pUl %x %lu %p", variable_name, vendor, attributes,
+                 data_size, data);
+
+       if (!variable_name || !vendor)
+               return EFI_EXIT(EFI_INVALID_PARAMETER);
+
+       ret = efi_to_native(native_name, variable_name, vendor);
+       if (ret)
+               return EFI_EXIT(ret);
+
+#define ACCESS_ATTR (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS)
+
+       if ((data_size == 0) || !(attributes & ACCESS_ATTR)) {
+               /* delete the variable: */
+               env_set(native_name, NULL);
+               return EFI_EXIT(EFI_SUCCESS);
+       }
+
+       val = env_get(native_name);
+       if (val) {
+               parse_attr(val, &attr);
+
+               if (attr & READ_ONLY)
+                       return EFI_EXIT(EFI_WRITE_PROTECTED);
+       }
+
+       val = malloc(2 * data_size + strlen("{ro,run,boot}(blob)") + 1);
+       if (!val)
+               return EFI_EXIT(EFI_OUT_OF_RESOURCES);
+
+       s = val;
+
+       /* store attributes: */
+       attributes &= (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS);
+       s += sprintf(s, "{");
+       while (attributes) {
+               u32 attr = 1 << (ffs(attributes) - 1);
+
+               if (attr == EFI_VARIABLE_BOOTSERVICE_ACCESS)
+                       s += sprintf(s, "boot");
+               else if (attr == EFI_VARIABLE_RUNTIME_ACCESS)
+                       s += sprintf(s, "run");
+
+               attributes &= ~attr;
+               if (attributes)
+                       s += sprintf(s, ",");
+       }
+       s += sprintf(s, "}");
+
+       /* store payload: */
+       s += sprintf(s, "(blob)");
+       s = mem2hex(s, data, data_size);
+       *s = '\0';
+
+       debug("%s: setting: %s=%s\n", __func__, native_name, val);
+
+       if (env_set(native_name, val))
+               ret = EFI_DEVICE_ERROR;
+
+       free(val);
+
+       return EFI_EXIT(ret);
+}
diff --git a/lib/efi_selftest/Kconfig b/lib/efi_selftest/Kconfig
new file mode 100644 (file)
index 0000000..3b5f3a1
--- /dev/null
@@ -0,0 +1,7 @@
+config CMD_BOOTEFI_SELFTEST
+       bool "Allow booting an EFI efi_selftest"
+       depends on CMD_BOOTEFI
+       help
+         This adds an EFI test application to U-Boot that can be executed
+         with the 'bootefi selftest' command. It provides extended tests of
+         the EFI API implementation.
diff --git a/lib/efi_selftest/Makefile b/lib/efi_selftest/Makefile
new file mode 100644 (file)
index 0000000..30f1960
--- /dev/null
@@ -0,0 +1,26 @@
+:
+# (C) Copyright 2017, Heinrich Schuchardt <xypron.glpk@gmx.de>
+#
+#  SPDX-License-Identifier:     GPL-2.0+
+#
+
+# This file only gets included with CONFIG_EFI_LOADER set, so all
+# object inclusion implicitly depends on it
+
+CFLAGS_efi_selftest.o := $(CFLAGS_EFI)
+CFLAGS_REMOVE_efi_selftest.o := $(CFLAGS_NON_EFI)
+CFLAGS_efi_selftest_console.o := $(CFLAGS_EFI)
+CFLAGS_REMOVE_efi_selftest_console.o := $(CFLAGS_NON_EFI)
+CFLAGS_efi_selftest_events.o := $(CFLAGS_EFI)
+CFLAGS_REMOVE_efi_selftest_events.o := $(CFLAGS_NON_EFI)
+CFLAGS_efi_selftest_exitbootservices.o := $(CFLAGS_EFI)
+CFLAGS_REMOVE_efi_selftest_exitbootservices.o := $(CFLAGS_NON_EFI)
+CFLAGS_efi_selftest_tpl.o := $(CFLAGS_EFI)
+CFLAGS_REMOVE_efi_selftest_tpl.o := $(CFLAGS_NON_EFI)
+
+obj-$(CONFIG_CMD_BOOTEFI_SELFTEST) += \
+efi_selftest.o \
+efi_selftest_console.o \
+efi_selftest_events.o \
+efi_selftest_exitbootservices.o \
+efi_selftest_tpl.o
diff --git a/lib/efi_selftest/efi_selftest.c b/lib/efi_selftest/efi_selftest.c
new file mode 100644 (file)
index 0000000..efec832
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * EFI efi_selftest
+ *
+ * Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <efi_selftest.h>
+#include <vsprintf.h>
+
+static const struct efi_system_table *systable;
+static const struct efi_boot_services *boottime;
+static const struct efi_runtime_services *runtime;
+static efi_handle_t handle;
+static u16 reset_message[] = L"Selftest completed";
+
+/*
+ * Exit the boot services.
+ *
+ * The size of the memory map is determined.
+ * Pool memory is allocated to copy the memory map.
+ * The memory amp is copied and the map key is obtained.
+ * The map key is used to exit the boot services.
+ */
+void efi_st_exit_boot_services(void)
+{
+       unsigned long  map_size = 0;
+       unsigned long  map_key;
+       unsigned long desc_size;
+       u32 desc_version;
+       efi_status_t ret;
+       struct efi_mem_desc *memory_map;
+
+       ret = boottime->get_memory_map(&map_size, NULL, &map_key, &desc_size,
+                                      &desc_version);
+       if (ret != EFI_BUFFER_TOO_SMALL) {
+               efi_st_printf("ERROR: GetMemoryMap did not return "
+                             "EFI_BUFFER_TOO_SMALL\n");
+               return;
+       }
+       /* Allocate extra space for newly allocated memory */
+       map_size += sizeof(struct efi_mem_desc);
+       ret = boottime->allocate_pool(EFI_BOOT_SERVICES_DATA, map_size,
+                                     (void **)&memory_map);
+       if (ret != EFI_SUCCESS) {
+               efi_st_printf("ERROR: AllocatePool did not return "
+                             "EFI_SUCCESS\n");
+               return;
+       }
+       ret = boottime->get_memory_map(&map_size, memory_map, &map_key,
+                                      &desc_size, &desc_version);
+       if (ret != EFI_SUCCESS) {
+               efi_st_printf("ERROR: GetMemoryMap did not return "
+                             "EFI_SUCCESS\n");
+               return;
+       }
+       ret = boottime->exit_boot_services(handle, map_key);
+       if (ret != EFI_SUCCESS) {
+               efi_st_printf("ERROR: ExitBootServices did not return "
+                             "EFI_SUCCESS\n");
+               return;
+       }
+       efi_st_printf("\nBoot services terminated\n");
+}
+
+/*
+ * Set up a test.
+ *
+ * @test       the test to be executed
+ * @failures   counter that will be incremented if a failure occurs
+ */
+static int setup(struct efi_unit_test *test, unsigned int *failures)
+{
+       int ret;
+
+       if (!test->setup)
+               return 0;
+       efi_st_printf("\nSetting up '%s'\n", test->name);
+       ret = test->setup(handle, systable);
+       if (ret) {
+               efi_st_printf("ERROR: Setting up '%s' failed\n", test->name);
+               ++*failures;
+       } else {
+               efi_st_printf("Setting up '%s' succeeded\n", test->name);
+       }
+       return ret;
+}
+
+/*
+ * Execute a test.
+ *
+ * @test       the test to be executed
+ * @failures   counter that will be incremented if a failure occurs
+ */
+static int execute(struct efi_unit_test *test, unsigned int *failures)
+{
+       int ret;
+
+       if (!test->execute)
+               return 0;
+       efi_st_printf("\nExecuting '%s'\n", test->name);
+       ret = test->execute();
+       if (ret) {
+               efi_st_printf("ERROR: Executing '%s' failed\n", test->name);
+               ++*failures;
+       } else {
+               efi_st_printf("Executing '%s' succeeded\n", test->name);
+       }
+       return ret;
+}
+
+/*
+ * Tear down a test.
+ *
+ * @test       the test to be torn down
+ * @failures   counter that will be incremented if a failure occurs
+ */
+static int teardown(struct efi_unit_test *test, unsigned int *failures)
+{
+       int ret;
+
+       if (!test->teardown)
+               return 0;
+       efi_st_printf("\nTearing down '%s'\n", test->name);
+       ret = test->teardown();
+       if (ret) {
+               efi_st_printf("ERROR: Tearing down '%s' failed\n", test->name);
+               ++*failures;
+       } else {
+               efi_st_printf("Tearing down '%s' succeeded\n", test->name);
+       }
+       return ret;
+}
+
+/*
+ * Execute selftest of the EFI API
+ *
+ * This is the main entry point of the EFI selftest application.
+ *
+ * All tests use a driver model and are run in three phases:
+ * setup, execute, teardown.
+ *
+ * A test may be setup and executed at boottime,
+ * it may be setup at boottime and executed at runtime,
+ * or it may be setup and executed at runtime.
+ *
+ * After executing all tests the system is reset.
+ *
+ * @image_handle:      handle of the loaded EFI image
+ * @systab:            EFI system table
+ */
+efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
+                                struct efi_system_table *systab)
+{
+       struct efi_unit_test *test;
+       unsigned int failures = 0;
+
+       systable = systab;
+       boottime = systable->boottime;
+       runtime = systable->runtime;
+       handle = image_handle;
+       con_out = systable->con_out;
+       con_in = systable->con_in;
+
+       efi_st_printf("\nTesting EFI API implementation\n");
+
+       efi_st_printf("\nNumber of tests to execute: %u\n",
+                     ll_entry_count(struct efi_unit_test, efi_unit_test));
+
+       /* Execute boottime tests */
+       for (test = ll_entry_start(struct efi_unit_test, efi_unit_test);
+            test < ll_entry_end(struct efi_unit_test, efi_unit_test); ++test) {
+               if (test->phase == EFI_EXECUTE_BEFORE_BOOTTIME_EXIT) {
+                       setup(test, &failures);
+                       execute(test, &failures);
+                       teardown(test, &failures);
+               }
+       }
+
+       /* Execute mixed tests */
+       for (test = ll_entry_start(struct efi_unit_test, efi_unit_test);
+            test < ll_entry_end(struct efi_unit_test, efi_unit_test); ++test) {
+               if (test->phase == EFI_SETUP_BEFORE_BOOTTIME_EXIT)
+                       setup(test, &failures);
+       }
+
+       efi_st_exit_boot_services();
+
+       for (test = ll_entry_start(struct efi_unit_test, efi_unit_test);
+            test < ll_entry_end(struct efi_unit_test, efi_unit_test); ++test) {
+               if (test->phase == EFI_SETUP_BEFORE_BOOTTIME_EXIT) {
+                       execute(test, &failures);
+                       teardown(test, &failures);
+               }
+       }
+
+       /* Execute runtime tests */
+       for (test = ll_entry_start(struct efi_unit_test, efi_unit_test);
+            test < ll_entry_end(struct efi_unit_test, efi_unit_test); ++test) {
+               if (test->phase == EFI_SETUP_AFTER_BOOTTIME_EXIT) {
+                       setup(test, &failures);
+                       execute(test, &failures);
+                       teardown(test, &failures);
+               }
+       }
+
+       /* Give feedback */
+       efi_st_printf("\nSummary: %u failures\n\n", failures);
+
+       /* Reset system */
+       efi_st_printf("Preparing for reset. Press any key.\n");
+       efi_st_get_key();
+       runtime->reset_system(EFI_RESET_WARM, EFI_NOT_READY,
+                             sizeof(reset_message), reset_message);
+       efi_st_printf("\nERROR: reset failed.\n");
+
+       return EFI_UNSUPPORTED;
+}
diff --git a/lib/efi_selftest/efi_selftest_console.c b/lib/efi_selftest/efi_selftest_console.c
new file mode 100644 (file)
index 0000000..7b5b724
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * EFI efi_selftest
+ *
+ * Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <efi_selftest.h>
+#include <vsprintf.h>
+
+struct efi_simple_text_output_protocol *con_out;
+struct efi_simple_input_interface *con_in;
+
+/*
+ * Print a pointer to an u16 string
+ *
+ * @pointer: pointer
+ * @buf: pointer to buffer address
+ * on return position of terminating zero word
+ */
+static void pointer(void *pointer, u16 **buf)
+{
+       int i;
+       u16 c;
+       uintptr_t p = (uintptr_t)pointer;
+       u16 *pos = *buf;
+
+       for (i = 8 * sizeof(p) - 4; i >= 0; i -= 4) {
+               c = (p >> i) & 0x0f;
+               c += '0';
+               if (c > '9')
+                       c += 'a' - '9' - 1;
+               *pos++ = c;
+       }
+       *pos = 0;
+       *buf = pos;
+}
+
+/*
+ * Print an unsigned 32bit value as decimal number to an u16 string
+ *
+ * @value: value to be printed
+ * @buf: pointer to buffer address
+ * on return position of terminating zero word
+ */
+static void uint2dec(u32 value, u16 **buf)
+{
+       u16 *pos = *buf;
+       int i;
+       u16 c;
+       u64 f;
+
+       /*
+        * Increment by .5 and multiply with
+        * (2 << 60) / 1,000,000,000 = 0x44B82FA0.9B5A52CC
+        * to move the first digit to bit 60-63.
+        */
+       f = 0x225C17D0;
+       f += (0x9B5A52DULL * value) >> 28;
+       f += 0x44B82FA0ULL * value;
+
+       for (i = 0; i < 10; ++i) {
+               /* Write current digit */
+               c = f >> 60;
+               if (c || pos != *buf)
+                       *pos++ = c + '0';
+               /* Eliminate current digit */
+               f &= 0xfffffffffffffff;
+               /* Get next digit */
+               f *= 0xaULL;
+       }
+       if (pos == *buf)
+               *pos++ = '0';
+       *pos = 0;
+       *buf = pos;
+}
+
+/*
+ * Print a signed 32bit value as decimal number to an u16 string
+ *
+ * @value: value to be printed
+ * @buf: pointer to buffer address
+ * on return position of terminating zero word
+ */
+static void int2dec(s32 value, u16 **buf)
+{
+       u32 u;
+       u16 *pos = *buf;
+
+       if (value < 0) {
+               *pos++ = '-';
+               u = -value;
+       } else {
+               u = value;
+       }
+       uint2dec(u, &pos);
+       *buf = pos;
+}
+
+/*
+ * Print a formatted string to the EFI console
+ *
+ * @fmt: format string
+ * @...: optional arguments
+ */
+void efi_st_printf(const char *fmt, ...)
+{
+       va_list args;
+       u16 buf[160];
+       const char *c;
+       u16 *pos = buf;
+       const char *s;
+
+       va_start(args, fmt);
+
+       c = fmt;
+       for (; *c; ++c) {
+               switch (*c) {
+               case '\\':
+                       ++c;
+                       switch (*c) {
+                       case '\0':
+                               --c;
+                               break;
+                       case 'n':
+                               *pos++ = '\n';
+                               break;
+                       case 'r':
+                               *pos++ = '\r';
+                               break;
+                       case 't':
+                               *pos++ = '\t';
+                               break;
+                       default:
+                               *pos++ = *c;
+                       }
+                       break;
+               case '%':
+                       ++c;
+                       switch (*c) {
+                       case '\0':
+                               --c;
+                               break;
+                       case 'd':
+                               int2dec(va_arg(args, s32), &pos);
+                               break;
+                       case 'p':
+                               pointer(va_arg(args, void*), &pos);
+                               break;
+                       case 's':
+                               s = va_arg(args, const char *);
+                               for (; *s; ++s)
+                                       *pos++ = *s;
+                               break;
+                       case 'u':
+                               uint2dec(va_arg(args, u32), &pos);
+                               break;
+                       default:
+                               break;
+                       }
+                       break;
+               default:
+                       *pos++ = *c;
+               }
+       }
+       va_end(args);
+       *pos = 0;
+       con_out->output_string(con_out, buf);
+}
+
+/*
+ * Reads an Unicode character from the input device.
+ *
+ * @return: Unicode character
+ */
+u16 efi_st_get_key(void)
+{
+       struct efi_input_key input_key;
+       efi_status_t ret;
+
+       /* Wait for next key */
+       do {
+               ret = con_in->read_key_stroke(con_in, &input_key);
+       } while (ret == EFI_NOT_READY);
+       return input_key.unicode_char;
+}
diff --git a/lib/efi_selftest/efi_selftest_events.c b/lib/efi_selftest/efi_selftest_events.c
new file mode 100644 (file)
index 0000000..c4f6695
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * efi_selftest_events
+ *
+ * Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ *
+ * This unit test uses timer events to check the implementation
+ * of the following boottime services:
+ * CreateEvent, CloseEvent, WaitForEvent, CheckEvent, SetTimer.
+ */
+
+#include <efi_selftest.h>
+
+static struct efi_event *event_notify;
+static struct efi_event *event_wait;
+static unsigned int counter;
+static struct efi_boot_services *boottime;
+
+/*
+ * Notification function, increments a counter.
+ *
+ * @event      notified event
+ * @context    pointer to the counter
+ */
+static void EFIAPI notify(struct efi_event *event, void *context)
+{
+       if (!context)
+               return;
+       ++*(unsigned int *)context;
+}
+
+/*
+ * Setup unit test.
+ *
+ * Create two timer events.
+ * One with EVT_NOTIFY_SIGNAL, the other with EVT_NOTIFY_WAIT.
+ *
+ * @handle:    handle of the loaded image
+ * @systable:  system table
+ */
+static int setup(const efi_handle_t handle,
+                const struct efi_system_table *systable)
+{
+       efi_status_t ret;
+
+       boottime = systable->boottime;
+
+       ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL,
+                                    TPL_CALLBACK, notify, (void *)&counter,
+                                    &event_notify);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("could not create event\n");
+               return 1;
+       }
+       ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_WAIT,
+                                    TPL_CALLBACK, notify, NULL, &event_wait);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("could not create event\n");
+               return 1;
+       }
+       return 0;
+}
+
+/*
+ * Tear down unit test.
+ *
+ * Close the events created in setup.
+ */
+static int teardown(void)
+{
+       efi_status_t ret;
+
+       if (event_notify) {
+               ret = boottime->close_event(event_notify);
+               event_notify = NULL;
+               if (ret != EFI_SUCCESS) {
+                       efi_st_error("could not close event\n");
+                       return 1;
+               }
+       }
+       if (event_wait) {
+               ret = boottime->close_event(event_wait);
+               event_wait = NULL;
+               if (ret != EFI_SUCCESS) {
+                       efi_st_error("could not close event\n");
+                       return 1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * Execute unit test.
+ *
+ * Run a 10 ms periodic timer and check that it is called 10 times
+ * while waiting for 100 ms single shot timer.
+ *
+ * Run a 100 ms single shot timer and check that it is called once
+ * while waiting for 100 ms periodic timer for two periods.
+ */
+static int execute(void)
+{
+       unsigned long index;
+       efi_status_t ret;
+
+       /* Set 10 ms timer */
+       counter = 0;
+       ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 100000);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not set timer\n");
+               return 1;
+       }
+       /* Set 100 ms timer */
+       ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000000);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not set timer\n");
+               return 1;
+       }
+
+       index = 5;
+       ret = boottime->wait_for_event(1, &event_wait, &index);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not wait for event\n");
+               return 1;
+       }
+       ret = boottime->check_event(event_wait);
+       if (ret != EFI_NOT_READY) {
+               efi_st_error("Signaled state was not cleared.\n");
+               efi_st_printf("ret = %u\n", (unsigned int)ret);
+               return 1;
+       }
+       if (index != 0) {
+               efi_st_error("WaitForEvent returned wrong index\n");
+               return 1;
+       }
+       efi_st_printf("Counter periodic: %u\n", counter);
+       if (counter < 8 || counter > 12) {
+               efi_st_error("Incorrect timing of events\n");
+               return 1;
+       }
+       ret = boottime->set_timer(event_notify, EFI_TIMER_STOP, 0);
+       if (index != 0) {
+               efi_st_error("Could not cancel timer\n");
+               return 1;
+       }
+       /* Set 10 ms timer */
+       counter = 0;
+       ret = boottime->set_timer(event_notify, EFI_TIMER_RELATIVE, 100000);
+       if (index != 0) {
+               efi_st_error("Could not set timer\n");
+               return 1;
+       }
+       /* Set 100 ms timer */
+       ret = boottime->set_timer(event_wait, EFI_TIMER_PERIODIC, 1000000);
+       if (index != 0) {
+               efi_st_error("Could not set timer\n");
+               return 1;
+       }
+       ret = boottime->wait_for_event(1, &event_wait, &index);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not wait for event\n");
+               return 1;
+       }
+       efi_st_printf("Counter single shot: %u\n", counter);
+       if (counter != 1) {
+               efi_st_error("Single shot timer failed\n");
+               return 1;
+       }
+       ret = boottime->wait_for_event(1, &event_wait, &index);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not wait for event\n");
+               return 1;
+       }
+       efi_st_printf("Stopped counter: %u\n", counter);
+       if (counter != 1) {
+               efi_st_error("Stopped timer fired\n");
+               return 1;
+       }
+       ret = boottime->set_timer(event_wait, EFI_TIMER_STOP, 0);
+       if (index != 0) {
+               efi_st_error("Could not cancel timer\n");
+               return 1;
+       }
+
+       return 0;
+}
+
+EFI_UNIT_TEST(events) = {
+       .name = "event services",
+       .phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT,
+       .setup = setup,
+       .execute = execute,
+       .teardown = teardown,
+};
diff --git a/lib/efi_selftest/efi_selftest_exitbootservices.c b/lib/efi_selftest/efi_selftest_exitbootservices.c
new file mode 100644 (file)
index 0000000..60271e6
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * efi_selftest_events
+ *
+ * Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ *
+ * This unit test checks that the notification function of an
+ * EVT_SIGNAL_EXIT_BOOT_SERVICES event is called exactly once.
+ */
+
+#include <efi_selftest.h>
+
+static struct efi_boot_services *boottime;
+static struct efi_event *event_notify;
+static unsigned int counter;
+
+/*
+ * Notification function, increments a counter.
+ *
+ * @event      notified event
+ * @context    pointer to the counter
+ */
+static void EFIAPI notify(struct efi_event *event, void *context)
+{
+       if (!context)
+               return;
+       ++*(unsigned int *)context;
+}
+
+/*
+ * Setup unit test.
+ *
+ * Create an EVT_SIGNAL_EXIT_BOOT_SERVICES event.
+ *
+ * @handle:    handle of the loaded image
+ * @systable:  system table
+ */
+static int setup(const efi_handle_t handle,
+                const struct efi_system_table *systable)
+{
+       efi_status_t ret;
+
+       boottime = systable->boottime;
+
+       counter = 0;
+       ret = boottime->create_event(EVT_SIGNAL_EXIT_BOOT_SERVICES,
+                                    TPL_CALLBACK, notify, (void *)&counter,
+                                    &event_notify);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("could not create event\n");
+               return 1;
+       }
+       return 0;
+}
+
+/*
+ * Tear down unit test.
+ *
+ * Close the event created in setup.
+ */
+static int teardown(void)
+{
+       efi_status_t ret;
+
+       if (event_notify) {
+               ret = boottime->close_event(event_notify);
+               event_notify = NULL;
+               if (ret != EFI_SUCCESS) {
+                       efi_st_error("could not close event\n");
+                       return 1;
+               }
+       }
+       return 0;
+}
+
+/*
+ * Execute unit test.
+ *
+ * Check that the notification function of the EVT_SIGNAL_EXIT_BOOT_SERVICES
+ * event has been called.
+ *
+ * Call ExitBootServices again and check that the notification function is
+ * not called again.
+ */
+static int execute(void)
+{
+       if (counter != 1) {
+               efi_st_error("ExitBootServices was not notified");
+               return 1;
+       }
+       efi_st_exit_boot_services();
+       if (counter != 1) {
+               efi_st_error("ExitBootServices was notified twice");
+               return 1;
+       }
+       return 0;
+}
+
+EFI_UNIT_TEST(exitbootservices) = {
+       .name = "ExitBootServices",
+       .phase = EFI_SETUP_BEFORE_BOOTTIME_EXIT,
+       .setup = setup,
+       .execute = execute,
+       .teardown = teardown,
+};
diff --git a/lib/efi_selftest/efi_selftest_tpl.c b/lib/efi_selftest/efi_selftest_tpl.c
new file mode 100644 (file)
index 0000000..90ace0f
--- /dev/null
@@ -0,0 +1,214 @@
+/*
+ * efi_selftest_events
+ *
+ * Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ *
+ * This unit test uses timer events to check the handling of
+ * task priority levels.
+ */
+
+#include <efi_selftest.h>
+
+static struct efi_event *event_notify;
+static struct efi_event *event_wait;
+static unsigned int counter;
+static struct efi_boot_services *boottime;
+
+/*
+ * Notification function, increments a counter.
+ *
+ * @event      notified event
+ * @context    pointer to the counter
+ */
+static void EFIAPI notify(struct efi_event *event, void *context)
+{
+       if (!context)
+               return;
+       ++*(unsigned int *)context;
+}
+
+/*
+ * Setup unit test.
+ *
+ * Create two timer events.
+ * One with EVT_NOTIFY_SIGNAL, the other with EVT_NOTIFY_WAIT.
+ *
+ * @handle:    handle of the loaded image
+ * @systable:  system table
+ */
+static int setup(const efi_handle_t handle,
+                const struct efi_system_table *systable)
+{
+       efi_status_t ret;
+
+       boottime = systable->boottime;
+
+       ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL,
+                                    TPL_CALLBACK, notify, (void *)&counter,
+                                    &event_notify);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("could not create event\n");
+               return 1;
+       }
+       ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_WAIT,
+                                    TPL_HIGH_LEVEL, notify, NULL, &event_wait);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("could not create event\n");
+               return 1;
+       }
+       return 0;
+}
+
+/*
+ * Tear down unit test.
+ *
+ * Close the events created in setup.
+ */
+static int teardown(void)
+{
+       efi_status_t ret;
+
+       if (event_notify) {
+               ret = boottime->close_event(event_notify);
+               event_notify = NULL;
+               if (ret != EFI_SUCCESS) {
+                       efi_st_error("could not close event\n");
+                       return 1;
+               }
+       }
+       if (event_wait) {
+               ret = boottime->close_event(event_wait);
+               event_wait = NULL;
+               if (ret != EFI_SUCCESS) {
+                       efi_st_error("could not close event\n");
+                       return 1;
+               }
+       }
+       boottime->restore_tpl(TPL_APPLICATION);
+       return 0;
+}
+
+/*
+ * Execute unit test.
+ *
+ * Run a 10 ms periodic timer and check that it is called 10 times
+ * while waiting for 100 ms single shot timer.
+ *
+ * Raise the TPL level to the level of the 10 ms timer and observe
+ * that the notification function is not called again.
+ *
+ * Lower the TPL level and check that the queued notification
+ * function is called.
+ */
+static int execute(void)
+{
+       unsigned long index;
+       efi_status_t ret;
+       UINTN old_tpl;
+
+       /* Set 10 ms timer */
+       counter = 0;
+       ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 100000);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not set timer\n");
+               return 1;
+       }
+       /* Set 100 ms timer */
+       ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000000);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not set timer\n");
+               return 1;
+       }
+       index = 5;
+       ret = boottime->wait_for_event(1, &event_wait, &index);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not wait for event\n");
+               return 1;
+       }
+       ret = boottime->check_event(event_wait);
+       if (ret != EFI_NOT_READY) {
+               efi_st_error("Signaled state was not cleared.\n");
+               efi_st_printf("ret = %u\n", (unsigned int)ret);
+               return 1;
+       }
+       if (index != 0) {
+               efi_st_error("WaitForEvent returned wrong index\n");
+               return 1;
+       }
+       efi_st_printf("Counter with TPL level TPL_APPLICATION: %u\n", counter);
+       if (counter < 8 || counter > 12) {
+               efi_st_error("Incorrect timing of events\n");
+               return 1;
+       }
+       ret = boottime->set_timer(event_notify, EFI_TIMER_STOP, 0);
+       if (index != 0) {
+               efi_st_error("Could not cancel timer\n");
+               return 1;
+       }
+       /* Raise TPL level */
+       old_tpl = boottime->raise_tpl(TPL_CALLBACK);
+       if (old_tpl != TPL_APPLICATION) {
+               efi_st_error("Initial TPL level was not TPL_APPLICATION");
+               return 1;
+       }
+       /* Set 10 ms timer */
+       counter = 0;
+       ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 100000);
+       if (index != 0) {
+               efi_st_error("Could not set timer\n");
+               return 1;
+       }
+       /* Set 100 ms timer */
+       ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000000);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not set timer\n");
+               return 1;
+       }
+       do {
+               ret = boottime->check_event(event_wait);
+       } while (ret == EFI_NOT_READY);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not check event\n");
+               return 1;
+       }
+       efi_st_printf("Counter with TPL level TPL_CALLBACK: %u\n", counter);
+       if (counter != 0) {
+               efi_st_error("Suppressed timer fired\n");
+               return 1;
+       }
+       /* Set 1 ms timer */
+       ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1000);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not set timer\n");
+               return 1;
+       }
+       /* Restore the old TPL level */
+       boottime->restore_tpl(TPL_APPLICATION);
+       ret = boottime->wait_for_event(1, &event_wait, &index);
+       if (ret != EFI_SUCCESS) {
+               efi_st_error("Could not wait for event\n");
+               return 1;
+       }
+       efi_st_printf("Counter with TPL level TPL_APPLICATION: %u\n", counter);
+       if (counter < 1) {
+               efi_st_error("Queued timer event did not fire\n");
+               return 1;
+       }
+       ret = boottime->set_timer(event_wait, EFI_TIMER_STOP, 0);
+       if (index != 0) {
+               efi_st_error("Could not cancel timer\n");
+               return 1;
+       }
+
+       return 0;
+}
+
+EFI_UNIT_TEST(tpl) = {
+       .name = "task priority levels",
+       .phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT,
+       .setup = setup,
+       .execute = execute,
+       .teardown = teardown,
+};
index 107a892e79c274e0b6e2c44cf2516aef7d469a1e..45f3fe7baf8e76505e4b769bb945a62452ba1522 100644 (file)
@@ -4,17 +4,18 @@
  */
 
 #ifndef USE_HOSTCC
-#include <boot_fit.h>
 #include <common.h>
+#include <boot_fit.h>
 #include <dm.h>
+#include <dm/of_extra.h>
 #include <errno.h>
-#include <serial.h>
-#include <libfdt.h>
-#include <fdt_support.h>
 #include <fdtdec.h>
+#include <fdt_support.h>
+#include <libfdt.h>
+#include <serial.h>
 #include <asm/sections.h>
-#include <dm/of_extra.h>
 #include <linux/ctype.h>
+#include <linux/lzo.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -1203,9 +1204,66 @@ int fdtdec_setup_memory_banksize(void)
 }
 #endif
 
+#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
+# if CONFIG_IS_ENABLED(MULTI_DTB_FIT_GZIP) ||\
+       CONFIG_IS_ENABLED(MULTI_DTB_FIT_LZO)
+static int uncompress_blob(const void *src, ulong sz_src, void **dstp)
+{
+       size_t sz_out = CONFIG_SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ;
+       ulong sz_in = sz_src;
+       void *dst;
+       int rc;
+
+       if (CONFIG_IS_ENABLED(GZIP))
+               if (gzip_parse_header(src, sz_in) < 0)
+                       return -1;
+       if (CONFIG_IS_ENABLED(LZO))
+               if (!lzop_is_valid_header(src))
+                       return -EBADMSG;
+
+       if (CONFIG_IS_ENABLED(MULTI_DTB_FIT_DYN_ALLOC)) {
+               dst = malloc(sz_out);
+               if (!dst) {
+                       puts("uncompress_blob: Unable to allocate memory\n");
+                       return -ENOMEM;
+               }
+       } else  {
+#  if CONFIG_IS_ENABLED(MULTI_DTB_FIT_USER_DEFINED_AREA)
+               dst = (void *)CONFIG_VAL(MULTI_DTB_FIT_USER_DEF_ADDR);
+#  else
+               return -ENOTSUPP;
+#  endif
+       }
+
+       if (CONFIG_IS_ENABLED(GZIP))
+               rc = gunzip(dst, sz_out, (u8 *)src, &sz_in);
+       else if (CONFIG_IS_ENABLED(LZO))
+               rc = lzop_decompress(src, sz_in, dst, &sz_out);
+
+       if (rc < 0) {
+               /* not a valid compressed blob */
+               puts("uncompress_blob: Unable to uncompress\n");
+               if (CONFIG_IS_ENABLED(MULTI_DTB_FIT_DYN_ALLOC))
+                       free(dst);
+               return -EBADMSG;
+       }
+       *dstp = dst;
+       return 0;
+}
+# else
+static int uncompress_blob(const void *src, ulong sz_src, void **dstp)
+{
+       return -ENOTSUPP;
+}
+# endif
+#endif
+
 int fdtdec_setup(void)
 {
 #if CONFIG_IS_ENABLED(OF_CONTROL)
+# if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
+       void *fdt_blob;
+# endif
 # ifdef CONFIG_OF_EMBED
        /* Get a pointer to the FDT */
        gd->fdt_blob = __dtb_dt_begin;
@@ -1216,15 +1274,6 @@ int fdtdec_setup(void)
                gd->fdt_blob = (ulong *)&_image_binary_end;
        else
                gd->fdt_blob = (ulong *)&__bss_end;
-
-#  elif defined CONFIG_FIT_EMBED
-       gd->fdt_blob = locate_dtb_in_fit(&_end);
-
-       if (gd->fdt_blob == NULL || gd->fdt_blob <= ((void *)&_end)) {
-               puts("Failed to find proper dtb in embedded FIT Image\n");
-               return -1;
-       }
-
 #  else
        /* FDT is at end of image */
        gd->fdt_blob = (ulong *)&_end;
@@ -1243,7 +1292,27 @@ int fdtdec_setup(void)
        gd->fdt_blob = (void *)env_get_ulong("fdtcontroladdr", 16,
                                                (uintptr_t)gd->fdt_blob);
 # endif
+
+# if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
+       /*
+        * Try and uncompress the blob.
+        * Unfortunately there is no way to know how big the input blob really
+        * is. So let us set the maximum input size arbitrarily high. 16MB
+        * ought to be more than enough for packed DTBs.
+        */
+       if (uncompress_blob(gd->fdt_blob, 0x1000000, &fdt_blob) == 0)
+               gd->fdt_blob = fdt_blob;
+
+       /*
+        * Check if blob is a FIT images containings DTBs.
+        * If so, pick the most relevant
+        */
+       fdt_blob = locate_dtb_in_fit(gd->fdt_blob);
+       if (fdt_blob)
+               gd->fdt_blob = fdt_blob;
+# endif
 #endif
+
        return fdtdec_prepare_fdt();
 }
 
index 832b3064e7614bc7c74159ca04f62b3122420356..adb86c755036fa9be8bf13b2717b5f6d21295868 100644 (file)
@@ -42,7 +42,7 @@ void gzfree(void *x, void *addr, unsigned nb)
        free (addr);
 }
 
-int gunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp)
+int gzip_parse_header(const unsigned char *src, unsigned long len)
 {
        int i, flags;
 
@@ -63,12 +63,21 @@ int gunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp)
                        ;
        if ((flags & HEAD_CRC) != 0)
                i += 2;
-       if (i >= *lenp) {
+       if (i >= len) {
                puts ("Error: gunzip out of data in header\n");
                return (-1);
        }
+       return i;
+}
+
+int gunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp)
+{
+       int offset = gzip_parse_header(src, *lenp);
+
+       if (offset < 0)
+               return offset;
 
-       return zunzip(dst, dstlen, src, lenp, 1, i);
+       return zunzip(dst, dstlen, src, lenp, 1, offset);
 }
 
 #ifdef CONFIG_CMD_UNZIP
index ccc90b8ee53fe8097d26f20d31b34dface2413b1..65fef0b0eb90591d2c03e6acaf8c267e7b2c9021 100644 (file)
@@ -30,16 +30,29 @@ static const unsigned char lzop_magic[] = {
 
 #define HEADER_HAS_FILTER      0x00000800L
 
-static inline const unsigned char *parse_header(const unsigned char *src)
+
+bool lzop_is_valid_header(const unsigned char *src)
 {
-       u16 version;
        int i;
-
        /* read magic: 9 first bytes */
        for (i = 0; i < ARRAY_SIZE(lzop_magic); i++) {
                if (*src++ != lzop_magic[i])
-                       return NULL;
+                       return false;
        }
+       return true;
+}
+
+static inline const unsigned char *parse_header(const unsigned char *src)
+{
+       u16 version;
+       int i;
+
+       if (!lzop_is_valid_header(src))
+               return NULL;
+
+       /* skip header */
+       src += 9;
+
        /* get version (2bytes), skip library version (2),
         * 'need to be extracted' version (2) and
         * method (1) */
index a3a5c59d0da25446b1407fb013a7ec6e8443a5cc..2c7918ad37219b5d2b7e08d64c420283c91b9dfe 100644 (file)
@@ -172,11 +172,6 @@ ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
 # Usage:  $(call ld-ifversion, -ge, 22252, y)
 ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4))
 
-# dtc-option
-# Usage:  DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg)
-dtc-option = $(call try-run,\
-       echo '/dts-v1/; / {};' | $(DTC) $(1),$(1),$(2))
-
 ######
 
 ###
diff --git a/scripts/Kconfig b/scripts/Kconfig
deleted file mode 100644 (file)
index 2a2c18e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-config BUILD_BIN2C
-       bool
index 3e10c16d59fd1a06d2fc2700adb3ac81e3d18bfb..9d55241463d4542f7b791641f7670a3e6666948b 100644 (file)
@@ -21,3 +21,4 @@ build_docproc: $(obj)/docproc
 
 # Let clean descend into subdirs
 subdir-        += basic kconfig
+subdir-$(CONFIG_DTC)   += dtc
index 90dc149df3d9a5b625595b5177c8912309666789..1d3a5705946d53e6c5bc90bcb3c9c364a0c8a4ea 100644 (file)
@@ -58,8 +58,8 @@ endif
 
 KBUILD_CFLAGS += $(warning)
 
-dtc-warning-2 += $(call dtc-option,-Wnode_name_chars_strict)
-dtc-warning-2 += $(call dtc-option,-Wproperty_name_chars_strict)
+dtc-warning-2 += -Wnode_name_chars_strict
+dtc-warning-2 += -Wproperty_name_chars_strict
 
 dtc-warning := $(dtc-warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
 dtc-warning += $(dtc-warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
@@ -70,11 +70,11 @@ DTC_FLAGS += $(dtc-warning)
 else
 
 # Disable noisy checks by default
-DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg)
-DTC_FLAGS += $(call dtc-option,-Wno-simple_bus_reg)
-DTC_FLAGS += $(call dtc-option,-Wno-unit_address_format)
-DTC_FLAGS += $(call dtc-option,-Wno-pci_bridge)
-DTC_FLAGS += $(call dtc-option,-Wno-pci_device_bus_num)
-DTC_FLAGS += $(call dtc-option,-Wno-pci_device_reg)
+DTC_FLAGS += -Wno-unit_address_vs_reg
+DTC_FLAGS += -Wno-simple_bus_reg
+DTC_FLAGS += -Wno-unit_address_format
+DTC_FLAGS += -Wno-pci_bridge
+DTC_FLAGS += -Wno-pci_device_bus_num
+DTC_FLAGS += -Wno-pci_device_reg
 
 endif
index 2a7ed70cf26b3cd8d72d772d1bb1ae6a6c9f5773..861a3dc3f1d301378c8c807bf576bfcfcc437ab4 100644 (file)
@@ -359,20 +359,22 @@ cmd_S_ttf=                                                \
 $(obj)/%.S: $(src)/%.ttf
        $(call cmd,S_ttf)
 
-# EFI Hello World application
+# EFI applications
+# A Makefile target *.efi is built as EFI application.
+# A Makefile target *_efi.S wraps *.efi as built-in EFI 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';                              \
+cmd_S_efi=                                     \
+(                                              \
+       echo '.section .rodata.$*.init,"a"';    \
+       echo '.balign 16';                      \
+       echo '.global __efi_$*_begin';          \
+       echo '__efi_$*_begin:';                 \
+       echo '.incbin "$<" ';                   \
+       echo '__efi_$*_end:';                   \
+       echo '.global __efi_$*_end';            \
+       echo '.balign 16';                      \
 ) > $@
 
 $(obj)/%_efi.S: $(obj)/%.efi
@@ -383,7 +385,7 @@ cmd_efi_objcopy = $(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) $^ $@
 
-$(obj)/%.efi: $(obj)/%.so
+$(obj)/%.efi: $(obj)/%_efi.so
        $(call cmd,efi_objcopy)
 
 quiet_cmd_efi_ld = LD      $@
@@ -392,9 +394,7 @@ cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \
 
 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) \
+$(obj)/%_efi.so: $(obj)/%.o arch/$(ARCH)/lib/$(EFI_CRT0) \
                arch/$(ARCH)/lib/$(EFI_RELOC)
        $(call cmd,efi_ld)
 
index b86ea76bab260d15bf6bbdebda75f141b65e6a8c..49b27ac9267be60e55bd03fc41819fa15ec9694a 100644 (file)
@@ -209,10 +209,21 @@ cmd_cat = cat $(filter-out $(PHONY), $^) > $@
 quiet_cmd_copy = COPY    $@
       cmd_copy = cp $< $@
 
+ifneq ($(CONFIG_SPL_MULTI_DTB_FIT),y)
+FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).dtb
+else ifeq ($(CONFIG_SPL_MULTI_DTB_FIT_LZO),y)
+FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit.lzo
+else ifeq ($(CONFIG_SPL_MULTI_DTB_FIT_GZIP),y)
+FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit.gz
+else
+FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit
+endif
+
+
 ifeq ($(CONFIG_$(SPL_TPL_)OF_CONTROL)$(CONFIG_OF_SEPARATE)$(CONFIG_$(SPL_TPL_)OF_PLATDATA),yy)
 $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \
                $(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \
-               $(obj)/$(SPL_BIN).dtb FORCE
+               $(FINAL_DTB_CONTAINER)  FORCE
        $(call if_changed,cat)
 
 $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE
@@ -383,6 +394,28 @@ checkdtoc: tools
 PHONY += FORCE
 FORCE:
 
+PHONY += dtbs
+dtbs:
+       $(Q)$(MAKE) $(build)=dts dtbs
+
 # Declare the contents of the .PHONY variable as phony.  We keep that
 # information in a variable so we can use it in if_changed and friends.
 .PHONY: $(PHONY)
+
+SHRUNK_ARCH_DTB = $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(CONFIG_SPL_OF_LIST)))
+.SECONDEXPANSION:
+$(SHRUNK_ARCH_DTB): $$(patsubst $(obj)/dts/%, arch/$(ARCH)/dts/%, $$@)
+       $(call if_changed,fdtgrep)
+
+MKIMAGEFLAGS_$(SPL_BIN).multidtb.fit = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
+       -n "Multi DTB fit image for $(SPL_BIN)" -E \
+       $(patsubst %,-b %,$(SHRUNK_ARCH_DTB))
+
+$(obj)/$(SPL_BIN).multidtb.fit: /dev/null $(SHRUNK_ARCH_DTB) FORCE
+       $(call if_changed,mkimage)
+
+$(obj)/$(SPL_BIN).multidtb.fit.gz: $(obj)/$(SPL_BIN).multidtb.fit
+       @gzip -kf9 $< > $@
+
+$(obj)/$(SPL_BIN).multidtb.fit.lzo: $(obj)/$(SPL_BIN).multidtb.fit
+       @lzop -f9 $< > $@
index 56bb639091f388e97991c21504b6e0d0780f443d..78bcf06878b96ec49a4a5e9450efb85b8b1005a3 100644 (file)
@@ -1497,7 +1497,6 @@ CONFIG_MVEBU_MMC
 CONFIG_MVGBE
 CONFIG_MVGBE_PORTS
 CONFIG_MVMFP_V2
-CONFIG_MVNETA
 CONFIG_MVS
 CONFIG_MVSATA_IDE
 CONFIG_MVSATA_IDE_USE_PORT0
@@ -1848,7 +1847,6 @@ CONFIG_RAMDISK_ADDR
 CONFIG_RAMDISK_BOOT
 CONFIG_RAM_BOOT
 CONFIG_RAM_BOOT_PHYS
-CONFIG_RANDOM_UUID
 CONFIG_RCAR_BOARD_STRING
 CONFIG_RD_LVL
 CONFIG_REALMODE_DEBUG
@@ -4974,8 +4972,6 @@ CONFIG_USBD_SERIAL_OUT_PKTSIZE
 CONFIG_USBD_VENDORID
 CONFIG_USBID_ADDR
 CONFIG_USBNET_DEV_ADDR
-CONFIG_USBNET_HOST_ADDR
-CONFIG_USBNET_MANUFACTURER
 CONFIG_USBTTY
 CONFIG_USB_AM35X
 CONFIG_USB_ATMEL
@@ -5005,10 +5001,7 @@ CONFIG_USB_EHCI_TEGRA
 CONFIG_USB_EHCI_TXFIFO_THRESH
 CONFIG_USB_EHCI_VCT
 CONFIG_USB_EHCI_VF
-CONFIG_USB_ETHER
-CONFIG_USB_ETH_CDC
 CONFIG_USB_ETH_QMULT
-CONFIG_USB_ETH_RNDIS
 CONFIG_USB_ETH_SUBSET
 CONFIG_USB_EXT2_BOOT
 CONFIG_USB_FAT_BOOT
diff --git a/scripts/dtc/.gitignore b/scripts/dtc/.gitignore
new file mode 100644 (file)
index 0000000..d807c08
--- /dev/null
@@ -0,0 +1,4 @@
+/dtc
+/dtc-lexer.lex.c
+/dtc-parser.tab.c
+/dtc-parser.tab.h
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
new file mode 100644 (file)
index 0000000..2a48022
--- /dev/null
@@ -0,0 +1,31 @@
+# scripts/dtc makefile
+
+hostprogs-y    := dtc
+always         := $(hostprogs-y)
+
+dtc-objs       := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
+                  srcpos.o checks.o util.o
+dtc-objs       += dtc-lexer.lex.o dtc-parser.tab.o
+
+# Source files need to get at the userspace version of libfdt_env.h to compile
+
+HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt
+
+HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC)
+
+HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
+HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
+
+# dependencies on generated files need to be listed explicitly
+$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
+
+# generated files need to be cleaned explicitly
+clean-files    := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
diff --git a/scripts/dtc/Makefile.dtc b/scripts/dtc/Makefile.dtc
new file mode 100644 (file)
index 0000000..bece49b
--- /dev/null
@@ -0,0 +1,18 @@
+# Makefile.dtc
+#
+# This is not a complete Makefile of itself.  Instead, it is designed to
+# be easily embeddable into other systems of Makefiles.
+#
+DTC_SRCS = \
+       checks.c \
+       data.c \
+       dtc.c \
+       flattree.c \
+       fstree.c \
+       livetree.c \
+       srcpos.c \
+       treesource.c \
+       util.c
+
+DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c
+DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
new file mode 100644 (file)
index 0000000..afabf64
--- /dev/null
@@ -0,0 +1,1076 @@
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2007.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#include "dtc.h"
+
+#ifdef TRACE_CHECKS
+#define TRACE(c, ...) \
+       do { \
+               fprintf(stderr, "=== %s: ", (c)->name); \
+               fprintf(stderr, __VA_ARGS__); \
+               fprintf(stderr, "\n"); \
+       } while (0)
+#else
+#define TRACE(c, fmt, ...)     do { } while (0)
+#endif
+
+enum checkstatus {
+       UNCHECKED = 0,
+       PREREQ,
+       PASSED,
+       FAILED,
+};
+
+struct check;
+
+typedef void (*check_fn)(struct check *c, struct dt_info *dti, struct node *node);
+
+struct check {
+       const char *name;
+       check_fn fn;
+       void *data;
+       bool warn, error;
+       enum checkstatus status;
+       bool inprogress;
+       int num_prereqs;
+       struct check **prereq;
+};
+
+#define CHECK_ENTRY(_nm, _fn, _d, _w, _e, ...)        \
+       static struct check *_nm##_prereqs[] = { __VA_ARGS__ }; \
+       static struct check _nm = { \
+               .name = #_nm, \
+               .fn = (_fn), \
+               .data = (_d), \
+               .warn = (_w), \
+               .error = (_e), \
+               .status = UNCHECKED, \
+               .num_prereqs = ARRAY_SIZE(_nm##_prereqs), \
+               .prereq = _nm##_prereqs, \
+       };
+#define WARNING(_nm, _fn, _d, ...) \
+       CHECK_ENTRY(_nm, _fn, _d, true, false, __VA_ARGS__)
+#define ERROR(_nm, _fn, _d, ...) \
+       CHECK_ENTRY(_nm, _fn, _d, false, true, __VA_ARGS__)
+#define CHECK(_nm, _fn, _d, ...) \
+       CHECK_ENTRY(_nm, _fn, _d, false, false, __VA_ARGS__)
+
+static inline void  PRINTF(3, 4) check_msg(struct check *c, struct dt_info *dti,
+                                          const char *fmt, ...)
+{
+       va_list ap;
+       va_start(ap, fmt);
+
+       if ((c->warn && (quiet < 1))
+           || (c->error && (quiet < 2))) {
+               fprintf(stderr, "%s: %s (%s): ",
+                       strcmp(dti->outname, "-") ? dti->outname : "<stdout>",
+                       (c->error) ? "ERROR" : "Warning", c->name);
+               vfprintf(stderr, fmt, ap);
+               fprintf(stderr, "\n");
+       }
+       va_end(ap);
+}
+
+#define FAIL(c, dti, ...)                                              \
+       do {                                                            \
+               TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__);  \
+               (c)->status = FAILED;                                   \
+               check_msg((c), dti, __VA_ARGS__);                       \
+       } while (0)
+
+static void check_nodes_props(struct check *c, struct dt_info *dti, struct node *node)
+{
+       struct node *child;
+
+       TRACE(c, "%s", node->fullpath);
+       if (c->fn)
+               c->fn(c, dti, node);
+
+       for_each_child(node, child)
+               check_nodes_props(c, dti, child);
+}
+
+static bool run_check(struct check *c, struct dt_info *dti)
+{
+       struct node *dt = dti->dt;
+       bool error = false;
+       int i;
+
+       assert(!c->inprogress);
+
+       if (c->status != UNCHECKED)
+               goto out;
+
+       c->inprogress = true;
+
+       for (i = 0; i < c->num_prereqs; i++) {
+               struct check *prq = c->prereq[i];
+               error = error || run_check(prq, dti);
+               if (prq->status != PASSED) {
+                       c->status = PREREQ;
+                       check_msg(c, dti, "Failed prerequisite '%s'",
+                                 c->prereq[i]->name);
+               }
+       }
+
+       if (c->status != UNCHECKED)
+               goto out;
+
+       check_nodes_props(c, dti, dt);
+
+       if (c->status == UNCHECKED)
+               c->status = PASSED;
+
+       TRACE(c, "\tCompleted, status %d", c->status);
+
+out:
+       c->inprogress = false;
+       if ((c->status != PASSED) && (c->error))
+               error = true;
+       return error;
+}
+
+/*
+ * Utility check functions
+ */
+
+/* A check which always fails, for testing purposes only */
+static inline void check_always_fail(struct check *c, struct dt_info *dti,
+                                    struct node *node)
+{
+       FAIL(c, dti, "always_fail check");
+}
+CHECK(always_fail, check_always_fail, NULL);
+
+static void check_is_string(struct check *c, struct dt_info *dti,
+                           struct node *node)
+{
+       struct property *prop;
+       char *propname = c->data;
+
+       prop = get_property(node, propname);
+       if (!prop)
+               return; /* Not present, assumed ok */
+
+       if (!data_is_one_string(prop->val))
+               FAIL(c, dti, "\"%s\" property in %s is not a string",
+                    propname, node->fullpath);
+}
+#define WARNING_IF_NOT_STRING(nm, propname) \
+       WARNING(nm, check_is_string, (propname))
+#define ERROR_IF_NOT_STRING(nm, propname) \
+       ERROR(nm, check_is_string, (propname))
+
+static void check_is_cell(struct check *c, struct dt_info *dti,
+                         struct node *node)
+{
+       struct property *prop;
+       char *propname = c->data;
+
+       prop = get_property(node, propname);
+       if (!prop)
+               return; /* Not present, assumed ok */
+
+       if (prop->val.len != sizeof(cell_t))
+               FAIL(c, dti, "\"%s\" property in %s is not a single cell",
+                    propname, node->fullpath);
+}
+#define WARNING_IF_NOT_CELL(nm, propname) \
+       WARNING(nm, check_is_cell, (propname))
+#define ERROR_IF_NOT_CELL(nm, propname) \
+       ERROR(nm, check_is_cell, (propname))
+
+/*
+ * Structural check functions
+ */
+
+static void check_duplicate_node_names(struct check *c, struct dt_info *dti,
+                                      struct node *node)
+{
+       struct node *child, *child2;
+
+       for_each_child(node, child)
+               for (child2 = child->next_sibling;
+                    child2;
+                    child2 = child2->next_sibling)
+                       if (streq(child->name, child2->name))
+                               FAIL(c, dti, "Duplicate node name %s",
+                                    child->fullpath);
+}
+ERROR(duplicate_node_names, check_duplicate_node_names, NULL);
+
+static void check_duplicate_property_names(struct check *c, struct dt_info *dti,
+                                          struct node *node)
+{
+       struct property *prop, *prop2;
+
+       for_each_property(node, prop) {
+               for (prop2 = prop->next; prop2; prop2 = prop2->next) {
+                       if (prop2->deleted)
+                               continue;
+                       if (streq(prop->name, prop2->name))
+                               FAIL(c, dti, "Duplicate property name %s in %s",
+                                    prop->name, node->fullpath);
+               }
+       }
+}
+ERROR(duplicate_property_names, check_duplicate_property_names, NULL);
+
+#define LOWERCASE      "abcdefghijklmnopqrstuvwxyz"
+#define UPPERCASE      "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#define DIGITS         "0123456789"
+#define PROPNODECHARS  LOWERCASE UPPERCASE DIGITS ",._+*#?-"
+#define PROPNODECHARSSTRICT    LOWERCASE UPPERCASE DIGITS ",-"
+
+static void check_node_name_chars(struct check *c, struct dt_info *dti,
+                                 struct node *node)
+{
+       int n = strspn(node->name, c->data);
+
+       if (n < strlen(node->name))
+               FAIL(c, dti, "Bad character '%c' in node %s",
+                    node->name[n], node->fullpath);
+}
+ERROR(node_name_chars, check_node_name_chars, PROPNODECHARS "@");
+
+static void check_node_name_chars_strict(struct check *c, struct dt_info *dti,
+                                        struct node *node)
+{
+       int n = strspn(node->name, c->data);
+
+       if (n < node->basenamelen)
+               FAIL(c, dti, "Character '%c' not recommended in node %s",
+                    node->name[n], node->fullpath);
+}
+CHECK(node_name_chars_strict, check_node_name_chars_strict, PROPNODECHARSSTRICT);
+
+static void check_node_name_format(struct check *c, struct dt_info *dti,
+                                  struct node *node)
+{
+       if (strchr(get_unitname(node), '@'))
+               FAIL(c, dti, "Node %s has multiple '@' characters in name",
+                    node->fullpath);
+}
+ERROR(node_name_format, check_node_name_format, NULL, &node_name_chars);
+
+static void check_unit_address_vs_reg(struct check *c, struct dt_info *dti,
+                                     struct node *node)
+{
+       const char *unitname = get_unitname(node);
+       struct property *prop = get_property(node, "reg");
+
+       if (!prop) {
+               prop = get_property(node, "ranges");
+               if (prop && !prop->val.len)
+                       prop = NULL;
+       }
+
+       if (prop) {
+               if (!unitname[0])
+                       FAIL(c, dti, "Node %s has a reg or ranges property, but no unit name",
+                           node->fullpath);
+       } else {
+               if (unitname[0])
+                       FAIL(c, dti, "Node %s has a unit name, but no reg property",
+                           node->fullpath);
+       }
+}
+WARNING(unit_address_vs_reg, check_unit_address_vs_reg, NULL);
+
+static void check_property_name_chars(struct check *c, struct dt_info *dti,
+                                     struct node *node)
+{
+       struct property *prop;
+
+       for_each_property(node, prop) {
+               int n = strspn(prop->name, c->data);
+
+               if (n < strlen(prop->name))
+                       FAIL(c, dti, "Bad character '%c' in property name \"%s\", node %s",
+                            prop->name[n], prop->name, node->fullpath);
+       }
+}
+ERROR(property_name_chars, check_property_name_chars, PROPNODECHARS);
+
+static void check_property_name_chars_strict(struct check *c,
+                                            struct dt_info *dti,
+                                            struct node *node)
+{
+       struct property *prop;
+
+       for_each_property(node, prop) {
+               const char *name = prop->name;
+               int n = strspn(name, c->data);
+
+               if (n == strlen(prop->name))
+                       continue;
+
+               /* Certain names are whitelisted */
+               if (streq(name, "device_type"))
+                       continue;
+
+               /*
+                * # is only allowed at the beginning of property names not counting
+                * the vendor prefix.
+                */
+               if (name[n] == '#' && ((n == 0) || (name[n-1] == ','))) {
+                       name += n + 1;
+                       n = strspn(name, c->data);
+               }
+               if (n < strlen(name))
+                       FAIL(c, dti, "Character '%c' not recommended in property name \"%s\", node %s",
+                            name[n], prop->name, node->fullpath);
+       }
+}
+CHECK(property_name_chars_strict, check_property_name_chars_strict, PROPNODECHARSSTRICT);
+
+#define DESCLABEL_FMT  "%s%s%s%s%s"
+#define DESCLABEL_ARGS(node,prop,mark)         \
+       ((mark) ? "value of " : ""),            \
+       ((prop) ? "'" : ""), \
+       ((prop) ? (prop)->name : ""), \
+       ((prop) ? "' in " : ""), (node)->fullpath
+
+static void check_duplicate_label(struct check *c, struct dt_info *dti,
+                                 const char *label, struct node *node,
+                                 struct property *prop, struct marker *mark)
+{
+       struct node *dt = dti->dt;
+       struct node *othernode = NULL;
+       struct property *otherprop = NULL;
+       struct marker *othermark = NULL;
+
+       othernode = get_node_by_label(dt, label);
+
+       if (!othernode)
+               otherprop = get_property_by_label(dt, label, &othernode);
+       if (!othernode)
+               othermark = get_marker_label(dt, label, &othernode,
+                                              &otherprop);
+
+       if (!othernode)
+               return;
+
+       if ((othernode != node) || (otherprop != prop) || (othermark != mark))
+               FAIL(c, dti, "Duplicate label '%s' on " DESCLABEL_FMT
+                    " and " DESCLABEL_FMT,
+                    label, DESCLABEL_ARGS(node, prop, mark),
+                    DESCLABEL_ARGS(othernode, otherprop, othermark));
+}
+
+static void check_duplicate_label_node(struct check *c, struct dt_info *dti,
+                                      struct node *node)
+{
+       struct label *l;
+       struct property *prop;
+
+       for_each_label(node->labels, l)
+               check_duplicate_label(c, dti, l->label, node, NULL, NULL);
+
+       for_each_property(node, prop) {
+               struct marker *m = prop->val.markers;
+
+               for_each_label(prop->labels, l)
+                       check_duplicate_label(c, dti, l->label, node, prop, NULL);
+
+               for_each_marker_of_type(m, LABEL)
+                       check_duplicate_label(c, dti, m->ref, node, prop, m);
+       }
+}
+ERROR(duplicate_label, check_duplicate_label_node, NULL);
+
+static cell_t check_phandle_prop(struct check *c, struct dt_info *dti,
+                                struct node *node, const char *propname)
+{
+       struct node *root = dti->dt;
+       struct property *prop;
+       struct marker *m;
+       cell_t phandle;
+
+       prop = get_property(node, propname);
+       if (!prop)
+               return 0;
+
+       if (prop->val.len != sizeof(cell_t)) {
+               FAIL(c, dti, "%s has bad length (%d) %s property",
+                    node->fullpath, prop->val.len, prop->name);
+               return 0;
+       }
+
+       m = prop->val.markers;
+       for_each_marker_of_type(m, REF_PHANDLE) {
+               assert(m->offset == 0);
+               if (node != get_node_by_ref(root, m->ref))
+                       /* "Set this node's phandle equal to some
+                        * other node's phandle".  That's nonsensical
+                        * by construction. */ {
+                       FAIL(c, dti, "%s in %s is a reference to another node",
+                            prop->name, node->fullpath);
+               }
+               /* But setting this node's phandle equal to its own
+                * phandle is allowed - that means allocate a unique
+                * phandle for this node, even if it's not otherwise
+                * referenced.  The value will be filled in later, so
+                * we treat it as having no phandle data for now. */
+               return 0;
+       }
+
+       phandle = propval_cell(prop);
+
+       if ((phandle == 0) || (phandle == -1)) {
+               FAIL(c, dti, "%s has bad value (0x%x) in %s property",
+                    node->fullpath, phandle, prop->name);
+               return 0;
+       }
+
+       return phandle;
+}
+
+static void check_explicit_phandles(struct check *c, struct dt_info *dti,
+                                   struct node *node)
+{
+       struct node *root = dti->dt;
+       struct node *other;
+       cell_t phandle, linux_phandle;
+
+       /* Nothing should have assigned phandles yet */
+       assert(!node->phandle);
+
+       phandle = check_phandle_prop(c, dti, node, "phandle");
+
+       linux_phandle = check_phandle_prop(c, dti, node, "linux,phandle");
+
+       if (!phandle && !linux_phandle)
+               /* No valid phandles; nothing further to check */
+               return;
+
+       if (linux_phandle && phandle && (phandle != linux_phandle))
+               FAIL(c, dti, "%s has mismatching 'phandle' and 'linux,phandle'"
+                    " properties", node->fullpath);
+
+       if (linux_phandle && !phandle)
+               phandle = linux_phandle;
+
+       other = get_node_by_phandle(root, phandle);
+       if (other && (other != node)) {
+               FAIL(c, dti, "%s has duplicated phandle 0x%x (seen before at %s)",
+                    node->fullpath, phandle, other->fullpath);
+               return;
+       }
+
+       node->phandle = phandle;
+}
+ERROR(explicit_phandles, check_explicit_phandles, NULL);
+
+static void check_name_properties(struct check *c, struct dt_info *dti,
+                                 struct node *node)
+{
+       struct property **pp, *prop = NULL;
+
+       for (pp = &node->proplist; *pp; pp = &((*pp)->next))
+               if (streq((*pp)->name, "name")) {
+                       prop = *pp;
+                       break;
+               }
+
+       if (!prop)
+               return; /* No name property, that's fine */
+
+       if ((prop->val.len != node->basenamelen+1)
+           || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) {
+               FAIL(c, dti, "\"name\" property in %s is incorrect (\"%s\" instead"
+                    " of base node name)", node->fullpath, prop->val.val);
+       } else {
+               /* The name property is correct, and therefore redundant.
+                * Delete it */
+               *pp = prop->next;
+               free(prop->name);
+               data_free(prop->val);
+               free(prop);
+       }
+}
+ERROR_IF_NOT_STRING(name_is_string, "name");
+ERROR(name_properties, check_name_properties, NULL, &name_is_string);
+
+/*
+ * Reference fixup functions
+ */
+
+static void fixup_phandle_references(struct check *c, struct dt_info *dti,
+                                    struct node *node)
+{
+       struct node *dt = dti->dt;
+       struct property *prop;
+
+       for_each_property(node, prop) {
+               struct marker *m = prop->val.markers;
+               struct node *refnode;
+               cell_t phandle;
+
+               for_each_marker_of_type(m, REF_PHANDLE) {
+                       assert(m->offset + sizeof(cell_t) <= prop->val.len);
+
+                       refnode = get_node_by_ref(dt, m->ref);
+                       if (! refnode) {
+                               if (!(dti->dtsflags & DTSF_PLUGIN))
+                                       FAIL(c, dti, "Reference to non-existent node or "
+                                                       "label \"%s\"\n", m->ref);
+                               else /* mark the entry as unresolved */
+                                       *((fdt32_t *)(prop->val.val + m->offset)) =
+                                               cpu_to_fdt32(0xffffffff);
+                               continue;
+                       }
+
+                       phandle = get_node_phandle(dt, refnode);
+                       *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle);
+               }
+       }
+}
+ERROR(phandle_references, fixup_phandle_references, NULL,
+      &duplicate_node_names, &explicit_phandles);
+
+static void fixup_path_references(struct check *c, struct dt_info *dti,
+                                 struct node *node)
+{
+       struct node *dt = dti->dt;
+       struct property *prop;
+
+       for_each_property(node, prop) {
+               struct marker *m = prop->val.markers;
+               struct node *refnode;
+               char *path;
+
+               for_each_marker_of_type(m, REF_PATH) {
+                       assert(m->offset <= prop->val.len);
+
+                       refnode = get_node_by_ref(dt, m->ref);
+                       if (!refnode) {
+                               FAIL(c, dti, "Reference to non-existent node or label \"%s\"\n",
+                                    m->ref);
+                               continue;
+                       }
+
+                       path = refnode->fullpath;
+                       prop->val = data_insert_at_marker(prop->val, m, path,
+                                                         strlen(path) + 1);
+               }
+       }
+}
+ERROR(path_references, fixup_path_references, NULL, &duplicate_node_names);
+
+/*
+ * Semantic checks
+ */
+WARNING_IF_NOT_CELL(address_cells_is_cell, "#address-cells");
+WARNING_IF_NOT_CELL(size_cells_is_cell, "#size-cells");
+WARNING_IF_NOT_CELL(interrupt_cells_is_cell, "#interrupt-cells");
+
+WARNING_IF_NOT_STRING(device_type_is_string, "device_type");
+WARNING_IF_NOT_STRING(model_is_string, "model");
+WARNING_IF_NOT_STRING(status_is_string, "status");
+
+static void fixup_addr_size_cells(struct check *c, struct dt_info *dti,
+                                 struct node *node)
+{
+       struct property *prop;
+
+       node->addr_cells = -1;
+       node->size_cells = -1;
+
+       prop = get_property(node, "#address-cells");
+       if (prop)
+               node->addr_cells = propval_cell(prop);
+
+       prop = get_property(node, "#size-cells");
+       if (prop)
+               node->size_cells = propval_cell(prop);
+}
+WARNING(addr_size_cells, fixup_addr_size_cells, NULL,
+       &address_cells_is_cell, &size_cells_is_cell);
+
+#define node_addr_cells(n) \
+       (((n)->addr_cells == -1) ? 2 : (n)->addr_cells)
+#define node_size_cells(n) \
+       (((n)->size_cells == -1) ? 1 : (n)->size_cells)
+
+static void check_reg_format(struct check *c, struct dt_info *dti,
+                            struct node *node)
+{
+       struct property *prop;
+       int addr_cells, size_cells, entrylen;
+
+       prop = get_property(node, "reg");
+       if (!prop)
+               return; /* No "reg", that's fine */
+
+       if (!node->parent) {
+               FAIL(c, dti, "Root node has a \"reg\" property");
+               return;
+       }
+
+       if (prop->val.len == 0)
+               FAIL(c, dti, "\"reg\" property in %s is empty", node->fullpath);
+
+       addr_cells = node_addr_cells(node->parent);
+       size_cells = node_size_cells(node->parent);
+       entrylen = (addr_cells + size_cells) * sizeof(cell_t);
+
+       if (!entrylen || (prop->val.len % entrylen) != 0)
+               FAIL(c, dti, "\"reg\" property in %s has invalid length (%d bytes) "
+                    "(#address-cells == %d, #size-cells == %d)",
+                    node->fullpath, prop->val.len, addr_cells, size_cells);
+}
+WARNING(reg_format, check_reg_format, NULL, &addr_size_cells);
+
+static void check_ranges_format(struct check *c, struct dt_info *dti,
+                               struct node *node)
+{
+       struct property *prop;
+       int c_addr_cells, p_addr_cells, c_size_cells, p_size_cells, entrylen;
+
+       prop = get_property(node, "ranges");
+       if (!prop)
+               return;
+
+       if (!node->parent) {
+               FAIL(c, dti, "Root node has a \"ranges\" property");
+               return;
+       }
+
+       p_addr_cells = node_addr_cells(node->parent);
+       p_size_cells = node_size_cells(node->parent);
+       c_addr_cells = node_addr_cells(node);
+       c_size_cells = node_size_cells(node);
+       entrylen = (p_addr_cells + c_addr_cells + c_size_cells) * sizeof(cell_t);
+
+       if (prop->val.len == 0) {
+               if (p_addr_cells != c_addr_cells)
+                       FAIL(c, dti, "%s has empty \"ranges\" property but its "
+                            "#address-cells (%d) differs from %s (%d)",
+                            node->fullpath, c_addr_cells, node->parent->fullpath,
+                            p_addr_cells);
+               if (p_size_cells != c_size_cells)
+                       FAIL(c, dti, "%s has empty \"ranges\" property but its "
+                            "#size-cells (%d) differs from %s (%d)",
+                            node->fullpath, c_size_cells, node->parent->fullpath,
+                            p_size_cells);
+       } else if ((prop->val.len % entrylen) != 0) {
+               FAIL(c, dti, "\"ranges\" property in %s has invalid length (%d bytes) "
+                    "(parent #address-cells == %d, child #address-cells == %d, "
+                    "#size-cells == %d)", node->fullpath, prop->val.len,
+                    p_addr_cells, c_addr_cells, c_size_cells);
+       }
+}
+WARNING(ranges_format, check_ranges_format, NULL, &addr_size_cells);
+
+static const struct bus_type pci_bus = {
+       .name = "PCI",
+};
+
+static void check_pci_bridge(struct check *c, struct dt_info *dti, struct node *node)
+{
+       struct property *prop;
+       cell_t *cells;
+
+       prop = get_property(node, "device_type");
+       if (!prop || !streq(prop->val.val, "pci"))
+               return;
+
+       node->bus = &pci_bus;
+
+       if (!strneq(node->name, "pci", node->basenamelen) &&
+           !strneq(node->name, "pcie", node->basenamelen))
+               FAIL(c, dti, "Node %s node name is not \"pci\" or \"pcie\"",
+                            node->fullpath);
+
+       prop = get_property(node, "ranges");
+       if (!prop)
+               FAIL(c, dti, "Node %s missing ranges for PCI bridge (or not a bridge)",
+                            node->fullpath);
+
+       if (node_addr_cells(node) != 3)
+               FAIL(c, dti, "Node %s incorrect #address-cells for PCI bridge",
+                            node->fullpath);
+       if (node_size_cells(node) != 2)
+               FAIL(c, dti, "Node %s incorrect #size-cells for PCI bridge",
+                            node->fullpath);
+
+       prop = get_property(node, "bus-range");
+       if (!prop) {
+               FAIL(c, dti, "Node %s missing bus-range for PCI bridge",
+                            node->fullpath);
+               return;
+       }
+       if (prop->val.len != (sizeof(cell_t) * 2)) {
+               FAIL(c, dti, "Node %s bus-range must be 2 cells",
+                            node->fullpath);
+               return;
+       }
+       cells = (cell_t *)prop->val.val;
+       if (fdt32_to_cpu(cells[0]) > fdt32_to_cpu(cells[1]))
+               FAIL(c, dti, "Node %s bus-range 1st cell must be less than or equal to 2nd cell",
+                            node->fullpath);
+       if (fdt32_to_cpu(cells[1]) > 0xff)
+               FAIL(c, dti, "Node %s bus-range maximum bus number must be less than 256",
+                            node->fullpath);
+}
+WARNING(pci_bridge, check_pci_bridge, NULL,
+       &device_type_is_string, &addr_size_cells);
+
+static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, struct node *node)
+{
+       struct property *prop;
+       unsigned int bus_num, min_bus, max_bus;
+       cell_t *cells;
+
+       if (!node->parent || (node->parent->bus != &pci_bus))
+               return;
+
+       prop = get_property(node, "reg");
+       if (!prop)
+               return;
+
+       cells = (cell_t *)prop->val.val;
+       bus_num = (fdt32_to_cpu(cells[0]) & 0x00ff0000) >> 16;
+
+       prop = get_property(node->parent, "bus-range");
+       if (!prop) {
+               min_bus = max_bus = 0;
+       } else {
+               cells = (cell_t *)prop->val.val;
+               min_bus = fdt32_to_cpu(cells[0]);
+               max_bus = fdt32_to_cpu(cells[0]);
+       }
+       if ((bus_num < min_bus) || (bus_num > max_bus))
+               FAIL(c, dti, "Node %s PCI bus number %d out of range, expected (%d - %d)",
+                    node->fullpath, bus_num, min_bus, max_bus);
+}
+WARNING(pci_device_bus_num, check_pci_device_bus_num, NULL, &reg_format, &pci_bridge);
+
+static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct node *node)
+{
+       struct property *prop;
+       const char *unitname = get_unitname(node);
+       char unit_addr[5];
+       unsigned int dev, func, reg;
+       cell_t *cells;
+
+       if (!node->parent || (node->parent->bus != &pci_bus))
+               return;
+
+       prop = get_property(node, "reg");
+       if (!prop) {
+               FAIL(c, dti, "Node %s missing PCI reg property", node->fullpath);
+               return;
+       }
+
+       cells = (cell_t *)prop->val.val;
+       if (cells[1] || cells[2])
+               FAIL(c, dti, "Node %s PCI reg config space address cells 2 and 3 must be 0",
+                            node->fullpath);
+
+       reg = fdt32_to_cpu(cells[0]);
+       dev = (reg & 0xf800) >> 11;
+       func = (reg & 0x700) >> 8;
+
+       if (reg & 0xff000000)
+               FAIL(c, dti, "Node %s PCI reg address is not configuration space",
+                            node->fullpath);
+       if (reg & 0x000000ff)
+               FAIL(c, dti, "Node %s PCI reg config space address register number must be 0",
+                            node->fullpath);
+
+       if (func == 0) {
+               snprintf(unit_addr, sizeof(unit_addr), "%x", dev);
+               if (streq(unitname, unit_addr))
+                       return;
+       }
+
+       snprintf(unit_addr, sizeof(unit_addr), "%x,%x", dev, func);
+       if (streq(unitname, unit_addr))
+               return;
+
+       FAIL(c, dti, "Node %s PCI unit address format error, expected \"%s\"",
+            node->fullpath, unit_addr);
+}
+WARNING(pci_device_reg, check_pci_device_reg, NULL, &reg_format, &pci_bridge);
+
+static const struct bus_type simple_bus = {
+       .name = "simple-bus",
+};
+
+static bool node_is_compatible(struct node *node, const char *compat)
+{
+       struct property *prop;
+       const char *str, *end;
+
+       prop = get_property(node, "compatible");
+       if (!prop)
+               return false;
+
+       for (str = prop->val.val, end = str + prop->val.len; str < end;
+            str += strnlen(str, end - str) + 1) {
+               if (strneq(str, compat, end - str))
+                       return true;
+       }
+       return false;
+}
+
+static void check_simple_bus_bridge(struct check *c, struct dt_info *dti, struct node *node)
+{
+       if (node_is_compatible(node, "simple-bus"))
+               node->bus = &simple_bus;
+}
+WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL, &addr_size_cells);
+
+static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct node *node)
+{
+       struct property *prop;
+       const char *unitname = get_unitname(node);
+       char unit_addr[17];
+       unsigned int size;
+       uint64_t reg = 0;
+       cell_t *cells = NULL;
+
+       if (!node->parent || (node->parent->bus != &simple_bus))
+               return;
+
+       prop = get_property(node, "reg");
+       if (prop)
+               cells = (cell_t *)prop->val.val;
+       else {
+               prop = get_property(node, "ranges");
+               if (prop && prop->val.len)
+                       /* skip of child address */
+                       cells = ((cell_t *)prop->val.val) + node_addr_cells(node);
+       }
+
+       if (!cells) {
+               if (node->parent->parent && !(node->bus == &simple_bus))
+                       FAIL(c, dti, "Node %s missing or empty reg/ranges property", node->fullpath);
+               return;
+       }
+
+       size = node_addr_cells(node->parent);
+       while (size--)
+               reg = (reg << 32) | fdt32_to_cpu(*(cells++));
+
+       snprintf(unit_addr, sizeof(unit_addr), "%"PRIx64, reg);
+       if (!streq(unitname, unit_addr))
+               FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"",
+                    node->fullpath, unit_addr);
+}
+WARNING(simple_bus_reg, check_simple_bus_reg, NULL, &reg_format, &simple_bus_bridge);
+
+static void check_unit_address_format(struct check *c, struct dt_info *dti,
+                                     struct node *node)
+{
+       const char *unitname = get_unitname(node);
+
+       if (node->parent && node->parent->bus)
+               return;
+
+       if (!unitname[0])
+               return;
+
+       if (!strncmp(unitname, "0x", 2)) {
+               FAIL(c, dti, "Node %s unit name should not have leading \"0x\"",
+                   node->fullpath);
+               /* skip over 0x for next test */
+               unitname += 2;
+       }
+       if (unitname[0] == '0' && isxdigit(unitname[1]))
+               FAIL(c, dti, "Node %s unit name should not have leading 0s",
+                   node->fullpath);
+}
+WARNING(unit_address_format, check_unit_address_format, NULL,
+       &node_name_format, &pci_bridge, &simple_bus_bridge);
+
+/*
+ * Style checks
+ */
+static void check_avoid_default_addr_size(struct check *c, struct dt_info *dti,
+                                         struct node *node)
+{
+       struct property *reg, *ranges;
+
+       if (!node->parent)
+               return; /* Ignore root node */
+
+       reg = get_property(node, "reg");
+       ranges = get_property(node, "ranges");
+
+       if (!reg && !ranges)
+               return;
+
+       if (node->parent->addr_cells == -1)
+               FAIL(c, dti, "Relying on default #address-cells value for %s",
+                    node->fullpath);
+
+       if (node->parent->size_cells == -1)
+               FAIL(c, dti, "Relying on default #size-cells value for %s",
+                    node->fullpath);
+}
+WARNING(avoid_default_addr_size, check_avoid_default_addr_size, NULL,
+       &addr_size_cells);
+
+static void check_obsolete_chosen_interrupt_controller(struct check *c,
+                                                      struct dt_info *dti,
+                                                      struct node *node)
+{
+       struct node *dt = dti->dt;
+       struct node *chosen;
+       struct property *prop;
+
+       if (node != dt)
+               return;
+
+
+       chosen = get_node_by_path(dt, "/chosen");
+       if (!chosen)
+               return;
+
+       prop = get_property(chosen, "interrupt-controller");
+       if (prop)
+               FAIL(c, dti, "/chosen has obsolete \"interrupt-controller\" "
+                    "property");
+}
+WARNING(obsolete_chosen_interrupt_controller,
+       check_obsolete_chosen_interrupt_controller, NULL);
+
+static struct check *check_table[] = {
+       &duplicate_node_names, &duplicate_property_names,
+       &node_name_chars, &node_name_format, &property_name_chars,
+       &name_is_string, &name_properties,
+
+       &duplicate_label,
+
+       &explicit_phandles,
+       &phandle_references, &path_references,
+
+       &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell,
+       &device_type_is_string, &model_is_string, &status_is_string,
+
+       &property_name_chars_strict,
+       &node_name_chars_strict,
+
+       &addr_size_cells, &reg_format, &ranges_format,
+
+       &unit_address_vs_reg,
+       &unit_address_format,
+
+       &pci_bridge,
+       &pci_device_reg,
+       &pci_device_bus_num,
+
+       &simple_bus_bridge,
+       &simple_bus_reg,
+
+       &avoid_default_addr_size,
+       &obsolete_chosen_interrupt_controller,
+
+       &always_fail,
+};
+
+static void enable_warning_error(struct check *c, bool warn, bool error)
+{
+       int i;
+
+       /* Raising level, also raise it for prereqs */
+       if ((warn && !c->warn) || (error && !c->error))
+               for (i = 0; i < c->num_prereqs; i++)
+                       enable_warning_error(c->prereq[i], warn, error);
+
+       c->warn = c->warn || warn;
+       c->error = c->error || error;
+}
+
+static void disable_warning_error(struct check *c, bool warn, bool error)
+{
+       int i;
+
+       /* Lowering level, also lower it for things this is the prereq
+        * for */
+       if ((warn && c->warn) || (error && c->error)) {
+               for (i = 0; i < ARRAY_SIZE(check_table); i++) {
+                       struct check *cc = check_table[i];
+                       int j;
+
+                       for (j = 0; j < cc->num_prereqs; j++)
+                               if (cc->prereq[j] == c)
+                                       disable_warning_error(cc, warn, error);
+               }
+       }
+
+       c->warn = c->warn && !warn;
+       c->error = c->error && !error;
+}
+
+void parse_checks_option(bool warn, bool error, const char *arg)
+{
+       int i;
+       const char *name = arg;
+       bool enable = true;
+
+       if ((strncmp(arg, "no-", 3) == 0)
+           || (strncmp(arg, "no_", 3) == 0)) {
+               name = arg + 3;
+               enable = false;
+       }
+
+       for (i = 0; i < ARRAY_SIZE(check_table); i++) {
+               struct check *c = check_table[i];
+
+               if (streq(c->name, name)) {
+                       if (enable)
+                               enable_warning_error(c, warn, error);
+                       else
+                               disable_warning_error(c, warn, error);
+                       return;
+               }
+       }
+
+       die("Unrecognized check name \"%s\"\n", name);
+}
+
+void process_checks(bool force, struct dt_info *dti)
+{
+       int i;
+       int error = 0;
+
+       for (i = 0; i < ARRAY_SIZE(check_table); i++) {
+               struct check *c = check_table[i];
+
+               if (c->warn || c->error)
+                       error = error || run_check(c, dti);
+       }
+
+       if (error) {
+               if (!force) {
+                       fprintf(stderr, "ERROR: Input tree has errors, aborting "
+                               "(use -f to force output)\n");
+                       exit(2);
+               } else if (quiet < 3) {
+                       fprintf(stderr, "Warning: Input tree has errors, "
+                               "output forced\n");
+               }
+       }
+}
diff --git a/scripts/dtc/data.c b/scripts/dtc/data.c
new file mode 100644 (file)
index 0000000..aa37a16
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#include "dtc.h"
+
+void data_free(struct data d)
+{
+       struct marker *m, *nm;
+
+       m = d.markers;
+       while (m) {
+               nm = m->next;
+               free(m->ref);
+               free(m);
+               m = nm;
+       }
+
+       if (d.val)
+               free(d.val);
+}
+
+struct data data_grow_for(struct data d, int xlen)
+{
+       struct data nd;
+       int newsize;
+
+       if (xlen == 0)
+               return d;
+
+       nd = d;
+
+       newsize = xlen;
+
+       while ((d.len + xlen) > newsize)
+               newsize *= 2;
+
+       nd.val = xrealloc(d.val, newsize);
+
+       return nd;
+}
+
+struct data data_copy_mem(const char *mem, int len)
+{
+       struct data d;
+
+       d = data_grow_for(empty_data, len);
+
+       d.len = len;
+       memcpy(d.val, mem, len);
+
+       return d;
+}
+
+struct data data_copy_escape_string(const char *s, int len)
+{
+       int i = 0;
+       struct data d;
+       char *q;
+
+       d = data_grow_for(empty_data, len + 1);
+
+       q = d.val;
+       while (i < len) {
+               char c = s[i++];
+
+               if (c == '\\')
+                       c = get_escape_char(s, &i);
+
+               q[d.len++] = c;
+       }
+
+       q[d.len++] = '\0';
+       return d;
+}
+
+struct data data_copy_file(FILE *f, size_t maxlen)
+{
+       struct data d = empty_data;
+
+       while (!feof(f) && (d.len < maxlen)) {
+               size_t chunksize, ret;
+
+               if (maxlen == -1)
+                       chunksize = 4096;
+               else
+                       chunksize = maxlen - d.len;
+
+               d = data_grow_for(d, chunksize);
+               ret = fread(d.val + d.len, 1, chunksize, f);
+
+               if (ferror(f))
+                       die("Error reading file into data: %s", strerror(errno));
+
+               if (d.len + ret < d.len)
+                       die("Overflow reading file into data\n");
+
+               d.len += ret;
+       }
+
+       return d;
+}
+
+struct data data_append_data(struct data d, const void *p, int len)
+{
+       d = data_grow_for(d, len);
+       memcpy(d.val + d.len, p, len);
+       d.len += len;
+       return d;
+}
+
+struct data data_insert_at_marker(struct data d, struct marker *m,
+                                 const void *p, int len)
+{
+       d = data_grow_for(d, len);
+       memmove(d.val + m->offset + len, d.val + m->offset, d.len - m->offset);
+       memcpy(d.val + m->offset, p, len);
+       d.len += len;
+
+       /* Adjust all markers after the one we're inserting at */
+       m = m->next;
+       for_each_marker(m)
+               m->offset += len;
+       return d;
+}
+
+static struct data data_append_markers(struct data d, struct marker *m)
+{
+       struct marker **mp = &d.markers;
+
+       /* Find the end of the markerlist */
+       while (*mp)
+               mp = &((*mp)->next);
+       *mp = m;
+       return d;
+}
+
+struct data data_merge(struct data d1, struct data d2)
+{
+       struct data d;
+       struct marker *m2 = d2.markers;
+
+       d = data_append_markers(data_append_data(d1, d2.val, d2.len), m2);
+
+       /* Adjust for the length of d1 */
+       for_each_marker(m2)
+               m2->offset += d1.len;
+
+       d2.markers = NULL; /* So data_free() doesn't clobber them */
+       data_free(d2);
+
+       return d;
+}
+
+struct data data_append_integer(struct data d, uint64_t value, int bits)
+{
+       uint8_t value_8;
+       fdt16_t value_16;
+       fdt32_t value_32;
+       fdt64_t value_64;
+
+       switch (bits) {
+       case 8:
+               value_8 = value;
+               return data_append_data(d, &value_8, 1);
+
+       case 16:
+               value_16 = cpu_to_fdt16(value);
+               return data_append_data(d, &value_16, 2);
+
+       case 32:
+               value_32 = cpu_to_fdt32(value);
+               return data_append_data(d, &value_32, 4);
+
+       case 64:
+               value_64 = cpu_to_fdt64(value);
+               return data_append_data(d, &value_64, 8);
+
+       default:
+               die("Invalid literal size (%d)\n", bits);
+       }
+}
+
+struct data data_append_re(struct data d, uint64_t address, uint64_t size)
+{
+       struct fdt_reserve_entry re;
+
+       re.address = cpu_to_fdt64(address);
+       re.size = cpu_to_fdt64(size);
+
+       return data_append_data(d, &re, sizeof(re));
+}
+
+struct data data_append_cell(struct data d, cell_t word)
+{
+       return data_append_integer(d, word, sizeof(word) * 8);
+}
+
+struct data data_append_addr(struct data d, uint64_t addr)
+{
+       return data_append_integer(d, addr, sizeof(addr) * 8);
+}
+
+struct data data_append_byte(struct data d, uint8_t byte)
+{
+       return data_append_data(d, &byte, 1);
+}
+
+struct data data_append_zeroes(struct data d, int len)
+{
+       d = data_grow_for(d, len);
+
+       memset(d.val + d.len, 0, len);
+       d.len += len;
+       return d;
+}
+
+struct data data_append_align(struct data d, int align)
+{
+       int newlen = ALIGN(d.len, align);
+       return data_append_zeroes(d, newlen - d.len);
+}
+
+struct data data_add_marker(struct data d, enum markertype type, char *ref)
+{
+       struct marker *m;
+
+       m = xmalloc(sizeof(*m));
+       m->offset = d.len;
+       m->type = type;
+       m->ref = ref;
+       m->next = NULL;
+
+       return data_append_markers(d, m);
+}
+
+bool data_is_one_string(struct data d)
+{
+       int i;
+       int len = d.len;
+
+       if (len == 0)
+               return false;
+
+       for (i = 0; i < len-1; i++)
+               if (d.val[i] == '\0')
+                       return false;
+
+       if (d.val[len-1] != '\0')
+               return false;
+
+       return true;
+}
diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
new file mode 100644 (file)
index 0000000..fd825eb
--- /dev/null
@@ -0,0 +1,306 @@
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+%option noyywrap nounput noinput never-interactive
+
+%x BYTESTRING
+%x PROPNODENAME
+%s V1
+
+PROPNODECHAR   [a-zA-Z0-9,._+*#?@-]
+PATHCHAR       ({PROPNODECHAR}|[/])
+LABEL          [a-zA-Z_][a-zA-Z0-9_]*
+STRING         \"([^\\"]|\\.)*\"
+CHAR_LITERAL   '([^']|\\')*'
+WS             [[:space:]]
+COMMENT                "/*"([^*]|\*+[^*/])*\*+"/"
+LINECOMMENT    "//".*\n
+
+%{
+#include "dtc.h"
+#include "srcpos.h"
+#include "dtc-parser.tab.h"
+
+YYLTYPE yylloc;
+extern bool treesource_error;
+
+/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
+#define        YY_USER_ACTION \
+       { \
+               srcpos_update(&yylloc, yytext, yyleng); \
+       }
+
+/*#define LEXDEBUG     1*/
+
+#ifdef LEXDEBUG
+#define DPRINT(fmt, ...)       fprintf(stderr, fmt, ##__VA_ARGS__)
+#else
+#define DPRINT(fmt, ...)       do { } while (0)
+#endif
+
+static int dts_version = 1;
+
+#define BEGIN_DEFAULT()                DPRINT("<V1>\n"); \
+                               BEGIN(V1); \
+
+static void push_input_file(const char *filename);
+static bool pop_input_file(void);
+static void PRINTF(1, 2) lexical_error(const char *fmt, ...);
+
+%}
+
+%%
+<*>"/include/"{WS}*{STRING} {
+                       char *name = strchr(yytext, '\"') + 1;
+                       yytext[yyleng-1] = '\0';
+                       push_input_file(name);
+               }
+
+<*>^"#"(line)?[ \t]+[0-9]+[ \t]+{STRING}([ \t]+[0-9]+)? {
+                       char *line, *fnstart, *fnend;
+                       struct data fn;
+                       /* skip text before line # */
+                       line = yytext;
+                       while (!isdigit((unsigned char)*line))
+                               line++;
+
+                       /* regexp ensures that first and list "
+                        * in the whole yytext are those at
+                        * beginning and end of the filename string */
+                       fnstart = memchr(yytext, '"', yyleng);
+                       for (fnend = yytext + yyleng - 1;
+                            *fnend != '"'; fnend--)
+                               ;
+                       assert(fnstart && fnend && (fnend > fnstart));
+
+                       fn = data_copy_escape_string(fnstart + 1,
+                                                    fnend - fnstart - 1);
+
+                       /* Don't allow nuls in filenames */
+                       if (memchr(fn.val, '\0', fn.len - 1))
+                               lexical_error("nul in line number directive");
+
+                       /* -1 since #line is the number of the next line */
+                       srcpos_set_line(xstrdup(fn.val), atoi(line) - 1);
+                       data_free(fn);
+               }
+
+<*><<EOF>>             {
+                       if (!pop_input_file()) {
+                               yyterminate();
+                       }
+               }
+
+<*>{STRING}    {
+                       DPRINT("String: %s\n", yytext);
+                       yylval.data = data_copy_escape_string(yytext+1,
+                                       yyleng-2);
+                       return DT_STRING;
+               }
+
+<*>"/dts-v1/"  {
+                       DPRINT("Keyword: /dts-v1/\n");
+                       dts_version = 1;
+                       BEGIN_DEFAULT();
+                       return DT_V1;
+               }
+
+<*>"/plugin/"  {
+                       DPRINT("Keyword: /plugin/\n");
+                       return DT_PLUGIN;
+               }
+
+<*>"/memreserve/"      {
+                       DPRINT("Keyword: /memreserve/\n");
+                       BEGIN_DEFAULT();
+                       return DT_MEMRESERVE;
+               }
+
+<*>"/bits/"    {
+                       DPRINT("Keyword: /bits/\n");
+                       BEGIN_DEFAULT();
+                       return DT_BITS;
+               }
+
+<*>"/delete-property/" {
+                       DPRINT("Keyword: /delete-property/\n");
+                       DPRINT("<PROPNODENAME>\n");
+                       BEGIN(PROPNODENAME);
+                       return DT_DEL_PROP;
+               }
+
+<*>"/delete-node/"     {
+                       DPRINT("Keyword: /delete-node/\n");
+                       DPRINT("<PROPNODENAME>\n");
+                       BEGIN(PROPNODENAME);
+                       return DT_DEL_NODE;
+               }
+
+<*>{LABEL}:    {
+                       DPRINT("Label: %s\n", yytext);
+                       yylval.labelref = xstrdup(yytext);
+                       yylval.labelref[yyleng-1] = '\0';
+                       return DT_LABEL;
+               }
+
+<V1>([0-9]+|0[xX][0-9a-fA-F]+)(U|L|UL|LL|ULL)? {
+                       char *e;
+                       DPRINT("Integer Literal: '%s'\n", yytext);
+
+                       errno = 0;
+                       yylval.integer = strtoull(yytext, &e, 0);
+
+                       if (*e && e[strspn(e, "UL")]) {
+                               lexical_error("Bad integer literal '%s'",
+                                             yytext);
+                       }
+
+                       if (errno == ERANGE)
+                               lexical_error("Integer literal '%s' out of range",
+                                             yytext);
+                       else
+                               /* ERANGE is the only strtoull error triggerable
+                                *  by strings matching the pattern */
+                               assert(errno == 0);
+                       return DT_LITERAL;
+               }
+
+<*>{CHAR_LITERAL}      {
+                       struct data d;
+                       DPRINT("Character literal: %s\n", yytext);
+
+                       d = data_copy_escape_string(yytext+1, yyleng-2);
+                       if (d.len == 1) {
+                               lexical_error("Empty character literal");
+                               yylval.integer = 0;
+                       } else {
+                               yylval.integer = (unsigned char)d.val[0];
+
+                               if (d.len > 2)
+                                       lexical_error("Character literal has %d"
+                                                     " characters instead of 1",
+                                                     d.len - 1);
+                       }
+
+                       data_free(d);
+                       return DT_CHAR_LITERAL;
+               }
+
+<*>\&{LABEL}   {       /* label reference */
+                       DPRINT("Ref: %s\n", yytext+1);
+                       yylval.labelref = xstrdup(yytext+1);
+                       return DT_REF;
+               }
+
+<*>"&{/"{PATHCHAR}*\}  {       /* new-style path reference */
+                       yytext[yyleng-1] = '\0';
+                       DPRINT("Ref: %s\n", yytext+2);
+                       yylval.labelref = xstrdup(yytext+2);
+                       return DT_REF;
+               }
+
+<BYTESTRING>[0-9a-fA-F]{2} {
+                       yylval.byte = strtol(yytext, NULL, 16);
+                       DPRINT("Byte: %02x\n", (int)yylval.byte);
+                       return DT_BYTE;
+               }
+
+<BYTESTRING>"]"        {
+                       DPRINT("/BYTESTRING\n");
+                       BEGIN_DEFAULT();
+                       return ']';
+               }
+
+<PROPNODENAME>\\?{PROPNODECHAR}+ {
+                       DPRINT("PropNodeName: %s\n", yytext);
+                       yylval.propnodename = xstrdup((yytext[0] == '\\') ?
+                                                       yytext + 1 : yytext);
+                       BEGIN_DEFAULT();
+                       return DT_PROPNODENAME;
+               }
+
+"/incbin/"     {
+                       DPRINT("Binary Include\n");
+                       return DT_INCBIN;
+               }
+
+<*>{WS}+       /* eat whitespace */
+<*>{COMMENT}+  /* eat C-style comments */
+<*>{LINECOMMENT}+ /* eat C++-style comments */
+
+<*>"<<"                { return DT_LSHIFT; };
+<*>">>"                { return DT_RSHIFT; };
+<*>"<="                { return DT_LE; };
+<*>">="                { return DT_GE; };
+<*>"=="                { return DT_EQ; };
+<*>"!="                { return DT_NE; };
+<*>"&&"                { return DT_AND; };
+<*>"||"                { return DT_OR; };
+
+<*>.           {
+                       DPRINT("Char: %c (\\x%02x)\n", yytext[0],
+                               (unsigned)yytext[0]);
+                       if (yytext[0] == '[') {
+                               DPRINT("<BYTESTRING>\n");
+                               BEGIN(BYTESTRING);
+                       }
+                       if ((yytext[0] == '{')
+                           || (yytext[0] == ';')) {
+                               DPRINT("<PROPNODENAME>\n");
+                               BEGIN(PROPNODENAME);
+                       }
+                       return yytext[0];
+               }
+
+%%
+
+static void push_input_file(const char *filename)
+{
+       assert(filename);
+
+       srcfile_push(filename);
+
+       yyin = current_srcfile->f;
+
+       yypush_buffer_state(yy_create_buffer(yyin, YY_BUF_SIZE));
+}
+
+
+static bool pop_input_file(void)
+{
+       if (srcfile_pop() == 0)
+               return false;
+
+       yypop_buffer_state();
+       yyin = current_srcfile->f;
+
+       return true;
+}
+
+static void lexical_error(const char *fmt, ...)
+{
+       va_list ap;
+
+       va_start(ap, fmt);
+       srcpos_verror(&yylloc, "Lexical error", fmt, ap);
+       va_end(ap);
+
+       treesource_error = true;
+}
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
new file mode 100644 (file)
index 0000000..3934d86
--- /dev/null
@@ -0,0 +1,2255 @@
+#line 2 "dtc-lexer.lex.c"
+
+#line 4 "dtc-lexer.lex.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else  /* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN (yy_start) = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START (((yy_start) - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart(yyin  )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int yyleng;
+
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               *yy_cp = (yy_hold_char); \
+               YY_RESTORE_YY_MORE_OFFSET \
+               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+               YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+               } \
+       while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr)  )
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+       {
+       FILE *yy_input_file;
+
+       char *yy_ch_buf;                /* input buffer */
+       char *yy_buf_pos;               /* current position in input buffer */
+
+       /* Size of input buffer in bytes, not including room for EOB
+        * characters.
+        */
+       yy_size_t yy_buf_size;
+
+       /* Number of characters read into yy_ch_buf, not including EOB
+        * characters.
+        */
+       int yy_n_chars;
+
+       /* Whether we "own" the buffer - i.e., we know we created it,
+        * and can realloc() it to grow it, and should free() it to
+        * delete it.
+        */
+       int yy_is_our_buffer;
+
+       /* Whether this is an "interactive" input source; if so, and
+        * if we're using stdio for input, then we want to use getc()
+        * instead of fread(), to make sure we stop fetching input after
+        * each newline.
+        */
+       int yy_is_interactive;
+
+       /* Whether we're considered to be at the beginning of a line.
+        * If so, '^' rules will be active on the next match, otherwise
+        * not.
+        */
+       int yy_at_bol;
+
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
+       /* Whether to try to fill the input buffer when we reach the
+        * end of it.
+        */
+       int yy_fill_buffer;
+
+       int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+       /* When an EOF's been seen but there's still some text to process
+        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+        * shouldn't try reading from the input source any more.  We might
+        * still have a bunch of tokens to match, though, because of
+        * possible backing-up.
+        *
+        * When we actually see the EOF, we change the status to "new"
+        * (via yyrestart()), so that the user can continue scanning by
+        * just pointing yyin at a new input file.
+        */
+#define YY_BUFFER_EOF_PENDING 2
+
+       };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+static int yy_n_chars;         /* number of characters read into yy_ch_buf */
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 0;                /* whether we need to initialize */
+static int yy_start = 0;       /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart (FILE *input_file  );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
+void yy_delete_buffer (YY_BUFFER_STATE b  );
+void yy_flush_buffer (YY_BUFFER_STATE b  );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void yypop_buffer_state (void );
+
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
+
+void *yyalloc (yy_size_t  );
+void *yyrealloc (void *,yy_size_t  );
+void yyfree (void *  );
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+       }
+
+#define yy_set_bol(at_bol) \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+       }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+#define yywrap(n) 1
+#define YY_SKIP_YYWRAP
+
+typedef unsigned char YY_CHAR;
+
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+typedef int yy_state_type;
+
+extern int yylineno;
+
+int yylineno = 1;
+
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[]  );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+       (yytext_ptr) = yy_bp; \
+       yyleng = (size_t) (yy_cp - yy_bp); \
+       (yy_hold_char) = *yy_cp; \
+       *yy_cp = '\0'; \
+       (yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 31
+#define YY_END_OF_BUFFER 32
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+       {
+       flex_int32_t yy_verify;
+       flex_int32_t yy_nxt;
+       };
+static yyconst flex_int16_t yy_accept[166] =
+    {   0,
+        0,    0,    0,    0,    0,    0,    0,    0,   32,   30,
+       19,   19,   30,   30,   30,   30,   30,   30,   30,   30,
+       30,   30,   30,   30,   30,   30,   16,   17,   17,   30,
+       17,   11,   11,   19,   27,    0,    3,    0,   28,   13,
+        0,    0,   12,    0,    0,    0,    0,    0,    0,    0,
+        0,   22,   24,   26,   25,   23,    0,   10,   29,    0,
+        0,    0,   15,   15,   17,   17,   17,   11,   11,   11,
+        0,   13,    0,   12,    0,    0,    0,   21,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   17,   11,   11,
+       11,    0,   14,   20,    0,    0,    0,    0,    0,    0,
+
+        0,    0,    0,    0,   17,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,   17,    7,    0,    0,    0,
+        0,    0,    0,    0,    2,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    4,   18,    0,    0,    5,    2,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    1,    0,    0,    0,    0,    6,    9,    0,
+        0,    0,    0,    8,    0
+    } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        4,    4,    4,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    5,    6,    7,    1,    1,    8,    9,    1,
+        1,   10,   11,   11,   12,   11,   13,   14,   15,   16,
+       16,   16,   16,   16,   16,   16,   16,   17,    1,   18,
+       19,   20,   11,   11,   21,   21,   21,   21,   21,   21,
+       22,   22,   22,   22,   22,   23,   22,   22,   22,   22,
+       22,   22,   22,   22,   24,   22,   22,   25,   22,   22,
+        1,   26,   27,    1,   22,    1,   21,   28,   29,   30,
+
+       31,   21,   32,   22,   33,   22,   22,   34,   35,   36,
+       37,   38,   22,   39,   40,   41,   42,   43,   22,   25,
+       44,   22,   45,   46,   47,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst flex_int32_t yy_meta[48] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    2,    3,    1,    2,
+        2,    2,    4,    5,    5,    5,    6,    1,    1,    1,
+        7,    8,    8,    8,    8,    1,    1,    7,    7,    7,
+        7,    8,    8,    8,    8,    8,    8,    8,    8,    8,
+        8,    8,    8,    8,    3,    1,    4
+    } ;
+
+static yyconst flex_int16_t yy_base[180] =
+    {   0,
+        0,  393,   35,  392,   66,  391,   38,  107,  397,  401,
+       55,  113,  377,  112,  111,  111,  114,   42,  376,  106,
+      377,  347,  126,  120,    0,  147,  401,    0,  124,    0,
+      137,  158,  170,  163,  401,  153,  401,  389,  401,    0,
+      378,  120,  401,  131,  380,  386,  355,  139,  351,  355,
+      351,  401,  401,  401,  401,  401,  367,  401,  401,  185,
+      350,  346,  401,  364,    0,  185,  347,  189,  356,  355,
+        0,    0,  330,  180,  366,  141,  372,  361,  332,  338,
+      331,  341,  334,  326,  205,  331,  337,  329,  401,  341,
+      167,  316,  401,  349,  348,  320,  328,  346,  180,  318,
+
+      324,  209,  324,  320,  322,  342,  338,  309,  306,  315,
+      305,  315,  312,  192,  342,  341,  401,  293,  306,  282,
+      268,  252,  255,  203,  285,  282,  272,  268,  252,  233,
+      232,  239,  208,  107,  401,  401,  238,  211,  401,  211,
+      212,  208,  228,  203,  215,  207,  233,  222,  212,  211,
+      203,  227,  401,  237,  225,  204,  185,  401,  401,  149,
+      128,   88,   42,  401,  401,  253,  259,  267,  271,  275,
+      281,  288,  292,  300,  308,  312,  318,  326,  334
+    } ;
+
+static yyconst flex_int16_t yy_def[180] =
+    {   0,
+      165,    1,    1,    3,  165,    5,    1,    1,  165,  165,
+      165,  165,  165,  166,  167,  168,  165,  165,  165,  165,
+      169,  165,  165,  165,  170,  169,  165,  171,  172,  171,
+      171,  165,  165,  165,  165,  166,  165,  166,  165,  173,
+      165,  168,  165,  168,  174,  175,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  169,  165,  165,  165,
+      165,  165,  165,  169,  171,  172,  171,  165,  165,  165,
+      176,  173,  177,  168,  174,  174,  175,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  171,  165,  165,
+      176,  177,  165,  165,  165,  165,  165,  165,  165,  165,
+
+      165,  165,  165,  165,  171,  165,  165,  165,  165,  165,
+      165,  165,  165,  178,  165,  171,  165,  165,  165,  165,
+      165,  165,  165,  178,  165,  178,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  179,  165,  165,
+      165,  179,  165,  179,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,    0,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165,  165
+    } ;
+
+static yyconst flex_int16_t yy_nxt[449] =
+    {   0,
+       10,   11,   12,   11,   13,   14,   10,   15,   16,   10,
+       10,   10,   17,   10,   10,   10,   10,   18,   19,   20,
+       21,   21,   21,   21,   21,   10,   10,   21,   21,   21,
+       21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
+       21,   21,   21,   21,   10,   22,   10,   24,   25,   25,
+       25,   32,   33,   33,  164,   26,   34,   34,   34,   52,
+       53,   27,   26,   26,   26,   26,   10,   11,   12,   11,
+       13,   14,   28,   15,   16,   28,   28,   28,   24,   28,
+       28,   28,   10,   18,   19,   20,   29,   29,   29,   29,
+       29,   30,   10,   29,   29,   29,   29,   29,   29,   29,
+
+       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
+       10,   22,   10,   23,   34,   34,   34,   37,   39,   43,
+       32,   33,   33,   45,   55,   56,   46,   60,   43,   45,
+       65,  163,   46,   65,   65,   65,   44,   38,   60,   74,
+       58,   47,  141,   48,  142,   44,   49,   47,   50,   48,
+       76,   51,   62,   94,   50,   41,   44,   51,   37,   61,
+       64,   64,   64,   58,   34,   34,   34,   64,  162,   80,
+       67,   68,   68,   68,   64,   64,   64,   64,   38,   81,
+       69,   70,   71,   68,   68,   68,   60,  161,   43,   69,
+       70,   65,   69,   70,   65,   65,   65,  125,   85,   85,
+
+       85,   58,   68,   68,   68,   44,  102,  110,  125,  133,
+      102,   69,   70,  111,  114,  160,  159,  126,   85,   85,
+       85,  140,  140,  140,  140,  140,  140,  153,  126,  147,
+      147,  147,  153,  148,  147,  147,  147,  158,  148,  165,
+      157,  156,  155,  151,  150,  149,  146,  154,  145,  144,
+      143,  139,  154,   36,   36,   36,   36,   36,   36,   36,
+       36,   40,  138,  137,  136,   40,   40,   42,   42,   42,
+       42,   42,   42,   42,   42,   57,   57,   57,   57,   63,
+      135,   63,   65,  134,  165,   65,  133,   65,   65,   66,
+      132,  131,   66,   66,   66,   66,   72,  130,   72,   72,
+
+       75,   75,   75,   75,   75,   75,   75,   75,   77,   77,
+       77,   77,   77,   77,   77,   77,   91,  129,   91,   92,
+      128,   92,   92,  127,   92,   92,  124,  124,  124,  124,
+      124,  124,  124,  124,  152,  152,  152,  152,  152,  152,
+      152,  152,   60,   60,  123,  122,  121,  120,  119,  118,
+      117,   45,  116,  111,  115,  113,  112,  109,  108,  107,
+       46,  106,   93,   89,  105,  104,  103,  101,  100,   99,
+       98,   97,   96,   95,   78,   76,   93,   90,   89,   88,
+       58,   87,   86,   58,   84,   83,   82,   79,   78,   76,
+       73,  165,   59,   58,   54,   35,  165,   31,   23,   23,
+
+        9,  165,  165,  165,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165
+    } ;
+
+static yyconst flex_int16_t yy_chk[449] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    3,    3,    3,
+        3,    7,    7,    7,  163,    3,   11,   11,   11,   18,
+       18,    3,    3,    3,    3,    3,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    8,   12,   12,   12,   14,   15,   16,
+        8,    8,    8,   17,   20,   20,   17,   23,   42,   24,
+       29,  162,   24,   29,   29,   29,   16,   14,   31,   44,
+       29,   17,  134,   17,  134,   42,   17,   24,   17,   24,
+       76,   17,   24,   76,   24,   15,   44,   24,   36,   23,
+       26,   26,   26,   26,   34,   34,   34,   26,  161,   48,
+       31,   32,   32,   32,   26,   26,   26,   26,   36,   48,
+       32,   32,   32,   33,   33,   33,   60,  160,   74,   91,
+       91,   66,   33,   33,   66,   66,   66,  114,   60,   60,
+
+       60,   66,   68,   68,   68,   74,   85,   99,  124,  133,
+      102,   68,   68,   99,  102,  157,  156,  114,   85,   85,
+       85,  133,  133,  133,  140,  140,  140,  148,  124,  143,
+      143,  143,  152,  143,  147,  147,  147,  155,  147,  154,
+      151,  150,  149,  146,  145,  144,  142,  148,  141,  138,
+      137,  132,  152,  166,  166,  166,  166,  166,  166,  166,
+      166,  167,  131,  130,  129,  167,  167,  168,  168,  168,
+      168,  168,  168,  168,  168,  169,  169,  169,  169,  170,
+      128,  170,  171,  127,  126,  171,  125,  171,  171,  172,
+      123,  122,  172,  172,  172,  172,  173,  121,  173,  173,
+
+      174,  174,  174,  174,  174,  174,  174,  174,  175,  175,
+      175,  175,  175,  175,  175,  175,  176,  120,  176,  177,
+      119,  177,  177,  118,  177,  177,  178,  178,  178,  178,
+      178,  178,  178,  178,  179,  179,  179,  179,  179,  179,
+      179,  179,  116,  115,  113,  112,  111,  110,  109,  108,
+      107,  106,  105,  104,  103,  101,  100,   98,   97,   96,
+       95,   94,   92,   90,   88,   87,   86,   84,   83,   82,
+       81,   80,   79,   78,   77,   75,   73,   70,   69,   67,
+       64,   62,   61,   57,   51,   50,   49,   47,   46,   45,
+       41,   38,   22,   21,   19,   13,    9,    6,    4,    2,
+
+      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
+      165,  165,  165,  165,  165,  165,  165,  165
+    } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "dtc-lexer.l"
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+#define YY_NO_INPUT 1
+
+
+
+#line 37 "dtc-lexer.l"
+#include "dtc.h"
+#include "srcpos.h"
+#include "dtc-parser.tab.h"
+
+YYLTYPE yylloc;
+extern bool treesource_error;
+
+/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
+#define        YY_USER_ACTION \
+       { \
+               srcpos_update(&yylloc, yytext, yyleng); \
+       }
+
+/*#define LEXDEBUG     1*/
+
+#ifdef LEXDEBUG
+#define DPRINT(fmt, ...)       fprintf(stderr, fmt, ##__VA_ARGS__)
+#else
+#define DPRINT(fmt, ...)       do { } while (0)
+#endif
+
+static int dts_version = 1;
+
+#define BEGIN_DEFAULT()                DPRINT("<V1>\n"); \
+                               BEGIN(V1); \
+
+static void push_input_file(const char *filename);
+static bool pop_input_file(void);
+static void PRINTF(1, 2) lexical_error(const char *fmt, ...);
+
+#line 669 "dtc-lexer.lex.c"
+
+#define INITIAL 0
+#define BYTESTRING 1
+#define PROPNODENAME 2
+#define V1 3
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (void );
+
+int yyget_debug (void );
+
+void yyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE yyget_extra (void );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *yyget_in (void );
+
+void yyset_in  (FILE * in_str  );
+
+FILE *yyget_out (void );
+
+void yyset_out  (FILE * out_str  );
+
+int yyget_leng (void );
+
+char *yyget_text (void );
+
+int yyget_lineno (void );
+
+void yyset_lineno (int line_number  );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap (void );
+#else
+extern int yywrap (void );
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+               { \
+               int c = '*'; \
+               size_t n; \
+               for ( n = 0; n < max_size && \
+                            (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+                       buf[n] = (char) c; \
+               if ( c == '\n' ) \
+                       buf[n++] = (char) c; \
+               if ( c == EOF && ferror( yyin ) ) \
+                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
+               result = n; \
+               } \
+       else \
+               { \
+               errno=0; \
+               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+                       { \
+                       if( errno != EINTR) \
+                               { \
+                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                               break; \
+                               } \
+                       errno=0; \
+                       clearerr(yyin); \
+                       } \
+               }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex (void);
+
+#define YY_DECL int yylex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+       if ( yyleng > 0 ) \
+               YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+                               (yytext[yyleng - 1] == '\n'); \
+       YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+       register yy_state_type yy_current_state;
+       register char *yy_cp, *yy_bp;
+       register int yy_act;
+    
+#line 69 "dtc-lexer.l"
+
+#line 862 "dtc-lexer.lex.c"
+
+       if ( !(yy_init) )
+               {
+               (yy_init) = 1;
+
+#ifdef YY_USER_INIT
+               YY_USER_INIT;
+#endif
+
+               if ( ! (yy_start) )
+                       (yy_start) = 1; /* first start state */
+
+               if ( ! yyin )
+                       yyin = stdin;
+
+               if ( ! yyout )
+                       yyout = stdout;
+
+               if ( ! YY_CURRENT_BUFFER ) {
+                       yyensure_buffer_stack ();
+                       YY_CURRENT_BUFFER_LVALUE =
+                               yy_create_buffer(yyin,YY_BUF_SIZE );
+               }
+
+               yy_load_buffer_state( );
+               }
+
+       while ( 1 )             /* loops until end-of-file is reached */
+               {
+               yy_cp = (yy_c_buf_p);
+
+               /* Support of yytext. */
+               *yy_cp = (yy_hold_char);
+
+               /* yy_bp points to the position in yy_ch_buf of the start of
+                * the current run.
+                */
+               yy_bp = yy_cp;
+
+               yy_current_state = (yy_start);
+               yy_current_state += YY_AT_BOL();
+yy_match:
+               do
+                       {
+                       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+                       if ( yy_accept[yy_current_state] )
+                               {
+                               (yy_last_accepting_state) = yy_current_state;
+                               (yy_last_accepting_cpos) = yy_cp;
+                               }
+                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                               {
+                               yy_current_state = (int) yy_def[yy_current_state];
+                               if ( yy_current_state >= 166 )
+                                       yy_c = yy_meta[(unsigned int) yy_c];
+                               }
+                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+                       ++yy_cp;
+                       }
+               while ( yy_current_state != 165 );
+               yy_cp = (yy_last_accepting_cpos);
+               yy_current_state = (yy_last_accepting_state);
+
+yy_find_action:
+               yy_act = yy_accept[yy_current_state];
+
+               YY_DO_BEFORE_ACTION;
+
+do_action:     /* This label is used only to access EOF actions. */
+
+               switch ( yy_act )
+       { /* beginning of action switch */
+                       case 0: /* must back up */
+                       /* undo the effects of YY_DO_BEFORE_ACTION */
+                       *yy_cp = (yy_hold_char);
+                       yy_cp = (yy_last_accepting_cpos);
+                       yy_current_state = (yy_last_accepting_state);
+                       goto yy_find_action;
+
+case 1:
+/* rule 1 can match eol */
+YY_RULE_SETUP
+#line 70 "dtc-lexer.l"
+{
+                       char *name = strchr(yytext, '\"') + 1;
+                       yytext[yyleng-1] = '\0';
+                       push_input_file(name);
+               }
+       YY_BREAK
+case 2:
+/* rule 2 can match eol */
+YY_RULE_SETUP
+#line 76 "dtc-lexer.l"
+{
+                       char *line, *fnstart, *fnend;
+                       struct data fn;
+                       /* skip text before line # */
+                       line = yytext;
+                       while (!isdigit((unsigned char)*line))
+                               line++;
+
+                       /* regexp ensures that first and list "
+                        * in the whole yytext are those at
+                        * beginning and end of the filename string */
+                       fnstart = memchr(yytext, '"', yyleng);
+                       for (fnend = yytext + yyleng - 1;
+                            *fnend != '"'; fnend--)
+                               ;
+                       assert(fnstart && fnend && (fnend > fnstart));
+
+                       fn = data_copy_escape_string(fnstart + 1,
+                                                    fnend - fnstart - 1);
+
+                       /* Don't allow nuls in filenames */
+                       if (memchr(fn.val, '\0', fn.len - 1))
+                               lexical_error("nul in line number directive");
+
+                       /* -1 since #line is the number of the next line */
+                       srcpos_set_line(xstrdup(fn.val), atoi(line) - 1);
+                       data_free(fn);
+               }
+       YY_BREAK
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(BYTESTRING):
+case YY_STATE_EOF(PROPNODENAME):
+case YY_STATE_EOF(V1):
+#line 105 "dtc-lexer.l"
+{
+                       if (!pop_input_file()) {
+                               yyterminate();
+                       }
+               }
+       YY_BREAK
+case 3:
+/* rule 3 can match eol */
+YY_RULE_SETUP
+#line 111 "dtc-lexer.l"
+{
+                       DPRINT("String: %s\n", yytext);
+                       yylval.data = data_copy_escape_string(yytext+1,
+                                       yyleng-2);
+                       return DT_STRING;
+               }
+       YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 118 "dtc-lexer.l"
+{
+                       DPRINT("Keyword: /dts-v1/\n");
+                       dts_version = 1;
+                       BEGIN_DEFAULT();
+                       return DT_V1;
+               }
+       YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 125 "dtc-lexer.l"
+{
+                       DPRINT("Keyword: /plugin/\n");
+                       return DT_PLUGIN;
+               }
+       YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 130 "dtc-lexer.l"
+{
+                       DPRINT("Keyword: /memreserve/\n");
+                       BEGIN_DEFAULT();
+                       return DT_MEMRESERVE;
+               }
+       YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 136 "dtc-lexer.l"
+{
+                       DPRINT("Keyword: /bits/\n");
+                       BEGIN_DEFAULT();
+                       return DT_BITS;
+               }
+       YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 142 "dtc-lexer.l"
+{
+                       DPRINT("Keyword: /delete-property/\n");
+                       DPRINT("<PROPNODENAME>\n");
+                       BEGIN(PROPNODENAME);
+                       return DT_DEL_PROP;
+               }
+       YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 149 "dtc-lexer.l"
+{
+                       DPRINT("Keyword: /delete-node/\n");
+                       DPRINT("<PROPNODENAME>\n");
+                       BEGIN(PROPNODENAME);
+                       return DT_DEL_NODE;
+               }
+       YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 156 "dtc-lexer.l"
+{
+                       DPRINT("Label: %s\n", yytext);
+                       yylval.labelref = xstrdup(yytext);
+                       yylval.labelref[yyleng-1] = '\0';
+                       return DT_LABEL;
+               }
+       YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 163 "dtc-lexer.l"
+{
+                       char *e;
+                       DPRINT("Integer Literal: '%s'\n", yytext);
+
+                       errno = 0;
+                       yylval.integer = strtoull(yytext, &e, 0);
+
+                       if (*e && e[strspn(e, "UL")]) {
+                               lexical_error("Bad integer literal '%s'",
+                                             yytext);
+                       }
+
+                       if (errno == ERANGE)
+                               lexical_error("Integer literal '%s' out of range",
+                                             yytext);
+                       else
+                               /* ERANGE is the only strtoull error triggerable
+                                *  by strings matching the pattern */
+                               assert(errno == 0);
+                       return DT_LITERAL;
+               }
+       YY_BREAK
+case 12:
+/* rule 12 can match eol */
+YY_RULE_SETUP
+#line 185 "dtc-lexer.l"
+{
+                       struct data d;
+                       DPRINT("Character literal: %s\n", yytext);
+
+                       d = data_copy_escape_string(yytext+1, yyleng-2);
+                       if (d.len == 1) {
+                               lexical_error("Empty character literal");
+                               yylval.integer = 0;
+                       } else {
+                               yylval.integer = (unsigned char)d.val[0];
+
+                               if (d.len > 2)
+                                       lexical_error("Character literal has %d"
+                                                     " characters instead of 1",
+                                                     d.len - 1);
+                       }
+
+                       data_free(d);
+                       return DT_CHAR_LITERAL;
+               }
+       YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 206 "dtc-lexer.l"
+{      /* label reference */
+                       DPRINT("Ref: %s\n", yytext+1);
+                       yylval.labelref = xstrdup(yytext+1);
+                       return DT_REF;
+               }
+       YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 212 "dtc-lexer.l"
+{      /* new-style path reference */
+                       yytext[yyleng-1] = '\0';
+                       DPRINT("Ref: %s\n", yytext+2);
+                       yylval.labelref = xstrdup(yytext+2);
+                       return DT_REF;
+               }
+       YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 219 "dtc-lexer.l"
+{
+                       yylval.byte = strtol(yytext, NULL, 16);
+                       DPRINT("Byte: %02x\n", (int)yylval.byte);
+                       return DT_BYTE;
+               }
+       YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 225 "dtc-lexer.l"
+{
+                       DPRINT("/BYTESTRING\n");
+                       BEGIN_DEFAULT();
+                       return ']';
+               }
+       YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 231 "dtc-lexer.l"
+{
+                       DPRINT("PropNodeName: %s\n", yytext);
+                       yylval.propnodename = xstrdup((yytext[0] == '\\') ?
+                                                       yytext + 1 : yytext);
+                       BEGIN_DEFAULT();
+                       return DT_PROPNODENAME;
+               }
+       YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 239 "dtc-lexer.l"
+{
+                       DPRINT("Binary Include\n");
+                       return DT_INCBIN;
+               }
+       YY_BREAK
+case 19:
+/* rule 19 can match eol */
+YY_RULE_SETUP
+#line 244 "dtc-lexer.l"
+/* eat whitespace */
+       YY_BREAK
+case 20:
+/* rule 20 can match eol */
+YY_RULE_SETUP
+#line 245 "dtc-lexer.l"
+/* eat C-style comments */
+       YY_BREAK
+case 21:
+/* rule 21 can match eol */
+YY_RULE_SETUP
+#line 246 "dtc-lexer.l"
+/* eat C++-style comments */
+       YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 248 "dtc-lexer.l"
+{ return DT_LSHIFT; };
+       YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 249 "dtc-lexer.l"
+{ return DT_RSHIFT; };
+       YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 250 "dtc-lexer.l"
+{ return DT_LE; };
+       YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 251 "dtc-lexer.l"
+{ return DT_GE; };
+       YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 252 "dtc-lexer.l"
+{ return DT_EQ; };
+       YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 253 "dtc-lexer.l"
+{ return DT_NE; };
+       YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 254 "dtc-lexer.l"
+{ return DT_AND; };
+       YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 255 "dtc-lexer.l"
+{ return DT_OR; };
+       YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 257 "dtc-lexer.l"
+{
+                       DPRINT("Char: %c (\\x%02x)\n", yytext[0],
+                               (unsigned)yytext[0]);
+                       if (yytext[0] == '[') {
+                               DPRINT("<BYTESTRING>\n");
+                               BEGIN(BYTESTRING);
+                       }
+                       if ((yytext[0] == '{')
+                           || (yytext[0] == ';')) {
+                               DPRINT("<PROPNODENAME>\n");
+                               BEGIN(PROPNODENAME);
+                       }
+                       return yytext[0];
+               }
+       YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 272 "dtc-lexer.l"
+ECHO;
+       YY_BREAK
+#line 1260 "dtc-lexer.lex.c"
+
+       case YY_END_OF_BUFFER:
+               {
+               /* Amount of text matched not including the EOB char. */
+               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+               /* Undo the effects of YY_DO_BEFORE_ACTION. */
+               *yy_cp = (yy_hold_char);
+               YY_RESTORE_YY_MORE_OFFSET
+
+               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+                       {
+                       /* We're scanning a new file or input source.  It's
+                        * possible that this happened because the user
+                        * just pointed yyin at a new source and called
+                        * yylex().  If so, then we have to assure
+                        * consistency between YY_CURRENT_BUFFER and our
+                        * globals.  Here is the right place to do so, because
+                        * this is the first action (other than possibly a
+                        * back-up) that will match for the new input source.
+                        */
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+                       }
+
+               /* Note that here we test for yy_c_buf_p "<=" to the position
+                * of the first EOB in the buffer, since yy_c_buf_p will
+                * already have been incremented past the NUL character
+                * (since all states make transitions on EOB to the
+                * end-of-buffer state).  Contrast this with the test
+                * in input().
+                */
+               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+                       { /* This was really a NUL. */
+                       yy_state_type yy_next_state;
+
+                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+                       yy_current_state = yy_get_previous_state(  );
+
+                       /* Okay, we're now positioned to make the NUL
+                        * transition.  We couldn't have
+                        * yy_get_previous_state() go ahead and do it
+                        * for us because it doesn't know how to deal
+                        * with the possibility of jamming (and we don't
+                        * want to build jamming into it because then it
+                        * will run more slowly).
+                        */
+
+                       yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+                       if ( yy_next_state )
+                               {
+                               /* Consume the NUL. */
+                               yy_cp = ++(yy_c_buf_p);
+                               yy_current_state = yy_next_state;
+                               goto yy_match;
+                               }
+
+                       else
+                               {
+                               yy_cp = (yy_last_accepting_cpos);
+                               yy_current_state = (yy_last_accepting_state);
+                               goto yy_find_action;
+                               }
+                       }
+
+               else switch ( yy_get_next_buffer(  ) )
+                       {
+                       case EOB_ACT_END_OF_FILE:
+                               {
+                               (yy_did_buffer_switch_on_eof) = 0;
+
+                               if ( yywrap( ) )
+                                       {
+                                       /* Note: because we've taken care in
+                                        * yy_get_next_buffer() to have set up
+                                        * yytext, we can now set up
+                                        * yy_c_buf_p so that if some total
+                                        * hoser (like flex itself) wants to
+                                        * call the scanner after we return the
+                                        * YY_NULL, it'll still work - another
+                                        * YY_NULL will get returned.
+                                        */
+                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+                                       yy_act = YY_STATE_EOF(YY_START);
+                                       goto do_action;
+                                       }
+
+                               else
+                                       {
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
+                                               YY_NEW_FILE;
+                                       }
+                               break;
+                               }
+
+                       case EOB_ACT_CONTINUE_SCAN:
+                               (yy_c_buf_p) =
+                                       (yytext_ptr) + yy_amount_of_matched_text;
+
+                               yy_current_state = yy_get_previous_state(  );
+
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                               goto yy_match;
+
+                       case EOB_ACT_LAST_MATCH:
+                               (yy_c_buf_p) =
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+                               yy_current_state = yy_get_previous_state(  );
+
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+                               goto yy_find_action;
+                       }
+               break;
+               }
+
+       default:
+               YY_FATAL_ERROR(
+                       "fatal flex scanner internal error--no action found" );
+       } /* end of action switch */
+               } /* end of scanning one token */
+} /* end of yylex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *     EOB_ACT_LAST_MATCH -
+ *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *     EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (void)
+{
+       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+       register char *source = (yytext_ptr);
+       register int number_to_move, i;
+       int ret_val;
+
+       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+               YY_FATAL_ERROR(
+               "fatal flex scanner internal error--end of buffer missed" );
+
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+               { /* Don't try to fill the buffer, so this is an EOF. */
+               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+                       {
+                       /* We matched a single character, the EOB, so
+                        * treat this as a final EOF.
+                        */
+                       return EOB_ACT_END_OF_FILE;
+                       }
+
+               else
+                       {
+                       /* We matched some text prior to the EOB, first
+                        * process it.
+                        */
+                       return EOB_ACT_LAST_MATCH;
+                       }
+               }
+
+       /* Try to read more data. */
+
+       /* First move last chars to start of buffer. */
+       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+       for ( i = 0; i < number_to_move; ++i )
+               *(dest++) = *(source++);
+
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+               /* don't do the read, it's not guaranteed to return an EOF,
+                * just force an EOF
+                */
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+       else
+               {
+                       int num_to_read =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+               while ( num_to_read <= 0 )
+                       { /* Not enough room in the buffer - grow it. */
+
+                       /* just a shorter name for the current buffer */
+                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+                       int yy_c_buf_p_offset =
+                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+                       if ( b->yy_is_our_buffer )
+                               {
+                               int new_size = b->yy_buf_size * 2;
+
+                               if ( new_size <= 0 )
+                                       b->yy_buf_size += b->yy_buf_size / 8;
+                               else
+                                       b->yy_buf_size *= 2;
+
+                               b->yy_ch_buf = (char *)
+                                       /* Include room in for 2 EOB chars. */
+                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
+                               }
+                       else
+                               /* Can't grow it, we don't own it. */
+                               b->yy_ch_buf = 0;
+
+                       if ( ! b->yy_ch_buf )
+                               YY_FATAL_ERROR(
+                               "fatal error - scanner input buffer overflow" );
+
+                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+                                               number_to_move - 1;
+
+                       }
+
+               if ( num_to_read > YY_READ_BUF_SIZE )
+                       num_to_read = YY_READ_BUF_SIZE;
+
+               /* Read in more data. */
+               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+                       (yy_n_chars), (size_t) num_to_read );
+
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       if ( (yy_n_chars) == 0 )
+               {
+               if ( number_to_move == YY_MORE_ADJ )
+                       {
+                       ret_val = EOB_ACT_END_OF_FILE;
+                       yyrestart(yyin  );
+                       }
+
+               else
+                       {
+                       ret_val = EOB_ACT_LAST_MATCH;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+                               YY_BUFFER_EOF_PENDING;
+                       }
+               }
+
+       else
+               ret_val = EOB_ACT_CONTINUE_SCAN;
+
+       if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+               /* Extend the array by 50%, plus the number we really need. */
+               yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+       }
+
+       (yy_n_chars) += number_to_move;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+       return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+    static yy_state_type yy_get_previous_state (void)
+{
+       register yy_state_type yy_current_state;
+       register char *yy_cp;
+    
+       yy_current_state = (yy_start);
+       yy_current_state += YY_AT_BOL();
+
+       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+               {
+               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+               if ( yy_accept[yy_current_state] )
+                       {
+                       (yy_last_accepting_state) = yy_current_state;
+                       (yy_last_accepting_cpos) = yy_cp;
+                       }
+               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                       {
+                       yy_current_state = (int) yy_def[yy_current_state];
+                       if ( yy_current_state >= 166 )
+                               yy_c = yy_meta[(unsigned int) yy_c];
+                       }
+               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+               }
+
+       return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *     next_state = yy_try_NUL_trans( current_state );
+ */
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
+       register int yy_is_jam;
+       register char *yy_cp = (yy_c_buf_p);
+
+       register YY_CHAR yy_c = 1;
+       if ( yy_accept[yy_current_state] )
+               {
+               (yy_last_accepting_state) = yy_current_state;
+               (yy_last_accepting_cpos) = yy_cp;
+               }
+       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+               {
+               yy_current_state = (int) yy_def[yy_current_state];
+               if ( yy_current_state >= 166 )
+                       yy_c = yy_meta[(unsigned int) yy_c];
+               }
+       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+       yy_is_jam = (yy_current_state == 165);
+
+       return yy_is_jam ? 0 : yy_current_state;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+    static int yyinput (void)
+#else
+    static int input  (void)
+#endif
+
+{
+       int c;
+    
+       *(yy_c_buf_p) = (yy_hold_char);
+
+       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+               {
+               /* yy_c_buf_p now points to the character we want to return.
+                * If this occurs *before* the EOB characters, then it's a
+                * valid NUL; if not, then we've hit the end of the buffer.
+                */
+               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+                       /* This was really a NUL. */
+                       *(yy_c_buf_p) = '\0';
+
+               else
+                       { /* need more input */
+                       int offset = (yy_c_buf_p) - (yytext_ptr);
+                       ++(yy_c_buf_p);
+
+                       switch ( yy_get_next_buffer(  ) )
+                               {
+                               case EOB_ACT_LAST_MATCH:
+                                       /* This happens because yy_g_n_b()
+                                        * sees that we've accumulated a
+                                        * token and flags that we need to
+                                        * try matching the token before
+                                        * proceeding.  But for input(),
+                                        * there's no matching to consider.
+                                        * So convert the EOB_ACT_LAST_MATCH
+                                        * to EOB_ACT_END_OF_FILE.
+                                        */
+
+                                       /* Reset buffer status. */
+                                       yyrestart(yyin );
+
+                                       /*FALLTHROUGH*/
+
+                               case EOB_ACT_END_OF_FILE:
+                                       {
+                                       if ( yywrap( ) )
+                                               return EOF;
+
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
+                                               YY_NEW_FILE;
+#ifdef __cplusplus
+                                       return yyinput();
+#else
+                                       return input();
+#endif
+                                       }
+
+                               case EOB_ACT_CONTINUE_SCAN:
+                                       (yy_c_buf_p) = (yytext_ptr) + offset;
+                                       break;
+                               }
+                       }
+               }
+
+       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
+       *(yy_c_buf_p) = '\0';   /* preserve yytext */
+       (yy_hold_char) = *++(yy_c_buf_p);
+
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
+
+       return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void yyrestart  (FILE * input_file )
+{
+    
+       if ( ! YY_CURRENT_BUFFER ){
+        yyensure_buffer_stack ();
+               YY_CURRENT_BUFFER_LVALUE =
+            yy_create_buffer(yyin,YY_BUF_SIZE );
+       }
+
+       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+       yy_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+       /* TODO. We should be able to replace this entire function body
+        * with
+        *              yypop_buffer_state();
+        *              yypush_buffer_state(new_buffer);
+     */
+       yyensure_buffer_stack ();
+       if ( YY_CURRENT_BUFFER == new_buffer )
+               return;
+
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+       yy_load_buffer_state( );
+
+       /* We don't actually know whether we did this switch during
+        * EOF (yywrap()) processing, but the only time this flag
+        * is looked at is after yywrap() is called, so it's safe
+        * to go ahead and always set it.
+        */
+       (yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void yy_load_buffer_state  (void)
+{
+       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+       (yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
+{
+       YY_BUFFER_STATE b;
+    
+       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+       b->yy_buf_size = size;
+
+       /* yy_ch_buf has to be 2 characters longer than the size given because
+        * we need to put in 2 end-of-buffer characters.
+        */
+       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
+       if ( ! b->yy_ch_buf )
+               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+       b->yy_is_our_buffer = 1;
+
+       yy_init_buffer(b,file );
+
+       return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ * 
+ */
+    void yy_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
+       if ( ! b )
+               return;
+
+       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+       if ( b->yy_is_our_buffer )
+               yyfree((void *) b->yy_ch_buf  );
+
+       yyfree((void *) b  );
+}
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+
+{
+       int oerrno = errno;
+    
+       yy_flush_buffer(b );
+
+       b->yy_input_file = file;
+       b->yy_fill_buffer = 1;
+
+    /* If b is the current buffer, then yy_init_buffer was _probably_
+     * called from yyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
+    }
+
+        b->yy_is_interactive = 0;
+    
+       errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void yy_flush_buffer (YY_BUFFER_STATE  b )
+{
+       if ( ! b )
+               return;
+
+       b->yy_n_chars = 0;
+
+       /* We always need two end-of-buffer characters.  The first causes
+        * a transition to the end-of-buffer state.  The second causes
+        * a jam in that state.
+        */
+       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+       b->yy_buf_pos = &b->yy_ch_buf[0];
+
+       b->yy_at_bol = 1;
+       b->yy_buffer_status = YY_BUFFER_NEW;
+
+       if ( b == YY_CURRENT_BUFFER )
+               yy_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+       if (new_buffer == NULL)
+               return;
+
+       yyensure_buffer_stack();
+
+       /* This block is copied from yy_switch_to_buffer. */
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       /* Only push if top exists. Otherwise, replace top. */
+       if (YY_CURRENT_BUFFER)
+               (yy_buffer_stack_top)++;
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+       /* copied from yy_switch_to_buffer. */
+       yy_load_buffer_state( );
+       (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void yypop_buffer_state (void)
+{
+       if (!YY_CURRENT_BUFFER)
+               return;
+
+       yy_delete_buffer(YY_CURRENT_BUFFER );
+       YY_CURRENT_BUFFER_LVALUE = NULL;
+       if ((yy_buffer_stack_top) > 0)
+               --(yy_buffer_stack_top);
+
+       if (YY_CURRENT_BUFFER) {
+               yy_load_buffer_state( );
+               (yy_did_buffer_switch_on_eof) = 1;
+       }
+}
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (void)
+{
+       int num_to_alloc;
+    
+       if (!(yy_buffer_stack)) {
+
+               /* First allocation is just for 2 elements, since we don't know if this
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
+         */
+               num_to_alloc = 1;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+                                                                 
+               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+                               
+               (yy_buffer_stack_max) = num_to_alloc;
+               (yy_buffer_stack_top) = 0;
+               return;
+       }
+
+       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+               /* Increase the buffer to prepare for a possible push. */
+               int grow_size = 8 /* arbitrary grow size */;
+
+               num_to_alloc = (yy_buffer_stack_max) + grow_size;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+                                                               ((yy_buffer_stack),
+                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+               /* zero only the new slots.*/
+               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+               (yy_buffer_stack_max) = num_to_alloc;
+       }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
+{
+       YY_BUFFER_STATE b;
+    
+       if ( size < 2 ||
+            base[size-2] != YY_END_OF_BUFFER_CHAR ||
+            base[size-1] != YY_END_OF_BUFFER_CHAR )
+               /* They forgot to leave room for the EOB's. */
+               return 0;
+
+       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
+       b->yy_buf_pos = b->yy_ch_buf = base;
+       b->yy_is_our_buffer = 0;
+       b->yy_input_file = 0;
+       b->yy_n_chars = b->yy_buf_size;
+       b->yy_is_interactive = 0;
+       b->yy_at_bol = 1;
+       b->yy_fill_buffer = 0;
+       b->yy_buffer_status = YY_BUFFER_NEW;
+
+       yy_switch_to_buffer(b  );
+
+       return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
+{
+    
+       return yy_scan_bytes(yystr,strlen(yystr) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+{
+       YY_BUFFER_STATE b;
+       char *buf;
+       yy_size_t n;
+       int i;
+    
+       /* Get memory for full buffer, including space for trailing EOB's. */
+       n = _yybytes_len + 2;
+       buf = (char *) yyalloc(n  );
+       if ( ! buf )
+               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+       for ( i = 0; i < _yybytes_len; ++i )
+               buf[i] = yybytes[i];
+
+       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+       b = yy_scan_buffer(buf,n );
+       if ( ! b )
+               YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+       /* It's okay to grow etc. this buffer, and we should throw it
+        * away when we're done.
+        */
+       b->yy_is_our_buffer = 1;
+
+       return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg )
+{
+       (void) fprintf( stderr, "%s\n", msg );
+       exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               yytext[yyleng] = (yy_hold_char); \
+               (yy_c_buf_p) = yytext + yyless_macro_arg; \
+               (yy_hold_char) = *(yy_c_buf_p); \
+               *(yy_c_buf_p) = '\0'; \
+               yyleng = yyless_macro_arg; \
+               } \
+       while ( 0 )
+
+/* Accessor  methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ * 
+ */
+int yyget_lineno  (void)
+{
+        
+    return yylineno;
+}
+
+/** Get the input stream.
+ * 
+ */
+FILE *yyget_in  (void)
+{
+        return yyin;
+}
+
+/** Get the output stream.
+ * 
+ */
+FILE *yyget_out  (void)
+{
+        return yyout;
+}
+
+/** Get the length of the current token.
+ * 
+ */
+int yyget_leng  (void)
+{
+        return yyleng;
+}
+
+/** Get the current token.
+ * 
+ */
+
+char *yyget_text  (void)
+{
+        return yytext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void yyset_lineno (int  line_number )
+{
+    
+    yylineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE *  in_str )
+{
+        yyin = in_str ;
+}
+
+void yyset_out (FILE *  out_str )
+{
+        yyout = out_str ;
+}
+
+int yyget_debug  (void)
+{
+        return yy_flex_debug;
+}
+
+void yyset_debug (int  bdebug )
+{
+        yy_flex_debug = bdebug ;
+}
+
+static int yy_init_globals (void)
+{
+        /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from yylex_destroy(), so don't allocate here.
+     */
+
+    (yy_buffer_stack) = 0;
+    (yy_buffer_stack_top) = 0;
+    (yy_buffer_stack_max) = 0;
+    (yy_c_buf_p) = (char *) 0;
+    (yy_init) = 0;
+    (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    yyin = stdin;
+    yyout = stdout;
+#else
+    yyin = (FILE *) 0;
+    yyout = (FILE *) 0;
+#endif
+
+    /* For future reference: Set errno on error, since we are called by
+     * yylex_init()
+     */
+    return 0;
+}
+
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+       while(YY_CURRENT_BUFFER){
+               yy_delete_buffer(YY_CURRENT_BUFFER  );
+               YY_CURRENT_BUFFER_LVALUE = NULL;
+               yypop_buffer_state();
+       }
+
+       /* Destroy the stack itself. */
+       yyfree((yy_buffer_stack) );
+       (yy_buffer_stack) = NULL;
+
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * yylex() is called, initialization will occur. */
+    yy_init_globals( );
+
+    return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
+       register int i;
+       for ( i = 0; i < n; ++i )
+               s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s )
+{
+       register int n;
+       for ( n = 0; s[n]; ++n )
+               ;
+
+       return n;
+}
+#endif
+
+void *yyalloc (yy_size_t  size )
+{
+       return (void *) malloc( size );
+}
+
+void *yyrealloc  (void * ptr, yy_size_t  size )
+{
+       /* The cast to (char *) in the following accommodates both
+        * implementations that use char* generic pointers, and those
+        * that use void* generic pointers.  It works with the latter
+        * because both ANSI C and C++ allow castless assignment from
+        * any pointer type to void*, and deal with argument conversions
+        * as though doing an assignment.
+        */
+       return (void *) realloc( (char *) ptr, size );
+}
+
+void yyfree (void * ptr )
+{
+       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 272 "dtc-lexer.l"
+
+
+
+static void push_input_file(const char *filename)
+{
+       assert(filename);
+
+       srcfile_push(filename);
+
+       yyin = current_srcfile->f;
+
+       yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
+}
+
+
+static bool pop_input_file(void)
+{
+       if (srcfile_pop() == 0)
+               return false;
+
+       yypop_buffer_state();
+       yyin = current_srcfile->f;
+
+       return true;
+}
+
+static void lexical_error(const char *fmt, ...)
+{
+       va_list ap;
+
+       va_start(ap, fmt);
+       srcpos_verror(&yylloc, "Lexical error", fmt, ap);
+       va_end(ap);
+
+       treesource_error = true;
+}
+
diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
new file mode 100644 (file)
index 0000000..4d10814
--- /dev/null
@@ -0,0 +1,2301 @@
+/* A Bison parser, made by GNU Bison 3.0.2.  */
+
+/* Bison implementation for Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
+   This program 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 3 of the License, or
+   (at your option) any later version.
+
+   This program 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Bison version.  */
+#define YYBISON_VERSION "3.0.2"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 20 "dtc-parser.y" /* yacc.c:339  */
+
+#include <stdio.h>
+#include <inttypes.h>
+
+#include "dtc.h"
+#include "srcpos.h"
+
+extern int yylex(void);
+extern void yyerror(char const *s);
+#define ERROR(loc, ...) \
+       do { \
+               srcpos_error((loc), "Error", __VA_ARGS__); \
+               treesource_error = true; \
+       } while (0)
+
+extern struct dt_info *parser_output;
+extern bool treesource_error;
+
+#line 85 "dtc-parser.tab.c" /* yacc.c:339  */
+
+# ifndef YY_NULLPTR
+#  if defined __cplusplus && 201103L <= __cplusplus
+#   define YY_NULLPTR nullptr
+#  else
+#   define YY_NULLPTR 0
+#  endif
+# endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* In a future release of Bison, this section will be replaced
+   by #include "dtc-parser.tab.h".  */
+#ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
+# define YY_YY_DTC_PARSER_TAB_H_INCLUDED
+/* Debug traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int yydebug;
+#endif
+
+/* Token type.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+  enum yytokentype
+  {
+    DT_V1 = 258,
+    DT_PLUGIN = 259,
+    DT_MEMRESERVE = 260,
+    DT_LSHIFT = 261,
+    DT_RSHIFT = 262,
+    DT_LE = 263,
+    DT_GE = 264,
+    DT_EQ = 265,
+    DT_NE = 266,
+    DT_AND = 267,
+    DT_OR = 268,
+    DT_BITS = 269,
+    DT_DEL_PROP = 270,
+    DT_DEL_NODE = 271,
+    DT_PROPNODENAME = 272,
+    DT_LITERAL = 273,
+    DT_CHAR_LITERAL = 274,
+    DT_BYTE = 275,
+    DT_STRING = 276,
+    DT_LABEL = 277,
+    DT_REF = 278,
+    DT_INCBIN = 279
+  };
+#endif
+
+/* Value type.  */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
+{
+#line 39 "dtc-parser.y" /* yacc.c:355  */
+
+       char *propnodename;
+       char *labelref;
+       uint8_t byte;
+       struct data data;
+
+       struct {
+               struct data     data;
+               int             bits;
+       } array;
+
+       struct property *prop;
+       struct property *proplist;
+       struct node *node;
+       struct node *nodelist;
+       struct reserve_info *re;
+       uint64_t integer;
+       unsigned int flags;
+
+#line 170 "dtc-parser.tab.c" /* yacc.c:355  */
+};
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+/* Location type.  */
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
+{
+  int first_line;
+  int first_column;
+  int last_line;
+  int last_column;
+};
+# define YYLTYPE_IS_DECLARED 1
+# define YYLTYPE_IS_TRIVIAL 1
+#endif
+
+
+extern YYSTYPE yylval;
+extern YYLTYPE yylloc;
+int yyparse (void);
+
+#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED  */
+
+/* Copy the second part of user declarations.  */
+
+#line 199 "dtc-parser.tab.c" /* yacc.c:358  */
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#else
+typedef signed char yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+#  define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(E) ((void) (E))
+#else
+# define YYUSE(E) /* empty */
+#endif
+
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+    _Pragma ("GCC diagnostic pop")
+#else
+# define YY_INITIAL_VALUE(Value) Value
+#endif
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# ifdef YYSTACK_USE_ALLOCA
+#  if YYSTACK_USE_ALLOCA
+#   ifdef __GNUC__
+#    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
+#   else
+#    define YYSTACK_ALLOC alloca
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
+#     ifndef EXIT_SUCCESS
+#      define EXIT_SUCCESS 0
+#     endif
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's 'empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+    /* The OS might guarantee only one guard page at the bottom of the stack,
+       and a page size can be as small as 4096 bytes.  So we cannot safely
+       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
+       to allow for a few compiler-allocated temporary stack slots.  */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+#  endif
+# else
+#  define YYSTACK_ALLOC YYMALLOC
+#  define YYSTACK_FREE YYFREE
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+#  endif
+#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
+       && ! ((defined YYMALLOC || defined malloc) \
+             && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef EXIT_SUCCESS
+#    define EXIT_SUCCESS 0
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined EXIT_SUCCESS
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+#  ifndef YYFREE
+#   define YYFREE free
+#   if ! defined free && ! defined EXIT_SUCCESS
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  yytype_int16 yyss_alloc;
+  YYSTYPE yyvs_alloc;
+  YYLTYPE yyls_alloc;
+};
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+      + 2 * YYSTACK_GAP_MAXIMUM)
+
+# define YYCOPY_NEEDED 1
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
+    do                                                                  \
+      {                                                                 \
+        YYSIZE_T yynewbytes;                                            \
+        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
+        Stack = &yyptr->Stack_alloc;                                    \
+        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+        yyptr += yynewbytes / sizeof (*yyptr);                          \
+      }                                                                 \
+    while (0)
+
+#endif
+
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(Dst, Src, Count) \
+      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+#  else
+#   define YYCOPY(Dst, Src, Count)              \
+      do                                        \
+        {                                       \
+          YYSIZE_T yyi;                         \
+          for (yyi = 0; yyi < (Count); yyi++)   \
+            (Dst)[yyi] = (Src)[yyi];            \
+        }                                       \
+      while (0)
+#  endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  6
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   138
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  48
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  30
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  84
+/* YYNSTATES -- Number of states.  */
+#define YYNSTATES  149
+
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+   by yylex, with out-of-bounds checking.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   279
+
+#define YYTRANSLATE(YYX)                                                \
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, without out-of-bounds checking.  */
+static const yytype_uint8 yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    47,     2,     2,     2,    45,    41,     2,
+      33,    35,    44,    42,    34,    43,     2,    26,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    38,    25,
+      36,    29,    30,    37,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,    31,     2,    32,    40,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    27,    39,    28,    46,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+      15,    16,    17,    18,    19,    20,    21,    22,    23,    24
+};
+
+#if YYDEBUG
+  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,   109,   109,   117,   121,   128,   129,   139,   142,   149,
+     153,   161,   165,   170,   181,   191,   206,   214,   217,   224,
+     228,   232,   236,   244,   248,   252,   256,   260,   276,   286,
+     294,   297,   301,   308,   324,   329,   348,   362,   369,   370,
+     371,   378,   382,   383,   387,   388,   392,   393,   397,   398,
+     402,   403,   407,   408,   412,   413,   414,   418,   419,   420,
+     421,   422,   426,   427,   428,   432,   433,   434,   438,   439,
+     448,   457,   461,   462,   463,   464,   469,   472,   476,   484,
+     487,   491,   499,   503,   507
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || 0
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "DT_V1", "DT_PLUGIN", "DT_MEMRESERVE",
+  "DT_LSHIFT", "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND",
+  "DT_OR", "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME",
+  "DT_LITERAL", "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL",
+  "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
+  "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
+  "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
+  "header", "headers", "memreserves", "memreserve", "devicetree",
+  "nodedef", "proplist", "propdef", "propdata", "propdataprefix",
+  "arrayprefix", "integer_prim", "integer_expr", "integer_trinary",
+  "integer_or", "integer_and", "integer_bitor", "integer_bitxor",
+  "integer_bitand", "integer_eq", "integer_rela", "integer_shift",
+  "integer_add", "integer_mul", "integer_unary", "bytestring", "subnodes",
+  "subnode", YY_NULLPTR
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+   (internal) symbol number NUM (which must be that of a token).  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,    59,    47,   123,   125,    61,
+      62,    91,    93,    40,    44,    41,    60,    63,    58,   124,
+      94,    38,    43,    45,    42,    37,   126,    33
+};
+# endif
+
+#define YYPACT_NINF -44
+
+#define yypact_value_is_default(Yystate) \
+  (!!((Yystate) == (-44)))
+
+#define YYTABLE_NINF -1
+
+#define yytable_value_is_error(Yytable_value) \
+  0
+
+  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+     STATE-NUM.  */
+static const yytype_int8 yypact[] =
+{
+      14,    27,    61,    14,     8,    18,   -44,   -44,    37,     8,
+      40,     8,    64,   -44,   -44,   -12,    37,   -44,    50,    52,
+     -44,   -44,   -12,   -12,   -12,   -44,    51,   -44,    -4,    78,
+      53,    54,    55,    17,     2,    30,    38,    -3,   -44,    66,
+     -44,   -44,    70,    72,    50,    50,   -44,   -44,   -44,   -44,
+     -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,
+     -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -44,
+       3,    73,    50,   -44,   -44,    78,    59,    53,    54,    55,
+      17,     2,     2,    30,    30,    30,    30,    38,    38,    -3,
+      -3,   -44,   -44,   -44,    82,    83,    44,     3,   -44,    74,
+       3,   -44,   -44,   -12,    76,    79,   -44,   -44,   -44,   -44,
+     -44,    80,   -44,   -44,   -44,   -44,   -44,   -10,    36,   -44,
+     -44,   -44,   -44,    85,   -44,   -44,   -44,    75,   -44,   -44,
+      21,    71,    88,    -6,   -44,   -44,   -44,   -44,   -44,    11,
+     -44,   -44,   -44,    37,   -44,    77,    37,    81,   -44
+};
+
+  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+     Performed when YYTABLE does not specify something else to do.  Zero
+     means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       0,     0,     0,     5,     7,     3,     1,     6,     0,     0,
+       0,     7,     0,    38,    39,     0,     0,    10,     0,     2,
+       8,     4,     0,     0,     0,    72,     0,    41,    42,    44,
+      46,    48,    50,    52,    54,    57,    64,    67,    71,     0,
+      17,    11,     0,     0,     0,     0,    73,    74,    75,    40,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     9,
+      79,     0,     0,    14,    12,    45,     0,    47,    49,    51,
+      53,    55,    56,    60,    61,    59,    58,    62,    63,    65,
+      66,    69,    68,    70,     0,     0,     0,     0,    18,     0,
+      79,    15,    13,     0,     0,     0,    20,    30,    82,    22,
+      84,     0,    81,    80,    43,    21,    83,     0,     0,    16,
+      29,    19,    31,     0,    23,    32,    26,     0,    76,    34,
+       0,     0,     0,     0,    37,    36,    24,    35,    33,     0,
+      77,    78,    25,     0,    28,     0,     0,     0,    27
+};
+
+  /* YYPGOTO[NTERM-NUM].  */
+static const yytype_int8 yypgoto[] =
+{
+     -44,   -44,   -44,   103,    99,   104,   -44,   -43,   -44,   -21,
+     -44,   -44,   -44,    -8,    63,     9,   -44,    65,    67,    68,
+      69,    62,    26,     4,    22,    23,   -19,   -44,    20,    28
+};
+
+  /* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,     2,     3,     4,    10,    11,    19,    41,    70,    98,
+     117,   118,   130,    25,    26,    27,    28,    29,    30,    31,
+      32,    33,    34,    35,    36,    37,    38,   133,    99,   100
+};
+
+  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
+     positive, shift that token.  If negative, reduce the rule whose
+     number is the opposite.  If YYTABLE_NINF, syntax error.  */
+static const yytype_uint8 yytable[] =
+{
+      16,    73,    74,    46,    47,    48,    13,    14,    39,    50,
+      58,    59,   120,     8,   140,   121,   141,     1,    94,    95,
+      96,    15,    12,    66,   122,    97,   142,    56,    57,   102,
+       9,    22,    60,    51,    23,    24,    62,    63,    61,    13,
+      14,    67,    68,   134,   135,   143,   144,    91,    92,    93,
+     123,   136,     5,   108,    15,    13,    14,   124,   125,   126,
+     127,     6,    83,    84,    85,    86,    18,   128,    42,   106,
+      15,    40,   129,   107,    43,    44,   109,    40,    45,   112,
+      64,    65,    81,    82,    87,    88,    49,    89,    90,    21,
+      52,    69,    53,    71,    54,    72,    55,   103,   101,   104,
+     105,   115,   111,   131,   116,   119,     7,   138,   132,   139,
+      20,   146,   114,    17,    76,    75,   148,    80,     0,    77,
+     113,    78,   137,    79,     0,   110,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   145,     0,     0,   147
+};
+
+static const yytype_int16 yycheck[] =
+{
+       8,    44,    45,    22,    23,    24,    18,    19,    16,    13,
+       8,     9,    22,     5,    20,    25,    22,     3,    15,    16,
+      17,    33,     4,    26,    34,    22,    32,    10,    11,    72,
+      22,    43,    30,    37,    46,    47,     6,     7,    36,    18,
+      19,    44,    45,    22,    23,    34,    35,    66,    67,    68,
+      14,    30,    25,    96,    33,    18,    19,    21,    22,    23,
+      24,     0,    58,    59,    60,    61,    26,    31,    16,    25,
+      33,    27,    36,    29,    22,    23,    97,    27,    26,   100,
+      42,    43,    56,    57,    62,    63,    35,    64,    65,    25,
+      12,    25,    39,    23,    40,    23,    41,    38,    25,    17,
+      17,    25,    28,    18,    25,    25,     3,    36,    33,    21,
+      11,    34,   103,     9,    51,    50,    35,    55,    -1,    52,
+     100,    53,   130,    54,    -1,    97,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,   143,    -1,    -1,   146
+};
+
+  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+     symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,     3,    49,    50,    51,    25,     0,    51,     5,    22,
+      52,    53,     4,    18,    19,    33,    61,    53,    26,    54,
+      52,    25,    43,    46,    47,    61,    62,    63,    64,    65,
+      66,    67,    68,    69,    70,    71,    72,    73,    74,    61,
+      27,    55,    16,    22,    23,    26,    74,    74,    74,    35,
+      13,    37,    12,    39,    40,    41,    10,    11,     8,     9,
+      30,    36,     6,     7,    42,    43,    26,    44,    45,    25,
+      56,    23,    23,    55,    55,    65,    62,    66,    67,    68,
+      69,    70,    70,    71,    71,    71,    71,    72,    72,    73,
+      73,    74,    74,    74,    15,    16,    17,    22,    57,    76,
+      77,    25,    55,    38,    17,    17,    25,    29,    55,    57,
+      77,    28,    57,    76,    63,    25,    25,    58,    59,    25,
+      22,    25,    34,    14,    21,    22,    23,    24,    31,    36,
+      60,    18,    33,    75,    22,    23,    30,    61,    36,    21,
+      20,    22,    32,    34,    35,    61,    34,    61,    35
+};
+
+  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    48,    49,    50,    50,    51,    51,    52,    52,    53,
+      53,    54,    54,    54,    54,    54,    55,    56,    56,    57,
+      57,    57,    57,    58,    58,    58,    58,    58,    58,    58,
+      59,    59,    59,    60,    60,    60,    60,    60,    61,    61,
+      61,    62,    63,    63,    64,    64,    65,    65,    66,    66,
+      67,    67,    68,    68,    69,    69,    69,    70,    70,    70,
+      70,    70,    71,    71,    71,    72,    72,    72,    73,    73,
+      73,    73,    74,    74,    74,    74,    75,    75,    75,    76,
+      76,    76,    77,    77,    77
+};
+
+  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     3,     2,     4,     1,     2,     0,     2,     4,
+       2,     2,     3,     4,     3,     4,     5,     0,     2,     4,
+       2,     3,     2,     2,     3,     4,     2,     9,     5,     2,
+       0,     2,     2,     3,     1,     2,     2,     2,     1,     1,
+       3,     1,     1,     5,     1,     3,     1,     3,     1,     3,
+       1,     3,     1,     3,     1,     3,     3,     1,     3,     3,
+       3,     3,     3,     3,     1,     3,     3,     1,     3,     3,
+       3,     1,     1,     2,     2,     2,     0,     2,     2,     0,
+       2,     2,     2,     3,     2
+};
+
+
+#define yyerrok         (yyerrstatus = 0)
+#define yyclearin       (yychar = YYEMPTY)
+#define YYEMPTY         (-2)
+#define YYEOF           0
+
+#define YYACCEPT        goto yyacceptlab
+#define YYABORT         goto yyabortlab
+#define YYERROR         goto yyerrorlab
+
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)                                  \
+do                                                              \
+  if (yychar == YYEMPTY)                                        \
+    {                                                           \
+      yychar = (Token);                                         \
+      yylval = (Value);                                         \
+      YYPOPSTACK (yylen);                                       \
+      yystate = *yyssp;                                         \
+      goto yybackup;                                            \
+    }                                                           \
+  else                                                          \
+    {                                                           \
+      yyerror (YY_("syntax error: cannot back up")); \
+      YYERROR;                                                  \
+    }                                                           \
+while (0)
+
+/* Error token number */
+#define YYTERROR        1
+#define YYERRCODE       256
+
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
+    do                                                                  \
+      if (N)                                                            \
+        {                                                               \
+          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
+          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
+          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
+          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
+        }                                                               \
+      else                                                              \
+        {                                                               \
+          (Current).first_line   = (Current).last_line   =              \
+            YYRHSLOC (Rhs, 0).last_line;                                \
+          (Current).first_column = (Current).last_column =              \
+            YYRHSLOC (Rhs, 0).last_column;                              \
+        }                                                               \
+    while (0)
+#endif
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)                        \
+do {                                            \
+  if (yydebug)                                  \
+    YYFPRINTF Args;                             \
+} while (0)
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+
+/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
+
+YY_ATTRIBUTE_UNUSED
+static unsigned
+yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
+{
+  unsigned res = 0;
+  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
+  if (0 <= yylocp->first_line)
+    {
+      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
+      if (0 <= yylocp->first_column)
+        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
+    }
+  if (0 <= yylocp->last_line)
+    {
+      if (yylocp->first_line < yylocp->last_line)
+        {
+          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
+          if (0 <= end_col)
+            res += YYFPRINTF (yyo, ".%d", end_col);
+        }
+      else if (0 <= end_col && yylocp->first_column < end_col)
+        res += YYFPRINTF (yyo, "-%d", end_col);
+    }
+  return res;
+ }
+
+#  define YY_LOCATION_PRINT(File, Loc)          \
+  yy_location_print_ (File, &(Loc))
+
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
+do {                                                                      \
+  if (yydebug)                                                            \
+    {                                                                     \
+      YYFPRINTF (stderr, "%s ", Title);                                   \
+      yy_symbol_print (stderr,                                            \
+                  Type, Value, Location); \
+      YYFPRINTF (stderr, "\n");                                           \
+    }                                                                     \
+} while (0)
+
+
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT.  |
+`----------------------------------------*/
+
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
+{
+  FILE *yyo = yyoutput;
+  YYUSE (yyo);
+  YYUSE (yylocationp);
+  if (!yyvaluep)
+    return;
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+  YYUSE (yytype);
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
+{
+  YYFPRINTF (yyoutput, "%s %s (",
+             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+
+  YY_LOCATION_PRINT (yyoutput, *yylocationp);
+  YYFPRINTF (yyoutput, ": ");
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
+  YYFPRINTF (yyoutput, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included).                                                   |
+`------------------------------------------------------------------*/
+
+static void
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (; yybottom <= yytop; yybottom++)
+    {
+      int yybot = *yybottom;
+      YYFPRINTF (stderr, " %d", yybot);
+    }
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)                            \
+do {                                                            \
+  if (yydebug)                                                  \
+    yy_stack_print ((Bottom), (Top));                           \
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+static void
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
+{
+  unsigned long int yylno = yyrline[yyrule];
+  int yynrhs = yyr2[yyrule];
+  int yyi;
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+             yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr,
+                       yystos[yyssp[yyi + 1 - yynrhs]],
+                       &(yyvsp[(yyi + 1) - (yynrhs)])
+                       , &(yylsp[(yyi + 1) - (yynrhs)])                       );
+      YYFPRINTF (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)          \
+do {                                    \
+  if (yydebug)                          \
+    yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
+} while (0)
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined __GLIBC__ && defined _STRING_H
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+static YYSIZE_T
+yystrlen (const char *yystr)
+{
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
+    continue;
+  return yylen;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+{
+  char *yyd = yydest;
+  const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+   quotes and backslashes, so that it's suitable for yyerror.  The
+   heuristic is that double-quoting is unnecessary unless the string
+   contains an apostrophe, a comma, or backslash (other than
+   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
+   null, do not copy; instead, return the length of what the result
+   would have been.  */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+  if (*yystr == '"')
+    {
+      YYSIZE_T yyn = 0;
+      char const *yyp = yystr;
+
+      for (;;)
+        switch (*++yyp)
+          {
+          case '\'':
+          case ',':
+            goto do_not_strip_quotes;
+
+          case '\\':
+            if (*++yyp != '\\')
+              goto do_not_strip_quotes;
+            /* Fall through.  */
+          default:
+            if (yyres)
+              yyres[yyn] = *yyp;
+            yyn++;
+            break;
+
+          case '"':
+            if (yyres)
+              yyres[yyn] = '\0';
+            return yyn;
+          }
+    do_not_strip_quotes: ;
+    }
+
+  if (! yyres)
+    return yystrlen (yystr);
+
+  return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+   about the unexpected token YYTOKEN for the state stack whose top is
+   YYSSP.
+
+   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
+   not large enough to hold the message.  In that case, also set
+   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
+   required number of bytes is too large to store.  */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+                yytype_int16 *yyssp, int yytoken)
+{
+  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+  YYSIZE_T yysize = yysize0;
+  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+  /* Internationalized format string. */
+  const char *yyformat = YY_NULLPTR;
+  /* Arguments of yyformat. */
+  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+  /* Number of reported tokens (one for the "unexpected", one per
+     "expected"). */
+  int yycount = 0;
+
+  /* There are many possibilities here to consider:
+     - If this state is a consistent state with a default action, then
+       the only way this function was invoked is if the default action
+       is an error action.  In that case, don't check for expected
+       tokens because there are none.
+     - The only way there can be no lookahead present (in yychar) is if
+       this state is a consistent state with a default action.  Thus,
+       detecting the absence of a lookahead is sufficient to determine
+       that there is no unexpected or expected token to report.  In that
+       case, just report a simple "syntax error".
+     - Don't assume there isn't a lookahead just because this state is a
+       consistent state with a default action.  There might have been a
+       previous inconsistent state, consistent state with a non-default
+       action, or user semantic action that manipulated yychar.
+     - Of course, the expected token list depends on states to have
+       correct lookahead information, and it depends on the parser not
+       to perform extra reductions after fetching a lookahead from the
+       scanner and before detecting a syntax error.  Thus, state merging
+       (from LALR or IELR) and default reductions corrupt the expected
+       token list.  However, the list is correct for canonical LR with
+       one exception: it will still contain any token that will not be
+       accepted due to an error action in a later state.
+  */
+  if (yytoken != YYEMPTY)
+    {
+      int yyn = yypact[*yyssp];
+      yyarg[yycount++] = yytname[yytoken];
+      if (!yypact_value_is_default (yyn))
+        {
+          /* Start YYX at -YYN if negative to avoid negative indexes in
+             YYCHECK.  In other words, skip the first -YYN actions for
+             this state because they are default actions.  */
+          int yyxbegin = yyn < 0 ? -yyn : 0;
+          /* Stay within bounds of both yycheck and yytname.  */
+          int yychecklim = YYLAST - yyn + 1;
+          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+          int yyx;
+
+          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+                && !yytable_value_is_error (yytable[yyx + yyn]))
+              {
+                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+                  {
+                    yycount = 1;
+                    yysize = yysize0;
+                    break;
+                  }
+                yyarg[yycount++] = yytname[yyx];
+                {
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+                  if (! (yysize <= yysize1
+                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                    return 2;
+                  yysize = yysize1;
+                }
+              }
+        }
+    }
+
+  switch (yycount)
+    {
+# define YYCASE_(N, S)                      \
+      case N:                               \
+        yyformat = S;                       \
+      break
+      YYCASE_(0, YY_("syntax error"));
+      YYCASE_(1, YY_("syntax error, unexpected %s"));
+      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+    }
+
+  {
+    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+      return 2;
+    yysize = yysize1;
+  }
+
+  if (*yymsg_alloc < yysize)
+    {
+      *yymsg_alloc = 2 * yysize;
+      if (! (yysize <= *yymsg_alloc
+             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+      return 1;
+    }
+
+  /* Avoid sprintf, as that infringes on the user's name space.
+     Don't have undefined behavior even if the translation
+     produced a string with the wrong number of "%s"s.  */
+  {
+    char *yyp = *yymsg;
+    int yyi = 0;
+    while ((*yyp = *yyformat) != '\0')
+      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+        {
+          yyp += yytnamerr (yyp, yyarg[yyi++]);
+          yyformat += 2;
+        }
+      else
+        {
+          yyp++;
+          yyformat++;
+        }
+  }
+  return 0;
+}
+#endif /* YYERROR_VERBOSE */
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
+{
+  YYUSE (yyvaluep);
+  YYUSE (yylocationp);
+  if (!yymsg)
+    yymsg = "Deleting";
+  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+  YYUSE (yytype);
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
+}
+
+
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+/* Location data for the lookahead symbol.  */
+YYLTYPE yylloc
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+  = { 1, 1, 1, 1 }
+# endif
+;
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+int
+yyparse (void)
+{
+    int yystate;
+    /* Number of tokens to shift before error messages enabled.  */
+    int yyerrstatus;
+
+    /* The stacks and their tools:
+       'yyss': related to states.
+       'yyvs': related to semantic values.
+       'yyls': related to locations.
+
+       Refer to the stacks through separate pointers, to allow yyoverflow
+       to reallocate them elsewhere.  */
+
+    /* The state stack.  */
+    yytype_int16 yyssa[YYINITDEPTH];
+    yytype_int16 *yyss;
+    yytype_int16 *yyssp;
+
+    /* The semantic value stack.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs;
+    YYSTYPE *yyvsp;
+
+    /* The location stack.  */
+    YYLTYPE yylsa[YYINITDEPTH];
+    YYLTYPE *yyls;
+    YYLTYPE *yylsp;
+
+    /* The locations where the error started and ended.  */
+    YYLTYPE yyerror_range[3];
+
+    YYSIZE_T yystacksize;
+
+  int yyn;
+  int yyresult;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+  YYLTYPE yyloc;
+
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
+
+  yyssp = yyss = yyssa;
+  yyvsp = yyvs = yyvsa;
+  yylsp = yyls = yylsa;
+  yystacksize = YYINITDEPTH;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY; /* Cause a token to be read.  */
+  yylsp[0] = yylloc;
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed.  So pushing a state here evens the stacks.  */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+      {
+        /* Give user a chance to reallocate the stack.  Use copies of
+           these so that the &'s don't force the real ones into
+           memory.  */
+        YYSTYPE *yyvs1 = yyvs;
+        yytype_int16 *yyss1 = yyss;
+        YYLTYPE *yyls1 = yyls;
+
+        /* Each stack pointer address is followed by the size of the
+           data in use in that stack, in bytes.  This used to be a
+           conditional around just the two extra args, but that might
+           be undefined if yyoverflow is a macro.  */
+        yyoverflow (YY_("memory exhausted"),
+                    &yyss1, yysize * sizeof (*yyssp),
+                    &yyvs1, yysize * sizeof (*yyvsp),
+                    &yyls1, yysize * sizeof (*yylsp),
+                    &yystacksize);
+
+        yyls = yyls1;
+        yyss = yyss1;
+        yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyexhaustedlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+        goto yyexhaustedlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+        yystacksize = YYMAXDEPTH;
+
+      {
+        yytype_int16 *yyss1 = yyss;
+        union yyalloc *yyptr =
+          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+        if (! yyptr)
+          goto yyexhaustedlab;
+        YYSTACK_RELOCATE (yyss_alloc, yyss);
+        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+        YYSTACK_RELOCATE (yyls_alloc, yyls);
+#  undef YYSTACK_RELOCATE
+        if (yyss1 != yyssa)
+          YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+      yylsp = yyls + yysize - 1;
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+                  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+        YYABORT;
+    }
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  if (yystate == YYFINAL)
+    YYACCEPT;
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+  /* Do appropriate processing given the current state.  Read a
+     lookahead token if we need one and don't already have one.  */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+  yyn = yypact[yystate];
+  if (yypact_value_is_default (yyn))
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = yylex ();
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yytable_value_is_error (yyn))
+        goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  /* Shift the lookahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token.  */
+  yychar = YYEMPTY;
+
+  yystate = yyn;
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+  *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
+  *++yylsp = yylloc;
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     '$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+  /* Default location.  */
+  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 2:
+#line 110 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       parser_output = build_dt_info((yyvsp[-2].flags), (yyvsp[-1].re), (yyvsp[0].node),
+                                                     guess_boot_cpuid((yyvsp[0].node)));
+               }
+#line 1476 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 3:
+#line 118 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.flags) = DTSF_V1;
+               }
+#line 1484 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 4:
+#line 122 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.flags) = DTSF_V1 | DTSF_PLUGIN;
+               }
+#line 1492 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 6:
+#line 130 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       if ((yyvsp[0].flags) != (yyvsp[-1].flags))
+                               ERROR(&(yylsp[0]), "Header flags don't match earlier ones");
+                       (yyval.flags) = (yyvsp[-1].flags);
+               }
+#line 1502 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 7:
+#line 139 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.re) = NULL;
+               }
+#line 1510 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 8:
+#line 143 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
+               }
+#line 1518 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 9:
+#line 150 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
+               }
+#line 1526 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 10:
+#line 154 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
+                       (yyval.re) = (yyvsp[0].re);
+               }
+#line 1535 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 11:
+#line 162 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.node) = name_node((yyvsp[0].node), "");
+               }
+#line 1543 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 12:
+#line 166 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
+               }
+#line 1551 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 13:
+#line 171 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
+
+                       if (target) {
+                               add_label(&target->labels, (yyvsp[-2].labelref));
+                               merge_nodes(target, (yyvsp[0].node));
+                       } else
+                               ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
+                       (yyval.node) = (yyvsp[-3].node);
+               }
+#line 1566 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 14:
+#line 182 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
+
+                       if (target)
+                               merge_nodes(target, (yyvsp[0].node));
+                       else
+                               ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
+                       (yyval.node) = (yyvsp[-2].node);
+               }
+#line 1580 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 15:
+#line 192 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
+
+                       if (target)
+                               delete_node(target);
+                       else
+                               ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
+
+
+                       (yyval.node) = (yyvsp[-3].node);
+               }
+#line 1596 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 16:
+#line 207 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
+               }
+#line 1604 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 17:
+#line 214 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.proplist) = NULL;
+               }
+#line 1612 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 18:
+#line 218 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
+               }
+#line 1620 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 19:
+#line 225 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
+               }
+#line 1628 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 20:
+#line 229 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
+               }
+#line 1636 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 21:
+#line 233 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
+               }
+#line 1644 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 22:
+#line 237 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
+                       (yyval.prop) = (yyvsp[0].prop);
+               }
+#line 1653 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 23:
+#line 245 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
+               }
+#line 1661 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 24:
+#line 249 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
+               }
+#line 1669 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 25:
+#line 253 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
+               }
+#line 1677 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 26:
+#line 257 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
+               }
+#line 1685 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 27:
+#line 261 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
+                       struct data d;
+
+                       if ((yyvsp[-3].integer) != 0)
+                               if (fseek(f, (yyvsp[-3].integer), SEEK_SET) != 0)
+                                       die("Couldn't seek to offset %llu in \"%s\": %s",
+                                           (unsigned long long)(yyvsp[-3].integer), (yyvsp[-5].data).val,
+                                           strerror(errno));
+
+                       d = data_copy_file(f, (yyvsp[-1].integer));
+
+                       (yyval.data) = data_merge((yyvsp[-8].data), d);
+                       fclose(f);
+               }
+#line 1705 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 28:
+#line 277 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
+                       struct data d = empty_data;
+
+                       d = data_copy_file(f, -1);
+
+                       (yyval.data) = data_merge((yyvsp[-4].data), d);
+                       fclose(f);
+               }
+#line 1719 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 29:
+#line 287 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
+               }
+#line 1727 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 30:
+#line 294 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = empty_data;
+               }
+#line 1735 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 31:
+#line 298 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = (yyvsp[-1].data);
+               }
+#line 1743 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 32:
+#line 302 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
+               }
+#line 1751 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 33:
+#line 309 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       unsigned long long bits;
+
+                       bits = (yyvsp[-1].integer);
+
+                       if ((bits !=  8) && (bits != 16) &&
+                           (bits != 32) && (bits != 64)) {
+                               ERROR(&(yylsp[-1]), "Array elements must be"
+                                     " 8, 16, 32 or 64-bits");
+                               bits = 32;
+                       }
+
+                       (yyval.array).data = empty_data;
+                       (yyval.array).bits = bits;
+               }
+#line 1771 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 34:
+#line 325 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.array).data = empty_data;
+                       (yyval.array).bits = 32;
+               }
+#line 1780 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 35:
+#line 330 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       if ((yyvsp[-1].array).bits < 64) {
+                               uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
+                               /*
+                                * Bits above mask must either be all zero
+                                * (positive within range of mask) or all one
+                                * (negative and sign-extended). The second
+                                * condition is true if when we set all bits
+                                * within the mask to one (i.e. | in the
+                                * mask), all bits are one.
+                                */
+                               if (((yyvsp[0].integer) > mask) && (((yyvsp[0].integer) | mask) != -1ULL))
+                                       ERROR(&(yylsp[0]), "Value out of range for"
+                                             " %d-bit array element", (yyvsp[-1].array).bits);
+                       }
+
+                       (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
+               }
+#line 1803 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 36:
+#line 349 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
+
+                       if ((yyvsp[-1].array).bits == 32)
+                               (yyvsp[-1].array).data = data_add_marker((yyvsp[-1].array).data,
+                                                         REF_PHANDLE,
+                                                         (yyvsp[0].labelref));
+                       else
+                               ERROR(&(yylsp[0]), "References are only allowed in "
+                                           "arrays with 32-bit elements.");
+
+                       (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
+               }
+#line 1821 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 37:
+#line 363 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
+               }
+#line 1829 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 40:
+#line 372 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.integer) = (yyvsp[-1].integer);
+               }
+#line 1837 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 43:
+#line 383 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
+#line 1843 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 45:
+#line 388 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); }
+#line 1849 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 47:
+#line 393 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); }
+#line 1855 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 49:
+#line 398 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); }
+#line 1861 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 51:
+#line 403 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); }
+#line 1867 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 53:
+#line 408 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); }
+#line 1873 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 55:
+#line 413 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); }
+#line 1879 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 56:
+#line 414 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); }
+#line 1885 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 58:
+#line 419 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); }
+#line 1891 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 59:
+#line 420 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); }
+#line 1897 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 60:
+#line 421 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); }
+#line 1903 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 61:
+#line 422 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); }
+#line 1909 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 62:
+#line 426 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) << (yyvsp[0].integer); }
+#line 1915 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 63:
+#line 427 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) >> (yyvsp[0].integer); }
+#line 1921 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 65:
+#line 432 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
+#line 1927 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 66:
+#line 433 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
+#line 1933 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 68:
+#line 438 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
+#line 1939 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 69:
+#line 440 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       if ((yyvsp[0].integer) != 0) {
+                               (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer);
+                       } else {
+                               ERROR(&(yyloc), "Division by zero");
+                               (yyval.integer) = 0;
+                       }
+               }
+#line 1952 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 70:
+#line 449 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       if ((yyvsp[0].integer) != 0) {
+                               (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer);
+                       } else {
+                               ERROR(&(yyloc), "Division by zero");
+                               (yyval.integer) = 0;
+                       }
+               }
+#line 1965 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 73:
+#line 462 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = -(yyvsp[0].integer); }
+#line 1971 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 74:
+#line 463 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = ~(yyvsp[0].integer); }
+#line 1977 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 75:
+#line 464 "dtc-parser.y" /* yacc.c:1646  */
+    { (yyval.integer) = !(yyvsp[0].integer); }
+#line 1983 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 76:
+#line 469 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = empty_data;
+               }
+#line 1991 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 77:
+#line 473 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
+               }
+#line 1999 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 78:
+#line 477 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
+               }
+#line 2007 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 79:
+#line 484 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.nodelist) = NULL;
+               }
+#line 2015 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 80:
+#line 488 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
+               }
+#line 2023 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 81:
+#line 492 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       ERROR(&(yylsp[0]), "Properties must precede subnodes");
+                       YYERROR;
+               }
+#line 2032 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 82:
+#line 500 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
+               }
+#line 2040 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 83:
+#line 504 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       (yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
+               }
+#line 2048 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+  case 84:
+#line 508 "dtc-parser.y" /* yacc.c:1646  */
+    {
+                       add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
+                       (yyval.node) = (yyvsp[0].node);
+               }
+#line 2057 "dtc-parser.tab.c" /* yacc.c:1646  */
+    break;
+
+
+#line 2061 "dtc-parser.tab.c" /* yacc.c:1646  */
+      default: break;
+    }
+  /* User semantic actions sometimes alter yychar, and that requires
+     that yytoken be updated with the new translation.  We take the
+     approach of translating immediately before every use of yytoken.
+     One alternative is translating here after every semantic action,
+     but that translation would be missed if the semantic action invokes
+     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
+     incorrect destructor might then be invoked immediately.  In the
+     case of YYERROR or YYBACKUP, subsequent parser actions might lead
+     to an incorrect destructor call or verbose syntax error message
+     before the lookahead is translated.  */
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+  *++yylsp = yyloc;
+
+  /* Now 'shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*--------------------------------------.
+| yyerrlab -- here on detecting error.  |
+`--------------------------------------*/
+yyerrlab:
+  /* Make sure we have latest lookahead translation.  See comments at
+     user semantic actions for why this is necessary.  */
+  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+                                        yyssp, yytoken)
+      {
+        char const *yymsgp = YY_("syntax error");
+        int yysyntax_error_status;
+        yysyntax_error_status = YYSYNTAX_ERROR;
+        if (yysyntax_error_status == 0)
+          yymsgp = yymsg;
+        else if (yysyntax_error_status == 1)
+          {
+            if (yymsg != yymsgbuf)
+              YYSTACK_FREE (yymsg);
+            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+            if (!yymsg)
+              {
+                yymsg = yymsgbuf;
+                yymsg_alloc = sizeof yymsgbuf;
+                yysyntax_error_status = 2;
+              }
+            else
+              {
+                yysyntax_error_status = YYSYNTAX_ERROR;
+                yymsgp = yymsg;
+              }
+          }
+        yyerror (yymsgp);
+        if (yysyntax_error_status == 2)
+          goto yyexhaustedlab;
+      }
+# undef YYSYNTAX_ERROR
+#endif
+    }
+
+  yyerror_range[1] = yylloc;
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+         error, discard it.  */
+
+      if (yychar <= YYEOF)
+        {
+          /* Return failure if at end of input.  */
+          if (yychar == YYEOF)
+            YYABORT;
+        }
+      else
+        {
+          yydestruct ("Error: discarding",
+                      yytoken, &yylval, &yylloc);
+          yychar = YYEMPTY;
+        }
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR.  |
+`---------------------------------------------------*/
+yyerrorlab:
+
+  /* Pacify compilers like GCC when the user code never invokes
+     YYERROR and the label yyerrorlab therefore never appears in user
+     code.  */
+  if (/*CONSTCOND*/ 0)
+     goto yyerrorlab;
+
+  yyerror_range[1] = yylsp[1-yylen];
+  /* Do not reclaim the symbols of the rule whose action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+  yystate = *yyssp;
+  goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR.  |
+`-------------------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (!yypact_value_is_default (yyn))
+        {
+          yyn += YYTERROR;
+          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+            {
+              yyn = yytable[yyn];
+              if (0 < yyn)
+                break;
+            }
+        }
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+        YYABORT;
+
+      yyerror_range[1] = *yylsp;
+      yydestruct ("Error: popping",
+                  yystos[yystate], yyvsp, yylsp);
+      YYPOPSTACK (1);
+      yystate = *yyssp;
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+  *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+  yyerror_range[2] = yylloc;
+  /* Using YYLLOC is tempting, but would change the location of
+     the lookahead.  YYLOC is available though.  */
+  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
+  *++yylsp = yyloc;
+
+  /* Shift the error token.  */
+  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#if !defined yyoverflow || YYERROR_VERBOSE
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+  if (yychar != YYEMPTY)
+    {
+      /* Make sure we have latest lookahead translation.  See comments at
+         user semantic actions for why this is necessary.  */
+      yytoken = YYTRANSLATE (yychar);
+      yydestruct ("Cleanup: discarding lookahead",
+                  yytoken, &yylval, &yylloc);
+    }
+  /* Do not reclaim the symbols of the rule whose action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
+  while (yyssp != yyss)
+    {
+      yydestruct ("Cleanup: popping",
+                  yystos[*yyssp], yyvsp, yylsp);
+      YYPOPSTACK (1);
+    }
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  return yyresult;
+}
+#line 514 "dtc-parser.y" /* yacc.c:1906  */
+
+
+void yyerror(char const *s)
+{
+       ERROR(&yylloc, "%s", s);
+}
diff --git a/scripts/dtc/dtc-parser.tab.h_shipped b/scripts/dtc/dtc-parser.tab.h_shipped
new file mode 100644 (file)
index 0000000..e7b04dd
--- /dev/null
@@ -0,0 +1,123 @@
+/* A Bison parser, made by GNU Bison 3.0.2.  */
+
+/* Bison interface for Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
+   This program 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 3 of the License, or
+   (at your option) any later version.
+
+   This program 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+#ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
+# define YY_YY_DTC_PARSER_TAB_H_INCLUDED
+/* Debug traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int yydebug;
+#endif
+
+/* Token type.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+  enum yytokentype
+  {
+    DT_V1 = 258,
+    DT_PLUGIN = 259,
+    DT_MEMRESERVE = 260,
+    DT_LSHIFT = 261,
+    DT_RSHIFT = 262,
+    DT_LE = 263,
+    DT_GE = 264,
+    DT_EQ = 265,
+    DT_NE = 266,
+    DT_AND = 267,
+    DT_OR = 268,
+    DT_BITS = 269,
+    DT_DEL_PROP = 270,
+    DT_DEL_NODE = 271,
+    DT_PROPNODENAME = 272,
+    DT_LITERAL = 273,
+    DT_CHAR_LITERAL = 274,
+    DT_BYTE = 275,
+    DT_STRING = 276,
+    DT_LABEL = 277,
+    DT_REF = 278,
+    DT_INCBIN = 279
+  };
+#endif
+
+/* Value type.  */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
+{
+#line 39 "dtc-parser.y" /* yacc.c:1909  */
+
+       char *propnodename;
+       char *labelref;
+       uint8_t byte;
+       struct data data;
+
+       struct {
+               struct data     data;
+               int             bits;
+       } array;
+
+       struct property *prop;
+       struct property *proplist;
+       struct node *node;
+       struct node *nodelist;
+       struct reserve_info *re;
+       uint64_t integer;
+       unsigned int flags;
+
+#line 99 "dtc-parser.tab.h" /* yacc.c:1909  */
+};
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+/* Location type.  */
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
+{
+  int first_line;
+  int first_column;
+  int last_line;
+  int last_column;
+};
+# define YYLTYPE_IS_DECLARED 1
+# define YYLTYPE_IS_TRIVIAL 1
+#endif
+
+
+extern YYSTYPE yylval;
+extern YYLTYPE yylloc;
+int yyparse (void);
+
+#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED  */
diff --git a/scripts/dtc/dtc-parser.y b/scripts/dtc/dtc-parser.y
new file mode 100644 (file)
index 0000000..ca3f500
--- /dev/null
@@ -0,0 +1,519 @@
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+%{
+#include <stdio.h>
+#include <inttypes.h>
+
+#include "dtc.h"
+#include "srcpos.h"
+
+extern int yylex(void);
+extern void yyerror(char const *s);
+#define ERROR(loc, ...) \
+       do { \
+               srcpos_error((loc), "Error", __VA_ARGS__); \
+               treesource_error = true; \
+       } while (0)
+
+extern struct dt_info *parser_output;
+extern bool treesource_error;
+%}
+
+%union {
+       char *propnodename;
+       char *labelref;
+       uint8_t byte;
+       struct data data;
+
+       struct {
+               struct data     data;
+               int             bits;
+       } array;
+
+       struct property *prop;
+       struct property *proplist;
+       struct node *node;
+       struct node *nodelist;
+       struct reserve_info *re;
+       uint64_t integer;
+       unsigned int flags;
+}
+
+%token DT_V1
+%token DT_PLUGIN
+%token DT_MEMRESERVE
+%token DT_LSHIFT DT_RSHIFT DT_LE DT_GE DT_EQ DT_NE DT_AND DT_OR
+%token DT_BITS
+%token DT_DEL_PROP
+%token DT_DEL_NODE
+%token <propnodename> DT_PROPNODENAME
+%token <integer> DT_LITERAL
+%token <integer> DT_CHAR_LITERAL
+%token <byte> DT_BYTE
+%token <data> DT_STRING
+%token <labelref> DT_LABEL
+%token <labelref> DT_REF
+%token DT_INCBIN
+
+%type <data> propdata
+%type <data> propdataprefix
+%type <flags> header
+%type <flags> headers
+%type <re> memreserve
+%type <re> memreserves
+%type <array> arrayprefix
+%type <data> bytestring
+%type <prop> propdef
+%type <proplist> proplist
+
+%type <node> devicetree
+%type <node> nodedef
+%type <node> subnode
+%type <nodelist> subnodes
+
+%type <integer> integer_prim
+%type <integer> integer_unary
+%type <integer> integer_mul
+%type <integer> integer_add
+%type <integer> integer_shift
+%type <integer> integer_rela
+%type <integer> integer_eq
+%type <integer> integer_bitand
+%type <integer> integer_bitxor
+%type <integer> integer_bitor
+%type <integer> integer_and
+%type <integer> integer_or
+%type <integer> integer_trinary
+%type <integer> integer_expr
+
+%%
+
+sourcefile:
+         headers memreserves devicetree
+               {
+                       parser_output = build_dt_info($1, $2, $3,
+                                                     guess_boot_cpuid($3));
+               }
+       ;
+
+header:
+         DT_V1 ';'
+               {
+                       $$ = DTSF_V1;
+               }
+       | DT_V1 ';' DT_PLUGIN ';'
+               {
+                       $$ = DTSF_V1 | DTSF_PLUGIN;
+               }
+       ;
+
+headers:
+         header
+       | header headers
+               {
+                       if ($2 != $1)
+                               ERROR(&@2, "Header flags don't match earlier ones");
+                       $$ = $1;
+               }
+       ;
+
+memreserves:
+         /* empty */
+               {
+                       $$ = NULL;
+               }
+       | memreserve memreserves
+               {
+                       $$ = chain_reserve_entry($1, $2);
+               }
+       ;
+
+memreserve:
+         DT_MEMRESERVE integer_prim integer_prim ';'
+               {
+                       $$ = build_reserve_entry($2, $3);
+               }
+       | DT_LABEL memreserve
+               {
+                       add_label(&$2->labels, $1);
+                       $$ = $2;
+               }
+       ;
+
+devicetree:
+         '/' nodedef
+               {
+                       $$ = name_node($2, "");
+               }
+       | devicetree '/' nodedef
+               {
+                       $$ = merge_nodes($1, $3);
+               }
+
+       | devicetree DT_LABEL DT_REF nodedef
+               {
+                       struct node *target = get_node_by_ref($1, $3);
+
+                       if (target) {
+                               add_label(&target->labels, $2);
+                               merge_nodes(target, $4);
+                       } else
+                               ERROR(&@3, "Label or path %s not found", $3);
+                       $$ = $1;
+               }
+       | devicetree DT_REF nodedef
+               {
+                       struct node *target = get_node_by_ref($1, $2);
+
+                       if (target)
+                               merge_nodes(target, $3);
+                       else
+                               ERROR(&@2, "Label or path %s not found", $2);
+                       $$ = $1;
+               }
+       | devicetree DT_DEL_NODE DT_REF ';'
+               {
+                       struct node *target = get_node_by_ref($1, $3);
+
+                       if (target)
+                               delete_node(target);
+                       else
+                               ERROR(&@3, "Label or path %s not found", $3);
+
+
+                       $$ = $1;
+               }
+       ;
+
+nodedef:
+         '{' proplist subnodes '}' ';'
+               {
+                       $$ = build_node($2, $3);
+               }
+       ;
+
+proplist:
+         /* empty */
+               {
+                       $$ = NULL;
+               }
+       | proplist propdef
+               {
+                       $$ = chain_property($2, $1);
+               }
+       ;
+
+propdef:
+         DT_PROPNODENAME '=' propdata ';'
+               {
+                       $$ = build_property($1, $3);
+               }
+       | DT_PROPNODENAME ';'
+               {
+                       $$ = build_property($1, empty_data);
+               }
+       | DT_DEL_PROP DT_PROPNODENAME ';'
+               {
+                       $$ = build_property_delete($2);
+               }
+       | DT_LABEL propdef
+               {
+                       add_label(&$2->labels, $1);
+                       $$ = $2;
+               }
+       ;
+
+propdata:
+         propdataprefix DT_STRING
+               {
+                       $$ = data_merge($1, $2);
+               }
+       | propdataprefix arrayprefix '>'
+               {
+                       $$ = data_merge($1, $2.data);
+               }
+       | propdataprefix '[' bytestring ']'
+               {
+                       $$ = data_merge($1, $3);
+               }
+       | propdataprefix DT_REF
+               {
+                       $$ = data_add_marker($1, REF_PATH, $2);
+               }
+       | propdataprefix DT_INCBIN '(' DT_STRING ',' integer_prim ',' integer_prim ')'
+               {
+                       FILE *f = srcfile_relative_open($4.val, NULL);
+                       struct data d;
+
+                       if ($6 != 0)
+                               if (fseek(f, $6, SEEK_SET) != 0)
+                                       die("Couldn't seek to offset %llu in \"%s\": %s",
+                                           (unsigned long long)$6, $4.val,
+                                           strerror(errno));
+
+                       d = data_copy_file(f, $8);
+
+                       $$ = data_merge($1, d);
+                       fclose(f);
+               }
+       | propdataprefix DT_INCBIN '(' DT_STRING ')'
+               {
+                       FILE *f = srcfile_relative_open($4.val, NULL);
+                       struct data d = empty_data;
+
+                       d = data_copy_file(f, -1);
+
+                       $$ = data_merge($1, d);
+                       fclose(f);
+               }
+       | propdata DT_LABEL
+               {
+                       $$ = data_add_marker($1, LABEL, $2);
+               }
+       ;
+
+propdataprefix:
+         /* empty */
+               {
+                       $$ = empty_data;
+               }
+       | propdata ','
+               {
+                       $$ = $1;
+               }
+       | propdataprefix DT_LABEL
+               {
+                       $$ = data_add_marker($1, LABEL, $2);
+               }
+       ;
+
+arrayprefix:
+       DT_BITS DT_LITERAL '<'
+               {
+                       unsigned long long bits;
+
+                       bits = $2;
+
+                       if ((bits !=  8) && (bits != 16) &&
+                           (bits != 32) && (bits != 64)) {
+                               ERROR(&@2, "Array elements must be"
+                                     " 8, 16, 32 or 64-bits");
+                               bits = 32;
+                       }
+
+                       $$.data = empty_data;
+                       $$.bits = bits;
+               }
+       | '<'
+               {
+                       $$.data = empty_data;
+                       $$.bits = 32;
+               }
+       | arrayprefix integer_prim
+               {
+                       if ($1.bits < 64) {
+                               uint64_t mask = (1ULL << $1.bits) - 1;
+                               /*
+                                * Bits above mask must either be all zero
+                                * (positive within range of mask) or all one
+                                * (negative and sign-extended). The second
+                                * condition is true if when we set all bits
+                                * within the mask to one (i.e. | in the
+                                * mask), all bits are one.
+                                */
+                               if (($2 > mask) && (($2 | mask) != -1ULL))
+                                       ERROR(&@2, "Value out of range for"
+                                             " %d-bit array element", $1.bits);
+                       }
+
+                       $$.data = data_append_integer($1.data, $2, $1.bits);
+               }
+       | arrayprefix DT_REF
+               {
+                       uint64_t val = ~0ULL >> (64 - $1.bits);
+
+                       if ($1.bits == 32)
+                               $1.data = data_add_marker($1.data,
+                                                         REF_PHANDLE,
+                                                         $2);
+                       else
+                               ERROR(&@2, "References are only allowed in "
+                                           "arrays with 32-bit elements.");
+
+                       $$.data = data_append_integer($1.data, val, $1.bits);
+               }
+       | arrayprefix DT_LABEL
+               {
+                       $$.data = data_add_marker($1.data, LABEL, $2);
+               }
+       ;
+
+integer_prim:
+         DT_LITERAL
+       | DT_CHAR_LITERAL
+       | '(' integer_expr ')'
+               {
+                       $$ = $2;
+               }
+       ;
+
+integer_expr:
+       integer_trinary
+       ;
+
+integer_trinary:
+         integer_or
+       | integer_or '?' integer_expr ':' integer_trinary { $$ = $1 ? $3 : $5; }
+       ;
+
+integer_or:
+         integer_and
+       | integer_or DT_OR integer_and { $$ = $1 || $3; }
+       ;
+
+integer_and:
+         integer_bitor
+       | integer_and DT_AND integer_bitor { $$ = $1 && $3; }
+       ;
+
+integer_bitor:
+         integer_bitxor
+       | integer_bitor '|' integer_bitxor { $$ = $1 | $3; }
+       ;
+
+integer_bitxor:
+         integer_bitand
+       | integer_bitxor '^' integer_bitand { $$ = $1 ^ $3; }
+       ;
+
+integer_bitand:
+         integer_eq
+       | integer_bitand '&' integer_eq { $$ = $1 & $3; }
+       ;
+
+integer_eq:
+         integer_rela
+       | integer_eq DT_EQ integer_rela { $$ = $1 == $3; }
+       | integer_eq DT_NE integer_rela { $$ = $1 != $3; }
+       ;
+
+integer_rela:
+         integer_shift
+       | integer_rela '<' integer_shift { $$ = $1 < $3; }
+       | integer_rela '>' integer_shift { $$ = $1 > $3; }
+       | integer_rela DT_LE integer_shift { $$ = $1 <= $3; }
+       | integer_rela DT_GE integer_shift { $$ = $1 >= $3; }
+       ;
+
+integer_shift:
+         integer_shift DT_LSHIFT integer_add { $$ = $1 << $3; }
+       | integer_shift DT_RSHIFT integer_add { $$ = $1 >> $3; }
+       | integer_add
+       ;
+
+integer_add:
+         integer_add '+' integer_mul { $$ = $1 + $3; }
+       | integer_add '-' integer_mul { $$ = $1 - $3; }
+       | integer_mul
+       ;
+
+integer_mul:
+         integer_mul '*' integer_unary { $$ = $1 * $3; }
+       | integer_mul '/' integer_unary
+               {
+                       if ($3 != 0) {
+                               $$ = $1 / $3;
+                       } else {
+                               ERROR(&@$, "Division by zero");
+                               $$ = 0;
+                       }
+               }
+       | integer_mul '%' integer_unary
+               {
+                       if ($3 != 0) {
+                               $$ = $1 % $3;
+                       } else {
+                               ERROR(&@$, "Division by zero");
+                               $$ = 0;
+                       }
+               }
+       | integer_unary
+       ;
+
+integer_unary:
+         integer_prim
+       | '-' integer_unary { $$ = -$2; }
+       | '~' integer_unary { $$ = ~$2; }
+       | '!' integer_unary { $$ = !$2; }
+       ;
+
+bytestring:
+         /* empty */
+               {
+                       $$ = empty_data;
+               }
+       | bytestring DT_BYTE
+               {
+                       $$ = data_append_byte($1, $2);
+               }
+       | bytestring DT_LABEL
+               {
+                       $$ = data_add_marker($1, LABEL, $2);
+               }
+       ;
+
+subnodes:
+         /* empty */
+               {
+                       $$ = NULL;
+               }
+       | subnode subnodes
+               {
+                       $$ = chain_node($1, $2);
+               }
+       | subnode propdef
+               {
+                       ERROR(&@2, "Properties must precede subnodes");
+                       YYERROR;
+               }
+       ;
+
+subnode:
+         DT_PROPNODENAME nodedef
+               {
+                       $$ = name_node($2, $1);
+               }
+       | DT_DEL_NODE DT_PROPNODENAME ';'
+               {
+                       $$ = name_node(build_node_delete(), $2);
+               }
+       | DT_LABEL subnode
+               {
+                       add_label(&$2->labels, $1);
+                       $$ = $2;
+               }
+       ;
+
+%%
+
+void yyerror(char const *s)
+{
+       ERROR(&yylloc, "%s", s);
+}
diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c
new file mode 100644 (file)
index 0000000..5ed873c
--- /dev/null
@@ -0,0 +1,365 @@
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#include <sys/stat.h>
+
+#include "dtc.h"
+#include "srcpos.h"
+
+/*
+ * Command line options
+ */
+int quiet;             /* Level of quietness */
+int reservenum;                /* Number of memory reservation slots */
+int minsize;           /* Minimum blob size */
+int padsize;           /* Additional padding to blob */
+int alignsize;         /* Additional padding to blob accroding to the alignsize */
+int phandle_format = PHANDLE_EPAPR;    /* Use linux,phandle or phandle properties */
+int generate_symbols;  /* enable symbols & fixup support */
+int generate_fixups;           /* suppress generation of fixups on symbol support */
+int auto_label_aliases;                /* auto generate labels -> aliases */
+
+static int is_power_of_2(int x)
+{
+       return (x > 0) && ((x & (x - 1)) == 0);
+}
+
+static void fill_fullpaths(struct node *tree, const char *prefix)
+{
+       struct node *child;
+       const char *unit;
+
+       tree->fullpath = join_path(prefix, tree->name);
+
+       unit = strchr(tree->name, '@');
+       if (unit)
+               tree->basenamelen = unit - tree->name;
+       else
+               tree->basenamelen = strlen(tree->name);
+
+       for_each_child(tree, child)
+               fill_fullpaths(child, tree->fullpath);
+}
+
+/* Usage related data. */
+#define FDT_VERSION(version)   _FDT_VERSION(version)
+#define _FDT_VERSION(version)  #version
+static const char usage_synopsis[] = "dtc [options] <input file>";
+static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@Ahv";
+static struct option const usage_long_opts[] = {
+       {"quiet",            no_argument, NULL, 'q'},
+       {"in-format",         a_argument, NULL, 'I'},
+       {"out",               a_argument, NULL, 'o'},
+       {"out-format",        a_argument, NULL, 'O'},
+       {"out-version",       a_argument, NULL, 'V'},
+       {"out-dependency",    a_argument, NULL, 'd'},
+       {"reserve",           a_argument, NULL, 'R'},
+       {"space",             a_argument, NULL, 'S'},
+       {"pad",               a_argument, NULL, 'p'},
+       {"align",             a_argument, NULL, 'a'},
+       {"boot-cpu",          a_argument, NULL, 'b'},
+       {"force",            no_argument, NULL, 'f'},
+       {"include",           a_argument, NULL, 'i'},
+       {"sort",             no_argument, NULL, 's'},
+       {"phandle",           a_argument, NULL, 'H'},
+       {"warning",           a_argument, NULL, 'W'},
+       {"error",             a_argument, NULL, 'E'},
+       {"symbols",          no_argument, NULL, '@'},
+       {"auto-alias",       no_argument, NULL, 'A'},
+       {"help",             no_argument, NULL, 'h'},
+       {"version",          no_argument, NULL, 'v'},
+       {NULL,               no_argument, NULL, 0x0},
+};
+static const char * const usage_opts_help[] = {
+       "\n\tQuiet: -q suppress warnings, -qq errors, -qqq all",
+       "\n\tInput formats are:\n"
+        "\t\tdts - device tree source text\n"
+        "\t\tdtb - device tree blob\n"
+        "\t\tfs  - /proc/device-tree style directory",
+       "\n\tOutput file",
+       "\n\tOutput formats are:\n"
+        "\t\tdts - device tree source text\n"
+        "\t\tdtb - device tree blob\n"
+        "\t\tasm - assembler source",
+       "\n\tBlob version to produce, defaults to "FDT_VERSION(DEFAULT_FDT_VERSION)" (for dtb and asm output)",
+       "\n\tOutput dependency file",
+       "\n\tMake space for <number> reserve map entries (for dtb and asm output)",
+       "\n\tMake the blob at least <bytes> long (extra space)",
+       "\n\tAdd padding to the blob of <bytes> long (extra space)",
+       "\n\tMake the blob align to the <bytes> (extra space)",
+       "\n\tSet the physical boot cpu",
+       "\n\tTry to produce output even if the input tree has errors",
+       "\n\tAdd a path to search for include files",
+       "\n\tSort nodes and properties before outputting (useful for comparing trees)",
+       "\n\tValid phandle formats are:\n"
+        "\t\tlegacy - \"linux,phandle\" properties only\n"
+        "\t\tepapr  - \"phandle\" properties only\n"
+        "\t\tboth   - Both \"linux,phandle\" and \"phandle\" properties",
+       "\n\tEnable/disable warnings (prefix with \"no-\")",
+       "\n\tEnable/disable errors (prefix with \"no-\")",
+       "\n\tEnable generation of symbols",
+       "\n\tEnable auto-alias of labels",
+       "\n\tPrint this help and exit",
+       "\n\tPrint version and exit",
+       NULL,
+};
+
+static const char *guess_type_by_name(const char *fname, const char *fallback)
+{
+       const char *s;
+
+       s = strrchr(fname, '.');
+       if (s == NULL)
+               return fallback;
+       if (!strcasecmp(s, ".dts"))
+               return "dts";
+       if (!strcasecmp(s, ".dtb"))
+               return "dtb";
+       return fallback;
+}
+
+static const char *guess_input_format(const char *fname, const char *fallback)
+{
+       struct stat statbuf;
+       fdt32_t magic;
+       FILE *f;
+
+       if (stat(fname, &statbuf) != 0)
+               return fallback;
+
+       if (S_ISDIR(statbuf.st_mode))
+               return "fs";
+
+       if (!S_ISREG(statbuf.st_mode))
+               return fallback;
+
+       f = fopen(fname, "r");
+       if (f == NULL)
+               return fallback;
+       if (fread(&magic, 4, 1, f) != 1) {
+               fclose(f);
+               return fallback;
+       }
+       fclose(f);
+
+       if (fdt32_to_cpu(magic) == FDT_MAGIC)
+               return "dtb";
+
+       return guess_type_by_name(fname, fallback);
+}
+
+int main(int argc, char *argv[])
+{
+       struct dt_info *dti;
+       const char *inform = NULL;
+       const char *outform = NULL;
+       const char *outname = "-";
+       const char *depname = NULL;
+       bool force = false, sort = false;
+       const char *arg;
+       int opt;
+       FILE *outf = NULL;
+       int outversion = DEFAULT_FDT_VERSION;
+       long long cmdline_boot_cpuid = -1;
+
+       quiet      = 0;
+       reservenum = 0;
+       minsize    = 0;
+       padsize    = 0;
+       alignsize  = 0;
+
+       while ((opt = util_getopt_long()) != EOF) {
+               switch (opt) {
+               case 'I':
+                       inform = optarg;
+                       break;
+               case 'O':
+                       outform = optarg;
+                       break;
+               case 'o':
+                       outname = optarg;
+                       break;
+               case 'V':
+                       outversion = strtol(optarg, NULL, 0);
+                       break;
+               case 'd':
+                       depname = optarg;
+                       break;
+               case 'R':
+                       reservenum = strtol(optarg, NULL, 0);
+                       break;
+               case 'S':
+                       minsize = strtol(optarg, NULL, 0);
+                       break;
+               case 'p':
+                       padsize = strtol(optarg, NULL, 0);
+                       break;
+               case 'a':
+                       alignsize = strtol(optarg, NULL, 0);
+                       if (!is_power_of_2(alignsize))
+                               die("Invalid argument \"%d\" to -a option\n",
+                                   alignsize);
+                       break;
+               case 'f':
+                       force = true;
+                       break;
+               case 'q':
+                       quiet++;
+                       break;
+               case 'b':
+                       cmdline_boot_cpuid = strtoll(optarg, NULL, 0);
+                       break;
+               case 'i':
+                       srcfile_add_search_path(optarg);
+                       break;
+               case 'v':
+                       util_version();
+               case 'H':
+                       if (streq(optarg, "legacy"))
+                               phandle_format = PHANDLE_LEGACY;
+                       else if (streq(optarg, "epapr"))
+                               phandle_format = PHANDLE_EPAPR;
+                       else if (streq(optarg, "both"))
+                               phandle_format = PHANDLE_BOTH;
+                       else
+                               die("Invalid argument \"%s\" to -H option\n",
+                                   optarg);
+                       break;
+
+               case 's':
+                       sort = true;
+                       break;
+
+               case 'W':
+                       parse_checks_option(true, false, optarg);
+                       break;
+
+               case 'E':
+                       parse_checks_option(false, true, optarg);
+                       break;
+
+               case '@':
+                       generate_symbols = 1;
+                       break;
+               case 'A':
+                       auto_label_aliases = 1;
+                       break;
+
+               case 'h':
+                       usage(NULL);
+               default:
+                       usage("unknown option");
+               }
+       }
+
+       if (argc > (optind+1))
+               usage("missing files");
+       else if (argc < (optind+1))
+               arg = "-";
+       else
+               arg = argv[optind];
+
+       /* minsize and padsize are mutually exclusive */
+       if (minsize && padsize)
+               die("Can't set both -p and -S\n");
+
+       if (depname) {
+               depfile = fopen(depname, "w");
+               if (!depfile)
+                       die("Couldn't open dependency file %s: %s\n", depname,
+                           strerror(errno));
+               fprintf(depfile, "%s:", outname);
+       }
+
+       if (inform == NULL)
+               inform = guess_input_format(arg, "dts");
+       if (outform == NULL) {
+               outform = guess_type_by_name(outname, NULL);
+               if (outform == NULL) {
+                       if (streq(inform, "dts"))
+                               outform = "dtb";
+                       else
+                               outform = "dts";
+               }
+       }
+       if (streq(inform, "dts"))
+               dti = dt_from_source(arg);
+       else if (streq(inform, "fs"))
+               dti = dt_from_fs(arg);
+       else if(streq(inform, "dtb"))
+               dti = dt_from_blob(arg);
+       else
+               die("Unknown input format \"%s\"\n", inform);
+
+       dti->outname = outname;
+
+       if (depfile) {
+               fputc('\n', depfile);
+               fclose(depfile);
+       }
+
+       if (cmdline_boot_cpuid != -1)
+               dti->boot_cpuid_phys = cmdline_boot_cpuid;
+
+       fill_fullpaths(dti->dt, "");
+       process_checks(force, dti);
+
+       /* on a plugin, generate by default */
+       if (dti->dtsflags & DTSF_PLUGIN) {
+               generate_fixups = 1;
+       }
+
+       if (auto_label_aliases)
+               generate_label_tree(dti, "aliases", false);
+
+       if (generate_symbols)
+               generate_label_tree(dti, "__symbols__", true);
+
+       if (generate_fixups) {
+               generate_fixups_tree(dti, "__fixups__");
+               generate_local_fixups_tree(dti, "__local_fixups__");
+       }
+
+       if (sort)
+               sort_tree(dti);
+
+       if (streq(outname, "-")) {
+               outf = stdout;
+       } else {
+               outf = fopen(outname, "wb");
+               if (! outf)
+                       die("Couldn't open output file %s: %s\n",
+                           outname, strerror(errno));
+       }
+
+       if (streq(outform, "dts")) {
+               dt_to_source(outf, dti);
+       } else if (streq(outform, "dtb")) {
+               dt_to_blob(outf, dti, outversion);
+       } else if (streq(outform, "asm")) {
+               dt_to_asm(outf, dti, outversion);
+       } else if (streq(outform, "null")) {
+               /* do nothing */
+       } else {
+               die("Unknown output format \"%s\"\n", outform);
+       }
+
+       exit(0);
+}
diff --git a/scripts/dtc/dtc.h b/scripts/dtc/dtc.h
new file mode 100644 (file)
index 0000000..409db76
--- /dev/null
@@ -0,0 +1,290 @@
+#ifndef _DTC_H
+#define _DTC_H
+
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <unistd.h>
+#include <inttypes.h>
+
+#include <libfdt_env.h>
+#include <fdt.h>
+
+#include "util.h"
+
+#ifdef DEBUG
+#define debug(...)     printf(__VA_ARGS__)
+#else
+#define debug(...)
+#endif
+
+#define DEFAULT_FDT_VERSION    17
+
+/*
+ * Command line options
+ */
+extern int quiet;              /* Level of quietness */
+extern int reservenum;         /* Number of memory reservation slots */
+extern int minsize;            /* Minimum blob size */
+extern int padsize;            /* Additional padding to blob */
+extern int alignsize;          /* Additional padding to blob accroding to the alignsize */
+extern int phandle_format;     /* Use linux,phandle or phandle properties */
+extern int generate_symbols;   /* generate symbols for nodes with labels */
+extern int generate_fixups;    /* generate fixups */
+extern int auto_label_aliases; /* auto generate labels -> aliases */
+
+#define PHANDLE_LEGACY 0x1
+#define PHANDLE_EPAPR  0x2
+#define PHANDLE_BOTH   0x3
+
+typedef uint32_t cell_t;
+
+
+#define streq(a, b)    (strcmp((a), (b)) == 0)
+#define strneq(a, b, n)        (strncmp((a), (b), (n)) == 0)
+
+#define ALIGN(x, a)    (((x) + (a) - 1) & ~((a) - 1))
+
+/* Data blobs */
+enum markertype {
+       REF_PHANDLE,
+       REF_PATH,
+       LABEL,
+};
+
+struct  marker {
+       enum markertype type;
+       int offset;
+       char *ref;
+       struct marker *next;
+};
+
+struct data {
+       int len;
+       char *val;
+       struct marker *markers;
+};
+
+
+#define empty_data ((struct data){ 0 /* all .members = 0 or NULL */ })
+
+#define for_each_marker(m) \
+       for (; (m); (m) = (m)->next)
+#define for_each_marker_of_type(m, t) \
+       for_each_marker(m) \
+               if ((m)->type == (t))
+
+void data_free(struct data d);
+
+struct data data_grow_for(struct data d, int xlen);
+
+struct data data_copy_mem(const char *mem, int len);
+struct data data_copy_escape_string(const char *s, int len);
+struct data data_copy_file(FILE *f, size_t len);
+
+struct data data_append_data(struct data d, const void *p, int len);
+struct data data_insert_at_marker(struct data d, struct marker *m,
+                                 const void *p, int len);
+struct data data_merge(struct data d1, struct data d2);
+struct data data_append_cell(struct data d, cell_t word);
+struct data data_append_integer(struct data d, uint64_t word, int bits);
+struct data data_append_re(struct data d, uint64_t address, uint64_t size);
+struct data data_append_addr(struct data d, uint64_t addr);
+struct data data_append_byte(struct data d, uint8_t byte);
+struct data data_append_zeroes(struct data d, int len);
+struct data data_append_align(struct data d, int align);
+
+struct data data_add_marker(struct data d, enum markertype type, char *ref);
+
+bool data_is_one_string(struct data d);
+
+/* DT constraints */
+
+#define MAX_PROPNAME_LEN       31
+#define MAX_NODENAME_LEN       31
+
+/* Live trees */
+struct label {
+       bool deleted;
+       char *label;
+       struct label *next;
+};
+
+struct bus_type {
+       const char *name;
+};
+
+struct property {
+       bool deleted;
+       char *name;
+       struct data val;
+
+       struct property *next;
+
+       struct label *labels;
+};
+
+struct node {
+       bool deleted;
+       char *name;
+       struct property *proplist;
+       struct node *children;
+
+       struct node *parent;
+       struct node *next_sibling;
+
+       char *fullpath;
+       int basenamelen;
+
+       cell_t phandle;
+       int addr_cells, size_cells;
+
+       struct label *labels;
+       const struct bus_type *bus;
+};
+
+#define for_each_label_withdel(l0, l) \
+       for ((l) = (l0); (l); (l) = (l)->next)
+
+#define for_each_label(l0, l) \
+       for_each_label_withdel(l0, l) \
+               if (!(l)->deleted)
+
+#define for_each_property_withdel(n, p) \
+       for ((p) = (n)->proplist; (p); (p) = (p)->next)
+
+#define for_each_property(n, p) \
+       for_each_property_withdel(n, p) \
+               if (!(p)->deleted)
+
+#define for_each_child_withdel(n, c) \
+       for ((c) = (n)->children; (c); (c) = (c)->next_sibling)
+
+#define for_each_child(n, c) \
+       for_each_child_withdel(n, c) \
+               if (!(c)->deleted)
+
+void add_label(struct label **labels, char *label);
+void delete_labels(struct label **labels);
+
+struct property *build_property(char *name, struct data val);
+struct property *build_property_delete(char *name);
+struct property *chain_property(struct property *first, struct property *list);
+struct property *reverse_properties(struct property *first);
+
+struct node *build_node(struct property *proplist, struct node *children);
+struct node *build_node_delete(void);
+struct node *name_node(struct node *node, char *name);
+struct node *chain_node(struct node *first, struct node *list);
+struct node *merge_nodes(struct node *old_node, struct node *new_node);
+
+void add_property(struct node *node, struct property *prop);
+void delete_property_by_name(struct node *node, char *name);
+void delete_property(struct property *prop);
+void add_child(struct node *parent, struct node *child);
+void delete_node_by_name(struct node *parent, char *name);
+void delete_node(struct node *node);
+void append_to_property(struct node *node,
+                       char *name, const void *data, int len);
+
+const char *get_unitname(struct node *node);
+struct property *get_property(struct node *node, const char *propname);
+cell_t propval_cell(struct property *prop);
+struct property *get_property_by_label(struct node *tree, const char *label,
+                                      struct node **node);
+struct marker *get_marker_label(struct node *tree, const char *label,
+                               struct node **node, struct property **prop);
+struct node *get_subnode(struct node *node, const char *nodename);
+struct node *get_node_by_path(struct node *tree, const char *path);
+struct node *get_node_by_label(struct node *tree, const char *label);
+struct node *get_node_by_phandle(struct node *tree, cell_t phandle);
+struct node *get_node_by_ref(struct node *tree, const char *ref);
+cell_t get_node_phandle(struct node *root, struct node *node);
+
+uint32_t guess_boot_cpuid(struct node *tree);
+
+/* Boot info (tree plus memreserve information */
+
+struct reserve_info {
+       uint64_t address, size;
+
+       struct reserve_info *next;
+
+       struct label *labels;
+};
+
+struct reserve_info *build_reserve_entry(uint64_t start, uint64_t len);
+struct reserve_info *chain_reserve_entry(struct reserve_info *first,
+                                        struct reserve_info *list);
+struct reserve_info *add_reserve_entry(struct reserve_info *list,
+                                      struct reserve_info *new);
+
+
+struct dt_info {
+       unsigned int dtsflags;
+       struct reserve_info *reservelist;
+       uint32_t boot_cpuid_phys;
+       struct node *dt;                /* the device tree */
+       const char *outname;            /* filename being written to, "-" for stdout */
+};
+
+/* DTS version flags definitions */
+#define DTSF_V1                0x0001  /* /dts-v1/ */
+#define DTSF_PLUGIN    0x0002  /* /plugin/ */
+
+struct dt_info *build_dt_info(unsigned int dtsflags,
+                             struct reserve_info *reservelist,
+                             struct node *tree, uint32_t boot_cpuid_phys);
+void sort_tree(struct dt_info *dti);
+void generate_label_tree(struct dt_info *dti, char *name, bool allocph);
+void generate_fixups_tree(struct dt_info *dti, char *name);
+void generate_local_fixups_tree(struct dt_info *dti, char *name);
+
+/* Checks */
+
+void parse_checks_option(bool warn, bool error, const char *arg);
+void process_checks(bool force, struct dt_info *dti);
+
+/* Flattened trees */
+
+void dt_to_blob(FILE *f, struct dt_info *dti, int version);
+void dt_to_asm(FILE *f, struct dt_info *dti, int version);
+
+struct dt_info *dt_from_blob(const char *fname);
+
+/* Tree source */
+
+void dt_to_source(FILE *f, struct dt_info *dti);
+struct dt_info *dt_from_source(const char *f);
+
+/* FS trees */
+
+struct dt_info *dt_from_fs(const char *dirname);
+
+#endif /* _DTC_H */
diff --git a/scripts/dtc/flattree.c b/scripts/dtc/flattree.c
new file mode 100644 (file)
index 0000000..fcf7154
--- /dev/null
@@ -0,0 +1,940 @@
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#include "dtc.h"
+#include "srcpos.h"
+
+#define FTF_FULLPATH   0x1
+#define FTF_VARALIGN   0x2
+#define FTF_NAMEPROPS  0x4
+#define FTF_BOOTCPUID  0x8
+#define FTF_STRTABSIZE 0x10
+#define FTF_STRUCTSIZE 0x20
+#define FTF_NOPS       0x40
+
+static struct version_info {
+       int version;
+       int last_comp_version;
+       int hdr_size;
+       int flags;
+} version_table[] = {
+       {1, 1, FDT_V1_SIZE,
+        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS},
+       {2, 1, FDT_V2_SIZE,
+        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID},
+       {3, 1, FDT_V3_SIZE,
+        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID|FTF_STRTABSIZE},
+       {16, 16, FDT_V3_SIZE,
+        FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_NOPS},
+       {17, 16, FDT_V17_SIZE,
+        FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_STRUCTSIZE|FTF_NOPS},
+};
+
+struct emitter {
+       void (*cell)(void *, cell_t);
+       void (*string)(void *, const char *, int);
+       void (*align)(void *, int);
+       void (*data)(void *, struct data);
+       void (*beginnode)(void *, struct label *labels);
+       void (*endnode)(void *, struct label *labels);
+       void (*property)(void *, struct label *labels);
+};
+
+static void bin_emit_cell(void *e, cell_t val)
+{
+       struct data *dtbuf = e;
+
+       *dtbuf = data_append_cell(*dtbuf, val);
+}
+
+static void bin_emit_string(void *e, const char *str, int len)
+{
+       struct data *dtbuf = e;
+
+       if (len == 0)
+               len = strlen(str);
+
+       *dtbuf = data_append_data(*dtbuf, str, len);
+       *dtbuf = data_append_byte(*dtbuf, '\0');
+}
+
+static void bin_emit_align(void *e, int a)
+{
+       struct data *dtbuf = e;
+
+       *dtbuf = data_append_align(*dtbuf, a);
+}
+
+static void bin_emit_data(void *e, struct data d)
+{
+       struct data *dtbuf = e;
+
+       *dtbuf = data_append_data(*dtbuf, d.val, d.len);
+}
+
+static void bin_emit_beginnode(void *e, struct label *labels)
+{
+       bin_emit_cell(e, FDT_BEGIN_NODE);
+}
+
+static void bin_emit_endnode(void *e, struct label *labels)
+{
+       bin_emit_cell(e, FDT_END_NODE);
+}
+
+static void bin_emit_property(void *e, struct label *labels)
+{
+       bin_emit_cell(e, FDT_PROP);
+}
+
+static struct emitter bin_emitter = {
+       .cell = bin_emit_cell,
+       .string = bin_emit_string,
+       .align = bin_emit_align,
+       .data = bin_emit_data,
+       .beginnode = bin_emit_beginnode,
+       .endnode = bin_emit_endnode,
+       .property = bin_emit_property,
+};
+
+static void emit_label(FILE *f, const char *prefix, const char *label)
+{
+       fprintf(f, "\t.globl\t%s_%s\n", prefix, label);
+       fprintf(f, "%s_%s:\n", prefix, label);
+       fprintf(f, "_%s_%s:\n", prefix, label);
+}
+
+static void emit_offset_label(FILE *f, const char *label, int offset)
+{
+       fprintf(f, "\t.globl\t%s\n", label);
+       fprintf(f, "%s\t= . + %d\n", label, offset);
+}
+
+#define ASM_EMIT_BELONG(f, fmt, ...) \
+       { \
+               fprintf((f), "\t.byte\t((" fmt ") >> 24) & 0xff\n", __VA_ARGS__); \
+               fprintf((f), "\t.byte\t((" fmt ") >> 16) & 0xff\n", __VA_ARGS__); \
+               fprintf((f), "\t.byte\t((" fmt ") >> 8) & 0xff\n", __VA_ARGS__); \
+               fprintf((f), "\t.byte\t(" fmt ") & 0xff\n", __VA_ARGS__); \
+       }
+
+static void asm_emit_cell(void *e, cell_t val)
+{
+       FILE *f = e;
+
+       fprintf(f, "\t.byte 0x%02x; .byte 0x%02x; .byte 0x%02x; .byte 0x%02x\n",
+               (val >> 24) & 0xff, (val >> 16) & 0xff,
+               (val >> 8) & 0xff, val & 0xff);
+}
+
+static void asm_emit_string(void *e, const char *str, int len)
+{
+       FILE *f = e;
+
+       if (len != 0)
+               fprintf(f, "\t.string\t\"%.*s\"\n", len, str);
+       else
+               fprintf(f, "\t.string\t\"%s\"\n", str);
+}
+
+static void asm_emit_align(void *e, int a)
+{
+       FILE *f = e;
+
+       fprintf(f, "\t.balign\t%d, 0\n", a);
+}
+
+static void asm_emit_data(void *e, struct data d)
+{
+       FILE *f = e;
+       int off = 0;
+       struct marker *m = d.markers;
+
+       for_each_marker_of_type(m, LABEL)
+               emit_offset_label(f, m->ref, m->offset);
+
+       while ((d.len - off) >= sizeof(uint32_t)) {
+               asm_emit_cell(e, fdt32_to_cpu(*((fdt32_t *)(d.val+off))));
+               off += sizeof(uint32_t);
+       }
+
+       while ((d.len - off) >= 1) {
+               fprintf(f, "\t.byte\t0x%hhx\n", d.val[off]);
+               off += 1;
+       }
+
+       assert(off == d.len);
+}
+
+static void asm_emit_beginnode(void *e, struct label *labels)
+{
+       FILE *f = e;
+       struct label *l;
+
+       for_each_label(labels, l) {
+               fprintf(f, "\t.globl\t%s\n", l->label);
+               fprintf(f, "%s:\n", l->label);
+       }
+       fprintf(f, "\t/* FDT_BEGIN_NODE */\n");
+       asm_emit_cell(e, FDT_BEGIN_NODE);
+}
+
+static void asm_emit_endnode(void *e, struct label *labels)
+{
+       FILE *f = e;
+       struct label *l;
+
+       fprintf(f, "\t/* FDT_END_NODE */\n");
+       asm_emit_cell(e, FDT_END_NODE);
+       for_each_label(labels, l) {
+               fprintf(f, "\t.globl\t%s_end\n", l->label);
+               fprintf(f, "%s_end:\n", l->label);
+       }
+}
+
+static void asm_emit_property(void *e, struct label *labels)
+{
+       FILE *f = e;
+       struct label *l;
+
+       for_each_label(labels, l) {
+               fprintf(f, "\t.globl\t%s\n", l->label);
+               fprintf(f, "%s:\n", l->label);
+       }
+       fprintf(f, "\t/* FDT_PROP */\n");
+       asm_emit_cell(e, FDT_PROP);
+}
+
+static struct emitter asm_emitter = {
+       .cell = asm_emit_cell,
+       .string = asm_emit_string,
+       .align = asm_emit_align,
+       .data = asm_emit_data,
+       .beginnode = asm_emit_beginnode,
+       .endnode = asm_emit_endnode,
+       .property = asm_emit_property,
+};
+
+static int stringtable_insert(struct data *d, const char *str)
+{
+       int i;
+
+       /* FIXME: do this more efficiently? */
+
+       for (i = 0; i < d->len; i++) {
+               if (streq(str, d->val + i))
+                       return i;
+       }
+
+       *d = data_append_data(*d, str, strlen(str)+1);
+       return i;
+}
+
+static void flatten_tree(struct node *tree, struct emitter *emit,
+                        void *etarget, struct data *strbuf,
+                        struct version_info *vi)
+{
+       struct property *prop;
+       struct node *child;
+       bool seen_name_prop = false;
+
+       if (tree->deleted)
+               return;
+
+       emit->beginnode(etarget, tree->labels);
+
+       if (vi->flags & FTF_FULLPATH)
+               emit->string(etarget, tree->fullpath, 0);
+       else
+               emit->string(etarget, tree->name, 0);
+
+       emit->align(etarget, sizeof(cell_t));
+
+       for_each_property(tree, prop) {
+               int nameoff;
+
+               if (streq(prop->name, "name"))
+                       seen_name_prop = true;
+
+               nameoff = stringtable_insert(strbuf, prop->name);
+
+               emit->property(etarget, prop->labels);
+               emit->cell(etarget, prop->val.len);
+               emit->cell(etarget, nameoff);
+
+               if ((vi->flags & FTF_VARALIGN) && (prop->val.len >= 8))
+                       emit->align(etarget, 8);
+
+               emit->data(etarget, prop->val);
+               emit->align(etarget, sizeof(cell_t));
+       }
+
+       if ((vi->flags & FTF_NAMEPROPS) && !seen_name_prop) {
+               emit->property(etarget, NULL);
+               emit->cell(etarget, tree->basenamelen+1);
+               emit->cell(etarget, stringtable_insert(strbuf, "name"));
+
+               if ((vi->flags & FTF_VARALIGN) && ((tree->basenamelen+1) >= 8))
+                       emit->align(etarget, 8);
+
+               emit->string(etarget, tree->name, tree->basenamelen);
+               emit->align(etarget, sizeof(cell_t));
+       }
+
+       for_each_child(tree, child) {
+               flatten_tree(child, emit, etarget, strbuf, vi);
+       }
+
+       emit->endnode(etarget, tree->labels);
+}
+
+static struct data flatten_reserve_list(struct reserve_info *reservelist,
+                                struct version_info *vi)
+{
+       struct reserve_info *re;
+       struct data d = empty_data;
+       int    j;
+
+       for (re = reservelist; re; re = re->next) {
+               d = data_append_re(d, re->address, re->size);
+       }
+       /*
+        * Add additional reserved slots if the user asked for them.
+        */
+       for (j = 0; j < reservenum; j++) {
+               d = data_append_re(d, 0, 0);
+       }
+
+       return d;
+}
+
+static void make_fdt_header(struct fdt_header *fdt,
+                           struct version_info *vi,
+                           int reservesize, int dtsize, int strsize,
+                           int boot_cpuid_phys)
+{
+       int reserve_off;
+
+       reservesize += sizeof(struct fdt_reserve_entry);
+
+       memset(fdt, 0xff, sizeof(*fdt));
+
+       fdt->magic = cpu_to_fdt32(FDT_MAGIC);
+       fdt->version = cpu_to_fdt32(vi->version);
+       fdt->last_comp_version = cpu_to_fdt32(vi->last_comp_version);
+
+       /* Reserve map should be doubleword aligned */
+       reserve_off = ALIGN(vi->hdr_size, 8);
+
+       fdt->off_mem_rsvmap = cpu_to_fdt32(reserve_off);
+       fdt->off_dt_struct = cpu_to_fdt32(reserve_off + reservesize);
+       fdt->off_dt_strings = cpu_to_fdt32(reserve_off + reservesize
+                                         + dtsize);
+       fdt->totalsize = cpu_to_fdt32(reserve_off + reservesize + dtsize + strsize);
+
+       if (vi->flags & FTF_BOOTCPUID)
+               fdt->boot_cpuid_phys = cpu_to_fdt32(boot_cpuid_phys);
+       if (vi->flags & FTF_STRTABSIZE)
+               fdt->size_dt_strings = cpu_to_fdt32(strsize);
+       if (vi->flags & FTF_STRUCTSIZE)
+               fdt->size_dt_struct = cpu_to_fdt32(dtsize);
+}
+
+void dt_to_blob(FILE *f, struct dt_info *dti, int version)
+{
+       struct version_info *vi = NULL;
+       int i;
+       struct data blob       = empty_data;
+       struct data reservebuf = empty_data;
+       struct data dtbuf      = empty_data;
+       struct data strbuf     = empty_data;
+       struct fdt_header fdt;
+       int padlen = 0;
+
+       for (i = 0; i < ARRAY_SIZE(version_table); i++) {
+               if (version_table[i].version == version)
+                       vi = &version_table[i];
+       }
+       if (!vi)
+               die("Unknown device tree blob version %d\n", version);
+
+       flatten_tree(dti->dt, &bin_emitter, &dtbuf, &strbuf, vi);
+       bin_emit_cell(&dtbuf, FDT_END);
+
+       reservebuf = flatten_reserve_list(dti->reservelist, vi);
+
+       /* Make header */
+       make_fdt_header(&fdt, vi, reservebuf.len, dtbuf.len, strbuf.len,
+                       dti->boot_cpuid_phys);
+
+       /*
+        * If the user asked for more space than is used, adjust the totalsize.
+        */
+       if (minsize > 0) {
+               padlen = minsize - fdt32_to_cpu(fdt.totalsize);
+               if (padlen < 0) {
+                       padlen = 0;
+                       if (quiet < 1)
+                               fprintf(stderr,
+                                       "Warning: blob size %d >= minimum size %d\n",
+                                       fdt32_to_cpu(fdt.totalsize), minsize);
+               }
+       }
+
+       if (padsize > 0)
+               padlen = padsize;
+
+       if (alignsize > 0)
+               padlen = ALIGN(fdt32_to_cpu(fdt.totalsize) + padlen, alignsize)
+                       - fdt32_to_cpu(fdt.totalsize);
+
+       if (padlen > 0) {
+               int tsize = fdt32_to_cpu(fdt.totalsize);
+               tsize += padlen;
+               fdt.totalsize = cpu_to_fdt32(tsize);
+       }
+
+       /*
+        * Assemble the blob: start with the header, add with alignment
+        * the reserve buffer, add the reserve map terminating zeroes,
+        * the device tree itself, and finally the strings.
+        */
+       blob = data_append_data(blob, &fdt, vi->hdr_size);
+       blob = data_append_align(blob, 8);
+       blob = data_merge(blob, reservebuf);
+       blob = data_append_zeroes(blob, sizeof(struct fdt_reserve_entry));
+       blob = data_merge(blob, dtbuf);
+       blob = data_merge(blob, strbuf);
+
+       /*
+        * If the user asked for more space than is used, pad out the blob.
+        */
+       if (padlen > 0)
+               blob = data_append_zeroes(blob, padlen);
+
+       if (fwrite(blob.val, blob.len, 1, f) != 1) {
+               if (ferror(f))
+                       die("Error writing device tree blob: %s\n",
+                           strerror(errno));
+               else
+                       die("Short write on device tree blob\n");
+       }
+
+       /*
+        * data_merge() frees the right-hand element so only the blob
+        * remains to be freed.
+        */
+       data_free(blob);
+}
+
+static void dump_stringtable_asm(FILE *f, struct data strbuf)
+{
+       const char *p;
+       int len;
+
+       p = strbuf.val;
+
+       while (p < (strbuf.val + strbuf.len)) {
+               len = strlen(p);
+               fprintf(f, "\t.string \"%s\"\n", p);
+               p += len+1;
+       }
+}
+
+void dt_to_asm(FILE *f, struct dt_info *dti, int version)
+{
+       struct version_info *vi = NULL;
+       int i;
+       struct data strbuf = empty_data;
+       struct reserve_info *re;
+       const char *symprefix = "dt";
+
+       for (i = 0; i < ARRAY_SIZE(version_table); i++) {
+               if (version_table[i].version == version)
+                       vi = &version_table[i];
+       }
+       if (!vi)
+               die("Unknown device tree blob version %d\n", version);
+
+       fprintf(f, "/* autogenerated by dtc, do not edit */\n\n");
+
+       emit_label(f, symprefix, "blob_start");
+       emit_label(f, symprefix, "header");
+       fprintf(f, "\t/* magic */\n");
+       asm_emit_cell(f, FDT_MAGIC);
+       fprintf(f, "\t/* totalsize */\n");
+       ASM_EMIT_BELONG(f, "_%s_blob_abs_end - _%s_blob_start",
+                       symprefix, symprefix);
+       fprintf(f, "\t/* off_dt_struct */\n");
+       ASM_EMIT_BELONG(f, "_%s_struct_start - _%s_blob_start",
+               symprefix, symprefix);
+       fprintf(f, "\t/* off_dt_strings */\n");
+       ASM_EMIT_BELONG(f, "_%s_strings_start - _%s_blob_start",
+               symprefix, symprefix);
+       fprintf(f, "\t/* off_mem_rsvmap */\n");
+       ASM_EMIT_BELONG(f, "_%s_reserve_map - _%s_blob_start",
+               symprefix, symprefix);
+       fprintf(f, "\t/* version */\n");
+       asm_emit_cell(f, vi->version);
+       fprintf(f, "\t/* last_comp_version */\n");
+       asm_emit_cell(f, vi->last_comp_version);
+
+       if (vi->flags & FTF_BOOTCPUID) {
+               fprintf(f, "\t/* boot_cpuid_phys */\n");
+               asm_emit_cell(f, dti->boot_cpuid_phys);
+       }
+
+       if (vi->flags & FTF_STRTABSIZE) {
+               fprintf(f, "\t/* size_dt_strings */\n");
+               ASM_EMIT_BELONG(f, "_%s_strings_end - _%s_strings_start",
+                               symprefix, symprefix);
+       }
+
+       if (vi->flags & FTF_STRUCTSIZE) {
+               fprintf(f, "\t/* size_dt_struct */\n");
+               ASM_EMIT_BELONG(f, "_%s_struct_end - _%s_struct_start",
+                       symprefix, symprefix);
+       }
+
+       /*
+        * Reserve map entries.
+        * Align the reserve map to a doubleword boundary.
+        * Each entry is an (address, size) pair of u64 values.
+        * Always supply a zero-sized temination entry.
+        */
+       asm_emit_align(f, 8);
+       emit_label(f, symprefix, "reserve_map");
+
+       fprintf(f, "/* Memory reserve map from source file */\n");
+
+       /*
+        * Use .long on high and low halfs of u64s to avoid .quad
+        * as it appears .quad isn't available in some assemblers.
+        */
+       for (re = dti->reservelist; re; re = re->next) {
+               struct label *l;
+
+               for_each_label(re->labels, l) {
+                       fprintf(f, "\t.globl\t%s\n", l->label);
+                       fprintf(f, "%s:\n", l->label);
+               }
+               ASM_EMIT_BELONG(f, "0x%08x", (unsigned int)(re->address >> 32));
+               ASM_EMIT_BELONG(f, "0x%08x",
+                               (unsigned int)(re->address & 0xffffffff));
+               ASM_EMIT_BELONG(f, "0x%08x", (unsigned int)(re->size >> 32));
+               ASM_EMIT_BELONG(f, "0x%08x", (unsigned int)(re->size & 0xffffffff));
+       }
+       for (i = 0; i < reservenum; i++) {
+               fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
+       }
+
+       fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
+
+       emit_label(f, symprefix, "struct_start");
+       flatten_tree(dti->dt, &asm_emitter, f, &strbuf, vi);
+
+       fprintf(f, "\t/* FDT_END */\n");
+       asm_emit_cell(f, FDT_END);
+       emit_label(f, symprefix, "struct_end");
+
+       emit_label(f, symprefix, "strings_start");
+       dump_stringtable_asm(f, strbuf);
+       emit_label(f, symprefix, "strings_end");
+
+       emit_label(f, symprefix, "blob_end");
+
+       /*
+        * If the user asked for more space than is used, pad it out.
+        */
+       if (minsize > 0) {
+               fprintf(f, "\t.space\t%d - (_%s_blob_end - _%s_blob_start), 0\n",
+                       minsize, symprefix, symprefix);
+       }
+       if (padsize > 0) {
+               fprintf(f, "\t.space\t%d, 0\n", padsize);
+       }
+       if (alignsize > 0)
+               asm_emit_align(f, alignsize);
+       emit_label(f, symprefix, "blob_abs_end");
+
+       data_free(strbuf);
+}
+
+struct inbuf {
+       char *base, *limit, *ptr;
+};
+
+static void inbuf_init(struct inbuf *inb, void *base, void *limit)
+{
+       inb->base = base;
+       inb->limit = limit;
+       inb->ptr = inb->base;
+}
+
+static void flat_read_chunk(struct inbuf *inb, void *p, int len)
+{
+       if ((inb->ptr + len) > inb->limit)
+               die("Premature end of data parsing flat device tree\n");
+
+       memcpy(p, inb->ptr, len);
+
+       inb->ptr += len;
+}
+
+static uint32_t flat_read_word(struct inbuf *inb)
+{
+       fdt32_t val;
+
+       assert(((inb->ptr - inb->base) % sizeof(val)) == 0);
+
+       flat_read_chunk(inb, &val, sizeof(val));
+
+       return fdt32_to_cpu(val);
+}
+
+static void flat_realign(struct inbuf *inb, int align)
+{
+       int off = inb->ptr - inb->base;
+
+       inb->ptr = inb->base + ALIGN(off, align);
+       if (inb->ptr > inb->limit)
+               die("Premature end of data parsing flat device tree\n");
+}
+
+static char *flat_read_string(struct inbuf *inb)
+{
+       int len = 0;
+       const char *p = inb->ptr;
+       char *str;
+
+       do {
+               if (p >= inb->limit)
+                       die("Premature end of data parsing flat device tree\n");
+               len++;
+       } while ((*p++) != '\0');
+
+       str = xstrdup(inb->ptr);
+
+       inb->ptr += len;
+
+       flat_realign(inb, sizeof(uint32_t));
+
+       return str;
+}
+
+static struct data flat_read_data(struct inbuf *inb, int len)
+{
+       struct data d = empty_data;
+
+       if (len == 0)
+               return empty_data;
+
+       d = data_grow_for(d, len);
+       d.len = len;
+
+       flat_read_chunk(inb, d.val, len);
+
+       flat_realign(inb, sizeof(uint32_t));
+
+       return d;
+}
+
+static char *flat_read_stringtable(struct inbuf *inb, int offset)
+{
+       const char *p;
+
+       p = inb->base + offset;
+       while (1) {
+               if (p >= inb->limit || p < inb->base)
+                       die("String offset %d overruns string table\n",
+                           offset);
+
+               if (*p == '\0')
+                       break;
+
+               p++;
+       }
+
+       return xstrdup(inb->base + offset);
+}
+
+static struct property *flat_read_property(struct inbuf *dtbuf,
+                                          struct inbuf *strbuf, int flags)
+{
+       uint32_t proplen, stroff;
+       char *name;
+       struct data val;
+
+       proplen = flat_read_word(dtbuf);
+       stroff = flat_read_word(dtbuf);
+
+       name = flat_read_stringtable(strbuf, stroff);
+
+       if ((flags & FTF_VARALIGN) && (proplen >= 8))
+               flat_realign(dtbuf, 8);
+
+       val = flat_read_data(dtbuf, proplen);
+
+       return build_property(name, val);
+}
+
+
+static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
+{
+       struct reserve_info *reservelist = NULL;
+       struct reserve_info *new;
+       struct fdt_reserve_entry re;
+
+       /*
+        * Each entry is a pair of u64 (addr, size) values for 4 cell_t's.
+        * List terminates at an entry with size equal to zero.
+        *
+        * First pass, count entries.
+        */
+       while (1) {
+               uint64_t address, size;
+
+               flat_read_chunk(inb, &re, sizeof(re));
+               address  = fdt64_to_cpu(re.address);
+               size = fdt64_to_cpu(re.size);
+               if (size == 0)
+                       break;
+
+               new = build_reserve_entry(address, size);
+               reservelist = add_reserve_entry(reservelist, new);
+       }
+
+       return reservelist;
+}
+
+
+static char *nodename_from_path(const char *ppath, const char *cpath)
+{
+       int plen;
+
+       plen = strlen(ppath);
+
+       if (!strneq(ppath, cpath, plen))
+               die("Path \"%s\" is not valid as a child of \"%s\"\n",
+                   cpath, ppath);
+
+       /* root node is a special case */
+       if (!streq(ppath, "/"))
+               plen++;
+
+       return xstrdup(cpath + plen);
+}
+
+static struct node *unflatten_tree(struct inbuf *dtbuf,
+                                  struct inbuf *strbuf,
+                                  const char *parent_flatname, int flags)
+{
+       struct node *node;
+       char *flatname;
+       uint32_t val;
+
+       node = build_node(NULL, NULL);
+
+       flatname = flat_read_string(dtbuf);
+
+       if (flags & FTF_FULLPATH)
+               node->name = nodename_from_path(parent_flatname, flatname);
+       else
+               node->name = flatname;
+
+       do {
+               struct property *prop;
+               struct node *child;
+
+               val = flat_read_word(dtbuf);
+               switch (val) {
+               case FDT_PROP:
+                       if (node->children)
+                               fprintf(stderr, "Warning: Flat tree input has "
+                                       "subnodes preceding a property.\n");
+                       prop = flat_read_property(dtbuf, strbuf, flags);
+                       add_property(node, prop);
+                       break;
+
+               case FDT_BEGIN_NODE:
+                       child = unflatten_tree(dtbuf,strbuf, flatname, flags);
+                       add_child(node, child);
+                       break;
+
+               case FDT_END_NODE:
+                       break;
+
+               case FDT_END:
+                       die("Premature FDT_END in device tree blob\n");
+                       break;
+
+               case FDT_NOP:
+                       if (!(flags & FTF_NOPS))
+                               fprintf(stderr, "Warning: NOP tag found in flat tree"
+                                       " version <16\n");
+
+                       /* Ignore */
+                       break;
+
+               default:
+                       die("Invalid opcode word %08x in device tree blob\n",
+                           val);
+               }
+       } while (val != FDT_END_NODE);
+
+       if (node->name != flatname) {
+               free(flatname);
+       }
+
+       return node;
+}
+
+
+struct dt_info *dt_from_blob(const char *fname)
+{
+       FILE *f;
+       fdt32_t magic_buf, totalsize_buf;
+       uint32_t magic, totalsize, version, size_dt, boot_cpuid_phys;
+       uint32_t off_dt, off_str, off_mem_rsvmap;
+       int rc;
+       char *blob;
+       struct fdt_header *fdt;
+       char *p;
+       struct inbuf dtbuf, strbuf;
+       struct inbuf memresvbuf;
+       int sizeleft;
+       struct reserve_info *reservelist;
+       struct node *tree;
+       uint32_t val;
+       int flags = 0;
+
+       f = srcfile_relative_open(fname, NULL);
+
+       rc = fread(&magic_buf, sizeof(magic_buf), 1, f);
+       if (ferror(f))
+               die("Error reading DT blob magic number: %s\n",
+                   strerror(errno));
+       if (rc < 1) {
+               if (feof(f))
+                       die("EOF reading DT blob magic number\n");
+               else
+                       die("Mysterious short read reading magic number\n");
+       }
+
+       magic = fdt32_to_cpu(magic_buf);
+       if (magic != FDT_MAGIC)
+               die("Blob has incorrect magic number\n");
+
+       rc = fread(&totalsize_buf, sizeof(totalsize_buf), 1, f);
+       if (ferror(f))
+               die("Error reading DT blob size: %s\n", strerror(errno));
+       if (rc < 1) {
+               if (feof(f))
+                       die("EOF reading DT blob size\n");
+               else
+                       die("Mysterious short read reading blob size\n");
+       }
+
+       totalsize = fdt32_to_cpu(totalsize_buf);
+       if (totalsize < FDT_V1_SIZE)
+               die("DT blob size (%d) is too small\n", totalsize);
+
+       blob = xmalloc(totalsize);
+
+       fdt = (struct fdt_header *)blob;
+       fdt->magic = cpu_to_fdt32(magic);
+       fdt->totalsize = cpu_to_fdt32(totalsize);
+
+       sizeleft = totalsize - sizeof(magic) - sizeof(totalsize);
+       p = blob + sizeof(magic)  + sizeof(totalsize);
+
+       while (sizeleft) {
+               if (feof(f))
+                       die("EOF before reading %d bytes of DT blob\n",
+                           totalsize);
+
+               rc = fread(p, 1, sizeleft, f);
+               if (ferror(f))
+                       die("Error reading DT blob: %s\n",
+                           strerror(errno));
+
+               sizeleft -= rc;
+               p += rc;
+       }
+
+       off_dt = fdt32_to_cpu(fdt->off_dt_struct);
+       off_str = fdt32_to_cpu(fdt->off_dt_strings);
+       off_mem_rsvmap = fdt32_to_cpu(fdt->off_mem_rsvmap);
+       version = fdt32_to_cpu(fdt->version);
+       boot_cpuid_phys = fdt32_to_cpu(fdt->boot_cpuid_phys);
+
+       if (off_mem_rsvmap >= totalsize)
+               die("Mem Reserve structure offset exceeds total size\n");
+
+       if (off_dt >= totalsize)
+               die("DT structure offset exceeds total size\n");
+
+       if (off_str > totalsize)
+               die("String table offset exceeds total size\n");
+
+       if (version >= 3) {
+               uint32_t size_str = fdt32_to_cpu(fdt->size_dt_strings);
+               if ((off_str+size_str < off_str) || (off_str+size_str > totalsize))
+                       die("String table extends past total size\n");
+               inbuf_init(&strbuf, blob + off_str, blob + off_str + size_str);
+       } else {
+               inbuf_init(&strbuf, blob + off_str, blob + totalsize);
+       }
+
+       if (version >= 17) {
+               size_dt = fdt32_to_cpu(fdt->size_dt_struct);
+               if ((off_dt+size_dt < off_dt) || (off_dt+size_dt > totalsize))
+                       die("Structure block extends past total size\n");
+       }
+
+       if (version < 16) {
+               flags |= FTF_FULLPATH | FTF_NAMEPROPS | FTF_VARALIGN;
+       } else {
+               flags |= FTF_NOPS;
+       }
+
+       inbuf_init(&memresvbuf,
+                  blob + off_mem_rsvmap, blob + totalsize);
+       inbuf_init(&dtbuf, blob + off_dt, blob + totalsize);
+
+       reservelist = flat_read_mem_reserve(&memresvbuf);
+
+       val = flat_read_word(&dtbuf);
+
+       if (val != FDT_BEGIN_NODE)
+               die("Device tree blob doesn't begin with FDT_BEGIN_NODE (begins with 0x%08x)\n", val);
+
+       tree = unflatten_tree(&dtbuf, &strbuf, "", flags);
+
+       val = flat_read_word(&dtbuf);
+       if (val != FDT_END)
+               die("Device tree blob doesn't end with FDT_END\n");
+
+       free(blob);
+
+       fclose(f);
+
+       return build_dt_info(DTSF_V1, reservelist, tree, boot_cpuid_phys);
+}
diff --git a/scripts/dtc/fstree.c b/scripts/dtc/fstree.c
new file mode 100644 (file)
index 0000000..ae7d06c
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#include "dtc.h"
+
+#include <dirent.h>
+#include <sys/stat.h>
+
+static struct node *read_fstree(const char *dirname)
+{
+       DIR *d;
+       struct dirent *de;
+       struct stat st;
+       struct node *tree;
+
+       d = opendir(dirname);
+       if (!d)
+               die("Couldn't opendir() \"%s\": %s\n", dirname, strerror(errno));
+
+       tree = build_node(NULL, NULL);
+
+       while ((de = readdir(d)) != NULL) {
+               char *tmpname;
+
+               if (streq(de->d_name, ".")
+                   || streq(de->d_name, ".."))
+                       continue;
+
+               tmpname = join_path(dirname, de->d_name);
+
+               if (lstat(tmpname, &st) < 0)
+                       die("stat(%s): %s\n", tmpname, strerror(errno));
+
+               if (S_ISREG(st.st_mode)) {
+                       struct property *prop;
+                       FILE *pfile;
+
+                       pfile = fopen(tmpname, "rb");
+                       if (! pfile) {
+                               fprintf(stderr,
+                                       "WARNING: Cannot open %s: %s\n",
+                                       tmpname, strerror(errno));
+                       } else {
+                               prop = build_property(xstrdup(de->d_name),
+                                                     data_copy_file(pfile,
+                                                                    st.st_size));
+                               add_property(tree, prop);
+                               fclose(pfile);
+                       }
+               } else if (S_ISDIR(st.st_mode)) {
+                       struct node *newchild;
+
+                       newchild = read_fstree(tmpname);
+                       newchild = name_node(newchild, xstrdup(de->d_name));
+                       add_child(tree, newchild);
+               }
+
+               free(tmpname);
+       }
+
+       closedir(d);
+       return tree;
+}
+
+struct dt_info *dt_from_fs(const char *dirname)
+{
+       struct node *tree;
+
+       tree = read_fstree(dirname);
+       tree = name_node(tree, "");
+
+       return build_dt_info(DTSF_V1, NULL, tree, guess_boot_cpuid(tree));
+}
diff --git a/scripts/dtc/libfdt/Makefile.libfdt b/scripts/dtc/libfdt/Makefile.libfdt
new file mode 100644 (file)
index 0000000..098b3f3
--- /dev/null
@@ -0,0 +1,11 @@
+# Makefile.libfdt
+#
+# This is not a complete Makefile of itself.  Instead, it is designed to
+# be easily embeddable into other systems of Makefiles.
+#
+LIBFDT_soname = libfdt.$(SHAREDLIB_EXT).1
+LIBFDT_INCLUDES = fdt.h libfdt.h libfdt_env.h
+LIBFDT_VERSION = version.lds
+LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c \
+       fdt_addresses.c fdt_overlay.c
+LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
diff --git a/scripts/dtc/libfdt/fdt.c b/scripts/dtc/libfdt/fdt.c
new file mode 100644 (file)
index 0000000..22286a1
--- /dev/null
@@ -0,0 +1,251 @@
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 "libfdt_env.h"
+
+#include <fdt.h>
+#include <libfdt.h>
+
+#include "libfdt_internal.h"
+
+int fdt_check_header(const void *fdt)
+{
+       if (fdt_magic(fdt) == FDT_MAGIC) {
+               /* Complete tree */
+               if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
+                       return -FDT_ERR_BADVERSION;
+               if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION)
+                       return -FDT_ERR_BADVERSION;
+       } else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
+               /* Unfinished sequential-write blob */
+               if (fdt_size_dt_struct(fdt) == 0)
+                       return -FDT_ERR_BADSTATE;
+       } else {
+               return -FDT_ERR_BADMAGIC;
+       }
+
+       return 0;
+}
+
+const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
+{
+       unsigned absoffset = offset + fdt_off_dt_struct(fdt);
+
+       if ((absoffset < offset)
+           || ((absoffset + len) < absoffset)
+           || (absoffset + len) > fdt_totalsize(fdt))
+               return NULL;
+
+       if (fdt_version(fdt) >= 0x11)
+               if (((offset + len) < offset)
+                   || ((offset + len) > fdt_size_dt_struct(fdt)))
+                       return NULL;
+
+       return _fdt_offset_ptr(fdt, offset);
+}
+
+uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
+{
+       const fdt32_t *tagp, *lenp;
+       uint32_t tag;
+       int offset = startoffset;
+       const char *p;
+
+       *nextoffset = -FDT_ERR_TRUNCATED;
+       tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
+       if (!tagp)
+               return FDT_END; /* premature end */
+       tag = fdt32_to_cpu(*tagp);
+       offset += FDT_TAGSIZE;
+
+       *nextoffset = -FDT_ERR_BADSTRUCTURE;
+       switch (tag) {
+       case FDT_BEGIN_NODE:
+               /* skip name */
+               do {
+                       p = fdt_offset_ptr(fdt, offset++, 1);
+               } while (p && (*p != '\0'));
+               if (!p)
+                       return FDT_END; /* premature end */
+               break;
+
+       case FDT_PROP:
+               lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
+               if (!lenp)
+                       return FDT_END; /* premature end */
+               /* skip-name offset, length and value */
+               offset += sizeof(struct fdt_property) - FDT_TAGSIZE
+                       + fdt32_to_cpu(*lenp);
+               break;
+
+       case FDT_END:
+       case FDT_END_NODE:
+       case FDT_NOP:
+               break;
+
+       default:
+               return FDT_END;
+       }
+
+       if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset))
+               return FDT_END; /* premature end */
+
+       *nextoffset = FDT_TAGALIGN(offset);
+       return tag;
+}
+
+int _fdt_check_node_offset(const void *fdt, int offset)
+{
+       if ((offset < 0) || (offset % FDT_TAGSIZE)
+           || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE))
+               return -FDT_ERR_BADOFFSET;
+
+       return offset;
+}
+
+int _fdt_check_prop_offset(const void *fdt, int offset)
+{
+       if ((offset < 0) || (offset % FDT_TAGSIZE)
+           || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP))
+               return -FDT_ERR_BADOFFSET;
+
+       return offset;
+}
+
+int fdt_next_node(const void *fdt, int offset, int *depth)
+{
+       int nextoffset = 0;
+       uint32_t tag;
+
+       if (offset >= 0)
+               if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0)
+                       return nextoffset;
+
+       do {
+               offset = nextoffset;
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+
+               switch (tag) {
+               case FDT_PROP:
+               case FDT_NOP:
+                       break;
+
+               case FDT_BEGIN_NODE:
+                       if (depth)
+                               (*depth)++;
+                       break;
+
+               case FDT_END_NODE:
+                       if (depth && ((--(*depth)) < 0))
+                               return nextoffset;
+                       break;
+
+               case FDT_END:
+                       if ((nextoffset >= 0)
+                           || ((nextoffset == -FDT_ERR_TRUNCATED) && !depth))
+                               return -FDT_ERR_NOTFOUND;
+                       else
+                               return nextoffset;
+               }
+       } while (tag != FDT_BEGIN_NODE);
+
+       return offset;
+}
+
+int fdt_first_subnode(const void *fdt, int offset)
+{
+       int depth = 0;
+
+       offset = fdt_next_node(fdt, offset, &depth);
+       if (offset < 0 || depth != 1)
+               return -FDT_ERR_NOTFOUND;
+
+       return offset;
+}
+
+int fdt_next_subnode(const void *fdt, int offset)
+{
+       int depth = 1;
+
+       /*
+        * With respect to the parent, the depth of the next subnode will be
+        * the same as the last.
+        */
+       do {
+               offset = fdt_next_node(fdt, offset, &depth);
+               if (offset < 0 || depth < 1)
+                       return -FDT_ERR_NOTFOUND;
+       } while (depth > 1);
+
+       return offset;
+}
+
+const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
+{
+       int len = strlen(s) + 1;
+       const char *last = strtab + tabsize - len;
+       const char *p;
+
+       for (p = strtab; p <= last; p++)
+               if (memcmp(p, s, len) == 0)
+                       return p;
+       return NULL;
+}
+
+int fdt_move(const void *fdt, void *buf, int bufsize)
+{
+       FDT_CHECK_HEADER(fdt);
+
+       if (fdt_totalsize(fdt) > bufsize)
+               return -FDT_ERR_NOSPACE;
+
+       memmove(buf, fdt, fdt_totalsize(fdt));
+       return 0;
+}
diff --git a/scripts/dtc/libfdt/fdt.h b/scripts/dtc/libfdt/fdt.h
new file mode 100644 (file)
index 0000000..526aedb
--- /dev/null
@@ -0,0 +1,111 @@
+#ifndef _FDT_H
+#define _FDT_H
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ * Copyright 2012 Kim Phillips, Freescale Semiconductor.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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.
+ */
+
+#ifndef __ASSEMBLY__
+
+struct fdt_header {
+       fdt32_t magic;                   /* magic word FDT_MAGIC */
+       fdt32_t totalsize;               /* total size of DT block */
+       fdt32_t off_dt_struct;           /* offset to structure */
+       fdt32_t off_dt_strings;          /* offset to strings */
+       fdt32_t off_mem_rsvmap;          /* offset to memory reserve map */
+       fdt32_t version;                 /* format version */
+       fdt32_t last_comp_version;       /* last compatible version */
+
+       /* version 2 fields below */
+       fdt32_t boot_cpuid_phys;         /* Which physical CPU id we're
+                                           booting on */
+       /* version 3 fields below */
+       fdt32_t size_dt_strings;         /* size of the strings block */
+
+       /* version 17 fields below */
+       fdt32_t size_dt_struct;          /* size of the structure block */
+};
+
+struct fdt_reserve_entry {
+       fdt64_t address;
+       fdt64_t size;
+};
+
+struct fdt_node_header {
+       fdt32_t tag;
+       char name[0];
+};
+
+struct fdt_property {
+       fdt32_t tag;
+       fdt32_t len;
+       fdt32_t nameoff;
+       char data[0];
+};
+
+#endif /* !__ASSEMBLY */
+
+#define FDT_MAGIC      0xd00dfeed      /* 4: version, 4: total size */
+#define FDT_TAGSIZE    sizeof(fdt32_t)
+
+#define FDT_BEGIN_NODE 0x1             /* Start node: full name */
+#define FDT_END_NODE   0x2             /* End node */
+#define FDT_PROP       0x3             /* Property: name off,
+                                          size, content */
+#define FDT_NOP                0x4             /* nop */
+#define FDT_END                0x9
+
+#define FDT_V1_SIZE    (7*sizeof(fdt32_t))
+#define FDT_V2_SIZE    (FDT_V1_SIZE + sizeof(fdt32_t))
+#define FDT_V3_SIZE    (FDT_V2_SIZE + sizeof(fdt32_t))
+#define FDT_V16_SIZE   FDT_V3_SIZE
+#define FDT_V17_SIZE   (FDT_V16_SIZE + sizeof(fdt32_t))
+
+#endif /* _FDT_H */
diff --git a/scripts/dtc/libfdt/fdt_empty_tree.c b/scripts/dtc/libfdt/fdt_empty_tree.c
new file mode 100644 (file)
index 0000000..f2ae9b7
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2012 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 "libfdt_env.h"
+
+#include <fdt.h>
+#include <libfdt.h>
+
+#include "libfdt_internal.h"
+
+int fdt_create_empty_tree(void *buf, int bufsize)
+{
+       int err;
+
+       err = fdt_create(buf, bufsize);
+       if (err)
+               return err;
+
+       err = fdt_finish_reservemap(buf);
+       if (err)
+               return err;
+
+       err = fdt_begin_node(buf, "");
+       if (err)
+               return err;
+
+       err =  fdt_end_node(buf);
+       if (err)
+               return err;
+
+       err = fdt_finish(buf);
+       if (err)
+               return err;
+
+       return fdt_open_into(buf, buf, bufsize);
+}
diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c
new file mode 100644 (file)
index 0000000..08de2cc
--- /dev/null
@@ -0,0 +1,703 @@
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 "libfdt_env.h"
+
+#include <fdt.h>
+#include <libfdt.h>
+
+#include "libfdt_internal.h"
+
+static int _fdt_nodename_eq(const void *fdt, int offset,
+                           const char *s, int len)
+{
+       const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1);
+
+       if (!p)
+               /* short match */
+               return 0;
+
+       if (memcmp(p, s, len) != 0)
+               return 0;
+
+       if (p[len] == '\0')
+               return 1;
+       else if (!memchr(s, '@', len) && (p[len] == '@'))
+               return 1;
+       else
+               return 0;
+}
+
+const char *fdt_string(const void *fdt, int stroffset)
+{
+       return (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
+}
+
+static int _fdt_string_eq(const void *fdt, int stroffset,
+                         const char *s, int len)
+{
+       const char *p = fdt_string(fdt, stroffset);
+
+       return (strlen(p) == len) && (memcmp(p, s, len) == 0);
+}
+
+uint32_t fdt_get_max_phandle(const void *fdt)
+{
+       uint32_t max_phandle = 0;
+       int offset;
+
+       for (offset = fdt_next_node(fdt, -1, NULL);;
+            offset = fdt_next_node(fdt, offset, NULL)) {
+               uint32_t phandle;
+
+               if (offset == -FDT_ERR_NOTFOUND)
+                       return max_phandle;
+
+               if (offset < 0)
+                       return (uint32_t)-1;
+
+               phandle = fdt_get_phandle(fdt, offset);
+               if (phandle == (uint32_t)-1)
+                       continue;
+
+               if (phandle > max_phandle)
+                       max_phandle = phandle;
+       }
+
+       return 0;
+}
+
+int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
+{
+       FDT_CHECK_HEADER(fdt);
+       *address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address);
+       *size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size);
+       return 0;
+}
+
+int fdt_num_mem_rsv(const void *fdt)
+{
+       int i = 0;
+
+       while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0)
+               i++;
+       return i;
+}
+
+static int _nextprop(const void *fdt, int offset)
+{
+       uint32_t tag;
+       int nextoffset;
+
+       do {
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+
+               switch (tag) {
+               case FDT_END:
+                       if (nextoffset >= 0)
+                               return -FDT_ERR_BADSTRUCTURE;
+                       else
+                               return nextoffset;
+
+               case FDT_PROP:
+                       return offset;
+               }
+               offset = nextoffset;
+       } while (tag == FDT_NOP);
+
+       return -FDT_ERR_NOTFOUND;
+}
+
+int fdt_subnode_offset_namelen(const void *fdt, int offset,
+                              const char *name, int namelen)
+{
+       int depth;
+
+       FDT_CHECK_HEADER(fdt);
+
+       for (depth = 0;
+            (offset >= 0) && (depth >= 0);
+            offset = fdt_next_node(fdt, offset, &depth))
+               if ((depth == 1)
+                   && _fdt_nodename_eq(fdt, offset, name, namelen))
+                       return offset;
+
+       if (depth < 0)
+               return -FDT_ERR_NOTFOUND;
+       return offset; /* error */
+}
+
+int fdt_subnode_offset(const void *fdt, int parentoffset,
+                      const char *name)
+{
+       return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
+}
+
+int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen)
+{
+       const char *end = path + namelen;
+       const char *p = path;
+       int offset = 0;
+
+       FDT_CHECK_HEADER(fdt);
+
+       /* see if we have an alias */
+       if (*path != '/') {
+               const char *q = memchr(path, '/', end - p);
+
+               if (!q)
+                       q = end;
+
+               p = fdt_get_alias_namelen(fdt, p, q - p);
+               if (!p)
+                       return -FDT_ERR_BADPATH;
+               offset = fdt_path_offset(fdt, p);
+
+               p = q;
+       }
+
+       while (p < end) {
+               const char *q;
+
+               while (*p == '/') {
+                       p++;
+                       if (p == end)
+                               return offset;
+               }
+               q = memchr(p, '/', end - p);
+               if (! q)
+                       q = end;
+
+               offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
+               if (offset < 0)
+                       return offset;
+
+               p = q;
+       }
+
+       return offset;
+}
+
+int fdt_path_offset(const void *fdt, const char *path)
+{
+       return fdt_path_offset_namelen(fdt, path, strlen(path));
+}
+
+const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
+{
+       const struct fdt_node_header *nh = _fdt_offset_ptr(fdt, nodeoffset);
+       int err;
+
+       if (((err = fdt_check_header(fdt)) != 0)
+           || ((err = _fdt_check_node_offset(fdt, nodeoffset)) < 0))
+                       goto fail;
+
+       if (len)
+               *len = strlen(nh->name);
+
+       return nh->name;
+
+ fail:
+       if (len)
+               *len = err;
+       return NULL;
+}
+
+int fdt_first_property_offset(const void *fdt, int nodeoffset)
+{
+       int offset;
+
+       if ((offset = _fdt_check_node_offset(fdt, nodeoffset)) < 0)
+               return offset;
+
+       return _nextprop(fdt, offset);
+}
+
+int fdt_next_property_offset(const void *fdt, int offset)
+{
+       if ((offset = _fdt_check_prop_offset(fdt, offset)) < 0)
+               return offset;
+
+       return _nextprop(fdt, offset);
+}
+
+const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
+                                                     int offset,
+                                                     int *lenp)
+{
+       int err;
+       const struct fdt_property *prop;
+
+       if ((err = _fdt_check_prop_offset(fdt, offset)) < 0) {
+               if (lenp)
+                       *lenp = err;
+               return NULL;
+       }
+
+       prop = _fdt_offset_ptr(fdt, offset);
+
+       if (lenp)
+               *lenp = fdt32_to_cpu(prop->len);
+
+       return prop;
+}
+
+const struct fdt_property *fdt_get_property_namelen(const void *fdt,
+                                                   int offset,
+                                                   const char *name,
+                                                   int namelen, int *lenp)
+{
+       for (offset = fdt_first_property_offset(fdt, offset);
+            (offset >= 0);
+            (offset = fdt_next_property_offset(fdt, offset))) {
+               const struct fdt_property *prop;
+
+               if (!(prop = fdt_get_property_by_offset(fdt, offset, lenp))) {
+                       offset = -FDT_ERR_INTERNAL;
+                       break;
+               }
+               if (_fdt_string_eq(fdt, fdt32_to_cpu(prop->nameoff),
+                                  name, namelen))
+                       return prop;
+       }
+
+       if (lenp)
+               *lenp = offset;
+       return NULL;
+}
+
+const struct fdt_property *fdt_get_property(const void *fdt,
+                                           int nodeoffset,
+                                           const char *name, int *lenp)
+{
+       return fdt_get_property_namelen(fdt, nodeoffset, name,
+                                       strlen(name), lenp);
+}
+
+const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
+                               const char *name, int namelen, int *lenp)
+{
+       const struct fdt_property *prop;
+
+       prop = fdt_get_property_namelen(fdt, nodeoffset, name, namelen, lenp);
+       if (!prop)
+               return NULL;
+
+       return prop->data;
+}
+
+const void *fdt_getprop_by_offset(const void *fdt, int offset,
+                                 const char **namep, int *lenp)
+{
+       const struct fdt_property *prop;
+
+       prop = fdt_get_property_by_offset(fdt, offset, lenp);
+       if (!prop)
+               return NULL;
+       if (namep)
+               *namep = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
+       return prop->data;
+}
+
+const void *fdt_getprop(const void *fdt, int nodeoffset,
+                       const char *name, int *lenp)
+{
+       return fdt_getprop_namelen(fdt, nodeoffset, name, strlen(name), lenp);
+}
+
+uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
+{
+       const fdt32_t *php;
+       int len;
+
+       /* FIXME: This is a bit sub-optimal, since we potentially scan
+        * over all the properties twice. */
+       php = fdt_getprop(fdt, nodeoffset, "phandle", &len);
+       if (!php || (len != sizeof(*php))) {
+               php = fdt_getprop(fdt, nodeoffset, "linux,phandle", &len);
+               if (!php || (len != sizeof(*php)))
+                       return 0;
+       }
+
+       return fdt32_to_cpu(*php);
+}
+
+const char *fdt_get_alias_namelen(const void *fdt,
+                                 const char *name, int namelen)
+{
+       int aliasoffset;
+
+       aliasoffset = fdt_path_offset(fdt, "/aliases");
+       if (aliasoffset < 0)
+               return NULL;
+
+       return fdt_getprop_namelen(fdt, aliasoffset, name, namelen, NULL);
+}
+
+const char *fdt_get_alias(const void *fdt, const char *name)
+{
+       return fdt_get_alias_namelen(fdt, name, strlen(name));
+}
+
+int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
+{
+       int pdepth = 0, p = 0;
+       int offset, depth, namelen;
+       const char *name;
+
+       FDT_CHECK_HEADER(fdt);
+
+       if (buflen < 2)
+               return -FDT_ERR_NOSPACE;
+
+       for (offset = 0, depth = 0;
+            (offset >= 0) && (offset <= nodeoffset);
+            offset = fdt_next_node(fdt, offset, &depth)) {
+               while (pdepth > depth) {
+                       do {
+                               p--;
+                       } while (buf[p-1] != '/');
+                       pdepth--;
+               }
+
+               if (pdepth >= depth) {
+                       name = fdt_get_name(fdt, offset, &namelen);
+                       if (!name)
+                               return namelen;
+                       if ((p + namelen + 1) <= buflen) {
+                               memcpy(buf + p, name, namelen);
+                               p += namelen;
+                               buf[p++] = '/';
+                               pdepth++;
+                       }
+               }
+
+               if (offset == nodeoffset) {
+                       if (pdepth < (depth + 1))
+                               return -FDT_ERR_NOSPACE;
+
+                       if (p > 1) /* special case so that root path is "/", not "" */
+                               p--;
+                       buf[p] = '\0';
+                       return 0;
+               }
+       }
+
+       if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
+               return -FDT_ERR_BADOFFSET;
+       else if (offset == -FDT_ERR_BADOFFSET)
+               return -FDT_ERR_BADSTRUCTURE;
+
+       return offset; /* error from fdt_next_node() */
+}
+
+int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
+                                int supernodedepth, int *nodedepth)
+{
+       int offset, depth;
+       int supernodeoffset = -FDT_ERR_INTERNAL;
+
+       FDT_CHECK_HEADER(fdt);
+
+       if (supernodedepth < 0)
+               return -FDT_ERR_NOTFOUND;
+
+       for (offset = 0, depth = 0;
+            (offset >= 0) && (offset <= nodeoffset);
+            offset = fdt_next_node(fdt, offset, &depth)) {
+               if (depth == supernodedepth)
+                       supernodeoffset = offset;
+
+               if (offset == nodeoffset) {
+                       if (nodedepth)
+                               *nodedepth = depth;
+
+                       if (supernodedepth > depth)
+                               return -FDT_ERR_NOTFOUND;
+                       else
+                               return supernodeoffset;
+               }
+       }
+
+       if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
+               return -FDT_ERR_BADOFFSET;
+       else if (offset == -FDT_ERR_BADOFFSET)
+               return -FDT_ERR_BADSTRUCTURE;
+
+       return offset; /* error from fdt_next_node() */
+}
+
+int fdt_node_depth(const void *fdt, int nodeoffset)
+{
+       int nodedepth;
+       int err;
+
+       err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
+       if (err)
+               return (err < 0) ? err : -FDT_ERR_INTERNAL;
+       return nodedepth;
+}
+
+int fdt_parent_offset(const void *fdt, int nodeoffset)
+{
+       int nodedepth = fdt_node_depth(fdt, nodeoffset);
+
+       if (nodedepth < 0)
+               return nodedepth;
+       return fdt_supernode_atdepth_offset(fdt, nodeoffset,
+                                           nodedepth - 1, NULL);
+}
+
+int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
+                                 const char *propname,
+                                 const void *propval, int proplen)
+{
+       int offset;
+       const void *val;
+       int len;
+
+       FDT_CHECK_HEADER(fdt);
+
+       /* FIXME: The algorithm here is pretty horrible: we scan each
+        * property of a node in fdt_getprop(), then if that didn't
+        * find what we want, we scan over them again making our way
+        * to the next node.  Still it's the easiest to implement
+        * approach; performance can come later. */
+       for (offset = fdt_next_node(fdt, startoffset, NULL);
+            offset >= 0;
+            offset = fdt_next_node(fdt, offset, NULL)) {
+               val = fdt_getprop(fdt, offset, propname, &len);
+               if (val && (len == proplen)
+                   && (memcmp(val, propval, len) == 0))
+                       return offset;
+       }
+
+       return offset; /* error from fdt_next_node() */
+}
+
+int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
+{
+       int offset;
+
+       if ((phandle == 0) || (phandle == -1))
+               return -FDT_ERR_BADPHANDLE;
+
+       FDT_CHECK_HEADER(fdt);
+
+       /* FIXME: The algorithm here is pretty horrible: we
+        * potentially scan each property of a node in
+        * fdt_get_phandle(), then if that didn't find what
+        * we want, we scan over them again making our way to the next
+        * node.  Still it's the easiest to implement approach;
+        * performance can come later. */
+       for (offset = fdt_next_node(fdt, -1, NULL);
+            offset >= 0;
+            offset = fdt_next_node(fdt, offset, NULL)) {
+               if (fdt_get_phandle(fdt, offset) == phandle)
+                       return offset;
+       }
+
+       return offset; /* error from fdt_next_node() */
+}
+
+int fdt_stringlist_contains(const char *strlist, int listlen, const char *str)
+{
+       int len = strlen(str);
+       const char *p;
+
+       while (listlen >= len) {
+               if (memcmp(str, strlist, len+1) == 0)
+                       return 1;
+               p = memchr(strlist, '\0', listlen);
+               if (!p)
+                       return 0; /* malformed strlist.. */
+               listlen -= (p-strlist) + 1;
+               strlist = p + 1;
+       }
+       return 0;
+}
+
+int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property)
+{
+       const char *list, *end;
+       int length, count = 0;
+
+       list = fdt_getprop(fdt, nodeoffset, property, &length);
+       if (!list)
+               return length;
+
+       end = list + length;
+
+       while (list < end) {
+               length = strnlen(list, end - list) + 1;
+
+               /* Abort if the last string isn't properly NUL-terminated. */
+               if (list + length > end)
+                       return -FDT_ERR_BADVALUE;
+
+               list += length;
+               count++;
+       }
+
+       return count;
+}
+
+int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
+                         const char *string)
+{
+       int length, len, idx = 0;
+       const char *list, *end;
+
+       list = fdt_getprop(fdt, nodeoffset, property, &length);
+       if (!list)
+               return length;
+
+       len = strlen(string) + 1;
+       end = list + length;
+
+       while (list < end) {
+               length = strnlen(list, end - list) + 1;
+
+               /* Abort if the last string isn't properly NUL-terminated. */
+               if (list + length > end)
+                       return -FDT_ERR_BADVALUE;
+
+               if (length == len && memcmp(list, string, length) == 0)
+                       return idx;
+
+               list += length;
+               idx++;
+       }
+
+       return -FDT_ERR_NOTFOUND;
+}
+
+const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
+                              const char *property, int idx,
+                              int *lenp)
+{
+       const char *list, *end;
+       int length;
+
+       list = fdt_getprop(fdt, nodeoffset, property, &length);
+       if (!list) {
+               if (lenp)
+                       *lenp = length;
+
+               return NULL;
+       }
+
+       end = list + length;
+
+       while (list < end) {
+               length = strnlen(list, end - list) + 1;
+
+               /* Abort if the last string isn't properly NUL-terminated. */
+               if (list + length > end) {
+                       if (lenp)
+                               *lenp = -FDT_ERR_BADVALUE;
+
+                       return NULL;
+               }
+
+               if (idx == 0) {
+                       if (lenp)
+                               *lenp = length - 1;
+
+                       return list;
+               }
+
+               list += length;
+               idx--;
+       }
+
+       if (lenp)
+               *lenp = -FDT_ERR_NOTFOUND;
+
+       return NULL;
+}
+
+int fdt_node_check_compatible(const void *fdt, int nodeoffset,
+                             const char *compatible)
+{
+       const void *prop;
+       int len;
+
+       prop = fdt_getprop(fdt, nodeoffset, "compatible", &len);
+       if (!prop)
+               return len;
+
+       return !fdt_stringlist_contains(prop, len, compatible);
+}
+
+int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
+                                 const char *compatible)
+{
+       int offset, err;
+
+       FDT_CHECK_HEADER(fdt);
+
+       /* FIXME: The algorithm here is pretty horrible: we scan each
+        * property of a node in fdt_node_check_compatible(), then if
+        * that didn't find what we want, we scan over them again
+        * making our way to the next node.  Still it's the easiest to
+        * implement approach; performance can come later. */
+       for (offset = fdt_next_node(fdt, startoffset, NULL);
+            offset >= 0;
+            offset = fdt_next_node(fdt, offset, NULL)) {
+               err = fdt_node_check_compatible(fdt, offset, compatible);
+               if ((err < 0) && (err != -FDT_ERR_NOTFOUND))
+                       return err;
+               else if (err == 0)
+                       return offset;
+       }
+
+       return offset; /* error from fdt_next_node() */
+}
diff --git a/scripts/dtc/libfdt/fdt_rw.c b/scripts/dtc/libfdt/fdt_rw.c
new file mode 100644 (file)
index 0000000..5c3a2bb
--- /dev/null
@@ -0,0 +1,505 @@
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 "libfdt_env.h"
+
+#include <fdt.h>
+#include <libfdt.h>
+
+#include "libfdt_internal.h"
+
+static int _fdt_blocks_misordered(const void *fdt,
+                             int mem_rsv_size, int struct_size)
+{
+       return (fdt_off_mem_rsvmap(fdt) < FDT_ALIGN(sizeof(struct fdt_header), 8))
+               || (fdt_off_dt_struct(fdt) <
+                   (fdt_off_mem_rsvmap(fdt) + mem_rsv_size))
+               || (fdt_off_dt_strings(fdt) <
+                   (fdt_off_dt_struct(fdt) + struct_size))
+               || (fdt_totalsize(fdt) <
+                   (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
+}
+
+static int _fdt_rw_check_header(void *fdt)
+{
+       FDT_CHECK_HEADER(fdt);
+
+       if (fdt_version(fdt) < 17)
+               return -FDT_ERR_BADVERSION;
+       if (_fdt_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
+                                  fdt_size_dt_struct(fdt)))
+               return -FDT_ERR_BADLAYOUT;
+       if (fdt_version(fdt) > 17)
+               fdt_set_version(fdt, 17);
+
+       return 0;
+}
+
+#define FDT_RW_CHECK_HEADER(fdt) \
+       { \
+               int __err; \
+               if ((__err = _fdt_rw_check_header(fdt)) != 0) \
+                       return __err; \
+       }
+
+static inline int _fdt_data_size(void *fdt)
+{
+       return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
+}
+
+static int _fdt_splice(void *fdt, void *splicepoint, int oldlen, int newlen)
+{
+       char *p = splicepoint;
+       char *end = (char *)fdt + _fdt_data_size(fdt);
+
+       if (((p + oldlen) < p) || ((p + oldlen) > end))
+               return -FDT_ERR_BADOFFSET;
+       if ((p < (char *)fdt) || ((end - oldlen + newlen) < (char *)fdt))
+               return -FDT_ERR_BADOFFSET;
+       if ((end - oldlen + newlen) > ((char *)fdt + fdt_totalsize(fdt)))
+               return -FDT_ERR_NOSPACE;
+       memmove(p + newlen, p + oldlen, end - p - oldlen);
+       return 0;
+}
+
+static int _fdt_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
+                              int oldn, int newn)
+{
+       int delta = (newn - oldn) * sizeof(*p);
+       int err;
+       err = _fdt_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
+       if (err)
+               return err;
+       fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta);
+       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
+       return 0;
+}
+
+static int _fdt_splice_struct(void *fdt, void *p,
+                             int oldlen, int newlen)
+{
+       int delta = newlen - oldlen;
+       int err;
+
+       if ((err = _fdt_splice(fdt, p, oldlen, newlen)))
+               return err;
+
+       fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta);
+       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
+       return 0;
+}
+
+static int _fdt_splice_string(void *fdt, int newlen)
+{
+       void *p = (char *)fdt
+               + fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
+       int err;
+
+       if ((err = _fdt_splice(fdt, p, 0, newlen)))
+               return err;
+
+       fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen);
+       return 0;
+}
+
+static int _fdt_find_add_string(void *fdt, const char *s)
+{
+       char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
+       const char *p;
+       char *new;
+       int len = strlen(s) + 1;
+       int err;
+
+       p = _fdt_find_string(strtab, fdt_size_dt_strings(fdt), s);
+       if (p)
+               /* found it */
+               return (p - strtab);
+
+       new = strtab + fdt_size_dt_strings(fdt);
+       err = _fdt_splice_string(fdt, len);
+       if (err)
+               return err;
+
+       memcpy(new, s, len);
+       return (new - strtab);
+}
+
+int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
+{
+       struct fdt_reserve_entry *re;
+       int err;
+
+       FDT_RW_CHECK_HEADER(fdt);
+
+       re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt));
+       err = _fdt_splice_mem_rsv(fdt, re, 0, 1);
+       if (err)
+               return err;
+
+       re->address = cpu_to_fdt64(address);
+       re->size = cpu_to_fdt64(size);
+       return 0;
+}
+
+int fdt_del_mem_rsv(void *fdt, int n)
+{
+       struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
+
+       FDT_RW_CHECK_HEADER(fdt);
+
+       if (n >= fdt_num_mem_rsv(fdt))
+               return -FDT_ERR_NOTFOUND;
+
+       return _fdt_splice_mem_rsv(fdt, re, 1, 0);
+}
+
+static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,
+                               int len, struct fdt_property **prop)
+{
+       int oldlen;
+       int err;
+
+       *prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
+       if (!*prop)
+               return oldlen;
+
+       if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen),
+                                     FDT_TAGALIGN(len))))
+               return err;
+
+       (*prop)->len = cpu_to_fdt32(len);
+       return 0;
+}
+
+static int _fdt_add_property(void *fdt, int nodeoffset, const char *name,
+                            int len, struct fdt_property **prop)
+{
+       int proplen;
+       int nextoffset;
+       int namestroff;
+       int err;
+
+       if ((nextoffset = _fdt_check_node_offset(fdt, nodeoffset)) < 0)
+               return nextoffset;
+
+       namestroff = _fdt_find_add_string(fdt, name);
+       if (namestroff < 0)
+               return namestroff;
+
+       *prop = _fdt_offset_ptr_w(fdt, nextoffset);
+       proplen = sizeof(**prop) + FDT_TAGALIGN(len);
+
+       err = _fdt_splice_struct(fdt, *prop, 0, proplen);
+       if (err)
+               return err;
+
+       (*prop)->tag = cpu_to_fdt32(FDT_PROP);
+       (*prop)->nameoff = cpu_to_fdt32(namestroff);
+       (*prop)->len = cpu_to_fdt32(len);
+       return 0;
+}
+
+int fdt_set_name(void *fdt, int nodeoffset, const char *name)
+{
+       char *namep;
+       int oldlen, newlen;
+       int err;
+
+       FDT_RW_CHECK_HEADER(fdt);
+
+       namep = (char *)(uintptr_t)fdt_get_name(fdt, nodeoffset, &oldlen);
+       if (!namep)
+               return oldlen;
+
+       newlen = strlen(name);
+
+       err = _fdt_splice_struct(fdt, namep, FDT_TAGALIGN(oldlen+1),
+                                FDT_TAGALIGN(newlen+1));
+       if (err)
+               return err;
+
+       memcpy(namep, name, newlen+1);
+       return 0;
+}
+
+int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
+                           int len, void **prop_data)
+{
+       struct fdt_property *prop;
+       int err;
+
+       FDT_RW_CHECK_HEADER(fdt);
+
+       err = _fdt_resize_property(fdt, nodeoffset, name, len, &prop);
+       if (err == -FDT_ERR_NOTFOUND)
+               err = _fdt_add_property(fdt, nodeoffset, name, len, &prop);
+       if (err)
+               return err;
+
+       *prop_data = prop->data;
+       return 0;
+}
+
+int fdt_setprop(void *fdt, int nodeoffset, const char *name,
+               const void *val, int len)
+{
+       void *prop_data;
+       int err;
+
+       err = fdt_setprop_placeholder(fdt, nodeoffset, name, len, &prop_data);
+       if (err)
+               return err;
+
+       if (len)
+               memcpy(prop_data, val, len);
+       return 0;
+}
+
+int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
+                  const void *val, int len)
+{
+       struct fdt_property *prop;
+       int err, oldlen, newlen;
+
+       FDT_RW_CHECK_HEADER(fdt);
+
+       prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
+       if (prop) {
+               newlen = len + oldlen;
+               err = _fdt_splice_struct(fdt, prop->data,
+                                        FDT_TAGALIGN(oldlen),
+                                        FDT_TAGALIGN(newlen));
+               if (err)
+                       return err;
+               prop->len = cpu_to_fdt32(newlen);
+               memcpy(prop->data + oldlen, val, len);
+       } else {
+               err = _fdt_add_property(fdt, nodeoffset, name, len, &prop);
+               if (err)
+                       return err;
+               memcpy(prop->data, val, len);
+       }
+       return 0;
+}
+
+int fdt_delprop(void *fdt, int nodeoffset, const char *name)
+{
+       struct fdt_property *prop;
+       int len, proplen;
+
+       FDT_RW_CHECK_HEADER(fdt);
+
+       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
+       if (!prop)
+               return len;
+
+       proplen = sizeof(*prop) + FDT_TAGALIGN(len);
+       return _fdt_splice_struct(fdt, prop, proplen, 0);
+}
+
+int fdt_add_subnode_namelen(void *fdt, int parentoffset,
+                           const char *name, int namelen)
+{
+       struct fdt_node_header *nh;
+       int offset, nextoffset;
+       int nodelen;
+       int err;
+       uint32_t tag;
+       fdt32_t *endtag;
+
+       FDT_RW_CHECK_HEADER(fdt);
+
+       offset = fdt_subnode_offset_namelen(fdt, parentoffset, name, namelen);
+       if (offset >= 0)
+               return -FDT_ERR_EXISTS;
+       else if (offset != -FDT_ERR_NOTFOUND)
+               return offset;
+
+       /* Try to place the new node after the parent's properties */
+       fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
+       do {
+               offset = nextoffset;
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+       } while ((tag == FDT_PROP) || (tag == FDT_NOP));
+
+       nh = _fdt_offset_ptr_w(fdt, offset);
+       nodelen = sizeof(*nh) + FDT_TAGALIGN(namelen+1) + FDT_TAGSIZE;
+
+       err = _fdt_splice_struct(fdt, nh, 0, nodelen);
+       if (err)
+               return err;
+
+       nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
+       memset(nh->name, 0, FDT_TAGALIGN(namelen+1));
+       memcpy(nh->name, name, namelen);
+       endtag = (fdt32_t *)((char *)nh + nodelen - FDT_TAGSIZE);
+       *endtag = cpu_to_fdt32(FDT_END_NODE);
+
+       return offset;
+}
+
+int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
+{
+       return fdt_add_subnode_namelen(fdt, parentoffset, name, strlen(name));
+}
+
+int fdt_del_node(void *fdt, int nodeoffset)
+{
+       int endoffset;
+
+       FDT_RW_CHECK_HEADER(fdt);
+
+       endoffset = _fdt_node_end_offset(fdt, nodeoffset);
+       if (endoffset < 0)
+               return endoffset;
+
+       return _fdt_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset),
+                                 endoffset - nodeoffset, 0);
+}
+
+static void _fdt_packblocks(const char *old, char *new,
+                           int mem_rsv_size, int struct_size)
+{
+       int mem_rsv_off, struct_off, strings_off;
+
+       mem_rsv_off = FDT_ALIGN(sizeof(struct fdt_header), 8);
+       struct_off = mem_rsv_off + mem_rsv_size;
+       strings_off = struct_off + struct_size;
+
+       memmove(new + mem_rsv_off, old + fdt_off_mem_rsvmap(old), mem_rsv_size);
+       fdt_set_off_mem_rsvmap(new, mem_rsv_off);
+
+       memmove(new + struct_off, old + fdt_off_dt_struct(old), struct_size);
+       fdt_set_off_dt_struct(new, struct_off);
+       fdt_set_size_dt_struct(new, struct_size);
+
+       memmove(new + strings_off, old + fdt_off_dt_strings(old),
+               fdt_size_dt_strings(old));
+       fdt_set_off_dt_strings(new, strings_off);
+       fdt_set_size_dt_strings(new, fdt_size_dt_strings(old));
+}
+
+int fdt_open_into(const void *fdt, void *buf, int bufsize)
+{
+       int err;
+       int mem_rsv_size, struct_size;
+       int newsize;
+       const char *fdtstart = fdt;
+       const char *fdtend = fdtstart + fdt_totalsize(fdt);
+       char *tmp;
+
+       FDT_CHECK_HEADER(fdt);
+
+       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
+               * sizeof(struct fdt_reserve_entry);
+
+       if (fdt_version(fdt) >= 17) {
+               struct_size = fdt_size_dt_struct(fdt);
+       } else {
+               struct_size = 0;
+               while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END)
+                       ;
+               if (struct_size < 0)
+                       return struct_size;
+       }
+
+       if (!_fdt_blocks_misordered(fdt, mem_rsv_size, struct_size)) {
+               /* no further work necessary */
+               err = fdt_move(fdt, buf, bufsize);
+               if (err)
+                       return err;
+               fdt_set_version(buf, 17);
+               fdt_set_size_dt_struct(buf, struct_size);
+               fdt_set_totalsize(buf, bufsize);
+               return 0;
+       }
+
+       /* Need to reorder */
+       newsize = FDT_ALIGN(sizeof(struct fdt_header), 8) + mem_rsv_size
+               + struct_size + fdt_size_dt_strings(fdt);
+
+       if (bufsize < newsize)
+               return -FDT_ERR_NOSPACE;
+
+       /* First attempt to build converted tree at beginning of buffer */
+       tmp = buf;
+       /* But if that overlaps with the old tree... */
+       if (((tmp + newsize) > fdtstart) && (tmp < fdtend)) {
+               /* Try right after the old tree instead */
+               tmp = (char *)(uintptr_t)fdtend;
+               if ((tmp + newsize) > ((char *)buf + bufsize))
+                       return -FDT_ERR_NOSPACE;
+       }
+
+       _fdt_packblocks(fdt, tmp, mem_rsv_size, struct_size);
+       memmove(buf, tmp, newsize);
+
+       fdt_set_magic(buf, FDT_MAGIC);
+       fdt_set_totalsize(buf, bufsize);
+       fdt_set_version(buf, 17);
+       fdt_set_last_comp_version(buf, 16);
+       fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt));
+
+       return 0;
+}
+
+int fdt_pack(void *fdt)
+{
+       int mem_rsv_size;
+
+       FDT_RW_CHECK_HEADER(fdt);
+
+       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
+               * sizeof(struct fdt_reserve_entry);
+       _fdt_packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
+       fdt_set_totalsize(fdt, _fdt_data_size(fdt));
+
+       return 0;
+}
diff --git a/scripts/dtc/libfdt/fdt_strerror.c b/scripts/dtc/libfdt/fdt_strerror.c
new file mode 100644 (file)
index 0000000..9677a18
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 "libfdt_env.h"
+
+#include <fdt.h>
+#include <libfdt.h>
+
+#include "libfdt_internal.h"
+
+struct fdt_errtabent {
+       const char *str;
+};
+
+#define FDT_ERRTABENT(val) \
+       [(val)] = { .str = #val, }
+
+static struct fdt_errtabent fdt_errtable[] = {
+       FDT_ERRTABENT(FDT_ERR_NOTFOUND),
+       FDT_ERRTABENT(FDT_ERR_EXISTS),
+       FDT_ERRTABENT(FDT_ERR_NOSPACE),
+
+       FDT_ERRTABENT(FDT_ERR_BADOFFSET),
+       FDT_ERRTABENT(FDT_ERR_BADPATH),
+       FDT_ERRTABENT(FDT_ERR_BADPHANDLE),
+       FDT_ERRTABENT(FDT_ERR_BADSTATE),
+
+       FDT_ERRTABENT(FDT_ERR_TRUNCATED),
+       FDT_ERRTABENT(FDT_ERR_BADMAGIC),
+       FDT_ERRTABENT(FDT_ERR_BADVERSION),
+       FDT_ERRTABENT(FDT_ERR_BADSTRUCTURE),
+       FDT_ERRTABENT(FDT_ERR_BADLAYOUT),
+       FDT_ERRTABENT(FDT_ERR_INTERNAL),
+       FDT_ERRTABENT(FDT_ERR_BADNCELLS),
+       FDT_ERRTABENT(FDT_ERR_BADVALUE),
+       FDT_ERRTABENT(FDT_ERR_BADOVERLAY),
+       FDT_ERRTABENT(FDT_ERR_NOPHANDLES),
+};
+#define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
+
+const char *fdt_strerror(int errval)
+{
+       if (errval > 0)
+               return "<valid offset/length>";
+       else if (errval == 0)
+               return "<no error>";
+       else if (errval > -FDT_ERRTABSIZE) {
+               const char *s = fdt_errtable[-errval].str;
+
+               if (s)
+                       return s;
+       }
+
+       return "<unknown error>";
+}
diff --git a/scripts/dtc/libfdt/fdt_sw.c b/scripts/dtc/libfdt/fdt_sw.c
new file mode 100644 (file)
index 0000000..2bd15e7
--- /dev/null
@@ -0,0 +1,300 @@
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 "libfdt_env.h"
+
+#include <fdt.h>
+#include <libfdt.h>
+
+#include "libfdt_internal.h"
+
+static int _fdt_sw_check_header(void *fdt)
+{
+       if (fdt_magic(fdt) != FDT_SW_MAGIC)
+               return -FDT_ERR_BADMAGIC;
+       /* FIXME: should check more details about the header state */
+       return 0;
+}
+
+#define FDT_SW_CHECK_HEADER(fdt) \
+       { \
+               int err; \
+               if ((err = _fdt_sw_check_header(fdt)) != 0) \
+                       return err; \
+       }
+
+static void *_fdt_grab_space(void *fdt, size_t len)
+{
+       int offset = fdt_size_dt_struct(fdt);
+       int spaceleft;
+
+       spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt)
+               - fdt_size_dt_strings(fdt);
+
+       if ((offset + len < offset) || (offset + len > spaceleft))
+               return NULL;
+
+       fdt_set_size_dt_struct(fdt, offset + len);
+       return _fdt_offset_ptr_w(fdt, offset);
+}
+
+int fdt_create(void *buf, int bufsize)
+{
+       void *fdt = buf;
+
+       if (bufsize < sizeof(struct fdt_header))
+               return -FDT_ERR_NOSPACE;
+
+       memset(buf, 0, bufsize);
+
+       fdt_set_magic(fdt, FDT_SW_MAGIC);
+       fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
+       fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
+       fdt_set_totalsize(fdt,  bufsize);
+
+       fdt_set_off_mem_rsvmap(fdt, FDT_ALIGN(sizeof(struct fdt_header),
+                                             sizeof(struct fdt_reserve_entry)));
+       fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt));
+       fdt_set_off_dt_strings(fdt, bufsize);
+
+       return 0;
+}
+
+int fdt_resize(void *fdt, void *buf, int bufsize)
+{
+       size_t headsize, tailsize;
+       char *oldtail, *newtail;
+
+       FDT_SW_CHECK_HEADER(fdt);
+
+       headsize = fdt_off_dt_struct(fdt);
+       tailsize = fdt_size_dt_strings(fdt);
+
+       if ((headsize + tailsize) > bufsize)
+               return -FDT_ERR_NOSPACE;
+
+       oldtail = (char *)fdt + fdt_totalsize(fdt) - tailsize;
+       newtail = (char *)buf + bufsize - tailsize;
+
+       /* Two cases to avoid clobbering data if the old and new
+        * buffers partially overlap */
+       if (buf <= fdt) {
+               memmove(buf, fdt, headsize);
+               memmove(newtail, oldtail, tailsize);
+       } else {
+               memmove(newtail, oldtail, tailsize);
+               memmove(buf, fdt, headsize);
+       }
+
+       fdt_set_off_dt_strings(buf, bufsize);
+       fdt_set_totalsize(buf, bufsize);
+
+       return 0;
+}
+
+int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
+{
+       struct fdt_reserve_entry *re;
+       int offset;
+
+       FDT_SW_CHECK_HEADER(fdt);
+
+       if (fdt_size_dt_struct(fdt))
+               return -FDT_ERR_BADSTATE;
+
+       offset = fdt_off_dt_struct(fdt);
+       if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
+               return -FDT_ERR_NOSPACE;
+
+       re = (struct fdt_reserve_entry *)((char *)fdt + offset);
+       re->address = cpu_to_fdt64(addr);
+       re->size = cpu_to_fdt64(size);
+
+       fdt_set_off_dt_struct(fdt, offset + sizeof(*re));
+
+       return 0;
+}
+
+int fdt_finish_reservemap(void *fdt)
+{
+       return fdt_add_reservemap_entry(fdt, 0, 0);
+}
+
+int fdt_begin_node(void *fdt, const char *name)
+{
+       struct fdt_node_header *nh;
+       int namelen = strlen(name) + 1;
+
+       FDT_SW_CHECK_HEADER(fdt);
+
+       nh = _fdt_grab_space(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen));
+       if (! nh)
+               return -FDT_ERR_NOSPACE;
+
+       nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
+       memcpy(nh->name, name, namelen);
+       return 0;
+}
+
+int fdt_end_node(void *fdt)
+{
+       fdt32_t *en;
+
+       FDT_SW_CHECK_HEADER(fdt);
+
+       en = _fdt_grab_space(fdt, FDT_TAGSIZE);
+       if (! en)
+               return -FDT_ERR_NOSPACE;
+
+       *en = cpu_to_fdt32(FDT_END_NODE);
+       return 0;
+}
+
+static int _fdt_find_add_string(void *fdt, const char *s)
+{
+       char *strtab = (char *)fdt + fdt_totalsize(fdt);
+       const char *p;
+       int strtabsize = fdt_size_dt_strings(fdt);
+       int len = strlen(s) + 1;
+       int struct_top, offset;
+
+       p = _fdt_find_string(strtab - strtabsize, strtabsize, s);
+       if (p)
+               return p - strtab;
+
+       /* Add it */
+       offset = -strtabsize - len;
+       struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
+       if (fdt_totalsize(fdt) + offset < struct_top)
+               return 0; /* no more room :( */
+
+       memcpy(strtab + offset, s, len);
+       fdt_set_size_dt_strings(fdt, strtabsize + len);
+       return offset;
+}
+
+int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp)
+{
+       struct fdt_property *prop;
+       int nameoff;
+
+       FDT_SW_CHECK_HEADER(fdt);
+
+       nameoff = _fdt_find_add_string(fdt, name);
+       if (nameoff == 0)
+               return -FDT_ERR_NOSPACE;
+
+       prop = _fdt_grab_space(fdt, sizeof(*prop) + FDT_TAGALIGN(len));
+       if (! prop)
+               return -FDT_ERR_NOSPACE;
+
+       prop->tag = cpu_to_fdt32(FDT_PROP);
+       prop->nameoff = cpu_to_fdt32(nameoff);
+       prop->len = cpu_to_fdt32(len);
+       *valp = prop->data;
+       return 0;
+}
+
+int fdt_property(void *fdt, const char *name, const void *val, int len)
+{
+       void *ptr;
+       int ret;
+
+       ret = fdt_property_placeholder(fdt, name, len, &ptr);
+       if (ret)
+               return ret;
+       memcpy(ptr, val, len);
+       return 0;
+}
+
+int fdt_finish(void *fdt)
+{
+       char *p = (char *)fdt;
+       fdt32_t *end;
+       int oldstroffset, newstroffset;
+       uint32_t tag;
+       int offset, nextoffset;
+
+       FDT_SW_CHECK_HEADER(fdt);
+
+       /* Add terminator */
+       end = _fdt_grab_space(fdt, sizeof(*end));
+       if (! end)
+               return -FDT_ERR_NOSPACE;
+       *end = cpu_to_fdt32(FDT_END);
+
+       /* Relocate the string table */
+       oldstroffset = fdt_totalsize(fdt) - fdt_size_dt_strings(fdt);
+       newstroffset = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
+       memmove(p + newstroffset, p + oldstroffset, fdt_size_dt_strings(fdt));
+       fdt_set_off_dt_strings(fdt, newstroffset);
+
+       /* Walk the structure, correcting string offsets */
+       offset = 0;
+       while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) {
+               if (tag == FDT_PROP) {
+                       struct fdt_property *prop =
+                               _fdt_offset_ptr_w(fdt, offset);
+                       int nameoff;
+
+                       nameoff = fdt32_to_cpu(prop->nameoff);
+                       nameoff += fdt_size_dt_strings(fdt);
+                       prop->nameoff = cpu_to_fdt32(nameoff);
+               }
+               offset = nextoffset;
+       }
+       if (nextoffset < 0)
+               return nextoffset;
+
+       /* Finally, adjust the header */
+       fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
+       fdt_set_magic(fdt, FDT_MAGIC);
+       return 0;
+}
diff --git a/scripts/dtc/libfdt/fdt_wip.c b/scripts/dtc/libfdt/fdt_wip.c
new file mode 100644 (file)
index 0000000..5e85919
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 "libfdt_env.h"
+
+#include <fdt.h>
+#include <libfdt.h>
+
+#include "libfdt_internal.h"
+
+int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
+                                       const char *name, int namelen,
+                                       uint32_t idx, const void *val,
+                                       int len)
+{
+       void *propval;
+       int proplen;
+
+       propval = fdt_getprop_namelen_w(fdt, nodeoffset, name, namelen,
+                                       &proplen);
+       if (!propval)
+               return proplen;
+
+       if (proplen < (len + idx))
+               return -FDT_ERR_NOSPACE;
+
+       memcpy((char *)propval + idx, val, len);
+       return 0;
+}
+
+int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
+                       const void *val, int len)
+{
+       const void *propval;
+       int proplen;
+
+       propval = fdt_getprop(fdt, nodeoffset, name, &proplen);
+       if (!propval)
+               return proplen;
+
+       if (proplen != len)
+               return -FDT_ERR_NOSPACE;
+
+       return fdt_setprop_inplace_namelen_partial(fdt, nodeoffset, name,
+                                                  strlen(name), 0,
+                                                  val, len);
+}
+
+static void _fdt_nop_region(void *start, int len)
+{
+       fdt32_t *p;
+
+       for (p = start; (char *)p < ((char *)start + len); p++)
+               *p = cpu_to_fdt32(FDT_NOP);
+}
+
+int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
+{
+       struct fdt_property *prop;
+       int len;
+
+       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
+       if (!prop)
+               return len;
+
+       _fdt_nop_region(prop, len + sizeof(*prop));
+
+       return 0;
+}
+
+int _fdt_node_end_offset(void *fdt, int offset)
+{
+       int depth = 0;
+
+       while ((offset >= 0) && (depth >= 0))
+               offset = fdt_next_node(fdt, offset, &depth);
+
+       return offset;
+}
+
+int fdt_nop_node(void *fdt, int nodeoffset)
+{
+       int endoffset;
+
+       endoffset = _fdt_node_end_offset(fdt, nodeoffset);
+       if (endoffset < 0)
+               return endoffset;
+
+       _fdt_nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0),
+                       endoffset - nodeoffset);
+       return 0;
+}
diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h
new file mode 100644 (file)
index 0000000..7f83023
--- /dev/null
@@ -0,0 +1,1899 @@
+#ifndef _LIBFDT_H
+#define _LIBFDT_H
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 "libfdt_env.h"
+#include "fdt.h"
+
+#define FDT_FIRST_SUPPORTED_VERSION    0x10
+#define FDT_LAST_SUPPORTED_VERSION     0x11
+
+/* Error codes: informative error codes */
+#define FDT_ERR_NOTFOUND       1
+       /* FDT_ERR_NOTFOUND: The requested node or property does not exist */
+#define FDT_ERR_EXISTS         2
+       /* FDT_ERR_EXISTS: Attempted to create a node or property which
+        * already exists */
+#define FDT_ERR_NOSPACE                3
+       /* FDT_ERR_NOSPACE: Operation needed to expand the device
+        * tree, but its buffer did not have sufficient space to
+        * contain the expanded tree. Use fdt_open_into() to move the
+        * device tree to a buffer with more space. */
+
+/* Error codes: codes for bad parameters */
+#define FDT_ERR_BADOFFSET      4
+       /* FDT_ERR_BADOFFSET: Function was passed a structure block
+        * offset which is out-of-bounds, or which points to an
+        * unsuitable part of the structure for the operation. */
+#define FDT_ERR_BADPATH                5
+       /* FDT_ERR_BADPATH: Function was passed a badly formatted path
+        * (e.g. missing a leading / for a function which requires an
+        * absolute path) */
+#define FDT_ERR_BADPHANDLE     6
+       /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle.
+        * This can be caused either by an invalid phandle property
+        * length, or the phandle value was either 0 or -1, which are
+        * not permitted. */
+#define FDT_ERR_BADSTATE       7
+       /* FDT_ERR_BADSTATE: Function was passed an incomplete device
+        * tree created by the sequential-write functions, which is
+        * not sufficiently complete for the requested operation. */
+
+/* Error codes: codes for bad device tree blobs */
+#define FDT_ERR_TRUNCATED      8
+       /* FDT_ERR_TRUNCATED: Structure block of the given device tree
+        * ends without an FDT_END tag. */
+#define FDT_ERR_BADMAGIC       9
+       /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
+        * device tree at all - it is missing the flattened device
+        * tree magic number. */
+#define FDT_ERR_BADVERSION     10
+       /* FDT_ERR_BADVERSION: Given device tree has a version which
+        * can't be handled by the requested operation.  For
+        * read-write functions, this may mean that fdt_open_into() is
+        * required to convert the tree to the expected version. */
+#define FDT_ERR_BADSTRUCTURE   11
+       /* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
+        * structure block or other serious error (e.g. misnested
+        * nodes, or subnodes preceding properties). */
+#define FDT_ERR_BADLAYOUT      12
+       /* FDT_ERR_BADLAYOUT: For read-write functions, the given
+        * device tree has it's sub-blocks in an order that the
+        * function can't handle (memory reserve map, then structure,
+        * then strings).  Use fdt_open_into() to reorganize the tree
+        * into a form suitable for the read-write operations. */
+
+/* "Can't happen" error indicating a bug in libfdt */
+#define FDT_ERR_INTERNAL       13
+       /* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
+        * Should never be returned, if it is, it indicates a bug in
+        * libfdt itself. */
+
+/* Errors in device tree content */
+#define FDT_ERR_BADNCELLS      14
+       /* FDT_ERR_BADNCELLS: Device tree has a #address-cells, #size-cells
+        * or similar property with a bad format or value */
+
+#define FDT_ERR_BADVALUE       15
+       /* FDT_ERR_BADVALUE: Device tree has a property with an unexpected
+        * value. For example: a property expected to contain a string list
+        * is not NUL-terminated within the length of its value. */
+
+#define FDT_ERR_BADOVERLAY     16
+       /* FDT_ERR_BADOVERLAY: The device tree overlay, while
+        * correctly structured, cannot be applied due to some
+        * unexpected or missing value, property or node. */
+
+#define FDT_ERR_NOPHANDLES     17
+       /* FDT_ERR_NOPHANDLES: The device tree doesn't have any
+        * phandle available anymore without causing an overflow */
+
+#define FDT_ERR_MAX            17
+
+/**********************************************************************/
+/* Low-level functions (you probably don't need these)                */
+/**********************************************************************/
+
+#ifndef SWIG /* This function is not useful in Python */
+const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
+#endif
+static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
+{
+       return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
+}
+
+uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
+
+/**********************************************************************/
+/* Traversal functions                                                */
+/**********************************************************************/
+
+int fdt_next_node(const void *fdt, int offset, int *depth);
+
+/**
+ * fdt_first_subnode() - get offset of first direct subnode
+ *
+ * @fdt:       FDT blob
+ * @offset:    Offset of node to check
+ * @return offset of first subnode, or -FDT_ERR_NOTFOUND if there is none
+ */
+int fdt_first_subnode(const void *fdt, int offset);
+
+/**
+ * fdt_next_subnode() - get offset of next direct subnode
+ *
+ * After first calling fdt_first_subnode(), call this function repeatedly to
+ * get direct subnodes of a parent node.
+ *
+ * @fdt:       FDT blob
+ * @offset:    Offset of previous subnode
+ * @return offset of next subnode, or -FDT_ERR_NOTFOUND if there are no more
+ * subnodes
+ */
+int fdt_next_subnode(const void *fdt, int offset);
+
+/**
+ * fdt_for_each_subnode - iterate over all subnodes of a parent
+ *
+ * @node:      child node (int, lvalue)
+ * @fdt:       FDT blob (const void *)
+ * @parent:    parent node (int)
+ *
+ * This is actually a wrapper around a for loop and would be used like so:
+ *
+ *     fdt_for_each_subnode(node, fdt, parent) {
+ *             Use node
+ *             ...
+ *     }
+ *
+ *     if ((node < 0) && (node != -FDT_ERR_NOT_FOUND)) {
+ *             Error handling
+ *     }
+ *
+ * Note that this is implemented as a macro and @node is used as
+ * iterator in the loop. The parent variable be constant or even a
+ * literal.
+ *
+ */
+#define fdt_for_each_subnode(node, fdt, parent)                \
+       for (node = fdt_first_subnode(fdt, parent);     \
+            node >= 0;                                 \
+            node = fdt_next_subnode(fdt, node))
+
+/**********************************************************************/
+/* General functions                                                  */
+/**********************************************************************/
+#define fdt_get_header(fdt, field) \
+       (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
+#define fdt_magic(fdt)                 (fdt_get_header(fdt, magic))
+#define fdt_totalsize(fdt)             (fdt_get_header(fdt, totalsize))
+#define fdt_off_dt_struct(fdt)         (fdt_get_header(fdt, off_dt_struct))
+#define fdt_off_dt_strings(fdt)                (fdt_get_header(fdt, off_dt_strings))
+#define fdt_off_mem_rsvmap(fdt)                (fdt_get_header(fdt, off_mem_rsvmap))
+#define fdt_version(fdt)               (fdt_get_header(fdt, version))
+#define fdt_last_comp_version(fdt)     (fdt_get_header(fdt, last_comp_version))
+#define fdt_boot_cpuid_phys(fdt)       (fdt_get_header(fdt, boot_cpuid_phys))
+#define fdt_size_dt_strings(fdt)       (fdt_get_header(fdt, size_dt_strings))
+#define fdt_size_dt_struct(fdt)                (fdt_get_header(fdt, size_dt_struct))
+
+#define __fdt_set_hdr(name) \
+       static inline void fdt_set_##name(void *fdt, uint32_t val) \
+       { \
+               struct fdt_header *fdth = (struct fdt_header *)fdt; \
+               fdth->name = cpu_to_fdt32(val); \
+       }
+__fdt_set_hdr(magic);
+__fdt_set_hdr(totalsize);
+__fdt_set_hdr(off_dt_struct);
+__fdt_set_hdr(off_dt_strings);
+__fdt_set_hdr(off_mem_rsvmap);
+__fdt_set_hdr(version);
+__fdt_set_hdr(last_comp_version);
+__fdt_set_hdr(boot_cpuid_phys);
+__fdt_set_hdr(size_dt_strings);
+__fdt_set_hdr(size_dt_struct);
+#undef __fdt_set_hdr
+
+/**
+ * fdt_check_header - sanity check a device tree or possible device tree
+ * @fdt: pointer to data which might be a flattened device tree
+ *
+ * fdt_check_header() checks that the given buffer contains what
+ * appears to be a flattened device tree with sane information in its
+ * header.
+ *
+ * returns:
+ *     0, if the buffer appears to contain a valid device tree
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings, as above
+ */
+int fdt_check_header(const void *fdt);
+
+/**
+ * fdt_move - move a device tree around in memory
+ * @fdt: pointer to the device tree to move
+ * @buf: pointer to memory where the device is to be moved
+ * @bufsize: size of the memory space at buf
+ *
+ * fdt_move() relocates, if possible, the device tree blob located at
+ * fdt to the buffer at buf of size bufsize.  The buffer may overlap
+ * with the existing device tree blob at fdt.  Therefore,
+ *     fdt_move(fdt, fdt, fdt_totalsize(fdt))
+ * should always succeed.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_move(const void *fdt, void *buf, int bufsize);
+
+/**********************************************************************/
+/* Read-only functions                                                */
+/**********************************************************************/
+
+/**
+ * fdt_string - retrieve a string from the strings block of a device tree
+ * @fdt: pointer to the device tree blob
+ * @stroffset: offset of the string within the strings block (native endian)
+ *
+ * fdt_string() retrieves a pointer to a single string from the
+ * strings block of the device tree blob at fdt.
+ *
+ * returns:
+ *     a pointer to the string, on success
+ *     NULL, if stroffset is out of bounds
+ */
+const char *fdt_string(const void *fdt, int stroffset);
+
+/**
+ * fdt_get_max_phandle - retrieves the highest phandle in a tree
+ * @fdt: pointer to the device tree blob
+ *
+ * fdt_get_max_phandle retrieves the highest phandle in the given
+ * device tree. This will ignore badly formatted phandles, or phandles
+ * with a value of 0 or -1.
+ *
+ * returns:
+ *      the highest phandle on success
+ *      0, if no phandle was found in the device tree
+ *      -1, if an error occurred
+ */
+uint32_t fdt_get_max_phandle(const void *fdt);
+
+/**
+ * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
+ * @fdt: pointer to the device tree blob
+ *
+ * Returns the number of entries in the device tree blob's memory
+ * reservation map.  This does not include the terminating 0,0 entry
+ * or any other (0,0) entries reserved for expansion.
+ *
+ * returns:
+ *     the number of entries
+ */
+int fdt_num_mem_rsv(const void *fdt);
+
+/**
+ * fdt_get_mem_rsv - retrieve one memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @address, @size: pointers to 64-bit variables
+ *
+ * On success, *address and *size will contain the address and size of
+ * the n-th reserve map entry from the device tree blob, in
+ * native-endian format.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
+
+/**
+ * fdt_subnode_offset_namelen - find a subnode based on substring
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_subnode_offset(), but only examine the first
+ * namelen characters of name for matching the subnode name.  This is
+ * useful for finding subnodes based on a portion of a larger string,
+ * such as a full path.
+ */
+#ifndef SWIG /* Not available in Python */
+int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
+                              const char *name, int namelen);
+#endif
+/**
+ * fdt_subnode_offset - find a subnode of a given node
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ *
+ * fdt_subnode_offset() finds a subnode of the node at structure block
+ * offset parentoffset with the given name.  name may include a unit
+ * address, in which case fdt_subnode_offset() will find the subnode
+ * with that unit address, or the unit address may be omitted, in
+ * which case fdt_subnode_offset() will find an arbitrary subnode
+ * whose name excluding unit address matches the given name.
+ *
+ * returns:
+ *     structure block offset of the requested subnode (>=0), on success
+ *     -FDT_ERR_NOTFOUND, if the requested subnode does not exist
+ *     -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
+ *             tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
+
+/**
+ * fdt_path_offset_namelen - find a tree node by its full path
+ * @fdt: pointer to the device tree blob
+ * @path: full path of the node to locate
+ * @namelen: number of characters of path to consider
+ *
+ * Identical to fdt_path_offset(), but only consider the first namelen
+ * characters of path as the path name.
+ */
+#ifndef SWIG /* Not available in Python */
+int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
+#endif
+
+/**
+ * fdt_path_offset - find a tree node by its full path
+ * @fdt: pointer to the device tree blob
+ * @path: full path of the node to locate
+ *
+ * fdt_path_offset() finds a node of a given path in the device tree.
+ * Each path component may omit the unit address portion, but the
+ * results of this are undefined if any such path component is
+ * ambiguous (that is if there are multiple nodes at the relevant
+ * level matching the given component, differentiated only by unit
+ * address).
+ *
+ * returns:
+ *     structure block offset of the node with the requested path (>=0), on
+ *             success
+ *     -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
+ *     -FDT_ERR_NOTFOUND, if the requested node does not exist
+ *      -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_path_offset(const void *fdt, const char *path);
+
+/**
+ * fdt_get_name - retrieve the name of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of the starting node
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_name() retrieves the name (including unit address) of the
+ * device tree node at structure block offset nodeoffset.  If lenp is
+ * non-NULL, the length of this name is also returned, in the integer
+ * pointed to by lenp.
+ *
+ * returns:
+ *     pointer to the node's name, on success
+ *             If lenp is non-NULL, *lenp contains the length of that name
+ *                     (>=0)
+ *     NULL, on error
+ *             if lenp is non-NULL *lenp contains an error code (<0):
+ *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
+ *                     tag
+ *             -FDT_ERR_BADMAGIC,
+ *             -FDT_ERR_BADVERSION,
+ *             -FDT_ERR_BADSTATE, standard meanings
+ */
+const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
+
+/**
+ * fdt_first_property_offset - find the offset of a node's first property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of a node
+ *
+ * fdt_first_property_offset() finds the first property of the node at
+ * the given structure block offset.
+ *
+ * returns:
+ *     structure block offset of the property (>=0), on success
+ *     -FDT_ERR_NOTFOUND, if the requested node has no properties
+ *     -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag
+ *      -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_first_property_offset(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_next_property_offset - step through a node's properties
+ * @fdt: pointer to the device tree blob
+ * @offset: structure block offset of a property
+ *
+ * fdt_next_property_offset() finds the property immediately after the
+ * one at the given structure block offset.  This will be a property
+ * of the same node as the given property.
+ *
+ * returns:
+ *     structure block offset of the next property (>=0), on success
+ *     -FDT_ERR_NOTFOUND, if the given property is the last in its node
+ *     -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag
+ *      -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_next_property_offset(const void *fdt, int offset);
+
+/**
+ * fdt_for_each_property_offset - iterate over all properties of a node
+ *
+ * @property_offset:   property offset (int, lvalue)
+ * @fdt:               FDT blob (const void *)
+ * @node:              node offset (int)
+ *
+ * This is actually a wrapper around a for loop and would be used like so:
+ *
+ *     fdt_for_each_property_offset(property, fdt, node) {
+ *             Use property
+ *             ...
+ *     }
+ *
+ *     if ((property < 0) && (property != -FDT_ERR_NOT_FOUND)) {
+ *             Error handling
+ *     }
+ *
+ * Note that this is implemented as a macro and property is used as
+ * iterator in the loop. The node variable can be constant or even a
+ * literal.
+ */
+#define fdt_for_each_property_offset(property, fdt, node)      \
+       for (property = fdt_first_property_offset(fdt, node);   \
+            property >= 0;                                     \
+            property = fdt_next_property_offset(fdt, property))
+
+/**
+ * fdt_get_property_by_offset - retrieve the property at a given offset
+ * @fdt: pointer to the device tree blob
+ * @offset: offset of the property to retrieve
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_property_by_offset() retrieves a pointer to the
+ * fdt_property structure within the device tree blob at the given
+ * offset.  If lenp is non-NULL, the length of the property value is
+ * also returned, in the integer pointed to by lenp.
+ *
+ * returns:
+ *     pointer to the structure representing the property
+ *             if lenp is non-NULL, *lenp contains the length of the property
+ *             value (>=0)
+ *     NULL, on error
+ *             if lenp is non-NULL, *lenp contains an error code (<0):
+ *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
+ *             -FDT_ERR_BADMAGIC,
+ *             -FDT_ERR_BADVERSION,
+ *             -FDT_ERR_BADSTATE,
+ *             -FDT_ERR_BADSTRUCTURE,
+ *             -FDT_ERR_TRUNCATED, standard meanings
+ */
+const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
+                                                     int offset,
+                                                     int *lenp);
+
+/**
+ * fdt_get_property_namelen - find a property based on substring
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @namelen: number of characters of name to consider
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * Identical to fdt_get_property(), but only examine the first namelen
+ * characters of name for matching the property name.
+ */
+#ifndef SWIG /* Not available in Python */
+const struct fdt_property *fdt_get_property_namelen(const void *fdt,
+                                                   int nodeoffset,
+                                                   const char *name,
+                                                   int namelen, int *lenp);
+#endif
+
+/**
+ * fdt_get_property - find a given property in a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_property() retrieves a pointer to the fdt_property
+ * structure within the device tree blob corresponding to the property
+ * named 'name' of the node at offset nodeoffset.  If lenp is
+ * non-NULL, the length of the property value is also returned, in the
+ * integer pointed to by lenp.
+ *
+ * returns:
+ *     pointer to the structure representing the property
+ *             if lenp is non-NULL, *lenp contains the length of the property
+ *             value (>=0)
+ *     NULL, on error
+ *             if lenp is non-NULL, *lenp contains an error code (<0):
+ *             -FDT_ERR_NOTFOUND, node does not have named property
+ *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
+ *                     tag
+ *             -FDT_ERR_BADMAGIC,
+ *             -FDT_ERR_BADVERSION,
+ *             -FDT_ERR_BADSTATE,
+ *             -FDT_ERR_BADSTRUCTURE,
+ *             -FDT_ERR_TRUNCATED, standard meanings
+ */
+const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
+                                           const char *name, int *lenp);
+static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
+                                                     const char *name,
+                                                     int *lenp)
+{
+       return (struct fdt_property *)(uintptr_t)
+               fdt_get_property(fdt, nodeoffset, name, lenp);
+}
+
+/**
+ * fdt_getprop_by_offset - retrieve the value of a property at a given offset
+ * @fdt: pointer to the device tree blob
+ * @ffset: offset of the property to read
+ * @namep: pointer to a string variable (will be overwritten) or NULL
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_getprop_by_offset() retrieves a pointer to the value of the
+ * property at structure block offset 'offset' (this will be a pointer
+ * to within the device blob itself, not a copy of the value).  If
+ * lenp is non-NULL, the length of the property value is also
+ * returned, in the integer pointed to by lenp.  If namep is non-NULL,
+ * the property's namne will also be returned in the char * pointed to
+ * by namep (this will be a pointer to within the device tree's string
+ * block, not a new copy of the name).
+ *
+ * returns:
+ *     pointer to the property's value
+ *             if lenp is non-NULL, *lenp contains the length of the property
+ *             value (>=0)
+ *             if namep is non-NULL *namep contiains a pointer to the property
+ *             name.
+ *     NULL, on error
+ *             if lenp is non-NULL, *lenp contains an error code (<0):
+ *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
+ *             -FDT_ERR_BADMAGIC,
+ *             -FDT_ERR_BADVERSION,
+ *             -FDT_ERR_BADSTATE,
+ *             -FDT_ERR_BADSTRUCTURE,
+ *             -FDT_ERR_TRUNCATED, standard meanings
+ */
+#ifndef SWIG /* This function is not useful in Python */
+const void *fdt_getprop_by_offset(const void *fdt, int offset,
+                                 const char **namep, int *lenp);
+#endif
+
+/**
+ * fdt_getprop_namelen - get property value based on substring
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @namelen: number of characters of name to consider
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * Identical to fdt_getprop(), but only examine the first namelen
+ * characters of name for matching the property name.
+ */
+#ifndef SWIG /* Not available in Python */
+const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
+                               const char *name, int namelen, int *lenp);
+static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset,
+                                         const char *name, int namelen,
+                                         int *lenp)
+{
+       return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name,
+                                                     namelen, lenp);
+}
+#endif
+
+/**
+ * fdt_getprop - retrieve the value of a given property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_getprop() retrieves a pointer to the value of the property
+ * named 'name' of the node at offset nodeoffset (this will be a
+ * pointer to within the device blob itself, not a copy of the value).
+ * If lenp is non-NULL, the length of the property value is also
+ * returned, in the integer pointed to by lenp.
+ *
+ * returns:
+ *     pointer to the property's value
+ *             if lenp is non-NULL, *lenp contains the length of the property
+ *             value (>=0)
+ *     NULL, on error
+ *             if lenp is non-NULL, *lenp contains an error code (<0):
+ *             -FDT_ERR_NOTFOUND, node does not have named property
+ *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
+ *                     tag
+ *             -FDT_ERR_BADMAGIC,
+ *             -FDT_ERR_BADVERSION,
+ *             -FDT_ERR_BADSTATE,
+ *             -FDT_ERR_BADSTRUCTURE,
+ *             -FDT_ERR_TRUNCATED, standard meanings
+ */
+const void *fdt_getprop(const void *fdt, int nodeoffset,
+                       const char *name, int *lenp);
+static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
+                                 const char *name, int *lenp)
+{
+       return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
+}
+
+/**
+ * fdt_get_phandle - retrieve the phandle of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of the node
+ *
+ * fdt_get_phandle() retrieves the phandle of the device tree node at
+ * structure block offset nodeoffset.
+ *
+ * returns:
+ *     the phandle of the node at nodeoffset, on success (!= 0, != -1)
+ *     0, if the node has no phandle, or another error occurs
+ */
+uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_get_alias_namelen - get alias based on substring
+ * @fdt: pointer to the device tree blob
+ * @name: name of the alias th look up
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_get_alias(), but only examine the first namelen
+ * characters of name for matching the alias name.
+ */
+#ifndef SWIG /* Not available in Python */
+const char *fdt_get_alias_namelen(const void *fdt,
+                                 const char *name, int namelen);
+#endif
+
+/**
+ * fdt_get_alias - retrieve the path referenced by a given alias
+ * @fdt: pointer to the device tree blob
+ * @name: name of the alias th look up
+ *
+ * fdt_get_alias() retrieves the value of a given alias.  That is, the
+ * value of the property named 'name' in the node /aliases.
+ *
+ * returns:
+ *     a pointer to the expansion of the alias named 'name', if it exists
+ *     NULL, if the given alias or the /aliases node does not exist
+ */
+const char *fdt_get_alias(const void *fdt, const char *name);
+
+/**
+ * fdt_get_path - determine the full path of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose path to find
+ * @buf: character buffer to contain the returned path (will be overwritten)
+ * @buflen: size of the character buffer at buf
+ *
+ * fdt_get_path() computes the full path of the node at offset
+ * nodeoffset, and records that path in the buffer at buf.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *     0, on success
+ *             buf contains the absolute path of the node at
+ *             nodeoffset, as a NUL-terminated string.
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
+ *             characters and will not fit in the given buffer.
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
+
+/**
+ * fdt_supernode_atdepth_offset - find a specific ancestor of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ * @supernodedepth: depth of the ancestor to find
+ * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_supernode_atdepth_offset() finds an ancestor of the given node
+ * at a specific depth from the root (where the root itself has depth
+ * 0, its immediate subnodes depth 1 and so forth).  So
+ *     fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
+ * will always return 0, the offset of the root node.  If the node at
+ * nodeoffset has depth D, then:
+ *     fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
+ * will return nodeoffset itself.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *     structure block offset of the node at node offset's ancestor
+ *             of depth supernodedepth (>=0), on success
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of
+ *             nodeoffset
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
+                                int supernodedepth, int *nodedepth);
+
+/**
+ * fdt_node_depth - find the depth of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_node_depth() finds the depth of a given node.  The root node
+ * has depth 0, its immediate subnodes depth 1 and so forth.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *     depth of the node at nodeoffset (>=0), on success
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_depth(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_parent_offset - find the parent of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_parent_offset() locates the parent node of a given node (that
+ * is, it finds the offset of the node which contains the node at
+ * nodeoffset as a subnode).
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset, *twice*.
+ *
+ * returns:
+ *     structure block offset of the parent of the node at nodeoffset
+ *             (>=0), on success
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_parent_offset(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_node_offset_by_prop_value - find nodes with a given property value
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ * @propname: property name to check
+ * @propval: property value to search for
+ * @proplen: length of the value in propval
+ *
+ * fdt_node_offset_by_prop_value() returns the offset of the first
+ * node after startoffset, which has a property named propname whose
+ * value is of length proplen and has value equal to propval; or if
+ * startoffset is -1, the very first such node in the tree.
+ *
+ * To iterate through all nodes matching the criterion, the following
+ * idiom can be used:
+ *     offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
+ *                                            propval, proplen);
+ *     while (offset != -FDT_ERR_NOTFOUND) {
+ *             // other code here
+ *             offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
+ *                                                    propval, proplen);
+ *     }
+ *
+ * Note the -1 in the first call to the function, if 0 is used here
+ * instead, the function will never locate the root node, even if it
+ * matches the criterion.
+ *
+ * returns:
+ *     structure block offset of the located node (>= 0, >startoffset),
+ *              on success
+ *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+ *             tree after startoffset
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
+                                 const char *propname,
+                                 const void *propval, int proplen);
+
+/**
+ * fdt_node_offset_by_phandle - find the node with a given phandle
+ * @fdt: pointer to the device tree blob
+ * @phandle: phandle value
+ *
+ * fdt_node_offset_by_phandle() returns the offset of the node
+ * which has the given phandle value.  If there is more than one node
+ * in the tree with the given phandle (an invalid tree), results are
+ * undefined.
+ *
+ * returns:
+ *     structure block offset of the located node (>= 0), on success
+ *     -FDT_ERR_NOTFOUND, no node with that phandle exists
+ *     -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
+
+/**
+ * fdt_node_check_compatible: check a node's compatible property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of a tree node
+ * @compatible: string to match against
+ *
+ *
+ * fdt_node_check_compatible() returns 0 if the given node contains a
+ * 'compatible' property with the given string as one of its elements,
+ * it returns non-zero otherwise, or on error.
+ *
+ * returns:
+ *     0, if the node has a 'compatible' property listing the given string
+ *     1, if the node has a 'compatible' property, but it does not list
+ *             the given string
+ *     -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
+ *     -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_check_compatible(const void *fdt, int nodeoffset,
+                             const char *compatible);
+
+/**
+ * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ * @compatible: 'compatible' string to match against
+ *
+ * fdt_node_offset_by_compatible() returns the offset of the first
+ * node after startoffset, which has a 'compatible' property which
+ * lists the given compatible string; or if startoffset is -1, the
+ * very first such node in the tree.
+ *
+ * To iterate through all nodes matching the criterion, the following
+ * idiom can be used:
+ *     offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
+ *     while (offset != -FDT_ERR_NOTFOUND) {
+ *             // other code here
+ *             offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
+ *     }
+ *
+ * Note the -1 in the first call to the function, if 0 is used here
+ * instead, the function will never locate the root node, even if it
+ * matches the criterion.
+ *
+ * returns:
+ *     structure block offset of the located node (>= 0, >startoffset),
+ *              on success
+ *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+ *             tree after startoffset
+ *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
+                                 const char *compatible);
+
+/**
+ * fdt_stringlist_contains - check a string list property for a string
+ * @strlist: Property containing a list of strings to check
+ * @listlen: Length of property
+ * @str: String to search for
+ *
+ * This is a utility function provided for convenience. The list contains
+ * one or more strings, each terminated by \0, as is found in a device tree
+ * "compatible" property.
+ *
+ * @return: 1 if the string is found in the list, 0 not found, or invalid list
+ */
+int fdt_stringlist_contains(const char *strlist, int listlen, const char *str);
+
+/**
+ * fdt_stringlist_count - count the number of strings in a string list
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of a tree node
+ * @property: name of the property containing the string list
+ * @return:
+ *   the number of strings in the given property
+ *   -FDT_ERR_BADVALUE if the property value is not NUL-terminated
+ *   -FDT_ERR_NOTFOUND if the property does not exist
+ */
+int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property);
+
+/**
+ * fdt_stringlist_search - find a string in a string list and return its index
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of a tree node
+ * @property: name of the property containing the string list
+ * @string: string to look up in the string list
+ *
+ * Note that it is possible for this function to succeed on property values
+ * that are not NUL-terminated. That's because the function will stop after
+ * finding the first occurrence of @string. This can for example happen with
+ * small-valued cell properties, such as #address-cells, when searching for
+ * the empty string.
+ *
+ * @return:
+ *   the index of the string in the list of strings
+ *   -FDT_ERR_BADVALUE if the property value is not NUL-terminated
+ *   -FDT_ERR_NOTFOUND if the property does not exist or does not contain
+ *                     the given string
+ */
+int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
+                         const char *string);
+
+/**
+ * fdt_stringlist_get() - obtain the string at a given index in a string list
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of a tree node
+ * @property: name of the property containing the string list
+ * @index: index of the string to return
+ * @lenp: return location for the string length or an error code on failure
+ *
+ * Note that this will successfully extract strings from properties with
+ * non-NUL-terminated values. For example on small-valued cell properties
+ * this function will return the empty string.
+ *
+ * If non-NULL, the length of the string (on success) or a negative error-code
+ * (on failure) will be stored in the integer pointer to by lenp.
+ *
+ * @return:
+ *   A pointer to the string at the given index in the string list or NULL on
+ *   failure. On success the length of the string will be stored in the memory
+ *   location pointed to by the lenp parameter, if non-NULL. On failure one of
+ *   the following negative error codes will be returned in the lenp parameter
+ *   (if non-NULL):
+ *     -FDT_ERR_BADVALUE if the property value is not NUL-terminated
+ *     -FDT_ERR_NOTFOUND if the property does not exist
+ */
+const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
+                              const char *property, int index,
+                              int *lenp);
+
+/**********************************************************************/
+/* Read-only functions (addressing related)                           */
+/**********************************************************************/
+
+/**
+ * FDT_MAX_NCELLS - maximum value for #address-cells and #size-cells
+ *
+ * This is the maximum value for #address-cells, #size-cells and
+ * similar properties that will be processed by libfdt.  IEE1275
+ * requires that OF implementations handle values up to 4.
+ * Implementations may support larger values, but in practice higher
+ * values aren't used.
+ */
+#define FDT_MAX_NCELLS         4
+
+/**
+ * fdt_address_cells - retrieve address size for a bus represented in the tree
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to find the address size for
+ *
+ * When the node has a valid #address-cells property, returns its value.
+ *
+ * returns:
+ *     0 <= n < FDT_MAX_NCELLS, on success
+ *      2, if the node has no #address-cells property
+ *      -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
+ *             #address-cells property
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_address_cells(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_size_cells - retrieve address range size for a bus represented in the
+ *                  tree
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to find the address range size for
+ *
+ * When the node has a valid #size-cells property, returns its value.
+ *
+ * returns:
+ *     0 <= n < FDT_MAX_NCELLS, on success
+ *      2, if the node has no #address-cells property
+ *      -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
+ *             #size-cells property
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_size_cells(const void *fdt, int nodeoffset);
+
+
+/**********************************************************************/
+/* Write-in-place functions                                           */
+/**********************************************************************/
+
+/**
+ * fdt_setprop_inplace_namelen_partial - change a property's value,
+ *                                       but not its size
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @namelen: number of characters of name to consider
+ * @idx: index of the property to change in the array
+ * @val: pointer to data to replace the property value with
+ * @len: length of the property value
+ *
+ * Identical to fdt_setprop_inplace(), but modifies the given property
+ * starting from the given index, and using only the first characters
+ * of the name. It is useful when you want to manipulate only one value of
+ * an array and you have a string that doesn't end with \0.
+ */
+#ifndef SWIG /* Not available in Python */
+int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
+                                       const char *name, int namelen,
+                                       uint32_t idx, const void *val,
+                                       int len);
+#endif
+
+/**
+ * fdt_setprop_inplace - change a property's value, but not its size
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: pointer to data to replace the property value with
+ * @len: length of the property value
+ *
+ * fdt_setprop_inplace() replaces the value of a given property with
+ * the data in val, of length len.  This function cannot change the
+ * size of a property, and so will only work if len is equal to the
+ * current length of the property.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the given property value, and will not alter or move any other part
+ * of the tree.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, if len is not equal to the property's current length
+ *     -FDT_ERR_NOTFOUND, node does not have the named property
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+#ifndef SWIG /* Not available in Python */
+int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
+                       const void *val, int len);
+#endif
+
+/**
+ * fdt_setprop_inplace_u32 - change the value of a 32-bit integer property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 32-bit integer value to replace the property with
+ *
+ * fdt_setprop_inplace_u32() replaces the value of a given property
+ * with the 32-bit integer value in val, converting val to big-endian
+ * if necessary.  This function cannot change the size of a property,
+ * and so will only work if the property already exists and has length
+ * 4.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the given property value, and will not alter or move any other part
+ * of the tree.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, if the property's length is not equal to 4
+ *     -FDT_ERR_NOTFOUND, node does not have the named property
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
+                                         const char *name, uint32_t val)
+{
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
+}
+
+/**
+ * fdt_setprop_inplace_u64 - change the value of a 64-bit integer property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 64-bit integer value to replace the property with
+ *
+ * fdt_setprop_inplace_u64() replaces the value of a given property
+ * with the 64-bit integer value in val, converting val to big-endian
+ * if necessary.  This function cannot change the size of a property,
+ * and so will only work if the property already exists and has length
+ * 8.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the given property value, and will not alter or move any other part
+ * of the tree.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, if the property's length is not equal to 8
+ *     -FDT_ERR_NOTFOUND, node does not have the named property
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
+                                         const char *name, uint64_t val)
+{
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp));
+}
+
+/**
+ * fdt_setprop_inplace_cell - change the value of a single-cell property
+ *
+ * This is an alternative name for fdt_setprop_inplace_u32()
+ */
+static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
+                                          const char *name, uint32_t val)
+{
+       return fdt_setprop_inplace_u32(fdt, nodeoffset, name, val);
+}
+
+/**
+ * fdt_nop_property - replace a property with nop tags
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to nop
+ * @name: name of the property to nop
+ *
+ * fdt_nop_property() will replace a given property's representation
+ * in the blob with FDT_NOP tags, effectively removing it from the
+ * tree.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the property, and will not alter or move any other part of the
+ * tree.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOTFOUND, node does not have the named property
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
+
+/**
+ * fdt_nop_node - replace a node (subtree) with nop tags
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to nop
+ *
+ * fdt_nop_node() will replace a given node's representation in the
+ * blob, including all its subnodes, if any, with FDT_NOP tags,
+ * effectively removing it from the tree.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the node and its properties and subnodes, and will not alter or
+ * move any other part of the tree.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_nop_node(void *fdt, int nodeoffset);
+
+/**********************************************************************/
+/* Sequential write functions                                         */
+/**********************************************************************/
+
+int fdt_create(void *buf, int bufsize);
+int fdt_resize(void *fdt, void *buf, int bufsize);
+int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
+int fdt_finish_reservemap(void *fdt);
+int fdt_begin_node(void *fdt, const char *name);
+int fdt_property(void *fdt, const char *name, const void *val, int len);
+static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
+{
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_property(fdt, name, &tmp, sizeof(tmp));
+}
+static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
+{
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_property(fdt, name, &tmp, sizeof(tmp));
+}
+static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
+{
+       return fdt_property_u32(fdt, name, val);
+}
+
+/**
+ * fdt_property_placeholder - add a new property and return a ptr to its value
+ *
+ * @fdt: pointer to the device tree blob
+ * @name: name of property to add
+ * @len: length of property value in bytes
+ * @valp: returns a pointer to where where the value should be placed
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_NOSPACE, standard meanings
+ */
+int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp);
+
+#define fdt_property_string(fdt, name, str) \
+       fdt_property(fdt, name, str, strlen(str)+1)
+int fdt_end_node(void *fdt);
+int fdt_finish(void *fdt);
+
+/**********************************************************************/
+/* Read-write functions                                               */
+/**********************************************************************/
+
+int fdt_create_empty_tree(void *buf, int bufsize);
+int fdt_open_into(const void *fdt, void *buf, int bufsize);
+int fdt_pack(void *fdt);
+
+/**
+ * fdt_add_mem_rsv - add one memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @address, @size: 64-bit values (native endian)
+ *
+ * Adds a reserve map entry to the given blob reserving a region at
+ * address address of length size.
+ *
+ * This function will insert data into the reserve map and will
+ * therefore change the indexes of some entries in the table.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new reservation entry
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
+
+/**
+ * fdt_del_mem_rsv - remove a memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @n: entry to remove
+ *
+ * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
+ * the blob.
+ *
+ * This function will delete data from the reservation table and will
+ * therefore change the indexes of some entries in the table.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
+ *             are less than n+1 reserve map entries)
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_del_mem_rsv(void *fdt, int n);
+
+/**
+ * fdt_set_name - change the name of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of a node
+ * @name: name to give the node
+ *
+ * fdt_set_name() replaces the name (including unit address, if any)
+ * of the given node with the given string.  NOTE: this function can't
+ * efficiently check if the new name is unique amongst the given
+ * node's siblings; results are undefined if this function is invoked
+ * with a name equal to one of the given node's siblings.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob
+ *             to contain the new name
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_set_name(void *fdt, int nodeoffset, const char *name);
+
+/**
+ * fdt_setprop - create or change a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: pointer to data to set the property value to
+ * @len: length of the property value
+ *
+ * fdt_setprop() sets the value of the named property in the given
+ * node to the given value and length, creating the property if it
+ * does not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_setprop(void *fdt, int nodeoffset, const char *name,
+               const void *val, int len);
+
+/**
+ * fdt_setprop _placeholder - allocate space for a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @len: length of the property value
+ * @prop_data: return pointer to property data
+ *
+ * fdt_setprop_placeholer() allocates the named property in the given node.
+ * If the property exists it is resized. In either case a pointer to the
+ * property data is returned.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
+                           int len, void **prop_data);
+
+/**
+ * fdt_setprop_u32 - set a property to a 32-bit integer
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 32-bit integer value for the property (native endian)
+ *
+ * fdt_setprop_u32() sets the value of the named property in the given
+ * node to the given 32-bit integer value (converting to big-endian if
+ * necessary), or creates a new property with that value if it does
+ * not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
+                                 uint32_t val)
+{
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
+}
+
+/**
+ * fdt_setprop_u64 - set a property to a 64-bit integer
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 64-bit integer value for the property (native endian)
+ *
+ * fdt_setprop_u64() sets the value of the named property in the given
+ * node to the given 64-bit integer value (converting to big-endian if
+ * necessary), or creates a new property with that value if it does
+ * not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
+                                 uint64_t val)
+{
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
+}
+
+/**
+ * fdt_setprop_cell - set a property to a single cell value
+ *
+ * This is an alternative name for fdt_setprop_u32()
+ */
+static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
+                                  uint32_t val)
+{
+       return fdt_setprop_u32(fdt, nodeoffset, name, val);
+}
+
+/**
+ * fdt_setprop_string - set a property to a string value
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @str: string value for the property
+ *
+ * fdt_setprop_string() sets the value of the named property in the
+ * given node to the given string value (using the length of the
+ * string to determine the new length of the property), or creates a
+ * new property with that value if it does not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+#define fdt_setprop_string(fdt, nodeoffset, name, str) \
+       fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
+
+
+/**
+ * fdt_setprop_empty - set a property to an empty value
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ *
+ * fdt_setprop_empty() sets the value of the named property in the
+ * given node to an empty (zero length) value, or creates a new empty
+ * property if it does not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+#define fdt_setprop_empty(fdt, nodeoffset, name) \
+       fdt_setprop((fdt), (nodeoffset), (name), NULL, 0)
+
+/**
+ * fdt_appendprop - append to or create a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to append to
+ * @val: pointer to data to append to the property value
+ * @len: length of the data to append to the property value
+ *
+ * fdt_appendprop() appends the value to the named property in the
+ * given node, creating the property if it does not already exist.
+ *
+ * This function may insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
+                  const void *val, int len);
+
+/**
+ * fdt_appendprop_u32 - append a 32-bit integer value to a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 32-bit integer value to append to the property (native endian)
+ *
+ * fdt_appendprop_u32() appends the given 32-bit integer value
+ * (converting to big-endian if necessary) to the value of the named
+ * property in the given node, or creates a new property with that
+ * value if it does not already exist.
+ *
+ * This function may insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
+                                    const char *name, uint32_t val)
+{
+       fdt32_t tmp = cpu_to_fdt32(val);
+       return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
+}
+
+/**
+ * fdt_appendprop_u64 - append a 64-bit integer value to a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 64-bit integer value to append to the property (native endian)
+ *
+ * fdt_appendprop_u64() appends the given 64-bit integer value
+ * (converting to big-endian if necessary) to the value of the named
+ * property in the given node, or creates a new property with that
+ * value if it does not already exist.
+ *
+ * This function may insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
+                                    const char *name, uint64_t val)
+{
+       fdt64_t tmp = cpu_to_fdt64(val);
+       return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp));
+}
+
+/**
+ * fdt_appendprop_cell - append a single cell value to a property
+ *
+ * This is an alternative name for fdt_appendprop_u32()
+ */
+static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
+                                     const char *name, uint32_t val)
+{
+       return fdt_appendprop_u32(fdt, nodeoffset, name, val);
+}
+
+/**
+ * fdt_appendprop_string - append a string to a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @str: string value to append to the property
+ *
+ * fdt_appendprop_string() appends the given string to the value of
+ * the named property in the given node, or creates a new property
+ * with that value if it does not already exist.
+ *
+ * This function may insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain the new property value
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+#define fdt_appendprop_string(fdt, nodeoffset, name, str) \
+       fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
+
+/**
+ * fdt_delprop - delete a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to nop
+ * @name: name of the property to nop
+ *
+ * fdt_del_property() will delete the given property.
+ *
+ * This function will delete data from the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOTFOUND, node does not have the named property
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_delprop(void *fdt, int nodeoffset, const char *name);
+
+/**
+ * fdt_add_subnode_namelen - creates a new node based on substring
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_add_subnode(), but use only the first namelen
+ * characters of name as the name of the new node.  This is useful for
+ * creating subnodes based on a portion of a larger string, such as a
+ * full path.
+ */
+#ifndef SWIG /* Not available in Python */
+int fdt_add_subnode_namelen(void *fdt, int parentoffset,
+                           const char *name, int namelen);
+#endif
+
+/**
+ * fdt_add_subnode - creates a new node
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ *
+ * fdt_add_subnode() creates a new node as a subnode of the node at
+ * structure block offset parentoffset, with the given name (which
+ * should include the unit address, if any).
+ *
+ * This function will insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+
+ * returns:
+ *     structure block offset of the created nodeequested subnode (>=0), on
+ *             success
+ *     -FDT_ERR_NOTFOUND, if the requested subnode does not exist
+ *     -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
+ *             tag
+ *     -FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
+ *             the given name
+ *     -FDT_ERR_NOSPACE, if there is insufficient free space in the
+ *             blob to contain the new node
+ *     -FDT_ERR_NOSPACE
+ *     -FDT_ERR_BADLAYOUT
+ *      -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
+
+/**
+ * fdt_del_node - delete a node (subtree)
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to nop
+ *
+ * fdt_del_node() will remove the given node, including all its
+ * subnodes if any, from the blob.
+ *
+ * This function will delete data from the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_del_node(void *fdt, int nodeoffset);
+
+/**
+ * fdt_overlay_apply - Applies a DT overlay on a base DT
+ * @fdt: pointer to the base device tree blob
+ * @fdto: pointer to the device tree overlay blob
+ *
+ * fdt_overlay_apply() will apply the given device tree overlay on the
+ * given base device tree.
+ *
+ * Expect the base device tree to be modified, even if the function
+ * returns an error.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there's not enough space in the base device tree
+ *     -FDT_ERR_NOTFOUND, the overlay points to some inexistant nodes or
+ *             properties in the base DT
+ *     -FDT_ERR_BADPHANDLE,
+ *     -FDT_ERR_BADOVERLAY,
+ *     -FDT_ERR_NOPHANDLES,
+ *     -FDT_ERR_INTERNAL,
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADOFFSET,
+ *     -FDT_ERR_BADPATH,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_overlay_apply(void *fdt, void *fdto);
+
+/**********************************************************************/
+/* Debugging / informational functions                                */
+/**********************************************************************/
+
+const char *fdt_strerror(int errval);
+
+#endif /* _LIBFDT_H */
diff --git a/scripts/dtc/libfdt/libfdt_env.h b/scripts/dtc/libfdt/libfdt_env.h
new file mode 100644 (file)
index 0000000..952056c
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef _LIBFDT_ENV_H
+#define _LIBFDT_ENV_H
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ * Copyright 2012 Kim Phillips, Freescale Semiconductor.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef __CHECKER__
+#define FDT_FORCE __attribute__((force))
+#define FDT_BITWISE __attribute__((bitwise))
+#else
+#define FDT_FORCE
+#define FDT_BITWISE
+#endif
+
+typedef uint16_t FDT_BITWISE fdt16_t;
+typedef uint32_t FDT_BITWISE fdt32_t;
+typedef uint64_t FDT_BITWISE fdt64_t;
+
+#define EXTRACT_BYTE(x, n)     ((unsigned long long)((uint8_t *)&x)[n])
+#define CPU_TO_FDT16(x) ((EXTRACT_BYTE(x, 0) << 8) | EXTRACT_BYTE(x, 1))
+#define CPU_TO_FDT32(x) ((EXTRACT_BYTE(x, 0) << 24) | (EXTRACT_BYTE(x, 1) << 16) | \
+                        (EXTRACT_BYTE(x, 2) << 8) | EXTRACT_BYTE(x, 3))
+#define CPU_TO_FDT64(x) ((EXTRACT_BYTE(x, 0) << 56) | (EXTRACT_BYTE(x, 1) << 48) | \
+                        (EXTRACT_BYTE(x, 2) << 40) | (EXTRACT_BYTE(x, 3) << 32) | \
+                        (EXTRACT_BYTE(x, 4) << 24) | (EXTRACT_BYTE(x, 5) << 16) | \
+                        (EXTRACT_BYTE(x, 6) << 8) | EXTRACT_BYTE(x, 7))
+
+static inline uint16_t fdt16_to_cpu(fdt16_t x)
+{
+       return (FDT_FORCE uint16_t)CPU_TO_FDT16(x);
+}
+static inline fdt16_t cpu_to_fdt16(uint16_t x)
+{
+       return (FDT_FORCE fdt16_t)CPU_TO_FDT16(x);
+}
+
+static inline uint32_t fdt32_to_cpu(fdt32_t x)
+{
+       return (FDT_FORCE uint32_t)CPU_TO_FDT32(x);
+}
+static inline fdt32_t cpu_to_fdt32(uint32_t x)
+{
+       return (FDT_FORCE fdt32_t)CPU_TO_FDT32(x);
+}
+
+static inline uint64_t fdt64_to_cpu(fdt64_t x)
+{
+       return (FDT_FORCE uint64_t)CPU_TO_FDT64(x);
+}
+static inline fdt64_t cpu_to_fdt64(uint64_t x)
+{
+       return (FDT_FORCE fdt64_t)CPU_TO_FDT64(x);
+}
+#undef CPU_TO_FDT64
+#undef CPU_TO_FDT32
+#undef CPU_TO_FDT16
+#undef EXTRACT_BYTE
+
+#endif /* _LIBFDT_ENV_H */
diff --git a/scripts/dtc/libfdt/libfdt_internal.h b/scripts/dtc/libfdt/libfdt_internal.h
new file mode 100644 (file)
index 0000000..02cfa6f
--- /dev/null
@@ -0,0 +1,95 @@
+#ifndef _LIBFDT_INTERNAL_H
+#define _LIBFDT_INTERNAL_H
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 library 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. 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.
+ *
+ *     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 ANY DIRECT, 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 <fdt.h>
+
+#define FDT_ALIGN(x, a)                (((x) + (a) - 1) & ~((a) - 1))
+#define FDT_TAGALIGN(x)                (FDT_ALIGN((x), FDT_TAGSIZE))
+
+#define FDT_CHECK_HEADER(fdt) \
+       { \
+               int __err; \
+               if ((__err = fdt_check_header(fdt)) != 0) \
+                       return __err; \
+       }
+
+int _fdt_check_node_offset(const void *fdt, int offset);
+int _fdt_check_prop_offset(const void *fdt, int offset);
+const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
+int _fdt_node_end_offset(void *fdt, int nodeoffset);
+
+static inline const void *_fdt_offset_ptr(const void *fdt, int offset)
+{
+       return (const char *)fdt + fdt_off_dt_struct(fdt) + offset;
+}
+
+static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
+{
+       return (void *)(uintptr_t)_fdt_offset_ptr(fdt, offset);
+}
+
+static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n)
+{
+       const struct fdt_reserve_entry *rsv_table =
+               (const struct fdt_reserve_entry *)
+               ((const char *)fdt + fdt_off_mem_rsvmap(fdt));
+
+       return rsv_table + n;
+}
+static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
+{
+       return (void *)(uintptr_t)_fdt_mem_rsv(fdt, n);
+}
+
+#define FDT_SW_MAGIC           (~FDT_MAGIC)
+
+#endif /* _LIBFDT_INTERNAL_H */
diff --git a/scripts/dtc/livetree.c b/scripts/dtc/livetree.c
new file mode 100644 (file)
index 0000000..aecd278
--- /dev/null
@@ -0,0 +1,981 @@
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#include "dtc.h"
+
+/*
+ * Tree building functions
+ */
+
+void add_label(struct label **labels, char *label)
+{
+       struct label *new;
+
+       /* Make sure the label isn't already there */
+       for_each_label_withdel(*labels, new)
+               if (streq(new->label, label)) {
+                       new->deleted = 0;
+                       return;
+               }
+
+       new = xmalloc(sizeof(*new));
+       memset(new, 0, sizeof(*new));
+       new->label = label;
+       new->next = *labels;
+       *labels = new;
+}
+
+void delete_labels(struct label **labels)
+{
+       struct label *label;
+
+       for_each_label(*labels, label)
+               label->deleted = 1;
+}
+
+struct property *build_property(char *name, struct data val)
+{
+       struct property *new = xmalloc(sizeof(*new));
+
+       memset(new, 0, sizeof(*new));
+
+       new->name = name;
+       new->val = val;
+
+       return new;
+}
+
+struct property *build_property_delete(char *name)
+{
+       struct property *new = xmalloc(sizeof(*new));
+
+       memset(new, 0, sizeof(*new));
+
+       new->name = name;
+       new->deleted = 1;
+
+       return new;
+}
+
+struct property *chain_property(struct property *first, struct property *list)
+{
+       assert(first->next == NULL);
+
+       first->next = list;
+       return first;
+}
+
+struct property *reverse_properties(struct property *first)
+{
+       struct property *p = first;
+       struct property *head = NULL;
+       struct property *next;
+
+       while (p) {
+               next = p->next;
+               p->next = head;
+               head = p;
+               p = next;
+       }
+       return head;
+}
+
+struct node *build_node(struct property *proplist, struct node *children)
+{
+       struct node *new = xmalloc(sizeof(*new));
+       struct node *child;
+
+       memset(new, 0, sizeof(*new));
+
+       new->proplist = reverse_properties(proplist);
+       new->children = children;
+
+       for_each_child(new, child) {
+               child->parent = new;
+       }
+
+       return new;
+}
+
+struct node *build_node_delete(void)
+{
+       struct node *new = xmalloc(sizeof(*new));
+
+       memset(new, 0, sizeof(*new));
+
+       new->deleted = 1;
+
+       return new;
+}
+
+struct node *name_node(struct node *node, char *name)
+{
+       assert(node->name == NULL);
+
+       node->name = name;
+
+       return node;
+}
+
+struct node *merge_nodes(struct node *old_node, struct node *new_node)
+{
+       struct property *new_prop, *old_prop;
+       struct node *new_child, *old_child;
+       struct label *l;
+
+       old_node->deleted = 0;
+
+       /* Add new node labels to old node */
+       for_each_label_withdel(new_node->labels, l)
+               add_label(&old_node->labels, l->label);
+
+       /* Move properties from the new node to the old node.  If there
+        * is a collision, replace the old value with the new */
+       while (new_node->proplist) {
+               /* Pop the property off the list */
+               new_prop = new_node->proplist;
+               new_node->proplist = new_prop->next;
+               new_prop->next = NULL;
+
+               if (new_prop->deleted) {
+                       delete_property_by_name(old_node, new_prop->name);
+                       free(new_prop);
+                       continue;
+               }
+
+               /* Look for a collision, set new value if there is */
+               for_each_property_withdel(old_node, old_prop) {
+                       if (streq(old_prop->name, new_prop->name)) {
+                               /* Add new labels to old property */
+                               for_each_label_withdel(new_prop->labels, l)
+                                       add_label(&old_prop->labels, l->label);
+
+                               old_prop->val = new_prop->val;
+                               old_prop->deleted = 0;
+                               free(new_prop);
+                               new_prop = NULL;
+                               break;
+                       }
+               }
+
+               /* if no collision occurred, add property to the old node. */
+               if (new_prop)
+                       add_property(old_node, new_prop);
+       }
+
+       /* Move the override child nodes into the primary node.  If
+        * there is a collision, then merge the nodes. */
+       while (new_node->children) {
+               /* Pop the child node off the list */
+               new_child = new_node->children;
+               new_node->children = new_child->next_sibling;
+               new_child->parent = NULL;
+               new_child->next_sibling = NULL;
+
+               if (new_child->deleted) {
+                       delete_node_by_name(old_node, new_child->name);
+                       free(new_child);
+                       continue;
+               }
+
+               /* Search for a collision.  Merge if there is */
+               for_each_child_withdel(old_node, old_child) {
+                       if (streq(old_child->name, new_child->name)) {
+                               merge_nodes(old_child, new_child);
+                               new_child = NULL;
+                               break;
+                       }
+               }
+
+               /* if no collision occurred, add child to the old node. */
+               if (new_child)
+                       add_child(old_node, new_child);
+       }
+
+       /* The new node contents are now merged into the old node.  Free
+        * the new node. */
+       free(new_node);
+
+       return old_node;
+}
+
+struct node *chain_node(struct node *first, struct node *list)
+{
+       assert(first->next_sibling == NULL);
+
+       first->next_sibling = list;
+       return first;
+}
+
+void add_property(struct node *node, struct property *prop)
+{
+       struct property **p;
+
+       prop->next = NULL;
+
+       p = &node->proplist;
+       while (*p)
+               p = &((*p)->next);
+
+       *p = prop;
+}
+
+void delete_property_by_name(struct node *node, char *name)
+{
+       struct property *prop = node->proplist;
+
+       while (prop) {
+               if (streq(prop->name, name)) {
+                       delete_property(prop);
+                       return;
+               }
+               prop = prop->next;
+       }
+}
+
+void delete_property(struct property *prop)
+{
+       prop->deleted = 1;
+       delete_labels(&prop->labels);
+}
+
+void add_child(struct node *parent, struct node *child)
+{
+       struct node **p;
+
+       child->next_sibling = NULL;
+       child->parent = parent;
+
+       p = &parent->children;
+       while (*p)
+               p = &((*p)->next_sibling);
+
+       *p = child;
+}
+
+void delete_node_by_name(struct node *parent, char *name)
+{
+       struct node *node = parent->children;
+
+       while (node) {
+               if (streq(node->name, name)) {
+                       delete_node(node);
+                       return;
+               }
+               node = node->next_sibling;
+       }
+}
+
+void delete_node(struct node *node)
+{
+       struct property *prop;
+       struct node *child;
+
+       node->deleted = 1;
+       for_each_child(node, child)
+               delete_node(child);
+       for_each_property(node, prop)
+               delete_property(prop);
+       delete_labels(&node->labels);
+}
+
+void append_to_property(struct node *node,
+                                   char *name, const void *data, int len)
+{
+       struct data d;
+       struct property *p;
+
+       p = get_property(node, name);
+       if (p) {
+               d = data_append_data(p->val, data, len);
+               p->val = d;
+       } else {
+               d = data_append_data(empty_data, data, len);
+               p = build_property(name, d);
+               add_property(node, p);
+       }
+}
+
+struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size)
+{
+       struct reserve_info *new = xmalloc(sizeof(*new));
+
+       memset(new, 0, sizeof(*new));
+
+       new->address = address;
+       new->size = size;
+
+       return new;
+}
+
+struct reserve_info *chain_reserve_entry(struct reserve_info *first,
+                                       struct reserve_info *list)
+{
+       assert(first->next == NULL);
+
+       first->next = list;
+       return first;
+}
+
+struct reserve_info *add_reserve_entry(struct reserve_info *list,
+                                     struct reserve_info *new)
+{
+       struct reserve_info *last;
+
+       new->next = NULL;
+
+       if (! list)
+               return new;
+
+       for (last = list; last->next; last = last->next)
+               ;
+
+       last->next = new;
+
+       return list;
+}
+
+struct dt_info *build_dt_info(unsigned int dtsflags,
+                             struct reserve_info *reservelist,
+                             struct node *tree, uint32_t boot_cpuid_phys)
+{
+       struct dt_info *dti;
+
+       dti = xmalloc(sizeof(*dti));
+       dti->dtsflags = dtsflags;
+       dti->reservelist = reservelist;
+       dti->dt = tree;
+       dti->boot_cpuid_phys = boot_cpuid_phys;
+
+       return dti;
+}
+
+/*
+ * Tree accessor functions
+ */
+
+const char *get_unitname(struct node *node)
+{
+       if (node->name[node->basenamelen] == '\0')
+               return "";
+       else
+               return node->name + node->basenamelen + 1;
+}
+
+struct property *get_property(struct node *node, const char *propname)
+{
+       struct property *prop;
+
+       for_each_property(node, prop)
+               if (streq(prop->name, propname))
+                       return prop;
+
+       return NULL;
+}
+
+cell_t propval_cell(struct property *prop)
+{
+       assert(prop->val.len == sizeof(cell_t));
+       return fdt32_to_cpu(*((fdt32_t *)prop->val.val));
+}
+
+struct property *get_property_by_label(struct node *tree, const char *label,
+                                      struct node **node)
+{
+       struct property *prop;
+       struct node *c;
+
+       *node = tree;
+
+       for_each_property(tree, prop) {
+               struct label *l;
+
+               for_each_label(prop->labels, l)
+                       if (streq(l->label, label))
+                               return prop;
+       }
+
+       for_each_child(tree, c) {
+               prop = get_property_by_label(c, label, node);
+               if (prop)
+                       return prop;
+       }
+
+       *node = NULL;
+       return NULL;
+}
+
+struct marker *get_marker_label(struct node *tree, const char *label,
+                               struct node **node, struct property **prop)
+{
+       struct marker *m;
+       struct property *p;
+       struct node *c;
+
+       *node = tree;
+
+       for_each_property(tree, p) {
+               *prop = p;
+               m = p->val.markers;
+               for_each_marker_of_type(m, LABEL)
+                       if (streq(m->ref, label))
+                               return m;
+       }
+
+       for_each_child(tree, c) {
+               m = get_marker_label(c, label, node, prop);
+               if (m)
+                       return m;
+       }
+
+       *prop = NULL;
+       *node = NULL;
+       return NULL;
+}
+
+struct node *get_subnode(struct node *node, const char *nodename)
+{
+       struct node *child;
+
+       for_each_child(node, child)
+               if (streq(child->name, nodename))
+                       return child;
+
+       return NULL;
+}
+
+struct node *get_node_by_path(struct node *tree, const char *path)
+{
+       const char *p;
+       struct node *child;
+
+       if (!path || ! (*path)) {
+               if (tree->deleted)
+                       return NULL;
+               return tree;
+       }
+
+       while (path[0] == '/')
+               path++;
+
+       p = strchr(path, '/');
+
+       for_each_child(tree, child) {
+               if (p && (strlen(child->name) == p-path) &&
+                               strneq(path, child->name, p-path))
+                       return get_node_by_path(child, p+1);
+               else if (!p && streq(path, child->name))
+                       return child;
+       }
+
+       return NULL;
+}
+
+struct node *get_node_by_label(struct node *tree, const char *label)
+{
+       struct node *child, *node;
+       struct label *l;
+
+       assert(label && (strlen(label) > 0));
+
+       for_each_label(tree->labels, l)
+               if (streq(l->label, label))
+                       return tree;
+
+       for_each_child(tree, child) {
+               node = get_node_by_label(child, label);
+               if (node)
+                       return node;
+       }
+
+       return NULL;
+}
+
+struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
+{
+       struct node *child, *node;
+
+       assert((phandle != 0) && (phandle != -1));
+
+       if (tree->phandle == phandle) {
+               if (tree->deleted)
+                       return NULL;
+               return tree;
+       }
+
+       for_each_child(tree, child) {
+               node = get_node_by_phandle(child, phandle);
+               if (node)
+                       return node;
+       }
+
+       return NULL;
+}
+
+struct node *get_node_by_ref(struct node *tree, const char *ref)
+{
+       if (streq(ref, "/"))
+               return tree;
+       else if (ref[0] == '/')
+               return get_node_by_path(tree, ref);
+       else
+               return get_node_by_label(tree, ref);
+}
+
+cell_t get_node_phandle(struct node *root, struct node *node)
+{
+       static cell_t phandle = 1; /* FIXME: ick, static local */
+
+       if ((node->phandle != 0) && (node->phandle != -1))
+               return node->phandle;
+
+       while (get_node_by_phandle(root, phandle))
+               phandle++;
+
+       node->phandle = phandle;
+
+       if (!get_property(node, "linux,phandle")
+           && (phandle_format & PHANDLE_LEGACY))
+               add_property(node,
+                            build_property("linux,phandle",
+                                           data_append_cell(empty_data, phandle)));
+
+       if (!get_property(node, "phandle")
+           && (phandle_format & PHANDLE_EPAPR))
+               add_property(node,
+                            build_property("phandle",
+                                           data_append_cell(empty_data, phandle)));
+
+       /* If the node *does* have a phandle property, we must
+        * be dealing with a self-referencing phandle, which will be
+        * fixed up momentarily in the caller */
+
+       return node->phandle;
+}
+
+uint32_t guess_boot_cpuid(struct node *tree)
+{
+       struct node *cpus, *bootcpu;
+       struct property *reg;
+
+       cpus = get_node_by_path(tree, "/cpus");
+       if (!cpus)
+               return 0;
+
+
+       bootcpu = cpus->children;
+       if (!bootcpu)
+               return 0;
+
+       reg = get_property(bootcpu, "reg");
+       if (!reg || (reg->val.len != sizeof(uint32_t)))
+               return 0;
+
+       /* FIXME: Sanity check node? */
+
+       return propval_cell(reg);
+}
+
+static int cmp_reserve_info(const void *ax, const void *bx)
+{
+       const struct reserve_info *a, *b;
+
+       a = *((const struct reserve_info * const *)ax);
+       b = *((const struct reserve_info * const *)bx);
+
+       if (a->address < b->address)
+               return -1;
+       else if (a->address > b->address)
+               return 1;
+       else if (a->size < b->size)
+               return -1;
+       else if (a->size > b->size)
+               return 1;
+       else
+               return 0;
+}
+
+static void sort_reserve_entries(struct dt_info *dti)
+{
+       struct reserve_info *ri, **tbl;
+       int n = 0, i = 0;
+
+       for (ri = dti->reservelist;
+            ri;
+            ri = ri->next)
+               n++;
+
+       if (n == 0)
+               return;
+
+       tbl = xmalloc(n * sizeof(*tbl));
+
+       for (ri = dti->reservelist;
+            ri;
+            ri = ri->next)
+               tbl[i++] = ri;
+
+       qsort(tbl, n, sizeof(*tbl), cmp_reserve_info);
+
+       dti->reservelist = tbl[0];
+       for (i = 0; i < (n-1); i++)
+               tbl[i]->next = tbl[i+1];
+       tbl[n-1]->next = NULL;
+
+       free(tbl);
+}
+
+static int cmp_prop(const void *ax, const void *bx)
+{
+       const struct property *a, *b;
+
+       a = *((const struct property * const *)ax);
+       b = *((const struct property * const *)bx);
+
+       return strcmp(a->name, b->name);
+}
+
+static void sort_properties(struct node *node)
+{
+       int n = 0, i = 0;
+       struct property *prop, **tbl;
+
+       for_each_property_withdel(node, prop)
+               n++;
+
+       if (n == 0)
+               return;
+
+       tbl = xmalloc(n * sizeof(*tbl));
+
+       for_each_property_withdel(node, prop)
+               tbl[i++] = prop;
+
+       qsort(tbl, n, sizeof(*tbl), cmp_prop);
+
+       node->proplist = tbl[0];
+       for (i = 0; i < (n-1); i++)
+               tbl[i]->next = tbl[i+1];
+       tbl[n-1]->next = NULL;
+
+       free(tbl);
+}
+
+static int cmp_subnode(const void *ax, const void *bx)
+{
+       const struct node *a, *b;
+
+       a = *((const struct node * const *)ax);
+       b = *((const struct node * const *)bx);
+
+       return strcmp(a->name, b->name);
+}
+
+static void sort_subnodes(struct node *node)
+{
+       int n = 0, i = 0;
+       struct node *subnode, **tbl;
+
+       for_each_child_withdel(node, subnode)
+               n++;
+
+       if (n == 0)
+               return;
+
+       tbl = xmalloc(n * sizeof(*tbl));
+
+       for_each_child_withdel(node, subnode)
+               tbl[i++] = subnode;
+
+       qsort(tbl, n, sizeof(*tbl), cmp_subnode);
+
+       node->children = tbl[0];
+       for (i = 0; i < (n-1); i++)
+               tbl[i]->next_sibling = tbl[i+1];
+       tbl[n-1]->next_sibling = NULL;
+
+       free(tbl);
+}
+
+static void sort_node(struct node *node)
+{
+       struct node *c;
+
+       sort_properties(node);
+       sort_subnodes(node);
+       for_each_child_withdel(node, c)
+               sort_node(c);
+}
+
+void sort_tree(struct dt_info *dti)
+{
+       sort_reserve_entries(dti);
+       sort_node(dti->dt);
+}
+
+/* utility helper to avoid code duplication */
+static struct node *build_and_name_child_node(struct node *parent, char *name)
+{
+       struct node *node;
+
+       node = build_node(NULL, NULL);
+       name_node(node, xstrdup(name));
+       add_child(parent, node);
+
+       return node;
+}
+
+static struct node *build_root_node(struct node *dt, char *name)
+{
+       struct node *an;
+
+       an = get_subnode(dt, name);
+       if (!an)
+               an = build_and_name_child_node(dt, name);
+
+       if (!an)
+               die("Could not build root node /%s\n", name);
+
+       return an;
+}
+
+static bool any_label_tree(struct dt_info *dti, struct node *node)
+{
+       struct node *c;
+
+       if (node->labels)
+               return true;
+
+       for_each_child(node, c)
+               if (any_label_tree(dti, c))
+                       return true;
+
+       return false;
+}
+
+static void generate_label_tree_internal(struct dt_info *dti,
+                                        struct node *an, struct node *node,
+                                        bool allocph)
+{
+       struct node *dt = dti->dt;
+       struct node *c;
+       struct property *p;
+       struct label *l;
+
+       /* if there are labels */
+       if (node->labels) {
+
+               /* now add the label in the node */
+               for_each_label(node->labels, l) {
+
+                       /* check whether the label already exists */
+                       p = get_property(an, l->label);
+                       if (p) {
+                               fprintf(stderr, "WARNING: label %s already"
+                                       " exists in /%s", l->label,
+                                       an->name);
+                               continue;
+                       }
+
+                       /* insert it */
+                       p = build_property(l->label,
+                               data_copy_mem(node->fullpath,
+                                               strlen(node->fullpath) + 1));
+                       add_property(an, p);
+               }
+
+               /* force allocation of a phandle for this node */
+               if (allocph)
+                       (void)get_node_phandle(dt, node);
+       }
+
+       for_each_child(node, c)
+               generate_label_tree_internal(dti, an, c, allocph);
+}
+
+static bool any_fixup_tree(struct dt_info *dti, struct node *node)
+{
+       struct node *c;
+       struct property *prop;
+       struct marker *m;
+
+       for_each_property(node, prop) {
+               m = prop->val.markers;
+               for_each_marker_of_type(m, REF_PHANDLE) {
+                       if (!get_node_by_ref(dti->dt, m->ref))
+                               return true;
+               }
+       }
+
+       for_each_child(node, c) {
+               if (any_fixup_tree(dti, c))
+                       return true;
+       }
+
+       return false;
+}
+
+static void add_fixup_entry(struct dt_info *dti, struct node *fn,
+                           struct node *node, struct property *prop,
+                           struct marker *m)
+{
+       char *entry;
+
+       /* m->ref can only be a REF_PHANDLE, but check anyway */
+       assert(m->type == REF_PHANDLE);
+
+       /* there shouldn't be any ':' in the arguments */
+       if (strchr(node->fullpath, ':') || strchr(prop->name, ':'))
+               die("arguments should not contain ':'\n");
+
+       xasprintf(&entry, "%s:%s:%u",
+                       node->fullpath, prop->name, m->offset);
+       append_to_property(fn, m->ref, entry, strlen(entry) + 1);
+
+       free(entry);
+}
+
+static void generate_fixups_tree_internal(struct dt_info *dti,
+                                         struct node *fn,
+                                         struct node *node)
+{
+       struct node *dt = dti->dt;
+       struct node *c;
+       struct property *prop;
+       struct marker *m;
+       struct node *refnode;
+
+       for_each_property(node, prop) {
+               m = prop->val.markers;
+               for_each_marker_of_type(m, REF_PHANDLE) {
+                       refnode = get_node_by_ref(dt, m->ref);
+                       if (!refnode)
+                               add_fixup_entry(dti, fn, node, prop, m);
+               }
+       }
+
+       for_each_child(node, c)
+               generate_fixups_tree_internal(dti, fn, c);
+}
+
+static bool any_local_fixup_tree(struct dt_info *dti, struct node *node)
+{
+       struct node *c;
+       struct property *prop;
+       struct marker *m;
+
+       for_each_property(node, prop) {
+               m = prop->val.markers;
+               for_each_marker_of_type(m, REF_PHANDLE) {
+                       if (get_node_by_ref(dti->dt, m->ref))
+                               return true;
+               }
+       }
+
+       for_each_child(node, c) {
+               if (any_local_fixup_tree(dti, c))
+                       return true;
+       }
+
+       return false;
+}
+
+static void add_local_fixup_entry(struct dt_info *dti,
+               struct node *lfn, struct node *node,
+               struct property *prop, struct marker *m,
+               struct node *refnode)
+{
+       struct node *wn, *nwn;  /* local fixup node, walk node, new */
+       fdt32_t value_32;
+       char **compp;
+       int i, depth;
+
+       /* walk back retreiving depth */
+       depth = 0;
+       for (wn = node; wn; wn = wn->parent)
+               depth++;
+
+       /* allocate name array */
+       compp = xmalloc(sizeof(*compp) * depth);
+
+       /* store names in the array */
+       for (wn = node, i = depth - 1; wn; wn = wn->parent, i--)
+               compp[i] = wn->name;
+
+       /* walk the path components creating nodes if they don't exist */
+       for (wn = lfn, i = 1; i < depth; i++, wn = nwn) {
+               /* if no node exists, create it */
+               nwn = get_subnode(wn, compp[i]);
+               if (!nwn)
+                       nwn = build_and_name_child_node(wn, compp[i]);
+       }
+
+       free(compp);
+
+       value_32 = cpu_to_fdt32(m->offset);
+       append_to_property(wn, prop->name, &value_32, sizeof(value_32));
+}
+
+static void generate_local_fixups_tree_internal(struct dt_info *dti,
+                                               struct node *lfn,
+                                               struct node *node)
+{
+       struct node *dt = dti->dt;
+       struct node *c;
+       struct property *prop;
+       struct marker *m;
+       struct node *refnode;
+
+       for_each_property(node, prop) {
+               m = prop->val.markers;
+               for_each_marker_of_type(m, REF_PHANDLE) {
+                       refnode = get_node_by_ref(dt, m->ref);
+                       if (refnode)
+                               add_local_fixup_entry(dti, lfn, node, prop, m, refnode);
+               }
+       }
+
+       for_each_child(node, c)
+               generate_local_fixups_tree_internal(dti, lfn, c);
+}
+
+void generate_label_tree(struct dt_info *dti, char *name, bool allocph)
+{
+       if (!any_label_tree(dti, dti->dt))
+               return;
+       generate_label_tree_internal(dti, build_root_node(dti->dt, name),
+                                    dti->dt, allocph);
+}
+
+void generate_fixups_tree(struct dt_info *dti, char *name)
+{
+       if (!any_fixup_tree(dti, dti->dt))
+               return;
+       generate_fixups_tree_internal(dti, build_root_node(dti->dt, name),
+                                     dti->dt);
+}
+
+void generate_local_fixups_tree(struct dt_info *dti, char *name)
+{
+       if (!any_local_fixup_tree(dti, dti->dt))
+               return;
+       generate_local_fixups_tree_internal(dti, build_root_node(dti->dt, name),
+                                           dti->dt);
+}
diff --git a/scripts/dtc/srcpos.c b/scripts/dtc/srcpos.c
new file mode 100644 (file)
index 0000000..9d38459
--- /dev/null
@@ -0,0 +1,302 @@
+/*
+ * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#define _GNU_SOURCE
+
+#include <stdio.h>
+
+#include "dtc.h"
+#include "srcpos.h"
+
+/* A node in our list of directories to search for source/include files */
+struct search_path {
+       struct search_path *next;       /* next node in list, NULL for end */
+       const char *dirname;            /* name of directory to search */
+};
+
+/* This is the list of directories that we search for source files */
+static struct search_path *search_path_head, **search_path_tail;
+
+
+static char *get_dirname(const char *path)
+{
+       const char *slash = strrchr(path, '/');
+
+       if (slash) {
+               int len = slash - path;
+               char *dir = xmalloc(len + 1);
+
+               memcpy(dir, path, len);
+               dir[len] = '\0';
+               return dir;
+       }
+       return NULL;
+}
+
+FILE *depfile; /* = NULL */
+struct srcfile_state *current_srcfile; /* = NULL */
+
+/* Detect infinite include recursion. */
+#define MAX_SRCFILE_DEPTH     (100)
+static int srcfile_depth; /* = 0 */
+
+
+/**
+ * Try to open a file in a given directory.
+ *
+ * If the filename is an absolute path, then dirname is ignored. If it is a
+ * relative path, then we look in that directory for the file.
+ *
+ * @param dirname      Directory to look in, or NULL for none
+ * @param fname                Filename to look for
+ * @param fp           Set to NULL if file did not open
+ * @return allocated filename on success (caller must free), NULL on failure
+ */
+static char *try_open(const char *dirname, const char *fname, FILE **fp)
+{
+       char *fullname;
+
+       if (!dirname || fname[0] == '/')
+               fullname = xstrdup(fname);
+       else
+               fullname = join_path(dirname, fname);
+
+       *fp = fopen(fullname, "rb");
+       if (!*fp) {
+               free(fullname);
+               fullname = NULL;
+       }
+
+       return fullname;
+}
+
+/**
+ * Open a file for read access
+ *
+ * If it is a relative filename, we search the full search path for it.
+ *
+ * @param fname        Filename to open
+ * @param fp   Returns pointer to opened FILE, or NULL on failure
+ * @return pointer to allocated filename, which caller must free
+ */
+static char *fopen_any_on_path(const char *fname, FILE **fp)
+{
+       const char *cur_dir = NULL;
+       struct search_path *node;
+       char *fullname;
+
+       /* Try current directory first */
+       assert(fp);
+       if (current_srcfile)
+               cur_dir = current_srcfile->dir;
+       fullname = try_open(cur_dir, fname, fp);
+
+       /* Failing that, try each search path in turn */
+       for (node = search_path_head; !*fp && node; node = node->next)
+               fullname = try_open(node->dirname, fname, fp);
+
+       return fullname;
+}
+
+FILE *srcfile_relative_open(const char *fname, char **fullnamep)
+{
+       FILE *f;
+       char *fullname;
+
+       if (streq(fname, "-")) {
+               f = stdin;
+               fullname = xstrdup("<stdin>");
+       } else {
+               fullname = fopen_any_on_path(fname, &f);
+               if (!f)
+                       die("Couldn't open \"%s\": %s\n", fname,
+                           strerror(errno));
+       }
+
+       if (depfile)
+               fprintf(depfile, " %s", fullname);
+
+       if (fullnamep)
+               *fullnamep = fullname;
+       else
+               free(fullname);
+
+       return f;
+}
+
+void srcfile_push(const char *fname)
+{
+       struct srcfile_state *srcfile;
+
+       if (srcfile_depth++ >= MAX_SRCFILE_DEPTH)
+               die("Includes nested too deeply");
+
+       srcfile = xmalloc(sizeof(*srcfile));
+
+       srcfile->f = srcfile_relative_open(fname, &srcfile->name);
+       srcfile->dir = get_dirname(srcfile->name);
+       srcfile->prev = current_srcfile;
+
+       srcfile->lineno = 1;
+       srcfile->colno = 1;
+
+       current_srcfile = srcfile;
+}
+
+bool srcfile_pop(void)
+{
+       struct srcfile_state *srcfile = current_srcfile;
+
+       assert(srcfile);
+
+       current_srcfile = srcfile->prev;
+
+       if (fclose(srcfile->f))
+               die("Error closing \"%s\": %s\n", srcfile->name,
+                   strerror(errno));
+
+       /* FIXME: We allow the srcfile_state structure to leak,
+        * because it could still be referenced from a location
+        * variable being carried through the parser somewhere.  To
+        * fix this we could either allocate all the files from a
+        * table, or use a pool allocator. */
+
+       return current_srcfile ? true : false;
+}
+
+void srcfile_add_search_path(const char *dirname)
+{
+       struct search_path *node;
+
+       /* Create the node */
+       node = xmalloc(sizeof(*node));
+       node->next = NULL;
+       node->dirname = xstrdup(dirname);
+
+       /* Add to the end of our list */
+       if (search_path_tail)
+               *search_path_tail = node;
+       else
+               search_path_head = node;
+       search_path_tail = &node->next;
+}
+
+/*
+ * The empty source position.
+ */
+
+struct srcpos srcpos_empty = {
+       .first_line = 0,
+       .first_column = 0,
+       .last_line = 0,
+       .last_column = 0,
+       .file = NULL,
+};
+
+#define TAB_SIZE      8
+
+void srcpos_update(struct srcpos *pos, const char *text, int len)
+{
+       int i;
+
+       pos->file = current_srcfile;
+
+       pos->first_line = current_srcfile->lineno;
+       pos->first_column = current_srcfile->colno;
+
+       for (i = 0; i < len; i++)
+               if (text[i] == '\n') {
+                       current_srcfile->lineno++;
+                       current_srcfile->colno = 1;
+               } else if (text[i] == '\t') {
+                       current_srcfile->colno =
+                               ALIGN(current_srcfile->colno, TAB_SIZE);
+               } else {
+                       current_srcfile->colno++;
+               }
+
+       pos->last_line = current_srcfile->lineno;
+       pos->last_column = current_srcfile->colno;
+}
+
+struct srcpos *
+srcpos_copy(struct srcpos *pos)
+{
+       struct srcpos *pos_new;
+
+       pos_new = xmalloc(sizeof(struct srcpos));
+       memcpy(pos_new, pos, sizeof(struct srcpos));
+
+       return pos_new;
+}
+
+char *
+srcpos_string(struct srcpos *pos)
+{
+       const char *fname = "<no-file>";
+       char *pos_str;
+
+       if (pos->file && pos->file->name)
+               fname = pos->file->name;
+
+
+       if (pos->first_line != pos->last_line)
+               xasprintf(&pos_str, "%s:%d.%d-%d.%d", fname,
+                         pos->first_line, pos->first_column,
+                         pos->last_line, pos->last_column);
+       else if (pos->first_column != pos->last_column)
+               xasprintf(&pos_str, "%s:%d.%d-%d", fname,
+                         pos->first_line, pos->first_column,
+                         pos->last_column);
+       else
+               xasprintf(&pos_str, "%s:%d.%d", fname,
+                         pos->first_line, pos->first_column);
+
+       return pos_str;
+}
+
+void srcpos_verror(struct srcpos *pos, const char *prefix,
+                  const char *fmt, va_list va)
+{
+       char *srcstr;
+
+       srcstr = srcpos_string(pos);
+
+       fprintf(stderr, "%s: %s ", prefix, srcstr);
+       vfprintf(stderr, fmt, va);
+       fprintf(stderr, "\n");
+
+       free(srcstr);
+}
+
+void srcpos_error(struct srcpos *pos, const char *prefix,
+                 const char *fmt, ...)
+{
+       va_list va;
+
+       va_start(va, fmt);
+       srcpos_verror(pos, prefix, fmt, va);
+       va_end(va);
+}
+
+void srcpos_set_line(char *f, int l)
+{
+       current_srcfile->name = f;
+       current_srcfile->lineno = l;
+}
diff --git a/scripts/dtc/srcpos.h b/scripts/dtc/srcpos.h
new file mode 100644 (file)
index 0000000..7caca82
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#ifndef _SRCPOS_H_
+#define _SRCPOS_H_
+
+#include <stdio.h>
+#include <stdbool.h>
+#include "util.h"
+
+struct srcfile_state {
+       FILE *f;
+       char *name;
+       char *dir;
+       int lineno, colno;
+       struct srcfile_state *prev;
+};
+
+extern FILE *depfile; /* = NULL */
+extern struct srcfile_state *current_srcfile; /* = NULL */
+
+/**
+ * Open a source file.
+ *
+ * If the source file is a relative pathname, then it is searched for in the
+ * current directory (the directory of the last source file read) and after
+ * that in the search path.
+ *
+ * We work through the search path in order from the first path specified to
+ * the last.
+ *
+ * If the file is not found, then this function does not return, but calls
+ * die().
+ *
+ * @param fname                Filename to search
+ * @param fullnamep    If non-NULL, it is set to the allocated filename of the
+ *                     file that was opened. The caller is then responsible
+ *                     for freeing the pointer.
+ * @return pointer to opened FILE
+ */
+FILE *srcfile_relative_open(const char *fname, char **fullnamep);
+
+void srcfile_push(const char *fname);
+bool srcfile_pop(void);
+
+/**
+ * Add a new directory to the search path for input files
+ *
+ * The new path is added at the end of the list.
+ *
+ * @param dirname      Directory to add
+ */
+void srcfile_add_search_path(const char *dirname);
+
+struct srcpos {
+    int first_line;
+    int first_column;
+    int last_line;
+    int last_column;
+    struct srcfile_state *file;
+};
+
+#define YYLTYPE struct srcpos
+
+#define YYLLOC_DEFAULT(Current, Rhs, N)                                                \
+       do {                                                                    \
+               if (N) {                                                        \
+                       (Current).first_line = YYRHSLOC(Rhs, 1).first_line;     \
+                       (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \
+                       (Current).last_line = YYRHSLOC(Rhs, N).last_line;       \
+                       (Current).last_column  = YYRHSLOC (Rhs, N).last_column; \
+                       (Current).file = YYRHSLOC(Rhs, N).file;                 \
+               } else {                                                        \
+                       (Current).first_line = (Current).last_line =            \
+                               YYRHSLOC(Rhs, 0).last_line;                     \
+                       (Current).first_column = (Current).last_column =        \
+                               YYRHSLOC(Rhs, 0).last_column;                   \
+                       (Current).file = YYRHSLOC (Rhs, 0).file;                \
+               }                                                               \
+       } while (0)
+
+
+/*
+ * Fictional source position used for IR nodes that are
+ * created without otherwise knowing a true source position.
+ * For example,constant definitions from the command line.
+ */
+extern struct srcpos srcpos_empty;
+
+extern void srcpos_update(struct srcpos *pos, const char *text, int len);
+extern struct srcpos *srcpos_copy(struct srcpos *pos);
+extern char *srcpos_string(struct srcpos *pos);
+
+extern void PRINTF(3, 0) srcpos_verror(struct srcpos *pos, const char *prefix,
+                                       const char *fmt, va_list va);
+extern void PRINTF(3, 4) srcpos_error(struct srcpos *pos, const char *prefix,
+                                     const char *fmt, ...);
+
+extern void srcpos_set_line(char *f, int l);
+
+#endif /* _SRCPOS_H_ */
diff --git a/scripts/dtc/treesource.c b/scripts/dtc/treesource.c
new file mode 100644 (file)
index 0000000..2461a3d
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+ * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
+ *
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#include "dtc.h"
+#include "srcpos.h"
+
+extern FILE *yyin;
+extern int yyparse(void);
+extern YYLTYPE yylloc;
+
+struct dt_info *parser_output;
+bool treesource_error;
+
+struct dt_info *dt_from_source(const char *fname)
+{
+       parser_output = NULL;
+       treesource_error = false;
+
+       srcfile_push(fname);
+       yyin = current_srcfile->f;
+       yylloc.file = current_srcfile;
+
+       if (yyparse() != 0)
+               die("Unable to parse input tree\n");
+
+       if (treesource_error)
+               die("Syntax error parsing input tree\n");
+
+       return parser_output;
+}
+
+static void write_prefix(FILE *f, int level)
+{
+       int i;
+
+       for (i = 0; i < level; i++)
+               fputc('\t', f);
+}
+
+static bool isstring(char c)
+{
+       return (isprint((unsigned char)c)
+               || (c == '\0')
+               || strchr("\a\b\t\n\v\f\r", c));
+}
+
+static void write_propval_string(FILE *f, struct data val)
+{
+       const char *str = val.val;
+       int i;
+       struct marker *m = val.markers;
+
+       assert(str[val.len-1] == '\0');
+
+       while (m && (m->offset == 0)) {
+               if (m->type == LABEL)
+                       fprintf(f, "%s: ", m->ref);
+               m = m->next;
+       }
+       fprintf(f, "\"");
+
+       for (i = 0; i < (val.len-1); i++) {
+               char c = str[i];
+
+               switch (c) {
+               case '\a':
+                       fprintf(f, "\\a");
+                       break;
+               case '\b':
+                       fprintf(f, "\\b");
+                       break;
+               case '\t':
+                       fprintf(f, "\\t");
+                       break;
+               case '\n':
+                       fprintf(f, "\\n");
+                       break;
+               case '\v':
+                       fprintf(f, "\\v");
+                       break;
+               case '\f':
+                       fprintf(f, "\\f");
+                       break;
+               case '\r':
+                       fprintf(f, "\\r");
+                       break;
+               case '\\':
+                       fprintf(f, "\\\\");
+                       break;
+               case '\"':
+                       fprintf(f, "\\\"");
+                       break;
+               case '\0':
+                       fprintf(f, "\", ");
+                       while (m && (m->offset <= (i + 1))) {
+                               if (m->type == LABEL) {
+                                       assert(m->offset == (i+1));
+                                       fprintf(f, "%s: ", m->ref);
+                               }
+                               m = m->next;
+                       }
+                       fprintf(f, "\"");
+                       break;
+               default:
+                       if (isprint((unsigned char)c))
+                               fprintf(f, "%c", c);
+                       else
+                               fprintf(f, "\\x%02hhx", c);
+               }
+       }
+       fprintf(f, "\"");
+
+       /* Wrap up any labels at the end of the value */
+       for_each_marker_of_type(m, LABEL) {
+               assert (m->offset == val.len);
+               fprintf(f, " %s:", m->ref);
+       }
+}
+
+static void write_propval_cells(FILE *f, struct data val)
+{
+       void *propend = val.val + val.len;
+       fdt32_t *cp = (fdt32_t *)val.val;
+       struct marker *m = val.markers;
+
+       fprintf(f, "<");
+       for (;;) {
+               while (m && (m->offset <= ((char *)cp - val.val))) {
+                       if (m->type == LABEL) {
+                               assert(m->offset == ((char *)cp - val.val));
+                               fprintf(f, "%s: ", m->ref);
+                       }
+                       m = m->next;
+               }
+
+               fprintf(f, "0x%x", fdt32_to_cpu(*cp++));
+               if ((void *)cp >= propend)
+                       break;
+               fprintf(f, " ");
+       }
+
+       /* Wrap up any labels at the end of the value */
+       for_each_marker_of_type(m, LABEL) {
+               assert (m->offset == val.len);
+               fprintf(f, " %s:", m->ref);
+       }
+       fprintf(f, ">");
+}
+
+static void write_propval_bytes(FILE *f, struct data val)
+{
+       void *propend = val.val + val.len;
+       const char *bp = val.val;
+       struct marker *m = val.markers;
+
+       fprintf(f, "[");
+       for (;;) {
+               while (m && (m->offset == (bp-val.val))) {
+                       if (m->type == LABEL)
+                               fprintf(f, "%s: ", m->ref);
+                       m = m->next;
+               }
+
+               fprintf(f, "%02hhx", (unsigned char)(*bp++));
+               if ((const void *)bp >= propend)
+                       break;
+               fprintf(f, " ");
+       }
+
+       /* Wrap up any labels at the end of the value */
+       for_each_marker_of_type(m, LABEL) {
+               assert (m->offset == val.len);
+               fprintf(f, " %s:", m->ref);
+       }
+       fprintf(f, "]");
+}
+
+static void write_propval(FILE *f, struct property *prop)
+{
+       int len = prop->val.len;
+       const char *p = prop->val.val;
+       struct marker *m = prop->val.markers;
+       int nnotstring = 0, nnul = 0;
+       int nnotstringlbl = 0, nnotcelllbl = 0;
+       int i;
+
+       if (len == 0) {
+               fprintf(f, ";\n");
+               return;
+       }
+
+       for (i = 0; i < len; i++) {
+               if (! isstring(p[i]))
+                       nnotstring++;
+               if (p[i] == '\0')
+                       nnul++;
+       }
+
+       for_each_marker_of_type(m, LABEL) {
+               if ((m->offset > 0) && (prop->val.val[m->offset - 1] != '\0'))
+                       nnotstringlbl++;
+               if ((m->offset % sizeof(cell_t)) != 0)
+                       nnotcelllbl++;
+       }
+
+       fprintf(f, " = ");
+       if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul < (len-nnul))
+           && (nnotstringlbl == 0)) {
+               write_propval_string(f, prop->val);
+       } else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) {
+               write_propval_cells(f, prop->val);
+       } else {
+               write_propval_bytes(f, prop->val);
+       }
+
+       fprintf(f, ";\n");
+}
+
+static void write_tree_source_node(FILE *f, struct node *tree, int level)
+{
+       struct property *prop;
+       struct node *child;
+       struct label *l;
+
+       write_prefix(f, level);
+       for_each_label(tree->labels, l)
+               fprintf(f, "%s: ", l->label);
+       if (tree->name && (*tree->name))
+               fprintf(f, "%s {\n", tree->name);
+       else
+               fprintf(f, "/ {\n");
+
+       for_each_property(tree, prop) {
+               write_prefix(f, level+1);
+               for_each_label(prop->labels, l)
+                       fprintf(f, "%s: ", l->label);
+               fprintf(f, "%s", prop->name);
+               write_propval(f, prop);
+       }
+       for_each_child(tree, child) {
+               fprintf(f, "\n");
+               write_tree_source_node(f, child, level+1);
+       }
+       write_prefix(f, level);
+       fprintf(f, "};\n");
+}
+
+
+void dt_to_source(FILE *f, struct dt_info *dti)
+{
+       struct reserve_info *re;
+
+       fprintf(f, "/dts-v1/;\n\n");
+
+       for (re = dti->reservelist; re; re = re->next) {
+               struct label *l;
+
+               for_each_label(re->labels, l)
+                       fprintf(f, "%s: ", l->label);
+               fprintf(f, "/memreserve/\t0x%016llx 0x%016llx;\n",
+                       (unsigned long long)re->address,
+                       (unsigned long long)re->size);
+       }
+
+       write_tree_source_node(f, dti->dt, 0);
+}
+
diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh
new file mode 100755 (executable)
index 0000000..b8ebcc6
--- /dev/null
@@ -0,0 +1,81 @@
+#!/bin/sh
+# Simple script to update the version of DTC carried by the Linux kernel
+#
+# This script assumes that the dtc and the linux git trees are in the
+# same directory. After building dtc in the dtc directory, it copies the
+# source files and generated source files into the scripts/dtc directory
+# in the kernel and creates a git commit updating them to the new
+# version.
+#
+# Usage: from the top level Linux source tree, run:
+# $ ./scripts/dtc/update-dtc-source.sh
+#
+# The script will change into the dtc tree, build and test dtc, copy the
+# relevant files into the kernel tree and create a git commit. The commit
+# message will need to be modified to reflect the version of DTC being
+# imported
+#
+# TODO:
+# This script is pretty basic, but it is seldom used so a few manual tasks
+# aren't a big deal. If anyone is interested in making it more robust, the
+# the following would be nice:
+# * Actually fail to complete if any testcase fails.
+#   - The dtc "make check" target needs to return a failure
+# * Extract the version number from the dtc repo for the commit message
+# * Build dtc in the kernel tree
+# * run 'make check" on dtc built from the kernel tree
+
+set -ev
+
+DTC_UPSTREAM_PATH=`pwd`/../dtc
+DTC_LINUX_PATH=`pwd`/scripts/dtc
+
+DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c \
+               srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \
+               dtc-lexer.l dtc-parser.y"
+DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h"
+LIBFDT_SOURCE="Makefile.libfdt fdt.c fdt.h fdt_empty_tree.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c fdt_wip.c libfdt.h libfdt_env.h libfdt_internal.h"
+
+get_last_dtc_version() {
+       git log --oneline scripts/dtc/ | grep 'upstream' | head -1 | sed -e 's/^.* \(.*\)/\1/'
+}
+
+last_dtc_ver=$(get_last_dtc_version)
+
+# Build DTC
+cd $DTC_UPSTREAM_PATH
+make clean
+make check
+dtc_version=$(git describe HEAD)
+dtc_log=$(git log --oneline ${last_dtc_ver}..)
+
+
+# Copy the files into the Linux tree
+cd $DTC_LINUX_PATH
+for f in $DTC_SOURCE; do
+       cp ${DTC_UPSTREAM_PATH}/${f} ${f}
+       git add ${f}
+done
+for f in $DTC_GENERATED; do
+       cp ${DTC_UPSTREAM_PATH}/$f ${f}_shipped
+       git add ${f}_shipped
+done
+for f in $LIBFDT_SOURCE; do
+       cp ${DTC_UPSTREAM_PATH}/libfdt/${f} libfdt/${f}
+       git add libfdt/${f}
+done
+
+sed -i -- 's/#include <libfdt_env.h>/#include "libfdt_env.h"/g' ./libfdt/libfdt.h
+sed -i -- 's/#include <fdt.h>/#include "fdt.h"/g' ./libfdt/libfdt.h
+git add ./libfdt/libfdt.h
+
+commit_msg=$(cat << EOF
+scripts/dtc: Update to upstream version ${dtc_version}
+
+This adds the following commits from upstream:
+
+${dtc_log}
+EOF
+)
+
+git commit -e -v -s -m "${commit_msg}"
diff --git a/scripts/dtc/util.c b/scripts/dtc/util.c
new file mode 100644 (file)
index 0000000..9953c32
--- /dev/null
@@ -0,0 +1,474 @@
+/*
+ * Copyright 2011 The Chromium Authors, All Rights Reserved.
+ * Copyright 2008 Jon Loeliger, Freescale Semiconductor, Inc.
+ *
+ * util_is_printable_string contributed by
+ *     Pantelis Antoniou <pantelis.antoniou AT gmail.com>
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <assert.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "libfdt.h"
+#include "util.h"
+#include "version_gen.h"
+
+char *xstrdup(const char *s)
+{
+       int len = strlen(s) + 1;
+       char *d = xmalloc(len);
+
+       memcpy(d, s, len);
+
+       return d;
+}
+
+/* based in part from (3) vsnprintf */
+int xasprintf(char **strp, const char *fmt, ...)
+{
+       int n, size = 128;      /* start with 128 bytes */
+       char *p;
+       va_list ap;
+
+       /* initial pointer is NULL making the fist realloc to be malloc */
+       p = NULL;
+       while (1) {
+               p = xrealloc(p, size);
+
+               /* Try to print in the allocated space. */
+               va_start(ap, fmt);
+               n = vsnprintf(p, size, fmt, ap);
+               va_end(ap);
+
+               /* If that worked, return the string. */
+               if (n > -1 && n < size)
+                       break;
+               /* Else try again with more space. */
+               if (n > -1)     /* glibc 2.1 */
+                       size = n + 1; /* precisely what is needed */
+               else            /* glibc 2.0 */
+                       size *= 2; /* twice the old size */
+       }
+       *strp = p;
+       return strlen(p);
+}
+
+char *join_path(const char *path, const char *name)
+{
+       int lenp = strlen(path);
+       int lenn = strlen(name);
+       int len;
+       int needslash = 1;
+       char *str;
+
+       len = lenp + lenn + 2;
+       if ((lenp > 0) && (path[lenp-1] == '/')) {
+               needslash = 0;
+               len--;
+       }
+
+       str = xmalloc(len);
+       memcpy(str, path, lenp);
+       if (needslash) {
+               str[lenp] = '/';
+               lenp++;
+       }
+       memcpy(str+lenp, name, lenn+1);
+       return str;
+}
+
+bool util_is_printable_string(const void *data, int len)
+{
+       const char *s = data;
+       const char *ss, *se;
+
+       /* zero length is not */
+       if (len == 0)
+               return 0;
+
+       /* must terminate with zero */
+       if (s[len - 1] != '\0')
+               return 0;
+
+       se = s + len;
+
+       while (s < se) {
+               ss = s;
+               while (s < se && *s && isprint((unsigned char)*s))
+                       s++;
+
+               /* not zero, or not done yet */
+               if (*s != '\0' || s == ss)
+                       return 0;
+
+               s++;
+       }
+
+       return 1;
+}
+
+/*
+ * Parse a octal encoded character starting at index i in string s.  The
+ * resulting character will be returned and the index i will be updated to
+ * point at the character directly after the end of the encoding, this may be
+ * the '\0' terminator of the string.
+ */
+static char get_oct_char(const char *s, int *i)
+{
+       char x[4];
+       char *endx;
+       long val;
+
+       x[3] = '\0';
+       strncpy(x, s + *i, 3);
+
+       val = strtol(x, &endx, 8);
+
+       assert(endx > x);
+
+       (*i) += endx - x;
+       return val;
+}
+
+/*
+ * Parse a hexadecimal encoded character starting at index i in string s.  The
+ * resulting character will be returned and the index i will be updated to
+ * point at the character directly after the end of the encoding, this may be
+ * the '\0' terminator of the string.
+ */
+static char get_hex_char(const char *s, int *i)
+{
+       char x[3];
+       char *endx;
+       long val;
+
+       x[2] = '\0';
+       strncpy(x, s + *i, 2);
+
+       val = strtol(x, &endx, 16);
+       if (!(endx  > x))
+               die("\\x used with no following hex digits\n");
+
+       (*i) += endx - x;
+       return val;
+}
+
+char get_escape_char(const char *s, int *i)
+{
+       char    c = s[*i];
+       int     j = *i + 1;
+       char    val;
+
+       switch (c) {
+       case 'a':
+               val = '\a';
+               break;
+       case 'b':
+               val = '\b';
+               break;
+       case 't':
+               val = '\t';
+               break;
+       case 'n':
+               val = '\n';
+               break;
+       case 'v':
+               val = '\v';
+               break;
+       case 'f':
+               val = '\f';
+               break;
+       case 'r':
+               val = '\r';
+               break;
+       case '0':
+       case '1':
+       case '2':
+       case '3':
+       case '4':
+       case '5':
+       case '6':
+       case '7':
+               j--; /* need to re-read the first digit as
+                     * part of the octal value */
+               val = get_oct_char(s, &j);
+               break;
+       case 'x':
+               val = get_hex_char(s, &j);
+               break;
+       default:
+               val = c;
+       }
+
+       (*i) = j;
+       return val;
+}
+
+int utilfdt_read_err_len(const char *filename, char **buffp, off_t *len)
+{
+       int fd = 0;     /* assume stdin */
+       char *buf = NULL;
+       off_t bufsize = 1024, offset = 0;
+       int ret = 0;
+
+       *buffp = NULL;
+       if (strcmp(filename, "-") != 0) {
+               fd = open(filename, O_RDONLY);
+               if (fd < 0)
+                       return errno;
+       }
+
+       /* Loop until we have read everything */
+       buf = xmalloc(bufsize);
+       do {
+               /* Expand the buffer to hold the next chunk */
+               if (offset == bufsize) {
+                       bufsize *= 2;
+                       buf = xrealloc(buf, bufsize);
+               }
+
+               ret = read(fd, &buf[offset], bufsize - offset);
+               if (ret < 0) {
+                       ret = errno;
+                       break;
+               }
+               offset += ret;
+       } while (ret != 0);
+
+       /* Clean up, including closing stdin; return errno on error */
+       close(fd);
+       if (ret)
+               free(buf);
+       else
+               *buffp = buf;
+       *len = bufsize;
+       return ret;
+}
+
+int utilfdt_read_err(const char *filename, char **buffp)
+{
+       off_t len;
+       return utilfdt_read_err_len(filename, buffp, &len);
+}
+
+char *utilfdt_read_len(const char *filename, off_t *len)
+{
+       char *buff;
+       int ret = utilfdt_read_err_len(filename, &buff, len);
+
+       if (ret) {
+               fprintf(stderr, "Couldn't open blob from '%s': %s\n", filename,
+                       strerror(ret));
+               return NULL;
+       }
+       /* Successful read */
+       return buff;
+}
+
+char *utilfdt_read(const char *filename)
+{
+       off_t len;
+       return utilfdt_read_len(filename, &len);
+}
+
+int utilfdt_write_err(const char *filename, const void *blob)
+{
+       int fd = 1;     /* assume stdout */
+       int totalsize;
+       int offset;
+       int ret = 0;
+       const char *ptr = blob;
+
+       if (strcmp(filename, "-") != 0) {
+               fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+               if (fd < 0)
+                       return errno;
+       }
+
+       totalsize = fdt_totalsize(blob);
+       offset = 0;
+
+       while (offset < totalsize) {
+               ret = write(fd, ptr + offset, totalsize - offset);
+               if (ret < 0) {
+                       ret = -errno;
+                       break;
+               }
+               offset += ret;
+       }
+       /* Close the file/stdin; return errno on error */
+       if (fd != 1)
+               close(fd);
+       return ret < 0 ? -ret : 0;
+}
+
+
+int utilfdt_write(const char *filename, const void *blob)
+{
+       int ret = utilfdt_write_err(filename, blob);
+
+       if (ret) {
+               fprintf(stderr, "Couldn't write blob to '%s': %s\n", filename,
+                       strerror(ret));
+       }
+       return ret ? -1 : 0;
+}
+
+int utilfdt_decode_type(const char *fmt, int *type, int *size)
+{
+       int qualifier = 0;
+
+       if (!*fmt)
+               return -1;
+
+       /* get the conversion qualifier */
+       *size = -1;
+       if (strchr("hlLb", *fmt)) {
+               qualifier = *fmt++;
+               if (qualifier == *fmt) {
+                       switch (*fmt++) {
+/* TODO:               case 'l': qualifier = 'L'; break;*/
+                       case 'h':
+                               qualifier = 'b';
+                               break;
+                       }
+               }
+       }
+
+       /* we should now have a type */
+       if ((*fmt == '\0') || !strchr("iuxs", *fmt))
+               return -1;
+
+       /* convert qualifier (bhL) to byte size */
+       if (*fmt != 's')
+               *size = qualifier == 'b' ? 1 :
+                               qualifier == 'h' ? 2 :
+                               qualifier == 'l' ? 4 : -1;
+       *type = *fmt++;
+
+       /* that should be it! */
+       if (*fmt)
+               return -1;
+       return 0;
+}
+
+void utilfdt_print_data(const char *data, int len)
+{
+       int i;
+       const char *s;
+
+       /* no data, don't print */
+       if (len == 0)
+               return;
+
+       if (util_is_printable_string(data, len)) {
+               printf(" = ");
+
+               s = data;
+               do {
+                       printf("\"%s\"", s);
+                       s += strlen(s) + 1;
+                       if (s < data + len)
+                               printf(", ");
+               } while (s < data + len);
+
+       } else if ((len % 4) == 0) {
+               const fdt32_t *cell = (const fdt32_t *)data;
+
+               printf(" = <");
+               for (i = 0, len /= 4; i < len; i++)
+                       printf("0x%08x%s", fdt32_to_cpu(cell[i]),
+                              i < (len - 1) ? " " : "");
+               printf(">");
+       } else {
+               const unsigned char *p = (const unsigned char *)data;
+               printf(" = [");
+               for (i = 0; i < len; i++)
+                       printf("%02x%s", *p++, i < len - 1 ? " " : "");
+               printf("]");
+       }
+}
+
+void NORETURN util_version(void)
+{
+       printf("Version: %s\n", DTC_VERSION);
+       exit(0);
+}
+
+void NORETURN util_usage(const char *errmsg, const char *synopsis,
+                        const char *short_opts,
+                        struct option const long_opts[],
+                        const char * const opts_help[])
+{
+       FILE *fp = errmsg ? stderr : stdout;
+       const char a_arg[] = "<arg>";
+       size_t a_arg_len = strlen(a_arg) + 1;
+       size_t i;
+       int optlen;
+
+       fprintf(fp,
+               "Usage: %s\n"
+               "\n"
+               "Options: -[%s]\n", synopsis, short_opts);
+
+       /* prescan the --long opt length to auto-align */
+       optlen = 0;
+       for (i = 0; long_opts[i].name; ++i) {
+               /* +1 is for space between --opt and help text */
+               int l = strlen(long_opts[i].name) + 1;
+               if (long_opts[i].has_arg == a_argument)
+                       l += a_arg_len;
+               if (optlen < l)
+                       optlen = l;
+       }
+
+       for (i = 0; long_opts[i].name; ++i) {
+               /* helps when adding new applets or options */
+               assert(opts_help[i] != NULL);
+
+               /* first output the short flag if it has one */
+               if (long_opts[i].val > '~')
+                       fprintf(fp, "      ");
+               else
+                       fprintf(fp, "  -%c, ", long_opts[i].val);
+
+               /* then the long flag */
+               if (long_opts[i].has_arg == no_argument)
+                       fprintf(fp, "--%-*s", optlen, long_opts[i].name);
+               else
+                       fprintf(fp, "--%s %s%*s", long_opts[i].name, a_arg,
+                               (int)(optlen - strlen(long_opts[i].name) - a_arg_len), "");
+
+               /* finally the help text */
+               fprintf(fp, "%s\n", opts_help[i]);
+       }
+
+       if (errmsg) {
+               fprintf(fp, "\nError: %s\n", errmsg);
+               exit(EXIT_FAILURE);
+       } else
+               exit(EXIT_SUCCESS);
+}
diff --git a/scripts/dtc/util.h b/scripts/dtc/util.h
new file mode 100644 (file)
index 0000000..ad5f411
--- /dev/null
@@ -0,0 +1,263 @@
+#ifndef _UTIL_H
+#define _UTIL_H
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <getopt.h>
+
+/*
+ * Copyright 2011 The Chromium Authors, All Rights Reserved.
+ * Copyright 2008 Jon Loeliger, Freescale Semiconductor, Inc.
+ *
+ * This program 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 program 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.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *                                                                   USA
+ */
+
+#ifdef __GNUC__
+#define PRINTF(i, j)   __attribute__((format (printf, i, j)))
+#define NORETURN       __attribute__((noreturn))
+#else
+#define PRINTF(i, j)
+#define NORETURN
+#endif
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+static inline void NORETURN PRINTF(1, 2) die(const char *str, ...)
+{
+       va_list ap;
+
+       va_start(ap, str);
+       fprintf(stderr, "FATAL ERROR: ");
+       vfprintf(stderr, str, ap);
+       va_end(ap);
+       exit(1);
+}
+
+static inline void *xmalloc(size_t len)
+{
+       void *new = malloc(len);
+
+       if (!new)
+               die("malloc() failed\n");
+
+       return new;
+}
+
+static inline void *xrealloc(void *p, size_t len)
+{
+       void *new = realloc(p, len);
+
+       if (!new)
+               die("realloc() failed (len=%zd)\n", len);
+
+       return new;
+}
+
+extern char *xstrdup(const char *s);
+
+extern int PRINTF(2, 3) xasprintf(char **strp, const char *fmt, ...);
+extern char *join_path(const char *path, const char *name);
+
+/**
+ * Check a property of a given length to see if it is all printable and
+ * has a valid terminator. The property can contain either a single string,
+ * or multiple strings each of non-zero length.
+ *
+ * @param data The string to check
+ * @param len  The string length including terminator
+ * @return 1 if a valid printable string, 0 if not
+ */
+bool util_is_printable_string(const void *data, int len);
+
+/*
+ * Parse an escaped character starting at index i in string s.  The resulting
+ * character will be returned and the index i will be updated to point at the
+ * character directly after the end of the encoding, this may be the '\0'
+ * terminator of the string.
+ */
+char get_escape_char(const char *s, int *i);
+
+/**
+ * Read a device tree file into a buffer. This will report any errors on
+ * stderr.
+ *
+ * @param filename     The filename to read, or - for stdin
+ * @return Pointer to allocated buffer containing fdt, or NULL on error
+ */
+char *utilfdt_read(const char *filename);
+
+/**
+ * Like utilfdt_read(), but also passes back the size of the file read.
+ *
+ * @param len          If non-NULL, the amount of data we managed to read
+ */
+char *utilfdt_read_len(const char *filename, off_t *len);
+
+/**
+ * Read a device tree file into a buffer. Does not report errors, but only
+ * returns them. The value returned can be passed to strerror() to obtain
+ * an error message for the user.
+ *
+ * @param filename     The filename to read, or - for stdin
+ * @param buffp                Returns pointer to buffer containing fdt
+ * @return 0 if ok, else an errno value representing the error
+ */
+int utilfdt_read_err(const char *filename, char **buffp);
+
+/**
+ * Like utilfdt_read_err(), but also passes back the size of the file read.
+ *
+ * @param len          If non-NULL, the amount of data we managed to read
+ */
+int utilfdt_read_err_len(const char *filename, char **buffp, off_t *len);
+
+/**
+ * Write a device tree buffer to a file. This will report any errors on
+ * stderr.
+ *
+ * @param filename     The filename to write, or - for stdout
+ * @param blob         Poiner to buffer containing fdt
+ * @return 0 if ok, -1 on error
+ */
+int utilfdt_write(const char *filename, const void *blob);
+
+/**
+ * Write a device tree buffer to a file. Does not report errors, but only
+ * returns them. The value returned can be passed to strerror() to obtain
+ * an error message for the user.
+ *
+ * @param filename     The filename to write, or - for stdout
+ * @param blob         Poiner to buffer containing fdt
+ * @return 0 if ok, else an errno value representing the error
+ */
+int utilfdt_write_err(const char *filename, const void *blob);
+
+/**
+ * Decode a data type string. The purpose of this string
+ *
+ * The string consists of an optional character followed by the type:
+ *     Modifier characters:
+ *             hh or b 1 byte
+ *             h       2 byte
+ *             l       4 byte, default
+ *
+ *     Type character:
+ *             s       string
+ *             i       signed integer
+ *             u       unsigned integer
+ *             x       hex
+ *
+ * TODO: Implement ll modifier (8 bytes)
+ * TODO: Implement o type (octal)
+ *
+ * @param fmt          Format string to process
+ * @param type         Returns type found(s/d/u/x), or 0 if none
+ * @param size         Returns size found(1,2,4,8) or 4 if none
+ * @return 0 if ok, -1 on error (no type given, or other invalid format)
+ */
+int utilfdt_decode_type(const char *fmt, int *type, int *size);
+
+/*
+ * This is a usage message fragment for the -t option. It is the format
+ * supported by utilfdt_decode_type.
+ */
+
+#define USAGE_TYPE_MSG \
+       "<type>\ts=string, i=int, u=unsigned, x=hex\n" \
+       "\tOptional modifier prefix:\n" \
+       "\t\thh or b=byte, h=2 byte, l=4 byte (default)";
+
+/**
+ * Print property data in a readable format to stdout
+ *
+ * Properties that look like strings will be printed as strings. Otherwise
+ * the data will be displayed either as cells (if len is a multiple of 4
+ * bytes) or bytes.
+ *
+ * If len is 0 then this function does nothing.
+ *
+ * @param data Pointers to property data
+ * @param len  Length of property data
+ */
+void utilfdt_print_data(const char *data, int len);
+
+/**
+ * Show source version and exit
+ */
+void NORETURN util_version(void);
+
+/**
+ * Show usage and exit
+ *
+ * This helps standardize the output of various utils.  You most likely want
+ * to use the usage() helper below rather than call this.
+ *
+ * @param errmsg       If non-NULL, an error message to display
+ * @param synopsis     The initial example usage text (and possible examples)
+ * @param short_opts   The string of short options
+ * @param long_opts    The structure of long options
+ * @param opts_help    An array of help strings (should align with long_opts)
+ */
+void NORETURN util_usage(const char *errmsg, const char *synopsis,
+                        const char *short_opts,
+                        struct option const long_opts[],
+                        const char * const opts_help[]);
+
+/**
+ * Show usage and exit
+ *
+ * If you name all your usage variables with usage_xxx, then you can call this
+ * help macro rather than expanding all arguments yourself.
+ *
+ * @param errmsg       If non-NULL, an error message to display
+ */
+#define usage(errmsg) \
+       util_usage(errmsg, usage_synopsis, usage_short_opts, \
+                  usage_long_opts, usage_opts_help)
+
+/**
+ * Call getopt_long() with standard options
+ *
+ * Since all util code runs getopt in the same way, provide a helper.
+ */
+#define util_getopt_long() getopt_long(argc, argv, usage_short_opts, \
+                                      usage_long_opts, NULL)
+
+/* Helper for aligning long_opts array */
+#define a_argument required_argument
+
+/* Helper for usage_short_opts string constant */
+#define USAGE_COMMON_SHORT_OPTS "hV"
+
+/* Helper for usage_long_opts option array */
+#define USAGE_COMMON_LONG_OPTS \
+       {"help",      no_argument, NULL, 'h'}, \
+       {"version",   no_argument, NULL, 'V'}, \
+       {NULL,        no_argument, NULL, 0x0}
+
+/* Helper for usage_opts_help array */
+#define USAGE_COMMON_OPTS_HELP \
+       "Print this help and exit", \
+       "Print version and exit", \
+       NULL
+
+/* Helper for getopt case statements */
+#define case_USAGE_COMMON_FLAGS \
+       case 'h': usage(NULL); \
+       case 'V': util_version(); \
+       case '?': usage("unknown option");
+
+#endif /* _UTIL_H */
diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h
new file mode 100644 (file)
index 0000000..b5ed715
--- /dev/null
@@ -0,0 +1 @@
+#define DTC_VERSION "DTC 1.4.4-gfe50bd1e"
diff --git a/scripts/spelling.txt b/scripts/spelling.txt
new file mode 100644 (file)
index 0000000..400ef35
--- /dev/null
@@ -0,0 +1,1217 @@
+# Originally from Debian's Lintian tool. Various false positives have been
+# removed, and various additions have been made as they've been discovered
+# in the kernel source.
+#
+# License: GPLv2
+#
+# The format of each line is:
+# mistake||correction
+#
+abandonning||abandoning
+abigious||ambiguous
+abitrate||arbitrate
+abov||above
+abreviated||abbreviated
+absense||absence
+absolut||absolute
+absoulte||absolute
+acccess||access
+acceess||access
+acceleratoin||acceleration
+accelleration||acceleration
+accesing||accessing
+accesnt||accent
+accessable||accessible
+accesss||access
+accidentaly||accidentally
+accidentually||accidentally
+accoding||according
+accomodate||accommodate
+accomodates||accommodates
+accordign||according
+accoring||according
+accout||account
+accquire||acquire
+accquired||acquired
+accross||across
+acessable||accessible
+acess||access
+achitecture||architecture
+acient||ancient
+acitions||actions
+acitve||active
+acknowldegement||acknowledgment
+acknowledgement||acknowledgment
+ackowledge||acknowledge
+ackowledged||acknowledged
+acording||according
+activete||activate
+actived||activated
+actualy||actually
+acumulating||accumulating
+acumulator||accumulator
+adapater||adapter
+addional||additional
+additionaly||additionally
+addres||address
+adddress||address
+addreses||addresses
+addresss||address
+aditional||additional
+aditionally||additionally
+aditionaly||additionally
+adminstrative||administrative
+adress||address
+adresses||addresses
+adviced||advised
+afecting||affecting
+againt||against
+agaist||against
+albumns||albums
+alegorical||allegorical
+algined||aligned
+algorith||algorithm
+algorithmical||algorithmically
+algoritm||algorithm
+algoritms||algorithms
+algorrithm||algorithm
+algorritm||algorithm
+aligment||alignment
+alignement||alignment
+allign||align
+alligned||aligned
+allocatote||allocate
+allocatrd||allocated
+allocte||allocate
+allpication||application
+alocate||allocate
+alogirhtms||algorithms
+alogrithm||algorithm
+alot||a lot
+alow||allow
+alows||allows
+altough||although
+alue||value
+ambigious||ambiguous
+amoung||among
+amout||amount
+an union||a union
+an user||a user
+an userspace||a userspace
+an one||a one
+analysator||analyzer
+ang||and
+anniversery||anniversary
+annoucement||announcement
+anomolies||anomalies
+anomoly||anomaly
+anway||anyway
+aplication||application
+appearence||appearance
+applicaion||application
+appliction||application
+applictions||applications
+applys||applies
+appplications||applications
+appropiate||appropriate
+appropriatly||appropriately
+approriate||appropriate
+approriately||appropriately
+apropriate||appropriate
+aquainted||acquainted
+aquired||acquired
+aquisition||acquisition
+arbitary||arbitrary
+architechture||architecture
+arguement||argument
+arguements||arguments
+aritmetic||arithmetic
+arne't||aren't
+arraival||arrival
+artifical||artificial
+artillary||artillery
+asign||assign
+asser||assert
+assertation||assertion
+assiged||assigned
+assigment||assignment
+assigments||assignments
+assistent||assistant
+assocation||association
+associcated||associated
+assotiated||associated
+assum||assume
+assumtpion||assumption
+asuming||assuming
+asycronous||asynchronous
+asynchnous||asynchronous
+atomatically||automatically
+atomicly||atomically
+atempt||attempt
+attachement||attachment
+attched||attached
+attemps||attempts
+attemping||attempting
+attruibutes||attributes
+authentification||authentication
+automaticaly||automatically
+automaticly||automatically
+automatize||automate
+automatized||automated
+automatizes||automates
+autonymous||autonomous
+auxillary||auxiliary
+auxilliary||auxiliary
+avaiable||available
+avaible||available
+availabe||available
+availabled||available
+availablity||availability
+availale||available
+availavility||availability
+availble||available
+availiable||available
+avalable||available
+avaliable||available
+aysnc||async
+backgroud||background
+backword||backward
+backwords||backwards
+bahavior||behavior
+bakup||backup
+baloon||balloon
+baloons||balloons
+bandwith||bandwidth
+banlance||balance
+batery||battery
+beacuse||because
+becasue||because
+becomming||becoming
+becuase||because
+beeing||being
+befor||before
+begining||beginning
+beter||better
+betweeen||between
+bianries||binaries
+bitmast||bitmask
+boardcast||broadcast
+borad||board
+boundry||boundary
+brievely||briefly
+broadcat||broadcast
+cacluated||calculated
+caculation||calculation
+calender||calendar
+calle||called
+callibration||calibration
+calucate||calculate
+calulate||calculate
+cancelation||cancellation
+cancle||cancel
+capabilites||capabilities
+capabitilies||capabilities
+capatibilities||capabilities
+capapbilities||capabilities
+carefuly||carefully
+cariage||carriage
+catagory||category
+cehck||check
+challange||challenge
+challanges||challenges
+chanell||channel
+changable||changeable
+chanined||chained
+channle||channel
+channnel||channel
+charachter||character
+charachters||characters
+charactor||character
+charater||character
+charaters||characters
+charcter||character
+chcek||check
+chck||check
+checksuming||checksumming
+childern||children
+childs||children
+chiled||child
+chked||checked
+chnage||change
+chnages||changes
+chnnel||channel
+choosen||chosen
+chouse||chose
+circumvernt||circumvent
+claread||cleared
+clared||cleared
+closeing||closing
+clustred||clustered
+coexistance||coexistence
+collapsable||collapsible
+colorfull||colorful
+comand||command
+comit||commit
+commerical||commercial
+comming||coming
+comminucation||communication
+commited||committed
+commiting||committing
+committ||commit
+commoditiy||commodity
+comsume||consume
+comsumer||consumer
+comsuming||consuming
+compability||compatibility
+compaibility||compatibility
+compatability||compatibility
+compatable||compatible
+compatibiliy||compatibility
+compatibilty||compatibility
+compatiblity||compatibility
+competion||completion
+compilant||compliant
+compleatly||completely
+completition||completion
+completly||completely
+complient||compliant
+componnents||components
+compoment||component
+compres||compress
+compresion||compression
+comression||compression
+comunication||communication
+conbination||combination
+conditionaly||conditionally
+conected||connected
+connecetd||connected
+configuartion||configuration
+configuratoin||configuration
+configuraton||configuration
+configuretion||configuration
+configutation||configuration
+conider||consider
+conjuction||conjunction
+connectinos||connections
+connnection||connection
+connnections||connections
+consistancy||consistency
+consistant||consistent
+containes||contains
+containts||contains
+contaisn||contains
+contant||contact
+contence||contents
+continous||continuous
+continously||continuously
+continueing||continuing
+contraints||constraints
+contol||control
+contoller||controller
+controled||controlled
+controler||controller
+controll||control
+contruction||construction
+contry||country
+conuntry||country
+convertion||conversion
+convertor||converter
+convienient||convenient
+convinient||convenient
+corected||corrected
+correponding||corresponding
+correponds||corresponds
+correspoding||corresponding
+cotrol||control
+cound||could
+couter||counter
+coutner||counter
+cryptocraphic||cryptographic
+cunter||counter
+curently||currently
+cylic||cyclic
+dafault||default
+deafult||default
+deamon||daemon
+decompres||decompress
+decription||description
+dectected||detected
+defailt||default
+defferred||deferred
+definate||definite
+definately||definitely
+defintion||definition
+defintions||definitions
+defualt||default
+defult||default
+deintializing||deinitializing
+deintialize||deinitialize
+deintialized||deinitialized
+deivce||device
+delared||declared
+delare||declare
+delares||declares
+delaring||declaring
+delemiter||delimiter
+demodualtor||demodulator
+demension||dimension
+dependancies||dependencies
+dependancy||dependency
+dependant||dependent
+depreacted||deprecated
+depreacte||deprecate
+desactivate||deactivate
+desciptor||descriptor
+desciptors||descriptors
+descripton||description
+descrition||description
+descritptor||descriptor
+desctiptor||descriptor
+desriptor||descriptor
+desriptors||descriptors
+destionation||destination
+destory||destroy
+destoryed||destroyed
+destorys||destroys
+destroied||destroyed
+detabase||database
+deteced||detected
+develope||develop
+developement||development
+developped||developed
+developpement||development
+developper||developer
+developpment||development
+deveolpment||development
+devided||divided
+deviece||device
+diable||disable
+dictionnary||dictionary
+didnt||didn't
+diferent||different
+differrence||difference
+diffrent||different
+diffrentiate||differentiate
+difinition||definition
+diplay||display
+direectly||directly
+disassocation||disassociation
+disapear||disappear
+disapeared||disappeared
+disappared||disappeared
+disble||disable
+disbled||disabled
+disconnet||disconnect
+discontinous||discontinuous
+dispertion||dispersion
+dissapears||disappears
+distiction||distinction
+docuentation||documentation
+documantation||documentation
+documentaion||documentation
+documment||document
+doesnt||doesn't
+dorp||drop
+dosen||doesn
+downlad||download
+downlads||downloads
+druing||during
+dynmaic||dynamic
+easilly||easily
+ecspecially||especially
+edditable||editable
+editting||editing
+efective||effective
+efficently||efficiently
+ehther||ether
+eigth||eight
+elementry||elementary
+eletronic||electronic
+embeded||embedded
+enabledi||enabled
+enchanced||enhanced
+encorporating||incorporating
+encrupted||encrypted
+encrypiton||encryption
+encryptio||encryption
+endianess||endianness
+enhaced||enhanced
+enlightnment||enlightenment
+entrys||entries
+enocded||encoded
+enterily||entirely
+enviroiment||environment
+enviroment||environment
+environement||environment
+environent||environment
+eqivalent||equivalent
+equiped||equipped
+equivelant||equivalent
+equivilant||equivalent
+eror||error
+estbalishment||establishment
+etsablishment||establishment
+etsbalishment||establishment
+excecutable||executable
+exceded||exceeded
+excellant||excellent
+exeed||exceed
+existance||existence
+existant||existent
+exixt||exist
+exlcude||exclude
+exlcusive||exclusive
+exmaple||example
+expecially||especially
+explicite||explicit
+explicitely||explicitly
+explict||explicit
+explictely||explicitly
+explictly||explicitly
+expresion||expression
+exprimental||experimental
+extened||extended
+extensability||extensibility
+extention||extension
+extracter||extractor
+falied||failed
+faild||failed
+faill||fail
+failied||failed
+faillure||failure
+failue||failure
+failuer||failure
+faireness||fairness
+falied||failed
+faliure||failure
+fallbck||fallback
+familar||familiar
+fatser||faster
+feauture||feature
+feautures||features
+fetaure||feature
+fetaures||features
+fileystem||filesystem
+fimware||firmware
+finanize||finalize
+findn||find
+finilizes||finalizes
+finsih||finish
+flusing||flushing
+folloing||following
+followign||following
+followings||following
+follwing||following
+forseeable||foreseeable
+forse||force
+fortan||fortran
+forwardig||forwarding
+framming||framing
+framwork||framework
+frequncy||frequency
+frome||from
+fucntion||function
+fuction||function
+fuctions||functions
+funcion||function
+functionallity||functionality
+functionaly||functionally
+functionnality||functionality
+functonality||functionality
+funtion||function
+funtions||functions
+furthur||further
+futhermore||furthermore
+futrue||future
+gaurenteed||guaranteed
+generiously||generously
+genereate||generate
+genric||generic
+globel||global
+grabing||grabbing
+grahical||graphical
+grahpical||graphical
+grapic||graphic
+guage||gauge
+guarenteed||guaranteed
+guarentee||guarantee
+halfs||halves
+hander||handler
+handfull||handful
+hanled||handled
+happend||happened
+harware||hardware
+heirarchically||hierarchically
+helpfull||helpful
+hierachy||hierarchy
+hierarchie||hierarchy
+howver||however
+hsould||should
+hypervior||hypervisor
+hypter||hyper
+identidier||identifier
+iligal||illegal
+illigal||illegal
+imblance||imbalance
+immeadiately||immediately
+immedaite||immediate
+immediatelly||immediately
+immediatly||immediately
+immidiate||immediate
+impelentation||implementation
+impementated||implemented
+implemantation||implementation
+implemenation||implementation
+implementaiton||implementation
+implementated||implemented
+implemention||implementation
+implemetation||implementation
+implemntation||implementation
+implentation||implementation
+implmentation||implementation
+implmenting||implementing
+incomming||incoming
+incompatabilities||incompatibilities
+incompatable||incompatible
+inconsistant||inconsistent
+increas||increase
+incrment||increment
+indendation||indentation
+indended||intended
+independant||independent
+independantly||independently
+independed||independent
+indiate||indicate
+indicat||indicate
+inexpect||inexpected
+infomation||information
+informatiom||information
+informations||information
+informtion||information
+infromation||information
+ingore||ignore
+inital||initial
+initalized||initialized
+initalised||initialized
+initalise||initialize
+initalize||initialize
+initation||initiation
+initators||initiators
+initialiazation||initialization
+initializiation||initialization
+initialzed||initialized
+initilization||initialization
+initilize||initialize
+inofficial||unofficial
+insititute||institute
+instal||install
+instanciated||instantiated
+inteface||interface
+integreated||integrated
+integrety||integrity
+integrey||integrity
+intendet||intended
+intented||intended
+interanl||internal
+interchangable||interchangeable
+interferring||interfering
+interger||integer
+intermittant||intermittent
+internel||internal
+interoprability||interoperability
+interrface||interface
+interrrupt||interrupt
+interrup||interrupt
+interrups||interrupts
+interruptted||interrupted
+interupted||interrupted
+interupt||interrupt
+intial||initial
+intialisation||initialisation
+intialised||initialised
+intialise||initialise
+intialization||initialization
+intialized||initialized
+intialize||initialize
+intregral||integral
+intrrupt||interrupt
+intterrupt||interrupt
+intuative||intuitive
+invaid||invalid
+invalde||invalid
+invalide||invalid
+invalud||invalid
+invididual||individual
+invokation||invocation
+invokations||invocations
+irrelevent||irrelevant
+isnt||isn't
+isssue||issue
+iternations||iterations
+itertation||iteration
+itslef||itself
+jave||java
+jeffies||jiffies
+juse||just
+jus||just
+kown||known
+langage||language
+langauage||language
+langauge||language
+langugage||language
+lauch||launch
+layed||laid
+leightweight||lightweight
+lengh||length
+lenght||length
+lenth||length
+lesstiff||lesstif
+libaries||libraries
+libary||library
+librairies||libraries
+libraris||libraries
+licenceing||licencing
+loggging||logging
+loggin||login
+logile||logfile
+loosing||losing
+losted||lost
+machinary||machinery
+maintainance||maintenance
+maintainence||maintenance
+maintan||maintain
+makeing||making
+malplaced||misplaced
+malplace||misplace
+managable||manageable
+managment||management
+mangement||management
+manoeuvering||maneuvering
+mappping||mapping
+mathimatical||mathematical
+mathimatic||mathematic
+mathimatics||mathematics
+maxium||maximum
+mechamism||mechanism
+meetign||meeting
+ment||meant
+mergable||mergeable
+mesage||message
+messags||messages
+messgaes||messages
+messsage||message
+messsages||messages
+micropone||microphone
+microprocesspr||microprocessor
+milliseonds||milliseconds
+minium||minimum
+minimam||minimum
+minumum||minimum
+misalinged||misaligned
+miscelleneous||miscellaneous
+misformed||malformed
+mispelled||misspelled
+mispelt||misspelt
+mising||missing
+missmanaged||mismanaged
+missmatch||mismatch
+miximum||maximum
+mmnemonic||mnemonic
+mnay||many
+modulues||modules
+momery||memory
+memomry||memory
+monochorome||monochrome
+monochromo||monochrome
+monocrome||monochrome
+mopdule||module
+mroe||more
+mulitplied||multiplied
+multidimensionnal||multidimensional
+multple||multiple
+mumber||number
+muticast||multicast
+mutiple||multiple
+mutli||multi
+nams||names
+navagating||navigating
+nead||need
+neccecary||necessary
+neccesary||necessary
+neccessary||necessary
+necesary||necessary
+neded||needed
+negaive||negative
+negoitation||negotiation
+negotation||negotiation
+nerver||never
+nescessary||necessary
+nessessary||necessary
+noticable||noticeable
+notications||notifications
+notifed||notified
+numebr||number
+numner||number
+obtaion||obtain
+occassionally||occasionally
+occationally||occasionally
+occurance||occurrence
+occurances||occurrences
+occured||occurred
+occurence||occurrence
+occure||occurred
+occured||occurred
+occuring||occurring
+offet||offset
+omited||omitted
+omiting||omitting
+omitt||omit
+ommiting||omitting
+ommitted||omitted
+onself||oneself
+ony||only
+operatione||operation
+opertaions||operations
+optionnal||optional
+optmizations||optimizations
+orientatied||orientated
+orientied||oriented
+orignal||original
+otherise||otherwise
+ouput||output
+oustanding||outstanding
+overaall||overall
+overhread||overhead
+overlaping||overlapping
+overide||override
+overrided||overridden
+overriden||overridden
+overun||overrun
+overwritting||overwriting
+overwriten||overwritten
+pacakge||package
+pachage||package
+packacge||package
+packege||package
+packge||package
+packtes||packets
+pakage||package
+pallette||palette
+paln||plan
+paramameters||parameters
+paramaters||parameters
+paramater||parameter
+parametes||parameters
+parametised||parametrised
+paramter||parameter
+paramters||parameters
+particuarly||particularly
+particularily||particularly
+partiton||partition
+pased||passed
+passin||passing
+pathes||paths
+pecularities||peculiarities
+peformance||performance
+peice||piece
+pendantic||pedantic
+peprocessor||preprocessor
+perfoming||performing
+permissons||permissions
+peroid||period
+persistance||persistence
+persistant||persistent
+plalform||platform
+platfrom||platform
+plattform||platform
+pleaes||please
+ploting||plotting
+plugable||pluggable
+poinnter||pointer
+pointeur||pointer
+poiter||pointer
+posible||possible
+positon||position
+possibilites||possibilities
+powerfull||powerful
+preapre||prepare
+preceeded||preceded
+preceeding||preceding
+preceed||precede
+precendence||precedence
+precission||precision
+preemptable||preemptible
+prefered||preferred
+prefferably||preferably
+premption||preemption
+prepaired||prepared
+pressre||pressure
+primative||primitive
+princliple||principle
+priorty||priority
+privilaged||privileged
+privilage||privilege
+priviledge||privilege
+priviledges||privileges
+probaly||probably
+procceed||proceed
+proccesors||processors
+procesed||processed
+proces||process
+procesing||processing
+processessing||processing
+processess||processes
+processpr||processor
+processsed||processed
+processsing||processing
+procteted||protected
+prodecure||procedure
+progams||programs
+progess||progress
+programers||programmers
+programm||program
+programms||programs
+progresss||progress
+promiscous||promiscuous
+promps||prompts
+pronnounced||pronounced
+prononciation||pronunciation
+pronouce||pronounce
+pronunce||pronounce
+propery||property
+propigate||propagate
+propigation||propagation
+propogate||propagate
+prosess||process
+protable||portable
+protcol||protocol
+protecion||protection
+protocoll||protocol
+promixity||proximity
+psudo||pseudo
+psuedo||pseudo
+psychadelic||psychedelic
+pwoer||power
+quering||querying
+randomally||randomly
+raoming||roaming
+reasearcher||researcher
+reasearchers||researchers
+reasearch||research
+recepient||recipient
+receving||receiving
+recieved||received
+recieve||receive
+reciever||receiver
+recieves||receives
+recogniced||recognised
+recognizeable||recognizable
+recommanded||recommended
+recyle||recycle
+redircet||redirect
+redirectrion||redirection
+reename||rename
+refcounf||refcount
+refence||reference
+refered||referred
+referenace||reference
+refering||referring
+refernces||references
+refernnce||reference
+refrence||reference
+registerd||registered
+registeresd||registered
+registerred||registered
+registes||registers
+registraration||registration
+regsiter||register
+regster||register
+regualar||regular
+reguator||regulator
+regulamentations||regulations
+reigstration||registration
+releated||related
+relevent||relevant
+remoote||remote
+remore||remote
+removeable||removable
+repectively||respectively
+replacable||replaceable
+replacments||replacements
+replys||replies
+reponse||response
+representaion||representation
+reqeust||request
+requestied||requested
+requiere||require
+requirment||requirement
+requred||required
+requried||required
+requst||request
+reseting||resetting
+resizeable||resizable
+resouce||resource
+resouces||resources
+resoures||resources
+responce||response
+ressizes||resizes
+ressource||resource
+ressources||resources
+retransmited||retransmitted
+retreived||retrieved
+retreive||retrieve
+retrive||retrieve
+retuned||returned
+reudce||reduce
+reuest||request
+reuqest||request
+reutnred||returned
+revsion||revision
+rmeoved||removed
+rmeove||remove
+rmeoves||removes
+rountine||routine
+routins||routines
+rquest||request
+runing||running
+runned||ran
+runnning||running
+runtine||runtime
+sacrifying||sacrificing
+safly||safely
+safty||safety
+savable||saveable
+scaned||scanned
+scaning||scanning
+scarch||search
+seach||search
+searchs||searches
+secquence||sequence
+secund||second
+segement||segment
+senarios||scenarios
+sentivite||sensitive
+separatly||separately
+sepcify||specify
+sepc||spec
+seperated||separated
+seperately||separately
+seperate||separate
+seperatly||separately
+seperator||separator
+sepperate||separate
+sequece||sequence
+sequencial||sequential
+serveral||several
+setts||sets
+settting||setting
+shotdown||shutdown
+shoud||should
+shouldnt||shouldn't
+shoule||should
+shrinked||shrunk
+siginificantly||significantly
+signabl||signal
+similary||similarly
+similiar||similar
+simlar||similar
+simliar||similar
+simpified||simplified
+singaled||signaled
+singal||signal
+singed||signed
+sleeped||slept
+softwares||software
+speach||speech
+specfic||specific
+speciefied||specified
+specifc||specific
+specifed||specified
+specificatin||specification
+specificaton||specification
+specifing||specifying
+specifiying||specifying
+speficied||specified
+speicify||specify
+speling||spelling
+spinlcok||spinlock
+spinock||spinlock
+splitted||split
+spreaded||spread
+spurrious||spurious
+sructure||structure
+stablilization||stabilization
+staically||statically
+staion||station
+standardss||standards
+standartization||standardization
+standart||standard
+staticly||statically
+stoped||stopped
+stoppped||stopped
+straming||streaming
+struc||struct
+structres||structures
+stuct||struct
+strucuture||structure
+stucture||structure
+sturcture||structure
+subdirectoires||subdirectories
+suble||subtle
+substract||subtract
+succesfully||successfully
+succesful||successful
+successed||succeeded
+successfull||successful
+successfuly||successfully
+sucessfully||successfully
+sucess||success
+superflous||superfluous
+superseeded||superseded
+suplied||supplied
+suported||supported
+suport||support
+supportet||supported
+suppored||supported
+supportin||supporting
+suppoted||supported
+suppported||supported
+suppport||support
+supress||suppress
+surpresses||suppresses
+susbsystem||subsystem
+suspeneded||suspended
+suspicously||suspiciously
+swaping||swapping
+switchs||switches
+swith||switch
+swithable||switchable
+swithc||switch
+swithced||switched
+swithcing||switching
+swithed||switched
+swithing||switching
+symetric||symmetric
+synax||syntax
+synchonized||synchronized
+syncronize||synchronize
+syncronized||synchronized
+syncronizing||synchronizing
+syncronus||synchronous
+syste||system
+sytem||system
+sythesis||synthesis
+taht||that
+targetted||targeted
+targetting||targeting
+teh||the
+temorary||temporary
+temproarily||temporarily
+therfore||therefore
+thier||their
+threds||threads
+threshhold||threshold
+throught||through
+thses||these
+tiggered||triggered
+tipically||typically
+timout||timeout
+tmis||this
+torerable||tolerable
+tramsmitted||transmitted
+tramsmit||transmit
+tranfer||transfer
+transciever||transceiver
+transferd||transferred
+transfered||transferred
+transfering||transferring
+transision||transition
+transmittd||transmitted
+transormed||transformed
+trasfer||transfer
+trasmission||transmission
+treshold||threshold
+trigerring||triggering
+trun||turn
+ture||true
+tyep||type
+udpate||update
+uesd||used
+uncommited||uncommitted
+unconditionaly||unconditionally
+underun||underrun
+unecessary||unnecessary
+unexecpted||unexpected
+unexepected||unexpected
+unexpcted||unexpected
+unexpectd||unexpected
+unexpeted||unexpected
+unexpexted||unexpected
+unfortunatelly||unfortunately
+unifiy||unify
+unintialized||uninitialized
+unkmown||unknown
+unknonw||unknown
+unknow||unknown
+unkown||unknown
+unneded||unneeded
+unneedingly||unnecessarily
+unnsupported||unsupported
+unmached||unmatched
+unregester||unregister
+unresgister||unregister
+unrgesiter||unregister
+unsinged||unsigned
+unstabel||unstable
+unsolicitied||unsolicited
+unsuccessfull||unsuccessful
+unsuported||unsupported
+untill||until
+unuseful||useless
+upate||update
+usefule||useful
+usefull||useful
+usege||usage
+usera||users
+usualy||usually
+utilites||utilities
+utillities||utilities
+utilties||utilities
+utiltity||utility
+utitity||utility
+utitlty||utility
+vaid||valid
+vaild||valid
+valide||valid
+variantions||variations
+varible||variable
+varient||variant
+vaule||value
+verbse||verbose
+verisons||versions
+verison||version
+verson||version
+vicefersa||vice-versa
+virtal||virtual
+virtaul||virtual
+virtiual||virtual
+visiters||visitors
+vitual||virtual
+wakeus||wakeups
+wating||waiting
+wether||whether
+whataver||whatever
+whcih||which
+whenver||whenever
+wheter||whether
+whe||when
+wierd||weird
+wiil||will
+wirte||write
+withing||within
+wnat||want
+workarould||workaround
+writeing||writing
+writting||writing
+zombe||zombie
+zomebie||zombie
index 122fab924d6ac4491cb87907029b50a3d5cd259e..67fd660ee4f514ff2431e10a7cac1f362944c967 100644 (file)
@@ -110,6 +110,7 @@ static int dm_test_eth_act(struct unit_test_state *uts)
        char ethaddr[DM_TEST_ETH_NUM][18];
        int i;
 
+       memset(ethaddr, '\0', sizeof(ethaddr));
        net_ping_ip = string_to_ip("1.1.2.2");
 
        /* Prepare the test scenario */
@@ -119,7 +120,7 @@ static int dm_test_eth_act(struct unit_test_state *uts)
                ut_assertok(device_remove(dev[i], DM_REMOVE_NORMAL));
 
                /* Invalidate MAC address */
-               strcpy(ethaddr[i], env_get(addrname[i]));
+               strncpy(ethaddr[i], env_get(addrname[i]), 17);
                /* Must disable access protection for ethaddr before clearing */
                env_set(".flags", addrname[i]);
                env_set(addrname[i], NULL);
@@ -187,7 +188,8 @@ static int dm_test_eth_rotate(struct unit_test_state *uts)
        net_ping_ip = string_to_ip("1.1.2.2");
 
        /* Invalidate eth1's MAC address */
-       strcpy(ethaddr, env_get("eth1addr"));
+       memset(ethaddr, '\0', sizeof(ethaddr));
+       strncpy(ethaddr, env_get("eth1addr"), 17);
        /* Must disable access protection for eth1addr before clearing */
        env_set(".flags", "eth1addr");
        env_set("eth1addr", NULL);
@@ -200,7 +202,7 @@ static int dm_test_eth_rotate(struct unit_test_state *uts)
 
        if (!retval) {
                /* Invalidate eth0's MAC address */
-               strcpy(ethaddr, env_get("ethaddr"));
+               strncpy(ethaddr, env_get("ethaddr"), 17);
                /* Must disable access protection for ethaddr before clearing */
                env_set(".flags", "ethaddr");
                env_set("ethaddr", NULL);
index b46ae6060207b53022b0679949eaf59687db7653..4fd249bf64e845f8f00de3278463367d93a89ac7 100644 (file)
@@ -99,10 +99,10 @@ static int count_usb_devices(void)
        return count;
 }
 
-/* test that we can remove an emulated device and it is then not found */
-static int dm_test_usb_remove(struct unit_test_state *uts)
+/* test that no USB devices are found after we stop the stack */
+static int dm_test_usb_stop(struct unit_test_state *uts)
 {
-       struct udevice *dev, *emul;
+       struct udevice *dev;
 
        /* Scan and check that all devices are present */
        state_set_skip_delays(true);
@@ -112,164 +112,11 @@ static int dm_test_usb_remove(struct unit_test_state *uts)
        ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 2, &dev));
        ut_asserteq(6, count_usb_devices());
        ut_assertok(usb_stop());
-       ut_asserteq(6, count_usb_devices());
-
-       /* Remove the second emulation device */
-       ut_assertok(uclass_find_device_by_name(UCLASS_USB_EMUL, "flash-stick@1",
-                                              &dev));
-       ut_assertok(device_unbind(dev));
-
-       /* Rescan - only the first and third should be present */
-       ut_assertok(usb_init());
-       ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 0, &dev));
-       ut_assertok(usb_emul_find_for_dev(dev, &emul));
-       ut_asserteq_str("flash-stick@0", emul->name);
-       ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 1, &dev));
-       ut_assertok(usb_emul_find_for_dev(dev, &emul));
-       ut_asserteq_str("flash-stick@2", emul->name);
-
-       ut_asserteq(-ENODEV, uclass_get_device(UCLASS_MASS_STORAGE, 2, &dev));
-
-       ut_asserteq(5, count_usb_devices());
-       ut_assertok(usb_stop());
-       ut_asserteq(5, count_usb_devices());
-
-       return 0;
-}
-DM_TEST(dm_test_usb_remove, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
-
-const char usb_tree_base[] =
-"  1  Hub (12 Mb/s, 100mA)\n"
-"  |  sandbox hub 2345\n"
-"  |\n"
-"  |\b+-2  Mass Storage (12 Mb/s, 100mA)\n"
-"  |    sandbox flash flash-stick@0\n"
-"  |  \n"
-"  |\b+-3  Mass Storage (12 Mb/s, 100mA)\n"
-"  |    sandbox flash flash-stick@1\n"
-"  |  \n"
-"  |\b+-4  Mass Storage (12 Mb/s, 100mA)\n"
-"  |    sandbox flash flash-stick@2\n"
-"  |  \n"
-"  |\b+-5  Human Interface (12 Mb/s, 100mA)\n"
-"       sandbox keyboard keyb@3\n"
-"     \n";
-
-/* test that the 'usb tree' command output looks correct */
-static int dm_test_usb_tree(struct unit_test_state *uts)
-{
-       char *data;
-       int len;
-
-       state_set_skip_delays(true);
-       ut_assertok(usb_init());
-       console_record_reset_enable();
-       usb_show_tree();
-       len = membuff_getraw(&gd->console_out, -1, true, &data);
-       if (len)
-               data[len] = '\0';
-       ut_asserteq_str(usb_tree_base, data);
-       ut_assertok(usb_stop());
-
-       return 0;
-}
-DM_TEST(dm_test_usb_tree, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
-
-const char usb_tree_remove[] =
-"  1  Hub (12 Mb/s, 100mA)\n"
-"  |  sandbox hub 2345\n"
-"  |\n"
-"  |\b+-2  Mass Storage (12 Mb/s, 100mA)\n"
-"  |    sandbox flash flash-stick@0\n"
-"  |  \n"
-"  |\b+-3  Mass Storage (12 Mb/s, 100mA)\n"
-"  |    sandbox flash flash-stick@2\n"
-"  |  \n"
-"  |\b+-4  Human Interface (12 Mb/s, 100mA)\n"
-"       sandbox keyboard keyb@3\n"
-"     \n";
-
-/*
- * test that the 'usb tree' command output looks correct when we remove a
- * device
- */
-static int dm_test_usb_tree_remove(struct unit_test_state *uts)
-{
-       struct udevice *dev;
-       char *data;
-       int len;
-
-       /* Remove the second emulation device */
-       ut_assertok(uclass_find_device_by_name(UCLASS_USB_EMUL, "flash-stick@1",
-                                              &dev));
-       ut_assertok(device_unbind(dev));
-
-       state_set_skip_delays(true);
-       ut_assertok(usb_init());
-       console_record_reset_enable();
-       usb_show_tree();
-       len = membuff_getraw(&gd->console_out, -1, true, &data);
-       if (len)
-               data[len] = '\0';
-       ut_asserteq_str(usb_tree_remove, data);
-       ut_assertok(usb_stop());
-
-       return 0;
-}
-DM_TEST(dm_test_usb_tree_remove, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
-
-const char usb_tree_reorder[] =
-"  1  Hub (12 Mb/s, 100mA)\n"
-"  |  sandbox hub 2345\n"
-"  |\n"
-"  |\b+-2  Mass Storage (12 Mb/s, 100mA)\n"
-"  |    sandbox flash flash-stick@0\n"
-"  |  \n"
-"  |\b+-3  Mass Storage (12 Mb/s, 100mA)\n"
-"  |    sandbox flash flash-stick@2\n"
-"  |  \n"
-"  |\b+-4  Human Interface (12 Mb/s, 100mA)\n"
-"  |    sandbox keyboard keyb@3\n"
-"  |  \n"
-"  |\b+-5  Mass Storage (12 Mb/s, 100mA)\n"
-"       sandbox flash flash-stick@1\n"
-"     \n";
-
-/*
- * test that the 'usb tree' command output looks correct when we reorder two
- * devices.
- */
-static int dm_test_usb_tree_reorder(struct unit_test_state *uts)
-{
-       struct udevice *dev, *parent;
-       char *data;
-       int len;
-
-       /* Remove the second emulation device */
-       ut_assertok(uclass_find_device_by_name(UCLASS_USB_EMUL, "flash-stick@1",
-                                              &dev));
-       parent = dev->parent;
-
-       /* Reorder the devices in the parent list and uclass list */
-       list_del(&dev->sibling_node);
-       list_add_tail(&dev->sibling_node, &parent->child_head);
-
-       list_del(&dev->uclass_node);
-       list_add_tail(&dev->uclass_node, &dev->uclass->dev_head);
-
-       state_set_skip_delays(true);
-       ut_assertok(usb_init());
-       console_record_reset_enable();
-       usb_show_tree();
-       len = membuff_getraw(&gd->console_out, -1, true, &data);
-       if (len)
-               data[len] = '\0';
-       ut_asserteq_str(usb_tree_reorder, data);
-       ut_assertok(usb_stop());
+       ut_asserteq(0, count_usb_devices());
 
        return 0;
 }
-DM_TEST(dm_test_usb_tree_reorder, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+DM_TEST(dm_test_usb_stop, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
 
 static int dm_test_usb_keyb(struct unit_test_state *uts)
 {
index 4d000fa1bea5b41681b763b0dd318dd52d6f4afd..29917d0c2d831beaf2387db1cfd9d5651f999af2 100644 (file)
@@ -100,6 +100,14 @@ static int select_vidconsole(struct unit_test_state *uts, const char *drv_name)
        return 0;
 }
 
+static void vidconsole_put_string(struct udevice *dev, const char *str)
+{
+       const char *s;
+
+       for (s = str; *s; s++)
+               vidconsole_put_char(dev, *s);
+}
+
 /* Test text output works on the video console */
 static int dm_test_video_text(struct unit_test_state *uts)
 {
@@ -140,19 +148,51 @@ static int dm_test_video_chars(struct unit_test_state *uts)
 {
        struct udevice *dev, *con;
        const char *test_string = "Well\b\b\b\bxhe is\r \n\ta very \amodest  \bman\n\t\tand Has much to\b\bto be modest about.";
-       const char *s;
 
        ut_assertok(select_vidconsole(uts, "vidconsole0"));
        ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
-       for (s = test_string; *s; s++)
-               vidconsole_put_char(con, *s);
+       vidconsole_put_string(con, test_string);
        ut_asserteq(466, compress_frame_buffer(dev));
 
        return 0;
 }
 DM_TEST(dm_test_video_chars, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
 
+#ifdef CONFIG_VIDEO_ANSI
+#define ANSI_ESC "\x1b"
+/* Test handling of ANSI escape sequences */
+static int dm_test_video_ansi(struct unit_test_state *uts)
+{
+       struct udevice *dev, *con;
+
+       ut_assertok(select_vidconsole(uts, "vidconsole0"));
+       ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
+       ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
+
+       /* reference clear: */
+       video_clear(con->parent);
+       video_sync(con->parent);
+       ut_asserteq(46, compress_frame_buffer(dev));
+
+       /* test clear escape sequence: [2J */
+       vidconsole_put_string(con, "A\tB\tC"ANSI_ESC"[2J");
+       ut_asserteq(46, compress_frame_buffer(dev));
+
+       /* test set-cursor: [%d;%df */
+       vidconsole_put_string(con, "abc"ANSI_ESC"[2;2fab"ANSI_ESC"[4;4fcd");
+       ut_asserteq(142, compress_frame_buffer(dev));
+
+       /* test colors (30-37 fg color, 40-47 bg color) */
+       vidconsole_put_string(con, ANSI_ESC"[30;41mfoo"); /* black on red */
+       vidconsole_put_string(con, ANSI_ESC"[33;44mbar"); /* yellow on blue */
+       ut_asserteq(268, compress_frame_buffer(dev));
+
+       return 0;
+}
+DM_TEST(dm_test_video_ansi, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+#endif
+
 /**
  * check_vidconsole_output() - Run a text console test
  *
@@ -294,12 +334,10 @@ static int dm_test_video_truetype(struct unit_test_state *uts)
 {
        struct udevice *dev, *con;
        const char *test_string = "Criticism may not be agreeable, but it is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things. Some see private enterprise as a predatory target to be shot, others as a cow to be milked, but few are those who see it as a sturdy horse pulling the wagon. The \aprice OF\b\bof greatness\n\tis responsibility.\n\nBye";
-       const char *s;
 
        ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
-       for (s = test_string; *s; s++)
-               vidconsole_put_char(con, *s);
+       vidconsole_put_string(con, test_string);
        ut_asserteq(12619, compress_frame_buffer(dev));
 
        return 0;
@@ -312,7 +350,6 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)
        struct sandbox_sdl_plat *plat;
        struct udevice *dev, *con;
        const char *test_string = "Criticism may not be agreeable, but it is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things. Some see private enterprise as a predatory target to be shot, others as a cow to be milked, but few are those who see it as a sturdy horse pulling the wagon. The \aprice OF\b\bof greatness\n\tis responsibility.\n\nBye";
-       const char *s;
 
        ut_assertok(uclass_find_device(UCLASS_VIDEO, 0, &dev));
        ut_assert(!device_active(dev));
@@ -321,8 +358,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)
 
        ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
-       for (s = test_string; *s; s++)
-               vidconsole_put_char(con, *s);
+       vidconsole_put_string(con, test_string);
        ut_asserteq(33849, compress_frame_buffer(dev));
 
        return 0;
@@ -335,7 +371,6 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)
        struct sandbox_sdl_plat *plat;
        struct udevice *dev, *con;
        const char *test_string = "...Criticism may or may\b\b\b\b\b\bnot be agreeable, but seldom it is necessary\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bit is necessary. It fulfils the same function as pain in the human body. It calls attention to an unhealthy state of things.";
-       const char *s;
 
        ut_assertok(uclass_find_device(UCLASS_VIDEO, 0, &dev));
        ut_assert(!device_active(dev));
@@ -344,8 +379,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)
 
        ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev));
        ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
-       for (s = test_string; *s; s++)
-               vidconsole_put_char(con, *s);
+       vidconsole_put_string(con, test_string);
        ut_asserteq(34871, compress_frame_buffer(dev));
 
        return 0;
index b19486419e9209dce3386ca56fbf7ab540b23bce..20d5dd8a47d90a2f5ff85598a4f9e2914fd24589 100755 (executable)
@@ -9,14 +9,18 @@
 # It currently tests the fs/sb and native commands for ext4 and fat partitions
 # Expected results are as follows:
 # EXT4 tests:
-# fs-test.sb.ext4.out: Summary: PASS: 23 FAIL: 0
-# 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: 132 TOTAL FAIL: 6
+# fs-test.sb.ext4.out: Summary: PASS: 24 FAIL: 0
+# fs-test.ext4.out: Summary: PASS: 24 FAIL: 0
+# fs-test.fs.ext4.out: Summary: PASS: 24 FAIL: 0
+# FAT16 tests:
+# fs-test.sb.fat16.out: Summary: PASS: 24 FAIL: 0
+# fs-test.fat16.out: Summary: PASS: 21 FAIL: 3
+# fs-test.fs.fat16.out: Summary: PASS: 21 FAIL: 3
+# FAT32 tests:
+# fs-test.sb.fat32.out: Summary: PASS: 24 FAIL: 0
+# fs-test.fat32.out: Summary: PASS: 21 FAIL: 3
+# fs-test.fs.fat32.out: Summary: PASS: 21 FAIL: 3
+# Total Summary: TOTAL PASS: 204 TOTAL FAIL: 12
 
 # pre-requisite binaries list.
 PREREQ_BINS="md5sum mkfs mount umount dd fallocate mkdir"
@@ -41,7 +45,7 @@ SMALL_FILE="1MB.file"
 BIG_FILE="2.5GB.file"
 
 # $MD5_FILE will have the expected md5s when we do the test
-# They shall have a suffix which represents their file system (ext4/fat)
+# They shall have a suffix which represents their file system (ext4/fat16/...)
 MD5_FILE="${OUT_DIR}/md5s.list"
 
 # $OUT shall be the prefix of the test output. Their suffix will be .out
@@ -104,15 +108,25 @@ function prepare_env() {
 }
 
 # 1st parameter is the name of the image file to be created
-# 2nd parameter is the filesystem - fat ext4 etc
+# 2nd parameter is the filesystem - fat16 ext4 etc
 # -F cant be used with fat as it means something else.
 function create_image() {
        # Create image if not already present - saves time, while debugging
-       if [ "$2" = "ext4" ]; then
+       case "$2" in
+               fat16)
+               MKFS_OPTION="-F 16"
+               FS_TYPE="fat"
+               ;;
+               fat32)
+               MKFS_OPTION="-F 32"
+               FS_TYPE="fat"
+               ;;
+               ext4)
                MKFS_OPTION="-F"
-       else
-               MKFS_OPTION=""
-       fi
+               FS_TYPE="ext4"
+               ;;
+       esac
+
        if [ ! -f "$1" ]; then
                fallocate -l 3G "$1" &> /dev/null
                if [ $? -ne 0 ]; then
@@ -123,8 +137,8 @@ function create_image() {
                                exit $?
                        fi
                fi
-               mkfs -t "$2" $MKFS_OPTION "$1" &> /dev/null
-               if [ $? -ne 0 -a "$2" = "fat" ]; then
+               mkfs -t "$FS_TYPE" $MKFS_OPTION "$1" &> /dev/null
+               if [ $? -ne 0 -a "$FS_TYPE" = "fat" ]; then
                        # If we fail and we did fat, try vfat.
                        mkfs -t vfat $MKFS_OPTION "$1" &> /dev/null
                fi
@@ -136,7 +150,7 @@ function create_image() {
 }
 
 # 1st parameter is image file
-# 2nd parameter is file system type - fat/ext4
+# 2nd parameter is file system type - fat16/ext4/...
 # 3rd parameter is name of small file
 # 4th parameter is name of big file
 # 5th parameter is fs/nonfs/sb - to dictate generic fs commands or
@@ -149,7 +163,7 @@ function test_image() {
        length="0x00100000"
 
        case "$2" in
-               fat)
+               fat*)
                FPATH=""
                PREFIX="fat"
                WRITE="write"
@@ -215,10 +229,14 @@ ${PREFIX}ls host${SUFFIX} $6
 # We want ${PREFIX}size host 0:0 $3 for host commands and
 # sb size hostfs - $3 for hostfs commands.
 # 1MB is 0x0010 0000
-# Test Case 2 - size of small file
+# Test Case 2a - size of small file
 ${PREFIX}size host${SUFFIX} ${FPATH}$FILE_SMALL
 printenv filesize
 setenv filesize
+# Test Case 2b - size of small file via a path using '..'
+${PREFIX}size host${SUFFIX} ${FPATH}SUBDIR/../$FILE_SMALL
+printenv filesize
+setenv filesize
 
 # 2.5GB (1024*1024*2500) is 0x9C40 0000
 # Test Case 3 - size of big file
@@ -333,6 +351,9 @@ function create_files() {
        mkdir -p "$MOUNT_DIR"
        sudo mount -o loop,rw "$1" "$MOUNT_DIR"
 
+       # Create a subdirectory.
+       sudo mkdir -p "$MOUNT_DIR/SUBDIR"
+
        # Create big file in this image.
        # Note that we work only on the start 1MB, couple MBs in the 2GB range
        # and the last 1 MB of the huge 2.5GB file.
@@ -439,16 +460,19 @@ function check_results() {
        FAIL=0
 
        # Check if the ls is showing correct results for 2.5 gb file
-       grep -A6 "Test Case 1 " "$1" | egrep -iq "2621440000 *$4"
+       grep -A7 "Test Case 1 " "$1" | egrep -iq "2621440000 *$4"
        pass_fail "TC1: ls of $4"
 
        # Check if the ls is showing correct results for 1 mb file
-       grep -A6 "Test Case 1 " "$1" | egrep -iq "1048576 *$3"
+       grep -A7 "Test Case 1 " "$1" | egrep -iq "1048576 *$3"
        pass_fail "TC1: ls of $3"
 
        # Check size command on 1MB.file
-       egrep -A3 "Test Case 2 " "$1" | grep -q "filesize=100000"
+       egrep -A3 "Test Case 2a " "$1" | grep -q "filesize=100000"
        pass_fail "TC2: size of $3"
+       # Check size command on 1MB.file via a path using '..'
+       egrep -A3 "Test Case 2b " "$1" | grep -q "filesize=100000"
+       pass_fail "TC2: size of $3 via a path using '..'"
 
        # Check size command on 2.5GB.file
        egrep -A3 "Test Case 3 " "$1" | grep -q "filesize=9c400000"
@@ -550,7 +574,7 @@ TOTAL_PASS=0
 # In each loop, for a given file system image, we test both the
 # fs command, like load/size/write, the file system specific command
 # like: ext4load/ext4size/ext4write and the sb load/ls/save commands.
-for fs in ext4 fat; do
+for fs in ext4 fat16 fat32; do
 
        echo "Creating $fs image if not already present."
        IMAGE=${IMG}.${fs}.img
@@ -563,11 +587,14 @@ for fs in ext4 fat; do
 
        # Lets mount the image and test sb hostfs commands
        mkdir -p "$MOUNT_DIR"
-       if [ "$fs" = "fat" ]; then
+       case "$fs" in
+               fat*)
                uid="uid=`id -u`"
-       else
+               ;;
+               *)
                uid=""
-       fi
+               ;;
+       esac
        sudo mount -o loop,rw,$uid "$IMAGE" "$MOUNT_DIR"
        sudo chmod 777 "$MOUNT_DIR"
 
index 24891ee829018e5d1ae75af1df0f5bb9358befa3..c730a11f518883b5cbc83fc82dabedc365bea1d6 100644 (file)
@@ -226,6 +226,7 @@ int do_ut_overlay(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        void *fdt_overlay = &__dtb_test_fdt_overlay_begin;
        void *fdt_overlay_stacked = &__dtb_test_fdt_overlay_stacked_begin;
        void *fdt_base_copy, *fdt_overlay_copy, *fdt_overlay_stacked_copy;
+       int ret = -ENOMEM;
 
        uts = calloc(1, sizeof(*uts));
        if (!uts)
@@ -236,16 +237,16 @@ int do_ut_overlay(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        fdt_base_copy = malloc(FDT_COPY_SIZE);
        if (!fdt_base_copy)
-               return -ENOMEM;
+               goto err1;
        uts->priv = fdt_base_copy;
 
        fdt_overlay_copy = malloc(FDT_COPY_SIZE);
        if (!fdt_overlay_copy)
-               return -ENOMEM;
+               goto err2;
 
        fdt_overlay_stacked_copy = malloc(FDT_COPY_SIZE);
        if (!fdt_overlay_stacked_copy)
-               return -ENOMEM;
+               goto err3;
 
        /*
         * Resize the FDT to 4k so that we have room to operate on
@@ -293,11 +294,18 @@ int do_ut_overlay(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        }
 
        printf("Failures: %d\n", uts->fail_count);
+       if (!uts->fail_count)
+               ret = 0;
+       else
+               ret = CMD_RET_FAILURE;
 
        free(fdt_overlay_stacked_copy);
+err3:
        free(fdt_overlay_copy);
+err2:
        free(fdt_base_copy);
+err1:
        free(uts);
 
-       return uts->fail_count ? CMD_RET_FAILURE : 0;
+       return ret;
 }
index baad289972577e6e0b63e408ceb0e85379c88572..a42c554bef8d563b86334c06671878cfced0a1a3 100644 (file)
@@ -36,6 +36,9 @@ static int do_ut_print(cmd_tbl_t *cmdtp, int flag, int argc,
        snprintf(str, 0, "testing none");
        assert(*str == 'x');
 
+       sprintf(big_str, "_%ls_", L"foo");
+       assert(!strcmp("_foo_", big_str));
+
        /* Test the banner function */
        s = display_options_get_banner(true, str, sizeof(str));
        assert(s == str);
index 829c7efbb2d72c4242ce22e8285b2646884d5dee..ea4b66a41ccb84a202567332560c99ddda85acc5 100644 (file)
@@ -22,12 +22,17 @@ need to implement various "hook" scripts that are called by the test suite at
 the appropriate time.
 
 On Debian or Debian-like distributions, the following packages are required.
-Similar package names should exist in other distributions.
+Some packages are required to execute any test, and others only for specific
+tests. Similar package names should exist in other distributions.
 
 | Package        | Version tested (Ubuntu 14.04) |
 | -------------- | ----------------------------- |
 | python         | 2.7.5-5ubuntu3                |
 | python-pytest  | 2.5.1-1                       |
+| gdisk          | 0.8.8-1ubuntu0.1              |
+| dfu-util       | 0.5-1                         |
+| dtc            | 1.4.0+dfsg-1                  |
+| openssl        | 1.0.1f-1ubuntu2.22            |
 
 The test script supports either:
 
index 65e1d75626cf82105b11130458ac9b264e0ffaa1..6e66a48c15fdad796150467da5d6589bcf5758fb 100644 (file)
@@ -429,12 +429,12 @@ def setup_boardspec(item):
     for board in mark.args:
         if board.startswith('!'):
             if ubconfig.board_type == board[1:]:
-                pytest.skip('board not supported')
+                pytest.skip('board "%s" not supported' % ubconfig.board_type)
                 return
         else:
             required_boards.append(board)
     if required_boards and ubconfig.board_type not in required_boards:
-        pytest.skip('board not supported')
+        pytest.skip('board "%s" not supported' % ubconfig.board_type)
 
 def setup_buildconfigspec(item):
     """Process any 'buildconfigspec' marker for a test.
@@ -455,7 +455,35 @@ def setup_buildconfigspec(item):
         return
     for option in mark.args:
         if not ubconfig.buildconfig.get('config_' + option.lower(), None):
-            pytest.skip('.config feature not enabled')
+            pytest.skip('.config feature "%s" not enabled' % option.lower())
+
+def tool_is_in_path(tool):
+    for path in os.environ["PATH"].split(os.pathsep):
+        fn = os.path.join(path, tool)
+        if os.path.isfile(fn) and os.access(fn, os.X_OK):
+            return True
+    return False
+
+def setup_requiredtool(item):
+    """Process any 'requiredtool' marker for a test.
+
+    Such a marker lists some external tool (binary, executable, application)
+    that the test requires. If tests are being executed on a system that
+    doesn't have the required tool, the test is marked to be skipped.
+
+    Args:
+        item: The pytest test item.
+
+    Returns:
+        Nothing.
+    """
+
+    mark = item.get_marker('requiredtool')
+    if not mark:
+        return
+    for tool in mark.args:
+        if not tool_is_in_path(tool):
+            pytest.skip('tool "%s" not in $PATH' % tool)
 
 def start_test_section(item):
     anchors[item.name] = log.start_section(item.name)
@@ -476,6 +504,7 @@ def pytest_runtest_setup(item):
     start_test_section(item)
     setup_boardspec(item)
     setup_buildconfigspec(item)
+    setup_requiredtool(item)
 
 def pytest_runtest_protocol(item, nextitem):
     """pytest hook: Called to execute a test.
index bf926c3e7762ae37ffc026ebebf58e05641df50a..5bc1bc49d4de2d8f9433507f42bcdfd33a3916a1 100644 (file)
@@ -365,13 +365,13 @@ $(document).ready(function () {
 
         self._terminate_stream()
         self.f.write('<div class="' + note_type + '">\n')
-        if anchor:
-            self.f.write('<a href="#%s">\n' % anchor)
         self.f.write('<pre>')
+        if anchor:
+            self.f.write('<a href="#%s">' % anchor)
         self.f.write(self._escape(msg))
-        self.f.write('\n</pre>\n')
         if anchor:
-            self.f.write('</a>\n')
+            self.f.write('</a>')
+        self.f.write('\n</pre>\n')
         self.f.write('</div>\n')
 
     def start_section(self, marker, anchor=None):
index fba67d585b9faff1db1cade330a0597360b74b95..8f6877c5c2647c43d0ef31d3356f2bbf7afcc964 100644 (file)
@@ -113,6 +113,7 @@ test_sizes_default = (
 first_usb_dev_port = None
 
 @pytest.mark.buildconfigspec('cmd_dfu')
+@pytest.mark.requiredtool('dfu-util')
 def test_dfu(u_boot_console, env__usb_dev_port, env__dfu_config):
     """Test the "dfu" command; the host system must be able to enumerate a USB
     device when "dfu" is running, various DFU transfers are tested, and the
diff --git a/test/py/tests/test_efi_selftest.py b/test/py/tests/test_efi_selftest.py
new file mode 100644 (file)
index 0000000..76e282a
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
+# Copyright (c) 2017, Heinrich Schuchardt <xypron.glpk@gmx.de>
+#
+# SPDX-License-Identifier: GPL-2.0
+
+# Test efi API implementation
+
+import pytest
+import u_boot_utils
+
+@pytest.mark.buildconfigspec('cmd_bootefi_selftest')
+def test_efi_selftest(u_boot_console):
+       """
+       Run bootefi selftest
+       """
+
+       u_boot_console.run_command(cmd='bootefi selftest', wait_for_prompt=False)
+       m = u_boot_console.p.expect(['Summary: 0 failures', 'Press any key'])
+       if m != 0:
+               raise Exception('Failures occured during the EFI selftest')
+       u_boot_console.run_command(cmd='', wait_for_echo=False, wait_for_prompt=False);
+       m = u_boot_console.p.expect(['resetting', 'U-Boot'])
+       if m != 0:
+               raise Exception('Reset failed during the EFI selftest')
+       u_boot_console.restart_uboot();
index 7e6b96dae45a5665d2a50f3f9524093156642e0a..4b32bb18b8b3d6b8296e1b403042379ef70a166e 100755 (executable)
@@ -111,6 +111,7 @@ sb save hostfs 0 %(loadables2_addr)x %(loadables2_out)s %(loadables2_size)x
 
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.buildconfigspec('fit_signature')
+@pytest.mark.requiredtool('dtc')
 def test_fit(u_boot_console):
     def make_fname(leaf):
         """Make a temporary filename
index e2bbd08e6d42a6cbc4bb9da73684c37f46c2b95a..ec25fbbc5a1065efef662cc83d16b6088e2fd107 100644 (file)
@@ -38,15 +38,14 @@ class GptTestDiskImage(object):
             fd = os.open(self.path, os.O_RDWR | os.O_CREAT)
             os.ftruncate(fd, 4194304)
             os.close(fd)
-            sgdisk = '/sbin/sgdisk'
-            cmd = (sgdisk, '-U', '375a56f7-d6c9-4e81-b5f0-09d41ca89efe',
+            cmd = ('sgdisk', '-U', '375a56f7-d6c9-4e81-b5f0-09d41ca89efe',
                 self.path)
             u_boot_utils.run_and_log(u_boot_console, cmd)
-            cmd = (sgdisk, '--new=1:2048:2560', self.path)
+            cmd = ('sgdisk', '--new=1:2048:2560', self.path)
             u_boot_utils.run_and_log(u_boot_console, cmd)
-            cmd = (sgdisk, '--new=2:4096:4608', self.path)
+            cmd = ('sgdisk', '--new=2:4096:4608', self.path)
             u_boot_utils.run_and_log(u_boot_console, cmd)
-            cmd = (sgdisk, '-l', self.path)
+            cmd = ('sgdisk', '-l', self.path)
             u_boot_utils.run_and_log(u_boot_console, cmd)
 
 gtdi = None
@@ -64,6 +63,7 @@ def state_disk_image(u_boot_console):
 
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.buildconfigspec('cmd_gpt')
+@pytest.mark.requiredtool('sgdisk')
 def test_gpt_guid(state_disk_image, u_boot_console):
     """Test the gpt guid command."""
 
@@ -73,6 +73,7 @@ def test_gpt_guid(state_disk_image, u_boot_console):
 
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.buildconfigspec('cmd_gpt')
+@pytest.mark.requiredtool('sgdisk')
 def test_gpt_save_guid(state_disk_image, u_boot_console):
     """Test the gpt guid command to save GUID into a string."""
 
@@ -86,6 +87,7 @@ def test_gpt_save_guid(state_disk_image, u_boot_console):
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.buildconfigspec('cmd_gpt')
 @pytest.mark.buildconfigspec('cmd_gpt_rename')
+@pytest.mark.requiredtool('sgdisk')
 def test_gpt_rename_partition(state_disk_image, u_boot_console):
     """Test the gpt rename command to write partition names."""
 
@@ -101,6 +103,7 @@ def test_gpt_rename_partition(state_disk_image, u_boot_console):
 @pytest.mark.buildconfigspec('cmd_gpt')
 @pytest.mark.buildconfigspec('cmd_gpt_rename')
 @pytest.mark.buildconfigspec('cmd_part')
+@pytest.mark.requiredtool('sgdisk')
 def test_gpt_swap_partitions(state_disk_image, u_boot_console):
     """Test the gpt swap command to exchange two partition names."""
 
index 6e62820743fe03b63c3c4ce8a1885587b04e53c1..c4da79d11407eca7f62e6db89618cceffe772176 100644 (file)
@@ -31,6 +31,10 @@ import u_boot_utils as util
 
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.buildconfigspec('fit_signature')
+@pytest.mark.requiredtool('dtc')
+@pytest.mark.requiredtool('fdtget')
+@pytest.mark.requiredtool('fdtput')
+@pytest.mark.requiredtool('openssl')
 def test_vboot(u_boot_console):
     """Test verified boot signing with mkimage and verification with 'bootm'.
 
index a0db19d6b057394d5c3872dd203c854a46f2faed..c16477459d23c7a669feec5669e7cb986eae2d93 100644 (file)
@@ -175,7 +175,7 @@ HOSTCFLAGS_rsa-sign.o += -Wno-deprecated-declarations
 endif
 endif
 
-HOSTCFLAGS_fit_image.o += -DMKIMAGE_DTC=\"$(DTC)\"
+HOSTCFLAGS_fit_image.o += -DMKIMAGE_DTC=\"$(CONFIG_MKIMAGE_DTC_PATH)\"
 
 HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage)
 HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage)
index 352ad438eed2955aeb6ec5349fc437032f659c5b..68b470a3a7d9adfc5ec48647d6a6e899b63d8b5d 100644 (file)
@@ -73,6 +73,7 @@ email service. Don't wrestle with internal APIs. Tell me what you need and I
 might add it in a safe way as a client API instead."""
 
 import os
+import platform
 import re
 import sys
 
@@ -137,10 +138,8 @@ class Config(object):
         # The set of all symbols, indexed by name (a string)
         self.syms = {}
         # Python 2/3 compatibility hack. This is the only one needed.
-        if sys.version_info[0] >= 3:
-            self.syms_iter = self.syms.values
-        else:
-            self.syms_iter = self.syms.itervalues
+        self.syms_iter = self.syms.values if sys.version_info[0] >= 3 else \
+                         self.syms.itervalues
 
         # The set of all defined symbols in the configuration in the order they
         # appear in the Kconfig files. This excludes the special symbols n, m,
@@ -173,7 +172,7 @@ class Config(object):
         self.m = register_special_symbol(TRISTATE, "m", "m")
         self.y = register_special_symbol(TRISTATE, "y", "y")
         # DEFCONFIG_LIST uses this
-        register_special_symbol(STRING, "UNAME_RELEASE", os.uname()[2])
+        register_special_symbol(STRING, "UNAME_RELEASE", platform.uname()[2])
 
         # The symbol with "option defconfig_list" set, containing a list of
         # default .config files
@@ -183,16 +182,20 @@ class Config(object):
         self.arch = os.environ.get("ARCH")
         self.srcarch = os.environ.get("SRCARCH")
 
+        # If you set CONFIG_ in the environment, Kconfig will prefix all symbols
+        # with its value when saving the configuration, instead of using the default, "CONFIG_".
+        self.config_prefix = os.environ.get("CONFIG_")
+        if self.config_prefix is None:
+            self.config_prefix = "CONFIG_"
+
         # See Config.__init__(). We need this for get_defconfig_filename().
         self.srctree = os.environ.get("srctree")
         if self.srctree is None:
             self.srctree = "."
 
         self.filename = filename
-        if base_dir is None:
-            self.base_dir = self.srctree
-        else:
-            self.base_dir = os.path.expandvars(base_dir)
+        self.base_dir = self.srctree if base_dir is None else \
+                        os.path.expandvars(base_dir)
 
         # The 'mainmenu' text
         self.mainmenu_text = None
@@ -222,7 +225,8 @@ class Config(object):
         self._transform_m = None
 
         # Parse the Kconfig files
-        self.top_block = self._parse_file(filename, None, None, None)
+        self.top_block = []
+        self._parse_file(filename, None, None, None, self.top_block)
 
         # Build Symbol.dep for all symbols
         self._build_dep()
@@ -405,6 +409,10 @@ class Config(object):
         """
 
         self._warnings = []
+        # Regular expressions for parsing .config files
+        _set_re_match = re.compile(r"{}(\w+)=(.*)".format(self.config_prefix)).match
+        _unset_re_match = re.compile(r"# {}(\w+) is not set".format(self.config_prefix)).match
+
         # Put this first so that a missing file doesn't screw up our state
         filename = os.path.expandvars(filename)
         line_feeder = _FileFeed(filename)
@@ -524,14 +532,12 @@ class Config(object):
         with open(filename, "w") as f:
             # Write header
             if header is not None:
-                f.write(_comment(header))
-                f.write("\n")
+                f.write(_comment(header) + "\n")
 
             # Build and write configuration
             conf_strings = []
             _make_block_conf(self.top_block, conf_strings.append)
-            f.write("\n".join(conf_strings))
-            f.write("\n")
+            f.write("\n".join(conf_strings) + "\n")
 
     def eval(self, s):
         """Returns the value of the expression 's' -- where 's' is represented
@@ -609,16 +615,18 @@ class Config(object):
     # Kconfig parsing
     #
 
-    def _parse_file(self, filename, parent, deps, visible_if_deps, res=None):
-        """Parses the Kconfig file 'filename'. Returns a list with the Items in
-        the file. See _parse_block() for the meaning of the parameters."""
-        return self._parse_block(_FileFeed(filename), None, parent, deps,
-                                 visible_if_deps, res)
+    def _parse_file(self, filename, parent, deps, visible_if_deps, block):
+        """Parses the Kconfig file 'filename'. Appends the Items in the file
+        (and any file it sources) to the list passed in the 'block' parameter.
+        See _parse_block() for the meaning of the parameters."""
+        self._parse_block(_FileFeed(filename), None, parent, deps,
+                          visible_if_deps, block)
 
     def _parse_block(self, line_feeder, end_marker, parent, deps,
-                     visible_if_deps, res=None):
+                     visible_if_deps, block):
         """Parses a block, which is the contents of either a file or an if,
-        menu, or choice statement. Returns a list with the Items in the block.
+        menu, or choice statement. Appends the Items to the list passed in the
+        'block' parameter.
 
         line_feeder: A _FileFeed instance feeding lines from a file. The
           Kconfig language is line-based in practice.
@@ -634,10 +642,7 @@ class Config(object):
         visible_if_deps (default: None): 'visible if' dependencies from
            enclosing menus.
 
-        res (default: None): The list to add items to. If None, a new list is
-           created to hold the items."""
-
-        block = [] if res is None else res
+        block: The list to add items to."""
 
         while 1:
             # Do we already have a tokenized line that we determined wasn't
@@ -656,7 +661,7 @@ class Config(object):
                     if end_marker is not None:
                         raise Kconfig_Syntax_Error("Unexpected end of file {0}"
                                                  .format(line_feeder.filename))
-                    return block
+                    return
 
                 tokens = self._tokenize(line, False, line_feeder.filename,
                                         line_feeder.linenr)
@@ -679,14 +684,13 @@ class Config(object):
                 # choice statements, the choice statement takes precedence.
                 if not sym.is_defined_ or isinstance(parent, Choice):
                     sym.parent = parent
-
                 sym.is_defined_ = True
 
+                self._parse_properties(line_feeder, sym, deps, visible_if_deps)
+
                 self.kconfig_syms.append(sym)
                 block.append(sym)
 
-                self._parse_properties(line_feeder, sym, deps, visible_if_deps)
-
             elif t0 == T_SOURCE:
                 kconfig_file = tokens.get_next()
                 exp_kconfig_file = self._expand_sym_refs(kconfig_file)
@@ -705,7 +709,7 @@ class Config(object):
 
             elif t0 == end_marker:
                 # We have reached the end of the block
-                return block
+                return
 
             elif t0 == T_IF:
                 # If statements are treated as syntactic sugar for adding
@@ -722,38 +726,39 @@ class Config(object):
 
             elif t0 == T_COMMENT:
                 comment = Comment()
-
                 comment.config = self
                 comment.parent = parent
                 comment.filename = line_feeder.filename
                 comment.linenr = line_feeder.linenr
                 comment.text = tokens.get_next()
 
-                self.comments.append(comment)
-                block.append(comment)
-
                 self._parse_properties(line_feeder, comment, deps,
                                        visible_if_deps)
 
+                self.comments.append(comment)
+                block.append(comment)
+
             elif t0 == T_MENU:
                 menu = Menu()
-
                 menu.config = self
                 menu.parent = parent
                 menu.filename = line_feeder.filename
                 menu.linenr = line_feeder.linenr
                 menu.title = tokens.get_next()
 
-                self.menus.append(menu)
-                block.append(menu)
-
-                # Parse properties and contents
                 self._parse_properties(line_feeder, menu, deps,
                                        visible_if_deps)
-                menu.block = self._parse_block(line_feeder, T_ENDMENU, menu,
-                                               menu.dep_expr,
-                                               _make_and(visible_if_deps,
-                                                         menu.visible_if_expr))
+
+                # This needs to go before _parse_block() so that we get the
+                # proper menu ordering in the case of nested functions
+                self.menus.append(menu)
+                # Parse contents and put Items in menu.block
+                self._parse_block(line_feeder, T_ENDMENU, menu, menu.dep_expr,
+                                  _make_and(visible_if_deps,
+                                            menu.visible_if_expr),
+                                  menu.block)
+
+                block.append(menu)
 
             elif t0 == T_CHOICE:
                 name = tokens.get_next()
@@ -775,11 +780,12 @@ class Config(object):
                 choice.def_locations.append((line_feeder.filename,
                                              line_feeder.linenr))
 
-                # Parse properties and contents
                 self._parse_properties(line_feeder, choice, deps,
                                        visible_if_deps)
-                choice.block = self._parse_block(line_feeder, T_ENDCHOICE,
-                                                 choice, deps, visible_if_deps)
+
+                # Parse contents and put Items in choice.block
+                self._parse_block(line_feeder, T_ENDCHOICE, choice, deps,
+                                  visible_if_deps, choice.block)
 
                 choice._determine_actual_symbols()
 
@@ -819,19 +825,19 @@ class Config(object):
             """Parses '<expr1> if <expr2>' constructs, where the 'if' part is
             optional. Returns a tuple containing the parsed expressions, with
             None as the second element if the 'if' part is missing."""
-            val = self._parse_expr(tokens, stmt, line, filename, linenr, False)
-            if tokens.check(T_IF):
-                return (val, self._parse_expr(tokens, stmt, line, filename,
-                                              linenr))
-            return (val, None)
+            return (self._parse_expr(tokens, stmt, line, filename, linenr,
+                                     False),
+                    self._parse_expr(tokens, stmt, line, filename, linenr)
+                    if tokens.check(T_IF) else None)
 
         # In case the symbol is defined in multiple locations, we need to
-        # remember what prompts, defaults, and selects are new for this
-        # definition, as "depends on" should only apply to the local
+        # remember what prompts, defaults, selects, and implies are new for
+        # this definition, as "depends on" should only apply to the local
         # definition.
         new_prompt = None
         new_def_exprs = []
         new_selects = []
+        new_implies = []
 
         # Dependencies from 'depends on' statements
         depends_on_expr = None
@@ -897,18 +903,27 @@ class Config(object):
 
                 line_feeder.unget()
 
-            elif t0 == T_SELECT or t0 == T_IMPLY:
+            elif t0 == T_SELECT:
                 target = tokens.get_next()
 
                 stmt.referenced_syms.add(target)
                 stmt.selected_syms.add(target)
 
-                if tokens.check(T_IF):
-                    new_selects.append((target,
-                                        self._parse_expr(tokens, stmt, line,
-                                                         filename, linenr)))
-                else:
-                    new_selects.append((target, None))
+                new_selects.append(
+                    (target,
+                     self._parse_expr(tokens, stmt, line, filename, linenr)
+                     if tokens.check(T_IF) else None))
+
+            elif t0 == T_IMPLY:
+                target = tokens.get_next()
+
+                stmt.referenced_syms.add(target)
+                stmt.implied_syms.add(target)
+
+                new_implies.append(
+                    (target,
+                     self._parse_expr(tokens, stmt, line, filename, linenr)
+                     if tokens.check(T_IF) else None))
 
             elif t0 in (T_BOOL, T_TRISTATE, T_INT, T_HEX, T_STRING):
                 stmt.type = TOKEN_TO_TYPE[t0]
@@ -939,12 +954,10 @@ class Config(object):
                 stmt.referenced_syms.add(low)
                 stmt.referenced_syms.add(high)
 
-                if tokens.check(T_IF):
-                    stmt.ranges.append((low, high,
-                                        self._parse_expr(tokens, stmt, line,
-                                                         filename, linenr)))
-                else:
-                    stmt.ranges.append((low, high, None))
+                stmt.ranges.append(
+                    (low, high,
+                     self._parse_expr(tokens, stmt, line, filename, linenr)
+                     if tokens.check(T_IF) else None))
 
             elif t0 == T_DEF_TRISTATE:
                 stmt.type = TRISTATE
@@ -1051,21 +1064,20 @@ class Config(object):
             # Symbol or Choice
 
             # See comment for 'menu_dep'
-            stmt.menu_dep = depends_on_expr
+            stmt.menu_dep = _make_and(deps, depends_on_expr)
 
             # Propagate dependencies to prompts
 
             if new_prompt is not None:
-                # Propagate 'visible if' dependencies from enclosing menus
                 prompt, cond_expr = new_prompt
-                cond_expr = _make_and(cond_expr, visible_if_deps)
-                # Propagate 'depends on' dependencies
-                new_prompt = (prompt, _make_and(cond_expr, depends_on_expr))
+                # Propagate 'visible if' dependencies from menus and local
+                # 'depends on' dependencies
+                cond_expr = _make_and(_make_and(cond_expr, visible_if_deps),
+                                      depends_on_expr)
                 # Save original
-                stmt.orig_prompts.append(new_prompt)
+                stmt.orig_prompts.append((prompt, cond_expr))
                 # Finalize with dependencies from enclosing menus and ifs
-                stmt.prompts.append((new_prompt[0],
-                                     _make_and(new_prompt[1], deps)))
+                stmt.prompts.append((prompt, _make_and(cond_expr, deps)))
 
             # Propagate dependencies to defaults
 
@@ -1078,20 +1090,27 @@ class Config(object):
             stmt.def_exprs.extend([(val_expr, _make_and(cond_expr, deps))
                                    for val_expr, cond_expr in new_def_exprs])
 
-            # Propagate dependencies to selects
+            # Propagate dependencies to selects and implies
 
-            # Only symbols can select
+            # Only symbols can select and imply
             if isinstance(stmt, Symbol):
                 # Propagate 'depends on' dependencies
                 new_selects = [(target, _make_and(cond_expr, depends_on_expr))
                                for target, cond_expr in new_selects]
+                new_implies = [(target, _make_and(cond_expr, depends_on_expr))
+                               for target, cond_expr in new_implies]
                 # Save original
                 stmt.orig_selects.extend(new_selects)
+                stmt.orig_implies.extend(new_implies)
                 # Finalize with dependencies from enclosing menus and ifs
                 for target, cond in new_selects:
-                    target.rev_dep = _make_or(target.rev_dep,
-                                              _make_and(stmt,
-                                                        _make_and(cond, deps)))
+                    target.rev_dep = \
+                        _make_or(target.rev_dep,
+                                 _make_and(stmt, _make_and(cond, deps)))
+                for target, cond in new_implies:
+                    target.weak_rev_dep = \
+                        _make_or(target.weak_rev_dep,
+                                 _make_and(stmt, _make_and(cond, deps)))
 
     def _parse_expr(self, feed, cur_item, line, filename=None, linenr=None,
                     transform_m=True):
@@ -1483,7 +1502,8 @@ class Config(object):
 
         # The directly dependent symbols of a symbol are:
         #  - Any symbols whose prompts, default values, rev_dep (select
-        #    condition), or ranges depend on the symbol
+        #    condition), weak_rev_dep (imply condition) or ranges depend on the
+        #    symbol
         #  - Any symbols that belong to the same choice statement as the symbol
         #    (these won't be included in 'dep' as that makes the dependency
         #    graph unwieldy, but Symbol._get_dependent() will include them)
@@ -1497,6 +1517,7 @@ class Config(object):
                 add_expr_deps(e, sym)
 
             add_expr_deps(sym.rev_dep, sym)
+            add_expr_deps(sym.weak_rev_dep, sym)
 
             for l, u, e in sym.ranges:
                 add_expr_deps(l, sym)
@@ -1625,20 +1646,16 @@ class Config(object):
         else:
             prompts_str_rows = []
             for prompt, cond_expr in sc.orig_prompts:
-                if cond_expr is None:
-                    prompts_str_rows.append(' "{0}"'.format(prompt))
-                else:
-                    prompts_str_rows.append(
-                      ' "{0}" if {1}'.format(prompt,
-                                             self._expr_val_str(cond_expr)))
+                prompts_str_rows.append(
+                    ' "{0}"'.format(prompt) if cond_expr is None else
+                    ' "{0}" if {1}'.format(prompt,
+                                           self._expr_val_str(cond_expr)))
             prompts_str = "\n".join(prompts_str_rows)
 
         # Build locations string
-        if not sc.def_locations:
-            locations_str = "(no locations)"
-        else:
-            locations_str = " ".join(["{0}:{1}".format(filename, linenr) for
-                                      (filename, linenr) in sc.def_locations])
+        locations_str = "(no locations)" if not sc.def_locations else \
+                        " ".join(["{0}:{1}".format(filename, linenr) for
+                                  filename, linenr in sc.def_locations])
 
         # Build additional-dependencies-from-menus-and-ifs string
         additional_deps_str = " " + \
@@ -1657,13 +1674,11 @@ class Config(object):
                 else:
                     ranges_str_rows = []
                     for l, u, cond_expr in sc.ranges:
-                        if cond_expr is None:
-                            ranges_str_rows.append(" [{0}, {1}]".format(s(l),
-                                                                        s(u)))
-                        else:
-                            ranges_str_rows.append(" [{0}, {1}] if {2}"
-                              .format(s(l), s(u),
-                                      self._expr_val_str(cond_expr)))
+                        ranges_str_rows.append(
+                            " [{0}, {1}]".format(s(l), s(u))
+                            if cond_expr is None else
+                            " [{0}, {1}] if {2}"
+                            .format(s(l), s(u), self._expr_val_str(cond_expr)))
                     ranges_str = "\n".join(ranges_str_rows)
 
             # Build default values string
@@ -1685,14 +1700,24 @@ class Config(object):
             else:
                 selects_str_rows = []
                 for target, cond_expr in sc.orig_selects:
-                    if cond_expr is None:
-                        selects_str_rows.append(" {0}".format(target.name))
-                    else:
-                        selects_str_rows.append(
-                          " {0} if {1}".format(target.name,
-                                               self._expr_val_str(cond_expr)))
+                    selects_str_rows.append(
+                        " {0}".format(target.name) if cond_expr is None else
+                        " {0} if {1}".format(target.name,
+                                             self._expr_val_str(cond_expr)))
                 selects_str = "\n".join(selects_str_rows)
 
+            # Build implies string
+            if not sc.orig_implies:
+                implies_str = " (no implies)"
+            else:
+                implies_str_rows = []
+                for target, cond_expr in sc.orig_implies:
+                    implies_str_rows.append(
+                        " {0}".format(target.name) if cond_expr is None else
+                        " {0} if {1}".format(target.name,
+                                             self._expr_val_str(cond_expr)))
+                implies_str = "\n".join(implies_str_rows)
+
             res = _lines("Symbol " +
                            ("(no name)" if sc.name is None else sc.name),
                          "Type           : " + TYPENAME[sc.type],
@@ -1711,9 +1736,16 @@ class Config(object):
                           defaults_str,
                           "Selects:",
                           selects_str,
+                          "Implies:",
+                          implies_str,
                           "Reverse (select-related) dependencies:",
-                          " (no reverse dependencies)" if sc.rev_dep == "n"
-                            else " " + self._expr_val_str(sc.rev_dep),
+                          " (no reverse dependencies)"
+                          if sc.rev_dep == "n"
+                          else " " + self._expr_val_str(sc.rev_dep),
+                          "Weak reverse (imply-related) dependencies:",
+                          " (no weak reverse dependencies)"
+                          if sc.weak_rev_dep == "n"
+                          else " " + self._expr_val_str(sc.weak_rev_dep),
                           "Additional dependencies from enclosing menus "
                             "and ifs:",
                           additional_deps_str,
@@ -1735,11 +1767,10 @@ class Config(object):
         else:
             defaults_str_rows = []
             for sym, cond_expr in sc.orig_def_exprs:
-                if cond_expr is None:
-                    defaults_str_rows.append(" {0}".format(sym.name))
-                else:
-                    defaults_str_rows.append(" {0} if {1}".format(sym.name,
-                                                self._expr_val_str(cond_expr)))
+                defaults_str_rows.append(
+                    " {0}".format(sym.name) if cond_expr is None else
+                    " {0} if {1}".format(sym.name,
+                                         self._expr_val_str(cond_expr)))
             defaults_str = "\n".join(defaults_str_rows)
 
         # Build contained symbols string
@@ -1919,26 +1950,25 @@ class Symbol(Item):
                     self.write_to_conf = (mode != "n")
 
                     if mode == "y":
-                        if choice.get_selection() is self:
-                            new_val = "y"
-                        else:
-                            new_val = "n"
+                        new_val = "y" if choice.get_selection() is self \
+                                  else "n"
                     elif mode == "m":
                         if self.user_val == "m" or self.user_val == "y":
                             new_val = "m"
 
             else:
                 # If the symbol is visible and has a user value, use that.
-                # Otherwise, look at defaults.
-                use_defaults = True
+                # Otherwise, look at defaults and weak reverse dependencies
+                # (implies).
+                use_defaults_and_weak_rev_deps = True
 
                 if vis != "n":
                     self.write_to_conf = True
                     if self.user_val is not None:
                         new_val = self.config._eval_min(self.user_val, vis)
-                        use_defaults = False
+                        use_defaults_and_weak_rev_deps = False
 
-                if use_defaults:
+                if use_defaults_and_weak_rev_deps:
                     for val_expr, cond_expr in self.def_exprs:
                         cond_eval = self.config._eval_expr(cond_expr)
                         if cond_eval != "n":
@@ -1947,14 +1977,25 @@ class Symbol(Item):
                                                             cond_eval)
                             break
 
+                    weak_rev_dep_val = \
+                        self.config._eval_expr(self.weak_rev_dep)
+                    if weak_rev_dep_val != "n":
+                        self.write_to_conf = True
+                        new_val = self.config._eval_max(new_val,
+                                                        weak_rev_dep_val)
+
                 # Reverse (select-related) dependencies take precedence
                 rev_dep_val = self.config._eval_expr(self.rev_dep)
                 if rev_dep_val != "n":
                     self.write_to_conf = True
                     new_val = self.config._eval_max(new_val, rev_dep_val)
 
-            # Promote "m" to "y" for booleans
-            if new_val == "m" and self.type == BOOL:
+            # We need to promote "m" to "y" in two circumstances:
+            #  1) If our type is boolean
+            #  2) If our weak_rev_dep (from IMPLY) is "y"
+            if new_val == "m" and \
+               (self.type == BOOL or
+                self.config._eval_expr(self.weak_rev_dep) == "y"):
                 new_val = "y"
 
         elif self.type == INT or self.type == HEX:
@@ -2189,6 +2230,13 @@ class Symbol(Item):
         get_referenced_symbols()."""
         return self.selected_syms
 
+    def get_implied_symbols(self):
+        """Returns the set() of all symbols X for which this symbol has an
+        'imply X' or 'imply X if Y' (regardless of whether Y is satisfied or
+        not). This is a subset of the symbols returned by
+        get_referenced_symbols()."""
+        return self.implied_syms
+
     def set_user_value(self, v):
         """Sets the user value of the symbol.
 
@@ -2304,16 +2352,18 @@ class Symbol(Item):
         self.ranges = [] # 'range' properties (for int and hex)
         self.help = None # Help text
         self.rev_dep = "n" # Reverse (select-related) dependencies
+        self.weak_rev_dep = "n" # Weak reverse (imply-related) dependencies
         self.config = None
         self.parent = None
 
         self.user_val = None # Value set by user
 
-        # The prompt, default value and select conditions without any
+        # The prompt, default value, select, and imply conditions without any
         # dependencies from menus and ifs propagated to them
         self.orig_prompts = []
         self.orig_def_exprs = []
         self.orig_selects = []
+        self.orig_implies = []
 
         # Dependencies inherited from containing menus and ifs
         self.deps_from_containing = None
@@ -2323,13 +2373,15 @@ class Symbol(Item):
         # The set of symbols selected by this symbol (see
         # get_selected_symbols())
         self.selected_syms = set()
+        # The set of symbols implied by this symbol (see get_implied_symbols())
+        self.implied_syms = set()
         # Like 'referenced_syms', but includes symbols from
         # dependencies inherited from enclosing menus and ifs
         self.all_referenced_syms = set()
 
-        # This records only dependencies specified with 'depends on'. Needed
-        # when determining actual choice items (hrrrr...). See also
-        # Choice._determine_actual_symbols().
+        # This records only dependencies from enclosing ifs and menus together
+        # with local 'depends on' dependencies. Needed when determining actual
+        # choice items (hrrrr...). See Choice._determine_actual_symbols().
         self.menu_dep = None
 
         # See Symbol.get_ref/def_locations().
@@ -2470,18 +2522,17 @@ class Symbol(Item):
             return
 
         if self.type == BOOL or self.type == TRISTATE:
-            if val == "y" or val == "m":
-                append_fn("CONFIG_{0}={1}".format(self.name, val))
-            else:
-                append_fn("# CONFIG_{0} is not set".format(self.name))
+            append_fn("{0}{1}={2}".format(self.config.config_prefix, self.name, val)
+                      if val == "y" or val == "m" else
+                      "# {0}{1} is not set".format(self.config.config_prefix, self.name))
 
         elif self.type == INT or self.type == HEX:
-            append_fn("CONFIG_{0}={1}".format(self.name, val))
+            append_fn("{0}{1}={2}".format(self.config.config_prefix, self.name, val))
 
         elif self.type == STRING:
             # Escape \ and "
-            append_fn('CONFIG_{0}="{1}"'
-                      .format(self.name,
+            append_fn('{0}{1}="{2}"'
+                      .format(self.config.config_prefix, self.name,
                               val.replace("\\", "\\\\").replace('"', '\\"')))
 
         else:
@@ -2635,7 +2686,7 @@ class Menu(Item):
         self.title = None
         self.dep_expr = None
         self.visible_if_expr = None
-        self.block = None
+        self.block = [] # List of contained items
         self.config = None
         self.parent = None
 
@@ -2852,7 +2903,7 @@ class Choice(Item):
         self.prompts = []
         self.def_exprs = [] # 'default' properties
         self.help = None # Help text
-        self.block = None # List of contained items
+        self.block = [] # List of contained items
         self.config = None
         self.parent = None
 
@@ -3177,7 +3228,13 @@ def _get_visibility(sc):
             vis = sc.config._eval_max(vis, cond_expr)
 
         if isinstance(sc, Symbol) and sc.is_choice_sym:
-            vis = sc.config._eval_min(vis, _get_visibility(sc.parent))
+            if sc.type == TRISTATE and vis == "m" and \
+               sc.parent.get_mode() == "y":
+                # Choice symbols with visibility "m" are not visible if the
+                # choice has mode "y"
+                vis = "n"
+            else:
+                vis = sc.config._eval_min(vis, _get_visibility(sc.parent))
 
         # Promote "m" to "y" if we're dealing with a non-tristate
         if vis == "m" and sc.type != TRISTATE:
@@ -3434,7 +3491,7 @@ _get_keyword = \
    "prompt": T_PROMPT, "default": T_DEFAULT, "bool": T_BOOL, "boolean": T_BOOL,
    "tristate": T_TRISTATE, "int": T_INT, "hex": T_HEX, "def_bool": T_DEF_BOOL,
    "def_tristate": T_DEF_TRISTATE, "string": T_STRING, "select": T_SELECT,
-   "imply": T_IMPLY, "range": T_RANGE, "option": T_OPTION,
+   "imply" : T_IMPLY, "range": T_RANGE, "option": T_OPTION,
    "allnoconfig_y": T_ALLNOCONFIG_Y, "env": T_ENV,
    "defconfig_list": T_DEFCONFIG_LIST, "modules": T_MODULES,
    "visible": T_VISIBLE}.get
@@ -3455,10 +3512,6 @@ _initial_token_re_match = re.compile(r"[^\w]*(\w+)\s*").match
 # trailing whitespace as an optimization.
 _id_keyword_re_match = re.compile(r"\s*([\w./-]+)\s*").match
 
-# Regular expressions for parsing .config files
-_set_re_match = re.compile(r"CONFIG_(\w+)=(.*)").match
-_unset_re_match = re.compile(r"# CONFIG_(\w+) is not set").match
-
 # Regular expression for finding $-references to symbols in strings
 _sym_ref_re_search = re.compile(r"\$[A-Za-z0-9_]+").search
 
index 4dc8bd8862454598d1bf5383b259707a06cfccba..30257b178e274b0024c2a775d03dc9e6d5ba9fa1 100644 (file)
@@ -372,7 +372,7 @@ static int fit_build(struct image_tool_params *params, const char *fname)
        if (fd < 0) {
                fprintf(stderr, "%s: Can't open %s: %s\n",
                        params->cmdname, fname, strerror(errno));
-               goto err;
+               goto err_buf;
        }
        ret = write(fd, buf, size);
        if (ret != size) {
@@ -501,6 +501,7 @@ static int fit_extract_data(struct image_tool_params *params, const char *fname)
                ret = -EIO;
                goto err;
        }
+       free(buf);
        close(fd);
        return 0;
 
@@ -536,21 +537,21 @@ static int fit_import_data(struct image_tool_params *params, const char *fname)
                fprintf(stderr, "%s: Failed to allocate memory (%d bytes)\n",
                        __func__, size);
                ret = -ENOMEM;
-               goto err;
+               goto err_has_fd;
        }
        ret = fdt_open_into(old_fdt, fdt, size);
        if (ret) {
                debug("%s: Failed to expand FIT: %s\n", __func__,
                      fdt_strerror(errno));
                ret = -EINVAL;
-               goto err;
+               goto err_has_fd;
        }
 
        images = fdt_path_offset(fdt, FIT_IMAGES_PATH);
        if (images < 0) {
                debug("%s: Cannot find /images node: %d\n", __func__, images);
                ret = -EINVAL;
-               goto err;
+               goto err_has_fd;
        }
 
        for (node = fdt_first_subnode(fdt, images);
@@ -571,11 +572,11 @@ static int fit_import_data(struct image_tool_params *params, const char *fname)
                        debug("%s: Failed to write property: %s\n", __func__,
                              fdt_strerror(ret));
                        ret = -EINVAL;
-                       goto err;
+                       goto err_has_fd;
                }
        }
 
-       munmap(old_fdt, sbuf.st_size);
+       /* Close the old fd so we can re-use it. */
        close(fd);
 
        /* Pack the FDT and place the data after it */
@@ -588,21 +589,23 @@ static int fit_import_data(struct image_tool_params *params, const char *fname)
        if (fd < 0) {
                fprintf(stderr, "%s: Can't open %s: %s\n",
                        params->cmdname, fname, strerror(errno));
-               free(fdt);
-               return -EIO;
+               ret = -EIO;
+               goto err_no_fd;
        }
        if (write(fd, fdt, new_size) != new_size) {
                debug("%s: Failed to write external data to file %s\n",
                      __func__, strerror(errno));
                ret = -EIO;
-               goto err;
+               goto err_has_fd;
        }
 
        ret = 0;
 
-err:
-       free(fdt);
+err_has_fd:
        close(fd);
+err_no_fd:
+       munmap(old_fdt, sbuf.st_size);
+       free(fdt);
        return ret;
 }
 
index 6f549a51c16d0c2d81c3effbd8f62f8d255f45a5..e3116461bad0ec577b5081ff332077c5babdefe6 100755 (executable)
@@ -1472,7 +1472,7 @@ def find_kconfig_rules(kconf, config, imply_config):
     """
     sym = kconf.get_symbol(imply_config)
     if sym:
-        for sel in sym.get_selected_symbols():
+        for sel in sym.get_selected_symbols() | sym.get_implied_symbols():
             if sel.get_name() == config:
                 return sym
     return None
index 04e8272fd5b63b870186bd73a31e4256ee38352f..1a24e165894c45435daef9f4404b9ea7280b843f 100644 (file)
@@ -73,6 +73,7 @@ struct spl_info {
 
 static struct spl_info spl_infos[] = {
        { "rk3036", "RK30", 0x1000, false, false },
+       { "rk3128", "RK31", 0x1800, false, false },
        { "rk3188", "RK31", 0x8000 - 0x800, true, false },
        { "rk322x", "RK32", 0x8000 - 0x1000, false, false },
        { "rk3288", "RK32", 0x8000, false, false },