Merge tag 'u-boot-imx-20191105' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
authorTom Rini <trini@konsulko.com>
Tue, 12 Nov 2019 12:18:23 +0000 (07:18 -0500)
committerTom Rini <trini@konsulko.com>
Tue, 12 Nov 2019 12:18:23 +0000 (07:18 -0500)
u-boot-imx-20191105
-------------------
i.MX8MN SoC support
ROM API image download support
i.MX8MM enet enabling

730 files changed:
.azure-pipelines.yml
.gitattributes
.gitignore
.gitlab-ci.yml
.travis.yml
Kconfig
MAINTAINERS
Makefile
api/api.c
api/api_private.h
api/api_storage.c
arch/arm/Kconfig
arch/arm/cpu/armv7/ls102xa/Kconfig
arch/arm/cpu/armv8/fsl-layerscape/Kconfig
arch/arm/cpu/armv8/fsl-layerscape/Makefile
arch/arm/cpu/armv8/fsl-layerscape/cpu.c
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c
arch/arm/cpu/armv8/fsl-layerscape/ls1028_ids.c
arch/arm/cpu/armv8/fsl-layerscape/ls1088_ids.c
arch/arm/cpu/armv8/fsl-layerscape/ls2088_ids.c [new file with mode: 0644]
arch/arm/cpu/armv8/fsl-layerscape/lx2160_ids.c [new file with mode: 0644]
arch/arm/cpu/armv8/fsl-layerscape/soc.c
arch/arm/cpu/armv8/fsl-layerscape/spl.c
arch/arm/dts/Makefile
arch/arm/dts/fsl-ls1088a.dtsi
arch/arm/dts/k3-am654-r5-base-board.dts
arch/arm/dts/k3-j721e-mcu-wakeup.dtsi
arch/arm/dts/k3-j721e-r5-common-proc-board.dts
arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi
arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi
arch/arm/dts/phytium-durian.dts [new file with mode: 0644]
arch/arm/dts/rk3328-rock64-u-boot.dtsi
arch/arm/dts/rk3399-leez-p710-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3399-leez-p710.dts [new file with mode: 0644]
arch/arm/include/asm/arch-fsl-layerscape/fsl_icid.h
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
arch/arm/include/asm/arch-fsl-layerscape/stream_id_lsch3.h
arch/arm/include/asm/arch-rockchip/cru_rk3328.h
arch/arm/include/asm/io.h
arch/arm/lib/cache-cp15.c
arch/arm/mach-k3/am6_init.c
arch/arm/mach-k3/j721e_init.c
arch/arm/mach-rockchip/make_fit_atf.py
arch/arm/mach-rockchip/rk3188/rk3188.c
arch/arm/mach-rockchip/rk322x/rk322x.c
arch/arm/mach-rockchip/rk3288/Kconfig
arch/arm/mach-rockchip/rk3288/rk3288.c
arch/arm/mach-rockchip/rk3328/rk3328.c
arch/arm/mach-rockchip/rk3368/rk3368.c
arch/arm/mach-rockchip/rk3399/Kconfig
arch/arm/mach-socfpga/Kconfig
arch/powerpc/cpu/mpc85xx/Kconfig
arch/powerpc/cpu/mpc85xx/cpu_init.c
arch/powerpc/cpu/mpc85xx/start.S
arch/powerpc/cpu/mpc8xxx/law.c
arch/powerpc/dts/Makefile
arch/powerpc/dts/socrates-u-boot.dtsi [new file with mode: 0644]
arch/powerpc/dts/socrates.dts [new file with mode: 0644]
arch/powerpc/include/asm/fsl_secure_boot.h
board/freescale/common/Kconfig
board/freescale/common/Makefile
board/freescale/common/p_corenet/tlb.c
board/freescale/ls1043ardb/ls1043ardb.c
board/freescale/ls1046afrwy/ls1046afrwy.c
board/freescale/ls1046aqds/ls1046aqds.c
board/freescale/ls1046ardb/ls1046ardb.c
board/freescale/ls2080aqds/ls2080aqds.c
board/freescale/ls2080ardb/ls2080ardb.c
board/freescale/lx2160a/lx2160a.c
board/freescale/t104xrdb/tlb.c
board/logicpd/omap3som/omap3logic.c
board/phytium/durian/Kconfig [new file with mode: 0644]
board/phytium/durian/MAINTAINERS [new file with mode: 0644]
board/phytium/durian/Makefile [new file with mode: 0644]
board/phytium/durian/README [new file with mode: 0644]
board/phytium/durian/cpu.h [new file with mode: 0644]
board/phytium/durian/durian.c [new file with mode: 0644]
board/rockchip/evb_rk3399/MAINTAINERS
board/socrates/MAINTAINERS
board/socrates/law.c
board/socrates/socrates.c
board/ti/common/Kconfig
cmd/Kconfig
cmd/dfu.c
cmd/mtdparts.c
cmd/nand.c
cmd/thordown.c
common/cli_hush.c
common/console.c
common/dlmalloc.c
common/spl/Kconfig
common/spl/spl_atf.c
common/usb_storage.c
configs/B4860QDS_SECURE_BOOT_defconfig
configs/BSC9132QDS_NAND_DDRCLK100_SECURE_defconfig
configs/BSC9132QDS_NAND_DDRCLK133_SECURE_defconfig
configs/BSC9132QDS_NOR_DDRCLK100_SECURE_defconfig
configs/BSC9132QDS_NOR_DDRCLK133_SECURE_defconfig
configs/BSC9132QDS_SDCARD_DDRCLK100_SECURE_defconfig
configs/BSC9132QDS_SDCARD_DDRCLK133_SECURE_defconfig
configs/BSC9132QDS_SPIFLASH_DDRCLK100_SECURE_defconfig
configs/BSC9132QDS_SPIFLASH_DDRCLK133_SECURE_defconfig
configs/C29XPCIE_NOR_SECBOOT_defconfig
configs/C29XPCIE_SPIFLASH_SECBOOT_defconfig
configs/P1010RDB-PA_36BIT_NAND_SECBOOT_defconfig
configs/P1010RDB-PA_36BIT_NOR_SECBOOT_defconfig
configs/P1010RDB-PA_36BIT_SPIFLASH_SECBOOT_defconfig
configs/P1010RDB-PA_NAND_SECBOOT_defconfig
configs/P1010RDB-PA_NOR_SECBOOT_defconfig
configs/P1010RDB-PA_SPIFLASH_SECBOOT_defconfig
configs/P1010RDB-PB_36BIT_NAND_SECBOOT_defconfig
configs/P1010RDB-PB_36BIT_NOR_SECBOOT_defconfig
configs/P1010RDB-PB_36BIT_SPIFLASH_SECBOOT_defconfig
configs/P1010RDB-PB_NAND_SECBOOT_defconfig
configs/P1010RDB-PB_NOR_SECBOOT_defconfig
configs/P1010RDB-PB_SPIFLASH_SECBOOT_defconfig
configs/P2041RDB_SECURE_BOOT_defconfig
configs/P3041DS_NAND_SECURE_BOOT_defconfig
configs/P3041DS_SECURE_BOOT_defconfig
configs/P4080DS_SECURE_BOOT_defconfig
configs/P5020DS_NAND_SECURE_BOOT_defconfig
configs/P5020DS_SECURE_BOOT_defconfig
configs/P5040DS_NAND_SECURE_BOOT_defconfig
configs/P5040DS_SECURE_BOOT_defconfig
configs/SBx81LIFKW_defconfig
configs/SBx81LIFXCAT_defconfig
configs/T1023RDB_SECURE_BOOT_defconfig
configs/T1024QDS_DDR4_SECURE_BOOT_defconfig
configs/T1024QDS_SECURE_BOOT_defconfig
configs/T1024RDB_SECURE_BOOT_defconfig
configs/T1040D4RDB_SECURE_BOOT_defconfig
configs/T1040QDS_SECURE_BOOT_defconfig
configs/T1040RDB_SECURE_BOOT_defconfig
configs/T1042D4RDB_SECURE_BOOT_defconfig
configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig
configs/T1042RDB_SECURE_BOOT_defconfig
configs/T2080QDS_SECURE_BOOT_defconfig
configs/T2080RDB_SECURE_BOOT_defconfig
configs/T4160QDS_SECURE_BOOT_defconfig
configs/T4240QDS_SECURE_BOOT_defconfig
configs/adp-ae3xx_defconfig
configs/ae350_rv32_defconfig
configs/ae350_rv32_xip_defconfig
configs/ae350_rv64_defconfig
configs/ae350_rv64_xip_defconfig
configs/alt_defconfig
configs/am335x_boneblack_vboot_defconfig
configs/am335x_evm_defconfig
configs/am335x_guardian_defconfig
configs/am335x_hs_evm_defconfig
configs/am335x_hs_evm_uart_defconfig
configs/am43xx_evm_defconfig
configs/am43xx_evm_qspiboot_defconfig
configs/am43xx_evm_rtconly_defconfig
configs/am43xx_evm_usbhost_boot_defconfig
configs/am43xx_hs_evm_defconfig
configs/am57xx_evm_defconfig
configs/am57xx_hs_evm_defconfig
configs/am57xx_hs_evm_usb_defconfig
configs/am65x_evm_a53_defconfig
configs/am65x_evm_r5_defconfig
configs/am65x_hs_evm_a53_defconfig
configs/am65x_hs_evm_r5_defconfig
configs/ap121_defconfig
configs/ap143_defconfig
configs/ap152_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/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/avnet_ultra96_rev1_defconfig
configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
configs/axm_defconfig
configs/axs101_defconfig
configs/axs103_defconfig
configs/bcm7445_defconfig
configs/bcm963158_ram_defconfig
configs/bcm968580xref_ram_defconfig
configs/beaver_defconfig
configs/bk4r1_defconfig
configs/brppt1_spi_defconfig
configs/brppt2_defconfig
configs/brsmarc1_defconfig
configs/cardhu_defconfig
configs/cei-tk1-som_defconfig
configs/chromebit_mickey_defconfig
configs/chromebook_bob_defconfig
configs/chromebook_jerry_defconfig
configs/chromebook_minnie_defconfig
configs/chromebook_speedy_defconfig
configs/clearfog_defconfig
configs/clearfog_gt_8k_defconfig
configs/cm_t43_defconfig
configs/colibri_imx7_defconfig
configs/colibri_imx7_emmc_defconfig
configs/comtrend_ar5315u_ram_defconfig
configs/comtrend_ar5387un_ram_defconfig
configs/controlcenterdc_defconfig
configs/crs305-1g-4s_defconfig
configs/da850evm_defconfig
configs/da850evm_direct_nor_defconfig
configs/da850evm_nand_defconfig
configs/dalmore_defconfig
configs/db-88f6281-bp-spi_defconfig
configs/db-88f6720_defconfig
configs/db-88f6820-amc_defconfig
configs/db-88f6820-gp_defconfig
configs/db-mv784mp-gp_defconfig
configs/db-xc3-24g4xg_defconfig
configs/dh_imx6_defconfig
configs/display5_defconfig
configs/display5_factory_defconfig
configs/dra7xx_evm_defconfig
configs/dra7xx_hs_evm_defconfig
configs/dra7xx_hs_evm_usb_defconfig
configs/dreamplug_defconfig
configs/ds109_defconfig
configs/ds414_defconfig
configs/durian_defconfig [new file with mode: 0644]
configs/e2220-1170_defconfig
configs/edison_defconfig
configs/ethernut5_defconfig
configs/evb-px5_defconfig
configs/evb-rk3036_defconfig
configs/evb-rk3128_defconfig
configs/evb-rk3229_defconfig
configs/evb-rk3288_defconfig
configs/evb-rk3328_defconfig
configs/evb-rk3399_defconfig
configs/evb-rv1108_defconfig
configs/ficus-rk3399_defconfig
configs/firefly-rk3288_defconfig
configs/firefly-rk3399_defconfig
configs/gardena-smart-gateway-mt7688-ram_defconfig
configs/gardena-smart-gateway-mt7688_defconfig
configs/ge_bx50v3_defconfig
configs/grpeach_defconfig
configs/gwventana_emmc_defconfig
configs/gwventana_gw5904_defconfig
configs/gwventana_nand_defconfig
configs/helios4_defconfig
configs/hsdk_defconfig
configs/imx6dl_mamoj_defconfig
configs/imx6qdl_icore_mmc_defconfig
configs/imx8mq_evk_defconfig
configs/imx8qm_mek_defconfig
configs/imx8qm_rom7720_a1_4G_defconfig
configs/imx8qxp_mek_defconfig
configs/j721e_evm_a72_defconfig
configs/j721e_evm_r5_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/k2l_hs_evm_defconfig
configs/khadas-edge-captain-rk3399_defconfig
configs/khadas-edge-rk3399_defconfig
configs/khadas-edge-v-rk3399_defconfig
configs/km_kirkwood_128m16_defconfig
configs/km_kirkwood_defconfig
configs/km_kirkwood_pci_defconfig
configs/kmcoge5un_defconfig
configs/kmnusa_defconfig
configs/kmsugp1_defconfig
configs/kmsuv31_defconfig
configs/kylin-rk3036_defconfig
configs/leez-rk3399_defconfig [new file with mode: 0644]
configs/legoev3_defconfig
configs/libretech-ac_defconfig
configs/linkit-smart-7688-ram_defconfig
configs/linkit-smart-7688_defconfig
configs/lion-rk3368_defconfig
configs/ls1012a2g5rdb_qspi_defconfig
configs/ls1012a2g5rdb_tfa_defconfig
configs/ls1012afrdm_qspi_defconfig
configs/ls1012afrdm_tfa_defconfig
configs/ls1012afrwy_qspi_SECURE_BOOT_defconfig
configs/ls1012afrwy_qspi_defconfig
configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig
configs/ls1012afrwy_tfa_defconfig
configs/ls1012aqds_qspi_defconfig
configs/ls1012aqds_tfa_SECURE_BOOT_defconfig
configs/ls1012aqds_tfa_defconfig
configs/ls1012ardb_qspi_SECURE_BOOT_defconfig
configs/ls1012ardb_qspi_defconfig
configs/ls1012ardb_tfa_SECURE_BOOT_defconfig
configs/ls1012ardb_tfa_defconfig
configs/ls1021aqds_nor_SECURE_BOOT_defconfig
configs/ls1021atsn_qspi_defconfig
configs/ls1021atsn_sdcard_defconfig
configs/ls1021atwr_nor_SECURE_BOOT_defconfig
configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
configs/ls1028aqds_tfa_SECURE_BOOT_defconfig
configs/ls1028aqds_tfa_defconfig
configs/ls1028ardb_tfa_SECURE_BOOT_defconfig
configs/ls1028ardb_tfa_defconfig
configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
configs/ls1043ardb_SECURE_BOOT_defconfig
configs/ls1043ardb_nand_SECURE_BOOT_defconfig
configs/ls1043ardb_sdcard_SECURE_BOOT_defconfig
configs/ls1043ardb_tfa_SECURE_BOOT_defconfig
configs/ls1046afrwy_tfa_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/ls1046aqds_tfa_SECURE_BOOT_defconfig
configs/ls1046aqds_tfa_defconfig
configs/ls1046ardb_emmc_defconfig
configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
configs/ls1046ardb_qspi_defconfig
configs/ls1046ardb_qspi_spl_defconfig
configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig
configs/ls1046ardb_sdcard_defconfig
configs/ls1046ardb_tfa_SECURE_BOOT_defconfig
configs/ls1046ardb_tfa_defconfig
configs/ls1088aqds_qspi_SECURE_BOOT_defconfig
configs/ls1088aqds_qspi_defconfig
configs/ls1088aqds_sdcard_qspi_defconfig
configs/ls1088aqds_tfa_defconfig
configs/ls1088ardb_qspi_SECURE_BOOT_defconfig
configs/ls1088ardb_qspi_defconfig
configs/ls1088ardb_sdcard_qspi_SECURE_BOOT_defconfig
configs/ls1088ardb_sdcard_qspi_defconfig
configs/ls1088ardb_tfa_SECURE_BOOT_defconfig
configs/ls1088ardb_tfa_defconfig
configs/ls2080aqds_SECURE_BOOT_defconfig
configs/ls2080aqds_defconfig
configs/ls2080aqds_nand_defconfig
configs/ls2080aqds_qspi_defconfig
configs/ls2080aqds_sdcard_defconfig
configs/ls2080ardb_SECURE_BOOT_defconfig
configs/ls2080ardb_defconfig
configs/ls2081ardb_defconfig
configs/ls2088aqds_tfa_defconfig
configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
configs/ls2088ardb_qspi_defconfig
configs/ls2088ardb_tfa_SECURE_BOOT_defconfig
configs/ls2088ardb_tfa_defconfig
configs/lschlv2_defconfig
configs/lsxhl_defconfig
configs/lx2160aqds_tfa_SECURE_BOOT_defconfig
configs/lx2160aqds_tfa_defconfig
configs/lx2160ardb_tfa_SECURE_BOOT_defconfig
configs/lx2160ardb_tfa_defconfig
configs/m53menlo_defconfig
configs/maxbcm_defconfig
configs/mccmon6_nor_defconfig
configs/mccmon6_sd_defconfig
configs/meesc_dataflash_defconfig
configs/meesc_defconfig
configs/mgcoge3un_defconfig
configs/miqi-rk3288_defconfig
configs/mscc_jr2_defconfig
configs/mscc_luton_defconfig
configs/mscc_ocelot_defconfig
configs/mscc_serval_defconfig
configs/mscc_servalt_defconfig
configs/mt7629_rfb_defconfig
configs/mvebu_db-88f3720_defconfig
configs/mvebu_db_armada8k_defconfig
configs/mvebu_espressobin-88f3720_defconfig
configs/mvebu_mcbin-88f8040_defconfig
configs/mx6qsabrelite_defconfig
configs/mx6sabreauto_defconfig
configs/mx6sabresd_defconfig
configs/mx6slevk_defconfig
configs/mx6slevk_spinor_defconfig
configs/mx6slevk_spl_defconfig
configs/mx6sxsabreauto_defconfig
configs/mx6sxsabresd_defconfig
configs/mx6ul_14x14_evk_defconfig
configs/mx6ul_9x9_evk_defconfig
configs/mx6ull_14x14_evk_defconfig
configs/mx6ull_14x14_evk_plugin_defconfig
configs/mx6ulz_14x14_evk_defconfig
configs/mx7dsabresd_qspi_defconfig
configs/mx7ulp_evk_plugin_defconfig
configs/nanopc-t4-rk3399_defconfig
configs/nanopi-m4-rk3399_defconfig
configs/nanopi-neo4-rk3399_defconfig
configs/netgear_cg3100d_ram_defconfig
configs/nitrogen6dl2g_defconfig
configs/nitrogen6dl_defconfig
configs/nitrogen6q2g_defconfig
configs/nitrogen6q_defconfig
configs/nitrogen6s1g_defconfig
configs/nitrogen6s_defconfig
configs/nyan-big_defconfig
configs/odroid-xu3_defconfig
configs/omap35_logic_defconfig
configs/omap3_logic_defconfig
configs/omap3_logic_somlv_defconfig
configs/omap5_uevm_defconfig
configs/orangepi-rk3399_defconfig
configs/p2371-0000_defconfig
configs/p2371-2180_defconfig
configs/p2571_defconfig
configs/p2771-0000-000_defconfig
configs/p2771-0000-500_defconfig
configs/pcm052_defconfig
configs/peach-pi_defconfig
configs/peach-pit_defconfig
configs/phycore-rk3288_defconfig
configs/phycore_pcl063_defconfig
configs/pico-dwarf-imx6ul_defconfig
configs/pico-imx6_defconfig
configs/pico-imx7d_bl33_defconfig
configs/pm9261_defconfig
configs/pm9263_defconfig
configs/popmetal-rk3288_defconfig
configs/porter_defconfig
configs/puma-rk3399_defconfig
configs/r8a77970_eagle_defconfig
configs/r8a77980_condor_defconfig
configs/roc-rk3399-pc_defconfig
configs/rock-pi-4-rk3399_defconfig
configs/rock2_defconfig
configs/rock64-rk3328_defconfig
configs/rock960-rk3399_defconfig
configs/rock_defconfig
configs/rockpro64-rk3399_defconfig
configs/sagem_f@st1704_ram_defconfig
configs/sam9x60ek_nandflash_defconfig
configs/sam9x60ek_qspiflash_defconfig
configs/sama5d27_som1_ek_mmc1_defconfig
configs/sama5d27_som1_ek_mmc_defconfig
configs/sama5d27_som1_ek_qspiflash_defconfig
configs/sama5d27_wlsom1_ek_mmc_defconfig
configs/sama5d27_wlsom1_ek_qspiflash_defconfig
configs/sama5d2_xplained_emmc_defconfig
configs/sama5d2_xplained_mmc_defconfig
configs/sama5d2_xplained_qspiflash_defconfig
configs/sama5d2_xplained_spiflash_defconfig
configs/sama5d36ek_cmp_mmc_defconfig
configs/sama5d36ek_cmp_nandflash_defconfig
configs/sama5d36ek_cmp_spiflash_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/sandbox64_defconfig
configs/sandbox_defconfig
configs/sandbox_flattree_defconfig
configs/sandbox_spl_defconfig
configs/sei510_defconfig
configs/silk_defconfig
configs/slimbootloader_defconfig
configs/smdk5250_defconfig
configs/smdk5420_defconfig
configs/snow_defconfig
configs/socfpga_arria5_defconfig
configs/socfpga_cyclone5_defconfig
configs/socfpga_de0_nano_soc_defconfig
configs/socfpga_is1_defconfig
configs/socfpga_mcvevk_defconfig
configs/socfpga_sockit_defconfig
configs/socfpga_socrates_defconfig
configs/socfpga_sr1500_defconfig
configs/socfpga_stratix10_defconfig
configs/socfpga_vining_fpga_defconfig
configs/socrates_defconfig
configs/sopine_baseboard_defconfig
configs/spring_defconfig
configs/stih410-b2260_defconfig
configs/stm32f469-discovery_defconfig
configs/stm32f746-disco_defconfig
configs/stm32f769-disco_defconfig
configs/stm32mp15_basic_defconfig
configs/stm32mp15_optee_defconfig
configs/stm32mp15_trusted_defconfig
configs/stmark2_defconfig
configs/stout_defconfig
configs/stv0991_defconfig
configs/taurus_defconfig
configs/tbs2910_defconfig
configs/tec-ng_defconfig
configs/theadorable_debug_defconfig
configs/tinker-rk3288_defconfig
configs/topic_miami_defconfig
configs/topic_miamilite_defconfig
configs/topic_miamiplus_defconfig
configs/tplink_wdr4300_defconfig
configs/trimslice_defconfig
configs/turris_mox_defconfig
configs/turris_omnia_defconfig
configs/uDPU_defconfig
configs/usb_a9263_dataflash_defconfig
configs/variscite_dart6ul_defconfig
configs/venice2_defconfig
configs/vyasa-rk3288_defconfig
configs/warp7_bl33_defconfig
configs/warp7_defconfig
configs/x530_defconfig
configs/xilinx_versal_virt_defconfig
configs/xilinx_zynqmp_a2197_revA_defconfig
configs/xilinx_zynqmp_e_a2197_00_revA_defconfig
configs/xilinx_zynqmp_g_a2197_00_revA_defconfig
configs/xilinx_zynqmp_m_a2197_01_revA_defconfig
configs/xilinx_zynqmp_m_a2197_02_revA_defconfig
configs/xilinx_zynqmp_m_a2197_03_revA_defconfig
configs/xilinx_zynqmp_mini_qspi_defconfig
configs/xilinx_zynqmp_p_a2197_00_revA_defconfig
configs/xilinx_zynqmp_virt_defconfig
configs/xilinx_zynqmp_zc1232_revA_defconfig
configs/xilinx_zynqmp_zc1254_revA_defconfig
configs/xilinx_zynqmp_zc1751_xm015_dc1_defconfig
configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig
configs/xilinx_zynqmp_zc1751_xm017_dc3_defconfig
configs/xilinx_zynqmp_zc1751_xm018_dc4_defconfig
configs/xilinx_zynqmp_zcu100_revC_defconfig
configs/xilinx_zynqmp_zcu102_rev1_0_defconfig
configs/xilinx_zynqmp_zcu102_revA_defconfig
configs/xilinx_zynqmp_zcu102_revB_defconfig
configs/xilinx_zynqmp_zcu104_revA_defconfig
configs/xilinx_zynqmp_zcu104_revC_defconfig
configs/xilinx_zynqmp_zcu106_revA_defconfig
configs/xilinx_zynqmp_zcu111_revA_defconfig
configs/xilinx_zynqmp_zcu1275_revA_defconfig
configs/xilinx_zynqmp_zcu1275_revB_defconfig
configs/xilinx_zynqmp_zcu216_revA_defconfig
configs/zynq_cc108_defconfig
configs/zynq_cse_qspi_defconfig
configs/zynq_dlc20_rev1_0_defconfig
configs/zynq_microzed_defconfig
configs/zynq_minized_defconfig
configs/zynq_virt_defconfig
configs/zynq_z_turn_defconfig
configs/zynq_zc702_defconfig
configs/zynq_zc706_defconfig
configs/zynq_zc770_xm010_defconfig
configs/zynq_zc770_xm013_defconfig
configs/zynq_zed_defconfig
configs/zynq_zybo_defconfig
configs/zynq_zybo_z7_defconfig
doc/README.dfu [new file with mode: 0644]
doc/README.mpc85xx
doc/device-tree-bindings/regulator/regulator.txt
drivers/clk/clk-ti-sci.c
drivers/clk/rockchip/clk_rk3328.c
drivers/dfu/Kconfig
drivers/dfu/Makefile
drivers/dfu/dfu.c
drivers/dfu/dfu_mmc.c
drivers/dfu/dfu_mtd.c [new file with mode: 0644]
drivers/dfu/dfu_nand.c
drivers/dfu/dfu_sf.c
drivers/dfu/dfu_virt.c [new file with mode: 0644]
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/k3_avs.c [new file with mode: 0644]
drivers/mmc/fsl_esdhc.c
drivers/mmc/fsl_esdhc_imx.c
drivers/net/fsl_enetc.c
drivers/pci/Kconfig
drivers/pci/Makefile
drivers/pci/pci_mpc85xx.c [new file with mode: 0644]
drivers/pci/pcie_layerscape.c
drivers/pci/pcie_phytium.c [new file with mode: 0644]
drivers/power/pmic/Kconfig
drivers/power/pmic/Makefile
drivers/power/pmic/rk8xx.c
drivers/power/pmic/tps65941.c [new file with mode: 0644]
drivers/power/regulator/Kconfig
drivers/power/regulator/Makefile
drivers/power/regulator/regulator-uclass.c
drivers/power/regulator/rk8xx.c
drivers/power/regulator/tps62360_regulator.c [new file with mode: 0644]
drivers/power/regulator/tps65941_regulator.c [new file with mode: 0644]
drivers/ram/rockchip/sdram_rk3328.c
drivers/spi/Kconfig
drivers/usb/Kconfig
drivers/usb/cdns3/Kconfig [new file with mode: 0644]
drivers/usb/cdns3/Makefile [new file with mode: 0644]
drivers/usb/cdns3/cdns3-ti.c [new file with mode: 0644]
drivers/usb/cdns3/core.c [new file with mode: 0644]
drivers/usb/cdns3/core.h [new file with mode: 0644]
drivers/usb/cdns3/debug.h [new file with mode: 0644]
drivers/usb/cdns3/drd.c [new file with mode: 0644]
drivers/usb/cdns3/drd.h [new file with mode: 0644]
drivers/usb/cdns3/ep0.c [new file with mode: 0644]
drivers/usb/cdns3/gadget-export.h [new file with mode: 0644]
drivers/usb/cdns3/gadget.c [new file with mode: 0644]
drivers/usb/cdns3/gadget.h [new file with mode: 0644]
drivers/usb/cdns3/host-export.h [new file with mode: 0644]
drivers/usb/cdns3/host.c [new file with mode: 0644]
drivers/usb/cdns3/trace.c [new file with mode: 0644]
drivers/usb/cdns3/trace.h [new file with mode: 0644]
drivers/usb/dwc3/dwc3-generic.c
drivers/usb/dwc3/gadget.c
drivers/usb/gadget/composite.c
drivers/usb/gadget/epautoconf.c
drivers/usb/gadget/f_thor.c
drivers/usb/gadget/gadget_chips.h
drivers/usb/gadget/udc/udc-core.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/xhci-ring.c
include/configs/P1010RDB.h
include/configs/T104xRDB.h
include/configs/corenet_ds.h
include/configs/durian.h [new file with mode: 0644]
include/configs/ls1021atwr.h
include/configs/ls1028a_common.h
include/configs/ls1043a_common.h
include/configs/ls1046a_common.h
include/configs/ls1088a_common.h
include/configs/ls1088aqds.h
include/configs/ls2080aqds.h
include/configs/rk3328_common.h
include/configs/rk3368_common.h
include/configs/rk3399_common.h
include/configs/socrates.h
include/dfu.h
include/fsl_esdhc.h
include/fsl_sec.h
include/k3-avs.h [new file with mode: 0644]
include/linux/bitmap.h
include/linux/err.h
include/linux/kernel.h
include/linux/libfdt_env.h
include/linux/list.h
include/linux/usb/ch9.h
include/linux/usb/gadget.h
include/power/regulator.h
include/power/rk8xx_pmic.h
include/power/tps65941.h [new file with mode: 0644]
lib/Kconfig
lib/libfdt/Makefile
lib/libfdt/fdt_ro.c
scripts/Makefile.spl
scripts/config_whitelist.txt
scripts/dtc/libfdt/Makefile.libfdt
scripts/dtc/libfdt/fdt.c
scripts/dtc/libfdt/fdt.h
scripts/dtc/libfdt/fdt_addresses.c
scripts/dtc/libfdt/fdt_empty_tree.c
scripts/dtc/libfdt/fdt_overlay.c
scripts/dtc/libfdt/fdt_ro.c
scripts/dtc/libfdt/fdt_rw.c
scripts/dtc/libfdt/fdt_strerror.c
scripts/dtc/libfdt/fdt_sw.c
scripts/dtc/libfdt/fdt_wip.c
scripts/dtc/libfdt/libfdt.h
scripts/dtc/libfdt/libfdt_env.h
scripts/dtc/libfdt/libfdt_internal.h
scripts/dtc/pylibfdt/Makefile
scripts/dtc/pylibfdt/libfdt.i_shipped
scripts/dtc/pylibfdt/setup.py
test/dm/regulator.c
tools/binman/README
tools/binman/binman.py
tools/binman/cbfs_util_test.py
tools/binman/elf.py
tools/binman/elf_test.py
tools/binman/entry.py
tools/binman/entry_test.py
tools/binman/etype/intel_fit.py
tools/binman/etype/section.py
tools/binman/ftest.py
tools/binman/image_test.py
tools/binman/test/155_symbols_tpl_x86.dts [new file with mode: 0644]
tools/binman/test/Makefile
tools/binman/test/u_boot_binman_syms_x86.c [new symlink]
tools/binman/test/u_boot_binman_syms_x86.lds [new file with mode: 0644]
tools/buildman/board.py
tools/buildman/bsettings.py
tools/buildman/builder.py
tools/buildman/builderthread.py
tools/buildman/buildman.py
tools/buildman/control.py
tools/buildman/func_test.py
tools/buildman/test.py
tools/buildman/toolchain.py
tools/dtoc/dtoc.py
tools/dtoc/fdt.py
tools/dtoc/test_dtoc.py [changed mode: 0644->0755]
tools/dtoc/test_fdt.py
tools/img2brec.sh [deleted file]
tools/libfdt/fdt_rw.c
tools/microcode-tool.py
tools/moveconfig.py
tools/patman/command.py
tools/patman/func_test.py
tools/patman/patchstream.py
tools/patman/patman.py
tools/patman/series.py
tools/patman/settings.py
tools/patman/test.py
tools/patman/tools.py
tools/rkmux.py

index 862cced1cc56fdad291041e714d687861a00689b..44a76ebb09b55234270f6f4bd1f0099de1a87602 100644 (file)
@@ -149,6 +149,10 @@ jobs:
         sandbox:
           TEST_PY_BD: "sandbox"
           BUILDMAN: "^sandbox$"
+        sandbox_clang:
+          TEST_PY_BD: "sandbox"
+          BUILDMAN: "^sandbox$"
+          OVERRIDE: "-O clang-7"
         sandbox_spl:
           TEST_PY_BD: "sandbox_spl"
           TEST_PY_TEST_SPEC: "test_ofplatdata"
@@ -238,6 +242,7 @@ jobs:
           export TEST_PY_ID="${TEST_PY_ID}"
           export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
           export BUILDMAN="${BUILDMAN}"
+          export OVERRIDE="${OVERRIDE}"
           EOF
           cat << "EOF" >> test.sh
           # the below corresponds to .gitlab-ci.yml "before_script"
index 8560b794c0a7cb3525adfe30005f3da8d9b858e5..899473ab0fbbd38f4f5cc0690042da3c1c619ac5 100644 (file)
@@ -1,2 +1,5 @@
 # Declare files that always have LF line endings on checkout
 * text eol=lf
+# Denote all files that are truly binary and should not be modified
+*.bmp binary
+*.ttf binary
index d8b7b778449ef1ce61beeb6f3ec6f4450bb22496..f980ae6f703e1e8fc14c04c4fb2268a269b37e38 100644 (file)
@@ -17,6 +17,7 @@
 *.gcda
 *.gcno
 *.i
+*.img
 *.lex.c
 *.lst
 *.mod.c
index 9b295ac710feb9d89209731625e42186d8e064a3..0f5271dcd3080cd0a32095c207e94a24f63766cd 100644 (file)
@@ -178,6 +178,14 @@ sandbox test.py:
     BUILDMAN: "^sandbox$"
   <<: *buildman_and_testpy_dfn
 
+sandbox with clang test.py:
+  tags: [ 'all' ]
+  variables:
+    TEST_PY_BD: "sandbox"
+    BUILDMAN: "^sandbox$"
+    OVERRIDE: "-O clang-7"
+  <<: *buildman_and_testpy_dfn
+
 sandbox_spl test.py:
   tags: [ 'all' ]
   variables:
index 2369da97f9e571f973ad8e9d6324c427fad3c163..f6aec9677083f4f23cf18cb712995f8870303ea1 100644 (file)
@@ -47,7 +47,9 @@ install:
  # prepare buildman environment
  - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
  - echo -e "arc = /tmp/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman
- - echo -e "\n[toolchain-alias]\nsh = sh2\n" >> ~/.buildman
+ - echo -e "\n[toolchain-alias]\nsh = sh2" >> ~/.buildman
+ - echo -e "x86 = i386" >> ~/.buildman;
+ - echo -e "riscv = riscv64" >> ~/.buildman;
  - cat ~/.buildman
  - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
  - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
@@ -74,7 +76,6 @@ before_script:
   - if [[ "${TOOLCHAIN}" == *sh* ]]; then ./tools/buildman/buildman --fetch-arch sh2 ; fi
   - if [[ "${TOOLCHAIN}" == *i386* ]]; then
       ./tools/buildman/buildman --fetch-arch i386;
-      echo -e "\n[toolchain-alias]\nx86 = i386" >> ~/.buildman;
     fi
   - if [[ "${TOOLCHAIN}" == arc ]]; then
        wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2018.09-release/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz &&
@@ -98,7 +99,6 @@ before_script:
   - if [[ "${TOOLCHAIN}" == "powerpc" ]]; then ./tools/buildman/buildman --fetch-arch powerpc; fi
   - if [[ "${TOOLCHAIN}" == "riscv" ]]; then
        ./tools/buildman/buildman --fetch-arch riscv64;
-       echo -e "\n[toolchain-alias]\nriscv = riscv64" >> ~/.buildman;
     fi
   - if [[ "${QEMU_TARGET}" != "" ]]; then
        git clone git://git.qemu.org/qemu.git /tmp/qemu;
@@ -389,7 +389,7 @@ matrix:
       env:
         - TEST_PY_BD="sandbox"
           BUILDMAN="^sandbox$"
-          OVERRIDE="clang-7"
+          OVERRIDE="-O clang-7"
     - name: "test/py sandbox_spl"
       env:
         - TEST_PY_BD="sandbox_spl"
diff --git a/Kconfig b/Kconfig
index 66b059f749a7eeb2dfbd2f6413477b4298444a11..cda4f58ff7a64171bea21a1c72ea140b65fcb260 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -281,6 +281,20 @@ config SYS_LDSCRIPT
          Path within the source tree to the linker script to use for the
          main U-Boot binary.
 
+config ERR_PTR_OFFSET
+       hex
+       default 0x0
+       help
+         Some U-Boot pointers have redundant information, so we can use a
+         scheme where we can return either an error code or a pointer with the
+         same return value. The default implementation just casts the pointer
+         to a number, however, this may fail on platforms where the end of the
+         address range is used for valid pointers (e.g. 0xffffff00 is a valid
+         heap pointer in socfpga SPL).
+         For such platforms, this value provides an upper range of those error
+         pointer values - up to 'MAX_ERRNO' bytes below this value must be
+         unused/invalid addresses.
+
 endmenu                # General setup
 
 menu "Boot images"
index a310b8478f86365a2bd07079321d30ffc267bd4f..ef2cbb3223fea703006fe2e69b665c9050791b61 100644 (file)
@@ -481,6 +481,13 @@ S: Maintained
 T:     git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
 F:     arch/arm/mach-zynqmp-r5/
 
+ARM PHYTIUM
+M:     liuhao <liuhao@phytium.com.cn>
+M:     shuyiqi <shuyiqi@phytium.com.cn>
+S:     Maintained
+F:     drivers/pci/pcie_phytium.c
+F:     arch/arm/dts/phytium-durian.dts
+
 BINMAN
 M:     Simon Glass <sjg@chromium.org>
 S:     Maintained
@@ -701,6 +708,11 @@ S: Maintained
 F:     drivers/pci_endpoint/
 F:  include/pci_ep.h
 
+PCI MPC85xx
+M:     Heiko Schocher <hs@denx.de>
+S:     Maintained
+F:     drivers/pci/pci_mpc85xx.c
+
 POWER
 M:     Jaehoon Chung <jh80.chung@samsung.com>
 S:     Maintained
index 3000d30be23c708de27d6bab1eb7f0b4a9582bd8..a9a78c30d6739d976e0fc9f14bb4031d8195826c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 VERSION = 2020
 PATCHLEVEL = 01
 SUBLEVEL =
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc2
 NAME =
 
 # *DOCUMENTATION*
@@ -732,6 +732,7 @@ libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
 libs-$(CONFIG_SYS_FSL_MMDC) += drivers/ddr/fsl/
 libs-$(CONFIG_$(SPL_)ALTERA_SDRAM) += drivers/ddr/altera/
 libs-y += drivers/serial/
+libs-y += drivers/usb/cdns3/
 libs-y += drivers/usb/dwc3/
 libs-y += drivers/usb/common/
 libs-y += drivers/usb/emul/
@@ -1125,7 +1126,15 @@ u-boot.bin: u-boot-nodtb.bin FORCE
        $(call if_changed,copy)
 endif
 
-%.imx: %.bin
+# we call Makefile in arch/arm/mach-imx which
+# has targets which are dependent on targets defined
+# here. make could not resolve them and we must ensure
+# that they are finished before calling imx targets
+ifeq ($(CONFIG_MULTI_DTB_FIT),y)
+IMX_DEPS = u-boot-fit-dtb.bin
+endif
+
+%.imx: $(IMX_DEPS) %.bin
        $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
        $(BOARD_SIZE_CHECK)
 
index bc9454eb4b631e81f78f9fd033c24b019e77fb7f..71fa03804e6f6459b7e2b7392ddcc14bf7f7db10 100644 (file)
--- a/api/api.c
+++ b/api/api.c
@@ -295,27 +295,31 @@ static int API_dev_close(va_list ap)
 
 
 /*
- * Notice: this is for sending network packets only, as U-Boot does not
- * support writing to storage at the moment (12.2007)
- *
  * pseudo signature:
  *
  * int API_dev_write(
  *     struct device_info *di,
  *     void *buf,
- *     int *len
+ *     int *len,
+ *     unsigned long *start
  * )
  *
  * buf:        ptr to buffer from where to get the data to send
  *
- * len: length of packet to be sent (in bytes)
+ * len: ptr to length to be read
+ *      - network: len of packet to be sent (in bytes)
+ *      - storage: # of blocks to write (can vary in size depending on define)
  *
+ * start: ptr to start block (only used for storage devices, ignored for
+ *        network)
  */
 static int API_dev_write(va_list ap)
 {
        struct device_info *di;
        void *buf;
-       int *len;
+       lbasize_t *len_stor, act_len_stor;
+       lbastart_t *start;
+       int *len_net;
        int err = 0;
 
        /* 1. arg is ptr to the device_info struct */
@@ -333,23 +337,36 @@ static int API_dev_write(va_list ap)
        if (buf == NULL)
                return API_EINVAL;
 
-       /* 3. arg is length of buffer */
-       len = (int *)va_arg(ap, uintptr_t);
-       if (len == NULL)
-               return API_EINVAL;
-       if (*len <= 0)
-               return API_EINVAL;
+       if (di->type & DEV_TYP_STOR) {
+               /* 3. arg - ptr to var with # of blocks to write */
+               len_stor = (lbasize_t *)va_arg(ap, uintptr_t);
+               if (!len_stor)
+                       return API_EINVAL;
+               if (*len_stor <= 0)
+                       return API_EINVAL;
 
-       if (di->type & DEV_TYP_STOR)
-               /*
-                * write to storage is currently not supported by U-Boot:
-                * no storage device implements block_write() method
-                */
-               return API_ENODEV;
+               /* 4. arg - ptr to var with start block */
+               start = (lbastart_t *)va_arg(ap, uintptr_t);
 
-       else if (di->type & DEV_TYP_NET)
-               err = dev_write_net(di->cookie, buf, *len);
-       else
+               act_len_stor = dev_write_stor(di->cookie, buf, *len_stor, *start);
+               if (act_len_stor != *len_stor) {
+                       debugf("write @ %llu: done %llu out of %llu blocks",
+                                  (uint64_t)blk, (uint64_t)act_len_stor,
+                                  (uint64_t)len_stor);
+                       return API_EIO;
+               }
+
+       } else if (di->type & DEV_TYP_NET) {
+               /* 3. arg points to the var with length of packet to write */
+               len_net = (int *)va_arg(ap, uintptr_t);
+               if (!len_net)
+                       return API_EINVAL;
+               if (*len_net <= 0)
+                       return API_EINVAL;
+
+               err = dev_write_net(di->cookie, buf, *len_net);
+
+       } else
                err = API_ENODEV;
 
        return err;
index 8d97ca95a2a4eaf86314e5e5b115800b61c15145..07fd50ad3a363f42c1070158ff1fa2d3378452f2 100644 (file)
@@ -22,6 +22,7 @@ int   dev_close_stor(void *);
 int    dev_close_net(void *);
 
 lbasize_t      dev_read_stor(void *, void *, lbasize_t, lbastart_t);
+lbasize_t      dev_write_stor(void *, void *, lbasize_t, lbastart_t);
 int            dev_read_net(void *, void *, int);
 int            dev_write_net(void *, void *, int);
 
index 2b90c18aaec93a1dcb8914e80e37d41842d88980..7ae03ac2306eb97b806592eee429260a0fe0c21d 100644 (file)
@@ -349,3 +349,27 @@ lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start
        return dd->block_read(dd, start, len, buf);
 #endif /* defined(CONFIG_BLK) */
 }
+
+
+lbasize_t dev_write_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start)
+{
+       struct blk_desc *dd = (struct blk_desc *)cookie;
+       int type = dev_stor_type(dd);
+
+       if (type == ENUM_MAX)
+               return 0;
+
+       if (!dev_stor_is_valid(type, dd))
+               return 0;
+
+#ifdef CONFIG_BLK
+       return blk_dwrite(dd, start, len, buf);
+#else
+       if (dd->block_write == NULL) {
+               debugf("no block_write() for device 0x%08x\n", cookie);
+               return 0;
+       }
+
+       return dd->block_write(dd, start, len, buf);
+#endif /* defined(CONFIG_BLK) */
+}
index 629c5e8c2d393857116205649ea724aa8f61d12e..7b80630aa1cf6bcac44d7656946151eee542234c 100644 (file)
@@ -1631,6 +1631,13 @@ config ARCH_ASPEED
        select OF_CONTROL
        imply CMD_DM
 
+config TARGET_DURIAN
+       bool "Support Phytium Durian Platform"
+       select ARM64
+       help
+         Support for durian platform.
+         It has 2GB Sdram, uart and pcie.
+
 endchoice
 
 config ARCH_SUPPORT_TFABOOT
@@ -1830,6 +1837,7 @@ source "board/woodburn/Kconfig"
 source "board/xilinx/Kconfig"
 source "board/xilinx/zynq/Kconfig"
 source "board/xilinx/zynqmp/Kconfig"
+source "board/phytium/durian/Kconfig"
 
 source "arch/arm/Kconfig.debug"
 
index 94fa68250ddfee2c203b9b8087360551e4294eb4..b9511da3f30a5489ed42800df449dea55c10ca50 100644 (file)
@@ -50,8 +50,8 @@ config MAX_CPUS
          cores, count the reserved ports. This will allocate enough memory
          in spin table to properly handle all cores.
 
-config SECURE_BOOT
-       bool    "Secure Boot"
+config NXP_ESBC
+       bool    "NXP_ESBC"
        help
                Enable Freescale Secure Boot feature. Normally selected
                by defconfig. If unsure, do not change.
index 24c606a2328f470ba53fb527851c633c62f63188..f1578b10bcc5150505fa3ef13929f671eecec9fc 100644 (file)
@@ -45,6 +45,7 @@ config ARCH_LS1028A
        select SYS_FSL_ERRATUM_A008514 if !TFABOOT
        select SYS_FSL_ERRATUM_A009663 if !TFABOOT
        select SYS_FSL_ERRATUM_A009942 if !TFABOOT
+       select SYS_FSL_ERRATUM_A050382
        imply PANIC_HANG
 
 config ARCH_LS1043A
@@ -375,8 +376,8 @@ config EMC2305
         Enable the EMC2305 fan controller for configuration of fan
         speed.
 
-config SECURE_BOOT
-       bool "Secure Boot"
+config NXP_ESBC
+       bool "NXP_ESBC"
        help
                Enable Freescale Secure Boot feature
 
@@ -584,6 +585,8 @@ config SYS_FSL_ERRATUM_A009660
 config SYS_FSL_ERRATUM_A009929
        bool
 
+config SYS_FSL_ERRATUM_A050382
+       bool
 
 config SYS_FSL_HAS_RGMII
        bool
index efecbc07e7833d2d31d971dd44214b860177720d..e398aecd12ebb7f59f42c4309257fc3773769e7f 100644 (file)
@@ -24,10 +24,12 @@ endif
 
 ifneq ($(CONFIG_ARCH_LX2160A),)
 obj-$(CONFIG_SYS_HAS_SERDES) += lx2160a_serdes.o
+obj-y += icid.o lx2160_ids.o
 endif
 
 ifneq ($(CONFIG_ARCH_LS2080A),)
 obj-$(CONFIG_SYS_HAS_SERDES) += ls2080a_serdes.o
+obj-y += icid.o ls2088_ids.o
 endif
 
 ifneq ($(CONFIG_ARCH_LS1043A),)
index 8fd6c751c693852a7b6652b0904d73077f7d5882..83a33193211e8671010a88ce611d316460145ebc 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright 2017 NXP
+ * Copyright 2017-2019 NXP
  * Copyright 2014-2015 Freescale Semiconductor, Inc.
  */
 
@@ -1072,6 +1072,8 @@ static void config_core_prefetch(void)
 
        if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0)
                buf = buffer;
+       else
+               return;
 
        prefetch_arg = hwconfig_subarg_f("core_prefetch", "disable",
                                         &arglen, buf);
@@ -1221,7 +1223,7 @@ void __efi_runtime reset_cpu(ulong addr)
 #endif
 }
 
-#ifdef CONFIG_EFI_LOADER
+#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_PSCI_RESET)
 
 void __efi_runtime EFIAPI efi_reset_system(
                       enum efi_reset_type reset_type,
index b3e67321b485eb47bbd81f61daf87106e328f2a7..bbd550b03656341fb3f9465ed4a370a063bdfc7f 100644 (file)
@@ -64,7 +64,7 @@ void get_sys_info(struct sys_info *sys_info)
        };
 
        uint i, cluster;
-#if defined(CONFIG_TARGET_LS1028ARDB) || defined(CONFIG_TARGET_LS1088ARDB)
+#if defined(CONFIG_ARCH_LS1028A) || defined(CONFIG_ARCH_LS1088A)
        uint rcw_tmp;
 #endif
        uint freq_c_pll[CONFIG_SYS_FSL_NUM_CC_PLLS];
@@ -131,7 +131,7 @@ void get_sys_info(struct sys_info *sys_info)
                                                CONFIG_SYS_FSL_IFC_CLK_DIV;
 #endif
 
-#if defined(CONFIG_TARGET_LS1028ARDB) || defined(CONFIG_TARGET_LS1088ARDB)
+#if defined(CONFIG_ARCH_LS1028A) || defined(CONFIG_ARCH_LS1088A)
 #define HWA_CGA_M2_CLK_SEL      0x00380000
 #define HWA_CGA_M2_CLK_SHIFT    19
        rcw_tmp = in_le32(&gur->rcwsr[5]);
@@ -159,7 +159,7 @@ void get_sys_info(struct sys_info *sys_info)
                break;
        }
 #endif
-#if defined(CONFIG_TARGET_LX2160ARDB) || defined(CONFIG_TARGET_LS2080ARDB)
+#if defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LS2080A)
        sys_info->freq_cga_m2 = sys_info->freq_systembus;
 #endif
 }
@@ -176,10 +176,10 @@ int get_clocks(void)
 #endif
 #if defined(CONFIG_FSL_ESDHC)
 #if defined(CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK)
-#if defined(CONFIG_TARGET_LS1028ARDB) || defined(CONFIG_TARGET_LX2160ARDB)
+#if defined(CONFIG_ARCH_LS1028A) || defined(CONFIG_ARCH_LX2160A)
        gd->arch.sdhc_clk = sys_info.freq_cga_m2 / 2;
 #endif
-#if defined(CONFIG_TARGET_LS2080ARDB) || defined(CONFIG_TARGET_LS1088ARDB)
+#if defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
        gd->arch.sdhc_clk = sys_info.freq_cga_m2;
 #endif
 #else
index d9d125e8ba05f41d82369975a0f759bfd0fad1aa..9462298fbf9169114d428ba582c162ffde5419f3 100644 (file)
@@ -18,6 +18,7 @@ struct icid_id_table icid_tbl[] = {
        SET_QDMA_ICID("fsl,ls1028a-qdma", FSL_DMA_STREAM_ID),
        SET_GPU_ICID("fsl,ls1028a-gpu", FSL_GPU_STREAM_ID),
        SET_DISPLAY_ICID(FSL_DISPLAY_STREAM_ID),
+#ifdef CONFIG_FSL_CAAM
        SET_SEC_JR_ICID_ENTRY(0, FSL_SEC_JR1_STREAM_ID),
        SET_SEC_JR_ICID_ENTRY(1, FSL_SEC_JR2_STREAM_ID),
        SET_SEC_JR_ICID_ENTRY(2, FSL_SEC_JR3_STREAM_ID),
@@ -28,6 +29,7 @@ struct icid_id_table icid_tbl[] = {
        SET_SEC_RTIC_ICID_ENTRY(3, FSL_SEC_STREAM_ID),
        SET_SEC_DECO_ICID_ENTRY(0, FSL_SEC_STREAM_ID),
        SET_SEC_DECO_ICID_ENTRY(1, FSL_SEC_STREAM_ID),
+#endif
 };
 
 int icid_tbl_sz = ARRAY_SIZE(icid_tbl);
index 49e27553b12f2ca71e668eb8dab1d677d60b28f0..23743ae10cffd6a824e412602c489efdcbad7542 100644 (file)
@@ -13,6 +13,7 @@ struct icid_id_table icid_tbl[] = {
        SET_USB_ICID(1, "snps,dwc3", FSL_USB1_STREAM_ID),
        SET_USB_ICID(2, "snps,dwc3", FSL_USB2_STREAM_ID),
        SET_SATA_ICID(1, "fsl,ls1088a-ahci", FSL_SATA1_STREAM_ID),
+#ifdef CONFIG_FSL_CAAM
        SET_SEC_JR_ICID_ENTRY(0, FSL_SEC_JR1_STREAM_ID),
        SET_SEC_JR_ICID_ENTRY(1, FSL_SEC_JR2_STREAM_ID),
        SET_SEC_JR_ICID_ENTRY(2, FSL_SEC_JR3_STREAM_ID),
@@ -25,6 +26,7 @@ struct icid_id_table icid_tbl[] = {
        SET_SEC_DECO_ICID_ENTRY(1, FSL_SEC_STREAM_ID),
        SET_SEC_DECO_ICID_ENTRY(2, FSL_SEC_STREAM_ID),
        SET_SEC_DECO_ICID_ENTRY(3, FSL_SEC_STREAM_ID),
+#endif
 };
 
 int icid_tbl_sz = ARRAY_SIZE(icid_tbl);
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ls2088_ids.c b/arch/arm/cpu/armv8/fsl-layerscape/ls2088_ids.c
new file mode 100644 (file)
index 0000000..e6403b7
--- /dev/null
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 NXP
+ */
+
+#include <common.h>
+#include <asm/arch-fsl-layerscape/immap_lsch3.h>
+#include <asm/arch-fsl-layerscape/fsl_icid.h>
+#include <asm/arch-fsl-layerscape/fsl_portals.h>
+
+struct icid_id_table icid_tbl[] = {
+       SET_SDHC_ICID(1, FSL_SDMMC_STREAM_ID),
+       SET_USB_ICID(1, "snps,dwc3", FSL_USB1_STREAM_ID),
+       SET_USB_ICID(2, "snps,dwc3", FSL_USB2_STREAM_ID),
+       SET_SATA_ICID(1, "fsl,ls2080a-ahci", FSL_SATA1_STREAM_ID),
+       SET_SATA_ICID(2, "fsl,ls2080a-ahci", FSL_SATA2_STREAM_ID),
+#ifdef CONFIG_FSL_CAAM
+       SET_SEC_JR_ICID_ENTRY(0, FSL_SEC_JR1_STREAM_ID),
+       SET_SEC_JR_ICID_ENTRY(1, FSL_SEC_JR2_STREAM_ID),
+       SET_SEC_JR_ICID_ENTRY(2, FSL_SEC_JR3_STREAM_ID),
+       SET_SEC_JR_ICID_ENTRY(3, FSL_SEC_JR4_STREAM_ID),
+       SET_SEC_RTIC_ICID_ENTRY(0, FSL_SEC_STREAM_ID),
+       SET_SEC_RTIC_ICID_ENTRY(1, FSL_SEC_STREAM_ID),
+       SET_SEC_RTIC_ICID_ENTRY(2, FSL_SEC_STREAM_ID),
+       SET_SEC_RTIC_ICID_ENTRY(3, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(0, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(1, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(2, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(3, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(4, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(5, FSL_SEC_STREAM_ID),
+#endif
+};
+
+int icid_tbl_sz = ARRAY_SIZE(icid_tbl);
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/lx2160_ids.c b/arch/arm/cpu/armv8/fsl-layerscape/lx2160_ids.c
new file mode 100644 (file)
index 0000000..3a0ed1f
--- /dev/null
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 NXP
+ */
+
+#include <common.h>
+#include <asm/arch-fsl-layerscape/immap_lsch3.h>
+#include <asm/arch-fsl-layerscape/fsl_icid.h>
+#include <asm/arch-fsl-layerscape/fsl_portals.h>
+
+struct icid_id_table icid_tbl[] = {
+       SET_SDHC_ICID(1, FSL_SDMMC_STREAM_ID),
+       SET_SDHC_ICID(2, FSL_SDMMC2_STREAM_ID),
+       SET_USB_ICID(1, "snps,dwc3", FSL_USB1_STREAM_ID),
+       SET_USB_ICID(2, "snps,dwc3", FSL_USB2_STREAM_ID),
+       SET_SATA_ICID(1, "fsl,lx2160a-ahci", FSL_SATA1_STREAM_ID),
+       SET_SATA_ICID(2, "fsl,lx2160a-ahci", FSL_SATA2_STREAM_ID),
+       SET_SATA_ICID(3, "fsl,lx2160a-ahci", FSL_SATA3_STREAM_ID),
+       SET_SATA_ICID(4, "fsl,lx2160a-ahci", FSL_SATA4_STREAM_ID),
+#ifdef CONFIG_FSL_CAAM
+       SET_SEC_JR_ICID_ENTRY(0, FSL_SEC_JR1_STREAM_ID),
+       SET_SEC_JR_ICID_ENTRY(1, FSL_SEC_JR2_STREAM_ID),
+       SET_SEC_JR_ICID_ENTRY(2, FSL_SEC_JR3_STREAM_ID),
+       SET_SEC_JR_ICID_ENTRY(3, FSL_SEC_JR4_STREAM_ID),
+       SET_SEC_RTIC_ICID_ENTRY(0, FSL_SEC_STREAM_ID),
+       SET_SEC_RTIC_ICID_ENTRY(1, FSL_SEC_STREAM_ID),
+       SET_SEC_RTIC_ICID_ENTRY(2, FSL_SEC_STREAM_ID),
+       SET_SEC_RTIC_ICID_ENTRY(3, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(0, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(1, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(2, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(3, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(4, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(5, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(6, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(7, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(8, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(9, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(10, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(11, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(12, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(13, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(14, FSL_SEC_STREAM_ID),
+       SET_SEC_DECO_ICID_ENTRY(15, FSL_SEC_STREAM_ID),
+#endif
+};
+
+int icid_tbl_sz = ARRAY_SIZE(icid_tbl);
index 1f1869e8cf6b5dc409306bc9da86d190e44e46c8..f0df88c565ab0abd1d16d8787d2cc095a2f22a30 100644 (file)
@@ -341,7 +341,8 @@ void fsl_lsch3_early_init_f(void)
                bypass_smmu();
 #endif
 
-#if defined(CONFIG_ARCH_LS1088A) || defined(CONFIG_ARCH_LS1028A)
+#if defined(CONFIG_ARCH_LS1088A) || defined(CONFIG_ARCH_LS1028A) || \
+       defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LX2160A)
        set_icids();
 #endif
 }
@@ -828,6 +829,11 @@ int fsl_setenv_mcinitcmd(void)
 #endif
 
 #ifdef CONFIG_BOARD_LATE_INIT
+__weak int fsl_board_late_init(void)
+{
+       return 0;
+}
+
 int board_late_init(void)
 {
 #ifdef CONFIG_CHAIN_OF_TRUST
@@ -862,6 +868,6 @@ int board_late_init(void)
        qspi_ahb_init();
 #endif
 
-       return 0;
+       return fsl_board_late_init();
 }
 #endif
index 8eeeef199b154e15dffcd9360bb9425af57e3aec..3f6a5f6a4282b5bb4e302d8c553fb65aac9e65c6 100644 (file)
@@ -34,7 +34,7 @@ u32 spl_boot_device(void)
 
 void spl_board_init(void)
 {
-#if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_LSCH2)
+#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_LSCH2)
        /*
         * In case of Secure Boot, the IBR configures the SMMU
         * to allow only Secure transactions.
index 3e2677c4f19a7b65eae8f9dc911c94f4d7772a57..85ef00a2bd117a5e3c9aa2d0b2430681f823b2b2 100644 (file)
@@ -111,6 +111,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
        rk3399-khadas-edge.dtb \
        rk3399-khadas-edge-captain.dtb \
        rk3399-khadas-edge-v.dtb \
+       rk3399-leez-p710.dtb \
        rk3399-nanopc-t4.dtb \
        rk3399-nanopi-m4.dtb \
        rk3399-nanopi-neo4.dtb \
@@ -835,6 +836,8 @@ dtb-$(CONFIG_TARGET_VEXPRESS_CA5X2) += vexpress-v2p-ca5s.dtb
 dtb-$(CONFIG_TARGET_VEXPRESS_CA9X4) += vexpress-v2p-ca9.dtb
 dtb-$(CONFIG_TARGET_VEXPRESS_CA15_TC2) += vexpress-v2p-ca15_a7.dtb
 
+dtb-$(CONFIG_TARGET_DURIAN) += phytium-durian.dtb
+
 targets += $(dtb-y)
 
 # Add any required device tree compiler flags here
index 4be1ab87d2ee53a407635fc44763517222e6d125..abc8b21a112e99edb195cdc83ba6576a7cfb8b19 100644 (file)
                status = "disabled";
        };
 
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
 };
index 174d2023060d36f9877e8333ed67b144ad77e8b1..5c110ef9ddea1aa85e932d6ae05f5c60d8112b7e 100644 (file)
                u-boot,dm-spl;
        };
 
+       wkup_vtm0: wkup_vtm@42050000 {
+               compatible = "ti,am654-vtm", "ti,am654-avs";
+               reg = <0x42050000 0x25c>;
+               power-domains = <&k3_pds 80>;
+               #thermal-sensor-cells = <1>;
+       };
+
        clk_200mhz: dummy_clock {
                compatible = "fixed-clock";
                #clock-cells = <0>;
        power-domains = <&k3_pds 146 TI_SCI_PD_SHARED>;
 };
 
+&wkup_vtm0 {
+       vdd-supply-3 = <&vdd_mpu>;
+       vdd-supply-4 = <&vdd_mpu>;
+       u-boot,dm-spl;
+};
+
 &wkup_pmx0 {
        u-boot,dm-spl;
        wkup_uart0_pins_default: wkup_uart0_pins_default {
        pinctrl-names = "default";
        pinctrl-0 = <&wkup_i2c0_pins_default>;
        clock-frequency = <400000>;
+       u-boot,dm-spl;
+
+       vdd_mpu: tps62363@60 {
+               compatible = "ti,tps62363";
+               reg = <0x60>;
+               regulator-name = "VDD_MPU";
+               regulator-min-microvolt = <500000>;
+               regulator-max-microvolt = <1770000>;
+               regulator-always-on;
+               regulator-boot-on;
+               ti,vsel0-state-high;
+               ti,vsel1-state-high;
+               u-boot,dm-spl;
+       };
 };
index 92beeea34dbaf399f99a4c35086b85c282003850..5dd07ac4daf7380ba8897332506d47bc1f30cb06 100644 (file)
                clock-names = "fclk";
        };
 
+       wkup_i2c0: i2c@42120000 {
+               compatible = "ti,j721e-i2c", "ti,omap4-i2c";
+               reg = <0x0 0x42120000 0x0 0x100>;
+               interrupts = <GIC_SPI 896 IRQ_TYPE_LEVEL_HIGH>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               clock-names = "fck";
+               clocks = <&k3_clks 197 0>;
+               power-domains = <&k3_pds 197 TI_SCI_PD_EXCLUSIVE>;
+       };
+
        mcu_uart0: serial@40a00000 {
                compatible = "ti,j721e-uart", "ti,am654-uart";
                reg = <0x00 0x40a00000 0x00 0x100>;
index 54d7998d27a00ed5162041ccee0f1ed04ca41b08..41af48214f6fc72ba1f9a3ab170efb70f4ec3f51 100644 (file)
                mboxes= <&mcu_secproxy 4>, <&mcu_secproxy 5>;
                mbox-names = "tx", "rx";
        };
+
+       wkup_vtm0: wkup_vtm@42040000 {
+               compatible = "ti,am654-vtm", "ti,j721e-avs";
+               reg = <0x0 0x42040000 0x0 0x330>;
+               power-domains = <&k3_pds 154 TI_SCI_PD_EXCLUSIVE>;
+               #thermal-sensor-cells = <1>;
+       };
 };
 
 &dmsc {
                        J721E_WKUP_IOPAD(0xe0, PIN_OUTPUT, 0) /* (G29) WKUP_GPIO0_12.MCU_UART0_TXD */
                >;
        };
+
+       wkup_i2c0_pins_default: wkup-i2c0-pins-default {
+               pinctrl-single,pins = <
+                       J721E_WKUP_IOPAD(0xf8, PIN_INPUT_PULLUP, 0) /* (J25) WKUP_I2C0_SCL */
+                       J721E_WKUP_IOPAD(0xfc, PIN_INPUT_PULLUP, 0) /* (H24) WKUP_I2C0_SDA */
+               >;
+       };
 };
 
 &main_pmx0 {
        ti,driver-strength-ohm = <50>;
 };
 
+&wkup_i2c0 {
+       u-boot,dm-spl;
+       tps659413a: tps659413a@48 {
+               reg = <0x48>;
+               compatible = "ti,tps659413";
+               u-boot,dm-spl;
+               pinctrl-names = "default";
+               pinctrl-0 = <&wkup_i2c0_pins_default>;
+               clock-frequency = <400000>;
+
+               regulators: regulators {
+                       u-boot,dm-spl;
+                       buck12_reg: buck12 {
+                               /*VDD_MPU*/
+                               regulator-name = "buck12";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1250000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               u-boot,dm-spl;
+                       };
+               };
+       };
+};
+
+&wkup_vtm0 {
+       vdd-supply-2 = <&buck12_reg>;
+       u-boot,dm-spl;
+};
+
 #include "k3-j721e-common-proc-board-u-boot.dtsi"
index 1abd9a38870333f4f3665785bf68aae0b785cee6..e5d9e4f1b1d7b4d56a20afc7dfc7155d224d9aa6 100644 (file)
        };
 };
 
+&gpio1 {
+       /delete-property/ u-boot,dm-spl;
+};
+
+&gpio2 {
+       /delete-property/ u-boot,dm-spl;
+};
+
+&gpio3 {
+       /delete-property/ u-boot,dm-spl;
+};
+
+&gpio5 {
+       /delete-property/ u-boot,dm-spl;
+};
+
+&gpio6 {
+       /delete-property/ u-boot,dm-spl;
+};
+
 &i2c1 {
        clock-frequency = <400000>;
 };
index 976330f89716a740c82474a8dfed0159434bc440..76f74326ae888e729320e181534b3b1222336d4d 100644 (file)
        clock-frequency = <400000>;
 };
 
+&gpio1 {
+       /delete-property/ u-boot,dm-spl;
+};
+
+&gpio2 {
+       /delete-property/ u-boot,dm-spl;
+};
+
+&gpio3 {
+       /delete-property/ u-boot,dm-spl;
+};
+
+&gpio5 {
+       /delete-property/ u-boot,dm-spl;
+};
+
+&gpio6 {
+       /delete-property/ u-boot,dm-spl;
+};
+
 /delete-node/ &uart2;
 /delete-node/ &uart3;
 /delete-node/ &mmc2;
diff --git a/arch/arm/dts/phytium-durian.dts b/arch/arm/dts/phytium-durian.dts
new file mode 100644 (file)
index 0000000..3b76949
--- /dev/null
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019, Phytium Ltd.
+ * shuyiqi  <shuyiqi@phytium.com.cn>
+ */
+
+/dts-v1/;
+
+/ {
+       model = "Phytium Durian";
+       compatible = "phytium,durian";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       pcie-controller@40000000 {
+               compatible = "phytium,pcie-host-1.0";
+               device_type = "pci";
+               #address-cells = <3>;
+               #size-cells = <2>;
+               reg = <0x0 0x40000000 0x0 0x10000000>;
+               bus-range = <0x0 0xff>;
+               ranges = <0x1000000 0x0 0x0 0x0 0x50000000 0x0 0xF00000>,
+               <0x2000000 0x0 0x58000000 0x0 0x58000000 0x0 0x28000000>,
+               <0x43000000 0x10 0x00000000 0x10 0x00000000 0x10  0x00000000>;
+       };
+
+       uart@28001000 {
+               compatible = "arm,pl011";
+               reg = <0x0 0x28001000 0x0 0x1000>;
+               clock = <48000000>;
+       };
+};
+
index 1d441f7124f4ad7c9cb685b9895ef5258079bced..e5946d2d2dc7c487077331f21380bdc54127139f 100644 (file)
@@ -5,6 +5,11 @@
 
 #include "rk3328-u-boot.dtsi"
 #include "rk3328-sdram-lpddr3-1600.dtsi"
+/ {
+       chosen {
+               u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc;
+       };
+};
 
 &usb_host0_xhci {
        status = "okay";
diff --git a/arch/arm/dts/rk3399-leez-p710-u-boot.dtsi b/arch/arm/dts/rk3399-leez-p710-u-boot.dtsi
new file mode 100644 (file)
index 0000000..f8b2a1d
--- /dev/null
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2019 Andy Yan <andy.yan@gmail.com>
+ */
+
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-lpddr4-100.dtsi"
+
+/ {
+       chosen {
+               u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
+       };
+};
diff --git a/arch/arm/dts/rk3399-leez-p710.dts b/arch/arm/dts/rk3399-leez-p710.dts
new file mode 100644 (file)
index 0000000..32baa57
--- /dev/null
@@ -0,0 +1,645 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 Andy Yan <andy.yan@gmail.com>
+ */
+
+/dts-v1/;
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/pwm/pwm.h>
+#include "rk3399.dtsi"
+#include "rk3399-opp.dtsi"
+
+/ {
+       model = "Leez RK3399 P710";
+       compatible = "leez,p710", "rockchip,rk3399";
+
+       chosen {
+               stdout-path = "serial2:1500000n8";
+       };
+
+       clkin_gmac: external-gmac-clock {
+               compatible = "fixed-clock";
+               clock-frequency = <125000000>;
+               clock-output-names = "clkin_gmac";
+               #clock-cells = <0>;
+       };
+
+       sdio_pwrseq: sdio-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               clocks = <&rk808 1>;
+               clock-names = "ext_clock";
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_reg_on_h>;
+               reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
+       };
+
+       dc5v_adp: dc5v-adp {
+               compatible = "regulator-fixed";
+               regulator-name = "dc5v_adapter";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+       };
+
+       vcc5v0_sys: vcc5v0-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_sys";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc5v_adp>;
+       };
+
+       vcc3v3_sys: vcc3v3-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc3v3_sys";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc5v0_sys>;
+       };
+
+       vcc5v0_host0: vcc5v0_host1: vcc5v0-host {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_host";
+               regulator-boot-on;
+               regulator-always-on;
+               regulator-min-microvolt = <5500000>;
+               regulator-max-microvolt = <5500000>;
+               vin-supply = <&vcc5v0_sys>;
+       };
+
+       vcc5v0_host3: vcc5v0-host3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_host3";
+               enable-active-high;
+               gpio = <&gpio2 RK_PA2 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_host3_en>;
+               regulator-always-on;
+               vin-supply = <&vcc5v0_sys>;
+       };
+
+       vcc3v3_lan: vcc3v3-lan {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc3v3_lan";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vim-supply = <&vcc3v3_sys>;
+       };
+
+       vdd_log: vdd-log {
+               compatible = "pwm-regulator";
+               pwms = <&pwm2 0 25000 1>;
+               regulator-name = "vdd_log";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <800000>;
+               regulator-max-microvolt = <1400000>;
+               vin-supply = <&vcc5v0_sys>;
+       };
+};
+
+&cpu_l0 {
+       cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l1 {
+       cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l2 {
+       cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l3 {
+       cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_b0 {
+       cpu-supply = <&vdd_cpu_b>;
+};
+
+&cpu_b1 {
+       cpu-supply = <&vdd_cpu_b>;
+};
+
+&emmc_phy {
+       status = "okay";
+};
+
+&gmac {
+       assigned-clocks = <&cru SCLK_RMII_SRC>;
+       assigned-clock-parents = <&clkin_gmac>;
+       clock_in_out = "input";
+       phy-supply = <&vcc3v3_lan>;
+       phy-mode = "rgmii";
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmii_pins>;
+       snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 10000 50000>;
+       tx_delay = <0x28>;
+       rx_delay = <0x11>;
+       status = "okay";
+};
+
+&gpu {
+       mali-supply = <&vdd_gpu>;
+       status = "okay";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c7>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&hdmi_cec>;
+       status = "okay";
+};
+
+&hdmi_sound {
+       status = "okay";
+};
+
+&i2c0 {
+       clock-frequency = <400000>;
+       i2c-scl-rising-time-ns = <168>;
+       i2c-scl-falling-time-ns = <4>;
+       status = "okay";
+
+       rk808: pmic@1b {
+               compatible = "rockchip,rk808";
+               reg = <0x1b>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
+               #clock-cells = <1>;
+               clock-output-names = "xin32k", "rk808-clkout2";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pmic_int_l>;
+               rockchip,system-power-controller;
+               wakeup-source;
+
+               vcc1-supply = <&vcc5v0_sys>;
+               vcc2-supply = <&vcc5v0_sys>;
+               vcc3-supply = <&vcc5v0_sys>;
+               vcc4-supply = <&vcc5v0_sys>;
+               vcc6-supply = <&vcc5v0_sys>;
+               vcc7-supply = <&vcc5v0_sys>;
+               vcc8-supply = <&vcc3v3_sys>;
+               vcc9-supply = <&vcc5v0_sys>;
+               vcc10-supply = <&vcc5v0_sys>;
+               vcc11-supply = <&vcc5v0_sys>;
+               vcc12-supply = <&vcc3v3_sys>;
+               vddio-supply = <&vcc_1v8>;
+
+               regulators {
+                       vdd_center: DCDC_REG1 {
+                               regulator-name = "vdd_center";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <750000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vdd_cpu_l: DCDC_REG2 {
+                               regulator-name = "vdd_cpu_l";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <750000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_ddr: DCDC_REG3 {
+                               regulator-name = "vcc_ddr";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vcc_1v8: DCDC_REG4 {
+                               regulator-name = "vcc_1v8";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vcc1v8_dvp: LDO_REG1 {
+                               regulator-name = "vcc1v8_dvp";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc1v8_hdmi: LDO_REG2 {
+                               regulator-name = "vcc1v8_hdmi";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcca_1v8: LDO_REG3 {
+                               regulator-name = "vcca_1v8";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vccio_sd: LDO_REG4 {
+                               regulator-name = "vccio_sd";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3000000>;
+                               };
+                       };
+
+                       vcca3v0_codec: LDO_REG5 {
+                               regulator-name = "vcca3v0_codec";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_1v5: LDO_REG6 {
+                               regulator-name = "vcc_1v5";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1500000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1500000>;
+                               };
+                       };
+
+                       vcc0v9_hdmi: LDO_REG7 {
+                               regulator-name = "vcc0v9_hdmi";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <900000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_3v0: LDO_REG8 {
+                               regulator-name = "vcc_3v0";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3000000>;
+                               };
+                       };
+               };
+       };
+
+       vdd_cpu_b: regulator@40 {
+               compatible = "silergy,syr827";
+               reg = <0x40>;
+               fcs,suspend-voltage-selector = <1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vsel1_gpio>;
+               regulator-name = "vdd_cpu_b";
+               regulator-min-microvolt = <712500>;
+               regulator-max-microvolt = <1500000>;
+               regulator-ramp-delay = <1000>;
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc5v0_sys>;
+
+               regulator-state-mem {
+                       regulator-off-in-suspend;
+               };
+       };
+
+       vdd_gpu: regulator@41 {
+               compatible = "silergy,syr828";
+               reg = <0x41>;
+               fcs,suspend-voltage-selector = <1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vsel2_gpio>;
+               regulator-name = "vdd_gpu";
+               regulator-min-microvolt = <712500>;
+               regulator-max-microvolt = <1500000>;
+               regulator-ramp-delay = <1000>;
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc5v0_sys>;
+
+               regulator-state-mem {
+                       regulator-off-in-suspend;
+               };
+       };
+};
+
+&i2c1 {
+       i2c-scl-rising-time-ns = <300>;
+       i2c-scl-falling-time-ns = <15>;
+       status = "okay";
+};
+
+&i2c3 {
+       i2c-scl-rising-time-ns = <450>;
+       i2c-scl-falling-time-ns = <15>;
+       status = "okay";
+};
+
+&i2c4 {
+       i2c-scl-rising-time-ns = <600>;
+       i2c-scl-falling-time-ns = <20>;
+       status = "okay";
+};
+
+&i2c7 {
+       status = "okay";
+};
+
+&i2s0 {
+       rockchip,playback-channels = <8>;
+       rockchip,capture-channels = <8>;
+       status = "okay";
+};
+
+&i2s1 {
+       rockchip,playback-channels = <2>;
+       rockchip,capture-channels = <2>;
+       status = "okay";
+};
+
+&i2s2 {
+       status = "okay";
+};
+
+&io_domains {
+       status = "okay";
+
+       bt656-supply = <&vcc1v8_dvp>;
+       audio-supply = <&vcc_1v8>;
+       sdmmc-supply = <&vccio_sd>;
+       gpio1830-supply = <&vcc_3v0>;
+};
+
+&pmu_io_domains {
+       status = "okay";
+       pmu1830-supply = <&vcc_3v0>;
+};
+
+&pinctrl {
+       bt {
+               bt_reg_on_h: bt-reg-on-h {
+                       rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               bt_host_wake_l: bt-host-wake-l {
+                       rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               bt_wake_l: bt-wake-l {
+                       rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pmic {
+               pmic_int_l: pmic-int-l {
+                       rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+
+               vsel1_gpio: vsel1-gpio {
+                       rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+
+               vsel2_gpio: vsel2-gpio {
+                       rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+       };
+
+       usb2 {
+               vcc5v0_host3_en: vcc5v0-host3-en {
+                       rockchip,pins = <2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       wifi {
+               wifi_reg_on_h: wifi-reg-on-h {
+                       rockchip,pins =
+                               <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               wifi_host_wake_l: wifi-host-wake-l {
+                       rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
+
+&pwm2 {
+       status = "okay";
+};
+
+&saradc {
+       status = "okay";
+
+       vref-supply = <&vcc_1v8>;
+};
+
+&sdio0 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       bus-width = <4>;
+       clock-frequency = <50000000>;
+       cap-sdio-irq;
+       cap-sd-highspeed;
+       keep-power-in-suspend;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+       sd-uhs-sdr104;
+       status = "okay";
+
+       brcmf: wifi@1 {
+               compatible = "brcm,bcm4329-fmac";
+               reg = <1>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
+               interrupt-names = "host-wake";
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_host_wake_l>;
+       };
+};
+
+&sdmmc {
+       bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
+       cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
+       disable-wp;
+       max-frequency = <150000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc_clk &sdmmc_cd &sdmmc_cmd &sdmmc_bus4>;
+       status = "okay";
+};
+
+&sdhci {
+       bus-width = <8>;
+       mmc-hs400-1_8v;
+       mmc-hs400-enhanced-strobe;
+       non-removable;
+       status = "okay";
+};
+
+&tcphy0 {
+       status = "okay";
+};
+
+&tcphy1 {
+       status = "okay";
+};
+
+&tsadc {
+       status = "okay";
+
+       /* tshut mode 0:CRU 1:GPIO */
+       rockchip,hw-tshut-mode = <1>;
+       /* tshut polarity 0:LOW 1:HIGH */
+       rockchip,hw-tshut-polarity = <1>;
+};
+
+&u2phy0 {
+       status = "okay";
+
+       u2phy0_otg: otg-port {
+               status = "okay";
+       };
+
+       u2phy0_host: host-port {
+               phy-supply = <&vcc5v0_host0>;
+               status = "okay";
+       };
+};
+
+&u2phy1 {
+       status = "okay";
+
+       u2phy1_otg: otg-port {
+               status = "okay";
+       };
+
+       u2phy1_host: host-port {
+               phy-supply = <&vcc5v0_host1>;
+               status = "okay";
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
+       status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               clocks = <&rk808 1>;
+               clock-names = "ext_clock";
+               device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;
+               host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
+               shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_reg_on_h>;
+       };
+};
+
+&uart2 {
+       status = "okay";
+};
+
+&usb_host0_ehci {
+       status = "okay";
+};
+
+&usb_host0_ohci {
+       status = "okay";
+};
+
+&usb_host1_ehci {
+       status = "okay";
+};
+
+&usb_host1_ohci {
+       status = "okay";
+};
+
+&usbdrd3_0 {
+       status = "okay";
+};
+
+&usbdrd_dwc3_0 {
+       status = "okay";
+       dr_mode = "otg";
+};
+
+&usbdrd3_1 {
+       status = "okay";
+};
+
+&usbdrd_dwc3_1 {
+       status = "okay";
+       dr_mode = "host";
+};
+
+&vopb {
+       status = "okay";
+};
+
+&vopb_mmu {
+       status = "okay";
+};
+
+&vopl {
+       status = "okay";
+};
+
+&vopl_mmu {
+       status = "okay";
+};
index 37e2fe4e66cb5db22c08e35c625d3538c9992d9c..3c06a55cb853b913588744ea0b1d4e8079e180b1 100644 (file)
@@ -166,7 +166,7 @@ extern int fman_icid_tbl_sz;
 
 #define SET_SEC_JR_ICID_ENTRY(jr_num, streamid) \
        SET_ICID_ENTRY( \
-               (CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT && \
+               (CONFIG_IS_ENABLED(ARMV8_SEC_FIRMWARE_SUPPORT) && \
                (FSL_SEC_JR##jr_num##_OFFSET ==  \
                        SEC_JR3_OFFSET + CONFIG_SYS_FSL_SEC_OFFSET) \
                        ? NULL \
index 4f050470dd3452db9e16b32f881734bfe72225c6..d46477d96e269d2c08e9cbd4cf7354146bf8d2be 100644 (file)
@@ -87,6 +87,8 @@
 /* SATA */
 #define AHCI_BASE_ADDR1                                (CONFIG_SYS_IMMR + 0x02200000)
 #define AHCI_BASE_ADDR2                                (CONFIG_SYS_IMMR + 0x02210000)
+#define AHCI_BASE_ADDR3                                (CONFIG_SYS_IMMR + 0x02220000)
+#define AHCI_BASE_ADDR4                                (CONFIG_SYS_IMMR + 0x02230000)
 
 /* QDMA */
 #define QDMA_BASE_ADDR                         (CONFIG_SYS_IMMR + 0x07380000)
@@ -445,7 +447,9 @@ struct ccsr_gur {
        u8      res_538[0x550 - 0x538]; /* add more registers when needed */
        u32     sata1_amqr;
        u32     sata2_amqr;
-       u8      res_558[0x570-0x558];   /* add more registers when needed */
+       u32     sata3_amqr;
+       u32     sata4_amqr;
+       u8      res_560[0x570 - 0x560]; /* add more registers when needed */
        u32     misc1_amqr;
        u8      res_574[0x590-0x574];   /* add more registers when needed */
        u32     spare1_amqr;
index 93bdcc4caa7a451cc72b74ac614604dec3dbe3df..94ea99a349d516e4c99cd04a576724f3b7209ac0 100644 (file)
 #define FSL_SEC_JR4_STREAM_ID          68
 
 #define FSL_SDMMC2_STREAM_ID           69
+
+/*
+ * Erratum A-050382 workaround
+ *
+ * Description:
+ *   The eDMA ICID programmed in the eDMA_AMQR register in DCFG is not
+ *   correctly forwarded to the SMMU.
+ * Workaround:
+ *   Program eDMA ICID in the eDMA_AMQR register in DCFG to 40.
+ */
+#ifdef CONFIG_SYS_FSL_ERRATUM_A050382
+#define FSL_EDMA_STREAM_ID             40
+#else
 #define FSL_EDMA_STREAM_ID             70
+#endif
+
 #define FSL_GPU_STREAM_ID              71
 #define FSL_DISPLAY_STREAM_ID          72
+#define FSL_SATA3_STREAM_ID            73
+#define FSL_SATA4_STREAM_ID            74
 
 #endif
index 15b9788d9c4a24dd8bb0cd7fcf6e75c7faba1050..4bf69dbe08868c88c8ccbb7b4ea3d0e72dfa7a49 100644 (file)
@@ -66,4 +66,7 @@ enum apll_frequencies {
        APLL_600_MHZ,
 };
 
+void rk3328_configure_cpu(struct rk3328_cru *cru,
+                         enum apll_frequencies apll_freq);
+
 #endif /* __ASM_ARCH_CRU_RK3328_H_ */
index 723f3cf497d783790f465600ef9d93093d86ff50..8959749ad654bd599cb41f283bf6150ff146a5f4 100644 (file)
@@ -23,6 +23,7 @@
 #ifdef __KERNEL__
 
 #include <linux/types.h>
+#include <linux/kernel.h>
 #include <asm/byteorder.h>
 #include <asm/memory.h>
 #include <asm/barriers.h>
@@ -315,9 +316,105 @@ extern void _memset_io(unsigned long, int, size_t);
 
 extern void __readwrite_bug(const char *fn);
 
+/* Optimized copy functions to read from/write to IO sapce */
+#ifdef CONFIG_ARM64
+/*
+ * Copy data from IO memory space to "real" memory space.
+ */
+static inline
+void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t count)
+{
+       while (count && !IS_ALIGNED((unsigned long)from, 8)) {
+               *(u8 *)to = __raw_readb(from);
+               from++;
+               to++;
+               count--;
+       }
+
+       while (count >= 8) {
+               *(u64 *)to = __raw_readq(from);
+               from += 8;
+               to += 8;
+               count -= 8;
+       }
+
+       while (count) {
+               *(u8 *)to = __raw_readb(from);
+               from++;
+               to++;
+               count--;
+       }
+}
+
+/*
+ * Copy data from "real" memory space to IO memory space.
+ */
+static inline
+void __memcpy_toio(volatile void __iomem *to, const void *from, size_t count)
+{
+       while (count && !IS_ALIGNED((unsigned long)to, 8)) {
+               __raw_writeb(*(u8 *)from, to);
+               from++;
+               to++;
+               count--;
+       }
+
+       while (count >= 8) {
+               __raw_writeq(*(u64 *)from, to);
+               from += 8;
+               to += 8;
+               count -= 8;
+       }
+
+       while (count) {
+               __raw_writeb(*(u8 *)from, to);
+               from++;
+               to++;
+               count--;
+       }
+}
+
+/*
+ * "memset" on IO memory space.
+ */
+static inline
+void __memset_io(volatile void __iomem *dst, int c, size_t count)
+{
+       u64 qc = (u8)c;
+
+       qc |= qc << 8;
+       qc |= qc << 16;
+       qc |= qc << 32;
+
+       while (count && !IS_ALIGNED((unsigned long)dst, 8)) {
+               __raw_writeb(c, dst);
+               dst++;
+               count--;
+       }
+
+       while (count >= 8) {
+               __raw_writeq(qc, dst);
+               dst += 8;
+               count -= 8;
+       }
+
+       while (count) {
+               __raw_writeb(c, dst);
+               dst++;
+               count--;
+       }
+}
+#endif /* CONFIG_ARM64 */
+
+#ifdef CONFIG_ARM64
+#define memset_io(a, b, c)             __memset_io((a), (b), (c))
+#define memcpy_fromio(a, b, c)         __memcpy_fromio((a), (b), (c))
+#define memcpy_toio(a, b, c)           __memcpy_toio((a), (b), (c))
+#else
 #define memset_io(a, b, c)             memset((void *)(a), (b), (c))
 #define memcpy_fromio(a, b, c)         memcpy((a), (void *)(b), (c))
 #define memcpy_toio(a, b, c)           memcpy((void *)(a), (b), (c))
+#endif
 
 /*
  * If this architecture has ISA IO, then define the isa_read/isa_write
index b2913e8165a8c85ba473adb4f5abe7a210570364..47c223917a0298a2ca6e85a772d1599f4c78c9cf 100644 (file)
@@ -235,12 +235,18 @@ static void cache_disable(uint32_t cache_bit)
                /* if cache isn;t enabled no need to disable */
                if ((reg & CR_C) != CR_C)
                        return;
+#ifdef CONFIG_SYS_ARM_MMU
                /* if disabling data cache, disable mmu too */
                cache_bit |= CR_M;
+#endif
        }
        reg = get_cr();
 
+#ifdef CONFIG_SYS_ARM_MMU
        if (cache_bit == (CR_C | CR_M))
+#elif defined(CONFIG_SYS_ARM_MPU)
+       if (cache_bit == CR_C)
+#endif
                flush_dcache_all();
        set_cr(reg & ~cache_bit);
 }
index 0b564f7bd16647134a9e84be1044c9fa2e887b1f..99edcd9a247640e84e40ad0a621026e221bba5bb 100644 (file)
@@ -116,6 +116,13 @@ void board_init_f(ulong dummy)
        /* Perform EEPROM-based board detection */
        do_board_detect();
 
+#if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
+       ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(k3_avs),
+                                         &dev);
+       if (ret)
+               printf("AVS init failed: %d\n", ret);
+#endif
+
 #ifdef CONFIG_K3_AM654_DDRSS
        ret = uclass_get_device(UCLASS_RAM, 0, &dev);
        if (ret)
index 5e3813252baed24f5a6553e5444edee4860c53b2..d0bf86abeb222c078aacb075f2eeebc87da3b797 100644 (file)
@@ -118,6 +118,13 @@ void board_init_f(ulong dummy)
        preloader_console_init();
 #endif
 
+#if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
+       ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(k3_avs),
+                                         &dev);
+       if (ret)
+               printf("AVS init failed: %d\n", ret);
+#endif
+
 #if defined(CONFIG_K3_J721E_DDRSS)
        ret = uclass_get_device(UCLASS_RAM, 0, &dev);
        if (ret)
index 585edcf9d560fc7ac9c3f791924165695ab9413a..3c045a5e179d24264cfc54de1b8b9c4ad3384f7b 100755 (executable)
@@ -63,6 +63,21 @@ def append_bl31_node(file, atf_index, phy_addr, elf_entry):
     file.write('\t\t};\n')
     file.write('\n')
 
+def append_tee_node(file, atf_index, phy_addr, elf_entry):
+    # Append TEE DT node to input FIT dts file.
+    data = 'tee_0x%08x.bin' % phy_addr
+    file.write('\t\tatf_%d {\n' % atf_index)
+    file.write('\t\t\tdescription = \"TEE\";\n')
+    file.write('\t\t\tdata = /incbin/("%s");\n' % data)
+    file.write('\t\t\ttype = "tee";\n')
+    file.write('\t\t\tarch = "arm64";\n')
+    file.write('\t\t\tos = "tee";\n')
+    file.write('\t\t\tcompression = "none";\n')
+    file.write('\t\t\tload = <0x%08x>;\n' % phy_addr)
+    file.write('\t\t\tentry = <0x%08x>;\n' % elf_entry)
+    file.write('\t\t};\n')
+    file.write('\n')
+
 def append_fdt_node(file, dtbs):
     # Append FDT nodes.
     cnt = 1
@@ -115,15 +130,23 @@ def generate_atf_fit_dts_uboot(fit_file, uboot_file_name):
     index, entry, p_paddr, data = segments[0]
     fit_file.write(DT_UBOOT % p_paddr)
 
-def generate_atf_fit_dts_bl31(fit_file, bl31_file_name, dtbs_file_name):
+def generate_atf_fit_dts_bl31(fit_file, bl31_file_name, tee_file_name, dtbs_file_name):
     segments = unpack_elf(bl31_file_name)
     for index, entry, paddr, data in segments:
         append_bl31_node(fit_file, index + 1, paddr, entry)
+    num_segments = len(segments)
+
+    if tee_file_name:
+        tee_segments = unpack_elf(tee_file_name)
+        for index, entry, paddr, data in tee_segments:
+            append_tee_node(fit_file, num_segments + index + 1, paddr, entry)
+        num_segments = num_segments + len(tee_segments)
+
     append_fdt_node(fit_file, dtbs_file_name)
     fit_file.write(DT_IMAGES_NODE_END)
-    append_conf_node(fit_file, dtbs_file_name, len(segments))
+    append_conf_node(fit_file, dtbs_file_name, num_segments)
 
-def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_file_name):
+def generate_atf_fit_dts(fit_file_name, bl31_file_name, tee_file_name, uboot_file_name, dtbs_file_name):
     # Generate FIT script for ATF image.
     if fit_file_name != sys.stdout:
         fit_file = open(fit_file_name, "wb")
@@ -132,7 +155,7 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
 
     fit_file.write(DT_HEADER)
     generate_atf_fit_dts_uboot(fit_file, uboot_file_name)
-    generate_atf_fit_dts_bl31(fit_file, bl31_file_name, dtbs_file_name)
+    generate_atf_fit_dts_bl31(fit_file, bl31_file_name, tee_file_name, dtbs_file_name)
     fit_file.write(DT_END)
 
     if fit_file_name != sys.stdout:
@@ -144,6 +167,13 @@ def generate_atf_binary(bl31_file_name):
         with open(file_name, "wb") as atf:
             atf.write(data)
 
+def generate_tee_binary(tee_file_name):
+    if tee_file_name:
+        for index, entry, paddr, data in unpack_elf(tee_file_name):
+            file_name = 'tee_0x%08x.bin' % paddr
+            with open(file_name, "wb") as atf:
+                atf.write(data)
+
 def unpack_elf(filename):
     with open(filename, 'rb') as file:
         elf = file.read()
@@ -178,7 +208,14 @@ def main():
         logging.warning(' BL31 file bl31.elf NOT found, resulting binary is non-functional')
         logging.warning(' Please read Building section in doc/README.rockchip')
 
-    opts, args = getopt.getopt(sys.argv[1:], "o:u:b:h")
+    if "TEE" in os.environ:
+        tee_elf = os.getenv("TEE")
+    elif os.path.isfile("./tee.elf"):
+        tee_elf = "./tee.elf"
+    else:
+        tee_elf = ""
+
+    opts, args = getopt.getopt(sys.argv[1:], "o:u:b:t:h")
     for opt, val in opts:
         if opt == "-o":
             fit_its = val
@@ -186,14 +223,17 @@ def main():
             uboot_elf = val
         elif opt == "-b":
             bl31_elf = val
+        elif opt == "-t":
+            tee_elf = val
         elif opt == "-h":
             print(__doc__)
             sys.exit(2)
 
     dtbs = args
 
-    generate_atf_fit_dts(fit_its, bl31_elf, uboot_elf, dtbs)
+    generate_atf_fit_dts(fit_its, bl31_elf, tee_elf, uboot_elf, dtbs)
     generate_atf_binary(bl31_elf)
+    generate_tee_binary(tee_elf)
 
 if __name__ == "__main__":
     main()
index 95f0e3ccbead5120b9774b24c2afadce59884897..1b012f7f67aedfdcef220ddaf6ac0f0807af5e60 100644 (file)
@@ -14,8 +14,8 @@
 #define GRF_BASE       0x20008000
 
 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
-       [BROM_BOOTSOURCE_EMMC] = "dwmmc@1021c000",
-       [BROM_BOOTSOURCE_SD] = "dwmmc@10214000",
+       [BROM_BOOTSOURCE_EMMC] = "/dwmmc@1021c000",
+       [BROM_BOOTSOURCE_SD] = "/dwmmc@10214000",
 };
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
index cd0bf8a70cc09eb3e2bb9196e497bb43fa1063a4..562117e6c13aebdb411bd26a5dadd249e5a2acaf 100644 (file)
@@ -8,8 +8,8 @@
 #include <asm/arch-rockchip/hardware.h>
 
 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
-       [BROM_BOOTSOURCE_EMMC] = "dwmmc@30020000",
-       [BROM_BOOTSOURCE_SD] = "dwmmc@30000000",
+       [BROM_BOOTSOURCE_EMMC] = "/dwmmc@30020000",
+       [BROM_BOOTSOURCE_SD] = "/dwmmc@30000000",
 };
 
 #ifdef CONFIG_DEBUG_UART_BOARD_INIT
index 4ebc0792d55c423cd5e917980b49df72ed843723..afb62fca78e8308fdaebfdad9c3aeaf5823bbe9d 100644 (file)
@@ -67,6 +67,7 @@ config TARGET_FIREFLY_RK3288
        bool "Firefly-RK3288"
        select BOARD_LATE_INIT
        select SPL_BOARD_INIT if SPL
+       select TPL
        help
          Firefly is a RK3288-based development board with 2 USB ports,
          HDMI, VGA, micro-SD card, audio, WiFi  and Gigabit Ethernet, It
index 057ce920809ed04dcd26100e1fdb35da9aaa1e6c..987b4e0d58c2b732ae35486c93dfe7c4de55d4ca 100644 (file)
@@ -22,8 +22,8 @@ DECLARE_GLOBAL_DATA_PTR;
 #define GRF_BASE       0xff770000
 
 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
-       [BROM_BOOTSOURCE_EMMC] = "dwmmc@ff0f0000",
-       [BROM_BOOTSOURCE_SD] = "dwmmc@ff0c0000",
+       [BROM_BOOTSOURCE_EMMC] = "/dwmmc@ff0f0000",
+       [BROM_BOOTSOURCE_SD] = "/dwmmc@ff0c0000",
 };
 
 #ifdef CONFIG_SPL_BUILD
index c2448d727302963decc4ef3a50ab572ae05dd296..8c81242e5d4b711733eb3534a3dbc1fe80f107f7 100644 (file)
@@ -19,8 +19,8 @@ DECLARE_GLOBAL_DATA_PTR;
 #define FW_DDR_CON_REG         0xFF7C0040
 
 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
-       [BROM_BOOTSOURCE_EMMC] = "rksdmmc@ff520000",
-       [BROM_BOOTSOURCE_SD] = "rksdmmc@ff500000",
+       [BROM_BOOTSOURCE_EMMC] = "/rksdmmc@ff520000",
+       [BROM_BOOTSOURCE_SD] = "/rksdmmc@ff500000",
 };
 
 static struct mm_region rk3328_mem_map[] = {
index 7ccd417a18ce6ea54751d3121b3f22384d1090e4..20ae797794732bf884f770e4b19623af2c13b1c1 100644 (file)
@@ -54,8 +54,8 @@ static struct mm_region rk3368_mem_map[] = {
 struct mm_region *mem_map = rk3368_mem_map;
 
 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
-       [BROM_BOOTSOURCE_EMMC] = "dwmmc@ff0f0000",
-       [BROM_BOOTSOURCE_SD] = "dwmmc@ff0c0000",
+       [BROM_BOOTSOURCE_EMMC] = "/dwmmc@ff0f0000",
+       [BROM_BOOTSOURCE_SD] = "/dwmmc@ff0c0000",
 };
 
 #ifdef CONFIG_ARCH_EARLY_INIT_R
index 6660d05349b832de0f68be79ddd6b3df82ef5cc1..f781eacd1630ba7f50af05aba3d8450c9b6292df 100644 (file)
@@ -91,6 +91,9 @@ config TPL_STACK
 config TPL_TEXT_BASE
         default 0xff8c2000
 
+config SPL_STACK_R_ADDR
+       default 0x04000000
+
 source "board/rockchip/evb_rk3399/Kconfig"
 source "board/theobroma-systems/puma_rk3399/Kconfig"
 source "board/vamrs/rock960_rk3399/Kconfig"
index fc0a54214f8790d4f86ab7a5252f32b213d8123a..3770e0725857859c1606bccbc836c54e42304426 100644 (file)
@@ -1,5 +1,8 @@
 if ARCH_SOCFPGA
 
+config ERR_PTR_OFFSET
+       default 0xfffec000 if TARGET_SOCFPGA_GEN5 # Boot ROM range
+
 config NR_DRAM_BANKS
        default 1
 
index c038a6ddb0f4143520e0e23efe1ffff2619a10c9..8cc82f80b4652f0301435fb96a2df927b623cbb5 100644 (file)
@@ -1208,8 +1208,8 @@ config FSL_LAW
        help
                Use Freescale common code for Local Access Window
 
-config SECURE_BOOT
-       bool    "Secure Boot"
+config NXP_ESBC
+       bool    "NXP_ESBC"
        help
                Enable Freescale Secure Boot feature. Normally selected
                by defconfig. If unsure, do not change.
index cac928079042beaabf15ed903af215c4a209cd61..c2b2ef20414eeb877598d050b86d50d8c8b33822 100644 (file)
@@ -38,7 +38,7 @@
 #ifdef CONFIG_FSL_CAAM
 #include <fsl_sec.h>
 #endif
-#if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_CORENET)
+#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_CORENET)
 #include <asm/fsl_pamu.h>
 #include <fsl_secboot_err.h>
 #endif
@@ -440,7 +440,7 @@ ulong cpu_init_f(void)
 #ifdef CONFIG_SYS_DCSRBAR_PHYS
        ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 #endif
-#if defined(CONFIG_SECURE_BOOT) && !defined(CONFIG_SYS_RAMBOOT)
+#if defined(CONFIG_NXP_ESBC) && !defined(CONFIG_SYS_RAMBOOT)
        struct law_entry law;
 #endif
 #ifdef CONFIG_ARCH_MPC8548
@@ -460,7 +460,7 @@ ulong cpu_init_f(void)
        disable_tlb(14);
        disable_tlb(15);
 
-#if defined(CONFIG_SECURE_BOOT) && !defined(CONFIG_SYS_RAMBOOT)
+#if defined(CONFIG_NXP_ESBC) && !defined(CONFIG_SYS_RAMBOOT)
        /* Disable the LAW created for NOR flash by the PBI commands */
        law = find_law(CONFIG_SYS_PBI_FLASH_BASE);
        if (law.index != -1)
@@ -963,7 +963,7 @@ int cpu_init_r(void)
        fman_enet_init();
 #endif
 
-#if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_CORENET)
+#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_FSL_CORENET)
        if (pamu_init() < 0)
                fsl_secboot_handle_error(ERROR_ESBC_PAMU_INIT);
 #endif
index dbc705388c9610195f89776620e4aa29fa644e44..38e907f5ad51830c8fbfb5b8e1e9d695eca32101 100644 (file)
@@ -33,7 +33,7 @@
 #endif
 
 #if !defined(CONFIG_SPL) && !defined(CONFIG_SYS_RAMBOOT) && \
-       !defined(CONFIG_SECURE_BOOT) && !defined(CONFIG_SRIO_PCIE_BOOT_SLAVE)
+       !defined(CONFIG_NXP_ESBC) && !defined(CONFIG_SRIO_PCIE_BOOT_SLAVE)
 #define NOR_BOOT
 #endif
 
@@ -123,7 +123,7 @@ _start_e500:
 #endif
 
 
-#if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_E500MC) && \
+#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_E500MC) && \
        !defined(CONFIG_E6500)
        /* ISBC uses L2 as stack.
         * Disable L2 cache here so that u-boot can enable it later
@@ -467,7 +467,7 @@ nexti:      mflr    r1              /* R1 = our PC */
        blt     1b
 
 #if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !defined(MINIMAL_SPL) && \
-       !defined(CONFIG_SECURE_BOOT)
+       !defined(CONFIG_NXP_ESBC)
 /*
  * TLB entry for debuggging in AS1
  * Create temporary TLB entry in AS0 to handle debug exception
@@ -1065,7 +1065,7 @@ create_init_ram_area:
                0xffc00000, MAS3_SX|MAS3_SW|MAS3_SR, \
                0, r6
 
-#elif !defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SECURE_BOOT)
+#elif !defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_NXP_ESBC)
        /* create a temp mapping in AS = 1 for Flash mapping
         * created by PBL for ISBC code
         */
@@ -1080,7 +1080,7 @@ create_init_ram_area:
  * and for targets with CONFIG_SPL like T1, T2, T4, only for
  * u-boot-spl i.e. CONFIG_SPL_BUILD
  */
-#elif defined(CONFIG_RAMBOOT_PBL) && defined(CONFIG_SECURE_BOOT) && \
+#elif defined(CONFIG_RAMBOOT_PBL) && defined(CONFIG_NXP_ESBC) && \
        (!defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD))
        /* create a temp mapping in AS = 1 for mapping CONFIG_SYS_MONITOR_BASE
         * to L3 Address configured by PBL for ISBC code
index 30f35e25e3e21967957cdae746ac8eb85489c8e4..ca9e6aa8eb102cafeb7c44c4bd40c25c6d445e85 100644 (file)
@@ -259,7 +259,7 @@ void init_laws(void)
 #error FSL_HW_NUM_LAWS can not be greater than 32 w/o code changes
 #endif
 
-#if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_E500) && \
+#if defined(CONFIG_NXP_ESBC) && defined(CONFIG_E500) && \
                                                !defined(CONFIG_E500MC)
        /* ISBC (Boot ROM) creates a LAW 0 entry for non PBL platforms,
         * which is not disabled before transferring the control to uboot.
@@ -268,7 +268,7 @@ void init_laws(void)
        disable_law(0);
 #endif
 
-#if !defined(CONFIG_SECURE_BOOT)
+#if !defined(CONFIG_NXP_ESBC)
        /*
         * if any non DDR LAWs has been created earlier, remove them before
         * LAW table is parsed.
index 021c85f00f434e5359bf179f1c77bb171273ed68..3195351c9c38ef29fe7adaf85fb69c8718c92f52 100644 (file)
@@ -8,6 +8,7 @@ dtb-$(CONFIG_TARGET_P2041RDB) += p2041rdb.dtb
 dtb-$(CONFIG_TARGET_P3041DS) += p3041ds.dtb
 dtb-$(CONFIG_TARGET_P4080DS) += p4080ds.dtb
 dtb-$(CONFIG_TARGET_P5040DS) += p5040ds.dtb
+dtb-$(CONFIG_TARGET_SOCRATES) += socrates.dtb
 dtb-$(CONFIG_TARGET_T1024RDB) += t1024rdb.dtb
 dtb-$(CONFIG_TARGET_T1042D4RDB) += t1042d4rdb.dtb
 dtb-$(CONFIG_TARGET_T2080QDS) += t2080qds.dtb
diff --git a/arch/powerpc/dts/socrates-u-boot.dtsi b/arch/powerpc/dts/socrates-u-boot.dtsi
new file mode 100644 (file)
index 0000000..14a7c24
--- /dev/null
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de
+ */
+/ {
+       binman {
+               filename = "u-boot-socrates.bin";
+               pad-byte = <0xff>;
+               // Place dtb one sector before u-boot-nodtb.bin
+               blob {
+                       filename = "dts/dt.dtb";
+               };
+               u-boot-nodtb {
+                       filename = "u-boot-nodtb.bin";
+                       offset = <0x20000>;
+               };
+       };
+
+       chosen {
+               stdout-path = &serial0;
+       };
+
+       soc8544@e0000000 {
+               i2c@3000 {
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&pci0 {
+       clock-frequency = <33000000>;
+       ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                 0x01000000 0x0 0xe2000000 0xe2000000 0x0 0x01000000>;
+};
+
+&serial0 {
+       u-boot,dm-pre-reloc;
+       clock-frequency = <333333330>;
+};
diff --git a/arch/powerpc/dts/socrates.dts b/arch/powerpc/dts/socrates.dts
new file mode 100644 (file)
index 0000000..452cf58
--- /dev/null
@@ -0,0 +1,349 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Device Tree Source for the Socrates board (MPC8544).
+ *
+ * Copyright (c) 2008 Emcraft Systems.
+ * Sergei Poselenov, <sposelenov@emcraft.com>
+ *
+ */
+
+/dts-v1/;
+
+/ {
+       model = "abb,socrates";
+       compatible = "abb,socrates";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       aliases {
+               ethernet0 = &enet0;
+               ethernet1 = &enet1;
+               serial0 = &serial0;
+               serial1 = &serial1;
+               pci0 = &pci0;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               PowerPC,8544@0 {
+                       device_type = "cpu";
+                       reg = <0>;
+                       d-cache-line-size = <32>;
+                       i-cache-line-size = <32>;
+                       d-cache-size = <0x8000>;        // L1, 32K
+                       i-cache-size = <0x8000>;        // L1, 32K
+                       timebase-frequency = <0>;
+                       bus-frequency = <0>;
+                       clock-frequency = <0>;
+                       next-level-cache = <&L2>;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x00000000>;  // Filled in by U-Boot
+       };
+
+       soc8544@e0000000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               device_type = "soc";
+
+               ranges = <0x00000000 0xe0000000 0x00100000>;
+               bus-frequency = <0>;            // Filled in by U-Boot
+               compatible = "fsl,mpc8544-immr", "simple-bus";
+
+               ecm-law@0 {
+                       compatible = "fsl,ecm-law";
+                       reg = <0x0 0x1000>;
+                       fsl,num-laws = <10>;
+               };
+
+               ecm@1000 {
+                       compatible = "fsl,mpc8544-ecm", "fsl,ecm";
+                       reg = <0x1000 0x1000>;
+                       interrupts = <17 2>;
+                       interrupt-parent = <&mpic>;
+               };
+
+               memory-controller@2000 {
+                       compatible = "fsl,mpc8544-memory-controller";
+                       reg = <0x2000 0x1000>;
+                       interrupt-parent = <&mpic>;
+                       interrupts = <18 2>;
+               };
+
+               L2: l2-cache-controller@20000 {
+                       compatible = "fsl,mpc8544-l2-cache-controller";
+                       reg = <0x20000 0x1000>;
+                       cache-line-size = <32>;
+                       cache-size = <0x40000>; // L2, 256K
+                       interrupt-parent = <&mpic>;
+                       interrupts = <16 2>;
+               };
+
+               i2c@3000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       cell-index = <0>;
+                       compatible = "fsl,mpc8544-i2c", "fsl-i2c";
+                       reg = <0x3000 0x100>;
+                       interrupts = <43 2>;
+                       interrupt-parent = <&mpic>;
+                       fsl,preserve-clocking;
+
+                       dtt@28 {
+                               compatible = "winbond,w83782d";
+                               reg = <0x28>;
+                       };
+                       rtc@32 {
+                               compatible = "epson,rx8025";
+                               reg = <0x32>;
+                               interrupts = <7 1>;
+                               interrupt-parent = <&mpic>;
+                       };
+                       dtt@4c {
+                               compatible = "dallas,ds75";
+                               reg = <0x4c>;
+                       };
+                       ts@4a {
+                               compatible = "ti,tsc2003";
+                               reg = <0x4a>;
+                               interrupt-parent = <&mpic>;
+                               interrupts = <8 1>;
+                       };
+               };
+
+               i2c@3100 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       cell-index = <1>;
+                       compatible = "fsl,mpc8544-i2c", "fsl-i2c";
+                       reg = <0x3100 0x100>;
+                       interrupts = <43 2>;
+                       interrupt-parent = <&mpic>;
+                       fsl,preserve-clocking;
+               };
+
+               enet0: ethernet@24000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       cell-index = <0>;
+                       device_type = "network";
+                       model = "eTSEC";
+                       compatible = "gianfar";
+                       reg = <0x24000 0x1000>;
+                       ranges = <0x0 0x24000 0x1000>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <29 2 30 2 34 2>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy0>;
+                       tbi-handle = <&tbi0>;
+                       phy-connection-type = "rgmii-id";
+
+                       mdio@520 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,gianfar-mdio";
+                               reg = <0x520 0x20>;
+
+                               phy0: ethernet-phy@0 {
+                                       interrupt-parent = <&mpic>;
+                                       interrupts = <0 1>;
+                                       reg = <0>;
+                               };
+                               phy1: ethernet-phy@1 {
+                                       interrupt-parent = <&mpic>;
+                                       interrupts = <0 1>;
+                                       reg = <1>;
+                               };
+                               tbi0: tbi-phy@11 {
+                                       reg = <0x11>;
+                               };
+                       };
+               };
+
+               enet1: ethernet@26000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       cell-index = <1>;
+                       device_type = "network";
+                       model = "eTSEC";
+                       compatible = "gianfar";
+                       reg = <0x26000 0x1000>;
+                       ranges = <0x0 0x26000 0x1000>;
+                       local-mac-address = [ 00 00 00 00 00 00 ];
+                       interrupts = <31 2 32 2 33 2>;
+                       interrupt-parent = <&mpic>;
+                       phy-handle = <&phy1>;
+                       tbi-handle = <&tbi1>;
+                       phy-connection-type = "rgmii-id";
+
+                       mdio@520 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,gianfar-tbi";
+                               reg = <0x520 0x20>;
+
+                               tbi1: tbi-phy@11 {
+                                       reg = <0x11>;
+                               };
+                       };
+               };
+
+               serial0: serial@4500 {
+                       cell-index = <0>;
+                       device_type = "serial";
+                       compatible = "fsl,ns16550", "ns16550";
+                       reg = <0x4500 0x100>;
+                       clock-frequency = <0>;
+                       interrupts = <42 2>;
+                       interrupt-parent = <&mpic>;
+               };
+
+               serial1: serial@4600 {
+                       cell-index = <1>;
+                       device_type = "serial";
+                       compatible = "fsl,ns16550", "ns16550";
+                       reg = <0x4600 0x100>;
+                       clock-frequency = <0>;
+                       interrupts = <42 2>;
+                       interrupt-parent = <&mpic>;
+               };
+
+               global-utilities@e0000 {        //global utilities block
+                       compatible = "fsl,mpc8548-guts";
+                       reg = <0xe0000 0x1000>;
+                       fsl,has-rstcr;
+               };
+
+               mpic: pic@40000 {
+                       interrupt-controller;
+                       #address-cells = <0>;
+                       #interrupt-cells = <2>;
+                       reg = <0x40000 0x40000>;
+                       compatible = "chrp,open-pic";
+                       device_type = "open-pic";
+               };
+       };
+
+
+       localbus {
+               compatible = "fsl,mpc8544-localbus",
+                            "fsl,pq3-localbus",
+                            "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               reg = <0xe0005000 0x40>;
+               interrupt-parent = <&mpic>;
+               interrupts = <19 2>;
+
+               ranges = <0 0 0xfc000000 0x04000000
+                         2 0 0xc8000000 0x04000000
+                         3 0 0xc0000000 0x00100000
+                       >; /* Overwritten by U-Boot */
+
+               nor_flash@0,0 {
+                       compatible = "amd,s29gl256n", "cfi-flash";
+                       bank-width = <2>;
+                       reg = <0x0 0x000000 0x4000000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       partition@0 {
+                               label = "kernel";
+                               reg = <0x0 0x1e0000>;
+                               read-only;
+                       };
+                       partition@1e0000 {
+                               label = "dtb";
+                               reg = <0x1e0000 0x20000>;
+                       };
+                       partition@200000 {
+                               label = "root";
+                               reg = <0x200000 0x200000>;
+                       };
+                       partition@400000 {
+                               label = "user";
+                               reg = <0x400000 0x3b80000>;
+                       };
+                       partition@3f80000 {
+                               label = "env";
+                               reg = <0x3f80000 0x40000>;
+                               read-only;
+                       };
+                       partition@3fc0000 {
+                               label = "u-boot";
+                               reg = <0x3fc0000 0x40000>;
+                               read-only;
+                       };
+               };
+
+               display@2,0 {
+                       compatible = "fujitsu,lime";
+                       reg = <2 0x0 0x4000000>;
+                       interrupt-parent = <&mpic>;
+                       interrupts = <6 1>;
+               };
+
+               fpga_pic: fpga-pic@3,10 {
+                       compatible = "abb,socrates-fpga-pic";
+                       reg = <3 0x10 0x10>;
+                       interrupt-controller;
+                       /* IRQs 2, 10, 11, active low, level-sensitive */
+                       interrupts = <2 1 10 1 11 1>;
+                       interrupt-parent = <&mpic>;
+                       #interrupt-cells = <3>;
+               };
+
+               spi@3,60 {
+                       compatible = "abb,socrates-spi";
+                       reg = <3 0x60 0x10>;
+                       interrupts = <8 4 0>;   // number, type, routing
+                       interrupt-parent = <&fpga_pic>;
+               };
+
+               nand@3,70 {
+                       compatible = "abb,socrates-nand";
+                       reg = <3 0x70 0x04>;
+                       bank-width = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       data@0 {
+                               label = "data";
+                               reg = <0x0 0x40000000>;
+                       };
+               };
+
+               can@3,100 {
+                       compatible = "philips,sja1000";
+                       reg = <3 0x100 0x80>;
+                       interrupts = <2 8 1>;   // number, type, routing
+                       interrupt-parent = <&fpga_pic>;
+               };
+       };
+
+       pci0: pci@e0008000 {
+               #interrupt-cells = <1>;
+               #size-cells = <2>;
+               #address-cells = <3>;
+               compatible = "fsl,mpc8540-pci";
+               device_type = "pci";
+               reg = <0xe0008000 0x1000>;
+               clock-frequency = <66666666>;
+
+               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
+               interrupt-map = <
+                               /* IDSEL 0x11 */
+                                0x8800 0x0 0x0 1 &mpic 5 1
+                               /* IDSEL 0x12 */
+                                0x9000 0x0 0x0 1 &mpic 4 1>;
+               interrupt-parent = <&mpic>;
+               interrupts = <24 2>;
+               bus-range = <0x0 0x0>;
+               ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x20000000
+                         0x01000000 0x0 0x00000000 0xe2000000 0x0 0x01000000>;
+       };
+
+};
index 64c10074a896d2dd2001ee10826d17d25915c0bd..035bf1246766ba7c65281b4780a77041ef3c262d 100644 (file)
@@ -7,7 +7,7 @@
 #define __FSL_SECURE_BOOT_H
 #include <asm/config_mpc85xx.h>
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #if defined(CONFIG_FSL_CORENET)
 #define CONFIG_SYS_PBI_FLASH_BASE              0xc0000000
 #elif defined(CONFIG_TARGET_BSC9132QDS)
@@ -74,7 +74,7 @@
  */
 #define CONFIG_FSL_ISBC_KEY_EXT
 #endif
-#endif /* #ifdef CONFIG_SECURE_BOOT */
+#endif /* #ifdef CONFIG_NXP_ESBC */
 
 #ifdef CONFIG_CHAIN_OF_TRUST
 #ifdef CONFIG_SPL_BUILD
index 8b89c10aba6cec63d5fb8ddb7394669485ff87c9..1b1fd69cb216d8ce1ad12473452f76b1c47c4b62 100644 (file)
@@ -1,5 +1,5 @@
 config CHAIN_OF_TRUST
-       depends on !FIT_SIGNATURE && SECURE_BOOT
+       depends on !FIT_SIGNATURE && NXP_ESBC
        imply CMD_BLOB
        imply CMD_HASH if ARM
        select FSL_CAAM
index a9d61a8bcf5b95670e1208a44a73231e96134b5c..b0e109f0b82d2304e7e0050d556b22875f4267c8 100644 (file)
@@ -75,7 +75,7 @@ obj-$(CONFIG_TARGET_P5040DS)  += p_corenet/
 
 obj-$(CONFIG_LAYERSCAPE_NS_ACCESS)     += ns_access.o
 
-ifdef CONFIG_SECURE_BOOT
+ifdef CONFIG_NXP_ESBC
 obj-$(CONFIG_CMD_ESBC_VALIDATE) += fsl_validate.o cmd_esbc_validate.o
 endif
 obj-$(CONFIG_CHAIN_OF_TRUST) += fsl_chain_of_trust.o
index 3d9459b133a869138850a923ed110bbfa5e7c33b..c0ab1a5fd14e337ba4ef0998a4fb683ee78068dd 100644 (file)
@@ -43,7 +43,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
        /* *I*** - Covers boot page */
 #if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L3_ADDR)
 
-#if !defined(CONFIG_SECURE_BOOT)
+#if !defined(CONFIG_NXP_ESBC)
        /*
         * *I*G - L3SRAM. When L3 is used as 1M SRAM, the address of the
         * SRAM is at 0xfff00000, it covered the 0xfffff000.
index fbd9a2691b88ee9c360235ed1e1033c45880af39..9bc78d6543dd15c0a218922276675340b3d16ff4 100644 (file)
@@ -196,7 +196,7 @@ int board_init(void)
        init_final_memctl_regs();
 #endif
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
        /* In case of Secure Boot, the IBR configures the SMMU
         * to allow only Secure transactions.
         * SMMU must be reset in bypass mode.
index 41412a76b695620799a6f46a7a368014a1e6f838..ac2f8ee4368048c665075273de8bf36819f12b29 100644 (file)
@@ -126,7 +126,7 @@ int checkboard(void)
 
 int board_init(void)
 {
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
        /*
         * In case of Secure Boot, the IBR configures the SMMU
         * to allow only Secure transactions.
index b71c1746bb2672f65a20ab8db687d13c151d9ca1..6a51dcd649133360a17a016d9bbd559b4ee84694 100644 (file)
@@ -407,7 +407,7 @@ int board_init(void)
        ppa_init();
 #endif
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
        /*
         * In case of Secure Boot, the IBR configures the SMMU
         * to allow only Secure transactions.
index 0a73fe859d9ba8898b54782b4a29b2199e7b8bd7..cc6bd883c3d9bb29e5a9c3925ac5089093020bf3 100644 (file)
@@ -69,7 +69,7 @@ int board_init(void)
 {
        struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
        /*
         * In case of Secure Boot, the IBR configures the SMMU
         * to allow only Secure transactions.
index 91c80353edd61a36ec2c24443afa59cdccafc7c7..25e80c8ac621cb055d1801008d9fa40356f247d6 100644 (file)
@@ -20,6 +20,7 @@
 #include <hwconfig.h>
 #include <fsl_sec.h>
 #include <asm/arch/ppa.h>
+#include <asm/arch-fsl-layerscape/fsl_icid.h>
 
 
 #include "../common/qixis.h"
@@ -358,6 +359,8 @@ int ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_board_enet(blob);
 #endif
 
+       fdt_fixup_icid(blob);
+
        return 0;
 }
 #endif
index e20267f27ce06d35d40d1f1737198062fc9e73a2..6a1b8e3f53e945944a6897ae4ceb54aac906b355 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/arch/soc.h>
 #include <asm/arch/ppa.h>
 #include <fsl_sec.h>
+#include <asm/arch-fsl-layerscape/fsl_icid.h>
 
 #ifdef CONFIG_FSL_QIXIS
 #include "../common/qixis.h"
@@ -478,6 +479,8 @@ int ft_board_setup(void *blob, bd_t *bd)
        fdt_fixup_board_enet(blob);
 #endif
 
+       fdt_fixup_icid(blob);
+
        return 0;
 }
 #endif
index b509c0312e6ddad021bd25bf608a437c226c41fb..eff12747b411d061032c98535e381d8ff6f6d519 100644 (file)
@@ -27,6 +27,7 @@
 #include "../common/qixis.h"
 #include "../common/vid.h"
 #include <fsl_immap.h>
+#include <asm/arch-fsl-layerscape/fsl_icid.h>
 
 #ifdef CONFIG_EMC2305
 #include "../common/emc2305.h"
@@ -684,6 +685,7 @@ int ft_board_setup(void *blob, bd_t *bd)
        fdt_fsl_mc_fixup_iommu_map_entry(blob);
        fdt_fixup_board_enet(blob);
 #endif
+       fdt_fixup_icid(blob);
 
        return 0;
 }
index 6511c04f31a19617642fa0101888922bc100d87d..9dcba7933ff99c0bbf8b336b111129e765b67306 100644 (file)
@@ -28,7 +28,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
        /* TLB 1 */
        /* *I*** - Covers boot page */
 #if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L3_ADDR) && \
-       !defined(CONFIG_SECURE_BOOT)
+       !defined(CONFIG_NXP_ESBC)
        /*
         * *I*G - L3SRAM. When L3 is used as 256K SRAM, the address of the
         * SRAM is at 0xfffc0000, it covered the 0xfffff000.
@@ -37,7 +37,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 0, BOOKE_PAGESZ_256K, 1),
 
-#elif defined(CONFIG_SECURE_BOOT) && defined(CONFIG_SPL_BUILD)
+#elif defined(CONFIG_NXP_ESBC) && defined(CONFIG_SPL_BUILD)
        /*
         * *I*G - L3SRAM. When L3 is used as 256K SRAM, in case of Secure Boot
         * the physical address of the SRAM is at 0xbffc0000,
index ee77ce077c1ae319067fc94877ca1efe186163c8..43f049e592feb63be08eaa978e96862d6d9fdbe6 100644 (file)
@@ -141,6 +141,7 @@ void spl_board_prepare_for_linux(void)
 int misc_init_r(void)
 {
        twl4030_power_init();
+       twl4030_power_mmc_init(0);
        omap_die_id_display();
        return 0;
 }
diff --git a/board/phytium/durian/Kconfig b/board/phytium/durian/Kconfig
new file mode 100644 (file)
index 0000000..dc07109
--- /dev/null
@@ -0,0 +1,12 @@
+if TARGET_DURIAN
+
+config SYS_BOARD
+       default "durian"
+
+config SYS_VENDOR
+       default "phytium"
+
+config SYS_CONFIG_NAME
+       default "durian"
+
+endif
diff --git a/board/phytium/durian/MAINTAINERS b/board/phytium/durian/MAINTAINERS
new file mode 100644 (file)
index 0000000..895b762
--- /dev/null
@@ -0,0 +1,8 @@
+DURIAN BOARD
+M:     liuhao <liuhao@phytium.com.cn>
+M:     shuyiqi <shuyiqi@phytium.com.cn>
+S:     Maintained
+F:     board/phytium/durian/*
+F:     include/configs/durian.h
+F:     configs/durian_defconfig
+
diff --git a/board/phytium/durian/Makefile b/board/phytium/durian/Makefile
new file mode 100644 (file)
index 0000000..c2fbf19
--- /dev/null
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2019
+# shuyiqi  <shuyiqi@phytium.com.cn>
+# liuhao   <liuhao@phytium.com.cn>
+#
+
+obj-y += durian.o
+
diff --git a/board/phytium/durian/README b/board/phytium/durian/README
new file mode 100644 (file)
index 0000000..4443133
--- /dev/null
@@ -0,0 +1,59 @@
+Here is the step-by-step to boot U-Boot on phytium durian board.
+
+Compile U-Boot
+==============
+  > make durian_defconfig
+  > make
+
+Get the prebuild binary about BPF
+=================================
+  > cd ../
+  > git clone https://github.com/phytium-durian/bpf.git
+
+Package the image
+=================
+  > cd bpf
+  > cp ../u-boot/u-boot.bin ./
+  > ./dopack
+
+  The fip-all.bin is the final image.
+
+Flash the image into the spi nor-flash
+======================================
+  Any spi nor-flash and appropriate tool can be used to flash.
+  For example, we choose the S25FL256 chip that produced from
+  SPANSION company and EZP_XPro V1.2.
+
+Reset the board, you can get U-Boot log message from boot console:
+
+Power on...
+Start pcie setup!
+End pcie setup!
+Start ddr setup!
+End ddr setup!
+Jump to entrypoint: 0x500000
+
+U-Boot 2019.10-00594-g9ccc1b17ea-dirty (Oct 18 2019 - 00:17:09 +0800)
+
+DRAM:  1.9 GiB
+In:    uart@28001000
+Out:   uart@28001000
+Err:   uart@28001000
+scanning bus for devices...
+Target spinup took 0 ms.
+SATA link 1 timeout.
+SATA link 2 timeout.
+SATA link 3 timeout.
+AHCI 0001.0000 32 slots 4 ports 6 Gbps 0xf impl SATA mode
+flags: 64bit ncq led only pmp fbss pio slum part sxs
+  Device 0: (0:0) Vendor: ATA Prod.: ST1000DM010-2EP1 Rev: CC43
+            Type: Hard Disk
+            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
+SATA link 0 timeout.
+SATA link 1 timeout.
+SATA link 2 timeout.
+SATA link 3 timeout.
+AHCI 0001.0000 32 slots 4 ports 6 Gbps 0xf impl SATA mode
+flags: 64bit ncq led only pmp fbss pio slum part sxs
+Hit any key to stop autoboot:  0
+durian#
diff --git a/board/phytium/durian/cpu.h b/board/phytium/durian/cpu.h
new file mode 100644 (file)
index 0000000..a5a213d
--- /dev/null
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2019
+ * Phytium Technology Ltd <www.phytium.com>
+ * shuyiqi <shuyiqi@phytium.com.cn>
+ */
+
+#ifndef _FT_DURIAN_H
+#define _FT_DURIAN_H
+
+/* FLUSH L3 CASHE */
+#define HNF_COUNT           0x8
+#define HNF_PSTATE_REQ      (HNF_BASE + 0x10)
+#define HNF_PSTATE_STAT     (HNF_BASE + 0x18)
+#define HNF_PSTATE_OFF      0x0
+#define HNF_PSTATE_SFONLY   0x1
+#define HNF_PSTATE_HALF     0x2
+#define HNF_PSTATE_FULL     0x3
+#define HNF_STRIDE          0x10000
+#define HNF_BASE            (unsigned long)(0x3A200000)
+
+#endif /* _FT_DURIAN_H */
+
diff --git a/board/phytium/durian/durian.c b/board/phytium/durian/durian.c
new file mode 100644 (file)
index 0000000..59f307d
--- /dev/null
@@ -0,0 +1,110 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019
+ * shuyiqi <shuyiqi@phytium.com.cn>
+ * liuhao  <liuhao@phytium.com.cn>
+ */
+
+#include <common.h>
+#include <asm/armv8/mmu.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <linux/arm-smccc.h>
+#include <linux/kernel.h>
+#include <scsi.h>
+#include "cpu.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+       gd->mem_clk = 0;
+       gd->ram_size = PHYS_SDRAM_1_SIZE;
+       return 0;
+}
+
+int dram_init_banksize(void)
+{
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size =  PHYS_SDRAM_1_SIZE;
+
+       return 0;
+}
+
+int board_init(void)
+{
+       return 0;
+}
+
+void reset_cpu(ulong addr)
+{
+       struct arm_smccc_res res;
+
+       arm_smccc_smc(0x84000009, 0, 0, 0, 0, 0, 0, 0, &res);
+       debug("reset cpu error, %lx\n", res.a0);
+}
+
+static struct mm_region durian_mem_map[] = {
+       {
+               .virt = 0x0UL,
+               .phys = 0x0UL,
+               .size = 0x80000000UL,
+               .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+                                PTE_BLOCK_NON_SHARE |
+                                PTE_BLOCK_PXN |
+                                PTE_BLOCK_UXN
+       },
+       {
+               .virt = (u64)PHYS_SDRAM_1,
+               .phys = (u64)PHYS_SDRAM_1,
+               .size = (u64)PHYS_SDRAM_1_SIZE,
+               .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+                                PTE_BLOCK_NS |
+                                PTE_BLOCK_INNER_SHARE
+       },
+       {
+               0,
+       }
+};
+
+struct mm_region *mem_map = durian_mem_map;
+
+int print_cpuinfo(void)
+{
+       printf("CPU: Phytium ft2004 %ld MHz\n", gd->cpu_clk);
+       return 0;
+}
+
+int __asm_flush_l3_dcache(void)
+{
+       int i, pstate;
+
+       for (i = 0; i < HNF_COUNT; i++)
+               writeq(HNF_PSTATE_SFONLY, HNF_PSTATE_REQ + i * HNF_STRIDE);
+       for (i = 0; i < HNF_COUNT; i++) {
+               do {
+                       pstate = readq(HNF_PSTATE_STAT + i * HNF_STRIDE);
+               } while ((pstate & 0xf) != (HNF_PSTATE_SFONLY << 2));
+       }
+
+       for (i = 0; i < HNF_COUNT; i++)
+               writeq(HNF_PSTATE_FULL, HNF_PSTATE_REQ + i * HNF_STRIDE);
+
+       return 0;
+}
+
+int last_stage_init(void)
+{
+       int ret;
+
+       /* pci e */
+       pci_init();
+       /* scsi scan */
+       ret = scsi_scan(true);
+       if (ret) {
+               printf("scsi scan failed\n");
+               return CMD_RET_FAILURE;
+       }
+       return ret;
+}
+
index f8299d94601ca2a7e89512abb77b6ced606a09ec..139791795ec129cef69a5d681e53c93351305ea6 100644 (file)
@@ -24,6 +24,12 @@ S:   Maintained
 F:     configs/khadas-edge-v-rk3399_defconfig
 F:     arch/arm/dts/rk3399-khadas-edge-v-u-boot.dtsi
 
+LEEZ-P710
+M:     Andy Yan <andy.yan@rock-chips.com>
+S:      Maintained
+F:     arch/arm/dts/rk3399-leez-p710-u-boot.dtsi
+F:     configs/leez-rk3399_defconfig
+
 NANOPC-T4
 M:     Jagan Teki <jagan@amarulasolutions.com>
 S:     Maintained
index 293b8e6d018b0866ecc510c9d19829935353c2e3..2b27a73c18c5663dfd6296700478c1a29cb42bb2 100644 (file)
@@ -1,6 +1,8 @@
 SOCRATES BOARD
-#M:    -
+M:     Heiko Schocher <hs@denx.de>
 S:     Maintained
 F:     board/socrates/
 F:     include/configs/socrates.h
 F:     configs/socrates_defconfig
+F:     arch/powerpc/dts/socrates.dts
+F:     arch/powerpc/dts/socrates-u-boot.dtsi
index 44703e8aca4b6eae3b6c50485de679fd001ee0e3..840941b63e504474aef33e28c5ac2b3f74eeadea 100644 (file)
@@ -31,9 +31,7 @@
 
 struct law_entry law_table[] = {
        SET_LAW(CONFIG_SYS_DDR_SDRAM_BASE, LAW_SIZE_512M, LAW_TRGT_IF_DDR),
-       SET_LAW(CONFIG_SYS_PCI1_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCI),
        SET_LAW(CONFIG_SYS_LBC_FLASH_BASE, LAW_SIZE_64M, LAW_TRGT_IF_LBC),
-       SET_LAW(CONFIG_SYS_PCI1_IO_PHYS, LAW_SIZE_16M, LAW_TRGT_IF_PCI),
 #if defined(CONFIG_SYS_FPGA_BASE)
        SET_LAW(CONFIG_SYS_FPGA_BASE, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
 #endif
index da9ae5bebb7e01cad5d5c4cb9f27c11af7408e47..5f58b4c21bd6c1acec6c4a94fc030e9babda88b1 100644 (file)
@@ -50,7 +50,7 @@ int checkboard (void)
        }
        putc('\n');
 
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) || defined(CONFIG_DM_PCI)
        /* Check the PCI_clk sel bit */
        if (in_be32(&gur->porpllsr) & (1<<15)) {
                src = "SYSCLK";
@@ -126,6 +126,10 @@ int misc_init_r (void)
                               &flash_info[CONFIG_SYS_MAX_FLASH_BANKS - 1]);
        }
 
+#if defined(CONFIG_DM_PCI)
+       pci_init();
+#endif
+
        return 0;
 }
 
@@ -168,40 +172,6 @@ void local_bus_init (void)
        upmconfig (UPMB, (uint *)UPMTableB, sizeof(UPMTableB)/sizeof(int));
 }
 
-#if defined(CONFIG_PCI)
-/*
- * Initialize PCI Devices, report devices found.
- */
-
-#ifndef CONFIG_PCI_PNP
-static struct pci_config_table pci_mpc85xxads_config_table[] = {
-       {PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-        PCI_IDSEL_NUMBER, PCI_ANY_ID,
-        pci_cfgfunc_config_device, {PCI_ENET0_IOADDR,
-                                    PCI_ENET0_MEMADDR,
-                                    PCI_COMMAND_MEMORY |
-                                    PCI_COMMAND_MASTER}},
-       {}
-};
-#endif
-
-
-static struct pci_controller hose = {
-#ifndef CONFIG_PCI_PNP
-       config_table:pci_mpc85xxads_config_table,
-#endif
-};
-
-#endif /* CONFIG_PCI */
-
-
-void pci_init_board (void)
-{
-#ifdef CONFIG_PCI
-       pci_mpc85xx_init (&hose);
-#endif /* CONFIG_PCI */
-}
-
 #ifdef CONFIG_BOARD_EARLY_INIT_R
 int board_early_init_r (void)
 {
@@ -231,6 +201,7 @@ int ft_board_setup(void *blob, bd_t *bd)
        val[i++] = gd->bd->bi_flashstart;
        val[i++] = gd->bd->bi_flashsize;
 
+#if defined(CONFIG_VIDEO_MB862xx)
        if (mb862xx.frameAdrs == CONFIG_SYS_LIME_BASE) {
                /* Fixup LIME mapping */
                val[i++] = 2;                   /* chip select number */
@@ -238,6 +209,7 @@ int ft_board_setup(void *blob, bd_t *bd)
                val[i++] = CONFIG_SYS_LIME_BASE;
                val[i++] = CONFIG_SYS_LIME_SIZE;
        }
+#endif
 
        /* Fixup FPGA mapping */
        val[i++] = 3;                           /* chip select number */
@@ -255,180 +227,22 @@ int ft_board_setup(void *blob, bd_t *bd)
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
 
-#define DEFAULT_BRIGHTNESS     25
-#define BACKLIGHT_ENABLE       (1 << 31)
-
-static const gdc_regs init_regs [] =
-{
-       {0x0100, 0x00010f00},
-       {0x0020, 0x801901df},
-       {0x0024, 0x00000000},
-       {0x0028, 0x00000000},
-       {0x002c, 0x00000000},
-       {0x0110, 0x00000000},
-       {0x0114, 0x00000000},
-       {0x0118, 0x01df0320},
-       {0x0004, 0x041f0000},
-       {0x0008, 0x031f031f},
-       {0x000c, 0x017f0349},
-       {0x0010, 0x020c0000},
-       {0x0014, 0x01df01e9},
-       {0x0018, 0x00000000},
-       {0x001c, 0x01e00320},
-       {0x0100, 0x80010f00},
-       {0x0, 0x0}
-};
-
-const gdc_regs *board_get_regs (void)
-{
-       return init_regs;
-}
-
-int lime_probe(void)
-{
-       uint cfg_br2;
-       uint cfg_or2;
-       int type;
-
-       cfg_br2 = get_lbc_br(2);
-       cfg_or2 = get_lbc_or(2);
-
-       /* Configure GPCM for CS2 */
-       set_lbc_br(2, 0);
-       set_lbc_or(2, 0xfc000410);
-       set_lbc_br(2, (CONFIG_SYS_LIME_BASE) | 0x00001901);
-
-       /* Get controller type */
-       type = mb862xx_probe(CONFIG_SYS_LIME_BASE);
-
-       /* Restore previous CS2 configuration */
-       set_lbc_br(2, 0);
-       set_lbc_or(2, cfg_or2);
-       set_lbc_br(2, cfg_br2);
-
-       return (type == MB862XX_TYPE_LIME) ? 1 : 0;
-}
-
-/* Returns Lime base address */
-unsigned int board_video_init (void)
-{
-       if (!lime_probe())
-               return 0;
-
-       mb862xx.winSizeX = 800;
-       mb862xx.winSizeY = 480;
-       mb862xx.gdfIndex = GDF_15BIT_555RGB;
-       mb862xx.gdfBytesPP = 2;
-
-       return CONFIG_SYS_LIME_BASE;
-}
-
-#define W83782D_REG_CFG                0x40
-#define W83782D_REG_BANK_SEL   0x4e
-#define W83782D_REG_ADCCLK     0x4b
-#define W83782D_REG_BEEP_CTRL  0x4d
-#define W83782D_REG_BEEP_CTRL2 0x57
-#define W83782D_REG_PWMOUT1    0x5b
-#define W83782D_REG_VBAT       0x5d
-
-static int w83782d_hwmon_init(void)
-{
-       u8 buf;
-
-       if (i2c_read(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_CFG, 1, &buf, 1))
-               return -1;
-
-       i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_CFG, 0x80);
-       i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_BANK_SEL, 0);
-       i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_ADCCLK, 0x40);
-
-       buf = i2c_reg_read(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_BEEP_CTRL);
-       i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_BEEP_CTRL,
-                     buf | 0x80);
-       i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_BEEP_CTRL2, 0);
-       i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_PWMOUT1, 0x47);
-       i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_VBAT, 0x01);
-
-       buf = i2c_reg_read(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_CFG);
-       i2c_reg_write(CONFIG_SYS_I2C_W83782G_ADDR, W83782D_REG_CFG,
-                     (buf & 0xf4) | 0x01);
-       return 0;
-}
-
-static void board_backlight_brightness(int br)
+#if defined(CONFIG_OF_SEPARATE)
+void *board_fdt_blob_setup(void)
 {
-       u32 reg;
-       u8 buf;
-       u8 old_buf;
+       void *fw_dtb;
 
-       /* Select bank 0 */
-       if (i2c_read(CONFIG_SYS_I2C_W83782G_ADDR, 0x4e, 1, &old_buf, 1))
-               goto err;
-       else
-               buf = old_buf & 0xf8;
-
-       if (i2c_write(CONFIG_SYS_I2C_W83782G_ADDR, 0x4e, 1, &buf, 1))
-               goto err;
-
-       if (br > 0) {
-               /* PWMOUT1 duty cycle ctrl */
-               buf = 255 / (100 / br);
-               if (i2c_write(CONFIG_SYS_I2C_W83782G_ADDR, 0x5b, 1, &buf, 1))
-                       goto err;
-
-               /* LEDs on */
-               reg = in_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c));
-               if (!(reg & BACKLIGHT_ENABLE))
-                       out_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c),
-                                reg | BACKLIGHT_ENABLE);
-       } else {
-               buf = 0;
-               if (i2c_write(CONFIG_SYS_I2C_W83782G_ADDR, 0x5b, 1, &buf, 1))
-                       goto err;
-
-               /* LEDs off */
-               reg = in_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c));
-               reg &= ~BACKLIGHT_ENABLE;
-               out_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c), reg);
+       fw_dtb = (void *)(CONFIG_SYS_TEXT_BASE - CONFIG_ENV_SECT_SIZE);
+       if (fdt_magic(fw_dtb) != FDT_MAGIC) {
+               printf("DTB is not passed via %x\n", (u32)fw_dtb);
+               return NULL;
        }
-       /* Restore previous bank setting */
-       if (i2c_write(CONFIG_SYS_I2C_W83782G_ADDR, 0x4e, 1, &old_buf, 1))
-               goto err;
 
-       return;
-err:
-       printf("W83782G I2C access failed\n");
-}
-
-void board_backlight_switch (int flag)
-{
-       char * param;
-       int rc;
-
-       if (w83782d_hwmon_init())
-               printf ("hwmon IC init failed\n");
-
-       if (flag) {
-               param = env_get("brightness");
-               rc = param ? simple_strtol(param, NULL, 10) : -1;
-               if (rc < 0)
-                       rc = DEFAULT_BRIGHTNESS;
-       } else {
-               rc = 0;
-       }
-       board_backlight_brightness(rc);
+       return fw_dtb;
 }
+#endif
 
-#if defined(CONFIG_CONSOLE_EXTRA_INFO)
-/*
- * Return text to be printed besides the logo.
- */
-void video_get_info_str (int line_number, char *info)
+int get_serial_clock(void)
 {
-       if (line_number == 1) {
-               strcpy (info, " Board: Socrates");
-       } else {
-               info [0] = '\0';
-       }
+       return 333333330;
 }
-#endif
index b1956b810035ab5e1ff64427942353453fcb0d05..9ead7ca03811db3216e934614a4fdece031f7af5 100644 (file)
@@ -8,11 +8,13 @@ config EEPROM_BUS_ADDRESS
        int "Board EEPROM's I2C bus address"
        range 0 8
        default 0
+       depends on TI_I2C_BOARD_DETECT
 
 config EEPROM_CHIP_ADDRESS
        hex "Board EEPROM's I2C chip address"
        range 0 0xff
        default 0x50
+       depends on TI_I2C_BOARD_DETECT
 
 config TI_COMMON_CMD_OPTIONS
        bool "Enable cmd options on TI platforms"
index b08a7098579bc0426a57332250e6d7d3f4580b3f..99b8a0e21822a83b158a705edf0944296357e378 100644 (file)
@@ -263,13 +263,6 @@ config CMD_BOOTI
        help
          Boot an AArch64 Linux Kernel image from memory.
 
-config CMD_BOOTEFI
-       bool "bootefi"
-       depends on EFI_LOADER
-       default y
-       help
-         Boot an EFI image from memory.
-
 config BOOTM_LINUX
        bool "Support booting Linux OS images"
        depends on CMD_BOOTM || CMD_BOOTZ || CMD_BOOTI
@@ -318,6 +311,13 @@ config BOOTM_VXWORKS
        help
          Support booting VxWorks images via the bootm command.
 
+config CMD_BOOTEFI
+       bool "bootefi"
+       depends on EFI_LOADER
+       default y
+       help
+         Boot an EFI image from memory.
+
 config CMD_BOOTEFI_HELLO_COMPILE
        bool "Compile a standard EFI hello world binary for testing"
        depends on CMD_BOOTEFI && !CPU_V7M && !SANDBOX
@@ -442,6 +442,7 @@ config CMD_FITUPD
 
 config CMD_THOR_DOWNLOAD
        bool "thor - TIZEN 'thor' download"
+       select DFU
        help
          Implements the 'thor' download protocol. This is a way of
          downloading a software update over USB from an attached host.
@@ -1985,6 +1986,14 @@ config CMD_MTDPARTS_SPREAD
          at least as large as the size specified in the mtdparts variable and
          2) each partition starts on a good block.
 
+config CMD_MTDPARTS_SHOW_NET_SIZES
+       bool "Show net size (w/o bad blocks) of partitions"
+       depends on CMD_MTDPARTS
+       help
+         Adds two columns to the printed partition table showing the
+         effective usable size of a partition, if bad blocks are taken
+         into account.
+
 config CMD_REISER
        bool "reiser - Access to reiserfs filesystems"
        help
index 91a750a4fcaac1a688bd950713ce2ef1fb732c8c..33491d0bc9c3ce0d1aa7d468c7d97a82c97e2f83 100644 (file)
--- a/cmd/dfu.c
+++ b/cmd/dfu.c
 static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 
-       if (argc < 4)
+       if (argc < 2)
                return CMD_RET_USAGE;
 
 #ifdef CONFIG_DFU_OVER_USB
        char *usb_controller = argv[1];
 #endif
 #if defined(CONFIG_DFU_OVER_USB) || defined(CONFIG_DFU_OVER_TFTP)
-       char *interface = argv[2];
-       char *devstring = argv[3];
+       char *interface = NULL;
+       char *devstring = NULL;
+
+       if (argc >= 4) {
+               interface = argv[2];
+               devstring = argv[3];
+       }
 #endif
 
        int ret = 0;
 #ifdef CONFIG_DFU_OVER_TFTP
        unsigned long addr = 0;
        if (!strcmp(argv[1], "tftp")) {
-               if (argc == 5)
-                       addr = simple_strtoul(argv[4], NULL, 0);
+               if (argc == 5 || argc == 3)
+                       addr = simple_strtoul(argv[argc - 1], NULL, 0);
 
                return update_tftp(addr, interface, devstring);
        }
@@ -48,7 +53,7 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                goto done;
 
        ret = CMD_RET_SUCCESS;
-       if (argc > 4 && strcmp(argv[4], "list") == 0) {
+       if (strcmp(argv[argc - 1], "list") == 0) {
                dfu_show_entities();
                goto done;
        }
@@ -67,7 +72,7 @@ U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu,
        "Device Firmware Upgrade",
        ""
 #ifdef CONFIG_DFU_OVER_USB
-       "<USB_controller> <interface> <dev> [list]\n"
+       "<USB_controller> [<interface> <dev>] [list]\n"
        "  - device firmware upgrade via <USB_controller>\n"
        "    on device <dev>, attached to interface\n"
        "    <interface>\n"
@@ -77,7 +82,7 @@ U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu,
 #ifdef CONFIG_DFU_OVER_USB
        "dfu "
 #endif
-       "tftp <interface> <dev> [<addr>]\n"
+       "tftp [<interface> <dev>] [<addr>]\n"
        "  - device firmware upgrade via TFTP\n"
        "    on device <dev>, attached to interface\n"
        "    <interface>\n"
index 46155cabf66c30eaa5245c2dacd7a9f00e0fd953..b40c2afadda2b60c3be134b384b0cc68cab20645 100644 (file)
@@ -1233,11 +1233,11 @@ static uint64_t net_part_size(struct mtd_info *mtd, struct part_info *part)
 {
        uint64_t i, net_size = 0;
 
-       if (!mtd->block_isbad)
+       if (!mtd->_block_isbad)
                return part->size;
 
        for (i = 0; i < part->size; i += mtd->erasesize) {
-               if (!mtd->block_isbad(mtd, part->offset + i))
+               if (!mtd->_block_isbad(mtd, part->offset + i))
                        net_size += mtd->erasesize;
        }
 
@@ -1274,7 +1274,7 @@ static void print_partition_table(void)
                        part = list_entry(pentry, struct part_info, link);
                        net_size = net_part_size(mtd, part);
                        size_note = part->size == net_size ? " " : " (!)";
-                       printf("%2d: %-20s0x%08x\t0x%08x%s\t0x%08x\t%d\n",
+                       printf("%2d: %-20s0x%08llx\t0x%08x%s\t0x%08llx\t%d\n",
                                        part_num, part->name, part->size,
                                        net_size, size_note, part->offset,
                                        part->mask_flags);
index 27efef20bc95c0962a62c473521b9cb861fd2166..24c9df89c14b0583b270ea42040ef1c22b0cac25 100644 (file)
@@ -34,7 +34,6 @@
 
 /* partition handling routines */
 int mtdparts_init(void);
-int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num);
 int find_dev_and_part(const char *id, struct mtd_device **dev,
                      u8 *part_num, struct part_info **part);
 #endif
index dd0544d475723d14ce6bd298963ca62e411d42ed..8dae024e31db2bc601c617c4a302932a66a5e4bf 100644 (file)
@@ -40,7 +40,8 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        ret = g_dnl_register("usb_dnl_thor");
        if (ret) {
                pr_err("g_dnl_register failed %d\n", ret);
-               return ret;
+               ret = CMD_RET_FAILURE;
+               goto exit;
        }
 
        ret = thor_init();
index 8f86e4aa4a49e8e80a1f247951640fbbf2541d01..cf1e273485c7e98c82cc897030439faf3a2e917e 100644 (file)
 
 #define __U_BOOT__
 #ifdef __U_BOOT__
+#include <common.h>         /* readline */
 #include <env.h>
 #include <malloc.h>         /* malloc, free, realloc*/
 #include <linux/ctype.h>    /* isalpha, isdigit */
-#include <common.h>        /* readline */
 #include <console.h>
 #include <bootretry.h>
 #include <cli.h>
index 89b1e9590cad7b9695b1a0322d3b81574a45c26c..168ba60d0d9e84bcd6255e17f3301aa87ed5a55b 100644 (file)
@@ -252,10 +252,12 @@ static void console_puts(int file, const char *s)
        }
 }
 
+#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)
 static inline void console_doenv(int file, struct stdio_dev *dev)
 {
        iomux_doenv(file, dev->name);
 }
+#endif
 #else
 static inline int console_getc(int file)
 {
@@ -283,10 +285,12 @@ static inline void console_puts(int file, const char *s)
        stdio_devices[file]->puts(stdio_devices[file], s);
 }
 
+#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)
 static inline void console_doenv(int file, struct stdio_dev *dev)
 {
        console_setfile(file, dev);
 }
+#endif
 #endif /* CONIFIG_IS_ENABLED(CONSOLE_MUX) */
 
 /** U-Boot INITIAL CONSOLE-NOT COMPATIBLE FUNCTIONS *************************/
index 6f12a18d549b2372e3b33b2383bf58ac63c16b1a..dade68faf749867dd9f4d3c2fc55383cec625ab5 100644 (file)
@@ -2086,7 +2086,7 @@ Void_t* cALLOc(n, elem_size) size_t n; size_t elem_size;
   {
 #if CONFIG_VAL(SYS_MALLOC_F_LEN)
        if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT)) {
-               MALLOC_ZERO(mem, sz);
+               memset(mem, 0, sz);
                return mem;
        }
 #endif
index c661809923ab8d8c1119c9edac1cd57b260c59bf..8f0ba8ef831ec98a3d02ed590672aed7962f4ade 100644 (file)
@@ -1014,8 +1014,19 @@ config SPL_SERIAL_SUPPORT
          unless there are space reasons not to. Even then, consider
          enabling SPL_USE_TINY_PRINTF which is a small printf() version.
 
+config SPL_SPI_SUPPORT
+       bool "Support SPI drivers"
+       help
+         Enable support for using SPI in SPL. This is used for connecting
+         to SPI flash for loading U-Boot. See SPL_SPI_FLASH_SUPPORT for
+         more details on that. The SPI driver provides the transport for
+         data between the SPI flash and the CPU. This option can be used to
+         enable SPI drivers that are needed for other purposes also, such
+         as a SPI PMIC.
+
 config SPL_SPI_FLASH_SUPPORT
        bool "Support SPI flash drivers"
+       depends on SPL_SPI_SUPPORT
        help
          Enable support for using SPI flash in SPL, and loading U-Boot from
          SPI flash. SPI flash (Serial Peripheral Bus flash) is named after
@@ -1060,16 +1071,6 @@ config SYS_SPI_U_BOOT_OFFS
         Address within SPI-Flash from where the u-boot payload is fetched
         from.
 
-config SPL_SPI_SUPPORT
-       bool "Support SPI drivers"
-       help
-         Enable support for using SPI in SPL. This is used for connecting
-         to SPI flash for loading U-Boot. See SPL_SPI_FLASH_SUPPORT for
-         more details on that. The SPI driver provides the transport for
-         data between the SPI flash and the CPU. This option can be used to
-         enable SPI drivers that are needed for other purposes also, such
-         as a SPI PMIC.
-
 config SPL_THERMAL
        bool "Driver support for thermal devices"
        help
index 4715f9d3719faced434616c5bd651563cf6be2f9..0498d0a2c994391f4121c7d645b3776b6bedfa8f 100644 (file)
@@ -30,8 +30,11 @@ static struct bl31_params *bl2_to_bl31_params;
  *
  * @return bl31 params structure pointer
  */
-static struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl33_entry)
+static struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl32_entry,
+                                                   uintptr_t bl33_entry,
+                                                   uintptr_t fdt_addr)
 {
+       struct entry_point_info *bl32_ep_info;
        struct entry_point_info *bl33_ep_info;
 
        /*
@@ -49,16 +52,21 @@ static struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl33_entry)
        SET_PARAM_HEAD(bl2_to_bl31_params->bl31_image_info,
                       ATF_PARAM_IMAGE_BINARY, ATF_VERSION_1, 0);
 
-       /* Fill BL32 related information if it exists */
+       /* Fill BL32 related information */
        bl2_to_bl31_params->bl32_ep_info = &bl31_params_mem.bl32_ep_info;
-       SET_PARAM_HEAD(bl2_to_bl31_params->bl32_ep_info, ATF_PARAM_EP,
-                      ATF_VERSION_1, 0);
+       bl32_ep_info = &bl31_params_mem.bl32_ep_info;
+       SET_PARAM_HEAD(bl32_ep_info, ATF_PARAM_EP, ATF_VERSION_1,
+                      ATF_EP_SECURE);
+
+       /* secure payload is optional, so set pc to 0 if absent */
+       bl32_ep_info->args.arg3 = fdt_addr;
+       bl32_ep_info->pc = bl32_entry ? bl32_entry : 0;
+       bl32_ep_info->spsr = SPSR_64(MODE_EL1, MODE_SP_ELX,
+                                    DISABLE_ALL_EXECPTIONS);
+
        bl2_to_bl31_params->bl32_image_info = &bl31_params_mem.bl32_image_info;
        SET_PARAM_HEAD(bl2_to_bl31_params->bl32_image_info,
                       ATF_PARAM_IMAGE_BINARY, ATF_VERSION_1, 0);
-#ifndef BL32_BASE
-       bl2_to_bl31_params->bl32_ep_info->pc = 0;
-#endif /* BL32_BASE */
 
        /* Fill BL33 related information */
        bl2_to_bl31_params->bl33_ep_info = &bl31_params_mem.bl33_ep_info;
@@ -86,13 +94,14 @@ static inline void raw_write_daif(unsigned int daif)
 
 typedef void (*atf_entry_t)(struct bl31_params *params, void *plat_params);
 
-static void bl31_entry(uintptr_t bl31_entry, uintptr_t bl33_entry,
-                      uintptr_t fdt_addr)
+static void bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry,
+                      uintptr_t bl33_entry, uintptr_t fdt_addr)
 {
        struct bl31_params *bl31_params;
        atf_entry_t  atf_entry = (atf_entry_t)bl31_entry;
 
-       bl31_params = bl2_plat_get_bl31_params(bl33_entry);
+       bl31_params = bl2_plat_get_bl31_params(bl32_entry, bl33_entry,
+                                              fdt_addr);
 
        raw_write_daif(SPSR_EXCEPTION_MASK);
        dcache_disable();
@@ -100,7 +109,7 @@ static void bl31_entry(uintptr_t bl31_entry, uintptr_t bl33_entry,
        atf_entry((void *)bl31_params, (void *)fdt_addr);
 }
 
-static int spl_fit_images_find_uboot(void *blob)
+static int spl_fit_images_find(void *blob, int os)
 {
        int parent, node, ndepth;
        const void *data;
@@ -122,7 +131,7 @@ static int spl_fit_images_find_uboot(void *blob)
                if (!data)
                        continue;
 
-               if (genimg_get_os_id(data) == IH_OS_U_BOOT)
+               if (genimg_get_os_id(data) == os)
                        return node;
        };
 
@@ -143,11 +152,21 @@ uintptr_t spl_fit_images_get_entry(void *blob, int node)
 
 void spl_invoke_atf(struct spl_image_info *spl_image)
 {
+       uintptr_t  bl32_entry = 0;
        uintptr_t  bl33_entry = CONFIG_SYS_TEXT_BASE;
        void *blob = spl_image->fdt_addr;
        uintptr_t platform_param = (uintptr_t)blob;
        int node;
 
+       /*
+        * Find the OP-TEE binary (in /fit-images) load address or
+        * entry point (if different) and pass it as the BL3-2 entry
+        * point, this is optional.
+        */
+       node = spl_fit_images_find(blob, IH_OS_TEE);
+       if (node >= 0)
+               bl32_entry = spl_fit_images_get_entry(blob, node);
+
        /*
         * Find the U-Boot binary (in /fit-images) load addreess or
         * entry point (if different) and pass it as the BL3-3 entry
@@ -155,7 +174,7 @@ void spl_invoke_atf(struct spl_image_info *spl_image)
         * This will need to be extended to support Falcon mode.
         */
 
-       node = spl_fit_images_find_uboot(blob);
+       node = spl_fit_images_find(blob, IH_OS_U_BOOT);
        if (node >= 0)
                bl33_entry = spl_fit_images_get_entry(blob, node);
 
@@ -172,5 +191,6 @@ void spl_invoke_atf(struct spl_image_info *spl_image)
         * We don't provide a BL3-2 entry yet, but this will be possible
         * using similar logic.
         */
-       bl31_entry(spl_image->entry_point, bl33_entry, platform_param);
+       bl31_entry(spl_image->entry_point, bl32_entry,
+                  bl33_entry, platform_param);
 }
index 54f8e53c63076cec6dc5a5ba27b746c9edec1908..097b6729c14d14c1dfd968499e056d8b07b60775 100644 (file)
@@ -938,31 +938,32 @@ do_retry:
 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;
-
-#if !CONFIG_IS_ENABLED(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.
+        * Limit the total size of a transfer to 120 KB.
+        *
+        * Some devices are known to choke with anything larger. It seems like
+        * the problem stems from the fact that original IDE controllers had
+        * only an 8-bit register to hold the number of sectors in one transfer
+        * and even those couldn't handle a full 256 sectors.
+        *
+        * Because we want to make sure we interoperate with as many devices as
+        * possible, we will maintain a 240 sector transfer size limit for USB
+        * Mass Storage devices.
+        *
+        * Tests show that other operating have similar limits with Microsoft
+        * Windows 7 limiting transfers to 128 sectors for both USB2 and USB3
+        * and Apple Mac OS X 10.11 limiting transfers to 256 sectors for USB2
+        * and 2048 for USB3 devices.
         */
-       blk = USHRT_MAX;
-#else
-       blk = 20;
-#endif
-#else
+       unsigned short blk = 240;
+
+#if CONFIG_IS_ENABLED(DM_USB)
+       size_t size;
+       int ret;
+
        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;
+       if ((ret >= 0) && (size < blk * 512))
                blk = size / 512;
-       }
 #endif
 
        us->max_xfer_blk = blk;
@@ -1179,6 +1180,7 @@ retry_it:
                srb->pdata = (unsigned char *)buf_addr;
                if (usb_read_10(srb, ss, start, smallblks)) {
                        debug("Read ERROR\n");
+                       ss->flags &= ~USB_READY;
                        usb_request_sense(srb, ss);
                        if (retry--)
                                goto retry_it;
@@ -1189,7 +1191,6 @@ retry_it:
                blks -= smallblks;
                buf_addr += srb->datalen;
        } while (blks != 0);
-       ss->flags &= ~USB_READY;
 
        debug("usb_read: end startblk " LBAF ", blccnt %x buffer %lx\n",
              start, smallblks, buf_addr);
@@ -1264,6 +1265,7 @@ retry_it:
                srb->pdata = (unsigned char *)buf_addr;
                if (usb_write_10(srb, ss, start, smallblks)) {
                        debug("Write ERROR\n");
+                       ss->flags &= ~USB_READY;
                        usb_request_sense(srb, ss);
                        if (retry--)
                                goto retry_it;
@@ -1274,7 +1276,6 @@ retry_it:
                blks -= smallblks;
                buf_addr += srb->datalen;
        } while (blks != 0);
-       ss->flags &= ~USB_READY;
 
        debug("usb_write: end startblk " LBAF ", blccnt %x buffer %lx\n",
              start, smallblks, buf_addr);
@@ -1469,10 +1470,10 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
        memset(pccb->pdata, 0, 8);
        if (usb_read_capacity(pccb, ss) != 0) {
                printf("READ_CAP ERROR\n");
+               ss->flags &= ~USB_READY;
                cap[0] = 2880;
                cap[1] = 0x200;
        }
-       ss->flags &= ~USB_READY;
        debug("Read Capacity returns: 0x%08x, 0x%08x\n", cap[0], cap[1]);
 #if 0
        if (cap[0] > (0x200000 * 10)) /* greater than 10 GByte */
index 3eb310716c3d59d80778f4961fab1bbbf82b21d0..80735e92b3a6e580d6a9b4d029fc5517f5e25b84 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_B4860QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index af1bc88b3ac897fffb364dcc1bce69bb4cc856df..adcc983c13afbf0038433fb633fa00a35cb24826 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_BSC9132QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index abc0886de38d056e8b7106b894cd185707145a31..5f4c1c2483e478ec6ba291eab5099fa8f6142e8e 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_BSC9132QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index 81c3b3b73e5d3a64bbd11b7f46e02a261110748d..cade39d7e2b425cbd8caf9492c74f69b061f60ce 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x8FF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_BSC9132QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index dca12608aad21609d4a42f4be687187238787c40..1ea17b58c32274441260020832e169870e89cac6 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x8FF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_BSC9132QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index 1e5c7627dcfa82777298fa88d35b6a7f7befcdf2..f264ca8f060272de7dc066fe5f8723d67a583b53 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_BSC9132QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index 1203bdb46d5db4070079bc15e0ad4634cd3ab0e4..1ab09ec9c6fc3eb0b02043c923280828226d187f 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_BSC9132QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index a0e9cd8d1f35119ea413d7610697d31a7e1e348e..edc640e5ca537ac5b8f93b8aecf8e2eb83ee5bee 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_BSC9132QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index f086438cd2fef721d34714750b11ac16b12b575d..8411bddcb96d88616be033be7f30cbd4da3dad40 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_BSC9132QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index a256315c681dc7c3ac5f4d59fed0b83498694d75..50ba06f6a6d414301ec04068f115fcf9118c5acb 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_C29XPCIE=y
 # CONFIG_SYS_MALLOC_F is not set
index 8629f8aa4210c72f60d737494dc535d5857ec489..f887ec05e7175f97370060ba3352410781797f0a 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_C29XPCIE=y
 # CONFIG_SYS_MALLOC_F is not set
index 51b648806d634c357d973def8ca8c1bca285bdec..17fa25f37a4f50ef6d578a65bdeed4af04b602ad 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PA=y
 # CONFIG_SYS_MALLOC_F is not set
index b14e7deaf69d68dd30fdc217d98f754d3871c0dd..99e8b40580349d8acfdea71ceac410eaea097ea7 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PA=y
 # CONFIG_SYS_MALLOC_F is not set
index b24f704aad244d7d3601c681e2af1e45ed5e493f..10f17ed6c6dead5dcdce3b65b495a40515138126 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PA=y
 # CONFIG_SYS_MALLOC_F is not set
index 036f8e8a446b681e3600678cc226acc658e497c7..96eb27cdb57b5382a6afb738f55898c9baf1cd6f 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PA=y
 # CONFIG_SYS_MALLOC_F is not set
index 349fc95ee1c775a434ba98bd423f114568c3ca88..7b58ee80d2da61871585175c1bbe74811092ad5c 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PA=y
 # CONFIG_SYS_MALLOC_F is not set
index 0fa105ce70c6ade7659588c61623dbdef56f82cd..37f066a1e95b57adc441f3a974a9e557e08b21e1 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PA=y
 # CONFIG_SYS_MALLOC_F is not set
index dcc7d11d514ec009fd25cc986e59b2273b9a4c54..f304be67a919f5b170d998408cccbdc826b2db4b 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PB=y
 # CONFIG_SYS_MALLOC_F is not set
index 6ed4467323628b714d4d3cc5d64b4afa9dde8d2e..4c7f46460969cce1664575123f46089a9511f792 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PB=y
 # CONFIG_SYS_MALLOC_F is not set
index 6f43d694eaccdae6b0baf07102ed4958772a3d3a..aef1f3fb3b72879988edac15ea7cfa674179fc7e 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PB=y
 # CONFIG_SYS_MALLOC_F is not set
index 8e76629ad598ddeb5091e8a53fbff794c8a22e12..844e4a088dfe767993ac47bddb7e4206d91506c8 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PB=y
 # CONFIG_SYS_MALLOC_F is not set
index cc2a04f710b1c260c6712b1b9b21c0957625841c..bcfb589095a51713168588534578ea4dd51666cb 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PB=y
 # CONFIG_SYS_MALLOC_F is not set
index 78aef8395a0b050de7198c8f25a70841fb4a781c..af9bee18cb4f7cde81bb80534d7bb054690f6653 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x11000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PB=y
 # CONFIG_SYS_MALLOC_F is not set
index 91514e1641bc647d35b3c8a65f3817f418e7cda6..cf254d5a101722093d4cd09d4912215bd096032b 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P2041RDB=y
 # CONFIG_SYS_MALLOC_F is not set
index d83206342e5655ec9d6463485a80e7ef3f3c51b2..dc3c69b2dedfe5224a2d066ef82cbd93f3a0e2e0 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P3041DS=y
 # CONFIG_SYS_MALLOC_F is not set
index 483e39324681142f04703c59e2d1c46417fb2155..2250e49a254871ae45e4af64ecd64683e26a8297 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P3041DS=y
 # CONFIG_SYS_MALLOC_F is not set
index e6b1207d0e226542c99ed7b46b010ad6c9e1fc91..9f4cb9d89007109c37c031a6f79bd832df6bfe08 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P4080DS=y
 # CONFIG_SYS_MALLOC_F is not set
index 85f04ac323d17c1cae576fd4966dd47f75755aed..ad3bd81d1d13c972383af4fc63aff1658bdb8d8b 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P5020DS=y
 # CONFIG_SYS_MALLOC_F is not set
index 85fa7bdfbfa974261affff7d88fcfd75edb9c723..01131a5c5b1eb458ae357f07d4d7e67f0591603d 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P5020DS=y
 # CONFIG_SYS_MALLOC_F is not set
index c085e68efbe980eb1ad9d529e013d327676c7c87..9a92c0000ed400bb79a69dd83fe67cf0302a30eb 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P5040DS=y
 # CONFIG_SYS_MALLOC_F is not set
index 22b4d4ebda0bd4f33a0698c6bf95fa262b071ada..817b6dcd178a0a3c63a2dd756218e71631185350 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P5040DS=y
 # CONFIG_SYS_MALLOC_F is not set
index db843db9c2f53fc6f5916fbf4c9acd4431648d6a..2fbca371d5f2a6e09fdc6ed0e704cbb54c9b26c3 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_DM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_NTPSERVER=y
 CONFIG_CMD_MII=y
@@ -34,7 +33,6 @@ CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index c06ad6e32f777bb5f5be6f1b16a15aa84bfede7f..dd82ced814c4c5a7d5b23c9012cc2636248a023f 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_DM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_BOOTP_NTPSERVER=y
 CONFIG_CMD_MII=y
@@ -38,7 +37,6 @@ CONFIG_LED=y
 CONFIG_LED_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index 886aba79df3050f2d83985489375c0b7f5f17d55..1deffd8aeeb96a2c085e298fea8fe14cc6f8fda4 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T1023RDB=y
 # CONFIG_SYS_MALLOC_F is not set
index 423d64265ceb265ae8715db87cf8c13435898546..15c3bf91673cd5330fc0f666d18564449f1ad813 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T1024QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index 9d6bc986117d987874db0006f2ac74c909ddfd48..c60ab389c1c522cdf722c2084564a3e2f042987b 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T1024QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index cb751dfc71aa699867283f31a5e57ed36a4defd8..a67d50d587fa83ef9d43f12d21c12cc09a650979 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T1024RDB=y
 # CONFIG_SYS_MALLOC_F is not set
index 7391eff2a389fb105366806eabd4ddbfc812bb68..e59f8d736ed79f7f4848bbf8f07c36a14eaf2c71 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T1040D4RDB=y
 # CONFIG_SYS_MALLOC_F is not set
index 9cd30e57049e78a5b78ba21a59f2b7bb2aa709a9..e411274a9d4ce9f6e62dbe9936fd1adac45602e1 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T1040QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index 5f482c3f6019f7baf99b10288c04fda3124ceef5..376d52d2cbbad4b61db9c0017c3bbe385bf01908 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T1040RDB=y
 # CONFIG_SYS_MALLOC_F is not set
index d52521c96c8898a3ca88f4d38cd12b3bec31a624..55541be9758ae86b1957b1aec1e1ea0bcef34c7b 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T1042D4RDB=y
 # CONFIG_SYS_MALLOC_F is not set
index 721641270b559fe5a4a53dc381b667e5ddd2d6f0..e11757d3f0acc8bd6513409ca55f2b7251cc56b0 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0x30001000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL=y
index a255e085b9ff60fcab7de70f18844b87d36b2174..fc9144a03df9567cdc239f19216b3b4f83995cfd 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T1042RDB=y
 # CONFIG_SYS_MALLOC_F is not set
index dea847925314eb05966bda6bc50db1906717a5ea..12b9e403a5291e466b35635a9f03404a45440a85 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T2080QDS=y
 CONFIG_MPC85XX_HAVE_RESET_VECTOR=y
index 120bfccadec6bf63fa937ef95b35b56278de3192..90dd565397be68b4366117e73e65556a0699a77c 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T2080RDB=y
 # CONFIG_SYS_MALLOC_F is not set
index fafcdd52ccebf4883103b95897768df1d7edf08f..81bb19768165113b3376cc0bd7266beaf53ebee1 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T4160QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index 55a7f19dd55f733b9b2c3d9bf2ab758681eaf510..2c6a7ff16fa5d25a34e2739228aaa991e6e8b8a0 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xEFF40000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_MPC85xx=y
 CONFIG_TARGET_T4240QDS=y
 # CONFIG_SYS_MALLOC_F is not set
index a591681819fcf43a9d9317e98fc7a352e7b70764..98ef744ed923f4a7abca7b344f186e2c2c9a1a10 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_SYS_PROMPT="NDS32 # "
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -34,7 +33,6 @@ CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_DM_ETH=y
 CONFIG_FTMAC100=y
index a31027016b546543f8709eca87633a761dfa878b..25b8dad29705d1225bc8610db97e6af6844c0d9e 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_PREFER_SERVERIP=y
@@ -26,7 +25,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0x0
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_FTMAC100=y
index 8ec72f45076191074463334a21224f84829bfb1b..b8b206820631c182ebbbbbb447bbcb0e10df1064 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_PREFER_SERVERIP=y
@@ -26,7 +25,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0x0
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_FTMAC100=y
index d425252ec8e9a3aa05b4e7acd8fc0c62a6365f07..ea60e526f34a6c3cd19bb0d56f5550d27620b0a1 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_PREFER_SERVERIP=y
@@ -27,7 +26,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0x0
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_FTMAC100=y
index 8e423a79a3bd1b024d2538101fc959c3e1cbb7b7..dccc596bb6fd4d6624576c1457befdc0f46d9226 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_PROMPT="RISC-V # "
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_BOOTP_PREFER_SERVERIP=y
@@ -27,7 +26,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0x0
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_FTMAC100=y
index 0284d80b9325b73b14a7cbb2c27c1b9149412106..a0535533fb0bf686ed1ef5a6d8098fb2fde96405 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -68,7 +67,6 @@ CONFIG_RENESAS_SDHI=y
 CONFIG_MTD=y
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
index 47c4e9923322f8e37fd333e128160c4fe03786b7..5f11264bb38daa94e661d99133b88f0b83c8f265 100644 (file)
@@ -43,7 +43,6 @@ CONFIG_DM_MMC=y
 # CONFIG_SPL_DM_MMC is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
index 93a28b290b2c79beb6d9cec20773cb3ad4a5c4e6..599cbd67db438f4ac8193ca19f53068d71bb8ee7 100644 (file)
@@ -37,6 +37,8 @@ CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bone
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_SPL_ENV_IS_NOWHERE=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_CLK=y
+CONFIG_CLK_CDCE9XX=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_NAND=y
 CONFIG_DFU_RAM=y
@@ -48,7 +50,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
@@ -77,5 +78,3 @@ CONFIG_DYNAMIC_CRC_TABLE=y
 CONFIG_RSA=y
 CONFIG_LZO=y
 # CONFIG_OF_LIBFDT_OVERLAY is not set
-CONFIG_CLK=y
-CONFIG_CLK_CDCE9XX=y
index 3ce324193f8742a7f26963435470ea1d3a2486c7..321ed864cd3d35582aa96a36fae92cfb95d6d687 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_AM33XX=y
 CONFIG_TARGET_AM335X_GUARDIAN=y
-# CONFIG_SPL_MMC_SUPPORT is not set
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_ENV_SIZE=0x040000
@@ -30,8 +29,6 @@ CONFIG_SPL_NET_VCI_STRING="Guardian U-Boot SPL"
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_USB_ETHER=y
-# CONFIG_SPL_WATCHDOG_SUPPORT is not set
-# CONFIG_SPL_YMODEM_SUPPORT is not set
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
@@ -43,7 +40,6 @@ CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
-# CONFIG_CMD_MMC is not set
 CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_USB=y
@@ -58,17 +54,11 @@ CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-guardian"
-CONFIG_OF_SEPARATE=y
-CONFIG_ENV_IS_NOWHERE=y
-CONFIG_SPL_ENV_IS_NOWHERE=y
 CONFIG_SPL_DM=y
-CONFIG_SPL_DM_USB=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_MISC=y
-# CONFIG_DM_MMC is not set
 # CONFIG_MMC is not set
-# CONFIG_MMC_OMAP_HS is not set
 CONFIG_MTD=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
@@ -81,19 +71,17 @@ CONFIG_PHY=y
 CONFIG_NOP_PHY=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
-# CONFIG_WATCHDOG is not set
-CONFIG_SPL_WDT=y
 CONFIG_USB=y
 CONFIG_DM_USB_GADGET=y
 CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_TI=y
-CONFIG_USB_MUSB_DSPS=y
+# CONFIG_USB_STORAGE is not set
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
 CONFIG_USB_ETHER=y
-# CONFIG_USB_STORAGE is not set
+CONFIG_SPL_WDT=y
 CONFIG_FAT_WRITE=y
index f5da7f674f26c3aabf55e45e1454295965abb138..0a7b305bea96adff41eeef4a1ed6c9a0c649391b 100644 (file)
@@ -44,7 +44,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
index 3708a6f6239c669fdf52d27b7ad39865d5cf7ba4..531c36fc254593bbe1fbe016b839f5eba6d8fddd 100644 (file)
@@ -46,7 +46,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
index 5e3e01c9153ff37ba123dc5362ae50801876cc26..95a698436b906912b060c050e2111e716b33ec96 100644 (file)
@@ -39,6 +39,8 @@ CONFIG_REGMAP=y
 CONFIG_SPL_REGMAP=y
 CONFIG_SYSCON=y
 CONFIG_SPL_SYSCON=y
+CONFIG_CLK=y
+CONFIG_CLK_CDCE9XX=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
@@ -47,7 +49,6 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=48000000
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_PHY_GIGE=y
@@ -68,7 +69,6 @@ CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_DWC3_PHY_OMAP=y
@@ -79,5 +79,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0403
 CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
-CONFIG_CLK=y
-CONFIG_CLK_CDCE9XX=y
index b1bf67002ba3619ad904c4bcec15dad5991921b7..7a7591ec7f92141d9faaf8bc63bf370e135568ce 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -41,7 +40,6 @@ CONFIG_DFU_SF=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=48000000
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_MII=y
@@ -54,7 +52,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_OMAP_USB_PHY=y
index 3064f3198decd367bc445d9c40e623eb13f6bda4..587f72885c17dbfc3abaad5ca1d62b89a36fbcba 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=48000000
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_PHY_GIGE=y
@@ -53,7 +52,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_OMAP_USB_PHY=y
index f1a1a482484f333ab8e199777a509992cdeb282f..564eea6f978a2772e85de140b30ed040af9c6309 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -50,7 +49,6 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=48000000
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_PHY_GIGE=y
@@ -66,7 +64,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_OMAP_USB_PHY=y
index 0b32568316d70f005b15e1fe86b36992890f7249..61b89fb56b1809b68784a189d017d99ec3f9a84f 100644 (file)
@@ -47,7 +47,6 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=48000000
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_PHY_GIGE=y
@@ -63,7 +62,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_OMAP_USB_PHY=y
index e2f558cde7435b7cbbc3ade57f3eb443bb950730..8a867f662bbd56219ef9b96c6325332b78634024 100644 (file)
@@ -48,6 +48,8 @@ CONFIG_SPL_REGMAP=y
 CONFIG_SPL_SYSCON=y
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_DWC_AHCI=y
+CONFIG_CLK=y
+CONFIG_CLK_CDCE9XX=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
@@ -65,7 +67,6 @@ CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -92,11 +93,8 @@ CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-CONFIG_CLK=y
-CONFIG_CLK_CDCE9XX=y
index 7b56df8db7f7d274279209ea867ebaa269598773..d62581f4014fa6e96fdadaf6839c135881ff387e 100644 (file)
@@ -63,7 +63,6 @@ CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -90,7 +89,6 @@ CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
index 0b47df6e3c6939fe88d96d79a011467a602e65ba..438662bf83a5a2e0bb5b112b0ac871fd1b147ead 100644 (file)
@@ -69,7 +69,6 @@ CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_BAR=y
@@ -97,7 +96,6 @@ CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
index c60978c9be5a840286d36b7e8c85068b240a3892..d1188d001851db0c4e157fa4ab3bc5b9dc768d5e 100644 (file)
@@ -8,8 +8,8 @@ CONFIG_TARGET_AM654_A53_EVM=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 # CONFIG_PSCI_RESET is not set
index d0619e9b7a45e0cfefec64cb3edd2bd78cbabac9..b82e9f63581f92db5873087208f3a8eb62ae9b5e 100644 (file)
@@ -10,8 +10,8 @@ CONFIG_TARGET_AM654_R5_EVM=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_TEXT_BASE=0x41c00000
@@ -70,6 +70,7 @@ CONFIG_SYS_I2C_OMAP24XX=y
 CONFIG_DM_MAILBOX=y
 CONFIG_K3_SEC_PROXY=y
 CONFIG_MISC=y
+CONFIG_K3_AVS0=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_AM654=y
@@ -84,6 +85,7 @@ CONFIG_DM_REGULATOR=y
 CONFIG_SPL_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_DM_REGULATOR_GPIO=y
+CONFIG_DM_REGULATOR_TPS62360=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
index caee953426308a55f4aaa44ad80d0f19ed4771b2..cb52256e914c7dce3ca624461f74a8411cd73d42 100644 (file)
@@ -9,8 +9,8 @@ CONFIG_TARGET_AM654_A53_EVM=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_TEXT_BASE=0x80080000
index 6a3110d98172e9bf7ea8bae334c905263c2ff73e..08a8b1c41001f1686d96dd9067fb483fca14bab4 100644 (file)
@@ -10,8 +10,8 @@ CONFIG_TARGET_AM654_R5_EVM=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_TEXT_BASE=0x41c00000
index eca24e9d2555c6904c66c21b54331289da4c0703..199ffee407928606b13088b46f8f4b719a7449cb 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SYS_PROMPT="ap121 # "
 # CONFIG_CMD_CRC32 is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -36,7 +35,6 @@ CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=25000000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 9a5a9f89c69bf442fef0efb656749a1676684f4b..70ef12d60bda74e5a050d83618ccace292efdeb5 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SYS_PROMPT="ap143 # "
 # CONFIG_CMD_CRC32 is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=spi-flash.0"
@@ -35,7 +34,6 @@ CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=25000000
 # CONFIG_NET is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
index c95db3a79ac5d5d0002c1437a13e261cf4229d34..00e22e70ed02dd370d677e890d5be626e520a24d 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SYS_PROMPT="ap152 # "
 # CONFIG_CMD_CRC32 is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=spi-flash.0"
@@ -33,7 +32,6 @@ CONFIG_DEFAULT_DEVICE_TREE="ap152"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 # CONFIG_NET is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_DATAFLASH=y
index ef1b3b46be598d53d490c03f11c303eab53023d4..cab6a589296c8cdbec469ca2a983d01a387b6829 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 89129ce2f97dfabd0b5aa6995e88358e941373a6..500d1bbab083a9444e809021240adc1eec299c7c 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 79ef08c8ce0e860fcb6ee669e245c3acc4f23be7..3b4706ba456f7f68344f56d6e9a99ae50cf68ff9 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -40,7 +39,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 410f71142d9bad224efe96c6f1e9b2b8c13b21e0..b2ecbf212f4a088b3ea03ad3bad342a58db96fc5 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 83437583b6fa8a855e14c00b513a6cdfb9357703..cf447d193903d831f04b4226abc0c549209f1099 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 471715ab8613cfc607d83ef633b006695db60a73..bb1c1b809a8894f0b0f763fb37e29179de8987c9 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -40,7 +39,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index ce30dbb37078d936e783fe4c22929d696fb2e1f0..0a5293777ab37bb273df11359f48758e0608fe4a 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -50,7 +49,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index ce30dbb37078d936e783fe4c22929d696fb2e1f0..0a5293777ab37bb273df11359f48758e0608fe4a 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -50,7 +49,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 5149b34760efad90fc920878ddd8cda3c8b1d76b..53eddd8141dbc92b2edbd1771b933027ee5b7611 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 6e7ab93062c0062ca33c371a242904caf5b08fe6..9345a421e7fa71a23af87919bc75479c72c7f237 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -49,7 +48,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 03c55622e06ce41f9d42efa5fb3b270ad007d851..86ae5f7ee2fe81897c05579a9f27e8ab779c2ae0 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -49,7 +48,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 8a3cf115dc09157d25e8e2aa6ba910d304ab7e31..ea9621a3da0cf52a2cb0746525607aa0e2c11a74 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 89466b0014fd635ecda12ffce19d75caf340e4f6..a35e5b782127db1e8b0465b16f41e641411a613c 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 029cc9bbcf8aa8aa968ec8f9f9c63a8dc15da3a0..007f11d671a722e5e71f9c770e320a1e0ca42e30 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -40,7 +39,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 1c9cc0cdc94e0f439de4dd5c612500e4cbd8b229..f6f73059c7583224e728e13142b63cce7e600572 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -44,7 +43,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index a0a149904d2eacd15d4d117e3a09ad985f7138e5..c28b81bff4e1e87595fd675d906c719ce09a6dfb 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -42,7 +41,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 86c7116b83c251d47249c752116e3f7648f69b3b..0a6e0d6875317e0c7bdbf9bef4bce5bd06cdd613 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index c1c7b21cd86ded27140d470675d3ec929a7bca1d..97c37cf0d9f71fcdcf5632bed0ad150059856c5a 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index d8535b60d99b0795538aff2f7421153391004f94..3d97a52ea547f513c69bd20c371ce4c62671d170 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -40,7 +39,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index aad6ee43f316deec7c72f74bedbfb611b92770f3..ed57a54f7a6521dad11110a772814b3b6ac42d7a 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -44,7 +43,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
index a2cb37e1ae5141fa6b158e6edda73a824e3a4a29..51175fb6d5a46834e3e3b6406a2db78fac83264f 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -43,7 +42,6 @@ CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_NAND_ATMEL=y
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
index e49a90d21f925a6b04c420384ea211a5e60cb18c..e8aa9d9687f60e76fb90c9fdd276bceb41faf1d4 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -46,7 +45,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_PINCTRL=y
index 85130d7a49dfa9e07ecd54dde4aec9461b27b3a9..bef8345cc31d433e5b92b2821cdae592179dc71d 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_FAT=y
@@ -48,7 +47,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 38357632e7d54fe7a38c5b4f023410f94b6898a6..1402bccb9721278588c34a1118d9dbe86288fc68 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_FAT=y
@@ -44,7 +43,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 41a59891af30e7183ecc47ce87c6328a1ae64154..7b741807098cdca46236d3c24e81f612d7ddd217 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_FAT=y
@@ -43,7 +42,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 10df6441a407bccddd598bc4c6fcfec2438e5401..0a297b367fcd93da755737685ace9027ca29b2f1 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -49,7 +48,6 @@ CONFIG_NAND=y
 CONFIG_NAND_ATMEL=y
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 158c1ec3cb23e158d26a98fc4e7d53b3d442f11b..438c7fdd4d06c3506eda700a0948a92aeadc1c7b 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -46,7 +45,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index b5c282dc2539b0c2ba3ae29020cbb78941d67241..8f9efdf98a69be4004a85b902b1598750b469e81 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -45,7 +44,6 @@ CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_NAND_ATMEL=y
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 1fe37f96d1ca6a8b106d18981564fe1cb968c15a..fce32c0b9af91b5bc3ff91a2e8c99cfa41b112b5 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -48,7 +47,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index c71373530678543b7943f5b12578ca4a4b8156e5..a92106cc6f653c77772eeab5027826d8c13cecee 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 1862fc4b5af9a45efc61e67dcee1c32420232c51..32c037b08b079977d910aec71cd8bc6035f673dc 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index 110b1799f27ff1d78b91caefb1ada3eb320c214f..68d43ff814196b8a529682bcab4be049d4f07c02 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -40,7 +39,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_ETH=y
index bd60000ba9d469aca8d484def58540df28862aad..79ff80f7c2020a55c804f576b5a5dfb6340a8ea3 100644 (file)
@@ -57,7 +57,6 @@ CONFIG_MISC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -75,7 +74,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index b9bb0c9b11120dbf6966e20e31df72cb35d2fbe6..308f0f11a6b3db8a3c605a71377b02176e2b8420 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
@@ -43,7 +42,6 @@ CONFIG_I2C_EEPROM=y
 CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xfa
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SF_DUAL_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
index a1d374aeb5f9d23f6f49431866e73bb3aed5f34b..9947ed90b9fc8684201a8fb70d56a4e15d81bdab 100644 (file)
@@ -39,7 +39,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_PINMUX is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
@@ -61,7 +60,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PINCTRL=y
index 38c8ae998fd291655a383539e5df6137f451c0a8..ff1c414ea93ce281fecc1e8f0449790845e2a87e 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="AXS# "
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -39,7 +38,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_SNPS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_DM_ETH=y
index 8255d9fa068a94bae43fbf96ec0e135362d8e3f5..493bba882bdb506ae07ab15988a263f53f450894 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="AXS# "
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -39,7 +38,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_SNPS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_DM_ETH=y
index c79de19919c0e25fb0fed6e1ced3915155149cf3..a3d6a61b6e5de04146ddf28dc746d511b028595c 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="fdt addr ${fdtcontroladdr};fdt move ${fdtcontroladdr} ${fdtsaveaddr};fdt addr ${fdtsaveaddr};"
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot>"
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 CONFIG_CMD_SPI=y
 CONFIG_OF_PRIOR_STAGE=y
@@ -19,7 +18,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_BCMSTB=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_BCMSTB_SPI=y
index 74557deec659ec044f6c144a8153a827d2a4e060..c6111e5aa9e9ccade364e217ce54ed5e86241a7d 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_CACHE=y
 CONFIG_DOS_PARTITION=y
 CONFIG_ISO_PARTITION=y
@@ -40,7 +39,6 @@ CONFIG_NAND=y
 CONFIG_NAND_BRCMNAND=y
 CONFIG_NAND_BRCMNAND_63158=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPECIFY_CONSOLE_INDEX=y
 CONFIG_CONS_INDEX=0
index 6c6f57d3ad61ef571c5f5c614fa4c2fef8c72cd5..49fe205a31b9fe89af193f3b301b77124a2c15c5 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PART=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_DOS_PARTITION=y
 CONFIG_ISO_PARTITION=y
@@ -36,7 +35,6 @@ CONFIG_NAND=y
 CONFIG_NAND_BRCMNAND=y
 CONFIG_NAND_BRCMNAND_6858=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPECIFY_CONSOLE_INDEX=y
index 2af8e2c38482a15de366bf110b764e3c6f7f1756..2ae859edae142c7b5d4b9ede10fd64297bf21b45 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -32,7 +31,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 20d3e33e96e46fe5dcfcde2fba17ae182323a643..6ad2b7c9e6b781112bb7cdec8a4ea524f9536d28 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -59,7 +58,6 @@ CONFIG_NAND_VF610_NFC=y
 CONFIG_NAND_VF610_NFC_DT=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHYLIB=y
index a29dc0385ebd482aca40de6da40291ab5207b54e..aa4c7f74fa59eda2ee1acb4fab46a1f9d3b11118 100644 (file)
@@ -52,7 +52,6 @@ CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_ITEST is not set
 CONFIG_CMD_DHCP=y
@@ -87,7 +86,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
index 8f76262c5f242820aa69ed21834e80bffd6a0bc6..9863cc5559971c45d921e352a67e74510ee0a352 100644 (file)
@@ -10,13 +10,13 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x1000
 CONFIG_TARGET_BRPPT2=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
+CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
+CONFIG_SYS_BOOTCOUNT_ADDR=0x020CC068
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 # CONFIG_CMD_BMODE is not set
-CONFIG_DEFAULT_DEVICE_TREE="imx6dl-brppt2"
-CONFIG_NR_DRAM_BANKS=1
-CONFIG_TPL_SYS_MALLOC_F_LEN=0x0
 # CONFIG_EXPERT is not set
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
@@ -30,6 +30,7 @@ CONFIG_SPL_BOARD_INIT=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_ELF is not set
@@ -43,7 +44,6 @@ CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 # CONFIG_CMD_NFS is not set
@@ -54,6 +54,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_DEFAULT_DEVICE_TREE="imx6dl-brppt2"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupts dmas dma-names"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_NET_RANDOM_ETHADDR=y
@@ -62,17 +63,13 @@ CONFIG_SPL_DM_SEQ_ALIAS=y
 # CONFIG_OF_TRANSLATE is not set
 # CONFIG_SPL_BLK is not set
 CONFIG_BOOTCOUNT_LIMIT=y
-CONFIG_SYS_BOOTCOUNT_SINGLEWORD=y
-CONFIG_SYS_BOOTCOUNT_ADDR=0x020CC068
 CONFIG_SYS_I2C_MXC=y
 CONFIG_MMC_BROKEN_CD=y
 # CONFIG_SPL_DM_MMC is not set
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
-CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_FIXED=y
index d0faa4058cdea67c9d810a118558e6ba72c083be..b6626e15facfce74bb0046981229e833403dc7c1 100644 (file)
@@ -54,7 +54,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_ITEST is not set
@@ -85,7 +84,6 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 452ac90af3fac14b060d28ff46ddf69565930fc3..053953373ec0e0a94baae7443c1a419ac04d3bad 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -26,7 +25,6 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra30-cardhu"
 CONFIG_SPL_DM=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 95a4a6afed551b67dd53d80ee667fdeb70c01373..374ca5b9bf21750d468709082cef94ab876d6b23 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -31,7 +30,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 6a1ea049f92b93eaebb9efb5dbbf59765219dcb9..3845e84e498a6505c3fbd773daab7d81ded5dfc3 100644 (file)
@@ -5,8 +5,8 @@ CONFIG_SYS_TEXT_BASE=0x00100000
 CONFIG_ROCKCHIP_RK3288=y
 # CONFIG_SPL_MMC_SUPPORT is not set
 CONFIG_TARGET_CHROMEBIT_MICKEY=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -29,7 +29,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -65,7 +64,6 @@ CONFIG_PWRSEQ=y
 # CONFIG_SPL_DM_MMC is not set
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=2
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 8059c633cec047d83f4c7bfb4d358953c39f3765..55c5320b12dcad4a395bde634299586ba66c33a6 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x4000
 # CONFIG_SPL_MMC_SUPPORT is not set
 CONFIG_TARGET_CHROMEBOOK_BOB=y
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xff1a0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -28,7 +27,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -54,7 +52,6 @@ CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_DM_ETH=y
index 1b7751cc6ac178dc00cc5b69b94cd43f13cd4128..a3c66f8e5e6729b50e6f1d1ad6c268c7c7cf71d4 100644 (file)
@@ -4,8 +4,8 @@ CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00100000
 CONFIG_ROCKCHIP_RK3288=y
 # CONFIG_SPL_MMC_SUPPORT is not set
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -31,7 +31,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -68,7 +67,6 @@ CONFIG_PWRSEQ=y
 # CONFIG_SPL_DM_MMC is not set
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=2
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 28ae61847f08a9220f0b31321ca4e0fc46fb8ab0..4460d32e83306d1b42b6c69b0de34308edf03780 100644 (file)
@@ -5,8 +5,8 @@ CONFIG_SYS_TEXT_BASE=0x00100000
 CONFIG_ROCKCHIP_RK3288=y
 # CONFIG_SPL_MMC_SUPPORT is not set
 CONFIG_TARGET_CHROMEBOOK_MINNIE=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -30,7 +30,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -67,7 +66,6 @@ CONFIG_PWRSEQ=y
 # CONFIG_SPL_DM_MMC is not set
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=2
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 0284e31bcfcc56775c403a123bd14970763fff3b..c95a9a6d71a97ee5b5e45e28e42f30a271bc5f1b 100644 (file)
@@ -5,8 +5,8 @@ CONFIG_SYS_TEXT_BASE=0x00100000
 CONFIG_ROCKCHIP_RK3288=y
 # CONFIG_SPL_MMC_SUPPORT is not set
 CONFIG_TARGET_CHROMEBOOK_SPEEDY=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -31,7 +31,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -67,7 +66,6 @@ CONFIG_PWRSEQ=y
 # CONFIG_SPL_DM_MMC is not set
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=2
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index ebfe3cf158d3e90b63378184b2bfb8fe07567474..9f75e391f219d114552218b502be76dc453267ee 100644 (file)
@@ -31,7 +31,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -53,7 +52,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_MV=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_MTD=y
index 40f86e588adbc729516b996fddab32a68e334dd3..d26dfc14c84bc75893e268b4d37d117811994418 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -46,7 +45,6 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_XENON=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index 933c1c5bb7ac8d17c773f3766380fd57558aabad..013f2c6d9b1ad24e62e57d7cf7a4bcbec18a65e9 100644 (file)
@@ -42,7 +42,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_NFS is not set
@@ -58,7 +57,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=48000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_EON=y
index a6457d50540d1ad9f648012763ce824a0fd926c8..ad97ebfd5e7da392d14d3601f1f59c45013fc89b 100644 (file)
@@ -2,11 +2,11 @@ CONFIG_ARM=y
 CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_MX7=y
 CONFIG_SYS_TEXT_BASE=0x87800000
-CONFIG_IMX_HAB=y
 CONFIG_TARGET_COLIBRI_IMX7=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
+CONFIG_IMX_HAB=y
 # CONFIG_CMD_DEKBLOB is not set
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_imx7/imximage.cfg,MX7D"
index b4ca115f13bef1456d857dc367fa40807f19c29f..68cfc4b1bfc311406727129a15fd32bdc00eb0bc 100644 (file)
@@ -2,12 +2,12 @@ CONFIG_ARM=y
 CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_MX7=y
 CONFIG_SYS_TEXT_BASE=0x87800000
-CONFIG_IMX_HAB=y
 CONFIG_TARGET_COLIBRI_IMX7=y
 CONFIG_TARGET_COLIBRI_IMX7_EMMC=y
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
+CONFIG_IMX_HAB=y
 # CONFIG_CMD_DEKBLOB is not set
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
index 0f26c8989935ffa8a9a0708f5b7ca1d134d075b1..99659ff3ff149b74cb9dc408d1633713975fc25a 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_LICENSE=y
 CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADS is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
@@ -40,7 +39,6 @@ CONFIG_LED=y
 CONFIG_LED_BCM6328=y
 CONFIG_LED_BLINK=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_DM_ETH=y
index 3bd6ea74bf208507d1554118b521342f86920e28..5ea44ea6e441442c89b1c8219332db3dcb15d42c 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_LICENSE=y
 CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADS is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
@@ -40,7 +39,6 @@ CONFIG_LED=y
 CONFIG_LED_BCM6328=y
 CONFIG_LED_BLINK=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_DM_ETH=y
index b61982eac67e1cec9d2304ae515f15446bc15c0d..6f571563b0faf1d47b9c4f7c9f58ae863417ebcb 100644 (file)
@@ -34,7 +34,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -62,7 +61,6 @@ CONFIG_LED_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_MV=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHY_MARVELL=y
index c396a7c5baf78392a8cf1bfbf92e96e81e82e90c..41a79a514127dcc521a918ddd59932749e787941 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -34,7 +33,6 @@ CONFIG_SYS_I2C_MVTWSI=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_DEVICE=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
index 5eb015022fb3af247a418dc885297a8612ef17a8..4ff08e7d44472c517223ed356e24ec4b73f1ac4d 100644 (file)
@@ -59,7 +59,6 @@ CONFIG_DM_MMC=y
 CONFIG_MTD=y
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
index 698ac13a2896405e9bc39e090dce1da428defbfd..26b12bfbb60017a6beb4c3ba7cf540c49bbdba5f 100644 (file)
@@ -53,7 +53,6 @@ CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_PROTECTION=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
index 063b5b89240b1fef90450bdb83d94e3083fd64b5..b1f11deab835849ca7cd5bff169cb28f9e80ed78 100644 (file)
@@ -59,7 +59,6 @@ CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
 CONFIG_SYS_NAND_U_BOOT_OFFS=0x28000
 CONFIG_SPL_NAND_SIMPLE=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
index f660d38aee5f2f76140c2d9a69c3f5c35f1d5842..8012ad8d87e9eb07f18b212241c127526d050c73 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -31,7 +30,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 01ef497682ad912af4917df626886e619d236143..224b4b3387191d25434fa5798b50e1a8fdd142bc 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_CMD_DM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -38,7 +37,6 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHY_MARVELL=y
 CONFIG_DM_ETH=y
index 78c025596faa06b4d40ffd16d16169f5a31403b6..8ef1478a49bad14dca85b3525393738b7787bbc7 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -50,7 +49,6 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_BLK=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHY_MARVELL=y
index 3d23c12aecd67af5c302ea48aa288b598f9cf804..c1a858db0209a23be7b76e41e3c7605670ec3392 100644 (file)
@@ -28,7 +28,6 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x24000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -59,7 +58,6 @@ CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_PXA3XX=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 04bfbc4735bded76020097b32444b0eef16dc005..07fb557668484719dd74bdbbbc4b464774fc43cf 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x24000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -56,7 +55,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_MV=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHY_MARVELL=y
index 265f254582bca3ec4198c82d83e70c13ef131e40..3ea5de4252274fef41bcadab5b79fc022e795990 100644 (file)
@@ -28,7 +28,6 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SATA=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -55,7 +54,6 @@ CONFIG_BLK=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_PXA3XX=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHY_MARVELL=y
index de34d1fd6f892e15cdad030f33c2a80472fd8537..85fe5937d2e066b94353864ed10a72e31f28de0a 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -40,7 +39,6 @@ CONFIG_MTD_DEVICE=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_PXA3XX=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
index 072dcb20b5e8009ee0bd94c248d48af86babea3b..db3341e8cbb326dcf72503b992a6704d8c2e8fa5 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SATA=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
@@ -56,7 +55,6 @@ CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
index 91b369532d94e2a1a02a1b5fb3c612484a6c0da1..7169b334ab1a8b10b087db2fac6a3a7628a70ccd 100644 (file)
@@ -48,7 +48,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
 # CONFIG_CMD_PINMUX is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_WDT=y
 CONFIG_CMD_DHCP=y
@@ -88,7 +87,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
@@ -109,8 +107,8 @@ CONFIG_DM_REGULATOR_PFUZE100=y
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
-CONFIG_WATCHDOG_TIMEOUT_MSECS=15000
 CONFIG_SYSRESET=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_I2C_EDID=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=15000
 CONFIG_IMX_WATCHDOG=y
index a41a6329cb8cf772299fd97ccb82cee83f77cf8b..221f4b557c5922d84f2e70ff9cc1e1a0e1c33c41 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_BOOTCOMMAND="echo SDP Display5 recovery"
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_MISC_INIT_R=y
 CONFIG_BOUNCE_BUFFER=y
-# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
 CONFIG_SPL_DMA_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
@@ -49,7 +48,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_WDT=y
@@ -92,7 +90,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
@@ -121,7 +118,7 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
-CONFIG_WATCHDOG_TIMEOUT_MSECS=15000
 CONFIG_I2C_EDID=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=15000
 CONFIG_IMX_WATCHDOG=y
 CONFIG_PANIC_HANG=y
index 88d160d0b5251cb0f141c50dc1d13852ca64a374..a1a5dc549ecd4039dc543027e0e80c3e6ad345d3 100644 (file)
@@ -78,7 +78,6 @@ CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -110,7 +109,6 @@ CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_DWC3_PHY_OMAP=y
index ca904d8d2d1ae6c9dd8d2614c5b2c1540519b4fb..85b5f597100066a2cfbfdf8a50003a8a3dcc590b 100644 (file)
@@ -81,7 +81,6 @@ CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -113,7 +112,6 @@ CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_DWC3_PHY_OMAP=y
index 0a376e0b6e3ebf60fbb161ff777718d191514183..8d8cc22156856c1d67d832ff1399ccc64c0877ee 100644 (file)
@@ -78,7 +78,6 @@ CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_SPL_MMC_HS200_SUPPORT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_BAR=y
@@ -110,7 +109,6 @@ CONFIG_SPL_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
index 206539da5b258aa36683bfe1883124fe607e5c8e..c421eacbe8ff6f8e928bfb1a1d50e2aae12c6716 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_USE_PREBOOT=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -33,7 +32,6 @@ CONFIG_MVSATA_IDE=y
 CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
index 8f332a021deabf42bca9e11c4dea2a689416b509..3e69aaa7c4599b937fb9583813edcf7d774107fe 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_IDE=y
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -30,7 +29,6 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
index 408904df2258bea56b41f9c08eb34d327f7058b0..9114fed32f17359854819e37289aade20b7d1565 100644 (file)
@@ -28,7 +28,6 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x24000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -51,7 +50,6 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_MTD_DEVICE=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHY_ADDR_ENABLE=y
 CONFIG_PHY_MARVELL=y
diff --git a/configs/durian_defconfig b/configs/durian_defconfig
new file mode 100644 (file)
index 0000000..20177e4
--- /dev/null
@@ -0,0 +1,33 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_TARGET_DURIAN=y
+CONFIG_SYS_TEXT_BASE=0x500000
+CONFIG_NR_DRAM_BANKS=1
+# CONFIG_PSCI_RESET is not set
+CONFIG_AHCI=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyAMA0,115200 earlycon=pl011,0x28001000 root=/dev/sda2 rw"
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_LAST_STAGE_INIT=y
+CONFIG_SYS_PROMPT="durian#"
+# CONFIG_CMD_LZMADEC is not set
+# CONFIG_CMD_UNZIP is not set
+CONFIG_CMD_PCI=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="phytium-durian"
+# CONFIG_NET is not set
+CONFIG_DM=y
+CONFIG_SCSI_AHCI=y
+CONFIG_AHCI_PCI=y
+CONFIG_BLK=y
+# CONFIG_MMC is not set
+CONFIG_PCI=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCI_PHYTIUM=y
+CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_DM_SERIAL=y
+CONFIG_PL01X_SERIAL=y
index d650acae24ce55d8f7d7de2755dce0157ee950af..34c9c85dfc7f7ccc60c42a25fd57e388f61f7f1d 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -25,7 +24,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index cac6e4201fa5fb3179d3e59a41c03fa9cfea336e..553b22cf6902cb81b3462786b1634e35706841cc 100644 (file)
@@ -33,7 +33,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_DM_PCI_COMPAT=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Intel"
 CONFIG_USB_GADGET_VENDOR_NUM=0x8087
index 45a9175dac45c3f34bd099100be3a891d7511518..8668c80dd905f3784439d170fc63184b912138e3 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_SAVES=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -61,7 +60,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 5a06b2a99fa9806c26258e29606d10ab92f1ab6d..9692f7a85f1dbbcdb3199de89e82f8489985aa21 100644 (file)
@@ -2,14 +2,13 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3368=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x40000
 CONFIG_TPL_LIBCOMMON_SUPPORT=y
 CONFIG_TPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl-v8.lds"
 CONFIG_TARGET_EVB_PX5=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x600000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BASE=0xFF1c0000
 CONFIG_DEBUG_UART_CLOCK=24000000
index 2e7f57ae956bf64a9cf475b3bcc7ae98d953d068..5dd5f43f7c7995b93ad5a4869247d594bba4d40b 100644 (file)
@@ -5,9 +5,9 @@ CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x60000000
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_ROCKCHIP_RK3036=y
+CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x0
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0x20068000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -22,7 +22,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_CMD_SETEXPR is not set
@@ -44,7 +43,6 @@ CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_LED=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_PINCTRL=y
index a3189638a16dcd6ba99c5ed489d31ec4f3551627..ec2f143ddeca4ad6b7f1a9e96d7bb80a01d97399 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_PHY=y
 CONFIG_PINCTRL=y
index 9c8c084178655b764a91b4f389642b2581edb354..745fdd1c0fcaee66e06719185a57668d6c3eab17 100644 (file)
@@ -5,8 +5,8 @@ CONFIG_ROCKCHIP_RK322X=y
 CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x0
 CONFIG_TARGET_EVB_RK3229=y
 CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl.lds"
-CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_STACK_R_ADDR=0x60600000
+CONFIG_NR_DRAM_BANKS=2
 CONFIG_DEBUG_UART_BASE=0x11030000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
index 043ee32bb441186c8f959a58fe4c8d18108706df..c2a78bd06529d81c5b1f03f69a88c8d56d45a642 100644 (file)
@@ -3,9 +3,9 @@ CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x01000000
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_TARGET_EVB_RK3288=y
+CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_SIZE_LIMIT=0x4b000
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -21,7 +21,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -53,7 +52,6 @@ CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index f161c40ae76961664b8d63ad31eb67696508eebc..cc6164e0901d3f8963789eb73b197045a601807d 100644 (file)
@@ -3,12 +3,11 @@ CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3328=y
 CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x40000
 CONFIG_TPL_LIBCOMMON_SUPPORT=y
 CONFIG_TPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x600000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xFF130000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -55,7 +54,6 @@ CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index a0d215a5f185d266a9425b4fc3c4ff4b17373434..2c6901309880714ecd0da824f28d73ac25e39106 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -18,7 +16,6 @@ CONFIG_TPL=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index 2e28871f374bee1fae6374109e1d90dc773a6004..037715cbc0b8ad3d649e6d4633eee16730931413 100644 (file)
@@ -11,7 +11,6 @@ CONFIG_DEFAULT_FDT_FILE="rv1108-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_RANDOM_UUID=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -27,7 +26,6 @@ CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=1
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_MTD=y
index 05bbfbf381a1aece5434fdaebd39996804377b58..e475395a1d0070eed1ace39035348d0932cc6757 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
 CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x4000
 CONFIG_TARGET_ROCK960_RK3399=y
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -17,7 +16,6 @@ CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index 29935d869ca78d840fbeaddbf4b31eb9bc53b338..65e839214cc6d94e36d465ebb5c9f890afc026b0 100644 (file)
@@ -1,15 +1,14 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
-CONFIG_SYS_TEXT_BASE=0x00000000
+CONFIG_SYS_TEXT_BASE=0x01000000
 CONFIG_ROCKCHIP_RK3288=y
-CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_TARGET_FIREFLY_RK3288=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_SPL_SIZE_LIMIT=262144
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
-CONFIG_SPL_TEXT_BASE=0xff704000
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_USE_PREBOOT=y
 CONFIG_SILENT_CONSOLE=y
@@ -22,7 +21,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -56,7 +54,6 @@ CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index d022631465140fcd8e03a7c468c42632b54e31e5..50fd8b5b6ea2e11aba35fdc7230de1c5473bf582 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -18,7 +16,6 @@ CONFIG_TPL=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index be92c3c7f1e05e31f7d7b734e59aae11e40cf8df..d97b95ddd7c15d3fe3dec7162732e140afe4c6d0 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MTD=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_WDT=y
 CONFIG_CMD_DHCP=y
@@ -50,7 +49,6 @@ CONFIG_LED_BLINK=y
 CONFIG_LED_GPIO=y
 CONFIG_MTD=y
 CONFIG_MTD_SPI_NAND=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index 7e61a40e95399cbad978661d67e97d8c9af68f6a..8bf69c366648d8a5999b7d9b08e18dc9db3a62d3 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MTD=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_WDT=y
 CONFIG_CMD_DHCP=y
@@ -53,7 +52,6 @@ CONFIG_LED_BLINK=y
 CONFIG_LED_GPIO=y
 CONFIG_MTD=y
 CONFIG_MTD_SPI_NAND=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index 75fdbf7e72a7118d55885a53a426056f58438d4c..38f72bf8ef0c3fa0f1a640af4225e7ce5f4617cd 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT2=y
@@ -45,7 +44,6 @@ CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
index 4a243d679fdf857455995595782ac955ea839f5e..5dc49af29fd9885cc851f5dca14516d4e684be76 100644 (file)
@@ -9,7 +9,6 @@ CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_GPIO=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -38,7 +37,6 @@ CONFIG_LED=y
 CONFIG_LED_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_DM_ETH=y
index 8c79cbad402cdc3b6d9c9a1c6a25be6c8be2fe92..651d3396d4b947f2954c181a3b805ee706f8a3b4 100644 (file)
@@ -9,8 +9,8 @@ CONFIG_CMD_EECONFIG=y
 CONFIG_CMD_GSC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x18000000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_CMD_HDMIDETECT=y
 CONFIG_SPL_TEXT_BASE=0x00908000
index 6b2e0c7fc4acfd45fb1b29ee8ab7653e28735210..e8de54850e8cc778628ba9aefefc92db9e4585cd 100644 (file)
@@ -9,8 +9,8 @@ CONFIG_CMD_EECONFIG=y
 CONFIG_CMD_GSC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x18000000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_CMD_HDMIDETECT=y
 CONFIG_SPL_TEXT_BASE=0x00908000
index a485fc9b5e9dd63603c70b1b4b767a3bad3108b7..7cd148e5c3a798448b000cf8387d4ed329eeabc9 100644 (file)
@@ -9,8 +9,8 @@ CONFIG_CMD_EECONFIG=y
 CONFIG_CMD_GSC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x18000000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_CMD_HDMIDETECT=y
 CONFIG_SPL_TEXT_BASE=0x00908000
index ed488cb8ad48e124151f80f55c4bbc49a9a20254..b8c239b04cae0f92cf188eb9c10755d08232fe24 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x141
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -50,7 +49,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_MV=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_SPEED=104000000
 CONFIG_SPI_FLASH_WINBOND=y
index e28ceae289c14a6cca8641f5cfba42a5ad0b262c..841c9c3a5092c1b8fc14cf22e5fa325533d374cd 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_PROMPT="hsdk# "
 CONFIG_CMD_ENV_FLAGS=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -42,7 +41,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_SNPS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index 6b92f942e504ca6740d6a726cf7ab42da892cbcc..77be9f46b05a0817e5161bc5738ee4ee8cfc7146 100644 (file)
@@ -1,10 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x17800000
-CONFIG_IMX_HAB=y
 CONFIG_TARGET_MX6DL_MAMOJ=y
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_CSF_SIZE=0x2060
+CONFIG_IMX_HAB=y
 # CONFIG_CMD_BMODE is not set
 CONFIG_SPL_TEXT_BASE=0x00908000
 CONFIG_DISTRO_DEFAULTS=y
index 23e78a8ef45a14bd8b65a607faf70cedbfd354b4..6f4f712c8a8856f1e617ebed009122f696a5b466 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_DEBUG_UART_BASE=0x021f0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SPL_LIBDISK_SUPPORT=y
 # CONFIG_CMD_BMODE is not set
-CONFIG_CMD_NANDBCB=y
 CONFIG_DEBUG_UART=y
 CONFIG_SPL_TEXT_BASE=0x00908000
 CONFIG_FIT=y
@@ -59,9 +58,6 @@ CONFIG_SYS_I2C_MXC=y
 CONFIG_FSL_USDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
-CONFIG_CMD_MTDPARTS=y
-CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-nand:2m(spl),2m(uboot),1m(env),8m(kernel),1m(dtb),-(rootfs)"
 CONFIG_PHYLIB=y
 CONFIG_PHY_SMSC=y
 CONFIG_FEC_MXC=y
index 523dbf895b6c3bbf0e2d5e64d458d6623a52044f..25cfa88437063036c6d4688b86f3ab3084744383 100644 (file)
@@ -6,8 +6,8 @@ CONFIG_SYS_TEXT_BASE=0x40200000
 CONFIG_TARGET_IMX8MQ_EVK=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
-CONFIG_SPL_TEXT_BASE=0x7E1000
 CONFIG_CSF_SIZE=0x2000
+CONFIG_SPL_TEXT_BASE=0x7E1000
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
index 9ec76764841ae975e73b928d2663ba1db202ce35..6e7d9e65601b6fcafa0b52abee565c4e53b6fdf6 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_SPL_SYS_ICACHE_OFF=y
 CONFIG_SPL_SYS_DCACHE_OFF=y
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
-CONFIG_SPL_TEXT_BASE=0x100000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
@@ -16,6 +15,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_SPL=y
+CONFIG_SPL_TEXT_BASE=0x100000
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx8qm_mek/imximage.cfg"
 CONFIG_BOOTDELAY=3
index bbecea8e61d745eeb57a077460fdc60cd9c911a6..202d1fffc72416f6326dc000106a5dd1274102f2 100644 (file)
@@ -3,15 +3,14 @@ CONFIG_SPL_SYS_ICACHE_OFF=y
 CONFIG_SPL_SYS_DCACHE_OFF=y
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
-CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_TARGET_IMX8QM_ROM7720_A1=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=4
 CONFIG_SPL=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
@@ -21,11 +20,11 @@ CONFIG_BOOTDELAY=3
 CONFIG_LOG=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_BOARD_INIT=y
-CONFIG_HUSH_PARSER=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_IMPORTENV is not set
 CONFIG_CMD_CLK=y
@@ -41,8 +40,8 @@ CONFIG_CMD_FAT=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx8qm-rom7720-a1"
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM=y
-CONFIG_SPL_DM_MMC=y
 CONFIG_SPL_CLK=y
 CONFIG_CLK_IMX8=y
 CONFIG_CPU=y
@@ -79,5 +78,3 @@ CONFIG_DM_SERIAL=y
 CONFIG_FSL_LPUART=y
 CONFIG_SPL_TINY_MEMSET=y
 # CONFIG_EFI_LOADER is not set
-CONFIG_ARCH_MISC_INIT
-CONFIG_NET_RANDOM_ETHADDR=y
index 2f41e1bac2ca5d3ddbc7ca221228f05945c092b9..d0d625aff47f94f248be5d40f724a3de67f5dbed 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_SPL_SYS_ICACHE_OFF=y
 CONFIG_SPL_SYS_DCACHE_OFF=y
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
-CONFIG_SPL_TEXT_BASE=0x100000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
@@ -16,6 +15,7 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_SPL=y
+CONFIG_SPL_TEXT_BASE=0x100000
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx8qxp_mek/imximage.cfg"
 CONFIG_BOOTDELAY=3
index b79fe14a5ac053e51d147b30322ce0b93152a60d..f9396e612b021cf8135e154d9f94b27f11eccac1 100644 (file)
@@ -8,8 +8,8 @@ CONFIG_TARGET_J721E_A72_EVM=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -36,11 +36,12 @@ CONFIG_CMD_ASKENV=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_MTD=y
 CONFIG_CMD_REMOTEPROC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_UFS=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
+CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0,nor0=47034000.hyperbus"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=47034000.hyperbus:512k(hbmc.tiboot3),2m(hbmc.tispl),4m(hbmc.u-boot),256k(hbmc.env),1m(hbmc.sysfw),-@8m(hbmc.rootfs)"
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
@@ -75,7 +76,6 @@ CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_HBMC_AM654=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
@@ -101,5 +101,3 @@ CONFIG_UFS=y
 CONFIG_CADENCE_UFS=y
 CONFIG_TI_J721E_UFS=y
 CONFIG_OF_LIBFDT_OVERLAY=y
-CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0,nor0=47034000.hyperbus"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=47034000.hyperbus:512k(hbmc.tiboot3),2m(hbmc.tispl),4m(hbmc.u-boot),256k(hbmc.env),1m(hbmc.sysfw),-@8m(hbmc.rootfs)"
index b7168eceb438148aa8b831f7802fc7329974147a..e5cda6800c16136dfb961c27389229fdcbe5bec3 100644 (file)
@@ -45,8 +45,6 @@ CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-r5-common-proc-board"
-CONFIG_SPL_MULTI_DTB_FIT=y
-CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
@@ -59,15 +57,18 @@ CONFIG_CLK_TI_SCI=y
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_DM_GPIO=y
 CONFIG_DA8XX_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
+CONFIG_SYS_I2C_OMAP24XX=y
 CONFIG_DM_MAILBOX=y
 CONFIG_K3_SEC_PROXY=y
 CONFIG_MISC=y
 CONFIG_FS_LOADER=y
+CONFIG_K3_AVS0=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_AM654=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
@@ -76,6 +77,11 @@ CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_POWER_DOMAIN=y
 CONFIG_TI_SCI_POWER_DOMAIN=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_TPS65941=y
+CONFIG_DM_REGULATOR=y
+CONFIG_SPL_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_TPS65941=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
 CONFIG_DM_RESET=y
index a4e6f9f3c62b99254cf79c0fd98804a7832c87ac..dae21edd23165260ccfdab6a8d145a270853c40c 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -32,7 +31,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 260605533e65d0d793f2618582994550796f4cb8..affa5c1aa5bf2efcf54284e54012eb8ff09ad0f2 100644 (file)
@@ -48,7 +48,6 @@ CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
index 98e3cdeb90d58dc644670460b20b6cfe1a702a5d..928aebb9b7b4c28fb53e642b8516a6e3d9271724 100644 (file)
@@ -40,7 +40,6 @@ CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
index 865a643abe338f3d1f01579269d3843e426df5f4..ec67b3ee59b0278a691c98ed5b31afaaa25eaa6d 100644 (file)
@@ -48,7 +48,6 @@ CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_SPANSION=y
index f5f3678bbea936ded525de1d479672faf1818c89..aa590d98eeb07c43e01cdaaad85a81c469b2a575 100644 (file)
@@ -41,7 +41,6 @@ CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -67,7 +66,6 @@ CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
index 2d5f1934d0fdb04c1615819f109bffa931852dae..8315d1f5476d28912963c897e523117d2f405722 100644 (file)
@@ -48,7 +48,6 @@ CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
index 8d679208b0004d42dd66b603220b8b01580ac450..6a7a9b5b6282f34c81174b9339d30cf2da0329a0 100644 (file)
@@ -40,7 +40,6 @@ CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
index b0898b0000ee72884e8a7e851acf144b1937d6bf..3f50640f373881d5dd649a7a27978cc982189b0b 100644 (file)
@@ -48,7 +48,6 @@ CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
index 8b7089bbc7c2cf3bc8ad1354bc87ca015d678462..2cfc04cdd2c0f72d94ef6f92f1d923d048db08a6 100644 (file)
@@ -39,7 +39,6 @@ CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
index acfd91dbe7a5c5ad93f7631c8726cdcd4dd86fa6..4d9184cfd8648923b209c7f857cbaf0d011fd3ed 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -19,7 +17,6 @@ CONFIG_SYS_PROMPT="kedge# "
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index b71fd3a286ed988265e68d5c9057bcdfdca1183d..94747ea015f249c51a6335286b993e19f5e7840e 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -19,7 +17,6 @@ CONFIG_SYS_PROMPT="kedge# "
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index 0a789872dc3b4c1c6a708bfb4c9ef735d163d6b3..a908941aaa6bddb6253b26c349c0843c46d85555 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -19,7 +17,6 @@ CONFIG_SYS_PROMPT="kedge# "
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index 1ba69fc6143e622563a9c9fb2524005f37c3aae1..1a3dee1fd0b8834ed74abfe4e4ec18ec85e88e45 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -36,7 +35,6 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MVGBE=y
index df0c9d322c7b63c513c2c4480b5239a4a476f924..79e57e71f34be2682b28f06d4173aa4887c5cf57 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -36,7 +35,6 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MVGBE=y
index c5020caab01ade7fa8a2bff1b06c4bdc19893904..e5eda1aa826dce7e11ddfbf7c4f4bd7d60d454c1 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -37,7 +36,6 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MVGBE=y
index c3510c473b7ca7c72aa0761f2a017a76e5f5cae3..aebe52d90e9c4e808d1125c100a485d15c171eb2 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -39,7 +38,6 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MVGBE=y
index bcdf97ce1a90e3a43b4d239e89a0f070ef449001..bca8e9b481e968a35f44040533f37caa16e8a2aa 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -39,7 +38,6 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MV88E6352_SWITCH=y
index 2f123bd3f2d90e64f6f393de558230733dad605c..4b4dff5bc11745d30bd3fd93c4ac93ccb5b27258 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -39,7 +38,6 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MV88E6352_SWITCH=y
index 2c9c9bb3fa9ac3ea7e584b3af6563f9a6a61f006..c63f3e53728fa706336d4b635747ad605d0498cc 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -38,7 +37,6 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MVGBE=y
index dc587070d37c20dd3e0b5069b1af8e9938d745d8..1906d1d93f21fd52e0713fbe163386154e0d8347 100644 (file)
@@ -6,9 +6,9 @@ CONFIG_SYS_TEXT_BASE=0x60000000
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_ROCKCHIP_RK3036=y
 CONFIG_TARGET_KYLIN_RK3036=y
+CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x0
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0x20068000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -23,7 +23,6 @@ CONFIG_SPL_STACK_R=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -46,7 +45,6 @@ CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_LED=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_PINCTRL=y
diff --git a/configs/leez-rk3399_defconfig b/configs/leez-rk3399_defconfig
new file mode 100644 (file)
index 0000000..24e8591
--- /dev/null
@@ -0,0 +1,54 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_ROCKCHIP_RK3399=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEBUG_UART_BASE=0xFF1A0000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_DEBUG_UART=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-leez-p710.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
+CONFIG_TPL=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_TIME=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="rk3399-leez-p710"
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_DM_ETH=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_GMAC_ROCKCHIP=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_REGULATOR_PWM=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_RAM_RK3399_LPDDR4=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYSRESET=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_ETHER_ASIX=y
+CONFIG_USB_ETHER_ASIX88179=y
+CONFIG_USB_ETHER_MCS7830=y
+CONFIG_USB_ETHER_RTL8152=y
+CONFIG_USB_ETHER_SMSC95XX=y
+CONFIG_SPL_TINY_MEMSET=y
+CONFIG_ERRNO_STR=y
index 0f9f62450def0c3339009bb9d19e73071907be2c..f384406182d71663a57de33e68933c3be0b91a4c 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_CRC32_VERIFY=y
 CONFIG_MX_CYCLIC=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
@@ -31,7 +30,6 @@ CONFIG_DM=y
 CONFIG_SYS_I2C_DAVINCI=y
 CONFIG_DM_MMC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_DM_SERIAL=y
index f4f7b068a1d71261a9536241c868f99dca6d3838..81c88acc7ae12759cff6ed2407ba7f3643ad57ca 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_ADC=y
 CONFIG_CMD_GPIO=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -36,7 +35,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_MESON_GX=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHY_ADDR_ENABLE=y
index 3760ee453ccc5321c9289e3ba816db72433a8a5a..ce85c7bcc9c428ba2687d9414fc165e12ad9e465 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_GPIO=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MTD=y
 CONFIG_CMD_PART=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -38,7 +37,6 @@ CONFIG_BLK=y
 CONFIG_LED=y
 CONFIG_LED_BLINK=y
 CONFIG_LED_GPIO=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index 9a8ac02d64be5da49e116a0a1185b02603c51160..76465adfded805ff3527412ca44122b508492291 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_GPIO=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MTD=y
 CONFIG_CMD_PART=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -42,7 +41,6 @@ CONFIG_BLK=y
 CONFIG_LED=y
 CONFIG_LED_BLINK=y
 CONFIG_LED_GPIO=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index 1c874169805cc65b7ab51b0de7d1491c0d3070d3..1d02d65a378e4a205f9e4875ee77b9a8ebaf6242 100644 (file)
@@ -6,8 +6,8 @@ CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x0
 CONFIG_TPL_LIBCOMMON_SUPPORT=y
 CONFIG_TPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x600000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BASE=0xFF180000
 CONFIG_DEBUG_UART_CLOCK=24000000
@@ -39,7 +39,6 @@ CONFIG_TPL=y
 CONFIG_TPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_BOOTSTAGE=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_MTDPARTS=y
@@ -64,7 +63,6 @@ CONFIG_TPL_CLK=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHY_MICREL=y
index 1ef92b445af8a6ee875568719208448efc0c89e8..980fe51404d6c6b5a266279a10287536800ed234 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -35,7 +34,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_FSL_PFE=y
index 852cc5634e57b65535de2fa91f49c998b5f851f4..5b6eeaa626dcce684ff625d1c746ee1b7c2ee02e 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -35,7 +34,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_FSL_PFE=y
index 2b83e4ad17a141bbd6e104c1239f1d3d64532d53..f0a404929c1144d6fe974a67429d2cad878d1922 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -31,7 +30,6 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_FSL_PFE=y
index 0e1d15266fff1a9ec6c9390b2ef9a26d79fa14e4..493ae7e41090289d6c3558b4a95e035a6fadafb9 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -31,7 +30,6 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_FSL_PFE=y
index 3b1568f2075d198c3f7b3a58767d5bf4f57170db..8eb25434be2d49689ea96a219bd0ec589c13c567 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1012AFRWY=y
 CONFIG_SYS_TEXT_BASE=0x40100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_AHCI=y
@@ -22,7 +22,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_OF_CONTROL=y
@@ -33,7 +32,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_FSL_PFE=y
index 08eedec827dd9b96bdff1fd62903edc118c5b42c..312c655569dbd135e060832b2cae8ac0bee3ea82 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -34,7 +33,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_FSL_PFE=y
 CONFIG_DM_ETH=y
index 640a462dfbf1311fbba5b70bb392bba3e3d8874e..ff8758434a39b615ee51f79a4677345d144ec66c 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_LS1012AFRWY=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
@@ -22,7 +22,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_OF_CONTROL=y
@@ -33,7 +32,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_FSL_PFE=y
index 65ed34e58394582adfcda1cd90771dfb731a3655..0a6d5c6d9f95ea9b8bf4fadc09d321d0c4283f7b 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -34,7 +33,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_FSL_PFE=y
index 90b30a61721b9a08611e3d8284e410bcc0977751..91bacf0766c9de08859b0e319e53063db5a57d53 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_DEFAULT_SPI_BUS=1
 CONFIG_CMD_USB=y
@@ -49,7 +48,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=10000000
index f011aa02f5ec433ad4806777b24a5d412648961b..2ed38af317ffc5a5d413ab345571a47e2e82afb6 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_LS1012AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@@ -26,7 +26,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_DEFAULT_SPI_BUS=1
 CONFIG_CMD_USB=y
@@ -41,7 +40,6 @@ CONFIG_SCSI_AHCI=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=10000000
index 0379b61fa844394c89c04b70f63c1921f727a77d..588432405bf0a012f067b0d48c3e2c7f0dcbbe10 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_DEFAULT_SPI_BUS=1
 CONFIG_CMD_USB=y
@@ -49,7 +48,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=10000000
index 533e251341486e5229424427fa5cf99253e71c3c..c7f2780bf59105da49f558cb876ad5452464102b 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1012ARDB=y
 CONFIG_SYS_TEXT_BASE=0x40100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=2
@@ -25,7 +25,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -37,7 +36,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_E1000=y
index f9ea2097fb86c18f13ac4cdaedf5cd976007c901..b755a29c29b8566c0f494a2490fe42521375480e 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -36,7 +35,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_FSL_PFE=y
index f3a2a13e0b76fc4488f852e8431a4c4e866ef43c..6001e193f0cbad5207f09902defe3b57cf563062 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_LS1012ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@@ -25,7 +25,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -37,7 +36,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_E1000=y
index d3b38cea1022648d2c116f1ca7f5043959111aee..ce10c736e70762f7a5e53799985db12bb2306bc8 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -37,7 +36,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_FSL_PFE=y
index 43b3f6d255a45e3a83003e8b6f1e21efc34387d9..8dcd414c153f51c4200fc8fff571d83148fe73bb 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1021AQDS=y
 CONFIG_SYS_TEXT_BASE=0x60100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_AHCI=y
 # CONFIG_SYS_MALLOC_F is not set
index 0565d445432c43b13bfa7f1705e3d2f8f37d82a0..37dcc9171b0e0f9b79f9ad7bdbbf6868d2320027 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
 CONFIG_OF_CONTROL=y
@@ -29,7 +28,6 @@ CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index f28967c8fdebb7406c3559ec5e04dc2bd2d41867..ab65060c4d865b7e2c29d14ef0586a2e7b2f5c46 100644 (file)
@@ -30,7 +30,6 @@ CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_FS_UUID=y
 CONFIG_OF_CONTROL=y
@@ -41,7 +40,6 @@ CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 8871c61b87feec8d730045020ac5d35533aff8b2..07708362080bcf10f2c167fba98e806e7230d243 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1021ATWR=y
 CONFIG_SYS_TEXT_BASE=0x60100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_AHCI=y
 CONFIG_DISTRO_DEFAULTS=y
index 8277d6a1140290261dbfeeb24beec40a78f4a4ed..906f0b6e3c4594590d4b05c30b26a77198abed93 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_TARGET_LS1021ATWR=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
index 3170d81aafaa474d31112cf819078f01d4464db9..e2fed911b106427df469273918c9c17590e19c7a 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_LS1028AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_MALLOC_F_LEN=0x6000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_SYS_FSL_SDHC_CLK_DIV=1
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@@ -20,7 +20,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_WDT=y
 CONFIG_CMD_CACHE=y
@@ -40,7 +39,6 @@ CONFIG_I2C_MUX_PCA954x=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 2da7b1d94e39ca71a51d8322e270c45a51b9a254..67c9a82bcd6affe8f4597881db4fc7f391a64c28 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_WDT=y
 # CONFIG_CMD_SETEXPR is not set
@@ -43,7 +42,6 @@ CONFIG_I2C_MUX_PCA954x=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index c1e88b546515291b50c761f668a65bfdb5151182..6b87c57ec332c7bbaeae13f141c6821bc3638443 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_LS1028ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_MALLOC_F_LEN=0x6000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_SYS_FSL_SDHC_CLK_DIV=1
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@@ -20,7 +20,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_WDT=y
 CONFIG_CMD_CACHE=y
@@ -40,7 +39,6 @@ CONFIG_I2C_MUX_PCA954x=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 5ff34047a7509d8c8eb453cf0d0ee204bcb11211..1fd38ca3d482c3821a8b6e7a67c4c13cbb62473a 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_WDT=y
 # CONFIG_CMD_SETEXPR is not set
@@ -44,7 +43,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 472786ab2621f9831f211833c32999930a9d344f..9883d1683d7e2790fd9109614cc96bebd484837e 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
index 57791a748e4c8022c288d189d1b05ae8a197b447..0d9d2dd490afb2cbe33fd5093e5cc0a4c66f77fd 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1043ARDB=y
 CONFIG_SYS_TEXT_BASE=0x60100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_DISTRO_DEFAULTS=y
index c45fc68ac3f7198499e78672e32c97b8ccbd048a..65c8435c5742cfce68e5318c6e2ff8234bda2ab9 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_TARGET_LS1043ARDB=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
index bdfa13a0a71a7512bfd3473204b4ad2c84422897..1626004a46f0918ce7c5722d1dd141c49cda72b0 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_TARGET_LS1043ARDB=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
index 5c8257de4efb634bf6275409443824b5c929dddc..187d493336dd2bb74ea341a3c8c2495fe4092c7e 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_LS1043ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
index 1d274087629b4b47c4da34ffb158afaed0d49b9b..3cabb52ef012baa542e9b5dfb66d6e89f70a6583 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -33,7 +32,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index e863c973076371a6de6dedb2a7d0b8743a7c9d9d..c39b880456a255ac20cb8a7b35f2f04595d9ff06 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1046AQDS=y
 CONFIG_SYS_TEXT_BASE=0x60100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_AHCI=y
@@ -23,7 +23,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -38,7 +37,6 @@ CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_PHYLIB=y
 CONFIG_E1000=y
index 30f9d8229148d57da8c9a1ea2de25c89fbc9db5d..d82d786be28fa4b8bf90ce3cf74851fd7c847c08 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -39,7 +38,6 @@ CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_PHYLIB=y
 CONFIG_E1000=y
index a2381b79527691e37ddf6820e0cd50bd17b6b630..d3fb8077ef8ecf8804d5a0868da88521fd21e963 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -40,7 +39,6 @@ CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_PHYLIB=y
 CONFIG_E1000=y
index 75f9ebffefd51ced1ed08a4329f75a56e9a88b75..5d6f3c10b0002bb0b9fd4e05b435f63d62ca89aa 100644 (file)
@@ -30,7 +30,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -47,7 +46,6 @@ CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_PHYLIB=y
 CONFIG_E1000=y
index 7c0b0d3c23d40c7f7cede56c611a06df52762d86..98a42a7554b30d910bb29aff4f2423abac76f41b 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -34,7 +33,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index 3e537ec2deed70e110b4903d657f8b3f898d9423..d2ba4dd744cb0d860aa4a5fd356ded1e592be820 100644 (file)
@@ -38,7 +38,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -56,7 +55,6 @@ CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_PHYLIB=y
 CONFIG_E1000=y
index 7adaf6b2e560c4a1060d35e5531e771c4a2fe82e..8d68ce61ffeb82d49c7c04da9fa14e391aca90fd 100644 (file)
@@ -36,7 +36,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -50,7 +49,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index 2b4f72f54c462ce390291a2c2975a3568e283450..a8a260fb0b58bfe3ab17e96f055c36da78a70863 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_LS1046AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
@@ -25,7 +25,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -40,7 +39,6 @@ CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_PHYLIB=y
 CONFIG_E1000=y
index 6449d3a7711150750b43614c419c94ac13b9afc8..9033f424f9c96b06521aa308334d7936d241ea58 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -46,7 +45,6 @@ CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_PHYLIB=y
index 4467239d271ff52927a39852b48a09f98d64e269..cdc847ba9518f5d38411b44e048a958ebda6afb3 100644 (file)
@@ -33,7 +33,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -47,7 +46,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index dd784459b3f386a0801d347d7e2c1dbcccd3b686..cee127f8b53d9e6edf704d0d8959ce4bfc5437bd 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1046ARDB=y
 CONFIG_SYS_TEXT_BASE=0x40100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=2
@@ -19,7 +19,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -30,7 +29,6 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index ef5e73dd28dd05d9b1e3b67d210ba735fe6c5ad9..2f9506ab35c86959b71f5fab992e3f03546cc1d7 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -31,7 +30,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index 41c998816a762f43c5eeebc09b50c0e4f32bb65e..ee3e6ea0d6ebac6ed6ed9b46756eee3bcc3cd932 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -50,7 +49,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index fcc3632d9a5f1aaccfa376ac4674a7d46596779e..a07aabe18c60175d72873cc2f1d04ff71dcd4028 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_TARGET_LS1046ARDB=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
@@ -33,7 +33,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -44,7 +43,6 @@ CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1046a-rdb"
 CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index f3b2f61119dda3ad94b380a890715ca92acf3e4a..be94f4ddd86d965413dc254b4adc41258ee04ac4 100644 (file)
@@ -32,7 +32,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -46,7 +45,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index 9423d7db222d24549edb1f70f52142617313a7b9..b6d22fa75a3a8c22911724c68eb36e80b3001ed7 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_TARGET_LS1046ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@@ -20,7 +20,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -31,7 +30,6 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index 1aca8ef13ef7cd8ce0e828148ae13c086f4b9ce9..d183cf74acb599da1c7640f6d75c3441adced958 100644 (file)
@@ -19,7 +19,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -33,7 +32,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHYLIB=y
index bb90ed7549fb3dc1933b5cdca930a0653f944635..40163a4af1e26b7aa11b62974d28541d3b56fd0c 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1088AQDS=y
 CONFIG_SYS_TEXT_BASE=0x20100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=2
@@ -21,7 +21,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -34,7 +33,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 8aeca657e86999efe2d655dfd579f6f5a9100c28..8051e89796ba70c9af4a934ed4dd2ff85a630780 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -34,7 +33,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 5fd9b940d4e8a01a959b31676633b8dda4890ded..9552a89316d0241af7da4681ba0557ad8034427c 100644 (file)
@@ -31,7 +31,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -45,7 +44,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 145beea761d8b4dd0b58da78622fa316e3aa72b5..22bf8b849eee69f15d69c16c7d0d2c7c1a8158c8 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -49,7 +48,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 265303c356c7621a44092c79b41ff06ca3127274..0658b4f1ebd68a31b66276aa507bbced9c382468 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS1088ARDB=y
 CONFIG_SYS_TEXT_BASE=0x20100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=2
@@ -22,7 +22,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -35,7 +34,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 6dd9df2dc1ad3b5159c17a1365c28ebb3d4fbc1d..b3582e33a73efe577ed5c18647f85ecd130186da 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -35,7 +34,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 079ef9d8bce62d53a83c46f648fb9b6b48462a6c..cf4c1e0aa10e302dfb4ee895d744ce80a8286ee8 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_TARGET_LS1088ARDB=y
 CONFIG_SYS_TEXT_BASE=0x80400000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
@@ -34,7 +34,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -46,7 +45,6 @@ CONFIG_SPL_DM=y
 CONFIG_SCSI_AHCI=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 9dbaae6c56bec50a10011b46af4ab724386ce5db..4e8468909affa61ede9a5ee63899cde459bdee05 100644 (file)
@@ -32,7 +32,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -46,7 +45,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 45df1347faa6eaed806bf80a647ce8bf2af4658b..e4c61dc82e0da92b76c2df2fef572984e6fe4a99 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_TARGET_LS1088ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SYS_MALLOC_F_LEN=0x6000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@@ -24,7 +24,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -43,7 +42,6 @@ CONFIG_I2C_MUX_PCA954x=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index b7c40a4d6c1933dd8ce875746994be97031caf82..53882dd331d36aed04c5d87f1056a5d4d9edb9a8 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_MP=y
@@ -44,7 +43,6 @@ CONFIG_I2C_MUX_PCA954x=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index c0fde247fc426a4e84afed479d387ce72bd0ed11..81169bf20fe939d06de30f67b22001ef7bfc0586 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS2080AQDS=y
 CONFIG_SYS_TEXT_BASE=0x30100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_AHCI=y
@@ -21,7 +21,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -40,7 +39,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
index e265ac177b30260fc87896e85d338e034a4670fd..d2b545f0dee2a365e2da2369fb107a3137691e54 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -41,7 +40,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
index 33a75ac83a121ab4088d5caf06d2e6fb06233a9d..cd9d83b8d365bb00e7f50aee0afc7ce190cad261 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -48,7 +47,6 @@ CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
index 53abf71bbd3b0b54c9ed511897f5516e3539d182..b1319701c2aeb86b3d9c6baeacbd2cc36ad40d51 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -38,7 +37,6 @@ CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
index 4e392a8befaf1ac503834d2843fe63b898221a4e..9b034c9f594676308901d6b1cfaa0358dc9f6d19 100644 (file)
@@ -30,7 +30,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -46,7 +45,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_PHYLIB=y
 CONFIG_PHY_GIGE=y
index 5f307f6caf5e18e1bcdcb5504a0717a93033b187..99f3dd2bf3addbf7ce051abc24309d78986a807b 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS2080ARDB=y
 CONFIG_SYS_TEXT_BASE=0x30100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_AHCI=y
@@ -22,7 +22,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
index c92121e6d3ddfe9f5dcb43326878608a94dfe1e9..7943d91e6c545a36d3c80b7ad811a890aab330b5 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -41,7 +40,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_AQUANTIA=y
 CONFIG_E1000=y
index da055d2d178d893f8dccc423c204a83e76914ec4..d9610510bcc0daddf7010dfbcb9368eeb607736f 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
index f0ebe7bc35a0489820cda461f8d71fc712db0d22..2c8f08cf4c7f719aa497d68166d64532299659cd 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
index d4b5d87e6690a65333d6720def26a185f7edb584..8263440cfb53bb0ea1702a1ff689a59a2ba0380f 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_ARM=y
 CONFIG_TARGET_LS2080ARDB=y
 CONFIG_SYS_TEXT_BASE=0x20100000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_FSL_LS_PPA=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=3
@@ -18,7 +18,6 @@ CONFIG_CMD_GREPENV=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -31,7 +30,6 @@ CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index a38ec3da3e311cd25a88b0f50f5eab791d79ac65..e57990330aacc9ac88200e40e523a98a06ec7dcb 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -35,7 +34,6 @@ CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 0f840559935bce2d1d9df7561c88d8a463b79450..88f2ce14e387ce77b04ac028c0364be84da48127 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_TARGET_LS2080ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SYS_MALLOC_F_LEN=0x6000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_QSPI_AHB_INIT=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@@ -25,7 +25,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -48,7 +47,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
index 014acc5e91a4a680008a3acdacc813ed20560197..9fed7935bfd4fdf03fde39e68913258ceeac253b 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -51,7 +50,6 @@ CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 03498480f1d725643f6b50a84d79771772320793..ebfd4af7f76adb29def9498edd093191364d4e8e 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_SATA=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -34,7 +33,6 @@ CONFIG_SATA_MV=y
 CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MVGBE=y
index a0662815e205638a28318259678b18ccf46fc23f..e1182f549e10b7c2a8e86dfb41e7dc308f5f3e29 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_SATA=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -34,7 +33,6 @@ CONFIG_SATA_MV=y
 CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MVGBE=y
index 3d4506bbff022b8bc4b5bd3337248801cf0a732f..5c6a0b5af017d33a3c1f0885dcd226618849e558 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_TARGET_LX2160AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SYS_MALLOC_F_LEN=0x6000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
 CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
@@ -20,7 +20,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -38,7 +37,6 @@ CONFIG_I2C_MUX_PCA954x=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index ef774af62eca564342089b311eb7f758bcc26527..f50bc027cb3bc2795f29992f28770b8ef3fcedfd 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -41,7 +40,6 @@ CONFIG_I2C_MUX_PCA954x=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index ede4e0f75fb285d9df0f7497554de808b7219f71..2e2d888009d72c11da36aaf5628b60eab6835cf4 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_TARGET_LX2160ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SYS_MALLOC_F_LEN=0x6000
-CONFIG_SECURE_BOOT=y
+CONFIG_NXP_ESBC=y
 CONFIG_EMC2305=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
@@ -21,7 +21,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -37,7 +36,6 @@ CONFIG_I2C_DEFAULT_BUS_NUMBER=0
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 1ad4ad79b58be1a6f1297cbee16dd44778ff5309..632b52e548bd185d7ce08b24412c9881c1b438fb 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_MP=y
@@ -41,7 +40,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 7e5bcf94b90e8308573819f55a4b56ff3754bccd..b3660880a531d44d1d29e8679a261daa5d2d9b5e 100644 (file)
@@ -88,6 +88,6 @@ CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_DM_VIDEO=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_IPUV3=y
-CONFIG_IMX_WATCHDOG=y
 CONFIG_WATCHDOG_TIMEOUT_MSECS=8000
+CONFIG_IMX_WATCHDOG=y
 CONFIG_FAT_WRITE=y
index 6b5363d54f533bc6e04936d3bb8dcda7be8e41aa..932d5497ec4875105be5c6b02ac4e8ddfcbede27 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -38,7 +37,6 @@ CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=50000000
 CONFIG_SPL_OF_TRANSLATE=y
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index e2d3b84616c6aea8c6cfeab919c8acb1e90204b0..1c545959fa3f188cb91d5f34f3897b34f0c55ea7 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_PINMUX is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
@@ -41,13 +40,12 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6q-mccmon6"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
-CONFIG_DM=y
-CONFIG_FSL_USDHC=y
 CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_SYS_I2C_MXC_I2C1=y
 CONFIG_SYS_I2C_MXC_I2C2=y
 CONFIG_DM_MMC=y
+CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD_DEVICE=y
@@ -57,8 +55,6 @@ CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_PROTECTION=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
-CONFIG_SF_DEFAULT_BUS=0
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -78,10 +74,8 @@ CONFIG_DM_REGULATOR_PFUZE100=y
 # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
 # CONFIG_SPECIFY_CONSOLE_INDEX is not set
 # CONFIG_SPL_SERIAL_PRESENT is not set
-# CONFIG_TPL_SERIAL_PRESENT is not set
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_DM_THERMAL=y
-CONFIG_USE_TINY_PRINTF=y
 CONFIG_SPL_TINY_MEMSET=y
index 45aba4bb06eb1a51ebc2b7517a66207749dee8a8..80b5c5cf4a3b1bf08df0e90e9128d37d2f9b306e 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 # CONFIG_CMD_PINMUX is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
@@ -39,13 +38,12 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx6q-mccmon6"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
-CONFIG_DM=y
-CONFIG_FSL_USDHC=y
 CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_SYS_I2C_MXC_I2C1=y
 CONFIG_SYS_I2C_MXC_I2C2=y
 CONFIG_DM_MMC=y
+CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD_DEVICE=y
@@ -55,7 +53,6 @@ CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_PROTECTION=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -74,7 +71,6 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_PFUZE100=y
 # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
 # CONFIG_SPL_SERIAL_PRESENT is not set
-# CONFIG_TPL_SERIAL_PRESENT is not set
 CONFIG_MXC_UART=y
 CONFIG_SPI=y
 CONFIG_MXC_SPI=y
index 5d0f2471c07926c340fcf102b1e7bb08fe3c691f..a7b6f54d46a748f524ceee0dbbf5db0512cf3c42 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BDI is not set
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -34,7 +33,6 @@ CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 5312974c3b894e967e8624762c0d972379f76341..f7ff44bf10a58d175880c702ab4b63415f087dca 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -34,7 +33,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 15a6dd5b08159b66db84eedea15bc20f96863285..8c21e11c197afeac6f289cb843d71e5e60adb7f3 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -38,7 +37,6 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_MVGBE=y
index 7b4e3f7f3a26c7c7e7c7b3680e05d307622ec789..30b05ecf44ffd044d44a52af5d10123253317029 100644 (file)
@@ -4,8 +4,8 @@ CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_TARGET_MIQI_RK3288=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -22,7 +22,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -53,7 +52,6 @@ CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index 991a5c7ad6f5af0fa4a6123602802e5a842b44b5..f6e7785d11ee042205d83ec707024a477d769a1b 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_DHCP=y
 # CONFIG_NET_TFTP_VARS is not set
@@ -48,7 +47,6 @@ CONFIG_MSCC_SGPIO=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 0fdd9b8f3f7a6e59f61a7a658f3cde70157ad8c8..c30e52f945262b3f8f1122de6fa89d93e33a0eac 100644 (file)
@@ -28,7 +28,6 @@ CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_DHCP=y
 # CONFIG_NET_TFTP_VARS is not set
@@ -51,7 +50,6 @@ CONFIG_MSCC_SGPIO=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
index edc476d143f59b4863bd670dfd1cf24faab8e84b..53f8b323e89ff72b709be12a8703c3a02e7ac6f6 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MTD=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_DHCP=y
 # CONFIG_NET_TFTP_VARS is not set
@@ -52,7 +51,6 @@ CONFIG_LED_GPIO=y
 CONFIG_MTD=y
 CONFIG_MTD_SPI_NAND=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 687d6e8bf1d4e9c41f46282cd2a8859346e667fa..9f58764b5c9f9894776bb48607059bf6d35a9207 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_DHCP=y
 # CONFIG_NET_TFTP_VARS is not set
@@ -45,7 +44,6 @@ CONFIG_MSCC_SGPIO=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 2077819ba15f5da55c42644430623f003ab91d66..aca97a0e78dbcfd5e61f1f9688dfca3665c16253 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_DHCP=y
 # CONFIG_NET_TFTP_VARS is not set
@@ -43,7 +42,6 @@ CONFIG_MSCC_SGPIO=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_MACRONIX=y
index de438a848b0287448530ad7e21ea2086dbfbd0c6..ff5a3282a2301dc51c52c17e5abf2ad081fd3f6b 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_BOOTMENU=y
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SF_TEST=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NFS is not set
@@ -43,7 +42,6 @@ CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_ISSI=y
index f6bc97f5ab8df68e6b0a8e860171a5d068abcf1d..0733c0f8bc2f5472683537618cc592660b7dd82e 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -46,7 +45,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_XENON=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index 97077e11a23635821e8c55f5a6867b43c0ba2559..5fbb48adf0124d508c9fc87002a5f955ba899a0a 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -42,7 +41,6 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_XENON=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index 9375daf5909e396924469a2c7d7fbcfde5578520..2b70218ab3a7c6893ba366e1cd950aec0d3e211d 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_XENON=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index 7ce24b002945a9118eaffb43c0dc92003a715f53..9f356350443958f0711ec39b29d485d28999f21b 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -45,7 +44,6 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_XENON=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index e4a7441fbe9b1d35ea7dd9039333bd275b389f0e..671cad7d173f586c11266e4ea5d9e87a1120794a 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SATA=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_BMP=y
@@ -39,11 +38,10 @@ CONFIG_DM=y
 CONFIG_DWC_AHSATA=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_FSL_USDHC=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
+CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SST=y
index c2c4ca276fe062f577ac4cf20b9a8636fc9c8cf4..3977294e2adad5d784fd5456ebaea0bc7fa7aa05 100644 (file)
@@ -39,7 +39,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_PART=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -67,7 +66,6 @@ CONFIG_FSL_USDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
index 93f0ee9779b7b06c60feb70946d8e813685ab367..a894d2cb3c71e4132ee13676e9b0450d8766fee3 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -74,7 +73,6 @@ CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
index 6a7fa13f46459a0f1ec25683722ca07c52f777dd..364f1a136ee743ebbccd8f3bb236104a42332abc 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -36,7 +35,6 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
index b4812ffaed137388b2db0b15b58dd648e6623c67..c6dfbcd1a9b0435313ecfd6cbeaff9c9c4c45288 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -36,7 +35,6 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
index 46a5d2c38664966e34e4f570b040be2b61141b8d..7f98829cd54ad7ee7a49483327f8af9b5500c43a 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -45,7 +44,6 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
index fa9853def627b751de77ec5aa2cdbbc05fa0309c..16e1d6d12af4e0e20e82d44bd763c63878820bbc 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -38,7 +37,6 @@ CONFIG_FSL_USDHC=y
 CONFIG_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_STMICRO=y
index c5fabf9950a1e89814ecf32f16700d6b9b4018ac..bb12c70748e36ce8a68c45a76f5d56f6ce7775dc 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -40,7 +39,6 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=40000000
index 9177794ae989453a38496e624b9da8dd168205aa..80d79e5afdca8a2a37f9dcdff99d416d5a8cb923 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -46,7 +45,6 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_STMICRO=y
index 0b3b2b1fb223abd4546b31875a36903617116ab7..89db1b99b3bdbe685a8ab90ee56eb7bf011b161c 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -46,7 +45,6 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_STMICRO=y
index 2528ba8061c96d08c9ed0186b7f296e60b4b6abc..801edbad02dcee3f765aaaff5078079becb8a030 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
@@ -32,7 +31,6 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_STMICRO=y
index f71a495183fa3e6ea30bc184d545ba9b624032c2..0a5d0436b183cb5c80276c4b34dbfb4dad98d33d 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
@@ -33,7 +32,6 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_STMICRO=y
index f647d72c6ee08e63b7ebbd65da67145344be71fb..31a7aae44c3a12b7a285b91c3840f591320fdeda 100644 (file)
@@ -13,7 +13,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
@@ -32,7 +31,6 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_STMICRO=y
index 7223290e59ca7eabd6d632deed2b292db4504e3d..b22dd5e2496b9f66dea1293c063961c5fa540e9b 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
@@ -53,7 +52,6 @@ CONFIG_MMC_UHS_SUPPORT=y
 CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=40000000
 CONFIG_SPI_FLASH_EON=y
index 12106aad54f4f463a961a67d272aeeb61fbc833c..e49383bf1e26487cb36afe35277dccdd223a9754 100644 (file)
@@ -20,8 +20,8 @@ CONFIG_DM_GPIO=y
 CONFIG_IMX_RGPIO2P=y
 # CONFIG_MXC_GPIO is not set
 CONFIG_DM_I2C=y
-CONFIG_DM_MMC=y
 CONFIG_SYS_I2C_IMX_LPI2C=y
+CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_PINCTRL=y
index 1d4c8f8a0240aacb8adc19de1c140c3d88324d63..48f8aa86b938073063621ad397a31f661e40d34e 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -18,7 +16,6 @@ CONFIG_TPL=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index 7375b758a279056e484b30f91973aefe97292cdc..95bd46ffd1307a6eac51693bd9c64a8a57614920 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -18,7 +16,6 @@ CONFIG_TPL=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index 874ee5efb611391d84232069025da00e78b081e0..8b15ddcadfb1bc5810fee4b12a745b185d675778 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -18,7 +16,6 @@ CONFIG_TPL=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index 754a03ecb0b65af882852e255a431d0582c9baf8..44cada80b3c8355408d3de7733c20bf3dcf63f73 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_LICENSE=y
 CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADS is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_MISC is not set
 CONFIG_DEFAULT_DEVICE_TREE="netgear,cg3100d"
@@ -37,7 +36,6 @@ CONFIG_LED_BCM6328=y
 CONFIG_LED_BLINK=y
 CONFIG_LED_GPIO=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_DM_RESET=y
index 32bd4eedaff2bda638a9607d826257b7612e602d..3cfdf4fc227a864ca521681ec69b4f5ae3576bde 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SYS_ALT_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
@@ -42,11 +41,10 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_FSL_USDHC=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
+CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SST=y
index 34166e557ab124cc4eaf504c7f2fa274090f32b4..b1e30f16a54895dc1fa533cee4ca5de15c6b4333 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SYS_ALT_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
@@ -42,11 +41,10 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_FSL_USDHC=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
+CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SST=y
index 2c4def6fce9986dbf4e494594e7adb0f7199d7bb..50ff4ace85babe69fcaae7eca5c262f127ecabb9 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SATA=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
@@ -44,11 +43,10 @@ CONFIG_DM=y
 CONFIG_DWC_AHSATA=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_FSL_USDHC=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
+CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SST=y
index a4ca672d1352a904bfb67a1b05e60a290298bada..0d31b1f24eac98732c1634850886f476dff0b121 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SATA=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
@@ -44,11 +43,10 @@ CONFIG_DM=y
 CONFIG_DWC_AHSATA=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_FSL_USDHC=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
+CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SST=y
index ff8d2affbe655be77b9968dc2626ada7ee7b1a3d..841b46fbd6f52af4e511821e4cbec7dc02f454b5 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SYS_ALT_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
@@ -42,11 +41,10 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_FSL_USDHC=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
+CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SST=y
index f5623cbb5df51ccda921a25c44ff65f6bc7473b1..23fa23d14c590b9fd6cbee3e68f710a393005054 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SYS_ALT_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
@@ -42,11 +41,10 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
-CONFIG_FSL_USDHC=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
+CONFIG_FSL_USDHC=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_SST=y
index 443e27bedfc972c060d577bef92d5ebef52d8eac..4c971b499b8a114561c46292ae9dd2c54e70dec2 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -53,7 +52,6 @@ CONFIG_SYS_I2C_TEGRA=y
 CONFIG_CROS_EC_KEYB=y
 CONFIG_CROS_EC=y
 CONFIG_CROS_EC_SPI=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 8493312837aa362a9cd7fec22eae3c7b6c80aa9b..891db2d8f35bf0a166a76c95fb29268bf587c205 100644 (file)
@@ -49,7 +49,6 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_PHY_SAMSUNG=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Samsung"
index 78fcbaaca25d983942d44ff21d48f162b8a3b946..3c9acd7e41973f471515cd99e758c11cbc8911a0 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_ARM=y
 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=0x4000
 CONFIG_TARGET_OMAP3_LOGIC=y
 # CONFIG_SPL_OMAP3_ID_NAND is not set
index 81b57a8f7a0b1aa8032e9b62c1f9669717c91304..51547e71496fe99da6301cb4cb35fd9fd1442b16 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_ARM=y
 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=0x4000
 CONFIG_TARGET_OMAP3_LOGIC=y
 # CONFIG_SPL_OMAP3_ID_NAND is not set
index 656a2d5cb1f9e86ec1594f55603ca80d74997ce2..cec5e7ef2e5323c43e657ae2afbf6724f1edbc01 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_ARM=y
 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=0x4000
 CONFIG_TARGET_OMAP3_LOGIC=y
 # CONFIG_SPL_OMAP3_ID_NAND is not set
index 3231ff7eadf803d2191b373d3e085d57c0a811ec..cd30110ab97ca677ad5231e1c4b5a656dee218ab 100644 (file)
@@ -40,7 +40,6 @@ CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_GADGET=y
index 7b02c59f08d65662c0d2947c6b9af855384f3323..b7f8d47e0de7e432c3acf1309f388a1ed56a4fba 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -18,7 +16,6 @@ CONFIG_TPL=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index aa9c1f66c4f0b31459081dd116518b5b4f353bf4..95a007294d132548097719b67d0d48d11f832bad 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -26,7 +25,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 4bd8cd29f36f0c295fed46a715f721c0e9f4bf14..bab5bb7af189b41040f3e97e3ed8d89108d6e9b2 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -29,7 +28,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 1c47064c04a5be04c8a66e66de7c6e2f2f557be2..1e4fb6239a449cf0ce38957b144aa1c90c334094 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -26,7 +25,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 808577167e67863a953d6bcf9fb28de379b76377..6f64b395386ca5ed605e478da594f59eaa94a8ff 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
index b222bfa446acf2188aaeabe3e62a943a52a1f982..458e6f4e1b99c084438557aed2b3bb8f94ebb081 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
index b7e3d04641fb9f9ba4314beb9feb9fe2552a6d57..736a2e75490f762fb2a5dba978cd0a7f5073e894 100644 (file)
@@ -45,7 +45,6 @@ CONFIG_NAND_VF610_NFC=y
 CONFIG_NAND_VF610_NFC_DT=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHYLIB=y
index a3da90fa2e652eaccec3e5803eea3ce948e2ec97..5fe48384e2b06a95742bfc54bfc2f75a3a027d56 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_SYS_PROMPT="Peach-Pi # "
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -43,7 +42,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_S5P=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index df7ce5b821068ceca2cb3d1af543ae7a35af389e..5cbb0306478d2bec572b62967b1a2accf08a0f40 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_SYS_PROMPT="Peach-Pit # "
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -42,7 +41,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_S5P=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 2914ede36ce044516858cbc184a4335cbca9307d..d33f079dac288864ff75b8932972f93517e6da8d 100644 (file)
@@ -4,8 +4,8 @@ CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_TARGET_PHYCORE_RK3288=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -25,7 +25,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -57,7 +56,6 @@ CONFIG_MISC=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index 4fdcf67efe2163314126f1a06080bc7e97f30387..be16f484d56944a1be7c180c05975ada23a48213 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_CMD_MTD=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_CACHE=y
-CONFIG_CMD_NANDBCB=y
 CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
 CONFIG_MTDPARTS_DEFAULT="gpmi-nand:4m(uboot),1m(env),-(root)"
 CONFIG_CMD_UBI=y
index f1f6506868ff4336329ae2a01433282d37853b0f..bc3956d99f7462cf898f5fc0d84951ad29277795 100644 (file)
@@ -7,10 +7,10 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_TARGET_PICO_IMX6UL=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
index 02787f8250eadc92ec40bf383d703d88a698d34f..b2fc05408506ae0ffc71d1d6279ef6cd90f9e1f9 100644 (file)
@@ -10,17 +10,16 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
+CONFIG_SPL_TEXT_BASE=0x00908000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SPL_FIT_PRINT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTCOMMAND="run default_boot"
-CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
 CONFIG_DEFAULT_FDT_FILE="ask"
 CONFIG_BOUNCE_BUFFER=y
-CONFIG_SPL_TEXT_BASE=0x00908000
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_FIT_IMAGE_TINY=y
 CONFIG_SPL_FS_EXT4=y
@@ -69,5 +68,5 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_VIDEO=y
 CONFIG_VIDEO_IPUV3=y
+CONFIG_VIDEO=y
index c3c309c93cee28fd22de12c48981b1efdeb8ef5f..0c6f5f06fbe5a3f1e94bfea24a53cf70e83cedc1 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_SYS_TEXT_BASE=0x87800000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SECURE_BOOT=y
 CONFIG_TARGET_PICO_IMX7D=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
@@ -21,7 +20,6 @@ CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTD is not set
-CONFIG_CMD_BMP=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
@@ -36,6 +34,7 @@ CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PXE=y
+CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
index d087699f134c4032e18b4d6c57e38b66ecb83785..604e83dd3a2e9ae104b366c7cff28da1d14024cc 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SYS_PROMPT="pm9261> "
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -47,7 +46,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index 76476e38da5bab6eb4c33d1c0e8995eefc92a912..a1d22af2a3fcbbc90e4a4f33a846faea4510f722 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_SYS_PROMPT="u-boot-pm9263> "
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -47,7 +46,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_DM_SERIAL=y
index 67dd3f3f2d3ed60017419e29cfbc15fce1e3943e..7642ea38b10091d10186254683b5424485fb0dfc 100644 (file)
@@ -4,8 +4,8 @@ CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_TARGET_POPMETAL_RK3288=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -23,7 +23,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -53,7 +52,6 @@ CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index f3f5105aa674ca25f266852365f1921bcc03a15b..581f2812ad1069782279438e1e7eec409cee9c80 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -66,7 +65,6 @@ CONFIG_RENESAS_SDHI=y
 CONFIG_MTD=y
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
index 30b0f4ac6c68912a3c90b037eb67401093856d11..f2a70c4206b12a3935b2f020f60931beb7b00d69 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_ROCKCHIP_RK3399=y
 CONFIG_ROCKCHIP_BOOT_MODE_REG=0x0
 CONFIG_TARGET_PUMA_RK3399=y
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF180000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -30,7 +29,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -53,7 +51,6 @@ CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
 CONFIG_SPI_FLASH_WINBOND=y
index 40da71efbf7231c93a22c263804b549559e5814f..fd9c9d18eab56cfd9395467c65110281f02e197a 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -43,7 +42,6 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_RCAR_IIC=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHY_MICREL=y
index 546329dbffd217dd856578b8a33ef542b348a59a..43bdcf567c9b04240cb4710a9d203b46fe7bb107 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -46,7 +45,6 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_RCAR_IIC=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_PHY_MICREL=y
index 28b18333d784e4aac9eb4a5e198b709a30f3d94c..5799328fbc4069db62b9f72029ca36d83348e80a 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -18,7 +16,6 @@ CONFIG_TPL=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index 554945dd190ef30dec5794ce50e492a6c00ee35d..ffb82994ead522c20231ef10ecfc56376f6f565c 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -19,7 +17,6 @@ CONFIG_TPL=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index 80d6db5d83bfcb6931e4be94850ecc4bbad7614d..3723a7e0dd16c6857daf81b5bd08bbf7f5bfd161 100644 (file)
@@ -4,8 +4,8 @@ CONFIG_SYS_TEXT_BASE=0x00000000
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
 CONFIG_TARGET_ROCK2=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -22,7 +22,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -53,7 +52,6 @@ CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index 60a0d1473c186b32404340120c908746bfea585e..b12863567291e358fcd23682722fe697932ab9c3 100644 (file)
@@ -3,12 +3,11 @@ CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3328=y
 CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x40000
 CONFIG_TPL_LIBCOMMON_SUPPORT=y
 CONFIG_TPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x600000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xFF130000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SMBIOS_PRODUCT_NAME="rock64_rk3328"
@@ -29,7 +28,6 @@ CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
@@ -58,7 +56,6 @@ CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index cb3c68db6bdeea3b42dcc618f9b1c1102419d7db..0d6c55ce745f2f66da122105c92b3e1aedb30d42 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
 CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x4000
 CONFIG_TARGET_ROCK960_RK3399=y
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
index 4b02556a0683a5c69a71d9b0dc39fe79089bb848..7e6a2a6ec1591247ffaf4692dd5817129694e67a 100644 (file)
@@ -6,8 +6,8 @@ CONFIG_SYS_TEXT_BASE=0x60000000
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ROCKCHIP_RK3188=y
 CONFIG_TARGET_ROCK=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x60080000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0x20064000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -21,7 +21,6 @@ CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_RANDOM_UUID=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -41,7 +40,6 @@ CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_LED=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_PINCTRL=y
 CONFIG_DM_PMIC=y
index 22b8bc503b460782c5c9aa47598471b0fbfb10bc..423148b1a56e493e58e160e264a36276269c07f3 100644 (file)
@@ -2,9 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_ROCKCHIP_RK3399=y
-CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x50000
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -19,7 +17,6 @@ CONFIG_TPL=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
index b146330687afddb1f604d556f7cb8e60d684405e..ef163da616f5e6b5b9203babcdedc3ad2474810a 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_LICENSE=y
 CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADS is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -39,7 +38,6 @@ CONFIG_BCM6345_GPIO=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_FIXED=y
index 63966b5e9090c59e9549fb1d4222a4f0e7e329ef..b31bbec831ef3d4f9aa7596b16540d71b4931a26 100644 (file)
@@ -20,8 +20,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_DM=y
-CONFIG_CMD_I2C=y
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
index eed7b77cf350dd8737ae80673600ef7a0655f07c..c4a85b005d9b0a19afa9f3492a0f101bdd3e742b 100644 (file)
@@ -22,12 +22,11 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_DM=y
-CONFIG_CMD_I2C=y
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -59,7 +58,6 @@ CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 3d877f77d8fd0ac582b5ec6fcee46f71fad440c4..43cdd8fc7c9784fdccaafac0243f2665c0823726 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -65,7 +64,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=66000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_MACRONIX=y
index cadaa93355a476d33e38add11e1f59ebe2c812f2..f6e07df332216bfe00caf1b9bf3d363f72c204f7 100644 (file)
@@ -36,7 +36,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -65,7 +64,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=66000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 97f1efc626efb529d153a07db2080bdeeaad46d7..8dff5a368e359ef4e14652c8724d4645f63b17f6 100644 (file)
@@ -36,7 +36,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -65,7 +64,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=66000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 50a8a8e83ccbd5a04c6dda9020a07f6d944dc632..ffafc21ab3ce6b9852bf9429d81b33d7a46df435 100644 (file)
@@ -17,6 +17,7 @@ CONFIG_DEBUG_UART_CLOCK=82000000
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_DEBUG_UART=y
+CONFIG_SPL_TEXT_BASE=0x200000
 CONFIG_ENV_VARS_UBOOT_CONFIG=y
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="SAMA5D2"
@@ -26,7 +27,6 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_SPL_TEXT_BASE=0x200000
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DISPLAY_PRINT=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
@@ -37,7 +37,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -66,7 +65,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
index 82568e286d814d695c2d17787d7c8124a90d6e2d..3196a88f1131560f11089798d8a1264a5401e163 100644 (file)
@@ -31,15 +31,14 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DISPLAY_PRINT=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
 CONFIG_SPL_SPI_LOAD=y
-CONFIG_SPL_AT91_MCK_BYPASS=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000
+CONFIG_SPL_AT91_MCK_BYPASS=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -77,7 +76,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=2
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_ATMEL=y
index 41c4ef19733962ac9f70a6d14cfc5280030141c0..77c70975900bfe202c4f29ee11e17df8ae9a9d29 100644 (file)
@@ -34,7 +34,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -64,7 +63,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_MACRONIX=y
index a0db2e4be827f8205f72f0da2a7e02494a82d5e7..6892d9f4a839832f04b8fb76441a11f9c776d3c1 100644 (file)
@@ -36,7 +36,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -66,7 +65,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 0dff5d46a5c6b8455085ef4d86661796289fce13..bc7518ae60990e5de1b8c6aa7e4eb70dad912a4d 100644 (file)
@@ -36,7 +36,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -65,7 +64,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 1592e9375a6adaa91c05ba8ad862ea6b0d4a6f04..34098fe15ef220ea90af2d1299b9bb9b276e4dfa 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_I2C=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -66,7 +65,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 2f0415d97ff16fed25cd83ccc8e33b20ff1cc09c..979d95bc134e56309e7b8b3c91ee54a98e48f718 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -47,7 +46,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 3bcfbf071e3af267bdfaf03ff809f43376ced3c2..c7f47cc2fd6ade6865e0e69a401b0844e304eec9 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -46,7 +45,6 @@ CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_NAND_ATMEL=y
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 3fbdd54c0447867e079057aea292c45c16dc074d..5f68e7a752afd210af35361777cf72f30687b563 100644 (file)
@@ -28,7 +28,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -49,7 +48,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 934d020471c377c9cebaeb28362a0467250ceae8..fad19ab6a6fe0c6800e0a3ef9b7c6bb5d0618653 100644 (file)
@@ -38,7 +38,6 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -72,7 +71,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 3cf365bde59058801bd34bd0170b1883585b5931..bf5e861bf724060aea69d73e6bb66c4214468add 100644 (file)
@@ -34,7 +34,6 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -67,7 +66,6 @@ CONFIG_NAND_ATMEL=y
 CONFIG_PMECC_CAP=4
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index ed9d8064458112e67c30e5a135d7016bcd5ce7a0..68c10114fa9c5ec63bb74b6c0f3fd37115183250 100644 (file)
@@ -38,7 +38,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -70,7 +69,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 58b4bd1fbfc50dbf587990d5fbb6c17513825896..bba6c630d424ff11e4701f615496cc0051df35e0 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -65,7 +64,6 @@ CONFIG_NAND_ATMEL=y
 CONFIG_ATMEL_NAND_HW_PMECC=y
 CONFIG_PMECC_CAP=8
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index efdf0a4da171c96920206c18e75079045f461e9a..f8ba5d5d453be8bef29aa2b29e7b981be4ffd12a 100644 (file)
@@ -31,7 +31,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -60,7 +59,6 @@ CONFIG_NAND_ATMEL=y
 CONFIG_PMECC_CAP=8
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 82458be7b93d238fe1833cd3e1b06b011dfac566..7d672931e6cdb0993811978362550d803313bf31 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -66,7 +65,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 48f9db44eaf32d3099a8cd94633d2be1471be2cc..661c4e34d14f924a150bce2a3c7e19dcb785bcd0 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -63,7 +62,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index a5a151c6b2fd34419908ec6787b3974dec548c23..e42180a7f172785358e214c6c2edb3944f8e7a1f 100644 (file)
@@ -33,7 +33,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -60,7 +59,6 @@ CONFIG_NAND_ATMEL=y
 CONFIG_PMECC_CAP=8
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index e23d6cbd8e3bf813cf61dacb0f40a32e9da9ec61..ca91f7f8158ab710ff96701727faa380ada4b5b9 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -63,7 +62,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
index 1fea683d8922df409922f4a92708169fb9c616b3..b0abf99386b974c6b414966a643c4a0e1ebc6385 100644 (file)
@@ -115,7 +115,6 @@ CONFIG_SPL_PWRSEQ=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_SANDBOX=y
 CONFIG_SPI_FLASH_SANDBOX=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 20ebc68997ba1c8693442c3e34f46bb77c7adb42..ee0ec3f233d005f2bc6226f6fdea86bcd12c2b2e 100644 (file)
@@ -135,7 +135,6 @@ CONFIG_SPL_PWRSEQ=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_SANDBOX=y
 CONFIG_SPI_FLASH_SANDBOX=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 898815fe531cc637215ddf5151309c6fda4dcb1b..b50f750d066909923cef902c9af964d136d3a769 100644 (file)
@@ -101,7 +101,6 @@ CONFIG_SPL_PWRSEQ=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_SANDBOX=y
 CONFIG_SPI_FLASH_SANDBOX=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 409b8a38d5e0c0205272a67855ce539c94ee3075..55f7954c76b842312a8368570c40665441cf8afe 100644 (file)
@@ -120,7 +120,6 @@ CONFIG_PWRSEQ=y
 CONFIG_SPL_PWRSEQ=y
 CONFIG_MMC_SANDBOX=y
 CONFIG_SPI_FLASH_SANDBOX=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 302480efef2225fc1cdd72cb54f3f0c53eba7a52..79b348e2d60712701811eb9e1f2d416ef8710638 100644 (file)
@@ -25,8 +25,8 @@ CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_BMP=y
+CONFIG_CMD_REGULATOR=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="meson-g12a-sei510"
 CONFIG_ENV_IS_IN_MMC=y
@@ -49,10 +49,6 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_MESON_G12A=y
 CONFIG_POWER_DOMAIN=y
 CONFIG_MESON_EE_POWER_DOMAIN=y
-CONFIG_DM_VIDEO=y
-CONFIG_SYS_WHITE_ON_BLACK=y
-CONFIG_VIDEO_MESON=y
-CONFIG_VIDEO_DT_SIMPLEFB=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_RESET=y
@@ -72,5 +68,9 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
 CONFIG_USB_GADGET_PRODUCT_NUM=0xfada
 CONFIG_USB_GADGET_DWC2_OTG=y
 CONFIG_USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8=y
+CONFIG_DM_VIDEO=y
+CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_VIDEO_MESON=y
+CONFIG_VIDEO_DT_SIMPLEFB=y
 CONFIG_LZ4=y
 CONFIG_OF_LIBFDT_OVERLAY=y
index db63b14f19592d508ff555107250d2218fce78b7..b24f51c4d1047119a08a928cd7a90849d66ad7a9 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -68,7 +67,6 @@ CONFIG_RENESAS_SDHI=y
 CONFIG_MTD=y
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
index 3cbb83c7a47a3867f8473b50c2d727b5f0baa85a..1afb2810d2b5bd91ddfcc5f6c24b03c7cc533fa2 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_X86=y
 CONFIG_VENDOR_INTEL=y
 CONFIG_TARGET_SLIMBOOTLOADER=y
+# CONFIG_USE_CAR is not set
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_BOOTDELAY=10
@@ -18,4 +19,3 @@ CONFIG_REGMAP=y
 CONFIG_SYSCON=y
 # CONFIG_PCI_PNP is not set
 CONFIG_CONSOLE_SCROLL_LINES=5
-# CONFIG_USE_CAR is not set
index adec9b76610472555af0fe751206b1131c110ac8..c5beaa6a4ec77ac430cf59f56fe1e7b564bf2745 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_SYS_PROMPT="SMDK5250 # "
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -38,7 +37,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_S5P=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 3523f4b9fb25f0d6ef40f93a63f7c5b528d1b1ce..930dde57c1d02e36507bb5186f9cb0584fc066cc 100644 (file)
@@ -18,7 +18,6 @@ CONFIG_SYS_PROMPT="SMDK5420 # "
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -33,7 +32,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_S5P=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 209e41ff8697994c1d036db3c1901608fa738d3b..6724c9bd8b8a7d768f567665177043f9b4e96cee 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SYS_PROMPT="snow # "
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -48,7 +47,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_S5P=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 51f559cda8007a1cb6b23f226fdb922d8726f623..bf742dbe8079e28f80eaa737827f7d2c7d1a2c9e 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -43,7 +42,6 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD_DEVICE=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index c6481130297ac4d1c2bd52dd072f3b601ec9aa6a..2dfdff27da60364a520ff095cc8e275738cfba04 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -43,7 +42,6 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD_DEVICE=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 6eb052e9db3174839ae89c280447a1a4ac0faa40..bda1e312d1c740c03d8449ad543dced77b8afd1c 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
index 38b9f6c24b59f82489cb46e9314d7188a84b1751..877bb6aca33b327cdcd5dd4862404470f38974ee 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_GREPENV=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
@@ -41,7 +40,6 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
 # CONFIG_MMC is not set
 CONFIG_MTD_DEVICE=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
index 605ffd7c2b0810c9514bb740f15404cb670722ea..4d92fba55d261958ab63575aa549223774039cc5 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
index cae6f7bc9b7b33b7ec7da0c4fc855b5b215de283..6271f5e450d84bd8e06416dc7d61f1e8d5dfa9e3 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -43,7 +42,6 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD_DEVICE=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 9cb1daa889c9d6e7d8ed29d33f3f131b83b16240..bdf9363a9c317c6166965d6ebaf4975393f30870 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -44,7 +43,6 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD_DEVICE=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index c48bbb0e9c340901c5449f69b72cb879722634f9..0d4f5821f9d554806d79f9eda048b8119aa2f607 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
@@ -45,7 +44,6 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD_DEVICE=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=100000000
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 5ae53a4db9848a7631127f1fbe24c1483f01ee58..ee57d51476b61a4bf1d0ce6e268a2911d2b2d376 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -39,7 +38,6 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0x2003
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 80733ba6b150545481fe87d5bda538b03e0fe3c0..f7f882f019c0668f023952c8ae7ce10f11b8b0e9 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -68,7 +67,6 @@ CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=70
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD_DEVICE=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
index 58d135b907417dd696b38e6c3e5821f89c4476ac..2241fbb2c2768305da47e938aacc66e70062829c 100644 (file)
@@ -9,12 +9,16 @@ CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTDELAY=1
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="echo;echo Welcome on the ABB Socrates Board;echo"
-# CONFIG_CONSOLE_MUX is not set
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_BOARD_EARLY_INIT_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_REGINFO=y
+# CONFIG_BOOTM_NETBSD is not set
+# CONFIG_BOOTM_PLAN9 is not set
+# CONFIG_BOOTM_RTEMS is not set
+# CONFIG_BOOTM_VXWORKS is not set
 CONFIG_CMD_IMLS=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_PCI=y
@@ -26,12 +30,16 @@ CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_SNTP=y
-CONFIG_CMD_BMP=y
-CONFIG_CMD_DATE=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
 # CONFIG_CMD_IRQ is not set
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="socrates"
 CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_DM=y
+CONFIG_BLK=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_FSL=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
@@ -39,11 +47,16 @@ CONFIG_SYS_FLASH_CFI=y
 CONFIG_PHY_MARVELL=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_PCI_MPC85XX=y
+CONFIG_DM_RTC=y
 CONFIG_RTC_RX8025=y
+CONFIG_SPECIFY_CONSOLE_INDEX=y
+CONFIG_DM_SERIAL=y
+CONFIG_SERIAL_SEARCH_ALL=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 # CONFIG_USB_EHCI_HCD is not set
+CONFIG_USB_OHCI_PCI=y
 CONFIG_USB_STORAGE=y
-CONFIG_VIDEO=y
-CONFIG_CONSOLE_EXTRA_INFO=y
-CONFIG_OF_LIBFDT=y
index c9123fd7ee1722b90ac40e2e370750c77281c82c..6d37d7e0e86205acb2cd2d1fe0ac2869258e3d93 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DRAM_ZQ=3881949
 CONFIG_MMC0_CD_PIN=""
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_SPL_SPI_SUNXI=y
-CONFIG_SPI_FLASH_WINBOND=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_USE_PREBOOT=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x8000
@@ -18,6 +17,7 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x8000
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-sopine-baseboard"
+CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
index 5d8b629a5380708ae9b13f89d762babd6f3e6da1..b6c5fb3d8108d68453dd3b87058a895ec5c568c0 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_SYS_PROMPT="spring # "
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -48,7 +47,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_S5P=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 7b79c08ef4659b902d295e21fde6198018bb8e10..aeebeeca04c3e2fe4c66a8db40d0bea8c1d173df 100644 (file)
@@ -47,7 +47,6 @@ CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_GENERIC=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
 CONFIG_USB_GADGET_VENDOR_NUM=0x483
index 5cedb765d1378e4356c48333fd69a3bcd6fcd52b..7ab93d73f1df667119c6fb8ad67375eac84b5c9a 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GPT=y
 # CONFIG_RANDOM_UUID is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIMER=y
@@ -29,7 +28,6 @@ CONFIG_ARM_PL180_MMCI=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_PINCTRL_FULL is not set
 CONFIG_SPI=y
index 3c43d2a591b5b743a04c549a9a0fe590be3ed62d..8588d3133d15e8c408ee8c401ae7f4f5293dfa2b 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_GPT=y
 # CONFIG_RANDOM_UUID is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_SNTP=y
 CONFIG_CMD_DNS=y
@@ -42,7 +41,6 @@ CONFIG_ARM_PL180_MMCI=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_DM_ETH=y
index 887e2d5f7ca9e43c35fdd20f795039cb97c8a5f2..a1335f9e970cbce30bffa68989f6dc9110774863 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0xE00
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_STM32F7=y
 CONFIG_TARGET_STM32F746_DISCO=y
+CONFIG_SPL_TEXT_BASE=0x8000000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
@@ -13,7 +14,6 @@ CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk consoleblank=0 ignore_loglevel
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_SPL_TEXT_BASE=0x8000000
 CONFIG_SYS_PROMPT="U-Boot > "
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
@@ -21,7 +21,6 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_GPT=y
 # CONFIG_RANDOM_UUID is not set
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_SNTP=y
 CONFIG_CMD_DNS=y
@@ -42,7 +41,6 @@ CONFIG_ARM_PL180_MMCI=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_DM_ETH=y
index 2a54e715cb5fdc2f6983af8da69d8054f73776a6..c078b5cac3cce7d7acc1e296a4953b1a13bea384 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_REMOTEPROC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -83,7 +82,6 @@ CONFIG_MTD=y
 CONFIG_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 491174fc15c4ad84717e6ea83816955afdb96002..4f4102c40b1813ea60ee02d74cf2af253bb459f0 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_REMOTEPROC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -70,7 +69,6 @@ CONFIG_MTD=y
 CONFIG_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index a8a7eec3573206bc7ad7f3702a6114231e92a211..8712c7942bb8a620de93926720d8578b48782e3e 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_REMOTEPROC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -69,7 +68,6 @@ CONFIG_MTD=y
 CONFIG_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index b039ebb9eafa5f0dd8df3cdfb2b40c33f1711991..28f6eee7f8a5a044df939a7ae9b0d97c31b9ca01 100644 (file)
@@ -12,7 +12,6 @@ CONFIG_SYS_PROMPT="stmark2 $ "
 # CONFIG_CMD_IMPORTENV is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADS is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -26,7 +25,6 @@ CONFIG_ENV_SPI_CS=1
 # CONFIG_NET is not set
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MTD=y
index f32c005e8cb340d87138dbca10258979fd053421..a06098a8effffe81c8fe2d730742469531633567 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -66,7 +65,6 @@ CONFIG_RENESAS_SDHI=y
 CONFIG_MTD=y
 CONFIG_MTD_DEVICE=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHY_MICREL=y
index 0012374e69470e36c27d408f126dff3055398fde..eca2f2df6ba9be35711d550dec31de8453f8dbf5 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_PING=y
index 3676ecd41910112d6680a9d170b007a23c7c29ac..027ae66bea54be259fcbff6d6d76cf890bf72dd8 100644 (file)
@@ -45,7 +45,6 @@ CONFIG_CMD_DFU=y
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_PINMUX is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SOURCE is not set
@@ -69,7 +68,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
 CONFIG_PINCTRL=y
index ba29b7144d6e5fd1fd413d5e52ddaaf198577581..2cb57439c6a9f5cbd162bbe7c4dfafac0e153723 100644 (file)
@@ -80,4 +80,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_I2C_EDID=y
 CONFIG_VIDEO_IPUV3=y
 CONFIG_VIDEO=y
+CONFIG_OF_LIBFDT_ASSUME_MASK=0xff
 # CONFIG_EFI_LOADER is not set
index 7727e75b70d0b0dc8a338a2e12a4100c614a3786..9599df2d996eb3fe59db852f94e424d175c2bcd8 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_SYS_PROMPT="Tegra30 (TEC-NG) # "
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -26,7 +25,6 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra30-tec-ng"
 CONFIG_SPL_DM=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 34b740c6f2d1e4a3bb5533b6696593765f46e125..67d2c8bbc05e66e7dd8b3c6889e2b8b7f4d18fb7 100644 (file)
@@ -32,7 +32,6 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -61,7 +60,6 @@ CONFIG_BOOTCOUNT_RAM=y
 CONFIG_FPGA_ALTERA=y
 CONFIG_DM_GPIO=y
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=27777777
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y
index eff3b06b5ce274844a95c95dc5ab4452a43dbeaf..0fd1612f87ecd1b99dc49472e2ad29f925fba7ee 100644 (file)
@@ -4,9 +4,9 @@ CONFIG_SYS_TEXT_BASE=0x01000000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_TARGET_TINKER_RK3288=y
+CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_SIZE_LIMIT=0x4b000
-CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -25,7 +25,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -57,7 +56,6 @@ CONFIG_MISC=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index ddd43faedf873016aca5784aabf1c767e2befde9..7c1cffec349eff83cee264c4be8404e6f4c20b53 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
@@ -42,7 +41,6 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=108000000
 CONFIG_SPI_FLASH_STMICRO=y
index 17cc15d3c38d5ab736e002aa43a4610993f523fa..7941ca48d75e8c19dbea2d9f8969e98da9a191b8 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
@@ -42,7 +41,6 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=108000000
 CONFIG_SPI_FLASH_STMICRO=y
index 3d0699d9f053e3a2d00a7be8749ec5041bf60332..3092da4f2e580a974fca1d130460492313f7abf4 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
@@ -41,7 +40,6 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=108000000
 CONFIG_SPI_FLASH_STMICRO=y
index 12ebd989a23a0bd0809a1b710edb7ca11c07206c..668239d214b13c93abc672f22208e6795a2b361d 100644 (file)
@@ -14,7 +14,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
@@ -24,7 +23,6 @@ CONFIG_DEFAULT_DEVICE_TREE="tplink_wdr4300"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_CLK=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_GIGADEVICE=y
index 7ebdec4232c40d2aae24d0fd14fbe2d9bc1215bc..acb7e7e3652bb189a67fa195303eeb39ff696aba 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -29,7 +28,6 @@ CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=48000000
 CONFIG_SPL_DM=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_RTL8169=y
index 25c4fc14b53318e3e30ce1987fe32aa247560b4f..dac2e2db98fecabbc7276430b08f070909048e64 100644 (file)
@@ -22,7 +22,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -46,7 +45,6 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_XENON=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_MACRONIX=y
index a8619d4a36d9346245f3126094fd66b885e3c121..782aac5bac677c1fda782bb7c0c2ee3d09b3f47f 100644 (file)
@@ -40,7 +40,6 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_SATA=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
@@ -63,7 +62,6 @@ CONFIG_DM_PCA953X=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_MV=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHY_MARVELL=y
index ec0b731a3f297c58cff503d802080d6e46d5620a..7a2d76a8263887ba4dc8dbaa99b33aefa598bfaa 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -57,7 +56,6 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_XENON=y
 CONFIG_MTD=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 5779aeb05385db53f58bc48d701057266fa1d8a6..6ba3ce94fd375bbe80bbbff29aad33dfa638d4a5 100644 (file)
@@ -20,7 +20,6 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_ITEST is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -41,7 +40,6 @@ CONFIG_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_SPI_FLASH_DATAFLASH=y
 CONFIG_PINCTRL=y
index ca6ea9de37d63810074f355425438147bd092c5c..8e8b23ea1fe6d4293a6b384bfa2cf90cc8bf1338 100644 (file)
@@ -3,11 +3,13 @@ CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x86000000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_TARGET_DART_6UL=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=8
 CONFIG_SPL=y
+CONFIG_SPL_TEXT_BASE=0x00908000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
@@ -51,5 +53,3 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_LZO=y
-CONFIG_SPL_TEXT_BASE=0x00908000
-CONFIG_SYS_MALLOC_F_LEN=0x4000
index ae0f4cb9bf42661ea255047d9f1a26a5e2fb6a75..9ce72cfbe31e7d077ddc4b2cbd668c1d1a4da339 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
@@ -30,7 +29,6 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_SYS_I2C_TEGRA=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
index 89921e6836c0743ac1bcdbe323307f6b2c413907..6611080784df3db23fa0c300a1c62c426f1ca7b3 100644 (file)
@@ -5,8 +5,8 @@ CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00100000
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_TARGET_VYASA_RK3288=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL_STACK_R_ADDR=0x80000
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
@@ -21,7 +21,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -49,7 +48,6 @@ CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
index 9d161f3ecbe650ccb865d92f84ae019e826ebde6..a660d064d09b921b8bbf814b2789958dc04508fd 100644 (file)
@@ -1,9 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX7=y
 CONFIG_SYS_TEXT_BASE=0x87800000
-CONFIG_IMX_HAB=y
 CONFIG_TARGET_WARP7=y
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
+CONFIG_IMX_HAB=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
index 62e331d985f1acf36f7d406e375050034c2280f4..2666d497ec057dd981de1135c0009c0a2ad45dd5 100644 (file)
@@ -1,13 +1,13 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX7=y
 CONFIG_SYS_TEXT_BASE=0x87800000
-CONFIG_IMX_HAB=y
 CONFIG_TARGET_WARP7=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 # CONFIG_ARMV7_VIRT is not set
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
+CONFIG_IMX_HAB=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/warp7/imximage.cfg"
index 6d272add23d5d7bee0de030ed5fbdc1087b321a5..325390493466a2e6b5767a3e5f53e379e0771e04 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
@@ -56,7 +55,6 @@ CONFIG_I2C_MUX_PCA954x=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_PXA3XX=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_BAR=y
index 1717039dc0d17df3b186cdb557d7259895ba2c23..15d65dccd5063b12b25e2b0af6a4f57e5bff1ffd 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_TFTPPUT=y
@@ -61,7 +60,6 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
 CONFIG_ZYNQ_SDHCI_MIN_FREQ=100000
 CONFIG_DM_SPI_FLASH=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
@@ -86,7 +84,6 @@ CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index e5e2b54ae3b1bd4b7c867d37cfddda88f15b4fa6..6f090179fa14aebfe07011d67012ee1ee8f9deb8 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -73,7 +72,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SF_DUAL_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
@@ -101,9 +99,7 @@ CONFIG_ZYNQMP_GQSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 33f9f44c165114e7056bef9471b5bda4598fa438..c947bc4a6d22fa283351432a6c47c2edafd2412a 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -72,7 +71,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SF_DUAL_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
@@ -100,9 +98,7 @@ CONFIG_ZYNQMP_GQSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 9cc9191a4138c02e27d95eae5ac7650b790eb164..51b7f1301c644701872448c41c34d2d5f1f830b5 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -72,7 +71,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SF_DUAL_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
@@ -100,9 +98,7 @@ CONFIG_ZYNQMP_GQSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index ea6c6b9b01226ba80f2d45134c01819a062a98ec..156963d9e13f033cc3b78c5b291db1f2f5dcc5f6 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -72,7 +71,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SF_DUAL_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
@@ -100,9 +98,7 @@ CONFIG_ZYNQMP_GQSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index c77faf509a4b4d90ec27f3ddba2606837c9986de..c809a4d4063ae42f73aff76a7b6b72c5ecf5e90d 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -72,7 +71,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SF_DUAL_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
@@ -100,9 +98,7 @@ CONFIG_ZYNQMP_GQSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 3b57535c3a001209317e9774cc4c8d024e8a907a..0261bd9b6730169f2e150f5d9a4a9a1ecaf9f965 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -72,7 +71,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SF_DUAL_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
@@ -100,9 +98,7 @@ CONFIG_ZYNQMP_GQSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 2afd746970e03b564cd78e3fecfa5262fb1847f8..e537a513da5d941f66043a259e59237e6908bba9 100644 (file)
@@ -39,7 +39,6 @@ CONFIG_ZYNQMP_NO_DDR=y
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
-CONFIG_CMD_SF=y
 # CONFIG_CMD_ECHO is not set
 # CONFIG_CMD_ITEST is not set
 # CONFIG_CMD_SOURCE is not set
@@ -54,7 +53,6 @@ CONFIG_SPL_DM=y
 # CONFIG_DM_DEVICE_REMOVE is not set
 CONFIG_SPL_DM_SEQ_ALIAS=y
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index a7c4c79ebafb2828f48a946c64ccd166df6d59c5..f3df042e6734b05d6839ad6fcb44cfe7b07dabdb 100644 (file)
@@ -36,7 +36,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -73,7 +72,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SF_DUAL_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
@@ -101,9 +99,7 @@ CONFIG_ZYNQMP_GQSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 14eb06a405282a3f49fa5665254d8a16313d3079..333dcd8edbcc6b1ed1e1b2b0b8913d3936583395 100644 (file)
@@ -31,7 +31,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -70,7 +69,6 @@ CONFIG_MMC_IO_VOLTAGE=y
 CONFIG_MMC_UHS_SUPPORT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
@@ -94,9 +92,7 @@ CONFIG_ZYNQMP_GQSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index c86ab5c3630bcd68f4d09481b45e2a7a4aa7ee9c..9030a120130eff9bee9e72e34ebccf3816abd362 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_CLK=y
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_FPGA_LOAD_SECURE=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_NET is not set
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
@@ -35,7 +34,6 @@ CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQMPPL=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index f1d127d07c205e7266f3aa5cb00d0e59197d36c7..cbf068c087e683be8d684cea9a7f6f88dabe1370 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_CLK=y
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_FPGA_LOAD_SECURE=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_NET is not set
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
@@ -35,7 +34,6 @@ CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQMPPL=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index dab208298011b099e52a3cc07ed79a2947127ae7..2622d921da0ce6c7b21010a626c84106636d09ce 100644 (file)
@@ -32,7 +32,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -60,7 +59,6 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -86,7 +84,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index a2010571e52ccecf934b0cf58e73d47cd07f0f37..a6be6cb60bab6a61d6df9a94476924e56de93ee3 100644 (file)
@@ -57,7 +57,6 @@ CONFIG_MTD_DEVICE=y
 CONFIG_NAND=y
 CONFIG_NAND_ARASAN=y
 CONFIG_SYS_NAND_MAX_CHIPS=2
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_NATSEMI=y
@@ -76,7 +75,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 0d1e0f00c9e08c73fa025f9c5fd3321eea32c2cc..c66f68981f70d5836e09781c071176d4ecf82e03 100644 (file)
@@ -73,7 +73,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 75aa35b5ddcfab6d08bc41c149ce2b3a3f212d71..cb822a991cd80e473de390c180e2012e25759dc2 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_FPGA_LOAD_SECURE=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
@@ -45,7 +44,6 @@ CONFIG_SYS_I2C_CADENCE=y
 CONFIG_MISC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 335c8af4de6c4c283571dcae34941df3cae5a6f0..f548ef912b3dfddc598798d04b427461ddbcf8b4 100644 (file)
@@ -56,7 +56,6 @@ CONFIG_LED_GPIO=y
 CONFIG_MISC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -74,7 +73,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 70e451c4ffab32089b4abb9428e9077a25572bc7..392fdb6efd567c8b56fa933ff36a3a73305f065a 100644 (file)
@@ -34,7 +34,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -74,7 +73,6 @@ CONFIG_MMC_IO_VOLTAGE=y
 CONFIG_MMC_UHS_SUPPORT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -102,7 +100,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 899da928381ea130c0190ebb0bb289649985635d..c9f4aede194803b83a5e2b358e6790fda1d49b50 100644 (file)
@@ -34,7 +34,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -73,7 +72,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -101,7 +99,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 7da2f89b0b0b83f32a743309ed140c6af685b679..ac86932dad7ddc3bc5e45e22b6cf8cbe69da56da 100644 (file)
@@ -34,7 +34,6 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SDRAM=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -73,7 +72,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -101,7 +99,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index a0ba15ccea390d807bd6a246d06ddc5d913b1c9e..e410753f95c40e00ece374379a94fcbf5b250d68 100644 (file)
@@ -28,7 +28,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -57,7 +56,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -85,7 +83,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index cd45bd80f94fd0629e55b44495fbaafab4a79179..11600da050b0e412bd739f57d2f0ecca61c08338 100644 (file)
@@ -31,7 +31,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -61,7 +60,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -89,7 +87,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 461e2ecc113adf7cedad5492655e2a239eb5652e..f845c3cc160b612b175adaeaab5a153f147a5b1b 100644 (file)
@@ -31,7 +31,6 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -67,7 +66,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -95,7 +93,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 4800d7de0e92bc9d10cb537e8e8f0cdd835af5a2..acde8516c0208ed22ec641cdf6cb0e3ef7036971 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_CMD_FPGA_LOAD_SECURE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -59,7 +58,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
@@ -87,7 +85,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index cd28dbe1e3383e7dabafb05cda7711979ba65108..c0b3a84a933a8327d78ef4567d7bf335b68da8b2 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_CLK=y
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_FPGA_LOAD_SECURE=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_NET is not set
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
@@ -35,7 +34,6 @@ CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQMPPL=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 5030912c0fabd44696c6c3354b11e0ee971139c2..351faaf2bb5c902722a7ff167b9654e74764fea2 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_FPGA_LOAD_SECURE=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_NET is not set
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
@@ -38,7 +37,6 @@ CONFIG_FPGA_ZYNQMPPL=y
 CONFIG_MISC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 4854ebcf5617932775f0922738c25d28e3cc569e..ccc5303c2f83d0cf8e8e60471b9f5f5e1d71beb3 100644 (file)
@@ -27,7 +27,6 @@ CONFIG_CMD_FPGA_LOAD_SECURE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_TIME=y
@@ -59,7 +58,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SF_DUAL_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
@@ -87,9 +85,7 @@ CONFIG_ZYNQMP_GQSPI=y
 CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
-CONFIG_USB_XHCI_ZYNQMP=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
index 3980c5ecbc4ed5ecbe9a1d1c420cace40076935a..6fe4812543bdee9100f7ff997b3a3a6168f2b823 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -37,7 +36,6 @@ CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index f63855665ac8b8aa7597e4a9167d729eca21d55a..97325a27b892d1a99fa4ce53a57eb9143047498b 100644 (file)
@@ -49,7 +49,6 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
-CONFIG_CMD_SF=y
 # CONFIG_CMD_ECHO is not set
 # CONFIG_CMD_ITEST is not set
 # CONFIG_CMD_SOURCE is not set
@@ -62,7 +61,6 @@ CONFIG_DEFAULT_DEVICE_TREE="zynq-cse-qspi-single"
 # CONFIG_DM_DEVICE_REMOVE is not set
 CONFIG_SPL_DM_SEQ_ALIAS=y
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 9272a3f660eac23097c13ec4c20f5dba6f65808e..d2eaf5c90f634278fe7df4feeb0d06b8887ebc40 100644 (file)
@@ -31,7 +31,6 @@ CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -54,7 +53,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
index 3724b8e9cbb669a7ec65124df5cbe9568f203e13..f4b90f38e7c848c60d6150864491f943cd59a921 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -43,7 +42,6 @@ CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index e3acee1239e3a5db84bcaa1db1dad90c65b633b0..c27bdc0b45ee1243a75869157247d2f4a510af6a 100644 (file)
@@ -26,7 +26,6 @@ CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -43,7 +42,6 @@ CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 807e71f123b9ab225fcbdbb819ee93fd43b7773c..ffa4b5d7f009399d0d95248125b7d7e49c02909c 100644 (file)
@@ -28,7 +28,6 @@ CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -53,7 +52,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index a231dcadaf2363ab526852b145f6c10183550956..00105fb9f49a181820e518f5896128f63fc631c1 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -43,7 +42,6 @@ CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index f64bf18751cb5ffb82a8649f62954322df8d8f7c..e38a1a58a6840633b8dc4cc46d21d77ec83b2326 100644 (file)
@@ -32,7 +32,6 @@ CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -57,7 +56,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 36a9204be210fc7cd7c9ce1ea63455a684c8523e..a6a453fdf7077cb1bc19d322af79d1c033984dde 100644 (file)
@@ -34,7 +34,6 @@ CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -57,7 +56,6 @@ CONFIG_SYS_I2C_EEPROM_ADDR=0x0
 CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW=0x0
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index fff8ddc3fb3a110b72ab392d0261da0bf94ff8a0..a4f20e0298cd2918b4184ed8a381fd7b4e9abc0b 100644 (file)
@@ -28,7 +28,6 @@ CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
 CONFIG_CMD_CACHE=y
@@ -44,7 +43,6 @@ CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index 674a715736d258bf55574d3090291b360fde64a3..ce0c8dec9172b3bf985bc0d7bb54d8ea46a63d00 100644 (file)
@@ -38,7 +38,6 @@ CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
 # CONFIG_MMC is not set
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MACRONIX=y
index cfc637b4085efababc8d160d8f8d58f846f6f1ef..2b072b2dd59c6d7c0995775484ffe7bba560fd50 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -46,7 +45,6 @@ CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 3eaa4b4f0e83ee4de2a25d1d426abf8fc3c80f9d..45a40b06e6ed21f8e14d5c8ee5b01b707583cd60 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -46,7 +45,6 @@ CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHY_MARVELL=y
index bb193e45601552359fe73940458290cce050f05f..7f31606d535bc2a248968e57240823b14892d1ae 100644 (file)
@@ -29,7 +29,6 @@ CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TFTPPUT=y
@@ -46,7 +45,6 @@ CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ZYNQ=y
-CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHY_REALTEK=y
diff --git a/doc/README.dfu b/doc/README.dfu
new file mode 100644 (file)
index 0000000..558d347
--- /dev/null
@@ -0,0 +1,270 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+Device Firmware Upgrade (DFU)
+
+Overview:
+
+  The Device Firmware Upgrade (DFU) allows to download and upload firmware
+  to/from U-Boot connected over USB.
+
+  U-boot follows the Universal Serial Bus Device Class Specification for
+  Device Firmware Upgrade Version 1.1 the USB forum (DFU v1.1 in www.usb.org).
+
+  U-Boot implements this DFU capability (CONFIG_DFU) with the command dfu
+  (cmd/dfu.c / CONFIG_CMD_DFU) based on:
+  - the DFU stack (common/dfu.c and common/spl/spl_dfu.c), based on the
+    USB DFU download gadget (drivers/usb/gadget/f_dfu.c)
+  - The access to mediums is done in DFU backends (driver/dfu)
+
+  Today the supported DFU backends are:
+  - MMC (RAW or FAT / EXT2 / EXT3 / EXT4 file system)
+  - NAND
+  - RAM
+  - SF (serial flash)
+  - MTD (all MTD device: NAND, SPI-NOR, SPI-NAND,...)
+  - virtual
+
+  These DFU backends are also used by
+  - the dfutftp (see README.dfutftp)
+  - the thordown command (cmd/thordown.c and gadget/f_thor.c)
+
+  The "virtual" backend is a generic DFU backend to support a board specific
+  target (for example OTP), only based on the weak functions:
+  - dfu_write_medium_virt
+  - dfu_get_medium_size_virt
+  - dfu_read_medium_virt
+
+Configuration Options:
+  CONFIG_DFU
+  CONFIG_DFU_OVER_USB
+  CONFIG_DFU_MMC
+  CONFIG_DFU_MTD
+  CONFIG_DFU_NAND
+  CONFIG_DFU_RAM
+  CONFIG_DFU_SF
+  CONFIG_DFU_SF_PART
+  CONFIG_DFU_VIRTUAL
+  CONFIG_CMD_DFU
+
+Environment variables:
+  the dfu command use 3 environments variables:
+  "dfu_alt_info" : the DFU setting for the USB download gadget with a comma
+                   separated string of information on each alternate:
+                   dfu_alt_info="<alt1>;<alt2>;....;<altN>"
+
+                   when only several device are used, the format is:
+                   - <interface> <dev>'='alternate list (';' separated)
+                   - each interface is separated by '&'
+                dfu_alt_info=\
+                   "<interface1> <dev1>=<alt1>;....;<altN>&"\
+                   "<interface2> <dev2>=<altN+1>;....;<altM>&"\
+                   ...\
+                   "<interfaceI> <devI>=<altY+1>;....;<altZ>&"
+
+  "dfu_bufsiz" : size of the DFU buffer, when absent, use
+                 CONFIG_SYS_DFU_DATA_BUF_SIZE (8MiB by default)
+
+  "dfu_hash_algo" : name of the hash algorithm to use
+
+Commands:
+  dfu <USB_controller> [<interface> <dev>] list
+    list the alternate device defined in "dfu_alt_info"
+
+  dfu <USB_controller> [<interface> <dev>]
+    start the dfu stack on the USB instance with the selected medium
+    backend and use the "dfu_alt_info" variable to configure the
+    alternate setting and link each one with the medium
+    The dfu command continue until receive a ^C in console or
+    a DFU detach transaction from HOST.
+
+  The possible values of <interface> are :
+  (with <USB controller> = 0 in the dfu command example)
+
+  "mmc" (for eMMC and SD card)
+    cmd: dfu 0 mmc <dev>
+    each element in "dfu_alt_info" =
+      <name> raw <offset> <size>   raw access to mmc device
+      <name> part <dev> <part_id>  raw acces to partition
+      <name> fat <dev> <part_id>   file in FAT partition
+      <name> ext4 <dev> <part_id>  file in EXT4 partition
+
+      with <partid> is the GPT or DOS partition index
+
+  "nand" (raw slc nand device)
+    cmd: dfu 0 nand <dev>
+    each element in "dfu_alt_info" =
+      <name> raw <offset> <size>   raw access to mmc device
+      <name> part <dev> <part_id>  raw acces to partition
+      <name> partubi <dev> <part_id>  raw acces to ubi partition
+
+      with <partid> is the MTD partition index
+
+  "ram"
+    cmd: dfu 0 ram <dev>
+    (<dev> is not used for RAM target)
+    each element in "dfu_alt_info" =
+      <name> ram <offset> <size>  raw access to ram
+
+  "sf" (serial flash : NOR)
+    cmd: dfu 0 sf <dev>
+    each element in "dfu_alt_info" =
+      <name> ram <offset> <size>  raw access to sf device
+      <name> part <dev> <part_id>  raw acces to partition
+      <name> partubi <dev> <part_id>  raw acces to ubi partition
+
+      with <partid> is the MTD partition index
+
+  "mtd" (all MTD device: NAND, SPI-NOR, SPI-NAND,...)
+    cmd: dfu 0 mtd <dev>
+      with <dev> the mtd identifier as defined in mtd command
+      (nand0, nor0, spi-nand0,...)
+    each element in "dfu_alt_info" =
+      <name> raw <offset> <size>  raw access to mtd device
+      <name> part <dev> <part_id>  raw acces to partition
+      <name> partubi <dev> <part_id>  raw acces to ubi partition
+
+      with <partid> is the MTD partition index
+
+  "virt"
+    cmd: dfu 0 virt <dev>
+    each element in "dfu_alt_info" =
+      <name>
+
+  <interface> and <dev> are absent:
+    the dfu command to use multiple devices
+    cmd: dfu 0 list
+    cmd: dfu 0
+   "dfu_alt_info" variable provides the list of <interface> <dev> with
+   alternate list separated by '&' with the same format for each <alt>
+       mmc <dev>=<alt1>;....;<altN>
+       nand <dev>=<alt1>;....;<altN>
+       ram <dev>=<alt1>;....;<altN>
+       sf <dev>=<alt1>;....;<altN>
+       mtd <dev>=<alt1>;....;<altN>
+       virt <dev>=<alt1>;....;<altN>
+
+Callbacks:
+  The weak callback functions can be implemented to manage specific behavior
+  - dfu_initiated_callback  : called when the DFU transaction is started,
+                              used to initiase the device
+  - dfu_flush_callback      : called at the end of the DFU write after DFU
+                              manifestation, used to manage the device when
+                              DFU transaction is closed
+
+Host tools:
+  When U-Boot runs the dfu stack, the DFU host tools can be used
+  to send/receive firmwares on each configurated alternate.
+
+  For example dfu-util is a host side implementation of the DFU 1.1
+  specifications(http://dfu-util.sourceforge.net/) which works with U-Boot.
+
+Usage:
+  Example 1: firmware located in eMMC or SD card, with:
+  - alternate 1 (alt=1) for SPL partition (GPT partition 1)
+  - alternate 2 (alt=2) for U-Boot partition (GPT partition 2)
+
+  The U-Boot configuration is:
+
+  U-Boot> env set dfu_alt_info "spl part 0 1;u-boot part 0 2"
+
+  U-Boot> dfu 0 mmc 0 list
+  DFU alt settings list:
+  dev: eMMC alt: 0 name: spl layout: RAW_ADDR
+  dev: eMMC alt: 1 name: u-boot layout: RAW_ADDR
+
+  Boot> dfu 0 mmc 0
+
+  On the Host side:
+
+  list the available alternate setting:
+
+  $> dfu-util -l
+  dfu-util 0.9
+
+  Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
+  Copyright 2010-2016 Tormod Volden and Stefan Schmidt
+  This program is Free Software and has ABSOLUTELY NO WARRANTY
+  Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
+
+  Found DFU: [0483:5720] ver=0200, devnum=45, cfg=1, intf=0, path="3-1.3.1", \
+     alt=1, name="u-boot", serial="003A00203438510D36383238"
+  Found DFU: [0483:5720] ver=0200, devnum=45, cfg=1, intf=0, path="3-1.3.1", \
+     alt=0, name="spl", serial="003A00203438510D36383238"
+
+  To download to U-Boot, use -D option
+
+  $> dfu-util -a 0 -D u-boot-spl.bin
+  $> dfu-util -a 1 -D u-boot.bin
+
+  To upload from U-Boot, use -U option
+
+  $> dfu-util -a 0 -U u-boot-spl.bin
+  $> dfu-util -a 1 -U u-boot.bin
+
+  To request a DFU detach and reset the USB connection:
+  $> dfu-util -a 0 -e  -R
+
+
+  Example 2: firmware located in NOR (sf) and NAND, with:
+  - alternate 1 (alt=1) for SPL partition (NOR GPT partition 1)
+  - alternate 2 (alt=2) for U-Boot partition (NOR GPT partition 2)
+  - alternate 3 (alt=3) for U-Boot-env partition (NOR GPT partition 3)
+  - alternate 4 (alt=4) for UBI partition (NAND GPT partition 1)
+
+  U-Boot> env set dfu_alt_info \
+  "sf 0:0:10000000:0=spl part 0 1;u-boot part 0 2; \
+  u-boot-env part 0 3&nand 0=UBI partubi 0,1"
+
+  U-Boot> dfu 0 list
+
+  DFU alt settings list:
+  dev: SF alt: 0 name: spl layout: RAW_ADDR
+  dev: SF alt: 1 name: ssbl layout: RAW_ADDR
+  dev: SF alt: 2 name: u-boot-env layout: RAW_ADDR
+  dev: NAND alt: 3 name: UBI layout: RAW_ADDR
+
+  U-Boot> dfu 0
+
+  $> dfu-util -l
+  Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
+     intf=0, alt=3, name="UBI", serial="002700333338511934383330"
+  Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
+     intf=0, alt=2, name="u-boot-env", serial="002700333338511934383330"
+  Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
+     intf=0, alt=1, name="u-boot", serial="002700333338511934383330"
+  Found DFU: [0483:5720] ver=9999, devnum=96, cfg=1,\
+     intf=0, alt=0, name="spl", serial="002700333338511934383330"
+
+  Same example with MTD backend
+
+   U-Boot> env set dfu_alt_info \
+      "mtd nor0=spl part 1;u-boot part 2;u-boot-env part 3&"\
+      "mtd nand0=UBI partubi 1"
+
+  U-Boot> dfu 0 list
+  using id 'nor0,0'
+  using id 'nor0,1'
+  using id 'nor0,2'
+  using id 'nand0,0'
+  DFU alt settings list:
+  dev: MTD alt: 0 name: spl layout: RAW_ADDR
+  dev: MTD alt: 1 name: u-boot layout: RAW_ADDR
+  dev: MTD alt: 2 name: u-boot-env layout: RAW_ADDR
+  dev: MTD alt: 3 name: UBI layout: RAW_ADDR
+
+  Example 3: firmware located in SD Card (mmc) and virtual partition on
+             OTP and PMIC not volatile memory
+  - alternate 1 (alt=1) for scard
+  - alternate 2 (alt=2) for OTP (virtual)
+  - alternate 3 (alt=3) for PMIC NVM (virtual)
+
+   U-Boot> env set dfu_alt_info \
+      "mmc 0=sdcard raw 0 0x100000&"\
+      "virt 0=otp" \
+      "virt 1=pmic"
+
+   U-Boot> dfu 0 list
+   DFU alt settings list:
+   dev: eMMC alt: 0 name: sdcard layout: RAW_ADDR
+   dev: VIRT alt: 1 name: otp layout: RAW_ADDR
+   dev: VIRT alt: 2 name: pmic layout: RAW_ADDR
index 93ed641df30eade78d8cf8f84f58528bbeed6079..8464e7f4d8a654079905c2453af70ca6f7df19b5 100644 (file)
@@ -28,11 +28,11 @@ Major Config Switches during various boot Modes
 NOR boot
                !defined(CONFIG_SYS_RAMBOOT) && !defined(CONFIG_SPL)
 NOR boot Secure
-               !defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SECURE_BOOT)
+               !defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_NXP_ESBC)
 RAMBOOT(SD, SPI & NAND boot)
                 defined(CONFIG_SYS_RAMBOOT)
 RAMBOOT Secure (SD, SPI & NAND)
-                defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SECURE_BOOT)
+                defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_NXP_ESBC)
 NAND SPL BOOT
                 defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_NAND_SPL)
 
@@ -93,7 +93,7 @@ B) !defined(CONFIG_SYS_RAMBOOT) i.e. NOR boot
    1) TLB entry to overcome e500 v1/v2 debug restriction
        Location          : Label "_start_e500"
        TLB Entry  : CONFIG_SYS_PPC_E500_DEBUG_TLB
-#if defined(CONFIG_SECURE_BOOT)
+#if defined(CONFIG_NXP_ESBC)
        EPN -->RPN : CONFIG_SYS_MONITOR_BASE --> CONFIG_SYS_PBI_FLASH_WINDOW
        Properties : 1M, AS1, I, G, IPROT
 #else
@@ -104,7 +104,7 @@ B) !defined(CONFIG_SYS_RAMBOOT) i.e. NOR boot
    2) TLB entry for working in AS1
        Location          : Label "create_init_ram_area"
        TLB Entry  : 15
-#if defined(CONFIG_SECURE_BOOT)
+#if defined(CONFIG_NXP_ESBC)
        EPN -->RPN : CONFIG_SYS_MONITOR_BASE --> CONFIG_SYS_PBI_FLASH_WINDOW
        Properties : 1M, AS1, I, G, IPROT
 #else
index 4ba642b7c77ffe5989561ebdd6896d0eb4174e0b..6c9a02120fdee37b514ed5889af93c8a296ad2e9 100644 (file)
@@ -36,6 +36,28 @@ Optional properties:
 - regulator-always-on: regulator should never be disabled
 - regulator-boot-on: enabled by bootloader/firmware
 - regulator-ramp-delay: ramp delay for regulator (in uV/us)
+- regulator-init-microvolt: a init allowed Voltage value
+- regulator-state-(standby|mem|disk)
+  type: object
+  description:
+    sub-nodes for regulator state in Standby, Suspend-to-RAM, and
+    Suspend-to-DISK modes. Equivalent with standby, mem, and disk Linux
+    sleep states.
+
+    properties:
+      regulator-on-in-suspend:
+        description: regulator should be on in suspend state.
+        type: boolean
+
+      regulator-off-in-suspend:
+        description: regulator should be off in suspend state.
+        type: boolean
+
+      regulator-suspend-microvolt:
+        description: the default voltage which regulator would be set in
+          suspend. This property is now deprecated, instead setting voltage
+          for suspend mode via the API which regulator driver provides is
+          recommended.
 
 Note
 The "regulator-name" constraint is used for setting the device's uclass
@@ -59,7 +81,12 @@ ldo0 {
        regulator-max-microvolt = <1800000>;
        regulator-min-microamp = <100000>;
        regulator-max-microamp = <100000>;
+       regulator-init-microvolt = <1800000>;
        regulator-always-on;
        regulator-boot-on;
        regulator-ramp-delay = <12000>;
+       regulator-state-mem {
+               regulator-on-in-suspend;
+               regulator-suspend-microvolt = <1800000>;
+       };
 };
index c25415d4107add09bc28d8c0f1a1546ac18b9af0..478349f22f29f04813264805e156b37878deff54 100644 (file)
@@ -13,6 +13,7 @@
 #include <errno.h>
 #include <clk-uclass.h>
 #include <linux/soc/ti/ti_sci_protocol.h>
+#include <k3-avs.h>
 
 /**
  * struct ti_sci_clk_data - clock controller information structure
@@ -101,6 +102,10 @@ static ulong ti_sci_clk_set_rate(struct clk *clk, ulong rate)
 
        debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate);
 
+#ifdef CONFIG_K3_AVS0
+       k3_avs_notify_freq(clk->id, clk->data, rate);
+#endif
+
        /* Ask for exact frequency by using same value for min/target/max */
        ret = cops->set_freq(sci, clk->id, clk->data, rate, rate, rate);
        if (ret)
index a89e2ecc4ad6651cc73764448eb261d2a2d6a5e6..4331048a87612113bf3f2a684eccc21e32e05782 100644 (file)
@@ -282,6 +282,8 @@ static void rkclk_init(struct rk3328_cru *cru)
        u32 hclk_div;
        u32 pclk_div;
 
+       rk3328_configure_cpu(cru, APLL_600_MHZ);
+
        /* configure gpll cpll */
        rkclk_set_pll(cru, CLK_GENERAL, &gpll_init_cfg);
        rkclk_set_pll(cru, CLK_CODEC, &cpll_init_cfg);
index 4692736c9d24fe1d44cd280ad4292ab6e23b6198..9fe5bc0f589b9c6994385ea28ef5c66a19512637 100644 (file)
@@ -46,5 +46,26 @@ config DFU_SF
          This option enables using DFU to read and write to SPI flash based
          storage.
 
+config DFU_SF_PART
+       bool "MTD partition support for SPI flash back end"
+       depends on DFU_SF && CMD_MTDPARTS
+       default y
+       help
+         This option enables the support of "part" and "partubi" target in
+         SPI flash DFU back end.
+
+config DFU_MTD
+       bool "MTD back end for DFU"
+       depends on MTD
+       help
+         This option enables using DFU to read and write to on any MTD device.
+
+config DFU_VIRT
+       bool "VIRTUAL flash back end for DFU"
+       help
+         This option enables using DFU to read and write to VIRTUAL device
+         used at board level to manage specific behavior
+         (OTP update for example).
+
 endif
 endmenu
index 4164f342acc702fde160550893eb1d4ef91d9962..0d7925c083ef567124ae3156047e9f709d2f41e4 100644 (file)
@@ -5,7 +5,9 @@
 
 obj-$(CONFIG_$(SPL_)DFU) += dfu.o
 obj-$(CONFIG_$(SPL_)DFU_MMC) += dfu_mmc.o
+obj-$(CONFIG_$(SPL_)DFU_MTD) += dfu_mtd.o
 obj-$(CONFIG_$(SPL_)DFU_NAND) += dfu_nand.o
 obj-$(CONFIG_$(SPL_)DFU_RAM) += dfu_ram.o
 obj-$(CONFIG_$(SPL_)DFU_SF) += dfu_sf.o
 obj-$(CONFIG_$(SPL_)DFU_TFTP) += dfu_tftp.o
+obj-$(CONFIG_$(SPL_)DFU_VIRT) += dfu_virt.o
index d2b67b18cf020e4288d71806d94d4b3ecaaa2c0d..38aecd3a0586f42bb9c132398efecc8897d63255 100644 (file)
@@ -22,6 +22,22 @@ static int dfu_alt_num;
 static int alt_num_cnt;
 static struct hash_algo *dfu_hash_algo;
 
+/*
+ * The purpose of the dfu_flush_callback() function is to
+ * provide callback for dfu user
+ */
+__weak void dfu_flush_callback(struct dfu_entity *dfu)
+{
+}
+
+/*
+ * The purpose of the dfu_initiated_callback() function is to
+ * provide callback for dfu user
+ */
+__weak void dfu_initiated_callback(struct dfu_entity *dfu)
+{
+}
+
 /*
  * The purpose of the dfu_usb_get_reset() function is to
  * provide information if after USB_DETACH request
@@ -53,6 +69,54 @@ static int dfu_find_alt_num(const char *s)
        return ++i;
 }
 
+/*
+ * treat dfu_alt_info with several interface information
+ * to allow DFU on several device with one command,
+ * the string format is
+ * interface devstring'='alternate list (';' separated)
+ * and each interface separated by '&'
+ */
+int dfu_config_interfaces(char *env)
+{
+       struct dfu_entity *dfu;
+       char *s, *i, *d, *a, *part;
+       int ret = -EINVAL;
+       int n = 1;
+
+       s = env;
+       for (; *s; s++) {
+               if (*s == ';')
+                       n++;
+               if (*s == '&')
+                       n++;
+       }
+       ret = dfu_alt_init(n, &dfu);
+       if (ret)
+               return ret;
+
+       s = env;
+       while (s) {
+               ret = -EINVAL;
+               i = strsep(&s, " ");
+               if (!i)
+                       break;
+               d = strsep(&s, "=");
+               if (!d)
+                       break;
+               a = strsep(&s, "&");
+               if (!a)
+                       a = s;
+               do {
+                       part = strsep(&a, ";");
+                       ret = dfu_alt_add(dfu, i, d, part);
+                       if (ret)
+                               return ret;
+               } while (a);
+       }
+
+       return ret;
+}
+
 int dfu_init_env_entities(char *interface, char *devstr)
 {
        const char *str_env;
@@ -69,7 +133,11 @@ int dfu_init_env_entities(char *interface, char *devstr)
        }
 
        env_bkp = strdup(str_env);
-       ret = dfu_config_entities(env_bkp, interface, devstr);
+       if (!interface && !devstr)
+               ret = dfu_config_interfaces(env_bkp);
+       else
+               ret = dfu_config_entities(env_bkp, interface, devstr);
+
        if (ret) {
                pr_err("DFU entities configuration failed!\n");
                pr_err("(partition table does not match dfu_alt_info?)\n");
@@ -83,6 +151,7 @@ done:
 
 static unsigned char *dfu_buf;
 static unsigned long dfu_buf_size;
+static enum dfu_device_type dfu_buf_device_type;
 
 unsigned char *dfu_free_buf(void)
 {
@@ -100,6 +169,10 @@ unsigned char *dfu_get_buf(struct dfu_entity *dfu)
 {
        char *s;
 
+       /* manage several entity with several contraint */
+       if (dfu_buf && dfu->dev_type != dfu_buf_device_type)
+               dfu_free_buf();
+
        if (dfu_buf != NULL)
                return dfu_buf;
 
@@ -118,6 +191,7 @@ unsigned char *dfu_get_buf(struct dfu_entity *dfu)
                printf("%s: Could not memalign 0x%lx bytes\n",
                       __func__, dfu_buf_size);
 
+       dfu_buf_device_type = dfu->dev_type;
        return dfu_buf;
 }
 
@@ -205,6 +279,7 @@ int dfu_transaction_initiate(struct dfu_entity *dfu, bool read)
        }
 
        dfu->inited = 1;
+       dfu_initiated_callback(dfu);
 
        return 0;
 }
@@ -224,6 +299,8 @@ int dfu_flush(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
                printf("\nDFU complete %s: 0x%08x\n", dfu_hash_algo->name,
                       dfu->crc);
 
+       dfu_flush_callback(dfu);
+
        dfu_transaction_cleanup(dfu);
 
        return ret;
@@ -338,6 +415,8 @@ static int dfu_read_buffer_fill(struct dfu_entity *dfu, void *buf, int size)
                                debug("%s: Read error!\n", __func__);
                                return ret;
                        }
+                       if (dfu->b_left == 0)
+                               break;
                        dfu->offset += dfu->b_left;
                        dfu->r_left -= dfu->b_left;
 
@@ -402,6 +481,9 @@ static int dfu_fill_entity(struct dfu_entity *dfu, char *s, int alt,
        if (strcmp(interface, "mmc") == 0) {
                if (dfu_fill_entity_mmc(dfu, devstr, s))
                        return -1;
+       } else if (strcmp(interface, "mtd") == 0) {
+               if (dfu_fill_entity_mtd(dfu, devstr, s))
+                       return -1;
        } else if (strcmp(interface, "nand") == 0) {
                if (dfu_fill_entity_nand(dfu, devstr, s))
                        return -1;
@@ -411,6 +493,9 @@ static int dfu_fill_entity(struct dfu_entity *dfu, char *s, int alt,
        } else if (strcmp(interface, "sf") == 0) {
                if (dfu_fill_entity_sf(dfu, devstr, s))
                        return -1;
+       } else if (strcmp(interface, "virt") == 0) {
+               if (dfu_fill_entity_virt(dfu, devstr, s))
+                       return -1;
        } else {
                printf("%s: Device %s not (yet) supported!\n",
                       __func__,  interface);
@@ -439,13 +524,12 @@ void dfu_free_entities(void)
        alt_num_cnt = 0;
 }
 
-int dfu_config_entities(char *env, char *interface, char *devstr)
+int dfu_alt_init(int num, struct dfu_entity **dfu)
 {
-       struct dfu_entity *dfu;
-       int i, ret;
        char *s;
+       int ret;
 
-       dfu_alt_num = dfu_find_alt_num(env);
+       dfu_alt_num = num;
        debug("%s: dfu_alt_num=%d\n", __func__, dfu_alt_num);
 
        dfu_hash_algo = NULL;
@@ -456,21 +540,49 @@ int dfu_config_entities(char *env, char *interface, char *devstr)
                        pr_err("Hash algorithm %s not supported\n", s);
        }
 
-       dfu = calloc(sizeof(*dfu), dfu_alt_num);
-       if (!dfu)
+       *dfu = calloc(sizeof(struct dfu_entity), dfu_alt_num);
+       if (!*dfu)
+               return -1;
+
+       return 0;
+}
+
+int dfu_alt_add(struct dfu_entity *dfu, char *interface, char *devstr, char *s)
+{
+       struct dfu_entity *p_dfu;
+       int ret;
+
+       if (alt_num_cnt >= dfu_alt_num)
+               return -1;
+
+       p_dfu = &dfu[alt_num_cnt];
+       ret = dfu_fill_entity(p_dfu, s, alt_num_cnt, interface, devstr);
+       if (ret)
                return -1;
-       for (i = 0; i < dfu_alt_num; i++) {
 
+       list_add_tail(&p_dfu->list, &dfu_list);
+       alt_num_cnt++;
+
+       return 0;
+}
+
+int dfu_config_entities(char *env, char *interface, char *devstr)
+{
+       struct dfu_entity *dfu;
+       int i, ret;
+       char *s;
+
+       ret = dfu_alt_init(dfu_find_alt_num(env), &dfu);
+       if (ret)
+               return -1;
+
+       for (i = 0; i < dfu_alt_num; i++) {
                s = strsep(&env, ";");
-               ret = dfu_fill_entity(&dfu[i], s, alt_num_cnt, interface,
-                                     devstr);
+               ret = dfu_alt_add(dfu, interface, devstr, s);
                if (ret) {
                        /* We will free "dfu" in dfu_free_entities() */
                        return -1;
                }
-
-               list_add_tail(&dfu[i].list, &dfu_list);
-               alt_num_cnt++;
        }
 
        return 0;
@@ -478,14 +590,15 @@ int dfu_config_entities(char *env, char *interface, char *devstr)
 
 const char *dfu_get_dev_type(enum dfu_device_type t)
 {
-       const char *dev_t[] = {NULL, "eMMC", "OneNAND", "NAND", "RAM", "SF" };
+       const char *const dev_t[] = {NULL, "eMMC", "OneNAND", "NAND", "RAM",
+                                    "SF", "MTD", "VIRT"};
        return dev_t[t];
 }
 
 const char *dfu_get_layout(enum dfu_layout l)
 {
-       const char *dfu_layout[] = {NULL, "RAW_ADDR", "FAT", "EXT2",
-                                          "EXT3", "EXT4", "RAM_ADDR" };
+       const char *const dfu_layout[] = {NULL, "RAW_ADDR", "FAT", "EXT2",
+                                         "EXT3", "EXT4", "RAM_ADDR" };
        return dfu_layout[l];
 }
 
index 403fd5351d7738f1175dd5da2bc82829fb4d86dc..5b551f6ae115c91f4757f150fe491e6d77e57fe1 100644 (file)
@@ -352,6 +352,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
                struct blk_desc *blk_dev = mmc_get_blk_desc(mmc);
                int mmcdev = second_arg;
                int mmcpart = third_arg;
+               int offset = 0;
 
                if (part_get_info(blk_dev, mmcpart, &partinfo) != 0) {
                        pr_err("Couldn't find part #%d on mmc device #%d\n",
@@ -359,9 +360,17 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
                        return -ENODEV;
                }
 
+               /*
+                * Check for an extra entry at dfu_alt_info env variable
+                * specifying the mmc HW defined partition number
+                */
+               if (s)
+                       if (!strcmp(strsep(&s, " "), "offset"))
+                               offset = simple_strtoul(s, NULL, 0);
+
                dfu->layout                     = DFU_RAW_ADDR;
-               dfu->data.mmc.lba_start         = partinfo.start;
-               dfu->data.mmc.lba_size          = partinfo.size;
+               dfu->data.mmc.lba_start         = partinfo.start + offset;
+               dfu->data.mmc.lba_size          = partinfo.size-offset;
                dfu->data.mmc.lba_blk_size      = partinfo.blksz;
        } else if (!strcmp(entity_type, "fat")) {
                dfu->layout = DFU_FS_FAT;
diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c
new file mode 100644 (file)
index 0000000..9528a7b
--- /dev/null
@@ -0,0 +1,311 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * dfu_mtd.c -- DFU for MTD device.
+ *
+ * Copyright (C) 2019,STMicroelectronics - All Rights Reserved
+ *
+ * Based on dfu_nand.c
+ */
+
+#include <common.h>
+#include <dfu.h>
+#include <mtd.h>
+#include <jffs2/load_kernel.h>
+
+static bool mtd_is_aligned_with_block_size(struct mtd_info *mtd, u64 size)
+{
+       return !do_div(size, mtd->erasesize);
+}
+
+static int mtd_block_op(enum dfu_op op, struct dfu_entity *dfu,
+                       u64 offset, void *buf, long *len)
+{
+       u64 off, lim, remaining;
+       struct mtd_info *mtd = dfu->data.mtd.info;
+       struct mtd_oob_ops io_op = {};
+       int ret = 0;
+       bool has_pages = mtd->type == MTD_NANDFLASH ||
+                        mtd->type == MTD_MLCNANDFLASH;
+
+       /* if buf == NULL return total size of the area */
+       if (!buf) {
+               *len = dfu->data.mtd.size;
+               return 0;
+       }
+
+       off = dfu->data.mtd.start + offset + dfu->bad_skip;
+       lim = dfu->data.mtd.start + dfu->data.mtd.size;
+
+       if (off >= lim) {
+               printf("Limit reached 0x%llx\n", lim);
+               *len = 0;
+               return op == DFU_OP_READ ? 0 : -EIO;
+       }
+       /* limit request with the available size */
+       if (off + *len >= lim)
+               *len = lim - off;
+
+       if (!mtd_is_aligned_with_block_size(mtd, off)) {
+               printf("Offset not aligned with a block (0x%x)\n",
+                      mtd->erasesize);
+               return 0;
+       }
+
+       /* first erase */
+       if (op == DFU_OP_WRITE) {
+               struct erase_info erase_op = {};
+
+               remaining = round_up(*len, mtd->erasesize);
+               erase_op.mtd = mtd;
+               erase_op.addr = off;
+               erase_op.len = mtd->erasesize;
+               erase_op.scrub = 0;
+
+               while (remaining) {
+                       if (erase_op.addr + remaining > lim) {
+                               printf("Limit reached 0x%llx while erasing at offset 0x%llx\n",
+                                      lim, off);
+                               return -EIO;
+                       }
+
+                       ret = mtd_erase(mtd, &erase_op);
+
+                       if (ret) {
+                               /* Abort if its not a bad block error */
+                               if (ret != -EIO) {
+                                       printf("Failure while erasing at offset 0x%llx\n",
+                                              erase_op.fail_addr);
+                                       return 0;
+                               }
+                               printf("Skipping bad block at 0x%08llx\n",
+                                      erase_op.addr);
+                       } else {
+                               remaining -= mtd->erasesize;
+                       }
+
+                       /* Continue erase behind bad block */
+                       erase_op.addr += mtd->erasesize;
+               }
+       }
+
+       io_op.mode = MTD_OPS_AUTO_OOB;
+       io_op.len = *len;
+       if (has_pages && io_op.len > mtd->writesize)
+               io_op.len = mtd->writesize;
+       io_op.ooblen = 0;
+       io_op.datbuf = buf;
+       io_op.oobbuf = NULL;
+
+       /* Loop over to do the actual read/write */
+       remaining = *len;
+       while (remaining) {
+               if (off + remaining > lim) {
+                       printf("Limit reached 0x%llx while %s at offset 0x%llx\n",
+                              lim, op == DFU_OP_READ ? "reading" : "writing",
+                              off);
+                       if (op == DFU_OP_READ) {
+                               *len -= remaining;
+                               return 0;
+                       } else {
+                               return -EIO;
+                       }
+               }
+
+               /* Skip the block if it is bad */
+               if (mtd_is_aligned_with_block_size(mtd, off) &&
+                   mtd_block_isbad(mtd, off)) {
+                       off += mtd->erasesize;
+                       dfu->bad_skip += mtd->erasesize;
+                       continue;
+               }
+
+               if (op == DFU_OP_READ)
+                       ret = mtd_read_oob(mtd, off, &io_op);
+               else
+                       ret = mtd_write_oob(mtd, off, &io_op);
+
+               if (ret) {
+                       printf("Failure while %s at offset 0x%llx\n",
+                              op == DFU_OP_READ ? "reading" : "writing", off);
+                       return -EIO;
+               }
+
+               off += io_op.retlen;
+               remaining -= io_op.retlen;
+               io_op.datbuf += io_op.retlen;
+               io_op.len = remaining;
+               if (has_pages && io_op.len > mtd->writesize)
+                       io_op.len = mtd->writesize;
+       }
+
+       return ret;
+}
+
+static int dfu_get_medium_size_mtd(struct dfu_entity *dfu, u64 *size)
+{
+       *size = dfu->data.mtd.info->size;
+
+       return 0;
+}
+
+static int dfu_read_medium_mtd(struct dfu_entity *dfu, u64 offset, void *buf,
+                              long *len)
+{
+       int ret = -1;
+
+       switch (dfu->layout) {
+       case DFU_RAW_ADDR:
+               ret = mtd_block_op(DFU_OP_READ, dfu, offset, buf, len);
+               break;
+       default:
+               printf("%s: Layout (%s) not (yet) supported!\n", __func__,
+                      dfu_get_layout(dfu->layout));
+       }
+
+       return ret;
+}
+
+static int dfu_write_medium_mtd(struct dfu_entity *dfu,
+                               u64 offset, void *buf, long *len)
+{
+       int ret = -1;
+
+       switch (dfu->layout) {
+       case DFU_RAW_ADDR:
+               ret = mtd_block_op(DFU_OP_WRITE, dfu, offset, buf, len);
+               break;
+       default:
+               printf("%s: Layout (%s) not (yet) supported!\n", __func__,
+                      dfu_get_layout(dfu->layout));
+       }
+
+       return ret;
+}
+
+static int dfu_flush_medium_mtd(struct dfu_entity *dfu)
+{
+       struct mtd_info *mtd = dfu->data.mtd.info;
+       u64 remaining;
+       int ret;
+
+       /* in case of ubi partition, erase rest of the partition */
+       if (dfu->data.nand.ubi) {
+               struct erase_info erase_op = {};
+
+               erase_op.mtd = dfu->data.mtd.info;
+               erase_op.addr = round_up(dfu->data.mtd.start + dfu->offset +
+                                        dfu->bad_skip, mtd->erasesize);
+               erase_op.len = mtd->erasesize;
+               erase_op.scrub = 0;
+
+               remaining = dfu->data.mtd.start + dfu->data.mtd.size -
+                           erase_op.addr;
+
+               while (remaining) {
+                       ret = mtd_erase(mtd, &erase_op);
+
+                       if (ret) {
+                               /* Abort if its not a bad block error */
+                               if (ret != -EIO)
+                                       break;
+                               printf("Skipping bad block at 0x%08llx\n",
+                                      erase_op.addr);
+                       }
+
+                       /* Skip bad block and continue behind it */
+                       erase_op.addr += mtd->erasesize;
+                       remaining -= mtd->erasesize;
+               }
+       }
+       return 0;
+}
+
+static unsigned int dfu_polltimeout_mtd(struct dfu_entity *dfu)
+{
+       /*
+        * Currently, Poll Timeout != 0 is only needed on nand
+        * ubi partition, as sectors which are not used need
+        * to be erased
+        */
+       if (dfu->data.nand.ubi)
+               return DFU_MANIFEST_POLL_TIMEOUT;
+
+       return DFU_DEFAULT_POLL_TIMEOUT;
+}
+
+int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr, char *s)
+{
+       char *st;
+       struct mtd_info *mtd;
+       bool has_pages;
+       int ret, part;
+
+       mtd = get_mtd_device_nm(devstr);
+       if (IS_ERR_OR_NULL(mtd))
+               return -ENODEV;
+       put_mtd_device(mtd);
+
+       dfu->dev_type = DFU_DEV_MTD;
+       dfu->data.mtd.info = mtd;
+
+       has_pages = mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;
+       dfu->max_buf_size = has_pages ? mtd->erasesize : 0;
+
+       st = strsep(&s, " ");
+       if (!strcmp(st, "raw")) {
+               dfu->layout = DFU_RAW_ADDR;
+               dfu->data.mtd.start = simple_strtoul(s, &s, 16);
+               s++;
+               dfu->data.mtd.size = simple_strtoul(s, &s, 16);
+       } else if ((!strcmp(st, "part")) || (!strcmp(st, "partubi"))) {
+               char mtd_id[32];
+               struct mtd_device *mtd_dev;
+               u8 part_num;
+               struct part_info *pi;
+
+               dfu->layout = DFU_RAW_ADDR;
+
+               part = simple_strtoul(s, &s, 10);
+
+               sprintf(mtd_id, "%s,%d", devstr, part - 1);
+               printf("using id '%s'\n", mtd_id);
+
+               mtdparts_init();
+
+               ret = find_dev_and_part(mtd_id, &mtd_dev, &part_num, &pi);
+               if (ret != 0) {
+                       printf("Could not locate '%s'\n", mtd_id);
+                       return -1;
+               }
+
+               dfu->data.mtd.start = pi->offset;
+               dfu->data.mtd.size = pi->size;
+               if (!strcmp(st, "partubi"))
+                       dfu->data.mtd.ubi = 1;
+       } else {
+               printf("%s: Memory layout (%s) not supported!\n", __func__, st);
+               return -1;
+       }
+
+       if (!mtd_is_aligned_with_block_size(mtd, dfu->data.mtd.start)) {
+               printf("Offset not aligned with a block (0x%x)\n",
+                      mtd->erasesize);
+               return -EINVAL;
+       }
+       if (!mtd_is_aligned_with_block_size(mtd, dfu->data.mtd.size)) {
+               printf("Size not aligned with a block (0x%x)\n",
+                      mtd->erasesize);
+               return -EINVAL;
+       }
+
+       dfu->get_medium_size = dfu_get_medium_size_mtd;
+       dfu->read_medium = dfu_read_medium_mtd;
+       dfu->write_medium = dfu_write_medium_mtd;
+       dfu->flush_medium = dfu_flush_medium_mtd;
+       dfu->poll_timeout = dfu_polltimeout_mtd;
+
+       /* initial state */
+       dfu->inited = 0;
+
+       return 0;
+}
index 0bfdbf942898d391e993213573153dd4ec96c436..b812a3dfb136ec954305a76b7bf7555e155619ee 100644 (file)
@@ -214,7 +214,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr, char *s)
                part = simple_strtoul(s, &s, 10);
 
                sprintf(mtd_id, "%s%d,%d", "nand", dev, part - 1);
-               printf("using id '%s'\n", mtd_id);
+               debug("using id '%s'\n", mtd_id);
 
                mtdparts_init();
 
index 066e7670d1b939c55e4bff6af16a082ceeaf753e..0fdbfae43410b28d00775877ef6575b21981cb5d 100644 (file)
@@ -10,6 +10,8 @@
 #include <dfu.h>
 #include <spi.h>
 #include <spi_flash.h>
+#include <jffs2/load_kernel.h>
+#include <linux/mtd/mtd.h>
 
 static int dfu_get_medium_size_sf(struct dfu_entity *dfu, u64 *size)
 {
@@ -19,7 +21,7 @@ static int dfu_get_medium_size_sf(struct dfu_entity *dfu, u64 *size)
 }
 
 static int dfu_read_medium_sf(struct dfu_entity *dfu, u64 offset, void *buf,
-               long *len)
+                             long *len)
 {
        return spi_flash_read(dfu->data.sf.dev, dfu->data.sf.start + offset,
                *len, buf);
@@ -32,7 +34,7 @@ static u64 find_sector(struct dfu_entity *dfu, u64 start, u64 offset)
 }
 
 static int dfu_write_medium_sf(struct dfu_entity *dfu,
-               u64 offset, void *buf, long *len)
+                              u64 offset, void *buf, long *len)
 {
        int ret;
 
@@ -52,11 +54,33 @@ static int dfu_write_medium_sf(struct dfu_entity *dfu,
 
 static int dfu_flush_medium_sf(struct dfu_entity *dfu)
 {
+       u64 off, length;
+
+       if (!CONFIG_IS_ENABLED(DFU_SF_PART) || !dfu->data.sf.ubi)
+               return 0;
+
+       /* in case of ubi partition, erase rest of the partition */
+       off = find_sector(dfu, dfu->data.sf.start, dfu->offset);
+       /* last write ended with unaligned length jump to next */
+       if (off != dfu->data.sf.start + dfu->offset)
+               off += dfu->data.sf.dev->sector_size;
+       length = dfu->data.sf.start + dfu->data.sf.size - off;
+       if (length)
+               return spi_flash_erase(dfu->data.sf.dev, off, length);
+
        return 0;
 }
 
 static unsigned int dfu_polltimeout_sf(struct dfu_entity *dfu)
 {
+       /*
+        * Currently, Poll Timeout != 0 is only needed on nand
+        * ubi partition, as sectors which are not used need
+        * to be erased
+        */
+       if (CONFIG_IS_ENABLED(DFU_SF_PART) && dfu->data.sf.ubi)
+               return DFU_MANIFEST_POLL_TIMEOUT;
+
        return DFU_DEFAULT_POLL_TIMEOUT;
 }
 
@@ -133,6 +157,34 @@ int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr, char *s)
                dfu->data.sf.start = simple_strtoul(s, &s, 16);
                s++;
                dfu->data.sf.size = simple_strtoul(s, &s, 16);
+       } else if (CONFIG_IS_ENABLED(DFU_SF_PART) &&
+                  (!strcmp(st, "part") || !strcmp(st, "partubi"))) {
+               char mtd_id[32];
+               struct mtd_device *mtd_dev;
+               u8 part_num;
+               struct part_info *pi;
+               int ret, dev, part;
+
+               dfu->layout = DFU_RAW_ADDR;
+
+               dev = simple_strtoul(s, &s, 10);
+               s++;
+               part = simple_strtoul(s, &s, 10);
+
+               sprintf(mtd_id, "%s%d,%d", "nor", dev, part - 1);
+               printf("using id '%s'\n", mtd_id);
+
+               mtdparts_init();
+
+               ret = find_dev_and_part(mtd_id, &mtd_dev, &part_num, &pi);
+               if (ret != 0) {
+                       printf("Could not locate '%s'\n", mtd_id);
+                       return -1;
+               }
+               dfu->data.sf.start = pi->offset;
+               dfu->data.sf.size = pi->size;
+               if (!strcmp(st, "partubi"))
+                       dfu->data.sf.ubi = 1;
        } else {
                printf("%s: Memory layout (%s) not supported!\n", __func__, st);
                spi_flash_free(dfu->data.sf.dev);
diff --git a/drivers/dfu/dfu_virt.c b/drivers/dfu/dfu_virt.c
new file mode 100644 (file)
index 0000000..ea8c71f
--- /dev/null
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
+/*
+ * Copyright (C) 2019, STMicroelectronics - All Rights Reserved
+ */
+#include <common.h>
+#include <dfu.h>
+#include <errno.h>
+#include <malloc.h>
+
+int __weak dfu_write_medium_virt(struct dfu_entity *dfu, u64 offset,
+                                void *buf, long *len)
+{
+       debug("%s: off=0x%llx, len=0x%x\n", __func__, offset, (u32)*len);
+
+       return 0;
+}
+
+int __weak dfu_get_medium_size_virt(struct dfu_entity *dfu, u64 *size)
+{
+       *size = 0;
+
+       return 0;
+}
+
+int __weak dfu_read_medium_virt(struct dfu_entity *dfu, u64 offset,
+                               void *buf, long *len)
+{
+       debug("%s: off=0x%llx, len=0x%x\n", __func__, offset, (u32)*len);
+       *len = 0;
+
+       return 0;
+}
+
+int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr, char *s)
+{
+       debug("%s: devstr = %s\n", __func__, devstr);
+
+       dfu->dev_type = DFU_DEV_VIRT;
+       dfu->layout = DFU_RAW_ADDR;
+       dfu->data.virt.dev_num = simple_strtoul(devstr, NULL, 10);
+
+       dfu->write_medium = dfu_write_medium_virt;
+       dfu->get_medium_size = dfu_get_medium_size_virt;
+       dfu->read_medium = dfu_read_medium_virt;
+
+       dfu->inited = 0;
+
+       return 0;
+}
index 4985ea033b1514c13278a1c27def09661d39aa2e..7a8ba587da5bf1441d0dbbb4be6e13209c6f7f2b 100644 (file)
@@ -421,4 +421,13 @@ config MICROCHIP_FLEXCOM
          Only one function can be used at a time and is chosen at boot time
          according to the device tree.
 
+config K3_AVS0
+       depends on ARCH_K3 && SPL_DM_REGULATOR
+       bool "AVS class 0 support for K3 devices"
+       help
+         K3 devices have the optimized voltage values for the main voltage
+         domains stored in efuse within the VTM IP. This driver reads the
+         optimized voltage from the efuse, so that it can be programmed
+         to the PMIC on board.
+
 endmenu
index f61263640b84625cb6aefd7ede6b12f4b3791c45..870655e80228d09cea5433982c2373b4114e50c2 100644 (file)
@@ -66,3 +66,4 @@ obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress_config.o
 obj-$(CONFIG_WINBOND_W83627) += winbond_w83627.o
 obj-$(CONFIG_JZ4780_EFUSE) += jz4780_efuse.o
 obj-$(CONFIG_MICROCHIP_FLEXCOM) += microchip_flexcom.o
+obj-$(CONFIG_K3_AVS0) += k3_avs.o
diff --git a/drivers/misc/k3_avs.c b/drivers/misc/k3_avs.c
new file mode 100644 (file)
index 0000000..c19c3c0
--- /dev/null
@@ -0,0 +1,388 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Texas Instruments' K3 Clas 0 Adaptive Voltage Scaling driver
+ *
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
+ *      Tero Kristo <t-kristo@ti.com>
+ *
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <asm/io.h>
+#include <i2c.h>
+#include <k3-avs.h>
+#include <power/regulator.h>
+
+#define AM6_VTM_DEVINFO(i)     (priv->base + 0x100 + 0x20 * (i))
+#define AM6_VTM_OPPVID_VD(i)   (priv->base + 0x104 + 0x20 * (i))
+
+#define AM6_VTM_AVS0_SUPPORTED BIT(12)
+
+#define AM6_VTM_OPP_SHIFT(opp) (8 * (opp))
+#define AM6_VTM_OPP_MASK       0xff
+
+#define VD_FLAG_INIT_DONE      BIT(0)
+
+struct k3_avs_privdata {
+       void *base;
+       struct vd_config *vd_config;
+};
+
+struct opp {
+       u32 freq;
+       u32 volt;
+};
+
+struct vd_data {
+       int id;
+       u8 opp;
+       u8 flags;
+       int dev_id;
+       int clk_id;
+       struct opp opps[NUM_OPPS];
+       struct udevice *supply;
+};
+
+struct vd_config {
+       struct vd_data *vds;
+       u32 (*efuse_xlate)(struct k3_avs_privdata *priv, int idx, int opp);
+};
+
+static struct k3_avs_privdata *k3_avs_priv;
+
+/**
+ * am6_efuse_voltage: read efuse voltage from VTM
+ * @priv: driver private data
+ * @idx: VD to read efuse for
+ * @opp: opp id to read
+ *
+ * Reads efuse value for the specified OPP, and converts the register
+ * value to a voltage. Returns the voltage in uV, or 0 if nominal voltage
+ * should be used.
+ *
+ * Efuse val to volt conversion logic:
+ *
+ * val > 171 volt increments in 20mV steps with base 171 => 1.66V
+ * val between 115 to 11 increments in 10mV steps with base 115 => 1.1V
+ * val between 15 to 115 increments in 5mV steps with base 15 => .6V
+ * val between 1 to 15 increments in 20mv steps with base 0 => .3V
+ * val 0 is invalid
+ */
+static u32 am6_efuse_xlate(struct k3_avs_privdata *priv, int idx, int opp)
+{
+       u32 val = readl(AM6_VTM_OPPVID_VD(idx));
+
+       val >>= AM6_VTM_OPP_SHIFT(opp);
+       val &= AM6_VTM_OPP_MASK;
+
+       if (!val)
+               return 0;
+
+       if (val > 171)
+               return 1660000 + 20000 * (val - 171);
+
+       if (val > 115)
+               return 1100000 + 10000 * (val - 115);
+
+       if (val > 15)
+               return 600000 + 5000 * (val - 15);
+
+       return 300000 + 20000 * val;
+}
+
+static int k3_avs_program_voltage(struct k3_avs_privdata *priv,
+                                 struct vd_data *vd,
+                                 int opp_id)
+{
+       u32 volt = vd->opps[opp_id].volt;
+       struct vd_data *vd2;
+
+       if (!vd->supply)
+               return -ENODEV;
+
+       vd->opp = opp_id;
+       vd->flags |= VD_FLAG_INIT_DONE;
+
+       /* Take care of ganged rails and pick the Max amongst them*/
+       for (vd2 = priv->vd_config->vds; vd2->id >= 0; vd2++) {
+               if (vd == vd2)
+                       continue;
+
+               if (vd2->supply != vd->supply)
+                       continue;
+
+               if (vd2->opps[vd2->opp].volt > volt)
+                       volt = vd2->opps[vd2->opp].volt;
+
+               vd2->flags |= VD_FLAG_INIT_DONE;
+       }
+
+       return regulator_set_value(vd->supply, volt);
+}
+
+static struct vd_data *get_vd(struct k3_avs_privdata *priv, int idx)
+{
+       struct vd_data *vd;
+
+       for (vd = priv->vd_config->vds; vd->id >= 0 && vd->id != idx; vd++)
+               ;
+
+       if (vd->id < 0)
+               return NULL;
+
+       return vd;
+}
+
+/**
+ * k3_avs_set_opp: Sets the voltage for an arbitrary VD rail
+ * @dev: AVS device
+ * @vdd_id: voltage domain ID
+ * @opp_id: OPP ID
+ *
+ * Programs the desired OPP value for the defined voltage rail. This
+ * should be called from board files if reconfiguration is desired.
+ * Returns 0 on success, negative error value on failure.
+ */
+int k3_avs_set_opp(struct udevice *dev, int vdd_id, int opp_id)
+{
+       struct k3_avs_privdata *priv = dev_get_priv(dev);
+       struct vd_data *vd;
+
+       vd = get_vd(priv, vdd_id);
+       if (!vd)
+               return -EINVAL;
+
+       return k3_avs_program_voltage(priv, vd, opp_id);
+}
+
+static int match_opp(struct vd_data *vd, u32 freq)
+{
+       struct opp *opp;
+       int opp_id;
+
+       for (opp_id = 0; opp_id < NUM_OPPS; opp_id++) {
+               opp = &vd->opps[opp_id];
+               if (opp->freq == freq)
+                       return opp_id;
+       }
+
+       printf("No matching OPP found for freq %d.\n", freq);
+
+       return -EINVAL;
+}
+
+/**
+ * k3_avs_notify_freq: Notify clock rate change towards AVS subsystem
+ * @dev_id: Device ID for the clock to be changed
+ * @clk_id: Clock ID for the clock to be changed
+ * @freq: New frequency for clock
+ *
+ * Checks if the provided clock is the MPU clock or not, if not, return
+ * immediately. If MPU clock is provided, maps the provided MPU frequency
+ * towards an MPU OPP, and programs the voltage to the regulator. Return 0
+ * on success, negative error value on failure.
+ */
+int k3_avs_notify_freq(int dev_id, int clk_id, u32 freq)
+{
+       int opp_id;
+       struct k3_avs_privdata *priv = k3_avs_priv;
+       struct vd_data *vd;
+
+       for (vd = priv->vd_config->vds; vd->id >= 0; vd++) {
+               if (vd->dev_id != dev_id || vd->clk_id != clk_id)
+                       continue;
+
+               opp_id = match_opp(vd, freq);
+               if (opp_id < 0)
+                       return opp_id;
+
+               vd->opp = opp_id;
+               return k3_avs_program_voltage(priv, vd, opp_id);
+       }
+
+       return -EINVAL;
+}
+
+static int k3_avs_configure(struct udevice *dev, struct k3_avs_privdata *priv)
+{
+       struct vd_config *conf;
+       int ret;
+       char pname[20];
+       struct vd_data *vd;
+
+       conf = (void *)dev_get_driver_data(dev);
+
+       priv->vd_config = conf;
+
+       for (vd = conf->vds; vd->id >= 0; vd++) {
+               sprintf(pname, "vdd-supply-%d", vd->id);
+               ret = device_get_supply_regulator(dev, pname, &vd->supply);
+               if (ret)
+                       dev_warn(dev, "supply not found for VD%d.\n", vd->id);
+
+               sprintf(pname, "ti,default-opp-%d", vd->id);
+               ret = dev_read_u32_default(dev, pname, -1);
+               if (ret != -1)
+                       vd->opp = ret;
+       }
+
+       return 0;
+}
+
+/**
+ * k3_avs_probe: parses VD info from VTM, and re-configures the OPP data
+ *
+ * Parses all VDs on a device calculating the AVS class-0 voltages for them,
+ * and updates the vd_data based on this. The vd_data itself shall be used
+ * to program the required OPPs later on. Returns 0 on success, negative
+ * error value on failure.
+ */
+static int k3_avs_probe(struct udevice *dev)
+{
+       int opp_id;
+       u32 volt;
+       struct opp *opp;
+       struct k3_avs_privdata *priv;
+       struct vd_data *vd;
+       int ret;
+
+       priv = dev_get_priv(dev);
+
+       k3_avs_priv = priv;
+
+       ret = k3_avs_configure(dev, priv);
+       if (ret)
+               return ret;
+
+       priv->base = dev_read_addr_ptr(dev);
+       if (!priv->base)
+               return -ENODEV;
+
+       for (vd = priv->vd_config->vds; vd->id >= 0; vd++) {
+               if (!(readl(AM6_VTM_DEVINFO(vd->id)) &
+                     AM6_VTM_AVS0_SUPPORTED)) {
+                       dev_warn(dev, "AVS-class 0 not supported for VD%d\n",
+                                vd->id);
+                       continue;
+               }
+
+               for (opp_id = 0; opp_id < NUM_OPPS; opp_id++) {
+                       opp = &vd->opps[opp_id];
+
+                       if (!opp->freq)
+                               continue;
+
+                       volt = priv->vd_config->efuse_xlate(priv, vd->id,
+                                                           opp_id);
+                       if (volt)
+                               opp->volt = volt;
+               }
+       }
+
+       for (vd = priv->vd_config->vds; vd->id >= 0; vd++) {
+               if (vd->flags & VD_FLAG_INIT_DONE)
+                       continue;
+
+               k3_avs_program_voltage(priv, vd, vd->opp);
+       }
+
+       return 0;
+}
+
+static struct vd_data am654_vd_data[] = {
+       {
+               .id = AM6_VDD_CORE,
+               .dev_id = 82, /* AM6_DEV_CBASS0 */
+               .clk_id = 0, /* main sysclk0 */
+               .opp = AM6_OPP_NOM,
+               .opps = {
+                       [AM6_OPP_NOM] = {
+                               .volt = 1000000,
+                               .freq = 250000000, /* CBASS0 */
+                       },
+               },
+       },
+       {
+               .id = AM6_VDD_MPU0,
+               .dev_id = 202, /* AM6_DEV_COMPUTE_CLUSTER_A53_0 */
+               .clk_id = 0, /* ARM clock */
+               .opp = AM6_OPP_NOM,
+               .opps = {
+                       [AM6_OPP_NOM] = {
+                               .volt = 1000000,
+                               .freq = 800000000,
+                       },
+                       [AM6_OPP_OD] = {
+                               .volt = 1100000,
+                               .freq = 1000000000,
+                       },
+                       [AM6_OPP_TURBO] = {
+                               .volt = 1220000,
+                               .freq = 1100000000,
+                       },
+               },
+       },
+       {
+               .id = AM6_VDD_MPU1,
+               .opp = AM6_OPP_NOM,
+               .dev_id = 204, /* AM6_DEV_COMPUTE_CLUSTER_A53_2 */
+               .clk_id = 0, /* ARM clock */
+               .opps = {
+                       [AM6_OPP_NOM] = {
+                               .volt = 1000000,
+                               .freq = 800000000,
+                       },
+                       [AM6_OPP_OD] = {
+                               .volt = 1100000,
+                               .freq = 1000000000,
+                       },
+                       [AM6_OPP_TURBO] = {
+                               .volt = 1220000,
+                               .freq = 1100000000,
+                       },
+               },
+       },
+       { .id = -1 },
+};
+
+static struct vd_data j721e_vd_data[] = {
+       {
+               .id = J721E_VDD_MPU,
+               .opp = AM6_OPP_NOM,
+               .dev_id = 202, /* J721E_DEV_A72SS0_CORE0 */
+               .clk_id = 2, /* ARM clock */
+               .opps = {
+                       [AM6_OPP_NOM] = {
+                               .volt = 880000, /* TBD in DM */
+                               .freq = 2000000000,
+                       },
+               },
+       },
+       { .id = -1 },
+};
+
+static struct vd_config j721e_vd_config = {
+       .efuse_xlate = am6_efuse_xlate,
+       .vds = j721e_vd_data,
+};
+
+static struct vd_config am654_vd_config = {
+       .efuse_xlate = am6_efuse_xlate,
+       .vds = am654_vd_data,
+};
+
+static const struct udevice_id k3_avs_ids[] = {
+       { .compatible = "ti,am654-avs", .data = (ulong)&am654_vd_config },
+       { .compatible = "ti,j721e-avs", .data = (ulong)&j721e_vd_config },
+       {}
+};
+
+U_BOOT_DRIVER(k3_avs) = {
+       .name = "k3_avs",
+       .of_match = k3_avs_ids,
+       .id = UCLASS_MISC,
+       .probe = k3_avs_probe,
+       .priv_auto_alloc_size = sizeof(struct k3_avs_privdata),
+};
index cd357ea4116cc23a5ead341384e507ff480f4adc..8ff84aa3a8de63085a7c9f1e1c42aab9b6883dff 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define SDHCI_IRQ_EN_BITS              (IRQSTATEN_CC | IRQSTATEN_TC | \
-                               IRQSTATEN_CINT | \
-                               IRQSTATEN_CTOE | IRQSTATEN_CCE | IRQSTATEN_CEBE | \
-                               IRQSTATEN_CIE | IRQSTATEN_DTOE | IRQSTATEN_DCE | \
-                               IRQSTATEN_DEBE | IRQSTATEN_BRR | IRQSTATEN_BWR | \
-                               IRQSTATEN_DINT)
-
 struct fsl_esdhc {
        uint    dsaddr;         /* SDMA system address register */
        uint    blkattr;        /* Block attributes register */
@@ -82,8 +75,6 @@ struct fsl_esdhc_plat {
  * @mmc: mmc
  * Following is used when Driver Model is enabled for MMC
  * @dev: pointer for the device
- * @non_removable: 0: removable; 1: non-removable
- * @wp_enable: 1: enable checking wp; 0: no check
  * @cd_gpio: gpio for card detection
  * @wp_gpio: gpio for write protection
  */
@@ -92,13 +83,10 @@ struct fsl_esdhc_priv {
        unsigned int sdhc_clk;
        struct clk per_clk;
        unsigned int clock;
-       unsigned int bus_width;
 #if !CONFIG_IS_ENABLED(DM_MMC)
        struct mmc *mmc;
 #endif
        struct udevice *dev;
-       int non_removable;
-       int wp_enable;
 };
 
 /* Return the XFERTYP flags for a given command and data packet */
@@ -241,12 +229,10 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
 #endif
                if (wml_value > WML_WR_WML_MAX)
                        wml_value = WML_WR_WML_MAX_VAL;
-               if (priv->wp_enable) {
-                       if ((esdhc_read32(&regs->prsstat) &
-                           PRSSTAT_WPSPL) == 0) {
-                               printf("\nThe SD card is locked. Can not write to a locked card.\n\n");
-                               return -ETIMEDOUT;
-                       }
+
+               if (!(esdhc_read32(&regs->prsstat) & PRSSTAT_WPSPL)) {
+                       printf("Can not write to locked SD card.\n");
+                       return -EINVAL;
                }
 
                esdhc_clrsetbits32(&regs->wml, WML_WR_WML_MASK,
@@ -636,236 +622,42 @@ static int esdhc_getcd_common(struct fsl_esdhc_priv *priv)
        if (CONFIG_ESDHC_DETECT_QUIRK)
                return 1;
 #endif
-
-#if CONFIG_IS_ENABLED(DM_MMC)
-       if (priv->non_removable)
-               return 1;
-#endif
-
        while (!(esdhc_read32(&regs->prsstat) & PRSSTAT_CINS) && --timeout)
                udelay(1000);
 
        return timeout > 0;
 }
 
-static int esdhc_reset(struct fsl_esdhc *regs)
-{
-       ulong start;
-
-       /* reset the controller */
-       esdhc_setbits32(&regs->sysctl, SYSCTL_RSTA);
-
-       /* hardware clears the bit when it is done */
-       start = get_timer(0);
-       while ((esdhc_read32(&regs->sysctl) & SYSCTL_RSTA)) {
-               if (get_timer(start) > 100) {
-                       printf("MMC/SD: Reset never completed.\n");
-                       return -ETIMEDOUT;
-               }
-       }
-
-       return 0;
-}
-
-#if !CONFIG_IS_ENABLED(DM_MMC)
-static int esdhc_getcd(struct mmc *mmc)
-{
-       struct fsl_esdhc_priv *priv = mmc->priv;
-
-       return esdhc_getcd_common(priv);
-}
-
-static int esdhc_init(struct mmc *mmc)
-{
-       struct fsl_esdhc_priv *priv = mmc->priv;
-
-       return esdhc_init_common(priv, mmc);
-}
-
-static int esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
-                         struct mmc_data *data)
-{
-       struct fsl_esdhc_priv *priv = mmc->priv;
-
-       return esdhc_send_cmd_common(priv, mmc, cmd, data);
-}
-
-static int esdhc_set_ios(struct mmc *mmc)
-{
-       struct fsl_esdhc_priv *priv = mmc->priv;
-
-       return esdhc_set_ios_common(priv, mmc);
-}
-
-static const struct mmc_ops esdhc_ops = {
-       .getcd          = esdhc_getcd,
-       .init           = esdhc_init,
-       .send_cmd       = esdhc_send_cmd,
-       .set_ios        = esdhc_set_ios,
-};
-#endif
-
-static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
-                         struct fsl_esdhc_plat *plat)
+static void fsl_esdhc_get_cfg_common(struct fsl_esdhc_priv *priv,
+                                    struct mmc_config *cfg)
 {
-       struct mmc_config *cfg;
-       struct fsl_esdhc *regs;
-       u32 caps, voltage_caps;
-       int ret;
-
-       if (!priv)
-               return -EINVAL;
-
-       regs = priv->esdhc_regs;
-
-       /* First reset the eSDHC controller */
-       ret = esdhc_reset(regs);
-       if (ret)
-               return ret;
-
-       esdhc_setbits32(&regs->sysctl, SYSCTL_PEREN | SYSCTL_HCKEN |
-                                      SYSCTL_IPGEN | SYSCTL_CKEN);
-
-       writel(SDHCI_IRQ_EN_BITS, &regs->irqstaten);
-       cfg = &plat->cfg;
-#ifndef CONFIG_DM_MMC
-       memset(cfg, '\0', sizeof(*cfg));
-#endif
+       struct fsl_esdhc *regs = priv->esdhc_regs;
+       u32 caps;
 
-       voltage_caps = 0;
        caps = esdhc_read32(&regs->hostcapblt);
-
 #ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135
-       caps = caps & ~(ESDHC_HOSTCAPBLT_SRS |
-                       ESDHC_HOSTCAPBLT_VS18 | ESDHC_HOSTCAPBLT_VS30);
+       caps &= ~(HOSTCAPBLT_SRS | HOSTCAPBLT_VS18 | HOSTCAPBLT_VS30);
 #endif
-
-/* T4240 host controller capabilities register should have VS33 bit */
 #ifdef CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
-       caps = caps | ESDHC_HOSTCAPBLT_VS33;
+       caps |= HOSTCAPBLT_VS33;
 #endif
-
-       if (caps & ESDHC_HOSTCAPBLT_VS18)
-               voltage_caps |= MMC_VDD_165_195;
-       if (caps & ESDHC_HOSTCAPBLT_VS30)
-               voltage_caps |= MMC_VDD_29_30 | MMC_VDD_30_31;
-       if (caps & ESDHC_HOSTCAPBLT_VS33)
-               voltage_caps |= MMC_VDD_32_33 | MMC_VDD_33_34;
+       if (caps & HOSTCAPBLT_VS18)
+               cfg->voltages |= MMC_VDD_165_195;
+       if (caps & HOSTCAPBLT_VS30)
+               cfg->voltages |= MMC_VDD_29_30 | MMC_VDD_30_31;
+       if (caps & HOSTCAPBLT_VS33)
+               cfg->voltages |= MMC_VDD_32_33 | MMC_VDD_33_34;
 
        cfg->name = "FSL_SDHC";
-#if !CONFIG_IS_ENABLED(DM_MMC)
-       cfg->ops = &esdhc_ops;
-#endif
-#ifdef CONFIG_SYS_SD_VOLTAGE
-       cfg->voltages = CONFIG_SYS_SD_VOLTAGE;
-#else
-       cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
-#endif
-       if ((cfg->voltages & voltage_caps) == 0) {
-               printf("voltage not supported by controller\n");
-               return -1;
-       }
-
-       if (priv->bus_width == 8)
-               cfg->host_caps = MMC_MODE_4BIT | MMC_MODE_8BIT;
-       else if (priv->bus_width == 4)
-               cfg->host_caps = MMC_MODE_4BIT;
-
-       cfg->host_caps = MMC_MODE_4BIT | MMC_MODE_8BIT;
-
-       if (priv->bus_width > 0) {
-               if (priv->bus_width < 8)
-                       cfg->host_caps &= ~MMC_MODE_8BIT;
-               if (priv->bus_width < 4)
-                       cfg->host_caps &= ~MMC_MODE_4BIT;
-       }
 
-       if (caps & ESDHC_HOSTCAPBLT_HSS)
+       if (caps & HOSTCAPBLT_HSS)
                cfg->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
 
-#ifdef CONFIG_ESDHC_DETECT_8_BIT_QUIRK
-       if (CONFIG_ESDHC_DETECT_8_BIT_QUIRK)
-               cfg->host_caps &= ~MMC_MODE_8BIT;
-#endif
-
        cfg->f_min = 400000;
        cfg->f_max = min(priv->sdhc_clk, (u32)200000000);
-
        cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
-
-       return 0;
 }
 
-#if !CONFIG_IS_ENABLED(DM_MMC)
-static int fsl_esdhc_cfg_to_priv(struct fsl_esdhc_cfg *cfg,
-                                struct fsl_esdhc_priv *priv)
-{
-       if (!cfg || !priv)
-               return -EINVAL;
-
-       priv->esdhc_regs = (struct fsl_esdhc *)(unsigned long)(cfg->esdhc_base);
-       priv->bus_width = cfg->max_bus_width;
-       priv->sdhc_clk = cfg->sdhc_clk;
-       priv->wp_enable  = cfg->wp_enable;
-
-       return 0;
-};
-
-int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
-{
-       struct fsl_esdhc_plat *plat;
-       struct fsl_esdhc_priv *priv;
-       struct mmc *mmc;
-       int ret;
-
-       if (!cfg)
-               return -EINVAL;
-
-       priv = calloc(sizeof(struct fsl_esdhc_priv), 1);
-       if (!priv)
-               return -ENOMEM;
-       plat = calloc(sizeof(struct fsl_esdhc_plat), 1);
-       if (!plat) {
-               free(priv);
-               return -ENOMEM;
-       }
-
-       ret = fsl_esdhc_cfg_to_priv(cfg, priv);
-       if (ret) {
-               debug("%s xlate failure\n", __func__);
-               free(plat);
-               free(priv);
-               return ret;
-       }
-
-       ret = fsl_esdhc_init(priv, plat);
-       if (ret) {
-               debug("%s init failure\n", __func__);
-               free(plat);
-               free(priv);
-               return ret;
-       }
-
-       mmc = mmc_create(&plat->cfg, priv);
-       if (!mmc)
-               return -EIO;
-
-       priv->mmc = mmc;
-
-       return 0;
-}
-
-int fsl_esdhc_mmc_init(bd_t *bis)
-{
-       struct fsl_esdhc_cfg *cfg;
-
-       cfg = calloc(sizeof(struct fsl_esdhc_cfg), 1);
-       cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR;
-       cfg->sdhc_clk = gd->arch.sdhc_clk;
-       return fsl_esdhc_initialize(bis, cfg);
-}
-#endif
-
 #ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT
 void mmc_adapter_card_type_ident(void)
 {
@@ -939,7 +731,106 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)
 }
 #endif
 
-#if CONFIG_IS_ENABLED(DM_MMC)
+#if !CONFIG_IS_ENABLED(DM_MMC)
+static int esdhc_getcd(struct mmc *mmc)
+{
+       struct fsl_esdhc_priv *priv = mmc->priv;
+
+       return esdhc_getcd_common(priv);
+}
+
+static int esdhc_init(struct mmc *mmc)
+{
+       struct fsl_esdhc_priv *priv = mmc->priv;
+
+       return esdhc_init_common(priv, mmc);
+}
+
+static int esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
+                         struct mmc_data *data)
+{
+       struct fsl_esdhc_priv *priv = mmc->priv;
+
+       return esdhc_send_cmd_common(priv, mmc, cmd, data);
+}
+
+static int esdhc_set_ios(struct mmc *mmc)
+{
+       struct fsl_esdhc_priv *priv = mmc->priv;
+
+       return esdhc_set_ios_common(priv, mmc);
+}
+
+static const struct mmc_ops esdhc_ops = {
+       .getcd          = esdhc_getcd,
+       .init           = esdhc_init,
+       .send_cmd       = esdhc_send_cmd,
+       .set_ios        = esdhc_set_ios,
+};
+
+int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
+{
+       struct fsl_esdhc_plat *plat;
+       struct fsl_esdhc_priv *priv;
+       struct mmc_config *mmc_cfg;
+       struct mmc *mmc;
+
+       if (!cfg)
+               return -EINVAL;
+
+       priv = calloc(sizeof(struct fsl_esdhc_priv), 1);
+       if (!priv)
+               return -ENOMEM;
+       plat = calloc(sizeof(struct fsl_esdhc_plat), 1);
+       if (!plat) {
+               free(priv);
+               return -ENOMEM;
+       }
+
+       priv->esdhc_regs = (struct fsl_esdhc *)(unsigned long)(cfg->esdhc_base);
+       priv->sdhc_clk = cfg->sdhc_clk;
+
+       mmc_cfg = &plat->cfg;
+
+       if (cfg->max_bus_width == 8) {
+               mmc_cfg->host_caps |= MMC_MODE_1BIT | MMC_MODE_4BIT |
+                                     MMC_MODE_8BIT;
+       } else if (cfg->max_bus_width == 4) {
+               mmc_cfg->host_caps |= MMC_MODE_1BIT | MMC_MODE_4BIT;
+       } else if (cfg->max_bus_width == 1) {
+               mmc_cfg->host_caps |= MMC_MODE_1BIT;
+       } else {
+               mmc_cfg->host_caps |= MMC_MODE_1BIT | MMC_MODE_4BIT |
+                                     MMC_MODE_8BIT;
+               printf("No max bus width provided. Assume 8-bit supported.\n");
+       }
+
+#ifdef CONFIG_ESDHC_DETECT_8_BIT_QUIRK
+       if (CONFIG_ESDHC_DETECT_8_BIT_QUIRK)
+               mmc_cfg->host_caps &= ~MMC_MODE_8BIT;
+#endif
+       mmc_cfg->ops = &esdhc_ops;
+
+       fsl_esdhc_get_cfg_common(priv, mmc_cfg);
+
+       mmc = mmc_create(mmc_cfg, priv);
+       if (!mmc)
+               return -EIO;
+
+       priv->mmc = mmc;
+       return 0;
+}
+
+int fsl_esdhc_mmc_init(bd_t *bis)
+{
+       struct fsl_esdhc_cfg *cfg;
+
+       cfg = calloc(sizeof(struct fsl_esdhc_cfg), 1);
+       cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR;
+       cfg->sdhc_clk = gd->arch.sdhc_clk;
+       return fsl_esdhc_initialize(bis, cfg);
+}
+#else /* DM_MMC */
 #ifndef CONFIG_PPC
 #include <asm/arch/clock.h>
 #endif
@@ -949,7 +840,6 @@ static int fsl_esdhc_probe(struct udevice *dev)
        struct fsl_esdhc_plat *plat = dev_get_platdata(dev);
        struct fsl_esdhc_priv *priv = dev_get_priv(dev);
        fdt_addr_t addr;
-       unsigned int val;
        struct mmc *mmc;
        int ret;
 
@@ -963,22 +853,6 @@ static int fsl_esdhc_probe(struct udevice *dev)
 #endif
        priv->dev = dev;
 
-       val = dev_read_u32_default(dev, "bus-width", -1);
-       if (val == 8)
-               priv->bus_width = 8;
-       else if (val == 4)
-               priv->bus_width = 4;
-       else
-               priv->bus_width = 1;
-
-       if (dev_read_bool(dev, "non-removable")) {
-               priv->non_removable = 1;
-        } else {
-               priv->non_removable = 0;
-       }
-
-       priv->wp_enable = 1;
-
        if (IS_ENABLED(CONFIG_CLK)) {
                /* Assigned clock already set clock */
                ret = clk_get_by_name(dev, "per", &priv->per_clk);
@@ -1005,11 +879,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
                }
        }
 
-       ret = fsl_esdhc_init(priv, plat);
-       if (ret) {
-               dev_err(dev, "fsl_esdhc_init failure\n");
-               return ret;
-       }
+       fsl_esdhc_get_cfg_common(priv, &plat->cfg);
 
        mmc_of_parse(dev, &plat->cfg);
 
@@ -1024,8 +894,12 @@ static int fsl_esdhc_probe(struct udevice *dev)
 
 static int fsl_esdhc_get_cd(struct udevice *dev)
 {
+       struct fsl_esdhc_plat *plat = dev_get_platdata(dev);
        struct fsl_esdhc_priv *priv = dev_get_priv(dev);
 
+       if (plat->cfg.host_caps & MMC_CAP_NONREMOVABLE)
+               return 1;
+
        return esdhc_getcd_common(priv);
 }
 
index 43106dec7566d35b90d1ffcf8ab7b8e491590a24..40993863130904efe5b0a62c654aa15ec7dbc17f 100644 (file)
@@ -627,9 +627,6 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock)
        int sdhc_clk = priv->sdhc_clk;
        uint clk;
 
-       if (clock < mmc->cfg->f_min)
-               clock = mmc->cfg->f_min;
-
        while (sdhc_clk / (16 * pre_div * ddr_pre_div) > clock && pre_div < 256)
                pre_div *= 2;
 
@@ -958,6 +955,7 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
 {
        struct fsl_esdhc *regs = priv->esdhc_regs;
        int ret __maybe_unused;
+       u32 clock;
 
 #ifdef CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK
        /* Select to use peripheral clock */
@@ -966,8 +964,12 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
        esdhc_clock_control(priv, true);
 #endif
        /* Set the clock speed */
-       if (priv->clock != mmc->clock)
-               set_sysctl(priv, mmc, mmc->clock);
+       clock = mmc->clock;
+       if (clock < mmc->cfg->f_min)
+               clock = mmc->cfg->f_min;
+
+       if (priv->clock != clock)
+               set_sysctl(priv, mmc, clock);
 
 #ifdef MMC_SUPPORTS_TUNING
        if (mmc->clk_disable) {
@@ -1645,6 +1647,9 @@ static const struct udevice_id fsl_esdhc_ids[] = {
        { .compatible = "fsl,imx7d-usdhc", .data = (ulong)&usdhc_imx7d_data,},
        { .compatible = "fsl,imx7ulp-usdhc", },
        { .compatible = "fsl,imx8qm-usdhc", .data = (ulong)&usdhc_imx8qm_data,},
+       { .compatible = "fsl,imx8mm-usdhc", .data = (ulong)&usdhc_imx8qm_data,},
+       { .compatible = "fsl,imx8mn-usdhc", .data = (ulong)&usdhc_imx8qm_data,},
+       { .compatible = "fsl,imx8mq-usdhc", .data = (ulong)&usdhc_imx8qm_data,},
        { .compatible = "fsl,esdhc", },
        { /* sentinel */ }
 };
index e7c5062c39ac7998d4cd4a9814e243bdad648ea9..0ca7e838a817749adf2bee9b48910cc23d7db9a5 100644 (file)
@@ -191,6 +191,9 @@ static void enetc_start_pcs(struct udevice *dev)
                enetc_init_sgmii(dev);
                break;
        case PHY_INTERFACE_MODE_RGMII:
+       case PHY_INTERFACE_MODE_RGMII_ID:
+       case PHY_INTERFACE_MODE_RGMII_RXID:
+       case PHY_INTERFACE_MODE_RGMII_TXID:
                enetc_init_rgmii(dev);
                break;
        case PHY_INTERFACE_MODE_XGMII:
@@ -248,6 +251,7 @@ static void enetc_start_phy(struct udevice *dev)
 
        supported = GENMASK(6, 0); /* speeds up to 1G & AN */
        phy->advertising = phy->supported & supported;
+       phy->node = phy_node;
        phy_config(phy);
        phy_startup(phy);
 }
index 19e7b50046a841011335788a6f9360f365a8e72d..13603b9d57dcfe3d65ca078c7e4b3af20777ac2f 100644 (file)
@@ -51,6 +51,13 @@ config PCIE_ECAM_GENERIC
          Say Y here if you want to enable support for generic ECAM-based
          PCIe host controllers, such as the one emulated by QEMU.
 
+config PCI_PHYTIUM
+       bool "Phytium PCIe support"
+       depends on DM_PCI
+       help
+         Say Y here if you want to enable PCIe controller support on
+         Phytium SoCs.
+
 config PCIE_DW_MVEBU
        bool "Enable Armada-8K PCIe driver (DesignWare core)"
        depends on DM_PCI
@@ -68,6 +75,13 @@ config PCIE_FSL
          PowerPC MPC85xx, MPC86xx, B series, P series and T series SoCs.
          This driver does not support SRIO_PCIE_BOOT feature.
 
+config PCI_MPC85XX
+       bool "MPC85XX PowerPC PCI support"
+       depends on DM_PCI
+       help
+         Say Y here if you want to enable PCI controller support on FSL
+         PowerPC MPC85xx SoC.
+
 config PCI_RCAR_GEN2
        bool "Renesas RCar Gen2 PCIe driver"
        depends on DM_PCI
index b1d3dc8610b782b333ffbd3cd67e677ec12a47ce..219473aa7924e55fdb22eeda37cd1403d5e084fa 100644 (file)
@@ -19,6 +19,7 @@ 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
+obj-$(CONFIG_PCI_MPC85XX) += pci_mpc85xx.o
 obj-$(CONFIG_PCI_MSC01) += pci_msc01.o
 obj-$(CONFIG_PCIE_IMX) += pcie_imx.o
 obj-$(CONFIG_FTPCI100) += pci_ftpci100.o
@@ -37,6 +38,7 @@ obj-$(CONFIG_PCIE_LAYERSCAPE) += pcie_layerscape_fixup.o
 obj-$(CONFIG_PCIE_LAYERSCAPE_GEN4) += pcie_layerscape_gen4.o \
                                pcie_layerscape_gen4_fixup.o
 obj-$(CONFIG_PCI_XILINX) += pcie_xilinx.o
+obj-$(CONFIG_PCI_PHYTIUM) += pcie_phytium.o
 obj-$(CONFIG_PCIE_INTEL_FPGA) += pcie_intel_fpga.o
 obj-$(CONFIG_PCI_KEYSTONE) += pcie_dw_ti.o
 obj-$(CONFIG_PCIE_MEDIATEK) += pcie_mediatek.o
diff --git a/drivers/pci/pci_mpc85xx.c b/drivers/pci/pci_mpc85xx.c
new file mode 100644 (file)
index 0000000..e58ab60
--- /dev/null
@@ -0,0 +1,158 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * (C) Copyright 2019
+ * Heiko Schocher, DENX Software Engineering, hs@denx.de.
+ *
+ */
+#include <common.h>
+#include <asm/cpm_85xx.h>
+#include <pci.h>
+#include <dm.h>
+#include <asm/fsl_law.h>
+
+struct mpc85xx_pci_priv {
+       void __iomem            *cfg_addr;
+       void __iomem            *cfg_data;
+};
+
+static int mpc85xx_pci_dm_read_config(struct udevice *dev, pci_dev_t bdf,
+                                     uint offset, ulong *value,
+                                     enum pci_size_t size)
+{
+       struct mpc85xx_pci_priv *priv = dev_get_priv(dev);
+       u32 addr;
+
+       addr = bdf | (offset & 0xfc) | ((offset & 0xf00) << 16) | 0x80000000;
+       out_be32(priv->cfg_addr, addr);
+       sync();
+       *value = pci_conv_32_to_size(in_le32(priv->cfg_data), offset, size);
+
+       return 0;
+}
+
+static int mpc85xx_pci_dm_write_config(struct udevice *dev, pci_dev_t bdf,
+                                      uint offset, ulong value,
+                                      enum pci_size_t size)
+{
+       struct mpc85xx_pci_priv *priv = dev_get_priv(dev);
+       u32 addr;
+
+       addr = bdf | (offset & 0xfc) | ((offset & 0xf00) << 16) | 0x80000000;
+       out_be32(priv->cfg_addr, addr);
+       sync();
+       out_le32(priv->cfg_data, pci_conv_size_to_32(0, value, offset, size));
+
+       return 0;
+}
+
+static int
+mpc85xx_pci_dm_setup_laws(struct pci_region *io, struct pci_region *mem,
+                         struct pci_region *pre)
+{
+       /*
+        * Unfortunately we have defines for this addresse,
+        * as we have to setup the TLB, and at this stage
+        * we have no access to DT ... may we check here
+        * if the value in the define is the same ?
+        */
+       if (mem)
+               set_next_law(mem->phys_start, law_size_bits(mem->size),
+                            LAW_TRGT_IF_PCI);
+       if (io)
+               set_next_law(io->phys_start, law_size_bits(io->size),
+                            LAW_TRGT_IF_PCI);
+       if (pre)
+               set_next_law(pre->phys_start, law_size_bits(pre->size),
+                            LAW_TRGT_IF_PCI);
+
+       return 0;
+}
+
+static int mpc85xx_pci_dm_probe(struct udevice *dev)
+{
+       struct mpc85xx_pci_priv *priv = dev_get_priv(dev);
+       struct pci_region *io;
+       struct pci_region *mem;
+       struct pci_region *pre;
+       int count;
+       ccsr_pcix_t *pcix;
+
+       count = pci_get_regions(dev, &io, &mem, &pre);
+       if (count != 2) {
+               printf("%s: wrong count of regions %d only 2 allowed\n",
+                      __func__, count);
+               return -EINVAL;
+       }
+
+       mpc85xx_pci_dm_setup_laws(io, mem, pre);
+
+       pcix = priv->cfg_addr;
+       /* BAR 1: memory */
+       out_be32(&pcix->potar1, (mem->bus_start >> 12) & 0x000fffff);
+       out_be32(&pcix->potear1, 0);
+       out_be32(&pcix->powbar1, (mem->phys_start >> 12) & 0x000fffff);
+       out_be32(&pcix->powbear1, 0);
+       out_be32(&pcix->powar1, (POWAR_EN | POWAR_MEM_READ |
+                POWAR_MEM_WRITE | (__ilog2(mem->size) - 1)));
+
+       /* BAR 1: IO */
+       out_be32(&pcix->potar2, (io->bus_start >> 12) & 0x000fffff);
+       out_be32(&pcix->potear2, 0);
+       out_be32(&pcix->powbar2, (io->phys_start >> 12) & 0x000fffff);
+       out_be32(&pcix->powbear2, 0);
+       out_be32(&pcix->powar2, (POWAR_EN | POWAR_IO_READ |
+                POWAR_IO_WRITE | (__ilog2(io->size) - 1)));
+
+       out_be32(&pcix->pitar1, 0);
+       out_be32(&pcix->piwbar1, 0);
+       out_be32(&pcix->piwar1, (PIWAR_EN | PIWAR_PF | PIWAR_LOCAL |
+                PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP | PIWAR_MEM_2G));
+
+       out_be32(&pcix->powar3, 0);
+       out_be32(&pcix->powar4, 0);
+       out_be32(&pcix->piwar2, 0);
+       out_be32(&pcix->piwar3, 0);
+
+       return 0;
+}
+
+static int mpc85xx_pci_dm_remove(struct udevice *dev)
+{
+       return 0;
+}
+
+static int mpc85xx_pci_ofdata_to_platdata(struct udevice *dev)
+{
+       struct mpc85xx_pci_priv *priv = dev_get_priv(dev);
+       fdt_addr_t addr;
+
+       addr = devfdt_get_addr_index(dev, 0);
+       if (addr == FDT_ADDR_T_NONE)
+               return -EINVAL;
+       priv->cfg_addr = (void __iomem *)addr;
+       addr += 4;
+       priv->cfg_data = (void __iomem *)addr;
+
+       return 0;
+}
+
+static const struct dm_pci_ops mpc85xx_pci_ops = {
+       .read_config    = mpc85xx_pci_dm_read_config,
+       .write_config   = mpc85xx_pci_dm_write_config,
+};
+
+static const struct udevice_id mpc85xx_pci_ids[] = {
+       { .compatible = "fsl,mpc8540-pci" },
+       { }
+};
+
+U_BOOT_DRIVER(mpc85xx_pci) = {
+       .name                   = "mpc85xx_pci",
+       .id                     = UCLASS_PCI,
+       .of_match               = mpc85xx_pci_ids,
+       .ops                    = &mpc85xx_pci_ops,
+       .probe                  = mpc85xx_pci_dm_probe,
+       .remove                 = mpc85xx_pci_dm_remove,
+       .ofdata_to_platdata     = mpc85xx_pci_ofdata_to_platdata,
+       .priv_auto_alloc_size   = sizeof(struct mpc85xx_pci_priv),
+};
index db1375a1cea06c8964830a63e0f06abd3ac2a8e9..5ad7c287735126d2b65ef8a4508f228de0249f55 100644 (file)
@@ -406,7 +406,11 @@ static void ls_pcie_ep_setup_bars(void *bar_base)
 
 static void ls_pcie_ep_enable_cfg(struct ls_pcie *pcie)
 {
-       ctrl_writel(pcie, PCIE_CONFIG_READY, PCIE_PF_CONFIG);
+       u32 config;
+
+       config = ctrl_readl(pcie,  PCIE_PF_CONFIG);
+       config |= PCIE_CONFIG_READY;
+       ctrl_writel(pcie, config, PCIE_PF_CONFIG);
 }
 
 static void ls_pcie_setup_ep(struct ls_pcie *pcie)
diff --git a/drivers/pci/pcie_phytium.c b/drivers/pci/pcie_phytium.c
new file mode 100644 (file)
index 0000000..92e281e
--- /dev/null
@@ -0,0 +1,200 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Phytium PCIE host driver
+ *
+ * Heavily based on drivers/pci/pcie_xilinx.c
+ *
+ * Copyright (C) 2019
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <pci.h>
+#include <asm/io.h>
+
+/**
+ * struct phytium_pcie - phytium PCIe controller state
+ * @cfg_base: The base address of memory mapped configuration space
+ */
+struct phytium_pcie {
+       void *cfg_base;
+};
+
+/*
+ * phytium_pci_skip_dev()
+ * @parent: Identifies the PCIe device to access
+ *
+ * Checks whether the parent of the PCIe device is bridge
+ *
+ * Return: true if it is bridge, else false.
+ */
+static int phytium_pci_skip_dev(pci_dev_t parent)
+{
+       unsigned char pos, id;
+       unsigned long addr = 0x40000000;
+       unsigned short capreg;
+       unsigned char port_type;
+
+       addr += PCI_BUS(parent) << 20;
+       addr += PCI_DEV(parent) << 15;
+       addr += PCI_FUNC(parent) << 12;
+
+       pos = 0x34;
+       while (1) {
+               pos = readb(addr + pos);
+               if (pos < 0x40)
+                       break;
+               pos &= ~3;
+               id = readb(addr + pos);
+               if (id == 0xff)
+                       break;
+               if (id == 0x10) {
+                       capreg = readw(addr + pos + 2);
+                       port_type = (capreg >> 4) & 0xf;
+                       if (port_type == 0x6 || port_type == 0x4)
+                               return 1;
+                       else
+                               return 0;
+               }
+               pos += 1;
+       }
+       return 0;
+}
+
+/**
+ * pci_phytium_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_phytium_conf_address(struct udevice *bus, pci_dev_t bdf,
+                                   uint offset,
+                                   void **paddress)
+{
+       struct phytium_pcie *pcie = dev_get_priv(bus);
+       void *addr;
+       pci_dev_t bdf_parent;
+
+       unsigned int bus_no = PCI_BUS(bdf);
+       unsigned int dev_no = PCI_DEV(bdf);
+
+       bdf_parent = PCI_BDF((bus_no - 1), 0, 0);
+
+       addr = pcie->cfg_base;
+       addr += PCI_BUS(bdf) << 20;
+       addr += PCI_DEV(bdf) << 15;
+       addr += PCI_FUNC(bdf) << 12;
+
+       if (bus_no > 0 && dev_no > 0) {
+               if ((readb(addr + PCI_HEADER_TYPE) & 0x7f) !=
+                               PCI_HEADER_TYPE_BRIDGE)
+                       return -ENODEV;
+               if (phytium_pci_skip_dev(bdf_parent))
+                       return -ENODEV;
+       }
+
+       addr += offset;
+       *paddress = addr;
+
+       return 0;
+}
+
+/**
+ * pci_phytium_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_phytium_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_phytium_conf_address,
+                                           bdf, offset, valuep, size);
+}
+
+/**
+ * pci_phytium_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_phytium_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_phytium_conf_address,
+                                            bdf, offset, value, size);
+}
+
+/**
+ * pci_phytium_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_phytium_ofdata_to_platdata(struct udevice *dev)
+{
+       struct phytium_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_phytium_ops = {
+       .read_config    = pci_phytium_read_config,
+       .write_config   = pci_phytium_write_config,
+};
+
+static const struct udevice_id pci_phytium_ids[] = {
+       { .compatible = "phytium,pcie-host-1.0" },
+       { }
+};
+
+U_BOOT_DRIVER(pci_phytium) = {
+       .name                   = "pci_phytium",
+       .id                     = UCLASS_PCI,
+       .of_match               = pci_phytium_ids,
+       .ops                    = &pci_phytium_ops,
+       .ofdata_to_platdata     = pci_phytium_ofdata_to_platdata,
+       .priv_auto_alloc_size   = sizeof(struct phytium_pcie),
+};
index 4718dc700cd513af76a520d9d0950ced24f4d338..b4bf01867460e527e167271334e7701f16baf8e2 100644 (file)
@@ -275,3 +275,10 @@ config SPL_PMIC_LP87565
        help
        The LP87565 is a PMIC containing a bunch of SMPS.
        This driver binds the pmic children in SPL.
+
+config PMIC_TPS65941
+       bool "Enable driver for Texas Instruments TPS65941 PMIC"
+       depends on DM_PMIC
+       help
+       The TPS65941 is a PMIC containing a bunch of SMPS & LDOs.
+       This driver binds the pmic children.
index 888dbb2857397630cf2f74fbde750310675de652..ec6432780564d3f2c86e0ac514e4a7125e6e744a 100644 (file)
@@ -39,3 +39,4 @@ obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o
 obj-$(CONFIG_POWER_TPS65910) += pmic_tps65910.o
 obj-$(CONFIG_POWER_HI6553) += pmic_hi6553.o
 obj-$(CONFIG_POWER_MC34VR500) += pmic_mc34vr500.o
+obj-$(CONFIG_PMIC_TPS65941) += tps65941.o
index 25c339ab12cc5c2ba4f2f23e2ae62146365b11db..52e6d9d8c0e88484545d025728f16538ed04558d 100644 (file)
 #include <power/rk8xx_pmic.h>
 #include <power/pmic.h>
 
+static struct reg_data rk817_init_reg[] = {
+/* enable the under-voltage protection,
+ * the under-voltage protection will shutdown the LDO3 and reset the PMIC
+ */
+       { RK817_BUCK4_CMIN, 0x60, 0x60},
+};
+
 static const struct pmic_child_info pmic_children_info[] = {
        { .prefix = "DCDC_REG", .driver = "rk8xx_buck"},
        { .prefix = "LDO_REG", .driver = "rk8xx_ldo"},
@@ -76,13 +83,85 @@ static int rk8xx_bind(struct udevice *dev)
 static int rk8xx_probe(struct udevice *dev)
 {
        struct rk8xx_priv *priv = dev_get_priv(dev);
-       uint8_t msb, lsb;
+       struct reg_data *init_data = NULL;
+       int init_data_num = 0;
+       int ret = 0, i, show_variant;
+       u8 msb, lsb, id_msb, id_lsb;
+       u8 on_source = 0, off_source = 0;
+       u8 power_en0, power_en1, power_en2, power_en3;
+       u8 value;
 
        /* read Chip variant */
-       rk8xx_read(dev, ID_MSB, &msb, 1);
-       rk8xx_read(dev, ID_LSB, &lsb, 1);
+       if (device_is_compatible(dev, "rockchip,rk817") ||
+           device_is_compatible(dev, "rockchip,rk809")) {
+               id_msb = RK817_ID_MSB;
+               id_lsb = RK817_ID_LSB;
+       } else {
+               id_msb = ID_MSB;
+               id_lsb = ID_LSB;
+       }
+
+       ret = rk8xx_read(dev, id_msb, &msb, 1);
+       if (ret)
+               return ret;
+       ret = rk8xx_read(dev, id_lsb, &lsb, 1);
+       if (ret)
+               return ret;
 
        priv->variant = ((msb << 8) | lsb) & RK8XX_ID_MSK;
+       show_variant = priv->variant;
+       switch (priv->variant) {
+       case RK808_ID:
+               show_variant = 0x808;   /* RK808 hardware ID is 0 */
+               break;
+       case RK805_ID:
+       case RK816_ID:
+       case RK818_ID:
+               on_source = RK8XX_ON_SOURCE;
+               off_source = RK8XX_OFF_SOURCE;
+               break;
+       case RK809_ID:
+       case RK817_ID:
+               on_source = RK817_ON_SOURCE;
+               off_source = RK817_OFF_SOURCE;
+               init_data = rk817_init_reg;
+               init_data_num = ARRAY_SIZE(rk817_init_reg);
+               power_en0 = pmic_reg_read(dev, RK817_POWER_EN0);
+               power_en1 = pmic_reg_read(dev, RK817_POWER_EN1);
+               power_en2 = pmic_reg_read(dev, RK817_POWER_EN2);
+               power_en3 = pmic_reg_read(dev, RK817_POWER_EN3);
+
+               value = (power_en0 & 0x0f) | ((power_en1 & 0x0f) << 4);
+               pmic_reg_write(dev, RK817_POWER_EN_SAVE0, value);
+               value = (power_en2 & 0x0f) | ((power_en3 & 0x0f) << 4);
+               pmic_reg_write(dev, RK817_POWER_EN_SAVE1, value);
+               break;
+       default:
+               printf("Unknown PMIC: RK%x!!\n", priv->variant);
+               return -EINVAL;
+       }
+
+       for (i = 0; i < init_data_num; i++) {
+               ret = pmic_clrsetbits(dev,
+                                     init_data[i].reg,
+                                     init_data[i].mask,
+                                     init_data[i].val);
+               if (ret < 0) {
+                       printf("%s: i2c set reg 0x%x failed, ret=%d\n",
+                              __func__, init_data[i].reg, ret);
+               }
+
+               debug("%s: reg[0x%x] = 0x%x\n", __func__, init_data[i].reg,
+                     pmic_reg_read(dev, init_data[i].reg));
+       }
+
+       printf("PMIC:  RK%x ", show_variant);
+
+       if (on_source && off_source)
+               printf("(on=0x%02x, off=0x%02x)",
+                      pmic_reg_read(dev, on_source),
+                      pmic_reg_read(dev, off_source));
+       printf("\n");
 
        return 0;
 }
@@ -94,7 +173,11 @@ static struct dm_pmic_ops rk8xx_ops = {
 };
 
 static const struct udevice_id rk8xx_ids[] = {
+       { .compatible = "rockchip,rk805" },
        { .compatible = "rockchip,rk808" },
+       { .compatible = "rockchip,rk809" },
+       { .compatible = "rockchip,rk816" },
+       { .compatible = "rockchip,rk817" },
        { .compatible = "rockchip,rk818" },
        { }
 };
diff --git a/drivers/power/pmic/tps65941.c b/drivers/power/pmic/tps65941.c
new file mode 100644 (file)
index 0000000..e8f3c95
--- /dev/null
@@ -0,0 +1,83 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2019 Texas Instruments Incorporated, <www.ti.com>
+ * Keerthy <j-keerthy@ti.com>
+ */
+
+#include <common.h>
+#include <fdtdec.h>
+#include <errno.h>
+#include <dm.h>
+#include <i2c.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+#include <power/tps65941.h>
+#include <dm/device.h>
+
+static const struct pmic_child_info pmic_children_info[] = {
+       { .prefix = "ldo", .driver = TPS65941_LDO_DRIVER },
+       { .prefix = "buck", .driver = TPS65941_BUCK_DRIVER },
+       { },
+};
+
+static int tps65941_write(struct udevice *dev, uint reg, const uint8_t *buff,
+                         int len)
+{
+       if (dm_i2c_write(dev, reg, buff, len)) {
+               pr_err("write error to device: %p register: %#x!\n", dev, reg);
+               return -EIO;
+       }
+
+       return 0;
+}
+
+static int tps65941_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
+{
+       if (dm_i2c_read(dev, reg, buff, len)) {
+               pr_err("read error from device: %p register: %#x!\n", dev, reg);
+               return -EIO;
+       }
+
+       return 0;
+}
+
+static int tps65941_bind(struct udevice *dev)
+{
+       ofnode regulators_node;
+       int children;
+
+       regulators_node = dev_read_subnode(dev, "regulators");
+       if (!ofnode_valid(regulators_node)) {
+               debug("%s: %s regulators subnode not found!\n", __func__,
+                     dev->name);
+               return -ENXIO;
+       }
+
+       debug("%s: '%s' - found regulators subnode\n", __func__, dev->name);
+
+       children = pmic_bind_children(dev, regulators_node, pmic_children_info);
+       if (!children)
+               printf("%s: %s - no child found\n", __func__, dev->name);
+
+       /* Always return success for this device */
+       return 0;
+}
+
+static struct dm_pmic_ops tps65941_ops = {
+       .read = tps65941_read,
+       .write = tps65941_write,
+};
+
+static const struct udevice_id tps65941_ids[] = {
+       { .compatible = "ti,tps659411", .data = TPS659411 },
+       { .compatible = "ti,tps659413", .data = TPS659413 },
+       { }
+};
+
+U_BOOT_DRIVER(pmic_tps65941) = {
+       .name = "tps65941_pmic",
+       .id = UCLASS_PMIC,
+       .of_match = tps65941_ids,
+       .bind = tps65941_bind,
+       .ops = &tps65941_ops,
+};
index 9aa00fad42f4962784bb1ed914d55f12e599fccb..25fc787a2941398d5786d3a27eed65955314d398 100644 (file)
@@ -273,6 +273,16 @@ config DM_REGULATOR_TPS65910
        regulator types of the TPS65910 (BUCK, BOOST and LDO). It implements
        the get/set api for value and enable.
 
+config DM_REGULATOR_TPS62360
+       bool "Enable driver for TPS6236x Power Regulator"
+       depends on DM_REGULATOR
+       help
+       The TPS6236X DC/DC step down converter provides a single output
+       power line peaking at 3A current. This driver supports all four
+       variants of the chip (TPS62360, TPS62361, TPS62362, TPS62363). It
+       implements the get/set api for value only, as the power line is
+       always on.
+
 config DM_REGULATOR_STPMIC1
        bool "Enable driver for STPMIC1 regulators"
        depends on DM_REGULATOR && PMIC_STPMIC1
@@ -313,3 +323,13 @@ config SPL_DM_REGULATOR_LP873X
        This enables implementation of driver-model regulator uclass
        features for REGULATOR LP873X and the family of LP873X PMICs.
        The driver implements get/set api for: value and enable in SPL.
+
+config DM_REGULATOR_TPS65941
+       bool "Enable driver for TPS65941 PMIC regulators"
+        depends on PMIC_TPS65941
+       help
+       This enables implementation of driver-model regulator uclass
+       features for REGULATOR TPS65941 and the family of TPS65941 PMICs.
+       TPS65941 series of PMICs have 5 single phase BUCKs that can also
+       be configured in multi phase modes & 4 LDOs. The driver implements
+       get/set api for value and enable.
index 6a3d4bbee4c6270b362c9d2113e7bda9ce270770..b611c901baa80f5f1df5b37b0cf9cb6d25ea2711 100644 (file)
@@ -26,4 +26,6 @@ obj-$(CONFIG_$(SPL_)DM_REGULATOR_LP873X) += lp873x_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_LP87565) += lp87565_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
 obj-$(CONFIG_DM_REGULATOR_TPS65910) += tps65910_regulator.o
+obj-$(CONFIG_DM_REGULATOR_TPS62360) += tps62360_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_STPMIC1) += stpmic1.o
+obj-$(CONFIG_DM_REGULATOR_TPS65941) += tps65941_regulator.o
index 76be95bcd1591a2c8e06e4a7c3d3f8c66b798fe2..90961de95c656d9790fed48221ddb0a289a3c9c3 100644 (file)
@@ -77,6 +77,33 @@ int regulator_set_value(struct udevice *dev, int uV)
        return ret;
 }
 
+int regulator_set_suspend_value(struct udevice *dev, int uV)
+{
+       const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+       struct dm_regulator_uclass_platdata *uc_pdata;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+       if (uc_pdata->min_uV != -ENODATA && uV < uc_pdata->min_uV)
+               return -EINVAL;
+       if (uc_pdata->max_uV != -ENODATA && uV > uc_pdata->max_uV)
+               return -EINVAL;
+
+       if (!ops->set_suspend_value)
+               return -ENOSYS;
+
+       return ops->set_suspend_value(dev, uV);
+}
+
+int regulator_get_suspend_value(struct udevice *dev)
+{
+       const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+
+       if (!ops->get_suspend_value)
+               return -ENOSYS;
+
+       return ops->get_suspend_value(dev);
+}
+
 /*
  * To be called with at most caution as there is no check
  * before setting the actual voltage value.
@@ -170,6 +197,26 @@ int regulator_set_enable_if_allowed(struct udevice *dev, bool enable)
        return ret;
 }
 
+int regulator_set_suspend_enable(struct udevice *dev, bool enable)
+{
+       const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+
+       if (!ops->set_suspend_enable)
+               return -ENOSYS;
+
+       return ops->set_suspend_enable(dev, enable);
+}
+
+int regulator_get_suspend_enable(struct udevice *dev)
+{
+       const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
+
+       if (!ops->get_suspend_enable)
+               return -ENOSYS;
+
+       return ops->get_suspend_enable(dev);
+}
+
 int regulator_get_mode(struct udevice *dev)
 {
        const struct dm_regulator_ops *ops = dev_get_driver_ops(dev);
@@ -235,6 +282,14 @@ int regulator_autoset(struct udevice *dev)
        int ret = 0;
 
        uc_pdata = dev_get_uclass_platdata(dev);
+
+       ret = regulator_set_suspend_enable(dev, uc_pdata->suspend_on);
+       if (!ret && uc_pdata->suspend_on) {
+               ret = regulator_set_suspend_value(dev, uc_pdata->suspend_uV);
+               if (!ret)
+                       return ret;
+       }
+
        if (!uc_pdata->always_on && !uc_pdata->boot_on)
                return -EMEDIUMTYPE;
 
@@ -243,6 +298,8 @@ int regulator_autoset(struct udevice *dev)
 
        if (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UV)
                ret = regulator_set_value(dev, uc_pdata->min_uV);
+       if (uc_pdata->init_uV > 0)
+               ret = regulator_set_value(dev, uc_pdata->init_uV);
        if (!ret && (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UA))
                ret = regulator_set_current(dev, uc_pdata->min_uA);
 
@@ -363,6 +420,7 @@ static int regulator_post_bind(struct udevice *dev)
 static int regulator_pre_probe(struct udevice *dev)
 {
        struct dm_regulator_uclass_platdata *uc_pdata;
+       ofnode node;
 
        uc_pdata = dev_get_uclass_platdata(dev);
        if (!uc_pdata)
@@ -373,6 +431,8 @@ static int regulator_pre_probe(struct udevice *dev)
                                                -ENODATA);
        uc_pdata->max_uV = dev_read_u32_default(dev, "regulator-max-microvolt",
                                                -ENODATA);
+       uc_pdata->init_uV = dev_read_u32_default(dev, "regulator-init-microvolt",
+                                                -ENODATA);
        uc_pdata->min_uA = dev_read_u32_default(dev, "regulator-min-microamp",
                                                -ENODATA);
        uc_pdata->max_uA = dev_read_u32_default(dev, "regulator-max-microamp",
@@ -382,6 +442,16 @@ static int regulator_pre_probe(struct udevice *dev)
        uc_pdata->ramp_delay = dev_read_u32_default(dev, "regulator-ramp-delay",
                                                    0);
 
+       node = dev_read_subnode(dev, "regulator-state-mem");
+       if (ofnode_valid(node)) {
+               uc_pdata->suspend_on = !ofnode_read_bool(node, "regulator-off-in-suspend");
+               if (ofnode_read_u32(node, "regulator-suspend-microvolt", &uc_pdata->suspend_uV))
+                       uc_pdata->suspend_uV = uc_pdata->max_uV;
+       } else {
+               uc_pdata->suspend_on = true;
+               uc_pdata->suspend_uV = uc_pdata->max_uV;
+       }
+
        /* Those values are optional (-ENODATA if unset) */
        if ((uc_pdata->min_uV != -ENODATA) &&
            (uc_pdata->max_uV != -ENODATA) &&
index aa4f3a161c479de22ab9d6f8b75bf9aad6bc5804..e99331f6c964bb286862144d8d16ff98954e3e0d 100644 (file)
 #define ENABLE_DRIVER
 #endif
 
+/* Not used or exisit register and configure */
+#define NA                     0xff
+
 /* Field Definitions */
 #define RK808_BUCK_VSEL_MASK   0x3f
 #define RK808_BUCK4_VSEL_MASK  0xf
 #define RK808_LDO_VSEL_MASK    0x1f
 
+/* RK809 BUCK5 */
+#define RK809_BUCK5_CONFIG(n)          (0xde + (n) * 1)
+#define RK809_BUCK5_VSEL_MASK          0x07
+
+/* RK817 BUCK */
+#define RK817_BUCK_ON_VSEL(n)          (0xbb + 3 * ((n) - 1))
+#define RK817_BUCK_SLP_VSEL(n)         (0xbc + 3 * ((n) - 1))
+#define RK817_BUCK_VSEL_MASK           0x7f
+#define RK817_BUCK_CONFIG(i)           (0xba + (i) * 3)
+
+/* RK817 LDO */
+#define RK817_LDO_ON_VSEL(n)           (0xcc + 2 * ((n) - 1))
+#define RK817_LDO_SLP_VSEL(n)          (0xcd + 2 * ((n) - 1))
+#define RK817_LDO_VSEL_MASK            0x7f
+
+/* RK817 ENABLE */
+#define RK817_POWER_EN(n)              (0xb1 + (n))
+#define RK817_POWER_SLP_EN(n)          (0xb5 + (n))
+
 #define RK818_BUCK_VSEL_MASK           0x3f
 #define RK818_BUCK4_VSEL_MASK          0x1f
 #define RK818_LDO_VSEL_MASK            0x1f
 #define RK818_USB_ILIM_SEL_MASK                0x0f
 #define RK818_USB_CHG_SD_VSEL_MASK     0x70
 
+/*
+ * Ramp delay
+ */
+#define RK805_RAMP_RATE_OFFSET         3
+#define RK805_RAMP_RATE_MASK           (3 << RK805_RAMP_RATE_OFFSET)
+#define RK805_RAMP_RATE_3MV_PER_US     (0 << RK805_RAMP_RATE_OFFSET)
+#define RK805_RAMP_RATE_6MV_PER_US     (1 << RK805_RAMP_RATE_OFFSET)
+#define RK805_RAMP_RATE_12_5MV_PER_US  (2 << RK805_RAMP_RATE_OFFSET)
+#define RK805_RAMP_RATE_25MV_PER_US    (3 << RK805_RAMP_RATE_OFFSET)
+
+#define RK808_RAMP_RATE_OFFSET         3
+#define RK808_RAMP_RATE_MASK           (3 << RK808_RAMP_RATE_OFFSET)
+#define RK808_RAMP_RATE_2MV_PER_US     (0 << RK808_RAMP_RATE_OFFSET)
+#define RK808_RAMP_RATE_4MV_PER_US     (1 << RK808_RAMP_RATE_OFFSET)
+#define RK808_RAMP_RATE_6MV_PER_US     (2 << RK808_RAMP_RATE_OFFSET)
+#define RK808_RAMP_RATE_10MV_PER_US    (3 << RK808_RAMP_RATE_OFFSET)
+
+#define RK817_RAMP_RATE_OFFSET         6
+#define RK817_RAMP_RATE_MASK           (0x3 << RK817_RAMP_RATE_OFFSET)
+#define RK817_RAMP_RATE_3MV_PER_US     (0x0 << RK817_RAMP_RATE_OFFSET)
+#define RK817_RAMP_RATE_6_3MV_PER_US   (0x1 << RK817_RAMP_RATE_OFFSET)
+#define RK817_RAMP_RATE_12_5MV_PER_US  (0x2 << RK817_RAMP_RATE_OFFSET)
+#define RK817_RAMP_RATE_25MV_PER_US    (0x3 << RK817_RAMP_RATE_OFFSET)
 
 struct rk8xx_reg_info {
        uint min_uv;
        uint step_uv;
-       s8 vsel_reg;
+       u8 vsel_reg;
+       u8 vsel_sleep_reg;
+       u8 config_reg;
        u8 vsel_mask;
+       u8 min_sel;
 };
 
 static const struct rk8xx_reg_info rk808_buck[] = {
-       { 712500, 12500, REG_BUCK1_ON_VSEL, RK808_BUCK_VSEL_MASK, },
-       { 712500, 12500, REG_BUCK2_ON_VSEL, RK808_BUCK_VSEL_MASK, },
-       { 712500, 12500, -1, RK808_BUCK_VSEL_MASK, },
-       { 1800000, 100000, REG_BUCK4_ON_VSEL, RK808_BUCK4_VSEL_MASK, },
+       { 712500,   12500, REG_BUCK1_ON_VSEL, REG_BUCK1_SLP_VSEL, REG_BUCK1_CONFIG, RK808_BUCK_VSEL_MASK, },
+       { 712500,   12500, REG_BUCK2_ON_VSEL, REG_BUCK2_SLP_VSEL, REG_BUCK2_CONFIG, RK808_BUCK_VSEL_MASK, },
+       { 712500,   12500, NA,                NA,                 REG_BUCK3_CONFIG, RK808_BUCK_VSEL_MASK, },
+       { 1800000, 100000, REG_BUCK4_ON_VSEL, REG_BUCK4_SLP_VSEL, REG_BUCK4_CONFIG, RK808_BUCK4_VSEL_MASK, },
+};
+
+static const struct rk8xx_reg_info rk816_buck[] = {
+       /* buck 1 */
+       {  712500,  12500, REG_BUCK1_ON_VSEL, REG_BUCK1_SLP_VSEL, REG_BUCK1_CONFIG, RK818_BUCK_VSEL_MASK, 0x00, },
+       { 1800000, 200000, REG_BUCK1_ON_VSEL, REG_BUCK1_SLP_VSEL, REG_BUCK1_CONFIG, RK818_BUCK_VSEL_MASK, 0x3c, },
+       { 2300000,      0, REG_BUCK1_ON_VSEL, REG_BUCK1_SLP_VSEL, REG_BUCK1_CONFIG, RK818_BUCK_VSEL_MASK, 0x3f, },
+       /* buck 2 */
+       {  712500,  12500, REG_BUCK2_ON_VSEL, REG_BUCK2_SLP_VSEL, REG_BUCK2_CONFIG, RK818_BUCK_VSEL_MASK, 0x00, },
+       { 1800000, 200000, REG_BUCK2_ON_VSEL, REG_BUCK2_SLP_VSEL, REG_BUCK2_CONFIG, RK818_BUCK_VSEL_MASK, 0x3c, },
+       { 2300000,      0, REG_BUCK2_ON_VSEL, REG_BUCK2_SLP_VSEL, REG_BUCK2_CONFIG, RK818_BUCK_VSEL_MASK, 0x3f, },
+       /* buck 3 */
+       { 712500,   12500, NA,                NA,                 REG_BUCK3_CONFIG, RK818_BUCK_VSEL_MASK, },
+       /* buck 4 */
+       {  800000, 100000, REG_BUCK4_ON_VSEL, REG_BUCK4_SLP_VSEL, REG_BUCK4_CONFIG, RK818_BUCK4_VSEL_MASK, },
+};
+
+static const struct rk8xx_reg_info rk809_buck5[] = {
+       /* buck 5 */
+       { 1500000,      0, RK809_BUCK5_CONFIG(0), RK809_BUCK5_CONFIG(1), NA, RK809_BUCK5_VSEL_MASK, 0x00, },
+       { 1800000, 200000, RK809_BUCK5_CONFIG(0), RK809_BUCK5_CONFIG(1), NA, RK809_BUCK5_VSEL_MASK, 0x01, },
+       { 2800000, 200000, RK809_BUCK5_CONFIG(0), RK809_BUCK5_CONFIG(1), NA, RK809_BUCK5_VSEL_MASK, 0x04, },
+       { 3300000, 300000, RK809_BUCK5_CONFIG(0), RK809_BUCK5_CONFIG(1), NA, RK809_BUCK5_VSEL_MASK, 0x06, },
+};
+
+static const struct rk8xx_reg_info rk817_buck[] = {
+       /* buck 1 */
+       {  500000,  12500, RK817_BUCK_ON_VSEL(1), RK817_BUCK_SLP_VSEL(1), RK817_BUCK_CONFIG(1), RK817_BUCK_VSEL_MASK, 0x00, },
+       { 1500000, 100000, RK817_BUCK_ON_VSEL(1), RK817_BUCK_SLP_VSEL(1), RK817_BUCK_CONFIG(1), RK817_BUCK_VSEL_MASK, 0x50, },
+       { 2400000,      0, RK817_BUCK_ON_VSEL(1), RK817_BUCK_SLP_VSEL(1), RK817_BUCK_CONFIG(1), RK817_BUCK_VSEL_MASK, 0x59, },
+       /* buck 2 */
+       {  500000,  12500, RK817_BUCK_ON_VSEL(2), RK817_BUCK_SLP_VSEL(2), RK817_BUCK_CONFIG(2), RK817_BUCK_VSEL_MASK, 0x00, },
+       { 1500000, 100000, RK817_BUCK_ON_VSEL(2), RK817_BUCK_SLP_VSEL(2), RK817_BUCK_CONFIG(2), RK817_BUCK_VSEL_MASK, 0x50, },
+       { 2400000,      0, RK817_BUCK_ON_VSEL(2), RK817_BUCK_SLP_VSEL(2), RK817_BUCK_CONFIG(2), RK817_BUCK_VSEL_MASK, 0x59, },
+       /* buck 3 */
+       {  500000,  12500, RK817_BUCK_ON_VSEL(3), RK817_BUCK_SLP_VSEL(3), RK817_BUCK_CONFIG(3), RK817_BUCK_VSEL_MASK, 0x00, },
+       { 1500000, 100000, RK817_BUCK_ON_VSEL(3), RK817_BUCK_SLP_VSEL(3), RK817_BUCK_CONFIG(3), RK817_BUCK_VSEL_MASK, 0x50, },
+       { 2400000,      0, RK817_BUCK_ON_VSEL(3), RK817_BUCK_SLP_VSEL(3), RK817_BUCK_CONFIG(3), RK817_BUCK_VSEL_MASK, 0x59, },
+       /* buck 4 */
+       {  500000,  12500, RK817_BUCK_ON_VSEL(4), RK817_BUCK_SLP_VSEL(4), RK817_BUCK_CONFIG(4), RK817_BUCK_VSEL_MASK, 0x00, },
+       { 1500000, 100000, RK817_BUCK_ON_VSEL(4), RK817_BUCK_SLP_VSEL(4), RK817_BUCK_CONFIG(4), RK817_BUCK_VSEL_MASK, 0x50, },
+       { 3400000,      0, RK817_BUCK_ON_VSEL(4), RK817_BUCK_SLP_VSEL(4), RK817_BUCK_CONFIG(4), RK817_BUCK_VSEL_MASK, 0x63, },
 };
 
 static const struct rk8xx_reg_info rk818_buck[] = {
-       { 712500, 12500, REG_BUCK1_ON_VSEL, RK818_BUCK_VSEL_MASK, },
-       { 712500, 12500, REG_BUCK2_ON_VSEL, RK818_BUCK_VSEL_MASK, },
-       { 712500, 12500, -1, RK818_BUCK_VSEL_MASK, },
-       { 1800000, 100000, REG_BUCK4_ON_VSEL, RK818_BUCK4_VSEL_MASK, },
+       { 712500,   12500, REG_BUCK1_ON_VSEL, REG_BUCK1_SLP_VSEL, REG_BUCK1_CONFIG, RK818_BUCK_VSEL_MASK, },
+       { 712500,   12500, REG_BUCK2_ON_VSEL, REG_BUCK2_SLP_VSEL, REG_BUCK2_CONFIG, RK818_BUCK_VSEL_MASK, },
+       { 712500,   12500, NA,                NA,                 REG_BUCK3_CONFIG, RK818_BUCK_VSEL_MASK, },
+       { 1800000, 100000, REG_BUCK4_ON_VSEL, REG_BUCK4_SLP_VSEL, REG_BUCK4_CONFIG, RK818_BUCK4_VSEL_MASK, },
 };
 
 #ifdef ENABLE_DRIVER
 static const struct rk8xx_reg_info rk808_ldo[] = {
-       { 1800000, 100000, REG_LDO1_ON_VSEL, RK808_LDO_VSEL_MASK, },
-       { 1800000, 100000, REG_LDO2_ON_VSEL, RK808_LDO_VSEL_MASK, },
-       { 800000, 100000, REG_LDO3_ON_VSEL, RK808_BUCK4_VSEL_MASK, },
-       { 1800000, 100000, REG_LDO4_ON_VSEL, RK808_LDO_VSEL_MASK, },
-       { 1800000, 100000, REG_LDO5_ON_VSEL, RK808_LDO_VSEL_MASK, },
-       { 800000, 100000, REG_LDO6_ON_VSEL, RK808_LDO_VSEL_MASK, },
-       { 800000, 100000, REG_LDO7_ON_VSEL, RK808_LDO_VSEL_MASK, },
-       { 1800000, 100000, REG_LDO8_ON_VSEL, RK808_LDO_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO1_ON_VSEL, REG_LDO1_SLP_VSEL, NA, RK808_LDO_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO2_ON_VSEL, REG_LDO2_SLP_VSEL, NA, RK808_LDO_VSEL_MASK, },
+       {  800000, 100000, REG_LDO3_ON_VSEL, REG_LDO3_SLP_VSEL, NA, RK808_BUCK4_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO4_ON_VSEL, REG_LDO4_SLP_VSEL, NA, RK808_LDO_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO5_ON_VSEL, REG_LDO5_SLP_VSEL, NA, RK808_LDO_VSEL_MASK, },
+       {  800000, 100000, REG_LDO6_ON_VSEL, REG_LDO6_SLP_VSEL, NA, RK808_LDO_VSEL_MASK, },
+       {  800000, 100000, REG_LDO7_ON_VSEL, REG_LDO7_SLP_VSEL, NA, RK808_LDO_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO8_ON_VSEL, REG_LDO8_SLP_VSEL, NA, RK808_LDO_VSEL_MASK, },
+};
+
+static const struct rk8xx_reg_info rk816_ldo[] = {
+       { 800000, 100000, REG_LDO1_ON_VSEL, REG_LDO1_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       { 800000, 100000, REG_LDO2_ON_VSEL, REG_LDO2_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       { 800000, 100000, REG_LDO3_ON_VSEL, REG_LDO3_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       { 800000, 100000, REG_LDO4_ON_VSEL, REG_LDO4_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       { 800000, 100000, REG_LDO5_ON_VSEL, REG_LDO5_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       { 800000, 100000, REG_LDO6_ON_VSEL, REG_LDO6_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+};
+
+static const struct rk8xx_reg_info rk817_ldo[] = {
+       /* ldo1 */
+       {  600000, 25000, RK817_LDO_ON_VSEL(1), RK817_LDO_SLP_VSEL(1), NA, RK817_LDO_VSEL_MASK, 0x00, },
+       { 3400000,     0, RK817_LDO_ON_VSEL(1), RK817_LDO_SLP_VSEL(1), NA, RK817_LDO_VSEL_MASK, 0x70, },
+       /* ldo2 */
+       {  600000, 25000, RK817_LDO_ON_VSEL(2), RK817_LDO_SLP_VSEL(2), NA, RK817_LDO_VSEL_MASK, 0x00, },
+       { 3400000,     0, RK817_LDO_ON_VSEL(2), RK817_LDO_SLP_VSEL(2), NA, RK817_LDO_VSEL_MASK, 0x70, },
+       /* ldo3 */
+       {  600000, 25000, RK817_LDO_ON_VSEL(3), RK817_LDO_SLP_VSEL(3), NA, RK817_LDO_VSEL_MASK, 0x00, },
+       { 3400000,     0, RK817_LDO_ON_VSEL(3), RK817_LDO_SLP_VSEL(3), NA, RK817_LDO_VSEL_MASK, 0x70, },
+       /* ldo4 */
+       {  600000, 25000, RK817_LDO_ON_VSEL(4), RK817_LDO_SLP_VSEL(4), NA, RK817_LDO_VSEL_MASK, 0x00, },
+       { 3400000,     0, RK817_LDO_ON_VSEL(4), RK817_LDO_SLP_VSEL(4), NA, RK817_LDO_VSEL_MASK, 0x70, },
+       /* ldo5 */
+       {  600000, 25000, RK817_LDO_ON_VSEL(5), RK817_LDO_SLP_VSEL(5), NA, RK817_LDO_VSEL_MASK, 0x00, },
+       { 3400000,     0, RK817_LDO_ON_VSEL(5), RK817_LDO_SLP_VSEL(5), NA, RK817_LDO_VSEL_MASK, 0x70, },
+       /* ldo6 */
+       {  600000, 25000, RK817_LDO_ON_VSEL(6), RK817_LDO_SLP_VSEL(6), NA, RK817_LDO_VSEL_MASK, 0x00, },
+       { 3400000,     0, RK817_LDO_ON_VSEL(6), RK817_LDO_SLP_VSEL(6), NA, RK817_LDO_VSEL_MASK, 0x70, },
+       /* ldo7 */
+       {  600000, 25000, RK817_LDO_ON_VSEL(7), RK817_LDO_SLP_VSEL(7), NA, RK817_LDO_VSEL_MASK, 0x00, },
+       { 3400000,     0, RK817_LDO_ON_VSEL(7), RK817_LDO_SLP_VSEL(7), NA, RK817_LDO_VSEL_MASK, 0x70, },
+       /* ldo8 */
+       {  600000, 25000, RK817_LDO_ON_VSEL(8), RK817_LDO_SLP_VSEL(8), NA, RK817_LDO_VSEL_MASK, 0x00, },
+       { 3400000,     0, RK817_LDO_ON_VSEL(8), RK817_LDO_SLP_VSEL(8), NA, RK817_LDO_VSEL_MASK, 0x70, },
+       /* ldo9 */
+       {  600000, 25000, RK817_LDO_ON_VSEL(9), RK817_LDO_SLP_VSEL(9), NA, RK817_LDO_VSEL_MASK, 0x00, },
+       { 3400000,     0, RK817_LDO_ON_VSEL(9), RK817_LDO_SLP_VSEL(9), NA, RK817_LDO_VSEL_MASK, 0x70, },
 };
 
 static const struct rk8xx_reg_info rk818_ldo[] = {
-       { 1800000, 100000, REG_LDO1_ON_VSEL, RK818_LDO_VSEL_MASK, },
-       { 1800000, 100000, REG_LDO2_ON_VSEL, RK818_LDO_VSEL_MASK, },
-       { 800000, 100000, REG_LDO3_ON_VSEL, RK818_LDO3_ON_VSEL_MASK, },
-       { 1800000, 100000, REG_LDO4_ON_VSEL, RK818_LDO_VSEL_MASK, },
-       { 1800000, 100000, REG_LDO5_ON_VSEL, RK818_LDO_VSEL_MASK, },
-       { 800000, 100000, REG_LDO6_ON_VSEL, RK818_LDO_VSEL_MASK, },
-       { 800000, 100000, REG_LDO7_ON_VSEL, RK818_LDO_VSEL_MASK, },
-       { 1800000, 100000, REG_LDO8_ON_VSEL, RK818_LDO_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO1_ON_VSEL, REG_LDO1_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO2_ON_VSEL, REG_LDO2_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       {  800000, 100000, REG_LDO3_ON_VSEL, REG_LDO3_SLP_VSEL, NA, RK818_LDO3_ON_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO4_ON_VSEL, REG_LDO4_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO5_ON_VSEL, REG_LDO5_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       {  800000, 100000, REG_LDO6_ON_VSEL, REG_LDO6_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       {  800000, 100000, REG_LDO7_ON_VSEL, REG_LDO7_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
+       { 1800000, 100000, REG_LDO8_ON_VSEL, REG_LDO8_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, },
 };
 #endif
 
@@ -87,10 +216,54 @@ static const uint rk818_chrg_shutdown_vsel_array[] = {
 };
 
 static const struct rk8xx_reg_info *get_buck_reg(struct udevice *pmic,
-                                            int num)
+                                                int num, int uvolt)
 {
        struct rk8xx_priv *priv = dev_get_priv(pmic);
+
        switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               switch (num) {
+               case 0:
+               case 1:
+                       if (uvolt <= 1450000)
+                               return &rk816_buck[num * 3 + 0];
+                       else if (uvolt <= 2200000)
+                               return &rk816_buck[num * 3 + 1];
+                       else
+                               return &rk816_buck[num * 3 + 2];
+               default:
+                       return &rk816_buck[num + 4];
+               }
+
+       case RK809_ID:
+       case RK817_ID:
+               switch (num) {
+               case 0 ... 2:
+                       if (uvolt < 1500000)
+                               return &rk817_buck[num * 3 + 0];
+                       else if (uvolt < 2400000)
+                               return &rk817_buck[num * 3 + 1];
+                       else
+                               return &rk817_buck[num * 3 + 2];
+               case 3:
+                       if (uvolt < 1500000)
+                               return &rk817_buck[num * 3 + 0];
+                       else if (uvolt < 3400000)
+                               return &rk817_buck[num * 3 + 1];
+                       else
+                               return &rk817_buck[num * 3 + 2];
+               /* BUCK5 for RK809 */
+               default:
+                       if (uvolt < 1800000)
+                               return &rk809_buck5[0];
+                       else if (uvolt < 2800000)
+                               return &rk809_buck5[1];
+                       else if (uvolt < 3300000)
+                               return &rk809_buck5[2];
+                       else
+                               return &rk809_buck5[3];
+               }
        case RK818_ID:
                return &rk818_buck[num];
        default:
@@ -100,44 +273,245 @@ static const struct rk8xx_reg_info *get_buck_reg(struct udevice *pmic,
 
 static int _buck_set_value(struct udevice *pmic, int buck, int uvolt)
 {
-       const struct rk8xx_reg_info *info = get_buck_reg(pmic, buck - 1);
+       const struct rk8xx_reg_info *info = get_buck_reg(pmic, buck, uvolt);
+       struct rk8xx_priv *priv = dev_get_priv(pmic);
        int mask = info->vsel_mask;
        int val;
 
-       if (info->vsel_reg == -1)
+       if (info->vsel_reg == NA)
                return -ENOSYS;
-       val = (uvolt - info->min_uv) / info->step_uv;
-       debug("%s: reg=%x, mask=%x, val=%x\n", __func__, info->vsel_reg, mask,
-             val);
 
-       return pmic_clrsetbits(pmic, info->vsel_reg, mask, val);
+       if (info->step_uv == 0) /* Fixed voltage */
+               val = info->min_sel;
+       else
+               val = ((uvolt - info->min_uv) / info->step_uv) + info->min_sel;
+
+       debug("%s: volt=%d, buck=%d, reg=0x%x, mask=0x%x, val=0x%x\n",
+             __func__, uvolt, buck + 1, info->vsel_reg, mask, val);
+
+       if (priv->variant == RK816_ID) {
+               pmic_clrsetbits(pmic, info->vsel_reg, mask, val);
+               return pmic_clrsetbits(pmic, RK816_REG_DCDC_EN2,
+                                      1 << 7, 1 << 7);
+       } else {
+               return pmic_clrsetbits(pmic, info->vsel_reg, mask, val);
+       }
 }
 
 static int _buck_set_enable(struct udevice *pmic, int buck, bool enable)
 {
-       uint mask;
-       int ret;
+       uint mask, value, en_reg;
+       int ret = 0;
+       struct rk8xx_priv *priv = dev_get_priv(pmic);
 
-       buck--;
-       mask = 1 << buck;
-       if (enable) {
-               ret = pmic_clrsetbits(pmic, REG_DCDC_ILMAX, 0, 3 << (buck * 2));
-               if (ret)
-                       return ret;
-               ret = pmic_clrsetbits(pmic, REG_DCDC_UV_ACT, 1 << buck, 0);
-               if (ret)
-                       return ret;
+       switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               if (buck >= 4) {
+                       buck -= 4;
+                       en_reg = RK816_REG_DCDC_EN2;
+               } else {
+                       en_reg = RK816_REG_DCDC_EN1;
+               }
+               if (enable)
+                       value = ((1 << buck) | (1 << (buck + 4)));
+               else
+                       value = ((0 << buck) | (1 << (buck + 4)));
+               ret = pmic_reg_write(pmic, en_reg, value);
+               break;
+
+       case RK808_ID:
+       case RK818_ID:
+               mask = 1 << buck;
+               if (enable) {
+                       ret = pmic_clrsetbits(pmic, REG_DCDC_ILMAX,
+                                             0, 3 << (buck * 2));
+                       if (ret)
+                               return ret;
+               }
+               ret = pmic_clrsetbits(pmic, REG_DCDC_EN, mask,
+                                     enable ? mask : 0);
+               break;
+       case RK809_ID:
+       case RK817_ID:
+               if (buck < 4) {
+                       if (enable)
+                               value = ((1 << buck) | (1 << (buck + 4)));
+                       else
+                               value = ((0 << buck) | (1 << (buck + 4)));
+                       ret = pmic_reg_write(pmic, RK817_POWER_EN(0), value);
+               /* BUCK5 for RK809 */
+               } else {
+                       if (enable)
+                               value = ((1 << 1) | (1 << 5));
+                       else
+                               value = ((0 << 1) | (1 << 5));
+                       ret = pmic_reg_write(pmic, RK817_POWER_EN(3), value);
+               }
+               break;
+       default:
+               ret = -EINVAL;
        }
 
-       return pmic_clrsetbits(pmic, REG_DCDC_EN, mask, enable ? mask : 0);
+       return ret;
 }
 
 #ifdef ENABLE_DRIVER
+static int _buck_set_suspend_value(struct udevice *pmic, int buck, int uvolt)
+{
+       const struct rk8xx_reg_info *info = get_buck_reg(pmic, buck, uvolt);
+       int mask = info->vsel_mask;
+       int val;
+
+       if (info->vsel_sleep_reg == NA)
+               return -ENOSYS;
+
+       if (info->step_uv == 0)
+               val = info->min_sel;
+       else
+               val = ((uvolt - info->min_uv) / info->step_uv) + info->min_sel;
+
+       debug("%s: volt=%d, buck=%d, reg=0x%x, mask=0x%x, val=0x%x\n",
+             __func__, uvolt, buck + 1, info->vsel_sleep_reg, mask, val);
+
+       return pmic_clrsetbits(pmic, info->vsel_sleep_reg, mask, val);
+}
+
+static int _buck_get_enable(struct udevice *pmic, int buck)
+{
+       struct rk8xx_priv *priv = dev_get_priv(pmic);
+       uint mask = 0;
+       int ret = 0;
+
+       switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               if (buck >= 4) {
+                       mask = 1 << (buck - 4);
+                       ret = pmic_reg_read(pmic, RK816_REG_DCDC_EN2);
+               } else {
+                       mask = 1 << buck;
+                       ret = pmic_reg_read(pmic, RK816_REG_DCDC_EN1);
+               }
+               break;
+       case RK808_ID:
+       case RK818_ID:
+               mask = 1 << buck;
+               ret = pmic_reg_read(pmic, REG_DCDC_EN);
+               if (ret < 0)
+                       return ret;
+               break;
+       case RK809_ID:
+       case RK817_ID:
+               if (buck < 4) {
+                       mask = 1 << buck;
+                       ret = pmic_reg_read(pmic, RK817_POWER_EN(0));
+               /* BUCK5 for RK809 */
+               } else {
+                       mask = 1 << 1;
+                       ret = pmic_reg_read(pmic, RK817_POWER_EN(3));
+               }
+               break;
+       }
+
+       if (ret < 0)
+               return ret;
+
+       return ret & mask ? true : false;
+}
+
+static int _buck_set_suspend_enable(struct udevice *pmic, int buck, bool enable)
+{
+       uint mask = 0;
+       int ret;
+       struct rk8xx_priv *priv = dev_get_priv(pmic);
+
+       switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               mask = 1 << buck;
+               ret = pmic_clrsetbits(pmic, RK816_REG_DCDC_SLP_EN, mask,
+                                     enable ? mask : 0);
+               break;
+       case RK808_ID:
+       case RK818_ID:
+               mask = 1 << buck;
+               ret = pmic_clrsetbits(pmic, REG_SLEEP_SET_OFF1, mask,
+                                     enable ? 0 : mask);
+               break;
+       case RK809_ID:
+       case RK817_ID:
+               if (buck < 4)
+                       mask = 1 << buck;
+               else
+                       mask = 1 << 5;  /* BUCK5 for RK809 */
+               ret = pmic_clrsetbits(pmic, RK817_POWER_SLP_EN(0), mask,
+                                     enable ? mask : 0);
+               break;
+       default:
+               ret = -EINVAL;
+       }
+
+       return ret;
+}
+
+static int _buck_get_suspend_enable(struct udevice *pmic, int buck)
+{
+       struct rk8xx_priv *priv = dev_get_priv(pmic);
+       int ret, val;
+       uint mask = 0;
+
+       switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               mask = 1 << buck;
+               val = pmic_reg_read(pmic, RK816_REG_DCDC_SLP_EN);
+               if (val < 0)
+                       return val;
+               ret = val & mask ? 1 : 0;
+               break;
+       case RK808_ID:
+       case RK818_ID:
+               mask = 1 << buck;
+               val = pmic_reg_read(pmic, REG_SLEEP_SET_OFF1);
+               if (val < 0)
+                       return val;
+               ret = val & mask ? 0 : 1;
+               break;
+       case RK809_ID:
+       case RK817_ID:
+               if (buck < 4)
+                       mask = 1 << buck;
+               else
+                       mask = 1 << 5;  /* BUCK5 for RK809 */
+
+               val = pmic_reg_read(pmic, RK817_POWER_SLP_EN(0));
+               if (val < 0)
+                       return val;
+               ret = val & mask ? 1 : 0;
+               break;
+       default:
+               ret = -EINVAL;
+       }
+
+       return ret;
+}
+
 static const struct rk8xx_reg_info *get_ldo_reg(struct udevice *pmic,
-                                            int num)
+                                               int num, int uvolt)
 {
        struct rk8xx_priv *priv = dev_get_priv(pmic);
+
        switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               return &rk816_ldo[num];
+       case RK809_ID:
+       case RK817_ID:
+               if (uvolt < 3400000)
+                       return &rk817_ldo[num * 2 + 0];
+               else
+                       return &rk817_ldo[num * 2 + 1];
        case RK818_ID:
                return &rk818_ldo[num];
        default:
@@ -145,15 +519,196 @@ static const struct rk8xx_reg_info *get_ldo_reg(struct udevice *pmic,
        }
 }
 
+static int _ldo_get_enable(struct udevice *pmic, int ldo)
+{
+       struct rk8xx_priv *priv = dev_get_priv(pmic);
+       uint mask = 0;
+       int ret = 0;
+
+       switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               if (ldo >= 4) {
+                       mask = 1 << (ldo - 4);
+                       ret = pmic_reg_read(pmic, RK816_REG_LDO_EN2);
+               } else {
+                       mask = 1 << ldo;
+                       ret = pmic_reg_read(pmic, RK816_REG_LDO_EN1);
+               }
+               break;
+       case RK808_ID:
+       case RK818_ID:
+               mask = 1 << ldo;
+               ret = pmic_reg_read(pmic, REG_LDO_EN);
+               if (ret < 0)
+                       return ret;
+               break;
+       case RK809_ID:
+       case RK817_ID:
+               if (ldo < 4) {
+                       mask = 1 << ldo;
+                       ret = pmic_reg_read(pmic, RK817_POWER_EN(1));
+               } else if (ldo < 8) {
+                       mask = 1 << (ldo - 4);
+                       ret = pmic_reg_read(pmic, RK817_POWER_EN(2));
+               } else if (ldo == 8) {
+                       mask = 1 << 0;
+                       ret = pmic_reg_read(pmic, RK817_POWER_EN(3));
+               } else {
+                       return false;
+               }
+               break;
+       }
+
+       if (ret < 0)
+               return ret;
+
+       return ret & mask ? true : false;
+}
+
+static int _ldo_set_enable(struct udevice *pmic, int ldo, bool enable)
+{
+       struct rk8xx_priv *priv = dev_get_priv(pmic);
+       uint mask, value, en_reg;
+       int ret = 0;
+
+       switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               if (ldo >= 4) {
+                       ldo -= 4;
+                       en_reg = RK816_REG_LDO_EN2;
+               } else {
+                       en_reg = RK816_REG_LDO_EN1;
+               }
+               if (enable)
+                       value = ((1 << ldo) | (1 << (ldo + 4)));
+               else
+                       value = ((0 << ldo) | (1 << (ldo + 4)));
+
+               ret = pmic_reg_write(pmic, en_reg, value);
+               break;
+       case RK808_ID:
+       case RK818_ID:
+               mask = 1 << ldo;
+               ret = pmic_clrsetbits(pmic, REG_LDO_EN, mask,
+                                      enable ? mask : 0);
+               break;
+       case RK809_ID:
+       case RK817_ID:
+               if (ldo < 4) {
+                       en_reg = RK817_POWER_EN(1);
+               } else if (ldo < 8) {
+                       ldo -= 4;
+                       en_reg = RK817_POWER_EN(2);
+               } else if (ldo == 8) {
+                       ldo = 0;        /* BIT 0 */
+                       en_reg = RK817_POWER_EN(3);
+               } else {
+                       return -EINVAL;
+               }
+               if (enable)
+                       value = ((1 << ldo) | (1 << (ldo + 4)));
+               else
+                       value = ((0 << ldo) | (1 << (ldo + 4)));
+               ret = pmic_reg_write(pmic, en_reg, value);
+               break;
+       }
+
+       return ret;
+}
+
+static int _ldo_set_suspend_enable(struct udevice *pmic, int ldo, bool enable)
+{
+       struct rk8xx_priv *priv = dev_get_priv(pmic);
+       uint mask;
+       int ret = 0;
+
+       switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               mask = 1 << ldo;
+               ret = pmic_clrsetbits(pmic, RK816_REG_LDO_SLP_EN, mask,
+                                     enable ? mask : 0);
+               break;
+       case RK808_ID:
+       case RK818_ID:
+               mask = 1 << ldo;
+               ret = pmic_clrsetbits(pmic, REG_SLEEP_SET_OFF2, mask,
+                                     enable ? 0 : mask);
+               break;
+       case RK809_ID:
+       case RK817_ID:
+               if (ldo == 8) {
+                       mask = 1 << 4;  /* LDO9 */
+                       ret = pmic_clrsetbits(pmic, RK817_POWER_SLP_EN(0), mask,
+                                             enable ? mask : 0);
+               } else {
+                       mask = 1 << ldo;
+                       ret = pmic_clrsetbits(pmic, RK817_POWER_SLP_EN(1), mask,
+                                             enable ? mask : 0);
+               }
+               break;
+       }
+
+       return ret;
+}
+
+static int _ldo_get_suspend_enable(struct udevice *pmic, int ldo)
+{
+       struct rk8xx_priv *priv = dev_get_priv(pmic);
+       int val, ret = 0;
+       uint mask;
+
+       switch (priv->variant) {
+       case RK805_ID:
+       case RK816_ID:
+               mask = 1 << ldo;
+               val = pmic_reg_read(pmic, RK816_REG_LDO_SLP_EN);
+               if (val < 0)
+                       return val;
+               ret = val & mask ? 1 : 0;
+               break;
+       case RK808_ID:
+       case RK818_ID:
+               mask = 1 << ldo;
+               val = pmic_reg_read(pmic, REG_SLEEP_SET_OFF2);
+               if (val < 0)
+                       return val;
+               ret = val & mask ? 0 : 1;
+               break;
+       case RK809_ID:
+       case RK817_ID:
+               if (ldo == 8) {
+                       mask = 1 << 4;  /* LDO9 */
+                       val = pmic_reg_read(pmic, RK817_POWER_SLP_EN(0));
+                       if (val < 0)
+                               return val;
+                       ret = val & mask ? 1 : 0;
+               } else {
+                       mask = 1 << ldo;
+                       val = pmic_reg_read(pmic, RK817_POWER_SLP_EN(1));
+                       if (val < 0)
+                               return val;
+                       ret = val & mask ? 1 : 0;
+               }
+               break;
+       }
+
+       return ret;
+}
+
 static int buck_get_value(struct udevice *dev)
 {
        int buck = dev->driver_data - 1;
-       const struct rk8xx_reg_info *info = get_buck_reg(dev->parent, buck);
+       /* We assume level-1 voltage is enough for usage in U-Boot */
+       const struct rk8xx_reg_info *info = get_buck_reg(dev->parent, buck, 0);
        int mask = info->vsel_mask;
        int ret, val;
 
-       if (info->vsel_reg == -1)
+       if (info->vsel_reg == NA)
                return -ENOSYS;
+
        ret = pmic_reg_read(dev->parent, info->vsel_reg);
        if (ret < 0)
                return ret;
@@ -164,41 +719,74 @@ static int buck_get_value(struct udevice *dev)
 
 static int buck_set_value(struct udevice *dev, int uvolt)
 {
-       int buck = dev->driver_data;
+       int buck = dev->driver_data - 1;
 
        return _buck_set_value(dev->parent, buck, uvolt);
 }
 
+static int buck_get_suspend_value(struct udevice *dev)
+{
+       int buck = dev->driver_data - 1;
+       /* We assume level-1 voltage is enough for usage in U-Boot */
+       const struct rk8xx_reg_info *info = get_buck_reg(dev->parent, buck, 0);
+       int mask = info->vsel_mask;
+       int ret, val;
+
+       if (info->vsel_sleep_reg == NA)
+               return -ENOSYS;
+
+       ret = pmic_reg_read(dev->parent, info->vsel_sleep_reg);
+       if (ret < 0)
+               return ret;
+
+       val = ret & mask;
+
+       return info->min_uv + val * info->step_uv;
+}
+
+static int buck_set_suspend_value(struct udevice *dev, int uvolt)
+{
+       int buck = dev->driver_data - 1;
+
+       return _buck_set_suspend_value(dev->parent, buck, uvolt);
+}
+
 static int buck_set_enable(struct udevice *dev, bool enable)
 {
-       int buck = dev->driver_data;
+       int buck = dev->driver_data - 1;
 
        return _buck_set_enable(dev->parent, buck, enable);
 }
 
-static int buck_get_enable(struct udevice *dev)
+static int buck_set_suspend_enable(struct udevice *dev, bool enable)
 {
        int buck = dev->driver_data - 1;
-       int ret;
-       uint mask;
 
-       mask = 1 << buck;
+       return _buck_set_suspend_enable(dev->parent, buck, enable);
+}
 
-       ret = pmic_reg_read(dev->parent, REG_DCDC_EN);
-       if (ret < 0)
-               return ret;
+static int buck_get_suspend_enable(struct udevice *dev)
+{
+       int buck = dev->driver_data - 1;
 
-       return ret & mask ? true : false;
+       return _buck_get_suspend_enable(dev->parent, buck);
+}
+
+static int buck_get_enable(struct udevice *dev)
+{
+       int buck = dev->driver_data - 1;
+
+       return _buck_get_enable(dev->parent, buck);
 }
 
 static int ldo_get_value(struct udevice *dev)
 {
        int ldo = dev->driver_data - 1;
-       const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo);
+       const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, 0);
        int mask = info->vsel_mask;
        int ret, val;
 
-       if (info->vsel_reg == -1)
+       if (info->vsel_reg == NA)
                return -ENOSYS;
        ret = pmic_reg_read(dev->parent, info->vsel_reg);
        if (ret < 0)
@@ -211,71 +799,238 @@ static int ldo_get_value(struct udevice *dev)
 static int ldo_set_value(struct udevice *dev, int uvolt)
 {
        int ldo = dev->driver_data - 1;
-       const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo);
+       const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, uvolt);
        int mask = info->vsel_mask;
        int val;
 
-       if (info->vsel_reg == -1)
+       if (info->vsel_reg == NA)
                return -ENOSYS;
-       val = (uvolt - info->min_uv) / info->step_uv;
-       debug("%s: reg=%x, mask=%x, val=%x\n", __func__, info->vsel_reg, mask,
-             val);
+
+       if (info->step_uv == 0)
+               val = info->min_sel;
+       else
+               val = ((uvolt - info->min_uv) / info->step_uv) + info->min_sel;
+
+       debug("%s: volt=%d, ldo=%d, reg=0x%x, mask=0x%x, val=0x%x\n",
+             __func__, uvolt, ldo + 1, info->vsel_reg, mask, val);
 
        return pmic_clrsetbits(dev->parent, info->vsel_reg, mask, val);
 }
 
-static int ldo_set_enable(struct udevice *dev, bool enable)
+static int ldo_set_suspend_value(struct udevice *dev, int uvolt)
 {
        int ldo = dev->driver_data - 1;
-       uint mask;
+       const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, uvolt);
+       int mask = info->vsel_mask;
+       int val;
 
-       mask = 1 << ldo;
+       if (info->vsel_sleep_reg == NA)
+               return -ENOSYS;
 
-       return pmic_clrsetbits(dev->parent, REG_LDO_EN, mask,
-                              enable ? mask : 0);
+       if (info->step_uv == 0)
+               val = info->min_sel;
+       else
+               val = ((uvolt - info->min_uv) / info->step_uv) + info->min_sel;
+
+       debug("%s: volt=%d, ldo=%d, reg=0x%x, mask=0x%x, val=0x%x\n",
+             __func__, uvolt, ldo + 1, info->vsel_sleep_reg, mask, val);
+
+       return pmic_clrsetbits(dev->parent, info->vsel_sleep_reg, mask, val);
 }
 
-static int ldo_get_enable(struct udevice *dev)
+static int ldo_get_suspend_value(struct udevice *dev)
 {
        int ldo = dev->driver_data - 1;
-       int ret;
-       uint mask;
+       const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, 0);
+       int mask = info->vsel_mask;
+       int val, ret;
 
-       mask = 1 << ldo;
+       if (info->vsel_sleep_reg == NA)
+               return -ENOSYS;
 
-       ret = pmic_reg_read(dev->parent, REG_LDO_EN);
+       ret = pmic_reg_read(dev->parent, info->vsel_sleep_reg);
        if (ret < 0)
                return ret;
 
-       return ret & mask ? true : false;
+       val = ret & mask;
+
+       return info->min_uv + val * info->step_uv;
+}
+
+static int ldo_set_enable(struct udevice *dev, bool enable)
+{
+       int ldo = dev->driver_data - 1;
+
+       return _ldo_set_enable(dev->parent, ldo, enable);
+}
+
+static int ldo_set_suspend_enable(struct udevice *dev, bool enable)
+{
+       int ldo = dev->driver_data - 1;
+
+       return _ldo_set_suspend_enable(dev->parent, ldo, enable);
+}
+
+static int ldo_get_suspend_enable(struct udevice *dev)
+{
+       int ldo = dev->driver_data - 1;
+
+       return _ldo_get_suspend_enable(dev->parent, ldo);
+}
+
+static int ldo_get_enable(struct udevice *dev)
+{
+       int ldo = dev->driver_data - 1;
+
+       return _ldo_get_enable(dev->parent, ldo);
 }
 
 static int switch_set_enable(struct udevice *dev, bool enable)
 {
-       int sw = dev->driver_data - 1;
-       uint mask;
+       struct rk8xx_priv *priv = dev_get_priv(dev->parent);
+       int ret = 0, sw = dev->driver_data - 1;
+       uint mask = 0;
+
+       switch (priv->variant) {
+       case RK808_ID:
+               mask = 1 << (sw + 5);
+               ret = pmic_clrsetbits(dev->parent, REG_DCDC_EN, mask,
+                                     enable ? mask : 0);
+               break;
+       case RK809_ID:
+               mask = (1 << (sw + 2)) | (1 << (sw + 6));
+               ret = pmic_clrsetbits(dev->parent, RK817_POWER_EN(3), mask,
+                                     enable ? mask : 0);
+               break;
+       case RK818_ID:
+               mask = 1 << 6;
+               ret = pmic_clrsetbits(dev->parent, REG_DCDC_EN, mask,
+                                     enable ? mask : 0);
+               break;
+       }
 
-       mask = 1 << (sw + 5);
+       debug("%s: switch%d, enable=%d, mask=0x%x\n",
+             __func__, sw + 1, enable, mask);
 
-       return pmic_clrsetbits(dev->parent, REG_DCDC_EN, mask,
-                              enable ? mask : 0);
+       return ret;
 }
 
 static int switch_get_enable(struct udevice *dev)
 {
-       int sw = dev->driver_data - 1;
-       int ret;
-       uint mask;
+       struct rk8xx_priv *priv = dev_get_priv(dev->parent);
+       int ret = 0, sw = dev->driver_data - 1;
+       uint mask = 0;
 
-       mask = 1 << (sw + 5);
+       switch (priv->variant) {
+       case RK808_ID:
+               mask = 1 << (sw + 5);
+               ret = pmic_reg_read(dev->parent, REG_DCDC_EN);
+               break;
+       case RK809_ID:
+               mask = 1 << (sw + 2);
+               ret = pmic_reg_read(dev->parent, RK817_POWER_EN(3));
+               break;
+       case RK818_ID:
+               mask = 1 << 6;
+               ret = pmic_reg_read(dev->parent, REG_DCDC_EN);
+               break;
+       }
 
-       ret = pmic_reg_read(dev->parent, REG_DCDC_EN);
        if (ret < 0)
                return ret;
 
        return ret & mask ? true : false;
 }
 
+static int switch_set_suspend_value(struct udevice *dev, int uvolt)
+{
+       return 0;
+}
+
+static int switch_get_suspend_value(struct udevice *dev)
+{
+       return 0;
+}
+
+static int switch_set_suspend_enable(struct udevice *dev, bool enable)
+{
+       struct rk8xx_priv *priv = dev_get_priv(dev->parent);
+       int ret = 0, sw = dev->driver_data - 1;
+       uint mask = 0;
+
+       switch (priv->variant) {
+       case RK808_ID:
+               mask = 1 << (sw + 5);
+               ret = pmic_clrsetbits(dev->parent, REG_SLEEP_SET_OFF1, mask,
+                                     enable ? 0 : mask);
+               break;
+       case RK809_ID:
+               mask = 1 << (sw + 6);
+               ret = pmic_clrsetbits(dev->parent, RK817_POWER_SLP_EN(0), mask,
+                                     enable ? mask : 0);
+               break;
+       case RK818_ID:
+               mask = 1 << 6;
+               ret = pmic_clrsetbits(dev->parent, REG_SLEEP_SET_OFF1, mask,
+                                     enable ? 0 : mask);
+               break;
+       }
+
+       debug("%s: switch%d, enable=%d, mask=0x%x\n",
+             __func__, sw + 1, enable, mask);
+
+       return ret;
+}
+
+static int switch_get_suspend_enable(struct udevice *dev)
+{
+       struct rk8xx_priv *priv = dev_get_priv(dev->parent);
+       int val, ret = 0, sw = dev->driver_data - 1;
+       uint mask = 0;
+
+       switch (priv->variant) {
+       case RK808_ID:
+               mask = 1 << (sw + 5);
+               val = pmic_reg_read(dev->parent, REG_SLEEP_SET_OFF1);
+               if (val < 0)
+                       return val;
+               ret = val & mask ? 0 : 1;
+               break;
+       case RK809_ID:
+               mask = 1 << (sw + 6);
+               val = pmic_reg_read(dev->parent, RK817_POWER_SLP_EN(0));
+               if (val < 0)
+                       return val;
+               ret = val & mask ? 1 : 0;
+               break;
+       case RK818_ID:
+               mask = 1 << 6;
+               val = pmic_reg_read(dev->parent, REG_SLEEP_SET_OFF1);
+               if (val < 0)
+                       return val;
+               ret = val & mask ? 0 : 1;
+               break;
+       }
+
+       return ret;
+}
+
+/*
+ * RK8xx switch does not need to set the voltage,
+ * but if dts set regulator-min-microvolt/regulator-max-microvolt,
+ * will cause regulator set value fail and not to enable this switch.
+ * So add an empty function to return success.
+ */
+static int switch_get_value(struct udevice *dev)
+{
+       return 0;
+}
+
+static int switch_set_value(struct udevice *dev, int uvolt)
+{
+       return 0;
+}
+
 static int rk8xx_buck_probe(struct udevice *dev)
 {
        struct dm_regulator_uclass_platdata *uc_pdata;
@@ -315,20 +1070,34 @@ static int rk8xx_switch_probe(struct udevice *dev)
 static const struct dm_regulator_ops rk8xx_buck_ops = {
        .get_value  = buck_get_value,
        .set_value  = buck_set_value,
+       .set_suspend_value = buck_set_suspend_value,
+       .get_suspend_value = buck_get_suspend_value,
        .get_enable = buck_get_enable,
        .set_enable = buck_set_enable,
+       .set_suspend_enable = buck_set_suspend_enable,
+       .get_suspend_enable = buck_get_suspend_enable,
 };
 
 static const struct dm_regulator_ops rk8xx_ldo_ops = {
        .get_value  = ldo_get_value,
        .set_value  = ldo_set_value,
+       .set_suspend_value = ldo_set_suspend_value,
+       .get_suspend_value = ldo_get_suspend_value,
        .get_enable = ldo_get_enable,
        .set_enable = ldo_set_enable,
+       .set_suspend_enable = ldo_set_suspend_enable,
+       .get_suspend_enable = ldo_get_suspend_enable,
 };
 
 static const struct dm_regulator_ops rk8xx_switch_ops = {
+       .get_value  = switch_get_value,
+       .set_value  = switch_set_value,
        .get_enable = switch_get_enable,
        .set_enable = switch_set_enable,
+       .set_suspend_enable = switch_set_suspend_enable,
+       .get_suspend_enable = switch_get_suspend_enable,
+       .set_suspend_value = switch_set_suspend_value,
+       .get_suspend_value = switch_get_suspend_value,
 };
 
 U_BOOT_DRIVER(rk8xx_buck) = {
diff --git a/drivers/power/regulator/tps62360_regulator.c b/drivers/power/regulator/tps62360_regulator.c
new file mode 100644 (file)
index 0000000..3b123f5
--- /dev/null
@@ -0,0 +1,123 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
+ *      Tero Kristo <t-kristo@ti.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <i2c.h>
+#include <power/regulator.h>
+
+#define TPS62360_REG_SET0      0
+
+#define TPS62360_I2C_CHIP      0x60
+
+#define TPS62360_VSEL_STEPSIZE 10000 /* In uV */
+
+struct tps62360_regulator_config {
+       u32 vmin;
+       u32 vmax;
+};
+
+struct tps62360_regulator_pdata {
+       u8 vsel_offset;
+       struct udevice *i2c;
+       struct tps62360_regulator_config *config;
+};
+
+/*
+ * TPS62362/TPS62363 are just re-using these values for now, their preset
+ * voltage values are just different compared to TPS62360/TPS62361.
+ */
+static struct tps62360_regulator_config tps62360_data = {
+       .vmin = 770000,
+       .vmax = 1400000,
+};
+
+static struct tps62360_regulator_config tps62361_data = {
+       .vmin = 500000,
+       .vmax = 1770000,
+};
+
+static int tps62360_regulator_set_value(struct udevice *dev, int uV)
+{
+       struct tps62360_regulator_pdata *pdata = dev_get_platdata(dev);
+       u8 regval;
+
+       if (uV < pdata->config->vmin || uV > pdata->config->vmax)
+               return -EINVAL;
+
+       uV -= pdata->config->vmin;
+
+       uV = DIV_ROUND_UP(uV, TPS62360_VSEL_STEPSIZE);
+
+       if (uV > U8_MAX)
+               return -EINVAL;
+
+       regval = (u8)uV;
+
+       return dm_i2c_write(pdata->i2c, TPS62360_REG_SET0 + pdata->vsel_offset,
+                           &regval, 1);
+}
+
+static int tps62360_regulator_get_value(struct udevice *dev)
+{
+       u8 regval;
+       int ret;
+       struct tps62360_regulator_pdata *pdata = dev_get_platdata(dev);
+
+       ret = dm_i2c_read(pdata->i2c, TPS62360_REG_SET0 + pdata->vsel_offset,
+                         &regval, 1);
+       if (ret) {
+               dev_err(dev, "i2c read failed: %d\n", ret);
+               return ret;
+       }
+
+       return (u32)regval * TPS62360_VSEL_STEPSIZE + pdata->config->vmin;
+}
+
+static int tps62360_regulator_ofdata_to_platdata(struct udevice *dev)
+{
+       struct tps62360_regulator_pdata *pdata = dev_get_platdata(dev);
+       u8 vsel0;
+       u8 vsel1;
+       int ret;
+
+       pdata->config = (void *)dev_get_driver_data(dev);
+
+       vsel0 = dev_read_bool(dev, "ti,vsel0-state-high");
+       vsel1 = dev_read_bool(dev, "ti,vsel1-state-high");
+
+       pdata->vsel_offset = vsel0 + vsel1 * 2;
+
+       ret = i2c_get_chip(dev->parent, TPS62360_I2C_CHIP, 1, &pdata->i2c);
+       if (ret) {
+               dev_err(dev, "i2c dev get failed.\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+static const struct dm_regulator_ops tps62360_regulator_ops = {
+       .get_value  = tps62360_regulator_get_value,
+       .set_value  = tps62360_regulator_set_value,
+};
+
+static const struct udevice_id tps62360_regulator_ids[] = {
+       { .compatible = "ti,tps62360", .data = (ulong)&tps62360_data },
+       { .compatible = "ti,tps62361", .data = (ulong)&tps62361_data },
+       { .compatible = "ti,tps62362", .data = (ulong)&tps62360_data },
+       { .compatible = "ti,tps62363", .data = (ulong)&tps62361_data },
+       { },
+};
+
+U_BOOT_DRIVER(tps62360_regulator) = {
+       .name = "tps62360_regulator",
+       .id = UCLASS_REGULATOR,
+       .ops = &tps62360_regulator_ops,
+       .of_match = tps62360_regulator_ids,
+       .platdata_auto_alloc_size = sizeof(struct tps62360_regulator_pdata),
+       .ofdata_to_platdata = tps62360_regulator_ofdata_to_platdata,
+};
diff --git a/drivers/power/regulator/tps65941_regulator.c b/drivers/power/regulator/tps65941_regulator.c
new file mode 100644 (file)
index 0000000..a00ef58
--- /dev/null
@@ -0,0 +1,407 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2019
+ * Texas Instruments Incorporated, <www.ti.com>
+ *
+ * Keerthy <j-keerthy@ti.com>
+ */
+
+#include <common.h>
+#include <fdtdec.h>
+#include <errno.h>
+#include <dm.h>
+#include <i2c.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+#include <power/tps65941.h>
+
+static const char tps65941_buck_ctrl[TPS65941_BUCK_NUM] = {0x4, 0x6, 0x8, 0xA,
+                                                               0xC};
+static const char tps65941_buck_vout[TPS65941_BUCK_NUM] = {0xE, 0x10, 0x12,
+                                                               0x14, 0x16};
+static const char tps65941_ldo_ctrl[TPS65941_BUCK_NUM] = {0x1D, 0x1E, 0x1F,
+                                                               0x20};
+static const char tps65941_ldo_vout[TPS65941_BUCK_NUM] = {0x23, 0x24, 0x25,
+                                                               0x26};
+
+static int tps65941_buck_enable(struct udevice *dev, int op, bool *enable)
+{
+       int ret;
+       unsigned int adr;
+       struct dm_regulator_uclass_platdata *uc_pdata;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+       adr = uc_pdata->ctrl_reg;
+
+       ret = pmic_reg_read(dev->parent, adr);
+       if (ret < 0)
+               return ret;
+
+       if (op == PMIC_OP_GET) {
+               ret &= TPS65941_BUCK_MODE_MASK;
+
+               if (ret)
+                       *enable = true;
+               else
+                       *enable = false;
+
+               return 0;
+       } else if (op == PMIC_OP_SET) {
+               if (*enable)
+                       ret |= TPS65941_BUCK_MODE_MASK;
+               else
+                       ret &= ~TPS65941_BUCK_MODE_MASK;
+               ret = pmic_reg_write(dev->parent, adr, ret);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
+}
+
+static int tps65941_buck_volt2val(int uV)
+{
+       if (uV > TPS65941_BUCK_VOLT_MAX)
+               return -EINVAL;
+       else if (uV > 1650000)
+               return (uV - 1660000) / 20000 + 0xAB;
+       else if (uV > 1110000)
+               return (uV - 1110000) / 10000 + 0x73;
+       else if (uV > 600000)
+               return (uV - 600000) / 5000 + 0x0F;
+       else if (uV >= 300000)
+               return (uV - 300000) / 20000 + 0x00;
+       else
+               return -EINVAL;
+}
+
+static int tps65941_buck_val2volt(int val)
+{
+       if (val > TPS65941_BUCK_VOLT_MAX_HEX)
+               return -EINVAL;
+       else if (val > 0xAB)
+               return 1660000 + (val - 0xAB) * 20000;
+       else if (val > 0x73)
+               return 1100000 + (val - 0x73) * 10000;
+       else if (val > 0xF)
+               return 600000 + (val - 0xF) * 5000;
+       else if (val >= 0x0)
+               return 300000 + val * 5000;
+       else
+               return -EINVAL;
+}
+
+int tps65941_lookup_slew(int id)
+{
+       switch (id) {
+       case 0:
+               return 33000;
+       case 1:
+               return 20000;
+       case 2:
+               return 10000;
+       case 3:
+               return 5000;
+       case 4:
+               return 2500;
+       case 5:
+               return 1300;
+       case 6:
+               return 630;
+       case 7:
+               return 310;
+       default:
+               return -1;
+       }
+}
+
+static int tps65941_buck_val(struct udevice *dev, int op, int *uV)
+{
+       unsigned int hex, adr;
+       int ret, delta, uwait, slew;
+       struct dm_regulator_uclass_platdata *uc_pdata;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+
+       if (op == PMIC_OP_GET)
+               *uV = 0;
+
+       adr = uc_pdata->volt_reg;
+
+       ret = pmic_reg_read(dev->parent, adr);
+       if (ret < 0)
+               return ret;
+
+       ret &= TPS65941_BUCK_VOLT_MASK;
+       ret = tps65941_buck_val2volt(ret);
+       if (ret < 0)
+               return ret;
+
+       if (op == PMIC_OP_GET) {
+               *uV = ret;
+               return 0;
+       }
+
+       /*
+        * Compute the delta voltage, find the slew rate and wait
+        * for the appropriate amount of time after voltage switch
+        */
+       if (*uV > ret)
+               delta = *uV - ret;
+       else
+               delta = ret - *uV;
+
+       slew = pmic_reg_read(dev->parent, uc_pdata->ctrl_reg + 1);
+       if (slew < 0)
+               return ret;
+
+       slew &= TP65941_BUCK_CONF_SLEW_MASK;
+       slew = tps65941_lookup_slew(slew);
+       if (slew <= 0)
+               return ret;
+
+       uwait = delta / slew;
+
+       hex = tps65941_buck_volt2val(*uV);
+       if (hex < 0)
+               return hex;
+
+       ret &= 0x0;
+       ret = hex;
+
+       ret = pmic_reg_write(dev->parent, adr, ret);
+
+       udelay(uwait);
+
+       return ret;
+}
+
+static int tps65941_ldo_enable(struct udevice *dev, int op, bool *enable)
+{
+       int ret;
+       unsigned int adr;
+       struct dm_regulator_uclass_platdata *uc_pdata;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+       adr = uc_pdata->ctrl_reg;
+
+       ret = pmic_reg_read(dev->parent, adr);
+       if (ret < 0)
+               return ret;
+
+       if (op == PMIC_OP_GET) {
+               ret &= TPS65941_LDO_MODE_MASK;
+
+               if (ret)
+                       *enable = true;
+               else
+                       *enable = false;
+
+               return 0;
+       } else if (op == PMIC_OP_SET) {
+               if (*enable)
+                       ret |= TPS65941_LDO_MODE_MASK;
+               else
+                       ret &= ~TPS65941_LDO_MODE_MASK;
+               ret = pmic_reg_write(dev->parent, adr, ret);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
+}
+
+static int tps65941_ldo_val2volt(int val)
+{
+       if (val > TPS65941_LDO_VOLT_MAX_HEX || val < TPS65941_LDO_VOLT_MIN_HEX)
+               return -EINVAL;
+       else if (val >= TPS65941_LDO_VOLT_MIN_HEX)
+               return 600000 + (val - TPS65941_LDO_VOLT_MIN_HEX) * 50000;
+       else
+               return -EINVAL;
+}
+
+static int tps65941_ldo_val(struct udevice *dev, int op, int *uV)
+{
+       unsigned int hex, adr;
+       int ret;
+       struct dm_regulator_uclass_platdata *uc_pdata;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+
+       if (op == PMIC_OP_GET)
+               *uV = 0;
+
+       adr = uc_pdata->volt_reg;
+
+       ret = pmic_reg_read(dev->parent, adr);
+       if (ret < 0)
+               return ret;
+
+       ret &= TPS65941_LDO_VOLT_MASK;
+       ret = tps65941_ldo_val2volt(ret);
+       if (ret < 0)
+               return ret;
+
+       if (op == PMIC_OP_GET) {
+               *uV = ret;
+               return 0;
+       }
+
+       hex = tps65941_buck_volt2val(*uV);
+       if (hex < 0)
+               return hex;
+
+       ret &= 0x0;
+       ret = hex;
+
+       ret = pmic_reg_write(dev->parent, adr, ret);
+
+       return ret;
+}
+
+static int tps65941_ldo_probe(struct udevice *dev)
+{
+       struct dm_regulator_uclass_platdata *uc_pdata;
+       int idx;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+       uc_pdata->type = REGULATOR_TYPE_LDO;
+
+       idx = dev->driver_data;
+       if (idx == 1 || idx == 2 || idx == 3 || idx == 4) {
+               debug("Single phase regulator\n");
+       } else {
+               printf("Wrong ID for regulator\n");
+               return -EINVAL;
+       }
+
+       uc_pdata->ctrl_reg = tps65941_ldo_ctrl[idx - 1];
+       uc_pdata->volt_reg = tps65941_ldo_vout[idx - 1];
+
+       return 0;
+}
+
+static int tps65941_buck_probe(struct udevice *dev)
+{
+       struct dm_regulator_uclass_platdata *uc_pdata;
+       int idx;
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+       uc_pdata->type = REGULATOR_TYPE_BUCK;
+
+       idx = dev->driver_data;
+       if (idx == 1 || idx == 2 || idx == 3 || idx == 4 || idx == 5) {
+               debug("Single phase regulator\n");
+       } else if (idx == 12) {
+               idx = 1;
+       } else if (idx == 34) {
+               idx = 3;
+       } else if (idx == 1234) {
+               idx = 1;
+       } else {
+               printf("Wrong ID for regulator\n");
+               return -EINVAL;
+       }
+
+       uc_pdata->ctrl_reg = tps65941_buck_ctrl[idx - 1];
+       uc_pdata->volt_reg = tps65941_buck_vout[idx - 1];
+
+       return 0;
+}
+
+static int ldo_get_value(struct udevice *dev)
+{
+       int uV;
+       int ret;
+
+       ret = tps65941_ldo_val(dev, PMIC_OP_GET, &uV);
+       if (ret)
+               return ret;
+
+       return uV;
+}
+
+static int ldo_set_value(struct udevice *dev, int uV)
+{
+       return tps65941_ldo_val(dev, PMIC_OP_SET, &uV);
+}
+
+static int ldo_get_enable(struct udevice *dev)
+{
+       bool enable = false;
+       int ret;
+
+       ret = tps65941_ldo_enable(dev, PMIC_OP_GET, &enable);
+       if (ret)
+               return ret;
+
+       return enable;
+}
+
+static int ldo_set_enable(struct udevice *dev, bool enable)
+{
+       return tps65941_ldo_enable(dev, PMIC_OP_SET, &enable);
+}
+
+static int buck_get_value(struct udevice *dev)
+{
+       int uV;
+       int ret;
+
+       ret = tps65941_buck_val(dev, PMIC_OP_GET, &uV);
+       if (ret)
+               return ret;
+
+       return uV;
+}
+
+static int buck_set_value(struct udevice *dev, int uV)
+{
+       return tps65941_buck_val(dev, PMIC_OP_SET, &uV);
+}
+
+static int buck_get_enable(struct udevice *dev)
+{
+       bool enable = false;
+       int ret;
+
+       ret = tps65941_buck_enable(dev, PMIC_OP_GET, &enable);
+       if (ret)
+               return ret;
+
+       return enable;
+}
+
+static int buck_set_enable(struct udevice *dev, bool enable)
+{
+       return tps65941_buck_enable(dev, PMIC_OP_SET, &enable);
+}
+
+static const struct dm_regulator_ops tps65941_ldo_ops = {
+       .get_value  = ldo_get_value,
+       .set_value  = ldo_set_value,
+       .get_enable = ldo_get_enable,
+       .set_enable = ldo_set_enable,
+};
+
+U_BOOT_DRIVER(tps65941_ldo) = {
+       .name = TPS65941_LDO_DRIVER,
+       .id = UCLASS_REGULATOR,
+       .ops = &tps65941_ldo_ops,
+       .probe = tps65941_ldo_probe,
+};
+
+static const struct dm_regulator_ops tps65941_buck_ops = {
+       .get_value  = buck_get_value,
+       .set_value  = buck_set_value,
+       .get_enable = buck_get_enable,
+       .set_enable = buck_set_enable,
+};
+
+U_BOOT_DRIVER(tps65941_buck) = {
+       .name = TPS65941_BUCK_DRIVER,
+       .id = UCLASS_REGULATOR,
+       .ops = &tps65941_buck_ops,
+       .probe = tps65941_buck_probe,
+};
index 656696ac3c538fdb0f0f25ca9b7d6a179467f9ae..e84c9be6a29443f176a33cc2238ba33b596f38d9 100644 (file)
@@ -311,12 +311,12 @@ static void phy_dll_bypass_set(struct dram_info *dram, u32 freq)
        setbits_le32(PHY_REG(phy_base, 0x56), 1 << 4);
        clrbits_le32(PHY_REG(phy_base, 0x57), 1 << 3);
 
-       if (freq <= (400 * MHz))
+       if (freq <= 400)
                /* DLL bypass */
                setbits_le32(PHY_REG(phy_base, 0xa4), 0x1f);
        else
                clrbits_le32(PHY_REG(phy_base, 0xa4), 0x1f);
-       if (freq <= (680 * MHz))
+       if (freq <= 680)
                tmp = 2;
        else
                tmp = 1;
@@ -394,7 +394,7 @@ static void phy_cfg(struct dram_info *dram,
        copy_to_reg(PHY_REG(phy_base, 0x70),
                    &sdram_params->skew.cs0_dm0_skew[0], 44 * 4);
        copy_to_reg(PHY_REG(phy_base, 0xc0),
-                   &sdram_params->skew.cs0_dm1_skew[0], 44 * 4);
+                   &sdram_params->skew.cs1_dm0_skew[0], 44 * 4);
 }
 
 static int update_refresh_reg(struct dram_info *dram)
index 7be867d5b66dc70b1858bbd39f7ce3f63114169a..8588866489c7cf741e1d09fa43d483841cf07772 100644 (file)
@@ -385,6 +385,7 @@ config CF_SPI
 
 config FSL_ESPI
        bool "Freescale eSPI driver"
+       imply SPI_FLASH_BAR
        help
          Enable the Freescale eSPI driver. This driver can be used to
          access the SPI interface and SPI NOR flash on platforms embedding
index 3b53bf2c58a1e9f0197d4f8db38e467393351e46..9af78e88226a6f296528c926b5fadf99de8112f8 100644 (file)
@@ -68,6 +68,8 @@ config SPL_DM_USB_GADGET
 
 source "drivers/usb/host/Kconfig"
 
+source "drivers/usb/cdns3/Kconfig"
+
 source "drivers/usb/dwc3/Kconfig"
 
 source "drivers/usb/musb/Kconfig"
diff --git a/drivers/usb/cdns3/Kconfig b/drivers/usb/cdns3/Kconfig
new file mode 100644 (file)
index 0000000..4cf59c7
--- /dev/null
@@ -0,0 +1,58 @@
+config USB_CDNS3
+       tristate "Cadence USB3 Dual-Role Controller"
+       depends on USB_HOST || USB_GADGET
+       help
+         Say Y here if your system has a Cadence USB3 dual-role controller.
+         It supports: Host-only, and Peripheral-only.
+
+if USB_CDNS3
+
+config USB_CDNS3_GADGET
+       bool "Cadence USB3 device controller"
+       depends on USB_GADGET
+       select USB_GADGET_DUALSPEED
+       help
+         Say Y here to enable device controller functionality of the
+         Cadence USBSS-DEV driver.
+
+         This controller supports FF and HS mode. It doesn't support
+         LS and SSP mode.
+
+config USB_CDNS3_HOST
+       bool "Cadence USB3 host controller"
+       depends on USB_XHCI_HCD
+       help
+         Say Y here to enable host controller functionality of the
+         Cadence driver.
+
+         Host controller is compliant with XHCI so it will use
+         standard XHCI driver.
+
+config SPL_USB_CDNS3_GADGET
+       bool "SPL support for Cadence USB3 device controller"
+       depends on SPL_USB_GADGET
+       select USB_GADGET_DUALSPEED
+       help
+         Say Y here to enable device controller functionality of the
+         Cadence USBSS-DEV driver in SPL.
+
+         This controller supports FF and HS mode. It doesn't support
+         LS and SSP mode.
+
+config SPL_USB_CDNS3_HOST
+       bool "Cadence USB3 host controller"
+       depends on USB_XHCI_HCD && SPL_USB_HOST_SUPPORT
+       help
+         Say Y here to enable host controller functionality of the
+         Cadence driver.
+
+         Host controller is compliant with XHCI so it will use
+         standard XHCI driver.
+
+config USB_CDNS3_TI
+       tristate "Cadence USB3 support on TI platforms"
+       default USB_CDNS3
+       help
+         Say 'Y' here if you are building for Texas Instruments
+         platforms that contain Cadence USB3 controller core. E.g.: J721e.
+endif
diff --git a/drivers/usb/cdns3/Makefile b/drivers/usb/cdns3/Makefile
new file mode 100644 (file)
index 0000000..18d7190
--- /dev/null
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0
+
+cdns3-y                                        := core.o drd.o
+
+obj-$(CONFIG_USB_CDNS3)                        += cdns3.o
+
+cdns3-$(CONFIG_$(SPL_)USB_CDNS3_GADGET)        += gadget.o ep0.o
+
+cdns3-$(CONFIG_$(SPL_)USB_CDNS3_HOST)  += host.o
+
+obj-$(CONFIG_USB_CDNS3_TI)             += cdns3-ti.o
diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c
new file mode 100644 (file)
index 0000000..2fa0104
--- /dev/null
@@ -0,0 +1,193 @@
+// SPDX-License-Identifier: GPL-2.0
+/**
+ * cdns_ti-ti.c - TI specific Glue layer for Cadence USB Controller
+ *
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
+ */
+
+#include <common.h>
+#include <asm-generic/io.h>
+#include <clk.h>
+#include <dm.h>
+#include <linux/io.h>
+#include <linux/usb/otg.h>
+#include <malloc.h>
+
+#include "core.h"
+
+/* USB Wrapper register offsets */
+#define USBSS_PID              0x0
+#define        USBSS_W1                0x4
+#define USBSS_STATIC_CONFIG    0x8
+#define USBSS_PHY_TEST         0xc
+#define        USBSS_DEBUG_CTRL        0x10
+#define        USBSS_DEBUG_INFO        0x14
+#define        USBSS_DEBUG_LINK_STATE  0x18
+#define        USBSS_DEVICE_CTRL       0x1c
+
+/* Wrapper 1 register bits */
+#define USBSS_W1_PWRUP_RST             BIT(0)
+#define USBSS_W1_OVERCURRENT_SEL       BIT(8)
+#define USBSS_W1_MODESTRAP_SEL         BIT(9)
+#define USBSS_W1_OVERCURRENT           BIT(16)
+#define USBSS_W1_MODESTRAP_MASK                GENMASK(18, 17)
+#define USBSS_W1_MODESTRAP_SHIFT       17
+#define USBSS_W1_USB2_ONLY             BIT(19)
+
+/* Static config register bits */
+#define USBSS1_STATIC_PLL_REF_SEL_MASK GENMASK(8, 5)
+#define USBSS1_STATIC_PLL_REF_SEL_SHIFT        5
+#define USBSS1_STATIC_LOOPBACK_MODE_MASK       GENMASK(4, 3)
+#define USBSS1_STATIC_LOOPBACK_MODE_SHIFT      3
+#define USBSS1_STATIC_VBUS_SEL_MASK    GENMASK(2, 1)
+#define USBSS1_STATIC_VBUS_SEL_SHIFT   1
+#define USBSS1_STATIC_LANE_REVERSE     BIT(0)
+
+/* Modestrap modes */
+enum modestrap_mode { USBSS_MODESTRAP_MODE_NONE,
+                     USBSS_MODESTRAP_MODE_HOST,
+                     USBSS_MODESTRAP_MODE_PERIPHERAL};
+
+struct cdns_ti {
+       struct udevice *dev;
+       void __iomem *usbss;
+       int usb2_only:1;
+       int vbus_divider:1;
+       struct clk *usb2_refclk;
+       struct clk *lpm_clk;
+};
+
+static const int cdns_ti_rate_table[] = {      /* in KHZ */
+       9600,
+       10000,
+       12000,
+       19200,
+       20000,
+       24000,
+       25000,
+       26000,
+       38400,
+       40000,
+       58000,
+       50000,
+       52000,
+};
+
+static inline u32 cdns_ti_readl(struct cdns_ti *data, u32 offset)
+{
+       return readl(data->usbss + offset);
+}
+
+static inline void cdns_ti_writel(struct cdns_ti *data, u32 offset, u32 value)
+{
+       writel(value, data->usbss + offset);
+}
+
+static int cdns_ti_probe(struct udevice *dev)
+{
+       struct cdns_ti *data = dev_get_platdata(dev);
+       struct clk usb2_refclk;
+       int modestrap_mode;
+       unsigned long rate;
+       int rate_code, i;
+       u32 reg;
+       int ret;
+
+       data->dev = dev;
+
+       data->usbss = dev_remap_addr_index(dev, 0);
+       if (!data->usbss)
+               return -EINVAL;
+
+       ret = clk_get_by_name(dev, "usb2_refclk", &usb2_refclk);
+       if (ret) {
+               dev_err(dev, "Failed to get usb2_refclk\n");
+               return ret;
+       }
+
+       rate = clk_get_rate(&usb2_refclk);
+       rate /= 1000;   /* To KHz */
+       for (i = 0; i < ARRAY_SIZE(cdns_ti_rate_table); i++) {
+               if (cdns_ti_rate_table[i] == rate)
+                       break;
+       }
+
+       if (i == ARRAY_SIZE(cdns_ti_rate_table)) {
+               dev_err(dev, "unsupported usb2_refclk rate: %lu KHz\n", rate);
+               return -EINVAL;
+       }
+
+       rate_code = i;
+
+       /* assert RESET */
+       reg = cdns_ti_readl(data, USBSS_W1);
+       reg &= ~USBSS_W1_PWRUP_RST;
+       cdns_ti_writel(data, USBSS_W1, reg);
+
+       /* set static config */
+       reg = cdns_ti_readl(data, USBSS_STATIC_CONFIG);
+       reg &= ~USBSS1_STATIC_PLL_REF_SEL_MASK;
+       reg |= rate_code << USBSS1_STATIC_PLL_REF_SEL_SHIFT;
+
+       reg &= ~USBSS1_STATIC_VBUS_SEL_MASK;
+       data->vbus_divider = dev_read_bool(dev, "ti,vbus-divider");
+       if (data->vbus_divider)
+               reg |= 1 << USBSS1_STATIC_VBUS_SEL_SHIFT;
+
+       cdns_ti_writel(data, USBSS_STATIC_CONFIG, reg);
+       reg = cdns_ti_readl(data, USBSS_STATIC_CONFIG);
+
+       /* set USB2_ONLY mode if requested */
+       reg = cdns_ti_readl(data, USBSS_W1);
+       data->usb2_only = dev_read_bool(dev, "ti,usb2-only");
+       if (data->usb2_only)
+               reg |= USBSS_W1_USB2_ONLY;
+
+       /* set modestrap  */
+       if (dev_read_bool(dev, "ti,modestrap-host"))
+               modestrap_mode = USBSS_MODESTRAP_MODE_HOST;
+       else if (dev_read_bool(dev, "ti,modestrap-peripheral"))
+               modestrap_mode = USBSS_MODESTRAP_MODE_PERIPHERAL;
+       else
+               modestrap_mode = USBSS_MODESTRAP_MODE_NONE;
+
+       reg |= USBSS_W1_MODESTRAP_SEL;
+       reg &= ~USBSS_W1_MODESTRAP_MASK;
+       reg |= modestrap_mode << USBSS_W1_MODESTRAP_SHIFT;
+       cdns_ti_writel(data, USBSS_W1, reg);
+
+       /* de-assert RESET */
+       reg |= USBSS_W1_PWRUP_RST;
+       cdns_ti_writel(data, USBSS_W1, reg);
+
+       return 0;
+}
+
+static int cdns_ti_remove(struct udevice *dev)
+{
+       struct cdns_ti *data = dev_get_platdata(dev);
+       u32 reg;
+
+       /* put device back to RESET*/
+       reg = cdns_ti_readl(data, USBSS_W1);
+       reg &= ~USBSS_W1_PWRUP_RST;
+       cdns_ti_writel(data, USBSS_W1, reg);
+
+       return 0;
+}
+
+static const struct udevice_id cdns_ti_of_match[] = {
+       { .compatible = "ti,j721e-usb", },
+       {},
+};
+
+U_BOOT_DRIVER(cdns_ti) = {
+       .name = "cdns-ti",
+       .id = UCLASS_NOP,
+       .of_match = cdns_ti_of_match,
+       .bind = cdns3_bind,
+       .probe = cdns_ti_probe,
+       .remove = cdns_ti_remove,
+       .platdata_auto_alloc_size = sizeof(struct cdns_ti),
+       .flags = DM_FLAG_OS_PREPARE,
+};
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
new file mode 100644 (file)
index 0000000..f1e4bb6
--- /dev/null
@@ -0,0 +1,498 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Cadence USBSS DRD Driver.
+ *
+ * Copyright (C) 2018-2019 Cadence.
+ * Copyright (C) 2017-2018 NXP
+ * Copyright (C) 2019 Texas Instruments
+ *
+ * Author: Peter Chen <peter.chen@nxp.com>
+ *         Pawel Laszczak <pawell@cadence.com>
+ *         Roger Quadros <rogerq@ti.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/device-internal.h>
+#include <dm/lists.h>
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <usb.h>
+#include "../host/xhci.h"
+
+#include "core.h"
+#include "host-export.h"
+#include "gadget-export.h"
+#include "drd.h"
+
+static int cdns3_idle_init(struct cdns3 *cdns);
+
+struct cdns3_host_priv {
+       struct xhci_ctrl xhci_ctrl;
+       struct cdns3 cdns;
+};
+
+struct cdns3_gadget_priv {
+       struct cdns3 cdns;
+};
+
+static inline
+struct cdns3_role_driver *cdns3_get_current_role_driver(struct cdns3 *cdns)
+{
+       WARN_ON(!cdns->roles[cdns->role]);
+       return cdns->roles[cdns->role];
+}
+
+static int cdns3_role_start(struct cdns3 *cdns, enum usb_role role)
+{
+       int ret;
+
+       if (WARN_ON(role > USB_ROLE_DEVICE))
+               return 0;
+
+       mutex_lock(&cdns->mutex);
+       cdns->role = role;
+       mutex_unlock(&cdns->mutex);
+
+       if (!cdns->roles[role])
+               return -ENXIO;
+
+       if (cdns->roles[role]->state == CDNS3_ROLE_STATE_ACTIVE)
+               return 0;
+
+       mutex_lock(&cdns->mutex);
+       ret = cdns->roles[role]->start(cdns);
+       if (!ret)
+               cdns->roles[role]->state = CDNS3_ROLE_STATE_ACTIVE;
+       mutex_unlock(&cdns->mutex);
+
+       return ret;
+}
+
+static void cdns3_role_stop(struct cdns3 *cdns)
+{
+       enum usb_role role = cdns->role;
+
+       if (WARN_ON(role > USB_ROLE_DEVICE))
+               return;
+
+       if (cdns->roles[role]->state == CDNS3_ROLE_STATE_INACTIVE)
+               return;
+
+       mutex_lock(&cdns->mutex);
+       cdns->roles[role]->stop(cdns);
+       cdns->roles[role]->state = CDNS3_ROLE_STATE_INACTIVE;
+       mutex_unlock(&cdns->mutex);
+}
+
+static void cdns3_exit_roles(struct cdns3 *cdns)
+{
+       cdns3_role_stop(cdns);
+       cdns3_drd_exit(cdns);
+}
+
+static enum usb_role cdsn3_hw_role_state_machine(struct cdns3 *cdns);
+
+/**
+ * cdns3_core_init_role - initialize role of operation
+ * @cdns: Pointer to cdns3 structure
+ *
+ * Returns 0 on success otherwise negative errno
+ */
+static int cdns3_core_init_role(struct cdns3 *cdns)
+{
+       struct udevice *dev = cdns->dev;
+       enum usb_dr_mode best_dr_mode;
+       enum usb_dr_mode dr_mode;
+       int ret = 0;
+
+       dr_mode = usb_get_dr_mode(dev_of_offset(dev));
+       cdns->role = USB_ROLE_NONE;
+
+       /*
+        * If driver can't read mode by means of usb_get_dr_mode function then
+        * chooses mode according with Kernel configuration. This setting
+        * can be restricted later depending on strap pin configuration.
+        */
+       if (dr_mode == USB_DR_MODE_UNKNOWN) {
+               if (IS_ENABLED(CONFIG_USB_CDNS3_HOST) &&
+                   IS_ENABLED(CONFIG_USB_CDNS3_GADGET))
+                       dr_mode = USB_DR_MODE_OTG;
+               else if (IS_ENABLED(CONFIG_USB_CDNS3_HOST))
+                       dr_mode = USB_DR_MODE_HOST;
+               else if (IS_ENABLED(CONFIG_USB_CDNS3_GADGET))
+                       dr_mode = USB_DR_MODE_PERIPHERAL;
+       }
+
+       /*
+        * At this point cdns->dr_mode contains strap configuration.
+        * Driver try update this setting considering kernel configuration
+        */
+       best_dr_mode = cdns->dr_mode;
+
+       ret = cdns3_idle_init(cdns);
+       if (ret)
+               return ret;
+
+       if (dr_mode == USB_DR_MODE_OTG) {
+               best_dr_mode = cdns->dr_mode;
+       } else if (cdns->dr_mode == USB_DR_MODE_OTG) {
+               best_dr_mode = dr_mode;
+       } else if (cdns->dr_mode != dr_mode) {
+               dev_err(dev, "Incorrect DRD configuration\n");
+               return -EINVAL;
+       }
+
+       dr_mode = best_dr_mode;
+
+#if defined(CONFIG_SPL_USB_HOST_SUPPORT) || !defined(CONFIG_SPL_BUILD)
+       if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_HOST) {
+               ret = cdns3_host_init(cdns);
+               if (ret) {
+                       dev_err(dev, "Host initialization failed with %d\n",
+                               ret);
+                       goto err;
+               }
+       }
+#endif
+
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
+       if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_PERIPHERAL) {
+               ret = cdns3_gadget_init(cdns);
+               if (ret) {
+                       dev_err(dev, "Device initialization failed with %d\n",
+                               ret);
+                       goto err;
+               }
+       }
+#endif
+
+       cdns->dr_mode = dr_mode;
+
+       ret = cdns3_drd_update_mode(cdns);
+       if (ret)
+               goto err;
+
+       if (cdns->dr_mode != USB_DR_MODE_OTG) {
+               ret = cdns3_hw_role_switch(cdns);
+               if (ret)
+                       goto err;
+       }
+
+       return ret;
+err:
+       cdns3_exit_roles(cdns);
+       return ret;
+}
+
+/**
+ * cdsn3_hw_role_state_machine - role switch state machine based on hw events
+ * @cdns: Pointer to controller structure.
+ *
+ * Returns next role to be entered based on hw events.
+ */
+static enum usb_role cdsn3_hw_role_state_machine(struct cdns3 *cdns)
+{
+       enum usb_role role;
+       int id, vbus;
+
+       if (cdns->dr_mode != USB_DR_MODE_OTG)
+               goto not_otg;
+
+       id = cdns3_get_id(cdns);
+       vbus = cdns3_get_vbus(cdns);
+
+       /*
+        * Role change state machine
+        * Inputs: ID, VBUS
+        * Previous state: cdns->role
+        * Next state: role
+        */
+       role = cdns->role;
+
+       switch (role) {
+       case USB_ROLE_NONE:
+               /*
+                * Driver treats USB_ROLE_NONE synonymous to IDLE state from
+                * controller specification.
+                */
+               if (!id)
+                       role = USB_ROLE_HOST;
+               else if (vbus)
+                       role = USB_ROLE_DEVICE;
+               break;
+       case USB_ROLE_HOST: /* from HOST, we can only change to NONE */
+               if (id)
+                       role = USB_ROLE_NONE;
+               break;
+       case USB_ROLE_DEVICE: /* from GADGET, we can only change to NONE*/
+               if (!vbus)
+                       role = USB_ROLE_NONE;
+               break;
+       }
+
+       dev_dbg(cdns->dev, "role %d -> %d\n", cdns->role, role);
+
+       return role;
+
+not_otg:
+       if (cdns3_is_host(cdns))
+               role = USB_ROLE_HOST;
+       if (cdns3_is_device(cdns))
+               role = USB_ROLE_DEVICE;
+
+       return role;
+}
+
+static int cdns3_idle_role_start(struct cdns3 *cdns)
+{
+       return 0;
+}
+
+static void cdns3_idle_role_stop(struct cdns3 *cdns)
+{
+       /* Program Lane swap and bring PHY out of RESET */
+       generic_phy_reset(&cdns->usb3_phy);
+}
+
+static int cdns3_idle_init(struct cdns3 *cdns)
+{
+       struct cdns3_role_driver *rdrv;
+
+       rdrv = devm_kzalloc(cdns->dev, sizeof(*rdrv), GFP_KERNEL);
+       if (!rdrv)
+               return -ENOMEM;
+
+       rdrv->start = cdns3_idle_role_start;
+       rdrv->stop = cdns3_idle_role_stop;
+       rdrv->state = CDNS3_ROLE_STATE_INACTIVE;
+       rdrv->suspend = NULL;
+       rdrv->resume = NULL;
+       rdrv->name = "idle";
+
+       cdns->roles[USB_ROLE_NONE] = rdrv;
+
+       return 0;
+}
+
+/**
+ * cdns3_hw_role_switch - switch roles based on HW state
+ * @cdns3: controller
+ */
+int cdns3_hw_role_switch(struct cdns3 *cdns)
+{
+       enum usb_role real_role, current_role;
+       int ret = 0;
+
+       /* Do nothing if role based on syfs. */
+       if (cdns->role_override)
+               return 0;
+
+       current_role = cdns->role;
+       real_role = cdsn3_hw_role_state_machine(cdns);
+
+       /* Do nothing if nothing changed */
+       if (current_role == real_role)
+               goto exit;
+
+       cdns3_role_stop(cdns);
+
+       dev_dbg(cdns->dev, "Switching role %d -> %d", current_role, real_role);
+
+       ret = cdns3_role_start(cdns, real_role);
+       if (ret) {
+               /* Back to current role */
+               dev_err(cdns->dev, "set %d has failed, back to %d\n",
+                       real_role, current_role);
+               ret = cdns3_role_start(cdns, current_role);
+               if (ret)
+                       dev_err(cdns->dev, "back to %d failed too\n",
+                               current_role);
+       }
+exit:
+       return ret;
+}
+
+static int cdns3_probe(struct cdns3 *cdns)
+{
+       struct udevice *dev = cdns->dev;
+       int ret;
+
+       cdns->xhci_regs = dev_remap_addr_name(dev, "xhci");
+       if (!cdns->xhci_regs)
+               return -EINVAL;
+
+       cdns->dev_regs = dev_remap_addr_name(dev, "dev");
+       if (!cdns->dev_regs)
+               return -EINVAL;
+
+       mutex_init(&cdns->mutex);
+
+       ret = generic_phy_get_by_name(dev, "cdns3,usb2-phy", &cdns->usb2_phy);
+       if (ret)
+               dev_warn(dev, "Unable to get USB2 phy (ret %d)\n", ret);
+
+       ret = generic_phy_init(&cdns->usb2_phy);
+       if (ret)
+               return ret;
+
+       ret = generic_phy_get_by_name(dev, "cdns3,usb3-phy", &cdns->usb3_phy);
+       if (ret)
+               dev_warn(dev, "Unable to get USB3 phy (ret %d)\n", ret);
+
+       ret = generic_phy_init(&cdns->usb3_phy);
+       if (ret)
+               return ret;
+
+       ret = generic_phy_power_on(&cdns->usb2_phy);
+       if (ret)
+               return ret;
+
+       ret = generic_phy_power_on(&cdns->usb3_phy);
+       if (ret)
+               return ret;
+
+       ret = cdns3_drd_init(cdns);
+       if (ret)
+               return ret;
+
+       ret = cdns3_core_init_role(cdns);
+       if (ret)
+               return ret;
+
+       dev_dbg(dev, "Cadence USB3 core: probe succeed\n");
+
+       return 0;
+}
+
+static int cdns3_remove(struct cdns3 *cdns)
+{
+       cdns3_exit_roles(cdns);
+       generic_phy_power_off(&cdns->usb2_phy);
+       generic_phy_power_off(&cdns->usb3_phy);
+       generic_phy_exit(&cdns->usb2_phy);
+       generic_phy_exit(&cdns->usb3_phy);
+       return 0;
+}
+
+static const struct udevice_id cdns3_ids[] = {
+       { .compatible = "cdns,usb3" },
+       { },
+};
+
+int cdns3_bind(struct udevice *parent)
+{
+       int from = dev_of_offset(parent);
+       const void *fdt = gd->fdt_blob;
+       enum usb_dr_mode dr_mode;
+       struct udevice *dev;
+       const char *driver;
+       const char *name;
+       int node;
+       int ret;
+
+       node = fdt_node_offset_by_compatible(fdt, from, "cdns,usb3");
+       if (node < 0) {
+               ret = -ENODEV;
+               goto fail;
+       }
+
+       name = fdt_get_name(fdt, node, NULL);
+       dr_mode = usb_get_dr_mode(node);
+
+       switch (dr_mode) {
+#if defined(CONFIG_SPL_USB_HOST_SUPPORT) || \
+       (!defined(CONFIG_SPL_BUILD) && defined(CONFIG_USB_HOST))
+       case USB_DR_MODE_HOST:
+               debug("%s: dr_mode: HOST\n", __func__);
+               driver = "cdns-usb3-host";
+               break;
+#endif
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
+       case USB_DR_MODE_PERIPHERAL:
+               debug("%s: dr_mode: PERIPHERAL\n", __func__);
+               driver = "cdns-usb3-peripheral";
+               break;
+#endif
+       default:
+               printf("%s: unsupported dr_mode\n", __func__);
+               ret = -ENODEV;
+               goto fail;
+       };
+
+       ret = device_bind_driver_to_node(parent, driver, name,
+                                        offset_to_ofnode(node), &dev);
+       if (ret) {
+               printf("%s: not able to bind usb device mode\n",
+                      __func__);
+               goto fail;
+       }
+
+       return 0;
+
+fail:
+       /* do not return an error: failing to bind would hang the board */
+       return 0;
+}
+
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
+static int cdns3_gadget_probe(struct udevice *dev)
+{
+       struct cdns3_gadget_priv *priv = dev_get_priv(dev);
+       struct cdns3 *cdns = &priv->cdns;
+
+       cdns->dev = dev;
+
+       return cdns3_probe(cdns);
+}
+
+static int cdns3_gadget_remove(struct udevice *dev)
+{
+       struct cdns3_gadget_priv *priv = dev_get_priv(dev);
+       struct cdns3 *cdns = &priv->cdns;
+
+       return cdns3_remove(cdns);
+}
+
+U_BOOT_DRIVER(cdns_usb3_peripheral) = {
+       .name   = "cdns-usb3-peripheral",
+       .id     = UCLASS_USB_GADGET_GENERIC,
+       .of_match = cdns3_ids,
+       .probe = cdns3_gadget_probe,
+       .remove = cdns3_gadget_remove,
+       .priv_auto_alloc_size = sizeof(struct cdns3_gadget_priv),
+       .flags = DM_FLAG_ALLOC_PRIV_DMA,
+};
+#endif
+
+#if defined(CONFIG_SPL_USB_HOST_SUPPORT) || \
+       (!defined(CONFIG_SPL_BUILD) && defined(CONFIG_USB_HOST))
+static int cdns3_host_probe(struct udevice *dev)
+{
+       struct cdns3_host_priv *priv = dev_get_priv(dev);
+       struct cdns3 *cdns = &priv->cdns;
+
+       cdns->dev = dev;
+
+       return cdns3_probe(cdns);
+}
+
+static int cdns3_host_remove(struct udevice *dev)
+{
+       struct cdns3_host_priv *priv = dev_get_priv(dev);
+       struct cdns3 *cdns = &priv->cdns;
+
+       return cdns3_remove(cdns);
+}
+
+U_BOOT_DRIVER(cdns_usb3_host) = {
+       .name   = "cdns-usb3-host",
+       .id     = UCLASS_USB,
+       .of_match = cdns3_ids,
+       .probe = cdns3_host_probe,
+       .remove = cdns3_host_remove,
+       .priv_auto_alloc_size = sizeof(struct cdns3_host_priv),
+       .ops = &xhci_usb_ops,
+       .flags = DM_FLAG_ALLOC_PRIV_DMA,
+};
+#endif
diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h
new file mode 100644 (file)
index 0000000..0668d64
--- /dev/null
@@ -0,0 +1,108 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Cadence USBSS DRD Header File.
+ *
+ * Copyright (C) 2017-2018 NXP
+ * Copyright (C) 2018-2019 Cadence.
+ *
+ * Authors: Peter Chen <peter.chen@nxp.com>
+ *          Pawel Laszczak <pawell@cadence.com>
+ */
+#include <linux/compiler.h>
+#include <linux/types.h>
+#include <linux/usb/otg.h>
+#include <generic-phy.h>
+
+#ifndef __LINUX_CDNS3_CORE_H
+#define __LINUX_CDNS3_CORE_H
+
+enum usb_role {
+       USB_ROLE_NONE,
+       USB_ROLE_HOST,
+       USB_ROLE_DEVICE,
+};
+
+struct cdns3;
+
+/**
+ * struct cdns3_role_driver - host/gadget role driver
+ * @start: start this role
+ * @stop: stop this role
+ * @suspend: suspend callback for this role
+ * @resume: resume callback for this role
+ * @irq: irq handler for this role
+ * @name: role name string (host/gadget)
+ * @state: current state
+ */
+struct cdns3_role_driver {
+       int (*start)(struct cdns3 *cdns);
+       void (*stop)(struct cdns3 *cdns);
+       int (*suspend)(struct cdns3 *cdns, bool do_wakeup);
+       int (*resume)(struct cdns3 *cdns, bool hibernated);
+       const char *name;
+#define CDNS3_ROLE_STATE_INACTIVE      0
+#define CDNS3_ROLE_STATE_ACTIVE                1
+       int state;
+};
+
+#define CDNS3_XHCI_RESOURCES_NUM       2
+/**
+ * struct cdns3 - Representation of Cadence USB3 DRD controller.
+ * @dev: pointer to Cadence device struct
+ * @xhci_regs: pointer to base of xhci registers
+ * @dev_regs: pointer to base of dev registers
+ * @otg_v0_regs: pointer to base of v0 otg registers
+ * @otg_v1_regs: pointer to base of v1 otg registers
+ * @otg_regs: pointer to base of otg registers
+ * @otg_irq: irq number for otg controller
+ * @dev_irq: irq number for device controller
+ * @roles: array of supported roles for this controller
+ * @role: current role
+ * @host_dev: the child host device pointer for cdns3 core
+ * @gadget_dev: the child gadget device pointer for cdns3 core
+ * @usb2_phy: pointer to USB2 PHY
+ * @usb3_phy: pointer to USB3 PHY
+ * @mutex: the mutex for concurrent code at driver
+ * @dr_mode: supported mode of operation it can be only Host, only Device
+ *           or OTG mode that allow to switch between Device and Host mode.
+ *           This field based on firmware setting, kernel configuration
+ *           and hardware configuration.
+ * @role_sw: pointer to role switch object.
+ * @role_override: set 1 if role rely on SW.
+ */
+struct cdns3 {
+       struct udevice                  *dev;
+       void __iomem                    *xhci_regs;
+       struct cdns3_usb_regs __iomem   *dev_regs;
+
+       struct cdns3_otg_legacy_regs    *otg_v0_regs;
+       struct cdns3_otg_regs           *otg_v1_regs;
+       struct cdns3_otg_common_regs    *otg_regs;
+#define CDNS3_CONTROLLER_V0    0
+#define CDNS3_CONTROLLER_V1    1
+       u32                             version;
+
+       int                             otg_irq;
+       int                             dev_irq;
+       struct cdns3_role_driver        *roles[USB_ROLE_DEVICE + 1];
+       enum usb_role                   role;
+       struct cdns3_device             *gadget_dev;
+       struct phy                      usb2_phy;
+       struct phy                      usb3_phy;
+       /* mutext used in workqueue*/
+       struct mutex                    mutex;
+       enum usb_dr_mode                dr_mode;
+       int                             role_override;
+};
+
+int cdns3_hw_role_switch(struct cdns3 *cdns);
+
+/**
+ * cdns3_bind - generic bind function
+ * @parent - pointer to parent udevice of which cdns3 USB controller
+ *           node is child of
+ *
+ * return 0 on success, negative errno otherwise
+ */
+int cdns3_bind(struct udevice *dev);
+#endif /* __LINUX_CDNS3_CORE_H */
diff --git a/drivers/usb/cdns3/debug.h b/drivers/usb/cdns3/debug.h
new file mode 100644 (file)
index 0000000..0b4673a
--- /dev/null
@@ -0,0 +1,162 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Cadence USBSS DRD Driver.
+ * Debug header file.
+ *
+ * Copyright (C) 2018-2019 Cadence.
+ *
+ * Author: Pawel Laszczak <pawell@cadence.com>
+ */
+#ifndef __LINUX_CDNS3_DEBUG
+#define __LINUX_CDNS3_DEBUG
+
+#include "core.h"
+#include "gadget.h"
+
+static inline char *cdns3_decode_usb_irq(char *str,
+                                        enum usb_device_speed speed,
+                                        u32 usb_ists)
+{
+       int ret;
+
+       ret = sprintf(str, "IRQ %08x = ", usb_ists);
+
+       if (usb_ists & (USB_ISTS_CON2I | USB_ISTS_CONI)) {
+               ret += sprintf(str + ret, "Connection %s\n",
+                              usb_speed_string(speed));
+       }
+       if (usb_ists & USB_ISTS_DIS2I || usb_ists & USB_ISTS_DISI)
+               ret += sprintf(str + ret, "Disconnection ");
+       if (usb_ists & USB_ISTS_L2ENTI)
+               ret += sprintf(str + ret, "suspended ");
+       if (usb_ists & USB_ISTS_L1ENTI)
+               ret += sprintf(str + ret, "L1 enter ");
+       if (usb_ists & USB_ISTS_L1EXTI)
+               ret += sprintf(str + ret, "L1 exit ");
+       if (usb_ists & USB_ISTS_L2ENTI)
+               ret += sprintf(str + ret, "L2 enter ");
+       if (usb_ists & USB_ISTS_L2EXTI)
+               ret += sprintf(str + ret, "L2 exit ");
+       if (usb_ists & USB_ISTS_U3EXTI)
+               ret += sprintf(str + ret, "U3 exit ");
+       if (usb_ists & USB_ISTS_UWRESI)
+               ret += sprintf(str + ret, "Warm Reset ");
+       if (usb_ists & USB_ISTS_UHRESI)
+               ret += sprintf(str + ret, "Hot Reset ");
+       if (usb_ists & USB_ISTS_U2RESI)
+               ret += sprintf(str + ret, "Reset");
+
+       return str;
+}
+
+static inline  char *cdns3_decode_ep_irq(char *str,
+                                        u32 ep_sts,
+                                        const char *ep_name)
+{
+       int ret;
+
+       ret = sprintf(str, "IRQ for %s: %08x ", ep_name, ep_sts);
+
+       if (ep_sts & EP_STS_SETUP)
+               ret += sprintf(str + ret, "SETUP ");
+       if (ep_sts & EP_STS_IOC)
+               ret += sprintf(str + ret, "IOC ");
+       if (ep_sts & EP_STS_ISP)
+               ret += sprintf(str + ret, "ISP ");
+       if (ep_sts & EP_STS_DESCMIS)
+               ret += sprintf(str + ret, "DESCMIS ");
+       if (ep_sts & EP_STS_STREAMR)
+               ret += sprintf(str + ret, "STREAMR ");
+       if (ep_sts & EP_STS_MD_EXIT)
+               ret += sprintf(str + ret, "MD_EXIT ");
+       if (ep_sts & EP_STS_TRBERR)
+               ret += sprintf(str + ret, "TRBERR ");
+       if (ep_sts & EP_STS_NRDY)
+               ret += sprintf(str + ret, "NRDY ");
+       if (ep_sts & EP_STS_PRIME)
+               ret += sprintf(str + ret, "PRIME ");
+       if (ep_sts & EP_STS_SIDERR)
+               ret += sprintf(str + ret, "SIDERRT ");
+       if (ep_sts & EP_STS_OUTSMM)
+               ret += sprintf(str + ret, "OUTSMM ");
+       if (ep_sts & EP_STS_ISOERR)
+               ret += sprintf(str + ret, "ISOERR ");
+       if (ep_sts & EP_STS_IOT)
+               ret += sprintf(str + ret, "IOT ");
+
+       return str;
+}
+
+static inline char *cdns3_decode_epx_irq(char *str,
+                                        char *ep_name,
+                                        u32 ep_sts)
+{
+       return cdns3_decode_ep_irq(str, ep_sts, ep_name);
+}
+
+static inline char *cdns3_decode_ep0_irq(char *str,
+                                        int dir,
+                                        u32 ep_sts)
+{
+       return cdns3_decode_ep_irq(str, ep_sts,
+                                  dir ? "ep0IN" : "ep0OUT");
+}
+
+/**
+ * Debug a transfer ring.
+ *
+ * Prints out all TRBs in the endpoint ring, even those after the Link TRB.
+ *.
+ */
+static inline char *cdns3_dbg_ring(struct cdns3_endpoint *priv_ep,
+                                  struct cdns3_trb *ring, char *str)
+{
+       dma_addr_t addr = priv_ep->trb_pool_dma;
+       struct cdns3_trb *trb;
+       int trb_per_sector;
+       int ret = 0;
+       int i;
+
+       trb_per_sector = GET_TRBS_PER_SEGMENT(priv_ep->type);
+
+       trb = &priv_ep->trb_pool[priv_ep->dequeue];
+       ret += sprintf(str + ret, "\n\t\tRing contents for %s:", priv_ep->name);
+
+       ret += sprintf(str + ret,
+                      "\n\t\tRing deq index: %d, trb: %p (virt), 0x%llx (dma)\n",
+                      priv_ep->dequeue, trb,
+                      (unsigned long long)cdns3_trb_virt_to_dma(priv_ep, trb));
+
+       trb = &priv_ep->trb_pool[priv_ep->enqueue];
+       ret += sprintf(str + ret,
+                      "\t\tRing enq index: %d, trb: %p (virt), 0x%llx (dma)\n",
+                      priv_ep->enqueue, trb,
+                      (unsigned long long)cdns3_trb_virt_to_dma(priv_ep, trb));
+
+       ret += sprintf(str + ret,
+                      "\t\tfree trbs: %d, CCS=%d, PCS=%d\n",
+                      priv_ep->free_trbs, priv_ep->ccs, priv_ep->pcs);
+
+       if (trb_per_sector > TRBS_PER_SEGMENT)
+               trb_per_sector = TRBS_PER_SEGMENT;
+
+       if (trb_per_sector > TRBS_PER_SEGMENT) {
+               sprintf(str + ret, "\t\tTo big transfer ring %d\n",
+                       trb_per_sector);
+               return str;
+       }
+
+       for (i = 0; i < trb_per_sector; ++i) {
+               trb = &ring[i];
+               ret += sprintf(str + ret,
+                       "\t\t@%pad %08x %08x %08x\n", &addr,
+                       le32_to_cpu(trb->buffer),
+                       le32_to_cpu(trb->length),
+                       le32_to_cpu(trb->control));
+               addr += sizeof(*trb);
+       }
+
+       return str;
+}
+
+#endif /*__LINUX_CDNS3_DEBUG*/
diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c
new file mode 100644 (file)
index 0000000..13eb489
--- /dev/null
@@ -0,0 +1,301 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Cadence USBSS DRD Driver.
+ *
+ * Copyright (C) 2018-2019 Cadence.
+ * Copyright (C) 2019 Texas Instruments
+ *
+ * Author: Pawel Laszczak <pawell@cadence.com>
+ *         Roger Quadros <rogerq@ti.com>
+ *
+ *
+ */
+#include <dm.h>
+#include <linux/delay.h>
+#include <linux/iopoll.h>
+#include <linux/kernel.h>
+#include <linux/usb/otg.h>
+
+#include "gadget.h"
+#include "drd.h"
+#include "core.h"
+
+#define readl_poll_timeout_atomic readl_poll_timeout
+#define usleep_range(a, b) udelay((b))
+/**
+ * cdns3_set_mode - change mode of OTG Core
+ * @cdns: pointer to context structure
+ * @mode: selected mode from cdns_role
+ *
+ * Returns 0 on success otherwise negative errno
+ */
+int cdns3_set_mode(struct cdns3 *cdns, enum usb_dr_mode mode)
+{
+       int ret = 0;
+       u32 reg;
+
+       switch (mode) {
+       case USB_DR_MODE_PERIPHERAL:
+               break;
+       case USB_DR_MODE_HOST:
+               break;
+       case USB_DR_MODE_OTG:
+               dev_dbg(cdns->dev, "Set controller to OTG mode\n");
+               if (cdns->version == CDNS3_CONTROLLER_V1) {
+                       reg = readl(&cdns->otg_v1_regs->override);
+                       reg |= OVERRIDE_IDPULLUP;
+                       writel(reg, &cdns->otg_v1_regs->override);
+               } else {
+                       reg = readl(&cdns->otg_v0_regs->ctrl1);
+                       reg |= OVERRIDE_IDPULLUP_V0;
+                       writel(reg, &cdns->otg_v0_regs->ctrl1);
+               }
+
+               /*
+                * Hardware specification says: "ID_VALUE must be valid within
+                * 50ms after idpullup is set to '1" so driver must wait
+                * 50ms before reading this pin.
+                */
+               usleep_range(50000, 60000);
+               break;
+       default:
+               dev_err(cdns->dev, "Unsupported mode of operation %d\n", mode);
+               return -EINVAL;
+       }
+
+       return ret;
+}
+
+int cdns3_get_id(struct cdns3 *cdns)
+{
+       int id;
+
+       id = readl(&cdns->otg_regs->sts) & OTGSTS_ID_VALUE;
+       dev_dbg(cdns->dev, "OTG ID: %d", id);
+
+       return id;
+}
+
+int cdns3_get_vbus(struct cdns3 *cdns)
+{
+       int vbus;
+
+       vbus = !!(readl(&cdns->otg_regs->sts) & OTGSTS_VBUS_VALID);
+       dev_dbg(cdns->dev, "OTG VBUS: %d", vbus);
+
+       return vbus;
+}
+
+int cdns3_is_host(struct cdns3 *cdns)
+{
+       if (cdns->dr_mode == USB_DR_MODE_HOST)
+               return 1;
+       else if (!cdns3_get_id(cdns))
+               return 1;
+
+       return 0;
+}
+
+int cdns3_is_device(struct cdns3 *cdns)
+{
+       if (cdns->dr_mode == USB_DR_MODE_PERIPHERAL)
+               return 1;
+       else if (cdns->dr_mode == USB_DR_MODE_OTG)
+               if (cdns3_get_id(cdns))
+                       return 1;
+
+       return 0;
+}
+
+/**
+ * cdns3_drd_switch_host - start/stop host
+ * @cdns: Pointer to controller context structure
+ * @on: 1 for start, 0 for stop
+ *
+ * Returns 0 on success otherwise negative errno
+ */
+int cdns3_drd_switch_host(struct cdns3 *cdns, int on)
+{
+       int ret, val;
+       u32 reg = OTGCMD_OTG_DIS;
+
+       /* switch OTG core */
+       if (on) {
+               writel(OTGCMD_HOST_BUS_REQ | reg, &cdns->otg_regs->cmd);
+
+               dev_dbg(cdns->dev, "Waiting till Host mode is turned on\n");
+               ret = readl_poll_timeout_atomic(&cdns->otg_regs->sts, val,
+                                               val & OTGSTS_XHCI_READY,
+                                               100000);
+               if (ret) {
+                       dev_err(cdns->dev, "timeout waiting for xhci_ready\n");
+                       return ret;
+               }
+       } else {
+               writel(OTGCMD_HOST_BUS_DROP | OTGCMD_DEV_BUS_DROP |
+                      OTGCMD_DEV_POWER_OFF | OTGCMD_HOST_POWER_OFF,
+                      &cdns->otg_regs->cmd);
+               /* Waiting till H_IDLE state.*/
+               readl_poll_timeout_atomic(&cdns->otg_regs->state, val,
+                                         !(val & OTGSTATE_HOST_STATE_MASK),
+                                         2000000);
+       }
+
+       return 0;
+}
+
+/**
+ * cdns3_drd_switch_gadget - start/stop gadget
+ * @cdns: Pointer to controller context structure
+ * @on: 1 for start, 0 for stop
+ *
+ * Returns 0 on success otherwise negative errno
+ */
+int cdns3_drd_switch_gadget(struct cdns3 *cdns, int on)
+{
+       int ret, val;
+       u32 reg = OTGCMD_OTG_DIS;
+
+       /* switch OTG core */
+       if (on) {
+               writel(OTGCMD_DEV_BUS_REQ | reg, &cdns->otg_regs->cmd);
+
+               dev_dbg(cdns->dev, "Waiting till Device mode is turned on\n");
+
+               ret = readl_poll_timeout_atomic(&cdns->otg_regs->sts, val,
+                                               val & OTGSTS_DEV_READY,
+                                               100000);
+               if (ret) {
+                       dev_err(cdns->dev, "timeout waiting for dev_ready\n");
+                       return ret;
+               }
+       } else {
+               /*
+                * driver should wait at least 10us after disabling Device
+                * before turning-off Device (DEV_BUS_DROP)
+                */
+               usleep_range(20, 30);
+               writel(OTGCMD_HOST_BUS_DROP | OTGCMD_DEV_BUS_DROP |
+                      OTGCMD_DEV_POWER_OFF | OTGCMD_HOST_POWER_OFF,
+                      &cdns->otg_regs->cmd);
+               /* Waiting till DEV_IDLE state.*/
+               readl_poll_timeout_atomic(&cdns->otg_regs->state, val,
+                                         !(val & OTGSTATE_DEV_STATE_MASK),
+                                         2000000);
+       }
+
+       return 0;
+}
+
+/**
+ * cdns3_init_otg_mode - initialize drd controller
+ * @cdns: Pointer to controller context structure
+ *
+ * Returns 0 on success otherwise negative errno
+ */
+static int cdns3_init_otg_mode(struct cdns3 *cdns)
+{
+       int ret = 0;
+
+       /* clear all interrupts */
+       writel(~0, &cdns->otg_regs->ivect);
+
+       ret = cdns3_set_mode(cdns, USB_DR_MODE_OTG);
+       if (ret)
+               return ret;
+
+       return ret;
+}
+
+/**
+ * cdns3_drd_update_mode - initialize mode of operation
+ * @cdns: Pointer to controller context structure
+ *
+ * Returns 0 on success otherwise negative errno
+ */
+int cdns3_drd_update_mode(struct cdns3 *cdns)
+{
+       int ret = 0;
+
+       switch (cdns->dr_mode) {
+       case USB_DR_MODE_PERIPHERAL:
+               ret = cdns3_set_mode(cdns, USB_DR_MODE_PERIPHERAL);
+               break;
+       case USB_DR_MODE_HOST:
+               ret = cdns3_set_mode(cdns, USB_DR_MODE_HOST);
+               break;
+       case USB_DR_MODE_OTG:
+               ret = cdns3_init_otg_mode(cdns);
+               break;
+       default:
+               dev_err(cdns->dev, "Unsupported mode of operation %d\n",
+                       cdns->dr_mode);
+               return -EINVAL;
+       }
+
+       return ret;
+}
+
+int cdns3_drd_init(struct cdns3 *cdns)
+{
+       void __iomem *regs;
+       int ret = 0;
+       u32 state;
+
+       regs = dev_remap_addr_name(cdns->dev, "otg");
+       if (!regs)
+               return -EINVAL;
+
+       /* Detection of DRD version. Controller has been released
+        * in two versions. Both are similar, but they have same changes
+        * in register maps.
+        * The first register in old version is command register and it's read
+        * only, so driver should read 0 from it. On the other hand, in v1
+        * the first register contains device ID number which is not set to 0.
+        * Driver uses this fact to detect the proper version of
+        * controller.
+        */
+       cdns->otg_v0_regs = regs;
+       if (!readl(&cdns->otg_v0_regs->cmd)) {
+               cdns->version  = CDNS3_CONTROLLER_V0;
+               cdns->otg_v1_regs = NULL;
+               cdns->otg_regs = regs;
+               writel(1, &cdns->otg_v0_regs->simulate);
+               dev_info(cdns->dev, "DRD version v0 (%08x)\n",
+                        readl(&cdns->otg_v0_regs->version));
+       } else {
+               cdns->otg_v0_regs = NULL;
+               cdns->otg_v1_regs = regs;
+               cdns->otg_regs = (void *)&cdns->otg_v1_regs->cmd;
+               cdns->version  = CDNS3_CONTROLLER_V1;
+               writel(1, &cdns->otg_v1_regs->simulate);
+               dev_info(cdns->dev, "DRD version v1 (ID: %08x, rev: %08x)\n",
+                        readl(&cdns->otg_v1_regs->did),
+                        readl(&cdns->otg_v1_regs->rid));
+       }
+
+       state = OTGSTS_STRAP(readl(&cdns->otg_regs->sts));
+
+       /* Update dr_mode according to STRAP configuration. */
+       cdns->dr_mode = USB_DR_MODE_OTG;
+       if (state == OTGSTS_STRAP_HOST) {
+               dev_dbg(cdns->dev, "Controller strapped to HOST\n");
+               cdns->dr_mode = USB_DR_MODE_HOST;
+       } else if (state == OTGSTS_STRAP_GADGET) {
+               dev_dbg(cdns->dev, "Controller strapped to PERIPHERAL\n");
+               cdns->dr_mode = USB_DR_MODE_PERIPHERAL;
+       }
+
+       state = readl(&cdns->otg_regs->sts);
+       if (OTGSTS_OTG_NRDY(state) != 0) {
+               dev_err(cdns->dev, "Cadence USB3 OTG device not ready\n");
+               return -ENODEV;
+       }
+
+       return ret;
+}
+
+int cdns3_drd_exit(struct cdns3 *cdns)
+{
+       return 0;
+}
diff --git a/drivers/usb/cdns3/drd.h b/drivers/usb/cdns3/drd.h
new file mode 100644 (file)
index 0000000..815b93f
--- /dev/null
@@ -0,0 +1,166 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Cadence USB3 DRD header file.
+ *
+ * Copyright (C) 2018-2019 Cadence.
+ *
+ * Author: Pawel Laszczak <pawell@cadence.com>
+ */
+#ifndef __LINUX_CDNS3_DRD
+#define __LINUX_CDNS3_DRD
+
+#include <linux/types.h>
+#include <linux/usb/otg.h>
+#include "core.h"
+
+/*  DRD register interface for version v1. */
+struct cdns3_otg_regs {
+       __le32 did;
+       __le32 rid;
+       __le32 capabilities;
+       __le32 reserved1;
+       __le32 cmd;
+       __le32 sts;
+       __le32 state;
+       __le32 reserved2;
+       __le32 ien;
+       __le32 ivect;
+       __le32 refclk;
+       __le32 tmr;
+       __le32 reserved3[4];
+       __le32 simulate;
+       __le32 override;
+       __le32 susp_ctrl;
+       __le32 reserved4;
+       __le32 anasts;
+       __le32 adp_ramp_time;
+       __le32 ctrl1;
+       __le32 ctrl2;
+};
+
+/*  DRD register interface for version v0. */
+struct cdns3_otg_legacy_regs {
+       __le32 cmd;
+       __le32 sts;
+       __le32 state;
+       __le32 refclk;
+       __le32 ien;
+       __le32 ivect;
+       __le32 reserved1[3];
+       __le32 tmr;
+       __le32 reserved2[2];
+       __le32 version;
+       __le32 capabilities;
+       __le32 reserved3[2];
+       __le32 simulate;
+       __le32 reserved4[5];
+       __le32 ctrl1;
+};
+
+/*
+ * Common registers interface for both version of DRD.
+ */
+struct cdns3_otg_common_regs {
+       __le32 cmd;
+       __le32 sts;
+       __le32 state;
+       __le32 different1;
+       __le32 ien;
+       __le32 ivect;
+};
+
+/* CDNS_RID - bitmasks */
+#define CDNS_RID(p)                    ((p) & GENMASK(15, 0))
+
+/* CDNS_VID - bitmasks */
+#define CDNS_DID(p)                    ((p) & GENMASK(31, 0))
+
+/* OTGCMD - bitmasks */
+/* "Request the bus for Device mode. */
+#define OTGCMD_DEV_BUS_REQ             BIT(0)
+/* Request the bus for Host mode */
+#define OTGCMD_HOST_BUS_REQ            BIT(1)
+/* Enable OTG mode. */
+#define OTGCMD_OTG_EN                  BIT(2)
+/* Disable OTG mode */
+#define OTGCMD_OTG_DIS                 BIT(3)
+/*"Configure OTG as A-Device. */
+#define OTGCMD_A_DEV_EN                        BIT(4)
+/*"Configure OTG as A-Device. */
+#define OTGCMD_A_DEV_DIS               BIT(5)
+/* Drop the bus for Device mod e. */
+#define OTGCMD_DEV_BUS_DROP            BIT(8)
+/* Drop the bus for Host mode*/
+#define OTGCMD_HOST_BUS_DROP           BIT(9)
+/* Power Down USBSS-DEV. */
+#define OTGCMD_DEV_POWER_OFF           BIT(11)
+/* Power Down CDNSXHCI. */
+#define OTGCMD_HOST_POWER_OFF          BIT(12)
+
+/* OTGIEN - bitmasks */
+/* ID change interrupt enable */
+#define OTGIEN_ID_CHANGE_INT           BIT(0)
+/* Vbusvalid fall detected interrupt enable.*/
+#define OTGIEN_VBUSVALID_RISE_INT      BIT(4)
+/* Vbusvalid fall detected interrupt enable */
+#define OTGIEN_VBUSVALID_FALL_INT      BIT(5)
+
+/* OTGSTS - bitmasks */
+/*
+ * Current value of the ID pin. It is only valid when idpullup in
+ *  OTGCTRL1_TYPE register is set to '1'.
+ */
+#define OTGSTS_ID_VALUE                        BIT(0)
+/* Current value of the vbus_valid */
+#define OTGSTS_VBUS_VALID              BIT(1)
+/* Current value of the b_sess_vld */
+#define OTGSTS_SESSION_VALID           BIT(2)
+/*Device mode is active*/
+#define OTGSTS_DEV_ACTIVE              BIT(3)
+/* Host mode is active. */
+#define OTGSTS_HOST_ACTIVE             BIT(4)
+/* OTG Controller not ready. */
+#define OTGSTS_OTG_NRDY_MASK           BIT(11)
+#define OTGSTS_OTG_NRDY(p)             ((p) & OTGSTS_OTG_NRDY_MASK)
+/*
+ * Value of the strap pins.
+ * 000 - no default configuration
+ * 010 - Controller initiall configured as Host
+ * 100 - Controller initially configured as Device
+ */
+#define OTGSTS_STRAP(p)                        (((p) & GENMASK(14, 12)) >> 12)
+#define OTGSTS_STRAP_NO_DEFAULT_CFG    0x00
+#define OTGSTS_STRAP_HOST_OTG          0x01
+#define OTGSTS_STRAP_HOST              0x02
+#define OTGSTS_STRAP_GADGET            0x04
+/* Host mode is turned on. */
+#define OTGSTS_XHCI_READY              BIT(26)
+/* "Device mode is turned on .*/
+#define OTGSTS_DEV_READY               BIT(27)
+
+/* OTGSTATE- bitmasks */
+#define OTGSTATE_DEV_STATE_MASK                GENMASK(2, 0)
+#define OTGSTATE_HOST_STATE_MASK       GENMASK(5, 3)
+#define OTGSTATE_HOST_STATE_IDLE       0x0
+#define OTGSTATE_HOST_STATE_VBUS_FALL  0x7
+#define OTGSTATE_HOST_STATE(p)         (((p) & OTGSTATE_HOST_STATE_MASK) >> 3)
+
+/* OTGREFCLK - bitmasks */
+#define OTGREFCLK_STB_CLK_SWITCH_EN    BIT(31)
+
+/* OVERRIDE - bitmasks */
+#define OVERRIDE_IDPULLUP              BIT(0)
+/* Only for CDNS3_CONTROLLER_V0 version */
+#define OVERRIDE_IDPULLUP_V0           BIT(24)
+
+int cdns3_is_host(struct cdns3 *cdns);
+int cdns3_is_device(struct cdns3 *cdns);
+int cdns3_get_id(struct cdns3 *cdns);
+int cdns3_get_vbus(struct cdns3 *cdns);
+int cdns3_drd_init(struct cdns3 *cdns);
+int cdns3_drd_exit(struct cdns3 *cdns);
+int cdns3_drd_update_mode(struct cdns3 *cdns);
+int cdns3_drd_switch_gadget(struct cdns3 *cdns, int on);
+int cdns3_drd_switch_host(struct cdns3 *cdns, int on);
+
+#endif /* __LINUX_CDNS3_DRD */
diff --git a/drivers/usb/cdns3/ep0.c b/drivers/usb/cdns3/ep0.c
new file mode 100644 (file)
index 0000000..1903f61
--- /dev/null
@@ -0,0 +1,910 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Cadence USBSS DRD Driver - gadget side.
+ *
+ * Copyright (C) 2018 Cadence Design Systems.
+ * Copyright (C) 2017-2018 NXP
+ *
+ * Authors: Pawel Jez <pjez@cadence.com>,
+ *          Pawel Laszczak <pawell@cadence.com>
+ *          Peter Chen <peter.chen@nxp.com>
+ */
+
+#include <linux/usb/composite.h>
+#include <linux/iopoll.h>
+
+#include "gadget.h"
+#include "trace.h"
+
+#define readl_poll_timeout_atomic readl_poll_timeout
+#define usleep_range(a, b) udelay((b))
+
+static struct usb_endpoint_descriptor cdns3_gadget_ep0_desc = {
+       .bLength = USB_DT_ENDPOINT_SIZE,
+       .bDescriptorType = USB_DT_ENDPOINT,
+       .bmAttributes = USB_ENDPOINT_XFER_CONTROL,
+};
+
+/**
+ * cdns3_ep0_run_transfer - Do transfer on default endpoint hardware
+ * @priv_dev: extended gadget object
+ * @dma_addr: physical address where data is/will be stored
+ * @length: data length
+ * @erdy: set it to 1 when ERDY packet should be sent -
+ *        exit from flow control state
+ */
+static void cdns3_ep0_run_transfer(struct cdns3_device *priv_dev,
+                                  dma_addr_t dma_addr,
+                                  unsigned int length, int erdy, int zlp)
+{
+       struct cdns3_usb_regs __iomem *regs = priv_dev->regs;
+       struct cdns3_endpoint *priv_ep = priv_dev->eps[0];
+
+       priv_ep->trb_pool[0].buffer = TRB_BUFFER(dma_addr);
+       priv_ep->trb_pool[0].length = TRB_LEN(length);
+
+       if (zlp) {
+               priv_ep->trb_pool[0].control = TRB_CYCLE | TRB_TYPE(TRB_NORMAL);
+               priv_ep->trb_pool[1].buffer = TRB_BUFFER(dma_addr);
+               priv_ep->trb_pool[1].length = TRB_LEN(0);
+               priv_ep->trb_pool[1].control = TRB_CYCLE | TRB_IOC |
+                   TRB_TYPE(TRB_NORMAL);
+       } else {
+               priv_ep->trb_pool[0].control = TRB_CYCLE | TRB_IOC |
+                   TRB_TYPE(TRB_NORMAL);
+               priv_ep->trb_pool[1].control = 0;
+       }
+
+       /* Flush both TRBs */
+       flush_dcache_range((unsigned long)priv_ep->trb_pool,
+                          (unsigned long)priv_ep->trb_pool +
+                          ROUND(sizeof(struct cdns3_trb) * 2,
+                                CONFIG_SYS_CACHELINE_SIZE));
+
+       trace_cdns3_prepare_trb(priv_ep, priv_ep->trb_pool);
+
+       cdns3_select_ep(priv_dev, priv_dev->ep0_data_dir);
+
+       writel(EP_STS_TRBERR, &regs->ep_sts);
+       writel(EP_TRADDR_TRADDR(priv_ep->trb_pool_dma), &regs->ep_traddr);
+       trace_cdns3_doorbell_ep0(priv_dev->ep0_data_dir ? "ep0in" : "ep0out",
+                                readl(&regs->ep_traddr));
+
+       /* TRB should be prepared before starting transfer. */
+       writel(EP_CMD_DRDY, &regs->ep_cmd);
+
+       /* Resume controller before arming transfer. */
+       __cdns3_gadget_wakeup(priv_dev);
+
+       if (erdy)
+               writel(EP_CMD_ERDY, &priv_dev->regs->ep_cmd);
+}
+
+/**
+ * cdns3_ep0_delegate_req - Returns status of handling setup packet
+ * Setup is handled by gadget driver
+ * @priv_dev: extended gadget object
+ * @ctrl_req: pointer to received setup packet
+ *
+ * Returns zero on success or negative value on failure
+ */
+static int cdns3_ep0_delegate_req(struct cdns3_device *priv_dev,
+                                 struct usb_ctrlrequest *ctrl_req)
+{
+       int ret;
+
+       spin_unlock(&priv_dev->lock);
+       priv_dev->setup_pending = 1;
+       ret = priv_dev->gadget_driver->setup(&priv_dev->gadget, ctrl_req);
+       priv_dev->setup_pending = 0;
+       spin_lock(&priv_dev->lock);
+       return ret;
+}
+
+static void cdns3_prepare_setup_packet(struct cdns3_device *priv_dev)
+{
+       priv_dev->ep0_data_dir = 0;
+       priv_dev->ep0_stage = CDNS3_SETUP_STAGE;
+       cdns3_ep0_run_transfer(priv_dev, priv_dev->setup_dma,
+                              sizeof(struct usb_ctrlrequest), 0, 0);
+}
+
+static void cdns3_ep0_complete_setup(struct cdns3_device *priv_dev,
+                                    u8 send_stall, u8 send_erdy)
+{
+       struct cdns3_endpoint *priv_ep = priv_dev->eps[0];
+       struct usb_request *request;
+
+       request = cdns3_next_request(&priv_ep->pending_req_list);
+       if (request)
+               list_del_init(&request->list);
+
+       if (send_stall) {
+               trace_cdns3_halt(priv_ep, send_stall, 0);
+               /* set_stall on ep0 */
+               cdns3_select_ep(priv_dev, 0x00);
+               writel(EP_CMD_SSTALL, &priv_dev->regs->ep_cmd);
+       } else {
+               cdns3_prepare_setup_packet(priv_dev);
+       }
+
+       priv_dev->ep0_stage = CDNS3_SETUP_STAGE;
+       writel((send_erdy ? EP_CMD_ERDY : 0) | EP_CMD_REQ_CMPL,
+              &priv_dev->regs->ep_cmd);
+
+       cdns3_allow_enable_l1(priv_dev, 1);
+}
+
+/**
+ * cdns3_req_ep0_set_configuration - Handling of SET_CONFIG standard USB request
+ * @priv_dev: extended gadget object
+ * @ctrl_req: pointer to received setup packet
+ *
+ * Returns 0 if success, USB_GADGET_DELAYED_STATUS on deferred status stage,
+ * error code on error
+ */
+static int cdns3_req_ep0_set_configuration(struct cdns3_device *priv_dev,
+                                          struct usb_ctrlrequest *ctrl_req)
+{
+       enum usb_device_state device_state = priv_dev->gadget.state;
+       struct cdns3_endpoint *priv_ep;
+       u32 config = le16_to_cpu(ctrl_req->wValue);
+       int result = 0;
+       int i;
+
+       switch (device_state) {
+       case USB_STATE_ADDRESS:
+               /* Configure non-control EPs */
+               for (i = 0; i < CDNS3_ENDPOINTS_MAX_COUNT; i++) {
+                       priv_ep = priv_dev->eps[i];
+                       if (!priv_ep)
+                               continue;
+
+                       if (priv_ep->flags & EP_CLAIMED)
+                               cdns3_ep_config(priv_ep);
+               }
+
+               result = cdns3_ep0_delegate_req(priv_dev, ctrl_req);
+
+               if (result)
+                       return result;
+
+               if (config) {
+                       cdns3_set_hw_configuration(priv_dev);
+               } else {
+                       cdns3_hw_reset_eps_config(priv_dev);
+                       usb_gadget_set_state(&priv_dev->gadget,
+                                            USB_STATE_ADDRESS);
+               }
+               break;
+       case USB_STATE_CONFIGURED:
+               result = cdns3_ep0_delegate_req(priv_dev, ctrl_req);
+
+               if (!config && !result) {
+                       cdns3_hw_reset_eps_config(priv_dev);
+                       usb_gadget_set_state(&priv_dev->gadget,
+                                            USB_STATE_ADDRESS);
+               }
+               break;
+       default:
+               result = -EINVAL;
+       }
+
+       return result;
+}
+
+/**
+ * cdns3_req_ep0_set_address - Handling of SET_ADDRESS standard USB request
+ * @priv_dev: extended gadget object
+ * @ctrl_req: pointer to received setup packet
+ *
+ * Returns 0 if success, error code on error
+ */
+static int cdns3_req_ep0_set_address(struct cdns3_device *priv_dev,
+                                    struct usb_ctrlrequest *ctrl_req)
+{
+       enum usb_device_state device_state = priv_dev->gadget.state;
+       u32 reg;
+       u32 addr;
+
+       addr = le16_to_cpu(ctrl_req->wValue);
+
+       if (addr > USB_DEVICE_MAX_ADDRESS) {
+               dev_err(priv_dev->dev,
+                       "Device address (%d) cannot be greater than %d\n",
+                       addr, USB_DEVICE_MAX_ADDRESS);
+               return -EINVAL;
+       }
+
+       if (device_state == USB_STATE_CONFIGURED) {
+               dev_err(priv_dev->dev,
+                       "can't set_address from configured state\n");
+               return -EINVAL;
+       }
+
+       reg = readl(&priv_dev->regs->usb_cmd);
+
+       writel(reg | USB_CMD_FADDR(addr) | USB_CMD_SET_ADDR,
+              &priv_dev->regs->usb_cmd);
+
+       usb_gadget_set_state(&priv_dev->gadget,
+                            (addr ? USB_STATE_ADDRESS : USB_STATE_DEFAULT));
+
+       return 0;
+}
+
+/**
+ * cdns3_req_ep0_get_status - Handling of GET_STATUS standard USB request
+ * @priv_dev: extended gadget object
+ * @ctrl_req: pointer to received setup packet
+ *
+ * Returns 0 if success, error code on error
+ */
+static int cdns3_req_ep0_get_status(struct cdns3_device *priv_dev,
+                                   struct usb_ctrlrequest *ctrl)
+{
+       __le16 *response_pkt;
+       u16 usb_status = 0;
+       u32 recip;
+
+       recip = ctrl->bRequestType & USB_RECIP_MASK;
+
+       switch (recip) {
+       case USB_RECIP_DEVICE:
+               /* self powered */
+               if (priv_dev->is_selfpowered)
+                       usb_status = BIT(USB_DEVICE_SELF_POWERED);
+
+               if (priv_dev->wake_up_flag)
+                       usb_status |= BIT(USB_DEVICE_REMOTE_WAKEUP);
+
+               if (priv_dev->gadget.speed != USB_SPEED_SUPER)
+                       break;
+
+               if (priv_dev->u1_allowed)
+                       usb_status |= BIT(USB_DEV_STAT_U1_ENABLED);
+
+               if (priv_dev->u2_allowed)
+                       usb_status |= BIT(USB_DEV_STAT_U2_ENABLED);
+
+               break;
+       case USB_RECIP_INTERFACE:
+               return cdns3_ep0_delegate_req(priv_dev, ctrl);
+       case USB_RECIP_ENDPOINT:
+               /* check if endpoint is stalled */
+               cdns3_select_ep(priv_dev, ctrl->wIndex);
+               if (EP_STS_STALL(readl(&priv_dev->regs->ep_sts)))
+                       usb_status =  BIT(USB_ENDPOINT_HALT);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       response_pkt = (__le16 *)priv_dev->setup_buf;
+       *response_pkt = cpu_to_le16(usb_status);
+
+       /* Flush setup response */
+       flush_dcache_range((unsigned long)priv_dev->setup_buf,
+                          (unsigned long)priv_dev->setup_buf +
+                          ROUND(sizeof(struct usb_ctrlrequest),
+                                CONFIG_SYS_CACHELINE_SIZE));
+
+       cdns3_ep0_run_transfer(priv_dev, priv_dev->setup_dma,
+                              sizeof(*response_pkt), 1, 0);
+       return 0;
+}
+
+static int cdns3_ep0_feature_handle_device(struct cdns3_device *priv_dev,
+                                          struct usb_ctrlrequest *ctrl,
+                                          int set)
+{
+       enum usb_device_state state;
+       enum usb_device_speed speed;
+       int ret = 0;
+       u16 tmode;
+
+       state = priv_dev->gadget.state;
+       speed = priv_dev->gadget.speed;
+
+       switch (ctrl->wValue) {
+       case USB_DEVICE_REMOTE_WAKEUP:
+               priv_dev->wake_up_flag = !!set;
+               break;
+       case USB_DEVICE_U1_ENABLE:
+               if (state != USB_STATE_CONFIGURED || speed != USB_SPEED_SUPER)
+                       return -EINVAL;
+
+               priv_dev->u1_allowed = !!set;
+               break;
+       case USB_DEVICE_U2_ENABLE:
+               if (state != USB_STATE_CONFIGURED || speed != USB_SPEED_SUPER)
+                       return -EINVAL;
+
+               priv_dev->u2_allowed = !!set;
+               break;
+       case USB_DEVICE_LTM_ENABLE:
+               ret = -EINVAL;
+               break;
+       case USB_DEVICE_TEST_MODE:
+               if (state != USB_STATE_CONFIGURED || speed > USB_SPEED_HIGH)
+                       return -EINVAL;
+
+               tmode = le16_to_cpu(ctrl->wIndex);
+
+               if (!set || (tmode & 0xff) != 0)
+                       return -EINVAL;
+
+               switch (tmode >> 8) {
+               case TEST_J:
+               case TEST_K:
+               case TEST_SE0_NAK:
+               case TEST_PACKET:
+                       cdns3_ep0_complete_setup(priv_dev, 0, 1);
+                       /**
+                        *  Little delay to give the controller some time
+                        * for sending status stage.
+                        * This time should be less then 3ms.
+                        */
+                       usleep_range(1000, 2000);
+                       cdns3_set_register_bit(&priv_dev->regs->usb_cmd,
+                                              USB_CMD_STMODE |
+                                              USB_STS_TMODE_SEL(tmode - 1));
+                       break;
+               default:
+                       ret = -EINVAL;
+               }
+               break;
+       default:
+               ret = -EINVAL;
+       }
+
+       return ret;
+}
+
+static int cdns3_ep0_feature_handle_intf(struct cdns3_device *priv_dev,
+                                        struct usb_ctrlrequest *ctrl,
+                                        int set)
+{
+       u32 wValue;
+       int ret = 0;
+
+       wValue = le16_to_cpu(ctrl->wValue);
+
+       switch (wValue) {
+       case USB_INTRF_FUNC_SUSPEND:
+               break;
+       default:
+               ret = -EINVAL;
+       }
+
+       return ret;
+}
+
+static int cdns3_ep0_feature_handle_endpoint(struct cdns3_device *priv_dev,
+                                            struct usb_ctrlrequest *ctrl,
+                                            int set)
+{
+       struct cdns3_endpoint *priv_ep;
+       int ret = 0;
+       u8 index;
+
+       if (le16_to_cpu(ctrl->wValue) != USB_ENDPOINT_HALT)
+               return -EINVAL;
+
+       if (!(ctrl->wIndex & ~USB_DIR_IN))
+               return 0;
+
+       index = cdns3_ep_addr_to_index(ctrl->wIndex);
+       priv_ep = priv_dev->eps[index];
+
+       cdns3_select_ep(priv_dev, ctrl->wIndex);
+
+       if (set)
+               __cdns3_gadget_ep_set_halt(priv_ep);
+       else if (!(priv_ep->flags & EP_WEDGE))
+               ret = __cdns3_gadget_ep_clear_halt(priv_ep);
+
+       cdns3_select_ep(priv_dev, 0x00);
+
+       return ret;
+}
+
+/**
+ * cdns3_req_ep0_handle_feature -
+ * Handling of GET/SET_FEATURE standard USB request
+ *
+ * @priv_dev: extended gadget object
+ * @ctrl_req: pointer to received setup packet
+ * @set: must be set to 1 for SET_FEATURE request
+ *
+ * Returns 0 if success, error code on error
+ */
+static int cdns3_req_ep0_handle_feature(struct cdns3_device *priv_dev,
+                                       struct usb_ctrlrequest *ctrl,
+                                       int set)
+{
+       int ret = 0;
+       u32 recip;
+
+       recip = ctrl->bRequestType & USB_RECIP_MASK;
+
+       switch (recip) {
+       case USB_RECIP_DEVICE:
+               ret = cdns3_ep0_feature_handle_device(priv_dev, ctrl, set);
+               break;
+       case USB_RECIP_INTERFACE:
+               ret = cdns3_ep0_feature_handle_intf(priv_dev, ctrl, set);
+               break;
+       case USB_RECIP_ENDPOINT:
+               ret = cdns3_ep0_feature_handle_endpoint(priv_dev, ctrl, set);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return ret;
+}
+
+/**
+ * cdns3_req_ep0_set_sel - Handling of SET_SEL standard USB request
+ * @priv_dev: extended gadget object
+ * @ctrl_req: pointer to received setup packet
+ *
+ * Returns 0 if success, error code on error
+ */
+static int cdns3_req_ep0_set_sel(struct cdns3_device *priv_dev,
+                                struct usb_ctrlrequest *ctrl_req)
+{
+       if (priv_dev->gadget.state < USB_STATE_ADDRESS)
+               return -EINVAL;
+
+       if (ctrl_req->wLength != 6) {
+               dev_err(priv_dev->dev, "Set SEL should be 6 bytes, got %d\n",
+                       ctrl_req->wLength);
+               return -EINVAL;
+       }
+
+       cdns3_ep0_run_transfer(priv_dev, priv_dev->setup_dma, 6, 1, 0);
+       return 0;
+}
+
+/**
+ * cdns3_req_ep0_set_isoch_delay -
+ * Handling of GET_ISOCH_DELAY standard USB request
+ * @priv_dev: extended gadget object
+ * @ctrl_req: pointer to received setup packet
+ *
+ * Returns 0 if success, error code on error
+ */
+static int cdns3_req_ep0_set_isoch_delay(struct cdns3_device *priv_dev,
+                                        struct usb_ctrlrequest *ctrl_req)
+{
+       if (ctrl_req->wIndex || ctrl_req->wLength)
+               return -EINVAL;
+
+       priv_dev->isoch_delay = ctrl_req->wValue;
+
+       return 0;
+}
+
+/**
+ * cdns3_ep0_standard_request - Handling standard USB requests
+ * @priv_dev: extended gadget object
+ * @ctrl_req: pointer to received setup packet
+ *
+ * Returns 0 if success, error code on error
+ */
+static int cdns3_ep0_standard_request(struct cdns3_device *priv_dev,
+                                     struct usb_ctrlrequest *ctrl_req)
+{
+       int ret;
+
+       switch (ctrl_req->bRequest) {
+       case USB_REQ_SET_ADDRESS:
+               ret = cdns3_req_ep0_set_address(priv_dev, ctrl_req);
+               break;
+       case USB_REQ_SET_CONFIGURATION:
+               ret = cdns3_req_ep0_set_configuration(priv_dev, ctrl_req);
+               break;
+       case USB_REQ_GET_STATUS:
+               ret = cdns3_req_ep0_get_status(priv_dev, ctrl_req);
+               break;
+       case USB_REQ_CLEAR_FEATURE:
+               ret = cdns3_req_ep0_handle_feature(priv_dev, ctrl_req, 0);
+               break;
+       case USB_REQ_SET_FEATURE:
+               ret = cdns3_req_ep0_handle_feature(priv_dev, ctrl_req, 1);
+               break;
+       case USB_REQ_SET_SEL:
+               ret = cdns3_req_ep0_set_sel(priv_dev, ctrl_req);
+               break;
+       case USB_REQ_SET_ISOCH_DELAY:
+               ret = cdns3_req_ep0_set_isoch_delay(priv_dev, ctrl_req);
+               break;
+       default:
+               ret = cdns3_ep0_delegate_req(priv_dev, ctrl_req);
+               break;
+       }
+
+       return ret;
+}
+
+static void __pending_setup_status_handler(struct cdns3_device *priv_dev)
+{
+       struct usb_request *request = priv_dev->pending_status_request;
+
+       if (priv_dev->status_completion_no_call && request &&
+           request->complete) {
+               request->complete(&priv_dev->eps[0]->endpoint, request);
+               priv_dev->status_completion_no_call = 0;
+       }
+}
+
+void cdns3_pending_setup_status_handler(struct work_struct *work)
+{
+       struct cdns3_device *priv_dev = container_of(work, struct cdns3_device,
+                       pending_status_wq);
+       unsigned long flags;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+       __pending_setup_status_handler(priv_dev);
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+}
+
+/**
+ * cdns3_ep0_setup_phase - Handling setup USB requests
+ * @priv_dev: extended gadget object
+ */
+static void cdns3_ep0_setup_phase(struct cdns3_device *priv_dev)
+{
+       struct usb_ctrlrequest *ctrl = priv_dev->setup_buf;
+       struct cdns3_endpoint *priv_ep = priv_dev->eps[0];
+       int result;
+
+       priv_dev->ep0_data_dir = ctrl->bRequestType & USB_DIR_IN;
+
+       trace_cdns3_ctrl_req(ctrl);
+
+       if (!list_empty(&priv_ep->pending_req_list)) {
+               struct usb_request *request;
+
+               request = cdns3_next_request(&priv_ep->pending_req_list);
+               priv_ep->dir = priv_dev->ep0_data_dir;
+               cdns3_gadget_giveback(priv_ep, to_cdns3_request(request),
+                                     -ECONNRESET);
+       }
+
+       if (le16_to_cpu(ctrl->wLength))
+               priv_dev->ep0_stage = CDNS3_DATA_STAGE;
+       else
+               priv_dev->ep0_stage = CDNS3_STATUS_STAGE;
+
+       if ((ctrl->bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD)
+               result = cdns3_ep0_standard_request(priv_dev, ctrl);
+       else
+               result = cdns3_ep0_delegate_req(priv_dev, ctrl);
+
+       if (result == USB_GADGET_DELAYED_STATUS)
+               return;
+
+       if (result < 0)
+               cdns3_ep0_complete_setup(priv_dev, 1, 1);
+       else if (priv_dev->ep0_stage == CDNS3_STATUS_STAGE)
+               cdns3_ep0_complete_setup(priv_dev, 0, 1);
+}
+
+static void cdns3_transfer_completed(struct cdns3_device *priv_dev)
+{
+       struct cdns3_endpoint *priv_ep = priv_dev->eps[0];
+
+       if (!list_empty(&priv_ep->pending_req_list)) {
+               struct usb_request *request;
+
+               trace_cdns3_complete_trb(priv_ep, priv_ep->trb_pool);
+               request = cdns3_next_request(&priv_ep->pending_req_list);
+
+               /* Invalidate TRB before accessing it */
+               invalidate_dcache_range((unsigned long)priv_ep->trb_pool,
+                                       (unsigned long)priv_ep->trb_pool +
+                                       ROUND(sizeof(struct cdns3_trb),
+                                             CONFIG_SYS_CACHELINE_SIZE));
+
+               request->actual =
+                       TRB_LEN(le32_to_cpu(priv_ep->trb_pool->length));
+
+               priv_ep->dir = priv_dev->ep0_data_dir;
+               cdns3_gadget_giveback(priv_ep, to_cdns3_request(request), 0);
+       }
+
+       cdns3_ep0_complete_setup(priv_dev, 0, 0);
+}
+
+/**
+ * cdns3_check_new_setup - Check if controller receive new SETUP packet.
+ * @priv_dev: extended gadget object
+ *
+ * The SETUP packet can be kept in on-chip memory or in system memory.
+ */
+static bool cdns3_check_new_setup(struct cdns3_device *priv_dev)
+{
+       u32 ep_sts_reg;
+
+       cdns3_select_ep(priv_dev, 0 | USB_DIR_OUT);
+       ep_sts_reg = readl(&priv_dev->regs->ep_sts);
+
+       return !!(ep_sts_reg & (EP_STS_SETUP | EP_STS_STPWAIT));
+}
+
+/**
+ * cdns3_check_ep0_interrupt_proceed - Processes interrupt related to endpoint 0
+ * @priv_dev: extended gadget object
+ * @dir: USB_DIR_IN for IN direction, USB_DIR_OUT for OUT direction
+ */
+void cdns3_check_ep0_interrupt_proceed(struct cdns3_device *priv_dev, int dir)
+{
+       u32 ep_sts_reg;
+
+       cdns3_select_ep(priv_dev, dir);
+
+       ep_sts_reg = readl(&priv_dev->regs->ep_sts);
+       writel(ep_sts_reg, &priv_dev->regs->ep_sts);
+
+       trace_cdns3_ep0_irq(priv_dev, ep_sts_reg);
+
+       __pending_setup_status_handler(priv_dev);
+
+       if (ep_sts_reg & EP_STS_SETUP)
+               priv_dev->wait_for_setup = 1;
+
+       if (priv_dev->wait_for_setup && ep_sts_reg & EP_STS_IOC) {
+               priv_dev->wait_for_setup = 0;
+               cdns3_allow_enable_l1(priv_dev, 0);
+               cdns3_ep0_setup_phase(priv_dev);
+       } else if ((ep_sts_reg & EP_STS_IOC) || (ep_sts_reg & EP_STS_ISP)) {
+               priv_dev->ep0_data_dir = dir;
+               cdns3_transfer_completed(priv_dev);
+       }
+
+       if (ep_sts_reg & EP_STS_DESCMIS) {
+               if (dir == 0 && !priv_dev->setup_pending)
+                       cdns3_prepare_setup_packet(priv_dev);
+       }
+}
+
+/**
+ * cdns3_gadget_ep0_enable
+ * Function shouldn't be called by gadget driver,
+ * endpoint 0 is allways active
+ */
+static int cdns3_gadget_ep0_enable(struct usb_ep *ep,
+                                  const struct usb_endpoint_descriptor *desc)
+{
+       return -EINVAL;
+}
+
+/**
+ * cdns3_gadget_ep0_disable
+ * Function shouldn't be called by gadget driver,
+ * endpoint 0 is allways active
+ */
+static int cdns3_gadget_ep0_disable(struct usb_ep *ep)
+{
+       return -EINVAL;
+}
+
+/**
+ * cdns3_gadget_ep0_set_halt
+ * @ep: pointer to endpoint zero object
+ * @value: 1 for set stall, 0 for clear stall
+ *
+ * Returns 0
+ */
+static int cdns3_gadget_ep0_set_halt(struct usb_ep *ep, int value)
+{
+       /* TODO */
+       return 0;
+}
+
+/**
+ * cdns3_gadget_ep0_queue Transfer data on endpoint zero
+ * @ep: pointer to endpoint zero object
+ * @request: pointer to request object
+ * @gfp_flags: gfp flags
+ *
+ * Returns 0 on success, error code elsewhere
+ */
+static int cdns3_gadget_ep0_queue(struct usb_ep *ep,
+                                 struct usb_request *request,
+                                 gfp_t gfp_flags)
+{
+       struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep);
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       unsigned long flags;
+       int erdy_sent = 0;
+       int ret = 0;
+       u8 zlp = 0;
+
+       trace_cdns3_ep0_queue(priv_dev, request);
+
+       /* cancel the request if controller receive new SETUP packet. */
+       if (cdns3_check_new_setup(priv_dev))
+               return -ECONNRESET;
+
+       /* send STATUS stage. Should be called only for SET_CONFIGURATION */
+       if (priv_dev->ep0_stage == CDNS3_STATUS_STAGE) {
+               spin_lock_irqsave(&priv_dev->lock, flags);
+               cdns3_select_ep(priv_dev, 0x00);
+
+               erdy_sent = !priv_dev->hw_configured_flag;
+               cdns3_set_hw_configuration(priv_dev);
+
+               if (!erdy_sent)
+                       cdns3_ep0_complete_setup(priv_dev, 0, 1);
+
+               cdns3_allow_enable_l1(priv_dev, 1);
+
+               request->actual = 0;
+               priv_dev->status_completion_no_call = true;
+               priv_dev->pending_status_request = request;
+               spin_unlock_irqrestore(&priv_dev->lock, flags);
+
+               /*
+                * Since there is no completion interrupt for status stage,
+                * it needs to call ->completion in software after
+                * ep0_queue is back.
+                */
+#ifndef __UBOOT__
+               queue_work(system_freezable_wq, &priv_dev->pending_status_wq);
+#else
+               __pending_setup_status_handler(priv_dev);
+#endif
+               return 0;
+       }
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+       if (!list_empty(&priv_ep->pending_req_list)) {
+               dev_err(priv_dev->dev,
+                       "can't handle multiple requests for ep0\n");
+               spin_unlock_irqrestore(&priv_dev->lock, flags);
+               return -EBUSY;
+       }
+
+       ret = usb_gadget_map_request(&priv_dev->gadget, request,
+                                    priv_dev->ep0_data_dir);
+       if (ret) {
+               spin_unlock_irqrestore(&priv_dev->lock, flags);
+               dev_err(priv_dev->dev, "failed to map request\n");
+               return -EINVAL;
+       }
+
+       request->status = -EINPROGRESS;
+       list_add_tail(&request->list, &priv_ep->pending_req_list);
+
+       if (request->zero && request->length &&
+           (request->length % ep->maxpacket == 0))
+               zlp = 1;
+
+       cdns3_ep0_run_transfer(priv_dev, request->dma, request->length, 1, zlp);
+
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+
+       return ret;
+}
+
+/**
+ * cdns3_gadget_ep_set_wedge Set wedge on selected endpoint
+ * @ep: endpoint object
+ *
+ * Returns 0
+ */
+int cdns3_gadget_ep_set_wedge(struct usb_ep *ep)
+{
+       struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep);
+
+       dev_dbg(priv_dev->dev, "Wedge for %s\n", ep->name);
+       cdns3_gadget_ep_set_halt(ep, 1);
+       priv_ep->flags |= EP_WEDGE;
+
+       return 0;
+}
+
+const struct usb_ep_ops cdns3_gadget_ep0_ops = {
+       .enable = cdns3_gadget_ep0_enable,
+       .disable = cdns3_gadget_ep0_disable,
+       .alloc_request = cdns3_gadget_ep_alloc_request,
+       .free_request = cdns3_gadget_ep_free_request,
+       .queue = cdns3_gadget_ep0_queue,
+       .dequeue = cdns3_gadget_ep_dequeue,
+       .set_halt = cdns3_gadget_ep0_set_halt,
+       .set_wedge = cdns3_gadget_ep_set_wedge,
+};
+
+/**
+ * cdns3_ep0_config - Configures default endpoint
+ * @priv_dev: extended gadget object
+ *
+ * Functions sets parameters: maximal packet size and enables interrupts
+ */
+void cdns3_ep0_config(struct cdns3_device *priv_dev)
+{
+       struct cdns3_usb_regs __iomem *regs;
+       struct cdns3_endpoint *priv_ep;
+       u32 max_packet_size = 64;
+
+       regs = priv_dev->regs;
+
+       if (priv_dev->gadget.speed == USB_SPEED_SUPER)
+               max_packet_size = 512;
+
+       priv_ep = priv_dev->eps[0];
+
+       if (!list_empty(&priv_ep->pending_req_list)) {
+               struct usb_request *request;
+
+               request = cdns3_next_request(&priv_ep->pending_req_list);
+               list_del_init(&request->list);
+       }
+
+       priv_dev->u1_allowed = 0;
+       priv_dev->u2_allowed = 0;
+
+       priv_dev->gadget.ep0->maxpacket = max_packet_size;
+       cdns3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(max_packet_size);
+
+       /* init ep out */
+       cdns3_select_ep(priv_dev, USB_DIR_OUT);
+
+       if (priv_dev->dev_ver >= DEV_VER_V3) {
+               cdns3_set_register_bit(&priv_dev->regs->dtrans,
+                                      BIT(0) | BIT(16));
+               cdns3_set_register_bit(&priv_dev->regs->tdl_from_trb,
+                                      BIT(0) | BIT(16));
+       }
+
+       writel(EP_CFG_ENABLE | EP_CFG_MAXPKTSIZE(max_packet_size),
+              &regs->ep_cfg);
+
+       writel(EP_STS_EN_SETUPEN | EP_STS_EN_DESCMISEN | EP_STS_EN_TRBERREN,
+              &regs->ep_sts_en);
+
+       /* init ep in */
+       cdns3_select_ep(priv_dev, USB_DIR_IN);
+
+       writel(EP_CFG_ENABLE | EP_CFG_MAXPKTSIZE(max_packet_size),
+              &regs->ep_cfg);
+
+       writel(EP_STS_EN_SETUPEN | EP_STS_EN_TRBERREN, &regs->ep_sts_en);
+
+       cdns3_set_register_bit(&regs->usb_conf, USB_CONF_U1DS | USB_CONF_U2DS);
+}
+
+/**
+ * cdns3_init_ep0 Initializes software endpoint 0 of gadget
+ * @priv_dev: extended gadget object
+ * @ep_priv: extended endpoint object
+ *
+ * Returns 0 on success else error code.
+ */
+int cdns3_init_ep0(struct cdns3_device *priv_dev,
+                  struct cdns3_endpoint *priv_ep)
+{
+       sprintf(priv_ep->name, "ep0");
+
+       /* fill linux fields */
+       priv_ep->endpoint.ops = &cdns3_gadget_ep0_ops;
+       priv_ep->endpoint.maxburst = 1;
+       usb_ep_set_maxpacket_limit(&priv_ep->endpoint,
+                                  CDNS3_EP0_MAX_PACKET_LIMIT);
+#ifndef __UBOOT__
+       priv_ep->endpoint.address = 0;
+#endif
+       priv_ep->endpoint.caps.type_control = 1;
+       priv_ep->endpoint.caps.dir_in = 1;
+       priv_ep->endpoint.caps.dir_out = 1;
+       priv_ep->endpoint.name = priv_ep->name;
+       priv_ep->endpoint.desc = &cdns3_gadget_ep0_desc;
+       priv_dev->gadget.ep0 = &priv_ep->endpoint;
+       priv_ep->type = USB_ENDPOINT_XFER_CONTROL;
+
+       return cdns3_allocate_trb_pool(priv_ep);
+}
diff --git a/drivers/usb/cdns3/gadget-export.h b/drivers/usb/cdns3/gadget-export.h
new file mode 100644 (file)
index 0000000..577469e
--- /dev/null
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Cadence USBSS DRD Driver - Gadget Export APIs.
+ *
+ * Copyright (C) 2017 NXP
+ * Copyright (C) 2017-2018 NXP
+ *
+ * Authors: Peter Chen <peter.chen@nxp.com>
+ */
+#ifndef __LINUX_CDNS3_GADGET_EXPORT
+#define __LINUX_CDNS3_GADGET_EXPORT
+
+#ifdef CONFIG_USB_CDNS3_GADGET
+
+int cdns3_gadget_init(struct cdns3 *cdns);
+void cdns3_gadget_exit(struct cdns3 *cdns);
+#else
+
+static inline int cdns3_gadget_init(struct cdns3 *cdns)
+{
+       return -ENXIO;
+}
+
+static inline void cdns3_gadget_exit(struct cdns3 *cdns) { }
+
+#endif
+
+#endif /* __LINUX_CDNS3_GADGET_EXPORT */
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
new file mode 100644 (file)
index 0000000..0e02b77
--- /dev/null
@@ -0,0 +1,2760 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Cadence USBSS DRD Driver - gadget side.
+ *
+ * Copyright (C) 2018-2019 Cadence Design Systems.
+ * Copyright (C) 2017-2018 NXP
+ *
+ * Authors: Pawel Jez <pjez@cadence.com>,
+ *          Pawel Laszczak <pawell@cadence.com>
+ *          Peter Chen <peter.chen@nxp.com>
+ */
+
+/*
+ * Work around 1:
+ * At some situations, the controller may get stale data address in TRB
+ * at below sequences:
+ * 1. Controller read TRB includes data address
+ * 2. Software updates TRBs includes data address and Cycle bit
+ * 3. Controller read TRB which includes Cycle bit
+ * 4. DMA run with stale data address
+ *
+ * To fix this problem, driver needs to make the first TRB in TD as invalid.
+ * After preparing all TRBs driver needs to check the position of DMA and
+ * if the DMA point to the first just added TRB and doorbell is 1,
+ * then driver must defer making this TRB as valid. This TRB will be make
+ * as valid during adding next TRB only if DMA is stopped or at TRBERR
+ * interrupt.
+ *
+ * Issue has been fixed in DEV_VER_V3 version of controller.
+ *
+ * Work around 2:
+ * Controller for OUT endpoints has shared on-chip buffers for all incoming
+ * packets, including ep0out. It's FIFO buffer, so packets must be handle by DMA
+ * in correct order. If the first packet in the buffer will not be handled,
+ * then the following packets directed for other endpoints and  functions
+ * will be blocked.
+ * Additionally the packets directed to one endpoint can block entire on-chip
+ * buffers. In this case transfer to other endpoints also will blocked.
+ *
+ * To resolve this issue after raising the descriptor missing interrupt
+ * driver prepares internal usb_request object and use it to arm DMA transfer.
+ *
+ * The problematic situation was observed in case when endpoint has been enabled
+ * but no usb_request were queued. Driver try detects such endpoints and will
+ * use this workaround only for these endpoint.
+ *
+ * Driver use limited number of buffer. This number can be set by macro
+ * CDNS3_WA2_NUM_BUFFERS.
+ *
+ * Such blocking situation was observed on ACM gadget. For this function
+ * host send OUT data packet but ACM function is not prepared for this packet.
+ * It's cause that buffer placed in on chip memory block transfer to other
+ * endpoints.
+ *
+ * Issue has been fixed in DEV_VER_V2 version of controller.
+ *
+ */
+
+#include <dm.h>
+#include <linux/usb/gadget.h>
+#include <linux/compat.h>
+#include <linux/iopoll.h>
+#include <asm/dma-mapping.h>
+#include <linux/bitmap.h>
+#include <linux/bug.h>
+
+#include "core.h"
+#include "gadget-export.h"
+#include "gadget.h"
+#include "trace.h"
+#include "drd.h"
+
+#define readl_poll_timeout_atomic readl_poll_timeout
+#define usleep_range(a, b) udelay((b))
+
+static int __cdns3_gadget_ep_queue(struct usb_ep *ep,
+                                  struct usb_request *request,
+                                  gfp_t gfp_flags);
+
+/**
+ * cdns3_set_register_bit - set bit in given register.
+ * @ptr: address of device controller register to be read and changed
+ * @mask: bits requested to set
+ */
+void cdns3_set_register_bit(void __iomem *ptr, u32 mask)
+{
+       mask = readl(ptr) | mask;
+       writel(mask, ptr);
+}
+
+/**
+ * cdns3_ep_addr_to_index - Macro converts endpoint address to
+ * index of endpoint object in cdns3_device.eps[] container
+ * @ep_addr: endpoint address for which endpoint object is required
+ *
+ */
+u8 cdns3_ep_addr_to_index(u8 ep_addr)
+{
+       return (((ep_addr & 0x7F)) + ((ep_addr & USB_DIR_IN) ? 16 : 0));
+}
+
+static int cdns3_get_dma_pos(struct cdns3_device *priv_dev,
+                            struct cdns3_endpoint *priv_ep)
+{
+       int dma_index;
+
+       dma_index = readl(&priv_dev->regs->ep_traddr) - priv_ep->trb_pool_dma;
+
+       return dma_index / TRB_SIZE;
+}
+
+/**
+ * cdns3_next_request - returns next request from list
+ * @list: list containing requests
+ *
+ * Returns request or NULL if no requests in list
+ */
+struct usb_request *cdns3_next_request(struct list_head *list)
+{
+       return list_first_entry_or_null(list, struct usb_request, list);
+}
+
+/**
+ * cdns3_next_align_buf - returns next buffer from list
+ * @list: list containing buffers
+ *
+ * Returns buffer or NULL if no buffers in list
+ */
+struct cdns3_aligned_buf *cdns3_next_align_buf(struct list_head *list)
+{
+       return list_first_entry_or_null(list, struct cdns3_aligned_buf, list);
+}
+
+/**
+ * cdns3_next_priv_request - returns next request from list
+ * @list: list containing requests
+ *
+ * Returns request or NULL if no requests in list
+ */
+struct cdns3_request *cdns3_next_priv_request(struct list_head *list)
+{
+       return list_first_entry_or_null(list, struct cdns3_request, list);
+}
+
+/**
+ * select_ep - selects endpoint
+ * @priv_dev:  extended gadget object
+ * @ep: endpoint address
+ */
+void cdns3_select_ep(struct cdns3_device *priv_dev, u32 ep)
+{
+       if (priv_dev->selected_ep == ep)
+               return;
+
+       priv_dev->selected_ep = ep;
+       writel(ep, &priv_dev->regs->ep_sel);
+}
+
+dma_addr_t cdns3_trb_virt_to_dma(struct cdns3_endpoint *priv_ep,
+                                struct cdns3_trb *trb)
+{
+       u32 offset = (char *)trb - (char *)priv_ep->trb_pool;
+
+       return priv_ep->trb_pool_dma + offset;
+}
+
+int cdns3_ring_size(struct cdns3_endpoint *priv_ep)
+{
+       switch (priv_ep->type) {
+       case USB_ENDPOINT_XFER_ISOC:
+               return TRB_ISO_RING_SIZE;
+       case USB_ENDPOINT_XFER_CONTROL:
+               return TRB_CTRL_RING_SIZE;
+       default:
+               return TRB_RING_SIZE;
+       }
+}
+
+/**
+ * cdns3_allocate_trb_pool - Allocates TRB's pool for selected endpoint
+ * @priv_ep:  endpoint object
+ *
+ * Function will return 0 on success or -ENOMEM on allocation error
+ */
+int cdns3_allocate_trb_pool(struct cdns3_endpoint *priv_ep)
+{
+       int ring_size = cdns3_ring_size(priv_ep);
+       struct cdns3_trb *link_trb;
+
+       if (!priv_ep->trb_pool) {
+               priv_ep->trb_pool =
+               dma_alloc_coherent(ring_size,
+                                  (unsigned long *)&priv_ep->trb_pool_dma);
+               if (!priv_ep->trb_pool)
+                       return -ENOMEM;
+       } else {
+               memset(priv_ep->trb_pool, 0, ring_size);
+       }
+
+       if (!priv_ep->num)
+               return 0;
+
+       priv_ep->num_trbs = ring_size / TRB_SIZE;
+       /* Initialize the last TRB as Link TRB. */
+       link_trb = (priv_ep->trb_pool + (priv_ep->num_trbs - 1));
+       link_trb->buffer = TRB_BUFFER(priv_ep->trb_pool_dma);
+       link_trb->control = TRB_CYCLE | TRB_TYPE(TRB_LINK) | TRB_TOGGLE;
+
+       return 0;
+}
+
+static void cdns3_free_trb_pool(struct cdns3_endpoint *priv_ep)
+{
+       if (priv_ep->trb_pool) {
+               dma_free_coherent(priv_ep->trb_pool);
+               priv_ep->trb_pool = NULL;
+       }
+}
+
+/**
+ * cdns3_ep_stall_flush - Stalls and flushes selected endpoint
+ * @priv_ep: endpoint object
+ *
+ * Endpoint must be selected before call to this function
+ */
+static void cdns3_ep_stall_flush(struct cdns3_endpoint *priv_ep)
+{
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       int val;
+
+       trace_cdns3_halt(priv_ep, 1, 1);
+
+       writel(EP_CMD_DFLUSH | EP_CMD_ERDY | EP_CMD_SSTALL,
+              &priv_dev->regs->ep_cmd);
+
+       /* wait for DFLUSH cleared */
+       readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val,
+                                 !(val & EP_CMD_DFLUSH), 1000);
+       priv_ep->flags |= EP_STALLED;
+       priv_ep->flags &= ~EP_STALL_PENDING;
+}
+
+/**
+ * cdns3_hw_reset_eps_config - reset endpoints configuration kept by controller.
+ * @priv_dev: extended gadget object
+ */
+void cdns3_hw_reset_eps_config(struct cdns3_device *priv_dev)
+{
+       writel(USB_CONF_CFGRST, &priv_dev->regs->usb_conf);
+
+       cdns3_allow_enable_l1(priv_dev, 0);
+       priv_dev->hw_configured_flag = 0;
+       priv_dev->onchip_used_size = 0;
+       priv_dev->out_mem_is_allocated = 0;
+       priv_dev->wait_for_setup = 0;
+}
+
+/**
+ * cdns3_ep_inc_trb - increment a trb index.
+ * @index: Pointer to the TRB index to increment.
+ * @cs: Cycle state
+ * @trb_in_seg: number of TRBs in segment
+ *
+ * The index should never point to the link TRB. After incrementing,
+ * if it is point to the link TRB, wrap around to the beginning and revert
+ * cycle state bit The
+ * link TRB is always at the last TRB entry.
+ */
+static void cdns3_ep_inc_trb(int *index, u8 *cs, int trb_in_seg)
+{
+       (*index)++;
+       if (*index == (trb_in_seg - 1)) {
+               *index = 0;
+               *cs ^=  1;
+       }
+}
+
+/**
+ * cdns3_ep_inc_enq - increment endpoint's enqueue pointer
+ * @priv_ep: The endpoint whose enqueue pointer we're incrementing
+ */
+static void cdns3_ep_inc_enq(struct cdns3_endpoint *priv_ep)
+{
+       priv_ep->free_trbs--;
+       cdns3_ep_inc_trb(&priv_ep->enqueue, &priv_ep->pcs, priv_ep->num_trbs);
+}
+
+/**
+ * cdns3_ep_inc_deq - increment endpoint's dequeue pointer
+ * @priv_ep: The endpoint whose dequeue pointer we're incrementing
+ */
+static void cdns3_ep_inc_deq(struct cdns3_endpoint *priv_ep)
+{
+       priv_ep->free_trbs++;
+       cdns3_ep_inc_trb(&priv_ep->dequeue, &priv_ep->ccs, priv_ep->num_trbs);
+}
+
+void cdns3_move_deq_to_next_trb(struct cdns3_request *priv_req)
+{
+       struct cdns3_endpoint *priv_ep = priv_req->priv_ep;
+       int current_trb = priv_req->start_trb;
+
+       while (current_trb != priv_req->end_trb) {
+               cdns3_ep_inc_deq(priv_ep);
+               current_trb = priv_ep->dequeue;
+       }
+
+       cdns3_ep_inc_deq(priv_ep);
+}
+
+/**
+ * cdns3_allow_enable_l1 - enable/disable permits to transition to L1.
+ * @priv_dev: Extended gadget object
+ * @enable: Enable/disable permit to transition to L1.
+ *
+ * If bit USB_CONF_L1EN is set and device receive Extended Token packet,
+ * then controller answer with ACK handshake.
+ * If bit USB_CONF_L1DS is set and device receive Extended Token packet,
+ * then controller answer with NYET handshake.
+ */
+void cdns3_allow_enable_l1(struct cdns3_device *priv_dev, int enable)
+{
+       if (enable)
+               writel(USB_CONF_L1EN, &priv_dev->regs->usb_conf);
+       else
+               writel(USB_CONF_L1DS, &priv_dev->regs->usb_conf);
+}
+
+enum usb_device_speed cdns3_get_speed(struct cdns3_device *priv_dev)
+{
+       u32 reg;
+
+       reg = readl(&priv_dev->regs->usb_sts);
+
+       if (DEV_SUPERSPEED(reg))
+               return USB_SPEED_SUPER;
+       else if (DEV_HIGHSPEED(reg))
+               return USB_SPEED_HIGH;
+       else if (DEV_FULLSPEED(reg))
+               return USB_SPEED_FULL;
+       else if (DEV_LOWSPEED(reg))
+               return USB_SPEED_LOW;
+       return USB_SPEED_UNKNOWN;
+}
+
+/**
+ * cdns3_start_all_request - add to ring all request not started
+ * @priv_dev: Extended gadget object
+ * @priv_ep: The endpoint for whom request will be started.
+ *
+ * Returns return ENOMEM if transfer ring i not enough TRBs to start
+ *         all requests.
+ */
+static int cdns3_start_all_request(struct cdns3_device *priv_dev,
+                                  struct cdns3_endpoint *priv_ep)
+{
+       struct usb_request *request;
+       int ret = 0;
+
+       while (!list_empty(&priv_ep->deferred_req_list)) {
+               request = cdns3_next_request(&priv_ep->deferred_req_list);
+
+               ret = cdns3_ep_run_transfer(priv_ep, request);
+               if (ret)
+                       return ret;
+
+               list_del(&request->list);
+               list_add_tail(&request->list,
+                             &priv_ep->pending_req_list);
+       }
+
+       priv_ep->flags &= ~EP_RING_FULL;
+       return ret;
+}
+
+/*
+ * WA2: Set flag for all not ISOC OUT endpoints. If this flag is set
+ * driver try to detect whether endpoint need additional internal
+ * buffer for unblocking on-chip FIFO buffer. This flag will be cleared
+ * if before first DESCMISS interrupt the DMA will be armed.
+ */
+#define cdns3_wa2_enable_detection(priv_dev, ep_priv, reg) do { \
+       if (!priv_ep->dir && priv_ep->type != USB_ENDPOINT_XFER_ISOC) { \
+               priv_ep->flags |= EP_QUIRK_EXTRA_BUF_DET; \
+               (reg) |= EP_STS_EN_DESCMISEN; \
+       } } while (0)
+
+/**
+ * cdns3_wa2_descmiss_copy_data copy data from internal requests to
+ * request queued by class driver.
+ * @priv_ep: extended endpoint object
+ * @request: request object
+ */
+static void cdns3_wa2_descmiss_copy_data(struct cdns3_endpoint *priv_ep,
+                                        struct usb_request *request)
+{
+       struct usb_request *descmiss_req;
+       struct cdns3_request *descmiss_priv_req;
+
+       while (!list_empty(&priv_ep->wa2_descmiss_req_list)) {
+               int chunk_end;
+               int length;
+
+               descmiss_priv_req =
+                       cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list);
+               descmiss_req = &descmiss_priv_req->request;
+
+               /* driver can't touch pending request */
+               if (descmiss_priv_req->flags & REQUEST_PENDING)
+                       break;
+
+               chunk_end = descmiss_priv_req->flags & REQUEST_INTERNAL_CH;
+               length = request->actual + descmiss_req->actual;
+
+               request->status = descmiss_req->status;
+
+               if (length <= request->length) {
+                       memcpy(&((u8 *)request->buf)[request->actual],
+                              descmiss_req->buf,
+                              descmiss_req->actual);
+                       request->actual = length;
+               } else {
+                       /* It should never occur */
+                       request->status = -ENOMEM;
+               }
+
+               list_del_init(&descmiss_priv_req->list);
+
+               kfree(descmiss_req->buf);
+               cdns3_gadget_ep_free_request(&priv_ep->endpoint, descmiss_req);
+               --priv_ep->wa2_counter;
+
+               if (!chunk_end)
+                       break;
+       }
+}
+
+struct usb_request *cdns3_wa2_gadget_giveback(struct cdns3_device *priv_dev,
+                                             struct cdns3_endpoint *priv_ep,
+                                             struct cdns3_request *priv_req)
+{
+       if (priv_ep->flags & EP_QUIRK_EXTRA_BUF_EN &&
+           priv_req->flags & REQUEST_INTERNAL) {
+               struct usb_request *req;
+
+               req = cdns3_next_request(&priv_ep->deferred_req_list);
+
+               priv_ep->descmis_req = NULL;
+
+               if (!req)
+                       return NULL;
+
+               cdns3_wa2_descmiss_copy_data(priv_ep, req);
+               if (!(priv_ep->flags & EP_QUIRK_END_TRANSFER) &&
+                   req->length != req->actual) {
+                       /* wait for next part of transfer */
+                       return NULL;
+               }
+
+               if (req->status == -EINPROGRESS)
+                       req->status = 0;
+
+               list_del_init(&req->list);
+               cdns3_start_all_request(priv_dev, priv_ep);
+               return req;
+       }
+
+       return &priv_req->request;
+}
+
+int cdns3_wa2_gadget_ep_queue(struct cdns3_device *priv_dev,
+                             struct cdns3_endpoint *priv_ep,
+                             struct cdns3_request *priv_req)
+{
+       int deferred = 0;
+
+       /*
+        * If transfer was queued before DESCMISS appear than we
+        * can disable handling of DESCMISS interrupt. Driver assumes that it
+        * can disable special treatment for this endpoint.
+        */
+       if (priv_ep->flags & EP_QUIRK_EXTRA_BUF_DET) {
+               u32 reg;
+
+               cdns3_select_ep(priv_dev, priv_ep->num | priv_ep->dir);
+               priv_ep->flags &= ~EP_QUIRK_EXTRA_BUF_DET;
+               reg = readl(&priv_dev->regs->ep_sts_en);
+               reg &= ~EP_STS_EN_DESCMISEN;
+               trace_cdns3_wa2(priv_ep, "workaround disabled\n");
+               writel(reg, &priv_dev->regs->ep_sts_en);
+       }
+
+       if (priv_ep->flags & EP_QUIRK_EXTRA_BUF_EN) {
+               u8 pending_empty = list_empty(&priv_ep->pending_req_list);
+               u8 descmiss_empty = list_empty(&priv_ep->wa2_descmiss_req_list);
+
+               /*
+                *  DESCMISS transfer has been finished, so data will be
+                *  directly copied from internal allocated usb_request
+                *  objects.
+                */
+               if (pending_empty && !descmiss_empty &&
+                   !(priv_req->flags & REQUEST_INTERNAL)) {
+                       cdns3_wa2_descmiss_copy_data(priv_ep,
+                                                    &priv_req->request);
+
+                       trace_cdns3_wa2(priv_ep, "get internal stored data");
+
+                       list_add_tail(&priv_req->request.list,
+                                     &priv_ep->pending_req_list);
+                       cdns3_gadget_giveback(priv_ep, priv_req,
+                                             priv_req->request.status);
+
+                       /*
+                        * Intentionally driver returns positive value as
+                        * correct value. It informs that transfer has
+                        * been finished.
+                        */
+                       return EINPROGRESS;
+               }
+
+               /*
+                * Driver will wait for completion DESCMISS transfer,
+                * before starts new, not DESCMISS transfer.
+                */
+               if (!pending_empty && !descmiss_empty) {
+                       trace_cdns3_wa2(priv_ep, "wait for pending transfer\n");
+                       deferred = 1;
+               }
+
+               if (priv_req->flags & REQUEST_INTERNAL)
+                       list_add_tail(&priv_req->list,
+                                     &priv_ep->wa2_descmiss_req_list);
+       }
+
+       return deferred;
+}
+
+static void cdns3_wa2_remove_old_request(struct cdns3_endpoint *priv_ep)
+{
+       struct cdns3_request *priv_req;
+
+       while (!list_empty(&priv_ep->wa2_descmiss_req_list)) {
+               u8 chain;
+
+               priv_req = cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list);
+               chain = !!(priv_req->flags & REQUEST_INTERNAL_CH);
+
+               trace_cdns3_wa2(priv_ep, "removes eldest request");
+
+               kfree(priv_req->request.buf);
+               cdns3_gadget_ep_free_request(&priv_ep->endpoint,
+                                            &priv_req->request);
+               list_del_init(&priv_req->list);
+               --priv_ep->wa2_counter;
+
+               if (!chain)
+                       break;
+       }
+}
+
+/**
+ * cdns3_wa2_descmissing_packet - handles descriptor missing event.
+ * @priv_dev: extended gadget object
+ *
+ * This function is used only for WA2. For more information see Work around 2
+ * description.
+ */
+static void cdns3_wa2_descmissing_packet(struct cdns3_endpoint *priv_ep)
+{
+       struct cdns3_request *priv_req;
+       struct usb_request *request;
+
+       if (priv_ep->flags & EP_QUIRK_EXTRA_BUF_DET) {
+               priv_ep->flags &= ~EP_QUIRK_EXTRA_BUF_DET;
+               priv_ep->flags |= EP_QUIRK_EXTRA_BUF_EN;
+       }
+
+       trace_cdns3_wa2(priv_ep, "Description Missing detected\n");
+
+       if (priv_ep->wa2_counter >= CDNS3_WA2_NUM_BUFFERS)
+               cdns3_wa2_remove_old_request(priv_ep);
+
+       request = cdns3_gadget_ep_alloc_request(&priv_ep->endpoint,
+                                               GFP_ATOMIC);
+       if (!request)
+               goto err;
+
+       priv_req = to_cdns3_request(request);
+       priv_req->flags |= REQUEST_INTERNAL;
+
+       /* if this field is still assigned it indicate that transfer related
+        * with this request has not been finished yet. Driver in this
+        * case simply allocate next request and assign flag REQUEST_INTERNAL_CH
+        * flag to previous one. It will indicate that current request is
+        * part of the previous one.
+        */
+       if (priv_ep->descmis_req)
+               priv_ep->descmis_req->flags |= REQUEST_INTERNAL_CH;
+
+       priv_req->request.buf = kzalloc(CDNS3_DESCMIS_BUF_SIZE,
+                                       GFP_ATOMIC);
+       priv_ep->wa2_counter++;
+
+       if (!priv_req->request.buf) {
+               cdns3_gadget_ep_free_request(&priv_ep->endpoint, request);
+               goto err;
+       }
+
+       priv_req->request.length = CDNS3_DESCMIS_BUF_SIZE;
+       priv_ep->descmis_req = priv_req;
+
+       __cdns3_gadget_ep_queue(&priv_ep->endpoint,
+                               &priv_ep->descmis_req->request,
+                               GFP_ATOMIC);
+
+       return;
+
+err:
+       dev_err(priv_ep->cdns3_dev->dev,
+               "Failed: No sufficient memory for DESCMIS\n");
+}
+
+/**
+ * cdns3_gadget_giveback - call struct usb_request's ->complete callback
+ * @priv_ep: The endpoint to whom the request belongs to
+ * @priv_req: The request we're giving back
+ * @status: completion code for the request
+ *
+ * Must be called with controller's lock held and interrupts disabled. This
+ * function will unmap @req and call its ->complete() callback to notify upper
+ * layers that it has completed.
+ */
+void cdns3_gadget_giveback(struct cdns3_endpoint *priv_ep,
+                          struct cdns3_request *priv_req,
+                          int status)
+{
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       struct usb_request *request = &priv_req->request;
+
+       list_del_init(&request->list);
+
+       if (request->status == -EINPROGRESS)
+               request->status = status;
+
+       usb_gadget_unmap_request(&priv_dev->gadget, request,
+                                priv_ep->dir);
+
+       if ((priv_req->flags & REQUEST_UNALIGNED) &&
+           priv_ep->dir == USB_DIR_OUT && !request->status)
+               memcpy(request->buf, priv_req->aligned_buf->buf,
+                      request->length);
+
+       priv_req->flags &= ~(REQUEST_PENDING | REQUEST_UNALIGNED);
+       trace_cdns3_gadget_giveback(priv_req);
+
+       if (priv_dev->dev_ver < DEV_VER_V2) {
+               request = cdns3_wa2_gadget_giveback(priv_dev, priv_ep,
+                                                   priv_req);
+               if (!request)
+                       return;
+       }
+
+       if (request->complete) {
+               spin_unlock(&priv_dev->lock);
+               usb_gadget_giveback_request(&priv_ep->endpoint,
+                                           request);
+               spin_lock(&priv_dev->lock);
+       }
+
+       if (request->buf == priv_dev->zlp_buf)
+               cdns3_gadget_ep_free_request(&priv_ep->endpoint, request);
+}
+
+void cdns3_wa1_restore_cycle_bit(struct cdns3_endpoint *priv_ep)
+{
+       /* Work around for stale data address in TRB*/
+       if (priv_ep->wa1_set) {
+               trace_cdns3_wa1(priv_ep, "restore cycle bit");
+
+               priv_ep->wa1_set = 0;
+               priv_ep->wa1_trb_index = 0xFFFF;
+               if (priv_ep->wa1_cycle_bit) {
+                       priv_ep->wa1_trb->control =
+                               priv_ep->wa1_trb->control | 0x1;
+               } else {
+                       priv_ep->wa1_trb->control =
+                               priv_ep->wa1_trb->control & ~0x1;
+               }
+       }
+}
+
+static void cdns3_free_aligned_request_buf(struct cdns3_device *priv_dev)
+{
+       struct cdns3_aligned_buf *buf, *tmp;
+       unsigned long flags;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+
+       list_for_each_entry_safe(buf, tmp, &priv_dev->aligned_buf_list, list) {
+               if (!buf->in_use) {
+                       list_del(&buf->list);
+
+                       /*
+                        * Re-enable interrupts to free DMA capable memory.
+                        * Driver can't free this memory with disabled
+                        * interrupts.
+                        */
+                       spin_unlock_irqrestore(&priv_dev->lock, flags);
+                       dma_free_coherent(buf->buf);
+                       kfree(buf);
+                       spin_lock_irqsave(&priv_dev->lock, flags);
+               }
+       }
+
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+}
+
+static int cdns3_prepare_aligned_request_buf(struct cdns3_request *priv_req)
+{
+       struct cdns3_endpoint *priv_ep = priv_req->priv_ep;
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       struct cdns3_aligned_buf *buf;
+
+       /* check if buffer is aligned to 8. */
+       if (!((uintptr_t)priv_req->request.buf & 0x7))
+               return 0;
+
+       buf = priv_req->aligned_buf;
+
+       if (!buf || priv_req->request.length > buf->size) {
+               buf = kzalloc(sizeof(*buf), GFP_ATOMIC);
+               if (!buf)
+                       return -ENOMEM;
+
+               buf->size = priv_req->request.length;
+
+               buf->buf = dma_alloc_coherent(buf->size,
+                                             (unsigned long *)&buf->dma);
+               if (!buf->buf) {
+                       kfree(buf);
+                       return -ENOMEM;
+               }
+
+               if (priv_req->aligned_buf) {
+                       trace_cdns3_free_aligned_request(priv_req);
+                       priv_req->aligned_buf->in_use = 0;
+#ifndef __UBOOT__
+                       queue_work(system_freezable_wq,
+                                  &priv_dev->aligned_buf_wq);
+#else
+                       cdns3_free_aligned_request_buf(priv_dev);
+#endif
+               }
+
+               buf->in_use = 1;
+               priv_req->aligned_buf = buf;
+
+               list_add_tail(&buf->list,
+                             &priv_dev->aligned_buf_list);
+       }
+
+       if (priv_ep->dir == USB_DIR_IN) {
+               memcpy(buf->buf, priv_req->request.buf,
+                      priv_req->request.length);
+       }
+
+       priv_req->flags |= REQUEST_UNALIGNED;
+       trace_cdns3_prepare_aligned_request(priv_req);
+
+       return 0;
+}
+
+static int cdns3_wa1_update_guard(struct cdns3_endpoint *priv_ep,
+                                 struct cdns3_trb *trb)
+{
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+
+       if (!priv_ep->wa1_set) {
+               u32 doorbell;
+
+               doorbell = !!(readl(&priv_dev->regs->ep_cmd) & EP_CMD_DRDY);
+
+               if (doorbell) {
+                       priv_ep->wa1_cycle_bit = priv_ep->pcs ? TRB_CYCLE : 0;
+                       priv_ep->wa1_set = 1;
+                       priv_ep->wa1_trb = trb;
+                       priv_ep->wa1_trb_index = priv_ep->enqueue;
+                       trace_cdns3_wa1(priv_ep, "set guard");
+                       return 0;
+               }
+       }
+       return 1;
+}
+
+static void cdns3_wa1_tray_restore_cycle_bit(struct cdns3_device *priv_dev,
+                                            struct cdns3_endpoint *priv_ep)
+{
+       int dma_index;
+       u32 doorbell;
+
+       doorbell = !!(readl(&priv_dev->regs->ep_cmd) & EP_CMD_DRDY);
+       dma_index = cdns3_get_dma_pos(priv_dev, priv_ep);
+
+       if (!doorbell || dma_index != priv_ep->wa1_trb_index)
+               cdns3_wa1_restore_cycle_bit(priv_ep);
+}
+
+/**
+ * cdns3_ep_run_transfer - start transfer on no-default endpoint hardware
+ * @priv_ep: endpoint object
+ *
+ * Returns zero on success or negative value on failure
+ */
+int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
+                         struct usb_request *request)
+{
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       struct cdns3_request *priv_req;
+       struct cdns3_trb *trb;
+       dma_addr_t trb_dma;
+       u32 togle_pcs = 1;
+       int sg_iter = 0;
+       int num_trb = 1;
+       int address;
+       u32 control;
+       int pcs;
+
+       if (num_trb > priv_ep->free_trbs) {
+               priv_ep->flags |= EP_RING_FULL;
+               return -ENOBUFS;
+       }
+
+       priv_req = to_cdns3_request(request);
+       address = priv_ep->endpoint.desc->bEndpointAddress;
+
+       priv_ep->flags |= EP_PENDING_REQUEST;
+
+       /* must allocate buffer aligned to 8 */
+       if (priv_req->flags & REQUEST_UNALIGNED)
+               trb_dma = priv_req->aligned_buf->dma;
+       else
+               trb_dma = request->dma;
+
+       trb = priv_ep->trb_pool + priv_ep->enqueue;
+       priv_req->start_trb = priv_ep->enqueue;
+       priv_req->trb = trb;
+
+       cdns3_select_ep(priv_ep->cdns3_dev, address);
+
+       /* prepare ring */
+       if ((priv_ep->enqueue + num_trb)  >= (priv_ep->num_trbs - 1)) {
+               struct cdns3_trb *link_trb;
+               int doorbell, dma_index;
+               u32 ch_bit = 0;
+
+               doorbell = !!(readl(&priv_dev->regs->ep_cmd) & EP_CMD_DRDY);
+               dma_index = cdns3_get_dma_pos(priv_dev, priv_ep);
+
+               /* Driver can't update LINK TRB if it is current processed. */
+               if (doorbell && dma_index == priv_ep->num_trbs - 1) {
+                       priv_ep->flags |= EP_DEFERRED_DRDY;
+                       return -ENOBUFS;
+               }
+
+               /*updating C bt in  Link TRB before starting DMA*/
+               link_trb = priv_ep->trb_pool + (priv_ep->num_trbs - 1);
+               /*
+                * For TRs size equal 2 enabling TRB_CHAIN for epXin causes
+                * that DMA stuck at the LINK TRB.
+                * On the other hand, removing TRB_CHAIN for longer TRs for
+                * epXout cause that DMA stuck after handling LINK TRB.
+                * To eliminate this strange behavioral driver set TRB_CHAIN
+                * bit only for TR size > 2.
+                */
+               if (priv_ep->type == USB_ENDPOINT_XFER_ISOC ||
+                   TRBS_PER_SEGMENT > 2)
+                       ch_bit = TRB_CHAIN;
+
+               link_trb->control = ((priv_ep->pcs) ? TRB_CYCLE : 0) |
+                                   TRB_TYPE(TRB_LINK) | TRB_TOGGLE | ch_bit;
+       }
+
+       if (priv_dev->dev_ver <= DEV_VER_V2)
+               togle_pcs = cdns3_wa1_update_guard(priv_ep, trb);
+
+       /* set incorrect Cycle Bit for first trb*/
+       control = priv_ep->pcs ? 0 : TRB_CYCLE;
+
+       do {
+               u32 length;
+               u16 td_size = 0;
+
+               /* fill TRB */
+               control |= TRB_TYPE(TRB_NORMAL);
+               trb->buffer = TRB_BUFFER(trb_dma);
+
+               length = request->length;
+
+               if (likely(priv_dev->dev_ver >= DEV_VER_V2))
+                       td_size = DIV_ROUND_UP(length,
+                                              priv_ep->endpoint.maxpacket);
+
+               trb->length = TRB_BURST_LEN(priv_ep->trb_burst_size) |
+                                       TRB_LEN(length);
+               if (priv_dev->gadget.speed == USB_SPEED_SUPER)
+                       trb->length |= TRB_TDL_SS_SIZE(td_size);
+               else
+                       control |= TRB_TDL_HS_SIZE(td_size);
+
+               pcs = priv_ep->pcs ? TRB_CYCLE : 0;
+
+               /*
+                * first trb should be prepared as last to avoid processing
+                *  transfer to early
+                */
+               if (sg_iter != 0)
+                       control |= pcs;
+
+               if (priv_ep->type == USB_ENDPOINT_XFER_ISOC  && !priv_ep->dir) {
+                       control |= TRB_IOC | TRB_ISP;
+               } else {
+                       /* for last element in TD or in SG list */
+                       if (sg_iter == (num_trb - 1) && sg_iter != 0)
+                               control |= pcs | TRB_IOC | TRB_ISP;
+               }
+
+               if (sg_iter)
+                       trb->control = control;
+               else
+                       priv_req->trb->control = control;
+
+               control = 0;
+               ++sg_iter;
+               priv_req->end_trb = priv_ep->enqueue;
+               cdns3_ep_inc_enq(priv_ep);
+               trb = priv_ep->trb_pool + priv_ep->enqueue;
+       } while (sg_iter < num_trb);
+
+       trb = priv_req->trb;
+
+       priv_req->flags |= REQUEST_PENDING;
+
+       if (sg_iter == 1)
+               trb->control |= TRB_IOC | TRB_ISP;
+
+       /*
+        * Memory barrier - cycle bit must be set before other filds in trb.
+        */
+       dmb();
+
+       /* give the TD to the consumer*/
+       if (togle_pcs)
+               trb->control =  trb->control ^ 1;
+
+       if (priv_dev->dev_ver <= DEV_VER_V2)
+               cdns3_wa1_tray_restore_cycle_bit(priv_dev, priv_ep);
+
+       trace_cdns3_prepare_trb(priv_ep, priv_req->trb);
+
+       /*
+        * Memory barrier - Cycle Bit must be set before trb->length  and
+        * trb->buffer fields.
+        */
+       dmb();
+
+       /*
+        * For DMULT mode we can set address to transfer ring only once after
+        * enabling endpoint.
+        */
+       if (priv_ep->flags & EP_UPDATE_EP_TRBADDR) {
+               /*
+                * Until SW is not ready to handle the OUT transfer the ISO OUT
+                * Endpoint should be disabled (EP_CFG.ENABLE = 0).
+                * EP_CFG_ENABLE must be set before updating ep_traddr.
+                */
+               if (priv_ep->type == USB_ENDPOINT_XFER_ISOC  && !priv_ep->dir &&
+                   !(priv_ep->flags & EP_QUIRK_ISO_OUT_EN)) {
+                       priv_ep->flags |= EP_QUIRK_ISO_OUT_EN;
+                       cdns3_set_register_bit(&priv_dev->regs->ep_cfg,
+                                              EP_CFG_ENABLE);
+               }
+
+               writel(EP_TRADDR_TRADDR(priv_ep->trb_pool_dma +
+                                       priv_req->start_trb * TRB_SIZE),
+                                       &priv_dev->regs->ep_traddr);
+
+               priv_ep->flags &= ~EP_UPDATE_EP_TRBADDR;
+       }
+
+       if (!priv_ep->wa1_set && !(priv_ep->flags & EP_STALLED)) {
+               trace_cdns3_ring(priv_ep);
+               /*clearing TRBERR and EP_STS_DESCMIS before seting DRDY*/
+               writel(EP_STS_TRBERR | EP_STS_DESCMIS, &priv_dev->regs->ep_sts);
+               writel(EP_CMD_DRDY, &priv_dev->regs->ep_cmd);
+               trace_cdns3_doorbell_epx(priv_ep->name,
+                                        readl(&priv_dev->regs->ep_traddr));
+       }
+
+       /* WORKAROUND for transition to L0 */
+       __cdns3_gadget_wakeup(priv_dev);
+
+       return 0;
+}
+
+void cdns3_set_hw_configuration(struct cdns3_device *priv_dev)
+{
+       struct cdns3_endpoint *priv_ep;
+       struct usb_ep *ep;
+       int val;
+
+       if (priv_dev->hw_configured_flag)
+               return;
+
+       writel(USB_CONF_CFGSET, &priv_dev->regs->usb_conf);
+       writel(EP_CMD_ERDY | EP_CMD_REQ_CMPL, &priv_dev->regs->ep_cmd);
+
+       cdns3_set_register_bit(&priv_dev->regs->usb_conf,
+                              USB_CONF_U1EN | USB_CONF_U2EN);
+
+       /* wait until configuration set */
+       readl_poll_timeout_atomic(&priv_dev->regs->usb_sts, val,
+                                 val & USB_STS_CFGSTS_MASK, 100);
+
+       priv_dev->hw_configured_flag = 1;
+
+       list_for_each_entry(ep, &priv_dev->gadget.ep_list, ep_list) {
+               priv_ep = ep_to_cdns3_ep(ep);
+               if (priv_ep->flags & EP_ENABLED)
+                       cdns3_start_all_request(priv_dev, priv_ep);
+       }
+}
+
+/**
+ * cdns3_request_handled - check whether request has been handled by DMA
+ *
+ * @priv_ep: extended endpoint object.
+ * @priv_req: request object for checking
+ *
+ * Endpoint must be selected before invoking this function.
+ *
+ * Returns false if request has not been handled by DMA, else returns true.
+ *
+ * SR - start ring
+ * ER -  end ring
+ * DQ = priv_ep->dequeue - dequeue position
+ * EQ = priv_ep->enqueue -  enqueue position
+ * ST = priv_req->start_trb - index of first TRB in transfer ring
+ * ET = priv_req->end_trb - index of last TRB in transfer ring
+ * CI = current_index - index of processed TRB by DMA.
+ *
+ * As first step, function checks if cycle bit for priv_req->start_trb is
+ * correct.
+ *
+ * some rules:
+ * 1. priv_ep->dequeue never exceed current_index.
+ * 2  priv_ep->enqueue never exceed priv_ep->dequeue
+ * 3. exception: priv_ep->enqueue == priv_ep->dequeue
+ *    and priv_ep->free_trbs is zero.
+ *    This case indicate that TR is full.
+ *
+ * Then We can split recognition into two parts:
+ * Case 1 - priv_ep->dequeue < current_index
+ *      SR ... EQ ... DQ ... CI ... ER
+ *      SR ... DQ ... CI ... EQ ... ER
+ *
+ *      Request has been handled by DMA if ST and ET is between DQ and CI.
+ *
+ * Case 2 - priv_ep->dequeue > current_index
+ * This situation take place when CI go through the LINK TRB at the end of
+ * transfer ring.
+ *      SR ... CI ... EQ ... DQ ... ER
+ *
+ *      Request has been handled by DMA if ET is less then CI or
+ *      ET is greater or equal DQ.
+ */
+static bool cdns3_request_handled(struct cdns3_endpoint *priv_ep,
+                                 struct cdns3_request *priv_req)
+{
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       struct cdns3_trb *trb = priv_req->trb;
+       int current_index = 0;
+       int handled = 0;
+       int doorbell;
+
+       current_index = cdns3_get_dma_pos(priv_dev, priv_ep);
+       doorbell = !!(readl(&priv_dev->regs->ep_cmd) & EP_CMD_DRDY);
+
+       trb = &priv_ep->trb_pool[priv_req->start_trb];
+
+       if ((trb->control  & TRB_CYCLE) != priv_ep->ccs)
+               goto finish;
+
+       if (doorbell == 1 && current_index == priv_ep->dequeue)
+               goto finish;
+
+       /* The corner case for TRBS_PER_SEGMENT equal 2). */
+       if (TRBS_PER_SEGMENT == 2 && priv_ep->type != USB_ENDPOINT_XFER_ISOC) {
+               handled = 1;
+               goto finish;
+       }
+
+       if (priv_ep->enqueue == priv_ep->dequeue &&
+           priv_ep->free_trbs == 0) {
+               handled = 1;
+       } else if (priv_ep->dequeue < current_index) {
+               if ((current_index == (priv_ep->num_trbs - 1)) &&
+                   !priv_ep->dequeue)
+                       goto finish;
+
+               if (priv_req->end_trb >= priv_ep->dequeue &&
+                   priv_req->end_trb < current_index)
+                       handled = 1;
+       } else if (priv_ep->dequeue  > current_index) {
+               if (priv_req->end_trb  < current_index ||
+                   priv_req->end_trb >= priv_ep->dequeue)
+                       handled = 1;
+       }
+
+finish:
+       trace_cdns3_request_handled(priv_req, current_index, handled);
+
+       return handled;
+}
+
+static void cdns3_transfer_completed(struct cdns3_device *priv_dev,
+                                    struct cdns3_endpoint *priv_ep)
+{
+       struct cdns3_request *priv_req;
+       struct usb_request *request;
+       struct cdns3_trb *trb;
+
+       while (!list_empty(&priv_ep->pending_req_list)) {
+               request = cdns3_next_request(&priv_ep->pending_req_list);
+               priv_req = to_cdns3_request(request);
+
+               /* Re-select endpoint. It could be changed by other CPU during
+                * handling usb_gadget_giveback_request.
+                */
+#ifndef __UBOOT__
+               cdns3_select_ep(priv_dev, priv_ep->endpoint.address);
+#else
+               cdns3_select_ep(priv_dev,
+                               priv_ep->endpoint.desc->bEndpointAddress);
+#endif
+
+               if (!cdns3_request_handled(priv_ep, priv_req))
+                       goto prepare_next_td;
+
+               trb = priv_ep->trb_pool + priv_ep->dequeue;
+               trace_cdns3_complete_trb(priv_ep, trb);
+
+               if (trb != priv_req->trb)
+                       dev_warn(priv_dev->dev,
+                                "request_trb=0x%p, queue_trb=0x%p\n",
+                                priv_req->trb, trb);
+
+               request->actual = TRB_LEN(le32_to_cpu(trb->length));
+               cdns3_move_deq_to_next_trb(priv_req);
+               cdns3_gadget_giveback(priv_ep, priv_req, 0);
+
+               if (priv_ep->type != USB_ENDPOINT_XFER_ISOC &&
+                   TRBS_PER_SEGMENT == 2)
+                       break;
+       }
+       priv_ep->flags &= ~EP_PENDING_REQUEST;
+
+prepare_next_td:
+       if (!(priv_ep->flags & EP_STALLED) &&
+           !(priv_ep->flags & EP_STALL_PENDING))
+               cdns3_start_all_request(priv_dev, priv_ep);
+}
+
+void cdns3_rearm_transfer(struct cdns3_endpoint *priv_ep, u8 rearm)
+{
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+
+       cdns3_wa1_restore_cycle_bit(priv_ep);
+
+       if (rearm) {
+               trace_cdns3_ring(priv_ep);
+
+               /* Cycle Bit must be updated before arming DMA. */
+               dmb();
+               writel(EP_CMD_DRDY, &priv_dev->regs->ep_cmd);
+
+               __cdns3_gadget_wakeup(priv_dev);
+
+               trace_cdns3_doorbell_epx(priv_ep->name,
+                                        readl(&priv_dev->regs->ep_traddr));
+       }
+}
+
+/**
+ * cdns3_check_ep_interrupt_proceed - Processes interrupt related to endpoint
+ * @priv_ep: endpoint object
+ *
+ * Returns 0
+ */
+static int cdns3_check_ep_interrupt_proceed(struct cdns3_endpoint *priv_ep)
+{
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       u32 ep_sts_reg;
+
+#ifndef __UBOOT__
+       cdns3_select_ep(priv_dev, priv_ep->endpoint.address);
+#else
+       cdns3_select_ep(priv_dev, priv_ep->endpoint.desc->bEndpointAddress);
+#endif
+
+       trace_cdns3_epx_irq(priv_dev, priv_ep);
+
+       ep_sts_reg = readl(&priv_dev->regs->ep_sts);
+       writel(ep_sts_reg, &priv_dev->regs->ep_sts);
+
+       if (ep_sts_reg & EP_STS_TRBERR) {
+               if (priv_ep->flags & EP_STALL_PENDING &&
+                   !(ep_sts_reg & EP_STS_DESCMIS &&
+                   priv_dev->dev_ver < DEV_VER_V2)) {
+                       cdns3_ep_stall_flush(priv_ep);
+               }
+
+               /*
+                * For isochronous transfer driver completes request on
+                * IOC or on TRBERR. IOC appears only when device receive
+                * OUT data packet. If host disable stream or lost some packet
+                * then the only way to finish all queued transfer is to do it
+                * on TRBERR event.
+                */
+               if (priv_ep->type == USB_ENDPOINT_XFER_ISOC &&
+                   !priv_ep->wa1_set) {
+                       if (!priv_ep->dir) {
+                               u32 ep_cfg = readl(&priv_dev->regs->ep_cfg);
+
+                               ep_cfg &= ~EP_CFG_ENABLE;
+                               writel(ep_cfg, &priv_dev->regs->ep_cfg);
+                               priv_ep->flags &= ~EP_QUIRK_ISO_OUT_EN;
+                       }
+                       cdns3_transfer_completed(priv_dev, priv_ep);
+               } else if (!(priv_ep->flags & EP_STALLED) &&
+                         !(priv_ep->flags & EP_STALL_PENDING)) {
+                       if (priv_ep->flags & EP_DEFERRED_DRDY) {
+                               priv_ep->flags &= ~EP_DEFERRED_DRDY;
+                               cdns3_start_all_request(priv_dev, priv_ep);
+                       } else {
+                               cdns3_rearm_transfer(priv_ep,
+                                                    priv_ep->wa1_set);
+                       }
+               }
+       }
+
+       if ((ep_sts_reg & EP_STS_IOC) || (ep_sts_reg & EP_STS_ISP)) {
+               if (priv_ep->flags & EP_QUIRK_EXTRA_BUF_EN) {
+                       if (ep_sts_reg & EP_STS_ISP)
+                               priv_ep->flags |= EP_QUIRK_END_TRANSFER;
+                       else
+                               priv_ep->flags &= ~EP_QUIRK_END_TRANSFER;
+               }
+
+               cdns3_transfer_completed(priv_dev, priv_ep);
+       }
+
+       /*
+        * WA2: this condition should only be meet when
+        * priv_ep->flags & EP_QUIRK_EXTRA_BUF_DET or
+        * priv_ep->flags & EP_QUIRK_EXTRA_BUF_EN.
+        * In other cases this interrupt will be disabled/
+        */
+       if (ep_sts_reg & EP_STS_DESCMIS && priv_dev->dev_ver < DEV_VER_V2 &&
+           !(priv_ep->flags & EP_STALLED))
+               cdns3_wa2_descmissing_packet(priv_ep);
+
+       return 0;
+}
+
+static void cdns3_disconnect_gadget(struct cdns3_device *priv_dev)
+{
+       if (priv_dev->gadget_driver && priv_dev->gadget_driver->disconnect) {
+               spin_unlock(&priv_dev->lock);
+               priv_dev->gadget_driver->disconnect(&priv_dev->gadget);
+               spin_lock(&priv_dev->lock);
+       }
+}
+
+/**
+ * cdns3_check_usb_interrupt_proceed - Processes interrupt related to device
+ * @priv_dev: extended gadget object
+ * @usb_ists: bitmap representation of device's reported interrupts
+ * (usb_ists register value)
+ */
+static void cdns3_check_usb_interrupt_proceed(struct cdns3_device *priv_dev,
+                                             u32 usb_ists)
+{
+       int speed = 0;
+
+       trace_cdns3_usb_irq(priv_dev, usb_ists);
+       if (usb_ists & USB_ISTS_L1ENTI) {
+               /*
+                * WORKAROUND: CDNS3 controller has issue with hardware resuming
+                * from L1. To fix it, if any DMA transfer is pending driver
+                * must starts driving resume signal immediately.
+                */
+               if (readl(&priv_dev->regs->drbl))
+                       __cdns3_gadget_wakeup(priv_dev);
+       }
+
+       /* Connection detected */
+       if (usb_ists & (USB_ISTS_CON2I | USB_ISTS_CONI)) {
+               speed = cdns3_get_speed(priv_dev);
+               priv_dev->gadget.speed = speed;
+               usb_gadget_set_state(&priv_dev->gadget, USB_STATE_POWERED);
+               cdns3_ep0_config(priv_dev);
+       }
+
+       /* Disconnection detected */
+       if (usb_ists & (USB_ISTS_DIS2I | USB_ISTS_DISI)) {
+               cdns3_disconnect_gadget(priv_dev);
+               priv_dev->gadget.speed = USB_SPEED_UNKNOWN;
+               usb_gadget_set_state(&priv_dev->gadget, USB_STATE_NOTATTACHED);
+               cdns3_hw_reset_eps_config(priv_dev);
+       }
+
+       if (usb_ists & (USB_ISTS_L2ENTI | USB_ISTS_U3ENTI)) {
+               if (priv_dev->gadget_driver &&
+                   priv_dev->gadget_driver->suspend) {
+                       spin_unlock(&priv_dev->lock);
+                       priv_dev->gadget_driver->suspend(&priv_dev->gadget);
+                       spin_lock(&priv_dev->lock);
+               }
+       }
+
+       if (usb_ists & (USB_ISTS_L2EXTI | USB_ISTS_U3EXTI)) {
+               if (priv_dev->gadget_driver &&
+                   priv_dev->gadget_driver->resume) {
+                       spin_unlock(&priv_dev->lock);
+                       priv_dev->gadget_driver->resume(&priv_dev->gadget);
+                       spin_lock(&priv_dev->lock);
+               }
+       }
+
+       /* reset*/
+       if (usb_ists & (USB_ISTS_UWRESI | USB_ISTS_UHRESI | USB_ISTS_U2RESI)) {
+               if (priv_dev->gadget_driver) {
+                       spin_unlock(&priv_dev->lock);
+                       usb_gadget_udc_reset(&priv_dev->gadget,
+                                            priv_dev->gadget_driver);
+                       spin_lock(&priv_dev->lock);
+
+                       /*read again to check the actual speed*/
+                       speed = cdns3_get_speed(priv_dev);
+                       priv_dev->gadget.speed = speed;
+                       cdns3_hw_reset_eps_config(priv_dev);
+                       cdns3_ep0_config(priv_dev);
+               }
+       }
+}
+
+/**
+ * cdns3_device_irq_handler- interrupt handler for device part of controller
+ *
+ * @irq: irq number for cdns3 core device
+ * @data: structure of cdns3
+ *
+ * Returns IRQ_HANDLED or IRQ_NONE
+ */
+static irqreturn_t cdns3_device_irq_handler(int irq, void *data)
+{
+       struct cdns3_device *priv_dev;
+       struct cdns3 *cdns = data;
+       irqreturn_t ret = IRQ_NONE;
+       u32 reg;
+
+       priv_dev = cdns->gadget_dev;
+
+       /* check USB device interrupt */
+       reg = readl(&priv_dev->regs->usb_ists);
+       if (reg) {
+               /* After masking interrupts the new interrupts won't be
+                * reported in usb_ists/ep_ists. In order to not lose some
+                * of them driver disables only detected interrupts.
+                * They will be enabled ASAP after clearing source of
+                * interrupt. This an unusual behavior only applies to
+                * usb_ists register.
+                */
+               reg = ~reg & readl(&priv_dev->regs->usb_ien);
+               /* mask deferred interrupt. */
+               writel(reg, &priv_dev->regs->usb_ien);
+               ret = IRQ_WAKE_THREAD;
+       }
+
+       /* check endpoint interrupt */
+       reg = readl(&priv_dev->regs->ep_ists);
+       if (reg) {
+               writel(0, &priv_dev->regs->ep_ien);
+               ret = IRQ_WAKE_THREAD;
+       }
+
+       return ret;
+}
+
+/**
+ * cdns3_device_thread_irq_handler- interrupt handler for device part
+ * of controller
+ *
+ * @irq: irq number for cdns3 core device
+ * @data: structure of cdns3
+ *
+ * Returns IRQ_HANDLED or IRQ_NONE
+ */
+static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data)
+{
+       struct cdns3_device *priv_dev;
+       struct cdns3 *cdns = data;
+       irqreturn_t ret = IRQ_NONE;
+       unsigned long flags;
+       int bit;
+       u32 reg;
+
+       priv_dev = cdns->gadget_dev;
+       spin_lock_irqsave(&priv_dev->lock, flags);
+
+       reg = readl(&priv_dev->regs->usb_ists);
+       if (reg) {
+               writel(reg, &priv_dev->regs->usb_ists);
+               writel(USB_IEN_INIT, &priv_dev->regs->usb_ien);
+               cdns3_check_usb_interrupt_proceed(priv_dev, reg);
+               ret = IRQ_HANDLED;
+       }
+
+       reg = readl(&priv_dev->regs->ep_ists);
+
+       /* handle default endpoint OUT */
+       if (reg & EP_ISTS_EP_OUT0) {
+               cdns3_check_ep0_interrupt_proceed(priv_dev, USB_DIR_OUT);
+               ret = IRQ_HANDLED;
+       }
+
+       /* handle default endpoint IN */
+       if (reg & EP_ISTS_EP_IN0) {
+               cdns3_check_ep0_interrupt_proceed(priv_dev, USB_DIR_IN);
+               ret = IRQ_HANDLED;
+       }
+
+       /* check if interrupt from non default endpoint, if no exit */
+       reg &= ~(EP_ISTS_EP_OUT0 | EP_ISTS_EP_IN0);
+       if (!reg)
+               goto irqend;
+
+       for_each_set_bit(bit, (unsigned long *)&reg,
+                        sizeof(u32) * BITS_PER_BYTE) {
+               cdns3_check_ep_interrupt_proceed(priv_dev->eps[bit]);
+               ret = IRQ_HANDLED;
+       }
+
+irqend:
+       writel(~0, &priv_dev->regs->ep_ien);
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+
+       return ret;
+}
+
+/**
+ * cdns3_ep_onchip_buffer_reserve - Try to reserve onchip buf for EP
+ *
+ * The real reservation will occur during write to EP_CFG register,
+ * this function is used to check if the 'size' reservation is allowed.
+ *
+ * @priv_dev: extended gadget object
+ * @size: the size (KB) for EP would like to allocate
+ * @is_in: endpoint direction
+ *
+ * Return 0 if the required size can met or negative value on failure
+ */
+static int cdns3_ep_onchip_buffer_reserve(struct cdns3_device *priv_dev,
+                                         int size, int is_in)
+{
+       int remained;
+
+       /* 2KB are reserved for EP0*/
+       remained = priv_dev->onchip_buffers - priv_dev->onchip_used_size - 2;
+
+       if (is_in) {
+               if (remained < size)
+                       return -EPERM;
+
+               priv_dev->onchip_used_size += size;
+       } else {
+               int required;
+
+               /**
+                *  ALL OUT EPs are shared the same chunk onchip memory, so
+                * driver checks if it already has assigned enough buffers
+                */
+               if (priv_dev->out_mem_is_allocated >= size)
+                       return 0;
+
+               required = size - priv_dev->out_mem_is_allocated;
+
+               if (required > remained)
+                       return -EPERM;
+
+               priv_dev->out_mem_is_allocated += required;
+               priv_dev->onchip_used_size += required;
+       }
+
+       return 0;
+}
+
+void cdns3_configure_dmult(struct cdns3_device *priv_dev,
+                          struct cdns3_endpoint *priv_ep)
+{
+       struct cdns3_usb_regs __iomem *regs = priv_dev->regs;
+
+       /* For dev_ver > DEV_VER_V2 DMULT is configured per endpoint */
+       if (priv_dev->dev_ver <= DEV_VER_V2)
+               writel(USB_CONF_DMULT, &regs->usb_conf);
+
+       if (priv_dev->dev_ver == DEV_VER_V2)
+               writel(USB_CONF2_EN_TDL_TRB, &regs->usb_conf2);
+
+       if (priv_dev->dev_ver >= DEV_VER_V3 && priv_ep) {
+               u32 mask;
+
+               if (priv_ep->dir)
+                       mask = BIT(priv_ep->num + 16);
+               else
+                       mask = BIT(priv_ep->num);
+
+               if (priv_ep->type != USB_ENDPOINT_XFER_ISOC) {
+                       cdns3_set_register_bit(&regs->tdl_from_trb, mask);
+                       cdns3_set_register_bit(&regs->tdl_beh, mask);
+                       cdns3_set_register_bit(&regs->tdl_beh2, mask);
+                       cdns3_set_register_bit(&regs->dma_adv_td, mask);
+               }
+
+               if (priv_ep->type == USB_ENDPOINT_XFER_ISOC && !priv_ep->dir)
+                       cdns3_set_register_bit(&regs->tdl_from_trb, mask);
+
+               cdns3_set_register_bit(&regs->dtrans, mask);
+       }
+}
+
+/**
+ * cdns3_ep_config Configure hardware endpoint
+ * @priv_ep: extended endpoint object
+ */
+void cdns3_ep_config(struct cdns3_endpoint *priv_ep)
+{
+       bool is_iso_ep = (priv_ep->type == USB_ENDPOINT_XFER_ISOC);
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       u32 bEndpointAddress = priv_ep->num | priv_ep->dir;
+       u32 max_packet_size = 0;
+       u8 maxburst = 0;
+       u32 ep_cfg = 0;
+       u8 buffering;
+       u8 mult = 0;
+       int ret;
+
+       buffering = CDNS3_EP_BUF_SIZE - 1;
+
+       cdns3_configure_dmult(priv_dev, priv_ep);
+
+       switch (priv_ep->type) {
+       case USB_ENDPOINT_XFER_INT:
+               ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_INT);
+
+               if ((priv_dev->dev_ver == DEV_VER_V2 && !priv_ep->dir) ||
+                   priv_dev->dev_ver > DEV_VER_V2)
+                       ep_cfg |= EP_CFG_TDL_CHK;
+               break;
+       case USB_ENDPOINT_XFER_BULK:
+               ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_BULK);
+
+               if ((priv_dev->dev_ver == DEV_VER_V2  && !priv_ep->dir) ||
+                   priv_dev->dev_ver > DEV_VER_V2)
+                       ep_cfg |= EP_CFG_TDL_CHK;
+               break;
+       default:
+               ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_ISOC);
+               mult = CDNS3_EP_ISO_HS_MULT - 1;
+               buffering = mult + 1;
+       }
+
+       switch (priv_dev->gadget.speed) {
+       case USB_SPEED_FULL:
+               max_packet_size = is_iso_ep ? 1023 : 64;
+               break;
+       case USB_SPEED_HIGH:
+               max_packet_size = is_iso_ep ? 1024 : 512;
+               break;
+       case USB_SPEED_SUPER:
+               /* It's limitation that driver assumes in driver. */
+               mult = 0;
+               max_packet_size = 1024;
+               if (priv_ep->type == USB_ENDPOINT_XFER_ISOC) {
+                       maxburst = CDNS3_EP_ISO_SS_BURST - 1;
+                       buffering = (mult + 1) *
+                                   (maxburst + 1);
+
+                       if (priv_ep->interval > 1)
+                               buffering++;
+               } else {
+                       maxburst = CDNS3_EP_BUF_SIZE - 1;
+               }
+               break;
+       default:
+               /* all other speed are not supported */
+               return;
+       }
+
+       if (max_packet_size == 1024)
+               priv_ep->trb_burst_size = 128;
+       else if (max_packet_size >= 512)
+               priv_ep->trb_burst_size = 64;
+       else
+               priv_ep->trb_burst_size = 16;
+
+       ret = cdns3_ep_onchip_buffer_reserve(priv_dev, buffering + 1,
+                                            !!priv_ep->dir);
+       if (ret) {
+               dev_err(priv_dev->dev, "onchip mem is full, ep is invalid\n");
+               return;
+       }
+
+       ep_cfg |= EP_CFG_MAXPKTSIZE(max_packet_size) |
+                 EP_CFG_MULT(mult) |
+                 EP_CFG_BUFFERING(buffering) |
+                 EP_CFG_MAXBURST(maxburst);
+
+       cdns3_select_ep(priv_dev, bEndpointAddress);
+       writel(ep_cfg, &priv_dev->regs->ep_cfg);
+
+       dev_dbg(priv_dev->dev, "Configure %s: with val %08x\n",
+               priv_ep->name, ep_cfg);
+}
+
+/* Find correct direction for HW endpoint according to description */
+static int cdns3_ep_dir_is_correct(struct usb_endpoint_descriptor *desc,
+                                  struct cdns3_endpoint *priv_ep)
+{
+       return (priv_ep->endpoint.caps.dir_in && usb_endpoint_dir_in(desc)) ||
+              (priv_ep->endpoint.caps.dir_out && usb_endpoint_dir_out(desc));
+}
+
+static struct
+cdns3_endpoint *cdns3_find_available_ep(struct cdns3_device *priv_dev,
+                                       struct usb_endpoint_descriptor *desc)
+{
+       struct usb_ep *ep;
+       struct cdns3_endpoint *priv_ep;
+
+       list_for_each_entry(ep, &priv_dev->gadget.ep_list, ep_list) {
+               unsigned long num;
+               /* ep name pattern likes epXin or epXout */
+               char c[2] = {ep->name[2], '\0'};
+
+               num = simple_strtoul(c, NULL, 10);
+
+               priv_ep = ep_to_cdns3_ep(ep);
+               if (cdns3_ep_dir_is_correct(desc, priv_ep)) {
+                       if (!(priv_ep->flags & EP_CLAIMED)) {
+                               priv_ep->num  = num;
+                               return priv_ep;
+                       }
+               }
+       }
+
+       return ERR_PTR(-ENOENT);
+}
+
+/*
+ *  Cadence IP has one limitation that all endpoints must be configured
+ * (Type & MaxPacketSize) before setting configuration through hardware
+ * register, it means we can't change endpoints configuration after
+ * set_configuration.
+ *
+ * This function set EP_CLAIMED flag which is added when the gadget driver
+ * uses usb_ep_autoconfig to configure specific endpoint;
+ * When the udc driver receives set_configurion request,
+ * it goes through all claimed endpoints, and configure all endpoints
+ * accordingly.
+ *
+ * At usb_ep_ops.enable/disable, we only enable and disable endpoint through
+ * ep_cfg register which can be changed after set_configuration, and do
+ * some software operation accordingly.
+ */
+static struct
+usb_ep *cdns3_gadget_match_ep(struct usb_gadget *gadget,
+                             struct usb_endpoint_descriptor *desc,
+                             struct usb_ss_ep_comp_descriptor *comp_desc)
+{
+       struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
+       struct cdns3_endpoint *priv_ep;
+       unsigned long flags;
+
+       priv_ep = cdns3_find_available_ep(priv_dev, desc);
+       if (IS_ERR(priv_ep)) {
+               dev_err(priv_dev->dev, "no available ep\n");
+               return NULL;
+       }
+
+       dev_dbg(priv_dev->dev, "match endpoint: %s\n", priv_ep->name);
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+       priv_ep->endpoint.desc = desc;
+       priv_ep->dir  = usb_endpoint_dir_in(desc) ? USB_DIR_IN : USB_DIR_OUT;
+       priv_ep->type = usb_endpoint_type(desc);
+       priv_ep->flags |= EP_CLAIMED;
+       priv_ep->interval = desc->bInterval ? BIT(desc->bInterval - 1) : 0;
+
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+       return &priv_ep->endpoint;
+}
+
+/**
+ * cdns3_gadget_ep_alloc_request Allocates request
+ * @ep: endpoint object associated with request
+ * @gfp_flags: gfp flags
+ *
+ * Returns allocated request address, NULL on allocation error
+ */
+struct usb_request *cdns3_gadget_ep_alloc_request(struct usb_ep *ep,
+                                                 gfp_t gfp_flags)
+{
+       struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep);
+       struct cdns3_request *priv_req;
+
+       priv_req = kzalloc(sizeof(*priv_req), gfp_flags);
+       if (!priv_req)
+               return NULL;
+
+       priv_req->priv_ep = priv_ep;
+
+       trace_cdns3_alloc_request(priv_req);
+       return &priv_req->request;
+}
+
+/**
+ * cdns3_gadget_ep_free_request Free memory occupied by request
+ * @ep: endpoint object associated with request
+ * @request: request to free memory
+ */
+void cdns3_gadget_ep_free_request(struct usb_ep *ep,
+                                 struct usb_request *request)
+{
+       struct cdns3_request *priv_req = to_cdns3_request(request);
+
+       if (priv_req->aligned_buf)
+               priv_req->aligned_buf->in_use = 0;
+
+       trace_cdns3_free_request(priv_req);
+       kfree(priv_req);
+}
+
+/**
+ * cdns3_gadget_ep_enable Enable endpoint
+ * @ep: endpoint object
+ * @desc: endpoint descriptor
+ *
+ * Returns 0 on success, error code elsewhere
+ */
+static int cdns3_gadget_ep_enable(struct usb_ep *ep,
+                                 const struct usb_endpoint_descriptor *desc)
+{
+       struct cdns3_endpoint *priv_ep;
+       struct cdns3_device *priv_dev;
+       u32 reg = EP_STS_EN_TRBERREN;
+       u32 bEndpointAddress;
+       unsigned long flags;
+       int enable = 1;
+       int ret;
+       int val;
+
+       priv_ep = ep_to_cdns3_ep(ep);
+       priv_dev = priv_ep->cdns3_dev;
+
+       if (!ep || !desc || desc->bDescriptorType != USB_DT_ENDPOINT) {
+               dev_dbg(priv_dev->dev, "usbss: invalid parameters\n");
+               return -EINVAL;
+       }
+
+       if (!desc->wMaxPacketSize) {
+               dev_err(priv_dev->dev, "usbss: missing wMaxPacketSize\n");
+               return -EINVAL;
+       }
+
+       if (WARN_ON(priv_ep->flags & EP_ENABLED))
+               return 0;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+
+       priv_ep->endpoint.desc = desc;
+       priv_ep->type = usb_endpoint_type(desc);
+       priv_ep->interval = desc->bInterval ? BIT(desc->bInterval - 1) : 0;
+
+       if (priv_ep->interval > ISO_MAX_INTERVAL &&
+           priv_ep->type == USB_ENDPOINT_XFER_ISOC) {
+               dev_err(priv_dev->dev, "Driver is limited to %d period\n",
+                       ISO_MAX_INTERVAL);
+
+               ret =  -EINVAL;
+               goto exit;
+       }
+
+       ret = cdns3_allocate_trb_pool(priv_ep);
+
+       if (ret)
+               goto exit;
+
+       bEndpointAddress = priv_ep->num | priv_ep->dir;
+       cdns3_select_ep(priv_dev, bEndpointAddress);
+
+       trace_cdns3_gadget_ep_enable(priv_ep);
+
+       writel(EP_CMD_EPRST, &priv_dev->regs->ep_cmd);
+
+       ret = readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val,
+                                       !(val & (EP_CMD_CSTALL | EP_CMD_EPRST)),
+                                       1000);
+
+       if (unlikely(ret)) {
+               cdns3_free_trb_pool(priv_ep);
+               ret =  -EINVAL;
+               goto exit;
+       }
+
+       /* enable interrupt for selected endpoint */
+       cdns3_set_register_bit(&priv_dev->regs->ep_ien,
+                              BIT(cdns3_ep_addr_to_index(bEndpointAddress)));
+
+       if (priv_dev->dev_ver < DEV_VER_V2)
+               cdns3_wa2_enable_detection(priv_dev, priv_ep, reg);
+
+       writel(reg, &priv_dev->regs->ep_sts_en);
+
+       /*
+        * For some versions of controller at some point during ISO OUT traffic
+        * DMA reads Transfer Ring for the EP which has never got doorbell.
+        * This issue was detected only on simulation, but to avoid this issue
+        * driver add protection against it. To fix it driver enable ISO OUT
+        * endpoint before setting DRBL. This special treatment of ISO OUT
+        * endpoints are recommended by controller specification.
+        */
+       if (priv_ep->type == USB_ENDPOINT_XFER_ISOC  && !priv_ep->dir)
+               enable = 0;
+
+       if (enable)
+               cdns3_set_register_bit(&priv_dev->regs->ep_cfg, EP_CFG_ENABLE);
+
+       ep->desc = desc;
+       priv_ep->flags &= ~(EP_PENDING_REQUEST | EP_STALLED | EP_STALL_PENDING |
+                           EP_QUIRK_ISO_OUT_EN | EP_QUIRK_EXTRA_BUF_EN);
+       priv_ep->flags |= EP_ENABLED | EP_UPDATE_EP_TRBADDR;
+       priv_ep->wa1_set = 0;
+       priv_ep->enqueue = 0;
+       priv_ep->dequeue = 0;
+       reg = readl(&priv_dev->regs->ep_sts);
+       priv_ep->pcs = !!EP_STS_CCS(reg);
+       priv_ep->ccs = !!EP_STS_CCS(reg);
+       /* one TRB is reserved for link TRB used in DMULT mode*/
+       priv_ep->free_trbs = priv_ep->num_trbs - 1;
+exit:
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+
+       return ret;
+}
+
+/**
+ * cdns3_gadget_ep_disable Disable endpoint
+ * @ep: endpoint object
+ *
+ * Returns 0 on success, error code elsewhere
+ */
+static int cdns3_gadget_ep_disable(struct usb_ep *ep)
+{
+       struct cdns3_endpoint *priv_ep;
+       struct cdns3_request *priv_req;
+       struct cdns3_device *priv_dev;
+       struct usb_request *request;
+       unsigned long flags;
+       int ret = 0;
+       u32 ep_cfg;
+       int val;
+
+       if (!ep) {
+               pr_err("usbss: invalid parameters\n");
+               return -EINVAL;
+       }
+
+       priv_ep = ep_to_cdns3_ep(ep);
+       priv_dev = priv_ep->cdns3_dev;
+
+       if (WARN_ON(!(priv_ep->flags & EP_ENABLED)))
+               return 0;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+
+       trace_cdns3_gadget_ep_disable(priv_ep);
+
+       cdns3_select_ep(priv_dev, ep->desc->bEndpointAddress);
+
+       ep_cfg = readl(&priv_dev->regs->ep_cfg);
+       ep_cfg &= ~EP_CFG_ENABLE;
+       writel(ep_cfg, &priv_dev->regs->ep_cfg);
+
+       /**
+        * Driver needs some time before resetting endpoint.
+        * It need waits for clearing DBUSY bit or for timeout expired.
+        * 10us is enough time for controller to stop transfer.
+        */
+       readl_poll_timeout_atomic(&priv_dev->regs->ep_sts, val,
+                                 !(val & EP_STS_DBUSY), 10);
+       writel(EP_CMD_EPRST, &priv_dev->regs->ep_cmd);
+
+       readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val,
+                                 !(val & (EP_CMD_CSTALL | EP_CMD_EPRST)),
+                                 1000);
+       if (unlikely(ret))
+               dev_err(priv_dev->dev, "Timeout: %s resetting failed.\n",
+                       priv_ep->name);
+
+       while (!list_empty(&priv_ep->pending_req_list)) {
+               request = cdns3_next_request(&priv_ep->pending_req_list);
+
+               cdns3_gadget_giveback(priv_ep, to_cdns3_request(request),
+                                     -ESHUTDOWN);
+       }
+
+       while (!list_empty(&priv_ep->wa2_descmiss_req_list)) {
+               priv_req = cdns3_next_priv_request(&priv_ep->wa2_descmiss_req_list);
+
+               kfree(priv_req->request.buf);
+               cdns3_gadget_ep_free_request(&priv_ep->endpoint,
+                                            &priv_req->request);
+               list_del_init(&priv_req->list);
+               --priv_ep->wa2_counter;
+       }
+
+       while (!list_empty(&priv_ep->deferred_req_list)) {
+               request = cdns3_next_request(&priv_ep->deferred_req_list);
+
+               cdns3_gadget_giveback(priv_ep, to_cdns3_request(request),
+                                     -ESHUTDOWN);
+       }
+
+       priv_ep->descmis_req = NULL;
+
+       ep->desc = NULL;
+       priv_ep->flags &= ~EP_ENABLED;
+
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+
+       return ret;
+}
+
+/**
+ * cdns3_gadget_ep_queue Transfer data on endpoint
+ * @ep: endpoint object
+ * @request: request object
+ * @gfp_flags: gfp flags
+ *
+ * Returns 0 on success, error code elsewhere
+ */
+static int __cdns3_gadget_ep_queue(struct usb_ep *ep,
+                                  struct usb_request *request,
+                                  gfp_t gfp_flags)
+{
+       struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep);
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       struct cdns3_request *priv_req;
+       int ret = 0;
+
+       request->actual = 0;
+       request->status = -EINPROGRESS;
+       priv_req = to_cdns3_request(request);
+       trace_cdns3_ep_queue(priv_req);
+
+       if (priv_dev->dev_ver < DEV_VER_V2) {
+               ret = cdns3_wa2_gadget_ep_queue(priv_dev, priv_ep,
+                                               priv_req);
+
+               if (ret == EINPROGRESS)
+                       return 0;
+       }
+
+       ret = cdns3_prepare_aligned_request_buf(priv_req);
+       if (ret < 0)
+               return ret;
+
+       ret = usb_gadget_map_request(&priv_dev->gadget, request,
+                                    usb_endpoint_dir_in(ep->desc));
+       if (ret)
+               return ret;
+
+       list_add_tail(&request->list, &priv_ep->deferred_req_list);
+
+       /*
+        * If hardware endpoint configuration has not been set yet then
+        * just queue request in deferred list. Transfer will be started in
+        * cdns3_set_hw_configuration.
+        */
+       if (priv_dev->hw_configured_flag && !(priv_ep->flags & EP_STALLED) &&
+           !(priv_ep->flags & EP_STALL_PENDING))
+               cdns3_start_all_request(priv_dev, priv_ep);
+
+       return 0;
+}
+
+static int cdns3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
+                                gfp_t gfp_flags)
+{
+       struct usb_request *zlp_request;
+       struct cdns3_endpoint *priv_ep;
+       struct cdns3_device *priv_dev;
+       unsigned long flags;
+       int ret;
+
+       if (!request || !ep)
+               return -EINVAL;
+
+       priv_ep = ep_to_cdns3_ep(ep);
+       priv_dev = priv_ep->cdns3_dev;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+
+       ret = __cdns3_gadget_ep_queue(ep, request, gfp_flags);
+
+       if (ret == 0 && request->zero && request->length &&
+           (request->length % ep->maxpacket == 0)) {
+               struct cdns3_request *priv_req;
+
+               zlp_request = cdns3_gadget_ep_alloc_request(ep, GFP_ATOMIC);
+               zlp_request->buf = priv_dev->zlp_buf;
+               zlp_request->length = 0;
+
+               priv_req = to_cdns3_request(zlp_request);
+               priv_req->flags |= REQUEST_ZLP;
+
+               dev_dbg(priv_dev->dev, "Queuing ZLP for endpoint: %s\n",
+                       priv_ep->name);
+               ret = __cdns3_gadget_ep_queue(ep, zlp_request, gfp_flags);
+       }
+
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+       return ret;
+}
+
+/**
+ * cdns3_gadget_ep_dequeue Remove request from transfer queue
+ * @ep: endpoint object associated with request
+ * @request: request object
+ *
+ * Returns 0 on success, error code elsewhere
+ */
+int cdns3_gadget_ep_dequeue(struct usb_ep *ep,
+                           struct usb_request *request)
+{
+       struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep);
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       struct usb_request *req, *req_temp;
+       struct cdns3_request *priv_req;
+       struct cdns3_trb *link_trb;
+       unsigned long flags;
+       int ret = 0;
+
+       if (!ep || !request || !ep->desc)
+               return -EINVAL;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+
+       priv_req = to_cdns3_request(request);
+
+       trace_cdns3_ep_dequeue(priv_req);
+
+       cdns3_select_ep(priv_dev, ep->desc->bEndpointAddress);
+
+       list_for_each_entry_safe(req, req_temp, &priv_ep->pending_req_list,
+                                list) {
+               if (request == req)
+                       goto found;
+       }
+
+       list_for_each_entry_safe(req, req_temp, &priv_ep->deferred_req_list,
+                                list) {
+               if (request == req)
+                       goto found;
+       }
+
+       goto not_found;
+
+found:
+
+       if (priv_ep->wa1_trb == priv_req->trb)
+               cdns3_wa1_restore_cycle_bit(priv_ep);
+
+       link_trb = priv_req->trb;
+       cdns3_move_deq_to_next_trb(priv_req);
+       cdns3_gadget_giveback(priv_ep, priv_req, -ECONNRESET);
+
+       /* Update ring */
+       request = cdns3_next_request(&priv_ep->deferred_req_list);
+       if (request) {
+               priv_req = to_cdns3_request(request);
+
+               link_trb->buffer = TRB_BUFFER(priv_ep->trb_pool_dma +
+                                             (priv_req->start_trb * TRB_SIZE));
+               link_trb->control = (link_trb->control & TRB_CYCLE) |
+                                   TRB_TYPE(TRB_LINK) | TRB_CHAIN | TRB_TOGGLE;
+       } else {
+               priv_ep->flags |= EP_UPDATE_EP_TRBADDR;
+       }
+
+not_found:
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+       return ret;
+}
+
+/**
+ * __cdns3_gadget_ep_set_halt Sets stall on selected endpoint
+ * Should be called after acquiring spin_lock and selecting ep
+ * @ep: endpoint object to set stall on.
+ */
+void __cdns3_gadget_ep_set_halt(struct cdns3_endpoint *priv_ep)
+{
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+
+       trace_cdns3_halt(priv_ep, 1, 0);
+
+       if (!(priv_ep->flags & EP_STALLED)) {
+               u32 ep_sts_reg = readl(&priv_dev->regs->ep_sts);
+
+               if (!(ep_sts_reg & EP_STS_DBUSY))
+                       cdns3_ep_stall_flush(priv_ep);
+               else
+                       priv_ep->flags |= EP_STALL_PENDING;
+       }
+}
+
+/**
+ * __cdns3_gadget_ep_clear_halt Clears stall on selected endpoint
+ * Should be called after acquiring spin_lock and selecting ep
+ * @ep: endpoint object to clear stall on
+ */
+int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
+{
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       struct usb_request *request;
+       int ret = 0;
+       int val;
+
+       trace_cdns3_halt(priv_ep, 0, 0);
+
+       writel(EP_CMD_CSTALL | EP_CMD_EPRST, &priv_dev->regs->ep_cmd);
+
+       /* wait for EPRST cleared */
+       readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val,
+                                 !(val & EP_CMD_EPRST), 100);
+       if (ret)
+               return -EINVAL;
+
+       priv_ep->flags &= ~(EP_STALLED | EP_STALL_PENDING);
+
+       request = cdns3_next_request(&priv_ep->pending_req_list);
+
+       if (request)
+               cdns3_rearm_transfer(priv_ep, 1);
+
+       cdns3_start_all_request(priv_dev, priv_ep);
+       return ret;
+}
+
+/**
+ * cdns3_gadget_ep_set_halt Sets/clears stall on selected endpoint
+ * @ep: endpoint object to set/clear stall on
+ * @value: 1 for set stall, 0 for clear stall
+ *
+ * Returns 0 on success, error code elsewhere
+ */
+int cdns3_gadget_ep_set_halt(struct usb_ep *ep, int value)
+{
+       struct cdns3_endpoint *priv_ep = ep_to_cdns3_ep(ep);
+       struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
+       unsigned long flags;
+       int ret = 0;
+
+       if (!(priv_ep->flags & EP_ENABLED))
+               return -EPERM;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+
+       cdns3_select_ep(priv_dev, ep->desc->bEndpointAddress);
+
+       if (!value) {
+               priv_ep->flags &= ~EP_WEDGE;
+               ret = __cdns3_gadget_ep_clear_halt(priv_ep);
+       } else {
+               __cdns3_gadget_ep_set_halt(priv_ep);
+       }
+
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+
+       return ret;
+}
+
+extern const struct usb_ep_ops cdns3_gadget_ep0_ops;
+
+static const struct usb_ep_ops cdns3_gadget_ep_ops = {
+       .enable = cdns3_gadget_ep_enable,
+       .disable = cdns3_gadget_ep_disable,
+       .alloc_request = cdns3_gadget_ep_alloc_request,
+       .free_request = cdns3_gadget_ep_free_request,
+       .queue = cdns3_gadget_ep_queue,
+       .dequeue = cdns3_gadget_ep_dequeue,
+       .set_halt = cdns3_gadget_ep_set_halt,
+       .set_wedge = cdns3_gadget_ep_set_wedge,
+};
+
+/**
+ * cdns3_gadget_get_frame Returns number of actual ITP frame
+ * @gadget: gadget object
+ *
+ * Returns number of actual ITP frame
+ */
+static int cdns3_gadget_get_frame(struct usb_gadget *gadget)
+{
+       struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
+
+       return readl(&priv_dev->regs->usb_itpn);
+}
+
+int __cdns3_gadget_wakeup(struct cdns3_device *priv_dev)
+{
+       enum usb_device_speed speed;
+
+       speed = cdns3_get_speed(priv_dev);
+
+       if (speed >= USB_SPEED_SUPER)
+               return 0;
+
+       /* Start driving resume signaling to indicate remote wakeup. */
+       writel(USB_CONF_LGO_L0, &priv_dev->regs->usb_conf);
+
+       return 0;
+}
+
+static int cdns3_gadget_wakeup(struct usb_gadget *gadget)
+{
+       struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
+       unsigned long flags;
+       int ret = 0;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+       ret = __cdns3_gadget_wakeup(priv_dev);
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+       return ret;
+}
+
+static int cdns3_gadget_set_selfpowered(struct usb_gadget *gadget,
+                                       int is_selfpowered)
+{
+       struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
+       unsigned long flags;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+       priv_dev->is_selfpowered = !!is_selfpowered;
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+       return 0;
+}
+
+static int cdns3_gadget_pullup(struct usb_gadget *gadget, int is_on)
+{
+       struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
+
+       if (is_on)
+               writel(USB_CONF_DEVEN, &priv_dev->regs->usb_conf);
+       else
+               writel(USB_CONF_DEVDS, &priv_dev->regs->usb_conf);
+
+       return 0;
+}
+
+static void cdns3_gadget_config(struct cdns3_device *priv_dev)
+{
+       struct cdns3_usb_regs __iomem *regs = priv_dev->regs;
+       u32 reg;
+
+       cdns3_ep0_config(priv_dev);
+
+       /* enable interrupts for endpoint 0 (in and out) */
+       writel(EP_IEN_EP_OUT0 | EP_IEN_EP_IN0, &regs->ep_ien);
+
+       /*
+        * Driver needs to modify LFPS minimal U1 Exit time for DEV_VER_TI_V1
+        * revision of controller.
+        */
+       if (priv_dev->dev_ver == DEV_VER_TI_V1) {
+               reg = readl(&regs->dbg_link1);
+
+               reg &= ~DBG_LINK1_LFPS_MIN_GEN_U1_EXIT_MASK;
+               reg |= DBG_LINK1_LFPS_MIN_GEN_U1_EXIT(0x55) |
+                      DBG_LINK1_LFPS_MIN_GEN_U1_EXIT_SET;
+               writel(reg, &regs->dbg_link1);
+       }
+
+       /*
+        * By default some platforms has set protected access to memory.
+        * This cause problem with cache, so driver restore non-secure
+        * access to memory.
+        */
+       reg = readl(&regs->dma_axi_ctrl);
+       reg |= DMA_AXI_CTRL_MARPROT(DMA_AXI_CTRL_NON_SECURE) |
+              DMA_AXI_CTRL_MAWPROT(DMA_AXI_CTRL_NON_SECURE);
+       writel(reg, &regs->dma_axi_ctrl);
+
+       /* enable generic interrupt*/
+       writel(USB_IEN_INIT, &regs->usb_ien);
+       writel(USB_CONF_CLK2OFFDS | USB_CONF_L1DS, &regs->usb_conf);
+
+       cdns3_configure_dmult(priv_dev, NULL);
+
+       cdns3_gadget_pullup(&priv_dev->gadget, 1);
+}
+
+/**
+ * cdns3_gadget_udc_start Gadget start
+ * @gadget: gadget object
+ * @driver: driver which operates on this gadget
+ *
+ * Returns 0 on success, error code elsewhere
+ */
+static int cdns3_gadget_udc_start(struct usb_gadget *gadget,
+                                 struct usb_gadget_driver *driver)
+{
+       struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
+       unsigned long flags;
+
+       spin_lock_irqsave(&priv_dev->lock, flags);
+       priv_dev->gadget_driver = driver;
+       cdns3_gadget_config(priv_dev);
+       spin_unlock_irqrestore(&priv_dev->lock, flags);
+       return 0;
+}
+
+/**
+ * cdns3_gadget_udc_stop Stops gadget
+ * @gadget: gadget object
+ *
+ * Returns 0
+ */
+static int cdns3_gadget_udc_stop(struct usb_gadget *gadget)
+{
+       struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
+       struct cdns3_endpoint *priv_ep;
+       u32 bEndpointAddress;
+       struct usb_ep *ep;
+       int ret = 0;
+       int val;
+
+       priv_dev->gadget_driver = NULL;
+
+       priv_dev->onchip_used_size = 0;
+       priv_dev->out_mem_is_allocated = 0;
+       priv_dev->gadget.speed = USB_SPEED_UNKNOWN;
+
+       list_for_each_entry(ep, &priv_dev->gadget.ep_list, ep_list) {
+               priv_ep = ep_to_cdns3_ep(ep);
+               bEndpointAddress = priv_ep->num | priv_ep->dir;
+               cdns3_select_ep(priv_dev, bEndpointAddress);
+               writel(EP_CMD_EPRST, &priv_dev->regs->ep_cmd);
+               readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val,
+                                         !(val & EP_CMD_EPRST), 100);
+       }
+
+       /* disable interrupt for device */
+       writel(0, &priv_dev->regs->usb_ien);
+       writel(USB_CONF_DEVDS, &priv_dev->regs->usb_conf);
+
+       return ret;
+}
+
+static void cdns3_gadget_udc_set_speed(struct usb_gadget *gadget,
+                                      enum usb_device_speed speed)
+{
+       struct cdns3_device *priv_dev = gadget_to_cdns3_device(gadget);
+
+       switch (speed) {
+       case USB_SPEED_FULL:
+               writel(USB_CONF_SFORCE_FS, &priv_dev->regs->usb_conf);
+               writel(USB_CONF_USB3DIS, &priv_dev->regs->usb_conf);
+               break;
+       case USB_SPEED_HIGH:
+               writel(USB_CONF_USB3DIS, &priv_dev->regs->usb_conf);
+               break;
+       case USB_SPEED_SUPER:
+               break;
+       default:
+               dev_err(cdns->dev, "invalid speed parameter %d\n",
+                       speed);
+       }
+
+       priv_dev->gadget.speed = speed;
+}
+
+static const struct usb_gadget_ops cdns3_gadget_ops = {
+       .get_frame = cdns3_gadget_get_frame,
+       .wakeup = cdns3_gadget_wakeup,
+       .set_selfpowered = cdns3_gadget_set_selfpowered,
+       .pullup = cdns3_gadget_pullup,
+       .udc_start = cdns3_gadget_udc_start,
+       .udc_stop = cdns3_gadget_udc_stop,
+       .match_ep = cdns3_gadget_match_ep,
+       .udc_set_speed = cdns3_gadget_udc_set_speed,
+};
+
+static void cdns3_free_all_eps(struct cdns3_device *priv_dev)
+{
+       int i;
+
+       /* ep0 OUT point to ep0 IN. */
+       priv_dev->eps[16] = NULL;
+
+       for (i = 0; i < CDNS3_ENDPOINTS_MAX_COUNT; i++)
+               if (priv_dev->eps[i]) {
+                       cdns3_free_trb_pool(priv_dev->eps[i]);
+                       devm_kfree(priv_dev->dev, priv_dev->eps[i]);
+               }
+}
+
+/**
+ * cdns3_init_eps Initializes software endpoints of gadget
+ * @cdns3: extended gadget object
+ *
+ * Returns 0 on success, error code elsewhere
+ */
+static int cdns3_init_eps(struct cdns3_device *priv_dev)
+{
+       u32 ep_enabled_reg, iso_ep_reg;
+       struct cdns3_endpoint *priv_ep;
+       int ep_dir, ep_number;
+       u32 ep_mask;
+       int ret = 0;
+       int i;
+
+       /* Read it from USB_CAP3 to USB_CAP5 */
+       ep_enabled_reg = readl(&priv_dev->regs->usb_cap3);
+       iso_ep_reg = readl(&priv_dev->regs->usb_cap4);
+
+       dev_dbg(priv_dev->dev, "Initializing non-zero endpoints\n");
+
+       for (i = 0; i < CDNS3_ENDPOINTS_MAX_COUNT; i++) {
+               ep_dir = i >> 4;        /* i div 16 */
+               ep_number = i & 0xF;    /* i % 16 */
+               ep_mask = BIT(i);
+
+               if (!(ep_enabled_reg & ep_mask))
+                       continue;
+
+               if (ep_dir && !ep_number) {
+                       priv_dev->eps[i] = priv_dev->eps[0];
+                       continue;
+               }
+
+               priv_ep = devm_kzalloc(priv_dev->dev, sizeof(*priv_ep),
+                                      GFP_KERNEL);
+               if (!priv_ep) {
+                       ret = -ENOMEM;
+                       goto err;
+               }
+
+               /* set parent of endpoint object */
+               priv_ep->cdns3_dev = priv_dev;
+               priv_dev->eps[i] = priv_ep;
+               priv_ep->num = ep_number;
+               priv_ep->dir = ep_dir ? USB_DIR_IN : USB_DIR_OUT;
+
+               if (!ep_number) {
+                       ret = cdns3_init_ep0(priv_dev, priv_ep);
+                       if (ret) {
+                               dev_err(priv_dev->dev, "Failed to init ep0\n");
+                               goto err;
+                       }
+               } else {
+                       snprintf(priv_ep->name, sizeof(priv_ep->name), "ep%d%s",
+                                ep_number, !!ep_dir ? "in" : "out");
+                       priv_ep->endpoint.name = priv_ep->name;
+
+                       usb_ep_set_maxpacket_limit(&priv_ep->endpoint,
+                                                  CDNS3_EP_MAX_PACKET_LIMIT);
+                       priv_ep->endpoint.max_streams = CDNS3_EP_MAX_STREAMS;
+                       priv_ep->endpoint.ops = &cdns3_gadget_ep_ops;
+                       if (ep_dir)
+                               priv_ep->endpoint.caps.dir_in = 1;
+                       else
+                               priv_ep->endpoint.caps.dir_out = 1;
+
+                       if (iso_ep_reg & ep_mask)
+                               priv_ep->endpoint.caps.type_iso = 1;
+
+                       priv_ep->endpoint.caps.type_bulk = 1;
+                       priv_ep->endpoint.caps.type_int = 1;
+
+                       list_add_tail(&priv_ep->endpoint.ep_list,
+                                     &priv_dev->gadget.ep_list);
+               }
+
+               priv_ep->flags = 0;
+
+               dev_info(priv_dev->dev, "Initialized  %s support: %s %s\n",
+                        priv_ep->name,
+                        priv_ep->endpoint.caps.type_bulk ? "BULK, INT" : "",
+                        priv_ep->endpoint.caps.type_iso ? "ISO" : "");
+
+               INIT_LIST_HEAD(&priv_ep->pending_req_list);
+               INIT_LIST_HEAD(&priv_ep->deferred_req_list);
+               INIT_LIST_HEAD(&priv_ep->wa2_descmiss_req_list);
+       }
+
+       return 0;
+err:
+       cdns3_free_all_eps(priv_dev);
+       return -ENOMEM;
+}
+
+void cdns3_gadget_exit(struct cdns3 *cdns)
+{
+       struct cdns3_device *priv_dev;
+
+       priv_dev = cdns->gadget_dev;
+
+       usb_del_gadget_udc(&priv_dev->gadget);
+
+       cdns3_free_all_eps(priv_dev);
+
+       while (!list_empty(&priv_dev->aligned_buf_list)) {
+               struct cdns3_aligned_buf *buf;
+
+               buf = cdns3_next_align_buf(&priv_dev->aligned_buf_list);
+               dma_free_coherent(buf->buf);
+
+               list_del(&buf->list);
+               kfree(buf);
+       }
+
+       dma_free_coherent(priv_dev->setup_buf);
+
+       kfree(priv_dev->zlp_buf);
+       kfree(priv_dev);
+       cdns->gadget_dev = NULL;
+       cdns3_drd_switch_gadget(cdns, 0);
+}
+
+static int cdns3_gadget_start(struct cdns3 *cdns)
+{
+       struct cdns3_device *priv_dev;
+       u32 max_speed;
+       int ret;
+
+       priv_dev = kzalloc(sizeof(*priv_dev), GFP_KERNEL);
+       if (!priv_dev)
+               return -ENOMEM;
+
+       cdns->gadget_dev = priv_dev;
+       priv_dev->sysdev = cdns->dev;
+       priv_dev->dev = cdns->dev;
+       priv_dev->regs = cdns->dev_regs;
+
+       dev_read_u32(priv_dev->dev, "cdns,on-chip-buff-size",
+                    &priv_dev->onchip_buffers);
+
+       if (priv_dev->onchip_buffers <=  0) {
+               u32 reg = readl(&priv_dev->regs->usb_cap2);
+
+               priv_dev->onchip_buffers = USB_CAP2_ACTUAL_MEM_SIZE(reg);
+       }
+
+       if (!priv_dev->onchip_buffers)
+               priv_dev->onchip_buffers = 256;
+
+       max_speed = usb_get_maximum_speed(dev_of_offset(cdns->dev));
+
+       /* Check the maximum_speed parameter */
+       switch (max_speed) {
+       case USB_SPEED_FULL:
+               /* fall through */
+       case USB_SPEED_HIGH:
+               /* fall through */
+       case USB_SPEED_SUPER:
+               break;
+       default:
+               dev_err(cdns->dev, "invalid maximum_speed parameter %d\n",
+                       max_speed);
+               /* fall through */
+       case USB_SPEED_UNKNOWN:
+               /* default to superspeed */
+               max_speed = USB_SPEED_SUPER;
+               break;
+       }
+
+       /* fill gadget fields */
+       priv_dev->gadget.max_speed = max_speed;
+       priv_dev->gadget.speed = USB_SPEED_UNKNOWN;
+       priv_dev->gadget.ops = &cdns3_gadget_ops;
+       priv_dev->gadget.name = "cdns3-gadget";
+#ifndef __UBOOT__
+       priv_dev->gadget.name = "usb-ss-gadget";
+       priv_dev->gadget.sg_supported = 1;
+       priv_dev->gadget.quirk_avoids_skb_reserve = 1;
+#endif
+
+       spin_lock_init(&priv_dev->lock);
+       INIT_WORK(&priv_dev->pending_status_wq,
+                 cdns3_pending_setup_status_handler);
+
+       /* initialize endpoint container */
+       INIT_LIST_HEAD(&priv_dev->gadget.ep_list);
+       INIT_LIST_HEAD(&priv_dev->aligned_buf_list);
+
+       ret = cdns3_init_eps(priv_dev);
+       if (ret) {
+               dev_err(priv_dev->dev, "Failed to create endpoints\n");
+               goto err1;
+       }
+
+       /* allocate memory for setup packet buffer */
+       priv_dev->setup_buf =
+               dma_alloc_coherent(8, (unsigned long *)&priv_dev->setup_dma);
+       if (!priv_dev->setup_buf) {
+               ret = -ENOMEM;
+               goto err2;
+       }
+
+       priv_dev->dev_ver = readl(&priv_dev->regs->usb_cap6);
+
+       dev_dbg(priv_dev->dev, "Device Controller version: %08x\n",
+               readl(&priv_dev->regs->usb_cap6));
+       dev_dbg(priv_dev->dev, "USB Capabilities:: %08x\n",
+               readl(&priv_dev->regs->usb_cap1));
+       dev_dbg(priv_dev->dev, "On-Chip memory cnfiguration: %08x\n",
+               readl(&priv_dev->regs->usb_cap2));
+
+       priv_dev->dev_ver = GET_DEV_BASE_VERSION(priv_dev->dev_ver);
+
+       priv_dev->zlp_buf = kzalloc(CDNS3_EP_ZLP_BUF_SIZE, GFP_KERNEL);
+       if (!priv_dev->zlp_buf) {
+               ret = -ENOMEM;
+               goto err3;
+       }
+
+       /* add USB gadget device */
+       ret = usb_add_gadget_udc((struct device *)priv_dev->dev,
+                                &priv_dev->gadget);
+       if (ret < 0) {
+               dev_err(priv_dev->dev,
+                       "Failed to register USB device controller\n");
+               goto err4;
+       }
+
+       return 0;
+err4:
+       kfree(priv_dev->zlp_buf);
+err3:
+       dma_free_coherent(priv_dev->setup_buf);
+err2:
+       cdns3_free_all_eps(priv_dev);
+err1:
+       cdns->gadget_dev = NULL;
+       return ret;
+}
+
+static int __cdns3_gadget_init(struct cdns3 *cdns)
+{
+       int ret = 0;
+
+       cdns3_drd_switch_gadget(cdns, 1);
+
+       ret = cdns3_gadget_start(cdns);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+
+static int cdns3_gadget_suspend(struct cdns3 *cdns, bool do_wakeup)
+{
+       struct cdns3_device *priv_dev = cdns->gadget_dev;
+
+       cdns3_disconnect_gadget(priv_dev);
+
+       priv_dev->gadget.speed = USB_SPEED_UNKNOWN;
+       usb_gadget_set_state(&priv_dev->gadget, USB_STATE_NOTATTACHED);
+       cdns3_hw_reset_eps_config(priv_dev);
+
+       /* disable interrupt for device */
+       writel(0, &priv_dev->regs->usb_ien);
+
+       cdns3_gadget_pullup(&priv_dev->gadget, 0);
+
+       return 0;
+}
+
+static int cdns3_gadget_resume(struct cdns3 *cdns, bool hibernated)
+{
+       struct cdns3_device *priv_dev = cdns->gadget_dev;
+
+       if (!priv_dev->gadget_driver)
+               return 0;
+
+       cdns3_gadget_config(priv_dev);
+
+       return 0;
+}
+
+/**
+ * cdns3_gadget_init - initialize device structure
+ *
+ * cdns: cdns3 instance
+ *
+ * This function initializes the gadget.
+ */
+int cdns3_gadget_init(struct cdns3 *cdns)
+{
+       struct cdns3_role_driver *rdrv;
+
+       rdrv = devm_kzalloc(cdns->dev, sizeof(*rdrv), GFP_KERNEL);
+       if (!rdrv)
+               return -ENOMEM;
+
+       rdrv->start     = __cdns3_gadget_init;
+       rdrv->stop      = cdns3_gadget_exit;
+       rdrv->suspend   = cdns3_gadget_suspend;
+       rdrv->resume    = cdns3_gadget_resume;
+       rdrv->state     = CDNS3_ROLE_STATE_INACTIVE;
+       rdrv->name      = "gadget";
+       cdns->roles[USB_ROLE_DEVICE] = rdrv;
+
+       return 0;
+}
+
+/**
+ * cdns3_gadget_uboot_handle_interrupt - handle cdns3 gadget interrupt
+ * @cdns: pointer to struct cdns3
+ *
+ * Handles ep0 and gadget interrupt
+ */
+static void cdns3_gadget_uboot_handle_interrupt(struct cdns3 *cdns)
+{
+       int ret = cdns3_device_irq_handler(0, cdns);
+
+       if (ret == IRQ_WAKE_THREAD)
+               cdns3_device_thread_irq_handler(0, cdns);
+}
+
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
+{
+       struct cdns3 *cdns = dev_get_priv(dev);
+
+       cdns3_gadget_uboot_handle_interrupt(cdns);
+
+       return 0;
+}
diff --git a/drivers/usb/cdns3/gadget.h b/drivers/usb/cdns3/gadget.h
new file mode 100644 (file)
index 0000000..3d5242b
--- /dev/null
@@ -0,0 +1,1338 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * USBSS device controller driver header file
+ *
+ * Copyright (C) 2018-2019 Cadence.
+ * Copyright (C) 2017-2018 NXP
+ *
+ * Author: Pawel Laszczak <pawell@cadence.com>
+ *         Pawel Jez <pjez@cadence.com>
+ *         Peter Chen <peter.chen@nxp.com>
+ */
+#ifndef __LINUX_CDNS3_GADGET
+#define __LINUX_CDNS3_GADGET
+#include <linux/usb/gadget.h>
+
+/*
+ * USBSS-DEV register interface.
+ * This corresponds to the USBSS Device Controller Interface
+ */
+
+/**
+ * struct cdns3_usb_regs - device controller registers.
+ * @usb_conf:      Global Configuration.
+ * @usb_sts:       Global Status.
+ * @usb_cmd:       Global Command.
+ * @usb_itpn:      ITP/SOF number.
+ * @usb_lpm:       Global Command.
+ * @usb_ien:       USB Interrupt Enable.
+ * @usb_ists:      USB Interrupt Status.
+ * @ep_sel:        Endpoint Select.
+ * @ep_traddr:     Endpoint Transfer Ring Address.
+ * @ep_cfg:        Endpoint Configuration.
+ * @ep_cmd:        Endpoint Command.
+ * @ep_sts:        Endpoint Status.
+ * @ep_sts_sid:    Endpoint Status.
+ * @ep_sts_en:     Endpoint Status Enable.
+ * @drbl:          Doorbell.
+ * @ep_ien:        EP Interrupt Enable.
+ * @ep_ists:       EP Interrupt Status.
+ * @usb_pwr:       Global Power Configuration.
+ * @usb_conf2:     Global Configuration 2.
+ * @usb_cap1:      Capability 1.
+ * @usb_cap2:      Capability 2.
+ * @usb_cap3:      Capability 3.
+ * @usb_cap4:      Capability 4.
+ * @usb_cap5:      Capability 5.
+ * @usb_cap6:      Capability 6.
+ * @usb_cpkt1:     Custom Packet 1.
+ * @usb_cpkt2:     Custom Packet 2.
+ * @usb_cpkt3:     Custom Packet 3.
+ * @ep_dma_ext_addr: Upper address for DMA operations.
+ * @buf_addr:      Address for On-chip Buffer operations.
+ * @buf_data:      Data for On-chip Buffer operations.
+ * @buf_ctrl:      On-chip Buffer Access Control.
+ * @dtrans:        DMA Transfer Mode.
+ * @tdl_from_trb:  Source of TD Configuration.
+ * @tdl_beh:       TDL Behavior Configuration.
+ * @ep_tdl:        Endpoint TDL.
+ * @tdl_beh2:      TDL Behavior 2 Configuration.
+ * @dma_adv_td:    DMA Advance TD Configuration.
+ * @reserved1:     Reserved.
+ * @cfg_regs:      Configuration.
+ * @reserved2:     Reserved.
+ * @dma_axi_ctrl:  AXI Control.
+ * @dma_axi_id:    AXI ID register.
+ * @dma_axi_cap:   AXI Capability.
+ * @dma_axi_ctrl0: AXI Control 0.
+ * @dma_axi_ctrl1: AXI Control 1.
+ */
+struct cdns3_usb_regs {
+       __le32 usb_conf;
+       __le32 usb_sts;
+       __le32 usb_cmd;
+       __le32 usb_itpn;
+       __le32 usb_lpm;
+       __le32 usb_ien;
+       __le32 usb_ists;
+       __le32 ep_sel;
+       __le32 ep_traddr;
+       __le32 ep_cfg;
+       __le32 ep_cmd;
+       __le32 ep_sts;
+       __le32 ep_sts_sid;
+       __le32 ep_sts_en;
+       __le32 drbl;
+       __le32 ep_ien;
+       __le32 ep_ists;
+       __le32 usb_pwr;
+       __le32 usb_conf2;
+       __le32 usb_cap1;
+       __le32 usb_cap2;
+       __le32 usb_cap3;
+       __le32 usb_cap4;
+       __le32 usb_cap5;
+       __le32 usb_cap6;
+       __le32 usb_cpkt1;
+       __le32 usb_cpkt2;
+       __le32 usb_cpkt3;
+       __le32 ep_dma_ext_addr;
+       __le32 buf_addr;
+       __le32 buf_data;
+       __le32 buf_ctrl;
+       __le32 dtrans;
+       __le32 tdl_from_trb;
+       __le32 tdl_beh;
+       __le32 ep_tdl;
+       __le32 tdl_beh2;
+       __le32 dma_adv_td;
+       __le32 reserved1[26];
+       __le32 cfg_reg1;
+       __le32 dbg_link1;
+       __le32 dbg_link2;
+       __le32 cfg_regs[74];
+       __le32 reserved2[51];
+       __le32 dma_axi_ctrl;
+       __le32 dma_axi_id;
+       __le32 dma_axi_cap;
+       __le32 dma_axi_ctrl0;
+       __le32 dma_axi_ctrl1;
+};
+
+/* USB_CONF - bitmasks */
+/* Reset USB device configuration. */
+#define USB_CONF_CFGRST                BIT(0)
+/* Set Configuration. */
+#define USB_CONF_CFGSET                BIT(1)
+/* Disconnect USB device in SuperSpeed. */
+#define USB_CONF_USB3DIS       BIT(3)
+/* Disconnect USB device in HS/FS */
+#define USB_CONF_USB2DIS       BIT(4)
+/* Little Endian access - default */
+#define USB_CONF_LENDIAN       BIT(5)
+/*
+ * Big Endian access. Driver assume that byte order for
+ * SFRs access always is as Little Endian so this bit
+ * is not used.
+ */
+#define USB_CONF_BENDIAN       BIT(6)
+/* Device software reset. */
+#define USB_CONF_SWRST         BIT(7)
+/* Singular DMA transfer mode. Only for VER < DEV_VER_V3*/
+#define USB_CONF_DSING         BIT(8)
+/* Multiple DMA transfers mode. Only for VER < DEV_VER_V3 */
+#define USB_CONF_DMULT         BIT(9)
+/* DMA clock turn-off enable. */
+#define USB_CONF_DMAOFFEN      BIT(10)
+/* DMA clock turn-off disable. */
+#define USB_CONF_DMAOFFDS      BIT(11)
+/* Clear Force Full Speed. */
+#define USB_CONF_CFORCE_FS     BIT(12)
+/* Set Force Full Speed. */
+#define USB_CONF_SFORCE_FS     BIT(13)
+/* Device enable. */
+#define USB_CONF_DEVEN         BIT(14)
+/* Device disable. */
+#define USB_CONF_DEVDS         BIT(15)
+/* L1 LPM state entry enable (used in HS/FS mode). */
+#define USB_CONF_L1EN          BIT(16)
+/* L1 LPM state entry disable (used in HS/FS mode). */
+#define USB_CONF_L1DS          BIT(17)
+/* USB 2.0 clock gate disable. */
+#define USB_CONF_CLK2OFFEN     BIT(18)
+/* USB 2.0 clock gate enable. */
+#define USB_CONF_CLK2OFFDS     BIT(19)
+/* L0 LPM state entry request (used in HS/FS mode). */
+#define USB_CONF_LGO_L0                BIT(20)
+/* USB 3.0 clock gate disable. */
+#define USB_CONF_CLK3OFFEN     BIT(21)
+/* USB 3.0 clock gate enable. */
+#define USB_CONF_CLK3OFFDS     BIT(22)
+/* Bit 23 is reserved*/
+/* U1 state entry enable (used in SS mode). */
+#define USB_CONF_U1EN          BIT(24)
+/* U1 state entry disable (used in SS mode). */
+#define USB_CONF_U1DS          BIT(25)
+/* U2 state entry enable (used in SS mode). */
+#define USB_CONF_U2EN          BIT(26)
+/* U2 state entry disable (used in SS mode). */
+#define USB_CONF_U2DS          BIT(27)
+/* U0 state entry request (used in SS mode). */
+#define USB_CONF_LGO_U0                BIT(28)
+/* U1 state entry request (used in SS mode). */
+#define USB_CONF_LGO_U1                BIT(29)
+/* U2 state entry request (used in SS mode). */
+#define USB_CONF_LGO_U2                BIT(30)
+/* SS.Inactive state entry request (used in SS mode) */
+#define USB_CONF_LGO_SSINACT   BIT(31)
+
+/* USB_STS - bitmasks */
+/*
+ * Configuration status.
+ * 1 - device is in the configured state.
+ * 0 - device is not configured.
+ */
+#define USB_STS_CFGSTS_MASK    BIT(0)
+#define USB_STS_CFGSTS(p)      ((p) & USB_STS_CFGSTS_MASK)
+/*
+ * On-chip memory overflow.
+ * 0 - On-chip memory status OK.
+ * 1 - On-chip memory overflow.
+ */
+#define USB_STS_OV_MASK                BIT(1)
+#define USB_STS_OV(p)          ((p) & USB_STS_OV_MASK)
+/*
+ * SuperSpeed connection status.
+ * 0 - USB in SuperSpeed mode disconnected.
+ * 1 - USB in SuperSpeed mode connected.
+ */
+#define USB_STS_USB3CONS_MASK  BIT(2)
+#define USB_STS_USB3CONS(p)    ((p) & USB_STS_USB3CONS_MASK)
+/*
+ * DMA transfer configuration status.
+ * 0 - single request.
+ * 1 - multiple TRB chain
+ * Supported only for controller version <  DEV_VER_V3
+ */
+#define USB_STS_DTRANS_MASK    BIT(3)
+#define USB_STS_DTRANS(p)      ((p) & USB_STS_DTRANS_MASK)
+/*
+ * Device speed.
+ * 0 - Undefined (value after reset).
+ * 1 - Low speed
+ * 2 - Full speed
+ * 3 - High speed
+ * 4 - Super speed
+ */
+#define USB_STS_USBSPEED_MASK  GENMASK(6, 4)
+#define USB_STS_USBSPEED(p)    (((p) & USB_STS_USBSPEED_MASK) >> 4)
+#define USB_STS_LS             (0x1 << 4)
+#define USB_STS_FS             (0x2 << 4)
+#define USB_STS_HS             (0x3 << 4)
+#define USB_STS_SS             (0x4 << 4)
+#define DEV_UNDEFSPEED(p)      (((p) & USB_STS_USBSPEED_MASK) == (0x0 << 4))
+#define DEV_LOWSPEED(p)                (((p) & USB_STS_USBSPEED_MASK) == USB_STS_LS)
+#define DEV_FULLSPEED(p)       (((p) & USB_STS_USBSPEED_MASK) == USB_STS_FS)
+#define DEV_HIGHSPEED(p)       (((p) & USB_STS_USBSPEED_MASK) == USB_STS_HS)
+#define DEV_SUPERSPEED(p)      (((p) & USB_STS_USBSPEED_MASK) == USB_STS_SS)
+/*
+ * Endianness for SFR access.
+ * 0 - Little Endian order (default after hardware reset).
+ * 1 - Big Endian order
+ */
+#define USB_STS_ENDIAN_MASK    BIT(7)
+#define USB_STS_ENDIAN(p)      ((p) & USB_STS_ENDIAN_MASK)
+/*
+ * HS/FS clock turn-off status.
+ * 0 - hsfs clock is always on.
+ * 1 - hsfs clock turn-off in L2 (HS/FS mode) is enabled
+ *          (default after hardware reset).
+ */
+#define USB_STS_CLK2OFF_MASK   BIT(8)
+#define USB_STS_CLK2OFF(p)     ((p) & USB_STS_CLK2OFF_MASK)
+/*
+ * PCLK clock turn-off status.
+ * 0 - pclk clock is always on.
+ * 1 - pclk clock turn-off in U3 (SS mode) is enabled
+ *          (default after hardware reset).
+ */
+#define USB_STS_CLK3OFF_MASK   BIT(9)
+#define USB_STS_CLK3OFF(p)     ((p) & USB_STS_CLK3OFF_MASK)
+/*
+ * Controller in reset state.
+ * 0 - Internal reset is active.
+ * 1 - Internal reset is not active and controller is fully operational.
+ */
+#define USB_STS_IN_RST_MASK    BIT(10)
+#define USB_STS_IN_RST(p)      ((p) & USB_STS_IN_RST_MASK)
+/*
+ * Status of the "TDL calculation basing on TRB" feature.
+ * 0 - disabled
+ * 1 - enabled
+ * Supported only for DEV_VER_V2 controller version.
+ */
+#define USB_STS_TDL_TRB_ENABLED        BIT(11)
+/*
+ * Device enable Status.
+ * 0 - USB device is disabled (VBUS input is disconnected from internal logic).
+ * 1 - USB device is enabled (VBUS input is connected to the internal logic).
+ */
+#define USB_STS_DEVS_MASK      BIT(14)
+#define USB_STS_DEVS(p)                ((p) & USB_STS_DEVS_MASK)
+/*
+ * Address status.
+ * 0 - USB device is default state.
+ * 1 - USB device is at least in address state.
+ */
+#define USB_STS_ADDRESSED_MASK BIT(15)
+#define USB_STS_ADDRESSED(p)   ((p) & USB_STS_ADDRESSED_MASK)
+/*
+ * L1 LPM state enable status (used in HS/FS mode).
+ * 0 - Entering to L1 LPM state disabled.
+ * 1 - Entering to L1 LPM state enabled.
+ */
+#define USB_STS_L1ENS_MASK     BIT(16)
+#define USB_STS_L1ENS(p)       ((p) & USB_STS_L1ENS_MASK)
+/*
+ * Internal VBUS connection status (used both in HS/FS  and SS mode).
+ * 0 - internal VBUS is not detected.
+ * 1 - internal VBUS is detected.
+ */
+#define USB_STS_VBUSS_MASK     BIT(17)
+#define USB_STS_VBUSS(p)       ((p) & USB_STS_VBUSS_MASK)
+/*
+ * HS/FS LPM  state (used in FS/HS mode).
+ * 0 - L0 State
+ * 1 - L1 State
+ * 2 - L2 State
+ * 3 - L3 State
+ */
+#define USB_STS_LPMST_MASK     GENMASK(19, 18)
+#define DEV_L0_STATE(p)                (((p) & USB_STS_LPMST_MASK) == (0x0 << 18))
+#define DEV_L1_STATE(p)                (((p) & USB_STS_LPMST_MASK) == (0x1 << 18))
+#define DEV_L2_STATE(p)                (((p) & USB_STS_LPMST_MASK) == (0x2 << 18))
+#define DEV_L3_STATE(p)                (((p) & USB_STS_LPMST_MASK) == (0x3 << 18))
+/*
+ * Disable HS status (used in FS/HS mode).
+ * 0 - the disconnect bit for HS/FS mode is set .
+ * 1 - the disconnect bit for HS/FS mode is not set.
+ */
+#define USB_STS_USB2CONS_MASK  BIT(20)
+#define USB_STS_USB2CONS(p)    ((p) & USB_STS_USB2CONS_MASK)
+/*
+ * HS/FS mode connection status (used in FS/HS mode).
+ * 0 - High Speed operations in USB2.0 (FS/HS) mode not disabled.
+ * 1 - High Speed operations in USB2.0 (FS/HS).
+ */
+#define USB_STS_DISABLE_HS_MASK        BIT(21)
+#define USB_STS_DISABLE_HS(p)  ((p) & USB_STS_DISABLE_HS_MASK)
+/*
+ * U1 state enable status (used in SS mode).
+ * 0 - Entering to  U1 state disabled.
+ * 1 - Entering to  U1 state enabled.
+ */
+#define USB_STS_U1ENS_MASK     BIT(24)
+#define USB_STS_U1ENS(p)       ((p) & USB_STS_U1ENS_MASK)
+/*
+ * U2 state enable status (used in SS mode).
+ * 0 - Entering to  U2 state disabled.
+ * 1 - Entering to  U2 state enabled.
+ */
+#define USB_STS_U2ENS_MASK     BIT(25)
+#define USB_STS_U2ENS(p)       ((p) & USB_STS_U2ENS_MASK)
+/*
+ * SuperSpeed Link LTSSM state. This field reflects USBSS-DEV current
+ * SuperSpeed link state
+ */
+#define USB_STS_LST_MASK       GENMASK(29, 26)
+#define DEV_LST_U0             (((p) & USB_STS_LST_MASK) == (0x0 << 26))
+#define DEV_LST_U1             (((p) & USB_STS_LST_MASK) == (0x1 << 26))
+#define DEV_LST_U2             (((p) & USB_STS_LST_MASK) == (0x2 << 26))
+#define DEV_LST_U3             (((p) & USB_STS_LST_MASK) == (0x3 << 26))
+#define DEV_LST_DISABLED       (((p) & USB_STS_LST_MASK) == (0x4 << 26))
+#define DEV_LST_RXDETECT       (((p) & USB_STS_LST_MASK) == (0x5 << 26))
+#define DEV_LST_INACTIVE       (((p) & USB_STS_LST_MASK) == (0x6 << 26))
+#define DEV_LST_POLLING                (((p) & USB_STS_LST_MASK) == (0x7 << 26))
+#define DEV_LST_RECOVERY       (((p) & USB_STS_LST_MASK) == (0x8 << 26))
+#define DEV_LST_HOT_RESET      (((p) & USB_STS_LST_MASK) == (0x9 << 26))
+#define DEV_LST_COMP_MODE      (((p) & USB_STS_LST_MASK) == (0xa << 26))
+#define DEV_LST_LB_STATE       (((p) & USB_STS_LST_MASK) == (0xb << 26))
+/*
+ * DMA clock turn-off status.
+ * 0 - DMA clock is always on (default after hardware reset).
+ * 1 - DMA clock turn-off in U1, U2 and U3 (SS mode) is enabled.
+ */
+#define USB_STS_DMAOFF_MASK    BIT(30)
+#define USB_STS_DMAOFF(p)      ((p) & USB_STS_DMAOFF_MASK)
+/*
+ * SFR Endian status.
+ * 0 - Little Endian order (default after hardware reset).
+ * 1 - Big Endian order.
+ */
+#define USB_STS_ENDIAN2_MASK   BIT(31)
+#define USB_STS_ENDIAN2(p)     ((p) & USB_STS_ENDIAN2_MASK)
+
+/* USB_CMD -  bitmasks */
+/* Set Function Address */
+#define USB_CMD_SET_ADDR       BIT(0)
+/*
+ * Function Address This field is saved to the device only when the field
+ * SET_ADDR is set '1 ' during write to USB_CMD register.
+ * Software is responsible for entering the address of the device during
+ * SET_ADDRESS request service. This field should be set immediately after
+ * the SETUP packet is decoded, and prior to confirmation of the status phase
+ */
+#define USB_CMD_FADDR_MASK     GENMASK(7, 1)
+#define USB_CMD_FADDR(p)       (((p) << 1) & USB_CMD_FADDR_MASK)
+/* Send Function Wake Device Notification TP (used only in SS mode). */
+#define USB_CMD_SDNFW          BIT(8)
+/* Set Test Mode (used only in HS/FS mode). */
+#define USB_CMD_STMODE         BIT(9)
+/* Test mode selector (used only in HS/FS mode) */
+#define USB_STS_TMODE_SEL_MASK GENMASK(11, 10)
+#define USB_STS_TMODE_SEL(p)   (((p) << 10) & USB_STS_TMODE_SEL_MASK)
+/*
+ *  Send Latency Tolerance Message Device Notification TP (used only
+ *  in SS mode).
+ */
+#define USB_CMD_SDNLTM         BIT(12)
+/* Send Custom Transaction Packet (used only in SS mode) */
+#define USB_CMD_SPKT           BIT(13)
+/*Device Notification 'Function Wake' - Interface value (only in SS mode. */
+#define USB_CMD_DNFW_INT_MASK  GENMASK(23, 16)
+#define USB_STS_DNFW_INT(p)    (((p) << 16) & USB_CMD_DNFW_INT_MASK)
+/*
+ * Device Notification 'Latency Tolerance Message' -373 BELT value [7:0]
+ * (used only in SS mode).
+ */
+#define USB_CMD_DNLTM_BELT_MASK        GENMASK(27, 16)
+#define USB_STS_DNLTM_BELT(p)  (((p) << 16) & USB_CMD_DNLTM_BELT_MASK)
+
+/* USB_ITPN - bitmasks */
+/*
+ * ITP(SS) / SOF (HS/FS) number
+ * In SS mode this field represent number of last ITP received from host.
+ * In HS/FS mode this field represent number of last SOF received from host.
+ */
+#define USB_ITPN_MASK          GENMASK(13, 0)
+#define USB_ITPN(p)            ((p) & USB_ITPN_MASK)
+
+/* USB_LPM - bitmasks */
+/* Host Initiated Resume Duration. */
+#define USB_LPM_HIRD_MASK      GENMASK(3, 0)
+#define USB_LPM_HIRD(p)                ((p) & USB_LPM_HIRD_MASK)
+/* Remote Wakeup Enable (bRemoteWake). */
+#define USB_LPM_BRW            BIT(4)
+
+/* USB_IEN - bitmasks */
+/* SS connection interrupt enable */
+#define USB_IEN_CONIEN         BIT(0)
+/* SS disconnection interrupt enable. */
+#define USB_IEN_DISIEN         BIT(1)
+/* USB SS warm reset interrupt enable. */
+#define USB_IEN_UWRESIEN       BIT(2)
+/* USB SS hot reset interrupt enable */
+#define USB_IEN_UHRESIEN       BIT(3)
+/* SS link U3 state enter interrupt enable (suspend).*/
+#define USB_IEN_U3ENTIEN       BIT(4)
+/* SS link U3 state exit interrupt enable (wakeup). */
+#define USB_IEN_U3EXTIEN       BIT(5)
+/* SS link U2 state enter interrupt enable.*/
+#define USB_IEN_U2ENTIEN       BIT(6)
+/* SS link U2 state exit interrupt enable.*/
+#define USB_IEN_U2EXTIEN       BIT(7)
+/* SS link U1 state enter interrupt enable.*/
+#define USB_IEN_U1ENTIEN       BIT(8)
+/* SS link U1 state exit interrupt enable.*/
+#define USB_IEN_U1EXTIEN       BIT(9)
+/* ITP/SOF packet detected interrupt enable.*/
+#define USB_IEN_ITPIEN         BIT(10)
+/* Wakeup interrupt enable.*/
+#define USB_IEN_WAKEIEN                BIT(11)
+/* Send Custom Packet interrupt enable.*/
+#define USB_IEN_SPKTIEN                BIT(12)
+/* HS/FS mode connection interrupt enable.*/
+#define USB_IEN_CON2IEN                BIT(16)
+/* HS/FS mode disconnection interrupt enable.*/
+#define USB_IEN_DIS2IEN                BIT(17)
+/* USB reset (HS/FS mode) interrupt enable.*/
+#define USB_IEN_U2RESIEN       BIT(18)
+/* LPM L2 state enter interrupt enable.*/
+#define USB_IEN_L2ENTIEN       BIT(20)
+/* LPM  L2 state exit interrupt enable.*/
+#define USB_IEN_L2EXTIEN       BIT(21)
+/* LPM L1 state enter interrupt enable.*/
+#define USB_IEN_L1ENTIEN       BIT(24)
+/* LPM  L1 state exit interrupt enable.*/
+#define USB_IEN_L1EXTIEN       BIT(25)
+/* Configuration reset interrupt enable.*/
+#define USB_IEN_CFGRESIEN      BIT(26)
+/* Start of the USB SS warm reset interrupt enable.*/
+#define USB_IEN_UWRESSIEN      BIT(28)
+/* End of the USB SS warm reset interrupt enable.*/
+#define USB_IEN_UWRESEIEN      BIT(29)
+
+#define USB_IEN_INIT  (USB_IEN_U2RESIEN | USB_ISTS_DIS2I | USB_IEN_CON2IEN \
+                      | USB_IEN_UHRESIEN | USB_IEN_UWRESIEN | USB_IEN_DISIEN \
+                      | USB_IEN_CONIEN | USB_IEN_U3EXTIEN | USB_IEN_L2ENTIEN \
+                      | USB_IEN_L2EXTIEN | USB_IEN_L1ENTIEN | USB_IEN_U3ENTIEN)
+
+/* USB_ISTS - bitmasks */
+/* SS Connection detected. */
+#define USB_ISTS_CONI          BIT(0)
+/* SS Disconnection detected. */
+#define USB_ISTS_DISI          BIT(1)
+/* UUSB warm reset detectede. */
+#define USB_ISTS_UWRESI                BIT(2)
+/* USB hot reset detected. */
+#define USB_ISTS_UHRESI                BIT(3)
+/* U3 link state enter detected (suspend).*/
+#define USB_ISTS_U3ENTI                BIT(4)
+/* U3 link state exit detected (wakeup). */
+#define USB_ISTS_U3EXTI                BIT(5)
+/* U2 link state enter detected.*/
+#define USB_ISTS_U2ENTI                BIT(6)
+/* U2 link state exit detected.*/
+#define USB_ISTS_U2EXTI                BIT(7)
+/* U1 link state enter detected.*/
+#define USB_ISTS_U1ENTI                BIT(8)
+/* U1 link state exit detected.*/
+#define USB_ISTS_U1EXTI                BIT(9)
+/* ITP/SOF packet detected.*/
+#define USB_ISTS_ITPI          BIT(10)
+/* Wakeup detected.*/
+#define USB_ISTS_WAKEI         BIT(11)
+/* Send Custom Packet detected.*/
+#define USB_ISTS_SPKTI         BIT(12)
+/* HS/FS mode connection detected.*/
+#define USB_ISTS_CON2I         BIT(16)
+/* HS/FS mode disconnection detected.*/
+#define USB_ISTS_DIS2I         BIT(17)
+/* USB reset (HS/FS mode) detected.*/
+#define USB_ISTS_U2RESI                BIT(18)
+/* LPM L2 state enter detected.*/
+#define USB_ISTS_L2ENTI                BIT(20)
+/* LPM  L2 state exit detected.*/
+#define USB_ISTS_L2EXTI                BIT(21)
+/* LPM L1 state enter detected.*/
+#define USB_ISTS_L1ENTI                BIT(24)
+/* LPM L1 state exit detected.*/
+#define USB_ISTS_L1EXTI                BIT(25)
+/* USB configuration reset detected.*/
+#define USB_ISTS_CFGRESI       BIT(26)
+/* Start of the USB warm reset detected.*/
+#define USB_ISTS_UWRESSI       BIT(28)
+/* End of the USB warm reset detected.*/
+#define USB_ISTS_UWRESEI       BIT(29)
+
+/* USB_SEL - bitmasks */
+#define EP_SEL_EPNO_MASK       GENMASK(3, 0)
+/* Endpoint number. */
+#define EP_SEL_EPNO(p)         ((p) & EP_SEL_EPNO_MASK)
+/* Endpoint direction bit - 0 - OUT, 1 - IN. */
+#define EP_SEL_DIR             BIT(7)
+
+#define select_ep_in(nr)       (EP_SEL_EPNO(p) | EP_SEL_DIR)
+#define select_ep_out          (EP_SEL_EPNO(p))
+
+/* EP_TRADDR - bitmasks */
+/* Transfer Ring address. */
+#define EP_TRADDR_TRADDR(p)    ((p))
+
+/* EP_CFG - bitmasks */
+/* Endpoint enable */
+#define EP_CFG_ENABLE          BIT(0)
+/*
+ *  Endpoint type.
+ * 1 - isochronous
+ * 2 - bulk
+ * 3 - interrupt
+ */
+#define EP_CFG_EPTYPE_MASK     GENMASK(2, 1)
+#define EP_CFG_EPTYPE(p)       (((p) << 1)  & EP_CFG_EPTYPE_MASK)
+/* Stream support enable (only in SS mode). */
+#define EP_CFG_STREAM_EN       BIT(3)
+/* TDL check (only in SS mode for BULK EP). */
+#define EP_CFG_TDL_CHK         BIT(4)
+/* SID check (only in SS mode for BULK OUT EP). */
+#define EP_CFG_SID_CHK         BIT(5)
+/* DMA transfer endianness. */
+#define EP_CFG_EPENDIAN                BIT(7)
+/* Max burst size (used only in SS mode). */
+#define EP_CFG_MAXBURST_MASK   GENMASK(11, 8)
+#define EP_CFG_MAXBURST(p)     (((p) << 8) & EP_CFG_MAXBURST_MASK)
+/* ISO max burst. */
+#define EP_CFG_MULT_MASK       GENMASK(15, 14)
+#define EP_CFG_MULT(p)         (((p) << 14) & EP_CFG_MULT_MASK)
+/* ISO max burst. */
+#define EP_CFG_MAXPKTSIZE_MASK GENMASK(26, 16)
+#define EP_CFG_MAXPKTSIZE(p)   (((p) << 16) & EP_CFG_MAXPKTSIZE_MASK)
+/* Max number of buffered packets. */
+#define EP_CFG_BUFFERING_MASK  GENMASK(31, 27)
+#define EP_CFG_BUFFERING(p)    (((p) << 27) & EP_CFG_BUFFERING_MASK)
+
+/* EP_CMD - bitmasks */
+/* Endpoint reset. */
+#define EP_CMD_EPRST           BIT(0)
+/* Endpoint STALL set. */
+#define EP_CMD_SSTALL          BIT(1)
+/* Endpoint STALL clear. */
+#define EP_CMD_CSTALL          BIT(2)
+/* Send ERDY TP. */
+#define EP_CMD_ERDY            BIT(3)
+/* Request complete. */
+#define EP_CMD_REQ_CMPL                BIT(5)
+/* Transfer descriptor ready. */
+#define EP_CMD_DRDY            BIT(6)
+/* Data flush. */
+#define EP_CMD_DFLUSH          BIT(7)
+/*
+ * Transfer Descriptor Length write  (used only for Bulk Stream capable
+ * endpoints in SS mode).
+ * Bit Removed from DEV_VER_V3 controller version.
+ */
+#define EP_CMD_STDL            BIT(8)
+/*
+ * Transfer Descriptor Length (used only in SS mode for bulk endpoints).
+ * Bits Removed from DEV_VER_V3 controller version.
+ */
+#define EP_CMD_TDL_MASK                GENMASK(15, 9)
+#define EP_CMD_TDL_SET(p)      (((p) << 9) & EP_CMD_TDL_MASK)
+#define EP_CMD_TDL_GET(p)      (((p) & EP_CMD_TDL_MASK) >> 9)
+
+/* ERDY Stream ID value (used in SS mode). */
+#define EP_CMD_ERDY_SID_MASK   GENMASK(31, 16)
+#define EP_CMD_ERDY_SID(p)     (((p) << 16) & EP_CMD_ERDY_SID_MASK)
+
+/* EP_STS - bitmasks */
+/* Setup transfer complete. */
+#define EP_STS_SETUP           BIT(0)
+/* Endpoint STALL status. */
+#define EP_STS_STALL(p)                ((p) & BIT(1))
+/* Interrupt On Complete. */
+#define EP_STS_IOC             BIT(2)
+/* Interrupt on Short Packet. */
+#define EP_STS_ISP             BIT(3)
+/* Transfer descriptor missing. */
+#define EP_STS_DESCMIS         BIT(4)
+/* Stream Rejected (used only in SS mode) */
+#define EP_STS_STREAMR         BIT(5)
+/* EXIT from MOVE DATA State (used only for stream transfers in SS mode). */
+#define EP_STS_MD_EXIT         BIT(6)
+/* TRB error. */
+#define EP_STS_TRBERR          BIT(7)
+/* Not ready (used only in SS mode). */
+#define EP_STS_NRDY            BIT(8)
+/* DMA busy bit. */
+#define EP_STS_DBUSY           BIT(9)
+/* Endpoint Buffer Empty */
+#define EP_STS_BUFFEMPTY(p)    ((p) & BIT(10))
+/* Current Cycle Status */
+#define EP_STS_CCS(p)          ((p) & BIT(11))
+/* Prime (used only in SS mode. */
+#define EP_STS_PRIME           BIT(12)
+/* Stream error (used only in SS mode). */
+#define EP_STS_SIDERR          BIT(13)
+/* OUT size mismatch. */
+#define EP_STS_OUTSMM          BIT(14)
+/* ISO transmission error. */
+#define EP_STS_ISOERR          BIT(15)
+/* Host Packet Pending (only for SS mode). */
+#define EP_STS_HOSTPP(p)       ((p) & BIT(16))
+/* Stream Protocol State Machine State (only for Bulk stream endpoints). */
+#define EP_STS_SPSMST_MASK             GENMASK(18, 17)
+#define EP_STS_SPSMST_DISABLED(p)      (((p) & EP_STS_SPSMST_MASK) >> 17)
+#define EP_STS_SPSMST_IDLE(p)          (((p) & EP_STS_SPSMST_MASK) >> 17)
+#define EP_STS_SPSMST_START_STREAM(p)  (((p) & EP_STS_SPSMST_MASK) >> 17)
+#define EP_STS_SPSMST_MOVE_DATA(p)     (((p) & EP_STS_SPSMST_MASK) >> 17)
+/* Interrupt On Transfer complete. */
+#define EP_STS_IOT             BIT(19)
+/* OUT queue endpoint number. */
+#define EP_STS_OUTQ_NO_MASK    GENMASK(27, 24)
+#define EP_STS_OUTQ_NO(p)      (((p) & EP_STS_OUTQ_NO_MASK) >> 24)
+/* OUT queue valid flag. */
+#define EP_STS_OUTQ_VAL_MASK   BIT(28)
+#define EP_STS_OUTQ_VAL(p)     ((p) & EP_STS_OUTQ_VAL_MASK)
+/* SETUP WAIT. */
+#define EP_STS_STPWAIT         BIT(31)
+
+/* EP_STS_SID - bitmasks */
+/* Stream ID (used only in SS mode). */
+#define EP_STS_SID_MASK                GENMASK(15, 0)
+#define EP_STS_SID(p)          ((p) & EP_STS_SID_MASK)
+
+/* EP_STS_EN - bitmasks */
+/* SETUP interrupt enable. */
+#define EP_STS_EN_SETUPEN      BIT(0)
+/* OUT transfer missing descriptor enable. */
+#define EP_STS_EN_DESCMISEN    BIT(4)
+/* Stream Rejected enable. */
+#define EP_STS_EN_STREAMREN    BIT(5)
+/* Move Data Exit enable.*/
+#define EP_STS_EN_MD_EXITEN    BIT(6)
+/* TRB enable. */
+#define EP_STS_EN_TRBERREN     BIT(7)
+/* NRDY enable. */
+#define EP_STS_EN_NRDYEN       BIT(8)
+/* Prime enable. */
+#define EP_STS_EN_PRIMEEEN     BIT(12)
+/* Stream error enable. */
+#define EP_STS_EN_SIDERREN     BIT(13)
+/* OUT size mismatch enable. */
+#define EP_STS_EN_OUTSMMEN     BIT(14)
+/* ISO transmission error enable. */
+#define EP_STS_EN_ISOERREN     BIT(15)
+/* Interrupt on Transmission complete enable. */
+#define EP_STS_EN_IOTEN                BIT(19)
+/* Setup Wait interrupt enable. */
+#define EP_STS_EN_STPWAITEN    BIT(31)
+
+/* DRBL- bitmasks */
+#define DB_VALUE_BY_INDEX(index) (1 << (index))
+#define DB_VALUE_EP0_OUT       BIT(0)
+#define DB_VALUE_EP0_IN                BIT(16)
+
+/* EP_IEN - bitmasks */
+#define EP_IEN(index)          (1 << (index))
+#define EP_IEN_EP_OUT0         BIT(0)
+#define EP_IEN_EP_IN0          BIT(16)
+
+/* EP_ISTS - bitmasks */
+#define EP_ISTS(index)         (1 << (index))
+#define EP_ISTS_EP_OUT0                BIT(0)
+#define EP_ISTS_EP_IN0         BIT(16)
+
+/* USB_PWR- bitmasks */
+/*Power Shut Off capability enable*/
+#define PUSB_PWR_PSO_EN                BIT(0)
+/*Power Shut Off capability disable*/
+#define PUSB_PWR_PSO_DS                BIT(1)
+/*
+ * Enables turning-off Reference Clock.
+ * This bit is optional and implemented only when support for OTG is
+ * implemented (indicated by OTG_READY bit set to '1').
+ */
+#define PUSB_PWR_STB_CLK_SWITCH_EN     BIT(8)
+/*
+ * Status bit indicating that operation required by STB_CLK_SWITCH_EN write
+ * is completed
+ */
+#define PUSB_PWR_STB_CLK_SWITCH_DONE   BIT(9)
+/* This bit informs if Fast Registers Access is enabled. */
+#define PUSB_PWR_FST_REG_ACCESS_STAT   BIT(30)
+/* Fast Registers Access Enable. */
+#define PUSB_PWR_FST_REG_ACCESS                BIT(31)
+
+/* USB_CONF2- bitmasks */
+/*
+ * Writing 1 disables TDL calculation basing on TRB feature in controller
+ * for DMULT mode.
+ * Bit supported only for DEV_VER_V2 version.
+ */
+#define USB_CONF2_DIS_TDL_TRB          BIT(1)
+/*
+ * Writing 1 enables TDL calculation basing on TRB feature in controller
+ * for DMULT mode.
+ * Bit supported only for DEV_VER_V2 version.
+ */
+#define USB_CONF2_EN_TDL_TRB           BIT(2)
+
+/* USB_CAP1- bitmasks */
+/*
+ * SFR Interface type
+ * These field reflects type of SFR interface implemented:
+ * 0x0 - OCP
+ * 0x1 - AHB,
+ * 0x2 - PLB
+ * 0x3 - AXI
+ * 0x4-0xF - reserved
+ */
+#define USB_CAP1_SFR_TYPE_MASK GENMASK(3, 0)
+#define DEV_SFR_TYPE_OCP(p)    (((p) & USB_CAP1_SFR_TYPE_MASK) == 0x0)
+#define DEV_SFR_TYPE_AHB(p)    (((p) & USB_CAP1_SFR_TYPE_MASK) == 0x1)
+#define DEV_SFR_TYPE_PLB(p)    (((p) & USB_CAP1_SFR_TYPE_MASK) == 0x2)
+#define DEV_SFR_TYPE_AXI(p)    (((p) & USB_CAP1_SFR_TYPE_MASK) == 0x3)
+/*
+ * SFR Interface width
+ * These field reflects width of SFR interface implemented:
+ * 0x0 - 8 bit interface,
+ * 0x1 - 16 bit interface,
+ * 0x2 - 32 bit interface
+ * 0x3 - 64 bit interface
+ * 0x4-0xF - reserved
+ */
+#define USB_CAP1_SFR_WIDTH_MASK        GENMASK(7, 4)
+#define DEV_SFR_WIDTH_8(p)     (((p) & USB_CAP1_SFR_WIDTH_MASK) == (0x0 << 4))
+#define DEV_SFR_WIDTH_16(p)    (((p) & USB_CAP1_SFR_WIDTH_MASK) == (0x1 << 4))
+#define DEV_SFR_WIDTH_32(p)    (((p) & USB_CAP1_SFR_WIDTH_MASK) == (0x2 << 4))
+#define DEV_SFR_WIDTH_64(p)    (((p) & USB_CAP1_SFR_WIDTH_MASK) == (0x3 << 4))
+/*
+ * DMA Interface type
+ * These field reflects type of DMA interface implemented:
+ * 0x0 - OCP
+ * 0x1 - AHB,
+ * 0x2 - PLB
+ * 0x3 - AXI
+ * 0x4-0xF - reserved
+ */
+#define USB_CAP1_DMA_TYPE_MASK GENMASK(11, 8)
+#define DEV_DMA_TYPE_OCP(p)    (((p) & USB_CAP1_DMA_TYPE_MASK) == (0x0 << 8))
+#define DEV_DMA_TYPE_AHB(p)    (((p) & USB_CAP1_DMA_TYPE_MASK) == (0x1 << 8))
+#define DEV_DMA_TYPE_PLB(p)    (((p) & USB_CAP1_DMA_TYPE_MASK) == (0x2 << 8))
+#define DEV_DMA_TYPE_AXI(p)    (((p) & USB_CAP1_DMA_TYPE_MASK) == (0x3 << 8))
+/*
+ * DMA Interface width
+ * These field reflects width of DMA interface implemented:
+ * 0x0 - reserved,
+ * 0x1 - reserved,
+ * 0x2 - 32 bit interface
+ * 0x3 - 64 bit interface
+ * 0x4-0xF - reserved
+ */
+#define USB_CAP1_DMA_WIDTH_MASK        GENMASK(15, 12)
+#define DEV_DMA_WIDTH_32(p)    (((p) & USB_CAP1_DMA_WIDTH_MASK) == (0x2 << 12))
+#define DEV_DMA_WIDTH_64(p)    (((p) & USB_CAP1_DMA_WIDTH_MASK) == (0x3 << 12))
+/*
+ * USB3 PHY Interface type
+ * These field reflects type of USB3 PHY interface implemented:
+ * 0x0 - USB PIPE,
+ * 0x1 - RMMI,
+ * 0x2-0xF - reserved
+ */
+#define USB_CAP1_U3PHY_TYPE_MASK GENMASK(19, 16)
+#define DEV_U3PHY_PIPE(p) (((p) & USB_CAP1_U3PHY_TYPE_MASK) == (0x0 << 16))
+#define DEV_U3PHY_RMMI(p) (((p) & USB_CAP1_U3PHY_TYPE_MASK) == (0x1 << 16))
+/*
+ * USB3 PHY Interface width
+ * These field reflects width of USB3 PHY interface implemented:
+ * 0x0 - 8 bit PIPE interface,
+ * 0x1 - 16 bit PIPE interface,
+ * 0x2 - 32 bit PIPE interface,
+ * 0x3 - 64 bit PIPE interface
+ * 0x4-0xF - reserved
+ * Note: When SSIC interface is implemented this field shows the width of
+ * internal PIPE interface. The RMMI interface is always 20bit wide.
+ */
+#define USB_CAP1_U3PHY_WIDTH_MASK GENMASK(23, 20)
+#define DEV_U3PHY_WIDTH_8(p) \
+       (((p) & USB_CAP1_U3PHY_WIDTH_MASK) == (0x0 << 20))
+#define DEV_U3PHY_WIDTH_16(p) \
+       (((p) & USB_CAP1_U3PHY_WIDTH_MASK) == (0x1 << 16))
+#define DEV_U3PHY_WIDTH_32(p) \
+       (((p) & USB_CAP1_U3PHY_WIDTH_MASK) == (0x2 << 20))
+#define DEV_U3PHY_WIDTH_64(p) \
+       (((p) & USB_CAP1_U3PHY_WIDTH_MASK) == (0x3 << 16))
+
+/*
+ * USB2 PHY Interface enable
+ * These field informs if USB2 PHY interface is implemented:
+ * 0x0 - interface NOT implemented,
+ * 0x1 - interface implemented
+ */
+#define USB_CAP1_U2PHY_EN(p)   ((p) & BIT(24))
+/*
+ * USB2 PHY Interface type
+ * These field reflects type of USB2 PHY interface implemented:
+ * 0x0 - UTMI,
+ * 0x1 - ULPI
+ */
+#define DEV_U2PHY_ULPI(p)      ((p) & BIT(25))
+/*
+ * USB2 PHY Interface width
+ * These field reflects width of USB2 PHY interface implemented:
+ * 0x0 - 8 bit interface,
+ * 0x1 - 16 bit interface,
+ * Note: The ULPI interface is always 8bit wide.
+ */
+#define DEV_U2PHY_WIDTH_16(p)  ((p) & BIT(26))
+/*
+ * OTG Ready
+ * 0x0 - pure device mode
+ * 0x1 - some features and ports for CDNS USB OTG controller are implemented.
+ */
+#define USB_CAP1_OTG_READY(p)  ((p) & BIT(27))
+
+/*
+ * When set, indicates that controller supports automatic internal TDL
+ * calculation basing on the size provided in TRB (TRB[22:17]) for DMULT mode
+ * Supported only for DEV_VER_V2 controller version.
+ */
+#define USB_CAP1_TDL_FROM_TRB(p)       ((p) & BIT(28))
+
+/* USB_CAP2- bitmasks */
+/*
+ * The actual size of the connected On-chip RAM memory in kB:
+ * - 0 means 256 kB (max supported mem size)
+ * - value other than 0 reflects the mem size in kB
+ */
+#define USB_CAP2_ACTUAL_MEM_SIZE(p) ((p) & GENMASK(7, 0))
+/*
+ * Max supported mem size
+ * These field reflects width of on-chip RAM address bus width,
+ * which determines max supported mem size:
+ * 0x0-0x7 - reserved,
+ * 0x8 - support for 4kB mem,
+ * 0x9 - support for 8kB mem,
+ * 0xA - support for 16kB mem,
+ * 0xB - support for 32kB mem,
+ * 0xC - support for 64kB mem,
+ * 0xD - support for 128kB mem,
+ * 0xE - support for 256kB mem,
+ * 0xF - reserved
+ */
+#define USB_CAP2_MAX_MEM_SIZE(p) ((p) & GENMASK(11, 8))
+
+/* USB_CAP3- bitmasks */
+#define EP_IS_IMPLEMENTED(reg, index) ((reg) & (1 << (index)))
+
+/* USB_CAP4- bitmasks */
+#define EP_SUPPORT_ISO(reg, index) ((reg) & (1 << (index)))
+
+/* USB_CAP5- bitmasks */
+#define EP_SUPPORT_STREAM(reg, index) ((reg) & (1 << (index)))
+
+/* USB_CAP6- bitmasks */
+/* The USBSS-DEV Controller  Internal build number. */
+#define GET_DEV_BASE_VERSION(p) ((p) & GENMASK(23, 0))
+/* The USBSS-DEV Controller version number. */
+#define GET_DEV_CUSTOM_VERSION(p) ((p) & GENMASK(31, 24))
+
+#define DEV_VER_NXP_V1         0x00024502
+#define DEV_VER_TI_V1          0x00024509
+#define DEV_VER_V2             0x0002450C
+#define DEV_VER_V3             0x0002450d
+
+/* DBG_LINK1- bitmasks */
+/*
+ * LFPS_MIN_DET_U1_EXIT value This parameter configures the minimum
+ * time required for decoding the received LFPS as an LFPS.U1_Exit.
+ */
+#define DBG_LINK1_LFPS_MIN_DET_U1_EXIT(p)      ((p) & GENMASK(7, 0))
+/*
+ * LFPS_MIN_GEN_U1_EXIT value This parameter configures the minimum time for
+ * phytxelecidle deassertion when LFPS.U1_Exit
+ */
+#define DBG_LINK1_LFPS_MIN_GEN_U1_EXIT_MASK    GENMASK(15, 8)
+#define DBG_LINK1_LFPS_MIN_GEN_U1_EXIT(p)      (((p) << 8) & GENMASK(15, 8))
+/*
+ * RXDET_BREAK_DIS value This parameter configures terminating the Far-end
+ * Receiver termination detection sequence:
+ * 0: it is possible that USBSS_DEV will terminate Farend receiver
+ *    termination detection sequence
+ * 1: USBSS_DEV will not terminate Far-end receiver termination
+ *    detection sequence
+ */
+#define DBG_LINK1_RXDET_BREAK_DIS              BIT(16)
+/* LFPS_GEN_PING value This parameter configures the LFPS.Ping generation */
+#define DBG_LINK1_LFPS_GEN_PING(p)             (((p) << 17) & GENMASK(21, 17))
+/*
+ * Set the LFPS_MIN_DET_U1_EXIT value Writing '1' to this bit writes the
+ * LFPS_MIN_DET_U1_EXIT field value to the device. This bit is automatically
+ * cleared. Writing '0' has no effect
+ */
+#define DBG_LINK1_LFPS_MIN_DET_U1_EXIT_SET     BIT(24)
+/*
+ * Set the LFPS_MIN_GEN_U1_EXIT value. Writing '1' to this bit writes the
+ * LFPS_MIN_GEN_U1_EXIT field value to the device. This bit is automatically
+ * cleared. Writing '0' has no effect
+ */
+#define DBG_LINK1_LFPS_MIN_GEN_U1_EXIT_SET     BIT(25)
+/*
+ * Set the RXDET_BREAK_DIS value Writing '1' to this bit writes
+ * the RXDET_BREAK_DIS field value to the device. This bit is automatically
+ * cleared. Writing '0' has no effect
+ */
+#define DBG_LINK1_RXDET_BREAK_DIS_SET          BIT(26)
+/*
+ * Set the LFPS_GEN_PING_SET value Writing '1' to this bit writes
+ * the LFPS_GEN_PING field value to the device. This bit is automatically
+ * cleared. Writing '0' has no effect."
+ */
+#define DBG_LINK1_LFPS_GEN_PING_SET            BIT(27)
+
+/* DMA_AXI_CTRL- bitmasks */
+/* The mawprot pin configuration. */
+#define DMA_AXI_CTRL_MARPROT(p) ((p) & GENMASK(2, 0))
+/* The marprot pin configuration. */
+#define DMA_AXI_CTRL_MAWPROT(p) (((p) & GENMASK(2, 0)) << 16)
+#define DMA_AXI_CTRL_NON_SECURE 0x02
+
+#define gadget_to_cdns3_device(g) (container_of(g, struct cdns3_device, gadget))
+
+#define ep_to_cdns3_ep(ep) (container_of(ep, struct cdns3_endpoint, endpoint))
+
+/*-------------------------------------------------------------------------*/
+/*
+ * USBSS-DEV DMA interface.
+ */
+#define TRBS_PER_SEGMENT       40
+
+#define ISO_MAX_INTERVAL       10
+
+#if TRBS_PER_SEGMENT < 2
+#error "Incorrect TRBS_PER_SEGMENT. Minimal Transfer Ring size is 2."
+#endif
+
+/*
+ *Only for ISOC endpoints - maximum number of TRBs is calculated as
+ * pow(2, bInterval-1) * number of usb requests. It is limitation made by
+ * driver to save memory. Controller must prepare TRB for each ITP even
+ * if bInterval > 1. It's the reason why driver needs so many TRBs for
+ * isochronous endpoints.
+ */
+#define TRBS_PER_ISOC_SEGMENT  (ISO_MAX_INTERVAL * 8)
+
+#define GET_TRBS_PER_SEGMENT(ep_type) ((ep_type) == USB_ENDPOINT_XFER_ISOC ? \
+                                     TRBS_PER_ISOC_SEGMENT : TRBS_PER_SEGMENT)
+/**
+ * struct cdns3_trb - represent Transfer Descriptor block.
+ * @buffer:    pointer to buffer data
+ * @length:    length of data
+ * @control:   control flags.
+ *
+ * This structure describes transfer block serviced by DMA module.
+ */
+struct cdns3_trb {
+       __le32 buffer;
+       __le32 length;
+       __le32 control;
+};
+
+#define TRB_SIZE               (sizeof(struct cdns3_trb))
+#define TRB_RING_SIZE          (TRB_SIZE * TRBS_PER_SEGMENT)
+#define TRB_ISO_RING_SIZE      (TRB_SIZE * TRBS_PER_ISOC_SEGMENT)
+#define TRB_CTRL_RING_SIZE     (TRB_SIZE * 2)
+
+/* TRB bit mask */
+#define TRB_TYPE_BITMASK       GENMASK(15, 10)
+#define TRB_TYPE(p)            ((p) << 10)
+#define TRB_FIELD_TO_TYPE(p)   (((p) & TRB_TYPE_BITMASK) >> 10)
+
+/* TRB type IDs */
+/* bulk, interrupt, isoc , and control data stage */
+#define TRB_NORMAL             1
+/* TRB for linking ring segments */
+#define TRB_LINK               6
+
+/* Cycle bit - indicates TRB ownership by driver or hw*/
+#define TRB_CYCLE              BIT(0)
+/*
+ * When set to '1', the device will toggle its interpretation of the Cycle bit
+ */
+#define TRB_TOGGLE             BIT(1)
+
+/*
+ * Short Packet (SP). OUT EPs at DMULT=1 only. Indicates if the TRB was
+ * processed while USB short packet was received. No more buffers defined by
+ * the TD will be used. DMA will automatically advance to next TD.
+ * - Shall be set to 0 by Software when putting TRB on the Transfer Ring
+ * - Shall be set to 1 by Controller when Short Packet condition for this TRB
+ *   is detected independent if ISP is set or not.
+ */
+#define TRB_SP                 BIT(1)
+
+/* Interrupt on short packet*/
+#define TRB_ISP                        BIT(2)
+/*Setting this bit enables FIFO DMA operation mode*/
+#define TRB_FIFO_MODE          BIT(3)
+/* Set PCIe no snoop attribute */
+#define TRB_CHAIN              BIT(4)
+/* Interrupt on completion */
+#define TRB_IOC                        BIT(5)
+
+/* stream ID bitmasks. */
+#define TRB_STREAM_ID_BITMASK          GENMASK(31, 16)
+#define TRB_STREAM_ID(p)               ((p) << 16)
+#define TRB_FIELD_TO_STREAMID(p)       (((p) & TRB_STREAM_ID_BITMASK) >> 16)
+
+/* Size of TD expressed in USB packets for HS/FS mode. */
+#define TRB_TDL_HS_SIZE(p)     (((p) << 16) & GENMASK(31, 16))
+#define TRB_TDL_HS_SIZE_GET(p) (((p) & GENMASK(31, 16)) >> 16)
+
+/* transfer_len bitmasks. */
+#define TRB_LEN(p)             ((p) & GENMASK(16, 0))
+
+/* Size of TD expressed in USB packets for SS mode. */
+#define TRB_TDL_SS_SIZE(p)     (((p) << 17) & GENMASK(23, 17))
+#define TRB_TDL_SS_SIZE_GET(p) (((p) & GENMASK(23, 17)) >> 17)
+
+/* transfer_len bitmasks - bits 31:24 */
+#define TRB_BURST_LEN(p)       (((p) << 24) & GENMASK(31, 24))
+#define TRB_BURST_LEN_GET(p)   (((p) & GENMASK(31, 24)) >> 24)
+
+/* Data buffer pointer bitmasks*/
+#define TRB_BUFFER(p)          ((p) & GENMASK(31, 0))
+
+/*-------------------------------------------------------------------------*/
+/* Driver numeric constants */
+
+/* Such declaration should be added to ch9.h */
+#define USB_DEVICE_MAX_ADDRESS         127
+
+/* Endpoint init values */
+#define CDNS3_EP_MAX_PACKET_LIMIT      1024
+#define CDNS3_EP_MAX_STREAMS           15
+#define CDNS3_EP0_MAX_PACKET_LIMIT     512
+
+/* All endpoints including EP0 */
+#define CDNS3_ENDPOINTS_MAX_COUNT      32
+#define CDNS3_EP_ZLP_BUF_SIZE          1024
+
+#define CDNS3_EP_BUF_SIZE              2       /* KB */
+#define CDNS3_EP_ISO_HS_MULT           3
+#define CDNS3_EP_ISO_SS_BURST          3
+#define CDNS3_MAX_NUM_DESCMISS_BUF     32
+#define CDNS3_DESCMIS_BUF_SIZE         2048    /* Bytes */
+#define CDNS3_WA2_NUM_BUFFERS          128
+/*-------------------------------------------------------------------------*/
+/* Used structs */
+
+struct cdns3_device;
+
+/**
+ * struct cdns3_endpoint - extended device side representation of USB endpoint.
+ * @endpoint: usb endpoint
+ * @pending_req_list: list of requests queuing on transfer ring.
+ * @deferred_req_list: list of requests waiting for queuing on transfer ring.
+ * @wa2_descmiss_req_list: list of requests internally allocated by driver.
+ * @trb_pool: transfer ring - array of transaction buffers
+ * @trb_pool_dma: dma address of transfer ring
+ * @cdns3_dev: device associated with this endpoint
+ * @name: a human readable name e.g. ep1out
+ * @flags: specify the current state of endpoint
+ * @descmis_req: internal transfer object used for getting data from on-chip
+ *     buffer. It can happen only if function driver doesn't send usb_request
+ *     object on time.
+ * @dir: endpoint direction
+ * @num: endpoint number (1 - 15)
+ * @type: set to bmAttributes & USB_ENDPOINT_XFERTYPE_MASK
+ * @interval: interval between packets used for ISOC endpoint.
+ * @free_trbs: number of free TRBs in transfer ring
+ * @num_trbs: number of all TRBs in transfer ring
+ * @pcs: producer cycle state
+ * @ccs: consumer cycle state
+ * @enqueue: enqueue index in transfer ring
+ * @dequeue: dequeue index in transfer ring
+ * @trb_burst_size: number of burst used in trb.
+ */
+struct cdns3_endpoint {
+       struct usb_ep           endpoint;
+       struct list_head        pending_req_list;
+       struct list_head        deferred_req_list;
+       struct list_head        wa2_descmiss_req_list;
+       int                     wa2_counter;
+
+       struct cdns3_trb        *trb_pool;
+       dma_addr_t              trb_pool_dma;
+
+       struct cdns3_device     *cdns3_dev;
+       char                    name[20];
+
+#define EP_ENABLED             BIT(0)
+#define EP_STALLED             BIT(1)
+#define EP_STALL_PENDING       BIT(2)
+#define EP_WEDGE               BIT(3)
+#define EP_TRANSFER_STARTED    BIT(4)
+#define EP_UPDATE_EP_TRBADDR   BIT(5)
+#define EP_PENDING_REQUEST     BIT(6)
+#define EP_RING_FULL           BIT(7)
+#define EP_CLAIMED             BIT(8)
+#define EP_DEFERRED_DRDY       BIT(9)
+#define EP_QUIRK_ISO_OUT_EN    BIT(10)
+#define EP_QUIRK_END_TRANSFER  BIT(11)
+#define EP_QUIRK_EXTRA_BUF_DET BIT(12)
+#define EP_QUIRK_EXTRA_BUF_EN  BIT(13)
+       u32                     flags;
+
+       struct cdns3_request    *descmis_req;
+
+       u8                      dir;
+       u8                      num;
+       u8                      type;
+       int                     interval;
+
+       int                     free_trbs;
+       int                     num_trbs;
+       u8                      pcs;
+       u8                      ccs;
+       int                     enqueue;
+       int                     dequeue;
+       u8                      trb_burst_size;
+
+       unsigned int            wa1_set:1;
+       struct cdns3_trb        *wa1_trb;
+       unsigned int            wa1_trb_index;
+       unsigned int            wa1_cycle_bit:1;
+};
+
+/**
+ * struct cdns3_aligned_buf - represent aligned buffer used for DMA transfer
+ * @buf: aligned to 8 bytes data buffer. Buffer address used in
+ *       TRB shall be aligned to 8.
+ * @dma: dma address
+ * @size: size of buffer
+ * @in_use: inform if this buffer is associated with usb_request
+ * @list: used to adding instance of this object to list
+ */
+struct cdns3_aligned_buf {
+       void                    *buf;
+       dma_addr_t              dma;
+       u32                     size;
+       int                     in_use:1;
+       struct list_head        list;
+};
+
+/**
+ * struct cdns3_request - extended device side representation of usb_request
+ *                        object .
+ * @request: generic usb_request object describing single I/O request.
+ * @priv_ep: extended representation of usb_ep object
+ * @trb: the first TRB association with this request
+ * @start_trb: number of the first TRB in transfer ring
+ * @end_trb: number of the last TRB in transfer ring
+ * @aligned_buf: object holds information about aligned buffer associated whit
+ *               this endpoint
+ * @flags: flag specifying special usage of request
+ * @list: used by internally allocated request to add to wa2_descmiss_req_list.
+ */
+struct cdns3_request {
+       struct usb_request              request;
+       struct cdns3_endpoint           *priv_ep;
+       struct cdns3_trb                *trb;
+       int                             start_trb;
+       int                             end_trb;
+       struct cdns3_aligned_buf        *aligned_buf;
+#define REQUEST_PENDING                        BIT(0)
+#define REQUEST_INTERNAL               BIT(1)
+#define REQUEST_INTERNAL_CH            BIT(2)
+#define REQUEST_ZLP                    BIT(3)
+#define REQUEST_UNALIGNED              BIT(4)
+       u32                             flags;
+       struct list_head                list;
+};
+
+#define to_cdns3_request(r) (container_of(r, struct cdns3_request, request))
+
+/*Stages used during enumeration process.*/
+#define CDNS3_SETUP_STAGE              0x0
+#define CDNS3_DATA_STAGE               0x1
+#define CDNS3_STATUS_STAGE             0x2
+
+/**
+ * struct cdns3_device - represent USB device.
+ * @dev: pointer to device structure associated whit this controller
+ * @sysdev: pointer to the DMA capable device
+ * @gadget: device side representation of the peripheral controller
+ * @gadget_driver: pointer to the gadget driver
+ * @dev_ver: device controller version.
+ * @lock: for synchronizing
+ * @regs: base address for device side registers
+ * @setup_buf: used while processing usb control requests
+ * @setup_dma: dma address for setup_buf
+ * @zlp_buf - zlp buffer
+ * @ep0_stage: ep0 stage during enumeration process.
+ * @ep0_data_dir: direction for control transfer
+ * @eps: array of pointers to all endpoints with exclusion ep0
+ * @aligned_buf_list: list of aligned buffers internally allocated by driver
+ * @aligned_buf_wq: workqueue freeing  no longer used aligned buf.
+ * @selected_ep: actually selected endpoint. It's used only to improve
+ *               performance.
+ * @isoch_delay: value from Set Isoch Delay request. Only valid on SS/SSP.
+ * @u1_allowed: allow device transition to u1 state
+ * @u2_allowed: allow device transition to u2 state
+ * @is_selfpowered: device is self powered
+ * @setup_pending: setup packet is processing by gadget driver
+ * @hw_configured_flag: hardware endpoint configuration was set.
+ * @wake_up_flag: allow device to remote up the host
+ * @status_completion_no_call: indicate that driver is waiting for status s
+ *     stage completion. It's used in deferred SET_CONFIGURATION request.
+ * @onchip_buffers: number of available on-chip buffers.
+ * @onchip_used_size: actual size of on-chip memory assigned to endpoints.
+ * @pending_status_wq: workqueue handling status stage for deferred requests.
+ * @pending_status_request: request for which status stage was deferred
+ */
+struct cdns3_device {
+       struct udevice                  *dev;
+       struct udevice                  *sysdev;
+
+       struct usb_gadget               gadget;
+       struct usb_gadget_driver        *gadget_driver;
+
+#define CDNS_REVISION_V0               0x00024501
+#define CDNS_REVISION_V1               0x00024509
+       u32                             dev_ver;
+
+       /* generic spin-lock for drivers */
+       spinlock_t                      lock;
+
+       struct cdns3_usb_regs           __iomem *regs;
+
+       struct usb_ctrlrequest          *setup_buf;
+       dma_addr_t                      setup_dma;
+       void                            *zlp_buf;
+
+       u8                              ep0_stage;
+       int                             ep0_data_dir;
+
+       struct cdns3_endpoint           *eps[CDNS3_ENDPOINTS_MAX_COUNT];
+
+       struct list_head                aligned_buf_list;
+       struct work_struct              aligned_buf_wq;
+
+       u32                             selected_ep;
+       u16                             isoch_delay;
+
+       unsigned                        wait_for_setup:1;
+       unsigned                        u1_allowed:1;
+       unsigned                        u2_allowed:1;
+       unsigned                        is_selfpowered:1;
+       unsigned                        setup_pending:1;
+       int                             hw_configured_flag:1;
+       int                             wake_up_flag:1;
+       unsigned                        status_completion_no_call:1;
+       int                             out_mem_is_allocated;
+
+       struct work_struct              pending_status_wq;
+       struct usb_request              *pending_status_request;
+
+       /*in KB */
+       u32                             onchip_buffers;
+       u16                             onchip_used_size;
+};
+
+void cdns3_set_register_bit(void __iomem *ptr, u32 mask);
+dma_addr_t cdns3_trb_virt_to_dma(struct cdns3_endpoint *priv_ep,
+                                struct cdns3_trb *trb);
+enum usb_device_speed cdns3_get_speed(struct cdns3_device *priv_dev);
+void cdns3_pending_setup_status_handler(struct work_struct *work);
+void cdns3_hw_reset_eps_config(struct cdns3_device *priv_dev);
+void cdns3_set_hw_configuration(struct cdns3_device *priv_dev);
+void cdns3_select_ep(struct cdns3_device *priv_dev, u32 ep);
+void cdns3_allow_enable_l1(struct cdns3_device *priv_dev, int enable);
+struct usb_request *cdns3_next_request(struct list_head *list);
+int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
+                         struct usb_request *request);
+void cdns3_rearm_transfer(struct cdns3_endpoint *priv_ep, u8 rearm);
+int cdns3_allocate_trb_pool(struct cdns3_endpoint *priv_ep);
+u8 cdns3_ep_addr_to_index(u8 ep_addr);
+int cdns3_gadget_ep_set_wedge(struct usb_ep *ep);
+int cdns3_gadget_ep_set_halt(struct usb_ep *ep, int value);
+void __cdns3_gadget_ep_set_halt(struct cdns3_endpoint *priv_ep);
+int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep);
+struct usb_request *cdns3_gadget_ep_alloc_request(struct usb_ep *ep,
+                                                 gfp_t gfp_flags);
+void cdns3_gadget_ep_free_request(struct usb_ep *ep,
+                                 struct usb_request *request);
+int cdns3_gadget_ep_dequeue(struct usb_ep *ep, struct usb_request *request);
+void cdns3_gadget_giveback(struct cdns3_endpoint *priv_ep,
+                          struct cdns3_request *priv_req,
+                          int status);
+
+int cdns3_init_ep0(struct cdns3_device *priv_dev,
+                  struct cdns3_endpoint *priv_ep);
+void cdns3_ep0_config(struct cdns3_device *priv_dev);
+void cdns3_ep_config(struct cdns3_endpoint *priv_ep);
+void cdns3_check_ep0_interrupt_proceed(struct cdns3_device *priv_dev, int dir);
+int __cdns3_gadget_wakeup(struct cdns3_device *priv_dev);
+
+#endif /* __LINUX_CDNS3_GADGET */
diff --git a/drivers/usb/cdns3/host-export.h b/drivers/usb/cdns3/host-export.h
new file mode 100644 (file)
index 0000000..b498a17
--- /dev/null
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Cadence USBSS DRD Driver - Host Export APIs
+ *
+ * Copyright (C) 2017-2018 NXP
+ *
+ * Authors: Peter Chen <peter.chen@nxp.com>
+ */
+#ifndef __LINUX_CDNS3_HOST_EXPORT
+#define __LINUX_CDNS3_HOST_EXPORT
+
+#ifdef CONFIG_USB_CDNS3_HOST
+
+int cdns3_host_init(struct cdns3 *cdns);
+void cdns3_host_exit(struct cdns3 *cdns);
+
+#else
+
+static inline int cdns3_host_init(struct cdns3 *cdns)
+{
+       return -ENXIO;
+}
+
+static inline void cdns3_host_exit(struct cdns3 *cdns) { }
+
+#endif /* CONFIG_USB_CDNS3_HOST */
+
+#endif /* __LINUX_CDNS3_HOST_EXPORT */
diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c
new file mode 100644 (file)
index 0000000..79be630
--- /dev/null
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Cadence USBSS DRD Driver - host side
+ *
+ * Copyright (C) 2018-2019 Cadence Design Systems.
+ * Copyright (C) 2017-2018 NXP
+ *
+ * Authors: Peter Chen <peter.chen@nxp.com>
+ *          Pawel Laszczak <pawell@cadence.com>
+ */
+#include <dm.h>
+#include <linux/compat.h>
+#include <usb.h>
+#include "../host/xhci.h"
+
+#include "core.h"
+#include "drd.h"
+
+static int __cdns3_host_init(struct cdns3 *cdns)
+{
+       struct xhci_hcor *hcor;
+       struct xhci_hccr *hccr;
+
+       cdns3_drd_switch_host(cdns, 1);
+
+       hccr = (struct xhci_hccr *)cdns->xhci_regs;
+       hcor = (struct xhci_hcor *)(cdns->xhci_regs +
+                       HC_LENGTH(xhci_readl(&(hccr)->cr_capbase)));
+
+       return xhci_register(cdns->dev, hccr, hcor);
+}
+
+static void cdns3_host_exit(struct cdns3 *cdns)
+{
+       xhci_deregister(cdns->dev);
+       cdns3_drd_switch_host(cdns, 0);
+}
+
+int cdns3_host_init(struct cdns3 *cdns)
+{
+       struct cdns3_role_driver *rdrv;
+
+       rdrv = devm_kzalloc(cdns->dev, sizeof(*rdrv), GFP_KERNEL);
+       if (!rdrv)
+               return -ENOMEM;
+
+       rdrv->start     = __cdns3_host_init;
+       rdrv->stop      = cdns3_host_exit;
+       rdrv->state     = CDNS3_ROLE_STATE_INACTIVE;
+       rdrv->name      = "host";
+
+       cdns->roles[USB_ROLE_HOST] = rdrv;
+
+       return 0;
+}
diff --git a/drivers/usb/cdns3/trace.c b/drivers/usb/cdns3/trace.c
new file mode 100644 (file)
index 0000000..459fa72
--- /dev/null
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * USBSS device controller driver Trace Support
+ *
+ * Copyright (C) 2018-2019 Cadence.
+ *
+ * Author: Pawel Laszczak <pawell@cadence.com>
+ */
+
+#define CREATE_TRACE_POINTS
+#include "trace.h"
diff --git a/drivers/usb/cdns3/trace.h b/drivers/usb/cdns3/trace.h
new file mode 100644 (file)
index 0000000..e86c02a
--- /dev/null
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#define trace_cdns3_prepare_trb(a, b)
+#define trace_cdns3_doorbell_ep0(a, b)
+#define trace_cdns3_ctrl_req(a)
+#define trace_cdns3_complete_trb(a, b)
+#define trace_cdns3_ep0_irq(a, b)
+#define trace_cdns3_gadget_giveback(a)
+#define trace_cdns3_free_aligned_request(a)
+#define trace_cdns3_prepare_aligned_request(a)
+#define trace_cdns3_ring(a)
+#define trace_cdns3_doorbell_epx(a, b)
+#define trace_cdns3_request_handled(a, b, c)
+#define trace_cdns3_epx_irq(a, b)
+#define trace_cdns3_usb_irq(a, b)
+#define trace_cdns3_alloc_request(a)
+#define trace_cdns3_free_request(a)
+#define trace_cdns3_gadget_ep_enable(a)
+#define trace_cdns3_gadget_ep_disable(a)
+#define trace_cdns3_ep0_queue(a, b)
+#define trace_cdns3_ep0_dequeue(a)
+#define trace_cdns3_ep_queue(a)
+#define trace_cdns3_ep_dequeue(a)
+#define trace_cdns3_halt(a, b, c)
+#define trace_cdns3_wa1(a, b)
+#define trace_cdns3_wa2(a, b)
index 023e95395be79e161d29cdbfec39fa92ee673494..24b320bbcec260f289b0d0e00a6b70af8897b3b4 100644 (file)
@@ -338,7 +338,7 @@ static int dwc3_glue_reset_init(struct udevice *dev,
        int ret;
 
        ret = reset_get_bulk(dev, &glue->resets);
-       if (ret == -ENOTSUPP)
+       if (ret == -ENOTSUPP || ret == -ENOENT)
                return 0;
        else if (ret)
                return ret;
@@ -358,7 +358,7 @@ static int dwc3_glue_clk_init(struct udevice *dev,
        int ret;
 
        ret = clk_get_bulk(dev, &glue->clks);
-       if (ret == -ENOSYS)
+       if (ret == -ENOSYS || ret == -ENOENT)
                return 0;
        if (ret)
                return ret;
index 085f7b8968842bbdae3f08ac543b3b72ba96afda..67d11b4c0d7e9e2f2f2a3af2b1f04710a8c47352 100644 (file)
@@ -242,7 +242,8 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
 
        list_del(&req->list);
        req->trb = NULL;
-       dwc3_flush_cache((uintptr_t)req->request.dma, req->request.length);
+       if (req->request.length)
+               dwc3_flush_cache((uintptr_t)req->request.dma, req->request.length);
 
        if (req->request.status == -EINPROGRESS)
                req->request.status = status;
index c7e76237475260df0cccc5f688d816b1df99cc31..618a7d5016ee42416edffe01e066793ebbb64a4b 100644 (file)
@@ -688,6 +688,57 @@ static void composite_setup_complete(struct usb_ep *ep, struct usb_request *req)
                                req->status, req->actual, req->length);
 }
 
+static int bos_desc(struct usb_composite_dev *cdev)
+{
+       struct usb_ext_cap_descriptor   *usb_ext;
+       struct usb_bos_descriptor       *bos = cdev->req->buf;
+
+       bos->bLength = USB_DT_BOS_SIZE;
+       bos->bDescriptorType = USB_DT_BOS;
+
+       bos->wTotalLength = cpu_to_le16(USB_DT_BOS_SIZE);
+       bos->bNumDeviceCaps = 0;
+
+       /*
+        * A SuperSpeed device shall include the USB2.0 extension descriptor
+        * and shall support LPM when operating in USB2.0 HS mode.
+        */
+       usb_ext = cdev->req->buf + le16_to_cpu(bos->wTotalLength);
+       bos->bNumDeviceCaps++;
+       le16_add_cpu(&bos->wTotalLength, USB_DT_USB_EXT_CAP_SIZE);
+       usb_ext->bLength = USB_DT_USB_EXT_CAP_SIZE;
+       usb_ext->bDescriptorType = USB_DT_DEVICE_CAPABILITY;
+       usb_ext->bDevCapabilityType = USB_CAP_TYPE_EXT;
+       usb_ext->bmAttributes =
+               cpu_to_le32(USB_LPM_SUPPORT | USB_BESL_SUPPORT);
+
+       /*
+        * The Superspeed USB Capability descriptor shall be implemented
+        * by all SuperSpeed devices.
+        */
+       if (gadget_is_superspeed(cdev->gadget)) {
+               struct usb_ss_cap_descriptor *ss_cap;
+
+               ss_cap = cdev->req->buf + le16_to_cpu(bos->wTotalLength);
+               bos->bNumDeviceCaps++;
+               le16_add_cpu(&bos->wTotalLength, USB_DT_USB_SS_CAP_SIZE);
+               ss_cap->bLength = USB_DT_USB_SS_CAP_SIZE;
+               ss_cap->bDescriptorType = USB_DT_DEVICE_CAPABILITY;
+               ss_cap->bDevCapabilityType = USB_SS_CAP_TYPE;
+               ss_cap->bmAttributes = 0; /* LTM is not supported yet */
+               ss_cap->wSpeedSupported =
+                       cpu_to_le16(USB_LOW_SPEED_OPERATION |
+                                   USB_FULL_SPEED_OPERATION |
+                                   USB_HIGH_SPEED_OPERATION |
+                                   USB_5GBPS_OPERATION);
+               ss_cap->bFunctionalitySupport = USB_LOW_SPEED_OPERATION;
+               ss_cap->bU1devExitLat = USB_DEFAULT_U1_DEV_EXIT_LAT;
+               ss_cap->bU2DevExitLat =
+                       cpu_to_le16(USB_DEFAULT_U2_DEV_EXIT_LAT);
+       }
+       return le16_to_cpu(bos->wTotalLength);
+}
+
 /*
  * The setup() callback implements all the ep0 functionality that's
  * not handled lower down, in hardware or the hardware driver(like
@@ -776,12 +827,10 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
                                value = min(w_length, (u16) value);
                        break;
                case USB_DT_BOS:
-                       /*
-                        * The USB compliance test (USB 2.0 Command Verifier)
-                        * issues this request. We should not run into the
-                        * default path here. But return for now until
-                        * the superspeed support is added.
-                        */
+                       if (gadget_is_superspeed(cdev->gadget))
+                               value = bos_desc(cdev);
+                       if (value >= 0)
+                               value = min(w_length, (u16)value);
                        break;
                default:
                        goto unknown;
index 179b94cdd0ae75759605a2617da9e6a5830de580..e61fe5d11445dccede0bbbb19c7eb10d9622c7f5 100644 (file)
@@ -282,6 +282,9 @@ struct usb_ep *usb_ep_autoconfig(
                        return ep;
        }
 
+       if (gadget->ops->match_ep)
+               ep = gadget->ops->match_ep(gadget, desc, NULL);
+
        /* Second, look at endpoints until an unclaimed one looks usable */
        list_for_each_entry(ep, &gadget->ep_list, ep_list) {
                if (ep_matches(gadget, ep, desc))
index 8b3b19feaf3d45dc074125ed1786a0f6a6a31051..920fa5279cd240d6e8b30c45cdd9786936da5a66 100644 (file)
@@ -941,6 +941,13 @@ static int thor_eps_setup(struct usb_function *f)
        dev->out_req = req;
        /* ACM control EP */
        ep = dev->int_ep;
+       d = ep_desc(gadget, &hs_int_desc, &fs_int_desc);
+       debug("(d)bEndpointAddress: 0x%x\n", d->bEndpointAddress);
+
+       result = usb_ep_enable(ep, d);
+       if (result)
+               goto err;
+
        ep->driver_data = cdev; /* claim */
 
        return 0;
index 2c8f235d51c8769d759a0105fdf9df01dd197e75..91b0285244ec8e86f4655b0ada5e78cc99a1d3bb 100644 (file)
 #define gadget_is_dwc3(g)        0
 #endif
 
+#ifdef CONFIG_USB_CDNS3_GADGET
+#define gadget_is_cdns3(g)        (!strcmp("cdns3-gadget", (g)->name))
+#else
+#define gadget_is_cdns3(g)        0
+#endif
+
 /**
  * usb_gadget_controller_number - support bcdDevice id convention
  * @gadget: the controller being driven
@@ -208,5 +214,7 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
                return 0x22;
        else if (gadget_is_dwc3(gadget))
                return 0x23;
+       else if (gadget_is_cdns3(gadget))
+               return 0x24;
        return -ENOENT;
 }
index 62b47781ddcc51a6f19638a17b26e1e7b326f098..8d1d90e3e39fa7f425ca414e9c8e8bf55205c57f 100644 (file)
@@ -267,6 +267,27 @@ EXPORT_SYMBOL_GPL(usb_del_gadget_udc);
 
 /* ------------------------------------------------------------------------- */
 
+/**
+ * usb_gadget_udc_set_speed - tells usb device controller speed supported by
+ *    current driver
+ * @udc: The device we want to set maximum speed
+ * @speed: The maximum speed to allowed to run
+ *
+ * This call is issued by the UDC Class driver before calling
+ * usb_gadget_udc_start() in order to make sure that we don't try to
+ * connect on speeds the gadget driver doesn't support.
+ */
+static inline void usb_gadget_udc_set_speed(struct usb_udc *udc,
+                                           enum usb_device_speed speed)
+{
+       if (udc->gadget->ops->udc_set_speed) {
+               enum usb_device_speed s;
+
+               s = min(speed, udc->gadget->max_speed);
+               udc->gadget->ops->udc_set_speed(udc->gadget, s);
+       }
+}
+
 static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *driver)
 {
        int ret;
@@ -276,6 +297,8 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
 
        udc->driver = driver;
 
+       usb_gadget_udc_set_speed(udc, driver->speed);
+
        ret = driver->bind(udc->gadget);
        if (ret)
                goto err1;
index 61a61abb21129ed0a2c6e3d5c70e6ba47231af78..85918e85be3ceb6f094a7df2c6073e648969db7d 100644 (file)
@@ -307,7 +307,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
        volatile struct qTD *vtd;
        unsigned long ts;
        uint32_t *tdp;
-       uint32_t endpt, maxpacket, token, usbsts;
+       uint32_t endpt, maxpacket, token, usbsts, qhtoken;
        uint32_t c, toggle;
        uint32_t cmd;
        int timeout;
@@ -551,22 +551,21 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
        flush_dcache_range((unsigned long)qtd,
                           ALIGN_END_ADDR(struct qTD, qtd, qtd_count));
 
-       /* Set async. queue head pointer. */
-       ehci_writel(&ctrl->hcor->or_asynclistaddr, virt_to_phys(&ctrl->qh_list));
-
        usbsts = ehci_readl(&ctrl->hcor->or_usbsts);
        ehci_writel(&ctrl->hcor->or_usbsts, (usbsts & 0x3f));
 
        /* Enable async. schedule. */
        cmd = ehci_readl(&ctrl->hcor->or_usbcmd);
-       cmd |= CMD_ASE;
-       ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
+       if (!(cmd & CMD_ASE)) {
+               cmd |= CMD_ASE;
+               ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
 
-       ret = handshake((uint32_t *)&ctrl->hcor->or_usbsts, STS_ASS, STS_ASS,
-                       100 * 1000);
-       if (ret < 0) {
-               printf("EHCI fail timeout STS_ASS set\n");
-               goto fail;
+               ret = handshake((uint32_t *)&ctrl->hcor->or_usbsts, STS_ASS, STS_ASS,
+                               100 * 1000);
+               if (ret < 0) {
+                       printf("EHCI fail timeout STS_ASS set\n");
+                       goto fail;
+               }
        }
 
        /* Wait for TDs to be processed. */
@@ -587,6 +586,11 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
                        break;
                WATCHDOG_RESET();
        } while (get_timer(ts) < timeout);
+       qhtoken = hc32_to_cpu(qh->qh_overlay.qt_token);
+
+       ctrl->qh_list.qh_link = cpu_to_hc32(virt_to_phys(&ctrl->qh_list) | QH_LINK_TYPE_QH);
+       flush_dcache_range((unsigned long)&ctrl->qh_list,
+               ALIGN_END_ADDR(struct QH, &ctrl->qh_list, 1));
 
        /*
         * Invalidate the memory area occupied by buffer
@@ -605,25 +609,12 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
        if (QT_TOKEN_GET_STATUS(token) & QT_TOKEN_STATUS_ACTIVE)
                printf("EHCI timed out on TD - token=%#x\n", token);
 
-       /* Disable async schedule. */
-       cmd = ehci_readl(&ctrl->hcor->or_usbcmd);
-       cmd &= ~CMD_ASE;
-       ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
-
-       ret = handshake((uint32_t *)&ctrl->hcor->or_usbsts, STS_ASS, 0,
-                       100 * 1000);
-       if (ret < 0) {
-               printf("EHCI fail timeout STS_ASS reset\n");
-               goto fail;
-       }
-
-       token = hc32_to_cpu(qh->qh_overlay.qt_token);
-       if (!(QT_TOKEN_GET_STATUS(token) & QT_TOKEN_STATUS_ACTIVE)) {
-               debug("TOKEN=%#x\n", token);
-               switch (QT_TOKEN_GET_STATUS(token) &
+       if (!(QT_TOKEN_GET_STATUS(qhtoken) & QT_TOKEN_STATUS_ACTIVE)) {
+               debug("TOKEN=%#x\n", qhtoken);
+               switch (QT_TOKEN_GET_STATUS(qhtoken) &
                        ~(QT_TOKEN_STATUS_SPLITXSTATE | QT_TOKEN_STATUS_PERR)) {
                case 0:
-                       toggle = QT_TOKEN_GET_DT(token);
+                       toggle = QT_TOKEN_GET_DT(qhtoken);
                        usb_settoggle(dev, usb_pipeendpoint(pipe),
                                       usb_pipeout(pipe), toggle);
                        dev->status = 0;
@@ -641,11 +632,11 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
                        break;
                default:
                        dev->status = USB_ST_CRC_ERR;
-                       if (QT_TOKEN_GET_STATUS(token) & QT_TOKEN_STATUS_HALTED)
+                       if (QT_TOKEN_GET_STATUS(qhtoken) & QT_TOKEN_STATUS_HALTED)
                                dev->status |= USB_ST_STALLED;
                        break;
                }
-               dev->act_len = length - QT_TOKEN_GET_TOTALBYTES(token);
+               dev->act_len = length - QT_TOKEN_GET_TOTALBYTES(qhtoken);
        } else {
                dev->act_len = 0;
 #ifndef CONFIG_USB_EHCI_FARADAY
index 119b41848715fd4074f25319828ed35f73cb707e..6a469e1dae99aff5f002010e66e9f67dbc935c0d 100644 (file)
@@ -827,7 +827,7 @@ int xhci_ctrl_tx(struct usb_device *udev, unsigned long pipe,
                field |= 0x1;
 
        /* xHCI 1.0 6.4.1.2.1: Transfer Type field */
-       if (HC_VERSION(xhci_readl(&ctrl->hccr->cr_capbase)) == 0x100) {
+       if (HC_VERSION(xhci_readl(&ctrl->hccr->cr_capbase)) >= 0x100) {
                if (length > 0) {
                        if (req->requesttype & USB_DIR_IN)
                                field |= (TRB_DATA_IN << TRB_TX_TYPE_SHIFT);
index 1152bca03be6491b3e4deb94cedfaef9bb14d16e..344e19d2c55c375c7666a23096a3f09baa2cd5d5 100644 (file)
@@ -29,7 +29,7 @@
 #endif
 
 #ifdef CONFIG_SPIFLASH
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_RAMBOOT_SPIFLASH
 #define CONFIG_RESET_VECTOR_ADDRESS    0x110bfffc
 #else
@@ -50,7 +50,7 @@
 #endif
 
 #ifdef CONFIG_NAND
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET              "u-boot-with-spl.bin"
index 53ee1484d05da52c3aa80dab9bae84797a1082ac..7cc3db943e509bd763518311b1f7c3bcae6f2511 100644 (file)
@@ -13,7 +13,7 @@
 
 #ifdef CONFIG_RAMBOOT_PBL
 
-#ifndef CONFIG_SECURE_BOOT
+#ifndef CONFIG_NXP_ESBC
 #define CONFIG_SYS_FSL_PBL_PBI $(SRCTREE)/board/freescale/t104xrdb/t104x_pbi.cfg
 #else
 #define CONFIG_SYS_FSL_PBL_PBI \
@@ -32,7 +32,7 @@
 #define BOOT_PAGE_OFFSET               0x27000
 
 #ifdef CONFIG_NAND
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_U_BOOT_HDR_SIZE         (16 << 10)
 /*
  * HDR would be appended at end of image and copied to DDR along
@@ -163,7 +163,7 @@ $(SRCTREE)/board/freescale/t104xrdb/t1042d4_sd_rcw.cfg
 #define CONFIG_ENV_SIZE                        0x2000
 #define CONFIG_ENV_OFFSET              (512 * 0x800)
 #elif defined(CONFIG_NAND)
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_RAMBOOT_NAND
 #define CONFIG_BOOTSCRIPT_COPY_RAM
 #endif
index 60e09c19399d805b5d8e946a9b3f59e65826a315..df602f696461b16fed3770dbc7ca21658926ee16 100644 (file)
@@ -12,7 +12,7 @@
 #include "../board/freescale/common/ics307_clk.h"
 
 #ifdef CONFIG_RAMBOOT_PBL
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_RAMBOOT_TEXT_BASE       CONFIG_SYS_TEXT_BASE
 #define CONFIG_RESET_VECTOR_ADDRESS    0xfffffffc
 #ifdef CONFIG_NAND
diff --git a/include/configs/durian.h b/include/configs/durian.h
new file mode 100644 (file)
index 0000000..c42a98b
--- /dev/null
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2019
+ * shuyiqi  <shuyiqi@phytium.com.cn>
+ * liuhao   <liuhao@phytium.com.cn>
+ */
+
+#ifndef __DURIAN_CONFIG_H__
+#define __DURIAN_CONFIG_H__
+
+/* Sdram Bank #1 Address */
+#define PHYS_SDRAM_1                   0x80000000
+#define PHYS_SDRAM_1_SIZE              0x7B000000
+#define CONFIG_SYS_SDRAM_BASE   PHYS_SDRAM_1
+
+#define CONFIG_SYS_LOAD_ADDR   (CONFIG_SYS_SDRAM_BASE + 0x10000000)
+
+/* Size of Malloc Pool */
+#define CONFIG_ENV_SIZE 4096
+#define CONFIG_SYS_MALLOC_LEN  (1 * 1024 * 1024  + CONFIG_ENV_SIZE)
+
+#define CONFIG_SYS_INIT_SP_ADDR                (0x88000000 - 0x100000)
+
+/* PCI CONFIG */
+#define CONFIG_SYS_PCI_64BIT    1
+#define CONFIG_PCI_SCAN_SHOW
+
+/* SCSI */
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID 4
+#define CONFIG_SYS_SCSI_MAX_LUN 1
+#define CONFIG_SYS_SCSI_MAX_DEVICE 128
+#define CONFIG_SCSI_AHCI_PLAT
+#define CONFIG_SYS_SATA_MAX_DEVICE 4
+
+/* BOOT */
+#define CONFIG_SYS_BOOTM_LEN   (60 * 1024 * 1024)
+
+#define CONFIG_EXTRA_ENV_SETTINGS      \
+       "load_kernel=ext4load scsi 0:1 0x90100000 uImage-2004\0"        \
+       "load_fdt=ext4load scsi 0:1 0x95000000 ft2004-pci-64.dtb\0"\
+       "boot_fdt=bootm 0x90100000 -:- 0x95000000\0"    \
+       "distro_bootcmd=run load_kernel; run load_fdt; run boot_fdt"
+
+#endif
index 31abee81edd2db4d410c2855dd0afb6163d5c4b4..1363d3084d4479f41d3efe0f3a3453f681d7abcf 100644 (file)
        board/freescale/ls1021atwr/ls102xa_rcw_sd_ifc.cfg
 #endif
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 /*
  * HDR would be appended at end of image and copied to DDR along
  * with U-Boot image.
  */
 #define CONFIG_U_BOOT_HDR_SIZE                         (16 << 10)
-#endif /* ifdef CONFIG_SECURE_BOOT */
+#endif /* ifdef CONFIG_NXP_ESBC */
 
 #define CONFIG_SPL_MAX_SIZE            0x1a000
 #define CONFIG_SPL_STACK               0x1001d000
index 40fcd2258293c7b12996ab973d716dfb25eea21b..39f9318007094f897b671a2f0aab178c402b6617 100644 (file)
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  5
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #include <asm/fsl_secure_boot.h>
 #endif
 
index 70447a2183eecc6031358af3af833ec7ae58b946..e237012626b1e3bfd71757e21f6ea5b2ffb6aa5d 100644 (file)
@@ -74,7 +74,7 @@
 #define CONFIG_SPL_BSS_START_ADDR      0x8f000000
 #define CONFIG_SPL_BSS_MAX_SIZE                0x80000
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_U_BOOT_HDR_SIZE                         (16 << 10)
 /*
  * HDR would be appended at end of image and copied to DDR along
@@ -85,7 +85,7 @@
 #define CONFIG_SYS_MONITOR_LEN         (0x100000 + CONFIG_U_BOOT_HDR_SIZE)
 #else
 #define CONFIG_SYS_MONITOR_LEN         0x100000
-#endif /* ifdef CONFIG_SECURE_BOOT */
+#endif /* ifdef CONFIG_NXP_ESBC */
 #endif
 
 /* NAND SPL */
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000
 #define CONFIG_SPL_BSS_MAX_SIZE                0x80000
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_U_BOOT_HDR_SIZE                         (16 << 10)
-#endif /* ifdef CONFIG_SECURE_BOOT */
+#endif /* ifdef CONFIG_NXP_ESBC */
 
 #ifdef CONFIG_U_BOOT_HDR_SIZE
 /*
index 59c43f1ae1ef9f5993d6eff8777a335ecb89426c..cc8f4c021062b6fbfa4a7595fa6a7bbbb5b74115 100644 (file)
@@ -73,7 +73,7 @@
                                        CONFIG_SPL_BSS_MAX_SIZE)
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_U_BOOT_HDR_SIZE                         (16 << 10)
 /*
  * HDR would be appended at end of image and copied to DDR along
@@ -84,7 +84,7 @@
 #define CONFIG_SYS_MONITOR_LEN         (0x100000 + CONFIG_U_BOOT_HDR_SIZE)
 #else
 #define CONFIG_SYS_MONITOR_LEN         0x100000
-#endif /* ifdef CONFIG_SECURE_BOOT */
+#endif /* ifdef CONFIG_NXP_ESBC */
 #endif
 
 #if defined(CONFIG_QSPI_BOOT) && defined(CONFIG_SPL)
index 6f04dbaccde66561396640b902a5a8bde239b77c..73c56296ff48c3cd614eac11be7265f4c56e16f9 100644 (file)
@@ -235,7 +235,7 @@ unsigned long long get_qixis_addr(void);
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00100000
 #define CONFIG_SYS_SPL_MALLOC_START    0x80200000
 
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_U_BOOT_HDR_SIZE         (16 << 10)
 /*
  * HDR would be appended at end of image and copied to DDR along
@@ -246,7 +246,7 @@ unsigned long long get_qixis_addr(void);
 #define CONFIG_SYS_MONITOR_LEN         (0x100000 + CONFIG_U_BOOT_HDR_SIZE)
 #else
 #define CONFIG_SYS_MONITOR_LEN         0x100000
-#endif /* ifdef CONFIG_SECURE_BOOT */
+#endif /* ifdef CONFIG_NXP_ESBC */
 
 #endif
 #define CONFIG_SYS_BOOTM_LEN   (64 << 20)      /* Increase max gunzip size */
index 85e20617e6afc44d3940b480018b1a71bf962f2c..c9c517f93ec962ac6f49a063ad545c724e7a129d 100644 (file)
@@ -407,7 +407,7 @@ unsigned long get_board_ddr_clk(void);
        QIXIS_SDID_MASK) != QIXIS_ESDHC_NO_ADAPTER)
 
 /* Initial environment variables */
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS              \
        "hwconfig=fsl_ddr:bank_intlv=auto\0"    \
@@ -426,7 +426,7 @@ unsigned long get_board_ddr_clk(void);
        "sf read 0xa0740000 0x740000 0x4000;esbc_validate 0xa0740000;"  \
        "fsl_mc start mc 0xa0a00000 0xa0e00000\0"                       \
        "mcmemsize=0x70000000 \0"
-#else /* if !(CONFIG_SECURE_BOOT) */
+#else /* if !(CONFIG_NXP_ESBC) */
 #ifdef CONFIG_TFABOOT
 #define QSPI_MC_INIT_CMD                               \
        "sf probe 0:0;sf read 0x80000000 0xA00000 0x100000;"    \
@@ -522,7 +522,7 @@ unsigned long get_board_ddr_clk(void);
        "mcmemsize=0x70000000 \0"
 #endif
 #endif /* CONFIG_TFABOOT */
-#endif /* CONFIG_SECURE_BOOT */
+#endif /* CONFIG_NXP_ESBC */
 
 #ifdef CONFIG_FSL_MC_ENET
 #define CONFIG_FSL_MEMAC
index e2a897557db1d7f1d31d3badf4d9b3ffd7e1cb69..08696fa9a3af7e6004b0fcd191e3268cb6c9774e 100644 (file)
@@ -352,7 +352,7 @@ unsigned long get_board_ddr_clk(void);
 
 /* Initial environment variables */
 #undef CONFIG_EXTRA_ENV_SETTINGS
-#ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_NXP_ESBC
 #define CONFIG_EXTRA_ENV_SETTINGS              \
        "hwconfig=fsl_ddr:bank_intlv=auto\0"    \
        "loadaddr=0x80100000\0"                 \
@@ -442,7 +442,7 @@ unsigned long get_board_ddr_clk(void);
        "mcinitcmd=fsl_mc start mc 0x580a00000" \
        " 0x580e00000 \0"
 #endif /* CONFIG_TFABOOT */
-#endif /* CONFIG_SECURE_BOOT */
+#endif /* CONFIG_NXP_ESBC */
 
 #ifdef CONFIG_TFABOOT
 #define SD_BOOTCOMMAND                                         \
index 3ff3331c80870dec5051769193f748fe89aa8efa..e51e1b0e0e79e628ece61085fcb724649b6e55a8 100644 (file)
@@ -18,7 +18,7 @@
 #define CONFIG_SYS_INIT_SP_ADDR                0x00300000
 #define CONFIG_SYS_LOAD_ADDR           0x00800800
 #define CONFIG_SPL_STACK               0x00400000
-#define CONFIG_SPL_MAX_SIZE            0x100000
+#define CONFIG_SPL_MAX_SIZE            0x40000
 #define CONFIG_SPL_BSS_START_ADDR      0x2000000
 #define CONFIG_SPL_BSS_MAX_SIZE                0x2000
 
index e4b2114a0dd5f2d9aab2d9b3a994844cbbc4a8ce..e57d0efa7f92d6164816f6100baa384a14993742 100644 (file)
@@ -27,7 +27,7 @@
 #define CONFIG_SYS_INIT_SP_ADDR                0x00300000
 #define CONFIG_SYS_LOAD_ADDR           0x00280000
 
-#define CONFIG_SPL_MAX_SIZE             0x60000
+#define CONFIG_SPL_MAX_SIZE             0x40000
 #define CONFIG_SPL_BSS_START_ADDR       0x400000
 #define CONFIG_SPL_BSS_MAX_SIZE         0x20000
 #define CONFIG_SPL_STACK                0x00188000
index 126c34763ea86cb6974530e24cbca3a12c9a8dbc..7331c6dc026e53f52de8d0c46888213969dc903d 100644 (file)
@@ -21,7 +21,7 @@
 
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_TPL_BOOTROM_SUPPORT)
 #define CONFIG_SPL_STACK               0x00400000
-#define CONFIG_SPL_MAX_SIZE             0x100000
+#define CONFIG_SPL_MAX_SIZE             0x40000
 #define CONFIG_SPL_BSS_START_ADDR      0x00400000
 #define CONFIG_SPL_BSS_MAX_SIZE         0x2000
 #else
index c7c30d367a332258824f3c7ba84f27e55e9a19b9..a03005902fa89d64f651894b6a17fcd33170f4a4 100644 (file)
@@ -19,8 +19,6 @@
 /* High Level Configuration Options */
 #define CONFIG_SOCRATES                1
 
-#define CONFIG_PCI_INDIRECT_BRIDGE
-
 /*
  * Only possible on E500 Version 2 or newer cores.
  */
@@ -96,6 +94,7 @@
  */
 #define CONFIG_SYS_LBC_CACHE_BASE      0xf0000000      /* Localbus cacheable    */
 
+#define CONFIG_SYS_FLASH_QUIET_TEST
 #define CONFIG_SYS_FLASH0              0xFE000000
 #define CONFIG_SYS_FLASH1              0xFC000000
 #define CONFIG_SYS_FLASH_BANKS_LIST    { CONFIG_SYS_FLASH1, CONFIG_SYS_FLASH0 }
 #define CONFIG_SYS_BR2_PRELIM          0xc80018a1      /* UPMB, 32-bit */
 #define CONFIG_SYS_OR2_PRELIM          0xfc000000      /* 64 MB        */
 
-#define CONFIG_VIDEO_MB862xx
-#define CONFIG_VIDEO_MB862xx_ACCEL
-#define CONFIG_VIDEO_LOGO
-#define CONFIG_VIDEO_BMP_LOGO
-#define VIDEO_FB_16BPP_PIXEL_SWAP
-#define VIDEO_FB_16BPP_WORD_SWAP
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_VIDEO_BMP_GZIP
-#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)       /* decompressed img */
-
-/* SDRAM Clock frequency, 100MHz (0x0000) or 133MHz (0x10000) */
-#define CONFIG_SYS_MB862xx_CCF         0x10000
-/* SDRAM parameter */
-#define CONFIG_SYS_MB862xx_MMR         0x4157BA63
-
-/* Serial Port */
-
-#define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE    1
-#define CONFIG_SYS_NS16550_CLK         get_bus_freq(0)
-
-#define CONFIG_SYS_NS16550_COM1        (CONFIG_SYS_CCSRBAR+0x4500)
-#define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_CCSRBAR+0x4600)
-
-#define CONFIG_SYS_BAUDRATE_TABLE  \
-       {300, 600, 1200, 2400, 4800, 9600, 19200, 38400,115200}
-
-/*
- * I2C
- */
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
-#define CONFIG_SYS_FSL_I2C_SPEED       102124
-#define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
-#define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
-#define CONFIG_SYS_FSL_I2C2_SPEED      102124
-#define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
-#define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
-
-/* I2C RTC */
-#define CONFIG_SYS_I2C_RTC_ADDR        0x32    /* at address 0x32              */
-
-/* I2C W83782G HW-Monitoring IC */
-#define CONFIG_SYS_I2C_W83782G_ADDR    0x28    /* W83782G address              */
+#define CONFIG_SYS_SPD_BUS_NUM 0
 
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      4
 
  * General PCI
  * Memory space is mapped 1-1.
  */
-#define CONFIG_SYS_PCI_PHYS            0x80000000      /* 1G PCI TLB */
 
 /* PCI is clocked by the external source at 33 MHz */
 #define CONFIG_PCI_CLK_FREQ    33000000
 #define CONFIG_SYS_PCI1_IO_PHYS        CONFIG_SYS_PCI1_IO_BASE
 #define CONFIG_SYS_PCI1_IO_SIZE        0x01000000      /* 16M                  */
 
-#if defined(CONFIG_PCI)
-#undef CONFIG_PCI_SCAN_SHOW            /* show pci devices on startup  */
-#endif /* CONFIG_PCI */
-
 #define CONFIG_TSEC1   1
 #define CONFIG_TSEC1_NAME      "TSEC0"
 #define CONFIG_TSEC3   1
  * Environment
  */
 #define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K(one sector) for env     */
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE - \
+                               CONFIG_ENV_SECT_SIZE - CONFIG_ENV_SECT_SIZE)
 #define CONFIG_ENV_SIZE                0x4000
-#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR-CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR - CONFIG_ENV_SECT_SIZE)
 #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
 
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
        "bootfile=/home/tftp/syscon3/uImage\0"                          \
        "fdt_file=/home/tftp/syscon3/socrates.dtb\0"                    \
        "initrd_file=/home/tftp/syscon3/uinitrd.gz\0"                   \
-       "uboot_addr=FFFA0000\0"                                         \
+       "uboot_addr=FFF60000\0"                                         \
        "kernel_addr=FE000000\0"                                        \
        "fdt_addr=FE1E0000\0"                                           \
        "ramdisk_addr=FE200000\0"                                       \
                "run nfsargs addip addcons;"                            \
                "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
        "update_uboot=tftp 100000 ${uboot_file};"                       \
-               "protect off fffa0000 ffffffff;"                        \
-               "era fffa0000 ffffffff;"                                \
-               "cp.b 100000 fffa0000 ${filesize};"                     \
+               "protect off fff60000 ffffffff;"                        \
+               "era fff60000 ffffffff;"                                \
+               "cp.b 100000 fff60000 ${filesize};"                     \
                "setenv filesize;saveenv\0"                             \
        "update_kernel=tftp 100000 ${bootfile};"                        \
                "era fe000000 fe1dffff;"                                \
 /* USB support */
 #define CONFIG_USB_OHCI_NEW            1
 #define CONFIG_PCI_OHCI                        1
-#define CONFIG_PCI_OHCI_DEVNO          3 /* Number in PCI list */
-#define CONFIG_PCI_EHCI_DEVNO          (CONFIG_PCI_OHCI_DEVNO / 2)
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     15
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME          "ohci_pci"
 #define CONFIG_SYS_OHCI_SWAP_REG_ACCESS        1
index 145a1576a3e9e889050c27dbb63e1a56d6ad52aa..564966333f1228e5fd4530050e39817fe8e6f580 100644 (file)
@@ -22,6 +22,8 @@ enum dfu_device_type {
        DFU_DEV_NAND,
        DFU_DEV_RAM,
        DFU_DEV_SF,
+       DFU_DEV_MTD,
+       DFU_DEV_VIRT,
 };
 
 enum dfu_layout {
@@ -55,6 +57,16 @@ struct mmc_internal_data {
        unsigned int part;
 };
 
+struct mtd_internal_data {
+       struct mtd_info *info;
+
+       /* RAW programming */
+       u64 start;
+       u64 size;
+       /* for ubi partition */
+       unsigned int ubi;
+};
+
 struct nand_internal_data {
        /* RAW programming */
        u64 start;
@@ -77,6 +89,12 @@ struct sf_internal_data {
        /* RAW programming */
        u64 start;
        u64 size;
+       /* for sf/ubi use */
+       unsigned int ubi;
+};
+
+struct virt_internal_data {
+       int dev_num;
 };
 
 #define DFU_NAME_SIZE                  32
@@ -103,9 +121,11 @@ struct dfu_entity {
 
        union {
                struct mmc_internal_data mmc;
+               struct mtd_internal_data mtd;
                struct nand_internal_data nand;
                struct ram_internal_data ram;
                struct sf_internal_data sf;
+               struct virt_internal_data virt;
        } data;
 
        int (*get_medium_size)(struct dfu_entity *dfu, u64 *size);
@@ -141,6 +161,8 @@ struct dfu_entity {
 #ifdef CONFIG_SET_DFU_ALT_INFO
 void set_dfu_alt_info(char *interface, char *devstr);
 #endif
+int dfu_alt_init(int num, struct dfu_entity **dfu);
+int dfu_alt_add(struct dfu_entity *dfu, char *interface, char *devstr, char *s);
 int dfu_config_entities(char *s, char *interface, char *devstr);
 void dfu_free_entities(void);
 void dfu_show_entities(void);
@@ -161,6 +183,28 @@ int dfu_read(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
 int dfu_write(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
 int dfu_flush(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
 
+/**
+ * dfu_initiated_callback - weak callback called on DFU transaction start
+ *
+ * It is a callback function called by DFU stack when a DFU transaction is
+ * initiated. This function allows to manage some board specific behavior on
+ * DFU targets.
+ *
+ * @param dfu - pointer to the dfu_entity, which should be initialized
+ *
+ */
+void dfu_initiated_callback(struct dfu_entity *dfu);
+/**
+ * dfu_flush_callback - weak callback called at the end of the DFU write
+ *
+ * It is a callback function called by DFU stack after DFU manifestation.
+ * This function allows to manage some board specific behavior on DFU targets
+ *
+ * @param dfu - pointer to the dfu_entity, which should be flushed
+ *
+ */
+void dfu_flush_callback(struct dfu_entity *dfu);
+
 /*
  * dfu_defer_flush - pointer to store dfu_entity for deferred flashing.
  *                  It should be NULL when not used.
@@ -245,6 +289,33 @@ static inline int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr,
 }
 #endif
 
+#if CONFIG_IS_ENABLED(DFU_MTD)
+int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr, char *s);
+#else
+static inline int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr,
+                                     char *s)
+{
+       puts("MTD support not available!\n");
+       return -1;
+}
+#endif
+
+#ifdef CONFIG_DFU_VIRT
+int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr, char *s);
+int dfu_write_medium_virt(struct dfu_entity *dfu, u64 offset,
+                         void *buf, long *len);
+int dfu_get_medium_size_virt(struct dfu_entity *dfu, u64 *size);
+int dfu_read_medium_virt(struct dfu_entity *dfu, u64 offset,
+                        void *buf, long *len);
+#else
+static inline int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr,
+                                      char *s)
+{
+       puts("VIRT support not available!\n");
+       return -1;
+}
+#endif
+
 /**
  * dfu_tftp_write - Write TFTP data to DFU medium
  *
index 33dcbee53bea9e3cccc587c0a36e35c5efd4cc50..8e8cd2cc1a555ef124c21b6778020e1c32ebd19b 100644 (file)
 #define BLKATTR_SIZE(x)        (x & 0x1fff)
 #define MAX_BLK_CNT    0x7fff  /* so malloc will have enough room with 32M */
 
-#define ESDHC_HOSTCAPBLT_VS18  0x04000000
-#define ESDHC_HOSTCAPBLT_VS30  0x02000000
-#define ESDHC_HOSTCAPBLT_VS33  0x01000000
-#define ESDHC_HOSTCAPBLT_SRS   0x00800000
-#define ESDHC_HOSTCAPBLT_DMAS  0x00400000
-#define ESDHC_HOSTCAPBLT_HSS   0x00200000
+/* Host controller capabilities register */
+#define HOSTCAPBLT_VS18                0x04000000
+#define HOSTCAPBLT_VS30                0x02000000
+#define HOSTCAPBLT_VS33                0x01000000
+#define HOSTCAPBLT_SRS         0x00800000
+#define HOSTCAPBLT_DMAS                0x00400000
+#define HOSTCAPBLT_HSS         0x00200000
 
 struct fsl_esdhc_cfg {
        phys_addr_t esdhc_base;
        u32     sdhc_clk;
        u8      max_bus_width;
-       int     wp_enable;
        int     vs18_enable; /* Use 1.8V if set to 1 */
        struct mmc_config cfg;
 };
index be08a2b88b122e49fb724d00e24eeb00d51989b9..c0d2c7e8667921727be914d2cb42f29eba37240e 100644 (file)
@@ -93,8 +93,7 @@ typedef struct ccsr_sec {
        struct {
                u32     ms;     /* DECO LIODN Register, MS */
                u32     ls;     /* DECO LIODN Register, LS */
-       } decoliodnr[8];
-       u8      res4[0x40];
+       } decoliodnr[16];
        u32     dar;            /* DECO Avail Register */
        u32     drr;            /* DECO Reset Register */
        u8      res5[0x4d8];
diff --git a/include/k3-avs.h b/include/k3-avs.h
new file mode 100644 (file)
index 0000000..e3c3caf
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Texas Instruments' K3 Adaptive Voltage Scaling driver
+ *
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
+ *      Tero Kristo <t-kristo@ti.com>
+ *
+ */
+
+#ifndef _K3_AVS0_
+#define _K3_AVS0_
+
+#define AM6_VDD_WKUP           0
+#define AM6_VDD_MCU            1
+#define AM6_VDD_CORE           2
+#define AM6_VDD_MPU0           3
+#define AM6_VDD_MPU1           4
+
+#define J721E_VDD_MPU          2
+
+#define NUM_OPPS               4
+
+#define AM6_OPP_NOM            1
+#define AM6_OPP_OD             2
+#define AM6_OPP_TURBO          3
+
+int k3_avs_set_opp(struct udevice *dev, int vdd_id, int opp_id);
+int k3_avs_notify_freq(int dev_id, int clk_id, u32 freq);
+
+#endif
index 4a54ae050912a718fe147d5c95a16662d35986b2..fbbb67c8b24e2af0a10f959be081700744f1e893 100644 (file)
@@ -20,4 +20,65 @@ static inline void bitmap_zero(unsigned long *dst, int nbits)
        }
 }
 
+static inline unsigned long
+find_next_bit(const unsigned long *addr, unsigned long size,
+             unsigned long offset)
+{
+       const unsigned long *p = addr + BIT_WORD(offset);
+       unsigned long result = offset & ~(BITS_PER_LONG - 1);
+       unsigned long tmp;
+
+       if (offset >= size)
+               return size;
+       size -= result;
+       offset %= BITS_PER_LONG;
+       if (offset) {
+               tmp = *(p++);
+               tmp &= (~0UL << offset);
+               if (size < BITS_PER_LONG)
+                       goto found_first;
+               if (tmp)
+                       goto found_middle;
+               size -= BITS_PER_LONG;
+               result += BITS_PER_LONG;
+       }
+       while (size & ~(BITS_PER_LONG - 1)) {
+               tmp = *(p++);
+               if ((tmp))
+                       goto found_middle;
+               result += BITS_PER_LONG;
+               size -= BITS_PER_LONG;
+       }
+       if (!size)
+               return result;
+       tmp = *p;
+
+found_first:
+       tmp &= (~0UL >> (BITS_PER_LONG - size));
+       if (tmp == 0UL)         /* Are any bits set? */
+               return result + size;   /* Nope. */
+found_middle:
+       return result + __ffs(tmp);
+}
+
+/*
+ * Find the first set bit in a memory region.
+ */
+static inline unsigned long find_first_bit(const unsigned long *addr, unsigned long size)
+{
+       unsigned long idx;
+
+       for (idx = 0; idx * BITS_PER_LONG < size; idx++) {
+               if (addr[idx])
+                       return min(idx * BITS_PER_LONG + __ffs(addr[idx]), size);
+       }
+
+       return size;
+}
+
+#define for_each_set_bit(bit, addr, size) \
+       for ((bit) = find_first_bit((addr), (size));            \
+            (bit) < (size);                                    \
+            (bit) = find_next_bit((addr), (size), (bit) + 1))
+
 #endif /* __LINUX_BITMAP_H */
index 22e5756eddc25865fc594c12c979319b16d68829..5ede82432d2d26efeb0d402482f6483202db152d 100644 (file)
 
 static inline void *ERR_PTR(long error)
 {
-       return (void *) error;
+       return (void *)(CONFIG_ERR_PTR_OFFSET + error);
 }
 
 static inline long PTR_ERR(const void *ptr)
 {
-       return (long) ptr;
+       return ((long)ptr - CONFIG_ERR_PTR_OFFSET);
 }
 
 static inline long IS_ERR(const void *ptr)
 {
-       return IS_ERR_VALUE((unsigned long)ptr);
+       return IS_ERR_VALUE((unsigned long)PTR_ERR(ptr));
 }
 
 static inline bool IS_ERR_OR_NULL(const void *ptr)
 {
-       return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+       return !ptr || IS_ERR_VALUE((unsigned long)PTR_ERR(ptr));
 }
 
 /**
index a85c15d8dc28d31e7a1b7be06ac1b61d1f84f419..5c7e5f635b1a1e030907c2776a6254cad0c2682a 100644 (file)
@@ -37,6 +37,8 @@
 #define UINT32_MAX     U32_MAX
 #define UINT64_MAX     U64_MAX
 
+#define INT32_MAX      S32_MAX
+
 #define STACK_MAGIC    0xdeadbeef
 
 #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
index e49fcd72bd60d3d54ab1314257c2e94ce2fbcc13..148b908e2ecc14c7b5a75331d2f51b8da7dbb2b5 100644 (file)
@@ -10,6 +10,7 @@
 #define LIBFDT_ENV_H
 
 #include <linux/string.h>
+#include <linux/kernel.h>
 
 #include <asm/byteorder.h>
 
index 5b8d1df5dfee9d3dd59d69aeffa0a9e799306c53..f62afa092c630bbd79e7f585a441dc6618a5c9b5 100644 (file)
@@ -348,6 +348,20 @@ static inline void list_splice_tail_init(struct list_head *list,
 #define list_last_entry(ptr, type, member) \
        list_entry((ptr)->prev, type, member)
 
+/**
+ * list_first_entry_or_null - get the first element from a list
+ * @ptr:       the list head to take the element from.
+ * @type:      the type of the struct this is embedded in.
+ * @member:    the name of the list_head within the struct.
+ *
+ * Note that if the list is empty, it returns NULL.
+ */
+#define list_first_entry_or_null(ptr, type, member) ({ \
+       struct list_head *head__ = (ptr); \
+       struct list_head *pos__ = READ_ONCE(head__->next); \
+       pos__ != head__ ? list_entry(pos__, type, member) : NULL; \
+})
+
 /**
  * list_for_each       -       iterate over a list
  * @pos:       the &struct list_head to use as a loop cursor.
index 264c9712a33a68996de6fd2bb445b278e9f68a81..989a5fcbd96668dddac062faa7bec07a0906854a 100644 (file)
@@ -878,6 +878,9 @@ struct usb_ss_cap_descriptor {              /* Link Power Management */
        __le16 bU2DevExitLat;
 } __attribute__((packed));
 
+#define USB_DEFAULT_U1_DEV_EXIT_LAT     0x01   /* Less then 1 microsec */
+#define USB_DEFAULT_U2_DEV_EXIT_LAT     0x01F4 /* Less then 500 microsec */
+
 #define USB_DT_USB_SS_CAP_SIZE 10
 
 /*
index 497798a32a8739b807dc744131ef6a1a1cd900c3..06292ddeb624b9e4b0ce0e32a8c6618f9c4e8617 100644 (file)
@@ -129,11 +129,30 @@ struct usb_ep_ops {
        void (*fifo_flush) (struct usb_ep *ep);
 };
 
+/**
+ * struct usb_ep_caps - endpoint capabilities description
+ * @type_control:Endpoint supports control type (reserved for ep0).
+ * @type_iso:Endpoint supports isochronous transfers.
+ * @type_bulk:Endpoint supports bulk transfers.
+ * @type_int:Endpoint supports interrupt transfers.
+ * @dir_in:Endpoint supports IN direction.
+ * @dir_out:Endpoint supports OUT direction.
+ */
+struct usb_ep_caps {
+       unsigned type_control:1;
+       unsigned type_iso:1;
+       unsigned type_bulk:1;
+       unsigned type_int:1;
+       unsigned dir_in:1;
+       unsigned dir_out:1;
+};
+
 /**
  * struct usb_ep - device side representation of USB endpoint
  * @name:identifier for the endpoint, such as "ep-a" or "ep9in-bulk"
  * @ops: Function pointers used to access hardware-specific operations.
  * @ep_list:the gadget's ep_list holds all of its endpoints
+ * @caps:The structure describing types and directions supported by endoint.
  * @maxpacket:The maximum packet size used on this endpoint.  The initial
  *     value can sometimes be reduced (hardware allowing), according to
  *      the endpoint descriptor used to configure the endpoint.
@@ -159,6 +178,7 @@ struct usb_ep {
        const char              *name;
        const struct usb_ep_ops *ops;
        struct list_head        ep_list;
+       struct usb_ep_caps      caps;
        unsigned                maxpacket:16;
        unsigned                maxpacket_limit:16;
        unsigned                max_streams:16;
@@ -447,6 +467,11 @@ struct usb_gadget_ops {
        int     (*udc_start)(struct usb_gadget *,
                             struct usb_gadget_driver *);
        int     (*udc_stop)(struct usb_gadget *);
+       struct usb_ep *(*match_ep)(struct usb_gadget *,
+                       struct usb_endpoint_descriptor *,
+                       struct usb_ss_ep_comp_descriptor *);
+       void    (*udc_set_speed)(struct usb_gadget *gadget,
+                                enum usb_device_speed);
 };
 
 /**
@@ -566,6 +591,15 @@ static inline int gadget_is_otg(struct usb_gadget *g)
 #endif
 }
 
+/**
+ * gadget_is_superspeed() - return true if the hardware handles superspeed
+ * @g: controller that might support superspeed
+ */
+static inline int gadget_is_superspeed(struct usb_gadget *g)
+{
+       return g->max_speed >= USB_SPEED_SUPER;
+}
+
 /**
  * usb_gadget_frame_number - returns the current frame number
  * @gadget: controller that reports the frame number
index 6c6e2cd4f99635611c0bc19f8969ebfa268f762c..74938dd61e49287e378902c5f4a20b2f2306023d 100644 (file)
@@ -168,6 +168,7 @@ struct dm_regulator_uclass_platdata {
        int mode_count;
        int min_uV;
        int max_uV;
+       int init_uV;
        int min_uA;
        int max_uA;
        unsigned int ramp_delay;
@@ -177,6 +178,8 @@ struct dm_regulator_uclass_platdata {
        int flags;
        u8 ctrl_reg;
        u8 volt_reg;
+       bool suspend_on;
+       u32 suspend_uV;
 };
 
 /* Regulator device operations */
@@ -193,6 +196,19 @@ struct dm_regulator_ops {
        int (*get_value)(struct udevice *dev);
        int (*set_value)(struct udevice *dev, int uV);
 
+       /**
+        * The regulator suspend output value function calls operates
+        * on a micro Volts.
+        *
+        * get/set_suspen_value - get/set suspend mode output value
+        * @dev          - regulator device
+        * Sets:
+        * @uV           - set the suspend output value [micro Volts]
+        * @return output value [uV] on success or negative errno if fail.
+        */
+       int (*set_suspend_value)(struct udevice *dev, int uV);
+       int (*get_suspend_value)(struct udevice *dev);
+
        /**
         * The regulator output current function calls operates on a micro Amps.
         *
@@ -217,6 +233,19 @@ struct dm_regulator_ops {
        int (*get_enable)(struct udevice *dev);
        int (*set_enable)(struct udevice *dev, bool enable);
 
+       /**
+        * The most basic feature of the regulator output is its enable state
+        * in suspend mode.
+        *
+        * get/set_suspend_enable - get/set enable state of the suspend output
+        * @dev           - regulator device
+        * Sets:
+        * @enable         - set true - enable or false - disable
+        * @return true/false for get or -errno if fail; 0 / -errno for set.
+        */
+       int (*set_suspend_enable)(struct udevice *dev, bool enable);
+       int (*get_suspend_enable)(struct udevice *dev);
+
        /**
         * The 'get/set_mode()' function calls should operate on a driver-
         * specific mode id definitions, which should be found in:
@@ -261,6 +290,23 @@ int regulator_get_value(struct udevice *dev);
  */
 int regulator_set_value(struct udevice *dev, int uV);
 
+/**
+ * regulator_set_suspend_value: set the suspend microvoltage value of a given regulator.
+ *
+ * @dev    - pointer to the regulator device
+ * @uV     - the output suspend value to set [micro Volts]
+ * @return - 0 on success or -errno val if fails
+ */
+int regulator_set_suspend_value(struct udevice *dev, int uV);
+
+/**
+ * regulator_get_suspend_value: get the suspend microvoltage value of a given regulator.
+ *
+ * @dev    - pointer to the regulator device
+ * @return - positive output value [uV] on success or negative errno if fail.
+ */
+int regulator_get_suspend_value(struct udevice *dev);
+
 /**
  * regulator_set_value_force: set the microvoltage value of a given regulator
  *                           without any min-,max condition check
@@ -316,6 +362,23 @@ int regulator_set_enable(struct udevice *dev, bool enable);
  */
 int regulator_set_enable_if_allowed(struct udevice *dev, bool enable);
 
+/**
+ * regulator_set_suspend_enable: set regulator suspend enable state
+ *
+ * @dev    - pointer to the regulator device
+ * @enable - set true or false
+ * @return - 0 on success or -errno val if fails
+ */
+int regulator_set_suspend_enable(struct udevice *dev, bool enable);
+
+/**
+ * regulator_get_suspend_enable: get regulator suspend enable state
+ *
+ * @dev    - pointer to the regulator device
+ * @return - true/false of enable state or -errno val if fails
+ */
+int regulator_get_suspend_enable(struct udevice *dev);
+
 /**
  * regulator_get_mode: get active operation mode id of a given regulator
  *
index c06248f75183804965c3242a23cddf77b4eb600e..8ff0af35c57a0ca53b903cada2ef78a5b0dfbdcf 100644 (file)
@@ -169,14 +169,56 @@ enum {
        RK808_NUM_OF_REGS,
 };
 
+enum {
+       RK817_REG_SYS_CFG3 = 0xf4,
+};
+
+enum {
+       RK816_REG_DCDC_EN1 = 0x23,
+       RK816_REG_DCDC_EN2,
+       RK816_REG_DCDC_SLP_EN,
+       RK816_REG_LDO_SLP_EN,
+       RK816_REG_LDO_EN1 = 0x27,
+       RK816_REG_LDO_EN2,
+};
+
 enum {
        RK805_ID = 0x8050,
        RK808_ID = 0x0000,
+       RK809_ID = 0x8090,
+       RK816_ID = 0x8160,
+       RK817_ID = 0x8170,
        RK818_ID = 0x8180,
 };
 
+enum {
+       RK817_POWER_EN0 = 0xb1,
+       RK817_POWER_EN1,
+       RK817_POWER_EN2,
+       RK817_POWER_EN3,
+};
+
+#define RK817_POWER_EN_SAVE0   0x99
+#define RK817_POWER_EN_SAVE1   0xa4
+
+#define RK817_ID_MSB   0xed
+#define RK817_ID_LSB   0xee
 #define RK8XX_ID_MSK   0xfff0
 
+#define RK817_PMIC_SYS_CFG3    0xf4
+#define RK817_GPIO_INT_CFG     0xfe
+
+#define RK8XX_ON_SOURCE                0xae
+#define RK8XX_OFF_SOURCE       0xaf
+#define RK817_BUCK4_CMIN       0xc6
+#define RK817_ON_SOURCE                0xf5
+#define RK817_OFF_SOURCE       0xf6
+
+struct reg_data {
+       u8 reg;
+       u8 val;
+       u8 mask;
+};
 struct rk8xx_reg_table {
        char *name;
        u8 reg_ctl;
diff --git a/include/power/tps65941.h b/include/power/tps65941.h
new file mode 100644 (file)
index 0000000..2d48b31
--- /dev/null
@@ -0,0 +1,26 @@
+#define        TPS659411               0x0
+#define TPS659412              0x1
+#define TPS659413              0x2
+#define TPS659414              0x3
+
+/* I2C device address for pmic tps65941 */
+#define TPS65941_I2C_ADDR      (0x12 >> 1)
+#define TPS65941_LDO_NUM               4
+#define TPS65941_BUCK_NUM              5
+
+/* Drivers name */
+#define TPS65941_LDO_DRIVER            "tps65941_ldo"
+#define TPS65941_BUCK_DRIVER           "tps65941_buck"
+
+#define TPS65941_BUCK_VOLT_MASK                0xFF
+#define TPS65941_BUCK_VOLT_MAX_HEX     0xFF
+#define TPS65941_BUCK_VOLT_MAX         3340000
+#define TPS65941_BUCK_MODE_MASK                0x1
+
+#define TPS65941_LDO_VOLT_MASK         0x3E
+#define TPS65941_LDO_VOLT_MAX_HEX      0x3A
+#define TPS65941_LDO_VOLT_MIN_HEX      0x4
+#define TPS65941_LDO_VOLT_MAX          3300000
+#define TPS65941_LDO_MODE_MASK         0x1
+#define TPS65941_LDO_BYPASS_EN         0x80
+#define TP65941_BUCK_CONF_SLEW_MASK    0x7
index 135f0b372b074270beab7450a542edeeef94124f..b8a8509d720faa45ca569c1233a5c7ff8ef4c5d3 100644 (file)
@@ -464,6 +464,17 @@ config OF_LIBFDT
          particular compatible nodes. The library operates on a flattened
          version of the device tree.
 
+config OF_LIBFDT_ASSUME_MASK
+       hex "Mask of conditions to assume for libfdt"
+       depends on OF_LIBFDT || FIT
+       default 0
+       help
+         Use this to change the assumptions made by libfdt about the
+         device tree it is working with. A value of 0 means that no assumptions
+         are made, and libfdt is able to deal with malicious data. A value of
+         0xff means all assumptions are made and any invalid data may cause
+         unsafe execution. See FDT_ASSUME_PERFECT, etc. in libfdt_internal.h
+
 config OF_LIBFDT_OVERLAY
        bool "Enable the FDT library overlay support"
        depends on OF_LIBFDT
@@ -481,6 +492,17 @@ config SPL_OF_LIBFDT
          particular compatible nodes. The library operates on a flattened
          version of the device tree.
 
+config SPL_OF_LIBFDT_ASSUME_MASK
+       hex "Mask of conditions to assume for libfdt"
+       depends on SPL_OF_LIBFDT || FIT
+       default 0xff
+       help
+         Use this to change the assumptions made by libfdt in SPL about the
+         device tree it is working with. A value of 0 means that no assumptions
+         are made, and libfdt is able to deal with malicious data. A value of
+         0xff means all assumptions are made and any invalid data may cause
+         unsafe execution. See FDT_ASSUME_PERFECT, etc. in libfdt_internal.h
+
 config TPL_OF_LIBFDT
        bool "Enable the FDT library for TPL"
        default y if TPL_OF_CONTROL
@@ -491,6 +513,17 @@ config TPL_OF_LIBFDT
          particular compatible nodes. The library operates on a flattened
          version of the device tree.
 
+config TPL_OF_LIBFDT_ASSUME_MASK
+       hex "Mask of conditions to assume for libfdt"
+       depends on TPL_OF_LIBFDT || FIT
+       default 0xff
+       help
+         Use this to change the assumptions made by libfdt in TPL about the
+         device tree it is working with. A value of 0 means that no assumptions
+         are made, and libfdt is able to deal with malicious data. A value of
+         0xff means all assumptions are made and any invalid data may cause
+         unsafe execution. See FDT_ASSUME_PERFECT, etc. in libfdt_internal.h
+
 config FDT_FIXUP_PARTITIONS
        bool "overwrite MTD partitions in DTS through defined in 'mtdparts'"
        depends on OF_LIBFDT
index ef5b6e29d46afaa5f27497d9d5be0497243bf2f7..5d3ae4e2f138dd669ea19f765f6361ab5475e167 100644 (file)
@@ -22,4 +22,5 @@ obj-y += fdt_ro.o
 # U-Boot own file
 obj-y += fdt_region.o
 
-ccflags-y := -I$(srctree)/scripts/dtc/libfdt
+ccflags-y := -I$(srctree)/scripts/dtc/libfdt \
+       -DFDT_ASSUME_MASK=$(CONFIG_$(SPL_TPL_)OF_LIBFDT_ASSUME_MASK)
index 693de9aa5ad8032375b22749a25bc236dc15d950..560041b603e1a7a1928a5816bf76dc91bed38122 100644 (file)
 
 #include "libfdt_internal.h"
 
-static int _fdt_nodename_eq(const void *fdt, int offset,
+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);
+       int olen;
+       const char *p = fdt_get_name(fdt, offset, &olen);
 
-       if (!p)
+       if (!p || (fdt_chk_extra() && olen < len))
                /* short match */
                return 0;
 
@@ -34,46 +35,85 @@ static int _fdt_nodename_eq(const void *fdt, int offset,
                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 *fdt_get_string(const void *fdt, int stroffset, int *lenp)
 {
-       const char *p = fdt_string(fdt, stroffset);
+       int32_t totalsize;
+       uint32_t absoffset;
+       size_t len;
+       int err;
+       const char *s, *n;
 
-       return (strnlen(p, len + 1) == len) && (memcmp(p, s, len) == 0);
-}
+       if (!fdt_chk_extra()) {
+               s = (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
 
-uint32_t fdt_get_max_phandle(const void *fdt)
-{
-       uint32_t max_phandle = 0;
-       int offset;
+               if (lenp)
+                       *lenp = strlen(s);
+               return s;
+       }
+       totalsize = fdt_ro_probe_(fdt);
+       err = totalsize;
+       if (totalsize < 0)
+               goto fail;
+
+       err = -FDT_ERR_BADOFFSET;
+       absoffset = stroffset + fdt_off_dt_strings(fdt);
+       if (absoffset >= totalsize)
+               goto fail;
+       len = totalsize - absoffset;
+
+       if (fdt_magic(fdt) == FDT_MAGIC) {
+               if (stroffset < 0)
+                       goto fail;
+               if (!fdt_chk_version() || fdt_version(fdt) >= 17) {
+                       if (stroffset >= fdt_size_dt_strings(fdt))
+                               goto fail;
+                       if ((fdt_size_dt_strings(fdt) - stroffset) < len)
+                               len = fdt_size_dt_strings(fdt) - stroffset;
+               }
+       } else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
+               if ((stroffset >= 0)
+                   || (stroffset < -fdt_size_dt_strings(fdt)))
+                       goto fail;
+               if ((-stroffset) < len)
+                       len = -stroffset;
+       } else {
+               err = -FDT_ERR_INTERNAL;
+               goto fail;
+       }
 
-       for (offset = fdt_next_node(fdt, -1, NULL);;
-            offset = fdt_next_node(fdt, offset, NULL)) {
-               uint32_t phandle;
+       s = (const char *)fdt + absoffset;
+       n = memchr(s, '\0', len);
+       if (!n) {
+               /* missing terminating NULL */
+               err = -FDT_ERR_TRUNCATED;
+               goto fail;
+       }
 
-               if (offset == -FDT_ERR_NOTFOUND)
-                       return max_phandle;
+       if (lenp)
+               *lenp = n - s;
+       return s;
 
-               if (offset < 0)
-                       return (uint32_t)-1;
+fail:
+       if (lenp)
+               *lenp = err;
+       return NULL;
+}
 
-               phandle = fdt_get_phandle(fdt, offset);
-               if (phandle == (uint32_t)-1)
-                       continue;
+const char *fdt_string(const void *fdt, int stroffset)
+{
+       return fdt_get_string(fdt, stroffset, NULL);
+}
 
-               if (phandle > max_phandle)
-                       max_phandle = phandle;
-       }
+static int fdt_string_eq_(const void *fdt, int stroffset,
+                         const char *s, int len)
+{
+       int slen;
+       const char *p = fdt_get_string(fdt, stroffset, &slen);
 
-       return 0;
+       return p && (slen == len) && (memcmp(p, s, len) == 0);
 }
 
-int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
+int fdt_find_max_phandle(const void *fdt, uint32_t *phandle)
 {
        uint32_t max = 0;
        int offset = -1;
@@ -95,6 +135,21 @@ int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
                        max = value;
        }
 
+       if (phandle)
+               *phandle = max;
+
+       return 0;
+}
+
+int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
+{
+       uint32_t max;
+       int err;
+
+       err = fdt_find_max_phandle(fdt, &max);
+       if (err < 0)
+               return err;
+
        if (max == FDT_MAX_PHANDLE)
                return -FDT_ERR_NOPHANDLES;
 
@@ -104,24 +159,48 @@ int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
        return 0;
 }
 
+static const struct fdt_reserve_entry *fdt_mem_rsv(const void *fdt, int n)
+{
+       int offset = n * sizeof(struct fdt_reserve_entry);
+       int absoffset = fdt_off_mem_rsvmap(fdt) + offset;
+
+       if (fdt_chk_extra()) {
+               if (absoffset < fdt_off_mem_rsvmap(fdt))
+                       return NULL;
+               if (absoffset > fdt_totalsize(fdt) -
+                   sizeof(struct fdt_reserve_entry))
+                       return NULL;
+       }
+       return fdt_mem_rsv_(fdt, n);
+}
+
 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);
+       const struct fdt_reserve_entry *re;
+
+       FDT_RO_PROBE(fdt);
+       re = fdt_mem_rsv(fdt, n);
+       if (fdt_chk_extra() && !re)
+               return -FDT_ERR_BADOFFSET;
+
+       *address = fdt64_ld(&re->address);
+       *size = fdt64_ld(&re->size);
        return 0;
 }
 
 int fdt_num_mem_rsv(const void *fdt)
 {
-       int i = 0;
+       int i;
+       const struct fdt_reserve_entry *re;
 
-       while (fdt64_to_cpu(fdt_mem_rsv_(fdt, i)->size) != 0)
-               i++;
-       return i;
+       for (i = 0; (re = fdt_mem_rsv(fdt, i)) != NULL; i++) {
+               if (fdt64_ld(&re->size) == 0)
+                       return i;
+       }
+       return -FDT_ERR_TRUNCATED;
 }
 
-static int _nextprop(const void *fdt, int offset)
+static int nextprop_(const void *fdt, int offset)
 {
        uint32_t tag;
        int nextoffset;
@@ -150,13 +229,13 @@ int fdt_subnode_offset_namelen(const void *fdt, int offset,
 {
        int depth;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(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))
+                   && fdt_nodename_eq_(fdt, offset, name, namelen))
                        return offset;
 
        if (depth < 0)
@@ -170,36 +249,17 @@ int fdt_subnode_offset(const void *fdt, int parentoffset,
        return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
 }
 
-/*
- * Find the next of path separator, note we need to search for both '/' and ':'
- * and then take the first one so that we do the right thing for e.g.
- * "foo/bar:option" and "bar:option/otheroption", both of which happen, so
- * first searching for either ':' or '/' does not work.
- */
-static const char *fdt_path_next_separator(const char *path, int len)
-{
-       const void *sep1 = memchr(path, '/', len);
-       const void *sep2 = memchr(path, ':', len);
-
-       if (sep1 && sep2)
-               return (sep1 < sep2) ? sep1 : sep2;
-       else if (sep1)
-               return sep1;
-       else
-               return sep2;
-}
-
 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);
+       FDT_RO_PROBE(fdt);
 
        /* see if we have an alias */
        if (*path != '/') {
-               const char *q = fdt_path_next_separator(path, namelen);
+               const char *q = memchr(path, '/', end - p);
 
                if (!q)
                        q = end;
@@ -212,17 +272,16 @@ int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen)
                p = q;
        }
 
-       while (*p && (p < end)) {
+       while (p < end) {
                const char *q;
 
-               while (*p == '/')
+               while (*p == '/') {
                        p++;
-
-               if (*p == '\0' || *p == ':')
-                       return offset;
-
-               q = fdt_path_next_separator(p, end - p);
-               if (!q)
+                       if (p == end)
+                               return offset;
+               }
+               q = memchr(p, '/', end - p);
+               if (! q)
                        q = end;
 
                offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
@@ -243,16 +302,35 @@ int fdt_path_offset(const void *fdt, const char *path)
 const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
 {
        const struct fdt_node_header *nh = fdt_offset_ptr_(fdt, nodeoffset);
+       const char *nameptr;
        int err;
 
-       if (((err = fdt_check_header(fdt)) != 0)
-           || ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0))
+       if (fdt_chk_extra() &&
+           (((err = fdt_ro_probe_(fdt)) < 0)
+            || ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0)))
+               goto fail;
+
+       nameptr = nh->name;
+
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10) {
+               /*
+                * For old FDT versions, match the naming conventions of V16:
+                * give only the leaf name (after all /). The actual tree
+                * contents are loosely checked.
+                */
+               const char *leaf;
+               leaf = strrchr(nameptr, '/');
+               if (leaf == NULL) {
+                       err = -FDT_ERR_BADSTRUCTURE;
                        goto fail;
+               }
+               nameptr = leaf+1;
+       }
 
        if (len)
-               *len = strlen(nh->name);
+               *len = strlen(nameptr);
 
-       return nh->name;
+       return nameptr;
 
  fail:
        if (len)
@@ -267,7 +345,7 @@ int fdt_first_property_offset(const void *fdt, int nodeoffset)
        if ((offset = fdt_check_node_offset_(fdt, nodeoffset)) < 0)
                return offset;
 
-       return _nextprop(fdt, offset);
+       return nextprop_(fdt, offset);
 }
 
 int fdt_next_property_offset(const void *fdt, int offset)
@@ -275,17 +353,17 @@ 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);
+       return nextprop_(fdt, offset);
 }
 
-const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
-                                                     int offset,
-                                                     int *lenp)
+static 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 (fdt_chk_basic() && (err = fdt_check_prop_offset_(fdt, offset)) < 0) {
                if (lenp)
                        *lenp = err;
                return NULL;
@@ -294,28 +372,50 @@ const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
        prop = fdt_offset_ptr_(fdt, offset);
 
        if (lenp)
-               *lenp = fdt32_to_cpu(prop->len);
+               *lenp = fdt32_ld(&prop->len);
 
        return prop;
 }
 
-const struct fdt_property *fdt_get_property_namelen(const void *fdt,
-                                                   int offset,
-                                                   const char *name,
-                                                   int namelen, int *lenp)
+const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
+                                                     int offset,
+                                                     int *lenp)
+{
+       /* Prior to version 16, properties may need realignment
+        * and this API does not work. fdt_getprop_*() will, however. */
+
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10) {
+               if (lenp)
+                       *lenp = -FDT_ERR_BADVERSION;
+               return NULL;
+       }
+
+       return fdt_get_property_by_offset_(fdt, offset, lenp);
+}
+
+static const struct fdt_property *fdt_get_property_namelen_(const void *fdt,
+                                                           int offset,
+                                                           const char *name,
+                                                           int namelen,
+                                                           int *lenp,
+                                                           int *poffset)
 {
        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))) {
+               prop = fdt_get_property_by_offset_(fdt, offset, lenp);
+               if (fdt_chk_extra() && !prop) {
                        offset = -FDT_ERR_INTERNAL;
                        break;
                }
-               if (_fdt_string_eq(fdt, fdt32_to_cpu(prop->nameoff),
-                                  name, namelen))
+               if (fdt_string_eq_(fdt, fdt32_ld(&prop->nameoff),
+                                  name, namelen)) {
+                       if (poffset)
+                               *poffset = offset;
                        return prop;
+               }
        }
 
        if (lenp)
@@ -323,6 +423,25 @@ const struct fdt_property *fdt_get_property_namelen(const void *fdt,
        return NULL;
 }
 
+
+const struct fdt_property *fdt_get_property_namelen(const void *fdt,
+                                                   int offset,
+                                                   const char *name,
+                                                   int namelen, int *lenp)
+{
+       /* Prior to version 16, properties may need realignment
+        * and this API does not work. fdt_getprop_*() will, however. */
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10) {
+               if (lenp)
+                       *lenp = -FDT_ERR_BADVERSION;
+               return NULL;
+       }
+
+       return fdt_get_property_namelen_(fdt, offset, name, namelen, lenp,
+                                        NULL);
+}
+
+
 const struct fdt_property *fdt_get_property(const void *fdt,
                                            int nodeoffset,
                                            const char *name, int *lenp)
@@ -334,12 +453,18 @@ const struct fdt_property *fdt_get_property(const void *fdt,
 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
                                const char *name, int namelen, int *lenp)
 {
+       int poffset;
        const struct fdt_property *prop;
 
-       prop = fdt_get_property_namelen(fdt, nodeoffset, name, namelen, lenp);
+       prop = fdt_get_property_namelen_(fdt, nodeoffset, name, namelen, lenp,
+                                        &poffset);
        if (!prop)
                return NULL;
 
+       /* Handle realignment */
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10 &&
+           (poffset + sizeof(*prop)) % 8 && fdt32_ld(&prop->len) >= 8)
+               return prop->data + 4;
        return prop->data;
 }
 
@@ -348,11 +473,31 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset,
 {
        const struct fdt_property *prop;
 
-       prop = fdt_get_property_by_offset(fdt, offset, lenp);
+       prop = fdt_get_property_by_offset_(fdt, offset, lenp);
        if (!prop)
                return NULL;
-       if (namep)
-               *namep = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
+       if (namep) {
+               const char *name;
+               int namelen;
+
+               if (fdt_chk_extra()) {
+                       name = fdt_get_string(fdt, fdt32_ld(&prop->nameoff),
+                                             &namelen);
+                       if (!name) {
+                               if (lenp)
+                                       *lenp = namelen;
+                               return NULL;
+                       }
+                       *namep = name;
+               } else {
+                       *namep = fdt_string(fdt, fdt32_ld(&prop->nameoff));
+               }
+       }
+
+       /* Handle realignment */
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10 &&
+           (offset + sizeof(*prop)) % 8 && fdt32_ld(&prop->len) >= 8)
+               return prop->data + 4;
        return prop->data;
 }
 
@@ -376,7 +521,7 @@ uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
                        return 0;
        }
 
-       return fdt32_to_cpu(*php);
+       return fdt32_ld(php);
 }
 
 const char *fdt_get_alias_namelen(const void *fdt,
@@ -402,7 +547,7 @@ int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
        int offset, depth, namelen;
        const char *name;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        if (buflen < 2)
                return -FDT_ERR_NOSPACE;
@@ -454,7 +599,7 @@ int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
        int offset, depth;
        int supernodeoffset = -FDT_ERR_INTERNAL;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        if (supernodedepth < 0)
                return -FDT_ERR_NOTFOUND;
@@ -476,10 +621,12 @@ int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
                }
        }
 
-       if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
-               return -FDT_ERR_BADOFFSET;
-       else if (offset == -FDT_ERR_BADOFFSET)
-               return -FDT_ERR_BADSTRUCTURE;
+       if (fdt_chk_extra()) {
+               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() */
 }
@@ -491,7 +638,7 @@ int fdt_node_depth(const void *fdt, int nodeoffset)
 
        err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
        if (err)
-               return (err < 0) ? err : -FDT_ERR_INTERNAL;
+               return (!fdt_chk_extra() || err < 0) ? err : -FDT_ERR_INTERNAL;
        return nodedepth;
 }
 
@@ -513,7 +660,7 @@ int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
        const void *val;
        int len;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        /* FIXME: The algorithm here is pretty horrible: we scan each
         * property of a node in fdt_getprop(), then if that didn't
@@ -539,7 +686,7 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
        if ((phandle == 0) || (phandle == -1))
                return -FDT_ERR_BADPHANDLE;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        /* FIXME: The algorithm here is pretty horrible: we
         * potentially scan each property of a node in
@@ -692,7 +839,7 @@ int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
 {
        int offset, err;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        /* FIXME: The algorithm here is pretty horrible: we scan each
         * property of a node in fdt_node_check_compatible(), then if
@@ -711,3 +858,68 @@ int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
 
        return offset; /* error from fdt_next_node() */
 }
+
+#if !defined(CHECK_LEVEL) || CHECK_LEVEL > 0
+int fdt_check_full(const void *fdt, size_t bufsize)
+{
+       int err;
+       int num_memrsv;
+       int offset, nextoffset = 0;
+       uint32_t tag;
+       unsigned depth = 0;
+       const void *prop;
+       const char *propname;
+
+       if (bufsize < FDT_V1_SIZE)
+               return -FDT_ERR_TRUNCATED;
+       err = fdt_check_header(fdt);
+       if (err != 0)
+               return err;
+       if (bufsize < fdt_totalsize(fdt))
+               return -FDT_ERR_TRUNCATED;
+
+       num_memrsv = fdt_num_mem_rsv(fdt);
+       if (num_memrsv < 0)
+               return num_memrsv;
+
+       while (1) {
+               offset = nextoffset;
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+
+               if (nextoffset < 0)
+                       return nextoffset;
+
+               switch (tag) {
+               case FDT_NOP:
+                       break;
+
+               case FDT_END:
+                       if (depth != 0)
+                               return -FDT_ERR_BADSTRUCTURE;
+                       return 0;
+
+               case FDT_BEGIN_NODE:
+                       depth++;
+                       if (depth > INT_MAX)
+                               return -FDT_ERR_BADSTRUCTURE;
+                       break;
+
+               case FDT_END_NODE:
+                       if (depth == 0)
+                               return -FDT_ERR_BADSTRUCTURE;
+                       depth--;
+                       break;
+
+               case FDT_PROP:
+                       prop = fdt_getprop_by_offset(fdt, offset, &propname,
+                                                    &err);
+                       if (!prop)
+                               return err;
+                       break;
+
+               default:
+                       return -FDT_ERR_INTERNAL;
+               }
+       }
+}
+#endif
index 0f3d89b215215619cfa000644e20fa83538d97b5..f8ce7da2d281438066a2dd690be8510f9ed32846 100644 (file)
@@ -88,6 +88,7 @@ endif
 
 libs-y += drivers/
 libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/dwc3/
+libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/cdns3/
 libs-y += dts/
 libs-y += fs/
 libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/
index 5402bc2f281971ae696163c7cf0c3fcb0da777ac..bbc1cb1033c9b2dd18a092ec29c086cdf7395453 100644 (file)
@@ -542,7 +542,6 @@ CONFIG_FEC_MXC_SWAP_PACKET
 CONFIG_FEC_XCV_TYPE
 CONFIG_FEROCEON
 CONFIG_FEROCEON_88FR131
-CONFIG_FFUART
 CONFIG_FILE
 CONFIG_FIRMWARE_OFFSET
 CONFIG_FIRMWARE_SIZE
@@ -2935,7 +2934,6 @@ CONFIG_SYS_I2C_SPEED2
 CONFIG_SYS_I2C_SPEED3
 CONFIG_SYS_I2C_TCA642X_ADDR
 CONFIG_SYS_I2C_TCA642X_BUS_NUM
-CONFIG_SYS_I2C_W83782G_ADDR
 CONFIG_SYS_IBAT
 CONFIG_SYS_IBAT0L
 CONFIG_SYS_IBAT0U
index 098b3f36e668f8024a639dea5fa5bb7f553fa028..e54639738c8e8f8e3087906f21b2527fb135c654 100644 (file)
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 # Makefile.libfdt
 #
 # This is not a complete Makefile of itself.  Instead, it is designed to
@@ -9,3 +10,9 @@ 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)
+LIBFDT_LIB = libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT)
+
+libfdt_clean:
+       @$(VECHO) CLEAN "(libfdt)"
+       rm -f $(STD_CLEANFILES:%=$(LIBFDT_dir)/%)
+       rm -f $(LIBFDT_dir)/$(LIBFDT_soname)
index 7855a1787763aa3d891f8f3799519ebb4be477dd..8e4cce3b9be28de9de0f0fb88536933780fe3703 100644 (file)
@@ -1,52 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
  * 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 "libfdt_internal.h"
 
-int fdt_check_header(const void *fdt)
+/*
+ * Minimal sanity check for a read-only tree. fdt_ro_probe_() checks
+ * that the given buffer contains what appears to be a flattened
+ * device tree with sane information in its header.
+ */
+int32_t fdt_ro_probe_(const void *fdt)
 {
+       uint32_t totalsize = fdt_totalsize(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;
+               if (fdt_chk_version()) {
+                       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)
@@ -71,6 +36,96 @@ int fdt_check_header(const void *fdt)
                return -FDT_ERR_BADMAGIC;
        }
 
+       if (totalsize < INT32_MAX)
+               return totalsize;
+       else
+               return -FDT_ERR_TRUNCATED;
+}
+
+static int check_off_(uint32_t hdrsize, uint32_t totalsize, uint32_t off)
+{
+       return (off >= hdrsize) && (off <= totalsize);
+}
+
+static int check_block_(uint32_t hdrsize, uint32_t totalsize,
+                       uint32_t base, uint32_t size)
+{
+       if (!check_off_(hdrsize, totalsize, base))
+               return 0; /* block start out of bounds */
+       if ((base + size) < base)
+               return 0; /* overflow */
+       if (!check_off_(hdrsize, totalsize, base + size))
+               return 0; /* block end out of bounds */
+       return 1;
+}
+
+size_t fdt_header_size_(uint32_t version)
+{
+       if (version <= 1)
+               return FDT_V1_SIZE;
+       else if (version <= 2)
+               return FDT_V2_SIZE;
+       else if (version <= 3)
+               return FDT_V3_SIZE;
+       else if (version <= 16)
+               return FDT_V16_SIZE;
+       else
+               return FDT_V17_SIZE;
+}
+
+size_t fdt_header_size(const void *fdt)
+{
+       return fdt_chk_version() ? fdt_header_size_(fdt_version(fdt)) :
+               FDT_V17_SIZE;
+}
+
+int fdt_check_header(const void *fdt)
+{
+       size_t hdrsize;
+
+       if (fdt_magic(fdt) != FDT_MAGIC)
+               return -FDT_ERR_BADMAGIC;
+       if (fdt_chk_version()) {
+               if ((fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
+                   || (fdt_last_comp_version(fdt) >
+                       FDT_LAST_SUPPORTED_VERSION))
+                       return -FDT_ERR_BADVERSION;
+               if (fdt_version(fdt) < fdt_last_comp_version(fdt))
+                       return -FDT_ERR_BADVERSION;
+       }
+       hdrsize = fdt_header_size(fdt);
+       if (fdt_chk_basic()) {
+
+               if ((fdt_totalsize(fdt) < hdrsize)
+                   || (fdt_totalsize(fdt) > INT_MAX))
+                       return -FDT_ERR_TRUNCATED;
+
+               /* Bounds check memrsv block */
+               if (!check_off_(hdrsize, fdt_totalsize(fdt),
+                               fdt_off_mem_rsvmap(fdt)))
+                       return -FDT_ERR_TRUNCATED;
+       }
+
+       if (fdt_chk_extra()) {
+               /* Bounds check structure block */
+               if (fdt_chk_version() && fdt_version(fdt) < 17) {
+                       if (!check_off_(hdrsize, fdt_totalsize(fdt),
+                                       fdt_off_dt_struct(fdt)))
+                               return -FDT_ERR_TRUNCATED;
+               } else {
+                       if (!check_block_(hdrsize, fdt_totalsize(fdt),
+                                         fdt_off_dt_struct(fdt),
+                                         fdt_size_dt_struct(fdt)))
+                               return -FDT_ERR_TRUNCATED;
+               }
+
+               /* Bounds check strings block */
+               if (!check_block_(hdrsize, fdt_totalsize(fdt),
+                                 fdt_off_dt_strings(fdt),
+                                 fdt_size_dt_strings(fdt)))
+                       return -FDT_ERR_TRUNCATED;
+       }
+
        return 0;
 }
 
@@ -78,12 +133,13 @@ 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_chk_basic())
+               if ((absoffset < offset)
+                   || ((absoffset + len) < absoffset)
+                   || (absoffset + len) > fdt_totalsize(fdt))
+                       return NULL;
 
-       if (fdt_version(fdt) >= 0x11)
+       if (!fdt_chk_version() || fdt_version(fdt) >= 0x11)
                if (((offset + len) < offset)
                    || ((offset + len) > fdt_size_dt_struct(fdt)))
                        return NULL;
@@ -100,7 +156,7 @@ uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
 
        *nextoffset = -FDT_ERR_TRUNCATED;
        tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
-       if (!tagp)
+       if (fdt_chk_basic() && !tagp)
                return FDT_END; /* premature end */
        tag = fdt32_to_cpu(*tagp);
        offset += FDT_TAGSIZE;
@@ -112,18 +168,19 @@ uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
                do {
                        p = fdt_offset_ptr(fdt, offset++, 1);
                } while (p && (*p != '\0'));
-               if (!p)
+               if (fdt_chk_basic() && !p)
                        return FDT_END; /* premature end */
                break;
 
        case FDT_PROP:
                lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
-               if (!lenp)
+               if (fdt_chk_basic() && !lenp)
                        return FDT_END; /* premature end */
                /* skip-name offset, length and value */
                offset += sizeof(struct fdt_property) - FDT_TAGSIZE
                        + fdt32_to_cpu(*lenp);
-               if (fdt_version(fdt) < 0x10 && fdt32_to_cpu(*lenp) >= 8 &&
+               if (fdt_chk_version() &&
+                   fdt_version(fdt) < 0x10 && fdt32_to_cpu(*lenp) >= 8 &&
                    ((offset - fdt32_to_cpu(*lenp)) % 8) != 0)
                        offset += 4;
                break;
@@ -137,7 +194,8 @@ uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
                return FDT_END;
        }
 
-       if (!fdt_offset_ptr(fdt, startoffset, offset - startoffset))
+       if (fdt_chk_basic() &&
+           !fdt_offset_ptr(fdt, startoffset, offset - startoffset))
                return FDT_END; /* premature end */
 
        *nextoffset = FDT_TAGALIGN(offset);
@@ -244,7 +302,7 @@ const char *fdt_find_string_(const char *strtab, int tabsize, const char *s)
 
 int fdt_move(const void *fdt, void *buf, int bufsize)
 {
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        if (fdt_totalsize(fdt) > bufsize)
                return -FDT_ERR_NOSPACE;
index 74961f9026d160650f68a5880c1a8a4d8b43c147..f2e68807f277c5009641c54f5198bebb7cb1c28f 100644 (file)
@@ -1,55 +1,10 @@
+/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
 #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__
index 788c14311369f99589f0203483941e000afb0eb4..9a82cd0ba2f9714c748d40ba75cd61cb6fe25005 100644 (file)
@@ -1,53 +1,8 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2014 David Gibson <david@gibson.dropbear.id.au>
  * Copyright (C) 2018 embedded brains GmbH
- *
- * 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"
 
@@ -97,3 +52,50 @@ int fdt_size_cells(const void *fdt, int nodeoffset)
                return 1;
        return val;
 }
+
+/* This function assumes that [address|size]_cells is 1 or 2 */
+int fdt_appendprop_addrrange(void *fdt, int parent, int nodeoffset,
+                            const char *name, uint64_t addr, uint64_t size)
+{
+       int addr_cells, size_cells, ret;
+       uint8_t data[sizeof(fdt64_t) * 2], *prop;
+
+       ret = fdt_address_cells(fdt, parent);
+       if (ret < 0)
+               return ret;
+       addr_cells = ret;
+
+       ret = fdt_size_cells(fdt, parent);
+       if (ret < 0)
+               return ret;
+       size_cells = ret;
+
+       /* check validity of address */
+       prop = data;
+       if (addr_cells == 1) {
+               if ((addr > UINT32_MAX) || ((UINT32_MAX + 1 - addr) < size))
+                       return -FDT_ERR_BADVALUE;
+
+               fdt32_st(prop, (uint32_t)addr);
+       } else if (addr_cells == 2) {
+               fdt64_st(prop, addr);
+       } else {
+               return -FDT_ERR_BADNCELLS;
+       }
+
+       /* check validity of size */
+       prop += addr_cells * sizeof(fdt32_t);
+       if (size_cells == 1) {
+               if (size > UINT32_MAX)
+                       return -FDT_ERR_BADVALUE;
+
+               fdt32_st(prop, (uint32_t)size);
+       } else if (size_cells == 2) {
+               fdt64_st(prop, size);
+       } else {
+               return -FDT_ERR_BADNCELLS;
+       }
+
+       return fdt_appendprop(fdt, nodeoffset, name, data,
+                             (addr_cells + size_cells) * sizeof(fdt32_t));
+}
index f2ae9b77c285733e50b4b496407471149650d290..49d54d44b8e78be6d110c41db97312ef66ff89aa 100644 (file)
@@ -1,52 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
  * 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"
 
index bf75388ec9a20d9e4878ddd0f9636889dcaa18c3..be7187336615432d5659ab1cc90a2ac6cfaa7d7d 100644 (file)
@@ -1,53 +1,8 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2016 Free Electrons
  * Copyright (C) 2016 NextThing Co.
- *
- * 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"
 
@@ -93,11 +48,11 @@ static uint32_t overlay_get_target_phandle(const void *fdto, int fragment)
  * @pathp: pointer which receives the path of the target (or NULL)
  *
  * overlay_get_target() retrieves the target offset in the base
- * device tree of a fragment, no matter how the actual targetting is
+ * device tree of a fragment, no matter how the actual targeting is
  * done (through a phandle or a path)
  *
  * returns:
- *      the targetted node offset in the base device tree
+ *      the targeted node offset in the base device tree
  *      Negative error code on error
  */
 static int overlay_get_target(const void *fdt, const void *fdto,
@@ -697,7 +652,7 @@ static int get_path_len(const void *fdt, int nodeoffset)
        int len = 0, namelen;
        const char *name;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        for (;;) {
                name = fdt_get_name(fdt, nodeoffset, &namelen);
@@ -778,26 +733,36 @@ static int overlay_symbol_update(void *fdt, void *fdto)
                /* keep end marker to avoid strlen() */
                e = path + path_len;
 
-               /* format: /<fragment-name>/__overlay__/<relative-subnode-path> */
-
                if (*path != '/')
                        return -FDT_ERR_BADVALUE;
 
                /* get fragment name first */
                s = strchr(path + 1, '/');
-               if (!s)
-                       return -FDT_ERR_BADOVERLAY;
+               if (!s) {
+                       /* Symbol refers to something that won't end
+                        * up in the target tree */
+                       continue;
+               }
 
                frag_name = path + 1;
                frag_name_len = s - path - 1;
 
                /* verify format; safe since "s" lies in \0 terminated prop */
                len = sizeof("/__overlay__/") - 1;
-               if ((e - s) < len || memcmp(s, "/__overlay__/", len))
-                       return -FDT_ERR_BADOVERLAY;
-
-               rel_path = s + len;
-               rel_path_len = e - rel_path;
+               if ((e - s) > len && (memcmp(s, "/__overlay__/", len) == 0)) {
+                       /* /<fragment-name>/__overlay__/<relative-subnode-path> */
+                       rel_path = s + len;
+                       rel_path_len = e - rel_path;
+               } else if ((e - s) == len
+                          && (memcmp(s, "/__overlay__", len - 1) == 0)) {
+                       /* /<fragment-name>/__overlay__ */
+                       rel_path = "";
+                       rel_path_len = 0;
+               } else {
+                       /* Symbol refers to something that won't end
+                        * up in the target tree */
+                       continue;
+               }
 
                /* find the fragment index in which the symbol lies */
                ret = fdt_subnode_offset_namelen(fdto, 0, frag_name,
@@ -863,11 +828,15 @@ static int overlay_symbol_update(void *fdt, void *fdto)
 
 int fdt_overlay_apply(void *fdt, void *fdto)
 {
-       uint32_t delta = fdt_get_max_phandle(fdt);
+       uint32_t delta;
        int ret;
 
-       FDT_CHECK_HEADER(fdt);
-       FDT_CHECK_HEADER(fdto);
+       FDT_RO_PROBE(fdt);
+       FDT_RO_PROBE(fdto);
+
+       ret = fdt_find_max_phandle(fdt, &delta);
+       if (ret)
+               goto err;
 
        ret = overlay_adjust_local_phandles(fdto, delta);
        if (ret)
index dc499884e4d1a7f1858225024cc97799af4f57ce..e398815485d6d9a467c86f116575e7a348c17863 100644 (file)
@@ -1,52 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
  * 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"
 
@@ -61,7 +16,7 @@ static int fdt_nodename_eq_(const void *fdt, int offset,
        int olen;
        const char *p = fdt_get_name(fdt, offset, &olen);
 
-       if (!p || olen < len)
+       if (!p || (fdt_chk_extra() && olen < len))
                /* short match */
                return 0;
 
@@ -76,46 +31,85 @@ static int fdt_nodename_eq_(const void *fdt, int offset,
                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 *fdt_get_string(const void *fdt, int stroffset, int *lenp)
 {
-       const char *p = fdt_string(fdt, stroffset);
+       int32_t totalsize;
+       uint32_t absoffset;
+       size_t len;
+       int err;
+       const char *s, *n;
 
-       return (strlen(p) == len) && (memcmp(p, s, len) == 0);
-}
+       if (!fdt_chk_extra()) {
+               s = (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
 
-uint32_t fdt_get_max_phandle(const void *fdt)
-{
-       uint32_t max_phandle = 0;
-       int offset;
+               if (lenp)
+                       *lenp = strlen(s);
+               return s;
+       }
+       totalsize = fdt_ro_probe_(fdt);
+       err = totalsize;
+       if (totalsize < 0)
+               goto fail;
+
+       err = -FDT_ERR_BADOFFSET;
+       absoffset = stroffset + fdt_off_dt_strings(fdt);
+       if (absoffset >= totalsize)
+               goto fail;
+       len = totalsize - absoffset;
+
+       if (fdt_magic(fdt) == FDT_MAGIC) {
+               if (stroffset < 0)
+                       goto fail;
+               if (!fdt_chk_version() || fdt_version(fdt) >= 17) {
+                       if (stroffset >= fdt_size_dt_strings(fdt))
+                               goto fail;
+                       if ((fdt_size_dt_strings(fdt) - stroffset) < len)
+                               len = fdt_size_dt_strings(fdt) - stroffset;
+               }
+       } else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
+               if ((stroffset >= 0)
+                   || (stroffset < -fdt_size_dt_strings(fdt)))
+                       goto fail;
+               if ((-stroffset) < len)
+                       len = -stroffset;
+       } else {
+               err = -FDT_ERR_INTERNAL;
+               goto fail;
+       }
 
-       for (offset = fdt_next_node(fdt, -1, NULL);;
-            offset = fdt_next_node(fdt, offset, NULL)) {
-               uint32_t phandle;
+       s = (const char *)fdt + absoffset;
+       n = memchr(s, '\0', len);
+       if (!n) {
+               /* missing terminating NULL */
+               err = -FDT_ERR_TRUNCATED;
+               goto fail;
+       }
 
-               if (offset == -FDT_ERR_NOTFOUND)
-                       return max_phandle;
+       if (lenp)
+               *lenp = n - s;
+       return s;
 
-               if (offset < 0)
-                       return (uint32_t)-1;
+fail:
+       if (lenp)
+               *lenp = err;
+       return NULL;
+}
 
-               phandle = fdt_get_phandle(fdt, offset);
-               if (phandle == (uint32_t)-1)
-                       continue;
+const char *fdt_string(const void *fdt, int stroffset)
+{
+       return fdt_get_string(fdt, stroffset, NULL);
+}
 
-               if (phandle > max_phandle)
-                       max_phandle = phandle;
-       }
+static int fdt_string_eq_(const void *fdt, int stroffset,
+                         const char *s, int len)
+{
+       int slen;
+       const char *p = fdt_get_string(fdt, stroffset, &slen);
 
-       return 0;
+       return p && (slen == len) && (memcmp(p, s, len) == 0);
 }
 
-int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
+int fdt_find_max_phandle(const void *fdt, uint32_t *phandle)
 {
        uint32_t max = 0;
        int offset = -1;
@@ -137,6 +131,21 @@ int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
                        max = value;
        }
 
+       if (phandle)
+               *phandle = max;
+
+       return 0;
+}
+
+int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
+{
+       uint32_t max;
+       int err;
+
+       err = fdt_find_max_phandle(fdt, &max);
+       if (err < 0)
+               return err;
+
        if (max == FDT_MAX_PHANDLE)
                return -FDT_ERR_NOPHANDLES;
 
@@ -146,21 +155,45 @@ int fdt_generate_phandle(const void *fdt, uint32_t *phandle)
        return 0;
 }
 
+static const struct fdt_reserve_entry *fdt_mem_rsv(const void *fdt, int n)
+{
+       int offset = n * sizeof(struct fdt_reserve_entry);
+       int absoffset = fdt_off_mem_rsvmap(fdt) + offset;
+
+       if (fdt_chk_extra()) {
+               if (absoffset < fdt_off_mem_rsvmap(fdt))
+                       return NULL;
+               if (absoffset > fdt_totalsize(fdt) -
+                   sizeof(struct fdt_reserve_entry))
+                       return NULL;
+       }
+       return fdt_mem_rsv_(fdt, n);
+}
+
 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);
+       const struct fdt_reserve_entry *re;
+
+       FDT_RO_PROBE(fdt);
+       re = fdt_mem_rsv(fdt, n);
+       if (fdt_chk_extra() && !re)
+               return -FDT_ERR_BADOFFSET;
+
+       *address = fdt64_ld(&re->address);
+       *size = fdt64_ld(&re->size);
        return 0;
 }
 
 int fdt_num_mem_rsv(const void *fdt)
 {
-       int i = 0;
+       int i;
+       const struct fdt_reserve_entry *re;
 
-       while (fdt64_to_cpu(fdt_mem_rsv_(fdt, i)->size) != 0)
-               i++;
-       return i;
+       for (i = 0; (re = fdt_mem_rsv(fdt, i)) != NULL; i++) {
+               if (fdt64_ld(&re->size) == 0)
+                       return i;
+       }
+       return -FDT_ERR_TRUNCATED;
 }
 
 static int nextprop_(const void *fdt, int offset)
@@ -192,7 +225,7 @@ int fdt_subnode_offset_namelen(const void *fdt, int offset,
 {
        int depth;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        for (depth = 0;
             (offset >= 0) && (depth >= 0);
@@ -218,7 +251,7 @@ int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen)
        const char *p = path;
        int offset = 0;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        /* see if we have an alias */
        if (*path != '/') {
@@ -268,13 +301,14 @@ const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
        const char *nameptr;
        int err;
 
-       if (((err = fdt_check_header(fdt)) != 0)
-           || ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0))
-                       goto fail;
+       if (fdt_chk_extra() &&
+           (((err = fdt_ro_probe_(fdt)) < 0)
+            || ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0)))
+               goto fail;
 
        nameptr = nh->name;
 
-       if (fdt_version(fdt) < 0x10) {
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10) {
                /*
                 * For old FDT versions, match the naming conventions of V16:
                 * give only the leaf name (after all /). The actual tree
@@ -325,7 +359,7 @@ static const struct fdt_property *fdt_get_property_by_offset_(const void *fdt,
        int err;
        const struct fdt_property *prop;
 
-       if ((err = fdt_check_prop_offset_(fdt, offset)) < 0) {
+       if (fdt_chk_basic() && (err = fdt_check_prop_offset_(fdt, offset)) < 0) {
                if (lenp)
                        *lenp = err;
                return NULL;
@@ -334,7 +368,7 @@ static const struct fdt_property *fdt_get_property_by_offset_(const void *fdt,
        prop = fdt_offset_ptr_(fdt, offset);
 
        if (lenp)
-               *lenp = fdt32_to_cpu(prop->len);
+               *lenp = fdt32_ld(&prop->len);
 
        return prop;
 }
@@ -346,7 +380,7 @@ const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
        /* Prior to version 16, properties may need realignment
         * and this API does not work. fdt_getprop_*() will, however. */
 
-       if (fdt_version(fdt) < 0x10) {
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10) {
                if (lenp)
                        *lenp = -FDT_ERR_BADVERSION;
                return NULL;
@@ -367,11 +401,12 @@ static const struct fdt_property *fdt_get_property_namelen_(const void *fdt,
             (offset = fdt_next_property_offset(fdt, offset))) {
                const struct fdt_property *prop;
 
-               if (!(prop = fdt_get_property_by_offset_(fdt, offset, lenp))) {
+               prop = fdt_get_property_by_offset_(fdt, offset, lenp);
+               if (fdt_chk_extra() && !prop) {
                        offset = -FDT_ERR_INTERNAL;
                        break;
                }
-               if (fdt_string_eq_(fdt, fdt32_to_cpu(prop->nameoff),
+               if (fdt_string_eq_(fdt, fdt32_ld(&prop->nameoff),
                                   name, namelen)) {
                        if (poffset)
                                *poffset = offset;
@@ -392,7 +427,7 @@ const struct fdt_property *fdt_get_property_namelen(const void *fdt,
 {
        /* Prior to version 16, properties may need realignment
         * and this API does not work. fdt_getprop_*() will, however. */
-       if (fdt_version(fdt) < 0x10) {
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10) {
                if (lenp)
                        *lenp = -FDT_ERR_BADVERSION;
                return NULL;
@@ -423,8 +458,8 @@ const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
                return NULL;
 
        /* Handle realignment */
-       if (fdt_version(fdt) < 0x10 && (poffset + sizeof(*prop)) % 8 &&
-           fdt32_to_cpu(prop->len) >= 8)
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10 &&
+           (poffset + sizeof(*prop)) % 8 && fdt32_ld(&prop->len) >= 8)
                return prop->data + 4;
        return prop->data;
 }
@@ -437,12 +472,27 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset,
        prop = fdt_get_property_by_offset_(fdt, offset, lenp);
        if (!prop)
                return NULL;
-       if (namep)
-               *namep = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
+       if (namep) {
+               const char *name;
+               int namelen;
+
+               if (fdt_chk_extra()) {
+                       name = fdt_get_string(fdt, fdt32_ld(&prop->nameoff),
+                                             &namelen);
+                       if (!name) {
+                               if (lenp)
+                                       *lenp = namelen;
+                               return NULL;
+                       }
+                       *namep = name;
+               } else {
+                       *namep = fdt_string(fdt, fdt32_ld(&prop->nameoff));
+               }
+       }
 
        /* Handle realignment */
-       if (fdt_version(fdt) < 0x10 && (offset + sizeof(*prop)) % 8 &&
-           fdt32_to_cpu(prop->len) >= 8)
+       if (fdt_chk_version() && fdt_version(fdt) < 0x10 &&
+           (offset + sizeof(*prop)) % 8 && fdt32_ld(&prop->len) >= 8)
                return prop->data + 4;
        return prop->data;
 }
@@ -467,7 +517,7 @@ uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
                        return 0;
        }
 
-       return fdt32_to_cpu(*php);
+       return fdt32_ld(php);
 }
 
 const char *fdt_get_alias_namelen(const void *fdt,
@@ -493,7 +543,7 @@ int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
        int offset, depth, namelen;
        const char *name;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        if (buflen < 2)
                return -FDT_ERR_NOSPACE;
@@ -545,7 +595,7 @@ int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
        int offset, depth;
        int supernodeoffset = -FDT_ERR_INTERNAL;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        if (supernodedepth < 0)
                return -FDT_ERR_NOTFOUND;
@@ -567,10 +617,12 @@ int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
                }
        }
 
-       if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
-               return -FDT_ERR_BADOFFSET;
-       else if (offset == -FDT_ERR_BADOFFSET)
-               return -FDT_ERR_BADSTRUCTURE;
+       if (fdt_chk_extra()) {
+               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() */
 }
@@ -582,7 +634,7 @@ int fdt_node_depth(const void *fdt, int nodeoffset)
 
        err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
        if (err)
-               return (err < 0) ? err : -FDT_ERR_INTERNAL;
+               return (!fdt_chk_extra() || err < 0) ? err : -FDT_ERR_INTERNAL;
        return nodedepth;
 }
 
@@ -604,7 +656,7 @@ int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
        const void *val;
        int len;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        /* FIXME: The algorithm here is pretty horrible: we scan each
         * property of a node in fdt_getprop(), then if that didn't
@@ -630,7 +682,7 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
        if ((phandle == 0) || (phandle == -1))
                return -FDT_ERR_BADPHANDLE;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        /* FIXME: The algorithm here is pretty horrible: we
         * potentially scan each property of a node in
@@ -783,7 +835,7 @@ int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
 {
        int offset, err;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        /* FIXME: The algorithm here is pretty horrible: we scan each
         * property of a node in fdt_node_check_compatible(), then if
@@ -802,3 +854,68 @@ int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
 
        return offset; /* error from fdt_next_node() */
 }
+
+#if !defined(FDT_ASSUME_MASK) || FDT_ASSUME_MASK != 0xff
+int fdt_check_full(const void *fdt, size_t bufsize)
+{
+       int err;
+       int num_memrsv;
+       int offset, nextoffset = 0;
+       uint32_t tag;
+       unsigned depth = 0;
+       const void *prop;
+       const char *propname;
+
+       if (bufsize < FDT_V1_SIZE)
+               return -FDT_ERR_TRUNCATED;
+       err = fdt_check_header(fdt);
+       if (err != 0)
+               return err;
+       if (bufsize < fdt_totalsize(fdt))
+               return -FDT_ERR_TRUNCATED;
+
+       num_memrsv = fdt_num_mem_rsv(fdt);
+       if (num_memrsv < 0)
+               return num_memrsv;
+
+       while (1) {
+               offset = nextoffset;
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+
+               if (nextoffset < 0)
+                       return nextoffset;
+
+               switch (tag) {
+               case FDT_NOP:
+                       break;
+
+               case FDT_END:
+                       if (depth != 0)
+                               return -FDT_ERR_BADSTRUCTURE;
+                       return 0;
+
+               case FDT_BEGIN_NODE:
+                       depth++;
+                       if (depth > INT_MAX)
+                               return -FDT_ERR_BADSTRUCTURE;
+                       break;
+
+               case FDT_END_NODE:
+                       if (depth == 0)
+                               return -FDT_ERR_BADSTRUCTURE;
+                       depth--;
+                       break;
+
+               case FDT_PROP:
+                       prop = fdt_getprop_by_offset(fdt, offset, &propname,
+                                                    &err);
+                       if (!prop)
+                               return err;
+                       break;
+
+               default:
+                       return -FDT_ERR_INTERNAL;
+               }
+       }
+}
+#endif
index 9b829051e4447015aad9972270e299cab4dc3053..08e2981a44f85bca6315dd11726a00d32da76fc2 100644 (file)
@@ -1,52 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
  * 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"
 
@@ -58,6 +13,8 @@
 static int fdt_blocks_misordered_(const void *fdt,
                                  int mem_rsv_size, int struct_size)
 {
+       if (!fdt_chk_basic())
+               return false;
        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))
@@ -67,25 +24,27 @@ static int fdt_blocks_misordered_(const void *fdt,
                    (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
 }
 
-static int fdt_rw_check_header_(void *fdt)
+static int fdt_rw_probe_(void *fdt)
 {
-       FDT_CHECK_HEADER(fdt);
+       if (!fdt_chk_basic())
+               return 0;
+       FDT_RO_PROBE(fdt);
 
-       if (fdt_version(fdt) < 17)
+       if (fdt_chk_version() && 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)
+       if (fdt_chk_version() && fdt_version(fdt) > 17)
                fdt_set_version(fdt, 17);
 
        return 0;
 }
 
-#define FDT_RW_CHECK_HEADER(fdt) \
+#define FDT_RW_PROBE(fdt) \
        { \
                int err_; \
-               if ((err_ = fdt_rw_check_header_(fdt)) != 0) \
+               if (fdt_chk_extra() && (err_ = fdt_rw_probe_(fdt)) != 0) \
                        return err_; \
        }
 
@@ -136,6 +95,14 @@ static int fdt_splice_struct_(void *fdt, void *p,
        return 0;
 }
 
+/* Must only be used to roll back in case of error */
+static void fdt_del_last_string_(void *fdt, const char *s)
+{
+       int newlen = strlen(s) + 1;
+
+       fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) - newlen);
+}
+
 static int fdt_splice_string_(void *fdt, int newlen)
 {
        void *p = (char *)fdt
@@ -149,7 +116,16 @@ static int fdt_splice_string_(void *fdt, int newlen)
        return 0;
 }
 
-static int fdt_find_add_string_(void *fdt, const char *s)
+/**
+ * fdt_find_add_string_() - Find or allocate a string
+ *
+ * @fdt: pointer to the device tree to check/adjust
+ * @s: string to find/add
+ * @allocated: Set to 0 if the string was found, 1 if not found and so
+ *     allocated. Ignored if !fdt_chk_basic()
+ * @return offset of string in the string table (whether found or added)
+ */
+static int fdt_find_add_string_(void *fdt, const char *s, int *allocated)
 {
        char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
        const char *p;
@@ -157,6 +133,9 @@ static int fdt_find_add_string_(void *fdt, const char *s)
        int len = strlen(s) + 1;
        int err;
 
+       if (fdt_chk_basic())
+               *allocated = 0;
+
        p = fdt_find_string_(strtab, fdt_size_dt_strings(fdt), s);
        if (p)
                /* found it */
@@ -167,6 +146,9 @@ static int fdt_find_add_string_(void *fdt, const char *s)
        if (err)
                return err;
 
+       if (fdt_chk_basic())
+               *allocated = 1;
+
        memcpy(new, s, len);
        return (new - strtab);
 }
@@ -176,7 +158,7 @@ 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);
+       FDT_RW_PROBE(fdt);
 
        re = fdt_mem_rsv_w_(fdt, fdt_num_mem_rsv(fdt));
        err = fdt_splice_mem_rsv_(fdt, re, 0, 1);
@@ -192,7 +174,7 @@ 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);
+       FDT_RW_PROBE(fdt);
 
        if (n >= fdt_num_mem_rsv(fdt))
                return -FDT_ERR_NOTFOUND;
@@ -225,11 +207,12 @@ static int fdt_add_property_(void *fdt, int nodeoffset, const char *name,
        int nextoffset;
        int namestroff;
        int err;
+       int allocated;
 
        if ((nextoffset = fdt_check_node_offset_(fdt, nodeoffset)) < 0)
                return nextoffset;
 
-       namestroff = fdt_find_add_string_(fdt, name);
+       namestroff = fdt_find_add_string_(fdt, name, &allocated);
        if (namestroff < 0)
                return namestroff;
 
@@ -237,8 +220,12 @@ static int fdt_add_property_(void *fdt, int nodeoffset, const char *name,
        proplen = sizeof(**prop) + FDT_TAGALIGN(len);
 
        err = fdt_splice_struct_(fdt, *prop, 0, proplen);
-       if (err)
+       if (err) {
+               /* Delete the string if we failed to add it */
+               if (fdt_chk_basic() && allocated)
+                       fdt_del_last_string_(fdt, name);
                return err;
+       }
 
        (*prop)->tag = cpu_to_fdt32(FDT_PROP);
        (*prop)->nameoff = cpu_to_fdt32(namestroff);
@@ -252,7 +239,7 @@ int fdt_set_name(void *fdt, int nodeoffset, const char *name)
        int oldlen, newlen;
        int err;
 
-       FDT_RW_CHECK_HEADER(fdt);
+       FDT_RW_PROBE(fdt);
 
        namep = (char *)(uintptr_t)fdt_get_name(fdt, nodeoffset, &oldlen);
        if (!namep)
@@ -275,7 +262,7 @@ int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
        struct fdt_property *prop;
        int err;
 
-       FDT_RW_CHECK_HEADER(fdt);
+       FDT_RW_PROBE(fdt);
 
        err = fdt_resize_property_(fdt, nodeoffset, name, len, &prop);
        if (err == -FDT_ERR_NOTFOUND)
@@ -308,7 +295,7 @@ int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
        struct fdt_property *prop;
        int err, oldlen, newlen;
 
-       FDT_RW_CHECK_HEADER(fdt);
+       FDT_RW_PROBE(fdt);
 
        prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
        if (prop) {
@@ -334,7 +321,7 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name)
        struct fdt_property *prop;
        int len, proplen;
 
-       FDT_RW_CHECK_HEADER(fdt);
+       FDT_RW_PROBE(fdt);
 
        prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
        if (!prop)
@@ -354,7 +341,7 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
        uint32_t tag;
        fdt32_t *endtag;
 
-       FDT_RW_CHECK_HEADER(fdt);
+       FDT_RW_PROBE(fdt);
 
        offset = fdt_subnode_offset_namelen(fdt, parentoffset, name, namelen);
        if (offset >= 0)
@@ -394,7 +381,7 @@ int fdt_del_node(void *fdt, int nodeoffset)
 {
        int endoffset;
 
-       FDT_RW_CHECK_HEADER(fdt);
+       FDT_RW_PROBE(fdt);
 
        endoffset = fdt_node_end_offset_(fdt, nodeoffset);
        if (endoffset < 0)
@@ -435,12 +422,12 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
        const char *fdtend = fdtstart + fdt_totalsize(fdt);
        char *tmp;
 
-       FDT_CHECK_HEADER(fdt);
+       FDT_RO_PROBE(fdt);
 
        mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
                * sizeof(struct fdt_reserve_entry);
 
-       if (fdt_version(fdt) >= 17) {
+       if (!fdt_chk_version() || fdt_version(fdt) >= 17) {
                struct_size = fdt_size_dt_struct(fdt);
        } else {
                struct_size = 0;
@@ -494,7 +481,7 @@ int fdt_pack(void *fdt)
 {
        int mem_rsv_size;
 
-       FDT_RW_CHECK_HEADER(fdt);
+       FDT_RW_PROBE(fdt);
 
        mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
                * sizeof(struct fdt_reserve_entry);
index 9677a1887e572029a74ebb3dfa49b3f95b1ccb07..768db66eada5ea06c0595df6db4610522f01ec6c 100644 (file)
@@ -1,51 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
  * 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"
@@ -82,6 +38,7 @@ static struct fdt_errtabent fdt_errtable[] = {
        FDT_ERRTABENT(FDT_ERR_BADVALUE),
        FDT_ERRTABENT(FDT_ERR_BADOVERLAY),
        FDT_ERRTABENT(FDT_ERR_NOPHANDLES),
+       FDT_ERRTABENT(FDT_ERR_BADFLAGS),
 };
 #define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
 
index d8ef748a7212f489df98a94dac8faac399240a8b..a8c924675a6ad11f282c706bd346cd09ff7fd9d6 100644 (file)
@@ -1,52 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
  * 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 "libfdt_internal.h"
 
-static int fdt_sw_check_header_(void *fdt)
+static int fdt_sw_probe_(void *fdt)
+{
+       if (fdt_chk_basic()) {
+               if (fdt_magic(fdt) == FDT_MAGIC)
+                       return -FDT_ERR_BADSTATE;
+               else if (fdt_magic(fdt) != FDT_SW_MAGIC)
+                       return -FDT_ERR_BADMAGIC;
+       }
+
+       return 0;
+}
+
+#define FDT_SW_PROBE(fdt) \
+       { \
+               int err; \
+               if (fdt_chk_basic() && (err = fdt_sw_probe_(fdt)) != 0) \
+                       return err; \
+       }
+
+/* 'memrsv' state:     Initial state after fdt_create()
+ *
+ * Allowed functions:
+ *     fdt_add_reservmap_entry()
+ *     fdt_finish_reservemap()         [moves to 'struct' state]
+ */
+static int fdt_sw_probe_memrsv_(void *fdt)
+{
+       int err = fdt_sw_probe_(fdt);
+       if (err)
+               return err;
+
+       if (fdt_chk_extra() && fdt_off_dt_strings(fdt) != 0)
+               return -FDT_ERR_BADSTATE;
+       return 0;
+}
+
+#define FDT_SW_PROBE_MEMRSV(fdt) \
+       { \
+               int err; \
+               if (fdt_chk_extra() && (err = fdt_sw_probe_memrsv_(fdt)) != 0) \
+                       return err; \
+       }
+
+/* 'struct' state:     Enter this state after fdt_finish_reservemap()
+ *
+ * Allowed functions:
+ *     fdt_begin_node()
+ *     fdt_end_node()
+ *     fdt_property*()
+ *     fdt_finish()                    [moves to 'complete' state]
+ */
+static int fdt_sw_probe_struct_(void *fdt)
 {
-       if (fdt_magic(fdt) != FDT_SW_MAGIC)
-               return -FDT_ERR_BADMAGIC;
-       /* FIXME: should check more details about the header state */
+       int err;
+
+       if (!fdt_chk_extra())
+               return 0;
+       err = fdt_sw_probe_(fdt);
+       if (err)
+               return err;
+
+       if (fdt_off_dt_strings(fdt) != fdt_totalsize(fdt))
+               return -FDT_ERR_BADSTATE;
        return 0;
 }
 
-#define FDT_SW_CHECK_HEADER(fdt) \
+#define FDT_SW_PROBE_STRUCT(fdt) \
        { \
                int err; \
-               if ((err = fdt_sw_check_header_(fdt)) != 0) \
+               if (fdt_chk_extra() && (err = fdt_sw_probe_struct_(fdt)) != 0) \
                        return err; \
        }
 
+static inline uint32_t sw_flags(void *fdt)
+{
+       /* assert: (fdt_magic(fdt) == FDT_SW_MAGIC) */
+       return fdt_last_comp_version(fdt);
+}
+
+/* 'complete' state:   Enter this state after fdt_finish()
+ *
+ * Allowed functions: none
+ */
+
 static void *fdt_grab_space_(void *fdt, size_t len)
 {
        int offset = fdt_size_dt_struct(fdt);
@@ -85,38 +109,58 @@ static void *fdt_grab_space_(void *fdt, size_t len)
        return fdt_offset_ptr_w_(fdt, offset);
 }
 
-int fdt_create(void *buf, int bufsize)
+int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags)
 {
+       const size_t hdrsize = FDT_ALIGN(sizeof(struct fdt_header),
+                                        sizeof(struct fdt_reserve_entry));
        void *fdt = buf;
 
-       if (bufsize < sizeof(struct fdt_header))
+       if (bufsize < hdrsize)
                return -FDT_ERR_NOSPACE;
 
+       if (flags & ~FDT_CREATE_FLAGS_ALL)
+               return -FDT_ERR_BADFLAGS;
+
        memset(buf, 0, bufsize);
 
+       /*
+        * magic and last_comp_version keep intermediate state during the fdt
+        * creation process, which is replaced with the proper FDT format by
+        * fdt_finish().
+        *
+        * flags should be accessed with sw_flags().
+        */
        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_last_comp_version(fdt, flags);
+
        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_mem_rsvmap(fdt, hdrsize);
        fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt));
-       fdt_set_off_dt_strings(fdt, bufsize);
+       fdt_set_off_dt_strings(fdt, 0);
 
        return 0;
 }
 
+int fdt_create(void *buf, int bufsize)
+{
+       return fdt_create_with_flags(buf, bufsize, 0);
+}
+
 int fdt_resize(void *fdt, void *buf, int bufsize)
 {
        size_t headsize, tailsize;
        char *oldtail, *newtail;
 
-       FDT_SW_CHECK_HEADER(fdt);
+       FDT_SW_PROBE(fdt);
 
        headsize = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
        tailsize = fdt_size_dt_strings(fdt);
 
+       if (fdt_chk_extra() && (headsize + tailsize) > fdt_totalsize(fdt))
+               return -FDT_ERR_INTERNAL;
+
        if ((headsize + tailsize) > bufsize)
                return -FDT_ERR_NOSPACE;
 
@@ -133,8 +177,9 @@ int fdt_resize(void *fdt, void *buf, int bufsize)
                memmove(buf, fdt, headsize);
        }
 
-       fdt_set_off_dt_strings(buf, bufsize);
        fdt_set_totalsize(buf, bufsize);
+       if (fdt_off_dt_strings(buf))
+               fdt_set_off_dt_strings(buf, bufsize);
 
        return 0;
 }
@@ -144,10 +189,7 @@ 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;
+       FDT_SW_PROBE_MEMRSV(fdt);
 
        offset = fdt_off_dt_struct(fdt);
        if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
@@ -164,16 +206,23 @@ int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
 
 int fdt_finish_reservemap(void *fdt)
 {
-       return fdt_add_reservemap_entry(fdt, 0, 0);
+       int err = fdt_add_reservemap_entry(fdt, 0, 0);
+
+       if (err)
+               return err;
+
+       fdt_set_off_dt_strings(fdt, fdt_totalsize(fdt));
+       return 0;
 }
 
 int fdt_begin_node(void *fdt, const char *name)
 {
        struct fdt_node_header *nh;
-       int namelen = strlen(name) + 1;
+       int namelen;
 
-       FDT_SW_CHECK_HEADER(fdt);
+       FDT_SW_PROBE_STRUCT(fdt);
 
+       namelen = strlen(name) + 1;
        nh = fdt_grab_space_(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen));
        if (! nh)
                return -FDT_ERR_NOSPACE;
@@ -187,7 +236,7 @@ int fdt_end_node(void *fdt)
 {
        fdt32_t *en;
 
-       FDT_SW_CHECK_HEADER(fdt);
+       FDT_SW_PROBE_STRUCT(fdt);
 
        en = fdt_grab_space_(fdt, FDT_TAGSIZE);
        if (! en)
@@ -197,19 +246,13 @@ int fdt_end_node(void *fdt)
        return 0;
 }
 
-static int fdt_find_add_string_(void *fdt, const char *s)
+static int fdt_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)
@@ -220,20 +263,56 @@ static int fdt_find_add_string_(void *fdt, const char *s)
        return offset;
 }
 
+/* Must only be used to roll back in case of error */
+static void fdt_del_last_string_(void *fdt, const char *s)
+{
+       int strtabsize = fdt_size_dt_strings(fdt);
+       int len = strlen(s) + 1;
+
+       fdt_set_size_dt_strings(fdt, strtabsize - len);
+}
+
+static int fdt_find_add_string_(void *fdt, const char *s, int *allocated)
+{
+       char *strtab = (char *)fdt + fdt_totalsize(fdt);
+       int strtabsize = fdt_size_dt_strings(fdt);
+       const char *p;
+
+       *allocated = 0;
+
+       p = fdt_find_string_(strtab - strtabsize, strtabsize, s);
+       if (p)
+               return p - strtab;
+
+       *allocated = 1;
+
+       return fdt_add_string_(fdt, s);
+}
+
 int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp)
 {
        struct fdt_property *prop;
        int nameoff;
+       int allocated;
 
-       FDT_SW_CHECK_HEADER(fdt);
+       FDT_SW_PROBE_STRUCT(fdt);
 
-       nameoff = fdt_find_add_string_(fdt, name);
+       /* String de-duplication can be slow, _NO_NAME_DEDUP skips it */
+       if (sw_flags(fdt) & FDT_CREATE_FLAG_NO_NAME_DEDUP) {
+               allocated = 1;
+               nameoff = fdt_add_string_(fdt, name);
+       } else {
+               nameoff = fdt_find_add_string_(fdt, name, &allocated);
+       }
        if (nameoff == 0)
                return -FDT_ERR_NOSPACE;
 
        prop = fdt_grab_space_(fdt, sizeof(*prop) + FDT_TAGALIGN(len));
-       if (! prop)
+       if (! prop) {
+               if (allocated)
+                       fdt_del_last_string_(fdt, name);
                return -FDT_ERR_NOSPACE;
+       }
 
        prop->tag = cpu_to_fdt32(FDT_PROP);
        prop->nameoff = cpu_to_fdt32(nameoff);
@@ -262,7 +341,7 @@ int fdt_finish(void *fdt)
        uint32_t tag;
        int offset, nextoffset;
 
-       FDT_SW_CHECK_HEADER(fdt);
+       FDT_SW_PROBE_STRUCT(fdt);
 
        /* Add terminator */
        end = fdt_grab_space_(fdt, sizeof(*end));
@@ -295,6 +374,10 @@ int fdt_finish(void *fdt)
 
        /* Finally, adjust the header */
        fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
+
+       /* And fix up fields that were keeping intermediate state. */
+       fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
        fdt_set_magic(fdt, FDT_MAGIC);
+
        return 0;
 }
index 534c1cbbb2f355deb7d7b69a19b7e5ac1c309989..f64139e0b3dc5010b28f71815ed6d97ddaa1de4a 100644 (file)
@@ -1,52 +1,7 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
 /*
  * 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"
 
index c400f2f5d544cf7898c23978b318ac171e370cbb..36fadcdea516a2294212e5aa002f485f03e06d4b 100644 (file)
@@ -1,54 +1,9 @@
+/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
 #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"
@@ -90,8 +45,9 @@
 
 /* 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. */
+       /* FDT_ERR_TRUNCATED: FDT or a sub-block is improperly
+        * terminated (overflows, goes outside allowed bounds, or
+        * isn't properly terminated).  */
 #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
        /* FDT_ERR_NOPHANDLES: The device tree doesn't have any
         * phandle available anymore without causing an overflow */
 
-#define FDT_ERR_MAX            17
+#define FDT_ERR_BADFLAGS       18
+       /* FDT_ERR_BADFLAGS: The function was passed a flags field that
+        * contains invalid flags or an invalid combination of flags. */
+
+#define FDT_ERR_MAX            18
 
 /* constants */
 #define FDT_MAX_PHANDLE 0xfffffffe
@@ -157,6 +117,61 @@ static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
 
 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
 
+/*
+ * Alignment helpers:
+ *     These helpers access words from a device tree blob.  They're
+ *     built to work even with unaligned pointers on platforms (ike
+ *     ARM) that don't like unaligned loads and stores
+ */
+
+static inline uint32_t fdt32_ld(const fdt32_t *p)
+{
+       const uint8_t *bp = (const uint8_t *)p;
+
+       return ((uint32_t)bp[0] << 24)
+               | ((uint32_t)bp[1] << 16)
+               | ((uint32_t)bp[2] << 8)
+               | bp[3];
+}
+
+static inline void fdt32_st(void *property, uint32_t value)
+{
+       uint8_t *bp = (uint8_t *)property;
+
+       bp[0] = value >> 24;
+       bp[1] = (value >> 16) & 0xff;
+       bp[2] = (value >> 8) & 0xff;
+       bp[3] = value & 0xff;
+}
+
+static inline uint64_t fdt64_ld(const fdt64_t *p)
+{
+       const uint8_t *bp = (const uint8_t *)p;
+
+       return ((uint64_t)bp[0] << 56)
+               | ((uint64_t)bp[1] << 48)
+               | ((uint64_t)bp[2] << 40)
+               | ((uint64_t)bp[3] << 32)
+               | ((uint64_t)bp[4] << 24)
+               | ((uint64_t)bp[5] << 16)
+               | ((uint64_t)bp[6] << 8)
+               | bp[7];
+}
+
+static inline void fdt64_st(void *property, uint64_t value)
+{
+       uint8_t *bp = (uint8_t *)property;
+
+       bp[0] = value >> 56;
+       bp[1] = (value >> 48) & 0xff;
+       bp[2] = (value >> 40) & 0xff;
+       bp[3] = (value >> 32) & 0xff;
+       bp[4] = (value >> 24) & 0xff;
+       bp[5] = (value >> 16) & 0xff;
+       bp[6] = (value >> 8) & 0xff;
+       bp[7] = value & 0xff;
+}
+
 /**********************************************************************/
 /* Traversal functions                                                */
 /**********************************************************************/
@@ -199,7 +214,7 @@ int fdt_next_subnode(const void *fdt, int offset);
  *             ...
  *     }
  *
- *     if ((node < 0) && (node != -FDT_ERR_NOT_FOUND)) {
+ *     if ((node < 0) && (node != -FDT_ERR_NOTFOUND)) {
  *             Error handling
  *     }
  *
@@ -217,7 +232,7 @@ int fdt_next_subnode(const void *fdt, int offset);
 /* General functions                                                  */
 /**********************************************************************/
 #define fdt_get_header(fdt, field) \
-       (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
+       (fdt32_ld(&((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))
@@ -248,18 +263,32 @@ fdt_set_hdr_(size_dt_struct);
 #undef fdt_set_hdr_
 
 /**
- * fdt_check_header - sanity check a device tree or possible device tree
+ * fdt_header_size - return the size of the tree's header
+ * @fdt: pointer to a flattened device tree
+ */
+size_t fdt_header_size(const void *fdt);
+
+/**
+ * fdt_header_size_ - internal function which takes a version number
+ */
+size_t fdt_header_size_(uint32_t version);
+
+/**
+ * fdt_check_header - sanity check a device tree header
+
  * @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.
+ * appears to be a flattened device tree, and that the header contains
+ * valid information (to the extent that can be determined from the
+ * header alone).
  *
  * 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
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_TRUNCATED, standard meanings, as above
  */
 int fdt_check_header(const void *fdt);
 
@@ -288,6 +317,24 @@ int fdt_move(const void *fdt, void *buf, int bufsize);
 /* Read-only functions                                                */
 /**********************************************************************/
 
+int fdt_check_full(const void *fdt, size_t bufsize);
+
+/**
+ * fdt_get_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)
+ * @lenp: optional pointer to return the string's length
+ *
+ * fdt_get_string() retrieves a pointer to a single string from the
+ * strings block of the device tree blob at fdt, and optionally also
+ * returns the string's length in *lenp.
+ *
+ * returns:
+ *     a pointer to the string, on success
+ *     NULL, if stroffset is out of bounds, or doesn't point to a valid string
+ */
+const char *fdt_get_string(const void *fdt, int stroffset, int *lenp);
+
 /**
  * fdt_string - retrieve a string from the strings block of a device tree
  * @fdt: pointer to the device tree blob
@@ -298,10 +345,24 @@ int fdt_move(const void *fdt, void *buf, int bufsize);
  *
  * returns:
  *     a pointer to the string, on success
- *     NULL, if stroffset is out of bounds
+ *     NULL, if stroffset is out of bounds, or doesn't point to a valid string
  */
 const char *fdt_string(const void *fdt, int stroffset);
 
+/**
+ * fdt_find_max_phandle - find and return the highest phandle in a tree
+ * @fdt: pointer to the device tree blob
+ * @phandle: return location for the highest phandle value found in the tree
+ *
+ * fdt_find_max_phandle() finds the highest phandle value in the given device
+ * tree. The value returned in @phandle is only valid if the function returns
+ * success.
+ *
+ * returns:
+ *     0 on success or a negative error code on failure
+ */
+int fdt_find_max_phandle(const void *fdt, uint32_t *phandle);
+
 /**
  * fdt_get_max_phandle - retrieves the highest phandle in a tree
  * @fdt: pointer to the device tree blob
@@ -310,12 +371,24 @@ const char *fdt_string(const void *fdt, int stroffset);
  * device tree. This will ignore badly formatted phandles, or phandles
  * with a value of 0 or -1.
  *
+ * This function is deprecated in favour of fdt_find_max_phandle().
+ *
  * 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);
+static inline uint32_t fdt_get_max_phandle(const void *fdt)
+{
+       uint32_t phandle;
+       int err;
+
+       err = fdt_find_max_phandle(fdt, &phandle);
+       if (err < 0)
+               return (uint32_t)-1;
+
+       return phandle;
+}
 
 /**
  * fdt_generate_phandle - return a new, unused phandle for a device tree blob
@@ -522,7 +595,7 @@ int fdt_next_property_offset(const void *fdt, int offset);
  *             ...
  *     }
  *
- *     if ((property < 0) && (property != -FDT_ERR_NOT_FOUND)) {
+ *     if ((property < 0) && (property != -FDT_ERR_NOTFOUND)) {
  *             Error handling
  *     }
  *
@@ -625,7 +698,7 @@ static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
 /**
  * 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
+ * @offset: 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
  *
@@ -734,7 +807,7 @@ 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 to look up
+ * @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
@@ -1316,7 +1389,45 @@ int fdt_nop_node(void *fdt, int nodeoffset);
 /* Sequential write functions                                         */
 /**********************************************************************/
 
+/* fdt_create_with_flags flags */
+#define FDT_CREATE_FLAG_NO_NAME_DEDUP 0x1
+       /* FDT_CREATE_FLAG_NO_NAME_DEDUP: Do not try to de-duplicate property
+        * names in the fdt. This can result in faster creation times, but
+        * a larger fdt. */
+
+#define FDT_CREATE_FLAGS_ALL   (FDT_CREATE_FLAG_NO_NAME_DEDUP)
+
+/**
+ * fdt_create_with_flags - begin creation of a new fdt
+ * @fdt: pointer to memory allocated where fdt will be created
+ * @bufsize: size of the memory space at fdt
+ * @flags: a valid combination of FDT_CREATE_FLAG_ flags, or 0.
+ *
+ * fdt_create_with_flags() begins the process of creating a new fdt with
+ * the sequential write interface.
+ *
+ * fdt creation process must end with fdt_finished() to produce a valid fdt.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
+ *     -FDT_ERR_BADFLAGS, flags is not valid
+ */
+int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags);
+
+/**
+ * fdt_create - begin creation of a new fdt
+ * @fdt: pointer to memory allocated where fdt will be created
+ * @bufsize: size of the memory space at fdt
+ *
+ * fdt_create() is equivalent to fdt_create_with_flags() with flags=0.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
+ */
 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);
@@ -1787,6 +1898,43 @@ static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
 #define fdt_appendprop_string(fdt, nodeoffset, name, str) \
        fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
 
+/**
+ * fdt_appendprop_addrrange - append a address range property
+ * @fdt: pointer to the device tree blob
+ * @parent: offset of the parent node
+ * @nodeoffset: offset of the node to add a property at
+ * @name: name of property
+ * @addr: start address of a given range
+ * @size: size of a given range
+ *
+ * fdt_appendprop_addrrange() appends an address range value (start
+ * address and size) 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.
+ * If "name" is not specified, a default "reg" is used.
+ * Cell sizes are determined by parent's #address-cells and #size-cells.
+ *
+ * This function may insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_BADLAYOUT,
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
+ *             #address-cells property
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADSTATE,
+ *     -FDT_ERR_BADSTRUCTURE,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADVALUE, addr or size doesn't fit to respective cells size
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *             contain a new property
+ *     -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_appendprop_addrrange(void *fdt, int parent, int nodeoffset,
+                            const char *name, uint64_t addr, uint64_t size);
+
 /**
  * fdt_delprop - delete a property
  * @fdt: pointer to the device tree blob
index 3ff9e28630752c1f55052e8c47c300d1dfb13e67..73b6d40450aca51d94245be59490f6ee3454241d 100644 (file)
@@ -1,55 +1,10 @@
+/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
 #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 <stdbool.h>
@@ -57,6 +12,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <limits.h>
 
 #ifdef __CHECKER__
 #define FDT_FORCE __attribute__((force))
index 7681e192295b0a14cc07aa7a73ed3faca09b15d4..5436e2ceeacf1596dd1fb86ceba69f411b00d8d0 100644 (file)
@@ -1,65 +1,24 @@
+/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
 #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_ro_probe_(const void *fdt);
+#define FDT_RO_PROBE(fdt)                                      \
+       {                                                       \
+               int totalsize_;                                 \
+               if (fdt_chk_basic()) {                          \
+                       totalsize_ = fdt_ro_probe_(fdt);        \
+                       if (totalsize_ < 0)                     \
+                               return totalsize_;              \
+               }                                               \
        }
 
 int fdt_check_node_offset_(const void *fdt, int offset);
@@ -92,4 +51,87 @@ static inline struct fdt_reserve_entry *fdt_mem_rsv_w_(void *fdt, int n)
 
 #define FDT_SW_MAGIC           (~FDT_MAGIC)
 
+/**********************************************************************/
+/* Checking controls                                                  */
+/**********************************************************************/
+
+#ifndef FDT_ASSUME_MASK
+#define FDT_ASSUME_MASK 0
+#endif
+
+/*
+ * Defines assumptions which can be enabled. Each of these can be enabled
+ * individually. For maximum saftey, don't enable any assumptions!
+ *
+ * For minimal code size and no safety, use FDT_ASSUME_PERFECT at your own risk.
+ * You should have another method of validating the device tree, such as a
+ * signature or hash check before using libfdt.
+ *
+ * For situations where security is not a concern it may be safe to enable
+ * FDT_ASSUME_FRIENDLY.
+ */
+enum {
+       /*
+        * This does essentially no checks. Only the latest device-tree
+        * version is correctly handled. Incosistencies or errors in the device
+        * tree may cause undefined behaviour or crashes.
+        *
+        * If an error occurs when modifying the tree it may leave the tree in
+        * an intermediate (but valid) state. As an example, adding a property
+        * where there is insufficient space may result in the property name
+        * being added to the string table even though the property itself is
+        * not added to the struct section.
+        *
+        * Only use this if you have a fully validated device tree with
+        * the latest supported version and wish to minimise code size.
+        */
+       FDT_ASSUME_PERFECT      = 0xff,
+
+       /*
+        * This assumes that the device tree is sane. i.e. header metadata
+        * and basic hierarchy are correct.
+        *
+        * These checks will be sufficient if you have a valid device tree with
+        * no internal inconsistencies. With this assumption, libfdt will
+        * generally not return -FDT_ERR_INTERNAL, -FDT_ERR_BADLAYOUT, etc.
+        */
+       FDT_ASSUME_SANE         = 1 << 0,
+
+       /*
+        * This disables checks for device-tree version and removes all code
+        * which handles older versions.
+        *
+        * Only enable this if you know you have a device tree with the latest
+        * version.
+        */
+       FDT_ASSUME_LATEST       = 1 << 1,
+
+       /*
+        * This disables any extensive checking of parameters and the device
+        * tree, making various assumptions about correctness. Normal device
+        * trees produced by libfdt and the compiler should be handled safely.
+        * Malicious device trees and complete garbage may cause libfdt to
+        * behave badly or crash.
+        */
+       FDT_ASSUME_FRIENDLY     = 1 << 2,
+};
+
+/** fdt_chk_basic() - see if basic checking of params and DT data is enabled */
+static inline bool fdt_chk_basic(void)
+{
+       return !(FDT_ASSUME_MASK & FDT_ASSUME_SANE);
+}
+
+/** fdt_chk_version() - see if we need to handle old versions of the DT */
+static inline bool fdt_chk_version(void)
+{
+       return !(FDT_ASSUME_MASK & FDT_ASSUME_LATEST);
+}
+
+/** fdt_chk_extra() - see if extra checking is enabled */
+static inline bool fdt_chk_extra(void)
+{
+       return !(FDT_ASSUME_MASK & FDT_ASSUME_FRIENDLY);
+}
+
 #endif /* LIBFDT_INTERNAL_H */
index 15e66ad44d76004f15f08d014ed03a5d101e14e2..42342c75bb19f2c36b274768d0ed517a0ef9688c 100644 (file)
@@ -21,7 +21,7 @@ quiet_cmd_pymod = PYMOD   $@
                CPPFLAGS="$(HOSTCFLAGS) -I$(LIBFDT_srcdir)" OBJDIR=$(obj) \
                SOURCES="$(PYLIBFDT_srcs)" \
                SWIG_OPTS="-I$(LIBFDT_srcdir) -I$(LIBFDT_srcdir)/.." \
-               $(PYTHON2) $< --quiet build_ext --inplace
+               $(PYTHON3) $< --quiet build_ext --inplace
 
 $(obj)/_libfdt.so: $(src)/setup.py $(PYLIBFDT_srcs) FORCE
        $(call if_changed,pymod)
index 76e61e98bdf06137eec93dd8c27bb41586a40994..fae0b27d7d0908789c02aefb90edafebdbf551b5 100644 (file)
@@ -18,7 +18,7 @@
  * a struct called fdt_property. That struct causes swig to create a class in
  * libfdt.py called fdt_property(), which confuses things.
  */
-static int fdt_property_stub(void *fdt, const char *name, const char *val,
+static int fdt_property_stub(void *fdt, const char *name, const void *val,
                              int len)
 {
     return fdt_property(fdt, name, val, len);
@@ -92,7 +92,7 @@ def check_err(val, quiet=()):
     Raises
         FdtException if val < 0
     """
-    if val < 0:
+    if isinstance(val, int) and val < 0:
         if -val not in quiet:
             raise FdtException(val)
     return val
@@ -417,7 +417,7 @@ class FdtRo(object):
                                quiet)
         if isinstance(pdata, (int)):
             return pdata
-        return Property(prop_name, bytearray(pdata[0]))
+        return Property(prop_name, bytes(pdata[0]))
 
     def get_phandle(self, nodeoffset):
         """Get the phandle of a node
@@ -431,6 +431,18 @@ class FdtRo(object):
         """
         return fdt_get_phandle(self._fdt, nodeoffset)
 
+    def get_alias(self, name):
+        """Get the full path referenced by a given alias
+
+        Args:
+            name: name of the alias to lookup
+
+        Returns:
+            Full path to the node for the alias named 'name', if it exists
+            None, if the given alias or the /aliases node does not exist
+        """
+        return fdt_get_alias(self._fdt, name)
+
     def parent_offset(self, nodeoffset, quiet=()):
         """Get the offset of a node's parent
 
@@ -624,7 +636,7 @@ class Fdt(FdtRo):
         Raises:
             FdtException if no parent found or other error occurs
         """
-        val = val.encode('utf-8') + '\0'
+        val = val.encode('utf-8') + b'\0'
         return check_err(fdt_setprop(self._fdt, nodeoffset, prop_name,
                                      val, len(val)), quiet)
 
@@ -727,8 +739,10 @@ class FdtSw(FdtRo):
 
     # First create the device tree with a node and property:
     sw = FdtSw()
-    with sw.add_node('node'):
-        sw.property_u32('reg', 2)
+    sw.finish_reservemap()
+    with sw.add_node(''):
+        with sw.add_node('node'):
+            sw.property_u32('reg', 2)
     fdt = sw.as_fdt()
 
     # Now we can use it as a real device tree
@@ -1029,17 +1043,24 @@ typedef uint32_t fdt32_t;
        if (!$1)
                $result = Py_None;
        else
-               $result = Py_BuildValue("s#", $1, *arg4);
+        %#if PY_VERSION_HEX >= 0x03000000
+            $result = Py_BuildValue("y#", $1, *arg4);
+        %#else
+            $result = Py_BuildValue("s#", $1, *arg4);
+        %#endif
 }
 
 /* typemap used for fdt_setprop() */
 %typemap(in) (const void *val) {
-    $1 = PyString_AsString($input);   /* char *str */
-}
-
-/* typemap used for fdt_add_reservemap_entry() */
-%typemap(in) uint64_t {
-   $1 = PyLong_AsUnsignedLong($input);
+    %#if PY_VERSION_HEX >= 0x03000000
+        if (!PyBytes_Check($input)) {
+            SWIG_exception_fail(SWIG_TypeError, "bytes expected in method '" "$symname"
+                "', argument " "$argnum"" of type '" "$type""'");
+        }
+        $1 = PyBytes_AsString($input);
+    %#else
+        $1 = PyString_AsString($input);   /* char *str */
+    %#endif
 }
 
 /* typemaps used for fdt_next_node() */
@@ -1061,7 +1082,7 @@ typedef uint32_t fdt32_t;
 }
 
 %typemap(argout) uint64_t * {
-        PyObject *val = PyLong_FromUnsignedLong(*arg$argnum);
+        PyObject *val = PyLong_FromUnsignedLongLong(*arg$argnum);
         if (!result) {
            if (PyTuple_GET_SIZE(resultobj) == 0)
               resultobj = val;
@@ -1092,6 +1113,6 @@ int fdt_property_cell(void *fdt, const char *name, uint32_t val);
  * This function has a stub since the name fdt_property is used for both a
   * function and a struct, which confuses SWIG.
  */
-int fdt_property_stub(void *fdt, const char *name, const char *val, int len);
+int fdt_property_stub(void *fdt, const char *name, const void *val, int len);
 
 %include <../libfdt/libfdt.h>
index 4f7cf042bfe74380a36c040da4969da3ea1e9870..992cdec30f55238f09e3e3545848e9c31282da6d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 
 """
 setup.py file for SWIG libfdt
index e510539542b60b7a22416c060f83712939d93ad8..b967902493dd3a0005ae1eaf2dfc394f851edb9c 100644 (file)
@@ -215,6 +215,63 @@ static int dm_test_power_regulator_set_get_mode(struct unit_test_state *uts)
 }
 DM_TEST(dm_test_power_regulator_set_get_mode, DM_TESTF_SCAN_FDT);
 
+/* Test regulator set and get suspend Voltage method */
+static int dm_test_power_regulator_set_get_suspend_voltage(struct unit_test_state *uts)
+{
+       struct dm_regulator_uclass_platdata *uc_pdata;
+       const struct dm_regulator_ops *ops;
+       struct udevice *dev;
+       const char *platname;
+       int val_set, val_get;
+
+       /* Set and get Voltage of BUCK1 - set to 'min' constraint */
+       platname = regulator_names[BUCK1][PLATNAME];
+       ut_assertok(regulator_get_by_platname(platname, &dev));
+
+       uc_pdata = dev_get_uclass_platdata(dev);
+       ut_assert(uc_pdata);
+
+       ops = dev_get_driver_ops(dev);
+
+       if (ops->set_suspend_value && ops->get_suspend_value) {
+               val_set = uc_pdata->suspend_uV;
+               ut_assertok(regulator_set_suspend_value(dev, val_set));
+               val_get = regulator_get_suspend_value(dev);
+               ut_assert(val_get >= 0);
+
+               ut_asserteq(val_set, val_get);
+       }
+       return 0;
+}
+DM_TEST(dm_test_power_regulator_set_get_suspend_voltage, DM_TESTF_SCAN_FDT);
+
+/* Test regulator set and get suspend Enable method */
+static int dm_test_power_regulator_set_get_suspend_enable(struct unit_test_state *uts)
+{
+       const struct dm_regulator_ops *ops;
+       const char *platname;
+       struct udevice *dev;
+       bool val_set = true;
+
+       /* Set the Enable of LDO1 - default is disabled */
+       platname = regulator_names[LDO1][PLATNAME];
+       ut_assertok(regulator_get_by_platname(platname, &dev));
+
+       ops = dev_get_driver_ops(dev);
+
+       if (ops->set_suspend_enable && ops->get_suspend_enable) {
+               ut_assertok(regulator_set_suspend_enable(dev, val_set));
+
+               /*
+                * Get the Enable state of LDO1 and
+                * compare it with the requested one
+                */
+               ut_asserteq(regulator_get_suspend_enable(dev), val_set);
+       }
+       return 0;
+}
+DM_TEST(dm_test_power_regulator_set_get_suspend_enable, DM_TESTF_SCAN_FDT);
+
 /* Test regulator autoset method */
 static int dm_test_power_regulator_autoset(struct unit_test_state *uts)
 {
index c96a5642267367b5e1e70ef082b9f70539275f5d..20a80944e29fb9b92f93cc8fe7f010dafb1980f4 100644 (file)
@@ -766,20 +766,38 @@ when SPL is finished.
 Binman allows you to declare symbols in the SPL image which are filled in
 with their correct values during the build. For example:
 
-    binman_sym_declare(ulong, u_boot_any, offset);
+    binman_sym_declare(ulong, u_boot_any, image_pos);
 
-declares a ulong value which will be assigned to the offset of any U-Boot
+declares a ulong value which will be assigned to the image-pos of any U-Boot
 image (u-boot.bin, u-boot.img, u-boot-nodtb.bin) that is present in the image.
 You can access this value with something like:
 
-    ulong u_boot_offset = binman_sym(ulong, u_boot_any, offset);
+    ulong u_boot_offset = binman_sym(ulong, u_boot_any, image_pos);
 
-Thus u_boot_offset will be set to the offset of U-Boot in memory, assuming that
-the whole image has been loaded, or is available in flash. You can then jump to
-that address to start U-Boot.
+Thus u_boot_offset will be set to the image-pos of U-Boot in memory, assuming
+that the whole image has been loaded, or is available in flash. You can then
+jump to that address to start U-Boot.
 
-At present this feature is only supported in SPL. In principle it is possible
-to fill in such symbols in U-Boot proper, as well.
+At present this feature is only supported in SPL and TPL. In principle it is
+possible to fill in such symbols in U-Boot proper, as well, but a future C
+library is planned for this instead, to read from the device tree.
+
+As well as image-pos, it is possible to read the size of an entry and its
+offset (which is the start position of the entry within its parent).
+
+A small technical note: Binman automatically adds the base address of the image
+(i.e. __image_copy_start) to the value of the image-pos symbol, so that when the
+image is loaded to its linked address, the value will be correct and actually
+point into the image.
+
+For example, say SPL is at the start of the image and linked to start at address
+80108000. If U-Boot's image-pos is 0x8000 then binman will write an image-pos
+for U-Boot of 80110000 into the SPL binary, since it assumes the image is loaded
+to 80108000, with SPL at 80108000 and U-Boot at 80110000.
+
+For x86 devices (with the end-at-4gb property) this base address is not added
+since it is assumed that images are XIP and the offsets already include the
+address.
 
 
 Access to binman entry offsets at run time (fdt)
index 8bd5868df26a4b11e510897d57ad88ca1a79a1b2..9e6fd7211754cd192718a566918e6072f7e93106 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 
 # Copyright (c) 2016 Google, Inc
index 772c794eceb6007bb3e30e29ccc44629d904609e..ddc2e09e35870bf7948ac1515bdab8449821a427 100755 (executable)
@@ -56,7 +56,7 @@ class TestCbfs(unittest.TestCase):
         cls.have_lz4 = True
         try:
             tools.Run('lz4', '--no-frame-crc', '-c',
-                      tools.GetInputFilename('u-boot.bin'))
+                      tools.GetInputFilename('u-boot.bin'), binary=True)
         except:
             cls.have_lz4 = False
 
index 0c1a5b44b669a39e46c8cf1f575ac5b89ad0daea..de1ce73f2ae9bdd86856bbe10411a103196f186e 100644 (file)
@@ -134,7 +134,7 @@ def LookupAndWriteSymbols(elf_fname, entry, section):
                                  (msg, sym.size))
 
             # Look up the symbol in our entry tables.
-            value = section.LookupSymbol(name, sym.weak, msg)
+            value = section.LookupSymbol(name, sym.weak, msg, base.address)
             if value is None:
                 value = -1
                 pack_string = pack_string.lower()
index c0c11cb3403195fd0bb7b4a17a411960fc90f2c9..ac26fd51e41975c6ef1ddee488f00fbd022fb762 100644 (file)
@@ -45,7 +45,7 @@ class FakeSection:
     def GetPath(self):
         return 'section_path'
 
-    def LookupSymbol(self, name, weak, msg):
+    def LookupSymbol(self, name, weak, msg, base_addr):
         """Fake implementation which returns the same value for all symbols"""
         return self.sym_value
 
index 409c0dca9345df5898b0dc31214a88a0149286d1..b6f1b2c93fb195381d4d9d6130ab7cb2c72fa4f1 100644 (file)
@@ -7,16 +7,7 @@
 from __future__ import print_function
 
 from collections import namedtuple
-
-# importlib was introduced in Python 2.7 but there was a report of it not
-# working in 2.7.12, so we work around this:
-# http://lists.denx.de/pipermail/u-boot/2016-October/269729.html
-try:
-    import importlib
-    have_importlib = True
-except:
-    have_importlib = False
-
+import importlib
 import os
 import sys
 
@@ -56,6 +47,8 @@ class Entry(object):
         offset: Offset of entry within the section, None if not known yet (in
             which case it will be calculated by Pack())
         size: Entry size in bytes, None if not known
+        pre_reset_size: size as it was before ResetForPack(). This allows us to
+            keep track of the size we started with and detect size changes
         uncomp_size: Size of uncompressed data in bytes, if the entry is
             compressed, else None
         contents_size: Size of contents in bytes, 0 by default
@@ -80,6 +73,7 @@ class Entry(object):
         self.name = node and (name_prefix + node.name) or 'none'
         self.offset = None
         self.size = None
+        self.pre_reset_size = None
         self.uncomp_size = None
         self.data = None
         self.contents_size = 0
@@ -119,10 +113,7 @@ class Entry(object):
             old_path = sys.path
             sys.path.insert(0, os.path.join(our_path, 'etype'))
             try:
-                if have_importlib:
-                    module = importlib.import_module(module_name)
-                else:
-                    module = __import__(module_name)
+                module = importlib.import_module(module_name)
             except ImportError as e:
                 raise ValueError("Unknown entry type '%s' in node '%s' (expected etype/%s.py, error '%s'" %
                                  (etype, node_path, module_name, e))
@@ -326,6 +317,7 @@ class Entry(object):
         self.Detail('ResetForPack: offset %s->%s, size %s->%s' %
                     (ToHex(self.offset), ToHex(self.orig_offset),
                      ToHex(self.size), ToHex(self.orig_size)))
+        self.pre_reset_size = self.size
         self.offset = self.orig_offset
         self.size = self.orig_size
 
@@ -769,7 +761,10 @@ features to produce new behaviours.
             True if the data did not result in a resize of this entry, False if
                  the entry must be resized
         """
-        self.contents_size = self.size
+        if self.size is not None:
+            self.contents_size = self.size
+        else:
+            self.contents_size = self.pre_reset_size
         ok = self.ProcessContentsUpdate(data)
         self.Detail('WriteData: size=%x, ok=%s' % (len(data), ok))
         section_ok = self.section.WriteChildData(self)
index 13f58645168e26d87088453add64454ff404e601..277e10b5859f493361f08961d45b9bccdaf8ce20 100644 (file)
@@ -39,21 +39,6 @@ class TestEntry(unittest.TestCase):
         else:
             import entry
 
-    def test1EntryNoImportLib(self):
-        """Test that we can import Entry subclassess successfully"""
-        sys.modules['importlib'] = None
-        global entry
-        self._ReloadEntry()
-        entry.Entry.Create(None, self.GetNode(), 'u-boot')
-        self.assertFalse(entry.have_importlib)
-
-    def test2EntryImportLib(self):
-        del sys.modules['importlib']
-        global entry
-        self._ReloadEntry()
-        entry.Entry.Create(None, self.GetNode(), 'u-boot-spl')
-        self.assertTrue(entry.have_importlib)
-
     def testEntryContents(self):
         """Test the Entry bass class"""
         import entry
index 23606d27d04ab550c8dbd175c238520294bb4cc1..2a34a05f95554b2cf75b8b6ae71bb4c5d4f8efff 100644 (file)
@@ -27,6 +27,6 @@ class Entry_intel_fit(Entry_blob):
         self.align = 16
 
     def ObtainContents(self):
-        data = struct.pack('<8sIHBB', '_FIT_   ', 1, 0x100, 0x80, 0x7d)
+        data = struct.pack('<8sIHBB', b'_FIT_   ', 1, 0x100, 0x80, 0x7d)
         self.SetContents(data)
         return True
index ab0c42cee045eef1ec02878b7ced769d50e20a45..89b7bf67fa6fab589d55500c1dfcf32e3982403b 100644 (file)
@@ -290,13 +290,16 @@ class Entry_section(Entry):
                 return entry.GetData()
         source_entry.Raise("Cannot find entry for node '%s'" % node.name)
 
-    def LookupSymbol(self, sym_name, optional, msg):
+    def LookupSymbol(self, sym_name, optional, msg, base_addr):
         """Look up a symbol in an ELF file
 
         Looks up a symbol in an ELF file. Only entry types which come from an
         ELF image can be used by this function.
 
-        At present the only entry property supported is offset.
+        At present the only entry properties supported are:
+            offset
+            image_pos - 'base_addr' is added if this is not an end-at-4gb image
+            size
 
         Args:
             sym_name: Symbol name in the ELF file to look up in the format
@@ -309,6 +312,12 @@ class Entry_section(Entry):
             optional: True if the symbol is optional. If False this function
                 will raise if the symbol is not found
             msg: Message to display if an error occurs
+            base_addr: Base address of image. This is added to the returned
+                image_pos in most cases so that the returned position indicates
+                where the targetted entry/binary has actually been loaded. But
+                if end-at-4gb is used, this is not done, since the binary is
+                already assumed to be linked to the ROM position and using
+                execute-in-place (XIP).
 
         Returns:
             Value that should be assigned to that symbol, or None if it was
@@ -343,7 +352,10 @@ class Entry_section(Entry):
         if prop_name == 'offset':
             return entry.offset
         elif prop_name == 'image_pos':
-            return entry.image_pos
+            value = entry.image_pos
+            if not self.GetImage()._end_4gb:
+                value += base_addr
+            return value
         if prop_name == 'size':
             return entry.size
         else:
index 494e218cbc3a29a7acb37979816d6274a0fda17d..872b8554440d6a3799a4d0652b1a1e570109addb 100644 (file)
@@ -174,7 +174,7 @@ class TestFunctional(unittest.TestCase):
         cls.have_lz4 = True
         try:
             tools.Run('lz4', '--no-frame-crc', '-c',
-                      os.path.join(cls._indir, 'u-boot.bin'))
+                      os.path.join(cls._indir, 'u-boot.bin'), binary=True)
         except:
             cls.have_lz4 = False
 
@@ -1242,7 +1242,7 @@ class TestFunctional(unittest.TestCase):
 
         self._SetupSplElf('u_boot_binman_syms')
         data = self._DoReadFile('053_symbols.dts')
-        sym_values = struct.pack('<LQLL', 0, 28, 24, 4)
+        sym_values = struct.pack('<LQLL', 0x00, 0x1c, 0x28, 0x04)
         expected = (sym_values + U_BOOT_SPL_DATA[20:] +
                     tools.GetBytes(0xff, 1) + U_BOOT_DATA + sym_values +
                     U_BOOT_SPL_DATA[20:])
@@ -2113,7 +2113,7 @@ class TestFunctional(unittest.TestCase):
         data = self.data = self._DoReadFileRealDtb('115_fdtmap.dts')
         fdtmap_data = data[len(U_BOOT_DATA):]
         magic = fdtmap_data[:8]
-        self.assertEqual('_FDTMAP_', magic)
+        self.assertEqual(b'_FDTMAP_', magic)
         self.assertEqual(tools.GetBytes(0, 8), fdtmap_data[8:16])
 
         fdt_data = fdtmap_data[16:]
@@ -2156,7 +2156,7 @@ class TestFunctional(unittest.TestCase):
         dtb = fdt.Fdt.FromData(fdt_data)
         fdt_size = dtb.GetFdtObj().totalsize()
         hdr_data = data[-8:]
-        self.assertEqual('BinM', hdr_data[:4])
+        self.assertEqual(b'BinM', hdr_data[:4])
         offset = struct.unpack('<I', hdr_data[4:])[0] & 0xffffffff
         self.assertEqual(fdtmap_pos - 0x400, offset - (1 << 32))
 
@@ -2165,7 +2165,7 @@ class TestFunctional(unittest.TestCase):
         data = self.data = self._DoReadFileRealDtb('117_fdtmap_hdr_start.dts')
         fdtmap_pos = 0x100 + len(U_BOOT_DATA)
         hdr_data = data[:8]
-        self.assertEqual('BinM', hdr_data[:4])
+        self.assertEqual(b'BinM', hdr_data[:4])
         offset = struct.unpack('<I', hdr_data[4:])[0]
         self.assertEqual(fdtmap_pos, offset)
 
@@ -2174,7 +2174,7 @@ class TestFunctional(unittest.TestCase):
         data = self.data = self._DoReadFileRealDtb('118_fdtmap_hdr_pos.dts')
         fdtmap_pos = 0x100 + len(U_BOOT_DATA)
         hdr_data = data[0x80:0x88]
-        self.assertEqual('BinM', hdr_data[:4])
+        self.assertEqual(b'BinM', hdr_data[:4])
         offset = struct.unpack('<I', hdr_data[4:])[0]
         self.assertEqual(fdtmap_pos, offset)
 
@@ -2435,9 +2435,9 @@ class TestFunctional(unittest.TestCase):
 '  section               100   %x  section          100' % section_size,
 '    cbfs                100   400  cbfs               0',
 '      u-boot            138     4  u-boot            38',
-'      u-boot-dtb        180   10f  u-boot-dtb        80          3c9',
+'      u-boot-dtb        180   105  u-boot-dtb        80          3c9',
 '    u-boot-dtb          500   %x  u-boot-dtb       400          3c9' % fdt_size,
-'  fdtmap                %x   3b4  fdtmap           %x' %
+'  fdtmap                %x   3bd  fdtmap           %x' %
         (fdtmap_offset, fdtmap_offset),
 '  image-header          bf8     8  image-header     bf8',
             ]
@@ -2522,7 +2522,7 @@ class TestFunctional(unittest.TestCase):
         data = self._RunExtractCmd('section')
         cbfs_data = data[:0x400]
         cbfs = cbfs_util.CbfsReader(cbfs_data)
-        self.assertEqual(['u-boot', 'u-boot-dtb', ''], cbfs.files.keys())
+        self.assertEqual(['u-boot', 'u-boot-dtb', ''], list(cbfs.files.keys()))
         dtb_data = data[0x400:]
         dtb = self._decompress(dtb_data)
         self.assertEqual(EXTRACT_DTB_SIZE, len(dtb))
@@ -3304,12 +3304,9 @@ class TestFunctional(unittest.TestCase):
         self.assertIn("'intel-fit-ptr' section must have an 'intel-fit' sibling",
                       str(e.exception))
 
-    def testSymbolsTplSection(self):
-        """Test binman can assign symbols embedded in U-Boot TPL in a section"""
-        self._SetupSplElf('u_boot_binman_syms')
-        self._SetupTplElf('u_boot_binman_syms')
-        data = self._DoReadFile('149_symbols_tpl.dts')
-        sym_values = struct.pack('<LQLL', 4, 0x1c, 0x34, 4)
+    def _CheckSymbolsTplSection(self, dts, expected_vals):
+        data = self._DoReadFile(dts)
+        sym_values = struct.pack('<LQLL', *expected_vals)
         upto1 = 4 + len(U_BOOT_SPL_DATA)
         expected1 = tools.GetBytes(0xff, 4) + sym_values + U_BOOT_SPL_DATA[20:]
         self.assertEqual(expected1, data[:upto1])
@@ -3323,7 +3320,22 @@ class TestFunctional(unittest.TestCase):
         self.assertEqual(expected3, data[upto2:upto3])
 
         expected4 = sym_values + U_BOOT_TPL_DATA[20:]
-        self.assertEqual(expected4, data[upto3:])
+        self.assertEqual(expected4, data[upto3:upto3 + len(U_BOOT_TPL_DATA)])
+
+    def testSymbolsTplSection(self):
+        """Test binman can assign symbols embedded in U-Boot TPL in a section"""
+        self._SetupSplElf('u_boot_binman_syms')
+        self._SetupTplElf('u_boot_binman_syms')
+        self._CheckSymbolsTplSection('149_symbols_tpl.dts',
+                                     [0x04, 0x1c, 0x10 + 0x34, 0x04])
+
+    def testSymbolsTplSectionX86(self):
+        """Test binman can assign symbols in a section with end-at-4gb"""
+        self._SetupSplElf('u_boot_binman_syms_x86')
+        self._SetupTplElf('u_boot_binman_syms_x86')
+        self._CheckSymbolsTplSection('155_symbols_tpl_x86.dts',
+                                     [0xffffff04, 0xffffff1c, 0xffffff34,
+                                      0x04])
 
     def testPackX86RomIfwiSectiom(self):
         """Test that a section can be placed in an IFWI region"""
index 4004f789b7c3964bac5bc6e229d49b0597bc16ca..10f85d1081fec9c0fe3b1cde987d69b3cccacd2d 100644 (file)
@@ -13,7 +13,7 @@ class TestImage(unittest.TestCase):
     def testInvalidFormat(self):
         image = Image('name', 'node', test=True)
         with self.assertRaises(ValueError) as e:
-            image.LookupSymbol('_binman_something_prop_', False, 'msg')
+            image.LookupSymbol('_binman_something_prop_', False, 'msg', 0)
         self.assertIn(
             "msg: Symbol '_binman_something_prop_' has invalid format",
             str(e.exception))
@@ -22,7 +22,7 @@ class TestImage(unittest.TestCase):
         image = Image('name', 'node', test=True)
         image._entries = {}
         with self.assertRaises(ValueError) as e:
-            image.LookupSymbol('_binman_type_prop_pname', False, 'msg')
+            image.LookupSymbol('_binman_type_prop_pname', False, 'msg', 0)
         self.assertIn("msg: Entry 'type' not found in list ()",
                       str(e.exception))
 
@@ -30,7 +30,7 @@ class TestImage(unittest.TestCase):
         image = Image('name', 'node', test=True)
         image._entries = {}
         with capture_sys_output() as (stdout, stderr):
-            val = image.LookupSymbol('_binman_type_prop_pname', True, 'msg')
+            val = image.LookupSymbol('_binman_type_prop_pname', True, 'msg', 0)
         self.assertEqual(val, None)
         self.assertEqual("Warning: msg: Entry 'type' not found in list ()\n",
                          stderr.getvalue())
@@ -40,5 +40,5 @@ class TestImage(unittest.TestCase):
         image = Image('name', 'node', test=True)
         image._entries = {'u-boot': 1}
         with self.assertRaises(ValueError) as e:
-            image.LookupSymbol('_binman_u_boot_prop_bad', False, 'msg')
+            image.LookupSymbol('_binman_u_boot_prop_bad', False, 'msg', 0)
         self.assertIn("msg: No such property 'bad", str(e.exception))
diff --git a/tools/binman/test/155_symbols_tpl_x86.dts b/tools/binman/test/155_symbols_tpl_x86.dts
new file mode 100644 (file)
index 0000000..72ca447
--- /dev/null
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/dts-v1/;
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       binman {
+               pad-byte = <0xff>;
+               end-at-4gb;
+               size = <0x100>;
+               u-boot-spl {
+                       offset = <0xffffff04>;
+               };
+
+               u-boot-spl2 {
+                       offset = <0xffffff1c>;
+                       type = "u-boot-spl";
+               };
+
+               u-boot {
+                       offset = <0xffffff34>;
+               };
+
+               section {
+                       u-boot-tpl {
+                               type = "u-boot-tpl";
+                       };
+               };
+       };
+};
index bdbb009874d4a6a1016a4735328ce22ce4456442..e4fd97bb2e11b6361efa9ac42f892e7c6d898afc 100644 (file)
@@ -14,10 +14,11 @@ CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \
 LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds
 LDS_BINMAN := -T $(SRC)u_boot_binman_syms.lds
 LDS_BINMAN_BAD := -T $(SRC)u_boot_binman_syms_bad.lds
+LDS_BINMAN_X86 := -T $(SRC)u_boot_binman_syms_x86.lds
 
 TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \
        u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \
-       u_boot_binman_syms_size
+       u_boot_binman_syms_size u_boot_binman_syms_x86
 
 all: $(TARGETS)
 
@@ -36,6 +37,9 @@ u_boot_binman_syms.bin: u_boot_binman_syms
 u_boot_binman_syms: CFLAGS += $(LDS_BINMAN)
 u_boot_binman_syms: u_boot_binman_syms.c
 
+u_boot_binman_syms_x86: CFLAGS += $(LDS_BINMAN_X86)
+u_boot_binman_syms_x86: u_boot_binman_syms_x86.c
+
 u_boot_binman_syms_bad: CFLAGS += $(LDS_BINMAN_BAD)
 u_boot_binman_syms_bad: u_boot_binman_syms_bad.c
 
diff --git a/tools/binman/test/u_boot_binman_syms_x86.c b/tools/binman/test/u_boot_binman_syms_x86.c
new file mode 120000 (symlink)
index 0000000..939b2e9
--- /dev/null
@@ -0,0 +1 @@
+u_boot_binman_syms.c
\ No newline at end of file
diff --git a/tools/binman/test/u_boot_binman_syms_x86.lds b/tools/binman/test/u_boot_binman_syms_x86.lds
new file mode 100644 (file)
index 0000000..9daf86f
--- /dev/null
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2016 Google, Inc
+ */
+
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+
+SECTIONS
+{
+       . = 0xffffff00;
+       _start = .;
+
+       . = ALIGN(4);
+       .text :
+       {
+               __image_copy_start = .;
+               *(.text*)
+       }
+
+       . = ALIGN(4);
+       .binman_sym_table : {
+               __binman_sym_start = .;
+               KEEP(*(SORT(.binman_sym*)));
+               __binman_sym_end = .;
+       }
+       .interp : { *(.interp*) }
+
+}
index 2a1d021574c1396098dafd41689e62311aa9f289..447aaabea86a6be89444b7842b8ffd52d5c54705 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2012 The Chromium OS Authors.
 
+from collections import OrderedDict
 import re
 
 class Expr:
@@ -120,7 +121,7 @@ class Boards:
         Args:
             fname: Filename of boards.cfg file
         """
-        with open(fname, 'r') as fd:
+        with open(fname, 'r', encoding='utf-8') as fd:
             for line in fd:
                 if line[0] == '#':
                     continue
@@ -155,7 +156,7 @@ class Boards:
                 key is board.target
                 value is board
         """
-        board_dict = {}
+        board_dict = OrderedDict()
         for board in self._boards:
             board_dict[board.target] = board
         return board_dict
@@ -166,7 +167,7 @@ class Boards:
         Returns:
             List of Board objects that are marked selected
         """
-        board_dict = {}
+        board_dict = OrderedDict()
         for board in self._boards:
             if board.build_it:
                 board_dict[board.target] = board
@@ -259,7 +260,7 @@ class Boards:
                     due to each argument, arranged by argument.
                 List of errors found
         """
-        result = {}
+        result = OrderedDict()
         warnings = []
         terms = self._BuildTerms(args)
 
index 03d7439aa5436f5ee143a749808ec6bb2e94830d..0b7208da373019b31559bd000b55770a3d7d65fd 100644 (file)
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2012 The Chromium OS Authors.
 
-import ConfigParser
+import configparser
 import os
-import StringIO
+import io
 
 
 def Setup(fname=''):
@@ -15,20 +15,20 @@ def Setup(fname=''):
     global settings
     global config_fname
 
-    settings = ConfigParser.SafeConfigParser()
+    settings = configparser.SafeConfigParser()
     if fname is not None:
         config_fname = fname
         if config_fname == '':
             config_fname = '%s/.buildman' % os.getenv('HOME')
         if not os.path.exists(config_fname):
-            print 'No config file found ~/.buildman\nCreating one...\n'
+            print('No config file found ~/.buildman\nCreating one...\n')
             CreateBuildmanConfigFile(config_fname)
-            print 'To install tool chains, please use the --fetch-arch option'
+            print('To install tool chains, please use the --fetch-arch option')
         if config_fname:
             settings.read(config_fname)
 
 def AddFile(data):
-    settings.readfp(StringIO.StringIO(data))
+    settings.readfp(io.StringIO(data))
 
 def GetItems(section):
     """Get the items from a section of the config.
@@ -41,7 +41,7 @@ def GetItems(section):
     """
     try:
         return settings.items(section)
-    except ConfigParser.NoSectionError as e:
+    except configparser.NoSectionError as e:
         return []
     except:
         raise
@@ -68,10 +68,10 @@ def CreateBuildmanConfigFile(config_fname):
     try:
         f = open(config_fname, 'w')
     except IOError:
-        print "Couldn't create buildman config file '%s'\n" % config_fname
+        print("Couldn't create buildman config file '%s'\n" % config_fname)
         raise
 
-    print >>f, '''[toolchain]
+    print('''[toolchain]
 # name = path
 # e.g. x86 = /opt/gcc-4.6.3-nolibc/x86_64-linux
 
@@ -93,5 +93,5 @@ openrisc = or1k
 # snapper-boards=ENABLE_AT91_TEST=1
 # snapper9260=${snapper-boards} BUILD_TAG=442
 # snapper9g45=${snapper-boards} BUILD_TAG=443
-'''
+''', file=f)
     f.close();
index fbb236676c70c08acf9c57af9ef35442caec44a5..cfbe4c26b1a99b4ebce4ded5c8fab2df00921854 100644 (file)
@@ -9,7 +9,7 @@ from datetime import datetime, timedelta
 import glob
 import os
 import re
-import Queue
+import queue
 import shutil
 import signal
 import string
@@ -92,11 +92,10 @@ u-boot/             source directory
 """
 
 # Possible build outcomes
-OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = range(4)
+OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN = list(range(4))
 
 # Translate a commit subject into a valid filename (and handle unicode)
-trans_valid_chars = string.maketrans('/: ', '---')
-trans_valid_chars = trans_valid_chars.decode('latin-1')
+trans_valid_chars = str.maketrans('/: ', '---')
 
 BASE_CONFIG_FILENAMES = [
     'u-boot.cfg', 'u-boot-spl.cfg', 'u-boot-tpl.cfg'
@@ -122,8 +121,8 @@ class Config:
     def __hash__(self):
         val = 0
         for fname in self.config:
-            for key, value in self.config[fname].iteritems():
-                print key, value
+            for key, value in self.config[fname].items():
+                print(key, value)
                 val = val ^ hash(key) & hash(value)
         return val
 
@@ -293,8 +292,8 @@ class Builder:
         self._re_dtb_warning = re.compile('(.*): Warning .*')
         self._re_note = re.compile('(.*):(\d*):(\d*): note: this is the location of the previous.*')
 
-        self.queue = Queue.Queue()
-        self.out_queue = Queue.Queue()
+        self.queue = queue.Queue()
+        self.out_queue = queue.Queue()
         for i in range(self.num_threads):
             t = builderthread.BuilderThread(self, i, incremental,
                     per_board_out_dir)
@@ -781,7 +780,7 @@ class Builder:
         config = {}
         environment = {}
 
-        for board in boards_selected.itervalues():
+        for board in boards_selected.values():
             outcome = self.GetBuildOutcome(commit_upto, board.target,
                                            read_func_sizes, read_config,
                                            read_environment)
@@ -814,13 +813,13 @@ class Builder:
             tconfig = Config(self.config_filenames, board.target)
             for fname in self.config_filenames:
                 if outcome.config:
-                    for key, value in outcome.config[fname].iteritems():
+                    for key, value in outcome.config[fname].items():
                         tconfig.Add(fname, key, value)
             config[board.target] = tconfig
 
             tenvironment = Environment(board.target)
             if outcome.environment:
-                for key, value in outcome.environment.iteritems():
+                for key, value in outcome.environment.items():
                     tenvironment.Add(key, value)
             environment[board.target] = tenvironment
 
@@ -1040,12 +1039,12 @@ class Builder:
 
         # We now have a list of image size changes sorted by arch
         # Print out a summary of these
-        for arch, target_list in arch_list.iteritems():
+        for arch, target_list in arch_list.items():
             # Get total difference for each type
             totals = {}
             for result in target_list:
                 total = 0
-                for name, diff in result.iteritems():
+                for name, diff in result.items():
                     if name.startswith('_'):
                         continue
                     total += diff
@@ -1250,7 +1249,7 @@ class Builder:
             if self._show_unknown:
                 self.AddOutcome(board_selected, arch_list, unknown_boards, '?',
                         self.col.MAGENTA)
-            for arch, target_list in arch_list.iteritems():
+            for arch, target_list in arch_list.items():
                 Print('%10s: %s' % (arch, target_list))
                 self._error_lines += 1
             if better_err:
@@ -1283,13 +1282,13 @@ class Builder:
                 environment_minus = {}
                 environment_change = {}
                 base = tbase.environment
-                for key, value in tenvironment.environment.iteritems():
+                for key, value in tenvironment.environment.items():
                     if key not in base:
                         environment_plus[key] = value
-                for key, value in base.iteritems():
+                for key, value in base.items():
                     if key not in tenvironment.environment:
                         environment_minus[key] = value
-                for key, value in base.iteritems():
+                for key, value in base.items():
                     new_value = tenvironment.environment.get(key)
                     if new_value and value != new_value:
                         desc = '%s -> %s' % (value, new_value)
@@ -1342,15 +1341,15 @@ class Builder:
                     config_minus = {}
                     config_change = {}
                     base = tbase.config[name]
-                    for key, value in tconfig.config[name].iteritems():
+                    for key, value in tconfig.config[name].items():
                         if key not in base:
                             config_plus[key] = value
                             all_config_plus[key] = value
-                    for key, value in base.iteritems():
+                    for key, value in base.items():
                         if key not in tconfig.config[name]:
                             config_minus[key] = value
                             all_config_minus[key] = value
-                    for key, value in base.iteritems():
+                    for key, value in base.items():
                         new_value = tconfig.config.get(key)
                         if new_value and value != new_value:
                             desc = '%s -> %s' % (value, new_value)
@@ -1368,7 +1367,7 @@ class Builder:
                 summary[target] = '\n'.join(lines)
 
             lines_by_target = {}
-            for target, lines in summary.iteritems():
+            for target, lines in summary.items():
                 if lines in lines_by_target:
                     lines_by_target[lines].append(target)
                 else:
@@ -1392,7 +1391,7 @@ class Builder:
                     Print('%s:' % arch)
                     _OutputConfigInfo(lines)
 
-            for lines, targets in lines_by_target.iteritems():
+            for lines, targets in lines_by_target.items():
                 if not lines:
                     continue
                 Print('%s :' % ' '.join(sorted(targets)))
@@ -1463,7 +1462,7 @@ class Builder:
             commits: Selected commits to build
         """
         # First work out how many commits we will build
-        count = (self.commit_count + self._step - 1) / self._step
+        count = (self.commit_count + self._step - 1) // self._step
         self.count = len(board_selected) * count
         self.upto = self.warned = self.fail = 0
         self._timestamps = collections.deque()
@@ -1566,7 +1565,7 @@ class Builder:
         self.ProcessResult(None)
 
         # Create jobs to build all commits for each board
-        for brd in board_selected.itervalues():
+        for brd in board_selected.values():
             job = builderthread.BuilderJob()
             job.board = brd
             job.commits = commits
index 8a9d47cd5e4bc7281b7b3acf5d7f23a9c8fdf5ea..570c1f6595c93259255296c817a4f9d10bb1c805 100644 (file)
@@ -28,7 +28,7 @@ def Mkdir(dirname, parents = False):
     except OSError as err:
         if err.errno == errno.EEXIST:
             if os.path.realpath('.') == os.path.realpath(dirname):
-                print "Cannot create the current working directory '%s'!" % dirname
+                print("Cannot create the current working directory '%s'!" % dirname)
                 sys.exit(1)
             pass
         else:
@@ -291,15 +291,13 @@ class BuilderThread(threading.Thread):
         outfile = os.path.join(build_dir, 'log')
         with open(outfile, 'w') as fd:
             if result.stdout:
-                # We don't want unicode characters in log files
-                fd.write(result.stdout.decode('UTF-8').encode('ASCII', 'replace'))
+                fd.write(result.stdout)
 
         errfile = self.builder.GetErrFile(result.commit_upto,
                 result.brd.target)
         if result.stderr:
             with open(errfile, 'w') as fd:
-                # We don't want unicode characters in log files
-                fd.write(result.stderr.decode('UTF-8').encode('ASCII', 'replace'))
+                fd.write(result.stderr)
         elif os.path.exists(errfile):
             os.remove(errfile)
 
@@ -314,17 +312,17 @@ class BuilderThread(threading.Thread):
                 else:
                     fd.write('%s' % result.return_code)
             with open(os.path.join(build_dir, 'toolchain'), 'w') as fd:
-                print >>fd, 'gcc', result.toolchain.gcc
-                print >>fd, 'path', result.toolchain.path
-                print >>fd, 'cross', result.toolchain.cross
-                print >>fd, 'arch', result.toolchain.arch
+                print('gcc', result.toolchain.gcc, file=fd)
+                print('path', result.toolchain.path, file=fd)
+                print('cross', result.toolchain.cross, file=fd)
+                print('arch', result.toolchain.arch, file=fd)
                 fd.write('%s' % result.return_code)
 
             # Write out the image and function size information and an objdump
             env = result.toolchain.MakeEnvironment(self.builder.full_path)
             with open(os.path.join(build_dir, 'env'), 'w') as fd:
                 for var in sorted(env.keys()):
-                    print >>fd, '%s="%s"' % (var, env[var])
+                    print('%s="%s"' % (var, env[var]), file=fd)
             lines = []
             for fname in ['u-boot', 'spl/u-boot-spl']:
                 cmd = ['%snm' % self.toolchain.cross, '--size-sort', fname]
@@ -335,7 +333,7 @@ class BuilderThread(threading.Thread):
                     nm = self.builder.GetFuncSizesFile(result.commit_upto,
                                     result.brd.target, fname)
                     with open(nm, 'w') as fd:
-                        print >>fd, nm_result.stdout,
+                        print(nm_result.stdout, end=' ', file=fd)
 
                 cmd = ['%sobjdump' % self.toolchain.cross, '-h', fname]
                 dump_result = command.RunPipe([cmd], capture=True,
@@ -346,7 +344,7 @@ class BuilderThread(threading.Thread):
                     objdump = self.builder.GetObjdumpFile(result.commit_upto,
                                     result.brd.target, fname)
                     with open(objdump, 'w') as fd:
-                        print >>fd, dump_result.stdout,
+                        print(dump_result.stdout, end=' ', file=fd)
                     for line in dump_result.stdout.splitlines():
                         fields = line.split()
                         if len(fields) > 5 and fields[1] == '.rodata':
@@ -378,7 +376,7 @@ class BuilderThread(threading.Thread):
                 sizes = self.builder.GetSizesFile(result.commit_upto,
                                 result.brd.target)
                 with open(sizes, 'w') as fd:
-                    print >>fd, '\n'.join(lines)
+                    print('\n'.join(lines), file=fd)
 
         # Write out the configuration files, with a special case for SPL
         for dirname in ['', 'spl', 'tpl']:
index f17aa15e7c548bbe9bb34402f072867c76c768fc..30a8690f9352ce9620f05dc386768ec1bc11fe48 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (c) 2012 The Chromium OS Authors.
@@ -6,6 +6,8 @@
 
 """See README for more information"""
 
+from __future__ import print_function
+
 import multiprocessing
 import os
 import re
@@ -46,11 +48,11 @@ def RunTests(skip_net_tests):
         suite = unittest.TestLoader().loadTestsFromTestCase(module)
         suite.run(result)
 
-    print result
+    print(result)
     for test, err in result.errors:
-        print err
+        print(err)
     for test, err in result.failures:
-        print err
+        print(err)
 
 
 options, args = cmdline.ParseArgs()
index 9787b8674761646dc36c4e365ef361a441c0f27c..216012d00168f25b4ce6e41c40212f2b90535f73 100644 (file)
@@ -30,7 +30,7 @@ def GetActionSummary(is_summary, commits, selected, options):
     """
     if commits:
         count = len(commits)
-        count = (count + options.step - 1) / options.step
+        count = (count + options.step - 1) // options.step
         commit_str = '%d commit%s' % (count, GetPlural(count))
     else:
         commit_str = 'current source'
@@ -59,31 +59,31 @@ def ShowActions(series, why_selected, boards_selected, builder, options,
         board_warnings: List of warnings obtained from board selected
     """
     col = terminal.Color()
-    print 'Dry run, so not doing much. But I would do this:'
-    print
+    print('Dry run, so not doing much. But I would do this:')
+    print()
     if series:
         commits = series.commits
     else:
         commits = None
-    print GetActionSummary(False, commits, boards_selected,
-            options)
-    print 'Build directory: %s' % builder.base_dir
+    print(GetActionSummary(False, commits, boards_selected,
+            options))
+    print('Build directory: %s' % builder.base_dir)
     if commits:
         for upto in range(0, len(series.commits), options.step):
             commit = series.commits[upto]
-            print '   ', col.Color(col.YELLOW, commit.hash[:8], bright=False),
-            print commit.subject
-    print
+            print('   ', col.Color(col.YELLOW, commit.hash[:8], bright=False), end=' ')
+            print(commit.subject)
+    print()
     for arg in why_selected:
         if arg != 'all':
-            print arg, ': %d boards' % len(why_selected[arg])
+            print(arg, ': %d boards' % len(why_selected[arg]))
             if options.verbose:
-                print '   %s' % ' '.join(why_selected[arg])
-    print ('Total boards to build for each commit: %d\n' %
-            len(why_selected['all']))
+                print('   %s' % ' '.join(why_selected[arg]))
+    print(('Total boards to build for each commit: %d\n' %
+            len(why_selected['all'])))
     if board_warnings:
         for warning in board_warnings:
-            print col.Color(col.YELLOW, warning)
+            print(col.Color(col.YELLOW, warning))
 
 def CheckOutputDir(output_dir):
     """Make sure that the output directory is not within the current directory
@@ -146,17 +146,17 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
     if options.fetch_arch:
         if options.fetch_arch == 'list':
             sorted_list = toolchains.ListArchs()
-            print col.Color(col.BLUE, 'Available architectures: %s\n' %
-                            ' '.join(sorted_list))
+            print(col.Color(col.BLUE, 'Available architectures: %s\n' %
+                            ' '.join(sorted_list)))
             return 0
         else:
             fetch_arch = options.fetch_arch
             if fetch_arch == 'all':
                 fetch_arch = ','.join(toolchains.ListArchs())
-                print col.Color(col.CYAN, '\nDownloading toolchains: %s' %
-                                fetch_arch)
+                print(col.Color(col.CYAN, '\nDownloading toolchains: %s' %
+                                fetch_arch))
             for arch in fetch_arch.split(','):
-                print
+                print()
                 ret = toolchains.FetchAndInstall(arch)
                 if ret:
                     return ret
@@ -167,7 +167,7 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
         toolchains.Scan(options.list_tool_chains and options.verbose)
     if options.list_tool_chains:
         toolchains.List()
-        print
+        print()
         return 0
 
     # Work out how many commits to build. We want to build everything on the
@@ -191,7 +191,7 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
                 sys.exit(col.Color(col.RED, "Range '%s' has no commits" %
                                    options.branch))
             if msg:
-                print col.Color(col.YELLOW, msg)
+                print(col.Color(col.YELLOW, msg))
             count += 1   # Build upstream commit also
 
     if not count:
@@ -268,7 +268,7 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
         options.threads = min(multiprocessing.cpu_count(), len(selected))
     if not options.jobs:
         options.jobs = max(1, (multiprocessing.cpu_count() +
-                len(selected) - 1) / len(selected))
+                len(selected) - 1) // len(selected))
 
     if not options.step:
         options.step = len(series.commits) - 1
index f90b8ea7f5da467fe77f3aa811fa2642ce580617..4c3d497294d198eec76d3f773e1445cb1bddcbfb 100644 (file)
@@ -270,7 +270,7 @@ class TestFunctional(unittest.TestCase):
                                             stdout=''.join(commit_log[:count]))
 
         # Not handled, so abort
-        print 'git log', args
+        print('git log', args)
         sys.exit(1)
 
     def _HandleCommandGitConfig(self, args):
@@ -286,7 +286,7 @@ class TestFunctional(unittest.TestCase):
                                          stdout='refs/heads/master\n')
 
         # Not handled, so abort
-        print 'git config', args
+        print('git config', args)
         sys.exit(1)
 
     def _HandleCommandGit(self, in_args):
@@ -320,7 +320,7 @@ class TestFunctional(unittest.TestCase):
             return command.CommandResult(return_code=0)
 
         # Not handled, so abort
-        print 'git', git_args, sub_cmd, args
+        print('git', git_args, sub_cmd, args)
         sys.exit(1)
 
     def _HandleCommandNm(self, args):
@@ -351,7 +351,7 @@ class TestFunctional(unittest.TestCase):
             if pipe_list[1] == ['wc', '-l']:
                 wc = True
             else:
-                print 'invalid pipe', kwargs
+                print('invalid pipe', kwargs)
                 sys.exit(1)
         cmd = pipe_list[0][0]
         args = pipe_list[0][1:]
@@ -371,7 +371,7 @@ class TestFunctional(unittest.TestCase):
 
         if not result:
             # Not handled, so abort
-            print 'unknown command', kwargs
+            print('unknown command', kwargs)
             sys.exit(1)
 
         if wc:
@@ -404,14 +404,14 @@ class TestFunctional(unittest.TestCase):
             return command.CommandResult(return_code=0)
 
         # Not handled, so abort
-        print 'make', stage
+        print('make', stage)
         sys.exit(1)
 
     # Example function to print output lines
     def print_lines(self, lines):
-        print len(lines)
+        print(len(lines))
         for line in lines:
-            print line
+            print(line)
         #self.print_lines(terminal.GetPrintTestLines())
 
     def testNoBoards(self):
index ed99b9375c403d473c8e7694b2322c78093a02f4..b4e28d68676d543e7ee0a249d5c093808dc12755 100644 (file)
@@ -212,11 +212,11 @@ class TestBuild(unittest.TestCase):
         self.assertEqual(lines[1].text, '02: %s' % commits[1][1])
 
         col = terminal.Color()
-        self.assertSummary(lines[2].text, 'sandbox', 'w+', ['board4'],
+        self.assertSummary(lines[2].text, 'arm', 'w+', ['board1'],
                            outcome=OUTCOME_WARN)
-        self.assertSummary(lines[3].text, 'arm', 'w+', ['board1'],
+        self.assertSummary(lines[3].text, 'powerpc', 'w+', ['board2', 'board3'],
                            outcome=OUTCOME_WARN)
-        self.assertSummary(lines[4].text, 'powerpc', 'w+', ['board2', 'board3'],
+        self.assertSummary(lines[4].text, 'sandbox', 'w+', ['board4'],
                            outcome=OUTCOME_WARN)
 
         # Second commit: The warnings should be listed
@@ -226,10 +226,10 @@ class TestBuild(unittest.TestCase):
 
         # Third commit: Still fails
         self.assertEqual(lines[6].text, '03: %s' % commits[2][1])
-        self.assertSummary(lines[7].text, 'sandbox', '+', ['board4'])
-        self.assertSummary(lines[8].text, 'arm', '', ['board1'],
+        self.assertSummary(lines[7].text, 'arm', '', ['board1'],
                            outcome=OUTCOME_OK)
-        self.assertSummary(lines[9].text, 'powerpc', '+', ['board2', 'board3'])
+        self.assertSummary(lines[8].text, 'powerpc', '+', ['board2', 'board3'])
+        self.assertSummary(lines[9].text, 'sandbox', '+', ['board4'])
 
         # Expect a compiler error
         self.assertEqual(lines[10].text, '+%s' %
@@ -237,8 +237,6 @@ class TestBuild(unittest.TestCase):
 
         # Fourth commit: Compile errors are fixed, just have warning for board3
         self.assertEqual(lines[11].text, '04: %s' % commits[3][1])
-        self.assertSummary(lines[12].text, 'sandbox', 'w+', ['board4'],
-                           outcome=OUTCOME_WARN)
         expect = '%10s: ' % 'powerpc'
         expect += ' ' + col.Color(col.GREEN, '')
         expect += '  '
@@ -246,7 +244,9 @@ class TestBuild(unittest.TestCase):
         expect += ' ' + col.Color(col.YELLOW, 'w+')
         expect += '  '
         expect += col.Color(col.YELLOW, ' %s' % 'board3')
-        self.assertEqual(lines[13].text, expect)
+        self.assertEqual(lines[12].text, expect)
+        self.assertSummary(lines[13].text, 'sandbox', 'w+', ['board4'],
+                           outcome=OUTCOME_WARN)
 
         # Compile error fixed
         self.assertEqual(lines[14].text, '-%s' %
@@ -259,9 +259,9 @@ class TestBuild(unittest.TestCase):
 
         # Fifth commit
         self.assertEqual(lines[16].text, '05: %s' % commits[4][1])
-        self.assertSummary(lines[17].text, 'sandbox', '+', ['board4'])
-        self.assertSummary(lines[18].text, 'powerpc', '', ['board3'],
+        self.assertSummary(lines[17].text, 'powerpc', '', ['board3'],
                            outcome=OUTCOME_OK)
+        self.assertSummary(lines[18].text, 'sandbox', '+', ['board4'])
 
         # The second line of errors[3] is a duplicate, so buildman will drop it
         expect = errors[3].rstrip().split('\n')
index a65737fdf84b586e04791b8c9e8b5c507c68effe..cc26e2ede5737bb0814fda9216cde42ee0faf73f 100644 (file)
@@ -4,18 +4,19 @@
 
 import re
 import glob
-from HTMLParser import HTMLParser
+from html.parser import HTMLParser
 import os
 import sys
 import tempfile
-import urllib2
+import urllib.request, urllib.error, urllib.parse
 
 import bsettings
 import command
 import terminal
+import tools
 
 (PRIORITY_FULL_PREFIX, PRIORITY_PREFIX_GCC, PRIORITY_PREFIX_GCC_PATH,
-    PRIORITY_CALC) = range(4)
+    PRIORITY_CALC) = list(range(4))
 
 # Simple class to collect links from a page
 class MyHTMLParser(HTMLParser):
@@ -100,15 +101,15 @@ class Toolchain:
                                      raise_on_error=False)
             self.ok = result.return_code == 0
             if verbose:
-                print 'Tool chain test: ',
+                print('Tool chain test: ', end=' ')
                 if self.ok:
-                    print "OK, arch='%s', priority %d" % (self.arch,
-                                                          self.priority)
+                    print("OK, arch='%s', priority %d" % (self.arch,
+                                                          self.priority))
                 else:
-                    print 'BAD'
-                    print 'Command: ', cmd
-                    print result.stdout
-                    print result.stderr
+                    print('BAD')
+                    print('Command: ', cmd)
+                    print(result.stdout)
+                    print(result.stderr)
         else:
             self.ok = True
 
@@ -138,7 +139,7 @@ class Toolchain:
         value = ''
         for name, value in bsettings.GetItems('toolchain-wrapper'):
             if not value:
-                print "Warning: Wrapper not found"
+                print("Warning: Wrapper not found")
         if value:
             value = value + ' '
 
@@ -227,11 +228,11 @@ class Toolchains:
         """
         toolchains = bsettings.GetItems('toolchain')
         if show_warning and not toolchains:
-            print ("Warning: No tool chains. Please run 'buildman "
+            print(("Warning: No tool chains. Please run 'buildman "
                    "--fetch-arch all' to download all available toolchains, or "
                    "add a [toolchain] section to your buildman config file "
                    "%s. See README for details" %
-                   bsettings.config_fname)
+                   bsettings.config_fname))
 
         paths = []
         for name, value in toolchains:
@@ -272,10 +273,10 @@ class Toolchains:
         if add_it:
             self.toolchains[toolchain.arch] = toolchain
         elif verbose:
-            print ("Toolchain '%s' at priority %d will be ignored because "
+            print(("Toolchain '%s' at priority %d will be ignored because "
                    "another toolchain for arch '%s' has priority %d" %
                    (toolchain.gcc, toolchain.priority, toolchain.arch,
-                    self.toolchains[toolchain.arch].priority))
+                    self.toolchains[toolchain.arch].priority)))
 
     def ScanPath(self, path, verbose):
         """Scan a path for a valid toolchain
@@ -289,9 +290,9 @@ class Toolchains:
         fnames = []
         for subdir in ['.', 'bin', 'usr/bin']:
             dirname = os.path.join(path, subdir)
-            if verbose: print "      - looking in '%s'" % dirname
+            if verbose: print("      - looking in '%s'" % dirname)
             for fname in glob.glob(dirname + '/*gcc'):
-                if verbose: print "         - found '%s'" % fname
+                if verbose: print("         - found '%s'" % fname)
                 fnames.append(fname)
         return fnames
 
@@ -321,9 +322,9 @@ class Toolchains:
         Args:
             verbose: True to print out progress information
         """
-        if verbose: print 'Scanning for tool chains'
+        if verbose: print('Scanning for tool chains')
         for name, value in self.prefixes:
-            if verbose: print "   - scanning prefix '%s'" % value
+            if verbose: print("   - scanning prefix '%s'" % value)
             if os.path.exists(value):
                 self.Add(value, True, verbose, PRIORITY_FULL_PREFIX, name)
                 continue
@@ -335,10 +336,10 @@ class Toolchains:
             for f in fname_list:
                 self.Add(f, True, verbose, PRIORITY_PREFIX_GCC_PATH, name)
             if not fname_list:
-                raise ValueError("No tool chain found for prefix '%s'" %
+                raise ValueError("No tool chain found for prefix '%s'" %
                                    value)
         for path in self.paths:
-            if verbose: print "   - scanning path '%s'" % path
+            if verbose: print("   - scanning path '%s'" % path)
             fnames = self.ScanPath(path, verbose)
             for fname in fnames:
                 self.Add(fname, True, verbose)
@@ -346,13 +347,13 @@ class Toolchains:
     def List(self):
         """List out the selected toolchains for each architecture"""
         col = terminal.Color()
-        print col.Color(col.BLUE, 'List of available toolchains (%d):' %
-                        len(self.toolchains))
+        print(col.Color(col.BLUE, 'List of available toolchains (%d):' %
+                        len(self.toolchains)))
         if len(self.toolchains):
-            for key, value in sorted(self.toolchains.iteritems()):
-                print '%-10s: %s' % (key, value.gcc)
+            for key, value in sorted(self.toolchains.items()):
+                print('%-10s: %s' % (key, value.gcc))
         else:
-            print 'None'
+            print('None')
 
     def Select(self, arch):
         """Returns the toolchain for a given architecture
@@ -370,7 +371,7 @@ class Toolchains:
                         return self.toolchains[alias]
 
         if not arch in self.toolchains:
-            raise ValueError("No tool chain found for arch '%s'" % arch)
+            raise ValueError("No tool chain found for arch '%s'" % arch)
         return self.toolchains[arch]
 
     def ResolveReferences(self, var_dict, args):
@@ -464,9 +465,9 @@ class Toolchains:
         links = []
         for version in versions:
             url = '%s/%s/%s/' % (base, arch, version)
-            print 'Checking: %s' % url
-            response = urllib2.urlopen(url)
-            html = response.read()
+            print('Checking: %s' % url)
+            response = urllib.request.urlopen(url)
+            html = tools.ToString(response.read())
             parser = MyHTMLParser(fetch_arch)
             parser.feed(html)
             if fetch_arch == 'list':
@@ -488,14 +489,14 @@ class Toolchains:
                 Full path to the downloaded archive file in that directory,
                     or None if there was an error while downloading
         """
-        print 'Downloading: %s' % url
+        print('Downloading: %s' % url)
         leaf = url.split('/')[-1]
         tmpdir = tempfile.mkdtemp('.buildman')
-        response = urllib2.urlopen(url)
+        response = urllib.request.urlopen(url)
         fname = os.path.join(tmpdir, leaf)
         fd = open(fname, 'wb')
         meta = response.info()
-        size = int(meta.getheaders('Content-Length')[0])
+        size = int(meta.get('Content-Length'))
         done = 0
         block_size = 1 << 16
         status = ''
@@ -504,19 +505,19 @@ class Toolchains:
         while True:
             buffer = response.read(block_size)
             if not buffer:
-                print chr(8) * (len(status) + 1), '\r',
+                print(chr(8) * (len(status) + 1), '\r', end=' ')
                 break
 
             done += len(buffer)
             fd.write(buffer)
-            status = r'%10d MiB  [%3d%%]' % (done / 1024 / 1024,
-                                             done * 100 / size)
+            status = r'%10d MiB  [%3d%%]' % (done // 1024 // 1024,
+                                             done * 100 // size)
             status = status + chr(8) * (len(status) + 1)
-            print status,
+            print(status, end=' ')
             sys.stdout.flush()
         fd.close()
         if done != size:
-            print 'Error, failed to download'
+            print('Error, failed to download')
             os.remove(fname)
             fname = None
         return tmpdir, fname
@@ -565,11 +566,11 @@ class Toolchains:
         """
         # Fist get the URL for this architecture
         col = terminal.Color()
-        print col.Color(col.BLUE, "Downloading toolchain for arch '%s'" % arch)
+        print(col.Color(col.BLUE, "Downloading toolchain for arch '%s'" % arch))
         url = self.LocateArchUrl(arch)
         if not url:
-            print ("Cannot find toolchain for arch '%s' - use 'list' to list" %
-                   arch)
+            print(("Cannot find toolchain for arch '%s' - use 'list' to list" %
+                   arch))
             return 2
         home = os.environ['HOME']
         dest = os.path.join(home, '.buildman-toolchains')
@@ -580,28 +581,28 @@ class Toolchains:
         tmpdir, tarfile = self.Download(url)
         if not tarfile:
             return 1
-        print col.Color(col.GREEN, 'Unpacking to: %s' % dest),
+        print(col.Color(col.GREEN, 'Unpacking to: %s' % dest), end=' ')
         sys.stdout.flush()
         path = self.Unpack(tarfile, dest)
         os.remove(tarfile)
         os.rmdir(tmpdir)
-        print
+        print()
 
         # Check that the toolchain works
-        print col.Color(col.GREEN, 'Testing')
+        print(col.Color(col.GREEN, 'Testing'))
         dirpath = os.path.join(dest, path)
         compiler_fname_list = self.ScanPath(dirpath, True)
         if not compiler_fname_list:
-            print 'Could not locate C compiler - fetch failed.'
+            print('Could not locate C compiler - fetch failed.')
             return 1
         if len(compiler_fname_list) != 1:
-            print col.Color(col.RED, 'Warning, ambiguous toolchains: %s' %
-                            ', '.join(compiler_fname_list))
+            print(col.Color(col.RED, 'Warning, ambiguous toolchains: %s' %
+                            ', '.join(compiler_fname_list)))
         toolchain = Toolchain(compiler_fname_list[0], True, True)
 
         # Make sure that it will be found by buildman
         if not self.TestSettingsHasPath(dirpath):
-            print ("Adding 'download' to config file '%s'" %
-                   bsettings.config_fname)
+            print(("Adding 'download' to config file '%s'" %
+                   bsettings.config_fname))
             bsettings.SetItem('toolchain', 'download', '%s/*/*' % dest)
         return 0
index 514e0dd4a34b683c53c40898539583044ddaf5ff..b3596a5918fe2a1f420064a25eec01da5a63f684 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (C) 2016 Google, Inc
index 6770be79fbe3a28fc6d6b8462769c06929e14de0..1b7b730359ae80c84260b58b85a3284a0c4f88a4 100644 (file)
@@ -56,9 +56,6 @@ def BytesToValue(data):
                 is_string = False
                 break
             for ch in string:
-                # Handle Python 2 treating bytes as str
-                if type(ch) == str:
-                    ch = ord(ch)
                 if ch < 32 or ch > 127:
                     is_string = False
                     break
@@ -66,15 +63,9 @@ def BytesToValue(data):
         is_string = False
     if is_string:
         if count == 1: 
-            if sys.version_info[0] >= 3:  # pragma: no cover
-                return TYPE_STRING, strings[0].decode()
-            else:
-                return TYPE_STRING, strings[0]
+            return TYPE_STRING, strings[0].decode()
         else:
-            if sys.version_info[0] >= 3:  # pragma: no cover
-                return TYPE_STRING, [s.decode() for s in strings[:-1]]
-            else:
-                return TYPE_STRING, strings[:-1]
+            return TYPE_STRING, [s.decode() for s in strings[:-1]]
     if size % 4:
         if size == 1:
             return TYPE_BYTE, tools.ToChar(data[0])
@@ -415,8 +406,8 @@ class Node:
             prop_name: Name of property to set
             val: String value to set (will be \0-terminated in DT)
         """
-        if sys.version_info[0] >= 3:  # pragma: no cover
-            val = bytes(val, 'utf-8')
+        if type(val) == str:
+            val = val.encode('utf-8')
         self._CheckProp(prop_name).props[prop_name].SetData(val + b'\0')
 
     def AddString(self, prop_name, val):
old mode 100644 (file)
new mode 100755 (executable)
index b915b27..d733b70
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2012 The Chromium OS Authors.
 #
index 028c8cbaa80b1f582749eeba93d3679234b7fbd9..3316757e61e3ede85355587edc4dd9c290c10838 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 # Copyright (c) 2018 Google, Inc
 # Written by Simon Glass <sjg@chromium.org>
diff --git a/tools/img2brec.sh b/tools/img2brec.sh
deleted file mode 100755 (executable)
index 0fcdba2..0000000
+++ /dev/null
@@ -1,388 +0,0 @@
-#!/bin/sh
-
-# This script converts binary files (u-boot.bin) into so called
-# bootstrap records that are accepted by Motorola's MC9328MX1/L
-# (a.k.a. DragaonBall i.MX) in "Bootstrap Mode"
-# 
-# The code for the SynchFlash programming routines is taken from
-# Bootloader\Bin\SyncFlash\programBoot_b.txt contained in
-# Motorolas LINUX_BSP_0_3_8.tar.gz 
-# 
-# The script could easily extended for AMD flash routines.
-#
-# 2004-06-23   -       steven.scholz@imc-berlin.de
-
-#################################################################################
-# From the posting to the U-Boot-Users mailing list, 23 Jun 2004:
-# ===============================================================
-# I just hacked a simple script that converts u-boot.bin into a text file 
-# containg processor init code, SynchFlash programming code and U-Boot data in 
-# form of so called b-records.
-# 
-# This can be used to programm U-Boot into (Synch)Flash using the Bootstrap 
-# Mode of the MC9328MX1/L
-# 
-# 0AFE1F3410202E2E2E000000002073756363656564/
-# 0AFE1F44102E0A0000206661696C656420210A0000/
-# 0AFE100000
-# ...
-# MX1ADS Sync-flash Programming Utility v0.5 2002/08/21
-# 
-# Source address (stored in 0x0AFE0000): 0x0A000000
-# Target address (stored in 0x0AFE0004): 0x0C000000
-# Size           (stored in 0x0AFE0008): 0x0001A320
-# 
-# Press any key to start programming ...
-# Erasing ...
-# Blank checking ...
-# Programming ...
-# Verifying flash ... succeed.
-# 
-# Programming finished.
-# 
-# So no need for a BDI2000 anymore... ;-)
-# 
-# This is working on my MX1ADS eval board. Hope this could be useful for 
-# someone.
-#################################################################################
-
-if [ "$#" -lt 1 -o "$#" -gt 2 ] ; then
-    echo "Usage: $0 infile [outfile]" >&2
-    echo "       $0 u-boot.bin [u-boot.brec]" >&2
-    exit 1
-fi
-
-if [ "$#" -ge 1 ] ; then
-    INFILE=$1
-fi
-
-if [ ! -f $INFILE ] ; then
-    echo "Error: file '$INFILE' does not exist." >&2
-    exit 1
-fi
-
-FILESIZE=`filesize $INFILE`
-
-output_init()
-{
-echo "\
-********************************************\r
-* Initialize I/O Pad Driving Strength      *\r
-********************************************\r
-0021B80CC4000003AB\r
-********************************************\r
-* Initialize SDRAM                         *\r
-********************************************\r
-00221000C492120200   ; pre-charge command\r
-08200000E4   ; special read\r
-\r
-00221000C4A2120200   ; auto-refresh command\r
-08000000E4   ; 8 special read\r
-08000000E4   ; 8 special read\r
-08000000E4   ; 8 special read\r
-08000000E4   ; 8 special read\r
-08000000E4   ; 8 special read\r
-08000000E4   ; 8 special read\r
-08000000E4   ; 8 special read\r
-08000000E4   ; 8 special read\r
-\r
-00221000C4B2120200   ; set mode register\r
-08111800E4   ; special read\r
-\r
-00221000C482124200   ; set normal mode\r
-\r"
-}
-
-output_uboot()
-{
-echo "\
-********************************************\r
-* U-Boot image as bootstrap records        *\r
-*   will be stored in SDRAM at 0x0A000000  *\r
-********************************************\r
-\r"
-
-cat $INFILE | \
-hexdump -v -e "\"0A0%05.5_ax10\" 16/1 \"%02x\"\"\r\n\"" | \
-tr [:lower:] [:upper:]
-}
-
-output_flashprog()
-{
-echo "\
-********************************************\r
-* Address of arguments to flashProg        *\r
-* ---------------------------------------- *\r
-* Source      : 0x0A000000                 *\r
-* Destination : 0x0C000000                 *\r"
-
-# get the real size of the U-Boot image
-printf "* Size        : 0x%08X                 *\r\n" $FILESIZE
-printf "********************************************\r\n"
-printf "0AFE0000CC0A0000000C000000%08X\r\n" $FILESIZE
-
-#;0AFE0000CC0A0000000C00000000006000\r
-
-echo "\
-********************************************\r
-* Flash Program                            *\r
-********************************************\r
-0AFE10001008D09FE5AC0000EA00F0A0E1A42DFE0A\r
-0AFE1010100080FE0A0DC0A0E100D82DE904B04CE2\r
-0AFE1020109820A0E318309FE5003093E5033082E0\r
-0AFE103010003093E5013003E2FF3003E20300A0E1\r
-0AFE10401000A81BE9A01DFE0A0DC0A0E100D82DE9\r
-0AFE10501004B04CE204D04DE20030A0E10D304BE5\r
-0AFE1060109820A0E330309FE5003093E5033082E0\r
-0AFE107010003093E5013903E2000053E3F7FFFF0A\r
-0AFE1080104020A0E310309FE5003093E5032082E0\r
-0AFE1090100D305BE5003082E500A81BE9A01DFE0A\r
-0AFE10A0100DC0A0E100D82DE904B04CE20000A0E1\r
-0AFE10B010D7FFFFEB0030A0E1FF3003E2000053E3\r
-0AFE10C010FAFFFF0A10309FE5003093E5003093E5\r
-0AFE10D010FF3003E20300A0E100A81BE9A01DFE0A\r
-0AFE10E0100DC0A0E100D82DE904B04CE204D04DE2\r
-0AFE10F0100030A0E10D304BE50D305BE52332A0E1\r
-0AFE1100100E304BE50E305BE5090053E30300009A\r
-0AFE1110100E305BE5373083E20E304BE5020000EA\r
-0AFE1120100E305BE5303083E20E304BE50E305BE5\r
-0AFE1130100300A0E1C3FFFFEB0D305BE50F3003E2\r
-0AFE1140100E304BE50E305BE5090053E30300009A\r
-0AFE1150100E305BE5373083E20E304BE5020000EA\r
-0AFE1160100E305BE5303083E20E304BE50E305BE5\r
-0AFE1170100300A0E1B3FFFFEB00A81BE90DC0A0E1\r
-0AFE11801000D82DE904B04CE21CD04DE210000BE5\r
-0AFE11901014100BE518200BE588009FE5E50200EB\r
-0AFE11A01010301BE51C300BE514301BE520300BE5\r
-0AFE11B0100030A0E324300BE524201BE518301BE5\r
-0AFE11C010030052E10000003A120000EA1C004BE2\r
-0AFE11D010002090E520104BE2003091E500C093E5\r
-0AFE11E010043083E2003081E5003092E5042082E2\r
-0AFE11F010002080E50C0053E10200000A0030A0E3\r
-0AFE12001028300BE5050000EA24301BE5043083E2\r
-0AFE12101024300BE5E7FFFFEA0130A0E328300BE5\r
-0AFE12201028001BE500A81BE9E81EFE0A0DC0A0E1\r
-0AFE12301000D82DE904B04CE214D04DE210000BE5\r
-0AFE12401014100BE56C009FE5BA0200EB10301BE5\r
-0AFE12501018300BE50030A0E31C300BE51C201BE5\r
-0AFE12601014301BE5030052E10000003A0D0000EA\r
-0AFE12701018304BE2002093E5001092E5042082E2\r
-0AFE128010002083E5010071E30200000A0030A0E3\r
-0AFE12901020300BE5050000EA1C301BE5043083E2\r
-0AFE12A0101C300BE5ECFFFFEA0130A0E320300BE5\r
-0AFE12B01020001BE500A81BE9001FFE0A0DC0A0E1\r
-0AFE12C01000D82DE904B04CE224D04DE20130A0E3\r
-0AFE12D01024300BE5A4229FE58139A0E3023A83E2\r
-0AFE12E010003082E59820A0E390329FE5003093E5\r
-0AFE12F010033082E0003093E5023903E2000053E3\r
-0AFE1300100300001A74229FE58139A0E3033A83E2\r
-0AFE131010003082E568029FE5860200EBAF36A0E3\r
-0AFE1320100E3883E2003093E510300BE554029FE5\r
-0AFE133010800200EB10301BE5233CA0E1FF3003E2\r
-0AFE1340100300A0E165FFFFEB10301BE52338A0E1\r
-0AFE135010FF3003E20300A0E160FFFFEB10301BE5\r
-0AFE1360102334A0E1FF3003E20300A0E15BFFFFEB\r
-0AFE13701010305BE50300A0E158FFFFEB0A00A0E3\r
-0AFE13801030FFFFEB0D00A0E32EFFFFEBAF36A0E3\r
-0AFE1390100E3883E2043083E2003093E514300BE5\r
-0AFE13A010E4019FE5630200EB14301BE5233CA0E1\r
-0AFE13B010FF3003E20300A0E148FFFFEB14301BE5\r
-0AFE13C0102338A0E1FF3003E20300A0E143FFFFEB\r
-0AFE13D01014301BE52334A0E1FF3003E20300A0E1\r
-0AFE13E0103EFFFFEB14305BE50300A0E13BFFFFEB\r
-0AFE13F0100A00A0E313FFFFEB0D00A0E311FFFFEB\r
-0AFE140010AF36A0E30E3883E2083083E2003093E5\r
-0AFE14101018300BE574019FE5460200EB18301BE5\r
-0AFE142010233CA0E1FF3003E20300A0E12BFFFFEB\r
-0AFE14301018301BE52338A0E1FF3003E20300A0E1\r
-0AFE14401026FFFFEB18301BE52334A0E1FF3003E2\r
-0AFE1450100300A0E121FFFFEB18305BE50300A0E1\r
-0AFE1460101EFFFFEB0A00A0E3F6FEFFEB0D00A0E3\r
-0AFE147010F4FEFFEBE6FEFFEB0030A0E1FF3003E2\r
-0AFE148010000053E30000001A020000EA03FFFFEB\r
-0AFE1490102D004BE5F6FFFFEAF4009FE5250200EB\r
-0AFE14A010FEFEFFEB2D004BE5CD0000EBC00000EB\r
-0AFE14B010E0009FE51F0200EB18301BE528300BE5\r
-0AFE14C01014301BE52C300BE52C001BE5100100EB\r
-0AFE14D01028301BE5013643E228300BE52C301BE5\r
-0AFE14E010013683E22C300BE528301BE5000053E3\r
-0AFE14F010F4FFFFCAAE0000EB14001BE518101BE5\r
-0AFE15001049FFFFEB0030A0E1FF3003E2000053E3\r
-0AFE151010E6FFFF0A80009FE5060200EB10001BE5\r
-0AFE15201014101BE518201BE5D00000EB10001BE5\r
-0AFE15301014101BE518201BE50FFFFFEB0030A0E1\r
-0AFE154010FF3003E2000053E30200000A4C009FE5\r
-0AFE155010F80100EB010000EA44009FE5F50100EB\r
-0AFE156010930000EB3C009FE5F20100EB0000A0E3\r
-0AFE157010A4FEFFEB0030A0E30300A0E100A81BE9\r
-0AFE158010A01DFE0AA41DFE0AE01DFE0A0C1EFE0A\r
-0AFE159010381EFE0A641EFE0A181FFE0A281FFE0A\r
-0AFE15A0103C1FFE0A481FFE0AB41EFE0A0DC0A0E1\r
-0AFE15B01000D82DE904B04CE204D04DE210000BE5\r
-0AFE15C01010301BE5013043E210300BE5010073E3\r
-0AFE15D010FAFFFF1A00A81BE90DC0A0E100D82DE9\r
-0AFE15E01004B04CE208D04DE210000BE510301BE5\r
-0AFE15F01014300BE514301BE50300A0E100A81BE9\r
-0AFE1600100DC0A0E100D82DE904B04CE204D04DE2\r
-0AFE1610102228A0E3012A82E2042082E2E134A0E3\r
-0AFE162010023883E2033C83E2003082E50333A0E3\r
-0AFE163010053983E2003093E510300BE500A81BE9\r
-0AFE1640100DC0A0E100D82DE904B04CE204D04DE2\r
-0AFE1650102228A0E3012A82E2042082E29134A0E3\r
-0AFE166010023883E2033C83E2003082E5C136A0E3\r
-0AFE167010003093E510300BE52228A0E3012A82E2\r
-0AFE168010042082E2E134A0E3023883E2033C83E2\r
-0AFE169010003082E50333A0E3073983E20020A0E3\r
-0AFE16A010002083E52228A0E3012A82E2042082E2\r
-0AFE16B0108134A0E3023883E2033C83E2003082E5\r
-0AFE16C0100333A0E3003093E510300BE5CBFFFFEB\r
-0AFE16D01010301BE50300A0E100A81BE90DC0A0E1\r
-0AFE16E01000D82DE904B04CE208D04DE2D3FFFFEB\r
-0AFE16F0100030A0E110300BE510301BE5023503E2\r
-0AFE170010000053E30500000A10301BE5073703E2\r
-0AFE171010000053E30100000A10001BE5ADFFFFEB\r
-0AFE17201010301BE5803003E2000053E30500000A\r
-0AFE17301010301BE51C3003E2000053E30100000A\r
-0AFE17401010001BE5A3FFFFEB10201BE50235A0E3\r
-0AFE175010803083E2030052E10200001A0130A0E3\r
-0AFE17601014300BE5010000EA0030A0E314300BE5\r
-0AFE17701014001BE500A81BE90DC0A0E100D82DE9\r
-0AFE17801004B04CE204D04DE22228A0E3012A82E2\r
-0AFE179010042082E29134A0E3023883E2033C83E2\r
-0AFE17A010003082E5C136A0E3003093E510300BE5\r
-0AFE17B01000A81BE90DC0A0E100D82DE904B04CE2\r
-0AFE17C010ECFFFFEB2228A0E3012A82E2042082E2\r
-0AFE17D0108134A0E3023883E2033C83E2003082E5\r
-0AFE17E01000A81BE90DC0A0E100D82DE904B04CE2\r
-0AFE17F01004D04DE22228A0E3012A82E2042082E2\r
-0AFE1800102238A0E3013A83E2043083E2003093E5\r
-0AFE181010023183E3003082E52228A0E3012A82E2\r
-0AFE1820102238A0E3013A83E2003093E5023183E3\r
-0AFE183010003082E5FA0FA0E35BFFFFEB2228A0E3\r
-0AFE184010012A82E2042082E2B134A0E3023883E2\r
-0AFE185010033C83E2003082E50333A0E3233983E2\r
-0AFE186010033B83E2003093E510300BE500A81BE9\r
-0AFE1870100DC0A0E100D82DE904B04CE21CD04DE2\r
-0AFE18801010000BE514100BE518200BE50030A0E3\r
-0AFE1890101C300BE51C201BE518301BE5030052E1\r
-0AFE18A0100000003A190000EAB2FFFFEB2228A0E3\r
-0AFE18B010012A82E2042082E2F134A0E3023883E2\r
-0AFE18C010033C83E2003082E514201BE51C301BE5\r
-0AFE18D010031082E010201BE51C301BE5033082E0\r
-0AFE18E010003093E5003081E57BFFFFEB0030A0E1\r
-0AFE18F010FF3003E2000053E3FAFFFF0AACFFFFEB\r
-0AFE1900101C301BE5043083E21C300BE5E0FFFFEA\r
-0AFE19101000A81BE90DC0A0E100D82DE904B04CE2\r
-0AFE1920100CD04DE210000BE52228A0E3012A82E2\r
-0AFE193010042082E28134A0E3023883E2033C83E2\r
-0AFE194010003082E510301BE5003093E514300BE5\r
-0AFE1950102228A0E3012A82E2042082E29134A0E3\r
-0AFE196010023883E2033C83E2003082E510301BE5\r
-0AFE197010003093E518300BE52228A0E3012A82E2\r
-0AFE198010042082E2E134A0E3023883E2033C83E2\r
-0AFE199010003082E50229A0E310301BE5032082E0\r
-0AFE19A0100030A0E3003082E52228A0E3012A82E2\r
-0AFE19B010042082E28134A0E3023883E2033C83E2\r
-0AFE19C010003082E510201BE50D3AA0E3D03083E2\r
-0AFE19D010033883E1003082E53FFFFFEB0030A0E1\r
-0AFE19E010FF3003E2000053E3FAFFFF0A70FFFFEB\r
-0AFE19F01000A81BE90DC0A0E100D82DE904B04CE2\r
-0AFE1A00105CFFFFEB2228A0E3012A82E2042082E2\r
-0AFE1A1010E134A0E3023883E2033C83E2003082E5\r
-0AFE1A20100333A0E3033983E20020A0E3002083E5\r
-0AFE1A30102228A0E3012A82E2042082E28134A0E3\r
-0AFE1A4010023883E2033C83E2003082E50323A0E3\r
-0AFE1A5010032982E20339A0E3C03083E2033883E1\r
-0AFE1A6010003082E500A81BE90DC0A0E100D82DE9\r
-0AFE1A701004B04CE23FFFFFEB2228A0E3012A82E2\r
-0AFE1A8010042082E2E134A0E3023883E2033C83E2\r
-0AFE1A9010003082E50333A0E30A3983E20020A0E3\r
-0AFE1AA010002083E52228A0E3012A82E2042082E2\r
-0AFE1AB0108134A0E3023883E2033C83E2003082E5\r
-0AFE1AC0100323A0E30A2982E20339A0E3C03083E2\r
-0AFE1AD010033883E1003082E500A81BE90DC0A0E1\r
-0AFE1AE01000D82DE904B04CE28729A0E3222E82E2\r
-0AFE1AF0108739A0E3223E83E2003093E51E3CC3E3\r
-0AFE1B0010003082E58729A0E38E2F82E28739A0E3\r
-0AFE1B10108E3F83E2003093E51E3CC3E3003082E5\r
-0AFE1B20108139A0E3823D83E20520A0E3002083E5\r
-0AFE1B30108129A0E3822D82E2042082E20139A0E3\r
-0AFE1B4010273083E2003082E58139A0E3823D83E2\r
-0AFE1B50100C3083E20120A0E3002083E58129A0E3\r
-0AFE1B6010822D82E2102082E22A3DA0E3013083E2\r
-0AFE1B7010003082E58139A0E3823D83E2243083E2\r
-0AFE1B80100F20A0E3002083E58139A0E3823D83E2\r
-0AFE1B9010283083E28A20A0E3002083E58139A0E3\r
-0AFE1BA010823D83E22C3083E20820A0E3002083E5\r
-0AFE1BB01000A81BE90DC0A0E100D82DE904B04CE2\r
-0AFE1BC0108139A0E3823D83E2183083E2003093E5\r
-0AFE1BD010013003E2FF3003E20300A0E100A81BE9\r
-0AFE1BE0100DC0A0E100D82DE904B04CE204D04DE2\r
-0AFE1BF0100030A0E10D304BE58139A0E3823D83E2\r
-0AFE1C0010183083E2003093E5013903E2000053E3\r
-0AFE1C1010F8FFFF0A8139A0E3813D83E20D205BE5\r
-0AFE1C2010002083E50D305BE50A0053E30A00001A\r
-0AFE1C30108139A0E3823D83E2183083E2003093E5\r
-0AFE1C4010013903E2000053E3F8FFFF0A8139A0E3\r
-0AFE1C5010813D83E20D20A0E3002083E500A81BE9\r
-0AFE1C60100DC0A0E100D82DE904B04CE20000A0E1\r
-0AFE1C7010CFFFFFEB0030A0E1FF3003E2000053E3\r
-0AFE1C8010FAFFFF0A8139A0E3023A83E2003093E5\r
-0AFE1C9010FF3003E20300A0E100A81BE90DC0A0E1\r
-0AFE1CA01000D82DE904B04CE204D04DE20030A0E1\r
-0AFE1CB0100D304BE50D305BE52332A0E10E304BE5\r
-0AFE1CC0100E305BE5090053E30300009A0E305BE5\r
-0AFE1CD010373083E20E304BE5020000EA0E305BE5\r
-0AFE1CE010303083E20E304BE50E305BE50300A0E1\r
-0AFE1CF010BAFFFFEB0D305BE50F3003E20E304BE5\r
-0AFE1D00100E305BE5090053E30300009A0E305BE5\r
-0AFE1D1010373083E20E304BE5020000EA0E305BE5\r
-0AFE1D2010303083E20E304BE50E305BE50300A0E1\r
-0AFE1D3010AAFFFFEB00A81BE90DC0A0E100D82DE9\r
-0AFE1D401004B04CE204D04DE210000BE510301BE5\r
-0AFE1D50100030D3E5000053E30000001A080000EA\r
-0AFE1D601010104BE2003091E50320A0E10020D2E5\r
-0AFE1D7010013083E2003081E50200A0E197FFFFEB\r
-0AFE1D8008F1FFFFEA00A81BE9\r
-0AFE1DA4100A0D4D58314144532053796E632D666C\r
-0AFE1DB4106173682050726F6772616D6D696E6720\r
-0AFE1DC4105574696C6974792076302E3520323030\r
-0AFE1DD410322F30382F32310A0D000000536F7572\r
-0AFE1DE41063652061646472657373202873746F72\r
-0AFE1DF410656420696E2030783041464530303030\r
-0AFE1E0410293A2030780000005461726765742061\r
-0AFE1E1410646472657373202873746F7265642069\r
-0AFE1E24106E2030783041464530303034293A2030\r
-0AFE1E34107800000053697A652020202020202020\r
-0AFE1E44102020202873746F72656420696E203078\r
-0AFE1E54103041464530303038293A203078000000\r
-0AFE1E6410507265737320616E79206B657920746F\r
-0AFE1E74102073746172742070726F6772616D6D69\r
-0AFE1E84106E67202E2E2E00000A0D45726173696E\r
-0AFE1E94106720666C617368202E2E2E000A0D5072\r
-0AFE1EA4106F6772616D6D696E67202E2E2E000000\r
-0AFE1EB4100A0D50726F6772616D6D696E67206669\r
-0AFE1EC4106E69736865642E0A0D50726573732027\r
-0AFE1ED410612720746F20636F6E74696E7565202E\r
-0AFE1EE4102E2E2E000A0D566572696679696E6720\r
-0AFE1EF410666C617368202E2E2E0000000A0D426C\r
-0AFE1F0410616E6B20636865636B696E67202E2E2E\r
-0AFE1F1410000000000A45726173696E67202E2E2E\r
-0AFE1F2410000000000A50726F6772616D6D696E67\r
-0AFE1F3410202E2E2E000000002073756363656564\r
-0AFE1F44102E0A0000206661696C656420210A0000\r
-0AFE100000\r
-\r"
-}
-
-#########################################################
-
-if [ "$#" -eq 2 ] ; then
-    output_init > $2
-    output_uboot >> $2
-    output_flashprog >> $2
-else
-    output_init;
-    output_uboot;
-    output_flashprog;
-fi
index 68fc7c8c887fafb9721e4d4f3a2b573bfd9a1db0..7189f0142957b55c120aca37111122c534989649 100644 (file)
@@ -11,6 +11,7 @@ int fdt_remove_unused_strings(const void *old, void *new)
        const char *str;
        int ret;
        int tag = FDT_PROP;
+       int allocated;
 
        /* Make a copy and remove the strings */
        memcpy(new, old, size);
@@ -25,7 +26,7 @@ int fdt_remove_unused_strings(const void *old, void *new)
                new_prop = (struct fdt_property *)(unsigned long)
                        fdt_get_property_by_offset(new, offset, NULL);
                str = fdt_string(old, fdt32_to_cpu(old_prop->nameoff));
-               ret = fdt_find_add_string_(new, str);
+               ret = fdt_find_add_string_(new, str, &allocated);
                if (ret < 0)
                        return ret;
                new_prop->nameoff = cpu_to_fdt32(ret);
index 249a33b8cac440a1bf021dc71074f8d3a96243fc..24c02c4fca1400de4cca31630161204170a1fe33 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (c) 2014 Google, Inc
@@ -126,15 +126,15 @@ def List(date, microcodes, model):
         microcodes:     Dict of Microcode objects indexed by name
         model:          Model string to search for, or None
     """
-    print 'Date: %s' % date
+    print('Date: %s' % date)
     if model:
         mcode_list, tried = FindMicrocode(microcodes, model.lower())
-        print 'Matching models %s:' % (', '.join(tried))
+        print('Matching models %s:' % (', '.join(tried)))
     else:
-        print 'All models:'
-        mcode_list = [microcodes[m] for m in microcodes.keys()]
+        print('All models:')
+        mcode_list = [microcodes[m] for m in list(microcodes.keys())]
     for mcode in mcode_list:
-        print '%-20s: model %s' % (mcode.name, mcode.model)
+        print('%-20s: model %s' % (mcode.name, mcode.model))
 
 def FindMicrocode(microcodes, model):
     """Find all the microcode chunks which match the given model.
@@ -164,7 +164,7 @@ def FindMicrocode(microcodes, model):
     for i in range(3):
         abbrev = model[:-i] if i else model
         tried.append(abbrev)
-        for mcode in microcodes.values():
+        for mcode in list(microcodes.values()):
             if mcode.model.startswith(abbrev):
                 found.append(mcode)
         if found:
@@ -229,17 +229,17 @@ data = <%s
     args += [mcode.words[i] for i in range(7)]
     args.append(words)
     if outfile == '-':
-        print out % tuple(args)
+        print(out % tuple(args))
     else:
         if not outfile:
             if not os.path.exists(MICROCODE_DIR):
-                print >> sys.stderr, "Creating directory '%s'" % MICROCODE_DIR
+                print("Creating directory '%s'" % MICROCODE_DIR, file=sys.stderr)
                 os.makedirs(MICROCODE_DIR)
             outfile = os.path.join(MICROCODE_DIR, mcode.name + '.dtsi')
-        print >> sys.stderr, "Writing microcode for '%s' to '%s'" % (
-                ', '.join([mcode.name for mcode in mcodes]), outfile)
+        print("Writing microcode for '%s' to '%s'" % (
+                ', '.join([mcode.name for mcode in mcodes]), outfile), file=sys.stderr)
         with open(outfile, 'w') as fd:
-            print >> fd, out % tuple(args)
+            print(out % tuple(args), file=fd)
 
 def MicrocodeTool():
     """Run the microcode tool"""
@@ -289,14 +289,14 @@ def MicrocodeTool():
     if cmd == 'list':
         List(date, microcodes, options.model)
     elif cmd == 'license':
-        print '\n'.join(license_text)
+        print('\n'.join(license_text))
     elif cmd == 'create':
         if not options.model:
             parser.error('You must specify a model to create')
         model = options.model.lower()
         if options.model == 'all':
             options.multiple = True
-            mcode_list = microcodes.values()
+            mcode_list = list(microcodes.values())
             tried = []
         else:
             mcode_list, tried = FindMicrocode(microcodes, model)
index b99417e9d6300dbd56cf6e8b72f4e9253ac1e0ab..e2ff4cfc88b25f2a009ef63a3912db438b134ba3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Author: Masahiro Yamada <yamada.masahiro@socionext.com>
@@ -304,7 +304,7 @@ import glob
 import multiprocessing
 import optparse
 import os
-import Queue
+import queue
 import re
 import shutil
 import subprocess
@@ -450,8 +450,8 @@ def get_matched_defconfigs(defconfigs_file):
             line = line.split(' ')[0]  # handle 'git log' input
         matched = get_matched_defconfig(line)
         if not matched:
-            print >> sys.stderr, "warning: %s:%d: no defconfig matched '%s'" % \
-                                                 (defconfigs_file, i + 1, line)
+            print("warning: %s:%d: no defconfig matched '%s'" % \
+                                                 (defconfigs_file, i + 1, line), file=sys.stderr)
 
         defconfigs += matched
 
@@ -494,11 +494,11 @@ def show_diff(a, b, file_path, color_enabled):
 
     for line in diff:
         if line[0] == '-' and line[1] != '-':
-            print color_text(color_enabled, COLOR_RED, line),
+            print(color_text(color_enabled, COLOR_RED, line), end=' ')
         elif line[0] == '+' and line[1] != '+':
-            print color_text(color_enabled, COLOR_GREEN, line),
+            print(color_text(color_enabled, COLOR_GREEN, line), end=' ')
         else:
-            print line,
+            print(line, end=' ')
 
 def extend_matched_lines(lines, matched, pre_patterns, post_patterns, extend_pre,
                          extend_post):
@@ -554,9 +554,9 @@ def extend_matched_lines(lines, matched, pre_patterns, post_patterns, extend_pre
 def confirm(options, prompt):
     if not options.yes:
         while True:
-            choice = raw_input('{} [y/n]: '.format(prompt))
+            choice = input('{} [y/n]: '.format(prompt))
             choice = choice.lower()
-            print choice
+            print(choice)
             if choice == 'y' or choice == 'n':
                 break
 
@@ -809,10 +809,10 @@ def try_expand(line):
         val= val.strip('\"')
         if re.search("[*+-/]|<<|SZ_+|\(([^\)]+)\)", val):
             newval = hex(eval(val, SIZES))
-            print "\tExpanded expression %s to %s" % (val, newval)
+            print("\tExpanded expression %s to %s" % (val, newval))
             return cfg+'='+newval
     except:
-        print "\tFailed to expand expression in %s" % line
+        print("\tFailed to expand expression in %s" % line)
 
     return line
 
@@ -838,7 +838,7 @@ class Progress:
 
     def show(self):
         """Display the progress."""
-        print ' %d defconfigs out of %d\r' % (self.current, self.total),
+        print(' %d defconfigs out of %d\r' % (self.current, self.total), end=' ')
         sys.stdout.flush()
 
 
@@ -1236,7 +1236,7 @@ class Slot:
                     "Tool chain for '%s' is missing.  Do nothing.\n" % arch)
             self.finish(False)
             return
-       env = toolchain.MakeEnvironment(False)
+        env = toolchain.MakeEnvironment(False)
 
         cmd = list(self.make_cmd)
         cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
@@ -1312,7 +1312,7 @@ class Slot:
         log += '\n'.join([ '    ' + s for s in self.log.split('\n') ])
         # Some threads are running in parallel.
         # Print log atomically to not mix up logs from different threads.
-        print >> (sys.stdout if success else sys.stderr), log
+        print(log, file=(sys.stdout if success else sys.stderr))
 
         if not success:
             if self.options.exit_on_error:
@@ -1411,8 +1411,8 @@ class Slots:
             msg = "The following boards were not processed due to error:\n"
             msg += boards
             msg += "(the list has been saved in %s)\n" % output_file
-            print >> sys.stderr, color_text(self.options.color, COLOR_LIGHT_RED,
-                                            msg)
+            print(color_text(self.options.color, COLOR_LIGHT_RED,
+                                            msg), file=sys.stderr)
 
             with open(output_file, 'w') as f:
                 f.write(boards)
@@ -1431,8 +1431,8 @@ class Slots:
             msg += "It is highly recommended to check them manually:\n"
             msg += boards
             msg += "(the list has been saved in %s)\n" % output_file
-            print >> sys.stderr, color_text(self.options.color, COLOR_YELLOW,
-                                            msg)
+            print(color_text(self.options.color, COLOR_YELLOW,
+                                            msg), file=sys.stderr)
 
             with open(output_file, 'w') as f:
                 f.write(boards)
@@ -1448,11 +1448,11 @@ class ReferenceSource:
           commit: commit to git-clone
         """
         self.src_dir = tempfile.mkdtemp()
-        print "Cloning git repo to a separate work directory..."
+        print("Cloning git repo to a separate work directory...")
         subprocess.check_output(['git', 'clone', os.getcwd(), '.'],
                                 cwd=self.src_dir)
-        print "Checkout '%s' to build the original autoconf.mk." % \
-            subprocess.check_output(['git', 'rev-parse', '--short', commit]).strip()
+        print("Checkout '%s' to build the original autoconf.mk." % \
+            subprocess.check_output(['git', 'rev-parse', '--short', commit]).strip())
         subprocess.check_output(['git', 'checkout', commit],
                                 stderr=subprocess.STDOUT, cwd=self.src_dir)
 
@@ -1480,14 +1480,14 @@ def move_config(toolchains, configs, options, db_queue):
     """
     if len(configs) == 0:
         if options.force_sync:
-            print 'No CONFIG is specified. You are probably syncing defconfigs.',
+            print('No CONFIG is specified. You are probably syncing defconfigs.', end=' ')
         elif options.build_db:
-            print 'Building %s database' % CONFIG_DATABASE
+            print('Building %s database' % CONFIG_DATABASE)
         else:
-            print 'Neither CONFIG nor --force-sync is specified. Nothing will happen.',
+            print('Neither CONFIG nor --force-sync is specified. Nothing will happen.', end=' ')
     else:
-        print 'Move ' + ', '.join(configs),
-    print '(jobs: %d)\n' % options.jobs
+        print('Move ' + ', '.join(configs), end=' ')
+    print('(jobs: %d)\n' % options.jobs)
 
     if options.git_ref:
         reference_src = ReferenceSource(options.git_ref)
@@ -1517,7 +1517,7 @@ def move_config(toolchains, configs, options, db_queue):
     while not slots.empty():
         time.sleep(SLEEP_TIME)
 
-    print ''
+    print('')
     slots.show_failed_boards()
     slots.show_suspicious_boards()
 
@@ -1691,15 +1691,15 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added,
     for config in config_list:
         defconfigs = defconfig_db.get(config)
         if not defconfigs:
-            print '%s not found in any defconfig' % config
+            print('%s not found in any defconfig' % config)
             continue
 
         # Get the set of defconfigs without this one (since a config cannot
         # imply itself)
         non_defconfigs = all_defconfigs - defconfigs
         num_defconfigs = len(defconfigs)
-        print '%s found in %d/%d defconfigs' % (config, num_defconfigs,
-                                                len(all_configs))
+        print('%s found in %d/%d defconfigs' % (config, num_defconfigs,
+                                                len(all_configs)))
 
         # This will hold the results: key=config, value=defconfigs containing it
         imply_configs = {}
@@ -1736,7 +1736,7 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added,
             if common_defconfigs:
                 skip = False
                 if find_superset:
-                    for prev in imply_configs.keys():
+                    for prev in list(imply_configs.keys()):
                         prev_count = len(imply_configs[prev])
                         count = len(common_defconfigs)
                         if (prev_count > count and
@@ -1806,15 +1806,15 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added,
                             add_list[fname].append(linenum)
 
             if show and kconfig_info != 'skip':
-                print '%5d : %-30s%-25s %s' % (num_common, iconfig.ljust(30),
-                                              kconfig_info, missing_str)
+                print('%5d : %-30s%-25s %s' % (num_common, iconfig.ljust(30),
+                                              kconfig_info, missing_str))
 
         # Having collected a list of things to add, now we add them. We process
         # each file from the largest line number to the smallest so that
         # earlier additions do not affect our line numbers. E.g. if we added an
         # imply at line 20 it would change the position of each line after
         # that.
-        for fname, linenums in add_list.iteritems():
+        for fname, linenums in add_list.items():
             for linenum in sorted(linenums, reverse=True):
                 add_imply_rule(config[CONFIG_LEN:], fname, linenum)
 
@@ -1891,11 +1891,11 @@ def main():
             for flag in options.imply_flags.split(','):
                 bad = flag not in IMPLY_FLAGS
                 if bad:
-                    print "Invalid flag '%s'" % flag
+                    print("Invalid flag '%s'" % flag)
                 if flag == 'help' or bad:
-                    print "Imply flags: (separate with ',')"
-                    for name, info in IMPLY_FLAGS.iteritems():
-                        print ' %-15s: %s' % (name, info[1])
+                    print("Imply flags: (separate with ',')")
+                    for name, info in IMPLY_FLAGS.items():
+                        print(' %-15s: %s' % (name, info[1]))
                     parser.print_usage()
                     sys.exit(1)
                 imply_flags |= IMPLY_FLAGS[flag][0]
@@ -1905,14 +1905,14 @@ def main():
         return
 
     config_db = {}
-    db_queue = Queue.Queue()
+    db_queue = queue.Queue()
     t = DatabaseThread(config_db, db_queue)
     t.setDaemon(True)
     t.start()
 
     if not options.cleanup_headers_only:
         check_clean_directory()
-       bsettings.Setup('')
+        bsettings.Setup('')
         toolchains = toolchain.Toolchains()
         toolchains.GetSettings()
         toolchains.Scan(verbose=False)
@@ -1939,7 +1939,7 @@ def main():
 
     if options.build_db:
         with open(CONFIG_DATABASE, 'w') as fd:
-            for defconfig, configs in config_db.iteritems():
+            for defconfig, configs in config_db.items():
                 fd.write('%s\n' % defconfig)
                 for config in sorted(configs.keys()):
                     fd.write('   %s=%s\n' % (config, configs[config]))
index 16299f3f5be8bd203364d4fbf98733a0f7f3a375..5fbd2c4a3e9c3fbd6dd7b8806ec67a54f7c791c6 100644 (file)
@@ -4,6 +4,7 @@
 
 import os
 import cros_subprocess
+import tools
 
 """Shell command ease-ups for Python."""
 
@@ -31,6 +32,13 @@ class CommandResult:
         self.return_code = return_code
         self.exception = exception
 
+    def ToOutput(self, binary):
+        if not binary:
+            self.stdout = tools.ToString(self.stdout)
+            self.stderr = tools.ToString(self.stderr)
+            self.combined = tools.ToString(self.combined)
+        return self
+
 
 # This permits interception of RunPipe for test purposes. If it is set to
 # a function, then that function is called with the pipe list being
@@ -41,7 +49,7 @@ test_result = None
 
 def RunPipe(pipe_list, infile=None, outfile=None,
             capture=False, capture_stderr=False, oneline=False,
-            raise_on_error=True, cwd=None, **kwargs):
+            raise_on_error=True, cwd=None, binary=False, **kwargs):
     """
     Perform a command pipeline, with optional input/output filenames.
 
@@ -67,7 +75,7 @@ def RunPipe(pipe_list, infile=None, outfile=None,
         else:
             return test_result
         # No result: fall through to normal processing
-    result = CommandResult()
+    result = CommandResult(b'', b'', b'')
     last_pipe = None
     pipeline = list(pipe_list)
     user_pipestr =  '|'.join([' '.join(pipe) for pipe in pipe_list])
@@ -93,29 +101,36 @@ def RunPipe(pipe_list, infile=None, outfile=None,
             if raise_on_error:
                 raise Exception("Error running '%s': %s" % (user_pipestr, str))
             result.return_code = 255
-            return result
+            return result.ToOutput(binary)
 
     if capture:
         result.stdout, result.stderr, result.combined = (
                 last_pipe.CommunicateFilter(None))
         if result.stdout and oneline:
-            result.output = result.stdout.rstrip('\r\n')
+            result.output = result.stdout.rstrip(b'\r\n')
         result.return_code = last_pipe.wait()
     else:
         result.return_code = os.waitpid(last_pipe.pid, 0)[1]
     if raise_on_error and result.return_code:
         raise Exception("Error running '%s'" % user_pipestr)
-    return result
+    return result.ToOutput(binary)
 
 def Output(*cmd, **kwargs):
     kwargs['raise_on_error'] = kwargs.get('raise_on_error', True)
     return RunPipe([cmd], capture=True, **kwargs).stdout
 
 def OutputOneLine(*cmd, **kwargs):
+    """Run a command and output it as a single-line string
+
+    The command us expected to produce a single line of output
+
+    Returns:
+        String containing output of command
+    """
     raise_on_error = kwargs.pop('raise_on_error', True)
-    return (RunPipe([cmd], capture=True, oneline=True,
-            raise_on_error=raise_on_error,
-            **kwargs).stdout.strip())
+    result = RunPipe([cmd], capture=True, oneline=True,
+                     raise_on_error=raise_on_error, **kwargs).stdout.strip()
+    return result
 
 def Run(*cmd, **kwargs):
     return RunPipe([cmd], **kwargs).stdout
index 2321f9e028be7623469fc179035c873d27e21f34..76319fff37e3df6f0fc3bd515c92209470658ce1 100644 (file)
@@ -51,7 +51,7 @@ class TestFunctional(unittest.TestCase):
 
     @classmethod
     def GetText(self, fname):
-        return open(self.GetPath(fname)).read()
+        return open(self.GetPath(fname), encoding='utf-8').read()
 
     @classmethod
     def GetPatchName(self, subject):
@@ -160,7 +160,7 @@ class TestFunctional(unittest.TestCase):
                     dry_run, not ignore_bad_tags, cc_file,
                     in_reply_to=in_reply_to, thread=None)
             series.ShowActions(args, cmd, process_tags)
-        cc_lines = open(cc_file).read().splitlines()
+        cc_lines = open(cc_file, encoding='utf-8').read().splitlines()
         os.remove(cc_file)
 
         lines = out[0].splitlines()
@@ -229,14 +229,14 @@ Simon Glass (2):
 2.7.4
 
 '''
-        lines = open(cover_fname).read().splitlines()
+        lines = open(cover_fname, encoding='utf-8').read().splitlines()
         self.assertEqual(
                 'Subject: [RFC PATCH v3 0/2] test: A test patch series',
                 lines[3])
         self.assertEqual(expected.splitlines(), lines[7:])
 
         for i, fname in enumerate(args):
-            lines = open(fname).read().splitlines()
+            lines = open(fname, encoding='utf-8').read().splitlines()
             subject = [line for line in lines if line.startswith('Subject')]
             self.assertEqual('Subject: [RFC %d/%d]' % (i + 1, count),
                              subject[0][:18])
index ef06606297954aec0392f03c90619cd6a27aae2a..df3eb7483bb2f5f95770bc7d2d1ae24fe059d21f 100644 (file)
@@ -511,8 +511,8 @@ def FixPatch(backup_dir, fname, series, commit):
         A list of errors, or [] if all ok.
     """
     handle, tmpname = tempfile.mkstemp()
-    outfd = os.fdopen(handle, 'w')
-    infd = open(fname, 'r')
+    outfd = os.fdopen(handle, 'w', encoding='utf-8')
+    infd = open(fname, 'r', encoding='utf-8')
     ps = PatchStream(series)
     ps.commit = commit
     ps.ProcessStream(infd, outfd)
index 0187ebe1d4bf79d3f37b414adf3ac2389df9fb98..cf53e532ddf8e89fd72dcbe9a7b627c92297942b 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (c) 2011 The Chromium OS Authors.
index d667d9b6d61c257ad33759e25b619fd6ee259d85..02a1113ad017ba6079c0ad4e480529ee8c0c22cf 100644 (file)
@@ -223,7 +223,7 @@ class Series(dict):
         col = terminal.Color()
         # Look for commit tags (of the form 'xxx:' at the start of the subject)
         fname = '/tmp/patman.%d' % os.getpid()
-        fd = open(fname, 'w')
+        fd = open(fname, 'w', encoding='utf-8')
         all_ccs = []
         for commit in self.commits:
             cc = []
index c98911d522b4e4de05d1a1dfb1858d6dc903f747..5dc83a850023c779d6ce76ce96aaea9df3056646 100644 (file)
@@ -165,7 +165,7 @@ def ReadGitAliases(fname):
         fname: Filename to read
     """
     try:
-        fd = open(fname, 'r')
+        fd = open(fname, 'r', encoding='utf-8')
     except IOError:
         print("Warning: Cannot find alias file '%s'" % fname)
         return
@@ -259,7 +259,7 @@ def _ReadAliasFile(fname):
     """
     if os.path.exists(fname):
         bad_line = None
-        with open(fname) as fd:
+        with open(fname, encoding='utf-8') as fd:
             linenum = 0
             for line in fd:
                 linenum += 1
index cc61c20606e8eb1f65d208f2166bb7a633b84aec..889e186606ea5e6bbe429dcaccc784bd04d8512b 100644 (file)
@@ -72,12 +72,12 @@ Signed-off-by: Simon Glass <sjg@chromium.org>
 '''
         out = ''
         inhandle, inname = tempfile.mkstemp()
-        infd = os.fdopen(inhandle, 'w')
+        infd = os.fdopen(inhandle, 'w', encoding='utf-8')
         infd.write(data)
         infd.close()
 
         exphandle, expname = tempfile.mkstemp()
-        expfd = os.fdopen(exphandle, 'w')
+        expfd = os.fdopen(exphandle, 'w', encoding='utf-8')
         expfd.write(expected)
         expfd.close()
 
index 4a7fcdad214e7386cf46d0cde55a7bc68ca3006d..3feddb292fc70a5a250ab3de30cb01eb17a77403 100644 (file)
@@ -186,7 +186,7 @@ def PathHasFile(path_spec, fname):
             return True
     return False
 
-def Run(name, *args):
+def Run(name, *args, **kwargs):
     """Run a tool with some arguments
 
     This runs a 'tool', which is a program used by binman to process files and
@@ -201,13 +201,14 @@ def Run(name, *args):
         CommandResult object
     """
     try:
+        binary = kwargs.get('binary')
         env = None
         if tool_search_paths:
             env = dict(os.environ)
             env['PATH'] = ':'.join(tool_search_paths) + ':' + env['PATH']
         all_args = (name,) + args
         result = command.RunPipe([all_args], capture=True, capture_stderr=True,
-                                 env=env, raise_on_error=False)
+                                 env=env, raise_on_error=False, binary=binary)
         if result.return_code:
             raise Exception("Error %d running '%s': %s" %
                (result.return_code,' '.join(all_args),
@@ -375,7 +376,7 @@ def ToBytes(string):
     """Convert a str type into a bytes type
 
     Args:
-        string: string to convert value
+        string: string to convert
 
     Returns:
         Python 3: A bytes type
@@ -385,6 +386,18 @@ def ToBytes(string):
         return string.encode('utf-8')
     return string
 
+def ToString(bval):
+    """Convert a bytes type into a str type
+
+    Args:
+        bval: bytes value to convert
+
+    Returns:
+        Python 3: A bytes type
+        Python 2: A string type
+    """
+    return bval.decode('utf-8')
+
 def Compress(indata, algo, with_header=True):
     """Compress some data using a given algorithm
 
@@ -406,14 +419,14 @@ def Compress(indata, algo, with_header=True):
     fname = GetOutputFilename('%s.comp.tmp' % algo)
     WriteFile(fname, indata)
     if algo == 'lz4':
-        data = Run('lz4', '--no-frame-crc', '-c', fname)
+        data = Run('lz4', '--no-frame-crc', '-c', fname, binary=True)
     # cbfstool uses a very old version of lzma
     elif algo == 'lzma':
         outfname = GetOutputFilename('%s.comp.otmp' % algo)
         Run('lzma_alone', 'e', fname, outfname, '-lc1', '-lp0', '-pb0', '-d8')
         data = ReadFile(outfname)
     elif algo == 'gzip':
-        data = Run('gzip', '-c', fname)
+        data = Run('gzip', '-c', fname, binary=True)
     else:
         raise ValueError("Unknown algorithm '%s'" % algo)
     if with_header:
@@ -446,13 +459,13 @@ def Decompress(indata, algo, with_header=True):
     with open(fname, 'wb') as fd:
         fd.write(indata)
     if algo == 'lz4':
-        data = Run('lz4', '-dc', fname)
+        data = Run('lz4', '-dc', fname, binary=True)
     elif algo == 'lzma':
         outfname = GetOutputFilename('%s.decomp.otmp' % algo)
         Run('lzma_alone', 'd', fname, outfname)
-        data = ReadFile(outfname)
+        data = ReadFile(outfname, binary=True)
     elif algo == 'gzip':
-        data = Run('gzip', '-cd', fname)
+        data = Run('gzip', '-cd', fname, binary=True)
     else:
         raise ValueError("Unknown algorithm '%s'" % algo)
     return data
index 11c192a07375d8cf3409ec2e15ec692d35f48e43..1226ee201c3b06247fcd291ed4d1585cbf577603 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 
 # Script to create enums from datasheet register tables
 #
@@ -43,8 +43,8 @@ class RegField:
         self.desc.append(desc)
 
     def Show(self):
-        print self
-        print
+        print(self)
+        print()
         self.__init__()
 
     def __str__(self):
@@ -65,11 +65,11 @@ class Printer:
             self.output_footer()
 
     def output_header(self):
-        print '/* %s */' % self.name
-        print 'enum {'
+        print('/* %s */' % self.name)
+        print('enum {')
 
     def output_footer(self):
-        print '};';
+        print('};');
 
     def output_regfield(self, regfield):
         lines = regfield.desc
@@ -97,7 +97,7 @@ class Printer:
             self.first = False
             self.output_header()
         else:
-            print
+            print()
         out_enum(field, 'shift', bit_low)
         out_enum(field, 'mask', mask)
         next_val = -1
@@ -175,7 +175,7 @@ def out_enum(field, suffix, value, skip_val=False):
             val_str = '%d' % value
 
         str += '%s= %s' % ('\t' * tabs, val_str)
-    print '\t%s,' % str
+    print('\t%s,' % str)
 
 # Process a CSV file, e.g. from tabula
 def process_csv(name, fd):