Merge branch 'master' of git://git.denx.de/u-boot
authorStefano Babic <sbabic@denx.de>
Sun, 10 May 2020 11:03:56 +0000 (13:03 +0200)
committerStefano Babic <sbabic@denx.de>
Sun, 10 May 2020 11:03:56 +0000 (13:03 +0200)
847 files changed:
.readthedocs.yml
Kconfig
MAINTAINERS
Makefile
README
arch/arm/Kconfig
arch/arm/dts/Makefile
arch/arm/dts/armada-3720-uDPU.dts
arch/arm/dts/cros-ec-keyboard.dtsi
arch/arm/dts/cros-ec-sbs.dtsi
arch/arm/dts/mt7629-rfb.dts
arch/arm/dts/mt7629.dtsi
arch/arm/dts/px30-evb-u-boot.dtsi
arch/arm/dts/px30-evb.dts
arch/arm/dts/px30-firefly-u-boot.dtsi
arch/arm/dts/px30-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3328-evb-u-boot.dtsi
arch/arm/dts/rk3328-evb.dts
arch/arm/dts/rk3328-roc-cc-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3328-roc-cc.dts [new file with mode: 0644]
arch/arm/dts/rk3328-rock64-u-boot.dtsi
arch/arm/dts/rk3328-rock64.dts
arch/arm/dts/rk3328-u-boot.dtsi
arch/arm/dts/rk3328.dtsi
arch/arm/dts/rk3399-evb-u-boot.dtsi
arch/arm/dts/rk3399-evb.dts
arch/arm/dts/rk3399-ficus.dts
arch/arm/dts/rk3399-firefly.dts
arch/arm/dts/rk3399-gru-bob.dts
arch/arm/dts/rk3399-gru-chromebook.dtsi
arch/arm/dts/rk3399-gru-kevin.dts
arch/arm/dts/rk3399-gru.dtsi
arch/arm/dts/rk3399-khadas-edge.dtsi
arch/arm/dts/rk3399-leez-p710.dts
arch/arm/dts/rk3399-nanopc-t4.dts
arch/arm/dts/rk3399-nanopi-m4-2gb-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3399-nanopi-m4-2gb.dts [new file with mode: 0644]
arch/arm/dts/rk3399-nanopi4.dtsi
arch/arm/dts/rk3399-orangepi.dts
arch/arm/dts/rk3399-puma-u-boot.dtsi
arch/arm/dts/rk3399-puma.dtsi
arch/arm/dts/rk3399-roc-pc-mezzanine-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/rk3399-roc-pc-mezzanine.dts [new file with mode: 0644]
arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
arch/arm/dts/rk3399-roc-pc.dts
arch/arm/dts/rk3399-roc-pc.dtsi
arch/arm/dts/rk3399-rock-pi-4.dts
arch/arm/dts/rk3399-rock960.dts
arch/arm/dts/rk3399-rock960.dtsi
arch/arm/dts/rk3399-rockpro64.dts
arch/arm/dts/rk3399-rockpro64.dtsi [new file with mode: 0644]
arch/arm/dts/rk3399-u-boot.dtsi
arch/arm/dts/rk3399.dtsi
arch/arm/include/asm/iproc-common/configs.h
arch/arm/include/asm/system.h
arch/arm/lib/cache-cp15.c
arch/arm/lib/cache.c
arch/arm/lib/interrupts.c
arch/arm/lib/interrupts_64.c
arch/arm/lib/interrupts_m.c
arch/powerpc/dts/Makefile
arch/powerpc/dts/p1010rdb-pa.dts [new file with mode: 0644]
arch/powerpc/dts/p1010rdb-pa_36b.dts [new file with mode: 0644]
arch/powerpc/dts/p1010rdb-pb.dts [new file with mode: 0644]
arch/powerpc/dts/p1010rdb-pb_36b.dts [new file with mode: 0644]
arch/powerpc/dts/p1010rdb.dtsi [new file with mode: 0644]
arch/powerpc/dts/p1010rdb_32b.dtsi [new file with mode: 0644]
arch/powerpc/dts/p1010rdb_36b.dtsi [new file with mode: 0644]
arch/powerpc/dts/p1010si-post.dtsi [new file with mode: 0644]
arch/powerpc/dts/p1010si-pre.dtsi [new file with mode: 0644]
arch/powerpc/dts/p1020-post.dtsi
arch/powerpc/dts/p2020-post.dtsi
arch/powerpc/dts/p2041.dtsi
arch/powerpc/dts/p3041.dtsi
arch/powerpc/dts/p4080.dtsi
arch/powerpc/dts/p5040.dtsi
arch/powerpc/dts/pq3-i2c-0.dtsi [new file with mode: 0644]
arch/powerpc/dts/pq3-i2c-1.dtsi [new file with mode: 0644]
arch/powerpc/dts/qoriq-i2c-0.dtsi [new file with mode: 0644]
arch/powerpc/dts/qoriq-i2c-1.dtsi [new file with mode: 0644]
arch/powerpc/dts/t102x.dtsi
arch/powerpc/dts/t104x.dtsi
arch/powerpc/dts/t2080.dtsi
arch/powerpc/dts/t4240.dtsi
arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi [new file with mode: 0644]
arch/sandbox/dts/test.dts
arch/x86/cpu/Makefile
arch/x86/cpu/coreboot/Kconfig
arch/x86/cpu/coreboot/Makefile
arch/x86/cpu/coreboot/coreboot.c
arch/x86/cpu/coreboot/coreboot_spl.c [new file with mode: 0644]
arch/x86/cpu/cpu.c
arch/x86/cpu/i386/cpu.c
arch/x86/cpu/intel_common/Makefile
arch/x86/cpu/x86_64/cpu.c
arch/x86/dts/coreboot-u-boot.dtsi [new file with mode: 0644]
arch/x86/lib/spl.c
board/armltd/vexpress64/Kconfig
board/armltd/vexpress64/vexpress64.c
board/coreboot/coreboot/MAINTAINERS
board/firefly/roc-pc-rk3399/MAINTAINERS
board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
board/freescale/common/sys_eeprom.c
board/freescale/common/vsc3316_3308.c
board/freescale/p1010rdb/p1010rdb.c
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
board/freescale/t102xqds/t102xqds.c
board/freescale/t102xqds/t102xqds.h
board/freescale/t102xrdb/t102xrdb.c
board/freescale/t1040qds/diu.c
board/freescale/t1040qds/t1040qds.c
board/freescale/t1040qds/t1040qds.h
board/freescale/t208xqds/t208xqds.c
board/freescale/t4qds/t4240qds.c
board/keymile/km83xx/km83xx.c
board/rockchip/evb_rk3328/MAINTAINERS
board/rockchip/evb_rk3399/MAINTAINERS
board/sifive/fu540/Kconfig
cmd/Kconfig
cmd/bdinfo.c
cmd/bedbug.c
cmd/bootefi.c
cmd/bootmenu.c
cmd/cache.c
cmd/efidebug.c
cmd/gpt.c
cmd/mem.c
cmd/mvebu/bubt.c
cmd/nvedit_efi.c
cmd/pxe_utils.c
common/board_r.c
common/cli_hush.c
common/dlmalloc.c
common/image-fit-sig.c
common/menu.c
configs/MPC8548CDS_36BIT_defconfig
configs/MPC8548CDS_defconfig
configs/MPC8548CDS_legacy_defconfig
configs/P1010RDB-PA_36BIT_NAND_defconfig
configs/P1010RDB-PA_36BIT_NOR_defconfig
configs/P1010RDB-PA_36BIT_SDCARD_defconfig
configs/P1010RDB-PA_36BIT_SPIFLASH_defconfig
configs/P1010RDB-PA_NAND_defconfig
configs/P1010RDB-PA_NOR_defconfig
configs/P1010RDB-PA_SDCARD_defconfig
configs/P1010RDB-PA_SPIFLASH_defconfig
configs/P1010RDB-PB_36BIT_NAND_defconfig
configs/P1010RDB-PB_36BIT_NOR_defconfig
configs/P1010RDB-PB_36BIT_SDCARD_defconfig
configs/P1010RDB-PB_36BIT_SPIFLASH_defconfig
configs/P1010RDB-PB_NAND_defconfig
configs/P1010RDB-PB_NOR_defconfig
configs/P1010RDB-PB_SDCARD_defconfig
configs/P1010RDB-PB_SPIFLASH_defconfig
configs/P1020RDB-PC_36BIT_NAND_defconfig
configs/P1020RDB-PC_36BIT_SDCARD_defconfig
configs/P1020RDB-PC_36BIT_SPIFLASH_defconfig
configs/P1020RDB-PC_36BIT_defconfig
configs/P1020RDB-PC_NAND_defconfig
configs/P1020RDB-PC_SDCARD_defconfig
configs/P1020RDB-PC_SPIFLASH_defconfig
configs/P1020RDB-PC_defconfig
configs/P1020RDB-PD_NAND_defconfig
configs/P1020RDB-PD_SDCARD_defconfig
configs/P1020RDB-PD_SPIFLASH_defconfig
configs/P1020RDB-PD_defconfig
configs/P2020RDB-PC_36BIT_NAND_defconfig
configs/P2020RDB-PC_36BIT_SDCARD_defconfig
configs/P2020RDB-PC_36BIT_SPIFLASH_defconfig
configs/P2020RDB-PC_36BIT_defconfig
configs/P2020RDB-PC_NAND_defconfig
configs/P2020RDB-PC_SDCARD_defconfig
configs/P2020RDB-PC_SPIFLASH_defconfig
configs/P2020RDB-PC_defconfig
configs/P2041RDB_NAND_defconfig
configs/P2041RDB_SDCARD_defconfig
configs/P2041RDB_SPIFLASH_defconfig
configs/P2041RDB_defconfig
configs/P3041DS_NAND_defconfig
configs/P3041DS_SDCARD_defconfig
configs/P3041DS_SPIFLASH_defconfig
configs/P3041DS_defconfig
configs/P4080DS_SDCARD_defconfig
configs/P4080DS_SPIFLASH_defconfig
configs/P4080DS_defconfig
configs/P5040DS_NAND_defconfig
configs/P5040DS_SDCARD_defconfig
configs/P5040DS_SPIFLASH_defconfig
configs/P5040DS_defconfig
configs/T1023RDB_NAND_defconfig
configs/T1023RDB_SDCARD_defconfig
configs/T1023RDB_SECURE_BOOT_defconfig
configs/T1023RDB_SPIFLASH_defconfig
configs/T1023RDB_defconfig
configs/T1024RDB_NAND_defconfig
configs/T1024RDB_SDCARD_defconfig
configs/T1024RDB_SECURE_BOOT_defconfig
configs/T1024RDB_SPIFLASH_defconfig
configs/T1024RDB_defconfig
configs/T1042D4RDB_NAND_defconfig
configs/T1042D4RDB_SDCARD_defconfig
configs/T1042D4RDB_SPIFLASH_defconfig
configs/T1042D4RDB_defconfig
configs/T2080QDS_NAND_defconfig
configs/T2080QDS_SDCARD_defconfig
configs/T2080QDS_SECURE_BOOT_defconfig
configs/T2080QDS_SPIFLASH_defconfig
configs/T2080QDS_SRIO_PCIE_BOOT_defconfig
configs/T2080QDS_defconfig
configs/T2080RDB_NAND_defconfig
configs/T2080RDB_SDCARD_defconfig
configs/T2080RDB_SECURE_BOOT_defconfig
configs/T2080RDB_SPIFLASH_defconfig
configs/T2080RDB_SRIO_PCIE_BOOT_defconfig
configs/T2080RDB_defconfig
configs/T4240RDB_SDCARD_defconfig
configs/T4240RDB_defconfig
configs/ap121_defconfig
configs/ap143_defconfig
configs/ap152_defconfig
configs/apalis-imx8qm_defconfig
configs/apalis_imx6_defconfig
configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
configs/bk4r1_defconfig
configs/boston32r2_defconfig
configs/boston32r2el_defconfig
configs/boston32r6_defconfig
configs/boston32r6el_defconfig
configs/boston64r2_defconfig
configs/boston64r2el_defconfig
configs/boston64r6_defconfig
configs/boston64r6el_defconfig
configs/colibri-imx6ull_defconfig
configs/colibri-imx8qxp_defconfig
configs/colibri_imx6_defconfig
configs/colibri_imx7_defconfig
configs/colibri_imx7_emmc_defconfig
configs/colibri_vf_defconfig
configs/coreboot64_defconfig [new file with mode: 0644]
configs/crs305-1g-4s_defconfig
configs/db-xc3-24g4xg_defconfig
configs/dh_imx6_defconfig
configs/evb-px30_defconfig
configs/evb-rk3328_defconfig
configs/evb-rk3399_defconfig
configs/gazerbeam_defconfig
configs/igep00x0_defconfig
configs/imx6dl_icore_nand_defconfig
configs/imx6dl_mamoj_defconfig
configs/imx6q_icore_nand_defconfig
configs/imx6q_logic_defconfig
configs/imx6qdl_icore_mipi_defconfig
configs/imx6qdl_icore_mmc_defconfig
configs/imx6qdl_icore_nand_defconfig
configs/imx6qdl_icore_rqs_defconfig
configs/imx6ul_geam_mmc_defconfig
configs/imx6ul_geam_nand_defconfig
configs/imx6ul_isiot_emmc_defconfig
configs/imx6ul_isiot_nand_defconfig
configs/imx8mq_phanbell_defconfig
configs/liteboard_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_ddr4_nor_defconfig
configs/ls1021aqds_ddr4_nor_lpuart_defconfig
configs/ls1021aqds_nand_defconfig
configs/ls1021aqds_nor_SECURE_BOOT_defconfig
configs/ls1021aqds_nor_defconfig
configs/ls1021aqds_nor_lpuart_defconfig
configs/ls1021aqds_qspi_defconfig
configs/ls1021aqds_sdcard_ifc_defconfig
configs/ls1021aqds_sdcard_qspi_defconfig
configs/ls1021atwr_nor_SECURE_BOOT_defconfig
configs/ls1021atwr_nor_defconfig
configs/ls1021atwr_nor_lpuart_defconfig
configs/ls1021atwr_qspi_defconfig
configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig
configs/ls1021atwr_sdcard_ifc_defconfig
configs/ls1021atwr_sdcard_qspi_defconfig
configs/ls1028aqds_tfa_SECURE_BOOT_defconfig
configs/ls1028aqds_tfa_defconfig
configs/ls1028aqds_tfa_lpuart_defconfig
configs/ls1028ardb_tfa_SECURE_BOOT_defconfig
configs/ls1028ardb_tfa_defconfig
configs/ls1043aqds_defconfig
configs/ls1043aqds_lpuart_defconfig
configs/ls1043aqds_nand_defconfig
configs/ls1043aqds_nor_ddr3_defconfig
configs/ls1043aqds_qspi_defconfig
configs/ls1043aqds_sdcard_ifc_defconfig
configs/ls1043aqds_sdcard_qspi_defconfig
configs/ls1043aqds_tfa_SECURE_BOOT_defconfig
configs/ls1043aqds_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/ls1088aqds_defconfig
configs/ls1088aqds_qspi_SECURE_BOOT_defconfig
configs/ls1088aqds_qspi_defconfig
configs/ls1088aqds_sdcard_ifc_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/ls2080ardb_nand_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/meerkat96_defconfig
configs/mscc_jr2_defconfig
configs/mscc_luton_defconfig
configs/mscc_ocelot_defconfig
configs/mscc_serval_defconfig
configs/mscc_servalt_defconfig
configs/mt7623n_bpir2_defconfig
configs/mx6memcal_defconfig
configs/mx6qsabrelite_defconfig
configs/mx6sllevk_defconfig
configs/mx6sllevk_plugin_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_defconfig
configs/mx7dsabresd_qspi_defconfig
configs/mx7ulp_evk_defconfig
configs/mx7ulp_evk_plugin_defconfig
configs/nanopi-m4-2gb-rk3399_defconfig [new file with mode: 0644]
configs/nitrogen6dl2g_defconfig
configs/nitrogen6dl_defconfig
configs/nitrogen6q2g_defconfig
configs/nitrogen6q_defconfig
configs/nitrogen6s1g_defconfig
configs/nitrogen6s_defconfig
configs/odroid-xu3_defconfig
configs/odroid_defconfig
configs/pcm052_defconfig
configs/phycore_pcl063_defconfig
configs/pic32mzdask_defconfig
configs/pico-dwarf-imx6ul_defconfig
configs/pico-hobbit-imx6ul_defconfig
configs/pico-imx6ul_defconfig
configs/pico-imx7d_bl33_defconfig
configs/pico-pi-imx6ul_defconfig
configs/roc-cc-rk3328_defconfig [new file with mode: 0644]
configs/roc-pc-mezzanine-rk3399_defconfig [new file with mode: 0644]
configs/rock64-rk3328_defconfig
configs/s32v234evb_defconfig
configs/sandbox64_defconfig
configs/sandbox_defconfig
configs/sandbox_flattree_defconfig
configs/sandbox_spl_defconfig
configs/sansa_fuze_plus_defconfig
configs/socfpga_agilex_defconfig
configs/socfpga_sr1500_defconfig
configs/socfpga_stratix10_defconfig
configs/somlabs_visionsom_6ull_defconfig
configs/stm32mp15_basic_defconfig
configs/stm32mp15_dhcom_basic_defconfig
configs/stm32mp15_optee_defconfig
configs/stm32mp15_trusted_defconfig
configs/strider_con_defconfig
configs/strider_con_dp_defconfig
configs/strider_cpu_defconfig
configs/strider_cpu_dp_defconfig
configs/stv0991_defconfig
configs/tbs2910_defconfig
configs/topic_miami_defconfig
configs/topic_miamilite_defconfig
configs/topic_miamiplus_defconfig
configs/tplink_wdr4300_defconfig
configs/turris_omnia_defconfig
configs/usbarmory_defconfig
configs/verdin-imx8mm_defconfig
configs/vexpress_aemv8a_juno_defconfig
configs/vexpress_aemv8a_semi_defconfig
configs/vf610twr_defconfig
configs/vf610twr_nand_defconfig
configs/warp7_bl33_defconfig
configs/warp7_defconfig
configs/wb45n_defconfig
configs/wb50n_defconfig
configs/xilinx_versal_mini_defconfig
configs/xilinx_versal_virt_defconfig
configs/xilinx_zynq_virt_defconfig
configs/xilinx_zynqmp_mini_defconfig
configs/xilinx_zynqmp_virt_defconfig
configs/xpress_defconfig
configs/xpress_spl_defconfig
configs/zc5202_defconfig
configs/zc5601_defconfig
doc/README.rockchip
doc/board/coreboot/coreboot.rst
doc/develop/crash_dumps.rst [new file with mode: 0644]
doc/develop/index.rst [new file with mode: 0644]
doc/device-tree-bindings/net/phy/atheros.txt [new file with mode: 0644]
doc/device-tree-bindings/phy/phy-mtk-tphy.txt
doc/device-tree-bindings/usb/mediatek,mtk-xhci.txt [new file with mode: 0644]
doc/feature-removal-schedule.txt
doc/index.rst
drivers/ata/dwc_ahsata.c
drivers/cache/cache-l2x0.c
drivers/clk/rockchip/clk_rk3399.c
drivers/core/ofnode.c
drivers/core/read.c
drivers/dfu/Kconfig
drivers/mtd/Kconfig
drivers/mtd/nand/spi/Makefile
drivers/mtd/nand/spi/core.c
drivers/mtd/nand/spi/toshiba.c [new file with mode: 0644]
drivers/mtd/spi/spi-nor-core.c
drivers/mtd/spi/spi-nor-ids.c
drivers/net/Kconfig
drivers/net/dc2114x.c
drivers/net/dwc_eth_qos.c
drivers/net/pcnet.c
drivers/net/phy/atheros.c
drivers/net/rtl8139.c
drivers/net/smc911x.c
drivers/net/smc911x.h
drivers/phy/phy-mtk-tphy.c
drivers/phy/phy-uclass.c
drivers/qe/qe.c
drivers/rng/Kconfig
drivers/rng/Makefile
drivers/rng/rockchip_rng.c [new file with mode: 0644]
drivers/rtc/ds1337.c
drivers/rtc/pcf2127.c
drivers/rtc/pt7c4338.c
drivers/serial/serial_pl01x.c
drivers/spi/cadence_qspi.c
drivers/spi/fsl_qspi.c
drivers/spi/fsl_qspi.h [deleted file]
drivers/spi/spi-mem.c
drivers/spi/spi-sifive.c
drivers/timer/mtk_timer.c
drivers/usb/dwc3/core.c
drivers/usb/dwc3/dwc3-generic.c
drivers/usb/gadget/dwc2_udc_otg.c
drivers/usb/host/Kconfig
drivers/usb/host/Makefile
drivers/usb/host/xhci-dwc3.c
drivers/usb/host/xhci-mtk.c [new file with mode: 0644]
drivers/usb/host/xhci.c
drivers/video/rockchip/rk3288_mipi.c
drivers/video/rockchip/rk3399_mipi.c
drivers/video/rockchip/rk_edp.c
drivers/video/rockchip/rk_lvds.c
drivers/video/rockchip/rk_mipi.c
drivers/watchdog/Kconfig
drivers/watchdog/mtk_wdt.c
env/sf.c
examples/standalone/Makefile
examples/standalone/smc911x_eeprom.c
fs/ext4/ext4_journal.c
include/bedbug/type.h
include/configs/10m50_devboard.h
include/configs/3c120_devboard.h
include/configs/B4860QDS.h
include/configs/BSC9131RDB.h
include/configs/BSC9132QDS.h
include/configs/C29XPCIE.h
include/configs/M5208EVBE.h
include/configs/M52277EVB.h
include/configs/M5235EVB.h
include/configs/M5249EVB.h
include/configs/M5253DEMO.h
include/configs/M5272C3.h
include/configs/M5275EVB.h
include/configs/M5282EVB.h
include/configs/M53017EVB.h
include/configs/M5329EVB.h
include/configs/M5373EVB.h
include/configs/M54418TWR.h
include/configs/M54451EVB.h
include/configs/M54455EVB.h
include/configs/M5475EVB.h
include/configs/M5485EVB.h
include/configs/MCR3000.h
include/configs/MPC8308RDB.h
include/configs/MPC8313ERDB_NAND.h
include/configs/MPC8313ERDB_NOR.h
include/configs/MPC8315ERDB.h
include/configs/MPC8323ERDB.h
include/configs/MPC832XEMDS.h
include/configs/MPC8349EMDS.h
include/configs/MPC8349EMDS_SDRAM.h
include/configs/MPC8349ITX.h
include/configs/MPC837XEMDS.h
include/configs/MPC837XERDB.h
include/configs/MPC8536DS.h
include/configs/MPC8540ADS.h
include/configs/MPC8541CDS.h
include/configs/MPC8544DS.h
include/configs/MPC8548CDS.h
include/configs/MPC8555CDS.h
include/configs/MPC8560ADS.h
include/configs/MPC8568MDS.h
include/configs/MPC8569MDS.h
include/configs/MPC8572DS.h
include/configs/MPC8610HPCD.h
include/configs/MPC8641HPCN.h
include/configs/MigoR.h
include/configs/P1010RDB.h
include/configs/P1022DS.h
include/configs/P1023RDB.h
include/configs/P2041RDB.h
include/configs/SBx81LIFKW.h
include/configs/SBx81LIFXCAT.h
include/configs/T102xQDS.h
include/configs/T102xRDB.h
include/configs/T1040QDS.h
include/configs/T104xRDB.h
include/configs/T208xQDS.h
include/configs/T208xRDB.h
include/configs/T4240QDS.h
include/configs/T4240RDB.h
include/configs/TQM834x.h
include/configs/UCP1020.h
include/configs/adp-ae3xx.h
include/configs/adp-ag101p.h
include/configs/advantech_dms-ba16.h
include/configs/am3517_crane.h
include/configs/am3517_evm.h
include/configs/amcore.h
include/configs/ap121.h
include/configs/ap143.h
include/configs/ap152.h
include/configs/apalis-imx8.h
include/configs/apalis_imx6.h
include/configs/apf27.h
include/configs/aristainetos2.h
include/configs/armadillo-800eva.h
include/configs/astro_mcf5373l.h
include/configs/at91rm9200ek.h
include/configs/at91sam9260ek.h
include/configs/at91sam9261ek.h
include/configs/at91sam9263ek.h
include/configs/at91sam9m10g45ek.h
include/configs/at91sam9n12ek.h
include/configs/at91sam9rlek.h
include/configs/at91sam9x5ek.h
include/configs/ax25-ae350.h
include/configs/bk4r1.h
include/configs/blanche.h
include/configs/boston.h
include/configs/brppt2.h
include/configs/caddy2.h
include/configs/capricorn-common.h
include/configs/cgtqmx6eval.h
include/configs/ci20.h
include/configs/cl-som-imx7.h
include/configs/cm_fx6.h
include/configs/cm_t35.h
include/configs/cobra5272.h
include/configs/colibri-imx6ull.h
include/configs/colibri-imx8x.h
include/configs/colibri_imx6.h
include/configs/colibri_imx7.h
include/configs/colibri_pxa270.h
include/configs/colibri_vf.h
include/configs/controlcenterd.h
include/configs/corenet_ds.h
include/configs/cyrus.h
include/configs/da850evm.h
include/configs/dart_6ul.h
include/configs/db-88f6281-bp.h
include/configs/devkit3250.h
include/configs/devkit8000.h
include/configs/dh_imx6.h
include/configs/eb_cpu5282.h
include/configs/edison.h
include/configs/edminiv2.h
include/configs/el6x_common.h
include/configs/embestmx6boards.h
include/configs/ethernut5.h
include/configs/evb_ast2500.h
include/configs/exynos5-common.h
include/configs/flea3.h
include/configs/gardena-smart-gateway-mt7688.h
include/configs/gazerbeam.h
include/configs/ge_bx50v3.h
include/configs/grpeach.h
include/configs/gw_ventana.h
include/configs/highbank.h
include/configs/hrcon.h
include/configs/ids8313.h
include/configs/imx27lite-common.h
include/configs/imx6-engicam.h
include/configs/imx6_logic.h
include/configs/imx6dl-mamoj.h
include/configs/imx8mm_evk.h
include/configs/imx8mn_evk.h
include/configs/imx8mp_evk.h
include/configs/imx8mq_evk.h
include/configs/imx8qm_rom7720.h
include/configs/integrator-common.h
include/configs/km/km-powerpc.h
include/configs/km/km_arm.h
include/configs/kmcoge5ne.h
include/configs/kzm9g.h
include/configs/legoev3.h
include/configs/linkit-smart-7688.h
include/configs/liteboard.h
include/configs/ls1012a2g5rdb.h
include/configs/ls1012afrdm.h
include/configs/ls1012afrwy.h
include/configs/ls1012aqds.h
include/configs/ls1012ardb.h
include/configs/ls1021aqds.h
include/configs/ls1021atwr.h
include/configs/ls1028a_common.h
include/configs/ls1043aqds.h
include/configs/ls1046aqds.h
include/configs/ls1088aqds.h
include/configs/ls1088ardb.h
include/configs/m53menlo.h
include/configs/malta.h
include/configs/mccmon6.h
include/configs/meerkat96.h
include/configs/meesc.h
include/configs/microchip_mpfs_icicle.h
include/configs/mpc8308_p1m.h
include/configs/mt7623.h
include/configs/mv-common.h
include/configs/mvebu_armada-37xx.h
include/configs/mvebu_armada-8k.h
include/configs/mx25pdk.h
include/configs/mx31pdk.h
include/configs/mx35pdk.h
include/configs/mx51evk.h
include/configs/mx53ard.h
include/configs/mx53cx9020.h
include/configs/mx53evk.h
include/configs/mx53loco.h
include/configs/mx53ppd.h
include/configs/mx53smd.h
include/configs/mx6memcal.h
include/configs/mx6qarm2.h
include/configs/mx6sabre_common.h
include/configs/mx6slevk.h
include/configs/mx6sllevk.h
include/configs/mx6sxsabreauto.h
include/configs/mx6sxsabresd.h
include/configs/mx6ul_14x14_evk.h
include/configs/mx6ullevk.h
include/configs/mx7dsabresd.h
include/configs/mx7ulp_com.h
include/configs/mx7ulp_evk.h
include/configs/mxs.h
include/configs/nitrogen6x.h
include/configs/nokia_rx51.h
include/configs/novena.h
include/configs/odroid.h
include/configs/odroid_xu3.h
include/configs/omap3_igep00x0.h
include/configs/omap3_logic.h
include/configs/omap3_overo.h
include/configs/omap3_pandora.h
include/configs/omap3_zoom1.h
include/configs/omapl138_lcdk.h
include/configs/origen.h
include/configs/p1_p2_rdb_pc.h
include/configs/p1_twr.h
include/configs/pcl063.h
include/configs/pcl063_ull.h
include/configs/pcm051.h
include/configs/pcm052.h
include/configs/pic32mzdask.h
include/configs/pico-imx6.h
include/configs/pico-imx6ul.h
include/configs/pico-imx7d.h
include/configs/picosam9g45.h
include/configs/platinum.h
include/configs/pm9261.h
include/configs/pm9263.h
include/configs/pm9g45.h
include/configs/presidio_asic.h
include/configs/pxa-common.h
include/configs/qemu-mips.h
include/configs/qemu-mips64.h
include/configs/qemu-ppce500.h
include/configs/r2dplus.h
include/configs/r7780mp.h
include/configs/rk3399_common.h
include/configs/rockchip-common.h
include/configs/rpi.h
include/configs/s32v234evb.h
include/configs/s5p_goni.h
include/configs/s5pc210_universal.h
include/configs/sandbox.h
include/configs/sbc8349.h
include/configs/sbc8548.h
include/configs/sbc8641d.h
include/configs/secomx6quq7.h
include/configs/sh7752evb.h
include/configs/sh7753evb.h
include/configs/sh7757lcr.h
include/configs/sh7763rdp.h
include/configs/siemens-am33x-common.h
include/configs/smartweb.h
include/configs/smdkc100.h
include/configs/smdkv310.h
include/configs/snapper9260.h
include/configs/snapper9g45.h
include/configs/socfpga_common.h
include/configs/socfpga_soc64_common.h
include/configs/socrates.h
include/configs/somlabs_visionsom_6ull.h
include/configs/spear-common.h
include/configs/stm32mp1.h
include/configs/stmark2.h
include/configs/strider.h
include/configs/stv0991.h
include/configs/t4qds.h
include/configs/tam3517-common.h
include/configs/tao3530.h
include/configs/tbs2910.h
include/configs/tegra-common.h
include/configs/thunderx_88xx.h
include/configs/ti814x_evm.h
include/configs/titanium.h
include/configs/topic_miami.h
include/configs/tplink_wdr4300.h
include/configs/trats.h
include/configs/trats2.h
include/configs/tricorder.h
include/configs/turris_mox.h
include/configs/udoo.h
include/configs/udoo_neo.h
include/configs/usb_a9263.h
include/configs/usbarmory.h
include/configs/vcoreiii.h
include/configs/ve8313.h
include/configs/verdin-imx8mm.h
include/configs/vexpress_aemv8a.h
include/configs/vexpress_common.h
include/configs/vf610twr.h
include/configs/vining_2000.h
include/configs/vme8349.h
include/configs/vocore2.h
include/configs/wandboard.h
include/configs/warp.h
include/configs/warp7.h
include/configs/wb45n.h
include/configs/wb50n.h
include/configs/work_92105.h
include/configs/x530.h
include/configs/x600.h
include/configs/x86-common.h
include/configs/xilinx_versal.h
include/configs/xilinx_versal_mini.h
include/configs/xilinx_zynqmp.h
include/configs/xilinx_zynqmp_mini.h
include/configs/xilinx_zynqmp_r5.h
include/configs/xpedite517x.h
include/configs/xpedite520x.h
include/configs/xpedite537x.h
include/configs/xpedite550x.h
include/configs/xpress.h
include/configs/xtfpga.h
include/configs/zmx25.h
include/configs/zynq-common.h
include/crypto/pkcs7_parser.h [new file with mode: 0644]
include/crypto/x509_parser.h [new file with mode: 0644]
include/dm/ofnode.h
include/dm/read.h
include/dt-bindings/clock/rk3328-cru.h
include/dt-bindings/net/qca-ar803x.h [new file with mode: 0644]
include/dt-bindings/power/rk3328-power.h [new file with mode: 0644]
include/dwc3-uboot.h
include/eeprom.h
include/efi_loader.h
include/environment/distro/sf.h [new file with mode: 0644]
include/fsl_qe.h
include/generic-phy.h
include/linux/mtd/spi-nor.h
include/linux/mtd/spinand.h
include/menu.h
include/netdev.h
include/spi-mem.h
include/test/test.h
include/usb/xhci.h
lib/crypto/pkcs7_parser.c
lib/crypto/pkcs7_parser.h [deleted file]
lib/crypto/x509_cert_parser.c
lib/crypto/x509_parser.h [deleted file]
lib/crypto/x509_public_key.c
lib/efi_loader/Makefile
lib/efi_loader/efi_device_path.c
lib/efi_loader/efi_disk.c
lib/efi_loader/efi_image_loader.c
lib/efi_loader/efi_setup.c
lib/efi_loader/efi_signature.c
lib/efi_loader/efi_variable.c
lib/efi_selftest/efi_selftest_memory.c
lib/rsa/rsa-mod-exp.c
lib/tiny-printf.c
scripts/Makefile.lib
scripts/config_whitelist.txt
scripts/get_default_envs.sh
test/dm/ofnode.c
test/dm/phy.c
test/lib/asn1.c
test/log/nolog_test.c
test/log/syslog_test.c
test/py/tests/test_efi_secboot/test_authvar.py
test/py/tests/test_efi_secboot/test_signed.py
test/py/tests/test_efi_secboot/test_unsigned.py
test/py/tests/test_ut.py
test/py/tests/test_vboot.py
tools/fit_image.c
tools/mkimage.h

index f3fb5ed51ba6d0f05263f3af74a4768dfcc55a97..44949ea239d8ea1f459c5f57bda669a59a01b63c 100644 (file)
@@ -7,7 +7,7 @@ version: 2
 
 # Build documentation in the docs/ directory with Sphinx
 sphinx:
-  configuration: docs/conf.py
+  configuration: doc/conf.py
 
 # Optionally build your docs in additional formats such as PDF and ePub
 formats: []
diff --git a/Kconfig b/Kconfig
index 9a5e60075389a5dc9ee2d53a72ede1b6b17c056b..15f1a75c61abbf0d7bad430250271532fff18dba 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -209,6 +209,20 @@ if EXPERT
          When disabling this, please check if malloc calls, maybe
          should be replaced by calloc - if one expects zeroed memory.
 
+config SYS_MALLOC_DEFAULT_TO_INIT
+       bool "Default malloc to init while reserving the memory for it"
+       default n
+       help
+         It may happen that one needs to move the dynamic allocation
+         from one to another memory range, eg. when moving the malloc
+         from the limited static to a potentially large dynamic (DDR)
+         memory.
+
+         If so then on top of setting the updated memory aside one
+         needs to bring the malloc init.
+
+         If such a scenario is sought choose yes.
+
 config TOOLS_DEBUG
        bool "Enable debug information for tools"
        help
index 66f0b07263e22413cc41bdae52f7e2e5526332bf..ec59ce8b8802658b2caf6de5f7a59da2761cb9b2 100644 (file)
@@ -244,9 +244,12 @@ S: Maintained
 F:     arch/arm/mach-mediatek/
 F:     arch/arm/include/asm/arch-mediatek/
 F:     board/mediatek/
+F:     doc/device-tree-bindings/phy/phy-mtk-*
+F:     doc/device-tree-bindings/usb/mediatek,*
 F:     doc/README.mediatek
 F:     drivers/clk/mediatek/
 F:     drivers/mmc/mtk-sd.c
+F:     drivers/phy/phy-mtk-*
 F:     drivers/pinctrl/mediatek/
 F:     drivers/power/domain/mtk-power-domain.c
 F:     drivers/ram/mediatek/
index 6bb9cf55f2aa1c0456618725798ee78c50793cc8..cc99873062f0093bab218bb3c4cf711a0f48f04c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -926,6 +926,9 @@ ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi
 ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),)
 ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 endif
+ifeq ($(CONFIG_SYS_COREBOOT)$(CONFIG_SPL),yy)
+ALL-$(CONFIG_BINMAN) += u-boot-x86-with-spl.bin
+endif
 
 # Build a combined spl + u-boot image for sunxi
 ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy)
@@ -1626,6 +1629,9 @@ u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE
 endif
 endif
 
+u-boot-x86-with-spl.bin: spl/u-boot-spl.bin u-boot.bin FORCE
+       $(call if_changed,binman)
+
 ifneq ($(CONFIG_TEGRA),)
 ifneq ($(CONFIG_BINMAN),)
 # Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin
diff --git a/README b/README
index 083485067654c319b7f7b84227ae23c689467b1d..be9e6391d6b8f90e1151abb5883f4b0a67d56753 100644 (file)
--- a/README
+++ b/README
@@ -896,8 +896,6 @@ The following options need to be configured:
 
                CONFIG_TULIP
                Support for Digital 2114x chips.
-               Optional CONFIG_TULIP_SELECT_MEDIA for board specific
-               modem chip initialisation (KS8761/QS6611).
 
                CONFIG_NATSEMI
                Support for National dp83815 chips.
@@ -2475,14 +2473,6 @@ Configuration Settings:
 - CONFIG_SYS_BAUDRATE_TABLE:
                List of legal baudrate settings for this board.
 
-- CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END:
-               Begin and End addresses of the area used by the
-               simple memory test.
-
-- CONFIG_SYS_MEMTEST_SCRATCH:
-               Scratch address used by the alternate memory test
-               You only need to set this if address zero isn't writeable
-
 - CONFIG_SYS_MEM_RESERVE_SECURE
                Only implemented for ARMv8 for now.
                If defined, the size of CONFIG_SYS_MEM_RESERVE_SECURE memory
index 8e67e1c58733c474213738384f9a33e2560060ca..0d463088a2e4c180e043ba91432bca0064145b4f 100644 (file)
@@ -340,6 +340,34 @@ config SYS_CACHELINE_SIZE
        default 64 if SYS_CACHE_SHIFT_6
        default 32 if SYS_CACHE_SHIFT_5
 
+choice
+       prompt "Select the ARM data write cache policy"
+       default SYS_ARM_CACHE_WRITETHROUGH if TARGET_BCMCYGNUS || \
+                                             TARGET_BCMNSP || CPU_PXA || RZA1
+       default SYS_ARM_CACHE_WRITEBACK
+
+config SYS_ARM_CACHE_WRITEBACK
+       bool "Write-back (WB)"
+       help
+         A write updates the cache only and marks the cache line as dirty.
+         External memory is updated only when the line is evicted or explicitly
+         cleaned.
+
+config SYS_ARM_CACHE_WRITETHROUGH
+       bool "Write-through (WT)"
+       help
+         A write updates both the cache and the external memory system.
+         This does not mark the cache line as dirty.
+
+config SYS_ARM_CACHE_WRITEALLOC
+       bool "Write allocation (WA)"
+       help
+         A cache line is allocated on a write miss. This means that executing a
+         store instruction on the processor might cause a burst read to occur.
+         There is a linefill to obtain the data for the cache line, before the
+         write is performed.
+endchoice
+
 config ARCH_CPU_INIT
        bool "Enable ARCH_CPU_INIT"
        help
@@ -881,7 +909,7 @@ config ARCH_OWL
        select CLK
        select CLK_OWL
        select OF_CONTROL
-       select CONFIG_SYS_RELOC_GD_ENV_ADDR
+       select SYS_RELOC_GD_ENV_ADDR
        imply CMD_DM
 
 config ARCH_QEMU
@@ -1134,6 +1162,17 @@ config TARGET_VEXPRESS64_JUNO
        bool "Support Versatile Express Juno Development Platform"
        select ARM64
        select PL01X_SERIAL
+       select DM
+       select OF_CONTROL
+       select OF_BOARD
+       select CLK
+       select DM_SERIAL
+       select ARM_PSCI_FW
+       select PSCI_RESET
+       select DM
+       select BLK
+       select USB
+       select DM_USB
 
 config TARGET_LS2080A_EMU
        bool "Support ls2080a_emu"
index 312e6e377b780be5c54eb7d9c17982bd714e136d..559d3ab6a7ad92555cabcdbc9d7a732d728e617b 100644 (file)
@@ -106,6 +106,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3308) += \
 
 dtb-$(CONFIG_ROCKCHIP_RK3328) += \
        rk3328-evb.dtb \
+       rk3328-roc-cc.dtb \
        rk3328-rock64.dtb
 
 dtb-$(CONFIG_ROCKCHIP_RK3368) += \
@@ -125,12 +126,14 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
        rk3399-leez-p710.dtb \
        rk3399-nanopc-t4.dtb \
        rk3399-nanopi-m4.dtb \
+       rk3399-nanopi-m4-2gb.dtb \
        rk3399-nanopi-neo4.dtb \
        rk3399-orangepi.dtb \
        rk3399-puma-ddr1333.dtb \
        rk3399-puma-ddr1600.dtb \
        rk3399-puma-ddr1866.dtb \
        rk3399-roc-pc.dtb \
+       rk3399-roc-pc-mezzanine.dtb \
        rk3399-rock-pi-4.dtb \
        rk3399-rock960.dtb \
        rk3399-rockpro64.dtb
index 683dac2a7c18ae599edd51e70d3c1768c19709da..07c7b91175a3939c75340302f984c6f45e92729d 100644 (file)
 &comphy {
        phy0 {
                phy-type = <PHY_TYPE_SGMII1>;
-               phy-speed = <PHY_SPEED_1_25G>;
+               phy-speed = <PHY_SPEED_3_125G>;
        };
         phy1 {
                 phy-type = <PHY_TYPE_SGMII0>;
-                phy-speed = <PHY_SPEED_1_25G>;
+                phy-speed = <PHY_SPEED_3_125G>;
         };
 
         phy2 {
 &eth0 {
        pinctrl-0 = <&pcie_pins>;
        status = "okay";
-       phy-mode = "sgmii";
+       phy-mode = "2500base-x";
+       managed = "in-band-status";
        phy = <&ethphy0>;
-       fixed-link {
-               speed = <1000>;
-               full-duplex;
-       };
 };
 
 &eth1 {
        status = "okay";
-       phy-mode = "sgmii";
+       phy-mode = "2500base-x";
+       managed = "in-band-status";
        phy = <&ethphy1>;
-       fixed-link {
-               speed = <1000>;
-               full-duplex;
-       };
 };
 
 &i2c0 {
index 9c7fb0acae79c9d3c34f58e1acca360057d0c43e..4a0c1037fbc06336513a99f73ca0e3f4827553e7 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * Keyboard dts fragment for devices that use cros-ec-keyboard
  *
  * Copyright (c) 2014 Google, Inc
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
 */
 
 #include <dt-bindings/input/input.h>
@@ -22,6 +19,7 @@
                        MATRIX_KEY(0x00, 0x02, KEY_F1)
                        MATRIX_KEY(0x00, 0x03, KEY_B)
                        MATRIX_KEY(0x00, 0x04, KEY_F10)
+                       MATRIX_KEY(0x00, 0x05, KEY_RO)
                        MATRIX_KEY(0x00, 0x06, KEY_N)
                        MATRIX_KEY(0x00, 0x08, KEY_EQUAL)
                        MATRIX_KEY(0x00, 0x0a, KEY_RIGHTALT)
@@ -34,6 +32,7 @@
                        MATRIX_KEY(0x01, 0x08, KEY_APOSTROPHE)
                        MATRIX_KEY(0x01, 0x09, KEY_F9)
                        MATRIX_KEY(0x01, 0x0b, KEY_BACKSPACE)
+                       MATRIX_KEY(0x01, 0x0c, KEY_HENKAN)
 
                        MATRIX_KEY(0x02, 0x00, KEY_LEFTCTRL)
                        MATRIX_KEY(0x02, 0x01, KEY_TAB)
@@ -45,6 +44,7 @@
                        MATRIX_KEY(0x02, 0x07, KEY_102ND)
                        MATRIX_KEY(0x02, 0x08, KEY_LEFTBRACE)
                        MATRIX_KEY(0x02, 0x09, KEY_F8)
+                       MATRIX_KEY(0x02, 0x0a, KEY_YEN)
 
                        MATRIX_KEY(0x03, 0x01, KEY_GRAVE)
                        MATRIX_KEY(0x03, 0x02, KEY_F2)
@@ -52,7 +52,9 @@
                        MATRIX_KEY(0x03, 0x04, KEY_F5)
                        MATRIX_KEY(0x03, 0x06, KEY_6)
                        MATRIX_KEY(0x03, 0x08, KEY_MINUS)
+                       MATRIX_KEY(0x03, 0x09, KEY_F13)
                        MATRIX_KEY(0x03, 0x0b, KEY_BACKSLASH)
+                       MATRIX_KEY(0x03, 0x0c, KEY_MUHENKAN)
 
                        MATRIX_KEY(0x04, 0x00, KEY_RIGHTCTRL)
                        MATRIX_KEY(0x04, 0x01, KEY_A)
index dfe5ea6ca2c271b09b5f2394bcbd6890dec3bf3a..71f5c5ecce46905b0b0faf6f5d36f90d8cb92487 100644 (file)
@@ -1,8 +1,45 @@
-// SPDX-License-Identifier: GPL-2.0
 /*
  * Smart battery dts fragment for devices that use cros-ec-sbs
  *
  * Copyright (c) 2015 Google, Inc
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
 &i2c_tunnel {
index 687fe1c02971a99001d7db94b378c3af8e1a1650..bf84f76344047df96af0e9e474d76b3aed4c3634 100644 (file)
        status = "okay";
 };
 
+&xhci {
+       status = "okay";
+};
+
+&u3phy {
+       status = "okay";
+};
+
 &watchdog {
        pinctrl-names = "default";
        pinctrl-0 = <&watchdog_pins>;
index 644d2da4a88ed18bf256656aefb75b30431ebae8..6850e0058d485f54387de29bec0ad351120e1819 100644 (file)
@@ -11,6 +11,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/power/mt7629-power.h>
 #include <dt-bindings/reset/mt7629-reset.h>
+#include <dt-bindings/phy/phy.h>
 #include "skeleton.dtsi"
 
 / {
                #size-cells = <0>;
        };
 
+       ssusbsys: ssusbsys@1a000000 {
+               compatible = "mediatek,mt7629-ssusbsys", "syscon";
+               reg = <0x1a000000 0x1000>;
+               #clock-cells = <1>;
+       };
+
+       xhci: usb@1a0c0000 {
+               compatible = "mediatek,mt7629-xhci", "mediatek,mtk-xhci";
+               reg = <0x1a0c0000 0x1000>, <0x1a0c3e00 0x0100>;
+               reg-names = "mac", "ippc";
+               power-domains = <&scpsys MT7629_POWER_DOMAIN_HIF1>;
+               clocks = <&ssusbsys CLK_SSUSB_SYS_EN>,
+                        <&ssusbsys CLK_SSUSB_REF_EN>,
+                        <&ssusbsys CLK_SSUSB_MCU_EN>,
+                        <&ssusbsys CLK_SSUSB_DMA_EN>;
+               clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck";
+               phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>;
+               status = "disabled";
+       };
+
+       u3phy: usb-phy@1a0c4000 {
+               compatible = "mediatek,mt7629-tphy", "mediatek,generic-tphy-v2";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x1a0c4000 0x1000>;
+               status = "disabled";
+
+               u2port0: usb-phy@0 {
+                       reg = <0x0 0x0700>;
+                       #phy-cells = <1>;
+                       clocks = <&ssusbsys CLK_SSUSB_U2_PHY_EN>;
+                       clock-names = "ref";
+               };
+
+               u3port0: usb-phy@700 {
+                       reg = <0x0700 0x0700>;
+                       #phy-cells = <1>;
+               };
+       };
+
        ethsys: syscon@1b000000 {
                compatible = "mediatek,mt7629-ethsys", "syscon";
                reg = <0x1b000000 0x1000>;
index a2a2c07dcc1f8c97408a95b78fb1749b73c13ceb..61b1433af9192044a34ccf66763f2142a44288ab 100644 (file)
@@ -1,84 +1,10 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * (C) Copyright 2017 Rockchip Electronics Co., Ltd
+ * (C) Copyright 2020 Rockchip Electronics Co., Ltd
  */
 
-/ {
-       aliases {
-               mmc0 = &emmc;
-               mmc1 = &sdmmc;
-       };
+#include "px30-u-boot.dtsi"
 
-       chosen {
-               u-boot,spl-boot-order = &emmc, &sdmmc;
-       };
-};
-
-&dmc {
-       u-boot,dm-pre-reloc;
-};
-
-&uart2 {
-       clock-frequency = <24000000>;
-       u-boot,dm-pre-reloc;
-};
-
-&uart5 {
-       clock-frequency = <24000000>;
-       u-boot,dm-pre-reloc;
-};
-
-&sdmmc {
-       u-boot,dm-pre-reloc;
-
-       /* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
-       u-boot,spl-fifo-mode;
-};
-
-&emmc {
-       u-boot,dm-pre-reloc;
-
-       /* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
-       u-boot,spl-fifo-mode;
-};
-
-&grf {
-       u-boot,dm-pre-reloc;
-};
-
-&pmugrf {
-       u-boot,dm-pre-reloc;
-};
-
-&xin24m {
-       u-boot,dm-pre-reloc;
-};
-
-&cru {
-       u-boot,dm-pre-reloc;
-};
-
-&pmucru {
-       u-boot,dm-pre-reloc;
-};
-
-&saradc {
-       u-boot,dm-pre-reloc;
+&rng {
        status = "okay";
 };
-
-&gpio0 {
-       u-boot,dm-pre-reloc;
-};
-
-&gpio1 {
-       u-boot,dm-pre-reloc;
-};
-
-&gpio2 {
-       u-boot,dm-pre-reloc;
-};
-
-&gpio3 {
-       u-boot,dm-pre-reloc;
-};
index d886f17242fcb17aa3f06cbb540ddcbed287212c..4134e2ee13d8e39097dffce63c4efb63863885db 100644 (file)
@@ -8,7 +8,6 @@
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include "px30.dtsi"
-#include "px30-evb-u-boot.dtsi"
 
 / {
        model = "Rockchip PX30 EVB";
index bb782b4e2df138afb9425806c71e4b5dfe882d40..aea9f4d6e51f35600676c6815d82f55b1ec64613 100644 (file)
@@ -1,84 +1,6 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ * (C) Copyright 2020 Rockchip Electronics Co., Ltd
  */
 
-/ {
-       aliases {
-               mmc0 = &emmc;
-               mmc1 = &sdmmc;
-       };
-
-       chosen {
-               u-boot,spl-boot-order = &emmc, &sdmmc;
-       };
-};
-
-&dmc {
-       u-boot,dm-pre-reloc;
-};
-
-&uart2 {
-       clock-frequency = <24000000>;
-       u-boot,dm-pre-reloc;
-};
-
-&uart5 {
-       clock-frequency = <24000000>;
-       u-boot,dm-pre-reloc;
-};
-
-&sdmmc {
-       u-boot,dm-pre-reloc;
-
-       /* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
-       u-boot,spl-fifo-mode;
-};
-
-&emmc {
-       u-boot,dm-pre-reloc;
-
-       /* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
-       u-boot,spl-fifo-mode;
-};
-
-&grf {
-       u-boot,dm-pre-reloc;
-};
-
-&pmugrf {
-       u-boot,dm-pre-reloc;
-};
-
-&xin24m {
-       u-boot,dm-pre-reloc;
-};
-
-&cru {
-       u-boot,dm-pre-reloc;
-};
-
-&pmucru {
-       u-boot,dm-pre-reloc;
-};
-
-&saradc {
-       u-boot,dm-pre-reloc;
-       status = "okay";
-};
-
-&gpio0 {
-       u-boot,dm-pre-reloc;
-};
-
-&gpio1 {
-       u-boot,dm-pre-reloc;
-};
-
-&gpio2 {
-       u-boot,dm-pre-reloc;
-};
-
-&gpio3 {
-       u-boot,dm-pre-reloc;
-};
+#include "px30-u-boot.dtsi"
diff --git a/arch/arm/dts/px30-u-boot.dtsi b/arch/arm/dts/px30-u-boot.dtsi
new file mode 100644 (file)
index 0000000..029c8fb
--- /dev/null
@@ -0,0 +1,90 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ */
+
+/ {
+       aliases {
+               mmc0 = &emmc;
+               mmc1 = &sdmmc;
+       };
+
+       chosen {
+               u-boot,spl-boot-order = &emmc, &sdmmc;
+       };
+
+       rng: rng@ff0b0000 {
+               compatible = "rockchip,cryptov2-rng";
+               reg = <0x0 0xff0b0000 0x0 0x4000>;
+               status = "disabled";
+       };
+};
+
+&dmc {
+       u-boot,dm-pre-reloc;
+};
+
+&uart2 {
+       clock-frequency = <24000000>;
+       u-boot,dm-pre-reloc;
+};
+
+&uart5 {
+       clock-frequency = <24000000>;
+       u-boot,dm-pre-reloc;
+};
+
+&sdmmc {
+       u-boot,dm-pre-reloc;
+
+       /* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
+       u-boot,spl-fifo-mode;
+};
+
+&emmc {
+       u-boot,dm-pre-reloc;
+
+       /* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
+       u-boot,spl-fifo-mode;
+};
+
+&grf {
+       u-boot,dm-pre-reloc;
+};
+
+&pmugrf {
+       u-boot,dm-pre-reloc;
+};
+
+&xin24m {
+       u-boot,dm-pre-reloc;
+};
+
+&cru {
+       u-boot,dm-pre-reloc;
+};
+
+&pmucru {
+       u-boot,dm-pre-reloc;
+};
+
+&saradc {
+       u-boot,dm-pre-reloc;
+       status = "okay";
+};
+
+&gpio0 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio1 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio2 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio3 {
+       u-boot,dm-pre-reloc;
+};
index 4a827063c55571f3ef50139890e590464c9b0674..4bfa0c2330ba436c0a45bfca0a7d04e640c8bca2 100644 (file)
@@ -6,6 +6,45 @@
 #include "rk3328-u-boot.dtsi"
 #include "rk3328-sdram-ddr3-666.dtsi"
 
+/{
+       gmac_clkin: external-gmac-clock {
+               compatible = "fixed-clock";
+               clock-frequency = <125000000>;
+               clock-output-names = "gmac_clkin";
+               #clock-cells = <0>;
+       };
+
+       vcc5v0_host_xhci: vcc5v0-host-xhci-drv {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 0 GPIO_ACTIVE_HIGH>;
+               regulator-name = "vcc5v0_host_xhci";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+       };
+};
+
+&gmac2io {
+       phy-supply = <&vcc_phy>;
+       phy-mode = "rgmii";
+       clock_in_out = "input";
+       snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 10000 50000>;
+       assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
+       assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmiim1_pins>;
+       tx_delay = <0x26>;
+       rx_delay = <0x11>;
+       status = "okay";
+};
+
+&gmac2phy {
+       /* Integrated PHY unsupported by U-boot */
+       status = "broken";
+};
+
 &usb_host0_xhci {
        vbus-supply = <&vcc5v0_host_xhci>;
        status = "okay";
index a2ee838fcd6baeed47d81577afdf9cee59383cd2..6abc6f4a86cfbf38bf2c7c9411a8a4fecb6426b1 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
  */
 
 /dts-v1/;
        compatible = "rockchip,rk3328-evb", "rockchip,rk3328";
 
        chosen {
-               stdout-path = &uart2;
+               stdout-path = "serial2:1500000n8";
        };
 
-       gmac_clkin: external-gmac-clock {
-               compatible = "fixed-clock";
-               clock-frequency = <125000000>;
-               clock-output-names = "gmac_clkin";
-               #clock-cells = <0>;
-       };
-
-       vcc3v3_sdmmc: sdmmc-pwren {
+       dc_12v: dc-12v {
                compatible = "regulator-fixed";
-               regulator-name = "vcc3v3";
-               gpio = <&gpio0 30 GPIO_ACTIVE_LOW>;
+               regulator-name = "dc_12v";
                regulator-always-on;
                regulator-boot-on;
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+       };
+
+       sdio_pwrseq: sdio-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_enable_h>;
+
+               /*
+                * On the module itself this is one of these (depending
+                * on the actual card populated):
+                * - SDIO_RESET_L_WL_REG_ON
+                * - PDN (power down when low)
+                */
+               reset-gpios = <&gpio1 18 GPIO_ACTIVE_LOW>;
        };
 
-       vcc5v0_otg: vcc5v0-otg-drv {
+       vcc_sd: sdmmc-regulator {
                compatible = "regulator-fixed";
-               enable-active-high;
-               regulator-name = "vcc5v0_otg";
-               gpio = <&gpio0 27 GPIO_ACTIVE_HIGH>;
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
+               gpio = <&gpio0 30 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&sdmmc0m1_gpio>;
+               regulator-name = "vcc_sd";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_io>;
        };
 
-       vcc5v0_host_xhci: vcc5v0-host-xhci-drv {
+       vcc_sys: vcc-sys {
                compatible = "regulator-fixed";
-               enable-active-high;
-               regulator-name = "vcc5v0_host_xhci";
-               gpio = <&gpio0 0 GPIO_ACTIVE_HIGH>;
+               regulator-name = "vcc_sys";
+               regulator-always-on;
+               regulator-boot-on;
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc_12v>;
        };
 
        vcc_phy: vcc-phy-regulator {
        };
 };
 
-&saradc {
-       status = "okay";
-};
-
-&uart2 {
-       status = "okay";
-};
-
-&sdmmc {
-       bus-width = <4>;
-       cap-mmc-highspeed;
-       cap-sd-highspeed;
-       card-detect-delay = <200>;
-       disable-wp;
-       num-slots = <1>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>;
-       status = "okay";
+&cpu0 {
+       cpu-supply = <&vdd_arm>;
 };
 
 &emmc {
        bus-width = <8>;
        cap-mmc-highspeed;
-       supports-emmc;
-       disable-wp;
        non-removable;
-       num-slots = <1>;
        pinctrl-names = "default";
        pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
        status = "okay";
 };
 
-&gmac2io {
+&gmac2phy {
        phy-supply = <&vcc_phy>;
-       phy-mode = "rgmii";
-       clock_in_out = "input";
-       snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
-       snps,reset-active-low;
-       snps,reset-delays-us = <0 10000 50000>;
-       assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
-       assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&rgmiim1_pins>;
-       tx_delay = <0x26>;
-       rx_delay = <0x11>;
-       status = "okay";
-};
-
-&usb_host0_ehci {
-       status = "okay";
-};
+       clock_in_out = "output";
+       assigned-clocks = <&cru SCLK_MAC2PHY_SRC>;
+       assigned-clock-rate = <50000000>;
+       assigned-clocks = <&cru SCLK_MAC2PHY>;
+       assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>;
 
-&usb_host0_ohci {
-       status = "okay";
-};
-
-&usb20_otg {
-       vbus-supply = <&vcc5v0_otg>;
-       status = "okay";
 };
 
 &i2c1 {
-       clock-frequency = <400000>;
-       i2c-scl-rising-time-ns = <168>;
-       i2c-scl-falling-time-ns = <4>;
        status = "okay";
 
        rk805: pmic@18 {
                compatible = "rockchip,rk805";
-               status = "okay";
                reg = <0x18>;
                interrupt-parent = <&gpio2>;
                interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
+               #clock-cells = <1>;
+               clock-output-names = "xin32k", "rk805-clkout2";
+               gpio-controller;
+               #gpio-cells = <2>;
                pinctrl-names = "default";
                pinctrl-0 = <&pmic_int_l>;
                rockchip,system-power-controller;
                wakeup-source;
-               gpio-controller;
-               #gpio-cells = <2>;
-               #clock-cells = <1>;
-               clock-output-names = "xin32k", "rk805-clkout2";
+
+               vcc1-supply = <&vcc_sys>;
+               vcc2-supply = <&vcc_sys>;
+               vcc3-supply = <&vcc_sys>;
+               vcc4-supply = <&vcc_sys>;
+               vcc5-supply = <&vcc_io>;
+               vcc6-supply = <&vcc_io>;
 
                regulators {
                        vdd_logic: DCDC_REG1 {
                                regulator-name = "vdd_logic";
                                regulator-min-microvolt = <712500>;
                                regulator-max-microvolt = <1450000>;
-                               regulator-ramp-delay = <6001>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                        regulator-suspend-microvolt = <1000000>;
                                regulator-name = "vdd_arm";
                                regulator-min-microvolt = <712500>;
                                regulator-max-microvolt = <1450000>;
-                               regulator-ramp-delay = <6001>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
-                                       regulator-suspend-microvolt = <1000000>;
+                                       regulator-suspend-microvolt = <950000>;
                                };
                        };
 
                        vcc_ddr: DCDC_REG3 {
                                regulator-name = "vcc_ddr";
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                };
                                regulator-name = "vcc_io";
                                regulator-min-microvolt = <3300000>;
                                regulator-max-microvolt = <3300000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                        regulator-suspend-microvolt = <3300000>;
                                };
                        };
 
-                       vdd_18: LDO_REG1 {
-                               regulator-name = "vdd_18";
+                       vcc_18: LDO_REG1 {
+                               regulator-name = "vcc_18";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                        regulator-suspend-microvolt = <1800000>;
                                };
                        };
 
-                       vcc_18emmc: LDO_REG2 {
-                               regulator-name = "vcc_18emmc";
+                       vcc18_emmc: LDO_REG2 {
+                               regulator-name = "vcc18_emmc";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                        regulator-suspend-microvolt = <1800000>;
                                regulator-name = "vdd_10";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                        regulator-suspend-microvolt = <1000000>;
 &pinctrl {
        pmic {
                pmic_int_l: pmic-int-l {
+                       rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       sdio-pwrseq {
+               wifi_enable_h: wifi-enable-h {
                rockchip,pins =
-                       <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;  /* gpio2_a6 */
+                       <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 };
 
+&sdio {
+       bus-width = <4>;
+       cap-sd-highspeed;
+       cap-sdio-irq;
+       keep-power-in-suspend;
+       max-frequency = <150000000>;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
+       status = "okay";
+};
+
+&sdmmc {
+       bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
+       disable-wp;
+       max-frequency = <150000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
+       vmmc-supply = <&vcc_sd>;
+       status = "okay";
+};
+
+&tsadc {
+       status = "okay";
+};
+
+&uart2 {
+       status = "okay";
+};
+
+&u2phy {
+       status = "okay";
+};
+
+&u2phy_host {
+       status = "okay";
+};
+
+&u2phy_otg {
+       status = "okay";
+};
+
+&usb20_otg {
+       status = "okay";
+};
+
+&usb_host0_ehci {
+       status = "okay";
+};
+
+&usb_host0_ohci {
+       status = "okay";
+};
diff --git a/arch/arm/dts/rk3328-roc-cc-u-boot.dtsi b/arch/arm/dts/rk3328-roc-cc-u-boot.dtsi
new file mode 100644 (file)
index 0000000..e929d86
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2018-2019 Rockchip Electronics Co., Ltd
+ */
+
+#include "rk3328-u-boot.dtsi"
+#include "rk3328-sdram-ddr4-666.dtsi"
+/ {
+       chosen {
+               u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc;
+       };
+};
+
+&gpio0 {
+       u-boot,dm-spl;
+};
+
+&pinctrl {
+       u-boot,dm-spl;
+};
+
+&sdmmc0m1_gpio {
+       u-boot,dm-spl;
+};
+
+&pcfg_pull_up_4ma {
+       u-boot,dm-spl;
+};
+
+&usb_host0_xhci {
+       vbus-supply = <&vcc_host1_5v>;
+       status = "okay";
+};
+
+/*
+ * This makes XHCI responsible for toggling VBUS. This is needed to work
+ * around an issue where either XHCI only works with USB 2.0 or OTG doesn't
+ * work, depending on how VBUS is configured. Having USB 3.0 seems better.
+ */
+&vcc_host1_5v {
+       /delete-property/ regulator-always-on;
+};
+
+/* Need this and all the pinctrl/gpio stuff above to set pinmux */
+&vcc_sd {
+       u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/rk3328-roc-cc.dts b/arch/arm/dts/rk3328-roc-cc.dts
new file mode 100644 (file)
index 0000000..8d553c9
--- /dev/null
@@ -0,0 +1,354 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2017 T-Chip Intelligent Technology Co., Ltd
+ */
+
+/dts-v1/;
+#include "rk3328.dtsi"
+
+/ {
+       model = "Firefly roc-rk3328-cc";
+       compatible = "firefly,roc-rk3328-cc", "rockchip,rk3328";
+
+       chosen {
+               stdout-path = "serial2:1500000n8";
+       };
+
+       gmac_clkin: external-gmac-clock {
+               compatible = "fixed-clock";
+               clock-frequency = <125000000>;
+               clock-output-names = "gmac_clkin";
+               #clock-cells = <0>;
+       };
+
+       dc_12v: dc-12v {
+               compatible = "regulator-fixed";
+               regulator-name = "dc_12v";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+       };
+
+       vcc_sd: sdmmc-regulator {
+               compatible = "regulator-fixed";
+               gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&sdmmc0m1_gpio>;
+               regulator-boot-on;
+               regulator-name = "vcc_sd";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_io>;
+       };
+
+       vcc_sdio: sdmmcio-regulator {
+               compatible = "regulator-gpio";
+               gpios = <&grf_gpio 0 GPIO_ACTIVE_HIGH>;
+               states = <1800000 0x1
+                         3300000 0x0>;
+               regulator-name = "vcc_sdio";
+               regulator-type = "voltage";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+               vin-supply = <&vcc_sys>;
+       };
+
+       vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&usb20_host_drv>;
+               regulator-name = "vcc_host1_5v";
+               regulator-always-on;
+               vin-supply = <&vcc_sys>;
+       };
+
+       vcc_sys: vcc-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_sys";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc_12v>;
+       };
+
+       vcc_phy: vcc-phy-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_phy";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               power {
+                       label = "firefly:blue:power";
+                       linux,default-trigger = "heartbeat";
+                       gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
+                       mode = <0x23>;
+               };
+
+               user {
+                       label = "firefly:yellow:user";
+                       linux,default-trigger = "mmc1";
+                       gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+                       mode = <0x05>;
+               };
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&vdd_arm>;
+};
+
+&cpu1 {
+       cpu-supply = <&vdd_arm>;
+};
+
+&cpu2 {
+       cpu-supply = <&vdd_arm>;
+};
+
+&cpu3 {
+       cpu-supply = <&vdd_arm>;
+};
+
+&emmc {
+       bus-width = <8>;
+       cap-mmc-highspeed;
+       max-frequency = <150000000>;
+       mmc-ddr-1_8v;
+       mmc-hs200-1_8v;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
+       vmmc-supply = <&vcc_io>;
+       vqmmc-supply = <&vcc18_emmc>;
+       status = "okay";
+};
+
+&gmac2io {
+       assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
+       assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
+       clock_in_out = "input";
+       phy-supply = <&vcc_phy>;
+       phy-mode = "rgmii";
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmiim1_pins>;
+       snps,aal;
+       snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 10000 50000>;
+       snps,rxpbl = <0x4>;
+       snps,txpbl = <0x4>;
+       tx_delay = <0x24>;
+       rx_delay = <0x18>;
+       status = "okay";
+};
+
+&hdmi {
+       status = "okay";
+};
+
+&hdmiphy {
+       status = "okay";
+};
+
+&i2c1 {
+       status = "okay";
+
+       rk805: pmic@18 {
+               compatible = "rockchip,rk805";
+               reg = <0x18>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
+               #clock-cells = <1>;
+               clock-output-names = "xin32k", "rk805-clkout2";
+               gpio-controller;
+               #gpio-cells = <2>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pmic_int_l>;
+               rockchip,system-power-controller;
+               wakeup-source;
+
+               vcc1-supply = <&vcc_sys>;
+               vcc2-supply = <&vcc_sys>;
+               vcc3-supply = <&vcc_sys>;
+               vcc4-supply = <&vcc_sys>;
+               vcc5-supply = <&vcc_io>;
+               vcc6-supply = <&vcc_io>;
+
+               regulators {
+                       vdd_logic: DCDC_REG1 {
+                               regulator-name = "vdd_logic";
+                               regulator-min-microvolt = <712500>;
+                               regulator-max-microvolt = <1450000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1000000>;
+                               };
+                       };
+
+                       vdd_arm: DCDC_REG2 {
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <712500>;
+                               regulator-max-microvolt = <1450000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <950000>;
+                               };
+                       };
+
+                       vcc_ddr: DCDC_REG3 {
+                               regulator-name = "vcc_ddr";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vcc_io: DCDC_REG4 {
+                               regulator-name = "vcc_io";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3300000>;
+                               };
+                       };
+
+                       vcc_18: LDO_REG1 {
+                               regulator-name = "vcc_18";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vcc18_emmc: LDO_REG2 {
+                               regulator-name = "vcc18_emmc";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vdd_10: LDO_REG3 {
+                               regulator-name = "vdd_10";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1000000>;
+                               };
+                       };
+               };
+       };
+};
+
+&io_domains {
+       status = "okay";
+
+       vccio1-supply = <&vcc_io>;
+       vccio2-supply = <&vcc18_emmc>;
+       vccio3-supply = <&vcc_sdio>;
+       vccio4-supply = <&vcc_18>;
+       vccio5-supply = <&vcc_io>;
+       vccio6-supply = <&vcc_io>;
+       pmuio-supply = <&vcc_io>;
+};
+
+&pinctrl {
+       pmic {
+               pmic_int_l: pmic-int-l {
+                       rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       usb2 {
+               usb20_host_drv: usb20-host-drv {
+                       rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
+
+&sdmmc {
+       bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
+       disable-wp;
+       max-frequency = <150000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
+       sd-uhs-sdr12;
+       sd-uhs-sdr25;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       vmmc-supply = <&vcc_sd>;
+       vqmmc-supply = <&vcc_sdio>;
+       status = "okay";
+};
+
+&tsadc {
+       status = "okay";
+};
+
+&u2phy {
+       status = "okay";
+};
+
+&u2phy_host {
+       status = "okay";
+};
+
+&u2phy_otg {
+       status = "okay";
+};
+
+&uart2 {
+       status = "okay";
+};
+
+&usb20_otg {
+       status = "okay";
+};
+
+&usb_host0_ehci {
+       status = "okay";
+};
+
+&usb_host0_ohci {
+       status = "okay";
+};
+
+&vop {
+       status = "okay";
+};
+
+&vop_mmu {
+       status = "okay";
+};
index e5946d2d2dc7c487077331f21380bdc54127139f..8318bf4e6030182e7d2c2f8ae39f62ee428d745f 100644 (file)
 };
 
 &usb_host0_xhci {
+       vbus-supply = <&vcc_host_5v>;
        status = "okay";
 };
+
+/*
+ * This makes XHCI responsible for toggling VBUS. This is needed to work
+ * around an issue where either XHCI only works with USB 2.0 or OTG doesn't
+ * work, depending on how VBUS is configured. Having USB 3.0 seems better.
+ */
+&vcc_host_5v {
+       /delete-property/ regulator-always-on;
+       /delete-property/ regulator-boot-on;
+};
index a78eb4ac6fff0082f5b1391ff5333a70778d96ba..ebf3eb222e1fc73a8fead2caf5aba55be2486cb7 100644 (file)
                vin-supply = <&vcc_sys>;
        };
 
+       vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
+               compatible = "regulator-fixed";
+               gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&usb20_host_drv>;
+               regulator-name = "vcc_host1_5v";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc_sys>;
+       };
+
        vcc_sys: vcc-sys {
                compatible = "regulator-fixed";
                regulator-name = "vcc_sys";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
        };
+
+       ir-receiver {
+               compatible = "gpio-ir-receiver";
+               gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
+               pinctrl-0 = <&ir_int>;
+               pinctrl-names = "default";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               power {
+                       gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "mmc0";
+               };
+
+               standby {
+                       gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3328";
+               dais = <&i2s1_p0
+                       &spdif_p0>;
+       };
+
+       spdif-dit {
+               compatible = "linux,spdif-dit";
+               #sound-dai-cells = <0>;
+
+               port {
+                       dit_p0_0: endpoint {
+                               remote-endpoint = <&spdif_p0_0>;
+                       };
+               };
+       };
+};
+
+&codec {
+       mute-gpios = <&grf_gpio 0 GPIO_ACTIVE_LOW>;
+       status = "okay";
+
+       port@0 {
+               codec_p0_0: endpoint {
+                       remote-endpoint = <&i2s1_p0_0>;
+               };
+       };
 };
 
 &cpu0 {
        status = "okay";
 };
 
+&hdmi {
+       status = "okay";
+};
+
+&hdmiphy {
+       status = "okay";
+};
+
 &i2c1 {
        status = "okay";
 
-       rk805: rk805@18 {
+       rk805: pmic@18 {
                compatible = "rockchip,rk805";
                reg = <0x18>;
                interrupt-parent = <&gpio2>;
                interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
                #clock-cells = <1>;
                clock-output-names = "xin32k", "rk805-clkout2";
+               gpio-controller;
+               #gpio-cells = <2>;
                pinctrl-names = "default";
                pinctrl-0 = <&pmic_int_l>;
                rockchip,system-power-controller;
                        };
 
                        vcc_18: LDO_REG1 {
-                               regulator-name = "vdd_18";
+                               regulator-name = "vcc_18";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                        };
 
                        vcc18_emmc: LDO_REG2 {
-                               regulator-name = "vcc_18emmc";
+                               regulator-name = "vcc18_emmc";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
        };
 };
 
+&i2s1 {
+       status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&codec_p0_0>;
+               };
+       };
+};
+
 &io_domains {
        status = "okay";
 
 };
 
 &pinctrl {
+       ir {
+               ir_int: ir-int {
+                       rockchip,pins = <2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        pmic {
                pmic_int_l: pmic-int-l {
                        rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
        status = "okay";
 };
 
+&spdif {
+       pinctrl-0 = <&spdifm0_tx>;
+       status = "okay";
+
+       spdif_p0: port {
+               spdif_p0_0: endpoint {
+                       remote-endpoint = <&dit_p0_0>;
+               };
+       };
+};
+
 &spi0 {
        status = "okay";
 
        };
 };
 
+&tsadc {
+       rockchip,hw-tshut-mode = <0>;
+       rockchip,hw-tshut-polarity = <0>;
+       status = "okay";
+};
+
 &uart2 {
        status = "okay";
 };
 
+&u2phy {
+       status = "okay";
+
+       u2phy_host: host-port {
+               status = "okay";
+       };
+
+       u2phy_otg: otg-port {
+               status = "okay";
+       };
+};
+
 &usb20_otg {
        dr_mode = "host";
        status = "okay";
 &usb_host0_ohci {
        status = "okay";
 };
+
+&vop {
+       status = "okay";
+};
+
+&vop_mmu {
+       status = "okay";
+};
index 6d5b3ec06e072e31e9c1afe76fccb6bbbc02bea0..c69e13e11efe7e53ed7f9e4a64b99629ec3bb1c9 100644 (file)
@@ -62,3 +62,7 @@
        /* mmc to sram can't do dma, prevent aborts transfering TF-A parts */
        u-boot,spl-fifo-mode;
 };
+
+&usb20_otg {
+       hnp-srp-disable;
+};
index 060c84e6c0cfc38cd710da04d941c5b2f9d21a73..945387e579f0e4dca9fe7e7a2551bb850b5a40b1 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
  */
 
 #include <dt-bindings/clock/rk3328-cru.h>
@@ -8,6 +8,9 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/power/rk3328-power.h>
+#include <dt-bindings/soc/rockchip,boot-mode.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        compatible = "rockchip,rk3328";
@@ -24,9 +27,8 @@
                i2c1 = &i2c1;
                i2c2 = &i2c2;
                i2c3 = &i2c3;
-               mmc0 = &emmc;
-               mmc1 = &sdmmc;
-               mmc2 = &sdmmc_ext;
+               ethernet0 = &gmac2io;
+               ethernet1 = &gmac2phy;
        };
 
        cpus {
 
                cpu0: cpu@0 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x0>;
+                       clocks = <&cru ARMCLK>;
+                       #cooling-cells = <2>;
+                       cpu-idle-states = <&CPU_SLEEP>;
+                       dynamic-power-coefficient = <120>;
                        enable-method = "psci";
-//                     clocks = <&cru ARMCLK>;
+                       next-level-cache = <&l2>;
                        operating-points-v2 = <&cpu0_opp_table>;
                };
+
                cpu1: cpu@1 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x1>;
+                       clocks = <&cru ARMCLK>;
+                       #cooling-cells = <2>;
+                       cpu-idle-states = <&CPU_SLEEP>;
+                       dynamic-power-coefficient = <120>;
                        enable-method = "psci";
+                       next-level-cache = <&l2>;
+                       operating-points-v2 = <&cpu0_opp_table>;
                };
+
                cpu2: cpu@2 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x2>;
+                       clocks = <&cru ARMCLK>;
+                       #cooling-cells = <2>;
+                       cpu-idle-states = <&CPU_SLEEP>;
+                       dynamic-power-coefficient = <120>;
                        enable-method = "psci";
+                       next-level-cache = <&l2>;
+                       operating-points-v2 = <&cpu0_opp_table>;
                };
+
                cpu3: cpu@3 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x3>;
+                       clocks = <&cru ARMCLK>;
+                       #cooling-cells = <2>;
+                       cpu-idle-states = <&CPU_SLEEP>;
+                       dynamic-power-coefficient = <120>;
                        enable-method = "psci";
+                       next-level-cache = <&l2>;
+                       operating-points-v2 = <&cpu0_opp_table>;
+               };
+
+               idle-states {
+                       entry-method = "psci";
+
+                       CPU_SLEEP: cpu-sleep {
+                               compatible = "arm,idle-state";
+                               local-timer-stop;
+                               arm,psci-suspend-param = <0x0010000>;
+                               entry-latency-us = <120>;
+                               exit-latency-us = <250>;
+                               min-residency-us = <900>;
+                       };
+               };
+
+               l2: l2-cache0 {
+                       compatible = "cache";
                };
        };
 
                compatible = "operating-points-v2";
                opp-shared;
 
-               opp@408000000 {
+               opp-408000000 {
                        opp-hz = /bits/ 64 <408000000>;
                        opp-microvolt = <950000>;
                        clock-latency-ns = <40000>;
                        opp-suspend;
                };
-               opp@600000000 {
+               opp-600000000 {
                        opp-hz = /bits/ 64 <600000000>;
                        opp-microvolt = <950000>;
                        clock-latency-ns = <40000>;
                };
-               opp@816000000 {
+               opp-816000000 {
                        opp-hz = /bits/ 64 <816000000>;
                        opp-microvolt = <1000000>;
                        clock-latency-ns = <40000>;
                };
-               opp@1008000000 {
+               opp-1008000000 {
                        opp-hz = /bits/ 64 <1008000000>;
                        opp-microvolt = <1100000>;
                        clock-latency-ns = <40000>;
                };
-               opp@1200000000 {
+               opp-1200000000 {
                        opp-hz = /bits/ 64 <1200000000>;
                        opp-microvolt = <1225000>;
                        clock-latency-ns = <40000>;
                };
-               opp@1296000000 {
+               opp-1296000000 {
                        opp-hz = /bits/ 64 <1296000000>;
                        opp-microvolt = <1300000>;
                        clock-latency-ns = <40000>;
                };
        };
 
+       amba: bus {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               dmac: dmac@ff1f0000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0x0 0xff1f0000 0x0 0x4000>;
+                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cru ACLK_DMAC>;
+                       clock-names = "apb_pclk";
+                       #dma-cells = <1>;
+               };
+       };
+
+       analog_sound: analog-sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,mclk-fs = <256>;
+               simple-audio-card,name = "Analog";
+               status = "disabled";
+
+               simple-audio-card,cpu {
+                       sound-dai = <&i2s1>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&codec>;
+               };
+       };
+
        arm-pmu {
                compatible = "arm,cortex-a53-pmu";
                interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
                interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
        };
 
+       display_subsystem: display-subsystem {
+               compatible = "rockchip,display-subsystem";
+               ports = <&vop_out>;
+       };
+
+       hdmi_sound: hdmi-sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,mclk-fs = <128>;
+               simple-audio-card,name = "HDMI";
+               status = "disabled";
+
+               simple-audio-card,cpu {
+                       sound-dai = <&i2s0>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&hdmi>;
+               };
+       };
+
        psci {
-               compatible = "arm,psci-1.0";
+               compatible = "arm,psci-1.0", "arm,psci-0.2";
                method = "smc";
        };
 
                clocks = <&cru SCLK_I2S0>, <&cru HCLK_I2S0_8CH>;
                clock-names = "i2s_clk", "i2s_hclk";
                dmas = <&dmac 11>, <&dmac 12>;
-               #dma-cells = <2>;
                dma-names = "tx", "rx";
+               #sound-dai-cells = <0>;
                status = "disabled";
        };
 
                clocks = <&cru SCLK_I2S1>, <&cru HCLK_I2S1_8CH>;
                clock-names = "i2s_clk", "i2s_hclk";
                dmas = <&dmac 14>, <&dmac 15>;
-               #dma-cells = <2>;
                dma-names = "tx", "rx";
+               #sound-dai-cells = <0>;
                status = "disabled";
        };
 
                clocks = <&cru SCLK_I2S2>, <&cru HCLK_I2S2_2CH>;
                clock-names = "i2s_clk", "i2s_hclk";
                dmas = <&dmac 0>, <&dmac 1>;
-               #dma-cells = <2>;
                dma-names = "tx", "rx";
-               pinctrl-names = "default", "sleep";
-               pinctrl-0 = <&i2s2m0_mclk
-                            &i2s2m0_sclk
-                            &i2s2m0_lrcktx
-                            &i2s2m0_lrckrx
-                            &i2s2m0_sdo
-                            &i2s2m0_sdi>;
-               pinctrl-1 = <&i2s2m0_sleep>;
+               #sound-dai-cells = <0>;
                status = "disabled";
        };
 
                clocks = <&cru SCLK_SPDIF>, <&cru HCLK_SPDIF_8CH>;
                clock-names = "mclk", "hclk";
                dmas = <&dmac 10>;
-               #dma-cells = <1>;
                dma-names = "tx";
                pinctrl-names = "default";
                pinctrl-0 = <&spdifm2_tx>;
+               #sound-dai-cells = <0>;
+               status = "disabled";
+       };
+
+       pdm: pdm@ff040000 {
+               compatible = "rockchip,pdm";
+               reg = <0x0 0xff040000 0x0 0x1000>;
+               clocks = <&cru SCLK_PDM>, <&cru HCLK_PDM>;
+               clock-names = "pdm_clk", "pdm_hclk";
+               dmas = <&dmac 16>;
+               dma-names = "rx";
+               pinctrl-names = "default", "sleep";
+               pinctrl-0 = <&pdmm0_clk
+                            &pdmm0_sdi0
+                            &pdmm0_sdi1
+                            &pdmm0_sdi2
+                            &pdmm0_sdi3>;
+               pinctrl-1 = <&pdmm0_clk_sleep
+                            &pdmm0_sdi0_sleep
+                            &pdmm0_sdi1_sleep
+                            &pdmm0_sdi2_sleep
+                            &pdmm0_sdi3_sleep>;
                status = "disabled";
        };
 
                        compatible = "rockchip,rk3328-io-voltage-domain";
                        status = "disabled";
                };
+
+               grf_gpio: grf-gpio {
+                       compatible = "rockchip,rk3328-grf-gpio";
+                       gpio-controller;
+                       #gpio-cells = <2>;
+               };
+
+               power: power-controller {
+                       compatible = "rockchip,rk3328-power-controller";
+                       #power-domain-cells = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       pd_hevc@RK3328_PD_HEVC {
+                               reg = <RK3328_PD_HEVC>;
+                       };
+                       pd_video@RK3328_PD_VIDEO {
+                               reg = <RK3328_PD_VIDEO>;
+                       };
+                       pd_vpu@RK3328_PD_VPU {
+                               reg = <RK3328_PD_VPU>;
+                               clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
+                       };
+               };
+
+               reboot-mode {
+                       compatible = "syscon-reboot-mode";
+                       offset = <0x5c8>;
+                       mode-normal = <BOOT_NORMAL>;
+                       mode-recovery = <BOOT_RECOVERY>;
+                       mode-bootloader = <BOOT_FASTBOOT>;
+                       mode-loader = <BOOT_BL_DOWNLOAD>;
+               };
        };
 
        uart0: serial@ff110000 {
                interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>;
                clock-names = "baudclk", "apb_pclk";
-               reg-shift = <2>;
-               reg-io-width = <4>;
                dmas = <&dmac 2>, <&dmac 3>;
-               #dma-cells = <2>;
+               dma-names = "tx", "rx";
                pinctrl-names = "default";
                pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
+               reg-io-width = <4>;
+               reg-shift = <2>;
                status = "disabled";
        };
 
                reg = <0x0 0xff120000 0x0 0x100>;
                interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>;
-               clock-names = "sclk_uart", "pclk_uart";
-               reg-shift = <2>;
-               reg-io-width = <4>;
+               clock-names = "baudclk", "apb_pclk";
                dmas = <&dmac 4>, <&dmac 5>;
-               #dma-cells = <2>;
+               dma-names = "tx", "rx";
                pinctrl-names = "default";
                pinctrl-0 = <&uart1_xfer &uart1_cts &uart1_rts>;
+               reg-io-width = <4>;
+               reg-shift = <2>;
                status = "disabled";
        };
 
                interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>;
                clock-names = "baudclk", "apb_pclk";
-               reg-shift = <2>;
-               reg-io-width = <4>;
                dmas = <&dmac 6>, <&dmac 7>;
-               #dma-cells = <2>;
+               dma-names = "tx", "rx";
                pinctrl-names = "default";
                pinctrl-0 = <&uart2m1_xfer>;
+               reg-io-width = <4>;
+               reg-shift = <2>;
                status = "disabled";
        };
 
-       pmu: power-management@ff140000 {
-               compatible = "rockchip,rk3328-pmu", "syscon", "simple-mfd";
-               reg = <0x0 0xff140000 0x0 0x1000>;
-       };
-
        i2c0: i2c@ff150000 {
-               compatible = "rockchip,rk3328-i2c";
+               compatible = "rockchip,rk3328-i2c", "rockchip,rk3399-i2c";
                reg = <0x0 0xff150000 0x0 0x1000>;
                interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
        };
 
        i2c1: i2c@ff160000 {
-               compatible = "rockchip,rk3328-i2c";
+               compatible = "rockchip,rk3328-i2c", "rockchip,rk3399-i2c";
                reg = <0x0 0xff160000 0x0 0x1000>;
                interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
        };
 
        i2c2: i2c@ff170000 {
-               compatible = "rockchip,rk3328-i2c";
+               compatible = "rockchip,rk3328-i2c", "rockchip,rk3399-i2c";
                reg = <0x0 0xff170000 0x0 0x1000>;
                interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
        };
 
        i2c3: i2c@ff180000 {
-               compatible = "rockchip,rk3328-i2c";
+               compatible = "rockchip,rk3328-i2c", "rockchip,rk3399-i2c";
                reg = <0x0 0xff180000 0x0 0x1000>;
                interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
                clocks = <&cru SCLK_SPI>, <&cru PCLK_SPI>;
                clock-names = "spiclk", "apb_pclk";
                dmas = <&dmac 8>, <&dmac 9>;
-               #dma-cells = <2>;
                dma-names = "tx", "rx";
                pinctrl-names = "default";
                pinctrl-0 = <&spi0m2_clk &spi0m2_tx &spi0m2_rx &spi0m2_cs0>;
                compatible = "snps,dw-wdt";
                reg = <0x0 0xff1a0000 0x0 0x100>;
                interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru PCLK_WDT>;
+       };
+
+       pwm0: pwm@ff1b0000 {
+               compatible = "rockchip,rk3328-pwm";
+               reg = <0x0 0xff1b0000 0x0 0x10>;
+               clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>;
+               clock-names = "pwm", "pclk";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pwm0_pin>;
+               #pwm-cells = <3>;
                status = "disabled";
        };
 
-       amba {
-               compatible = "simple-bus";
-               #address-cells = <2>;
-               #size-cells = <2>;
-               ranges;
+       pwm1: pwm@ff1b0010 {
+               compatible = "rockchip,rk3328-pwm";
+               reg = <0x0 0xff1b0010 0x0 0x10>;
+               clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>;
+               clock-names = "pwm", "pclk";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pwm1_pin>;
+               #pwm-cells = <3>;
+               status = "disabled";
+       };
 
-               dmac: dmac@ff1f0000 {
-                       compatible = "arm,pl330", "arm,primecell";
-                       reg = <0x0 0xff1f0000 0x0 0x4000>;
-                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
-                                    <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cru ACLK_DMAC>;
-                       clock-names = "apb_pclk";
-                       #dma-cells = <1>;
+       pwm2: pwm@ff1b0020 {
+               compatible = "rockchip,rk3328-pwm";
+               reg = <0x0 0xff1b0020 0x0 0x10>;
+               clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>;
+               clock-names = "pwm", "pclk";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pwm2_pin>;
+               #pwm-cells = <3>;
+               status = "disabled";
+       };
+
+       pwm3: pwm@ff1b0030 {
+               compatible = "rockchip,rk3328-pwm";
+               reg = <0x0 0xff1b0030 0x0 0x10>;
+               interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>;
+               clock-names = "pwm", "pclk";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pwmir_pin>;
+               #pwm-cells = <3>;
+               status = "disabled";
+       };
+
+       thermal-zones {
+               soc_thermal: soc-thermal {
+                       polling-delay-passive = <20>;
+                       polling-delay = <1000>;
+                       sustainable-power = <1000>;
+
+                       thermal-sensors = <&tsadc 0>;
+
+                       trips {
+                               threshold: trip-point0 {
+                                       temperature = <70000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               target: trip-point1 {
+                                       temperature = <85000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               soc_crit: soc-crit {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&target>;
+                                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                                       contribution = <4096>;
+                               };
+                       };
+               };
+
+       };
+
+       tsadc: tsadc@ff250000 {
+               compatible = "rockchip,rk3328-tsadc";
+               reg = <0x0 0xff250000 0x0 0x100>;
+               interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+               assigned-clocks = <&cru SCLK_TSADC>;
+               assigned-clock-rates = <50000>;
+               clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
+               clock-names = "tsadc", "apb_pclk";
+               pinctrl-names = "init", "default", "sleep";
+               pinctrl-0 = <&otp_gpio>;
+               pinctrl-1 = <&otp_out>;
+               pinctrl-2 = <&otp_gpio>;
+               resets = <&cru SRST_TSADC>;
+               reset-names = "tsadc-apb";
+               rockchip,grf = <&grf>;
+               rockchip,hw-tshut-temp = <100000>;
+               #thermal-sensor-cells = <1>;
+               status = "disabled";
+       };
+
+       efuse: efuse@ff260000 {
+               compatible = "rockchip,rk3328-efuse";
+               reg = <0x0 0xff260000 0x0 0x50>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               clocks = <&cru SCLK_EFUSE>;
+               clock-names = "pclk_efuse";
+               rockchip,efuse-size = <0x20>;
+
+               /* Data cells */
+               efuse_id: id@7 {
+                       reg = <0x07 0x10>;
+               };
+               cpu_leakage: cpu-leakage@17 {
+                       reg = <0x17 0x1>;
+               };
+               logic_leakage: logic-leakage@19 {
+                       reg = <0x19 0x1>;
+               };
+               efuse_cpu_version: cpu-version@1a {
+                       reg = <0x1a 0x1>;
+                       bits = <3 3>;
                };
        };
 
-       saradc: saradc@ff280000 {
-               compatible = "rockchip,rk3328-saradc", "rockchip,saradc";
+       saradc: adc@ff280000 {
+               compatible = "rockchip,rk3328-saradc", "rockchip,rk3399-saradc";
                reg = <0x0 0xff280000 0x0 0x100>;
                interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
                #io-channel-cells = <1>;
                status = "disabled";
        };
 
+       gpu: gpu@ff300000 {
+               compatible = "rockchip,rk3328-mali", "arm,mali-450";
+               reg = <0x0 0xff300000 0x0 0x40000>;
+               interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "gp",
+                                 "gpmmu",
+                                 "pp",
+                                 "pp0",
+                                 "ppmmu0",
+                                 "pp1",
+                                 "ppmmu1";
+               clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>;
+               clock-names = "bus", "core";
+               resets = <&cru SRST_GPU_A>;
+       };
+
+       h265e_mmu: iommu@ff330200 {
+               compatible = "rockchip,iommu";
+               reg = <0x0 0xff330200 0 0x100>;
+               interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "h265e_mmu";
+               clocks = <&cru ACLK_H265>, <&cru PCLK_H265>;
+               clock-names = "aclk", "iface";
+               #iommu-cells = <0>;
+               status = "disabled";
+       };
+
+       vepu_mmu: iommu@ff340800 {
+               compatible = "rockchip,iommu";
+               reg = <0x0 0xff340800 0x0 0x40>;
+               interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "vepu_mmu";
+               clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
+               clock-names = "aclk", "iface";
+               #iommu-cells = <0>;
+               status = "disabled";
+       };
+
+       vpu: video-codec@ff350000 {
+               compatible = "rockchip,rk3328-vpu";
+               reg = <0x0 0xff350000 0x0 0x800>;
+               interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "vdpu";
+               clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
+               clock-names = "aclk", "hclk";
+               iommus = <&vpu_mmu>;
+               power-domains = <&power RK3328_PD_VPU>;
+       };
+
+       vpu_mmu: iommu@ff350800 {
+               compatible = "rockchip,iommu";
+               reg = <0x0 0xff350800 0x0 0x40>;
+               interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "vpu_mmu";
+               clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
+               clock-names = "aclk", "iface";
+               #iommu-cells = <0>;
+               power-domains = <&power RK3328_PD_VPU>;
+       };
+
+       rkvdec_mmu: iommu@ff360480 {
+               compatible = "rockchip,iommu";
+               reg = <0x0 0xff360480 0x0 0x40>, <0x0 0xff3604c0 0x0 0x40>;
+               interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "rkvdec_mmu";
+               clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>;
+               clock-names = "aclk", "iface";
+               #iommu-cells = <0>;
+               status = "disabled";
+       };
+
+       vop: vop@ff370000 {
+               compatible = "rockchip,rk3328-vop";
+               reg = <0x0 0xff370000 0x0 0x3efc>;
+               interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru ACLK_VOP>, <&cru DCLK_LCDC>, <&cru HCLK_VOP>;
+               clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
+               resets = <&cru SRST_VOP_A>, <&cru SRST_VOP_H>, <&cru SRST_VOP_D>;
+               reset-names = "axi", "ahb", "dclk";
+               iommus = <&vop_mmu>;
+               status = "disabled";
+
+               vop_out: port {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       vop_out_hdmi: endpoint@0 {
+                               reg = <0>;
+                               remote-endpoint = <&hdmi_in_vop>;
+                       };
+               };
+       };
+
+       vop_mmu: iommu@ff373f00 {
+               compatible = "rockchip,iommu";
+               reg = <0x0 0xff373f00 0x0 0x100>;
+               interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "vop_mmu";
+               clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>;
+               clock-names = "aclk", "iface";
+               #iommu-cells = <0>;
+               status = "disabled";
+       };
+
+       hdmi: hdmi@ff3c0000 {
+               compatible = "rockchip,rk3328-dw-hdmi";
+               reg = <0x0 0xff3c0000 0x0 0x20000>;
+               reg-io-width = <4>;
+               interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru PCLK_HDMI>,
+                        <&cru SCLK_HDMI_SFC>,
+                        <&cru SCLK_RTC32K>;
+               clock-names = "iahb",
+                             "isfr",
+                             "cec";
+               phys = <&hdmiphy>;
+               phy-names = "hdmi";
+               pinctrl-names = "default";
+               pinctrl-0 = <&hdmi_cec &hdmii2c_xfer &hdmi_hpd>;
+               rockchip,grf = <&grf>;
+               #sound-dai-cells = <0>;
+               status = "disabled";
+
+               ports {
+                       hdmi_in: port {
+                               hdmi_in_vop: endpoint {
+                                       remote-endpoint = <&vop_out_hdmi>;
+                               };
+                       };
+               };
+       };
+
+       codec: codec@ff410000 {
+               compatible = "rockchip,rk3328-codec";
+               reg = <0x0 0xff410000 0x0 0x1000>;
+               clocks = <&cru PCLK_ACODECPHY>, <&cru SCLK_I2S1>;
+               clock-names = "pclk", "mclk";
+               rockchip,grf = <&grf>;
+               #sound-dai-cells = <0>;
+               status = "disabled";
+       };
+
+       hdmiphy: phy@ff430000 {
+               compatible = "rockchip,rk3328-hdmi-phy";
+               reg = <0x0 0xff430000 0x0 0x10000>;
+               interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru PCLK_HDMIPHY>, <&xin24m>, <&cru DCLK_HDMIPHY>;
+               clock-names = "sysclk", "refoclk", "refpclk";
+               clock-output-names = "hdmi_phy";
+               #clock-cells = <0>;
+               nvmem-cells = <&efuse_cpu_version>;
+               nvmem-cell-names = "cpu-version";
+               #phy-cells = <0>;
+               status = "disabled";
+       };
+
        cru: clock-controller@ff440000 {
                compatible = "rockchip,rk3328-cru", "rockchip,cru", "syscon";
                reg = <0x0 0xff440000 0x0 0x1000>;
                #clock-cells = <1>;
                #reset-cells = <1>;
                assigned-clocks =
+                       /*
+                        * CPLL should run at 1200, but that is to high for
+                        * the initial dividers of most of its children.
+                        * We need set cpll child clk div first,
+                        * and then set the cpll frequency.
+                        */
                        <&cru DCLK_LCDC>, <&cru SCLK_PDM>,
                        <&cru SCLK_RTC32K>, <&cru SCLK_UART0>,
                        <&cru SCLK_UART1>, <&cru SCLK_UART2>,
                        <&cru ACLK_BUS_PRE>, <&cru HCLK_BUS_PRE>,
                        <&cru PCLK_BUS_PRE>, <&cru ACLK_PERI_PRE>,
                        <&cru HCLK_PERI>, <&cru PCLK_PERI>,
-                       <&cru ACLK_VIO_PRE>, <&cru HCLK_VIO_PRE>,
-                       <&cru ACLK_RGA_PRE>, <&cru SCLK_RGA>,
-                       <&cru ACLK_VOP_PRE>, <&cru ACLK_RKVDEC_PRE>,
-                       <&cru ACLK_RKVENC>, <&cru ACLK_VPU_PRE>,
-                       <&cru SCLK_VDEC_CABAC>, <&cru SCLK_VDEC_CORE>,
-                       <&cru SCLK_VENC_CORE>, <&cru SCLK_VENC_DSP>,
-                       <&cru SCLK_EFUSE>, <&cru PCLK_DDR>,
-                       <&cru ACLK_GMAC>, <&cru PCLK_GMAC>,
-                       <&cru SCLK_RTC32K>, <&cru SCLK_USB3OTG_SUSPEND>;
+                       <&cru SCLK_RTC32K>;
                assigned-clock-parents =
                        <&cru HDMIPHY>, <&cru PLL_APLL>,
                        <&cru PLL_GPLL>, <&xin24m>,
                        <150000000>, <75000000>,
                        <75000000>, <150000000>,
                        <75000000>, <75000000>,
-                       <300000000>, <100000000>,
-                       <300000000>, <200000000>,
-                       <400000000>, <500000000>,
-                       <200000000>, <300000000>,
-                       <300000000>, <250000000>,
-                       <200000000>, <100000000>,
-                       <24000000>, <100000000>,
-                       <150000000>, <50000000>,
-                       <32768>, <32768>;
+                       <32768>;
        };
 
-       sdmmc: rksdmmc@ff500000 {
+       usb2phy_grf: syscon@ff450000 {
+               compatible = "rockchip,rk3328-usb2phy-grf", "syscon",
+                            "simple-mfd";
+               reg = <0x0 0xff450000 0x0 0x10000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               u2phy: usb2-phy@100 {
+                       compatible = "rockchip,rk3328-usb2phy";
+                       reg = <0x100 0x10>;
+                       clocks = <&xin24m>;
+                       clock-names = "phyclk";
+                       clock-output-names = "usb480m_phy";
+                       #clock-cells = <0>;
+                       assigned-clocks = <&cru USB480M>;
+                       assigned-clock-parents = <&u2phy>;
+                       status = "disabled";
+
+                       u2phy_otg: otg-port {
+                               #phy-cells = <0>;
+                               interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "otg-bvalid", "otg-id",
+                                                 "linestate";
+                               status = "disabled";
+                       };
+
+                       u2phy_host: host-port {
+                               #phy-cells = <0>;
+                               interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "linestate";
+                               status = "disabled";
+                       };
+               };
+       };
+
+       sdmmc: mmc@ff500000 {
                compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
                reg = <0x0 0xff500000 0x0 0x4000>;
-               max-frequency = <150000000>;
-               clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>;
-               clock-names = "biu", "ciu";
-               fifo-depth = <0x100>;
                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
+                        <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
+               clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+               fifo-depth = <0x100>;
+               max-frequency = <150000000>;
                status = "disabled";
        };
 
-       sdio: dwmmc@ff510000 {
+       sdio: mmc@ff510000 {
                compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
                reg = <0x0 0xff510000 0x0 0x4000>;
-               max-frequency = <150000000>;
+               interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>,
                         <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>;
-               clock-names = "biu", "ciu", "ciu_drv", "ciu_sample";
+               clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
                fifo-depth = <0x100>;
-               interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+               max-frequency = <150000000>;
                status = "disabled";
        };
 
-       emmc: rksdmmc@ff520000 {
+       emmc: mmc@ff520000 {
                compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
                reg = <0x0 0xff520000 0x0 0x4000>;
-               max-frequency = <150000000>;
-               clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>;
-               clock-names = "biu", "ciu";
-               fifo-depth = <0x100>;
                interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
+                        <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
+               clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+               fifo-depth = <0x100>;
+               max-frequency = <150000000>;
                status = "disabled";
        };
 
        gmac2io: ethernet@ff540000 {
                compatible = "rockchip,rk3328-gmac";
                reg = <0x0 0xff540000 0x0 0x10000>;
-               rockchip,grf = <&grf>;
                interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
                interrupt-names = "macirq";
                clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_RX>,
                              "pclk_mac";
                resets = <&cru SRST_GMAC2IO_A>;
                reset-names = "stmmaceth";
+               rockchip,grf = <&grf>;
+               snps,txpbl = <0x4>;
                status = "disabled";
        };
 
+       gmac2phy: ethernet@ff550000 {
+               compatible = "rockchip,rk3328-gmac";
+               reg = <0x0 0xff550000 0x0 0x10000>;
+               rockchip,grf = <&grf>;
+               interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "macirq";
+               clocks = <&cru SCLK_MAC2PHY_SRC>, <&cru SCLK_MAC2PHY_RXTX>,
+                        <&cru SCLK_MAC2PHY_RXTX>, <&cru SCLK_MAC2PHY_REF>,
+                        <&cru ACLK_MAC2PHY>, <&cru PCLK_MAC2PHY>,
+                        <&cru SCLK_MAC2PHY_OUT>;
+               clock-names = "stmmaceth", "mac_clk_rx",
+                             "mac_clk_tx", "clk_mac_ref",
+                             "aclk_mac", "pclk_mac",
+                             "clk_macphy";
+               resets = <&cru SRST_GMAC2PHY_A>, <&cru SRST_MACPHY>;
+               reset-names = "stmmaceth", "mac-phy";
+               phy-mode = "rmii";
+               phy-handle = <&phy>;
+               snps,txpbl = <0x4>;
+               status = "disabled";
+
+               mdio {
+                       compatible = "snps,dwmac-mdio";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy: phy@0 {
+                               compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22";
+                               reg = <0>;
+                               clocks = <&cru SCLK_MAC2PHY_OUT>;
+                               resets = <&cru SRST_MACPHY>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&fephyled_rxm1 &fephyled_linkm1>;
+                               phy-is-integrated;
+                       };
+               };
+       };
+
        usb_host0_ehci: usb@ff5c0000 {
                compatible = "generic-ehci";
                reg = <0x0 0xff5c0000 0x0 0x10000>;
                interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru HCLK_HOST0>, <&u2phy>;
+               phys = <&u2phy_host>;
+               phy-names = "usb";
                status = "disabled";
        };
 
                compatible = "generic-ohci";
                reg = <0x0 0xff5d0000 0x0 0x10000>;
                interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru HCLK_HOST0>, <&u2phy>;
+               phys = <&u2phy_host>;
+               phy-names = "usb";
                status = "disabled";
        };
 
+       /*
+        * U-boot Specific Change
+        *
+        * The OTG controller must come after the USB host pair for it
+        * to work. This is likely due to lack of support for the USB
+        * PHYs. This must be manually changed after each device tree
+        * sync. There is no clean way to handle this in -u-boot.dtsi
+        * files.
+        */
        usb20_otg: usb@ff580000 {
                compatible = "rockchip,rk3328-usb", "rockchip,rk3066-usb",
                             "snps,dwc2";
                reg = <0x0 0xff580000 0x0 0x40000>;
                interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
-               hnp-srp-disable;
+               clocks = <&cru HCLK_OTG>;
+               clock-names = "otg";
                dr_mode = "otg";
+               g-np-tx-fifo-size = <16>;
+               g-rx-fifo-size = <280>;
+               g-tx-fifo-size = <256 128 128 64 32 16>;
+               phys = <&u2phy_otg>;
+               phy-names = "usb2-phy";
                status = "disabled";
        };
 
-       sdmmc_ext: rksdmmc@ff5f0000 {
-               compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
-               reg = <0x0 0xff5f0000 0x0 0x4000>;
-               max-frequency = <150000000>;
-               clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>;
-               clock-names = "biu", "ciu";
-               fifo-depth = <0x100>;
-               interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
-               status = "disabled";
-       };
-
-       gic: interrupt-controller@ffb70000 {
+       gic: interrupt-controller@ff811000 {
                compatible = "arm,gic-400";
                #interrupt-cells = <3>;
                #address-cells = <0>;
 
                i2c0 {
                        i2c0_xfer: i2c0-xfer {
-                               rockchip,pins =
-                                       <2 24 RK_FUNC_1 &pcfg_pull_none>,
-                                       <2 25 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PD0 1 &pcfg_pull_none>,
+                                               <2 RK_PD1 1 &pcfg_pull_none>;
                        };
                };
 
                i2c1 {
                        i2c1_xfer: i2c1-xfer {
-                               rockchip,pins =
-                                       <2 4 RK_FUNC_2 &pcfg_pull_none>,
-                                       <2 5 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA4 2 &pcfg_pull_none>,
+                                               <2 RK_PA5 2 &pcfg_pull_none>;
                        };
                };
 
                i2c2 {
                        i2c2_xfer: i2c2-xfer {
-                               rockchip,pins =
-                                       <2 13 RK_FUNC_1 &pcfg_pull_none>,
-                                       <2 14 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PB5 1 &pcfg_pull_none>,
+                                               <2 RK_PB6 1 &pcfg_pull_none>;
                        };
                };
 
                i2c3 {
                        i2c3_xfer: i2c3-xfer {
-                               rockchip,pins =
-                                       <0 5 RK_FUNC_2 &pcfg_pull_none>,
-                                       <0 6 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA5 2 &pcfg_pull_none>,
+                                               <0 RK_PA6 2 &pcfg_pull_none>;
                        };
                        i2c3_gpio: i2c3-gpio {
                                rockchip,pins =
-                                       <0 5 RK_FUNC_GPIO &pcfg_pull_none>,
-                                       <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
+                                       <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>,
+                                       <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
                        };
                };
 
                hdmi_i2c {
                        hdmii2c_xfer: hdmii2c-xfer {
+                               rockchip,pins = <0 RK_PA5 1 &pcfg_pull_none>,
+                                               <0 RK_PA6 1 &pcfg_pull_none>;
+                       };
+               };
+
+               pdm-0 {
+                       pdmm0_clk: pdmm0-clk {
+                               rockchip,pins = <2 RK_PC2 2 &pcfg_pull_none>;
+                       };
+
+                       pdmm0_fsync: pdmm0-fsync {
+                               rockchip,pins = <2 RK_PC7 2 &pcfg_pull_none>;
+                       };
+
+                       pdmm0_sdi0: pdmm0-sdi0 {
+                               rockchip,pins = <2 RK_PC3 2 &pcfg_pull_none>;
+                       };
+
+                       pdmm0_sdi1: pdmm0-sdi1 {
+                               rockchip,pins = <2 RK_PC4 2 &pcfg_pull_none>;
+                       };
+
+                       pdmm0_sdi2: pdmm0-sdi2 {
+                               rockchip,pins = <2 RK_PC5 2 &pcfg_pull_none>;
+                       };
+
+                       pdmm0_sdi3: pdmm0-sdi3 {
+                               rockchip,pins = <2 RK_PC6 2 &pcfg_pull_none>;
+                       };
+
+                       pdmm0_clk_sleep: pdmm0-clk-sleep {
+                               rockchip,pins =
+                                       <2 RK_PC2 RK_FUNC_GPIO &pcfg_input_high>;
+                       };
+
+                       pdmm0_sdi0_sleep: pdmm0-sdi0-sleep {
+                               rockchip,pins =
+                                       <2 RK_PC3 RK_FUNC_GPIO &pcfg_input_high>;
+                       };
+
+                       pdmm0_sdi1_sleep: pdmm0-sdi1-sleep {
+                               rockchip,pins =
+                                       <2 RK_PC4 RK_FUNC_GPIO &pcfg_input_high>;
+                       };
+
+                       pdmm0_sdi2_sleep: pdmm0-sdi2-sleep {
+                               rockchip,pins =
+                                       <2 RK_PC5 RK_FUNC_GPIO &pcfg_input_high>;
+                       };
+
+                       pdmm0_sdi3_sleep: pdmm0-sdi3-sleep {
+                               rockchip,pins =
+                                       <2 RK_PC6 RK_FUNC_GPIO &pcfg_input_high>;
+                       };
+
+                       pdmm0_fsync_sleep: pdmm0-fsync-sleep {
                                rockchip,pins =
-                                       <0 5 RK_FUNC_1 &pcfg_pull_none>,
-                                       <0 6 RK_FUNC_1 &pcfg_pull_none>;
+                                       <2 RK_PC7 RK_FUNC_GPIO &pcfg_input_high>;
+                       };
+               };
+
+               tsadc {
+                       otp_gpio: otp-gpio {
+                               rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
+                       };
+
+                       otp_out: otp-out {
+                               rockchip,pins = <2 RK_PB5 1 &pcfg_pull_none>;
                        };
                };
 
                uart0 {
                        uart0_xfer: uart0-xfer {
-                               rockchip,pins =
-                                       <1 9 RK_FUNC_1 &pcfg_pull_up>,
-                                       <1 8 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PB1 1 &pcfg_pull_up>,
+                                               <1 RK_PB0 1 &pcfg_pull_none>;
                        };
 
                        uart0_cts: uart0-cts {
-                               rockchip,pins =
-                                       <1 11 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PB3 1 &pcfg_pull_none>;
                        };
 
                        uart0_rts: uart0-rts {
-                               rockchip,pins =
-                                       <1 10 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PB2 1 &pcfg_pull_none>;
                        };
 
                        uart0_rts_gpio: uart0-rts-gpio {
-                               rockchip,pins =
-                                       <1 10 RK_FUNC_GPIO &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
                        };
                };
 
                uart1 {
                        uart1_xfer: uart1-xfer {
-                               rockchip,pins =
-                                       <3 4 RK_FUNC_4 &pcfg_pull_up>,
-                                       <3 6 RK_FUNC_4 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PA4 4 &pcfg_pull_up>,
+                                               <3 RK_PA6 4 &pcfg_pull_none>;
                        };
 
                        uart1_cts: uart1-cts {
-                               rockchip,pins =
-                                       <3 7 RK_FUNC_4 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PA7 4 &pcfg_pull_none>;
                        };
 
                        uart1_rts: uart1-rts {
-                               rockchip,pins =
-                                       <3 5 RK_FUNC_4 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PA5 4 &pcfg_pull_none>;
                        };
 
                        uart1_rts_gpio: uart1-rts-gpio {
-                               rockchip,pins =
-                                       <3 5 RK_FUNC_GPIO &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
                        };
                };
 
                uart2-0 {
                        uart2m0_xfer: uart2m0-xfer {
-                               rockchip,pins =
-                                       <1 0 RK_FUNC_2 &pcfg_pull_up>,
-                                       <1 1 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PA0 2 &pcfg_pull_up>,
+                                               <1 RK_PA1 2 &pcfg_pull_none>;
                        };
                };
 
                uart2-1 {
                        uart2m1_xfer: uart2m1-xfer {
-                               rockchip,pins =
-                                       <2 0 RK_FUNC_1 &pcfg_pull_up>,
-                                       <2 1 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA0 1 &pcfg_pull_up>,
+                                               <2 RK_PA1 1 &pcfg_pull_none>;
                        };
                };
 
                spi0-0 {
                        spi0m0_clk: spi0m0-clk {
-                               rockchip,pins =
-                                       <2 8 RK_FUNC_1 &pcfg_pull_up>;
+                               rockchip,pins = <2 RK_PB0 1 &pcfg_pull_up>;
                        };
 
                        spi0m0_cs0: spi0m0-cs0 {
-                               rockchip,pins =
-                                       <2 11 RK_FUNC_1 &pcfg_pull_up>;
+                               rockchip,pins = <2 RK_PB3 1 &pcfg_pull_up>;
                        };
 
                        spi0m0_tx: spi0m0-tx {
-                               rockchip,pins =
-                                       <2 9 RK_FUNC_1 &pcfg_pull_up>;
+                               rockchip,pins = <2 RK_PB1 1 &pcfg_pull_up>;
                        };
 
                        spi0m0_rx: spi0m0-rx {
-                               rockchip,pins =
-                                       <2 10 RK_FUNC_1 &pcfg_pull_up>;
+                               rockchip,pins = <2 RK_PB2 1 &pcfg_pull_up>;
                        };
 
                        spi0m0_cs1: spi0m0-cs1 {
-                               rockchip,pins =
-                                       <2 12 RK_FUNC_1 &pcfg_pull_up>;
+                               rockchip,pins = <2 RK_PB4 1 &pcfg_pull_up>;
                        };
                };
 
                spi0-1 {
                        spi0m1_clk: spi0m1-clk {
-                               rockchip,pins =
-                                       <3 23 RK_FUNC_2 &pcfg_pull_up>;
+                               rockchip,pins = <3 RK_PC7 2 &pcfg_pull_up>;
                        };
 
                        spi0m1_cs0: spi0m1-cs0 {
-                               rockchip,pins =
-                                       <3 26 RK_FUNC_2 &pcfg_pull_up>;
+                               rockchip,pins = <3 RK_PD2 2 &pcfg_pull_up>;
                        };
 
                        spi0m1_tx: spi0m1-tx {
-                               rockchip,pins =
-                                       <3 25 RK_FUNC_2 &pcfg_pull_up>;
+                               rockchip,pins = <3 RK_PD1 2 &pcfg_pull_up>;
                        };
 
                        spi0m1_rx: spi0m1-rx {
-                               rockchip,pins =
-                                       <3 24 RK_FUNC_2 &pcfg_pull_up>;
+                               rockchip,pins = <3 RK_PD0 2 &pcfg_pull_up>;
                        };
 
                        spi0m1_cs1: spi0m1-cs1 {
-                               rockchip,pins =
-                                       <3 27 RK_FUNC_2 &pcfg_pull_up>;
+                               rockchip,pins = <3 RK_PD3 2 &pcfg_pull_up>;
                        };
                };
 
                spi0-2 {
                        spi0m2_clk: spi0m2-clk {
-                               rockchip,pins =
-                                       <3 0 RK_FUNC_4 &pcfg_pull_up>;
+                               rockchip,pins = <3 RK_PA0 4 &pcfg_pull_up>;
                        };
 
                        spi0m2_cs0: spi0m2-cs0 {
-                               rockchip,pins =
-                                       <3 8 RK_FUNC_3 &pcfg_pull_up>;
+                               rockchip,pins = <3 RK_PB0 3 &pcfg_pull_up>;
                        };
 
                        spi0m2_tx: spi0m2-tx {
-                               rockchip,pins =
-                                       <3 1 RK_FUNC_4 &pcfg_pull_up>;
+                               rockchip,pins = <3 RK_PA1 4 &pcfg_pull_up>;
                        };
 
                        spi0m2_rx: spi0m2-rx {
-                               rockchip,pins =
-                                       <3 2 RK_FUNC_4 &pcfg_pull_up>;
+                               rockchip,pins = <3 RK_PA2 4 &pcfg_pull_up>;
                        };
                };
 
                i2s1 {
                        i2s1_mclk: i2s1-mclk {
-                               rockchip,pins =
-                                       <2 15 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PB7 1 &pcfg_pull_none>;
                        };
 
                        i2s1_sclk: i2s1-sclk {
-                               rockchip,pins =
-                                       <2 18 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC2 1 &pcfg_pull_none>;
                        };
 
                        i2s1_lrckrx: i2s1-lrckrx {
-                               rockchip,pins =
-                                       <2 16 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC0 1 &pcfg_pull_none>;
                        };
 
                        i2s1_lrcktx: i2s1-lrcktx {
-                               rockchip,pins =
-                                       <2 17 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC1 1 &pcfg_pull_none>;
                        };
 
                        i2s1_sdi: i2s1-sdi {
-                               rockchip,pins =
-                                       <2 19 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC3 1 &pcfg_pull_none>;
                        };
 
                        i2s1_sdo: i2s1-sdo {
-                               rockchip,pins =
-                                       <2 23 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC7 1 &pcfg_pull_none>;
                        };
 
                        i2s1_sdio1: i2s1-sdio1 {
-                               rockchip,pins =
-                                       <2 20 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC4 1 &pcfg_pull_none>;
                        };
 
                        i2s1_sdio2: i2s1-sdio2 {
-                               rockchip,pins =
-                                       <2 21 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC5 1 &pcfg_pull_none>;
                        };
 
                        i2s1_sdio3: i2s1-sdio3 {
-                               rockchip,pins =
-                                       <2 22 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC6 1 &pcfg_pull_none>;
                        };
 
                        i2s1_sleep: i2s1-sleep {
                                rockchip,pins =
-                                       <2 15 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <2 16 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <2 17 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <2 18 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <2 19 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <2 20 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <2 21 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <2 22 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <2 23 RK_FUNC_GPIO &pcfg_input_high>;
+                                       <2 RK_PB7 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <2 RK_PC0 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <2 RK_PC1 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <2 RK_PC2 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <2 RK_PC3 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <2 RK_PC4 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <2 RK_PC5 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <2 RK_PC6 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <2 RK_PC7 RK_FUNC_GPIO &pcfg_input_high>;
                        };
                };
 
                i2s2-0 {
                        i2s2m0_mclk: i2s2m0-mclk {
-                               rockchip,pins =
-                                       <1 21 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PC5 1 &pcfg_pull_none>;
                        };
 
                        i2s2m0_sclk: i2s2m0-sclk {
-                               rockchip,pins =
-                                       <1 22 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PC6 1 &pcfg_pull_none>;
                        };
 
                        i2s2m0_lrckrx: i2s2m0-lrckrx {
-                               rockchip,pins =
-                                       <1 26 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PD2 1 &pcfg_pull_none>;
                        };
 
                        i2s2m0_lrcktx: i2s2m0-lrcktx {
-                               rockchip,pins =
-                                       <1 23 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PC7 1 &pcfg_pull_none>;
                        };
 
                        i2s2m0_sdi: i2s2m0-sdi {
-                               rockchip,pins =
-                                       <1 24 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PD0 1 &pcfg_pull_none>;
                        };
 
                        i2s2m0_sdo: i2s2m0-sdo {
-                               rockchip,pins =
-                                       <1 25 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PD1 1 &pcfg_pull_none>;
                        };
 
                        i2s2m0_sleep: i2s2m0-sleep {
                                rockchip,pins =
-                                       <1 21 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <1 22 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <1 26 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <1 23 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <1 24 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <1 25 RK_FUNC_GPIO &pcfg_input_high>;
+                                       <1 RK_PC5 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <1 RK_PC6 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <1 RK_PD2 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <1 RK_PC7 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <1 RK_PD0 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <1 RK_PD1 RK_FUNC_GPIO &pcfg_input_high>;
                        };
                };
 
                i2s2-1 {
                        i2s2m1_mclk: i2s2m1-mclk {
-                               rockchip,pins =
-                                       <1 21 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PC5 1 &pcfg_pull_none>;
                        };
 
                        i2s2m1_sclk: i2s2m1-sclk {
-                               rockchip,pins =
-                                       <3 0 RK_FUNC_6 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PA0 6 &pcfg_pull_none>;
                        };
 
                        i2s2m1_lrckrx: i2sm1-lrckrx {
-                               rockchip,pins =
-                                       <3 8 RK_FUNC_6 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PB0 6 &pcfg_pull_none>;
                        };
 
                        i2s2m1_lrcktx: i2s2m1-lrcktx {
-                               rockchip,pins =
-                                       <3 8 RK_FUNC_4 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PB0 4 &pcfg_pull_none>;
                        };
 
                        i2s2m1_sdi: i2s2m1-sdi {
-                               rockchip,pins =
-                                       <3 2 RK_FUNC_6 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PA2 6 &pcfg_pull_none>;
                        };
 
                        i2s2m1_sdo: i2s2m1-sdo {
-                               rockchip,pins =
-                                       <3 1 RK_FUNC_6 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PA1 6 &pcfg_pull_none>;
                        };
 
                        i2s2m1_sleep: i2s2m1-sleep {
                                rockchip,pins =
-                                       <1 21 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <3 0 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <3 8 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <3 2 RK_FUNC_GPIO &pcfg_input_high>,
-                                       <3 1 RK_FUNC_GPIO &pcfg_input_high>;
+                                       <1 RK_PC5 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <3 RK_PA0 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <3 RK_PB0 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <3 RK_PA2 RK_FUNC_GPIO &pcfg_input_high>,
+                                       <3 RK_PA1 RK_FUNC_GPIO &pcfg_input_high>;
                        };
                };
 
                spdif-0 {
                        spdifm0_tx: spdifm0-tx {
-                               rockchip,pins =
-                                       <0 27 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PD3 1 &pcfg_pull_none>;
                        };
                };
 
                spdif-1 {
                        spdifm1_tx: spdifm1-tx {
-                               rockchip,pins =
-                                       <2 17 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC1 2 &pcfg_pull_none>;
                        };
                };
 
                spdif-2 {
                        spdifm2_tx: spdifm2-tx {
-                               rockchip,pins =
-                                       <0 2 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA2 2 &pcfg_pull_none>;
                        };
                };
 
                sdmmc0-0 {
                        sdmmc0m0_pwren: sdmmc0m0-pwren {
-                               rockchip,pins =
-                                       <2 7 RK_FUNC_1 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <2 RK_PA7 1 &pcfg_pull_up_4ma>;
                        };
 
                        sdmmc0m0_gpio: sdmmc0m0-gpio {
-                               rockchip,pins =
-                                       <2 7 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
+                               rockchip,pins = <2 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
                        };
                };
 
                sdmmc0-1 {
                        sdmmc0m1_pwren: sdmmc0m1-pwren {
-                               rockchip,pins =
-                                       <0 30 RK_FUNC_3 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <0 RK_PD6 3 &pcfg_pull_up_4ma>;
                        };
 
                        sdmmc0m1_gpio: sdmmc0m1-gpio {
-                               rockchip,pins =
-                                       <0 30 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
+                               rockchip,pins = <0 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
                        };
                };
 
                sdmmc0 {
                        sdmmc0_clk: sdmmc0-clk {
-                               rockchip,pins =
-                                       <1 6 RK_FUNC_1 &pcfg_pull_none_4ma>;
+                               rockchip,pins = <1 RK_PA6 1 &pcfg_pull_none_8ma>;
                        };
 
                        sdmmc0_cmd: sdmmc0-cmd {
-                               rockchip,pins =
-                                       <1 4 RK_FUNC_1 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <1 RK_PA4 1 &pcfg_pull_up_8ma>;
                        };
 
                        sdmmc0_dectn: sdmmc0-dectn {
-                               rockchip,pins =
-                                       <1 5 RK_FUNC_1 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <1 RK_PA5 1 &pcfg_pull_up_4ma>;
                        };
 
                        sdmmc0_wrprt: sdmmc0-wrprt {
-                               rockchip,pins =
-                                       <1 7 RK_FUNC_1 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <1 RK_PA7 1 &pcfg_pull_up_4ma>;
                        };
 
                        sdmmc0_bus1: sdmmc0-bus1 {
-                               rockchip,pins =
-                                       <1 0 RK_FUNC_1 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <1 RK_PA0 1 &pcfg_pull_up_8ma>;
                        };
 
                        sdmmc0_bus4: sdmmc0-bus4 {
-                               rockchip,pins =
-                                       <1 0 RK_FUNC_1 &pcfg_pull_up_4ma>,
-                                       <1 1 RK_FUNC_1 &pcfg_pull_up_4ma>,
-                                       <1 2 RK_FUNC_1 &pcfg_pull_up_4ma>,
-                                       <1 3 RK_FUNC_1 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <1 RK_PA0 1 &pcfg_pull_up_8ma>,
+                                               <1 RK_PA1 1 &pcfg_pull_up_8ma>,
+                                               <1 RK_PA2 1 &pcfg_pull_up_8ma>,
+                                               <1 RK_PA3 1 &pcfg_pull_up_8ma>;
                        };
 
                        sdmmc0_gpio: sdmmc0-gpio {
                                rockchip,pins =
-                                       <1 6 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 4 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 5 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 7 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 3 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 2 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 1 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 0 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
+                                       <1 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
                        };
                };
 
                sdmmc0ext {
                        sdmmc0ext_clk: sdmmc0ext-clk {
-                               rockchip,pins =
-                                       <3 2 RK_FUNC_3 &pcfg_pull_none_4ma>;
+                               rockchip,pins = <3 RK_PA2 3 &pcfg_pull_none_4ma>;
                        };
 
                        sdmmc0ext_cmd: sdmmc0ext-cmd {
-                               rockchip,pins =
-                                       <3 0 RK_FUNC_3 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <3 RK_PA0 3 &pcfg_pull_up_4ma>;
                        };
 
                        sdmmc0ext_wrprt: sdmmc0ext-wrprt {
-                               rockchip,pins =
-                                       <3 3 RK_FUNC_3 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <3 RK_PA3 3 &pcfg_pull_up_4ma>;
                        };
 
                        sdmmc0ext_dectn: sdmmc0ext-dectn {
-                               rockchip,pins =
-                                       <3 1 RK_FUNC_3 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <3 RK_PA1 3 &pcfg_pull_up_4ma>;
                        };
 
                        sdmmc0ext_bus1: sdmmc0ext-bus1 {
-                               rockchip,pins =
-                                       <3 4 RK_FUNC_3 &pcfg_pull_up_4ma>;
+                               rockchip,pins = <3 RK_PA4 3 &pcfg_pull_up_4ma>;
                        };
 
                        sdmmc0ext_bus4: sdmmc0ext-bus4 {
                                rockchip,pins =
-                                       <3 4 RK_FUNC_3 &pcfg_pull_up_4ma>,
-                                       <3 5 RK_FUNC_3 &pcfg_pull_up_4ma>,
-                                       <3 6 RK_FUNC_3 &pcfg_pull_up_4ma>,
-                                       <3 7 RK_FUNC_3 &pcfg_pull_up_4ma>;
+                                       <3 RK_PA4 3 &pcfg_pull_up_4ma>,
+                                       <3 RK_PA5 3 &pcfg_pull_up_4ma>,
+                                       <3 RK_PA6 3 &pcfg_pull_up_4ma>,
+                                       <3 RK_PA7 3 &pcfg_pull_up_4ma>;
                        };
 
                        sdmmc0ext_gpio: sdmmc0ext-gpio {
                                rockchip,pins =
-                                       <3 0 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <3 1 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <3 2 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <3 3 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <3 4 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <3 5 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <3 6 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <3 7 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
+                                       <3 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
                        };
                };
 
                sdmmc1 {
                        sdmmc1_clk: sdmmc1-clk {
-                               rockchip,pins =
-                                       <1 12 RK_FUNC_1 &pcfg_pull_none_8ma>;
+                               rockchip,pins = <1 RK_PB4 1 &pcfg_pull_none_8ma>;
                        };
 
                        sdmmc1_cmd: sdmmc1-cmd {
-                               rockchip,pins =
-                                       <1 13 RK_FUNC_1 &pcfg_pull_up_8ma>;
+                               rockchip,pins = <1 RK_PB5 1 &pcfg_pull_up_8ma>;
                        };
 
                        sdmmc1_pwren: sdmmc1-pwren {
-                               rockchip,pins =
-                                       <1 18 RK_FUNC_1 &pcfg_pull_up_8ma>;
+                               rockchip,pins = <1 RK_PC2 1 &pcfg_pull_up_8ma>;
                        };
 
                        sdmmc1_wrprt: sdmmc1-wrprt {
-                               rockchip,pins =
-                                       <1 20 RK_FUNC_1 &pcfg_pull_up_8ma>;
+                               rockchip,pins = <1 RK_PC4 1 &pcfg_pull_up_8ma>;
                        };
 
                        sdmmc1_dectn: sdmmc1-dectn {
-                               rockchip,pins =
-                                       <1 19 RK_FUNC_1 &pcfg_pull_up_8ma>;
+                               rockchip,pins = <1 RK_PC3 1 &pcfg_pull_up_8ma>;
                        };
 
                        sdmmc1_bus1: sdmmc1-bus1 {
-                               rockchip,pins =
-                                       <1 14 RK_FUNC_1 &pcfg_pull_up_8ma>;
+                               rockchip,pins = <1 RK_PB6 1 &pcfg_pull_up_8ma>;
                        };
 
                        sdmmc1_bus4: sdmmc1-bus4 {
-                               rockchip,pins =
-                                       <1 12 RK_FUNC_1 &pcfg_pull_up_8ma>,
-                                       <1 13 RK_FUNC_1 &pcfg_pull_up_8ma>,
-                                       <1 16 RK_FUNC_1 &pcfg_pull_up_8ma>,
-                                       <1 17 RK_FUNC_1 &pcfg_pull_up_8ma>;
+                               rockchip,pins = <1 RK_PB6 1 &pcfg_pull_up_8ma>,
+                                               <1 RK_PB7 1 &pcfg_pull_up_8ma>,
+                                               <1 RK_PC0 1 &pcfg_pull_up_8ma>,
+                                               <1 RK_PC1 1 &pcfg_pull_up_8ma>;
                        };
 
                        sdmmc1_gpio: sdmmc1-gpio {
                                rockchip,pins =
-                                       <1 12 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 13 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 14 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 15 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 16 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 17 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 18 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 19 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
-                                       <1 20 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
+                                       <1 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PC3 RK_FUNC_GPIO &pcfg_pull_up_4ma>,
+                                       <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up_4ma>;
                        };
                };
 
                emmc {
                        emmc_clk: emmc-clk {
-                               rockchip,pins =
-                                       <3 21 RK_FUNC_2 &pcfg_pull_none_12ma>;
+                               rockchip,pins = <3 RK_PC5 2 &pcfg_pull_none_12ma>;
                        };
 
                        emmc_cmd: emmc-cmd {
-                               rockchip,pins =
-                                       <3 19 RK_FUNC_2 &pcfg_pull_up_12ma>;
+                               rockchip,pins = <3 RK_PC3 2 &pcfg_pull_up_12ma>;
                        };
 
                        emmc_pwren: emmc-pwren {
-                               rockchip,pins =
-                                       <3 22 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PC6 2 &pcfg_pull_none>;
                        };
 
                        emmc_rstnout: emmc-rstnout {
-                               rockchip,pins =
-                                       <3 20 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <3 RK_PC4 2 &pcfg_pull_none>;
                        };
 
                        emmc_bus1: emmc-bus1 {
-                               rockchip,pins =
-                                       <0 7 RK_FUNC_2 &pcfg_pull_up_12ma>;
+                               rockchip,pins = <0 RK_PA7 2 &pcfg_pull_up_12ma>;
                        };
 
                        emmc_bus4: emmc-bus4 {
                                rockchip,pins =
-                                       <0 7 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <2 28 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <2 29 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <2 30 RK_FUNC_2 &pcfg_pull_up_12ma>;
+                                       <0 RK_PA7 2 &pcfg_pull_up_12ma>,
+                                       <2 RK_PD4 2 &pcfg_pull_up_12ma>,
+                                       <2 RK_PD5 2 &pcfg_pull_up_12ma>,
+                                       <2 RK_PD6 2 &pcfg_pull_up_12ma>;
                        };
 
                        emmc_bus8: emmc-bus8 {
                                rockchip,pins =
-                                       <0 7 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <2 28 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <2 29 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <2 30 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <2 31 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <3 16 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <3 17 RK_FUNC_2 &pcfg_pull_up_12ma>,
-                                       <3 18 RK_FUNC_2 &pcfg_pull_up_12ma>;
+                                       <0 RK_PA7 2 &pcfg_pull_up_12ma>,
+                                       <2 RK_PD4 2 &pcfg_pull_up_12ma>,
+                                       <2 RK_PD5 2 &pcfg_pull_up_12ma>,
+                                       <2 RK_PD6 2 &pcfg_pull_up_12ma>,
+                                       <2 RK_PD7 2 &pcfg_pull_up_12ma>,
+                                       <3 RK_PC0 2 &pcfg_pull_up_12ma>,
+                                       <3 RK_PC1 2 &pcfg_pull_up_12ma>,
+                                       <3 RK_PC2 2 &pcfg_pull_up_12ma>;
                        };
                };
 
                pwm0 {
                        pwm0_pin: pwm0-pin {
-                               rockchip,pins =
-                                       <2 4 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA4 1 &pcfg_pull_none>;
                        };
                };
 
                pwm1 {
                        pwm1_pin: pwm1-pin {
-                               rockchip,pins =
-                                       <2 5 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA5 1 &pcfg_pull_none>;
                        };
                };
 
                pwm2 {
                        pwm2_pin: pwm2-pin {
-                               rockchip,pins =
-                                       <2 6 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PA6 1 &pcfg_pull_none>;
                        };
                };
 
                pwmir {
                        pwmir_pin: pwmir-pin {
-                               rockchip,pins =
-                                       <2 2 RK_FUNC_1 &pcfg_pull_none>;
-                       };
-               };
-
-               gmac-0 {
-                       rgmiim0_pins: rgmiim0-pins {
-                               rockchip,pins =
-                                       /* mac_txclk */
-                                       <0 8 RK_FUNC_1 &pcfg_pull_none_12ma>,
-                                       /* mac_rxclk */
-                                       <0 10 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_mdio */
-                                       <0 11 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_txen */
-                                       <0 12 RK_FUNC_1 &pcfg_pull_none_12ma>,
-                                       /* mac_clk */
-                                       <0 24 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_rxdv */
-                                       <0 25 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_mdc */
-                                       <0 19 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_rxd1 */
-                                       <0 14 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_rxd0 */
-                                       <0 15 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_txd1 */
-                                       <0 16 RK_FUNC_1 &pcfg_pull_none_12ma>,
-                                       /* mac_txd0 */
-                                       <0 17 RK_FUNC_1 &pcfg_pull_none_12ma>,
-                                       /* mac_rxd3 */
-                                       <0 20 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_rxd2 */
-                                       <0 21 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_txd3 */
-                                       <0 23 RK_FUNC_1 &pcfg_pull_none_12ma>,
-                                       /* mac_txd2 */
-                                       <0 22 RK_FUNC_1 &pcfg_pull_none_12ma>;
-                       };
-
-                       rmiim0_pins: rmiim0-pins {
-                               rockchip,pins =
-                                       /* mac_mdio */
-                                       <0 11 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_txen */
-                                       <0 12 RK_FUNC_1 &pcfg_pull_none_12ma>,
-                                       /* mac_clk */
-                                       <0 24 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_rxer */
-                                       <0 13 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_rxdv */
-                                       <0 25 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_mdc */
-                                       <0 19 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_rxd1 */
-                                       <0 14 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_rxd0 */
-                                       <0 15 RK_FUNC_1 &pcfg_pull_none>,
-                                       /* mac_txd1 */
-                                       <0 16 RK_FUNC_1 &pcfg_pull_none_12ma>,
-                                       /* mac_txd0 */
-                                       <0 17 RK_FUNC_1 &pcfg_pull_none_12ma>;
+                               rockchip,pins = <2 RK_PA2 1 &pcfg_pull_none>;
                        };
                };
 
                        rgmiim1_pins: rgmiim1-pins {
                                rockchip,pins =
                                        /* mac_txclk */
-                                       <1 12 RK_FUNC_2 &pcfg_pull_none_12ma>,
+                                       <1 RK_PB4 2 &pcfg_pull_none_8ma>,
                                        /* mac_rxclk */
-                                       <1 13 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PB5 2 &pcfg_pull_none_4ma>,
                                        /* mac_mdio */
-                                       <1 19 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PC3 2 &pcfg_pull_none_4ma>,
                                        /* mac_txen */
-                                       <1 25 RK_FUNC_2 &pcfg_pull_none_12ma>,
+                                       <1 RK_PD1 2 &pcfg_pull_none_8ma>,
                                        /* mac_clk */
-                                       <1 21 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PC5 2 &pcfg_pull_none_4ma>,
                                        /* mac_rxdv */
-                                       <1 22 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PC6 2 &pcfg_pull_none_4ma>,
                                        /* mac_mdc */
-                                       <1 23 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PC7 2 &pcfg_pull_none_4ma>,
                                        /* mac_rxd1 */
-                                       <1 10 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PB2 2 &pcfg_pull_none_4ma>,
                                        /* mac_rxd0 */
-                                       <1 11 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PB3 2 &pcfg_pull_none_4ma>,
                                        /* mac_txd1 */
-                                       <1 8 RK_FUNC_2 &pcfg_pull_none_12ma>,
+                                       <1 RK_PB0 2 &pcfg_pull_none_8ma>,
                                        /* mac_txd0 */
-                                       <1 9 RK_FUNC_2 &pcfg_pull_none_12ma>,
+                                       <1 RK_PB1 2 &pcfg_pull_none_8ma>,
                                        /* mac_rxd3 */
-                                       <1 14 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PB6 2 &pcfg_pull_none_4ma>,
                                        /* mac_rxd2 */
-                                       <1 15 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PB7 2 &pcfg_pull_none_4ma>,
                                        /* mac_txd3 */
-                                       <1 16 RK_FUNC_2 &pcfg_pull_none_12ma>,
+                                       <1 RK_PC0 2 &pcfg_pull_none_8ma>,
                                        /* mac_txd2 */
-                                       <1 17 RK_FUNC_2 &pcfg_pull_none_12ma>,
+                                       <1 RK_PC1 2 &pcfg_pull_none_8ma>,
 
                                        /* mac_txclk */
-                                       <0 8 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PB0 1 &pcfg_pull_none_8ma>,
                                        /* mac_txen */
-                                       <0 12 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PB4 1 &pcfg_pull_none_8ma>,
                                        /* mac_clk */
-                                       <0 24 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PD0 1 &pcfg_pull_none_4ma>,
                                        /* mac_txd1 */
-                                       <0 16 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PC0 1 &pcfg_pull_none_8ma>,
                                        /* mac_txd0 */
-                                       <0 17 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PC1 1 &pcfg_pull_none_8ma>,
                                        /* mac_txd3 */
-                                       <0 23 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PC7 1 &pcfg_pull_none_8ma>,
                                        /* mac_txd2 */
-                                       <0 22 RK_FUNC_1 &pcfg_pull_none>;
+                                       <0 RK_PC6 1 &pcfg_pull_none_8ma>;
                        };
 
                        rmiim1_pins: rmiim1-pins {
                                rockchip,pins =
                                        /* mac_mdio */
-                                       <1 19 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PC3 2 &pcfg_pull_none_2ma>,
                                        /* mac_txen */
-                                       <1 25 RK_FUNC_2 &pcfg_pull_none_12ma>,
+                                       <1 RK_PD1 2 &pcfg_pull_none_12ma>,
                                        /* mac_clk */
-                                       <1 21 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PC5 2 &pcfg_pull_none_2ma>,
                                        /* mac_rxer */
-                                       <1 24 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PD0 2 &pcfg_pull_none_2ma>,
                                        /* mac_rxdv */
-                                       <1 22 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PC6 2 &pcfg_pull_none_2ma>,
                                        /* mac_mdc */
-                                       <1 23 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PC7 2 &pcfg_pull_none_2ma>,
                                        /* mac_rxd1 */
-                                       <1 10 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PB2 2 &pcfg_pull_none_2ma>,
                                        /* mac_rxd0 */
-                                       <1 11 RK_FUNC_2 &pcfg_pull_none_2ma>,
+                                       <1 RK_PB3 2 &pcfg_pull_none_2ma>,
                                        /* mac_txd1 */
-                                       <1 8 RK_FUNC_2 &pcfg_pull_none_12ma>,
+                                       <1 RK_PB0 2 &pcfg_pull_none_12ma>,
                                        /* mac_txd0 */
-                                       <1 9 RK_FUNC_2 &pcfg_pull_none_12ma>,
+                                       <1 RK_PB1 2 &pcfg_pull_none_12ma>,
 
                                        /* mac_mdio */
-                                       <0 11 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PB3 1 &pcfg_pull_none>,
                                        /* mac_txen */
-                                       <0 12 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PB4 1 &pcfg_pull_none>,
                                        /* mac_clk */
-                                       <0 24 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PD0 1 &pcfg_pull_none>,
                                        /* mac_mdc */
-                                       <0 19 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PC3 1 &pcfg_pull_none>,
                                        /* mac_txd1 */
-                                       <0 16 RK_FUNC_1 &pcfg_pull_none>,
+                                       <0 RK_PC0 1 &pcfg_pull_none>,
                                        /* mac_txd0 */
-                                       <0 17 RK_FUNC_1 &pcfg_pull_none>;
+                                       <0 RK_PC1 1 &pcfg_pull_none>;
                        };
                };
 
                gmac2phy {
-                       fephyled_speed100: fephyled-speed100 {
-                               rockchip,pins =
-                                       <0 31 RK_FUNC_1 &pcfg_pull_none>;
-                       };
-
                        fephyled_speed10: fephyled-speed10 {
-                               rockchip,pins =
-                                       <0 30 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PD6 1 &pcfg_pull_none>;
                        };
 
                        fephyled_duplex: fephyled-duplex {
-                               rockchip,pins =
-                                       <0 30 RK_FUNC_2 &pcfg_pull_none>;
-                       };
-
-                       fephyled_rxm0: fephyled-rxm0 {
-                               rockchip,pins =
-                                       <0 29 RK_FUNC_1 &pcfg_pull_none>;
-                       };
-
-                       fephyled_txm0: fephyled-txm0 {
-                               rockchip,pins =
-                                       <0 29 RK_FUNC_2 &pcfg_pull_none>;
-                       };
-
-                       fephyled_linkm0: fephyled-linkm0 {
-                               rockchip,pins =
-                                       <0 28 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PD6 2 &pcfg_pull_none>;
                        };
 
                        fephyled_rxm1: fephyled-rxm1 {
-                               rockchip,pins =
-                                       <2 25 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PD1 2 &pcfg_pull_none>;
                        };
 
                        fephyled_txm1: fephyled-txm1 {
-                               rockchip,pins =
-                                       <2 25 RK_FUNC_3 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PD1 3 &pcfg_pull_none>;
                        };
 
                        fephyled_linkm1: fephyled-linkm1 {
-                               rockchip,pins =
-                                       <2 24 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PD0 2 &pcfg_pull_none>;
                        };
                };
 
                tsadc_pin {
                        tsadc_int: tsadc-int {
-                               rockchip,pins =
-                                       <2 13 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PB5 2 &pcfg_pull_none>;
                        };
                        tsadc_gpio: tsadc-gpio {
-                               rockchip,pins =
-                                       <2 13 RK_FUNC_GPIO &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
                        };
                };
 
                hdmi_pin {
                        hdmi_cec: hdmi-cec {
-                               rockchip,pins =
-                                       <0 3 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA3 1 &pcfg_pull_none>;
                        };
 
                        hdmi_hpd: hdmi-hpd {
-                               rockchip,pins =
-                                       <0 4 RK_FUNC_1 &pcfg_pull_down>;
+                               rockchip,pins = <0 RK_PA4 1 &pcfg_pull_down>;
                        };
                };
 
                        dvp_d2d9_m0:dvp-d2d9-m0 {
                                rockchip,pins =
                                        /* cif_d0 */
-                                       <3 4 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA4 2 &pcfg_pull_none>,
                                        /* cif_d1 */
-                                       <3 5 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA5 2 &pcfg_pull_none>,
                                        /* cif_d2 */
-                                       <3 6 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA6 2 &pcfg_pull_none>,
                                        /* cif_d3 */
-                                       <3 7 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA7 2 &pcfg_pull_none>,
                                        /* cif_d4 */
-                                       <3 8 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PB0 2 &pcfg_pull_none>,
                                        /* cif_d5m0 */
-                                       <3 9 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PB1 2 &pcfg_pull_none>,
                                        /* cif_d6m0 */
-                                       <3 10 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PB2 2 &pcfg_pull_none>,
                                        /* cif_d7m0 */
-                                       <3 11 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PB3 2 &pcfg_pull_none>,
                                        /* cif_href */
-                                       <3 1 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA1 2 &pcfg_pull_none>,
                                        /* cif_vsync */
-                                       <3 0 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA0 2 &pcfg_pull_none>,
                                        /* cif_clkoutm0 */
-                                       <3 3 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA3 2 &pcfg_pull_none>,
                                        /* cif_clkin */
-                                       <3 2 RK_FUNC_2 &pcfg_pull_none>;
+                                       <3 RK_PA2 2 &pcfg_pull_none>;
                        };
                };
 
                        dvp_d2d9_m1:dvp-d2d9-m1 {
                                rockchip,pins =
                                        /* cif_d0 */
-                                       <3 4 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA4 2 &pcfg_pull_none>,
                                        /* cif_d1 */
-                                       <3 5 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA5 2 &pcfg_pull_none>,
                                        /* cif_d2 */
-                                       <3 6 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA6 2 &pcfg_pull_none>,
                                        /* cif_d3 */
-                                       <3 7 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA7 2 &pcfg_pull_none>,
                                        /* cif_d4 */
-                                       <3 8 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PB0 2 &pcfg_pull_none>,
                                        /* cif_d5m1 */
-                                       <2 16 RK_FUNC_4 &pcfg_pull_none>,
+                                       <2 RK_PC0 4 &pcfg_pull_none>,
                                        /* cif_d6m1 */
-                                       <2 17 RK_FUNC_4 &pcfg_pull_none>,
+                                       <2 RK_PC1 4 &pcfg_pull_none>,
                                        /* cif_d7m1 */
-                                       <2 18 RK_FUNC_4 &pcfg_pull_none>,
+                                       <2 RK_PC2 4 &pcfg_pull_none>,
                                        /* cif_href */
-                                       <3 1 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA1 2 &pcfg_pull_none>,
                                        /* cif_vsync */
-                                       <3 0 RK_FUNC_2 &pcfg_pull_none>,
+                                       <3 RK_PA0 2 &pcfg_pull_none>,
                                        /* cif_clkoutm1 */
-                                       <2 15 RK_FUNC_4 &pcfg_pull_none>,
+                                       <2 RK_PB7 4 &pcfg_pull_none>,
                                        /* cif_clkin */
-                                       <3 2 RK_FUNC_2 &pcfg_pull_none>;
+                                       <3 RK_PA2 2 &pcfg_pull_none>;
                        };
                };
        };
index ccb33d34d12d0ed20856b0c042a37d80a8962e0e..e5659d79995d13c06b89e743b54459803bc4b0fb 100644 (file)
                u-boot,spl-boot-order = &sdhci, &sdmmc;
        };
 };
+
+&rng {
+       status = "okay";
+};
+
+&i2c0 {
+       u-boot,dm-pre-reloc;
+};
+
+&rk808 {
+       u-boot,dm-pre-reloc;
+};
index 4129e902a81822556c5f39b31641ca5986385620..694b0d08d644aeee1015d33d30f192d624a2a4a6 100644 (file)
@@ -1,86 +1,18 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
  */
 
 /dts-v1/;
 #include <dt-bindings/pwm/pwm.h>
-#include <dt-bindings/pinctrl/rockchip.h>
 #include "rk3399.dtsi"
 
 / {
        model = "Rockchip RK3399 Evaluation Board";
-       compatible = "rockchip,rk3399-evb", "rockchip,rk3399",
-                    "google,rk3399evb-rev2";
-
-       chosen {
-               stdout-path = &uart2;
-       };
-
-       vdd_center: vdd-center {
-               compatible = "pwm-regulator";
-               pwms = <&pwm3 0 25000 1>;
-               regulator-name = "vdd_center";
-               regulator-min-microvolt = <800000>;
-               regulator-max-microvolt = <1400000>;
-               regulator-init-microvolt = <950000>;
-               regulator-always-on;
-               regulator-boot-on;
-               status = "okay";
-       };
-
-       vccsys: vccsys {
-               compatible = "regulator-fixed";
-               regulator-name = "vccsys";
-               regulator-boot-on;
-               regulator-always-on;
-       };
-
-       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>;
-       };
-
-       vcc_phy: vcc-phy-regulator {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc_phy";
-               regulator-always-on;
-               regulator-boot-on;
-       };
-
-       vcc5v0_host: vcc5v0-host-en {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc5v0_host";
-               gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
-       };
-
-       vcc5v0_typec0: vcc5v0-typec0-en {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc5v0_typec0";
-               gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
-       };
-
-       vcc5v0_typec1: vcc5v0-typec1-en {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc5v0_typec1";
-               gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
-       };
-
-       clkin_gmac: external-gmac-clock {
-               compatible = "fixed-clock";
-               clock-frequency = <125000000>;
-               clock-output-names = "clkin_gmac";
-               #clock-cells = <0>;
-       };
+       compatible = "rockchip,rk3399-evb", "rockchip,rk3399";
 
        backlight: backlight {
                compatible = "pwm-backlight";
-               power-supply = <&vccsys>;
-               enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
                brightness-levels = <
                          0   1   2   3   4   5   6   7
                          8   9  10  11  12  13  14  15
                        248 249 250 251 252 253 254 255>;
                default-brightness-level = <200>;
                pwms = <&pwm0 0 25000 0>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&pwm0_pin>;
-               pwm-delay-us = <10000>;
-               status = "disabled";
        };
 
-       panel:panel {
-               compatible = "simple-panel";
-               power-supply = <&vcc33_lcd>;
+       edp_panel: edp-panel {
+               compatible ="lg,lp079qx1-sp0v";
                backlight = <&backlight>;
-               /*enable-gpios = <&gpio4 18 GPIO_ACTIVE_HIGH>;*/
-               status = "disabled";
+               enable-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
+               power-supply = <&vcc3v3_s0>;
+
+               port {
+                       panel_in_edp: endpoint {
+                               remote-endpoint = <&edp_out_panel>;
+                       };
+               };
+       };
+
+       clkin_gmac: external-gmac-clock {
+               compatible = "fixed-clock";
+               clock-frequency = <125000000>;
+               clock-output-names = "clkin_gmac";
+               #clock-cells = <0>;
+       };
+
+       vdd_center: vdd-center {
+               compatible = "pwm-regulator";
+               pwms = <&pwm3 0 25000 0>;
+               regulator-name = "vdd_center";
+               regulator-min-microvolt = <800000>;
+               regulator-max-microvolt = <1400000>;
+               regulator-always-on;
+               regulator-boot-on;
+               status = "okay";
+       };
+
+       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>;
+       };
+
+       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>;
+       };
+
+       vcc5v0_host: vcc5v0-host-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_host_en>;
+               regulator-name = "vcc5v0_host";
+               vin-supply = <&vcc5v0_sys>;
+       };
+
+       vcc_phy: vcc-phy-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_phy";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       vcc_phy: vcc-phy-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_phy";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+};
+
+&edp {
+       status = "okay";
+       force-hpd;
+
+       ports {
+               edp_out: port@1 {
+                       reg = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       edp_out_panel: endpoint@0 {
+                               reg = <0>;
+                               remote-endpoint = <&panel_in_edp>;
+                       };
+               };
        };
 };
 
        status = "okay";
 };
 
-&pwm0 {
+&gmac {
+       assigned-clocks = <&cru SCLK_RMII_SRC>;
+       assigned-clock-parents = <&clkin_gmac>;
+       clock_in_out = "input";
+       phy-supply = <&vcc_phy>;
+       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";
 };
 
-&pwm2 {
+&i2c0 {
        status = "okay";
+
+       rk808: pmic@1b {
+               compatible = "rockchip,rk808";
+               reg = <0x1b>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pmic_int_l>;
+               rockchip,system-power-controller;
+               wakeup-source;
+               #clock-cells = <1>;
+               clock-output-names = "rk808-clkout1", "rk808-clkout2";
+
+               vcc1-supply = <&vcc3v3_sys>;
+               vcc2-supply = <&vcc3v3_sys>;
+               vcc3-supply = <&vcc3v3_sys>;
+               vcc4-supply = <&vcc3v3_sys>;
+               vcc6-supply = <&vcc3v3_sys>;
+               vcc7-supply = <&vcc3v3_sys>;
+               vcc8-supply = <&vcc3v3_sys>;
+               vcc9-supply = <&vcc3v3_sys>;
+               vcc10-supply = <&vcc3v3_sys>;
+               vcc11-supply = <&vcc3v3_sys>;
+               vcc12-supply = <&vcc3v3_sys>;
+               vddio-supply = <&vcc1v8_pmu>;
+
+               regulators {
+                       vdd_log: DCDC_REG1 {
+                               regulator-name = "vdd_log";
+                               regulator-min-microvolt = <750000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <900000>;
+                               };
+                       };
+
+                       vdd_cpu_l: DCDC_REG2 {
+                               regulator-name = "vdd_cpu_l";
+                               regulator-min-microvolt = <750000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-ramp-delay = <6001>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               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-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vcc1v8_dvp: LDO_REG1 {
+                               regulator-name = "vcc1v8_dvp";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc3v0_tp: LDO_REG2 {
+                               regulator-name = "vcc3v0_tp";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc1v8_pmu: LDO_REG3 {
+                               regulator-name = "vcc1v8_pmu";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1800000>;
+                               };
+                       };
+
+                       vcc_sd: LDO_REG4 {
+                               regulator-name = "vcc_sd";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3000000>;
+                               };
+                       };
+
+                       vcca3v0_codec: LDO_REG5 {
+                               regulator-name = "vcca3v0_codec";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_1v5: LDO_REG6 {
+                               regulator-name = "vcc_1v5";
+                               regulator-min-microvolt = <1500000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <1500000>;
+                               };
+                       };
+
+                       vcca1v8_codec: LDO_REG7 {
+                               regulator-name = "vcca1v8_codec";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc_3v0: LDO_REG8 {
+                               regulator-name = "vcc_3v0";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-microvolt = <3000000>;
+                               };
+                       };
+
+                       vcc3v3_s3: SWITCH_REG1 {
+                               regulator-name = "vcc3v3_s3";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       vcc3v3_s0: SWITCH_REG2 {
+                               regulator-name = "vcc3v3_s0";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+               };
+       };
+
+       vdd_cpu_b: regulator@40 {
+               compatible = "silergy,syr827";
+               reg = <0x40>;
+               fcs,suspend-voltage-selector = <1>;
+               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>;
+               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;
+               };
+       };
 };
 
-&pwm3 {
+&pwm0 {
        status = "okay";
 };
 
-&saradc {
+&pwm2 {
        status = "okay";
 };
 
-&sdmmc {
-       bus-width = <4>;
+&pwm3 {
        status = "okay";
 };
 
        status = "okay";
 };
 
-&uart2 {
-       status = "okay";
+&pcie_phy {
+       status = "disabled";
 };
 
-&usb_host0_ehci {
-       status = "okay";
+&pcie0 {
+       ep-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>;
+       num-lanes = <4>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie_clkreqn_cpm>;
+       status = "disabled";
 };
 
-&usb_host0_ohci {
+&u2phy0 {
        status = "okay";
 };
 
-&usbdrd3_0 {
-       vbus-supply = <&vcc5v0_typec0>;
+&u2phy0_host {
+       phy-supply = <&vcc5v0_host>;
        status = "okay";
 };
 
-&usb_host1_ehci {
+&u2phy1 {
        status = "okay";
 };
 
-&usb_host1_ohci {
+&u2phy1_host {
+       phy-supply = <&vcc5v0_host>;
        status = "okay";
 };
 
-&usbdrd3_1 {
-       vbus-supply = <&vcc5v0_typec1>;
+&uart2 {
        status = "okay";
 };
 
-&i2c0 {
+&usb_host0_ehci {
        status = "okay";
-       clock-frequency = <400000>;
-       i2c-scl-falling-time-ns = <50>;
-       i2c-scl-rising-time-ns = <100>;
-       u-boot,dm-pre-reloc;
-
-       rk808: pmic@1b {
-               compatible = "rockchip,rk808";
-               clock-output-names = "xin32k", "wifibt_32kin";
-               interrupt-parent = <&gpio0>;
-               interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&pmic_int_l>;
-               reg = <0x1b>;
-               rockchip,system-power-controller;
-               #clock-cells = <1>;
-               u-boot,dm-pre-reloc;
-               status = "okay";
+};
 
-               vcc12-supply = <&vcc3v3_sys>;
+&usb_host0_ohci {
+       status = "okay";
+};
 
-               regulators {
-                       vcc33_lcd: SWITCH_REG2 {
-                               regulator-always-on;
-                               regulator-boot-on;
-                               regulator-name = "vcc33_lcd";
-                       };
-               };
-       };
+&usb_host1_ehci {
+       status = "okay";
 };
 
-&mipi_dsi {
-       status = "disabled";
-       rockchip,panel = <&panel>;
-       display-timings {
-               timing0 {
-               bits-per-pixel = <24>;
-               clock-frequency = <160000000>;
-               hfront-porch = <120>;
-               hsync-len = <20>;
-               hback-porch = <21>;
-               hactive = <1200>;
-               vfront-porch = <21>;
-               vsync-len = <3>;
-               vback-porch = <18>;
-               vactive = <1920>;
-               hsync-active = <0>;
-               vsync-active = <0>;
-               de-active = <1>;
-               pixelclk-active = <0>;
-               };
-       };
+&usb_host1_ohci {
+       status = "okay";
 };
 
 &pinctrl {
        pmic {
                pmic_int_l: pmic-int-l {
                        rockchip,pins =
-                               <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
+                               <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
                };
+       };
 
-               pmic_dvs2: pmic-dvs2 {
+       usb2 {
+               vcc5v0_host_en: vcc5v0-host-en {
                        rockchip,pins =
-                               <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
+                               <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 };
 
-&gmac {
-        phy-supply = <&vcc_phy>;
-       phy-mode = "rgmii";
-       clock_in_out = "input";
-       snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
-       snps,reset-active-low;
-       snps,reset-delays-us = <0 10000 50000>;
-       assigned-clocks = <&cru SCLK_RMII_SRC>;
-       assigned-clock-parents = <&clkin_gmac>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&rgmii_pins>;
-       tx_delay = <0x28>;
-       rx_delay = <0x11>;
+&vopb {
+       status = "okay";
+};
+
+&vopb_mmu {
        status = "okay";
 };
index 6b059bd7a04fe2ee2acbb7c67507064ad64c0155..ebe2ee77ba1f60aaeec9914b7158c83a90cb23e7 100644 (file)
        };
 };
 
+&spi1 {
+       /* On both Low speed and High speed expansion */
+       cs-gpios = <0>, <&gpio4 RK_PA6 0>, <&gpio4 RK_PA7 0>;
+       status = "okay";
+};
+
 &usbdrd_dwc3_0 {
        dr_mode = "host";
 };
index 89c67fd24cc93894ef354f3480bce3398818c786..d63faf38cc81a8e2b38ef282e204c4280256316a 100644 (file)
@@ -1,19 +1,20 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
  */
 
 /dts-v1/;
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/pwm/pwm.h>
-#include <dt-bindings/pinctrl/rockchip.h>
 #include "rk3399.dtsi"
+#include "rk3399-opp.dtsi"
 
 / {
        model = "Firefly-RK3399 Board";
        compatible = "firefly,firefly-rk3399", "rockchip,rk3399";
 
        chosen {
-               stdout-path = &uart2;
+               stdout-path = "serial2:1500000n8";
        };
 
        backlight: backlight {
                #clock-cells = <0>;
        };
 
+       dc_12v: dc-12v {
+               compatible = "regulator-fixed";
+               regulator-name = "dc_12v";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               autorepeat;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pwrbtn>;
+
+               power {
+                       debounce-interval = <100>;
+                       gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
+                       label = "GPIO Key Power";
+                       linux,code = <KEY_POWER>;
+                       wakeup-source;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>;
+
+               work-led {
+                       label = "work";
+                       default-state = "on";
+                       gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
+               };
+
+               diy-led {
+                       label = "diy";
+                       default-state = "off";
+                       gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
        rt5640-sound {
                compatible = "simple-audio-card";
                simple-audio-card,name = "rockchip,rt5640-codec";
                reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
        };
 
+       /* switched by pmic_sleep */
+       vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc1v8_s3";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_1v8>;
+       };
+
        vcc3v3_pcie: vcc3v3-pcie-regulator {
                compatible = "regulator-fixed";
                enable-active-high;
                gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
-               pinctrl-0 = <&pcie_drv>;
+               pinctrl-0 = <&pcie_pwr_en>;
                regulator-name = "vcc3v3_pcie";
                regulator-always-on;
                regulator-boot-on;
+               vin-supply = <&dc_12v>;
        };
 
        vcc3v3_sys: vcc3v3-sys {
                regulator-boot-on;
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_sys>;
        };
 
+       /* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
        vcc5v0_host: vcc5v0-host-regulator {
                compatible = "regulator-fixed";
                enable-active-high;
                gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
-               pinctrl-0 = <&host_vbus_drv>;
+               pinctrl-0 = <&vcc5v0_host_en>;
                regulator-name = "vcc5v0_host";
                regulator-always-on;
+               vin-supply = <&vcc_sys>;
        };
 
-       vcc5v0_sys: vcc5v0-sys {
+       vcc_sys: vcc-sys {
                compatible = "regulator-fixed";
-               regulator-name = "vcc5v0_sys";
+               regulator-name = "vcc_sys";
                regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-       };
-
-       vcc_phy: vcc-phy-regulator {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc_phy";
-               regulator-always-on;
-               regulator-boot-on;
+               vin-supply = <&dc_12v>;
        };
 
        vdd_log: vdd-log {
                regulator-boot-on;
                regulator-min-microvolt = <430000>;
                regulator-max-microvolt = <1400000>;
-               regulator-init-microvolt = <950000>;
-       };
-
-       vccadc_ref: vccadc-ref {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc1v8_sys";
-               regulator-always-on;
-               regulator-boot-on;
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_sys>;
        };
 };
 
        assigned-clocks = <&cru SCLK_RMII_SRC>;
        assigned-clock-parents = <&clkin_gmac>;
        clock_in_out = "input";
-       phy-supply = <&vcc_phy>;
+       phy-supply = <&vcc_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 = <0x33>;
-       rx_delay = <0x45>;
+       tx_delay = <0x28>;
+       rx_delay = <0x11>;
+       status = "okay";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c3>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&hdmi_cec>;
        status = "okay";
 };
 
                rockchip,system-power-controller;
                wakeup-source;
 
-               vcc1-supply = <&vcc3v3_sys>;
-               vcc2-supply = <&vcc3v3_sys>;
-               vcc3-supply = <&vcc3v3_sys>;
-               vcc4-supply = <&vcc3v3_sys>;
-               vcc6-supply = <&vcc3v3_sys>;
-               vcc7-supply = <&vcc3v3_sys>;
+               vcc1-supply = <&vcc_sys>;
+               vcc2-supply = <&vcc_sys>;
+               vcc3-supply = <&vcc_sys>;
+               vcc4-supply = <&vcc_sys>;
+               vcc6-supply = <&vcc_sys>;
+               vcc7-supply = <&vcc_sys>;
                vcc8-supply = <&vcc3v3_sys>;
-               vcc9-supply = <&vcc3v3_sys>;
-               vcc10-supply = <&vcc3v3_sys>;
-               vcc11-supply = <&vcc3v3_sys>;
+               vcc9-supply = <&vcc_sys>;
+               vcc10-supply = <&vcc_sys>;
+               vcc11-supply = <&vcc_sys>;
                vcc12-supply = <&vcc3v3_sys>;
                vddio-supply = <&vcc1v8_pmu>;
 
                                };
                        };
 
-                       vcc3v0_tp: LDO_REG2 {
-                               regulator-name = "vcc3v0_tp";
+                       vcc2v8_dvp: LDO_REG2 {
+                               regulator-name = "vcc2v8_dvp";
                                regulator-always-on;
                                regulator-boot-on;
-                               regulator-min-microvolt = <3000000>;
-                               regulator-max-microvolt = <3000000>;
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                                };
                        };
 
-                       vcc_sd: LDO_REG4 {
-                               regulator-name = "vcc_sd";
+                       vcc_sdio: LDO_REG4 {
+                               regulator-name = "vcc_sdio";
                                regulator-always-on;
                                regulator-boot-on;
                                regulator-min-microvolt = <1800000>;
                                };
                        };
 
-                       vcc3v3_s3: SWITCH_REG1 {
+                       vcc3v3_s3: vcc_lan: SWITCH_REG1 {
                                regulator-name = "vcc3v3_s3";
                                regulator-always-on;
                                regulator-boot-on;
                regulator-ramp-delay = <1000>;
                regulator-always-on;
                regulator-boot-on;
-               vin-supply = <&vcc5v0_sys>;
+               vin-supply = <&vcc_sys>;
 
                regulator-state-mem {
                        regulator-off-in-suspend;
                regulator-ramp-delay = <1000>;
                regulator-always-on;
                regulator-boot-on;
-               vin-supply = <&vcc5v0_sys>;
+               vin-supply = <&vcc_sys>;
 
                regulator-state-mem {
                        regulator-off-in-suspend;
 &i2s0 {
        rockchip,playback-channels = <8>;
        rockchip,capture-channels = <8>;
-       #sound-dai-cells = <0>;
        status = "okay";
 };
 
 &i2s1 {
        rockchip,playback-channels = <2>;
        rockchip,capture-channels = <2>;
-       #sound-dai-cells = <0>;
        status = "okay";
 };
 
 &i2s2 {
-       #sound-dai-cells = <0>;
        status = "okay";
 };
 
 
        bt656-supply = <&vcc1v8_dvp>;
        audio-supply = <&vcca1v8_codec>;
-       sdmmc-supply = <&vcc_sd>;
+       sdmmc-supply = <&vcc_sdio>;
        gpio1830-supply = <&vcc_3v0>;
 };
 
        ep-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
        num-lanes = <4>;
        pinctrl-names = "default";
-       pinctrl-0 = <&pcie_clkreqn>;
+       pinctrl-0 = <&pcie_clkreqn_cpm>;
        status = "okay";
 };
 
        };
 
        pcie {
-               pcie_drv: pcie-drv {
+               pcie_pwr_en: pcie-pwr-en {
                        rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
 
        };
 
        usb2 {
-               host_vbus_drv: host-vbus-drv {
+               vcc5v0_host_en: vcc5v0-host-en {
                        rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
+
+       wifi {
+               wifi_host_wake_l: wifi-host-wake-l {
+                       rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       leds {
+               work_led_gpio: work_led-gpio {
+                       rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               diy_led_gpio: diy_led-gpio {
+                       rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
 };
 
 &pwm0 {
 };
 
 &saradc {
-       vref-supply = <&vccadc_ref>;
+       vref-supply = <&vcca1v8_s3>;
        status = "okay";
 };
 
+&sdio0 {
+       /* WiFi & BT combo module Ampak AP6356S */
+       bus-width = <4>;
+       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;
+
+       /* Power supply */
+       vqmmc-supply = &vcc1v8_s3;      /* IO line */
+       vmmc-supply = &vcc_sdio;        /* card's power */
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+       status = "okay";
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
+               interrupt-names = "host-wake";
+               brcm,drive-strength = <5>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_host_wake_l>;
+       };
+};
+
 &sdmmc {
        bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
+       cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+       disable-wp;
+       max-frequency = <150000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
        status = "okay";
 };
 
 &sdhci {
        bus-width = <8>;
-       keep-power-in-suspend;
        mmc-hs400-1_8v;
        mmc-hs400-enhanced-strobe;
        non-removable;
        status = "okay";
 };
 
+&tcphy0 {
+       status = "okay";
+};
+
+&tcphy1 {
+       status = "okay";
+};
+
 &tsadc {
        /* tshut mode 0:CRU 1:GPIO */
        rockchip,hw-tshut-mode = <1>;
 &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 1ee0dc0d9f10ff9641f02bdad4aae75fc225d078..e6c1c94c8d69c5e4be895b4d91d7ec38c3c37f22 100644 (file)
                     "google,bob", "google,gru", "rockchip,rk3399";
 
        edp_panel: edp-panel {
-               compatible = "boe,nv101wxmn51", "simple-panel";
+               compatible = "boe,nv101wxmn51";
                backlight = <&backlight>;
                power-supply = <&pp3300_disp>;
 
-               ports {
+               port {
                        panel_in_edp: endpoint {
                                remote-endpoint = <&edp_out_panel>;
                        };
 
 &spi0 {
        status = "okay";
+
+       cr50@0 {
+               compatible = "google,cr50";
+               reg = <0>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <5 IRQ_TYPE_EDGE_RISING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&h1_int_od_l>;
+               spi-max-frequency = <800000>;
+       };
 };
 
 &pinctrl {
        tpm {
                h1_int_od_l: h1-int-od-l {
-                       rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
+                       rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
 };
index c6495adccae2b2f27662630864223085e871469a..1384dabbdf4067b38af92ccf017f6afc9c6fec11 100644 (file)
 
        backlight: backlight {
                compatible = "pwm-backlight";
-               brightness-levels = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
-                                    17 18 19 20 21 22 23 24 25 26 27 28 29 30
-                                    31 32 33 34 35 36 37 38 39 40 41 42 43 44
-                                    45 46 47 48 49 50 51 52 53 54 55 56 57 58
-                                    59 60 61 62 63 64 65 66 67 68 69 70 71 72
-                                    73 74 75 76 77 78 79 80 81 82 83 84 85 86
-                                    87 88 89 90 91 92 93 94 95 96 97 98 99 100>;
-               default-brightness-level = <51>;
                enable-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
                power-supply = <&pp3300_disp>;
                pinctrl-names = "default";
                pinctrl-0 = <&bl_en>;
                pwm-delay-us = <10000>;
        };
+
+       gpio_keys: gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&bt_host_wake_l>;
+
+               wake_on_bt: wake-on-bt {
+                       label = "Wake-on-Bluetooth";
+                       gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WAKEUP>;
+                       wakeup-source;
+               };
+       };
 };
 
 &ppvar_bigcpu {
 &edp {
        status = "okay";
 
-       rockchip,panel = <&edp_panel>;
        ports {
                edp_out: port@1 {
                        reg = <1>;
@@ -287,11 +291,9 @@ ap_i2c_tp: &i2c5 {
                #pwm-cells = <1>;
        };
 
-       usbc_extcon1: extcon@1 {
+       usbc_extcon1: extcon1 {
                compatible = "google,extcon-usbc-cros-ec";
                google,usb-port-id = <1>;
-
-               #extcon-cells = <0>;
        };
 };
 
@@ -361,27 +363,27 @@ ap_i2c_tp: &i2c5 {
 &pinctrl {
        discrete-regulators {
                pp1500_en: pp1500-en {
-                       rockchip,pins = <RK_GPIO0 10 RK_FUNC_GPIO
+                       rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO
                                         &pcfg_pull_none>;
                };
 
                pp1800_audio_en: pp1800-audio-en {
-                       rockchip,pins = <RK_GPIO0 2 RK_FUNC_GPIO
+                       rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO
                                         &pcfg_pull_down>;
                };
 
                pp3000_en: pp3000-en {
-                       rockchip,pins = <RK_GPIO0 12 RK_FUNC_GPIO
+                       rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO
                                         &pcfg_pull_none>;
                };
 
                pp3300_disp_en: pp3300-disp-en {
-                       rockchip,pins = <RK_GPIO4 27 RK_FUNC_GPIO
+                       rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO
                                         &pcfg_pull_none>;
                };
 
                wlan_module_pd_l: wlan-module-pd-l {
-                       rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO
+                       rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO
                                         &pcfg_pull_down>;
                };
        };
@@ -389,10 +391,10 @@ ap_i2c_tp: &i2c5 {
 
 &wifi {
        wifi_perst_l: wifi-perst-l {
-               rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
+               rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
        };
 
        wlan_host_wake_l: wlan-host-wake-l {
-               rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_none>;
+               rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
        };
 };
index 2cc7c47d6a85d79312a519dd0a0c02964f9223ff..2bbef9fcbe2704065b2999d0b113b4cf34b318a2 100644 (file)
        };
 
        edp_panel: edp-panel {
-               compatible = "sharp,lq123p1jx31", "simple-panel";
+               compatible = "sharp,lq123p1jx31";
                backlight = <&backlight>;
                power-supply = <&pp3300_disp>;
 
-               ports {
+               panel-timing {
+                       clock-frequency = <266666667>;
+                       hactive = <2400>;
+                       hfront-porch = <48>;
+                       hback-porch = <84>;
+                       hsync-len = <32>;
+                       hsync-active = <0>;
+                       vactive = <1600>;
+                       vfront-porch = <3>;
+                       vback-porch = <120>;
+                       vsync-len = <10>;
+                       vsync-active = <0>;
+               };
+
+               port {
                        panel_in_edp: endpoint {
                                remote-endpoint = <&edp_out_panel>;
                        };
                        map0 {
                                trip = <&ppvar_bigcpu_alert>;
                                cooling-device =
-                                       <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                                       <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu_l1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu_l2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu_l3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
                                contribution = <4096>;
                        };
                        map1 {
                                trip = <&ppvar_bigcpu_alert>;
                                cooling-device =
-                                       <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                                       <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
                                contribution = <1024>;
                        };
                };
@@ -286,24 +304,24 @@ ap_i2c_dig: &i2c2 {
        digitizer {
                /* Has external pullup */
                cpu1_dig_irq_l: cpu1-dig-irq-l {
-                       rockchip,pins = <2 4 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <2 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
                };
 
                /* Has external pullup */
                cpu1_dig_pdct_l: cpu1-dig-pdct-l {
-                       rockchip,pins = <2 5 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <2 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
        discrete-regulators {
                cpu3_pen_pwr_en: cpu3-pen-pwr-en {
-                       rockchip,pins = <4 30 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
        pen {
                cpu1_pen_eject: cpu1-pen-eject {
-                       rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_up>;
+                       rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
 };
index 0e2e0471808d5dc78c3857b8132314f99d9e3213..7ac88392f2c2ddf877007b0ff28c08def08c002b 100644 (file)
 
 / {
        chosen {
-               u-boot,dm-pre-reloc;
                stdout-path = "serial2:115200n8";
-               u-boot,spl-boot-order = &spi_flash;
-       };
-
-       config {
-               u-boot,spl-payload-offset = <0x40000>;
        };
 
        /*
        pp5000_usb_a_vbus: pp5000 {
        };
 
-       gpio_keys: gpio-keys {
-               compatible = "gpio-keys";
-               pinctrl-names = "default";
-               pinctrl-0 = <&bt_host_wake_l>;
-
-               wake_on_bt: wake-on-bt {
-                       label = "Wake-on-Bluetooth";
-                       gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_WAKEUP>;
-                       wakeup-source;
-               };
+       ap_rtc_clk: ap-rtc-clk {
+               compatible = "fixed-clock";
+               clock-frequency = <32768>;
+               clock-output-names = "xin32k";
+               #clock-cells = <0>;
        };
 
        max98357a: max98357a {
@@ -549,8 +537,7 @@ ap_i2c_audio: &i2c8 {
        pinctrl-names = "default", "sleep";
        pinctrl-1 = <&spi1_sleep>;
 
-       spi_flash: spiflash@0 {
-               u-boot,dm-pre-reloc;
+       spiflash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
 
@@ -565,16 +552,12 @@ ap_i2c_audio: &i2c8 {
 
 &spi5 {
        status = "okay";
-       spi-activate-delay = <100>;
-       spi-max-frequency = <3000000>;
-       spi-deactivate-delay = <200>;
 
        cros_ec: ec@0 {
                compatible = "google,cros-ec-spi";
                reg = <0>;
                interrupt-parent = <&gpio0>;
                interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
-               ec-interrupt = <&gpio0 1 GPIO_ACTIVE_LOW>;
                pinctrl-names = "default";
                pinctrl-0 = <&ec_ap_int_l>;
                spi-max-frequency = <3000000>;
@@ -586,11 +569,9 @@ ap_i2c_audio: &i2c8 {
                        #size-cells = <0>;
                };
 
-               usbc_extcon0: extcon@0 {
+               usbc_extcon0: extcon0 {
                        compatible = "google,extcon-usbc-cros-ec";
                        google,usb-port-id = <0>;
-
-                       #extcon-cells = <0>;
                };
        };
 };
@@ -692,29 +673,29 @@ ap_i2c_audio: &i2c8 {
 
        backlight-enable {
                bl_en: bl-en {
-                       rockchip,pins = <1 17 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
        cros-ec {
                ec_ap_int_l: ec-ap-int-l {
-                       rockchip,pins = <RK_GPIO0 1 RK_FUNC_GPIO &pcfg_pull_up>;
+                       rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
 
        discrete-regulators {
                sd_io_pwr_en: sd-io-pwr-en {
-                       rockchip,pins = <RK_GPIO2 2 RK_FUNC_GPIO
+                       rockchip,pins = <2 RK_PA2 RK_FUNC_GPIO
                                         &pcfg_pull_none>;
                };
 
                sd_pwr_1800_sel: sd-pwr-1800-sel {
-                       rockchip,pins = <RK_GPIO2 28 RK_FUNC_GPIO
+                       rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO
                                         &pcfg_pull_none>;
                };
 
                sd_slot_pwr_en: sd-slot-pwr-en {
-                       rockchip,pins = <RK_GPIO4 29 RK_FUNC_GPIO
+                       rockchip,pins = <4 RK_PD5 RK_FUNC_GPIO
                                         &pcfg_pull_none>;
                };
        };
@@ -722,17 +703,17 @@ ap_i2c_audio: &i2c8 {
        codec {
                /* Has external pullup */
                headset_int_l: headset-int-l {
-                       rockchip,pins = <1 23 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
                };
 
                mic_int: mic-int {
-                       rockchip,pins = <1 13 RK_FUNC_GPIO &pcfg_pull_down>;
+                       rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_down>;
                };
        };
 
        max98357a {
                sdmode_en: sdmode-en {
-                       rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_down>;
+                       rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_down>;
                };
        };
 
@@ -743,7 +724,7 @@ ap_i2c_audio: &i2c8 {
                         * to hack this as gpio, so the EP could be able to
                         * de-assert it along and make ClockPM(CPM) work.
                         */
-                       rockchip,pins = <2 26 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
@@ -754,20 +735,20 @@ ap_i2c_audio: &i2c8 {
                 */
                sdmmc_bus4: sdmmc-bus4 {
                        rockchip,pins =
-                               <4 8 RK_FUNC_1 &pcfg_pull_none_8ma>,
-                               <4 9 RK_FUNC_1 &pcfg_pull_none_8ma>,
-                               <4 10 RK_FUNC_1 &pcfg_pull_none_8ma>,
-                               <4 11 RK_FUNC_1 &pcfg_pull_none_8ma>;
+                               <4 RK_PB0 1 &pcfg_pull_none_8ma>,
+                               <4 RK_PB1 1 &pcfg_pull_none_8ma>,
+                               <4 RK_PB2 1 &pcfg_pull_none_8ma>,
+                               <4 RK_PB3 1 &pcfg_pull_none_8ma>;
                };
 
                sdmmc_clk: sdmmc-clk {
                        rockchip,pins =
-                               <4 12 RK_FUNC_1 &pcfg_pull_none_8ma>;
+                               <4 RK_PB4 1 &pcfg_pull_none_8ma>;
                };
 
                sdmmc_cmd: sdmmc-cmd {
                        rockchip,pins =
-                               <4 13 RK_FUNC_1 &pcfg_pull_none_8ma>;
+                               <4 RK_PB5 1 &pcfg_pull_none_8ma>;
                };
 
                /*
@@ -781,12 +762,12 @@ ap_i2c_audio: &i2c8 {
                 */
                sdmmc_cd: sdmmc-cd {
                        rockchip,pins =
-                               <0 7 RK_FUNC_1 &pcfg_pull_none>;
+                               <0 RK_PA7 1 &pcfg_pull_none>;
                };
 
                /* This is where we actually hook up CD; has external pull */
                sdmmc_cd_gpio: sdmmc-cd-gpio {
-                       rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
@@ -796,47 +777,47 @@ ap_i2c_audio: &i2c8 {
                         * Pull down SPI1 CLK/CS/RX/TX during suspend, to
                         * prevent leakage.
                         */
-                       rockchip,pins = <1 9 RK_FUNC_GPIO &pcfg_pull_down>,
-                                       <1 10 RK_FUNC_GPIO &pcfg_pull_down>,
-                                       <1 7 RK_FUNC_GPIO &pcfg_pull_down>,
-                                       <1 8 RK_FUNC_GPIO &pcfg_pull_down>;
+                       rockchip,pins = <1 RK_PB1 RK_FUNC_GPIO &pcfg_pull_down>,
+                                       <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_down>,
+                                       <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_down>,
+                                       <1 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>;
                };
        };
 
        touchscreen {
                touch_int_l: touch-int-l {
-                       rockchip,pins = <3 13 RK_FUNC_GPIO &pcfg_pull_up>;
+                       rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
                };
 
                touch_reset_l: touch-reset-l {
-                       rockchip,pins = <4 26 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
        trackpad {
                ap_i2c_tp_pu_en: ap-i2c-tp-pu-en {
-                       rockchip,pins = <3 12 RK_FUNC_GPIO &pcfg_output_high>;
+                       rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_output_high>;
                };
 
                trackpad_int_l: trackpad-int-l {
-                       rockchip,pins = <1 4 RK_FUNC_GPIO &pcfg_pull_up>;
+                       rockchip,pins = <1 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
 
        wifi: wifi {
                wlan_module_reset_l: wlan-module-reset-l {
-                       rockchip,pins = <1 11 RK_FUNC_GPIO &pcfg_pull_none>;
+                       rockchip,pins = <1 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
                };
 
                bt_host_wake_l: bt-host-wake-l {
                        /* Kevin has an external pull up, but Gru does not */
-                       rockchip,pins = <0 3 RK_FUNC_GPIO &pcfg_pull_up>;
+                       rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
 
        write-protect {
                ap_fw_wp: ap-fw-wp {
-                       rockchip,pins = <1 18 RK_FUNC_GPIO &pcfg_pull_up>;
+                       rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
 };
index 4944d78a0a1cbb44013e261c275de6074d5d836d..e87a04477440e29d2adbb144e66b1cbd48a38aed 100644 (file)
        sd-uhs-sdr104;
        vqmmc-supply = <&vcc1v8_s3>;
        vmmc-supply = <&vccio_sd>;
+       #address-cells = <1>;
+       #size-cells = <0>;
        status = "okay";
 
        brcmf: wifi@1 {
+               reg = <1>;
                compatible = "brcm,bcm4329-fmac";
                interrupt-parent = <&gpio0>;
                interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
index 32baa57b94819912d8ac554eed9eac9e0789162a..73be38a537960ed9d551a453e81d26c7d2c89126 100644 (file)
                regulator-max-microvolt = <5000000>;
        };
 
-       vcc5v0_sys: vcc5v0-sys {
+       vcc3v3_lan: vcc3v3-lan {
                compatible = "regulator-fixed";
-               regulator-name = "vcc5v0_sys";
+               regulator-name = "vcc3v3_lan";
                regulator-always-on;
                regulator-boot-on;
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               vin-supply = <&dc5v_adp>;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vim-supply = <&vcc3v3_sys>;
        };
 
        vcc3v3_sys: vcc3v3-sys {
                vin-supply = <&vcc5v0_sys>;
        };
 
-       vcc3v3_lan: vcc3v3-lan {
+       vcc5v0_sys: vcc5v0-sys {
                compatible = "regulator-fixed";
-               regulator-name = "vcc3v3_lan";
+               regulator-name = "vcc5v0_sys";
                regulator-always-on;
                regulator-boot-on;
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-               vim-supply = <&vcc3v3_sys>;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc5v_adp>;
        };
 
        vdd_log: vdd-log {
        };
 };
 
+&sdhci {
+       bus-width = <8>;
+       mmc-hs400-1_8v;
+       mmc-hs400-enhanced-strobe;
+       non-removable;
+       status = "okay";
+};
+
 &sdmmc {
        bus-width = <4>;
        cap-mmc-highspeed;
        status = "okay";
 };
 
-&sdhci {
-       bus-width = <8>;
-       mmc-hs400-1_8v;
-       mmc-hs400-enhanced-strobe;
-       non-removable;
-       status = "okay";
-};
-
 &tcphy0 {
        status = "okay";
 };
index 84433cf02be98c75d5e6d378cac6dc5860a614f5..e0d75617bb7e2b9d25656d762bee8902d2ac8f32 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&ir_rx>;
        };
+
+       fan: pwm-fan {
+               compatible = "pwm-fan";
+               /*
+                * With 20KHz PWM and an EVERCOOL EC4007H12SA fan, these levels
+                * work out to 0, ~1200, ~3000, and 5000RPM respectively.
+                */
+               cooling-levels = <0 12 18 255>;
+               #cooling-cells = <2>;
+               fan-supply = <&vcc12v0_sys>;
+               pwms = <&pwm1 0 50000 0>;
+       };
+};
+
+&cpu_thermal {
+       trips {
+               cpu_warm: cpu_warm {
+                       temperature = <55000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+
+               cpu_hot: cpu_hot {
+                       temperature = <65000>;
+                       hysteresis = <2000>;
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               map2 {
+                       trip = <&cpu_warm>;
+                       cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+               };
+
+               map3 {
+                       trip = <&cpu_hot>;
+                       cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
+&pcie0 {
+       num-lanes = <4>;
+       vpcie3v3-supply = <&vcc3v3_sys>;
 };
 
 &pinctrl {
        ir {
                ir_rx: ir-rx {
                        /* external pullup to VCC3V3_SYS, despite being 1.8V :/ */
-                       rockchip,pins = <0 RK_PA6 RK_FUNC_1 &pcfg_pull_none>;
+                       rockchip,pins = <0 RK_PA6 1 &pcfg_pull_none>;
                };
        };
 };
diff --git a/arch/arm/dts/rk3399-nanopi-m4-2gb-u-boot.dtsi b/arch/arm/dts/rk3399-nanopi-m4-2gb-u-boot.dtsi
new file mode 100644 (file)
index 0000000..a2f9786
--- /dev/null
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+ * Copyright (C) 2020 Deepak Das <deepakdas.linux@gmail.com>
+ */
+
+#include "rk3399-nanopi4-u-boot.dtsi"
+#include "rk3399-sdram-ddr3-1866.dtsi"
diff --git a/arch/arm/dts/rk3399-nanopi-m4-2gb.dts b/arch/arm/dts/rk3399-nanopi-m4-2gb.dts
new file mode 100644 (file)
index 0000000..60358ab
--- /dev/null
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * FriendlyElec NanoPi M4 board device tree source
+ *
+ * Copyright (c) 2018 FriendlyElec Computer Tech. Co., Ltd.
+ * (http://www.friendlyarm.com)
+ *
+ * Copyright (c) 2018 Collabora Ltd.
+ * Copyright (c) 2019 Arm Ltd.
+ */
+
+/dts-v1/;
+#include "rk3399-nanopi4.dtsi"
+
+/ {
+       model = "FriendlyElec NanoPi M4";
+       compatible = "friendlyarm,nanopi-m4", "rockchip,rk3399";
+
+       vdd_5v: vdd-5v {
+               compatible = "regulator-fixed";
+               regulator-name = "vdd_5v";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       vcc5v0_core: vcc5v0-core {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_core";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vdd_5v>;
+       };
+
+       vcc5v0_usb1: vcc5v0-usb1 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_usb1";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc5v0_sys>;
+       };
+
+       vcc5v0_usb2: vcc5v0-usb2 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_usb2";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc5v0_sys>;
+       };
+};
+
+&vcc3v3_sys {
+       vin-supply = <&vcc5v0_core>;
+};
+
+&u2phy0_host {
+       phy-supply = <&vcc5v0_usb1>;
+};
+
+&u2phy1_host {
+       phy-supply = <&vcc5v0_usb2>;
+};
+
+&vbus_typec {
+       regulator-always-on;
+       vin-supply = <&vdd_5v>;
+};
index d325e117287ba38d5c2b6a6e731fbce7bf11543c..c88018a0ef35dbd148db089da3e9790d3f5f3572 100644 (file)
@@ -48,7 +48,7 @@
        };
 
        /* switched by pmic_sleep */
-       vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
+       vcc1v8_s3: vcc1v8-s3 {
                compatible = "regulator-fixed";
                regulator-always-on;
                regulator-boot-on;
                vin-supply = <&vcc3v3_sys>;
        };
 
+       /*
+        * Really, this is supplied by vcc_1v8, and vcc1v8_s3 only
+        * drives the enable pin, but we can't quite model that.
+        */
+       vcca0v9_s3: vcca0v9-s3 {
+               compatible = "regulator-fixed";
+               regulator-min-microvolt = <900000>;
+               regulator-max-microvolt = <900000>;
+               regulator-name = "vcca0v9_s3";
+               vin-supply = <&vcc1v8_s3>;
+       };
+
+       /* As above, actually supplied by vcc3v3_sys */
+       vcca1v8_s3: vcca1v8-s3 {
+               compatible = "regulator-fixed";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-name = "vcca1v8_s3";
+               vin-supply = <&vcc1v8_s3>;
+       };
+
        vbus_typec: vbus-typec {
                compatible = "regulator-fixed";
                regulator-min-microvolt = <5000000>;
        assigned-clocks = <&cru SCLK_RMII_SRC>;
        clock_in_out = "input";
        pinctrl-names = "default";
-       pinctrl-0 = <&rgmii_pins>;
+       pinctrl-0 = <&rgmii_pins>, <&phy_intb>, <&phy_rstb>;
+       phy-handle = <&rtl8211e>;
        phy-mode = "rgmii";
        phy-supply = <&vcc3v3_s3>;
-       snps,reset-active-low;
-       snps,reset-delays-us = <0 10000 50000>;
-       snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
        tx_delay = <0x28>;
        rx_delay = <0x11>;
        status = "okay";
+
+       mdio {
+               compatible = "snps,dwmac-mdio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               rtl8211e: phy@1 {
+                       reg = <1>;
+                       interrupt-parent = <&gpio3>;
+                       interrupts = <RK_PB2 IRQ_TYPE_LEVEL_LOW>;
+                       reset-assert-us = <10000>;
+                       reset-deassert-us = <30000>;
+                       reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+               };
+       };
 };
 
 &gpu {
        status = "okay";
 };
 
+&hdmi_sound {
+       status = "okay";
+};
+
 &i2c0 {
        clock-frequency = <400000>;
        i2c-scl-rising-time-ns = <160>;
        status = "okay";
 };
 
+&i2s2 {
+       status = "okay";
+};
+
 &io_domains {
        bt656-supply = <&vcc_1v8>;
        audio-supply = <&vcca1v8_codec>;
 &pcie0 {
        ep-gpios = <&gpio2 RK_PA4 GPIO_ACTIVE_HIGH>;
        max-link-speed = <2>;
-       num-lanes = <4>;
+       num-lanes = <2>;
+       vpcie0v9-supply = <&vcca0v9_s3>;
+       vpcie1v8-supply = <&vcca1v8_s3>;
        status = "okay";
 };
 
                };
        };
 
+       phy {
+               phy_intb: phy-intb {
+                       rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+
+               phy_rstb: phy-rstb {
+                       rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        pmic {
                cpu_b_sleep: cpu-b-sleep {
                        rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
index cf37b96a6b77ebab29939d19ad7677722f0594ab..f9f7246d4d2f3b3b7ba697e33f354a06ba8ff512 100644 (file)
                vin-supply = <&vcc_sys>;
        };
 
-       vcc5v0_typec0: vcc5v0-typec0-regulator {
+       vbus_typec: vbus-typec-regulator {
                compatible = "regulator-fixed";
                enable-active-high;
                gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
-               pinctrl-0 = <&vcc5v0_typec0_en>;
-               regulator-name = "vcc5v0_typec0";
+               pinctrl-0 = <&vcc5v0_typec_en>;
+               regulator-name = "vbus_typec";
                vin-supply = <&vcc_sys>;
        };
 
        clock_in_out = "input";
        phy-supply = <&vcc3v3_s3>;
        phy-mode = "rgmii";
+       phy-handle = <&rtl8211e>;
        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>;
+       pinctrl-0 = <&rgmii_pins>, <&phy_intb>, <&phy_rstb>;
        tx_delay = <0x28>;
        rx_delay = <0x11>;
        status = "okay";
+
+       mdio {
+               compatible = "snps,dwmac-mdio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               rtl8211e: phy@1 {
+                       reg = <1>;
+                       interrupt-parent = <&gpio3>;
+                       interrupts = <RK_PB2 IRQ_TYPE_LEVEL_LOW>;
+                       reset-assert-us = <10000>;
+                       reset-deassert-us = <30000>;
+                       reset-gpios = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+               };
+       };
 };
 
 &gpu {
                compatible = "silergy,syr827";
                reg = <0x40>;
                fcs,suspend-voltage-selector = <1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&cpu_b_sleep>;
                regulator-name = "vdd_cpu_b";
                regulator-min-microvolt = <712500>;
                regulator-max-microvolt = <1500000>;
                compatible = "silergy,syr828";
                reg = <0x41>;
                fcs,suspend-voltage-selector = <1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&gpu_sleep>;
                regulator-name = "vdd_gpu";
                regulator-min-microvolt = <712500>;
                regulator-max-microvolt = <1500000>;
                compatible = "asahi-kasei,ak09911";
                reg = <0x0c>;
                vdd-supply = <&vcc3v3_s3>;
+               vid-supply = <&vcc3v3_s3>;
        };
 
        mpu6500@68 {
                pinctrl-0 = <&light_int_l>;
                vdd-supply = <&vcc3v3_s3>;
        };
+
+       fusb302@22 {
+               compatible = "fcs,fusb302";
+               reg = <0x22>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&chg_cc_int_l>;
+               vbus-supply = <&vbus_typec>;
+       };
 };
 
 &io_domains {
                };
        };
 
+       phy {
+               phy_intb: phy-intb {
+                       rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+
+               phy_rstb: phy-rstb {
+                       rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        pmic {
+               cpu_b_sleep: cpu-b-sleep {
+                       rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+
+               gpu_sleep: gpu-sleep {
+                       rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+
                pmic_int_l: pmic-int-l {
                        rockchip,pins =
                                <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
        sd {
                sdmmc0_pwr_h: sdmmc0-pwr-h {
                        rockchip,pins =
-                               <RK_GPIO0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
+                               <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
                                <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
 
-               vcc5v0_typec0_en: vcc5v0-typec0-en {
+               vcc5v0_typec_en: vcc5v0-typec-en {
                        rockchip,pins =
                                <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
                };
                        rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
+
+       fusb302 {
+               chg_cc_int_l: chg-cc-int-l {
+                       rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
 };
 
 &pwm0 {
        pinctrl-names = "default";
        pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
        sd-uhs-sdr104;
+       #address-cells = <1>;
+       #size-cells = <0>;
        status = "okay";
 
        brcmf: wifi@1 {
+               reg = <1>;
                compatible = "brcm,bcm4329-fmac";
                interrupt-parent = <&gpio0>;
                interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
        status = "okay";
 
        u2phy0_otg: otg-port {
-               phy-supply = <&vcc5v0_typec0>;
+               phy-supply = <&vbus_typec>;
                status = "okay";
        };
 
        bluetooth {
                compatible = "brcm,bcm43438-bt";
                clocks = <&rk808 1>;
-               clock-names = "ext_clock";
+               clock-names = "lpo";
                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>;
+               vbat-supply = <&vcc3v3_sys>;
+               vddio-supply = <&vcc_1v8>;
        };
 };
 
index 52f62b5d39ed2399718a0e91f5fc51fd1d8cb2d2..3ad113983323f3875741985a549516c434e6112e 100644 (file)
@@ -13,7 +13,7 @@
        chosen {
                stdout-path = "serial0:115200n8";
                u-boot,spl-boot-order = \
-                       "same-as-spl", &spiflash, &sdhci, &sdmmc;
+                       "same-as-spl", &norflash, &sdhci, &sdmmc;
        };
 
        aliases {
                spi1 = &spi5;
        };
 
+       /*
+        * The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module
+        * eMMC and SPI flash powered-down initially (in fact it keeps the
+        * reset signal asserted).  Even though it is an enable signal, we
+        * model this as a regulator.
+        */
+       bios_enable: bios_enable {
+               compatible = "regulator-fixed";
+               u-boot,dm-pre-reloc;
+               regulator-name = "bios_enable";
+               enable-active-high;
+               gpio = <&gpio3 RK_PD5 GPIO_ACTIVE_LOW>;
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+};
+
+&gpio1 {
+       u-boot,dm-pre-reloc;
+};
+
+&gpio3 {
+       u-boot,dm-pre-reloc;
+};
+
+&norflash {
+       u-boot,dm-pre-reloc;
 };
index 558b6337dfeca20d89c65d27b8b2cb5c84a2f463..07694b196fdbedcfb9f0171ebb52fd598589f5cc 100644 (file)
@@ -1,30 +1,74 @@
-// SPDX-License-Identifier: GPL-2.0+ OR X11
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
+ * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
  */
 
 #include <dt-bindings/pwm/pwm.h>
 #include "rk3399.dtsi"
+#include "rk3399-opp.dtsi"
 
 / {
-       model = "Theobroma Systems RK3399-Q7 SoM";
-       compatible = "tsd,rk3399-q7", "tsd,puma", "rockchip,rk3399";
-
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
-               pinctrl-0 = <&leds_pins_puma>;
+               pinctrl-0 = <&led_pin_module>;
 
-               module_led {
+               module-led {
                        label = "module_led";
                        gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "heartbeat";
+                       panic-indicator;
                };
+       };
 
-               sd_card_led {
-                       label = "sd_card_led";
-                       gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
-                       linux,default-trigger = "mmc0";
+       /*
+        * Overwrite the opp-table for CPUB as this board uses a different
+        * regulator (FAN53555) that only allows 10mV steps and therefore
+        * can't reach the operation point target voltages from rk3399-opp.dtsi
+        */
+       /delete-node/ opp-table1;
+       cluster1_opp: opp-table1 {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp00 {
+                       opp-hz = /bits/ 64 <408000000>;
+                       opp-microvolt = <800000>;
+                       clock-latency-ns = <40000>;
+               };
+               opp01 {
+                       opp-hz = /bits/ 64 <600000000>;
+                       opp-microvolt = <800000>;
+               };
+               opp02 {
+                       opp-hz = /bits/ 64 <816000000>;
+                       opp-microvolt = <830000>;
+                       opp-suspend;
+               };
+               opp03 {
+                       opp-hz = /bits/ 64 <1008000000>;
+                       opp-microvolt = <880000>;
+               };
+               opp04 {
+                       opp-hz = /bits/ 64 <1200000000>;
+                       opp-microvolt = <950000>;
+               };
+               opp05 {
+                       opp-hz = /bits/ 64 <1416000000>;
+                       opp-microvolt = <1030000>;
+               };
+               opp06 {
+                       opp-hz = /bits/ 64 <1608000000>;
+                       opp-microvolt = <1100000>;
+               };
+               opp07 {
+                       opp-hz = /bits/ 64 <1800000000>;
+                       opp-microvolt = <1200000>;
+               };
+               opp08 {
+                       opp-hz = /bits/ 64 <1992000000>;
+                       opp-microvolt = <1230000>;
+                       turbo-mode;
                };
        };
 
                #clock-cells = <0>;
        };
 
-       dw_hdmi_audio: dw-hdmi-audio {
-               status = "enabled";
-               compatible = "rockchip,dw-hdmi-audio";
-               #sound-dai-cells = <0>;
-       };
-
-       hdmi_codec: hdmi-codec {
-               compatible = "simple-audio-card";
-               simple-audio-card,format = "i2s";
-               simple-audio-card,mclk-fs = <256>;
-               simple-audio-card,name = "HDMI-CODEC";
-
-               simple-audio-card,cpu {
-                       sound-dai = <&i2s2>;
-               };
-
-               simple-audio-card,codec {
-                       sound-dai = <&hdmi>;
-               };
-       };
-
-       hdmi_sound: hdmi-sound {
-               status = "disabled";
-               compatible = "simple-audio-card";
-               simple-audio-card,format = "i2s";
-               simple-audio-card,mclk-fs = <256>;
-               simple-audio-card,name = "rockchip,hdmi";
-
-               simple-audio-card,cpu {
-                       sound-dai = <&i2s2>;
-               };
-               simple-audio-card,codec {
-                       sound-dai = <&hdmi>;
-               };
-       };
-
-       usbhub_enable: usbhub_enable {
-               compatible = "regulator-fixed";
-               regulator-name = "usbhub_enable";
-               enable-active-low;
-               gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&host_vbus_drv>;
-               regulator-boot-on;
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-       };
-
-       /*
-        * The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module
-        * eMMC and SPI flash powered-down initially (in fact it keeps the
-        * reset signal asserted).  Even though it is an enable signal, we
-        * model this as a regulator.
-        */
-       bios_enable: bios_enable {
-               compatible = "regulator-fixed";
-               u-boot,dm-pre-reloc;
-               regulator-name = "bios_enable";
-               enable-active-high;
-               gpio = <&gpio3 RK_PD5 GPIO_ACTIVE_LOW>;
-               regulator-always-on;
-               regulator-boot-on;
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
-       };
-
-       vccadc_ref: vccadc-ref {
+       vcc1v2_phy: vcc1v2-phy {
                compatible = "regulator-fixed";
-               regulator-name = "vcc1v8_sys";
+               regulator-name = "vcc1v2_phy";
                regulator-always-on;
                regulator-boot-on;
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
+               regulator-min-microvolt = <1200000>;
+               regulator-max-microvolt = <1200000>;
+               vin-supply = <&vcc5v0_sys>;
        };
 
        vcc3v3_sys: vcc3v3-sys {
                regulator-boot-on;
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc5v0_sys>;
        };
 
-       vcc5v0_otg: vcc5v0-otg-regulator {
+       vcc5v0_host: vcc5v0-host-regulator {
                compatible = "regulator-fixed";
-               enable-active-high;
-               gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
+               gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
+               enable-active-low;
                pinctrl-names = "default";
-               pinctrl-0 = <&otg_vbus_drv>;
-               regulator-name = "vcc5v0_otg";
+               pinctrl-0 = <&vcc5v0_host_en>;
+               regulator-name = "vcc5v0_host";
                regulator-always-on;
+               vin-supply = <&vcc5v0_sys>;
        };
 
        vcc5v0_sys: vcc5v0-sys {
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
        };
+};
 
-       vcc_phy: vcc-phy-regulator {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc_phy";
-               regulator-always-on;
-               regulator-boot-on;
-       };
+&cpu_b0 {
+       cpu-supply = <&vdd_cpu_b>;
+};
 
-       vdd_log: vdd-log {
-               compatible = "pwm-regulator";
-               pwms = <&pwm2 0 25000 1>;
-               regulator-name = "vdd_log";
-               regulator-min-microvolt = <800000>;
-               regulator-max-microvolt = <1400000>;
-               regulator-always-on;
-               regulator-boot-on;
-               regulator-init-microvolt = <950000>;
-       };
+&cpu_b1 {
+       cpu-supply = <&vdd_cpu_b>;
+};
+
+&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>;
 };
 
 &emmc_phy {
        status = "okay";
+       drive-impedance-ohm = <33>;
 };
 
 &gmac {
-       phy-supply = <&vcc_phy>;
-       phy-mode = "rgmii";
-       clock_in_out = "input";
-       snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>;
-       snps,reset-active-low;
-       snps,reset-delays-us = <2 10000 50000>;
        assigned-clocks = <&cru SCLK_RMII_SRC>;
        assigned-clock-parents = <&clkin_gmac>;
+       clock_in_out = "input";
+       phy-supply = <&vcc1v2_phy>;
+       phy-mode = "rgmii";
        pinctrl-names = "default";
        pinctrl-0 = <&rgmii_pins>;
+       snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 10000 50000>;
        tx_delay = <0x10>;
        rx_delay = <0x10>;
        status = "okay";
 };
 
-&hdmi {
-       #sound-dai-cells = <0>;
+&gpu {
+       mali-supply = <&vdd_gpu>;
        status = "okay";
 };
 
        i2c-scl-falling-time-ns = <4>;
        clock-frequency = <400000>;
 
-       vdd_gpu: vdd_gpu {
-               status = "okay";
-               compatible = "fcs,fan53555";
-               reg = <0x60>;
-               vsel-gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>;
-               vin-supply = <&vcc5v0_sys>;
-               regulator-compatible = "fan53555-reg";
-               regulator-name = "vdd_gpu";
-               regulator-min-microvolt = <600000>;
-               regulator-max-microvolt = <1230000>;
-               regulator-ramp-delay = <1000>;
-               fcs,suspend-voltage-selector = <1>;
-               regulator-always-on;
-               regulator-boot-on;
-               regulator-initial-state = <3>;
-                       regulator-state-mem {
-                       regulator-off-in-suspend;
-               };
-       };
-
        rk808: pmic@1b {
                compatible = "rockchip,rk808";
                reg = <0x1b>;
                interrupt-parent = <&gpio1>;
-               interrupts = <22 IRQ_TYPE_LEVEL_LOW>;  // TODO check interrupt?
+               interrupts = <22 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;
-               #clock-cells = <1>;
-               clock-output-names = "xin32k", "rk808-clkout2";
 
                vcc1-supply = <&vcc5v0_sys>;
                vcc2-supply = <&vcc5v0_sys>;
 
                regulators {
                        vdd_center: DCDC_REG1 {
-                               regulator-always-on;
-                               regulator-boot-on;
+                               regulator-name = "vdd_center";
                                regulator-min-microvolt = <750000>;
                                regulator-max-microvolt = <1350000>;
                                regulator-ramp-delay = <6001>;
-                               regulator-name = "vdd_center";
+                               regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
 
                        vdd_cpu_l: DCDC_REG2 {
-                               regulator-always-on;
-                               regulator-boot-on;
+                               regulator-name = "vdd_cpu_l";
                                regulator-min-microvolt = <750000>;
                                regulator-max-microvolt = <1350000>;
                                regulator-ramp-delay = <6001>;
-                               regulator-name = "vdd_cpu_l";
+                               regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
 
                        vcc_ddr: DCDC_REG3 {
+                               regulator-name = "vcc_ddr";
                                regulator-always-on;
                                regulator-boot-on;
-                               regulator-name = "vcc_ddr";
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                };
                        };
 
                        vcc_1v8: DCDC_REG4 {
-                               regulator-always-on;
-                               regulator-boot-on;
+                               regulator-name = "vcc_1v8";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               regulator-name = "vcc_1v8";
+                               regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                        regulator-suspend-microvolt = <1800000>;
                        };
 
                        vcc_ldo1: LDO_REG1 {
-                               regulator-boot-on;
+                               regulator-name = "vcc_ldo1";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               regulator-name = "vcc_ldo1";
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
 
                        vcc1v8_hdmi: LDO_REG2 {
-                               regulator-always-on;
-                               regulator-boot-on;
+                               regulator-name = "vcc1v8_hdmi";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               regulator-name = "vcc1v8_hdmi";
+                               regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
 
                        vcc1v8_pmu: LDO_REG3 {
-                               regulator-always-on;
-                               regulator-boot-on;
+                               regulator-name = "vcc1v8_pmu";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               regulator-name = "vcc1v8_pmu";
+                               regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                        regulator-suspend-microvolt = <1800000>;
                        };
 
                        vcc_sd: LDO_REG4 {
-                               regulator-always-on;
-                               regulator-boot-on;
+                               regulator-name = "vcc_sd";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <3000000>;
-                               regulator-name = "vcc_sd";
+                               regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                        regulator-suspend-microvolt = <3000000>;
                        };
 
                        vcc_ldo5: LDO_REG5 {
-                               regulator-boot-on;
+                               regulator-name = "vcc_ldo5";
                                regulator-min-microvolt = <3000000>;
                                regulator-max-microvolt = <3000000>;
-                               regulator-name = "vcc_ldo5";
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
 
                        vcc_ldo6: LDO_REG6 {
-                               regulator-boot-on;
+                               regulator-name = "vcc_ldo6";
                                regulator-min-microvolt = <1500000>;
                                regulator-max-microvolt = <1500000>;
-                               regulator-name = "vcc_ldo6";
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
 
                        vcc0v9_hdmi: LDO_REG7 {
-                               regulator-always-on;
-                               regulator-boot-on;
+                               regulator-name = "vcc0v9_hdmi";
                                regulator-min-microvolt = <900000>;
                                regulator-max-microvolt = <900000>;
-                               regulator-name = "vcc0v9_hdmi";
+                               regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
 
                        vcc_efuse: LDO_REG8 {
-                               regulator-always-on;
-                               regulator-boot-on;
+                               regulator-name = "vcc_efuse";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               regulator-name = "vcc_efuse";
+                               regulator-always-on;
+                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
 
                        vcc3v3_s3: SWITCH_REG1 {
+                               regulator-name = "vcc3v3_s3";
                                regulator-always-on;
                                regulator-boot-on;
-                               regulator-name = "vcc3v3_s3";
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
 
                        vcc3v3_s0: SWITCH_REG2 {
+                               regulator-name = "vcc3v3_s0";
                                regulator-always-on;
                                regulator-boot-on;
-                               regulator-name = "vcc3v3_s0";
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                        };
                };
        };
+
+       vdd_gpu: regulator@60 {
+               compatible = "fcs,fan53555";
+               reg = <0x60>;
+               fcs,suspend-voltage-selector = <1>;
+               regulator-name = "vdd_gpu";
+               regulator-min-microvolt = <600000>;
+               regulator-max-microvolt = <1230000>;
+               regulator-ramp-delay = <1000>;
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc5v0_sys>;
+       };
+};
+
+&i2c7 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       fan: fan@18 {
+               compatible = "ti,amc6821";
+               reg = <0x18>;
+               #cooling-cells = <2>;
+       };
+
+       rtc_twi: rtc@6f {
+               compatible = "isil,isl1208";
+               reg = <0x6f>;
+       };
 };
 
 &i2c8 {
        status = "okay";
        clock-frequency = <400000>;
 
-       vdd_cpu_b: vdd_cpu_b {
-               status = "okay";
+       vdd_cpu_b: regulator@60 {
                compatible = "fcs,fan53555";
                reg = <0x60>;
-               vsel-gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_HIGH>;
                vin-supply = <&vcc5v0_sys>;
-               regulator-compatible = "fan53555-reg";
                regulator-name = "vdd_cpu_b";
                regulator-min-microvolt = <600000>;
                regulator-max-microvolt = <1230000>;
                fcs,suspend-voltage-selector = <1>;
                regulator-always-on;
                regulator-boot-on;
-               regulator-initial-state = <3>;
-                       regulator-state-mem {
-                       regulator-off-in-suspend;
-               };
        };
 };
 
 &i2s0 {
+       pinctrl-0 = <&i2s0_2ch_bus>;
+       rockchip,playback-channels = <2>;
+       rockchip,capture-channels = <2>;
        status = "okay";
-       rockchip,i2s-broken-burst-len;
-       rockchip,playback-channels = <8>;
-       rockchip,capture-channels = <8>;
-       #sound-dai-cells = <0>;
 };
 
-&i2s2 {
-       #sound-dai-cells = <0>;
-       status = "okay";
+/*
+ * As Q7 does not specify neither a global nor a RX clock for I2S these
+ * signals are not used. Furthermore I2S0_LRCK_RX is used as GPIO.
+ * Therefore we have to redefine the i2s0_2ch_bus definition to prevent
+ * conflicts.
+ */
+&i2s0_2ch_bus {
+       rockchip,pins =
+               <3 RK_PD0 1 &pcfg_pull_none>,
+               <3 RK_PD2 1 &pcfg_pull_none>,
+               <3 RK_PD3 1 &pcfg_pull_none>,
+               <3 RK_PD7 1 &pcfg_pull_none>;
 };
 
 &io_domains {
        status = "okay";
-
-       bt656-supply = <&vcc_1v8>;      /* bt656_gpio2ab_ms */
-       audio-supply = <&vcc_1v8>;      /* audio_gpio3d4a_ms */
-       sdmmc-supply = <&vcc_sd>;       /* sdmmc_gpio4b_ms */
-       gpio1830-supply = <&vcc_1v8>;   /* gpio1833_gpio4cd_ms */
-};
-
-&pcie0 {
-       assigned-clocks = <&cru SCLK_PCIEPHY_REF>;
-       assigned-clock-parents = <&cru SCLK_PCIEPHY_REF100M>;
-       assigned-clock-rates = <100000000>;
-       ep-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
-       num-lanes = <4>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&pcie_clkreqn>;
-       status = "okay";
-};
-
-&pcie_phy {
-               status = "okay";
+       bt656-supply = <&vcc_1v8>;
+       audio-supply = <&vcc_1v8>;
+       sdmmc-supply = <&vcc_sd>;
+       gpio1830-supply = <&vcc_1v8>;
 };
 
 &pmu_io_domains {
        pmu1830-supply = <&vcc_1v8>;
 };
 
-&pwm0 {
-       status = "okay";
-};
-
 &pwm2 {
        status = "okay";
 };
 
-&sdhci {
-       bus-width = <8>;
-       mmc-hs400-1_8v;
-       supports-emmc;
-       non-removable;
-       keep-power-in-suspend;
-       mmc-hs400-enhanced-strobe;
-       status = "okay";
-};
-
-&sdmmc {
-       clock-frequency = <150000000>;
-       max-frequency = <40000000>;
-       supports-sd;
-       bus-width = <4>;
-       cap-mmc-highspeed;
-       cap-sd-highspeed;
-       disable-wp;
-       num-slots = <1>;
-       vqmmc-supply = <&vcc_sd>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
-       status = "okay";
-};
-
-&uart2 {
-       status = "okay";
-};
-
-&usb_host0_ehci {
-       status = "disabled";
-};
-
-&usb_host0_ohci {
-       status = "disabled";
-};
-
-&usbdrd3_0 {
-       status = "okay";
-};
-
-&usb_host1_ehci {
-       status = "disabled";
-};
-
-&usb_host1_ohci {
-       status = "disabled";
-};
-
-&usbdrd3_1 {
-       status = "okay";
-       tsd,usb-port-power = "usbhub_enable";
-};
-
-&vopb {
-       status = "okay";
-};
-
-&gpio1 {
-       u-boot,dm-pre-reloc;
-};
-
-&gpio3 {
-       u-boot,dm-pre-reloc;
-};
-
 &pinctrl {
-       /* Pins that are not explicitely used by any devices */
-       pinctrl-names = "default";
-       pinctrl-0 = <&puma_pin_hog>;
-
-       hog {
-               puma_pin_hog: puma_pin_hog {
+       i2c8 {
+               i2c8_xfer_a: i2c8-xfer {
                        rockchip,pins =
-                               /* We need pull-ups on Q7 buttons */
-                               <RK_GPIO0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>, /* LID_BTN# */
-                               <RK_GPIO0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>, /* BATLOW# */
-                               <RK_GPIO0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>, /* SLP_BTN# */
-                               <RK_GPIO0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>; /* BIOS_DISABLE# */
+                         <1 RK_PC4 1 &pcfg_pull_up>,
+                         <1 RK_PC5 1 &pcfg_pull_up>;
                };
        };
 
-       pmic {
-               pmic_int_l: pmic-int-l {
+       leds {
+               led_pin_module: led-module-gpio {
                        rockchip,pins =
-                               <RK_GPIO1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
+                         <2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
-       leds_pins_puma: led_pins@0 {
-                       rockchip,pins =
-                               <RK_GPIO2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>,
-                               <RK_GPIO1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
-       };
-
-       usb2 {
-               otg_vbus_drv: otg-vbus-drv {
-                       rockchip,pins =
-                               <RK_GPIO0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
-               };
-
-               host_vbus_drv: host-vbus-drv {
+       pmic {
+               pmic_int_l: pmic-int-l {
                        rockchip,pins =
-                               <RK_GPIO4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
+                         <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
 
-       i2c8 {
-               i2c8_xfer_a: i2c8-xfer {
+       usb2 {
+               vcc5v0_host_en: vcc5v0-host-en {
                        rockchip,pins =
-                               <RK_GPIO1 RK_PC5 RK_FUNC_1 &pcfg_pull_up>,
-                               <RK_GPIO1 RK_PC4 RK_FUNC_1 &pcfg_pull_up>;
+                         <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 };
 
-&i2c1 {
+&sdhci {
+       bus-width = <8>;
+       mmc-hs400-1_8v;
+       mmc-hs400-enhanced-strobe;
+       non-removable;
        status = "okay";
-       clock-frequency = <400000>;
 };
-&i2c2 {
-       status = "okay";
-       clock-frequency = <400000>;
+
+&sdmmc {
+       vqmmc-supply = <&vcc_sd>;
 };
-&i2c4 {
+
+&spi1 {
        status = "okay";
-       clock-frequency = <400000>;
+
+       norflash: flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <50000000>;
+       };
 };
-&i2c6 {
+
+&tcphy1 {
        status = "okay";
-       clock-frequency = <400000>;
 };
 
-&i2c6_xfer {
-       /* Enable pull-ups, the pins would float otherwise. */
-       rockchip,pins =
-               <RK_GPIO2 RK_PB2 RK_FUNC_2 &pcfg_pull_up>,
-               <RK_GPIO2 RK_PB1 RK_FUNC_2 &pcfg_pull_up>;
+&tsadc {
+       rockchip,hw-tshut-mode = <1>;
+       rockchip,hw-tshut-polarity = <1>;
+       status = "okay";
 };
 
-&i2c7 {
+&u2phy1 {
        status = "okay";
-       clock-frequency = <400000>;
 
-       rtc_twi: rtc@6f {
-               compatible = "isil,isl1208";
-               reg = <0x6f>;
+       u2phy1_otg: otg-port {
+               status = "okay";
        };
-       fan: fan@18 {
-               compatible = "ti,amc6821";
-               reg = <0x18>;
-               cooling-min-state = <0>;
-               cooling-max-state = <9>;
-               #cooling-cells = <2>;
+
+       u2phy1_host: host-port {
+               phy-supply = <&vcc5v0_host>;
+               status = "okay";
        };
 };
 
-&uart0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&uart0_xfer &uart0_cts>;
+&usbdrd3_1 {
        status = "okay";
 };
 
-
-&spi1 {
+&usbdrd_dwc3_1 {
        status = "okay";
+       dr_mode = "host";
+};
 
-       #address-cells = <1>;
-       #size-cells = <0>;
-
-       spiflash: w25q32dw@0 {
-               u-boot,dm-pre-reloc;
-
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <49500000>;
-               spi-cpol;
-               spi-cpha;
-       };
+&usb_host1_ehci {
+       status = "okay";
 };
 
-&spi5 {
+&usb_host1_ohci {
        status = "okay";
 };
diff --git a/arch/arm/dts/rk3399-roc-pc-mezzanine-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-mezzanine-u-boot.dtsi
new file mode 100644 (file)
index 0000000..f50c18d
--- /dev/null
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2020 Amarula Solutions(India)
+ */
+
+#include "rk3399-roc-pc-u-boot.dtsi"
diff --git a/arch/arm/dts/rk3399-roc-pc-mezzanine.dts b/arch/arm/dts/rk3399-roc-pc-mezzanine.dts
new file mode 100644 (file)
index 0000000..2acb3d5
--- /dev/null
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2017 T-Chip Intelligent Technology Co., Ltd
+ * Copyright (c) 2019 Markus Reichl <m.reichl@fivetechno.de>
+ */
+
+/dts-v1/;
+#include "rk3399-roc-pc.dtsi"
+
+/ {
+       model = "Firefly ROC-RK3399-PC Mezzanine Board";
+       compatible = "firefly,roc-rk3399-pc-mezzanine", "rockchip,rk3399";
+
+       vcc3v3_ngff: vcc3v3-ngff {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc3v3_ngff";
+               enable-active-high;
+               gpio = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc3v3_ngff_en>;
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&dc_12v>;
+       };
+
+       vcc3v3_pcie: vcc3v3-pcie {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc3v3_pcie";
+               enable-active-high;
+               gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc3v3_pcie_en>;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&dc_12v>;
+       };
+};
+
+&pcie_phy {
+       status = "okay";
+};
+
+&pcie0 {
+       ep-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
+       num-lanes = <4>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie_perst>;
+       vpcie3v3-supply = <&vcc3v3_pcie>;
+       vpcie1v8-supply = <&vcc1v8_pmu>;
+       vpcie0v9-supply = <&vcca_0v9>;
+       status = "okay";
+};
+
+&pinctrl {
+       ngff {
+               vcc3v3_ngff_en: vcc3v3-ngff-en {
+                       rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pcie {
+               vcc3v3_pcie_en: vcc3v3-pcie-en {
+                       rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               pcie_perst: pcie-perst {
+                       rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
+
+&sdio0 {
+       bus-width = <4>;
+       cap-sd-highspeed;
+       cap-sdio-irq;
+       keep-power-in-suspend;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+       sd-uhs-sdr104;
+       vmmc-supply = <&vcc3v3_ngff>;
+       vqmmc-supply = <&vcc_1v8>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
+       status = "okay";
+};
index 574644298112e5b1fab709b9f2871ab67acd2235..141dd0b30672f27c79de491c83e424b20537159d 100644 (file)
        chosen {
                u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
        };
+
+       vcc_hub_en: vcc_hub_en-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio2 RK_PA4 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&hub_rst>;
+               regulator-name = "vcc_hub_en";
+               regulator-always-on;
+       };
+};
+
+/*
+ * should be placed inside mp8859, but not until mp8859 has
+ * its own dt-binding.
+ */
+&dc_12v {
+       compatible = "regulator-fixed";
+       regulator-name = "dc_12v";
+       regulator-always-on;
+       regulator-boot-on;
+       regulator-min-microvolt = <12000000>;
+       regulator-max-microvolt = <12000000>;
+       vin-supply = <&vcc_vbus_typec0>;
 };
 
 &vdd_log {
        regulator-min-microvolt = <430000>;
        regulator-init-microvolt = <950000>;
 };
+
+&vcc5v0_host {
+       regulator-always-on;
+};
+
+&vcc_sys {
+       regulator-always-on;
+};
+
+&vcc_sdio {
+       regulator-always-on;
+};
index 6a909e4eefd23492c5eeda52b4b257e36fb3f364..cd419542530973450975ecfdb64eec2ddce229ae 100644 (file)
@@ -8,6 +8,5 @@
 
 / {
        model = "Firefly ROC-RK3399-PC Board";
-       compatible = "libretech,roc-rk3399-pc", "firefly,roc-rk3399-pc",
-                    "rockchip,rk3399";
+       compatible = "firefly,roc-rk3399-pc", "rockchip,rk3399";
 };
index 9a1ce3a4ae12881b1d8d68f2fad30d87a500123c..9f225e9c3d545dd8784ea81faadb16d5597474bf 100644 (file)
                regulator-max-microvolt = <5000000>;
        };
 
-       /*
-        * should be placed inside mp8859, but not until mp8859 has
-        * its own dt-binding.
-        */
-       dc_12v: mp8859-dcdc1 {
-               compatible = "regulator-fixed";
-               regulator-name = "dc_12v";
-               regulator-always-on;
-               regulator-boot-on;
-               regulator-min-microvolt = <12000000>;
-               regulator-max-microvolt = <12000000>;
-               vin-supply = <&vcc_vbus_typec0>;
-       };
-
        /* switched by pmic_sleep */
        vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
                compatible = "regulator-fixed";
                pinctrl-names = "default";
                pinctrl-0 = <&vcc5v0_host_en &hub_rst>;
                regulator-name = "vcc5v0_host";
-               regulator-always-on;
                vin-supply = <&vcc_sys>;
        };
 
                pinctrl-names = "default";
                pinctrl-0 = <&vcc_sys_en>;
                regulator-name = "vcc_sys";
-               regulator-always-on;
                regulator-boot-on;
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
 
                        vcc_sdio: LDO_REG4 {
                                regulator-name = "vcc_sdio";
-                               regulator-always-on;
                                regulator-boot-on;
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <3000000>;
                vbus-supply = <&vcc_vbus_typec0>;
                status = "okay";
        };
+
+       mp8859: regulator@66 {
+               compatible = "mps,mp8859";
+               reg = <0x66>;
+               dc_12v: mp8859_dcdc {
+                       regulator-name = "dc_12v";
+                       regulator-min-microvolt = <12000000>;
+                       regulator-max-microvolt = <12000000>;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       vin-supply = <&vcc_vbus_typec0>;
+
+                       regulator-state-mem {
+                               regulator-on-in-suspend;
+                               regulator-suspend-microvolt = <12000000>;
+                       };
+               };
+       };
 };
 
 &i2s0 {
index 4a543f2117d4212b9e26578a64db9ad982ff5c59..3923ec01ef66f3ba7172354c418aa5cf12651801 100644 (file)
                #clock-cells = <0>;
        };
 
+       sdio_pwrseq: sdio-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               clocks = <&rk808 1>;
+               clock-names = "ext_clock";
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_enable_h>;
+               reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
+       };
+
        vcc12v_dcin: dc-12v {
                compatible = "regulator-fixed";
                regulator-name = "vcc12v_dcin";
                vin-supply = <&vcc12v_dcin>;
        };
 
+       vcc_0v9: vcc-0v9 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_0v9";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <900000>;
+               regulator-max-microvolt = <900000>;
+               vin-supply = <&vcc3v3_sys>;
+       };
+
        vcc3v3_pcie: vcc3v3-pcie-regulator {
                compatible = "regulator-fixed";
                enable-active-high;
        status = "okay";
 };
 
+&gpu {
+       mali-supply = <&vdd_gpu>;
+       status = "okay";
+};
+
 &hdmi {
+       ddc-i2c-bus = <&i2c3>;
        pinctrl-names = "default";
        pinctrl-0 = <&hdmi_cec>;
        status = "okay";
 };
 
+&hdmi_sound {
+       status = "okay";
+};
+
 &i2c0 {
        clock-frequency = <400000>;
        i2c-scl-rising-time-ns = <168>;
        pmu1830-supply = <&vcc_3v0>;
 };
 
+&pcie_phy {
+       status = "okay";
+};
+
+&pcie0 {
+       ep-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>;
+       max-link-speed = <2>;
+       num-lanes = <4>;
+       pinctrl-0 = <&pcie_clkreqnb_cpm>;
+       pinctrl-names = "default";
+       vpcie0v9-supply = <&vcc_0v9>;
+       vpcie1v8-supply = <&vcc_1v8>;
+       vpcie3v3-supply = <&vcc3v3_pcie>;
+       status = "okay";
+};
+
 &pinctrl {
+       bt {
+               bt_enable_h: bt-enable-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_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        pcie {
                pcie_pwr_en: pcie-pwr-en {
                        rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
+       sdio0 {
+               sdio0_bus4: sdio0-bus4 {
+                       rockchip,pins = <2 RK_PC4 1 &pcfg_pull_up_20ma>,
+                                       <2 RK_PC5 1 &pcfg_pull_up_20ma>,
+                                       <2 RK_PC6 1 &pcfg_pull_up_20ma>,
+                                       <2 RK_PC7 1 &pcfg_pull_up_20ma>;
+               };
+
+               sdio0_cmd: sdio0-cmd {
+                       rockchip,pins = <2 RK_PD0 1 &pcfg_pull_up_20ma>;
+               };
+
+               sdio0_clk: sdio0-clk {
+                       rockchip,pins = <2 RK_PD1 1 &pcfg_pull_none_20ma>;
+               };
+       };
+
        pmic {
                pmic_int_l: pmic-int-l {
                        rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
                        rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
+
+       wifi {
+               wifi_enable_h: wifi-enable-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 {
        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;
        };
 };
 
+&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_PD3 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_enable_h>;
+       };
+};
+
 &uart2 {
        status = "okay";
 };
index 12285c51cceb6efaac4f43f80d8e3b4525154979..437a75f31ad4db29e5b021aeb84944741bb1494a 100644 (file)
        };
 };
 
+&spi0 {
+       /* On Low speed expansion (LS-SPI0) */
+       status = "okay";
+};
+
+&spi4 {
+       /* On High speed expansion (HS-SPI1) */
+       status = "okay";
+};
+
+&thermal_zones {
+       cpu_thermal: cpu {
+               polling-delay-passive = <100>;
+               polling-delay = <1000>;
+               thermal-sensors = <&tsadc 0>;
+               sustainable-power = <1550>;
+
+               trips {
+                       cpu_alert0: cpu_alert0 {
+                                   temperature = <65000>;
+                                   hysteresis = <2000>;
+                                   type = "passive";
+                       };
+
+                       cpu_alert1: cpu_alert1 {
+                                   temperature = <75000>;
+                                   hysteresis = <2000>;
+                                   type = "passive";
+                       };
+
+                       cpu_crit: cpu_crit {
+                                 temperature = <95000>;
+                                 hysteresis = <2000>;
+                                 type = "critical";
+                       };
+               };
+
+               cooling-maps {
+                            map0 {
+
+                            trip = <&cpu_alert1>;
+                            cooling-device =
+                                       <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                       };
+               };
+       };
+};
+
 &usbdrd_dwc3_0 {
        dr_mode = "otg";
 };
index c7d48d41e184ee6f00dc82875a6178d894e22752..ba7c75c9f2a19ee243fe266414840b18311b4081 100644 (file)
                regulator-always-on;
                vin-supply = <&vcc5v0_sys>;
        };
+
+       vcc_0v9: vcc-0v9 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_0v9";
+               regulator-always-on;
+               regulator-min-microvolt = <900000>;
+               regulator-max-microvolt = <900000>;
+               vin-supply = <&vcc3v3_sys>;
+       };
 };
 
 &cpu_l0 {
        num-lanes = <4>;
        pinctrl-names = "default";
        pinctrl-0 = <&pcie_clkreqn_cpm>;
+       vpcie0v9-supply = <&vcc_0v9>;
+       vpcie1v8-supply = <&vcca_1v8>;
        vpcie3v3-supply = <&vcc3v3_pcie>;
        status = "okay";
 };
        cap-mmc-highspeed;
        cap-sd-highspeed;
        clock-frequency = <100000000>;
-       clock-freq-min-max = <100000 100000000>;
+       max-frequency = <100000000>;
        cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
        disable-wp;
        sd-uhs-sdr104;
index e544deb61d288285610a2d28aea8ecf1a40adc17..4b42717800f777278802941f743c681c5c4c8465 100644 (file)
 /*
  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
  * Copyright (c) 2018 Akash Gajjar <Akash_Gajjar@mentor.com>
+ * Copyright (c) 2019 Katsuhiro Suzuki <katsuhiro@katsuster.net>
  */
 
 /dts-v1/;
-#include <dt-bindings/input/linux-event-codes.h>
-#include <dt-bindings/pwm/pwm.h>
-#include "rk3399.dtsi"
-#include "rk3399-opp.dtsi"
+#include "rk3399-rockpro64.dtsi"
 
 / {
-       model = "Pine64 RockPro64";
-       compatible = "pine64,rockpro64", "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>;
-       };
-
-       gpio-keys {
-               compatible = "gpio-keys";
-               autorepeat;
-               pinctrl-names = "default";
-               pinctrl-0 = <&pwrbtn>;
-
-               power {
-                       debounce-interval = <100>;
-                       gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
-                       label = "GPIO Key Power";
-                       linux,code = <KEY_POWER>;
-                       wakeup-source;
-               };
-       };
-
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>;
-
-               work-led {
-                       label = "work";
-                       default-state = "on";
-                       gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
-               };
-
-               diy-led {
-                       label = "diy";
-                       default-state = "off";
-                       gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
-               };
-       };
-
-       fan: pwm-fan {
-               compatible = "pwm-fan";
-               #cooling-cells = <2>;
-               fan-supply = <&vcc12v_dcin>;
-               pwms = <&pwm1 0 50000 0>;
-       };
-
-       sdio_pwrseq: sdio-pwrseq {
-               compatible = "mmc-pwrseq-simple";
-               clocks = <&rk808 1>;
-               clock-names = "ext_clock";
-               pinctrl-names = "default";
-               pinctrl-0 = <&wifi_enable_h>;
-
-               /*
-                * On the module itself this is one of these (depending
-                * on the actual card populated):
-                * - SDIO_RESET_L_WL_REG_ON
-                * - PDN (power down when low)
-                */
-               reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
-       };
-
-       vcc12v_dcin: vcc12v-dcin {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc12v_dcin";
-               regulator-always-on;
-               regulator-boot-on;
-               regulator-min-microvolt = <12000000>;
-               regulator-max-microvolt = <12000000>;
-       };
-
-       /* switched by pmic_sleep */
-       vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc1v8_s3";
-               regulator-always-on;
-               regulator-boot-on;
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
-               vin-supply = <&vcc_1v8>;
-       };
-
-       vcc3v3_pcie: vcc3v3-pcie-regulator {
-               compatible = "regulator-fixed";
-               enable-active-high;
-               gpio = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&pcie_pwr_en>;
-               regulator-name = "vcc3v3_pcie";
-               regulator-always-on;
-               regulator-boot-on;
-               vin-supply = <&vcc12v_dcin>;
-       };
-
-       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>;
-       };
-
-       /* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
-       vcc5v0_host: vcc5v0-host-regulator {
-               compatible = "regulator-fixed";
-               enable-active-high;
-               gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&vcc5v0_host_en>;
-               regulator-name = "vcc5v0_host";
-               regulator-always-on;
-               vin-supply = <&vcc5v0_usb>;
-       };
-
-       vcc5v0_typec: vcc5v0-typec-regulator {
-               compatible = "regulator-fixed";
-               enable-active-high;
-               gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&vcc5v0_typec_en>;
-               regulator-name = "vcc5v0_typec";
-               regulator-always-on;
-               vin-supply = <&vcc5v0_usb>;
-       };
-
-       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 = <&vcc12v_dcin>;
-       };
-
-       vcc5v0_usb: vcc5v0-usb {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc5v0_usb";
-               regulator-always-on;
-               regulator-boot-on;
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               vin-supply = <&vcc12v_dcin>;
-       };
-
-       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 = <1700000>;
-               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 = <&vcc_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";
-};
-
-&hdmi {
-       ddc-i2c-bus = <&i2c3>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&hdmi_cec>;
-       status = "okay";
-};
-
-&hdmi_sound {
-       status = "okay";
-};
-
-&gpu {
-       mali-supply = <&vdd_gpu>;
-       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 = <&gpio3>;
-               interrupts = <10 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 = <&vcca_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;
-                               };
-                       };
-
-                       vcc3v0_touch: LDO_REG2 {
-                               regulator-name = "vcc3v0_touch";
-                               regulator-always-on;
-                               regulator-boot-on;
-                               regulator-min-microvolt = <3000000>;
-                               regulator-max-microvolt = <3000000>;
-                               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>;
-                               };
-                       };
-
-                       vcc_sdio: LDO_REG4 {
-                               regulator-name = "vcc_sdio";
-                               regulator-always-on;
-                               regulator-boot-on;
-                               regulator-min-microvolt = <1800000>;
-                               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>;
-                               };
-                       };
-
-                       vcca1v8_codec: LDO_REG7 {
-                               regulator-name = "vcca1v8_codec";
-                               regulator-always-on;
-                               regulator-boot-on;
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               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>;
-                               };
-                       };
-
-                       vcc3v3_s3: vcc_lan: SWITCH_REG1 {
-                               regulator-name = "vcc3v3_s3";
-                               regulator-always-on;
-                               regulator-boot-on;
-                               regulator-state-mem {
-                                       regulator-off-in-suspend;
-                               };
-                       };
-
-                       vcc3v3_s0: SWITCH_REG2 {
-                               regulator-name = "vcc3v3_s0";
-                               regulator-always-on;
-                               regulator-boot-on;
-                               regulator-state-mem {
-                                       regulator-off-in-suspend;
-                               };
-                       };
-               };
-       };
-
-       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;
-               };
-       };
+       model = "Pine64 RockPro64 v2.1";
+       compatible = "pine64,rockpro64-v2.1", "pine64,rockpro64", "rockchip,rk3399";
 };
 
 &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";
-
-       fusb0: typec-portc@22 {
-               compatible = "fcs,fusb302";
-               reg = <0x22>;
-               interrupt-parent = <&gpio1>;
-               interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&fusb0_int>;
-               vbus-supply = <&vcc5v0_typec>;
-               status = "okay";
-       };
-};
+       es8316: codec@11 {
+               compatible = "everest,es8316";
+               reg = <0x11>;
+               clocks = <&cru SCLK_I2S_8CH_OUT>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
 
-&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_3v0>;
-       sdmmc-supply = <&vcc_sdio>;
-       gpio1830-supply = <&vcc_3v0>;
-};
-
-&pcie0 {
-       ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
-       num-lanes = <4>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&pcie_perst>;
-       vpcie12v-supply = <&vcc12v_dcin>;
-       vpcie3v3-supply = <&vcc3v3_pcie>;
-       status = "okay";
-};
-
-&pcie_phy {
-       status = "okay";
-};
-
-&pmu_io_domains {
-       pmu1830-supply = <&vcc_3v0>;
-       status = "okay";
-};
-
-&pinctrl {
-       buttons {
-               pwrbtn: pwrbtn {
-                       rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
-               };
-       };
-
-       fusb302x {
-               fusb0_int: fusb0-int {
-                       rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
-               };
-       };
-
-       leds {
-               work_led_gpio: work_led-gpio {
-                       rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
-               };
-
-               diy_led_gpio: diy_led-gpio {
-                       rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
-               };
-       };
-
-       pcie {
-               pcie_perst: pcie-perst {
-                       rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
-               };
-
-               pcie_pwr_en: pcie-pwr-en {
-                       rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
-               };
-       };
-
-       pmic {
-               pmic_int_l: pmic-int-l {
-                       rockchip,pins = <3 RK_PB2 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>;
-               };
-       };
-
-       sdio-pwrseq {
-               wifi_enable_h: wifi-enable-h {
-                       rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
-               };
-       };
-
-       usb-typec {
-               vcc5v0_typec_en: vcc5v0_typec_en {
-                       rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
-               };
-       };
-
-       usb2 {
-               vcc5v0_host_en: vcc5v0-host-en {
-                       rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+               port {
+                       es8316_p0_0: endpoint {
+                               remote-endpoint = <&i2s1_p0_0>;
+                       };
                };
        };
 };
-
-&pwm0 {
-       status = "okay";
-};
-
-&pwm1 {
-       status = "okay";
-};
-
-&pwm2 {
-       status = "okay";
-};
-
-&saradc {
-       vref-supply = <&vcca1v8_s3>;
-       status = "okay";
-};
-
-&sdmmc {
-       bus-width = <4>;
-       cap-sd-highspeed;
-       cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
-       disable-wp;
-       max-frequency = <150000000>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
-       status = "okay";
-};
-
-&sdhci {
-       bus-width = <8>;
-       mmc-hs200-1_8v;
-       non-removable;
-       status = "okay";
-};
-
-&spi1 {
-       status = "okay";
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <10000000>;
-       };
-};
-
-&tcphy0 {
-       status = "okay";
-};
-
-&tcphy1 {
-       status = "okay";
-};
-
-&tsadc {
-       /* tshut mode 0:CRU 1:GPIO */
-       rockchip,hw-tshut-mode = <1>;
-       /* tshut polarity 0:LOW 1:HIGH */
-       rockchip,hw-tshut-polarity = <1>;
-       status = "okay";
-};
-
-&u2phy0 {
-       status = "okay";
-
-       u2phy0_otg: otg-port {
-               status = "okay";
-       };
-
-       u2phy0_host: host-port {
-               phy-supply = <&vcc5v0_host>;
-               status = "okay";
-       };
-};
-
-&u2phy1 {
-       status = "okay";
-
-       u2phy1_otg: otg-port {
-               status = "okay";
-       };
-
-       u2phy1_host: host-port {
-               phy-supply = <&vcc5v0_host>;
-               status = "okay";
-       };
-};
-
-&uart0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&uart0_xfer &uart0_cts>;
-       status = "okay";
-};
-
-&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";
-};
diff --git a/arch/arm/dts/rk3399-rockpro64.dtsi b/arch/arm/dts/rk3399-rockpro64.dtsi
new file mode 100644 (file)
index 0000000..9bca258
--- /dev/null
@@ -0,0 +1,797 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
+ * Copyright (c) 2018 Akash Gajjar <Akash_Gajjar@mentor.com>
+ */
+
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/pwm/pwm.h>
+#include "rk3399.dtsi"
+#include "rk3399-opp.dtsi"
+
+/ {
+       chosen {
+               stdout-path = "serial2:1500000n8";
+       };
+
+       clkin_gmac: external-gmac-clock {
+               compatible = "fixed-clock";
+               clock-frequency = <125000000>;
+               clock-output-names = "clkin_gmac";
+               #clock-cells = <0>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               autorepeat;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pwrbtn>;
+
+               power {
+                       debounce-interval = <100>;
+                       gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
+                       label = "GPIO Key Power";
+                       linux,code = <KEY_POWER>;
+                       wakeup-source;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&work_led_gpio>, <&diy_led_gpio>;
+
+               work-led {
+                       label = "work";
+                       default-state = "on";
+                       gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
+               };
+
+               diy-led {
+                       label = "diy";
+                       default-state = "off";
+                       gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       fan: pwm-fan {
+               compatible = "pwm-fan";
+               #cooling-cells = <2>;
+               fan-supply = <&vcc12v_dcin>;
+               pwms = <&pwm1 0 50000 0>;
+       };
+
+       sdio_pwrseq: sdio-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               clocks = <&rk808 1>;
+               clock-names = "ext_clock";
+               pinctrl-names = "default";
+               pinctrl-0 = <&wifi_enable_h>;
+               reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
+       };
+
+       sound {
+               compatible = "audio-graph-card";
+               label = "rockchip,rk3399";
+               dais = <&i2s1_p0>;
+       };
+
+       vcc12v_dcin: vcc12v-dcin {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc12v_dcin";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+       };
+
+       /* switched by pmic_sleep */
+       vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc1v8_s3";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_1v8>;
+       };
+
+       vcc3v3_pcie: vcc3v3-pcie-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pcie_pwr_en>;
+               regulator-name = "vcc3v3_pcie";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc12v_dcin>;
+       };
+
+       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>;
+       };
+
+       /* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
+       vcc5v0_host: vcc5v0-host-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_host_en>;
+               regulator-name = "vcc5v0_host";
+               regulator-always-on;
+               vin-supply = <&vcc5v0_usb>;
+       };
+
+       vcc5v0_typec: vcc5v0-typec-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vcc5v0_typec_en>;
+               regulator-name = "vcc5v0_typec";
+               regulator-always-on;
+               vin-supply = <&vcc5v0_usb>;
+       };
+
+       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 = <&vcc12v_dcin>;
+       };
+
+       vcc5v0_usb: vcc5v0-usb {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_usb";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&vcc12v_dcin>;
+       };
+
+       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 = <1700000>;
+               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 = <&vcc_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";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c3>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&hdmi_cec>;
+       status = "okay";
+};
+
+&hdmi_sound {
+       status = "okay";
+};
+
+&gpu {
+       mali-supply = <&vdd_gpu>;
+       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 = <&gpio3>;
+               interrupts = <10 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 = <&vcca_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;
+                               };
+                       };
+
+                       vcc3v0_touch: LDO_REG2 {
+                               regulator-name = "vcc3v0_touch";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               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>;
+                               };
+                       };
+
+                       vcc_sdio: LDO_REG4 {
+                               regulator-name = "vcc_sdio";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               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>;
+                               };
+                       };
+
+                       vcca1v8_codec: LDO_REG7 {
+                               regulator-name = "vcca1v8_codec";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               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>;
+                               };
+                       };
+
+                       vcc3v3_s3: vcc_lan: SWITCH_REG1 {
+                               regulator-name = "vcc3v3_s3";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       vcc3v3_s0: SWITCH_REG2 {
+                               regulator-name = "vcc3v3_s0";
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+               };
+       };
+
+       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";
+
+       fusb0: typec-portc@22 {
+               compatible = "fcs,fusb302";
+               reg = <0x22>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&fusb0_int>;
+               vbus-supply = <&vcc5v0_typec>;
+               status = "okay";
+       };
+};
+
+&i2s0 {
+       rockchip,playback-channels = <8>;
+       rockchip,capture-channels = <8>;
+       status = "okay";
+};
+
+&i2s1 {
+       rockchip,playback-channels = <2>;
+       rockchip,capture-channels = <2>;
+       status = "okay";
+
+       i2s1_p0: port {
+               i2s1_p0_0: endpoint {
+                       dai-format = "i2s";
+                       mclk-fs = <256>;
+                       remote-endpoint = <&es8316_p0_0>;
+               };
+       };
+};
+
+&i2s2 {
+       status = "okay";
+};
+
+&io_domains {
+       status = "okay";
+
+       bt656-supply = <&vcc1v8_dvp>;
+       audio-supply = <&vcc_3v0>;
+       sdmmc-supply = <&vcc_sdio>;
+       gpio1830-supply = <&vcc_3v0>;
+};
+
+&pcie0 {
+       ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
+       num-lanes = <4>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie_perst>;
+       vpcie12v-supply = <&vcc12v_dcin>;
+       vpcie3v3-supply = <&vcc3v3_pcie>;
+       status = "okay";
+};
+
+&pcie_phy {
+       status = "okay";
+};
+
+&pmu_io_domains {
+       pmu1830-supply = <&vcc_3v0>;
+       status = "okay";
+};
+
+&pinctrl {
+       bt {
+               bt_enable_h: bt-enable-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_down>;
+               };
+
+               bt_wake_l: bt-wake-l {
+                       rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       buttons {
+               pwrbtn: pwrbtn {
+                       rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       fusb302x {
+               fusb0_int: fusb0-int {
+                       rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       leds {
+               work_led_gpio: work_led-gpio {
+                       rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               diy_led_gpio: diy_led-gpio {
+                       rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pcie {
+               pcie_perst: pcie-perst {
+                       rockchip,pins = <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               pcie_pwr_en: pcie-pwr-en {
+                       rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pmic {
+               pmic_int_l: pmic-int-l {
+                       rockchip,pins = <3 RK_PB2 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>;
+               };
+       };
+
+       sdio-pwrseq {
+               wifi_enable_h: wifi-enable-h {
+                       rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       usb-typec {
+               vcc5v0_typec_en: vcc5v0_typec_en {
+                       rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       usb2 {
+               vcc5v0_host_en: vcc5v0-host-en {
+                       rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
+
+&pwm0 {
+       status = "okay";
+};
+
+&pwm1 {
+       status = "okay";
+};
+
+&pwm2 {
+       status = "okay";
+};
+
+&saradc {
+       vref-supply = <&vcca1v8_s3>;
+       status = "okay";
+};
+
+&sdio0 {
+       bus-width = <4>;
+       cap-sd-highspeed;
+       cap-sdio-irq;
+       disable-wp;
+       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";
+};
+
+&sdmmc {
+       bus-width = <4>;
+       cap-sd-highspeed;
+       cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+       disable-wp;
+       max-frequency = <150000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
+       status = "okay";
+};
+
+&sdhci {
+       bus-width = <8>;
+       mmc-hs200-1_8v;
+       non-removable;
+       status = "okay";
+};
+
+&spi1 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+       };
+};
+
+&tcphy0 {
+       status = "okay";
+};
+
+&tcphy1 {
+       status = "okay";
+};
+
+&tsadc {
+       /* tshut mode 0:CRU 1:GPIO */
+       rockchip,hw-tshut-mode = <1>;
+       /* tshut polarity 0:LOW 1:HIGH */
+       rockchip,hw-tshut-polarity = <1>;
+       status = "okay";
+};
+
+&u2phy0 {
+       status = "okay";
+
+       u2phy0_otg: otg-port {
+               status = "okay";
+       };
+
+       u2phy0_host: host-port {
+               phy-supply = <&vcc5v0_host>;
+               status = "okay";
+       };
+};
+
+&u2phy1 {
+       status = "okay";
+
+       u2phy1_otg: otg-port {
+               status = "okay";
+       };
+
+       u2phy1_host: host-port {
+               phy-supply = <&vcc5v0_host>;
+               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 = "lpo";
+               device-wakeup-gpios = <&gpio2 RK_PD3 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_enable_h>;
+               vbat-supply = <&vcc3v3_sys>;
+               vddio-supply = <&vcc_1v8>;
+       };
+};
+
+&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 8b857ccfc79726b76dbfa2f4e5effa30635c7fe8..9bb130a92a962689bd993d40f4377e3910c05726 100644 (file)
                clock-names = "pclk_ddr_mon";
        };
 
+       rng: rng@ff8b8000 {
+               compatible = "rockchip,cryptov1-rng";
+               reg = <0x0 0xff8b8000 0x0 0x1000>;
+               status = "disabled";
+       };
+
        dmc: dmc {
                u-boot,dm-pre-reloc;
                compatible = "rockchip,rk3399-dmc";
@@ -79,6 +85,7 @@
 };
 
 &sdhci {
+       max-frequency = <200000000>;
        u-boot,dm-pre-reloc;
 };
 
index 6b7c136ab8cb8bdad4b871b773ba75cfb9272c1e..74f2c3d490953770e22b1ec8f92fbb949c2a9141 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * Copyright (c) 2016-2017 Fuzhou Rockchip Electronics Co., Ltd.
+ * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
  */
 
 #include <dt-bindings/clock/rk3399-cru.h>
@@ -19,6 +19,7 @@
        #size-cells = <2>;
 
        aliases {
+               ethernet0 = &gmac;
                i2c0 = &i2c0;
                i2c1 = &i2c1;
                i2c2 = &i2c2;
 
                cpu_l0: cpu@0 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x0>;
                        enable-method = "psci";
-                       #cooling-cells = <2>; /* min followed by max */
+                       capacity-dmips-mhz = <485>;
                        clocks = <&cru ARMCLKL>;
+                       #cooling-cells = <2>; /* min followed by max */
+                       dynamic-power-coefficient = <100>;
+                       cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
                };
 
                cpu_l1: cpu@1 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x1>;
                        enable-method = "psci";
+                       capacity-dmips-mhz = <485>;
                        clocks = <&cru ARMCLKL>;
+                       #cooling-cells = <2>; /* min followed by max */
+                       dynamic-power-coefficient = <100>;
+                       cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
                };
 
                cpu_l2: cpu@2 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x2>;
                        enable-method = "psci";
+                       capacity-dmips-mhz = <485>;
                        clocks = <&cru ARMCLKL>;
+                       #cooling-cells = <2>; /* min followed by max */
+                       dynamic-power-coefficient = <100>;
+                       cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
                };
 
                cpu_l3: cpu@3 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0 0x3>;
                        enable-method = "psci";
+                       capacity-dmips-mhz = <485>;
                        clocks = <&cru ARMCLKL>;
+                       #cooling-cells = <2>; /* min followed by max */
+                       dynamic-power-coefficient = <100>;
+                       cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
                };
 
                cpu_b0: cpu@100 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a72", "arm,armv8";
+                       compatible = "arm,cortex-a72";
                        reg = <0x0 0x100>;
                        enable-method = "psci";
-                       #cooling-cells = <2>; /* min followed by max */
+                       capacity-dmips-mhz = <1024>;
                        clocks = <&cru ARMCLKB>;
+                       #cooling-cells = <2>; /* min followed by max */
+                       dynamic-power-coefficient = <436>;
+                       cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
                };
 
                cpu_b1: cpu@101 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a72", "arm,armv8";
+                       compatible = "arm,cortex-a72";
                        reg = <0x0 0x101>;
                        enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
                        clocks = <&cru ARMCLKB>;
+                       #cooling-cells = <2>; /* min followed by max */
+                       dynamic-power-coefficient = <436>;
+                       cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP>;
                };
+
+               idle-states {
+                       entry-method = "psci";
+
+                       CPU_SLEEP: cpu-sleep {
+                               compatible = "arm,idle-state";
+                               local-timer-stop;
+                               arm,psci-suspend-param = <0x0010000>;
+                               entry-latency-us = <120>;
+                               exit-latency-us = <250>;
+                               min-residency-us = <900>;
+                       };
+
+                       CLUSTER_SLEEP: cluster-sleep {
+                               compatible = "arm,idle-state";
+                               local-timer-stop;
+                               arm,psci-suspend-param = <0x1010000>;
+                               entry-latency-us = <400>;
+                               exit-latency-us = <500>;
+                               min-residency-us = <2000>;
+                       };
+               };
+       };
+
+       display-subsystem {
+               compatible = "rockchip,display-subsystem";
+               ports = <&vopl_out>, <&vopb_out>;
        };
 
        pmu_a53 {
                #clock-cells = <0>;
        };
 
-       amba {
+       amba: bus {
                compatible = "simple-bus";
                #address-cells = <2>;
                #size-cells = <2>;
                #size-cells = <2>;
                #interrupt-cells = <1>;
                aspm-no-l0s;
-               bus-range = <0x0 0x1>;
+               bus-range = <0x0 0x1f>;
                clocks = <&cru ACLK_PCIE>, <&cru ACLK_PERF_PCIE>,
                         <&cru PCLK_PCIE>, <&cru SCLK_PCIE_PM>;
                clock-names = "aclk", "aclk-perf",
                linux,pci-domain = <0>;
                max-link-speed = <1>;
                msi-map = <0x0 &its 0x0 0x1000>;
-               phys = <&pcie_phy>;
-               phy-names = "pcie-phy";
-               ranges = <0x83000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x600000
-                         0x81000000 0x0 0xfa600000 0x0 0xfa600000 0x0 0x100000>;
+               phys = <&pcie_phy 0>, <&pcie_phy 1>,
+                      <&pcie_phy 2>, <&pcie_phy 3>;
+               phy-names = "pcie-phy-0", "pcie-phy-1",
+                           "pcie-phy-2", "pcie-phy-3";
+               ranges = <0x83000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000
+                         0x81000000 0x0 0xfbe00000 0x0 0xfbe00000 0x0 0x100000>;
                resets = <&cru SRST_PCIE_CORE>, <&cru SRST_PCIE_MGMT>,
                         <&cru SRST_PCIE_MGMT_STICKY>, <&cru SRST_PCIE_PIPE>,
                         <&cru SRST_PCIE_PM>, <&cru SRST_P_PCIE>,
                resets = <&cru SRST_A_GMAC>;
                reset-names = "stmmaceth";
                rockchip,grf = <&grf>;
+               snps,txpbl = <0x4>;
                status = "disabled";
        };
 
-       sdio0: dwmmc@fe310000 {
+       sdio0: mmc@fe310000 {
                compatible = "rockchip,rk3399-dw-mshc",
                             "rockchip,rk3288-dw-mshc";
                reg = <0x0 0xfe310000 0x0 0x4000>;
                status = "disabled";
        };
 
-       sdmmc: dwmmc@fe320000 {
+       sdmmc: mmc@fe320000 {
                compatible = "rockchip,rk3399-dw-mshc",
                             "rockchip,rk3288-dw-mshc";
                reg = <0x0 0xfe320000 0x0 0x4000>;
                interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH 0>;
                max-frequency = <150000000>;
+               assigned-clocks = <&cru HCLK_SD>;
+               assigned-clock-rates = <200000000>;
                clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
                         <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
                clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
                arasan,soc-ctl-syscon = <&grf>;
                assigned-clocks = <&cru SCLK_EMMC>;
                assigned-clock-rates = <200000000>;
-               max-frequency = <200000000>;
                clocks = <&cru SCLK_EMMC>, <&cru ACLK_EMMC>;
                clock-names = "clk_xin", "clk_ahb";
                clock-output-names = "emmc_cardclock";
                phys = <&emmc_phy>;
                phy-names = "phy_arasan";
                power-domains = <&power RK3399_PD_EMMC>;
+               disable-cqe-dcmd;
                status = "disabled";
        };
 
                interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH 0>;
                clocks = <&cru HCLK_HOST0>, <&cru HCLK_HOST0_ARB>,
                         <&u2phy0>;
-               clock-names = "usbhost", "arbiter",
-                             "utmi";
                phys = <&u2phy0_host>;
                phy-names = "usb";
-               power-domains = <&power RK3399_PD_PERIHP>;
                status = "disabled";
        };
 
                interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH 0>;
                clocks = <&cru HCLK_HOST0>, <&cru HCLK_HOST0_ARB>,
                         <&u2phy0>;
-               clock-names = "usbhost", "arbiter",
-                             "utmi";
                phys = <&u2phy0_host>;
                phy-names = "usb";
-               power-domains = <&power RK3399_PD_PERIHP>;
                status = "disabled";
        };
 
                interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH 0>;
                clocks = <&cru HCLK_HOST1>, <&cru HCLK_HOST1_ARB>,
                         <&u2phy1>;
-               clock-names = "usbhost", "arbiter",
-                             "utmi";
                phys = <&u2phy1_host>;
                phy-names = "usb";
-               power-domains = <&power RK3399_PD_PERIHP>;
                status = "disabled";
        };
 
                interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH 0>;
                clocks = <&cru HCLK_HOST1>, <&cru HCLK_HOST1_ARB>,
                         <&u2phy1>;
-               clock-names = "usbhost", "arbiter",
-                             "utmi";
                phys = <&u2phy1_host>;
                phy-names = "usb";
-               power-domains = <&power RK3399_PD_PERIHP>;
                status = "disabled";
        };
 
-       usbdrd3_0: dwc3_typec0: usb@fe800000 {
+       usbdrd3_0: usb@fe800000 {
                compatible = "rockchip,rk3399-dwc3";
                #address-cells = <2>;
                #size-cells = <2>;
                        compatible = "snps,dwc3";
                        reg = <0x0 0xfe800000 0x0 0x100000>;
                        interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH 0>;
+                       clocks = <&cru SCLK_USB3OTG0_REF>, <&cru ACLK_USB3OTG0>,
+                                <&cru SCLK_USB3OTG0_SUSPEND>;
+                       clock-names = "ref", "bus_early", "suspend";
                        dr_mode = "otg";
                        phys = <&u2phy0_otg>, <&tcphy0_usb3>;
                        phy-names = "usb2-phy", "usb3-phy";
                };
        };
 
-       dwc3_typec1: usbdrd3_1: usb@fe900000 {
+       usbdrd3_1: usb@fe900000 {
                compatible = "rockchip,rk3399-dwc3";
                #address-cells = <2>;
                #size-cells = <2>;
                        compatible = "snps,dwc3";
                        reg = <0x0 0xfe900000 0x0 0x100000>;
                        interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 0>;
+                       clocks = <&cru SCLK_USB3OTG1_REF>, <&cru ACLK_USB3OTG1>,
+                                <&cru SCLK_USB3OTG1_SUSPEND>;
+                       clock-names = "ref", "bus_early", "suspend";
                        dr_mode = "otg";
                        phys = <&u2phy1_otg>, <&tcphy1_usb3>;
                        phy-names = "usb2-phy", "usb3-phy";
                its: interrupt-controller@fee20000 {
                        compatible = "arm,gic-v3-its";
                        msi-controller;
+                       #msi-cells = <1>;
                        reg = <0x0 0xfee20000 0x0 0x20000>;
                };
 
                clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>;
                clock-names = "baudclk", "apb_pclk";
                interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH 0>;
-               clock-frequency = <24000000>;
                reg-shift = <2>;
                reg-io-width = <4>;
                pinctrl-names = "default";
                clocks = <&cru SCLK_SPI0>, <&cru PCLK_SPI0>;
                clock-names = "spiclk", "apb_pclk";
                interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH 0>;
+               dmas = <&dmac_peri 10>, <&dmac_peri 11>;
+               dma-names = "tx", "rx";
                pinctrl-names = "default";
                pinctrl-0 = <&spi0_clk &spi0_tx &spi0_rx &spi0_cs0>;
                #address-cells = <1>;
                clocks = <&cru SCLK_SPI1>, <&cru PCLK_SPI1>;
                clock-names = "spiclk", "apb_pclk";
                interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH 0>;
+               dmas = <&dmac_peri 12>, <&dmac_peri 13>;
+               dma-names = "tx", "rx";
                pinctrl-names = "default";
                pinctrl-0 = <&spi1_clk &spi1_tx &spi1_rx &spi1_cs0>;
                #address-cells = <1>;
                clocks = <&cru SCLK_SPI2>, <&cru PCLK_SPI2>;
                clock-names = "spiclk", "apb_pclk";
                interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH 0>;
+               dmas = <&dmac_peri 14>, <&dmac_peri 15>;
+               dma-names = "tx", "rx";
                pinctrl-names = "default";
                pinctrl-0 = <&spi2_clk &spi2_tx &spi2_rx &spi2_cs0>;
                #address-cells = <1>;
                clocks = <&cru SCLK_SPI4>, <&cru PCLK_SPI4>;
                clock-names = "spiclk", "apb_pclk";
                interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH 0>;
+               dmas = <&dmac_peri 18>, <&dmac_peri 19>;
+               dma-names = "tx", "rx";
                pinctrl-names = "default";
                pinctrl-0 = <&spi4_clk &spi4_tx &spi4_rx &spi4_cs0>;
                #address-cells = <1>;
                clocks = <&cru SCLK_SPI5>, <&cru PCLK_SPI5>;
                clock-names = "spiclk", "apb_pclk";
                interrupts = <GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH 0>;
+               dmas = <&dmac_bus 8>, <&dmac_bus 9>;
+               dma-names = "tx", "rx";
                pinctrl-names = "default";
                pinctrl-0 = <&spi5_clk &spi5_tx &spi5_rx &spi5_cs0>;
+               power-domains = <&power RK3399_PD_SDIOAUDIO>;
                #address-cells = <1>;
                #size-cells = <0>;
                status = "disabled";
                                map0 {
                                        trip = <&cpu_alert0>;
                                        cooling-device =
-                                               <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                                               <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                               <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
                                };
                                map1 {
                                        trip = <&cpu_alert1>;
                                        cooling-device =
                                                <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
-                                               <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                                               <&cpu_l1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                               <&cpu_l2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                               <&cpu_l3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                               <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                               <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
                                };
                        };
                };
                                map0 {
                                        trip = <&gpu_alert0>;
                                        cooling-device =
-                                               <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                                               <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
                                };
                        };
                };
                                         <&cru PCLK_GMAC>;
                                pm_qos = <&qos_gmac>;
                        };
-                       pd_perihp@RK3399_PD_PERIHP {
-                               reg = <RK3399_PD_PERIHP>;
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               clocks = <&cru ACLK_PERIHP>;
-                               pm_qos = <&qos_perihp>,
-                                        <&qos_pcie>,
-                                        <&qos_usb_host0>,
-                                        <&qos_usb_host1>;
-
-                               pd_sd@RK3399_PD_SD {
-                                       reg = <RK3399_PD_SD>;
-                                       clocks = <&cru HCLK_SDMMC>,
-                                                <&cru SCLK_SDMMC>;
-                                       pm_qos = <&qos_sd>;
-                               };
+                       pd_sd@RK3399_PD_SD {
+                               reg = <RK3399_PD_SD>;
+                               clocks = <&cru HCLK_SDMMC>,
+                                        <&cru SCLK_SDMMC>;
+                               pm_qos = <&qos_sd>;
                        };
                        pd_sdioaudio@RK3399_PD_SDIOAUDIO {
                                reg = <RK3399_PD_SDIOAUDIO>;
        pmugrf: syscon@ff320000 {
                compatible = "rockchip,rk3399-pmugrf", "syscon", "simple-mfd";
                reg = <0x0 0xff320000 0x0 0x1000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
 
                pmu_io_domains: io-domains {
                        compatible = "rockchip,rk3399-pmu-io-voltage-domain";
                status = "disabled";
        };
 
+       vpu: video-codec@ff650000 {
+               compatible = "rockchip,rk3399-vpu";
+               reg = <0x0 0xff650000 0x0 0x800>;
+               interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH 0>,
+                            <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH 0>;
+               interrupt-names = "vepu", "vdpu";
+               clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
+               clock-names = "aclk", "hclk";
+               iommus = <&vpu_mmu>;
+               power-domains = <&power RK3399_PD_VCODEC>;
+       };
+
+       vpu_mmu: iommu@ff650800 {
+               compatible = "rockchip,iommu";
+               reg = <0x0 0xff650800 0x0 0x40>;
+               interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH 0>;
+               interrupt-names = "vpu_mmu";
+               clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
+               clock-names = "aclk", "iface";
+               #iommu-cells = <0>;
+               power-domains = <&power RK3399_PD_VCODEC>;
+       };
+
+       vdec_mmu: iommu@ff660480 {
+               compatible = "rockchip,iommu";
+               reg = <0x0 0xff660480 0x0 0x40>, <0x0 0xff6604c0 0x0 0x40>;
+               interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH 0>;
+               interrupt-names = "vdec_mmu";
+               clocks = <&cru ACLK_VDU>, <&cru HCLK_VDU>;
+               clock-names = "aclk", "iface";
+               #iommu-cells = <0>;
+               status = "disabled";
+       };
+
+       iep_mmu: iommu@ff670800 {
+               compatible = "rockchip,iommu";
+               reg = <0x0 0xff670800 0x0 0x40>;
+               interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH 0>;
+               interrupt-names = "iep_mmu";
+               clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
+               clock-names = "aclk", "iface";
+               #iommu-cells = <0>;
+               status = "disabled";
+       };
+
+       rga: rga@ff680000 {
+               compatible = "rockchip,rk3399-rga";
+               reg = <0x0 0xff680000 0x0 0x10000>;
+               interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH 0>;
+               clocks = <&cru ACLK_RGA>, <&cru HCLK_RGA>, <&cru SCLK_RGA_CORE>;
+               clock-names = "aclk", "hclk", "sclk";
+               resets = <&cru SRST_RGA_CORE>, <&cru SRST_A_RGA>, <&cru SRST_H_RGA>;
+               reset-names = "core", "axi", "ahb";
+               power-domains = <&power RK3399_PD_RGA>;
+       };
+
        efuse0: efuse@ff690000 {
                compatible = "rockchip,rk3399-efuse";
                reg = <0x0 0xff690000 0x0 0x80>;
                        compatible = "rockchip,rk3399-pcie-phy";
                        clocks = <&cru SCLK_PCIEPHY_REF>;
                        clock-names = "refclk";
-                       #phy-cells = <0>;
+                       #phy-cells = <1>;
                        resets = <&cru SRST_PCIEPHY>;
+                       drive-impedance-ohm = <50>;
                        reset-names = "phy";
                        status = "disabled";
                };
                reg = <0x0 0xff914000 0x0 0x100>, <0x0 0xff915000 0x0 0x100>;
                interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH 0>;
                interrupt-names = "isp0_mmu";
-               clocks = <&cru ACLK_ISP0_NOC>, <&cru HCLK_ISP0_NOC>;
+               clocks = <&cru ACLK_ISP0_WRAPPER>, <&cru HCLK_ISP0_WRAPPER>;
                clock-names = "aclk", "iface";
                #iommu-cells = <0>;
+               power-domains = <&power RK3399_PD_ISP0>;
                rockchip,disable-mmu-reset;
-               status = "disabled";
        };
 
        isp1_mmu: iommu@ff924000 {
                reg = <0x0 0xff924000 0x0 0x100>, <0x0 0xff925000 0x0 0x100>;
                interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH 0>;
                interrupt-names = "isp1_mmu";
-               clocks = <&cru ACLK_ISP1_NOC>, <&cru HCLK_ISP1_NOC>;
+               clocks = <&cru ACLK_ISP1_WRAPPER>, <&cru HCLK_ISP1_WRAPPER>;
                clock-names = "aclk", "iface";
                #iommu-cells = <0>;
+               power-domains = <&power RK3399_PD_ISP1>;
                rockchip,disable-mmu-reset;
-               status = "disabled";
        };
 
        hdmi_sound: hdmi-sound {
        };
 
        mipi_dsi: mipi@ff960000 {
-               compatible = "rockchip,rk3399_mipi_dsi";
+               compatible = "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi";
                reg = <0x0 0xff960000 0x0 0x8000>;
                interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH 0>;
-               clocks = <&cru SCLK_MIPIDPHY_REF>, <&cru PCLK_MIPI_DSI0>,
-                        <&cru SCLK_DPHY_TX0_CFG>;
-               clock-names = "ref", "pclk", "phy_cfg";
+               clocks = <&cru SCLK_DPHY_PLL>, <&cru PCLK_MIPI_DSI0>,
+                        <&cru SCLK_DPHY_TX0_CFG>, <&cru PCLK_VIO_GRF>;
+               clock-names = "ref", "pclk", "phy_cfg", "grf";
+               power-domains = <&power RK3399_PD_VIO>;
+               resets = <&cru SRST_P_MIPI_DSI0>;
+               reset-names = "apb";
                rockchip,grf = <&grf>;
                #address-cells = <1>;
                #size-cells = <0>;
                status = "disabled";
+
                ports {
-                       reg = <1>;
-                       mipi_in: port {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       mipi_in: port@0 {
+                               reg = <0>;
                                #address-cells = <1>;
                                #size-cells = <0>;
+
                                mipi_in_vopb: endpoint@0 {
                                        reg = <0>;
                                        remote-endpoint = <&vopb_out_mipi>;
                resets = <&cru SRST_P_MIPI_DSI1>;
                reset-names = "apb";
                rockchip,grf = <&grf>;
+               #address-cells = <1>;
+               #size-cells = <0>;
                status = "disabled";
 
                ports {
                             <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH 0>;
                interrupt-names = "gpu", "job", "mmu";
                clocks = <&cru ACLK_GPU>;
+               #cooling-cells = <2>;
                power-domains = <&power RK3399_PD_GPU>;
                status = "disabled";
        };
 
                clock {
                        clk_32k: clk-32k {
-                               rockchip,pins = <0 RK_PA0 RK_FUNC_2 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA0 2 &pcfg_pull_none>;
                        };
                };
 
                edp {
                        edp_hpd: edp-hpd {
                                rockchip,pins =
-                                       <4 RK_PC7 RK_FUNC_2 &pcfg_pull_none>;
+                                       <4 RK_PC7 2 &pcfg_pull_none>;
                        };
                };
 
                        rgmii_pins: rgmii-pins {
                                rockchip,pins =
                                        /* mac_txclk */
-                                       <3 RK_PC1 RK_FUNC_1 &pcfg_pull_none_13ma>,
+                                       <3 RK_PC1 1 &pcfg_pull_none_13ma>,
                                        /* mac_rxclk */
-                                       <3 RK_PB6 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB6 1 &pcfg_pull_none>,
                                        /* mac_mdio */
-                                       <3 RK_PB5 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB5 1 &pcfg_pull_none>,
                                        /* mac_txen */
-                                       <3 RK_PB4 RK_FUNC_1 &pcfg_pull_none_13ma>,
+                                       <3 RK_PB4 1 &pcfg_pull_none_13ma>,
                                        /* mac_clk */
-                                       <3 RK_PB3 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB3 1 &pcfg_pull_none>,
                                        /* mac_rxdv */
-                                       <3 RK_PB1 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB1 1 &pcfg_pull_none>,
                                        /* mac_mdc */
-                                       <3 RK_PB0 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB0 1 &pcfg_pull_none>,
                                        /* mac_rxd1 */
-                                       <3 RK_PA7 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PA7 1 &pcfg_pull_none>,
                                        /* mac_rxd0 */
-                                       <3 RK_PA6 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PA6 1 &pcfg_pull_none>,
                                        /* mac_txd1 */
-                                       <3 RK_PA5 RK_FUNC_1 &pcfg_pull_none_13ma>,
+                                       <3 RK_PA5 1 &pcfg_pull_none_13ma>,
                                        /* mac_txd0 */
-                                       <3 RK_PA4 RK_FUNC_1 &pcfg_pull_none_13ma>,
+                                       <3 RK_PA4 1 &pcfg_pull_none_13ma>,
                                        /* mac_rxd3 */
-                                       <3 RK_PA3 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PA3 1 &pcfg_pull_none>,
                                        /* mac_rxd2 */
-                                       <3 RK_PA2 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PA2 1 &pcfg_pull_none>,
                                        /* mac_txd3 */
-                                       <3 RK_PA1 RK_FUNC_1 &pcfg_pull_none_13ma>,
+                                       <3 RK_PA1 1 &pcfg_pull_none_13ma>,
                                        /* mac_txd2 */
-                                       <3 RK_PA0 RK_FUNC_1 &pcfg_pull_none_13ma>;
+                                       <3 RK_PA0 1 &pcfg_pull_none_13ma>;
                        };
 
                        rmii_pins: rmii-pins {
                                rockchip,pins =
                                        /* mac_mdio */
-                                       <3 RK_PB5 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB5 1 &pcfg_pull_none>,
                                        /* mac_txen */
-                                       <3 RK_PB4 RK_FUNC_1 &pcfg_pull_none_13ma>,
+                                       <3 RK_PB4 1 &pcfg_pull_none_13ma>,
                                        /* mac_clk */
-                                       <3 RK_PB3 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB3 1 &pcfg_pull_none>,
                                        /* mac_rxer */
-                                       <3 RK_PB2 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB2 1 &pcfg_pull_none>,
                                        /* mac_rxdv */
-                                       <3 RK_PB1 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB1 1 &pcfg_pull_none>,
                                        /* mac_mdc */
-                                       <3 RK_PB0 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PB0 1 &pcfg_pull_none>,
                                        /* mac_rxd1 */
-                                       <3 RK_PA7 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PA7 1 &pcfg_pull_none>,
                                        /* mac_rxd0 */
-                                       <3 RK_PA6 RK_FUNC_1 &pcfg_pull_none>,
+                                       <3 RK_PA6 1 &pcfg_pull_none>,
                                        /* mac_txd1 */
-                                       <3 RK_PA5 RK_FUNC_1 &pcfg_pull_none_13ma>,
+                                       <3 RK_PA5 1 &pcfg_pull_none_13ma>,
                                        /* mac_txd0 */
-                                       <3 RK_PA4 RK_FUNC_1 &pcfg_pull_none_13ma>;
+                                       <3 RK_PA4 1 &pcfg_pull_none_13ma>;
                        };
                };
 
                i2c0 {
                        i2c0_xfer: i2c0-xfer {
                                rockchip,pins =
-                                       <1 RK_PB7 RK_FUNC_2 &pcfg_pull_none>,
-                                       <1 RK_PC0 RK_FUNC_2 &pcfg_pull_none>;
+                                       <1 RK_PB7 2 &pcfg_pull_none>,
+                                       <1 RK_PC0 2 &pcfg_pull_none>;
                        };
                };
 
                i2c1 {
                        i2c1_xfer: i2c1-xfer {
                                rockchip,pins =
-                                       <4 RK_PA2 RK_FUNC_1 &pcfg_pull_none>,
-                                       <4 RK_PA1 RK_FUNC_1 &pcfg_pull_none>;
+                                       <4 RK_PA2 1 &pcfg_pull_none>,
+                                       <4 RK_PA1 1 &pcfg_pull_none>;
                        };
                };
 
                i2c2 {
                        i2c2_xfer: i2c2-xfer {
                                rockchip,pins =
-                                       <2 RK_PA1 RK_FUNC_2 &pcfg_pull_none_12ma>,
-                                       <2 RK_PA0 RK_FUNC_2 &pcfg_pull_none_12ma>;
+                                       <2 RK_PA1 2 &pcfg_pull_none_12ma>,
+                                       <2 RK_PA0 2 &pcfg_pull_none_12ma>;
                        };
                };
 
                i2c3 {
                        i2c3_xfer: i2c3-xfer {
                                rockchip,pins =
-                                       <4 RK_PC1 RK_FUNC_1 &pcfg_pull_none>,
-                                       <4 RK_PC0 RK_FUNC_1 &pcfg_pull_none>;
+                                       <4 RK_PC1 1 &pcfg_pull_none>,
+                                       <4 RK_PC0 1 &pcfg_pull_none>;
                        };
                };
 
                i2c4 {
                        i2c4_xfer: i2c4-xfer {
                                rockchip,pins =
-                                       <1 RK_PB4 RK_FUNC_1 &pcfg_pull_none>,
-                                       <1 RK_PB3 RK_FUNC_1 &pcfg_pull_none>;
+                                       <1 RK_PB4 1 &pcfg_pull_none>,
+                                       <1 RK_PB3 1 &pcfg_pull_none>;
                        };
                };
 
                i2c5 {
                        i2c5_xfer: i2c5-xfer {
                                rockchip,pins =
-                                       <3 RK_PB3 RK_FUNC_2 &pcfg_pull_none>,
-                                       <3 RK_PB2 RK_FUNC_2 &pcfg_pull_none>;
+                                       <3 RK_PB3 2 &pcfg_pull_none>,
+                                       <3 RK_PB2 2 &pcfg_pull_none>;
                        };
                };
 
                i2c6 {
                        i2c6_xfer: i2c6-xfer {
                                rockchip,pins =
-                                       <2 RK_PB2 RK_FUNC_2 &pcfg_pull_none>,
-                                       <2 RK_PB1 RK_FUNC_2 &pcfg_pull_none>;
+                                       <2 RK_PB2 2 &pcfg_pull_none>,
+                                       <2 RK_PB1 2 &pcfg_pull_none>;
                        };
                };
 
                i2c7 {
                        i2c7_xfer: i2c7-xfer {
                                rockchip,pins =
-                                       <2 RK_PB0 RK_FUNC_2 &pcfg_pull_none>,
-                                       <2 RK_PA7 RK_FUNC_2 &pcfg_pull_none>;
+                                       <2 RK_PB0 2 &pcfg_pull_none>,
+                                       <2 RK_PA7 2 &pcfg_pull_none>;
                        };
                };
 
                i2c8 {
                        i2c8_xfer: i2c8-xfer {
                                rockchip,pins =
-                                       <1 RK_PC5 RK_FUNC_1 &pcfg_pull_none>,
-                                       <1 RK_PC4 RK_FUNC_1 &pcfg_pull_none>;
+                                       <1 RK_PC5 1 &pcfg_pull_none>,
+                                       <1 RK_PC4 1 &pcfg_pull_none>;
                        };
                };
 
                i2s0 {
+                       i2s0_2ch_bus: i2s0-2ch-bus {
+                               rockchip,pins =
+                                       <3 RK_PD0 1 &pcfg_pull_none>,
+                                       <3 RK_PD1 1 &pcfg_pull_none>,
+                                       <3 RK_PD2 1 &pcfg_pull_none>,
+                                       <3 RK_PD3 1 &pcfg_pull_none>,
+                                       <3 RK_PD7 1 &pcfg_pull_none>,
+                                       <4 RK_PA0 1 &pcfg_pull_none>;
+                       };
+
                        i2s0_8ch_bus: i2s0-8ch-bus {
                                rockchip,pins =
-                                       <3 RK_PD0 RK_FUNC_1 &pcfg_pull_none>,
-                                       <3 RK_PD1 RK_FUNC_1 &pcfg_pull_none>,
-                                       <3 RK_PD2 RK_FUNC_1 &pcfg_pull_none>,
-                                       <3 RK_PD3 RK_FUNC_1 &pcfg_pull_none>,
-                                       <3 RK_PD4 RK_FUNC_1 &pcfg_pull_none>,
-                                       <3 RK_PD5 RK_FUNC_1 &pcfg_pull_none>,
-                                       <3 RK_PD6 RK_FUNC_1 &pcfg_pull_none>,
-                                       <3 RK_PD7 RK_FUNC_1 &pcfg_pull_none>,
-                                       <4 RK_PA0 RK_FUNC_1 &pcfg_pull_none>;
+                                       <3 RK_PD0 1 &pcfg_pull_none>,
+                                       <3 RK_PD1 1 &pcfg_pull_none>,
+                                       <3 RK_PD2 1 &pcfg_pull_none>,
+                                       <3 RK_PD3 1 &pcfg_pull_none>,
+                                       <3 RK_PD4 1 &pcfg_pull_none>,
+                                       <3 RK_PD5 1 &pcfg_pull_none>,
+                                       <3 RK_PD6 1 &pcfg_pull_none>,
+                                       <3 RK_PD7 1 &pcfg_pull_none>,
+                                       <4 RK_PA0 1 &pcfg_pull_none>;
                        };
                };
 
                i2s1 {
                        i2s1_2ch_bus: i2s1-2ch-bus {
                                rockchip,pins =
-                                       <4 RK_PA3 RK_FUNC_1 &pcfg_pull_none>,
-                                       <4 RK_PA4 RK_FUNC_1 &pcfg_pull_none>,
-                                       <4 RK_PA5 RK_FUNC_1 &pcfg_pull_none>,
-                                       <4 RK_PA6 RK_FUNC_1 &pcfg_pull_none>,
-                                       <4 RK_PA7 RK_FUNC_1 &pcfg_pull_none>;
+                                       <4 RK_PA3 1 &pcfg_pull_none>,
+                                       <4 RK_PA4 1 &pcfg_pull_none>,
+                                       <4 RK_PA5 1 &pcfg_pull_none>,
+                                       <4 RK_PA6 1 &pcfg_pull_none>,
+                                       <4 RK_PA7 1 &pcfg_pull_none>;
                        };
                };
 
                sdio0 {
                        sdio0_bus1: sdio0-bus1 {
                                rockchip,pins =
-                                       <2 RK_PC4 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PC4 1 &pcfg_pull_up>;
                        };
 
                        sdio0_bus4: sdio0-bus4 {
                                rockchip,pins =
-                                       <2 RK_PC4 RK_FUNC_1 &pcfg_pull_up>,
-                                       <2 RK_PC5 RK_FUNC_1 &pcfg_pull_up>,
-                                       <2 RK_PC6 RK_FUNC_1 &pcfg_pull_up>,
-                                       <2 RK_PC7 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PC4 1 &pcfg_pull_up>,
+                                       <2 RK_PC5 1 &pcfg_pull_up>,
+                                       <2 RK_PC6 1 &pcfg_pull_up>,
+                                       <2 RK_PC7 1 &pcfg_pull_up>;
                        };
 
                        sdio0_cmd: sdio0-cmd {
                                rockchip,pins =
-                                       <2 RK_PD0 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PD0 1 &pcfg_pull_up>;
                        };
 
                        sdio0_clk: sdio0-clk {
                                rockchip,pins =
-                                       <2 RK_PD1 RK_FUNC_1 &pcfg_pull_none>;
+                                       <2 RK_PD1 1 &pcfg_pull_none>;
                        };
 
                        sdio0_cd: sdio0-cd {
                                rockchip,pins =
-                                       <2 RK_PD2 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PD2 1 &pcfg_pull_up>;
                        };
 
                        sdio0_pwr: sdio0-pwr {
                                rockchip,pins =
-                                       <2 RK_PD3 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PD3 1 &pcfg_pull_up>;
                        };
 
                        sdio0_bkpwr: sdio0-bkpwr {
                                rockchip,pins =
-                                       <2 RK_PD4 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PD4 1 &pcfg_pull_up>;
                        };
 
                        sdio0_wp: sdio0-wp {
                                rockchip,pins =
-                                       <0 RK_PA3 RK_FUNC_1 &pcfg_pull_up>;
+                                       <0 RK_PA3 1 &pcfg_pull_up>;
                        };
 
                        sdio0_int: sdio0-int {
                                rockchip,pins =
-                                       <0 RK_PA4 RK_FUNC_1 &pcfg_pull_up>;
+                                       <0 RK_PA4 1 &pcfg_pull_up>;
                        };
                };
 
                sdmmc {
                        sdmmc_bus1: sdmmc-bus1 {
                                rockchip,pins =
-                                       <4 RK_PB0 RK_FUNC_1 &pcfg_pull_up>;
+                                       <4 RK_PB0 1 &pcfg_pull_up>;
                        };
 
                        sdmmc_bus4: sdmmc-bus4 {
                                rockchip,pins =
-                                       <4 RK_PB0 RK_FUNC_1 &pcfg_pull_up>,
-                                       <4 RK_PB1 RK_FUNC_1 &pcfg_pull_up>,
-                                       <4 RK_PB2 RK_FUNC_1 &pcfg_pull_up>,
-                                       <4 RK_PB3 RK_FUNC_1 &pcfg_pull_up>;
+                                       <4 RK_PB0 1 &pcfg_pull_up>,
+                                       <4 RK_PB1 1 &pcfg_pull_up>,
+                                       <4 RK_PB2 1 &pcfg_pull_up>,
+                                       <4 RK_PB3 1 &pcfg_pull_up>;
                        };
 
                        sdmmc_clk: sdmmc-clk {
                                rockchip,pins =
-                                       <4 RK_PB4 RK_FUNC_1 &pcfg_pull_none>;
+                                       <4 RK_PB4 1 &pcfg_pull_none>;
                        };
 
                        sdmmc_cmd: sdmmc-cmd {
                                rockchip,pins =
-                                       <4 RK_PB5 RK_FUNC_1 &pcfg_pull_up>;
+                                       <4 RK_PB5 1 &pcfg_pull_up>;
                        };
 
                        sdmmc_cd: sdmmc-cd {
                                rockchip,pins =
-                                       <0 RK_PA7 RK_FUNC_1 &pcfg_pull_up>;
+                                       <0 RK_PA7 1 &pcfg_pull_up>;
                        };
 
                        sdmmc_wp: sdmmc-wp {
                                rockchip,pins =
-                                       <0 RK_PB0 RK_FUNC_1 &pcfg_pull_up>;
+                                       <0 RK_PB0 1 &pcfg_pull_up>;
                        };
                };
 
                sleep {
                        ap_pwroff: ap-pwroff {
-                               rockchip,pins = <1 RK_PA5 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PA5 1 &pcfg_pull_none>;
                        };
 
                        ddrio_pwroff: ddrio-pwroff {
-                               rockchip,pins = <0 RK_PA1 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <0 RK_PA1 1 &pcfg_pull_none>;
                        };
                };
 
                spdif {
                        spdif_bus: spdif-bus {
                                rockchip,pins =
-                                       <4 RK_PC5 RK_FUNC_1 &pcfg_pull_none>;
+                                       <4 RK_PC5 1 &pcfg_pull_none>;
                        };
 
                        spdif_bus_1: spdif-bus-1 {
                                rockchip,pins =
-                                       <3 RK_PC0 RK_FUNC_3 &pcfg_pull_none>;
+                                       <3 RK_PC0 3 &pcfg_pull_none>;
                        };
                };
 
                spi0 {
                        spi0_clk: spi0-clk {
                                rockchip,pins =
-                                       <3 RK_PA6 RK_FUNC_2 &pcfg_pull_up>;
+                                       <3 RK_PA6 2 &pcfg_pull_up>;
                        };
                        spi0_cs0: spi0-cs0 {
                                rockchip,pins =
-                                       <3 RK_PA7 RK_FUNC_2 &pcfg_pull_up>;
+                                       <3 RK_PA7 2 &pcfg_pull_up>;
                        };
                        spi0_cs1: spi0-cs1 {
                                rockchip,pins =
-                                       <3 RK_PB0 RK_FUNC_2 &pcfg_pull_up>;
+                                       <3 RK_PB0 2 &pcfg_pull_up>;
                        };
                        spi0_tx: spi0-tx {
                                rockchip,pins =
-                                       <3 RK_PA5 RK_FUNC_2 &pcfg_pull_up>;
+                                       <3 RK_PA5 2 &pcfg_pull_up>;
                        };
                        spi0_rx: spi0-rx {
                                rockchip,pins =
-                                       <3 RK_PA4 RK_FUNC_2 &pcfg_pull_up>;
+                                       <3 RK_PA4 2 &pcfg_pull_up>;
                        };
                };
 
                spi1 {
                        spi1_clk: spi1-clk {
                                rockchip,pins =
-                                       <1 RK_PB1 RK_FUNC_2 &pcfg_pull_up>;
+                                       <1 RK_PB1 2 &pcfg_pull_up>;
                        };
                        spi1_cs0: spi1-cs0 {
                                rockchip,pins =
-                                       <1 RK_PB2 RK_FUNC_2 &pcfg_pull_up>;
+                                       <1 RK_PB2 2 &pcfg_pull_up>;
                        };
                        spi1_rx: spi1-rx {
                                rockchip,pins =
-                                       <1 RK_PA7 RK_FUNC_2 &pcfg_pull_up>;
+                                       <1 RK_PA7 2 &pcfg_pull_up>;
                        };
                        spi1_tx: spi1-tx {
                                rockchip,pins =
-                                       <1 RK_PB0 RK_FUNC_2 &pcfg_pull_up>;
+                                       <1 RK_PB0 2 &pcfg_pull_up>;
                        };
                };
 
                spi2 {
                        spi2_clk: spi2-clk {
                                rockchip,pins =
-                                       <2 RK_PB3 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PB3 1 &pcfg_pull_up>;
                        };
                        spi2_cs0: spi2-cs0 {
                                rockchip,pins =
-                                       <2 RK_PB4 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PB4 1 &pcfg_pull_up>;
                        };
                        spi2_rx: spi2-rx {
                                rockchip,pins =
-                                       <2 RK_PB1 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PB1 1 &pcfg_pull_up>;
                        };
                        spi2_tx: spi2-tx {
                                rockchip,pins =
-                                       <2 RK_PB2 RK_FUNC_1 &pcfg_pull_up>;
+                                       <2 RK_PB2 1 &pcfg_pull_up>;
                        };
                };
 
                spi3 {
                        spi3_clk: spi3-clk {
                                rockchip,pins =
-                                       <1 RK_PC1 RK_FUNC_1 &pcfg_pull_up>;
+                                       <1 RK_PC1 1 &pcfg_pull_up>;
                        };
                        spi3_cs0: spi3-cs0 {
                                rockchip,pins =
-                                       <1 RK_PC2 RK_FUNC_1 &pcfg_pull_up>;
+                                       <1 RK_PC2 1 &pcfg_pull_up>;
                        };
                        spi3_rx: spi3-rx {
                                rockchip,pins =
-                                       <1 RK_PB7 RK_FUNC_1 &pcfg_pull_up>;
+                                       <1 RK_PB7 1 &pcfg_pull_up>;
                        };
                        spi3_tx: spi3-tx {
                                rockchip,pins =
-                                       <1 RK_PC0 RK_FUNC_1 &pcfg_pull_up>;
+                                       <1 RK_PC0 1 &pcfg_pull_up>;
                        };
                };
 
                spi4 {
                        spi4_clk: spi4-clk {
                                rockchip,pins =
-                                       <3 RK_PA2 RK_FUNC_2 &pcfg_pull_up>;
+                                       <3 RK_PA2 2 &pcfg_pull_up>;
                        };
                        spi4_cs0: spi4-cs0 {
                                rockchip,pins =
-                                       <3 RK_PA3 RK_FUNC_2 &pcfg_pull_up>;
+                                       <3 RK_PA3 2 &pcfg_pull_up>;
                        };
                        spi4_rx: spi4-rx {
                                rockchip,pins =
-                                       <3 RK_PA0 RK_FUNC_2 &pcfg_pull_up>;
+                                       <3 RK_PA0 2 &pcfg_pull_up>;
                        };
                        spi4_tx: spi4-tx {
                                rockchip,pins =
-                                       <3 RK_PA1 RK_FUNC_2 &pcfg_pull_up>;
+                                       <3 RK_PA1 2 &pcfg_pull_up>;
                        };
                };
 
                spi5 {
                        spi5_clk: spi5-clk {
                                rockchip,pins =
-                                       <2 RK_PC6 RK_FUNC_2 &pcfg_pull_up>;
+                                       <2 RK_PC6 2 &pcfg_pull_up>;
                        };
                        spi5_cs0: spi5-cs0 {
                                rockchip,pins =
-                                       <2 RK_PC7 RK_FUNC_2 &pcfg_pull_up>;
+                                       <2 RK_PC7 2 &pcfg_pull_up>;
                        };
                        spi5_rx: spi5-rx {
                                rockchip,pins =
-                                       <2 RK_PC4 RK_FUNC_2 &pcfg_pull_up>;
+                                       <2 RK_PC4 2 &pcfg_pull_up>;
                        };
                        spi5_tx: spi5-tx {
                                rockchip,pins =
-                                       <2 RK_PC5 RK_FUNC_2 &pcfg_pull_up>;
+                                       <2 RK_PC5 2 &pcfg_pull_up>;
+                       };
+               };
+
+               testclk {
+                       test_clkout0: test-clkout0 {
+                               rockchip,pins =
+                                       <0 RK_PA0 1 &pcfg_pull_none>;
+                       };
+
+                       test_clkout1: test-clkout1 {
+                               rockchip,pins =
+                                       <2 RK_PD1 2 &pcfg_pull_none>;
+                       };
+
+                       test_clkout2: test-clkout2 {
+                               rockchip,pins =
+                                       <0 RK_PB0 3 &pcfg_pull_none>;
                        };
                };
 
                        };
 
                        otp_out: otp-out {
-                               rockchip,pins = <1 RK_PA6 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <1 RK_PA6 1 &pcfg_pull_none>;
                        };
                };
 
                uart0 {
                        uart0_xfer: uart0-xfer {
                                rockchip,pins =
-                                       <2 RK_PC0 RK_FUNC_1 &pcfg_pull_up>,
-                                       <2 RK_PC1 RK_FUNC_1 &pcfg_pull_none>;
+                                       <2 RK_PC0 1 &pcfg_pull_up>,
+                                       <2 RK_PC1 1 &pcfg_pull_none>;
                        };
 
                        uart0_cts: uart0-cts {
                                rockchip,pins =
-                                       <2 RK_PC2 RK_FUNC_1 &pcfg_pull_none>;
+                                       <2 RK_PC2 1 &pcfg_pull_none>;
                        };
 
                        uart0_rts: uart0-rts {
                                rockchip,pins =
-                                       <2 RK_PC3 RK_FUNC_1 &pcfg_pull_none>;
+                                       <2 RK_PC3 1 &pcfg_pull_none>;
                        };
                };
 
                uart1 {
                        uart1_xfer: uart1-xfer {
                                rockchip,pins =
-                                       <3 RK_PB4 RK_FUNC_2 &pcfg_pull_up>,
-                                       <3 RK_PB5 RK_FUNC_2 &pcfg_pull_none>;
+                                       <3 RK_PB4 2 &pcfg_pull_up>,
+                                       <3 RK_PB5 2 &pcfg_pull_none>;
                        };
                };
 
                uart2a {
                        uart2a_xfer: uart2a-xfer {
                                rockchip,pins =
-                                       <4 RK_PB0 RK_FUNC_2 &pcfg_pull_up>,
-                                       <4 RK_PB1 RK_FUNC_2 &pcfg_pull_none>;
+                                       <4 RK_PB0 2 &pcfg_pull_up>,
+                                       <4 RK_PB1 2 &pcfg_pull_none>;
                        };
                };
 
                uart2b {
                        uart2b_xfer: uart2b-xfer {
                                rockchip,pins =
-                                       <4 RK_PC0 RK_FUNC_2 &pcfg_pull_up>,
-                                       <4 RK_PC1 RK_FUNC_2 &pcfg_pull_none>;
+                                       <4 RK_PC0 2 &pcfg_pull_up>,
+                                       <4 RK_PC1 2 &pcfg_pull_none>;
                        };
                };
 
                uart2c {
                        uart2c_xfer: uart2c-xfer {
                                rockchip,pins =
-                                       <4 RK_PC3 RK_FUNC_1 &pcfg_pull_up>,
-                                       <4 RK_PC4 RK_FUNC_1 &pcfg_pull_none>;
+                                       <4 RK_PC3 1 &pcfg_pull_up>,
+                                       <4 RK_PC4 1 &pcfg_pull_none>;
                        };
                };
 
                uart3 {
                        uart3_xfer: uart3-xfer {
                                rockchip,pins =
-                                       <3 RK_PB6 RK_FUNC_2 &pcfg_pull_up>,
-                                       <3 RK_PB7 RK_FUNC_2 &pcfg_pull_none>;
+                                       <3 RK_PB6 2 &pcfg_pull_up>,
+                                       <3 RK_PB7 2 &pcfg_pull_none>;
                        };
 
                        uart3_cts: uart3-cts {
                                rockchip,pins =
-                                       <3 RK_PC2 RK_FUNC_2 &pcfg_pull_none>;
+                                       <3 RK_PC2 &pcfg_pull_none>;
                        };
 
                        uart3_rts: uart3-rts {
                                rockchip,pins =
-                                       <3 RK_PC3 RK_FUNC_2 &pcfg_pull_none>;
+                                       <3 RK_PC2 &pcfg_pull_none>;
                        };
                };
 
                uart4 {
                        uart4_xfer: uart4-xfer {
                                rockchip,pins =
-                                       <1 RK_PA7 RK_FUNC_1 &pcfg_pull_up>,
-                                       <1 RK_PB0 RK_FUNC_1 &pcfg_pull_none>;
+                                       <1 RK_PA7 1 &pcfg_pull_up>,
+                                       <1 RK_PB0 1 &pcfg_pull_none>;
                        };
                };
 
                uarthdcp {
                        uarthdcp_xfer: uarthdcp-xfer {
                                rockchip,pins =
-                                       <4 RK_PC5 RK_FUNC_2 &pcfg_pull_up>,
-                                       <4 RK_PC6 RK_FUNC_2 &pcfg_pull_none>;
+                                       <4 RK_PC5 2 &pcfg_pull_up>,
+                                       <4 RK_PC6 2 &pcfg_pull_none>;
                        };
                };
 
                pwm0 {
                        pwm0_pin: pwm0-pin {
                                rockchip,pins =
-                                       <4 RK_PC2 RK_FUNC_1 &pcfg_pull_none>;
+                                       <4 RK_PC2 1 &pcfg_pull_none>;
+                       };
+
+                       pwm0_pin_pull_down: pwm0-pin-pull-down {
+                               rockchip,pins =
+                                       <4 RK_PC2 1 &pcfg_pull_down>;
                        };
 
                        vop0_pwm_pin: vop0-pwm-pin {
                                rockchip,pins =
-                                       <4 RK_PC2 RK_FUNC_2 &pcfg_pull_none>;
+                                       <4 RK_PC2 2 &pcfg_pull_none>;
+                       };
+
+                       vop1_pwm_pin: vop1-pwm-pin {
+                               rockchip,pins =
+                                       <4 RK_PC2 3 &pcfg_pull_none>;
                        };
                };
 
                pwm1 {
                        pwm1_pin: pwm1-pin {
                                rockchip,pins =
-                                       <4 RK_PC6 RK_FUNC_1 &pcfg_pull_none>;
+                                       <4 RK_PC6 1 &pcfg_pull_none>;
                        };
 
-                       vop1_pwm_pin: vop1-pwm-pin {
+                       pwm1_pin_pull_down: pwm1-pin-pull-down {
                                rockchip,pins =
-                                       <4 RK_PC2 RK_FUNC_3 &pcfg_pull_none>;
+                                       <4 RK_PC6 1 &pcfg_pull_down>;
                        };
                };
 
                pwm2 {
                        pwm2_pin: pwm2-pin {
                                rockchip,pins =
-                                       <1 RK_PC3 RK_FUNC_1 &pcfg_pull_none>;
+                                       <1 RK_PC3 1 &pcfg_pull_none>;
                        };
 
                        pwm2_pin_pull_down: pwm2-pin-pull-down {
                                rockchip,pins =
-                                       <1 RK_PC3 RK_FUNC_1 &pcfg_pull_down>;
+                                       <1 RK_PC3 1 &pcfg_pull_down>;
                        };
                };
 
                pwm3a {
                        pwm3a_pin: pwm3a-pin {
                                rockchip,pins =
-                                       <0 RK_PA6 RK_FUNC_1 &pcfg_pull_none>;
+                                       <0 RK_PA6 1 &pcfg_pull_none>;
                        };
                };
 
                pwm3b {
                        pwm3b_pin: pwm3b-pin {
                                rockchip,pins =
-                                       <1 RK_PB6 RK_FUNC_1 &pcfg_pull_none>;
+                                       <1 RK_PB6 1 &pcfg_pull_none>;
                        };
                };
 
                hdmi {
                        hdmi_i2c_xfer: hdmi-i2c-xfer {
                                rockchip,pins =
-                                       <4 RK_PC1 RK_FUNC_3 &pcfg_pull_none>,
-                                       <4 RK_PC0 RK_FUNC_3 &pcfg_pull_none>;
+                                       <4 RK_PC1 3 &pcfg_pull_none>,
+                                       <4 RK_PC0 3 &pcfg_pull_none>;
                        };
 
                        hdmi_cec: hdmi-cec {
                                rockchip,pins =
-                                       <4 RK_PC7 RK_FUNC_1 &pcfg_pull_none>;
+                                       <4 RK_PC7 1 &pcfg_pull_none>;
                        };
                };
 
                pcie {
-                       pcie_clkreqn: pci-clkreqn {
-                               rockchip,pins =
-                                       <2 RK_PD2 RK_FUNC_2 &pcfg_pull_none>;
-                       };
-
-                       pcie_clkreqnb: pci-clkreqnb {
-                               rockchip,pins =
-                                       <4 RK_PD0 RK_FUNC_1 &pcfg_pull_none>;
-                       };
-
                        pcie_clkreqn_cpm: pci-clkreqn-cpm {
                                rockchip,pins =
                                        <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
index 96c4f54f4a481f13a8cdc085c5478136e8759e04..4733c0793c36bba719537f602d59535c175a852f 100644 (file)
@@ -10,7 +10,6 @@
 
 /* Architecture, CPU, chip, etc */
 #define CONFIG_IPROC
-#define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
 
 /* Memory Info */
 #define CONFIG_SYS_SDRAM_BASE          0x61000000
index 81ccead1127d7729b954176d6a06b8ea60280eb0..a3147fde146d9197b372b36ecfb9eab5931bb64d 100644 (file)
@@ -485,6 +485,14 @@ enum dcache_option {
 };
 #endif
 
+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
+#define DCACHE_DEFAULT_OPTION  DCACHE_WRITETHROUGH
+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
+#define DCACHE_DEFAULT_OPTION  DCACHE_WRITEALLOC
+#elif defined(CONFIG_SYS_ARM_CACHE_WRITEBACK)
+#define DCACHE_DEFAULT_OPTION  DCACHE_WRITEBACK
+#endif
+
 /* Size of an MMU section */
 enum {
 #ifdef CONFIG_ARMV7_LPAE
index f8d20960da9d6173e2985c5fbcb486eb62438554..f803d6fb8ce97b29909015f039daa5d50d86e7dd 100644 (file)
@@ -61,8 +61,11 @@ void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
        unsigned long startpt, stoppt;
        unsigned long upto, end;
 
-       end = ALIGN(start + size, MMU_SECTION_SIZE) >> MMU_SECTION_SHIFT;
+       /* div by 2 before start + size to avoid phys_addr_t overflow */
+       end = ALIGN((start / 2) + (size / 2), MMU_SECTION_SIZE / 2)
+             >> (MMU_SECTION_SHIFT - 1);
        start = start >> MMU_SECTION_SHIFT;
+
 #ifdef CONFIG_ARMV7_LPAE
        debug("%s: start=%pa, size=%zu, option=%llx\n", __func__, &start, size,
              option);
@@ -91,19 +94,16 @@ __weak void dram_bank_mmu_setup(int bank)
        bd_t *bd = gd->bd;
        int     i;
 
+       /* bd->bi_dram is available only after relocation */
+       if ((gd->flags & GD_FLG_RELOC) == 0)
+               return;
+
        debug("%s: bank: %d\n", __func__, bank);
        for (i = bd->bi_dram[bank].start >> MMU_SECTION_SHIFT;
             i < (bd->bi_dram[bank].start >> MMU_SECTION_SHIFT) +
                 (bd->bi_dram[bank].size >> MMU_SECTION_SHIFT);
-            i++) {
-#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
-               set_section_dcache(i, DCACHE_WRITETHROUGH);
-#elif defined(CONFIG_SYS_ARM_CACHE_WRITEALLOC)
-               set_section_dcache(i, DCACHE_WRITEALLOC);
-#else
-               set_section_dcache(i, DCACHE_WRITEBACK);
-#endif
-       }
+            i++)
+               set_section_dcache(i, DCACHE_DEFAULT_OPTION);
 }
 
 /* to activate the MMU we need to set up virtual memory: use 1M areas */
index 44dde26065b1f338ff8e7f541a1f70c7207f135f..224f2aef14db6146471345fbd9fd801379fad405 100644 (file)
@@ -75,6 +75,15 @@ static unsigned long noncached_start;
 static unsigned long noncached_end;
 static unsigned long noncached_next;
 
+void noncached_set_region(void)
+{
+#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
+       mmu_set_region_dcache_behaviour(noncached_start,
+                                       noncached_end - noncached_start,
+                                       DCACHE_OFF);
+#endif
+}
+
 void noncached_init(void)
 {
        phys_addr_t start, end;
@@ -91,9 +100,7 @@ void noncached_init(void)
        noncached_end = end;
        noncached_next = start;
 
-#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
-       mmu_set_region_dcache_behaviour(noncached_start, size, DCACHE_OFF);
-#endif
+       noncached_set_region();
 }
 
 phys_addr_t noncached_alloc(size_t size, size_t align)
index 6dbf03b00cd5c98ac0eeb61b2296cfe4a14e072a..36299d6e54315d196db182e8110a02b3febf1ae1 100644 (file)
@@ -34,6 +34,8 @@ int interrupt_init(void)
         */
        IRQ_STACK_START_IN = gd->irq_sp + 8;
 
+       enable_interrupts();
+
        return 0;
 }
 
index dffdf57aa2029127e2e856f141e035f793ccc69b..a2df7cf193c57966b8db2e634de58e6e1d1f3567 100644 (file)
@@ -13,6 +13,8 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int interrupt_init(void)
 {
+       enable_interrupts();
+
        return 0;
 }
 
index 1f6fdf2995d88633496a3e7287d6a8d2972e7d1d..2ae1c5ba76c937e420014b6a77e3abe48729c766 100644 (file)
@@ -31,6 +31,8 @@ struct autosave_regs {
 
 int interrupt_init(void)
 {
+       enable_interrupts();
+
        return 0;
 }
 
index 3195351c9c38ef29fe7adaf85fb69c8718c92f52..7eb005f45014048b08c18a8382146f6a10864af3 100644 (file)
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 dtb-$(CONFIG_TARGET_MPC8548CDS) += mpc8548cds.dtb mpc8548cds_36b.dtb
+dtb-$(CONFIG_TARGET_P1010RDB_PA) += p1010rdb-pa.dtb p1010rdb-pa_36b.dtb
+dtb-$(CONFIG_TARGET_P1010RDB_PB) += p1010rdb-pb.dtb p1010rdb-pb_36b.dtb
 dtb-$(CONFIG_TARGET_P1020RDB_PC) += p1020rdb-pc.dtb p1020rdb-pc_36b.dtb
 dtb-$(CONFIG_TARGET_P1020RDB_PD) += p1020rdb-pd.dtb
 dtb-$(CONFIG_TARGET_P2020RDB) += p2020rdb-pc.dtb p2020rdb-pc_36b.dtb
diff --git a/arch/powerpc/dts/p1010rdb-pa.dts b/arch/powerpc/dts/p1010rdb-pa.dts
new file mode 100644 (file)
index 0000000..c66c492
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * P1010 RDB Device Tree Source
+ *
+ * Copyright 2020 NXP
+ */
+
+/include/ "p1010si-pre.dtsi"
+
+/ {
+       model = "fsl,P1010RDB";
+       compatible = "fsl,P1010RDB";
+
+       /include/ "p1010rdb_32b.dtsi"
+};
+
+/include/ "p1010si-post.dtsi"
diff --git a/arch/powerpc/dts/p1010rdb-pa_36b.dts b/arch/powerpc/dts/p1010rdb-pa_36b.dts
new file mode 100644 (file)
index 0000000..b943de7
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * P1010 RDB Device Tree Source (36-bit address map)
+ *
+ * Copyright 2020 NXP
+ */
+
+/include/ "p1010si-pre.dtsi"
+
+/ {
+       model = "fsl,P1010RDB";
+       compatible = "fsl,P1010RDB";
+
+       /include/ "p1010rdb_36b.dtsi"
+};
+
+/include/ "p1010si-post.dtsi"
diff --git a/arch/powerpc/dts/p1010rdb-pb.dts b/arch/powerpc/dts/p1010rdb-pb.dts
new file mode 100644 (file)
index 0000000..9ca5625
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * P1010RDB Device Tree Source
+ *
+ * Copyright 2020 NXP
+ */
+
+/include/ "p1010si-pre.dtsi"
+
+/ {
+       model = "fsl,P1010RDB-PB";
+       compatible = "fsl,P1010RDB-PB";
+
+       /include/ "p1010rdb_32b.dtsi"
+};
+
+/include/ "p1010si-post.dtsi"
+/include/ "p1010rdb.dtsi"
diff --git a/arch/powerpc/dts/p1010rdb-pb_36b.dts b/arch/powerpc/dts/p1010rdb-pb_36b.dts
new file mode 100644 (file)
index 0000000..eeff2a8
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * P1010 RDB Device Tree Source (36-bit address map)
+ *
+ * Copyright 2020 NXP
+ */
+
+/include/ "p1010si-pre.dtsi"
+
+/ {
+       model = "fsl,P1010RDB-PB";
+       compatible = "fsl,P1010RDB-PB";
+
+       /include/ "p1010rdb_36b.dtsi"
+};
+
+/include/ "p1010si-post.dtsi"
+/include/ "p1010rdb.dtsi"
diff --git a/arch/powerpc/dts/p1010rdb.dtsi b/arch/powerpc/dts/p1010rdb.dtsi
new file mode 100644 (file)
index 0000000..4f58ee2
--- /dev/null
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * P1010RDB Device Tree Source
+ *
+ * Copyright 2020 NXP
+ */
+&soc {
+       i2c@3000 {
+               rtc@68 {
+                       compatible = "pericom,pt7c4338";
+                       reg = <0x68>;
+               };
+       };
+};
diff --git a/arch/powerpc/dts/p1010rdb_32b.dtsi b/arch/powerpc/dts/p1010rdb_32b.dtsi
new file mode 100644 (file)
index 0000000..5da790d
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * P1010RDB Device Tree Source
+ *
+ * Copyright 2020 NXP
+ */
+
+soc: soc@ffe00000 {
+       ranges = <0x0 0x0 0xffe00000 0x100000>;
+};
+
+pci1: pcie@ffe09000 {
+       reg = <0 0xffe09000 0 0x1000>;
+       ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
+                 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
+};
+
+pci0: pcie@ffe0a000 {
+       reg = <0 0xffe0a000 0 0x1000>;
+       ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
+                 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
+};
diff --git a/arch/powerpc/dts/p1010rdb_36b.dtsi b/arch/powerpc/dts/p1010rdb_36b.dtsi
new file mode 100644 (file)
index 0000000..54dd16e
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * P1010RDB Device Tree Source (36-bit address map)
+ *
+ * Copyright 2020 NXP
+ */
+
+soc: soc@fffe00000 {
+       ranges = <0x0 0xf 0xffe00000 0x100000>;
+};
+
+pci1: pcie@fffe09000 {
+       reg = <0xf 0xffe09000 0 0x1000>;
+       ranges = <0x2000000 0x0 0xc0000000 0xc 0x20000000 0x0 0x20000000
+                 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>;
+};
+
+pci0: pcie@fffe0a000 {
+       reg = <0xf 0xffe0a000 0 0x1000>;
+       ranges = <0x2000000 0x0 0xc0000000 0xc 0x20000000 0x0 0x20000000
+                 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>;
+};
diff --git a/arch/powerpc/dts/p1010si-post.dtsi b/arch/powerpc/dts/p1010si-post.dtsi
new file mode 100644 (file)
index 0000000..0289441
--- /dev/null
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * P1010 Silicon/SoC Device Tree Source (post include)
+ *
+ * Copyright 2020 NXP
+ */
+
+&soc {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       device_type = "soc";
+       compatible = "fsl,p1010-immr", "simple-bus";
+       bus-frequency = <0>;
+
+       mpic: pic@40000 {
+               interrupt-controller;
+               #address-cells = <0>;
+               #interrupt-cells = <4>;
+               reg = <0x40000 0x40000>;
+               compatible = "fsl,mpic";
+               device_type = "open-pic";
+               big-endian;
+               single-cpu-affinity;
+               last-interrupt-source = <255>;
+       };
+/include/ "pq3-i2c-0.dtsi"
+/include/ "pq3-i2c-1.dtsi"
+};
+
+/* controller at 0x9000 */
+&pci1 {
+       compatible = "fsl,pcie-p1_p2", "fsl,pcie-fsl-qoriq";
+       law_trgt_if = <1>;
+       #address-cells = <3>;
+       #size-cells = <2>;
+       device_type = "pci";
+       bus-range = <0x0 0xff>;
+};
+
+/* controller at 0xa000 */
+&pci0 {
+       compatible = "fsl,pcie-p1_p2", "fsl,pcie-fsl-qoriq";
+       law_trgt_if = <2>;
+       #address-cells = <3>;
+       #size-cells = <2>;
+       device_type = "pci";
+       bus-range = <0x0 0xff>;
+};
diff --git a/arch/powerpc/dts/p1010si-pre.dtsi b/arch/powerpc/dts/p1010si-pre.dtsi
new file mode 100644 (file)
index 0000000..9d7bb6c
--- /dev/null
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * P1010 Silicon/SoC Device Tree Source (pre include)
+ *
+ * Copyright 2020 NXP
+ */
+
+/dts-v1/;
+
+/include/ "e500v2_power_isa.dtsi"
+
+/ {
+       compatible = "fsl,P1010";
+       #address-cells = <2>;
+       #size-cells = <2>;
+       interrupt-parent = <&mpic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               PowerPC,P1010@0 {
+                       device_type = "cpu";
+                       reg = <0x0>;
+               };
+       };
+};
index 1c77702f01e772686d440909cffc976cc20553fb..1dce8e86e9a3c0c143e68f6f1e15d9a076305298 100644 (file)
@@ -44,6 +44,8 @@
                clock-frequency = <0>;
        };
 
+       /include/ "pq3-i2c-0.dtsi"
+       /include/ "pq3-i2c-1.dtsi"
 };
 
 /* PCIe controller base address 0x9000 */
index 5bbd5c5468185793ab6f037268ca88c5919f1218..4ed093dad4eda7d75149c737650e2b785a5cb61c 100644 (file)
@@ -37,6 +37,9 @@
                /* Filled in by U-Boot */
                clock-frequency = <0>;
        };
+
+       /include/ "pq3-i2c-0.dtsi"
+       /include/ "pq3-i2c-1.dtsi"
 };
 
 /* PCIe controller base address 0x8000 */
index 0f5e7dbdc8107ac4abf5936370bbea37bf47c79e..95931e299d8c871ef5a4bbafec3c37e1312af3b2 100644 (file)
@@ -3,7 +3,7 @@
  * P2041 Silicon/SoC Device Tree Source (pre include)
  *
  * Copyright 2011 - 2015 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2020 NXP
  */
 
 /dts-v1/;
@@ -86,6 +86,9 @@
                        reg = <0x114000 0x1000>;
                        clock-frequency = <0>;
                };
+
+               /include/ "qoriq-i2c-0.dtsi"
+               /include/ "qoriq-i2c-1.dtsi"
        };
 
        pcie@ffe200000 {
index 6736d000356354cc14cc9055986f26f48210a27b..3152683b84634d40641b8ad3091c404f49c809e1 100644 (file)
@@ -3,7 +3,7 @@
  * P3041 Silicon/SoC Device Tree Source (pre include)
  *
  * Copyright 2010 - 2015 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2020 NXP
  */
 
 /dts-v1/;
@@ -86,6 +86,8 @@
                        reg = <0x114000 0x1000>;
                        clock-frequency = <0>;
                };
+               /include/ "qoriq-i2c-0.dtsi"
+               /include/ "qoriq-i2c-1.dtsi"
        };
 
        pcie@ffe200000 {
index 02f39fbfcb390e0680a0401b2ccf100943fb5c0c..4a80561e1881b3653e8da0e3513f80db133d7a87 100644 (file)
@@ -3,7 +3,7 @@
  * P4080/P4040 Silicon/SoC Device Tree Source (pre include)
  *
  * Copyright 2011 - 2015 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2020 NXP
  */
 
 /dts-v1/;
@@ -97,6 +97,8 @@
                        reg = <0x211000 0x1000>;
                        phy_type = "ulpi";
                };
+               /include/ "qoriq-i2c-0.dtsi"
+               /include/ "qoriq-i2c-1.dtsi"
        };
 
        pcie@ffe200000 {
index 67a62a77253de80eb90f01152f0c4c252eb5836d..45988574a2e7b3a6ee23bcc742a501548773730d 100644 (file)
@@ -3,7 +3,7 @@
  * P5040 Silicon/SoC Device Tree Source (pre include)
  *
  * Copyright 2012 - 2015 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2020 NXP
  */
 
 /dts-v1/;
@@ -85,6 +85,9 @@
                        reg = <0x114000 0x1000>;
                        clock-frequency = <0>;
                };
+
+               /include/ "qoriq-i2c-0.dtsi"
+               /include/ "qoriq-i2c-1.dtsi"
        };
 
        pcie@ffe200000 {
diff --git a/arch/powerpc/dts/pq3-i2c-0.dtsi b/arch/powerpc/dts/pq3-i2c-0.dtsi
new file mode 100644 (file)
index 0000000..86a91e6
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * PQ3 I2C Device Tree stub
+ *
+ * Copyright 2020 NXP
+ */
+i2c@3000 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cell-index = <0>;
+       compatible = "fsl-i2c";
+       u-boot,dm-pre-reloc;
+       reg = <0x3000 0x100>;
+       interrupts = <43 2 0 0>;
+};
diff --git a/arch/powerpc/dts/pq3-i2c-1.dtsi b/arch/powerpc/dts/pq3-i2c-1.dtsi
new file mode 100644 (file)
index 0000000..5d79b1f
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * PQ3 I2C Device Tree stub
+ *
+ * Copyright 2020 NXP
+ */
+i2c@3100 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cell-index = <1>;
+       compatible = "fsl-i2c";
+       u-boot,dm-pre-reloc;
+       reg = <0x3100 0x100>;
+       interrupts = <43 2 0 0>;
+};
diff --git a/arch/powerpc/dts/qoriq-i2c-0.dtsi b/arch/powerpc/dts/qoriq-i2c-0.dtsi
new file mode 100644 (file)
index 0000000..9d0ab88
--- /dev/null
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * QorIQ I2C Device Tree stub
+ *
+ * Copyright 2020 NXP
+ */
+i2c0: i2c@118000 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cell-index = <0>;
+       compatible = "fsl-i2c";
+       u-boot,dm-pre-reloc;
+       reg = <0x118000 0x100>;
+       interrupts = <38 2 0 0>;
+};
+
+i2c1: i2c@118100 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cell-index = <1>;
+       compatible = "fsl-i2c";
+       u-boot,dm-pre-reloc;
+       reg = <0x118100 0x100>;
+       interrupts = <38 2 0 0>;
+};
diff --git a/arch/powerpc/dts/qoriq-i2c-1.dtsi b/arch/powerpc/dts/qoriq-i2c-1.dtsi
new file mode 100644 (file)
index 0000000..de0a22e
--- /dev/null
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * QorIQ I2C Device Tree stub
+ *
+ * Copyright 2020 NXP
+ */
+i2c2: i2c@119000 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cell-index = <2>;
+       compatible = "fsl-i2c";
+       u-boot,dm-pre-reloc;
+       reg = <0x119000 0x100>;
+       interrupts = <39 2 0 0>;
+};
+
+i2c3: i2c@119100 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cell-index = <3>;
+       compatible = "fsl-i2c";
+       u-boot,dm-pre-reloc;
+       reg = <0x119100 0x100>;
+       interrupts = <39 2 0 0>;
+};
index a6b821a76afc475da8aa31e01d98080472181ebf..521825d85a4c9ed735ffec092d9d765c6aa8416d 100644 (file)
@@ -3,7 +3,7 @@
  * T102X Silicon/SoC Device Tree Source (pre include)
  *
  * Copyright 2013 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2020 NXP
  */
 
 /dts-v1/;
@@ -75,6 +75,8 @@
                        reg = <0x114000 0x1000>;
                        clock-frequency = <0>;
                };
+               /include/ "qoriq-i2c-0.dtsi"
+               /include/ "qoriq-i2c-1.dtsi"
        };
 
        pcie@ffe240000 {
index 093aaab834b7a9b1344465224996c53f40dba327..0a08a69f31ae3863850bacee005335c6926c32da 100644 (file)
@@ -3,7 +3,7 @@
  * T104X Silicon/SoC Device Tree Source (pre include)
  *
  * Copyright 2013 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2020 NXP
  */
 
 /dts-v1/;
@@ -85,6 +85,8 @@
                        reg = <0x114000 0x1000>;
                        clock-frequency = <0>;
                };
+               /include/ "qoriq-i2c-0.dtsi"
+               /include/ "qoriq-i2c-1.dtsi"
        };
 
        pcie@ffe240000 {
index 458019ae92f1e2994cd0c259203a9190bb23b688..a9e9b404f66f04c75b65502c8ea081dffdbc871d 100644 (file)
@@ -3,7 +3,7 @@
  * T2080/T2081 Silicon/SoC Device Tree Source (pre include)
  *
  * Copyright 2013 Freescale Semiconductor Inc.
- * Copyright 2018 NXP
+ * Copyright 2018,2020 NXP
  */
 
 /dts-v1/;
@@ -96,6 +96,8 @@
                        sata-number = <2>;
                        sata-fpdma = <0>;
                };
+               /include/ "qoriq-i2c-0.dtsi"
+               /include/ "qoriq-i2c-1.dtsi"
        };
 
        pcie@ffe240000 {
index 43f98cd9e1630e884f835e0080d4e0bf56632d7a..9b5902fe9e228167cd99ec33b7c4711fdfc5fca8 100644 (file)
@@ -3,7 +3,7 @@
  * T4240 Silicon/SoC Device Tree Source (pre include)
  *
  * Copyright 2013 Freescale Semiconductor Inc.
- * Copyright 2019 NXP
+ * Copyright 2019-2020 NXP
  */
 
 /dts-v1/;
                        reg = <0x114000 0x1000>;
                        clock-frequency = <0>;
                };
+
+               /include/ "qoriq-i2c-0.dtsi"
+               /include/ "qoriq-i2c-1.dtsi"
        };
 
        pcie@ffe240000 {
diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
new file mode 100644 (file)
index 0000000..2aebfab
--- /dev/null
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+ */
+
+/ {
+       aliases {
+               spi0 = &qspi0;
+               spi2 = &qspi2;
+       };
+};
index 4bccfbe6e1b1d3fe2ac67df60fd1d167b341f795..15cd2330a38109d64a9842fd8b67d1bc0f1fdb6f 100644 (file)
                broken;
        };
 
+       phy_provider2: gen_phy@2 {
+               compatible = "sandbox,phy";
+               #phy-cells = <0>;
+       };
+
        gen_phy_user: gen_phy_user {
                compatible = "simple-bus";
                phys = <&phy_provider0 0>, <&phy_provider0 1>, <&phy_provider1>;
                phy-names = "phy1", "phy2", "phy3";
        };
 
+       gen_phy_user1: gen_phy_user1 {
+               compatible = "simple-bus";
+               phys = <&phy_provider0 0>, <&phy_provider2>;
+               phy-names = "phy1", "phy2";
+       };
+
        some-bus {
                #address-cells = <1>;
                #size-cells = <0>;
                compatible = "denx,u-boot-fdt-test1";
        };
 
+       i-test {
+               compatible = "mediatek,u-boot-fdt-test";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               subnode@0 {
+                       reg = <0>;
+               };
+
+               subnode@1 {
+                       reg = <1>;
+               };
+
+               subnode@2 {
+                       reg = <2>;
+               };
+       };
+
        devres-test {
                compatible = "denx,u-boot-devres-test";
        };
index 307267a8fb33b9a19b56b5fb4e075fc4dea258e7..ee0499f5d797ee273a95c57c233d4a7594c4b818 100644 (file)
@@ -54,9 +54,11 @@ obj-$(CONFIG_INTEL_QUARK) += quark/
 obj-$(CONFIG_INTEL_QUEENSBAY) += queensbay/
 obj-$(CONFIG_INTEL_TANGIER) += tangier/
 obj-$(CONFIG_APIC) += lapic.o ioapic.o
-obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += irq.o
 obj-$(CONFIG_$(SPL_TPL_)ACPI_GPE) += acpi_gpe.o
 obj-$(CONFIG_QFW) += qfw_cpu.o
+ifndef CONFIG_SYS_COREBOOT
+obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += irq.o
+endif
 ifndef CONFIG_$(SPL_)X86_64
 obj-$(CONFIG_SMP) += mp_init.o
 endif
index c8e6a889d023b25159e2d985c99cd182a6103492..497d6284ac19ddd6cec8752ddb3fae1db9f7b245 100644 (file)
@@ -25,5 +25,6 @@ config SYS_COREBOOT
        imply FS_CBFS
        imply CBMEM_CONSOLE
        imply X86_TSC_READ_BASE
+       select BINMAN if X86_64
 
 endif
index 35b15bb1da8df3fa8dc7d98ef588b49591287f7a..605f90304e37e55826f836ab8b4c31ee3a5677e7 100644 (file)
 # (C) Copyright 2002
 # Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
 
+ifndef CONFIG_SPL
 obj-y += car.o
+endif
+ifdef CONFIG_SPL_BUILD
+obj-y += coreboot_spl.o
+else
+obj-y += sdram.o
+endif
 obj-y += coreboot.o
 obj-y += tables.o
-obj-y += sdram.o
 obj-y += timestamp.o
index 0c4c6348d1d902b07aab90ac1f7f6517c64d1cb8..624caf67a6aaae6f418e39cb1d4c98691be492a8 100644 (file)
@@ -27,7 +27,8 @@ int arch_cpu_init(void)
 
        timestamp_init();
 
-       return x86_cpu_init_f();
+       return IS_ENABLED(CONFIG_X86_RUN_64BIT) ? x86_cpu_reinit_f() :
+                x86_cpu_init_f();
 }
 
 int checkcpu(void)
diff --git a/arch/x86/cpu/coreboot/coreboot_spl.c b/arch/x86/cpu/coreboot/coreboot_spl.c
new file mode 100644 (file)
index 0000000..3666187
--- /dev/null
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2020 Google LLC
+ */
+
+#include <common.h>
+#include <init.h>
+
+int dram_init(void)
+{
+       return 0;
+}
index 8526e856d7d47f97726c05ab389da2ade5a403ae..2e5d0ddd9f63d212eec35a85effcc68eb305d92a 100644 (file)
@@ -290,3 +290,28 @@ int reserve_arch(void)
        return 0;
 }
 #endif
+
+long detect_coreboot_table_at(ulong start, ulong size)
+{
+       u32 *ptr, *end;
+
+       size /= 4;
+       for (ptr = (void *)start, end = ptr + size; ptr < end; ptr += 4) {
+               if (*ptr == 0x4f49424c) /* "LBIO" */
+                       return (long)ptr;
+       }
+
+       return -ENOENT;
+}
+
+long locate_coreboot_table(void)
+{
+       long addr;
+
+       /* We look for LBIO in the first 4K of RAM and again at 960KB */
+       addr = detect_coreboot_table_at(0x0, 0x1000);
+       if (addr < 0)
+               addr = detect_coreboot_table_at(0xf0000, 0x1000);
+
+       return addr;
+}
index 0312a26bbbf5c719e690c32e89e1ea00c29359ed..435e50edada7d368613c00a92442bb36a63c534b 100644 (file)
@@ -24,6 +24,7 @@
 #include <malloc.h>
 #include <spl.h>
 #include <asm/control_regs.h>
+#include <asm/coreboot_tables.h>
 #include <asm/cpu.h>
 #include <asm/mp.h>
 #include <asm/msr.h>
@@ -447,31 +448,6 @@ int x86_cpu_init_f(void)
        return 0;
 }
 
-long detect_coreboot_table_at(ulong start, ulong size)
-{
-       u32 *ptr, *end;
-
-       size /= 4;
-       for (ptr = (void *)start, end = ptr + size; ptr < end; ptr += 4) {
-               if (*ptr == 0x4f49424c) /* "LBIO" */
-                       return (long)ptr;
-       }
-
-       return -ENOENT;
-}
-
-long locate_coreboot_table(void)
-{
-       long addr;
-
-       /* We look for LBIO in the first 4K of RAM and again at 960KB */
-       addr = detect_coreboot_table_at(0x0, 0x1000);
-       if (addr < 0)
-               addr = detect_coreboot_table_at(0xf0000, 0x1000);
-
-       return addr;
-}
-
 int x86_cpu_reinit_f(void)
 {
        setup_identity();
@@ -638,16 +614,6 @@ int cpu_jump_to_64bit_uboot(ulong target)
 
        func = (func_t)ptr;
 
-       /*
-        * Copy U-Boot from ROM
-        * TODO(sjg@chromium.org): Figure out a way to get the text base
-        * correctly here, and in the device-tree binman definition.
-        *
-        * Also consider using FIT so we get the correct image length and
-        * parameters.
-        */
-       memcpy((char *)target, (char *)0xfff00000, 0x100000);
-
        /* Jump to U-Boot */
        func((ulong)pgtable, 0, (ulong)target);
 
index 1736bd2b530e1820490169d80fb2ab46ace136aa..374803b87607d0a624dd4e6ec0c6542ac62537e0 100644 (file)
@@ -32,6 +32,8 @@ obj-$(CONFIG_HAVE_P2SB) += p2sb.o
 
 ifdef CONFIG_SPL
 ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_SYS_COREBOOT
 obj-y += cpu_from_spl.o
 endif
 endif
+endif
index 90925e46ea2195b3b6312f8f22efcb69ec56e99d..4b64339f25954c87da8dae46583761bf62d8fb3a 100644 (file)
@@ -53,6 +53,7 @@ int misc_init_r(void)
        return 0;
 }
 
+#ifndef CONFIG_SYS_COREBOOT
 int checkcpu(void)
 {
        return 0;
@@ -62,6 +63,7 @@ int print_cpuinfo(void)
 {
        return 0;
 }
+#endif
 
 int x86_cpu_reinit_f(void)
 {
diff --git a/arch/x86/dts/coreboot-u-boot.dtsi b/arch/x86/dts/coreboot-u-boot.dtsi
new file mode 100644 (file)
index 0000000..38efc48
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2020 Google LLC
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#include <config.h>
+
+/ {
+       binman {
+               filename = "u-boot-x86-with-spl.bin";
+               u-boot-spl {
+               };
+               u-boot {
+                       offset = <0x10000>;
+               };
+       };
+};
index 90baec2a175e3de4100764606db64b368104ac8b..212b4d596d20d86c5d4dfa3cb05800ada3d68a34 100644 (file)
@@ -63,7 +63,7 @@ static int x86_spl_init(void)
         * is not needed. We could make this a CONFIG option or perhaps
         * place it immediately below CONFIG_SYS_TEXT_BASE.
         */
-       char *ptr = (char *)0x110000;
+       __maybe_unused char *ptr = (char *)0x110000;
 #else
        struct udevice *punit;
 #endif
@@ -111,7 +111,8 @@ static int x86_spl_init(void)
                              __func__, ret);
        }
 
-#ifndef CONFIG_TPL
+#ifndef CONFIG_SYS_COREBOOT
+# ifndef CONFIG_TPL
        memset(&__bss_start, 0, (ulong)&__bss_end - (ulong)&__bss_start);
 
        /* TODO(sjg@chromium.org): Consider calling cpu_init_r() here */
@@ -140,7 +141,7 @@ static int x86_spl_init(void)
                return ret;
        }
        mtrr_commit(true);
-#else
+# else
        ret = syscon_get_by_driver_data(X86_SYSCON_PUNIT, &punit);
        if (ret)
                debug("Could not find PUNIT (err=%d)\n", ret);
@@ -148,6 +149,7 @@ static int x86_spl_init(void)
        ret = set_max_freq();
        if (ret)
                debug("Failed to set CPU frequency (err=%d)\n", ret);
+# endif
 #endif
 
        return 0;
@@ -162,7 +164,7 @@ void board_init_f(ulong flags)
                debug("Error %d\n", ret);
                panic("x86_spl_init fail");
        }
-#ifdef CONFIG_TPL
+#if IS_ENABLED(CONFIG_TPL) || IS_ENABLED(CONFIG_SYS_COREBOOT)
        gd->bd = malloc(sizeof(*gd->bd));
        if (!gd->bd) {
                printf("Out of memory for bd_info size %x\n", sizeof(*gd->bd));
@@ -207,6 +209,19 @@ static int spl_board_load_image(struct spl_image_info *spl_image,
        spl_image->os = IH_OS_U_BOOT;
        spl_image->name = "U-Boot";
 
+       if (!IS_ENABLED(CONFIG_SYS_COREBOOT)) {
+               /*
+                * Copy U-Boot from ROM
+                * TODO(sjg@chromium.org): Figure out a way to get the text base
+                * correctly here, and in the device-tree binman definition.
+                *
+                * Also consider using FIT so we get the correct image length
+                * and parameters.
+                */
+               memcpy((char *)spl_image->load_addr, (char *)0xfff00000,
+                      0x100000);
+       }
+
        debug("Loading to %lx\n", spl_image->load_addr);
 
        return 0;
index 9014418433401de164bcd7673bbc6a312786c75b..1d13f542e677ac9b59ec311d706a70a9c4cb0ffb 100644 (file)
@@ -9,4 +9,11 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
        default "vexpress_aemv8a"
 
+config JUNO_DTB_PART
+       string "NOR flash partition holding DTB"
+       default "board.dtb"
+       help
+         The ARM partition name in the NOR flash memory holding the
+         device tree blob to configure U-Boot.
+
 endif
index dd0ebdd3030e8f938fe51b2ba5bbd1accc6f5a92..5c7a8f55f03598dd4a84b875b038fb28afbd0edd 100644 (file)
@@ -82,9 +82,64 @@ int dram_init_banksize(void)
        return 0;
 }
 
-/*
- * Board specific reset that is system reset.
- */
+#ifdef CONFIG_OF_BOARD
+#define JUNO_FLASH_SEC_SIZE    (256 * 1024)
+static phys_addr_t find_dtb_in_nor_flash(const char *partname)
+{
+       phys_addr_t sector = CONFIG_SYS_FLASH_BASE;
+       int i;
+
+       for (i = 0;
+            i < CONFIG_SYS_MAX_FLASH_SECT;
+            i++, sector += JUNO_FLASH_SEC_SIZE) {
+               int len = strlen(partname) + 1;
+               int offs;
+               phys_addr_t imginfo;
+               u32 reg;
+
+               reg = readl(sector + JUNO_FLASH_SEC_SIZE - 0x04);
+                /* This makes up the string "HSLFTOOF" flash footer */
+               if (reg != 0x464F4F54U)
+                       continue;
+               reg = readl(sector + JUNO_FLASH_SEC_SIZE - 0x08);
+                if (reg != 0x464C5348U)
+                       continue;
+
+               for (offs = 0; offs < 32; offs += 4, len -= 4) {
+                       reg = readl(sector + JUNO_FLASH_SEC_SIZE - 0x30 + offs);
+                       if (strncmp(partname + offs, (char *)&reg,
+                                   len > 4 ? 4 : len))
+                               break;
+
+                       if (len > 4)
+                               continue;
+
+                       reg = readl(sector + JUNO_FLASH_SEC_SIZE - 0x10);
+                       imginfo = sector + JUNO_FLASH_SEC_SIZE - 0x30 - reg;
+                       reg = readl(imginfo + 0x54);
+
+                       return CONFIG_SYS_FLASH_BASE +
+                              reg * JUNO_FLASH_SEC_SIZE;
+               }
+       }
+
+       printf("No DTB found\n");
+
+       return ~0;
+}
+
+void *board_fdt_blob_setup(void)
+{
+       phys_addr_t fdt_rom_addr = find_dtb_in_nor_flash(CONFIG_JUNO_DTB_PART);
+
+       if (fdt_rom_addr == ~0UL)
+               return NULL;
+
+       return (void *)fdt_rom_addr;
+}
+#endif
+
+/* Actual reset is done via PSCI. */
 void reset_cpu(ulong addr)
 {
 }
index 188906b0803262e27e93eec7b469e47ab835b40d..a05673bb0be71420a65182237eca620bc3d5a1a5 100644 (file)
@@ -4,3 +4,10 @@ S:     Maintained
 F:     board/coreboot/coreboot/
 F:     include/configs/chromebook_link.h
 F:     configs/coreboot_defconfig
+
+COREBOOT64 BOARD
+M:     Simon Glass <sjg@chromium.org>
+S:     Maintained
+F:     board/coreboot/coreboot/
+F:     include/configs/chromebook_link.h
+F:     configs/coreboot64_defconfig
index 7564dd252ded67d4008cfcdde934d07bfd269381..68a5b757d1dfc4c4447e7856fdd5c251b56f9575 100644 (file)
@@ -1,6 +1,8 @@
 ROC-RK3399-PC
 M:     Levin Du <djw@t-chip.com.cn>
+M:     Suniel Mahesh <sunil@amarulasolutions.com>
 S:     Maintained
 F:     board/firefly/roc-pc-rk3399
 F:     include/configs/roc-pc-rk3399.h
 F:     configs/roc-pc-rk3399_defconfig
+F:     configs/roc-pc-mezzanine-rk3399_defconfig
index de9185a7cee0f6c51048c185b5ea158cb8f44396..0fe1914c0fc857d9b8844e4036e54da6d37d7164 100644 (file)
@@ -10,7 +10,6 @@
 #include <spl_gpio.h>
 #include <asm/io.h>
 #include <asm/arch-rockchip/gpio.h>
-#include <asm/arch-rockchip/grf_rk3399.h>
 
 #ifndef CONFIG_SPL_BUILD
 int board_early_init_f(void)
@@ -34,26 +33,13 @@ out:
 
 #if defined(CONFIG_TPL_BUILD)
 
-#define PMUGRF_BASE     0xff320000
 #define GPIO0_BASE      0xff720000
 
 int board_early_init_f(void)
 {
        struct rockchip_gpio_regs * const gpio0 = (void *)GPIO0_BASE;
-       struct rk3399_pmugrf_regs * const pmugrf = (void *)PMUGRF_BASE;
 
-       /**
-        * 1. Glow yellow LED, termed as low power
-        * 2. Poll for on board power key press
-        * 3. Once 2 done, off yellow and glow red LED, termed as full power
-        * 4. Continue booting...
-        */
-       spl_gpio_output(gpio0, GPIO(BANK_A, 2), 1);
-
-       spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_A, 5), GPIO_PULL_NORMAL);
-       while (readl(&gpio0->ext_port) & 0x20);
-
-       spl_gpio_output(gpio0, GPIO(BANK_A, 2), 0);
+       /* Turn on red LED, indicating full power mode */
        spl_gpio_output(gpio0, GPIO(BANK_B, 5), 1);
 
        return 0;
index 6f151b0f717b1116ddbb37bc110562361fac8bf0..c487e3a515f36f23c414ffe6d5003f6972e09238 100644 (file)
@@ -595,6 +595,7 @@ unsigned int get_cpu_board_revision(void)
                (void *)&be, sizeof(be));
 #else
        struct udevice *dev;
+       int ret;
 #ifdef CONFIG_SYS_EEPROM_BUS_NUM
        ret = i2c_get_chip_for_busnum(CONFIG_SYS_EEPROM_BUS_NUM,
                                      CONFIG_SYS_I2C_EEPROM_ADDR,
@@ -603,7 +604,7 @@ unsigned int get_cpu_board_revision(void)
 #else
        ret = i2c_get_chip_for_busnum(0, CONFIG_SYS_I2C_EEPROM_ADDR,
                                      CONFIG_SYS_I2C_EEPROM_ADDR_LEN,
-                                     &dev)
+                                     &dev);
 #endif
        if (!ret)
                dm_i2c_read(dev, 0, (void *)&be, sizeof(be));
index 033fae020f12c01b9758674636db3905d66dec49..f0d273ca201bb9859d1872b86ded3fc7bf46152a 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #include "vsc3316_3308.h"
@@ -32,7 +33,22 @@ int vsc_if_enable(unsigned int vsc_addr)
 
        /* enable 2-wire Serial InterFace (I2C) */
        data = 0x02;
+#ifdef CONFIG_DM_I2C
+       int ret, bus_num = 0;
+       struct udevice *dev;
+
+       ret = i2c_get_chip_for_busnum(bus_num, vsc_addr,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return ret;
+       }
+
+       return dm_i2c_write(dev, INTERFACE_MODE_REG, &data, 1);
+#else
        return i2c_write(vsc_addr, INTERFACE_MODE_REG, 1, &data, 1);
+#endif
 }
 
 int vsc3316_config(unsigned int vsc_addr, int8_t con_arr[][2],
@@ -45,6 +61,66 @@ int vsc3316_config(unsigned int vsc_addr, int8_t con_arr[][2],
        debug("VSC:Initializing VSC3316 at I2C address 0x%2x"
                " for Tx\n", vsc_addr);
 
+#ifdef CONFIG_DM_I2C
+       int bus_num = 0;
+       struct udevice *dev;
+
+       ret = i2c_get_chip_for_busnum(bus_num, vsc_addr,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return ret;
+       }
+
+       ret = dm_i2c_read(dev, REVISION_ID_REG, &rev_id, 1);
+       if (ret < 0) {
+               printf("VSC:0x%x could not read REV_ID from device.\n",
+                      vsc_addr);
+               return ret;
+       }
+
+       if (rev_id != 0xab) {
+               printf("VSC: device at address 0x%x is not VSC3316/3308.\n",
+                      vsc_addr);
+               return -ENODEV;
+       }
+
+       ret = vsc_if_enable(vsc_addr);
+       if (ret) {
+               printf("VSC:0x%x could not configured for 2-wire I/F.\n",
+                      vsc_addr);
+               return ret;
+       }
+
+       /* config connections - page 0x00 */
+       dm_i2c_reg_write(dev, CURRENT_PAGE_REGISTER, CONNECTION_CONFIG_PAGE);
+
+       /* Making crosspoint connections, by connecting required
+        * input to output
+        */
+       for (i = 0; i < num_con ; i++)
+               dm_i2c_reg_write(dev, con_arr[i][1], con_arr[i][0]);
+
+       /* input state - page 0x13 */
+       dm_i2c_reg_write(dev, CURRENT_PAGE_REGISTER, INPUT_STATE_REG);
+       /* Configuring the required input of the switch */
+       for (i = 0; i < num_con ; i++)
+               dm_i2c_reg_write(dev, con_arr[i][0], 0x80);
+
+       /* Setting Global Input LOS threshold value */
+       dm_i2c_reg_write(dev, GLOBAL_INPUT_LOS, 0x60);
+
+       /* config output mode - page 0x23 */
+       dm_i2c_reg_write(dev, CURRENT_PAGE_REGISTER, OUTPUT_MODE_PAGE);
+       /* Turn ON the Output driver correspond to required output*/
+       for (i = 0; i < num_con ; i++)
+               dm_i2c_reg_write(dev,  con_arr[i][1], 0);
+
+       /* configure global core control register, Turn on Global core power */
+       dm_i2c_reg_write(dev, GLOBAL_CORE_CNTRL, 0);
+
+#else
        ret = i2c_read(vsc_addr, REVISION_ID_REG, 1, &rev_id, 1);
        if (ret < 0) {
                printf("VSC:0x%x could not read REV_ID from device.\n",
@@ -90,6 +166,7 @@ int vsc3316_config(unsigned int vsc_addr, int8_t con_arr[][2],
 
        /* configure global core control register, Turn on Global core power */
        i2c_reg_write(vsc_addr, GLOBAL_CORE_CNTRL, 0);
+#endif
 
        vsc_wp_config(vsc_addr);
 
@@ -107,6 +184,105 @@ int vsc3308_config_adjust(unsigned int vsc_addr, const int8_t con_arr[][2],
        debug("VSC:Initializing VSC3308 at I2C address 0x%x for Tx\n",
              vsc_addr);
 
+#ifdef CONFIG_DM_I2C
+       int bus_num = 0;
+       struct udevice *dev;
+
+       ret = i2c_get_chip_for_busnum(bus_num, vsc_addr,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return ret;
+       }
+
+       ret = dm_i2c_read(dev, REVISION_ID_REG, &rev_id, 1);
+       if (ret < 0) {
+               printf("VSC:0x%x could not read REV_ID from device.\n",
+                      vsc_addr);
+               return ret;
+       }
+
+       if (rev_id != 0xab) {
+               printf("VSC: device at address 0x%x is not VSC3316/3308.\n",
+                      vsc_addr);
+               return -ENODEV;
+       }
+
+       ret = vsc_if_enable(vsc_addr);
+       if (ret) {
+               printf("VSC:0x%x could not configured for 2-wire I/F.\n",
+                      vsc_addr);
+               return ret;
+       }
+
+       /* config connections - page 0x00 */
+       dm_i2c_reg_write(dev, CURRENT_PAGE_REGISTER, CONNECTION_CONFIG_PAGE);
+
+       /* Configure Global Input ISE */
+       dm_i2c_reg_write(dev, GLOBAL_INPUT_ISE1, 0);
+       dm_i2c_reg_write(dev, GLOBAL_INPUT_ISE2, 0);
+
+       /* Configure Tx/Rx Global Output PE1 */
+       dm_i2c_reg_write(dev, GLOBAL_OUTPUT_PE1, 0);
+
+       /* Configure Tx/Rx Global Output PE2 */
+       dm_i2c_reg_write(dev, GLOBAL_OUTPUT_PE2, 0);
+
+       /* Configure Tx/Rx Global Input GAIN */
+       dm_i2c_reg_write(dev, GLOBAL_INPUT_GAIN, 0x3F);
+
+       /* Setting Global Input LOS threshold value */
+       dm_i2c_reg_write(dev, GLOBAL_INPUT_LOS, 0xE0);
+
+       /* Setting Global output termination */
+       dm_i2c_reg_write(dev, GLOBAL_OUTPUT_TERMINATION, 0);
+
+       /* Configure Tx/Rx Global Output level */
+       if (vsc_addr == VSC3308_TX_ADDRESS)
+               dm_i2c_reg_write(dev, GLOBAL_OUTPUT_LEVEL, 4);
+       else
+               dm_i2c_reg_write(dev, GLOBAL_OUTPUT_LEVEL, 2);
+
+       /* Making crosspoint connections, by connecting required
+        * input to output
+        */
+       for (i = 0; i < num_con ; i++)
+               dm_i2c_reg_write(dev, con_arr[i][1], con_arr[i][0]);
+
+       /* input state - page 0x13 */
+       dm_i2c_reg_write(dev, CURRENT_PAGE_REGISTER, INPUT_STATE_REG);
+       /* Turning off all the required input of the switch */
+       for (i = 0; i < num_con; i++)
+               dm_i2c_reg_write(dev, con_arr[i][0], 1);
+
+       /* only turn on specific Tx/Rx requested by the XFI erratum */
+       if (vsc_addr == VSC3308_TX_ADDRESS) {
+               dm_i2c_reg_write(dev, 2, 0);
+               dm_i2c_reg_write(dev, 3, 0);
+       } else {
+               dm_i2c_reg_write(dev, 0, 0);
+               dm_i2c_reg_write(dev, 1, 0);
+       }
+
+       /* config output mode - page 0x23 */
+       dm_i2c_reg_write(dev, CURRENT_PAGE_REGISTER, OUTPUT_MODE_PAGE);
+       /* Turn off the Output driver correspond to required output*/
+       for (i = 0; i < num_con ; i++)
+               dm_i2c_reg_write(dev,  con_arr[i][1], 1);
+
+       /* only turn on specific Tx/Rx requested by the XFI erratum */
+       if (vsc_addr == VSC3308_TX_ADDRESS) {
+               dm_i2c_reg_write(dev, 0, 0);
+               dm_i2c_reg_write(dev, 1, 0);
+       } else {
+               dm_i2c_reg_write(dev, 3, 0);
+               dm_i2c_reg_write(dev, 4, 0);
+       }
+
+       /* configure global core control register, Turn on Global core power */
+       dm_i2c_reg_write(dev, GLOBAL_CORE_CNTRL, 0);
+#else
        ret = i2c_read(vsc_addr, REVISION_ID_REG, 1, &rev_id, 1);
        if (ret < 0) {
                printf("VSC:0x%x could not read REV_ID from device.\n",
@@ -192,7 +368,7 @@ int vsc3308_config_adjust(unsigned int vsc_addr, const int8_t con_arr[][2],
 
        /* configure global core control register, Turn on Global core power */
        i2c_reg_write(vsc_addr, GLOBAL_CORE_CNTRL, 0);
-
+#endif
        vsc_wp_config(vsc_addr);
 
        return 0;
@@ -208,7 +384,69 @@ int vsc3308_config(unsigned int vsc_addr, const int8_t con_arr[][2],
 
        debug("VSC:Initializing VSC3308 at I2C address 0x%x"
                " for Tx\n", vsc_addr);
+#ifdef CONFIG_DM_I2C
+       int bus_num = 0;
+       struct udevice *dev;
+
+       ret = i2c_get_chip_for_busnum(bus_num, vsc_addr,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return ret;
+       }
 
+       ret = dm_i2c_read(dev, REVISION_ID_REG, &rev_id, 1);
+       if (ret < 0) {
+               printf("VSC:0x%x could not read REV_ID from device.\n",
+                      vsc_addr);
+               return ret;
+       }
+
+       if (rev_id != 0xab) {
+               printf("VSC: device at address 0x%x is not VSC3316/3308.\n",
+                      vsc_addr);
+               return -ENODEV;
+       }
+
+       ret = vsc_if_enable(vsc_addr);
+       if (ret) {
+               printf("VSC:0x%x could not configured for 2-wire I/F.\n",
+                      vsc_addr);
+               return ret;
+       }
+
+       /* config connections - page 0x00 */
+       dm_i2c_reg_write(dev, CURRENT_PAGE_REGISTER, CONNECTION_CONFIG_PAGE);
+
+       /* Making crosspoint connections, by connecting required
+        * input to output
+        */
+       for (i = 0; i < num_con ; i++)
+               dm_i2c_reg_write(dev, con_arr[i][1], con_arr[i][0]);
+
+       /*Configure Global Input ISE and gain */
+       dm_i2c_reg_write(dev, GLOBAL_INPUT_ISE1, 0x12);
+       dm_i2c_reg_write(dev, GLOBAL_INPUT_ISE2, 0x12);
+
+       /* input state - page 0x13 */
+       dm_i2c_reg_write(dev, CURRENT_PAGE_REGISTER, INPUT_STATE_REG);
+       /* Turning ON the required input of the switch */
+       for (i = 0; i < num_con ; i++)
+               dm_i2c_reg_write(dev, con_arr[i][0], 0);
+
+       /* Setting Global Input LOS threshold value */
+       dm_i2c_reg_write(dev, GLOBAL_INPUT_LOS, 0x60);
+
+       /* config output mode - page 0x23 */
+       dm_i2c_reg_write(dev, CURRENT_PAGE_REGISTER, OUTPUT_MODE_PAGE);
+       /* Turn ON the Output driver correspond to required output*/
+       for (i = 0; i < num_con ; i++)
+               dm_i2c_reg_write(dev,  con_arr[i][1], 0);
+
+       /* configure global core control register, Turn on Global core power */
+       dm_i2c_reg_write(dev, GLOBAL_CORE_CNTRL, 0);
+#else
        ret = i2c_read(vsc_addr, REVISION_ID_REG, 1, &rev_id, 1);
        if (ret < 0) {
                printf("VSC:0x%x could not read REV_ID from device.\n",
@@ -258,7 +496,7 @@ int vsc3308_config(unsigned int vsc_addr, const int8_t con_arr[][2],
 
        /* configure global core control register, Turn on Global core power */
        i2c_reg_write(vsc_addr, GLOBAL_CORE_CNTRL, 0);
-
+#endif
        vsc_wp_config(vsc_addr);
 
        return 0;
@@ -270,6 +508,22 @@ void vsc_wp_config(unsigned int vsc_addr)
 
        /* For new crosspoint configuration to occur, WP bit of
         * CORE_CONFIG_REG should be set 1 and then reset to 0 */
+#ifdef CONFIG_DM_I2C
+       int ret, bus_num = 0;
+       struct udevice *dev;
+
+       ret = i2c_get_chip_for_busnum(bus_num, vsc_addr,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return;
+       }
+
+       dm_i2c_reg_write(dev, CORE_CONFIG_REG, 0x01);
+       dm_i2c_reg_write(dev, CORE_CONFIG_REG, 0x0);
+#else
        i2c_reg_write(vsc_addr, CORE_CONFIG_REG, 0x01);
        i2c_reg_write(vsc_addr, CORE_CONFIG_REG, 0x0);
+#endif
 }
index a0866926832f7f891e55ee8f2c339ddebc514a06..314646d4ff4fb85d6cbd680b706e6d5a3690e4ab 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #include <common.h>
@@ -124,7 +125,7 @@ int board_early_init_r(void)
        return 0;
 }
 
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && !defined(CONFIG_DM_PCI)
 void pci_init_board(void)
 {
        fsl_pcie_init_board(0);
@@ -136,6 +137,125 @@ int config_board_mux(int ctrl_type)
        ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
        u8 tmp;
 
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
+       int ret;
+#if defined(CONFIG_TARGET_P1010RDB_PA)
+       struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);
+
+       ret = i2c_get_chip_for_busnum(I2C_PCA9557_BUS_NUM,
+                                     I2C_PCA9557_ADDR1, 1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n",
+                      __func__, I2C_PCA9557_BUS_NUM);
+               return ret;
+       }
+       switch (ctrl_type) {
+       case MUX_TYPE_IFC:
+               tmp = 0xf0;
+               dm_i2c_write(dev, 3, &tmp, 1);
+               tmp = 0x01;
+               dm_i2c_write(dev, 1, &tmp, 1);
+               sd_ifc_mux = MUX_TYPE_IFC;
+               clrbits_be32(&gur->pmuxcr, PMUXCR1_IFC_MASK);
+               break;
+       case MUX_TYPE_SDHC:
+               tmp = 0xf0;
+               dm_i2c_write(dev, 3, &tmp, 1);
+               tmp = 0x05;
+               dm_i2c_write(dev, 1, &tmp, 1);
+               sd_ifc_mux = MUX_TYPE_SDHC;
+               clrsetbits_be32(&gur->pmuxcr, PMUXCR1_SDHC_MASK,
+                               PMUXCR1_SDHC_ENABLE);
+               break;
+       case MUX_TYPE_SPIFLASH:
+               out_8(&cpld_data->spi_cs0_sel, MUX_CPLD_SPICS0_FLASH);
+               break;
+       case MUX_TYPE_TDM:
+               out_8(&cpld_data->tdm_can_sel, MUX_CPLD_TDM);
+               out_8(&cpld_data->spi_cs0_sel, MUX_CPLD_SPICS0_SLIC);
+               break;
+       case MUX_TYPE_CAN:
+               out_8(&cpld_data->tdm_can_sel, MUX_CPLD_CAN_UART);
+               break;
+       default:
+               break;
+       }
+#elif defined(CONFIG_TARGET_P1010RDB_PB)
+       ret = i2c_get_chip_for_busnum(I2C_PCA9557_BUS_NUM,
+                                     I2C_PCA9557_ADDR2, 1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n",
+                      __func__, I2C_PCA9557_BUS_NUM);
+               return ret;
+       }
+       switch (ctrl_type) {
+       case MUX_TYPE_IFC:
+               dm_i2c_read(dev, 0, &tmp, 1);
+               clrbits_8(&tmp, 0x04);
+               dm_i2c_write(dev, 1, &tmp, 1);
+               dm_i2c_read(dev, 3, &tmp, 1);
+               clrbits_8(&tmp, 0x04);
+               dm_i2c_write(dev, 3, &tmp, 1);
+               sd_ifc_mux = MUX_TYPE_IFC;
+               clrbits_be32(&gur->pmuxcr, PMUXCR1_IFC_MASK);
+               break;
+       case MUX_TYPE_SDHC:
+               dm_i2c_read(dev, 0, &tmp, 1);
+               setbits_8(&tmp, 0x04);
+               dm_i2c_write(dev, 1, &tmp, 1);
+               dm_i2c_read(dev, 3, &tmp, 1);
+               clrbits_8(&tmp, 0x04);
+               dm_i2c_write(dev, 3, &tmp, 1);
+               sd_ifc_mux = MUX_TYPE_SDHC;
+               clrsetbits_be32(&gur->pmuxcr, PMUXCR1_SDHC_MASK,
+                               PMUXCR1_SDHC_ENABLE);
+               break;
+       case MUX_TYPE_SPIFLASH:
+               dm_i2c_read(dev, 0, &tmp, 1);
+               clrbits_8(&tmp, 0x80);
+               dm_i2c_write(dev, 1, &tmp, 1);
+               dm_i2c_read(dev, 3, &tmp, 1);
+               clrbits_8(&tmp, 0x80);
+               dm_i2c_write(dev, 3, &tmp, 1);
+               break;
+       case MUX_TYPE_TDM:
+               dm_i2c_read(dev, 0, &tmp, 1);
+               setbits_8(&tmp, 0x82);
+               dm_i2c_write(dev, 1, &tmp, 1);
+               dm_i2c_read(dev, 3, &tmp, 1);
+               clrbits_8(&tmp, 0x82);
+               dm_i2c_write(dev, 3, &tmp, 1);
+               break;
+       case MUX_TYPE_CAN:
+               dm_i2c_read(dev, 0, &tmp, 1);
+               clrbits_8(&tmp, 0x02);
+               dm_i2c_write(dev, 1, &tmp, 1);
+               dm_i2c_read(dev, 3, &tmp, 1);
+               clrbits_8(&tmp, 0x02);
+               dm_i2c_write(dev, 3, &tmp, 1);
+               break;
+       case MUX_TYPE_CS0_NOR:
+               dm_i2c_read(dev, 0, &tmp, 1);
+               clrbits_8(&tmp, 0x08);
+               dm_i2c_write(dev, 1, &tmp, 1);
+               dm_i2c_read(dev, 3, &tmp, 1);
+               clrbits_8(&tmp, 0x08);
+               dm_i2c_write(dev, 3, &tmp, 1);
+               break;
+       case MUX_TYPE_CS0_NAND:
+               dm_i2c_read(dev, 0, &tmp, 1);
+               setbits_8(&tmp, 0x08);
+               dm_i2c_write(dev, 1, &tmp, 1);
+               dm_i2c_read(dev, 3, &tmp, 1);
+               clrbits_8(&tmp, 0x08);
+               dm_i2c_write(dev, 3, &tmp, 1);
+               break;
+       default:
+               break;
+       }
+#endif
+#else
 #if defined(CONFIG_TARGET_P1010RDB_PA)
        struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);
 
@@ -242,6 +362,7 @@ int config_board_mux(int ctrl_type)
                break;
        }
        i2c_set_bus_num(orig_bus);
+#endif
 #endif
        return 0;
 }
@@ -250,9 +371,23 @@ int config_board_mux(int ctrl_type)
 int i2c_pca9557_read(int type)
 {
        u8 val;
+       int bus_num = I2C_PCA9557_BUS_NUM;
 
-       i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
+       int ret;
+
+       ret = i2c_get_chip_for_busnum(bus_num, I2C_PCA9557_ADDR2, 1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n",
+                      __func__, bus_num);
+               return ret;
+       }
+       dm_i2c_read(dev, 0, &val, 1);
+#else
+       i2c_set_bus_num(bus_num);
        i2c_read(I2C_PCA9557_ADDR2, 0, 1, &val, 1);
+#endif
 
        switch (type) {
        case I2C_READ_BANK:
@@ -280,11 +415,26 @@ int checkboard(void)
        printf("Board: %sRDB-PA, ", cpu->name);
 #elif defined(CONFIG_TARGET_P1010RDB_PB)
        printf("Board: %sRDB-PB, ", cpu->name);
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
+       int ret;
+
+       ret = i2c_get_chip_for_busnum(I2C_PCA9557_BUS_NUM, I2C_PCA9557_ADDR2,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      I2C_PCA9557_BUS_NUM);
+               return ret;
+       }
+       val = 0x0;  /* no polarity inversion */
+       dm_i2c_write(dev, 2, &val, 1);
+#else
        i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
        i2c_init(CONFIG_SYS_FSL_I2C_SPEED, CONFIG_SYS_FSL_I2C_SLAVE);
        val = 0x0;  /* no polarity inversion */
        i2c_write(I2C_PCA9557_ADDR2, 2, 1, &val, 1);
 #endif
+#endif
 
 #ifdef CONFIG_SDCARD
        /* switch to IFC to read info from CPLD */
@@ -308,7 +458,11 @@ int checkboard(void)
        case 0xe:
                puts("SDHC\n");
                val = 0x60; /* set pca9557 pin input/output */
+#ifdef CONFIG_DM_I2C
+               dm_i2c_write(dev, 3, &val, 1);
+#else
                i2c_write(I2C_PCA9557_ADDR2, 3, 1, &val, 1);
+#endif
                break;
        case 0x5:
                config_board_mux(MUX_TYPE_IFC);
@@ -457,7 +611,7 @@ int ft_board_setup(void *blob, bd_t *bd)
        base = env_get_bootm_low();
        size = env_get_bootm_size();
 
-#if defined(CONFIG_PCI)
+#if defined(CONFIG_PCI) && !defined(CONFIG_DM_PCI)
        FT_FSL_PCI_SETUP;
 #endif
 
index 71fca8ca1e1aa4b5d67b7e5438dc5ef18b722e5e..f668d7efb126819750b6a1638e8b94be3464785b 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2010-2011, 2013 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #include <common.h>
@@ -227,6 +228,7 @@ int checkboard(void)
        struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);
        ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
        u8 in, out, io_config, val;
+       int bus_num = CONFIG_SYS_SPD_BUS_NUM;
 
        printf("Board: %s CPLD: V%d.%d PCBA: V%d.0\n", CONFIG_BOARDNAME,
                in_8(&cpld_data->cpld_rev_major) & 0x0F,
@@ -234,7 +236,26 @@ int checkboard(void)
                in_8(&cpld_data->pcba_rev) & 0x0F);
 
        /* Initialize i2c early for rom_loc and flash bank information */
-       i2c_set_bus_num(CONFIG_SYS_SPD_BUS_NUM);
+       #if defined(CONFIG_DM_I2C)
+       struct udevice *dev;
+       int ret;
+
+       ret = i2c_get_chip_for_busnum(bus_num, CONFIG_SYS_I2C_PCA9557_ADDR,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return -ENXIO;
+       }
+
+       if (dm_i2c_read(dev, 0, &in, 1) < 0 ||
+           dm_i2c_read(dev, 1, &out, 1) < 0 ||
+           dm_i2c_read(dev, 3, &io_config, 1) < 0) {
+               printf("Error reading i2c boot information!\n");
+               return 0; /* Don't want to hang() on this error */
+       }
+       #else /* Non DM I2C support - will be removed */
+       i2c_set_bus_num(bus_num);
 
        if (i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 0, 1, &in, 1) < 0 ||
            i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 1, 1, &out, 1) < 0 ||
@@ -242,6 +263,7 @@ int checkboard(void)
                printf("Error reading i2c boot information!\n");
                return 0; /* Don't want to hang() on this error */
        }
+       #endif
 
        val = (in & io_config) | (out & (~io_config));
 
index e42337e47a4570d98b0b98c0c4969c8442bfb539..32b4780376a63d1dd21dfcf4c1c5e01e89fc8319 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #include <common.h>
@@ -75,11 +76,24 @@ int checkboard(void)
        return 0;
 }
 
-int select_i2c_ch_pca9547(u8 ch)
+int select_i2c_ch_pca9547(u8 ch, int bus_num)
 {
        int ret;
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
 
+       ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return ret;
+       }
+
+       ret = dm_i2c_write(dev, 0, &ch, 1);
+#else
        ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#endif
        if (ret) {
                puts("PCA: failed to select proper channel\n");
                return ret;
@@ -191,6 +205,82 @@ void board_retimer_ds125df111_init(void)
 {
        u8 reg;
 
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
+       int ret, bus_num = 0;
+
+       ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
+                                     1, &dev);
+       if (ret)
+               goto failed;
+
+       /* Retimer DS125DF111 is connected to I2C1_CH7_CH5 */
+       reg = I2C_MUX_CH7;
+       dm_i2c_write(dev, 0, &reg, 1);
+
+       ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_SEC,
+                                     1, &dev);
+       if (ret)
+               goto failed;
+
+       reg = I2C_MUX_CH5;
+       dm_i2c_write(dev, 0, &reg, 1);
+
+       /* Access to Control/Shared register */
+       ret = i2c_get_chip_for_busnum(bus_num, I2C_RETIMER_ADDR,
+                                     1, &dev);
+       if (ret)
+               goto failed;
+       reg = 0x0;
+       dm_i2c_write(dev, 0xff, &reg, 1);
+
+       /* Read device revision and ID */
+       dm_i2c_read(dev, 1, &reg, 1);
+       debug("Retimer version id = 0x%x\n", reg);
+
+       /* Enable Broadcast */
+       reg = 0x0c;
+       dm_i2c_write(dev, 0xff, &reg, 1);
+
+       /* Reset Channel Registers */
+       dm_i2c_read(dev, 0, &reg, 1);
+       reg |= 0x4;
+       dm_i2c_write(dev, 0, &reg, 1);
+
+       /* Enable override divider select and Enable Override Output Mux */
+       dm_i2c_read(dev, 9, &reg, 1);
+       reg |= 0x24;
+       dm_i2c_write(dev, 9, &reg, 1);
+
+       /* Select VCO Divider to full rate (000) */
+       dm_i2c_read(dev, 0x18, &reg, 1);
+       reg &= 0x8f;
+       dm_i2c_write(dev, 0x18, &reg, 1);
+
+       /* Select active PFD MUX input as re-timed data (001) */
+       dm_i2c_read(dev, 0x1e, &reg, 1);
+       reg &= 0x3f;
+       reg |= 0x20;
+       dm_i2c_write(dev, 0x1e, &reg, 1);
+
+       /* Set data rate as 10.3125 Gbps */
+       reg = 0x0;
+       dm_i2c_write(dev, 0x60, &reg, 1);
+       reg = 0xb2;
+       dm_i2c_write(dev, 0x61, &reg, 1);
+       reg = 0x90;
+       dm_i2c_write(dev, 0x62, &reg, 1);
+       reg = 0xb3;
+       dm_i2c_write(dev, 0x63, &reg, 1);
+       reg = 0xcd;
+       dm_i2c_write(dev, 0x64, &reg, 1);
+       return;
+
+failed:
+       printf("%s: Cannot find udev for a bus %d\n", __func__,
+              bus_num);
+       return;
+#else
        /* Retimer DS125DF111 is connected to I2C1_CH7_CH5 */
        reg = I2C_MUX_CH7;
        i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &reg, 1);
@@ -241,6 +331,7 @@ void board_retimer_ds125df111_init(void)
        i2c_write(I2C_RETIMER_ADDR, 0x63, 1, &reg, 1);
        reg = 0xcd;
        i2c_write(I2C_RETIMER_ADDR, 0x64, 1, &reg, 1);
+#endif
 }
 
 int board_early_init_f(void)
@@ -281,7 +372,7 @@ int board_early_init_r(void)
                MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                0, flash_esel, BOOKE_PAGESZ_256M, 1);
 #endif
-       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
        board_mux_lane_to_slot();
        board_retimer_ds125df111_init();
 
index 15de1325988a09b7cb599ff08f000e31f3e860a1..d327b5edb9f3f781e32f1d9f48bc953251472482 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #ifndef __T102x_QDS_H__
@@ -8,6 +9,6 @@
 
 void fdt_fixup_board_enet(void *blob);
 void pci_of_setup(void *blob, bd_t *bd);
-int select_i2c_ch_pca9547(u8 ch);
+int select_i2c_ch_pca9547(u8 ch, int bus_num);
 
 #endif
index eee09a57019e1780f6a7397f484555bde2c121b7..a34490c8bdcf46c3046ccec0c9c27ec6695ff33a 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #include <common.h>
@@ -250,8 +251,69 @@ static u32 t1023rdb_ctrl(u32 ctrl_type)
 {
        ccsr_gpio_t __iomem *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
        ccsr_gur_t __iomem  *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-       u32 val, orig_bus = i2c_get_bus_num();
+       u32 val;
        u8 tmp;
+       int bus_num = I2C_PCA6408_BUS_NUM;
+
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
+       int ret;
+
+       ret = i2c_get_chip_for_busnum(bus_num, I2C_PCA6408_ADDR,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return ret;
+       }
+       switch (ctrl_type) {
+       case GPIO1_SD_SEL:
+               val = in_be32(&pgpio->gpdat);
+               val |= GPIO1_SD_SEL;
+               out_be32(&pgpio->gpdat, val);
+               setbits_be32(&pgpio->gpdir, GPIO1_SD_SEL);
+               break;
+       case GPIO1_EMMC_SEL:
+               val = in_be32(&pgpio->gpdat);
+               val &= ~GPIO1_SD_SEL;
+               out_be32(&pgpio->gpdat, val);
+               setbits_be32(&pgpio->gpdir, GPIO1_SD_SEL);
+               break;
+       case GPIO3_GET_VERSION:
+               pgpio = (ccsr_gpio_t *)(CONFIG_SYS_MPC85xx_GPIO_ADDR
+                        + GPIO3_OFFSET);
+               val = in_be32(&pgpio->gpdat);
+               val = ((val & GPIO3_BRD_VER_MASK) >> 26) & 0x3;
+               if (val == 0x3) /* GPIO3_4/5 not used on RevB */
+                       val = 0;
+               return val;
+       case I2C_GET_BANK:
+               dm_i2c_read(dev, 0, &tmp, 1);
+               tmp &= 0x7;
+               tmp = ((tmp & 1) << 2) | (tmp & 2) | ((tmp & 4) >> 2);
+               return tmp;
+       case I2C_SET_BANK0:
+               tmp = 0x0;
+               dm_i2c_write(dev, 1, &tmp, 1);
+               tmp = 0xf8;
+               dm_i2c_write(dev, 3, &tmp, 1);
+               /* asserting HRESET_REQ */
+               out_be32(&gur->rstcr, 0x2);
+               break;
+       case I2C_SET_BANK4:
+               tmp = 0x1;
+               dm_i2c_write(dev, 1, &tmp, 1);
+               tmp = 0xf8;
+               dm_i2c_write(dev, 3, &tmp, 1);
+               out_be32(&gur->rstcr, 0x2);
+               break;
+       default:
+               break;
+       }
+#else
+       u32 orig_bus;
+
+       orig_bus = i2c_get_bus_num();
 
        switch (ctrl_type) {
        case GPIO1_SD_SEL:
@@ -275,14 +337,14 @@ static u32 t1023rdb_ctrl(u32 ctrl_type)
                        val = 0;
                return val;
        case I2C_GET_BANK:
-               i2c_set_bus_num(I2C_PCA6408_BUS_NUM);
+               i2c_set_bus_num(bus_num);
                i2c_read(I2C_PCA6408_ADDR, 0, 1, &tmp, 1);
                tmp &= 0x7;
                tmp = ((tmp & 1) << 2) | (tmp & 2) | ((tmp & 4) >> 2);
                i2c_set_bus_num(orig_bus);
                return tmp;
        case I2C_SET_BANK0:
-               i2c_set_bus_num(I2C_PCA6408_BUS_NUM);
+               i2c_set_bus_num(bus_num);
                tmp = 0x0;
                i2c_write(I2C_PCA6408_ADDR, 1, 1, &tmp, 1);
                tmp = 0xf8;
@@ -291,7 +353,7 @@ static u32 t1023rdb_ctrl(u32 ctrl_type)
                out_be32(&gur->rstcr, 0x2);
                break;
        case I2C_SET_BANK4:
-               i2c_set_bus_num(I2C_PCA6408_BUS_NUM);
+               i2c_set_bus_num(bus_num);
                tmp = 0x1;
                i2c_write(I2C_PCA6408_ADDR, 1, 1, &tmp, 1);
                tmp = 0xf8;
@@ -301,6 +363,7 @@ static u32 t1023rdb_ctrl(u32 ctrl_type)
        default:
                break;
        }
+#endif
        return 0;
 }
 
index ab9e922a927d7e73fc3742a054c400d4025f8941..0b1aeed69e4214c0800baadf83b8d07ab388f33a 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  * Author: Priyanka Jain <Priyanka.Jain@freescale.com>
  */
 
@@ -48,7 +49,7 @@ void diu_set_pixel_clock(unsigned int pixclock)
 
        /* Program HDMI encoder */
        /* Switch channel to DIU */
-       select_i2c_ch_pca9547(I2C_MUX_CH_DIU);
+       select_i2c_ch_pca9547(I2C_MUX_CH_DIU, 0);
 
        /* Set dispaly encoder */
        ret = diu_set_dvi_encoder(temp);
@@ -58,7 +59,7 @@ void diu_set_pixel_clock(unsigned int pixclock)
        }
 
        /* Switch channel to default */
-       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 
        /* Program pixel clock */
        out_be32((unsigned *)CONFIG_SYS_FSL_SCFG_PIXCLK_ADDR,
index 92dd9237ec7f884e368fe03309c57b1de202af0c..9e253fdec27d079e08c5c6233065823570c724dc 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2013 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #include <common.h>
@@ -79,11 +80,24 @@ int checkboard(void)
        return 0;
 }
 
-int select_i2c_ch_pca9547(u8 ch)
+int select_i2c_ch_pca9547(u8 ch, int bus_num)
 {
        int ret;
 
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
+
+       ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI, 1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return ret;
+       }
+
+       ret = dm_i2c_write(dev, 0, &ch, 1);
+#else
        ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#endif
        if (ret) {
                puts("PCA: failed to select proper channel\n");
                return ret;
@@ -154,7 +168,7 @@ int board_early_init_r(void)
                MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                0, flash_esel, BOOKE_PAGESZ_256M, 1);
 #endif
-       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 
        return 0;
 }
index d2f0203f17795eb4e3948393575f4ebbd1125962..781bcdefc93ec8518ecb4bb6c058d1dab01aef35 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2013 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #ifndef __T1040_QDS_H__
@@ -8,6 +9,6 @@
 
 void fdt_fixup_board_enet(void *blob);
 void pci_of_setup(void *blob, bd_t *bd);
-int select_i2c_ch_pca9547(u8 ch);
+int select_i2c_ch_pca9547(u8 ch, int bus_bum);
 
 #endif
index 79cc1543f95a337225da20d9f4e3a3bdd8e57edf..91004010223d6fb24277a23ff4f2e48a771ebc9e 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2009-2013 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #include <common.h>
@@ -75,11 +76,23 @@ int checkboard(void)
        return 0;
 }
 
-int select_i2c_ch_pca9547(u8 ch)
+int select_i2c_ch_pca9547(u8 ch, int bus_num)
 {
        int ret;
 
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
+
+       ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI, 1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return ret;
+       }
+       ret = dm_i2c_write(dev, 0, &ch, 1);
+#else
        ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#endif
        if (ret) {
                puts("PCA: failed to select proper channel\n");
                return ret;
@@ -90,7 +103,7 @@ int select_i2c_ch_pca9547(u8 ch)
 
 int i2c_multiplexer_select_vid_channel(u8 channel)
 {
-       return select_i2c_ch_pca9547(channel);
+       return select_i2c_ch_pca9547(channel, 0);
 }
 
 int brd_mux_lane_to_slot(void)
@@ -368,7 +381,7 @@ int board_early_init_r(void)
                printf("Warning: Adjusting core voltage failed.\n");
 
        brd_mux_lane_to_slot();
-       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 
        return 0;
 }
index 5608774afd19e3194808179d0c8494da5af235be..869c01de92b91fd2658058f119849d8844e63c10 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2009-2012 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #include <common.h>
@@ -91,11 +92,25 @@ int checkboard(void)
        return 0;
 }
 
-int select_i2c_ch_pca9547(u8 ch)
+int select_i2c_ch_pca9547(u8 ch, int bus_num)
 {
        int ret;
 
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
+
+       ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
+                                     1, &dev);
+       if (ret) {
+               printf("%s: Cannot find udev for a bus %d\n", __func__,
+                      bus_num);
+               return ret;
+       }
+
+       ret = dm_i2c_write(dev, 0, &ch, 1);
+#else
        ret = i2c_write(I2C_MUX_PCA_ADDR_PRI, 0, 1, &ch, 1);
+#endif
        if (ret) {
                puts("PCA: failed to select proper channel\n");
                return ret;
@@ -115,10 +130,28 @@ static inline int read_voltage(void)
 {
        int i, ret, voltage_read = 0;
        u16 vol_mon;
+#ifdef CONFIG_DM_I2C
+       struct udevice *dev;
+       int bus_num = 0;
+#endif
 
        for (i = 0; i < NUM_READINGS; i++) {
+#ifdef CONFIG_DM_I2C
+               ret = i2c_get_chip_for_busnum(bus_num, I2C_VOL_MONITOR_ADDR,
+                                             1, &dev);
+               if (ret) {
+                       printf("%s: Cannot find udev for a bus %d\n", __func__,
+                              bus_num);
+                       return ret;
+               }
+
+               ret = dm_i2c_read(dev,
+                                 I2C_VOL_MONITOR_BUS_V_OFFSET,
+                                 (void *)&vol_mon, 2);
+#else
                ret = i2c_read(I2C_VOL_MONITOR_ADDR,
                        I2C_VOL_MONITOR_BUS_V_OFFSET, 1, (void *)&vol_mon, 2);
+#endif
                if (ret) {
                        printf("VID: failed to read core voltage\n");
                        return ret;
@@ -250,7 +283,7 @@ static int adjust_vdd(ulong vdd_override)
                unsigned voltage;
        };
 
-       ret = select_i2c_ch_pca9547(I2C_MUX_CH_VOL_MONITOR);
+       ret = select_i2c_ch_pca9547(I2C_MUX_CH_VOL_MONITOR, 0);
        if (ret) {
                debug("VID: I2c failed to switch channel\n");
                ret = -1;
@@ -348,7 +381,7 @@ int config_frontside_crossbar_vsc3316(void)
        u32 srds_prtcl_s1, srds_prtcl_s2;
        int ret;
 
-       ret = select_i2c_ch_pca9547(I2C_MUX_CH_VSC3316_FS);
+       ret = select_i2c_ch_pca9547(I2C_MUX_CH_VSC3316_FS, 0);
        if (ret)
                return ret;
 
@@ -567,7 +600,7 @@ int board_early_init_r(void)
        /* Configure board SERDES ports crossbar */
        config_frontside_crossbar_vsc3316();
        config_backside_crossbar_mux();
-       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+       select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
 
        return 0;
 }
@@ -732,11 +765,11 @@ void board_detail(void)
        }
 
        /* Voltage secion */
-       if (!select_i2c_ch_pca9547(I2C_MUX_CH_VOL_MONITOR)) {
+       if (!select_i2c_ch_pca9547(I2C_MUX_CH_VOL_MONITOR, 0)) {
                vdd = read_voltage();
                if (vdd > 0)
                        printf("Core voltage= %d mV\n", vdd);
-               select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+               select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT, 0);
        }
 
        printf("XVDD        = 1.%d V\n", ((brdcfg[8] & 0xf) - 4) * 5 + 25);
index 23bbdcccacf796736d83195b06294ae83294b63d..8f7e7f05d82bcdaf5d7d3f6a7d94318a51999ebb 100644 (file)
@@ -330,8 +330,12 @@ void post_word_store(ulong value)
 
 int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset)
 {
-       *vstart = CONFIG_SYS_MEMTEST_START;
-       *size = CONFIG_SYS_MEMTEST_END - CONFIG_SYS_MEMTEST_START;
+       /*
+        * These match CONFIG_SYS_MEMTEST_START and
+        * (CONFIG_SYS_MEMTEST_END - CONFIG_SYS_MEMTEST_START)
+        */
+       *vstart = 0x00100000;
+       *size = 0xe00000;
        debug("arch_memory_test_prepare 0x%08X 0x%08X\n", *vstart, *size);
 
        return 0;
index c661d2e06ae3d2ff8998b14bc77034bbf9fc9765..89becf41c50f7930535fd040bade52e7f304140a 100644 (file)
@@ -5,6 +5,13 @@ F:      board/rockchip/evb_rk3328
 F:      include/configs/evb_rk3328.h
 F:      configs/evb-rk3328_defconfig
 
+ROC-RK3328-CC
+M:      Loic Devulder <ldevulder@suse.com>
+M:      Chen-Yu Tsai <wens@csie.org>
+S:      Maintained
+F:      configs/roc-cc-rk3328_defconfig
+F:      arch/arm/dts/rk3328-roc-cc-u-boot.dtsi
+
 ROCK64-RK3328
 M:      Matwey V. Kornilov <matwey.kornilov@gmail.com>
 S:      Maintained
index 0834254f6de19f63293a5d9dcb0a92aa6e936cd1..792df1087f5b30bbbcf1ef7f78034092c2d0b6f9 100644 (file)
@@ -42,6 +42,13 @@ S:   Maintained
 F:     configs/nanopi-m4-rk3399_defconfig
 F:     arch/arm/dts/rk3399-nanopi-m4-u-boot.dtsi
 
+NANOPI-M4-2GB
+M:     Jagan Teki <jagan@amarulasolutions.com>
+M:     Deepak Das <deepakdas.linux@gmail.com>
+S:     Maintained
+F:     configs/nanopi-m4-2gb-rk3399_defconfig
+F:     arch/arm/dts/rk3399-nanopi-m4-2gb-u-boot.dtsi
+
 NANOPI-NEO4
 M:     Jagan Teki <jagan@amarulasolutions.com>
 S:     Maintained
index 5ca21474deea9c40d60805a13d0148cfe308e0e1..75661f35f8aae86ce377728e74b05fd96bc9b46c 100644 (file)
@@ -26,6 +26,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
        imply CMD_FS_GENERIC
        imply CMD_NET
        imply CMD_PING
+       imply CMD_SF
        imply CLK_SIFIVE
        imply CLK_SIFIVE_FU540_PRCI
        imply DOS_PARTITION
@@ -40,6 +41,8 @@ config BOARD_SPECIFIC_OPTIONS # dummy
        imply SIFIVE_SERIAL
        imply SPI
        imply SPI_SIFIVE
+       imply SPI_FLASH
+       imply SPI_FLASH_ISSI
        imply MMC
        imply MMC_SPI
        imply MMC_BROKEN_CD
index 157a33081ff144bd3914bc8b3bb0f7f17319c8b4..f9be1988f655c22f14bc2ffccdc7eec54a256ea9 100644 (file)
@@ -750,6 +750,22 @@ config SYS_ALT_MEMTEST
        help
          Use a more complete alternative memory test.
 
+config SYS_MEMTEST_START
+       hex "default start address for mtest"
+       default 0
+       help
+         This is the default start address for mtest for simple read/write
+         test. If no arguments are given to mtest, default address is used
+         as start address.
+
+config SYS_MEMTEST_END
+       hex "default end address for mtest"
+       default 0x1000
+       help
+         This is the default end address for mtest for simple read/write
+         test. If no arguments are given to mtest, default address is used
+         as end address.
+
 endif
 
 config CMD_SHA1SUM
index d6a7175b37956e53c3270c714af6c97a3354bab2..9edcf8d74ebb583b9a3ba7c8bf74c443bb550fa0 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+__maybe_unused void print_cpu_word_size(void)
+{
+       printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8);
+}
+
 __maybe_unused
 static void print_num(const char *name, ulong value)
 {
@@ -208,6 +213,8 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        print_baudrate();
        print_num("relocaddr", gd->relocaddr);
        board_detail();
+       print_cpu_word_size();
+
        return 0;
 }
 
@@ -227,6 +234,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        print_eth_ip_addr();
        print_baudrate();
+       print_cpu_word_size();
 
        return 0;
 }
@@ -252,6 +260,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        print_num("fdt_blob", (ulong)gd->fdt_blob);
        print_num("new_fdt", (ulong)gd->new_fdt);
        print_num("fdt_size", (ulong)gd->fdt_size);
+       print_cpu_word_size();
 
        return 0;
 }
@@ -283,6 +292,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
        print_eth_ip_addr();
        print_baudrate();
+       print_cpu_word_size();
 
        return 0;
 }
@@ -294,6 +304,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        print_std_bdinfo(gd->bd);
        print_num("relocaddr", gd->relocaddr);
        print_num("reloc off", gd->reloc_off);
+       print_cpu_word_size();
 
        return 0;
 }
@@ -354,6 +365,7 @@ static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
 #endif
        if (gd->fdt_blob)
                print_num("fdt_blob", (ulong)gd->fdt_blob);
+       print_cpu_word_size();
 
        return 0;
 }
@@ -368,6 +380,8 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        print_bi_flash(bd);
        print_eth_ip_addr();
        print_baudrate();
+       print_cpu_word_size();
+
        return 0;
 }
 
@@ -388,6 +402,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        print_mhz("ethspeed",       bd->bi_ethspeed);
 #endif
        print_baudrate();
+       print_cpu_word_size();
 
        return 0;
 }
@@ -405,6 +420,8 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
        print_num("FB base  ", gd->fb_base);
 #endif
+       print_cpu_word_size();
+
        return 0;
 }
 
@@ -419,6 +436,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        print_bi_dram(bd);
        print_eth_ip_addr();
        print_baudrate();
+       print_cpu_word_size();
 
        return 0;
 }
@@ -435,6 +453,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        print_num("reloc off", gd->reloc_off);
        print_eth_ip_addr();
        print_baudrate();
+       print_cpu_word_size();
 
        return 0;
 }
@@ -448,6 +467,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        print_bi_mem(bd);
        print_eth_ip_addr();
        print_baudrate();
+       print_cpu_word_size();
 
        return 0;
 }
index 9fee5288301971e3ece57198b9437ee5c57ce2b0..d3e31212eab0acaa9537b085e8fb108ada788d2a 100644 (file)
@@ -44,10 +44,10 @@ int bedbug_puts (const char *str)
  * settings.
  * ====================================================================== */
 
-void bedbug_init (void)
+int bedbug_init(void)
 {
        /* -------------------------------------------------- */
-       return;
+       return 0;
 }                              /* bedbug_init */
 
 
index 54b4b8f98455a8af7ccb60abcf1ae8074d45d032..06573b14e9bf113c0d1070c5432b27a7793ad5f1 100644 (file)
@@ -127,13 +127,13 @@ static efi_status_t copy_fdt(void **fdtp)
        new_fdt_addr = (uintptr_t)map_sysmem(fdt_ram_start + 0x7f00000 +
                                             fdt_size, 0);
        ret = efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
-                                EFI_BOOT_SERVICES_DATA, fdt_pages,
+                                EFI_ACPI_RECLAIM_MEMORY, fdt_pages,
                                 &new_fdt_addr);
        if (ret != EFI_SUCCESS) {
                /* If we can't put it there, put it somewhere */
                new_fdt_addr = (ulong)memalign(EFI_PAGE_SIZE, fdt_size);
                ret = efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
-                                        EFI_BOOT_SERVICES_DATA, fdt_pages,
+                                        EFI_ACPI_RECLAIM_MEMORY, fdt_pages,
                                         &new_fdt_addr);
                if (ret != EFI_SUCCESS) {
                        printf("ERROR: Failed to reserve space for FDT\n");
index 3dc2c854aca5c4b7c54bd99b692beaa29360254f..f1562883f5217c9f43750fc36a3add2f71ec5769 100644 (file)
@@ -365,6 +365,34 @@ cleanup:
        return NULL;
 }
 
+static void menu_display_statusline(struct menu *m)
+{
+       struct bootmenu_entry *entry;
+       struct bootmenu_data *menu;
+
+       if (menu_default_choice(m, (void *)&entry) < 0)
+               return;
+
+       menu = entry->menu;
+
+       printf(ANSI_CURSOR_POSITION, 1, 1);
+       puts(ANSI_CLEAR_LINE);
+       printf(ANSI_CURSOR_POSITION, 2, 1);
+       puts("  *** U-Boot Boot Menu ***");
+       puts(ANSI_CLEAR_LINE_TO_END);
+       printf(ANSI_CURSOR_POSITION, 3, 1);
+       puts(ANSI_CLEAR_LINE);
+
+       /* First 3 lines are bootmenu header + 2 empty lines between entries */
+       printf(ANSI_CURSOR_POSITION, menu->count + 5, 1);
+       puts(ANSI_CLEAR_LINE);
+       printf(ANSI_CURSOR_POSITION, menu->count + 6, 1);
+       puts("  Press UP/DOWN to move, ENTER to select");
+       puts(ANSI_CLEAR_LINE_TO_END);
+       printf(ANSI_CURSOR_POSITION, menu->count + 7, 1);
+       puts(ANSI_CLEAR_LINE);
+}
+
 static void bootmenu_show(int delay)
 {
        int init = 0;
@@ -396,8 +424,9 @@ static void bootmenu_show(int delay)
        if (!bootmenu)
                return;
 
-       menu = menu_create(NULL, bootmenu->delay, 1, bootmenu_print_entry,
-                          bootmenu_choice_entry, bootmenu);
+       menu = menu_create(NULL, bootmenu->delay, 1, menu_display_statusline,
+                          bootmenu_print_entry, bootmenu_choice_entry,
+                          bootmenu);
        if (!menu) {
                bootmenu_destroy(bootmenu);
                return;
@@ -445,34 +474,6 @@ cleanup:
 #endif
 }
 
-void menu_display_statusline(struct menu *m)
-{
-       struct bootmenu_entry *entry;
-       struct bootmenu_data *menu;
-
-       if (menu_default_choice(m, (void *)&entry) < 0)
-               return;
-
-       menu = entry->menu;
-
-       printf(ANSI_CURSOR_POSITION, 1, 1);
-       puts(ANSI_CLEAR_LINE);
-       printf(ANSI_CURSOR_POSITION, 2, 1);
-       puts("  *** U-Boot Boot Menu ***");
-       puts(ANSI_CLEAR_LINE_TO_END);
-       printf(ANSI_CURSOR_POSITION, 3, 1);
-       puts(ANSI_CLEAR_LINE);
-
-       /* First 3 lines are bootmenu header + 2 empty lines between entries */
-       printf(ANSI_CURSOR_POSITION, menu->count + 5, 1);
-       puts(ANSI_CLEAR_LINE);
-       printf(ANSI_CURSOR_POSITION, menu->count + 6, 1);
-       puts("  Press UP/DOWN to move, ENTER to select");
-       puts(ANSI_CLEAR_LINE_TO_END);
-       printf(ANSI_CURSOR_POSITION, menu->count + 7, 1);
-       puts(ANSI_CLEAR_LINE);
-}
-
 #ifdef CONFIG_AUTOBOOT_MENU_SHOW
 int menu_show(int bootdelay)
 {
index 27dcec093169e1294235e4ef31770b4bfdd65d6c..7678615dd83164f968e2af95d0f223226e6bc580 100644 (file)
@@ -20,6 +20,10 @@ void __weak invalidate_icache_all(void)
        puts("No arch specific invalidate_icache_all available!\n");
 }
 
+__weak void noncached_set_region(void)
+{
+}
+
 static int do_icache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        switch (argc) {
@@ -64,6 +68,7 @@ static int do_dcache(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                        break;
                case 1:
                        dcache_enable();
+                       noncached_set_region();
                        break;
                case 2:
                        flush_dcache_all();
index d4030fee645ae90ab3934f27bf86998d97bfbd95..d8a76d78a38896727f70fb7947b417303654c0f7 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/ctype.h>
 
 #define BS systab.boottime
-#define RT systab.runtime
 
 /**
  * efi_get_device_handle_info() - get information of UEFI device
@@ -69,7 +68,7 @@ static int do_efi_show_devices(cmd_tbl_t *cmdtp, int flag,
        u16 *dev_path_text;
        efi_status_t ret;
 
-       ret = EFI_CALL(BS->locate_handle_buffer(ALL_HANDLES, NULL, NULL,
+       ret = EFI_CALL(efi_locate_handle_buffer(ALL_HANDLES, NULL, NULL,
                                                &num, &handles));
        if (ret != EFI_SUCCESS)
                return CMD_RET_FAILURE;
@@ -86,7 +85,7 @@ static int do_efi_show_devices(cmd_tbl_t *cmdtp, int flag,
                }
        }
 
-       EFI_CALL(BS->free_pool(handles));
+       efi_free_pool(handles);
 
        return CMD_RET_SUCCESS;
 }
@@ -148,7 +147,7 @@ static int do_efi_show_drivers(cmd_tbl_t *cmdtp, int flag,
        u16 *driver_name, *image_path_text;
        efi_status_t ret;
 
-       ret = EFI_CALL(BS->locate_handle_buffer(
+       ret = EFI_CALL(efi_locate_handle_buffer(
                                BY_PROTOCOL, &efi_guid_driver_binding_protocol,
                                NULL, &num, &handles));
        if (ret != EFI_SUCCESS)
@@ -170,12 +169,12 @@ static int do_efi_show_drivers(cmd_tbl_t *cmdtp, int flag,
                        else
                                printf("%p %-20ls <built-in>\n",
                                       handles[i], driver_name);
-                       EFI_CALL(BS->free_pool(driver_name));
-                       EFI_CALL(BS->free_pool(image_path_text));
+                       efi_free_pool(driver_name);
+                       efi_free_pool(image_path_text);
                }
        }
 
-       EFI_CALL(BS->free_pool(handles));
+       efi_free_pool(handles);
 
        return CMD_RET_SUCCESS;
 }
@@ -321,7 +320,7 @@ static int do_efi_show_handles(cmd_tbl_t *cmdtp, int flag,
        const char *guid_text;
        efi_status_t ret;
 
-       ret = EFI_CALL(BS->locate_handle_buffer(ALL_HANDLES, NULL, NULL,
+       ret = EFI_CALL(efi_locate_handle_buffer(ALL_HANDLES, NULL, NULL,
                                                &num, &handles));
        if (ret != EFI_SUCCESS)
                return CMD_RET_FAILURE;
@@ -355,7 +354,7 @@ static int do_efi_show_handles(cmd_tbl_t *cmdtp, int flag,
                putc('\n');
        }
 
-       EFI_CALL(BS->free_pool(handles));
+       efi_free_pool(handles);
 
        return CMD_RET_SUCCESS;
 }
@@ -463,18 +462,17 @@ static int do_efi_show_memmap(cmd_tbl_t *cmdtp, int flag,
        int i;
        efi_status_t ret;
 
-       ret = EFI_CALL(BS->get_memory_map(&map_size, memmap, NULL, NULL, NULL));
+       ret = efi_get_memory_map(&map_size, memmap, NULL, NULL, NULL);
        if (ret == EFI_BUFFER_TOO_SMALL) {
                map_size += sizeof(struct efi_mem_desc); /* for my own */
-               ret = EFI_CALL(BS->allocate_pool(EFI_LOADER_DATA,
-                                                map_size, (void *)&memmap));
+               ret = efi_allocate_pool(EFI_LOADER_DATA, map_size,
+                                       (void *)&memmap);
                if (ret != EFI_SUCCESS)
                        return CMD_RET_FAILURE;
-               ret = EFI_CALL(BS->get_memory_map(&map_size, memmap,
-                                                 NULL, NULL, NULL));
+               ret = efi_get_memory_map(&map_size, memmap, NULL, NULL, NULL);
        }
        if (ret != EFI_SUCCESS) {
-               EFI_CALL(BS->free_pool(memmap));
+               efi_free_pool(memmap);
                return CMD_RET_FAILURE;
        }
 
@@ -501,7 +499,7 @@ static int do_efi_show_memmap(cmd_tbl_t *cmdtp, int flag,
                putc('\n');
        }
 
-       EFI_CALL(BS->free_pool(memmap));
+       efi_free_pool(memmap);
 
        return CMD_RET_SUCCESS;
 }
@@ -615,7 +613,7 @@ static int do_efi_boot_add(cmd_tbl_t *cmdtp, int flag,
                goto out;
        }
 
-       ret = EFI_CALL(RT->set_variable(var_name16, &guid,
+       ret = EFI_CALL(efi_set_variable(var_name16, &guid,
                                        EFI_VARIABLE_NON_VOLATILE |
                                        EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                        EFI_VARIABLE_RUNTIME_ACCESS,
@@ -670,7 +668,7 @@ static int do_efi_boot_rm(cmd_tbl_t *cmdtp, int flag,
                p = var_name16;
                utf8_utf16_strncpy(&p, var_name, 9);
 
-               ret = EFI_CALL(RT->set_variable(var_name16, &guid, 0, 0, NULL));
+               ret = EFI_CALL(efi_set_variable(var_name16, &guid, 0, 0, NULL));
                if (ret) {
                        printf("Cannot remove %ls\n", var_name16);
                        return CMD_RET_FAILURE;
@@ -864,7 +862,7 @@ static int show_efi_boot_order(void)
        efi_status_t ret;
 
        size = 0;
-       ret = EFI_CALL(RT->get_variable(L"BootOrder", &efi_global_variable_guid,
+       ret = EFI_CALL(efi_get_variable(L"BootOrder", &efi_global_variable_guid,
                                        NULL, &size, NULL));
        if (ret != EFI_BUFFER_TOO_SMALL) {
                if (ret == EFI_NOT_FOUND) {
@@ -975,7 +973,7 @@ static int do_efi_boot_next(cmd_tbl_t *cmdtp, int flag,
 
        guid = efi_global_variable_guid;
        size = sizeof(u16);
-       ret = EFI_CALL(RT->set_variable(L"BootNext", &guid,
+       ret = EFI_CALL(efi_set_variable(L"BootNext", &guid,
                                        EFI_VARIABLE_NON_VOLATILE |
                                        EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                        EFI_VARIABLE_RUNTIME_ACCESS,
@@ -1036,7 +1034,7 @@ static int do_efi_boot_order(cmd_tbl_t *cmdtp, int flag,
        }
 
        guid = efi_global_variable_guid;
-       ret = EFI_CALL(RT->set_variable(L"BootOrder", &guid,
+       ret = EFI_CALL(efi_set_variable(L"BootOrder", &guid,
                                        EFI_VARIABLE_NON_VOLATILE |
                                        EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                        EFI_VARIABLE_RUNTIME_ACCESS,
index b94f0051cdd780197de80229a56e940c127acc6c..b8d11c167df776476a39e64137153e953b6538f8 100644 (file)
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -772,11 +772,9 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
  out:
        del_gpt_info();
 #ifdef CONFIG_RANDOM_UUID
-       if (str_disk_guid)
-               free(str_disk_guid);
+       free(str_disk_guid);
 #endif
-       if (new_partitions)
-               free(new_partitions);
+       free(new_partitions);
        free(partitions_list);
        return ret;
 }
index 009b7b58f32887dea97c78fbecb6f239289cc0d4..18f0510098be60355b4252815fd3401a87a2cb3c 100644 (file)
--- a/cmd/mem.c
+++ b/cmd/mem.c
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifndef CONFIG_SYS_MEMTEST_SCRATCH
-#define CONFIG_SYS_MEMTEST_SCRATCH 0
-#endif
-
 static int mod_mem(cmd_tbl_t *, int, int, int, char * const []);
 
 /* Display values from last command.
@@ -922,7 +918,8 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
                        char * const argv[])
 {
        ulong start, end;
-       vu_long *buf, *dummy;
+       vu_long scratch_space;
+       vu_long *buf, *dummy = &scratch_space;
        ulong iteration_limit = 0;
        ulong count = 0;
        ulong errs = 0; /* number of errors, or -1 if interrupted */
@@ -958,7 +955,6 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
              start, end);
 
        buf = map_sysmem(start, end - start);
-       dummy = map_sysmem(CONFIG_SYS_MEMTEST_SCRATCH, sizeof(vu_long));
        for (iteration = 0;
                        !iteration_limit || iteration < iteration_limit;
                        iteration++) {
@@ -988,7 +984,6 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
        }
 
        unmap_sysmem((void *)buf);
-       unmap_sysmem((void *)dummy);
 
        if (errs == -1UL) {
                /* Memory test was aborted - write a newline to finish off */
index dc0ce01c358e2dd059cdde1f9b8e3f9031fd661f..ef53153c46b5ee5b3285d7e4294db853312ea43e 100644 (file)
@@ -730,8 +730,8 @@ static int bubt_check_boot_mode(const struct bubt_dev *dst)
 
                for (int i = 0; i < ARRAY_SIZE(a38x_boot_modes); i++) {
                        if (a38x_boot_modes[i].id == hdr->blockid) {
-                               printf("Error: A38x image meant to be "
-                                      "booted from \"%s\", not \"%s\"!\n",
+                               printf("Error: A38x image meant to be booted from "
+                                      "\"%s\", not \"%s\"!\n",
                                       a38x_boot_modes[i].name, dst->name);
                                return -ENOEXEC;
                        }
index 837e39e021798876ddc9e05a230ca619642898c8..6f69a84feaa0e2d4fb146e8a1dc34a52b58119b8 100644 (file)
@@ -298,7 +298,7 @@ int do_env_print_efi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                return CMD_RET_USAGE;
 
                        /* -a already specified */
-                       if (!default_guid & guid_any)
+                       if (!default_guid && guid_any)
                                return CMD_RET_USAGE;
 
                        argc--;
index 53af04d7dc75bdef091c34f7d94c7d97ace60777..c244bfb10d670f3790095164568d7747a5167a41 100644 (file)
@@ -1237,7 +1237,7 @@ static struct menu *pxe_menu_to_menu(struct pxe_menu *cfg)
         * Create a menu and add items for all the labels.
         */
        m = menu_create(cfg->title, DIV_ROUND_UP(cfg->timeout, 10),
-                       cfg->prompt, label_print, NULL, NULL);
+                       cfg->prompt, NULL, label_print, NULL, NULL);
 
        if (!m)
                return NULL;
index 0bbeaa7594c6bbbcbc9274a238581bf8d02526ca..d9015cd05794ef60f480731259b081ed0a9f1069 100644 (file)
@@ -518,15 +518,6 @@ static int initr_api(void)
 }
 #endif
 
-/* enable exceptions */
-#ifdef CONFIG_ARM
-static int initr_enable_interrupts(void)
-{
-       enable_interrupts();
-       return 0;
-}
-#endif
-
 #ifdef CONFIG_CMD_NET
 static int initr_ethaddr(void)
 {
@@ -646,15 +637,6 @@ int initr_mem(void)
 }
 #endif
 
-#ifdef CONFIG_CMD_BEDBUG
-static int initr_bedbug(void)
-{
-       bedbug_init();
-
-       return 0;
-}
-#endif
-
 static int run_main_loop(void)
 {
 #ifdef CONFIG_SANDBOX
@@ -813,9 +795,6 @@ static init_fnc_t init_sequence_r[] = {
        initr_kgdb,
 #endif
        interrupt_init,
-#ifdef CONFIG_ARM
-       initr_enable_interrupts,
-#endif
 #if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K)
        timer_init,             /* initialize timer */
 #endif
@@ -860,7 +839,7 @@ static init_fnc_t init_sequence_r[] = {
 #endif
 #ifdef CONFIG_CMD_BEDBUG
        INIT_FUNC_WATCHDOG_RESET
-       initr_bedbug,
+       bedbug_init,
 #endif
 #if defined(CONFIG_PRAM)
        initr_mem,
index cf1e273485c7e98c82cc897030439faf3a2e917e..a62af07cc5469c080bac40b9d711373a9d4b35a6 100644 (file)
@@ -1849,8 +1849,7 @@ static int run_list_real(struct pipe *pi)
                                continue;
                        } else {
                                /* insert new value from list for variable */
-                               if (pi->progs->argv[0])
-                                       free(pi->progs->argv[0]);
+                               free(pi->progs->argv[0]);
                                pi->progs->argv[0] = *list++;
 #ifndef __U_BOOT__
                                pi->progs->glob_result.gl_pathv[0] =
index db5ab55ed33119add34d853c44538502fb913032..e8f07f14f93f2a9d58dcfd68f697adc6e314229a 100644 (file)
@@ -280,6 +280,7 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            |             Unused space (may be 0 bytes long)                .
            .                                                               .
            .                                                               |
+
 nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     `foot:' |             Size of chunk, in bytes                           |
            +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -574,6 +575,10 @@ static void malloc_bin_reloc(void)
 static inline void malloc_bin_reloc(void) {}
 #endif
 
+#ifdef CONFIG_SYS_MALLOC_DEFAULT_TO_INIT
+static void malloc_init(void);
+#endif
+
 ulong mem_malloc_start = 0;
 ulong mem_malloc_end = 0;
 ulong mem_malloc_brk = 0;
@@ -604,6 +609,10 @@ void mem_malloc_init(ulong start, ulong size)
        mem_malloc_end = start + size;
        mem_malloc_brk = start;
 
+#ifdef CONFIG_SYS_MALLOC_DEFAULT_TO_INIT
+       malloc_init();
+#endif
+
        debug("using memory %#lx-%#lx for malloc()\n", mem_malloc_start,
              mem_malloc_end);
 #ifdef CONFIG_SYS_MALLOC_CLEAR_ON_INIT
@@ -708,7 +717,36 @@ static unsigned int max_n_mmaps = 0;
 static unsigned long max_mmapped_mem = 0;
 #endif
 
+#ifdef CONFIG_SYS_MALLOC_DEFAULT_TO_INIT
+static void malloc_init(void)
+{
+       int i, j;
+
+       debug("bins (av_ array) are at %p\n", (void *)av_);
+
+       av_[0] = NULL; av_[1] = NULL;
+       for (i = 2, j = 2; i < NAV * 2 + 2; i += 2, j++) {
+               av_[i] = bin_at(j - 2);
+               av_[i + 1] = bin_at(j - 2);
+
+               /* Just print the first few bins so that
+                * we can see there are alright.
+                */
+               if (i < 10)
+                       debug("av_[%d]=%lx av_[%d]=%lx\n",
+                             i, (ulong)av_[i],
+                             i + 1, (ulong)av_[i + 1]);
+       }
 
+       /* Init the static bookkeeping as well */
+       sbrk_base = (char *)(-1);
+       max_sbrked_mem = 0;
+       max_total_mem = 0;
+#ifdef DEBUG
+       memset((void *)&current_mallinfo, 0, sizeof(struct mallinfo));
+#endif
+}
+#endif
 
 /*
   Debugging support
@@ -1051,9 +1089,6 @@ static mchunkptr mremap_chunk(p, new_size) mchunkptr p; size_t new_size;
 
 #endif /* HAVE_MMAP */
 
-
-
-
 /*
   Extend the top-most chunk by obtaining memory from system.
   Main interface to sbrk (but see also malloc_trim).
index 3e735785949e9d642c00624164e8f03933ed6749..a3a0c61bcbf48df7fb53f848d5a03df22dbbcf09 100644 (file)
@@ -249,7 +249,7 @@ static int fit_config_check_sig(const void *fit, int noffset,
                                int required_keynode, int conf_noffset,
                                char **err_msgp)
 {
-       char * const exc_prop[] = {"data"};
+       char * const exc_prop[] = {"data", "data-size", "data-position"};
        const char *prop, *end, *name;
        struct image_sign_info info;
        const uint32_t *strings;
index 7b66d199a9b13054706f5886e19829a85c322d12..5fb2ffbd065d4ed8a3dd22dddf81e8d121be5b83 100644 (file)
@@ -36,6 +36,7 @@ struct menu {
        int timeout;
        char *title;
        int prompt;
+       void (*display_statusline)(struct menu *);
        void (*item_data_print)(void *);
        char *(*item_choice)(void *);
        void *item_choice_data;
@@ -106,10 +107,6 @@ static inline void *menu_item_destroy(struct menu *m,
        return NULL;
 }
 
-__weak void menu_display_statusline(struct menu *m)
-{
-}
-
 /*
  * Display a menu so the user can make a choice of an item. First display its
  * title, if any, and then each item in the menu.
@@ -120,7 +117,8 @@ static inline void menu_display(struct menu *m)
                puts(m->title);
                putc('\n');
        }
-       menu_display_statusline(m);
+       if (m->display_statusline)
+               m->display_statusline(m);
 
        menu_items_iter(m, menu_item_print, NULL);
 }
@@ -344,6 +342,9 @@ int menu_item_add(struct menu *m, char *item_key, void *item_data)
  * timeout. If 1, the user will be prompted for input regardless of the value
  * of timeout.
  *
+ * display_statusline - If not NULL, will be called to show a statusline when
+ * the menu is displayed.
+ *
  * item_data_print - If not NULL, will be called for each item when the menu
  * is displayed, with the pointer to the item's data passed as the argument.
  * If NULL, each item's key will be printed instead.  Since an item's key is
@@ -360,6 +361,7 @@ int menu_item_add(struct menu *m, char *item_key, void *item_data)
  * insufficient memory available to create the menu.
  */
 struct menu *menu_create(char *title, int timeout, int prompt,
+                               void (*display_statusline)(struct menu *),
                                void (*item_data_print)(void *),
                                char *(*item_choice)(void *),
                                void *item_choice_data)
@@ -374,6 +376,7 @@ struct menu *menu_create(char *title, int timeout, int prompt,
        m->default_item = NULL;
        m->prompt = prompt;
        m->timeout = timeout;
+       m->display_statusline = display_statusline;
        m->item_data_print = item_data_print;
        m->item_choice = item_choice;
        m->item_choice_data = item_choice_data;
index 22034409609b5a513b7602fb291f847c91c0825f..010e375740c837d480df8a754392231c6bf04a61 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="mpc8548cds_36b"
 CONFIG_ENV_ADDR=0xFFF60000
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
index b4ac4f1082aa8ccb5adbdef25bb4aa227e81dc06..deaa69d13490338560fb232c2c791c51793f0454 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="mpc8548cds"
 CONFIG_ENV_ADDR=0xFFF60000
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
index 9b6f8be9cfe9f61acca3ea3a1e7b384dc971021a..ab6f6eacd660a475e5092d20bc1fe6932fd2c6d8 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="mpc8548cds"
 CONFIG_ENV_ADDR=0xFFF60000
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
index 74294fceee53c680bd9fa1b8458c3538cf7029be..da04cab0142166262cc9a09854d156cb22720869 100644 (file)
@@ -39,14 +39,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pa_36b"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -71,9 +74,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index d43ad79f2e5e68e1f9757b5b93e894270910102b..e6edd395e783d7826e8150450e38f3c4db69651f 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_SECT_SIZE=0x20000
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PA=y
+CONFIG_MPC85XX_HAVE_RESET_VECTOR=y
 CONFIG_PHYS_64BIT=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
@@ -21,14 +22,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pa_36b"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -52,9 +56,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index ddb7e604cd972038e67eb2ec1e383f172a0d3b9f..dcd606b0c2e6a85481e287bbbf1289662eb6f8ba 100644 (file)
@@ -34,14 +34,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pa_36b"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -65,9 +68,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 12a073d42ae3d5899774953ca8d92c25ccc701a6..c0800c8d7ddfd1b6524cb73ac671676849ca9010 100644 (file)
@@ -36,14 +36,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pa_36b"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -67,9 +70,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 67cba6a436d081fa4e587f0b10fe3d3c40d1a8c8..29ba692ca16e76493b78a743311a4a6b627d2c30 100644 (file)
@@ -38,14 +38,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pa"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -70,9 +73,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 05ec02451c529cfc75cda53d1698446bfd0997d9..d8f87b5dacbac7ba86794d08394e19682dddb3b5 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_SECT_SIZE=0x20000
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PA=y
+CONFIG_MPC85XX_HAVE_RESET_VECTOR=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -20,14 +21,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pa"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -51,9 +55,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 95a15f7a18e1191ccdb0b7271a71d4080b6e0fc9..971108252912fe9918dfddb174b6db9805442cf4 100644 (file)
@@ -33,14 +33,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pa"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -64,9 +67,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index a7dd582c868e56b8d758ed3ad47592ff9c221f94..de2ac2235f983a3a7dc25070556e7d5fa1deedf0 100644 (file)
@@ -35,14 +35,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pa"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -66,9 +69,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 6e71c2a48fe7e339d1a72c6f0f9e22b0b3978c88..9f4876dd13abca4a89586f60ab03ae5223ec483f 100644 (file)
@@ -39,14 +39,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pb_36b"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -71,9 +74,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 79e4117d77632daadab9eeb055bc76fb3e79202c..e85af32e2c09818e46bfc13ef237b7d7b70ef6be 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_SECT_SIZE=0x20000
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PB=y
+CONFIG_MPC85XX_HAVE_RESET_VECTOR=y
 CONFIG_PHYS_64BIT=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
@@ -21,14 +22,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pb_36b"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -52,9 +56,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 083fe79f7d949362240b6259b3278ff89799091e..45feab4ee4d26555e5a360d4231dd607fdf0f413 100644 (file)
@@ -34,14 +34,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pb_36b"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -65,9 +68,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 6247d4706f21171851d35517e17e3c6e931a524b..3cd94f84ea5ecbdaed5b957afc80274da24648a6 100644 (file)
@@ -36,14 +36,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pb_36b"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -67,9 +70,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 12c74915ced3bad7d5c1316e5a092cebbad837d1..ddfe7b43a13da1952352cea729722053c6d58435 100644 (file)
@@ -38,14 +38,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pb"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -70,9 +73,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 943ca96fadfbf0668f648fd8c4a69ebaf0e6afbc..6011f8a9d8e0d4fcb27d2510a6712f84bc984326 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_ENV_SIZE=0x2000
 CONFIG_ENV_SECT_SIZE=0x20000
 CONFIG_MPC85xx=y
 CONFIG_TARGET_P1010RDB_PB=y
+CONFIG_MPC85XX_HAVE_RESET_VECTOR=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
@@ -20,14 +21,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pb"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -51,9 +55,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 3548b9511099acc353d9e2b24d7badf9b3697fcf..65f86fff603a726c2fe0fbf55703f60dba1b66a8 100644 (file)
@@ -33,14 +33,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pb"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -64,9 +67,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index b54cf2b8b64a8756af66b2c8280db69e800821a8..f71ee19ba663b6a530ab5a06edbf63a4c315a063 100644 (file)
@@ -35,14 +35,17 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_MTDIDS_DEFAULT="nand0=ff800000.flash"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:2m(uboot-env),1m(dtb),5m(kernel),56m(fs),-(usr)"
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="p1010rdb-pb"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -66,9 +69,12 @@ CONFIG_PHY_GIGE=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_TSEC_ENET=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
index 2396d910115dbd4b00decb0950c467546de3fd9b..6ee52fe5e7d41121cdbc30be67a40404e0e4931e 100644 (file)
@@ -39,7 +39,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -49,6 +48,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pc_36b"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -77,6 +77,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 745200da51491ce055e774df1d30f7834589bcbc..489b91d8e7e8e5287b0027ac025fb9208b6a0990 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -45,6 +44,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pc_36b"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -72,6 +72,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 3eadd3d83c9397ed0d563b9bbc2952862db41df9..4a8e4e3726bf44eaccb655c76a0594e67bd5e0d3 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -47,6 +46,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pc_36b"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -74,6 +74,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 9b7901f5c3725205b6a6225a1606045b8fd5e3b8..f9a4b735ca081ef2ff3a2fd832167c04cd4755e9 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -34,6 +33,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pc_36b"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -61,6 +61,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index e99709a2b876bfc0edb3af18ccf88a53c094fa47..5c8231cba20316a7c8d4f2a9d3e522c97aabe2f7 100644 (file)
@@ -38,7 +38,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -48,6 +47,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pc"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -76,6 +76,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index ef007e5fe4b521c7951322d5c8f421e0cfb9823c..ad2bb90a49e8c620e1c5c64797f036f9225283f2 100644 (file)
@@ -34,7 +34,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -44,6 +43,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pc"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -71,6 +71,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index c8b0923cb50c634df255658719fb2a566a1a6eb8..b8055e49b0cc6cd2cbd5219d080d9ab680fee3da 100644 (file)
@@ -36,7 +36,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -46,6 +45,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pc"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -73,6 +73,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 1a30c97f7fa1db3366d1458fc3a913904bb6a0c6..a71985374e0fc1f3a8032b9470b3f2bf6c0a1f45 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -33,6 +32,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pc"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -60,6 +60,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index e1858e4cac82c772c9d38cb3c2276d48bc5006de..0043fd5f66f11727e4fe24a2cf7744d7f0f39fa9 100644 (file)
@@ -38,7 +38,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -51,6 +50,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pd"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -80,6 +80,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index e24c89f7266e575c1d5b99856e2630b28d2c68d8..cb0a8aec6574fd22a1b5e59b0db399717b622c5a 100644 (file)
@@ -34,7 +34,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -47,6 +46,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pd"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -75,6 +75,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index c89201f9788bf9f5aeb53a93de92a616279469c8..35e60ca856926b89edbec772cd8c39d03f6a2ce2 100644 (file)
@@ -36,7 +36,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -49,6 +48,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pd"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -77,6 +77,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index c79d599b60999b4d001bfa399d5ee08de161e9f7..d7f19c3d96fd405e34fc00e626ecb1724a25482d 100644 (file)
@@ -23,7 +23,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -36,6 +35,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p1020rdb-pd"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -64,6 +64,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index b419367e7e3ddfaa47f810a63b327c537df6672c..3e6ea64ee32e447cb545a22ab0eb24fb0bad6305 100644 (file)
@@ -40,7 +40,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -53,6 +52,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p2020rdb-pc_36b"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -82,6 +82,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 0afddc2ed98d7822b4b1a86aab9d68863ef5a865..187cbee0d62eb0ad6a7468ef9170de370b1ed72f 100644 (file)
@@ -36,7 +36,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -49,6 +48,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p2020rdb-pc_36b"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -77,6 +77,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 1a700a867fe7b4f4d4dcd07613b63664128c04f3..88c92240014fe6a869acf487bde7395b2adfcf4a 100644 (file)
@@ -38,7 +38,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -51,6 +50,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p2020rdb-pc_36b"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -79,6 +79,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 8b98cb8b9a7ac980b6c19971a0f313c3c0d5fb3a..88e24c30badff57afcc730bfebe35ecb65105de9 100644 (file)
@@ -25,7 +25,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -38,6 +37,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p2020rdb-pc_36b"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -66,6 +66,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index b1a26af0f4b95c0afe7bf4acd2fb3bb0ee0d6d15..dda34dd43ec1cc9db1ad38a463e0935fc3348476 100644 (file)
@@ -39,7 +39,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -52,6 +51,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p2020rdb-pc"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -81,6 +81,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index c76958e1f381d20bdb86e00b3e3de5a2e226823d..c2b6ad5f3228e47c4968bc8d3fddb522fd5bc761 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -48,6 +47,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p2020rdb-pc"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -76,6 +76,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 0892596fd61ef01b81dfc29594ff6db2a42b90e2..3ec208ee00cdbc512430c222bb13aa7993f59c46 100644 (file)
@@ -37,7 +37,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -50,6 +49,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p2020rdb-pc"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -78,6 +78,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index e37ca66d1fc05b324b6e277c510ab881668b78c2..0f0a6ad810ee479c8e7c51bef405e8ff5b457abb 100644 (file)
@@ -24,7 +24,6 @@ CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 # CONFIG_CMD_HASH is not set
 CONFIG_CMD_EXT2=y
@@ -37,6 +36,7 @@ CONFIG_DEFAULT_DEVICE_TREE="p2020rdb-pc"
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -65,6 +65,7 @@ CONFIG_TSEC_ENET=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 0399a27e5d3381d3b8cdfad45bc90c7088ef1c00..13b20dd1c6c5b57765c0ca2a51c307714e2f549e 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 0b53a0595ca767d1256c0bf827fe4a122f6f8696..d99c15342dfeb06fb1076aa0a2d0df2c3f320a89 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 8c2e20eeaa64d51621aa169ca8e490bd59e36412..78a2a97064f2273f704db5e9dba67480ac0c07ab 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 6836d42932f920d3a8c5b2cabc52fb989177f06d..0b9625e91e2932729e6c2d07c9e21c9a750aac13 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index eb000c8b3c47040a74d9ab6862ea3f0af235b772..55613ccacd045bc2357ba066192785e9ed6ac59a 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index ade8b58feee6b81c413e7ba2dc8067101da5fb30..b52068d050df582569ea5776c5e531966f23de7f 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 0bb7288fa4bffcda507b6e573c5e05850baefa48..3af52b90e839a050a1173381fed7821a9bf61220 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 428d9e3e6cf9fa2ba5fe3d4872afb129b283203e..cc3234c6b1b7bf368f5164241dfd98f786f131f8 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 1318e261fb47b67c95493bbcc7775e5625e2a498..18ad56ac8dab6aec55325f2e03ac6b7cad8c1ed1 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD_NOR_FLASH=y
index f19ace2f2ed55de88e189d26f1d4e31ed8462958..81a513bec91f0ee746428291dd7762e16855bdc8 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD_NOR_FLASH=y
index 31e91c12814fa3d5e6bc2a1eefa85a8aa0eb5e41..52db2e06c7e9b7d442faaf38e151e623d45dfa5e 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD_NOR_FLASH=y
index 8be7d908021d74435178adf285ced731ffd7c696..efffb706fbb319be51df89b8e3527d1194a281e5 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 134ea01ed3dc88293d956beaadd00cff9026d226..fdd39acbaf3592c50768ad7463a09773e7c841b3 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 2daceccd7d48a70c00c74f60c2f2e64f4738f1ce..3f4642f4e08d48ced6c9446bf5644143c16bafe3 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 14a97f8f79d67a1a73510322e43326289805f65a..d2a2e02dcd075b68c5d157e46785a079f2d17756 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index ca74b8800d6b6549fc980275e7380a25a7e25d22..75604383c6c64de724521e46c49c7821feed077d 100644 (file)
@@ -31,6 +31,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 4edc69aac56cc4a769afd409010b69ce6c57b4e0..4471c83f3fdbf0c05eeb437c9b4a4c10c42403b9 100644 (file)
@@ -29,6 +29,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5ddaac6e2e2d9317562db4edb6a85b912ab6e713..34fe6e5e528497291f5b2ad39984f63b3f107757 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index b489a80245917b99425a2fe9549509b1b9c26e92..599aeec688646a567d254661515da1b7bc4f419d 100644 (file)
@@ -31,6 +31,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index b8ffebc45c072c8d5002d3409680df8c1c7a27b3..62cc129a319215b4f49b212a9e3973928b44fdf5 100644 (file)
@@ -16,6 +16,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index c2c73a744ac61b146c2fe78feec17daab621f4ff..9b116548a73544820b4ca8b072a4bc4e19230640 100644 (file)
@@ -34,6 +34,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -41,7 +43,6 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
@@ -53,6 +54,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_FSL_DDR3=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -76,6 +78,7 @@ CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
 CONFIG_SYS_QE_FMAN_FW_IN_NAND=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 3ded897dcf430afda1969eda432705089cf311fe..5e087fe2f3bc11dfe30c2146630af5be3a8a8029 100644 (file)
@@ -32,6 +32,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -39,7 +41,6 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
@@ -51,6 +52,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_FSL_DDR3=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -73,6 +75,7 @@ CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
 CONFIG_SYS_QE_FMAN_FW_IN_MMC=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 1d221dba9ec2243b23e6bd5beadeee9c677b8213..f23f021143ac93e1ae29703639b1d14dd849779f 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index 123d8ddbb0b5cf7be4f81647c55aec1f82777565..39b4537e71857d135c20c5959173a14e55a7df37 100644 (file)
@@ -34,6 +34,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -41,7 +43,6 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
@@ -54,6 +55,7 @@ CONFIG_ENV_ADDR=0xFFFC9000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_FSL_DDR3=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -76,6 +78,7 @@ CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
 CONFIG_SYS_QE_FMAN_FW_IN_SPIFLASH=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index dc6b62c67ef1ff9002ce2c005fb895f57581b516..8ff2fe3f0cd11b7cd9761d18338c446069d549ea 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -26,7 +28,6 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_DATE=y
 CONFIG_MP=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
@@ -39,6 +40,7 @@ CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
 CONFIG_SYS_FSL_DDR3=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -61,6 +63,7 @@ CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
 CONFIG_SYS_QE_FMAN_FW_IN_NOR=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index f5a3c4403889f21cbd87d159c6b5756177d94c8e..1602fb890e880a22ec4fdba19f091bca7981ade9 100644 (file)
@@ -51,6 +51,7 @@ CONFIG_DEFAULT_DEVICE_TREE="t1042d4rdb"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -75,6 +76,7 @@ CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
 CONFIG_SYS_QE_FMAN_FW_IN_NAND=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 18e51b1d6045edf0474ce9314f511ec4677cede0..a4a31bfd6239074b937922d1e853a7c48d35908d 100644 (file)
@@ -49,6 +49,7 @@ CONFIG_DEFAULT_DEVICE_TREE="t1042d4rdb"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -72,6 +73,7 @@ CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
 CONFIG_SYS_QE_FMAN_FW_IN_MMC=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 093d233b7c293d970d89ea85fd4e761d0d578d7f..697c08dbfac515a68c6e01de83dcf54d4b5a9391 100644 (file)
@@ -52,6 +52,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_ADDR=0xFFFC9000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -75,6 +76,7 @@ CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
 CONFIG_SYS_QE_FMAN_FW_IN_SPIFLASH=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index 95160cdd16c99a9ff3e12c06b96037f16d4f556a..70ddffb3a75285623b888a396e8b2d728ccee9c6 100644 (file)
@@ -37,6 +37,7 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
@@ -60,6 +61,7 @@ CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCIE_FSL=y
 CONFIG_SYS_QE_FMAN_FW_IN_NOR=y
+CONFIG_DM_RTC=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_FSL_ESPI=y
index dc836642859e67e1c0b5281e278a18eebe59a011..52255ed1204f6cb530c079497bfe27dabed1a548 100644 (file)
@@ -47,6 +47,7 @@ CONFIG_DEFAULT_DEVICE_TREE="t2080qds"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 24359ed1a4b0cb5aa05f65da9dfd49381a9cd03c..ba57ea33b1df865fab9d3bd8c26b0a5ce17a5c2a 100644 (file)
@@ -45,6 +45,7 @@ CONFIG_DEFAULT_DEVICE_TREE="t2080qds"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index cc2449a25f6e825b65ae73b4013a1c2f38c7ac62..9b3f709c87f33d12da2bb1dc7a048bcc74dc20fd 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="t2080qds"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 5d159607a8960d00e10b7c0e4517b995d40ffdb7..5aa45f5a892e3f05a62e9c40b6fc190a4789c300 100644 (file)
@@ -48,6 +48,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_ADDR=0xFFFC9000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index c3fef7afe34ad22fb0fe27120760d4c7e5cd1b99..4958435ef4b939cc7511368df230970d1a710b5c 100644 (file)
@@ -30,6 +30,7 @@ CONFIG_ENV_IS_IN_REMOTE=y
 CONFIG_ENV_ADDR=0xFFE20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 9cf28152994df7163ff9c1739a85395aacc6a801..602bf577e07a5ae185edd49b29f32d3c7f77ec7a 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 292a3beb41a313a5ca8771a0ebe131d4d97128ea..81baa5dbdd0daf509c1b88c076da20919ccaa4c5 100644 (file)
@@ -30,6 +30,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -49,6 +51,7 @@ CONFIG_DEFAULT_DEVICE_TREE="t2080rdb"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index b53a0ada3da6787f6ee97a5cdc6b678ee2fdbd3f..a1d7d87b60f374466eb130d6956961d17b5b3607 100644 (file)
@@ -28,6 +28,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -47,6 +49,7 @@ CONFIG_DEFAULT_DEVICE_TREE="t2080rdb"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index a1f8d3d1fd9cad4beb6a4a92b33b1fcee2382328..7d04a9411650bbfbb9460049fc7800d8ef5e4e14 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
index ddf273f54587257a6cfd20ee6e3fb3faecfcbbcb..c433a922e635ee6443467abbd660ca8c5318b38b 100644 (file)
@@ -30,6 +30,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -50,6 +52,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_ADDR=0xFFFC9000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 6c16bfa19f438638e16ca8efc8294cc285bc7a96..a8f0a965c134f0d0d1b6e3a763d202e8435f8b4c 100644 (file)
@@ -13,6 +13,8 @@ CONFIG_BOARD_EARLY_INIT_R=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c81f546f52d3dc0f18765f20435c4d02b0b916e1..85e3b64ad335a6d9aef09807a2353ec6432c93bc 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00200000
+CONFIG_SYS_MEMTEST_END=0x00400000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SF=y
@@ -35,6 +37,7 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index 646cd88793aee6cdabc8bf58d3a495ebe7cb87d4..14e366358bd3b07dfb41fef68fbc3e508d075c86 100644 (file)
@@ -42,6 +42,7 @@ CONFIG_DEFAULT_DEVICE_TREE="t4240rdb"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index d74afc71eb0114fab60820458df539e225c95bfe..dfe8953af76a3fee1f8512cbce17b61f58fd3ff5 100644 (file)
@@ -30,6 +30,7 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xEFF20000
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
+CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
index af83ef5e9434a84f6e6b7fd533a924feb9c4f8f2..5d7a8de71d6d017585e3f60973c2333268da7b5c 100644 (file)
@@ -24,6 +24,8 @@ CONFIG_SYS_PROMPT="ap121 # "
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_CRC32 is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80100000
+CONFIG_SYS_MEMTEST_END=0x83f00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_SPI=y
 CONFIG_CMD_DHCP=y
index 3d5849dd0a5c1b2d33d12ec5c4a85bb94d062179..68cc8e03bbde21978d189119b68126510d8b5b23 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_SYS_PROMPT="ap143 # "
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_CRC32 is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80100000
+CONFIG_SYS_MEMTEST_END=0x83f00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_SPI=y
 CONFIG_CMD_MTDPARTS=y
index 6ed89a2ea16c882750d454191abde133995160e4..434e3c1406ce46aedbddf3428a63fea9ec15cd7e 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_SYS_PROMPT="ap152 # "
 # CONFIG_CMD_EDITENV is not set
 # CONFIG_CMD_CRC32 is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80100000
+CONFIG_SYS_MEMTEST_END=0x83f00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_SPI=y
 CONFIG_CMD_MTDPARTS=y
index 84bc0bb929bac316043547a8e18784ddb09ffca1..4c27c33459195eed456d4d502ebad389dbb85aec 100644 (file)
@@ -18,6 +18,8 @@ CONFIG_CMD_CPU=y
 # CONFIG_BOOTM_NETBSD is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x88000000
+CONFIG_SYS_MEMTEST_END=0x89000000
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DM=y
 CONFIG_CMD_FUSE=y
index ea18ef908cb8ce0be7311851f5720a44b9e947af..4c6b100654617a1674479ba2431a18934f8db0ca 100644 (file)
@@ -40,6 +40,8 @@ CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
index 2a72355c6964ba3bb34f746a819de8a9784af0de..785283fbea8f7b1860d30cabccfba94e4d0b13c7 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_BOOTDELAY=0
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_OS_BOOT=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x00001000
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_MMC=y
index deec16e55cb34488ddc8b34ee91674718104d631..8c2bda6984ae86ee537360d7095330125f09dd78 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80010000
+CONFIG_SYS_MEMTEST_END=0x87c00000
 CONFIG_CMD_DM=y
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
index c14226133119f61946fb75662d177af8bfe7b37c..189b824544bfa41a4a030e0f478ecb30939af6f2 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_PCI=y
index c6c7f00acd31491a3c50f418a88b46eb860e18ab..eb2454e296f3dee604ec3762aee4cca68f5b3531 100644 (file)
@@ -16,6 +16,8 @@ CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_PCI=y
index 0fffc46ae61fcc2bcf7c42640dae2a36b49966d0..f3e0908d5bf531ddb29ab6120e265af52061513b 100644 (file)
@@ -16,6 +16,8 @@ CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_PCI=y
index 1ecc06d4402726c6734f8ab8010bcf39b94b51d8..0d139d83072658578aab665cc823db3d7bc695d3 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_PCI=y
index 46e78c7fef2f8533b89ace4224c349f4d4d937c1..8ba301f6bdbc426c3225d60b2d9c23b438fa913a 100644 (file)
@@ -16,6 +16,8 @@ CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_PCI=y
index aa075398e4c031ef64b0e885094b99efdb63b203..6db2f2b887fec7774f7f1c00ec4db58b1ed8bfcf 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_PCI=y
index 216e61c8bfa6878c4ec3d43a59970932a27c74dc..b0bbf51a5271e5fd9b15d577c86d15647655cde0 100644 (file)
@@ -16,6 +16,8 @@ CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_PCI=y
index 354ae8e53bd0b6437ac906786225b23ccb2e746e..030d708e559180297c9e8df55a571982b866847d 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SYS_PROMPT="boston # "
 # CONFIG_CMD_ELF is not set
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_PCI=y
index 7e997552e352d5b72fbd0ba2c213dc242bd9e675..74a67a020009b33060544f6abbb1ac481e8edcd7 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_SYS_PROMPT="Colibri iMX6ULL # "
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
index fa5bd4aca1723c9190dc82cd4e4af6059ef57c99..d86cefafc68377a75f829a5ea467ee79f4fc22e2 100644 (file)
@@ -18,6 +18,8 @@ CONFIG_CMD_CPU=y
 # CONFIG_BOOTM_NETBSD is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x88000000
+CONFIG_SYS_MEMTEST_END=0x89000000
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
index 8fbd9fcf1fddddee9f9be1e8317c7ef53ffd89e1..adb7c95019534a0528ff91e15b3bed1a362e0c8e 100644 (file)
@@ -39,6 +39,8 @@ CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
index e434a77400270e1a4c50efe33f7234f6b0ba8fc8..7596478ee3699aaa1583d4c4f1ea703a0f321c2b 100644 (file)
@@ -27,6 +27,8 @@ CONFIG_SYS_PROMPT="Colibri iMX7 # "
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x8c000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 814667adf9c766810bfaa14a2a77d2967cd6a23c..c23ff97daa1faf8f02d2a51fb6c013cd0ba0c110 100644 (file)
@@ -29,6 +29,8 @@ CONFIG_SYS_PROMPT="Colibri iMX7 # "
 CONFIG_CMD_ASKENV=y
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x8c000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
index 91afabe5438eb1e82240fd76597754cb769d13e0..c494fb40e944e9c76679c64fcf06c1959ea9d534 100644 (file)
@@ -29,6 +29,8 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80010000
+CONFIG_SYS_MEMTEST_END=0x87c00000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_DM=y
 # CONFIG_CMD_FLASH is not set
diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig
new file mode 100644 (file)
index 0000000..39469b5
--- /dev/null
@@ -0,0 +1,48 @@
+CONFIG_X86=y
+CONFIG_SYS_TEXT_BASE=0x1120000
+CONFIG_ENV_SIZE=0x1000
+CONFIG_NR_DRAM_BANKS=8
+CONFIG_PRE_CON_BUF_ADDR=0x100000
+CONFIG_SPL_TEXT_BASE=0x1110000
+CONFIG_X86_RUN_64BIT=y
+CONFIG_VENDOR_COREBOOT=y
+CONFIG_TARGET_COREBOOT=y
+CONFIG_FIT=y
+CONFIG_FIT_SIGNATURE=y
+CONFIG_SHOW_BOOT_PROGRESS=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
+CONFIG_PRE_CONSOLE_BUFFER=y
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_LAST_STAGE_INIT=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IDE=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+# CONFIG_CMD_NFS is not set
+CONFIG_CMD_PING=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_SOUND=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_MAC_PARTITION=y
+# CONFIG_SPL_MAC_PARTITION is not set
+# CONFIG_SPL_DOS_PARTITION is not set
+CONFIG_ISO_PARTITION=y
+CONFIG_EFI_PARTITION=y
+# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_DEFAULT_DEVICE_TREE="coreboot"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+# CONFIG_PCI_PNP is not set
+CONFIG_SOUND=y
+CONFIG_SOUND_I8254=y
+CONFIG_CONSOLE_SCROLL_LINES=5
index 3b513cc1582c6b7db9b9c7e5af72d77a4f662e6c..7632fc4254ba7255e69d3a116f486f73c5073f08 100644 (file)
@@ -13,6 +13,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00800000
+CONFIG_SYS_MEMTEST_END=0x00ffffff
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SPI=y
index 0d49d406cabc88ce25cadb446f733645e7ce99b7..2bbff646653d8f51af9ff9b81efef7101b93ffda 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_USE_PREBOOT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00800000
+CONFIG_SYS_MEMTEST_END=0x00ffffff
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_SPI=y
index dcfbbb6d5a510b99a543ca16a20339ed62921e92..e0dfffa4b5710515932fc9485ac4208352b7e273 100644 (file)
@@ -33,6 +33,8 @@ CONFIG_BOUNCE_BUFFER=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x20000000
 CONFIG_CMD_UNZIP=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
index f8d66745dc34c8f8005704928ee1451328ae68a0..b2fda44ec26c2dd69b39bdfbb1063481709b9206 100644 (file)
@@ -85,6 +85,8 @@ CONFIG_SPL_RAM=y
 CONFIG_TPL_RAM=y
 CONFIG_ROCKCHIP_SDRAM_COMMON=y
 CONFIG_DM_RESET=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_ROCKCHIP=y
 # CONFIG_SPECIFY_CONSOLE_INDEX is not set
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_DEBUG_UART_SKIP_INIT=y
index 5bbdc002148c1d24d72472ea902e404d8feaec4a..7667bb037b3d28dcec2d58e3a29237eaf408c086 100644 (file)
@@ -61,7 +61,6 @@ CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
-CONFIG_PHY=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_DM_PMIC=y
index 3f74be3b3c4c316162b8fff701649b21999c1f6d..7f14e18b1b31966a5c79390cd9b88ec7c276b6a2 100644 (file)
@@ -39,6 +39,8 @@ CONFIG_PMIC_RK8XX=y
 CONFIG_REGULATOR_PWM=y
 CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_ROCKCHIP=y
 CONFIG_BAUDRATE=1500000
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYSRESET=y
index d125a6eb9db20084dcdcca253b790eb7f9c45b40..7111905eeeeabdd418073c88a3227e034e57b230 100644 (file)
@@ -127,6 +127,8 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_BINOP=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00001000
+CONFIG_SYS_MEMTEST_END=0x07e00000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e273f35e84046e6469d28a4a20bbdd488194d65f..a5c301dbdbffc8954bcf8d82a89a381d16c33033 100644 (file)
@@ -52,6 +52,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_SYS_MTDPARTS_RUNTIME=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SPL_NAND_SIMPLE=y
index fb18458cbe59bbb35677dca8885cfac1d176dfb5..340718c572cbc8c2863b120c871a0d275af5dd6b 100644 (file)
@@ -24,6 +24,8 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="icorem6qdl> "
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 8f03f2fc9edab3a099a78392c5df08ecd9995ef0..7c4913debd4e52d7418930a4447aa18fbc1b6f21 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_BOUNCE_BUFFER=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 4f42f7a83554e8b0bd287d7864091acccce6391a..6b3cb8d8d3ac2bfd89941429870b003595351c77 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="icorem6qdl> "
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index f4ec96c6e6ccafb04c346170774c3a037906cd16..be704125a92e8ca1154ddc788e91e5e3b072115b 100644 (file)
@@ -38,6 +38,8 @@ CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x1500000
 CONFIG_CMD_SPL_WRITE_SIZE=0x00100000
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index fe37760d7fb45ec06cb5016362f5cd959f6ce25b..7b13e1fd781aba88dbe77034e32d08791e584378 100644 (file)
@@ -31,6 +31,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="icorem6qdl-mipi> "
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 486268cee9f6ab0f33214a4254fd2d51d08e0dd4..4b2e1f4780fccda75c6c7755b222c95b900c9c76 100644 (file)
@@ -34,6 +34,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="icorem6qdl> "
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 4f42f7a83554e8b0bd287d7864091acccce6391a..6b3cb8d8d3ac2bfd89941429870b003595351c77 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="icorem6qdl> "
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index f9a748d66c2025340aa1ee4bf8360fe697e7097f..a224baf6398c9ff943f09470bd7feb0a98f35b5a 100644 (file)
@@ -28,6 +28,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="icorem6qdl-rqs> "
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 8ae72e7ee49d0d9f9fb73ab4879cc2938d2728f0..5e27fd6bd1c09b8c89486c07cdf29b684ffcf433 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="geam6ul> "
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 15201d2ef05a88c9e70d2a19256927061f246999..ce1c3ddeeefd9116d99c765989f83a675571aae6 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="geam6ul> "
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 35c974ebef5fe8103b6050acff801a5e976cd661..314045828214773725a41224e6f6151d56e943f1 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="isiotmx6ul> "
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index bfa03a791d9f93c919291baeb89e19a37b0abedb..c9c2660d60f1fa827f71197fbf6413002c84c27a 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="isiotmx6ul> "
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5be02a33829ba706de42aa38667326a67b302c93..d1e9cc401777ea49dcaacd342fa05fddc8ad8645 100644 (file)
@@ -3,9 +3,9 @@ CONFIG_SPL_SYS_ICACHE_OFF=y
 CONFIG_SPL_SYS_DCACHE_OFF=y
 CONFIG_ARCH_IMX8M=y
 CONFIG_SYS_TEXT_BASE=0x40200000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x400000
-CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_DM_GPIO=y
 CONFIG_TARGET_IMX8MQ_PHANBELL=y
 CONFIG_SPL_SERIAL_SUPPORT=y
@@ -17,6 +17,7 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage.cfg"
+CONFIG_SD_BOOT=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_BOOTM_NETBSD is not set
@@ -28,6 +29,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
+# CONFIG_SPL_DOS_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx8mq-phanbell"
 CONFIG_ENV_IS_IN_MMC=y
@@ -48,5 +50,3 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_RESET=y
 CONFIG_DM_THERMAL=y
-CONFIG_SD_BOOT=y
-# CONFIG_SPL_DOS_PARTITION is not set
index 7c94478e0a742bda68077369a95b8929f5d007a3..b1606e54c457ba1423290c9a4cbc04f9c07e4a05 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
index 9bf5b9c16b008c50e13cc03725d1c62321e73eb0..18b72b465caafde90c1601cba17b8b512711a5f3 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index d9d4f8206c83b6ba548c77b2c7b3f21fe0fff9fc..4ca57d1debc457393f766774743dcb3f8a8598e9 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 02a80b1a596d35816f2a05d36a451a2f936140e9..1a4cc37555ca84477802cb034b6da7b77632338c 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
index ecc4c81eb3fa9d81bdaebf9254d1d663e16afdd4..177fcd4ff63360648aa593909ba8a0bedd996b27 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
index addb31c1959c6af68f39404e27b70edb786880e4..a702cc82b9a01c8a76b142b3ec08133232b187cf 100644 (file)
@@ -20,6 +20,9 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 2156f5eb971ad5a837bb6b64d1dba65c7c2f8623..187015c2b2e87badb1840dbae3c2bfcc1ce13036 100644 (file)
@@ -21,6 +21,9 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index a4fdd0c02ffafa1c0dbf052cf0135a9f66782b04..5071bb75dfb0229e1206aad8ec331f4f390e55cd 100644 (file)
@@ -20,6 +20,9 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 280dbd3b47c75519572b838f157d32d842ef07dd..c5ed91a7d3e4e85b4432a33dee90f255575fe508 100644 (file)
@@ -21,6 +21,9 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 78266612398fb56911b14c4c3bc739d1174d04c7..1c3d7bcd756d921a141f4786d5c59efab34025db 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 8ab6cbc3f8075fe88ea2fa4efcf7c035e7cb1a17..0833a2ae5eca078afe3e0540f39907fae6b65958 100644 (file)
@@ -24,6 +24,8 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 1b783c524f636de4cfdf9e42a2c2ceff21fc8133..7fc9e15bc41beb874690f7ca34747dec034e83c5 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 4031b9bbd75917f49267465f759b89eb4f07b672..b6110c022a3203930c0948af6bdb5e6c97bb2808 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 01770b89d4d2974f6312e2f1683dbf09a6417b2d..9c2a308e73ec9c2857b4e69636cef009149588e7 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 57e9dd9957c97f526ce7a7aaa291e1474b2ba410..736810d773570ab333f43482a54ad221158cde94 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 06584ff1dca4c41dcf415fab7cbf9b872894ddfb..fc3dc4a0e79adbe2a357e7995d07ffa34a83098a 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 203303b6e12b767f17e05bd7dc6badcaf519c631..24e0316eb1d35acd92d6343ffd7438d91056f629 100644 (file)
@@ -21,6 +21,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index f77b6dbd9dba0d202a71d2990fc0f52b294ffa89..f0f3a747c6c6f252c7b4c8c9324f6982f395ad6a 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index dc45f8fbf4684d14bcd3b2c04776c97c206d758e..8a88c5fd39373a8ce7710e4484411ee8a3f83d05 100644 (file)
@@ -37,6 +37,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index aaf0f137853dfa9c4fcabb4f934e3dbd3d959d16..547b6393ba9279d234555a4b102553a0fe597a20 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9211f97a63497b7b519779d05167ed167dfa5482..58d251b90864f95007b68425c15e8331b56057ae 100644 (file)
@@ -21,6 +21,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c27147e3435c52f933badef78b6892d08f2ce436..f74a4c6b29472a599c56effe2835062d2297ecb4 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c3b5627702f53c9f3905b069c176d283c75fdfd3..f91534cfdd60820395738a0cc5bd022760dec1b1 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e08f2839619939e36f97efe60ba48a4ef6ab99b8..8d342138551d57bf7c73ccfb828c31c319975901 100644 (file)
@@ -35,6 +35,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 605a37858452415b6a9737e8cc59484b9156800c..9871c8edf446771b1b270a6be081f83d7fc2726d 100644 (file)
@@ -34,6 +34,8 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index af8b8ffd7d347acf9b1cd4b9a4b384e5c442f219..0bf4aad1029c5c346f9b12fcd4383fd9fd958c92 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 3e63933ea273eebd3a2fe44caec5d13726349d65..5507dbe3c13351461524b91d59977d20f269bb43 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 01b5205df41ae8cc109d1e5286dc4064b6d114b0..cdf81957a84cd381db14469ec492f460e771e610 100644 (file)
@@ -24,6 +24,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 504b2d9afcb6b16c8ec7941f3f6780f7ca0c728a..4c82d6689988619be8c5c782db7ac0ec1b6cda94 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_MISC_INIT_R=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 82e624410363cfd6c38574859f5d0b0fcd304e90..9039ccc8f25aa172cdc257f1b56d2d290a0d1b33 100644 (file)
@@ -38,6 +38,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index ad05bc49a3ed015adc93ce38a878f7576ea86452..478d3df1b80b7627fa3e8ee4b63718b31ee97b36 100644 (file)
@@ -37,6 +37,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 18fd5c36e2652abacd5f12157a6831c15bbc1eb5..de783a8d3da730c33a2ca4287927ae4bae536eda 100644 (file)
@@ -36,6 +36,8 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c19c66fa6842cdae4c04fc61d54357c93287793e..4fd9ff8f3a76bd667f140638925323ab4282da75 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1028AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_MALLOC_F_LEN=0x6000
@@ -19,6 +20,9 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256 video=1920x1080-32@60 cma=256M"
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -79,4 +83,3 @@ CONFIG_WDT_SP805=y
 CONFIG_RSA=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 82b08a58ecd044d1dfd38bf96a5e6618d421f17e..fc6344cd7cebb233ca7d25dcaa1502dbe8f9f18e 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1028AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_MALLOC_F_LEN=0x6000
@@ -20,6 +21,9 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256 video=1920x1080-32@60 cma=256M"
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -84,4 +88,3 @@ CONFIG_WDT=y
 CONFIG_WDT_SP805=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 417f29217a02bd966fb9db0b2dda2394064b165d..e0348279d9f9981bc1412c312805a6b5f9a8e51c 100644 (file)
@@ -3,8 +3,8 @@ CONFIG_TARGET_LS1028AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_MALLOC_F_LEN=0x6000
 CONFIG_ENV_SIZE=0x2000
-CONFIG_ENV_SECT_SIZE=0x40000
 CONFIG_ENV_OFFSET=0x500000
+CONFIG_ENV_SECT_SIZE=0x40000
 CONFIG_DM_GPIO=y
 CONFIG_FSPI_AHB_EN_4BYTE=y
 CONFIG_NR_DRAM_BANKS=2
@@ -15,12 +15,15 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_SYS_EXTRA_OPTIONS="LPUART"
 CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256 video=1920x1080-32@60 cma=256M"
-CONFIG_SYS_EXTRA_OPTIONS="LPUART"
 CONFIG_MISC_INIT_R=y
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
index 947c4b46132dc46a1e225c477d111ba490d1f178..96f190d85953049f6a43018090ade9315b9824dc 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1028ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_MALLOC_F_LEN=0x6000
@@ -18,6 +19,9 @@ CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256 video=1920x1080-32@60 cma=256M"
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -76,4 +80,3 @@ CONFIG_WDT_SP805=y
 CONFIG_RSA=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index ad6de6ca0116800088d9500bcf1f6bcd8ed67466..1f05ae57cc120c11721628d2ddd592418f13b3f6 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1028ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_MALLOC_F_LEN=0x6000
@@ -19,6 +20,9 @@ CONFIG_BOOTDELAY=10
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256 video=1920x1080-32@60 cma=256M"
 CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -85,4 +89,3 @@ CONFIG_WDT=y
 CONFIG_WDT_SP805=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index cd01a8dc3744e74a2a9bd047dc11f7718a82e2fc..da56fce6938e14222569f7864b79b4281ecb5e1f 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 1976e27d7fb4d09ff7fa4b21efc48138bfa8feb6..9d450b3d639091de7866c370fbae134bff16ddf7 100644 (file)
@@ -21,6 +21,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 1a1643eded31e34f2c2d1996455fae682c768b66..a08ec2a7e451b462e9546db6bf29b76dcb59e17b 100644 (file)
@@ -36,6 +36,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index bd05cab3abc1b2a8b68e2f6bd543641386425e59..fe025facdd81a2131ae6638b5b747405f9596147 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 50af1a79ef5721fd3218d40618210eed7c32c31d..9ea003e735e3911d3e05dba79249e2b6a99210cc 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e5a91a3ab203931ea0da1ad038b6c9bb91c71f48..862458c7c7749bd219c2a5e71d79c1d1ece90c82 100644 (file)
@@ -36,6 +36,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 42d0642ff726482a2260cbc09dda5fc77a36b0be..c5887cce4478188175606a6967da188fc733b804 100644 (file)
@@ -35,6 +35,8 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9dccd1131d0fb42316556eb23f81e6cf103fe5f0..f10d4d9425ac029375d770807442ed30897fb39d 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 2be983f10fd355ab2d588129327f307a3ede9b21..4fcdca83e7de83a4577f13a011713f670b1f9545 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index d3521c37b5bfd086770fbb638b9404ff13bdfb03..caa4221875a51dee4dc26b96bcde6bb3f2935e9d 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index cf92386dc27f48124de2c4f39a5892f346fedc90..838d97cde49f2b06f2dfaee90b1dc81d0129e8bd 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index a75a523f54f3bbd0258a541db0635918bc1e01a5..d89b7791b2732afdc4c4fb9babed7970bd14566c 100644 (file)
@@ -21,6 +21,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 8f92af55b25a7a36ca7bb807959e54219987da52..4aebca710889775e554dd0e310145efb99116648 100644 (file)
@@ -29,6 +29,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 239483f3142c6b114a121eea2643ff6fe38f0127..b98101d0b53ab9c0366bdac4699951a99cf40909 100644 (file)
@@ -21,6 +21,8 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c5ef64a70a34a6ac1dbaf874165b7127a3b28fd2..a68c43566db43992018ce553ad28ad4d8bd1d4a4 100644 (file)
@@ -37,6 +37,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index a4d714f801bfe4c30cc90727704ad95125232d9b..616e420e0d1552ffaf232e450173de04a5f3d4e6 100644 (file)
@@ -36,6 +36,8 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index ece7c19ce09ef583393d05cc994e7b34534c45bc..03cd17feb6d794579956ed60fe782bc1b4d09314 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index f1693e1f4cbd4da423da9d489f71f17078f41e2f..d50a8ebd7f858c3b010489537432c0d418ed91b5 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_CMD_IMLS=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 69e3a8fbbfc5f7b3584e49b3f3b0a5a39a4eb42d..61e05ceda67d6e08b39e7b6796a5a28e2586cd93 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088AQDS=y
 CONFIG_SYS_TEXT_BASE=0x30100000
 CONFIG_ENV_SIZE=0x20000
@@ -18,6 +19,8 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -64,4 +67,3 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
-CONFIG_GIC_V3_ITS=y
index 3a363790d9b0c424d86748c898219cc1055380b3..e51fdcab203b9744a1f62ec6216a13df799dfdb9 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088AQDS=y
 CONFIG_SYS_TEXT_BASE=0x20100000
 CONFIG_ENV_SIZE=0x2000
@@ -20,6 +21,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -66,4 +69,3 @@ CONFIG_USB_GADGET=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 117fdd8588e3fdd074a55e8e6eee57a3fcf551b3..f7d0c15707d5c7aea008ef4def6845ab2ff80f45 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088AQDS=y
 CONFIG_SYS_TEXT_BASE=0x20100000
 CONFIG_ENV_SIZE=0x2000
@@ -21,6 +22,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -67,4 +70,3 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_GADGET=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index eedee1e88f8a5f24d6cb10a6fc8863abc6f5c048..57e706a4c486224532c734b8268c81a057779399 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088AQDS=y
 CONFIG_SYS_TEXT_BASE=0x80400000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
@@ -29,6 +30,8 @@ CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -72,4 +75,3 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
-CONFIG_GIC_V3_ITS=y
index 621c411aca6e02a2c1443ba8a61ae73129b14f32..4ff7173369b2305ff4e533b0bb02f7c75b9227db 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088AQDS=y
 CONFIG_SYS_TEXT_BASE=0x80400000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
@@ -31,6 +32,8 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -76,4 +79,3 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_GADGET=y
-CONFIG_GIC_V3_ITS=y
index 2bb84e158cdb417b80ffca6158bcf4571c515586..e66a61c08960bd63395d0df0c2b2831330128237 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS1088AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
@@ -24,6 +25,8 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -84,4 +87,3 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_GADGET=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 806d7705dea9f184a26e076d007bb7a827cdf3e1..f00307f964e6a7f8ffe9c2a66b162cae734b31cd 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_MISC_INIT_R=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9b66fd910179aef57f63371da188557c101d1181..0572c9c241d94281a86da16afc20f6344266c419 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_MISC_INIT_R=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 4a15f82e9e528cf4c7509f9546914bdbedb5d9f7..3e00a25857d7bca0bfddb1f68ebe3f46ab93daac 100644 (file)
@@ -34,6 +34,8 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 1ab1fa3a2f61f31920ed1e094906c70cc78b0a2c..b6e21b27563d4ca1a3c58d1c230dbf5d1cf6cf23 100644 (file)
@@ -33,6 +33,8 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 4ad9a66333ae0077486813c48a5a522068770cef..dba45267349b90ba655c9bc3f1418e01311de2ee 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_MISC_INIT_R=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 7690292db4de00c58b462cb843f143af1ec321f2..1c36801e6548ec848e8cc0353c92c534d8adfc11 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_MISC_INIT_R=y
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fffffff
 CONFIG_CMD_DM=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 4c85b1148f3b7524d8a98e415a85cd41788c435d..efbd5f75bd8f81cef1e947fb9a77246ab9e9e02c 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080AQDS=y
 CONFIG_SYS_TEXT_BASE=0x30100000
 CONFIG_ENV_SIZE=0x2000
@@ -66,4 +67,3 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 0f8e22b304f67085343c4eb2917b24fd7a4d75d7..ad53671e6c542c2909a2c4ef13d4ffe5db5314a0 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080AQDS=y
 CONFIG_SYS_TEXT_BASE=0x30100000
 CONFIG_ENV_SIZE=0x2000
@@ -67,4 +68,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 044177088c90a6496b3e7946a1bcf7a8d675dece..590ca280000433ec0efd55c5687557593ff08dd1 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080AQDS=y
 CONFIG_SYS_TEXT_BASE=0x80400000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
@@ -74,4 +75,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index c159c153da62a4e9e2b2fcf43abc9a451f8059d1..b8fbb43eb3b0ac5d8fee39c0e98c19df791e6c12 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080AQDS=y
 CONFIG_SYS_TEXT_BASE=0x20100000
 CONFIG_ENV_SIZE=0x2000
@@ -66,4 +67,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index ac0b635191c70cd3a2726af3f4884872c3c2d2ea..d493febf4b9eac512699d0320f191e32bcc33374 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080AQDS=y
 CONFIG_SYS_TEXT_BASE=0x80400000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
@@ -73,4 +74,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 94087cee01a4fa942244c28ec68b6e2babb55f7a..21739f0f9ecaf78dcf34d8fe3e8b1d0afd10f69a 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080ARDB=y
 CONFIG_SYS_TEXT_BASE=0x30100000
 CONFIG_ENV_SIZE=0x2000
@@ -64,4 +65,3 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index e9dfc3603eadad48f39e289fb50ff33d1928ea70..dc4564b318e6d1777ffdee88635340a3d24c388b 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080ARDB=y
 CONFIG_SYS_TEXT_BASE=0x30100000
 CONFIG_ENV_SIZE=0x2000
@@ -65,4 +66,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index d1086f976c6edecdbd0332fbca35a8dd7c62578b..a3fa5c6bbf274a456820b0ea7eef4a2000851cf9 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080ARDB=y
 CONFIG_SYS_TEXT_BASE=0x80400000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
@@ -70,4 +71,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 032cb406338393e269087855b4fe57632a97171e..9d08eb7af77b2cc895ebe8e3c57d9df01b8dbad3 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2081ARDB=y
 CONFIG_SYS_TEXT_BASE=0x20100000
 CONFIG_ENV_SIZE=0x2000
@@ -62,4 +63,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 81bc489d19a339777df90a1bacb17e2373e4ab39..7c7bb345e17d22aa558ddf5b9dab5aba26047ba9 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
@@ -78,4 +79,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 2d71baeced7d686d8bcab77c5263e4ecf166693d..be073b6724ea875ba4442c3675048cbacad8d62b 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080ARDB=y
 CONFIG_SYS_TEXT_BASE=0x20100000
 CONFIG_ENV_SIZE=0x2000
@@ -63,4 +64,3 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 85b8dac99244ea6fbdca2fc99cd9be783943b958..d312cc96289ba8e05af75995ab9f79b56e793408 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080ARDB=y
 CONFIG_SYS_TEXT_BASE=0x20100000
 CONFIG_ENV_SIZE=0x2000
@@ -67,4 +68,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 39a69734feaee7e475d00cd4f1979f8d2aa7a042..a244af17bc1a6bcdaf1aa3aa8d7c8a523af91eab 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
@@ -80,4 +81,3 @@ CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_RSA_SOFTWARE_EXP=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 34b94394c7cc8d30d52956a2a6f9eedffd9480e4..2a82fda0bfac2cd1d51432681be5e21453fd7d62 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_GIC_V3_ITS=y
 CONFIG_TARGET_LS2080ARDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
@@ -85,4 +86,3 @@ CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
-CONFIG_GIC_V3_ITS=y
index 894ddc6c79a4ddecf0d7b97e1c344fabec6365c8..191288f836057cf9f67209d5e9f01821372d7340 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xa0000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
index c77b1c07c8c2bad04d2f62cee819a2f7ff81dde0..9bd90ddc3d706905f76d9e298a833483448d5a6a 100644 (file)
@@ -29,6 +29,8 @@ CONFIG_SYS_PROMPT="jr2 # "
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fc00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_SPI=y
index b42b704e9124e6cfa14a63a377a6247ea5a5ba5f..a57d033d30a9c3578ef0a408c7435850c57d18b2 100644 (file)
@@ -31,6 +31,8 @@ CONFIG_SYS_PROMPT="luton # "
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x87c00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_SPI=y
index ecab4d0afdbbbf8d9f6512dfdde078cd1c60021e..32f4148e755f184e0e0320e147ae9aab6e03176b 100644 (file)
@@ -28,6 +28,8 @@ CONFIG_SYS_PROMPT="ocelot # "
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fc00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MTD=y
index ee12e7cd18306b695f9fb9843af3315c190661cf..e35219e3ce485ca668b4168f0c57ddba2c3f3a3e 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_SYS_PROMPT="serval # "
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x87c00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_SPI=y
index 5caef62a6827e1579ce99cd0ab51db082f6abadd..669d9f6c23ff31a21f20f48e1c84059c9f1ec846 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_SYS_PROMPT="servalt # "
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x9fc00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_SPI=y
index 07ddade76a4a3ca501dd52bc4a4cae4f81d8f3bb..6b9fbd7e22194afde2433797ec677be1faa3a130 100644 (file)
@@ -7,13 +7,13 @@ CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x100000
 CONFIG_TARGET_MT7623=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_BOOTDELAY=3
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 CONFIG_DEFAULT_FDT_FILE="mt7623n-bananapi-bpi-r2"
 # CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
 CONFIG_CMD_BOOTMENU=y
 # CONFIG_CMD_ELF is not set
@@ -21,13 +21,9 @@ CONFIG_CMD_BOOTMENU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_PART=y
 CONFIG_CMD_READ=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NFS is not set
-CONFIG_CMD_PING=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
 CONFIG_DEFAULT_DEVICE_TREE="mt7623n-bananapi-bpi-r2"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
@@ -56,4 +52,3 @@ CONFIG_TIMER=y
 CONFIG_MTK_TIMER=y
 CONFIG_WDT_MTK=y
 CONFIG_LZMA=y
-# CONFIG_EFI_LOADER is not set
index 5063049fdc3aa13ba47a533a807944ac406fd154..8b5e0ff9b13475ce1f5215f7981da2da29ff4fb5 100644 (file)
@@ -31,6 +31,8 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_ENV_EXISTS is not set
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x20000000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_CACHE=y
index 510b8d721ae6893e34ae62c12d4352ee65830527..ea338c1b53aab932ef5c4af3fd1da22348775eab 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_BOUNCE_BUFFER=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 064684a68bd1ac7a6108c7eeb9f87417c114f541..48cace51011c71f43cc1c6eb92ab80cd2ec968b5 100644 (file)
@@ -14,6 +14,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index ae06ad4535c5f139d94c4a529824a72b718d60fa..a32b19851dd3d738d60826113bc895c45600a1c4 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 6498f024b8c55fd6c597b491507a2284f3086eb9..94b36d2615778262ef10c4a0cb2aa27aeed72da7 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index ce87cc1b269f34893cebba32dc49026d5612ba1e..9bb11f580ef74aaa89569d6c4959ee2492d26322 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 357932ae62dbefc0274adc5293d0366ee2b5af69..344e03a8de898cf02605aaa1f25c8ddb8a96abba 100644 (file)
@@ -13,6 +13,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index a5451fc941837918c9b91aa4f6f8607d6368aa54..2811d868aca8d967362f8c9139eb1424315f4f4c 100644 (file)
@@ -14,6 +14,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index ae81e10b3b6de62a635103c8287851c39f69ab5e..37b518a763bb1a408b46ebe3be37011af3f638df 100644 (file)
@@ -13,6 +13,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index e948091a920155b66ac624f62408b21dfd5562cf..df87e2d1710399e19d57f68bab247dd19677585e 100644 (file)
@@ -24,6 +24,8 @@ CONFIG_BOUNCE_BUFFER=y
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xa0000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 23a1c458378042acac30164592261f6f970d6d8d..3a07b704b5b8573ee65351750b4e8109a221e66a 100644 (file)
@@ -24,6 +24,8 @@ CONFIG_BOUNCE_BUFFER=y
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xa0000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 62d37b3369650ebb07db191e74fe0e61d87c0f2f..680445bea75406b411524d885065fff2ccce5aab 100644 (file)
@@ -12,6 +12,8 @@ CONFIG_BOUNCE_BUFFER=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x60000000
+CONFIG_SYS_MEMTEST_END=0x9e000000
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 8d24fe7ac12bf8b8fd1e941e87c2fbaba84b3757..b70c36c7c956f9eff59d6ad3e23cf184f9dadf05 100644 (file)
@@ -10,6 +10,8 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx7ulp_evk/imximage.cfg"
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x60000000
+CONFIG_SYS_MEMTEST_END=0x9e000000
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
diff --git a/configs/nanopi-m4-2gb-rk3399_defconfig b/configs/nanopi-m4-2gb-rk3399_defconfig
new file mode 100644 (file)
index 0000000..4e559ed
--- /dev/null
@@ -0,0 +1,61 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ROCKCHIP_RK3399=y
+CONFIG_TARGET_EVB_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-nanopi-m4-2gb.dtb"
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+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-nanopi-m4-2gb"
+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_SYS_RELOC_GD_ENV_ADDR=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_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_KEYBOARD=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_DM_VIDEO=y
+CONFIG_DISPLAY=y
+CONFIG_VIDEO_ROCKCHIP=y
+CONFIG_DISPLAY_ROCKCHIP_HDMI=y
+CONFIG_SPL_TINY_MEMSET=y
+CONFIG_ERRNO_STR=y
index 57d7ca9d174f07b975bc4cb546dd177e6e74e8af..f6b0655f0fec03456c51f46cf8020b1eabc5abe8 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index b0f28c527e725a59f14b8728e88ef066f1924279..0de09d4a09c1b0f16d8360ea2b7fa937aab80f00 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 02632dcde656a24649663fc7a91146a6829c5f55..0757aa01c6260a11657ec550b02ec590bc08673f 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 8e041999839a4dd8b3b90c2ce68a4bd1517a1d78..d9e0760ead7254296d62d2eef8249f53edc9b963 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 592fb4a73937c76394bbd09ddb9ec4022162d060..f5396b6cb7700ab1dd6ee1fb8c55972e0557b456 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 3a4572ad080132c6d03a001d1aaea8be5995a7f4..a9aa8ad59be9ac982536f3347c2d1f4afd32c972 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10010000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 2e982e1b533adc061d9847d4e51f54d67d6fccfb..1a2183ce1957bd70d2bb42bb5b7fbbab28ced7ef 100644 (file)
@@ -39,6 +39,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_ADC=y
 CONFIG_ADC_EXYNOS=y
 CONFIG_DFU_MMC=y
+CONFIG_SET_DFU_ALT_INFO=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MTD=y
index e4392e477ed0ce32a3d91bba9f925440268fc040..345cc3b94002dd980defd2751996573efff2e3ef 100644 (file)
@@ -40,6 +40,7 @@ CONFIG_DEFAULT_DEVICE_TREE="exynos4412-odroid"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DFU_MMC=y
+CONFIG_SET_DFU_ALT_INFO=y
 CONFIG_SYS_I2C_S3C24X0=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
index 619289481362620e1b51b123fa42e4c133412d4b..4f77026212a2e355cdba00b01caf9a5a917cdcbc 100644 (file)
@@ -14,6 +14,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80010000
+CONFIG_SYS_MEMTEST_END=0x87c00000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 760f62a423904eee078ecb9191db16ae2e3e0156..15e4fbb7afbbcc0ff8bb78cb17ede65669bee8ad 100644 (file)
@@ -18,6 +18,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_USB_HOST_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index bb09a9a5a2f8aa2cbbf0c331085dc78ba8b99645..b2ed1879314b8b672dd023bb3af58853df6223cf 100644 (file)
@@ -13,6 +13,8 @@ CONFIG_SYS_PROMPT="dask # "
 CONFIG_LOOPW=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x88000000
+CONFIG_SYS_MEMTEST_END=0x88080000
 CONFIG_CMD_CLK=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index bb0281395e39f7887a624d621fad63c1763f4386..66fad2a82352c59fbacd9ac5bbfb35ecffb2e727 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_CMD_BOOTMENU=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index ffa5cc8d07ddf8379de150797a83b3ae66df7fb6..a33555e04a23764c52414fd84c16efb43fbab93e 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_CMD_BOOTMENU=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 24948ddd55e249fb31b75359f52c7bc6dcb2feb0..8113bd0074e41ce89eadf578199adeca7762a6dd 100644 (file)
@@ -28,6 +28,8 @@ CONFIG_CMD_BOOTMENU=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 2836edc64b079b4e0db9ac488adc32744bf31785..ea9caa75cf79ab7a661b639f92c460bfe922b8f8 100644 (file)
@@ -27,6 +27,8 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xa0000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 5eb6fe2ec5978160a3234bfc86d3f0064cb9e25c..046acfc4557067dc23f8754172107adbde712dc5 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_CMD_BOOTMENU=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
diff --git a/configs/roc-cc-rk3328_defconfig b/configs/roc-cc-rk3328_defconfig
new file mode 100644 (file)
index 0000000..933a1c6
--- /dev/null
@@ -0,0 +1,102 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ROCKCHIP_RK3328=y
+CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_TPL_LIBCOMMON_SUPPORT=y
+CONFIG_TPL_LIBGENERIC_SUPPORT=y
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+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="roc-rk3328-cc"
+CONFIG_DEBUG_UART=y
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x800
+# CONFIG_ANDROID_BOOT_IMAGE is not set
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-roc-cc.dtb"
+CONFIG_MISC_INIT_R=y
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_TPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_POWER_SUPPORT=y
+CONFIG_SPL_ATF=y
+CONFIG_SPL_ATF_NO_PLATFORM_PARAM=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_TPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="rk3328-roc-cc"
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_TPL_OF_PLATDATA=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_TPL_DM=y
+CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
+CONFIG_TPL_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_SPL_SYSCON=y
+CONFIG_TPL_SYSCON=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_FASTBOOT_BUF_ADDR=0x800800
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_SF_DEFAULT_SPEED=20000000
+CONFIG_PHY_REALTEK=y
+CONFIG_DM_ETH=y
+CONFIG_PHY_GIGE=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_GMAC_ROCKCHIP=y
+CONFIG_PINCTRL=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_SPL_DM_REGULATOR=y
+CONFIG_REGULATOR_PWM=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_SPL_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_RAM=y
+CONFIG_SPL_RAM=y
+CONFIG_TPL_RAM=y
+CONFIG_DM_RESET=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYSRESET=y
+# CONFIG_TPL_SYSRESET is not set
+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_OHCI_HCD=y
+CONFIG_USB_OHCI_GENERIC=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_DWC3=y
+# CONFIG_USB_DWC3_GADGET is not set
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_SPL_TINY_MEMSET=y
+CONFIG_TPL_TINY_MEMSET=y
+CONFIG_ERRNO_STR=y
+CONFIG_SMBIOS_MANUFACTURER="firefly"
diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig
new file mode 100644 (file)
index 0000000..1879944
--- /dev/null
@@ -0,0 +1,65 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ROCKCHIP_RK3399=y
+CONFIG_TARGET_ROC_PC_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-roc-pc-mezzanine.dtb"
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
+CONFIG_TPL=y
+CONFIG_TPL_GPIO_SUPPORT=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-roc-pc-mezzanine"
+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_SYS_RELOC_GD_ENV_ADDR=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_SPI_FLASH_WINBOND=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_ROCKCHIP_SPI=y
+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_KEYBOARD=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_DM_VIDEO=y
+CONFIG_DISPLAY=y
+CONFIG_VIDEO_ROCKCHIP=y
+CONFIG_DISPLAY_ROCKCHIP_HDMI=y
+CONFIG_SPL_TINY_MEMSET=y
+CONFIG_ERRNO_STR=y
index 826c7a691742c564fc0d3487651467492b6b876f..7d096d38c6d0c8f4f77cafde330f347f1ce63d07 100644 (file)
@@ -60,7 +60,6 @@ CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_GMAC_ROCKCHIP=y
-CONFIG_PHY=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_DM_PMIC=y
index 1fb25ee2ba1fd3228925606193f47e958cefc5f5..99720a9193a986ac8e7e31af08b78c24f11b52e8 100644 (file)
@@ -11,6 +11,8 @@ CONFIG_BOOTARGS="console=ttyLF0 root=/dev/ram rw"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0xc0000000
+CONFIG_SYS_MEMTEST_END=0xc7c00000
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
index d69b185aa8bed0aa25c539142a2f4cfa1ec1668e..c1237ea296467efa44c6b3dd91f05798356f410e 100644 (file)
@@ -35,6 +35,8 @@ CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MX_CYCLIC=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00100000
+CONFIG_SYS_MEMTEST_END=0x00101000
 CONFIG_CMD_DEMO=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 781238763a5f18f7dab135af3196ff843b8b4cf4..9445d781182d51accc39fb70bd232477fce9da23 100644 (file)
@@ -39,6 +39,8 @@ CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MX_CYCLIC=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00100000
+CONFIG_SYS_MEMTEST_END=0x00101000
 CONFIG_CMD_BIND=y
 CONFIG_CMD_DEMO=y
 CONFIG_CMD_GPIO=y
index 00d9359f197cfe02ac47e2abc6ec6e03253e4aab..a4a7ae83795a8fe4d035d9f097e24b5489518346 100644 (file)
@@ -29,6 +29,8 @@ CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MX_CYCLIC=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00100000
+CONFIG_SYS_MEMTEST_END=0x00101000
 CONFIG_CMD_DEMO=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index 18c6a4760295ec672768609b8507886c51a151b9..945fe54d20db32cf667512ae2ba61edc4394ae48 100644 (file)
@@ -39,6 +39,8 @@ CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MX_CYCLIC=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00100000
+CONFIG_SYS_MEMTEST_END=0x00101000
 CONFIG_CMD_DEMO=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
index b207592ee8e06b3c993a0b4fda00885dc7c06b7d..188b0eec65ab7d278ce44cf242d51da6cfec6721 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 # CONFIG_SPL_FRAMEWORK is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x40000000
+CONFIG_SYS_MEMTEST_END=0x40400000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
index 4bca53aebbaae1def161e979f5fcb6c5798cff60..35316d7c252fff8ebb78efce82a013f5187de516 100644 (file)
@@ -17,6 +17,8 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="SOCFPGA_AGILEX # "
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x3fe00000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 099ed7e9cb2b5f33e0f127c2165809257ac15a95..c95a7fc5e0737dd802e6adc0661293deaeba21e1 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_GREPENV=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x40000000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 155de1a6439a8f42b29bab62f8498d0bcbc7456f..21014f9f8cdeedf9aace625e983be6828aa6bbd2 100644 (file)
@@ -16,6 +16,8 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="SOCFPGA_STRATIX10 # "
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x3fe00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 03e37afb5c283b5df58548cc754413f90a400ec1..08469d68b6248c18ca1dc83453aa2dd2d3ee3e68 100644 (file)
@@ -13,6 +13,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x88000000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
index 100f174a579ec2b8c900e3b27353860c76f3919a..c9289934ac57613d914633cda5b3619f8b490e28 100644 (file)
@@ -26,6 +26,8 @@ CONFIG_SYS_PROMPT="STM32MP> "
 # CONFIG_CMD_IMPORTENV is not set
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0xc0000000
+CONFIG_SYS_MEMTEST_END=0xc4000000
 CONFIG_CMD_ADC=y
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
@@ -68,6 +70,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_MTD=y
 CONFIG_DFU_VIRT=y
+CONFIG_SET_DFU_ALT_INFO=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
 CONFIG_FASTBOOT_BUF_SIZE=0x02000000
@@ -87,6 +90,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_STM32_SDMMC2=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
+CONFIG_SYS_MTDPARTS_RUNTIME=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_MTD_SPI_NAND=y
index 5f3813e515cc9c86dfea38ce6111cea57ca29547..c2f3a5ebc15a793bde0160bc6f97b905f83b71a8 100644 (file)
@@ -24,6 +24,8 @@ CONFIG_SYS_PROMPT="STM32MP> "
 CONFIG_CMD_EEPROM=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0xc0000000
+CONFIG_SYS_MEMTEST_END=0xc4000000
 CONFIG_CMD_ADC=y
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
@@ -67,6 +69,7 @@ CONFIG_SPL_BLOCK_CACHE=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_VIRT=y
+CONFIG_SET_DFU_ALT_INFO=y
 CONFIG_DM_HWSPINLOCK=y
 CONFIG_HWSPINLOCK_STM32=y
 CONFIG_DM_I2C=y
@@ -80,6 +83,7 @@ CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_STM32_SDMMC2=y
 CONFIG_MTD=y
+CONFIG_SYS_MTDPARTS_RUNTIME=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
index 596fe190af2d7da875e90367571e6aeda34b89bd..443e2c40b78f6dd4a24097600931f99996e33f47 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_SYS_PROMPT="STM32MP> "
 # CONFIG_CMD_IMPORTENV is not set
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0xc0000000
+CONFIG_SYS_MEMTEST_END=0xc4000000
 CONFIG_CMD_ADC=y
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
@@ -59,6 +61,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_MTD=y
 CONFIG_DFU_VIRT=y
+CONFIG_SET_DFU_ALT_INFO=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
 CONFIG_FASTBOOT_BUF_SIZE=0x02000000
@@ -78,6 +81,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_STM32_SDMMC2=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
+CONFIG_SYS_MTDPARTS_RUNTIME=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_MTD_SPI_NAND=y
index f9df13a6c3b635b6e67c633a135689837095d253..33f6926fa9e43e1710b10a6f83575738ffd85b82 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_SYS_PROMPT="STM32MP> "
 # CONFIG_CMD_IMPORTENV is not set
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0xc0000000
+CONFIG_SYS_MEMTEST_END=0xc4000000
 CONFIG_CMD_ADC=y
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
@@ -55,6 +57,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_MTD=y
 CONFIG_DFU_VIRT=y
+CONFIG_SET_DFU_ALT_INFO=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
 CONFIG_FASTBOOT_BUF_SIZE=0x02000000
@@ -74,6 +77,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_STM32_SDMMC2=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
+CONFIG_SYS_MTDPARTS_RUNTIME=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_MTD_SPI_NAND=y
index 0790c76a701ef500abfb9d4fa97aaa7e6872c5f2..599438232deea507423b6817f049ba4589d6411a 100644 (file)
@@ -109,6 +109,8 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00001000
+CONFIG_SYS_MEMTEST_END=0x07f00000
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index f203f404645ba0a73ff96d5bea8ddd8bd27a0c91..bf52ae701b6e2e4c19135d99c71941dd504a1466 100644 (file)
@@ -109,6 +109,8 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00001000
+CONFIG_SYS_MEMTEST_END=0x07f00000
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c2875c51a7ae44ae5bb1423632d5387a5e7dbbe0..d34ca9edd2bf259aec4a94b1d23291b07f4faada 100644 (file)
@@ -109,6 +109,8 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00001000
+CONFIG_SYS_MEMTEST_END=0x07f00000
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 7647fd800b1ef1d125602db31a3d9916969799ba..01cdf0c43fd1e6bc520e6b4db4e1b7bc112aacac 100644 (file)
@@ -109,6 +109,8 @@ CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00001000
+CONFIG_SYS_MEMTEST_END=0x07f00000
 CONFIG_CMD_FPGAD=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 0b52b0073327bdac5b527b39352afbb62d37054f..54f1cd2bfdc656c21867da075f268c6c287b9b6e 100644 (file)
@@ -18,6 +18,8 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Hit SPACE in %d seconds to stop autoboot.\n"
 CONFIG_AUTOBOOT_STOP_STR=" "
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x00100000
 CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_PING=y
index f4fdd38c3f54569cfda7d32520efd8f3fd10c1ac..2ff0e160f7379004b6e6617ef6c92fd60001fd19 100644 (file)
@@ -24,6 +24,8 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_BOOTM_VXWORKS is not set
 # CONFIG_CMD_FDT is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x2f400000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 5c244b499912845570978a590938da73254f24e5..f50d12d154e2c561779e827e04e489f6c7ca877d 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_PROMPT="zynq-uboot> "
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x18000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 068b5bcdc14643640122ac6ca6f7d2019eeedc08..d2fe64ed9ee4c02eba23f5615138efcf003d71f2 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_PROMPT="zynq-uboot> "
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x18000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 86980774e5fea1f2847266fdbe3ff3265301f255..9afd7f6bcada0b897440184a7d62c85330f5c48a 100644 (file)
@@ -23,6 +23,8 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_PROMPT="zynq-uboot> "
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x18000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 6d59ba4e66920e334da3ffca3e3e28c10a18ca9c..f9d37b1365f0566816f2c3b6b8f94d868972b8d4 100644 (file)
@@ -14,6 +14,8 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_ELF is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80100000
+CONFIG_SYS_MEMTEST_END=0x83f00000
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
index 07d8612740932fb491a5e8edc985e642bd60c615..fff98733bffe04be96128f26d3a2c14585bb248e 100644 (file)
@@ -33,6 +33,8 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00800000
+CONFIG_SYS_MEMTEST_END=0x00ffffff
 CONFIG_CMD_SHA1SUM=y
 CONFIG_CMD_LZMADEC=y
 CONFIG_CMD_GPIO=y
index da14fb02873c963f2642340f82313ec6a564a2f3..0564bdcce1182be947aa4cc10db9e6ba92472831 100644 (file)
@@ -9,6 +9,8 @@ CONFIG_NR_DRAM_BANKS=1
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x70000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c852ad26237c629e98c9b13582e618b304806337..c68b299a959081ae36f2666a9052892654297ba9 100644 (file)
@@ -44,6 +44,8 @@ CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_IMPORTENV is not set
 # CONFIG_CMD_CRC32 is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x40000000
+CONFIG_SYS_MEMTEST_END=0x80000000
 CONFIG_CMD_CLK=y
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
index 8628d05e68bf75404acd07af65c1dc08e9f4d93d..49acb343106a0b99cd7e4b83511d2f78e1d058f3 100644 (file)
@@ -18,8 +18,11 @@ CONFIG_SYS_PROMPT="VExpress64# "
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xff000000
 CONFIG_CMD_ARMFLASH=y
 # CONFIG_CMD_LOADS is not set
+CONFIG_CMD_USB=y
 # CONFIG_CMD_ITEST is not set
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NFS is not set
@@ -28,9 +31,9 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
+CONFIG_OF_BOARD=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xBFC0000
-CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
@@ -41,5 +44,7 @@ CONFIG_SYS_FLASH_CFI=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x018000000
 CONFIG_SMC911X_32_BIT=y
-CONFIG_DM_SERIAL=y
-CONFIG_OF_LIBFDT=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_GENERIC=y
index c9093260f3dba26a689fd5c80a7516e7cc727f2c..f0ac2f9da34c8b6d9536fae47903c852f73d51c6 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_CMD_ABOOTIMG=y
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_EDITENV is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xff000000
 CONFIG_CMD_ARMFLASH=y
 # CONFIG_CMD_LOADS is not set
 # CONFIG_CMD_ITEST is not set
index 84828c91f02bc325c471b0b3e41d58d82c8b8ed6..2849ddd9a8eef6b8778e77bcd5c5c0f63eb5bf66 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_AUTO_COMPLETE is not set
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80010000
+CONFIG_SYS_MEMTEST_END=0x87c00000
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index 27fb40e2972df340d91fbab04f62d86ac89cc96f..9bf8ea2091f822915825c115b67cc7ae8ca275dd 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_AUTO_COMPLETE is not set
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80010000
+CONFIG_SYS_MEMTEST_END=0x87c00000
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
index e731d6ff58ddfdb3aafef961012c019b0352fb82..38aeab69f891a40312ca39de38438f8b685351cd 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_BOUNCE_BUFFER=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xa0000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index a5fb48ff1fbc0da3626c414408017a9002440a29..70fa486e9ea54c1adb89fae11b4a8e6cc60b93ef 100644 (file)
@@ -21,6 +21,8 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_XIMG is not set
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0xa0000000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
index fbb039dec9da741f5766d1abd93c69b62037e64a..d2de463aaa14db51e7167270cb812d4d6b4959e0 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x20000000
+CONFIG_SYS_MEMTEST_END=0x23e00000
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 25a6edd1d8787b1278270f43c6dd59a058076ab0..86a8549406bf2166f401d7f759b4324d57586cb4 100644 (file)
@@ -20,6 +20,8 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x21000000
+CONFIG_SYS_MEMTEST_END=0x22000000
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_LOADS is not set
 CONFIG_CMD_NAND=y
index 0743592285f1ea9831bc4e3cc3c6f981c4781af6..a3b71ccc3e1b8387a34ca122761cb518a1119651 100644 (file)
@@ -38,6 +38,8 @@ CONFIG_SYS_PROMPT="Versal> "
 # CONFIG_CMD_CRC32 is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x00001000
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
 # CONFIG_CMD_ECHO is not set
index e8c349261207b802f21b7edd640ba7a298974f55..b629f8ba698c4e19d26ec16803128200ca9e06b3 100644 (file)
@@ -15,6 +15,8 @@ CONFIG_SYS_PROMPT="Versal> "
 CONFIG_CMD_BOOTMENU=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x00001000
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_DM=y
index 7441e10d325a7f931ebf6ac0db0d3e4126979176..375d54cbad6375fd573720584e3b7d2f61a045f6 100644 (file)
@@ -24,6 +24,8 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_CMD_IMLS=y
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x00001000
 CONFIG_CMD_DFU=y
 CONFIG_CMD_FPGA_LOADBP=y
 CONFIG_CMD_FPGA_LOADFS=y
index 2d9a3b3a5f3a25cff136aa80f7511d3a77514fbd..c28efa3582a777fb163b1aa81402da15655aeb5f 100644 (file)
@@ -33,6 +33,8 @@ CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_CRC32 is not set
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x00001000
 # CONFIG_CMD_DM is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
index 73e8d84b88864baff81c16c8b16e037ef9b1f5fe..57be5a49f65e23ca453f42baa811f3fbcfd509a0 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_CMD_BOOTMENU=y
 CONFIG_CMD_THOR_DOWNLOAD=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x00000000
+CONFIG_SYS_MEMTEST_END=0x00001000
 CONFIG_CMD_BIND=y
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
index 3c18dea65b952f678ec9047d2822aa4267dd3a82..04b0a14f9da4010ff3a94f19ce6bd8ba6304134b 100644 (file)
@@ -14,6 +14,8 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
index aae7f6d29b3ff700e12b97c6cec910bbc14087d2..7cae66667699215b1b58191d807a36194f01d2f6 100644 (file)
@@ -25,6 +25,8 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x80000000
+CONFIG_SYS_MEMTEST_END=0x90000000
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
index ce40145ea4e2b1c723ae4b90c85e33eecd673a79..4c298cb4da966b8bfb0a792fe6a6470a644cc257 100644 (file)
@@ -28,6 +28,8 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10800000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index c1b7fb131c794417c5ad554b56a6ca9bd1095f09..e8f4736541ef3f89e87b2a00715ab0f806b04b43 100644 (file)
@@ -28,6 +28,8 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_MEMTEST_START=0x10000000
+CONFIG_SYS_MEMTEST_END=0x10800000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
index 9b699b9ae5d35ae3e53045e0c296c77124360cb6..70c8798ed2d07de58f09d8cfe3d681151e729d91 100644 (file)
@@ -52,10 +52,12 @@ Two RK3308 boards are supported:
    - EVB RK3308 - use evb-rk3308 configuration
    - ROC-CC-RK3308 - use roc-cc-rk3308 configuration
 
-Two RK3328 board are supported:
+Three RK3328 boards are supported:
 
    - EVB RK3328 - use evb-rk3328_defconfig
    - Pine64 Rock64 board - use rock64-rk3328_defconfig
+   - Firefly / Libre Computer Project ROC-RK3328-CC board -
+     use roc-cc-rk3328_defconfig
 
 Size RK3399 boards are supported (aarch64):
 
index fd974229eb4ca22d9cc41f798514e1ea55ec99e5..9c44c025a48f3e6b968d176922beba549ffe41cc 100644 (file)
@@ -40,3 +40,13 @@ To enable video you must enable these options in coreboot:
 At present it seems that for Minnowboard Max, coreboot does not pass through
 the video information correctly (it always says the resolution is 0x0). This
 works correctly for link though.
+
+64-bit U-Boot
+-------------
+
+In addition to the 32-bit 'coreboot' build there is a 'coreboot64' build. This
+produces an image which can be booted from coreboot (32-bit). Internally it
+works by using a 32-bit SPL binary to switch to 64-bit for running U-Boot. It
+can be useful for running UEFI applications, for example.
+
+This has only been lightly tested.
diff --git a/doc/develop/crash_dumps.rst b/doc/develop/crash_dumps.rst
new file mode 100644 (file)
index 0000000..1869637
--- /dev/null
@@ -0,0 +1,122 @@
+.. SPDX-License-Identifier: GPL-2.0+
+.. Copyright (c) 2020 Heinrich Schuchardt
+
+Analyzing crash dumps
+=====================
+
+When the CPU detects an instruction that it cannot execute it raises an
+interrupt. U-Boot than writes a crash dump. This chapter describes how such
+dump can be analyzed.
+
+Creating a crash dump voluntarily
+---------------------------------
+
+For describing the analysis of a crash dump we need an example. U-Boot comes
+with a command 'exception' that comes in handy here. The command is enabled
+by::
+
+    CONFIG_CMD_EXCEPTION=y
+
+The example output below was recorded when running qemu\_arm64\_defconfig on
+QEMU::
+
+    => exception undefined
+    "Synchronous Abort" handler, esr 0x02000000
+    elr: 00000000000101fc lr : 00000000000214ec (reloc)
+    elr: 000000007ff291fc lr : 000000007ff3a4ec
+    x0 : 000000007ffbd7f8 x1 : 0000000000000000
+    x2 : 0000000000000001 x3 : 000000007eedce18
+    x4 : 000000007ff291fc x5 : 000000007eedce50
+    x6 : 0000000000000064 x7 : 000000007eedce10
+    x8 : 0000000000000000 x9 : 0000000000000004
+    x10: 6db6db6db6db6db7 x11: 000000000000000d
+    x12: 0000000000000006 x13: 000000000001869f
+    x14: 000000007edd7dc0 x15: 0000000000000002
+    x16: 000000007ff291fc x17: 0000000000000000
+    x18: 000000007eed8dc0 x19: 0000000000000000
+    x20: 000000007ffbd7f8 x21: 0000000000000000
+    x22: 000000007eedce10 x23: 0000000000000002
+    x24: 000000007ffd4c80 x25: 0000000000000000
+    x26: 0000000000000000 x27: 0000000000000000
+    x28: 000000007eedce70 x29: 000000007edd7b40
+
+    Code: b00003c0 912ad000 940029d6 17ffff52 (e7f7defb)
+    Resetting CPU ...
+
+    resetting ...
+
+The first line provides us with the type of interrupt that occurred.
+(On ARMv8 a synchronous abort is an exception where the return address stored
+in the ESR register indicates the instruction that caused the exception.)
+
+The second line provides the contents of the elr and the lr register after
+subtracting the relocation offset. - U-Boot relocates itself after being
+loaded. - The relocation offset can also be displayed using the bdinfo command.
+
+After the contents of the registers we get a line indicating the machine
+code of the instructions preceding the crash and in parentheses the instruction
+leading to the dump.
+
+Analyzing the code location
+---------------------------
+
+We can convert the instructions in the line starting with 'Code:' into mnemonics
+using the objdump command. To make things easier scripts/decodecode is
+supplied::
+
+    $echo 'Code: b00003c0 912ad000 940029d6 17ffff52 (e7f7defb)' | \
+      CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 scripts/decodecode
+    Code: b00003c0 912ad000 940029d6 17ffff52 (e7f7defb)
+    All code
+    ========
+       0:   b00003c0     adrp   x0, 0x79000
+       4:   912ad000     add    x0, x0, #0xab4
+       8:   940029d6     bl     0xa760
+       c:   17ffff52     b      0xfffffffffffffd54
+      10:*  e7f7defb     .inst  0xe7f7defb ; undefined <-- trapping instruction
+
+    Code starting with the faulting instruction
+    ===========================================
+       0:   e7f7defb     .inst  0xe7f7defb ; undefined
+
+Now lets use the locations provided by the elr and lr registers after
+subtracting the relocation offset to find out where in the code the crash
+occurred and from where it was invoked.
+
+File u-boot.map contains the memory layout of the U-Boot binary. Here we find
+these lines::
+
+   .text.do_undefined
+                  0x00000000000101fc        0xc cmd/built-in.o
+   .text.exception_complete
+                  0x0000000000010208       0x90 cmd/built-in.o
+   ...
+   .text.cmd_process
+                  0x00000000000213b8      0x164 common/built-in.o
+                  0x00000000000213b8                cmd_process
+   .text.cmd_process_error
+                  0x000000000002151c       0x40 common/built-in.o
+                  0x000000000002151c                cmd_process_error
+
+So the error occurred at the start of function do\_undefined() and this
+function was invoked from somewhere inside function cmd\_process().
+
+If we want to dive deeper, we can disassemble the U-Boot binary::
+
+    $ aarch64-linux-gnu-objdump -S -D u-boot | less
+
+    00000000000101fc <do_undefined>:
+    {
+            /*
+             * 0xe7f...f.   is undefined in ARM mode
+             * 0xde..       is undefined in Thumb mode
+            */
+            asm volatile (".word 0xe7f7defb\n");
+       101fc:       e7f7defb        .inst   0xe7f7defb ; undefined
+            return CMD_RET_FAILURE;
+    }
+    10200:       52800020        mov     w0, #0x1        // #1
+    10204:       d65f03c0        ret
+
+This example is based on the ARMv8 architecture but the same procedures can be
+used on other architectures as well.
diff --git a/doc/develop/index.rst b/doc/develop/index.rst
new file mode 100644 (file)
index 0000000..072db63
--- /dev/null
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Develop U-Boot
+==============
+
+
+.. toctree::
+   :maxdepth: 2
+
+   crash_dumps
diff --git a/doc/device-tree-bindings/net/phy/atheros.txt b/doc/device-tree-bindings/net/phy/atheros.txt
new file mode 100644 (file)
index 0000000..97e97b8
--- /dev/null
@@ -0,0 +1,35 @@
+* Qualcomm Atheros PHY Device Tree binding
+
+Required properties:
+- reg: PHY address
+
+Optional properties:
+- qca,clk-out-frequency: Clock frequency of the CLK_25M pin in Hz.
+       Either 25000000, 50000000, 62500000 or 125000000.
+- qca,clk-out-strength: Clock output buffer driver strength.
+    Supported values are defined in dt-bindings/net/qca-ar803x.h
+- qca,keep-pll-enabled: Keep the PLL running if no link is present.
+       Don't go into hibernation mode.
+       Only supported on the AR8031/AR8033.
+- vddio-supply: RGMII I/O voltage regulator
+       Only supported on the AR8031/AR8033.
+
+Optional subnodes:
+- vddio-regulator: Initial data for the VDDIO regulator, as covered
+    doc/device-tree-bindings/regulator/regulator.txt
+
+Example:
+       #include <dt-bindings/net/qca-ar803x.h>
+
+       ethernet-phy@0 {
+               reg = <0>;
+               qca-clk-out-frequency = <125000000>;
+               qca,keep-pll-enabled;
+
+               vddio-supply = <&vddio>;
+
+               vddio: vddio-regulator {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+       };
index 037c5a4be5c83d319a61dc93287e6c917b230d7a..8cd23d8c0bbb767f2847b20f7037b36ebb4c986d 100644 (file)
@@ -7,10 +7,17 @@ controllers on MediaTek SoCs, such as, USB2.0, USB3.0, PCIe, and SATA.
 Required properties (controller (parent) node):
  - compatible  : should be one of
                  "mediatek,generic-tphy-v1"
- - clocks      : (deprecated, use port's clocks instead) a list of phandle +
-                 clock-specifier pairs, one for each entry in clock-names
- - clock-names : (deprecated, use port's one instead) must contain
-                 "u3phya_ref": for reference clock of usb3.0 analog phy.
+                 "mediatek,generic-tphy-v2"
+
+- #address-cells:      the number of cells used to represent physical
+               base addresses.
+- #size-cells: the number of cells used to represent the size of an address.
+- ranges:      the address mapping relationship to the parent, defined with
+               - empty value: if optional 'reg' is used.
+               - non-empty value: if optional 'reg' is not used. should set
+                       the child's base address to 0, the physical address
+                       within parent's address space, and the length of
+                       the address map.
 
 Required nodes : a sub-node is required for each port the controller
                  provides. Address range information including the usual
@@ -27,12 +34,6 @@ Optional properties (controller (parent) node):
 
 Required properties (port (child) node):
 - reg          : address and length of the register set for the port.
-- clocks       : a list of phandle + clock-specifier pairs, one for each
-                 entry in clock-names
-- clock-names  : must contain
-                 "ref": 48M reference clock for HighSpeed analog phy; and 26M
-                       reference clock for SuperSpeed analog phy, sometimes is
-                       24M, 25M or 27M, depended on platform.
 - #phy-cells   : should be 1 (See second example)
                  cell after port phandle is phy type from:
                        - PHY_TYPE_USB2
@@ -40,6 +41,17 @@ Required properties (port (child) node):
                        - PHY_TYPE_PCIE
                        - PHY_TYPE_SATA
 
+Optional properties (port (child) node):
+- clocks       : a list of phandle + clock-specifier pairs, one for each
+                 entry in clock-names
+- clock-names  : may contain
+                 "ref": 48M reference clock for HighSpeed (digital) phy; and 26M
+                       reference clock for SuperSpeed (digital) phy, sometimes is
+                       24M, 25M or 27M, depended on platform.
+                 "da_ref": the reference clock of analog phy, used if the clocks
+                       of analog and digital phys are separated, otherwise uses
+                       "ref" clock only if needed.
+
 Example:
 
        u3phy2: usb-phy@1a244000 {
@@ -84,3 +96,49 @@ usb30: usb@11270000 {
        phy-names = "usb2-0", "usb3-0";
        ...
 };
+
+Layout differences of banks between TPHY V1 and V2
+-------------------------------------------------------------
+IP V1:
+port        offset    bank
+shared      0x0000    SPLLC
+            0x0100    FMREG
+u2 port0    0x0800    U2PHY_COM
+u3 port0    0x0900    U3PHYD
+            0x0a00    U3PHYD_BANK2
+            0x0b00    U3PHYA
+            0x0c00    U3PHYA_DA
+u2 port1    0x1000    U2PHY_COM
+u3 port1    0x1100    U3PHYD
+            0x1200    U3PHYD_BANK2
+            0x1300    U3PHYA
+            0x1400    U3PHYA_DA
+u2 port2    0x1800    U2PHY_COM
+            ...
+
+IP V2:
+port        offset    bank
+u2 port0    0x0000    MISC
+            0x0100    FMREG
+            0x0300    U2PHY_COM
+u3 port0    0x0700    SPLLC
+            0x0800    CHIP
+            0x0900    U3PHYD
+            0x0a00    U3PHYD_BANK2
+            0x0b00    U3PHYA
+            0x0c00    U3PHYA_DA
+u2 port1    0x1000    MISC
+            0x1100    FMREG
+            0x1300    U2PHY_COM
+u3 port1    0x1700    SPLLC
+            0x1800    CHIP
+            0x1900    U3PHYD
+            0x1a00    U3PHYD_BANK2
+            0x1b00    U3PHYA
+            0x1c00    U3PHYA_DA
+u2 port2    0x2000    MISC
+            ...
+
+    SPLLC shared by u3 ports and FMREG shared by u2 ports on
+TPHY V1 are put back into each port; a new bank MISC for
+u2 ports and CHIP for u3 ports are added on TPHY V2.
diff --git a/doc/device-tree-bindings/usb/mediatek,mtk-xhci.txt b/doc/device-tree-bindings/usb/mediatek,mtk-xhci.txt
new file mode 100644 (file)
index 0000000..0447468
--- /dev/null
@@ -0,0 +1,40 @@
+MediaTek xHCI
+
+The device node for USB3 host controller on MediaTek SoCs.
+
+Required properties:
+ - compatible : should be "mediatek,mtk-xhci"
+ - reg : specifies physical base address and size of the registers
+ - reg-names: should be "mac" for xHCI MAC and "ippc" for IP port control
+ - power-domains : a phandle to USB power domain node to control USB's
+       MTCMOS
+ - vusb33-supply : regulator of USB avdd3.3v
+
+ - clocks : a list of phandle + clock-specifier pairs, one for each
+       entry in clock-names
+ - clock-names : must contain
+       "sys_ck": controller clock used by normal mode,
+       the following ones are optional:
+       "ref_ck": reference clock used by low power mode etc,
+       "mcu_ck": mcu_bus clock for register access,
+       "dma_ck": dma_bus clock for data transfer by DMA,
+       "xhci_ck": controller clock
+
+ - phys : list of all the USB PHYs on this HCD
+ - phy-names: name specifier for the USB PHY
+
+Optional properties:
+ - vbus-supply : reference to the VBUS regulator;
+
+Example:
+xhci: usb@1a0c0000 {
+       compatible = "mediatek,mt7629-xhci", "mediatek,mtk-xhci";
+       reg = <0x1a0c0000 0x1000>, <0x1a0c3e00 0x0100>;
+       reg-names = "mac", "ippc";
+       power-domains = <&scpsys MT7629_POWER_DOMAIN_HIF1>;
+       clocks = <&ssusbsys CLK_SSUSB_SYS_EN>, <&ssusbsys CLK_SSUSB_REF_EN>,
+                <&ssusbsys CLK_SSUSB_MCU_EN>, <&ssusbsys CLK_SSUSB_DMA_EN>;
+       clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck";
+       phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>;
+       status = "disabled";
+};
index b5a70da2962a527216cad4abf58b971cd7b14e2d..546d2da17d986d411b52e03d046fec2b38c806c6 100644 (file)
@@ -7,18 +7,6 @@ file.
 
 ---------------------------
 
-What:  Remove unused CONFIG_SYS_MEMTEST_START/END
-When:  Release v2013.10
-
-Why:   As the 'mtest' command is no longer default, a number of platforms
-       have not opted to turn the command back on and thus provide unused
-       defines (which are likely to be propagated to new platforms from
-       copy/paste).  Remove these defines when unused.
-
-Who:   Tom Rini <trini@ti.com>
-
----------------------------
-
 What:  Users of the legacy miiphy_* code
 When:  undetermined
 
index cd98be6cc5fdaab0f20bb4eea301b25465965e23..fd9f10f28e4c6509101f6ee74296c25f3870254f 100644 (file)
@@ -26,6 +26,17 @@ trying to get it to work optimally on a given system.
 
    build/index
 
+Developer-oriented documentation
+--------------------------------
+
+The following manuals are written for *developers* of the U-Boot - those who
+want to contribute to U-Boot.
+
+.. toctree::
+   :maxdepth: 2
+
+   develop/index
+
 Unified Extensible Firmware (UEFI)
 ----------------------------------
 
index c2e28fe518eb4074247f82d4fa931e3886080a4f..2bc1de8b98a7a7f14564623ad6e1094cd806fbcc 100644 (file)
@@ -223,7 +223,7 @@ static int ahci_host_init(struct ahci_uc_priv *uc_priv)
 
                /* Wait for COMINIT bit 26 (DIAG_X) in SERR */
                timeout = 1000;
-               while (!(readl(&port_mmio->serr) | SATA_PORT_SERR_DIAG_X)
+               while (!(readl(&port_mmio->serr) & SATA_PORT_SERR_DIAG_X)
                        && --timeout)
                        ;
                if (timeout <= 0) {
@@ -450,7 +450,6 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, u8 port)
 
        mem = (u32)malloc(AHCI_PORT_PRIV_DMA_SZ + 1024);
        if (!mem) {
-               free(pp);
                printf("No mem for table!\n");
                return -ENOMEM;
        }
@@ -847,6 +846,9 @@ static int ahci_init_one(int pdev)
        struct ahci_uc_priv *uc_priv = NULL;
 
        uc_priv = malloc(sizeof(struct ahci_uc_priv));
+       if (!uc_priv)
+               return -ENOMEM;
+
        memset(uc_priv, 0, sizeof(struct ahci_uc_priv));
        uc_priv->dev = pdev;
 
@@ -871,6 +873,8 @@ static int ahci_init_one(int pdev)
        return 0;
 
 err_out:
+       if (uc_priv)
+               free(uc_priv);
        return rc;
 }
 
@@ -914,6 +918,9 @@ int reset_sata(int dev)
        while (readl(&host_mmio->ghc) & SATA_HOST_GHC_HR)
                udelay(100);
 
+       free(uc_priv);
+       memset(&sata_dev_desc[dev], 0, sizeof(struct blk_desc));
+
        return 0;
 }
 
index 226824c2832eda7e632c2a057cc9343b9c1f6a52..a1556fbf1740f165901f33396794d7d8ff7960e2 100644 (file)
@@ -36,6 +36,8 @@ static void l2c310_of_parse_and_init(struct udevice *dev)
        if (dev_read_bool(dev, "arm,shared-override"))
                saved_reg |= L310_SHARED_ATT_OVERRIDE_ENABLE;
 
+       writel(saved_reg, &regs->pl310_aux_ctrl);
+
        saved_reg = readl(&regs->pl310_tag_latency_ctrl);
        if (!dev_read_u32_array(dev, "arm,tag-latency", tag, 3))
                saved_reg |= L310_LATENCY_CTRL_RD(tag[0] - 1) |
index 1f623765956b861328fee4a965fbd1cbe66aeb01..d822acace14be9ba955c96f1c484e14ee0e8137f 100644 (file)
@@ -996,6 +996,7 @@ static ulong rk3399_clk_set_rate(struct clk *clk, ulong rate)
                break;
        case ACLK_VOP1:
        case HCLK_VOP1:
+       case HCLK_SD:
                /**
                 * assigned-clocks handling won't require for vopl, so
                 * return 0 to satisfy clk_set_defaults during device probe.
index 20871a681552f65ad2df2bdda438ae3471e04e61..e3c42dae5c6e221df7ea96102e87e01e07f74963 100644 (file)
@@ -474,6 +474,17 @@ ofnode ofnode_get_chosen_node(const char *name)
        return ofnode_path(prop);
 }
 
+int ofnode_get_child_count(ofnode parent)
+{
+       ofnode child;
+       int num = 0;
+
+       ofnode_for_each_subnode(child, parent)
+               num++;
+
+       return num;
+}
+
 static int decode_timing_property(ofnode node, const char *name,
                                  struct timing_entry *result)
 {
index 47b8e034465ac0f648754d2a4ba1f15e03e54f57..3d421f7a69c71472abed7c0dd60de1b8c9a1c05e 100644 (file)
@@ -352,3 +352,8 @@ fdt_addr_t dev_read_addr_pci(const struct udevice *dev)
 
        return addr;
 }
+
+int dev_get_child_count(const struct udevice *dev)
+{
+       return ofnode_get_child_count(dev_ofnode(dev));
+}
index 174fb588a6e995ccb3e445e3358d4771cee74a5b..5d45d7d7c2d76cc8d89c498476234c8fd053ff00 100644 (file)
@@ -81,5 +81,10 @@ config DFU_VIRT
          used at board level to manage specific behavior
          (OTP update for example).
 
+config SET_DFU_ALT_INFO
+       bool "Dynamic set of DFU alternate information"
+       help
+         This option allows to call the function set_dfu_alt_info to
+         dynamically build dfu_alt_info in board.
 endif
 endmenu
index 5e7571cf3da3f93738fd31921ae01c616bdd49e9..348b43e653f988a233bb45cf73caa8f8eff379ef 100644 (file)
@@ -22,6 +22,13 @@ config MTD_NOR_FLASH
        help
          Enable support for parallel NOR flash.
 
+config SYS_MTDPARTS_RUNTIME
+       bool "Allow MTDPARTS to be configured at runtime"
+       depends on MTD
+       help
+         This option allows to call the function board_mtdparts_default to
+         dynamically build the variables mtdids and mtdparts at runtime.
+
 config FLASH_CFI_DRIVER
        bool "Enable CFI Flash driver"
        help
index dd6bacae34d9431c8898d5e18a462e55275b4cf0..6c65b187e86e8515427f548e38c613f100dc14a8 100644 (file)
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
 
-spinand-objs := core.o gigadevice.o macronix.o micron.o winbond.o
+spinand-objs := core.o gigadevice.o macronix.o micron.o toshiba.o winbond.o
 obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
index cd624ec6ae64926223354dfb0864ffb21c79146b..397dfa41789813a7c050f4f1f040163bad9a6d58 100644 (file)
@@ -835,6 +835,7 @@ static const struct spinand_manufacturer *spinand_manufacturers[] = {
        &gigadevice_spinand_manufacturer,
        &macronix_spinand_manufacturer,
        &micron_spinand_manufacturer,
+       &toshiba_spinand_manufacturer,
        &winbond_spinand_manufacturer,
 };
 
diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c
new file mode 100644 (file)
index 0000000..77c2539
--- /dev/null
@@ -0,0 +1,201 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2018 exceet electronics GmbH
+ * Copyright (c) 2018 Kontron Electronics GmbH
+ *
+ * Author: Frieder Schrempf <frieder.schrempf@kontron.de>
+ */
+
+#ifndef __UBOOT__
+#include <malloc.h>
+#include <linux/device.h>
+#include <linux/kernel.h>
+#endif
+#include <linux/mtd/spinand.h>
+
+#define SPINAND_MFR_TOSHIBA            0x98
+#define TOSH_STATUS_ECC_HAS_BITFLIPS_T (3 << 4)
+
+static SPINAND_OP_VARIANTS(read_cache_variants,
+               SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+               SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+               SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
+               SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
+
+static SPINAND_OP_VARIANTS(write_cache_variants,
+               SPINAND_PROG_LOAD(true, 0, NULL, 0));
+
+static SPINAND_OP_VARIANTS(update_cache_variants,
+               SPINAND_PROG_LOAD(false, 0, NULL, 0));
+
+static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section,
+                                    struct mtd_oob_region *region)
+{
+       if (section > 0)
+               return -ERANGE;
+
+       region->offset = mtd->oobsize / 2;
+       region->length = mtd->oobsize / 2;
+
+       return 0;
+}
+
+static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section,
+                                     struct mtd_oob_region *region)
+{
+       if (section > 0)
+               return -ERANGE;
+
+       /* 2 bytes reserved for BBM */
+       region->offset = 2;
+       region->length = (mtd->oobsize / 2) - 2;
+
+       return 0;
+}
+
+static const struct mtd_ooblayout_ops tc58cxgxsx_ooblayout = {
+       .ecc = tc58cxgxsx_ooblayout_ecc,
+       .rfree = tc58cxgxsx_ooblayout_free,
+};
+
+static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand,
+                                     u8 status)
+{
+       struct nand_device *nand = spinand_to_nand(spinand);
+       u8 mbf = 0;
+       struct spi_mem_op op = SPINAND_GET_FEATURE_OP(0x30, &mbf);
+
+       switch (status & STATUS_ECC_MASK) {
+       case STATUS_ECC_NO_BITFLIPS:
+               return 0;
+
+       case STATUS_ECC_UNCOR_ERROR:
+               return -EBADMSG;
+
+       case STATUS_ECC_HAS_BITFLIPS:
+       case TOSH_STATUS_ECC_HAS_BITFLIPS_T:
+               /*
+                * Let's try to retrieve the real maximum number of bitflips
+                * in order to avoid forcing the wear-leveling layer to move
+                * data around if it's not necessary.
+                */
+               if (spi_mem_exec_op(spinand->slave, &op))
+                       return nand->eccreq.strength;
+
+               mbf >>= 4;
+
+               if (WARN_ON(mbf > nand->eccreq.strength || !mbf))
+                       return nand->eccreq.strength;
+
+               return mbf;
+
+       default:
+               break;
+       }
+
+       return -EINVAL;
+}
+
+static const struct spinand_info toshiba_spinand_table[] = {
+       /* 3.3V 1Gb */
+       SPINAND_INFO("TC58CVG0S3", 0xC2,
+                    NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_variants,
+                                             &update_cache_variants),
+                    0,
+                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
+                                    tc58cxgxsx_ecc_get_status)),
+       /* 3.3V 2Gb */
+       SPINAND_INFO("TC58CVG1S3", 0xCB,
+                    NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_variants,
+                                             &update_cache_variants),
+                    0,
+                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
+                                    tc58cxgxsx_ecc_get_status)),
+       /* 3.3V 4Gb */
+       SPINAND_INFO("TC58CVG2S0", 0xCD,
+                    NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_variants,
+                                             &update_cache_variants),
+                    0,
+                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
+                                    tc58cxgxsx_ecc_get_status)),
+       /* 3.3V 4Gb */
+       SPINAND_INFO("TC58CVG2S0", 0xED,
+                    NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_variants,
+                                             &update_cache_variants),
+                    0,
+                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
+                                    tc58cxgxsx_ecc_get_status)),
+       /* 1.8V 1Gb */
+       SPINAND_INFO("TC58CYG0S3", 0xB2,
+                    NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_variants,
+                                             &update_cache_variants),
+                    0,
+                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
+                                    tc58cxgxsx_ecc_get_status)),
+       /* 1.8V 2Gb */
+       SPINAND_INFO("TC58CYG1S3", 0xBB,
+                    NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_variants,
+                                             &update_cache_variants),
+                    0,
+                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
+                                    tc58cxgxsx_ecc_get_status)),
+       /* 1.8V 4Gb */
+       SPINAND_INFO("TC58CYG2S0", 0xBD,
+                    NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1),
+                    NAND_ECCREQ(8, 512),
+                    SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+                                             &write_cache_variants,
+                                             &update_cache_variants),
+                    0,
+                    SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
+                                    tc58cxgxsx_ecc_get_status)),
+};
+
+static int toshiba_spinand_detect(struct spinand_device *spinand)
+{
+       u8 *id = spinand->id.data;
+       int ret;
+
+       /*
+        * Toshiba SPI NAND read ID needs a dummy byte,
+        * so the first byte in id is garbage.
+        */
+       if (id[1] != SPINAND_MFR_TOSHIBA)
+               return 0;
+
+       ret = spinand_match_and_init(spinand, toshiba_spinand_table,
+                                    ARRAY_SIZE(toshiba_spinand_table),
+                                    id[2]);
+       if (ret)
+               return ret;
+
+       return 1;
+}
+
+static const struct spinand_manufacturer_ops toshiba_spinand_manuf_ops = {
+       .detect = toshiba_spinand_detect,
+};
+
+const struct spinand_manufacturer toshiba_spinand_manufacturer = {
+       .id = SPINAND_MFR_TOSHIBA,
+       .name = "Toshiba",
+       .ops = &toshiba_spinand_manuf_ops,
+};
index 7b6ad495ace34c221c3ae188f7c82e74ba1fb95c..e840c60f275ee573cacd9ac82908d48f6570ab74 100644 (file)
@@ -325,6 +325,7 @@ static int set_4byte(struct spi_nor *nor, const struct flash_info *info,
        case SNOR_MFR_MICRON:
                /* Some Micron need WREN command; all will accept it */
                need_wren = true;
+       case SNOR_MFR_ISSI:
        case SNOR_MFR_MACRONIX:
        case SNOR_MFR_WINBOND:
                if (need_wren)
@@ -1246,11 +1247,8 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len,
                 * If page_size is a power of two, the offset can be quickly
                 * calculated with an AND operation. On the other cases we
                 * need to do a modulus operation (more expensive).
-                * Power of two numbers have only one bit set and we can use
-                * the instruction hweight32 to detect if we need to do a
-                * modulus (do_div()) or not.
                 */
-               if (hweight32(nor->page_size) == 1) {
+               if (is_power_of_2(nor->page_size)) {
                        page_offset = addr & (nor->page_size - 1);
                } else {
                        u64 aux = addr;
index abdf560e020ee5b2ffa478576c96b8d44334efcf..e5e710292313787b7adff5005f4c7c815f283615 100644 (file)
@@ -135,7 +135,8 @@ const struct flash_info spi_nor_ids[] = {
        { INFO("is25wp128",  0x9d7018, 0, 64 * 1024, 256,
                        SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
        { INFO("is25wp256",  0x9d7019, 0, 64 * 1024, 512,
-                       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+                       SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+                       SPI_NOR_4B_OPCODES) },
 #endif
 #ifdef CONFIG_SPI_FLASH_MACRONIX       /* MACRONIX */
        /* Macronix */
@@ -183,8 +184,8 @@ const struct flash_info spi_nor_ids[] = {
        { INFO("n25q00",      0x20ba21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
        { INFO("n25q00a",     0x20bb21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
        { INFO("mt25qu02g",   0x20bb22, 0, 64 * 1024, 4096, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ | NO_CHIP_ERASE) },
-       { INFO("mt35xu512aba", 0x2c5b1a, 0,  128 * 1024,  512, USE_FSR | SPI_NOR_4B_OPCODES) },
-       { INFO("mt35xu02g",  0x2c5b1c, 0, 128 * 1024,  2048, USE_FSR | SPI_NOR_4B_OPCODES) },
+       { INFO("mt35xu512aba", 0x2c5b1a, 0,  128 * 1024,  512, USE_FSR | SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES) },
+       { INFO("mt35xu02g",  0x2c5b1c, 0, 128 * 1024,  2048, USE_FSR | SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES) },
 #endif
 #ifdef CONFIG_SPI_FLASH_SPANSION       /* SPANSION */
        /* Spansion/Cypress -- single (large) sector size only, at least
@@ -192,9 +193,10 @@ const struct flash_info spi_nor_ids[] = {
         */
        { INFO("s25sl032p",  0x010215, 0x4d00,  64 * 1024,  64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
        { INFO("s25sl064p",  0x010216, 0x4d00,  64 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
-       { INFO("s25fl256s0", 0x010219, 0x4d00, 256 * 1024, 128, USE_CLSR) },
+       { INFO("s25fl256s0", 0x010219, 0x4d00, 256 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
        { INFO("s25fl256s1", 0x010219, 0x4d01,  64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
-       { INFO6("s25fl512s",  0x010220, 0x4d0081, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+       { INFO6("s25fl512s",  0x010220, 0x4d0080, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
+       { INFO6("s25fs512s",  0x010220, 0x4d0081, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
        { INFO("s25fl512s_256k",  0x010220, 0x4d00, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
        { INFO("s25fl512s_64k",  0x010220, 0x4d01, 64 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
        { INFO("s25fl512s_512k", 0x010220, 0x4f00, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
index bc518f218da6827bf3efa1ffa37e55bf8cdfb8e5..a2587a29e16513aada0ccdd8faf89cfd5538fcf5 100644 (file)
@@ -388,11 +388,13 @@ config SMC911X
 
 if SMC911X
 
+if !DM_ETH
 config SMC911X_BASE
        hex "SMC911X Base Address"
        help
          Define this to hold the physical address
          of the device (I/O space)
+endif #DM_ETH
 
 choice
        prompt "SMC911X bus width"
index 43c2253f10d2d163ed02b014b976aec5281dfa9f..d008696b0ffb1918af21121067cfed53481d598d 100644 (file)
@@ -7,24 +7,21 @@
 #include <netdev.h>
 #include <pci.h>
 
-#undef DEBUG_SROM
-#undef DEBUG_SROM2
+#define SROM_DLEVEL    0
 
 #undef UPDATE_SROM
 
-/* PCI Registers.
- */
-#define PCI_CFDA_PSM           0x43
+/* PCI Registers. */
+#define PCI_CFDA_PSM   0x43
 
 #define CFRV_RN                0x000000f0      /* Revision Number */
 
 #define WAKEUP         0x00            /* Power Saving Wakeup */
 #define SLEEP          0x80            /* Power Saving Sleep Mode */
 
-#define DC2114x_BRK    0x0020          /* CFRV break between DC21142 & DC21143 */
+#define DC2114x_BRK    0x0020  /* CFRV break between DC21142 & DC21143 */
 
-/* Ethernet chip registers.
- */
+/* Ethernet chip registers. */
 #define DE4X5_BMR      0x000           /* Bus Mode Register */
 #define DE4X5_TPD      0x008           /* Transmit Poll Demand Reg */
 #define DE4X5_RRBA     0x018           /* RX Ring Base Address Reg */
@@ -34,8 +31,7 @@
 #define DE4X5_SICR     0x068           /* SIA Connectivity Register */
 #define DE4X5_APROM    0x048           /* Ethernet Address PROM */
 
-/* Register bits.
- */
+/* Register bits. */
 #define BMR_SWR                0x00000001      /* Software Reset */
 #define STS_TS         0x00700000      /* Transmit Process State */
 #define STS_RS         0x000e0000      /* Receive Process State */
@@ -45,8 +41,7 @@
 #define OMR_SDP                0x02000000      /* SD Polarity - MUST BE ASSERTED */
 #define OMR_PM         0x00000080      /* Pass All Multicast */
 
-/* Descriptor bits.
- */
+/* Descriptor bits. */
 #define R_OWN          0x80000000      /* Own Bit */
 #define RD_RER         0x02000000      /* Receive End Of Ring */
 #define RD_LS          0x00000100      /* Last Descriptor */
 #define SROM_READ_CMD  6
 #define SROM_ERASE_CMD 7
 
-#define SROM_HWADD         0x0014      /* Hardware Address offset in SROM */
+#define SROM_HWADD     0x0014          /* Hardware Address offset in SROM */
 #define SROM_RD                0x00004000      /* Read from Boot ROM */
-#define EE_DATA_WRITE        0x04      /* EEPROM chip data in. */
-#define EE_WRITE_0         0x4801
-#define EE_WRITE_1         0x4805
-#define EE_DATA_READ         0x08      /* EEPROM chip data out. */
+#define EE_DATA_WRITE  0x04            /* EEPROM chip data in. */
+#define EE_WRITE_0     0x4801
+#define EE_WRITE_1     0x4805
+#define EE_DATA_READ   0x08            /* EEPROM chip data out. */
 #define SROM_SR                0x00000800      /* Select Serial ROM when set */
 
 #define DT_IN          0x00000004      /* Serial Data In */
 
 #define POLL_DEMAND    1
 
-#ifdef CONFIG_TULIP_FIX_DAVICOM
-#define RESET_DM9102(dev) {\
-    unsigned long i;\
-    i=INL(dev, 0x0);\
-    udelay(1000);\
-    OUTL(dev, i | BMR_SWR, DE4X5_BMR);\
-    udelay(1000);\
-}
+#if defined(CONFIG_E500)
+#define phys_to_bus(a) (a)
 #else
-#define RESET_DE4X5(dev) {\
-    int i;\
-    i=INL(dev, DE4X5_BMR);\
-    udelay(1000);\
-    OUTL(dev, i | BMR_SWR, DE4X5_BMR);\
-    udelay(1000);\
-    OUTL(dev, i, DE4X5_BMR);\
-    udelay(1000);\
-    for (i=0;i<5;i++) {INL(dev, DE4X5_BMR); udelay(10000);}\
-    udelay(1000);\
-}
+#define phys_to_bus(a) pci_phys_to_mem((pci_dev_t)dev->priv, a)
 #endif
 
-#define START_DE4X5(dev) {\
-    s32 omr; \
-    omr = INL(dev, DE4X5_OMR);\
-    omr |= OMR_ST | OMR_SR;\
-    OUTL(dev, omr, DE4X5_OMR);         /* Enable the TX and/or RX */\
-}
-
-#define STOP_DE4X5(dev) {\
-    s32 omr; \
-    omr = INL(dev, DE4X5_OMR);\
-    omr &= ~(OMR_ST|OMR_SR);\
-    OUTL(dev, omr, DE4X5_OMR);         /* Disable the TX and/or RX */ \
-}
-
 #define NUM_RX_DESC PKTBUFSRX
-#ifndef CONFIG_TULIP_FIX_DAVICOM
-       #define NUM_TX_DESC 1                   /* Number of TX descriptors   */
-#else
-       #define NUM_TX_DESC 4
-#endif
+#define NUM_TX_DESC 1                  /* Number of TX descriptors   */
 #define RX_BUFF_SZ  PKTSIZE_ALIGN
 
 #define TOUT_LOOP   1000000
@@ -132,455 +93,117 @@ struct de4x5_desc {
        u32 next;
 };
 
-static struct de4x5_desc rx_ring[NUM_RX_DESC] __attribute__ ((aligned(32))); /* RX descriptor ring         */
-static struct de4x5_desc tx_ring[NUM_TX_DESC] __attribute__ ((aligned(32))); /* TX descriptor ring         */
-static int rx_new;                             /* RX descriptor ring pointer */
-static int tx_new;                             /* TX descriptor ring pointer */
+/* RX and TX descriptor ring */
+static struct de4x5_desc rx_ring[NUM_RX_DESC] __aligned(32);
+static struct de4x5_desc tx_ring[NUM_TX_DESC] __aligned(32);
+static int rx_new;     /* RX descriptor ring pointer */
+static int tx_new;     /* TX descriptor ring pointer */
 
-static char rxRingSize;
-static char txRingSize;
+static char rx_ring_size;
+static char tx_ring_size;
 
-#if defined(UPDATE_SROM) || !defined(CONFIG_TULIP_FIX_DAVICOM)
-static void  sendto_srom(struct eth_device* dev, u_int command, u_long addr);
-static int   getfrom_srom(struct eth_device* dev, u_long addr);
-static int   do_eeprom_cmd(struct eth_device *dev, u_long ioaddr,int cmd,int cmd_len);
-static int   do_read_eeprom(struct eth_device *dev,u_long ioaddr,int location,int addr_len);
-#endif /* UPDATE_SROM || !CONFIG_TULIP_FIX_DAVICOM */
-#ifdef UPDATE_SROM
-static int   write_srom(struct eth_device *dev, u_long ioaddr, int index, int new_value);
-static void  update_srom(struct eth_device *dev, bd_t *bis);
-#endif
-#ifndef CONFIG_TULIP_FIX_DAVICOM
-static int   read_srom(struct eth_device *dev, u_long ioaddr, int index);
-static void  read_hw_addr(struct eth_device* dev, bd_t * bis);
-#endif /* CONFIG_TULIP_FIX_DAVICOM */
-static void  send_setup_frame(struct eth_device* dev, bd_t * bis);
-
-static int   dc21x4x_init(struct eth_device* dev, bd_t* bis);
-static int   dc21x4x_send(struct eth_device *dev, void *packet, int length);
-static int   dc21x4x_recv(struct eth_device* dev);
-static void  dc21x4x_halt(struct eth_device* dev);
-#ifdef CONFIG_TULIP_SELECT_MEDIA
-extern void  dc21x4x_select_media(struct eth_device* dev);
-#endif
-
-#if defined(CONFIG_E500)
-#define phys_to_bus(a) (a)
-#else
-#define phys_to_bus(a) pci_phys_to_mem((pci_dev_t)dev->priv, a)
-#endif
-
-static int INL(struct eth_device* dev, u_long addr)
+static u32 dc2114x_inl(struct eth_device *dev, u32 addr)
 {
-       return le32_to_cpu(*(volatile u_long *)(addr + dev->iobase));
+       return le32_to_cpu(*(volatile u32 *)(addr + dev->iobase));
 }
 
-static void OUTL(struct eth_device* dev, int command, u_long addr)
+static void dc2114x_outl(struct eth_device *dev, u32 command, u32 addr)
 {
-       *(volatile u_long *)(addr + dev->iobase) = cpu_to_le32(command);
+       *(volatile u32 *)(addr + dev->iobase) = cpu_to_le32(command);
 }
 
-static struct pci_device_id supported[] = {
-       { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST },
-       { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21142 },
-#ifdef CONFIG_TULIP_FIX_DAVICOM
-       { PCI_VENDOR_ID_DAVICOM, PCI_DEVICE_ID_DAVICOM_DM9102A },
-#endif
-       { }
-};
-
-int dc21x4x_initialize(bd_t *bis)
+static void reset_de4x5(struct eth_device *dev)
 {
-       int                     idx=0;
-       int                     card_number = 0;
-       unsigned int            cfrv;
-       unsigned char           timer;
-       pci_dev_t               devbusfn;
-       unsigned int            iobase;
-       unsigned short          status;
-       struct eth_device*      dev;
-
-       while(1) {
-               devbusfn =  pci_find_devices(supported, idx++);
-               if (devbusfn == -1) {
-                       break;
-               }
-
-               /* Get the chip configuration revision register. */
-               pci_read_config_dword(devbusfn, PCI_REVISION_ID, &cfrv);
-
-#ifndef CONFIG_TULIP_FIX_DAVICOM
-               if ((cfrv & CFRV_RN) < DC2114x_BRK ) {
-                       printf("Error: The chip is not DC21143.\n");
-                       continue;
-               }
-#endif
-
-               pci_read_config_word(devbusfn, PCI_COMMAND, &status);
-               status |=
-#ifdef CONFIG_TULIP_USE_IO
-                 PCI_COMMAND_IO |
-#else
-                 PCI_COMMAND_MEMORY |
-#endif
-                 PCI_COMMAND_MASTER;
-               pci_write_config_word(devbusfn, PCI_COMMAND, status);
-
-               pci_read_config_word(devbusfn, PCI_COMMAND, &status);
-#ifdef CONFIG_TULIP_USE_IO
-               if (!(status & PCI_COMMAND_IO)) {
-                       printf("Error: Can not enable I/O access.\n");
-                       continue;
-               }
-#else
-               if (!(status & PCI_COMMAND_MEMORY)) {
-                       printf("Error: Can not enable MEMORY access.\n");
-                       continue;
-               }
-#endif
-
-               if (!(status & PCI_COMMAND_MASTER)) {
-                       printf("Error: Can not enable Bus Mastering.\n");
-                       continue;
-               }
-
-               /* Check the latency timer for values >= 0x60. */
-               pci_read_config_byte(devbusfn, PCI_LATENCY_TIMER, &timer);
-
-               if (timer < 0x60) {
-                       pci_write_config_byte(devbusfn, PCI_LATENCY_TIMER, 0x60);
-               }
-
-#ifdef CONFIG_TULIP_USE_IO
-               /* read BAR for memory space access */
-               pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, &iobase);
-               iobase &= PCI_BASE_ADDRESS_IO_MASK;
-#else
-               /* read BAR for memory space access */
-               pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_1, &iobase);
-               iobase &= PCI_BASE_ADDRESS_MEM_MASK;
-#endif
-               debug ("dc21x4x: DEC 21142 PCI Device @0x%x\n", iobase);
-
-               dev = (struct eth_device*) malloc(sizeof *dev);
-
-               if (!dev) {
-                       printf("Can not allocalte memory of dc21x4x\n");
-                       break;
-               }
-               memset(dev, 0, sizeof(*dev));
-
-#ifdef CONFIG_TULIP_FIX_DAVICOM
-               sprintf(dev->name, "Davicom#%d", card_number);
-#else
-               sprintf(dev->name, "dc21x4x#%d", card_number);
-#endif
-
-#ifdef CONFIG_TULIP_USE_IO
-               dev->iobase = pci_io_to_phys(devbusfn, iobase);
-#else
-               dev->iobase = pci_mem_to_phys(devbusfn, iobase);
-#endif
-               dev->priv   = (void*) devbusfn;
-               dev->init   = dc21x4x_init;
-               dev->halt   = dc21x4x_halt;
-               dev->send   = dc21x4x_send;
-               dev->recv   = dc21x4x_recv;
-
-               /* Ensure we're not sleeping. */
-               pci_write_config_byte(devbusfn, PCI_CFDA_PSM, WAKEUP);
-
-               udelay(10 * 1000);
-
-#ifndef CONFIG_TULIP_FIX_DAVICOM
-               read_hw_addr(dev, bis);
-#endif
-               eth_register(dev);
-
-               card_number++;
+       u32 i;
+
+       i = dc2114x_inl(dev, DE4X5_BMR);
+       mdelay(1);
+       dc2114x_outl(dev, i | BMR_SWR, DE4X5_BMR);
+       mdelay(1);
+       dc2114x_outl(dev, i, DE4X5_BMR);
+       mdelay(1);
+
+       for (i = 0; i < 5; i++) {
+               dc2114x_inl(dev, DE4X5_BMR);
+               mdelay(10);
        }
 
-       return card_number;
+       mdelay(1);
 }
 
-static int dc21x4x_init(struct eth_device* dev, bd_t* bis)
+static void start_de4x5(struct eth_device *dev)
 {
-       int             i;
-       int             devbusfn = (int) dev->priv;
+       u32 omr;
 
-       /* Ensure we're not sleeping. */
-       pci_write_config_byte(devbusfn, PCI_CFDA_PSM, WAKEUP);
-
-#ifdef CONFIG_TULIP_FIX_DAVICOM
-       RESET_DM9102(dev);
-#else
-       RESET_DE4X5(dev);
-#endif
-
-       if ((INL(dev, DE4X5_STS) & (STS_TS | STS_RS)) != 0) {
-               printf("Error: Cannot reset ethernet controller.\n");
-               return -1;
-       }
-
-#ifdef CONFIG_TULIP_SELECT_MEDIA
-       dc21x4x_select_media(dev);
-#else
-       OUTL(dev, OMR_SDP | OMR_PS | OMR_PM, DE4X5_OMR);
-#endif
-
-       for (i = 0; i < NUM_RX_DESC; i++) {
-               rx_ring[i].status = cpu_to_le32(R_OWN);
-               rx_ring[i].des1 = cpu_to_le32(RX_BUFF_SZ);
-               rx_ring[i].buf = cpu_to_le32(
-                       phys_to_bus((u32)net_rx_packets[i]));
-#ifdef CONFIG_TULIP_FIX_DAVICOM
-               rx_ring[i].next = cpu_to_le32(
-                       phys_to_bus((u32)&rx_ring[(i + 1) % NUM_RX_DESC]));
-#else
-               rx_ring[i].next = 0;
-#endif
-       }
-
-       for (i=0; i < NUM_TX_DESC; i++) {
-               tx_ring[i].status = 0;
-               tx_ring[i].des1 = 0;
-               tx_ring[i].buf = 0;
-
-#ifdef CONFIG_TULIP_FIX_DAVICOM
-       tx_ring[i].next = cpu_to_le32(phys_to_bus((u32) &tx_ring[(i+1) % NUM_TX_DESC]));
-#else
-               tx_ring[i].next = 0;
-#endif
-       }
-
-       rxRingSize = NUM_RX_DESC;
-       txRingSize = NUM_TX_DESC;
-
-       /* Write the end of list marker to the descriptor lists. */
-       rx_ring[rxRingSize - 1].des1 |= cpu_to_le32(RD_RER);
-       tx_ring[txRingSize - 1].des1 |= cpu_to_le32(TD_TER);
-
-       /* Tell the adapter where the TX/RX rings are located. */
-       OUTL(dev, phys_to_bus((u32) &rx_ring), DE4X5_RRBA);
-       OUTL(dev, phys_to_bus((u32) &tx_ring), DE4X5_TRBA);
-
-       START_DE4X5(dev);
-
-       tx_new = 0;
-       rx_new = 0;
-
-       send_setup_frame(dev, bis);
-
-       return 0;
+       omr = dc2114x_inl(dev, DE4X5_OMR);
+       omr |= OMR_ST | OMR_SR;
+       dc2114x_outl(dev, omr, DE4X5_OMR);      /* Enable the TX and/or RX */
 }
 
-static int dc21x4x_send(struct eth_device *dev, void *packet, int length)
+static void stop_de4x5(struct eth_device *dev)
 {
-       int             status = -1;
-       int             i;
+       u32 omr;
 
-       if (length <= 0) {
-               printf("%s: bad packet size: %d\n", dev->name, length);
-               goto Done;
-       }
-
-       for(i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
-               if (i >= TOUT_LOOP) {
-                       printf("%s: tx error buffer not ready\n", dev->name);
-                       goto Done;
-               }
-       }
-
-       tx_ring[tx_new].buf    = cpu_to_le32(phys_to_bus((u32) packet));
-       tx_ring[tx_new].des1   = cpu_to_le32(TD_TER | TD_LS | TD_FS | length);
-       tx_ring[tx_new].status = cpu_to_le32(T_OWN);
-
-       OUTL(dev, POLL_DEMAND, DE4X5_TPD);
-
-       for(i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
-               if (i >= TOUT_LOOP) {
-                       printf(".%s: tx buffer not ready\n", dev->name);
-                       goto Done;
-               }
-       }
-
-       if (le32_to_cpu(tx_ring[tx_new].status) & TD_ES) {
-#if 0 /* test-only */
-               printf("TX error status = 0x%08X\n",
-                       le32_to_cpu(tx_ring[tx_new].status));
-#endif
-               tx_ring[tx_new].status = 0x0;
-               goto Done;
-       }
-
-       status = length;
-
- Done:
-    tx_new = (tx_new+1) % NUM_TX_DESC;
-       return status;
+       omr = dc2114x_inl(dev, DE4X5_OMR);
+       omr &= ~(OMR_ST | OMR_SR);
+       dc2114x_outl(dev, omr, DE4X5_OMR);      /* Disable the TX and/or RX */
 }
 
-static int dc21x4x_recv(struct eth_device* dev)
+/* SROM Read and write routines. */
+static void sendto_srom(struct eth_device *dev, u_int command, u_long addr)
 {
-       s32             status;
-       int             length    = 0;
-
-       for ( ; ; ) {
-               status = (s32)le32_to_cpu(rx_ring[rx_new].status);
-
-               if (status & R_OWN) {
-                       break;
-               }
-
-               if (status & RD_LS) {
-                       /* Valid frame status.
-                        */
-                       if (status & RD_ES) {
-
-                               /* There was an error.
-                                */
-                               printf("RX error status = 0x%08X\n", status);
-                       } else {
-                               /* A valid frame received.
-                                */
-                               length = (le32_to_cpu(rx_ring[rx_new].status) >> 16);
-
-                               /* Pass the packet up to the protocol
-                                * layers.
-                                */
-                               net_process_received_packet(
-                                       net_rx_packets[rx_new], length - 4);
-                       }
-
-                       /* Change buffer ownership for this frame, back
-                        * to the adapter.
-                        */
-                       rx_ring[rx_new].status = cpu_to_le32(R_OWN);
-               }
-
-               /* Update entry information.
-                */
-               rx_new = (rx_new + 1) % rxRingSize;
-       }
-
-       return length;
-}
-
-static void dc21x4x_halt(struct eth_device* dev)
-{
-       int             devbusfn = (int) dev->priv;
-
-       STOP_DE4X5(dev);
-       OUTL(dev, 0, DE4X5_SICR);
-
-       pci_write_config_byte(devbusfn, PCI_CFDA_PSM, SLEEP);
-}
-
-static void send_setup_frame(struct eth_device* dev, bd_t *bis)
-{
-       int             i;
-       char    setup_frame[SETUP_FRAME_LEN];
-       char    *pa = &setup_frame[0];
-
-       memset(pa, 0xff, SETUP_FRAME_LEN);
-
-       for (i = 0; i < ETH_ALEN; i++) {
-               *(pa + (i & 1)) = dev->enetaddr[i];
-               if (i & 0x01) {
-                       pa += 4;
-               }
-       }
-
-       for(i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
-               if (i >= TOUT_LOOP) {
-                       printf("%s: tx error buffer not ready\n", dev->name);
-                       goto Done;
-               }
-       }
-
-       tx_ring[tx_new].buf = cpu_to_le32(phys_to_bus((u32) &setup_frame[0]));
-       tx_ring[tx_new].des1 = cpu_to_le32(TD_TER | TD_SET| SETUP_FRAME_LEN);
-       tx_ring[tx_new].status = cpu_to_le32(T_OWN);
-
-       OUTL(dev, POLL_DEMAND, DE4X5_TPD);
-
-       for(i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
-               if (i >= TOUT_LOOP) {
-                       printf("%s: tx buffer not ready\n", dev->name);
-                       goto Done;
-               }
-       }
-
-       if (le32_to_cpu(tx_ring[tx_new].status) != 0x7FFFFFFF) {
-               printf("TX error status2 = 0x%08X\n", le32_to_cpu(tx_ring[tx_new].status));
-       }
-       tx_new = (tx_new+1) % NUM_TX_DESC;
-
-Done:
-       return;
-}
-
-#if defined(UPDATE_SROM) || !defined(CONFIG_TULIP_FIX_DAVICOM)
-/* SROM Read and write routines.
- */
-static void
-sendto_srom(struct eth_device* dev, u_int command, u_long addr)
-{
-       OUTL(dev, command, addr);
+       dc2114x_outl(dev, command, addr);
        udelay(1);
 }
 
-static int
-getfrom_srom(struct eth_device* dev, u_long addr)
+static int getfrom_srom(struct eth_device *dev, u_long addr)
 {
-       s32 tmp;
+       u32 tmp = dc2114x_inl(dev, addr);
 
-       tmp = INL(dev, addr);
        udelay(1);
-
        return tmp;
 }
 
 /* Note: this routine returns extra data bits for size detection. */
-static int do_read_eeprom(struct eth_device *dev, u_long ioaddr, int location, int addr_len)
+static int do_read_eeprom(struct eth_device *dev, u_long ioaddr, int location,
+                         int addr_len)
 {
-       int i;
-       unsigned retval = 0;
        int read_cmd = location | (SROM_READ_CMD << addr_len);
+       unsigned int retval = 0;
+       int i;
 
        sendto_srom(dev, SROM_RD | SROM_SR, ioaddr);
        sendto_srom(dev, SROM_RD | SROM_SR | DT_CS, ioaddr);
 
-#ifdef DEBUG_SROM
-       printf(" EEPROM read at %d ", location);
-#endif
+       debug_cond(SROM_DLEVEL >= 1, " EEPROM read at %d ", location);
 
        /* Shift the read command bits out. */
        for (i = 4 + addr_len; i >= 0; i--) {
                short dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
-               sendto_srom(dev, SROM_RD | SROM_SR | DT_CS | dataval, ioaddr);
+
+               sendto_srom(dev, SROM_RD | SROM_SR | DT_CS | dataval,
+                           ioaddr);
                udelay(10);
-               sendto_srom(dev, SROM_RD | SROM_SR | DT_CS | dataval | DT_CLK, ioaddr);
+               sendto_srom(dev, SROM_RD | SROM_SR | DT_CS | dataval | DT_CLK,
+                           ioaddr);
                udelay(10);
-#ifdef DEBUG_SROM2
-               printf("%X", getfrom_srom(dev, ioaddr) & 15);
-#endif
-               retval = (retval << 1) | ((getfrom_srom(dev, ioaddr) & EE_DATA_READ) ? 1 : 0);
+               debug_cond(SROM_DLEVEL >= 2, "%X",
+                          getfrom_srom(dev, ioaddr) & 15);
+               retval = (retval << 1) |
+                        !!(getfrom_srom(dev, ioaddr) & EE_DATA_READ);
        }
 
        sendto_srom(dev, SROM_RD | SROM_SR | DT_CS, ioaddr);
 
-#ifdef DEBUG_SROM2
-       printf(" :%X:", getfrom_srom(dev, ioaddr) & 15);
-#endif
+       debug_cond(SROM_DLEVEL >= 2, " :%X:", getfrom_srom(dev, ioaddr) & 15);
 
        for (i = 16; i > 0; i--) {
                sendto_srom(dev, SROM_RD | SROM_SR | DT_CS | DT_CLK, ioaddr);
                udelay(10);
-#ifdef DEBUG_SROM2
-               printf("%X", getfrom_srom(dev, ioaddr) & 15);
-#endif
-               retval = (retval << 1) | ((getfrom_srom(dev, ioaddr) & EE_DATA_READ) ? 1 : 0);
+               debug_cond(SROM_DLEVEL >= 2, "%X",
+                          getfrom_srom(dev, ioaddr) & 15);
+               retval = (retval << 1) |
+                        !!(getfrom_srom(dev, ioaddr) & EE_DATA_READ);
                sendto_srom(dev, SROM_RD | SROM_SR | DT_CS, ioaddr);
                udelay(10);
        }
@@ -588,145 +211,115 @@ static int do_read_eeprom(struct eth_device *dev, u_long ioaddr, int location, i
        /* Terminate the EEPROM access. */
        sendto_srom(dev, SROM_RD | SROM_SR, ioaddr);
 
-#ifdef DEBUG_SROM2
-       printf(" EEPROM value at %d is %5.5x.\n", location, retval);
-#endif
+       debug_cond(SROM_DLEVEL >= 2, " EEPROM value at %d is %5.5x.\n",
+                  location, retval);
 
        return retval;
 }
-#endif /* UPDATE_SROM || !CONFIG_TULIP_FIX_DAVICOM */
 
-/* This executes a generic EEPROM command, typically a write or write
+/*
+ * This executes a generic EEPROM command, typically a write or write
  * enable. It returns the data output from the EEPROM, and thus may
  * also be used for reads.
  */
-#if defined(UPDATE_SROM) || !defined(CONFIG_TULIP_FIX_DAVICOM)
-static int do_eeprom_cmd(struct eth_device *dev, u_long ioaddr, int cmd, int cmd_len)
+static int do_eeprom_cmd(struct eth_device *dev, u_long ioaddr, int cmd,
+                        int cmd_len)
 {
-       unsigned retval = 0;
+       unsigned int retval = 0;
 
-#ifdef DEBUG_SROM
-       printf(" EEPROM op 0x%x: ", cmd);
-#endif
+       debug_cond(SROM_DLEVEL >= 1, " EEPROM op 0x%x: ", cmd);
 
-       sendto_srom(dev,SROM_RD | SROM_SR | DT_CS | DT_CLK, ioaddr);
+       sendto_srom(dev, SROM_RD | SROM_SR | DT_CS | DT_CLK, ioaddr);
 
        /* Shift the command bits out. */
        do {
-               short dataval = (cmd & (1 << cmd_len)) ? EE_WRITE_1 : EE_WRITE_0;
-               sendto_srom(dev,dataval, ioaddr);
+               short dataval = (cmd & BIT(cmd_len)) ? EE_WRITE_1 : EE_WRITE_0;
+
+               sendto_srom(dev, dataval, ioaddr);
                udelay(10);
 
-#ifdef DEBUG_SROM2
-               printf("%X", getfrom_srom(dev,ioaddr) & 15);
-#endif
+               debug_cond(SROM_DLEVEL >= 2, "%X",
+                          getfrom_srom(dev, ioaddr) & 15);
 
-               sendto_srom(dev,dataval | DT_CLK, ioaddr);
+               sendto_srom(dev, dataval | DT_CLK, ioaddr);
                udelay(10);
-               retval = (retval << 1) | ((getfrom_srom(dev,ioaddr) & EE_DATA_READ) ? 1 : 0);
+               retval = (retval << 1) |
+                        !!(getfrom_srom(dev, ioaddr) & EE_DATA_READ);
        } while (--cmd_len >= 0);
-       sendto_srom(dev,SROM_RD | SROM_SR | DT_CS, ioaddr);
+
+       sendto_srom(dev, SROM_RD | SROM_SR | DT_CS, ioaddr);
 
        /* Terminate the EEPROM access. */
-       sendto_srom(dev,SROM_RD | SROM_SR, ioaddr);
+       sendto_srom(dev, SROM_RD | SROM_SR, ioaddr);
 
-#ifdef DEBUG_SROM
-       printf(" EEPROM result is 0x%5.5x.\n", retval);
-#endif
+       debug_cond(SROM_DLEVEL >= 1, " EEPROM result is 0x%5.5x.\n", retval);
 
        return retval;
 }
-#endif /* UPDATE_SROM || !CONFIG_TULIP_FIX_DAVICOM */
 
-#ifndef CONFIG_TULIP_FIX_DAVICOM
 static int read_srom(struct eth_device *dev, u_long ioaddr, int index)
 {
-       int ee_addr_size = do_read_eeprom(dev, ioaddr, 0xff, 8) & 0x40000 ? 8 : 6;
+       int ee_addr_size;
 
-       return do_eeprom_cmd(dev, ioaddr,
-                            (((SROM_READ_CMD << ee_addr_size) | index) << 16)
-                            | 0xffff, 3 + ee_addr_size + 16);
+       ee_addr_size = (do_read_eeprom(dev, ioaddr, 0xff, 8) & BIT(18)) ? 8 : 6;
+
+       return do_eeprom_cmd(dev, ioaddr, 0xffff |
+                            (((SROM_READ_CMD << ee_addr_size) | index) << 16),
+                            3 + ee_addr_size + 16);
 }
-#endif /* CONFIG_TULIP_FIX_DAVICOM */
 
 #ifdef UPDATE_SROM
-static int write_srom(struct eth_device *dev, u_long ioaddr, int index, int new_value)
+static int write_srom(struct eth_device *dev, u_long ioaddr, int index,
+                     int new_value)
 {
-       int ee_addr_size = do_read_eeprom(dev, ioaddr, 0xff, 8) & 0x40000 ? 8 : 6;
-       int i;
        unsigned short newval;
+       int ee_addr_size;
+       int i;
 
-       udelay(10*1000); /* test-only */
+       ee_addr_size = (do_read_eeprom(dev, ioaddr, 0xff, 8) & BIT(18)) ? 8 : 6;
 
-#ifdef DEBUG_SROM
-       printf("ee_addr_size=%d.\n", ee_addr_size);
-       printf("Writing new entry 0x%4.4x to offset %d.\n", new_value, index);
-#endif
+       udelay(10 * 1000); /* test-only */
+
+       debug_cond(SROM_DLEVEL >= 1, "ee_addr_size=%d.\n", ee_addr_size);
+       debug_cond(SROM_DLEVEL >= 1,
+                  "Writing new entry 0x%4.4x to offset %d.\n",
+                  new_value, index);
 
        /* Enable programming modes. */
-       do_eeprom_cmd(dev, ioaddr, (0x4f << (ee_addr_size-4)), 3+ee_addr_size);
+       do_eeprom_cmd(dev, ioaddr, 0x4f << (ee_addr_size - 4),
+                     3 + ee_addr_size);
 
        /* Do the actual write. */
-       do_eeprom_cmd(dev, ioaddr,
-                     (((SROM_WRITE_CMD<<ee_addr_size)|index) << 16) | new_value,
+       do_eeprom_cmd(dev, ioaddr, new_value |
+                     (((SROM_WRITE_CMD << ee_addr_size) | index) << 16),
                      3 + ee_addr_size + 16);
 
        /* Poll for write finished. */
        sendto_srom(dev, SROM_RD | SROM_SR | DT_CS, ioaddr);
-       for (i = 0; i < 10000; i++)                     /* Typical 2000 ticks */
+       for (i = 0; i < 10000; i++) {   /* Typical 2000 ticks */
                if (getfrom_srom(dev, ioaddr) & EE_DATA_READ)
                        break;
+       }
 
-#ifdef DEBUG_SROM
-       printf(" Write finished after %d ticks.\n", i);
-#endif
+       debug_cond(SROM_DLEVEL >= 1, " Write finished after %d ticks.\n", i);
 
        /* Disable programming. */
-       do_eeprom_cmd(dev, ioaddr, (0x40 << (ee_addr_size-4)), 3 + ee_addr_size);
+       do_eeprom_cmd(dev, ioaddr, (0x40 << (ee_addr_size - 4)),
+                     3 + ee_addr_size);
 
        /* And read the result. */
        newval = do_eeprom_cmd(dev, ioaddr,
-                              (((SROM_READ_CMD<<ee_addr_size)|index) << 16)
+                              (((SROM_READ_CMD << ee_addr_size) | index) << 16)
                               | 0xffff, 3 + ee_addr_size + 16);
-#ifdef DEBUG_SROM
-       printf("  New value at offset %d is %4.4x.\n", index, newval);
-#endif
-       return 1;
-}
-#endif
-
-#ifndef CONFIG_TULIP_FIX_DAVICOM
-static void read_hw_addr(struct eth_device *dev, bd_t *bis)
-{
-       u_short tmp, *p = (u_short *)(&dev->enetaddr[0]);
-       int i, j = 0;
 
-       for (i = 0; i < (ETH_ALEN >> 1); i++) {
-               tmp = read_srom(dev, DE4X5_APROM, ((SROM_HWADD >> 1) + i));
-               *p = le16_to_cpu(tmp);
-               j += *p++;
-       }
+       debug_cond(SROM_DLEVEL >= 1, "  New value at offset %d is %4.4x.\n",
+                  index, newval);
 
-       if ((j == 0) || (j == 0x2fffd)) {
-               memset (dev->enetaddr, 0, ETH_ALEN);
-               debug ("Warning: can't read HW address from SROM.\n");
-               goto Done;
-       }
-
-       return;
-
-Done:
-#ifdef UPDATE_SROM
-       update_srom(dev, bis);
-#endif
-       return;
+       return 1;
 }
-#endif /* CONFIG_TULIP_FIX_DAVICOM */
 
-#ifdef UPDATE_SROM
 static void update_srom(struct eth_device *dev, bd_t *bis)
 {
-       int i;
        static unsigned short eeprom[0x40] = {
                0x140b, 0x6610, 0x0000, 0x0000, /* 00 */
                0x0000, 0x0000, 0x0000, 0x0000, /* 04 */
@@ -746,16 +339,318 @@ static void update_srom(struct eth_device *dev, bd_t *bis)
                0x0000, 0x0000, 0x0000, 0x4e07, /* 3c */
        };
        uchar enetaddr[6];
+       int i;
 
        /* Ethernet Addr... */
        if (!eth_env_get_enetaddr("ethaddr", enetaddr))
                return;
+
        eeprom[0x0a] = (enetaddr[1] << 8) | enetaddr[0];
        eeprom[0x0b] = (enetaddr[3] << 8) | enetaddr[2];
        eeprom[0x0c] = (enetaddr[5] << 8) | enetaddr[4];
 
-       for (i=0; i<0x40; i++) {
+       for (i = 0; i < 0x40; i++)
                write_srom(dev, DE4X5_APROM, i, eeprom[i]);
+}
+#endif /* UPDATE_SROM */
+
+static void send_setup_frame(struct eth_device *dev, bd_t *bis)
+{
+       char setup_frame[SETUP_FRAME_LEN];
+       char *pa = &setup_frame[0];
+       int i;
+
+       memset(pa, 0xff, SETUP_FRAME_LEN);
+
+       for (i = 0; i < ETH_ALEN; i++) {
+               *(pa + (i & 1)) = dev->enetaddr[i];
+               if (i & 0x01)
+                       pa += 4;
+       }
+
+       for (i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
+               if (i < TOUT_LOOP)
+                       continue;
+
+               printf("%s: tx error buffer not ready\n", dev->name);
+               return;
+       }
+
+       tx_ring[tx_new].buf = cpu_to_le32(phys_to_bus((u32)&setup_frame[0]));
+       tx_ring[tx_new].des1 = cpu_to_le32(TD_TER | TD_SET | SETUP_FRAME_LEN);
+       tx_ring[tx_new].status = cpu_to_le32(T_OWN);
+
+       dc2114x_outl(dev, POLL_DEMAND, DE4X5_TPD);
+
+       for (i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
+               if (i < TOUT_LOOP)
+                       continue;
+
+               printf("%s: tx buffer not ready\n", dev->name);
+               return;
+       }
+
+       if (le32_to_cpu(tx_ring[tx_new].status) != 0x7FFFFFFF) {
+               printf("TX error status2 = 0x%08X\n",
+                      le32_to_cpu(tx_ring[tx_new].status));
+       }
+
+       tx_new = (tx_new + 1) % NUM_TX_DESC;
+}
+
+static int dc21x4x_send(struct eth_device *dev, void *packet, int length)
+{
+       int status = -1;
+       int i;
+
+       if (length <= 0) {
+               printf("%s: bad packet size: %d\n", dev->name, length);
+               goto done;
+       }
+
+       for (i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
+               if (i < TOUT_LOOP)
+                       continue;
+
+               printf("%s: tx error buffer not ready\n", dev->name);
+               goto done;
+       }
+
+       tx_ring[tx_new].buf = cpu_to_le32(phys_to_bus((u32)packet));
+       tx_ring[tx_new].des1 = cpu_to_le32(TD_TER | TD_LS | TD_FS | length);
+       tx_ring[tx_new].status = cpu_to_le32(T_OWN);
+
+       dc2114x_outl(dev, POLL_DEMAND, DE4X5_TPD);
+
+       for (i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
+               if (i < TOUT_LOOP)
+                       continue;
+
+               printf(".%s: tx buffer not ready\n", dev->name);
+               goto done;
+       }
+
+       if (le32_to_cpu(tx_ring[tx_new].status) & TD_ES) {
+               tx_ring[tx_new].status = 0x0;
+               goto done;
+       }
+
+       status = length;
+
+done:
+       tx_new = (tx_new + 1) % NUM_TX_DESC;
+       return status;
+}
+
+static int dc21x4x_recv(struct eth_device *dev)
+{
+       int length = 0;
+       u32 status;
+
+       while (true) {
+               status = le32_to_cpu(rx_ring[rx_new].status);
+
+               if (status & R_OWN)
+                       break;
+
+               if (status & RD_LS) {
+                       /* Valid frame status. */
+                       if (status & RD_ES) {
+                               /* There was an error. */
+                               printf("RX error status = 0x%08X\n", status);
+                       } else {
+                               /* A valid frame received. */
+                               length = (le32_to_cpu(rx_ring[rx_new].status)
+                                         >> 16);
+
+                               /* Pass the packet up to the protocol layers */
+                               net_process_received_packet
+                                       (net_rx_packets[rx_new], length - 4);
+                       }
+
+                       /*
+                        * Change buffer ownership for this frame,
+                        * back to the adapter.
+                        */
+                       rx_ring[rx_new].status = cpu_to_le32(R_OWN);
+               }
+
+               /* Update entry information. */
+               rx_new = (rx_new + 1) % rx_ring_size;
+       }
+
+       return length;
+}
+
+static int dc21x4x_init(struct eth_device *dev, bd_t *bis)
+{
+       int i;
+       int devbusfn = (int)dev->priv;
+
+       /* Ensure we're not sleeping. */
+       pci_write_config_byte(devbusfn, PCI_CFDA_PSM, WAKEUP);
+
+       reset_de4x5(dev);
+
+       if (dc2114x_inl(dev, DE4X5_STS) & (STS_TS | STS_RS)) {
+               printf("Error: Cannot reset ethernet controller.\n");
+               return -1;
+       }
+
+       dc2114x_outl(dev, OMR_SDP | OMR_PS | OMR_PM, DE4X5_OMR);
+
+       for (i = 0; i < NUM_RX_DESC; i++) {
+               rx_ring[i].status = cpu_to_le32(R_OWN);
+               rx_ring[i].des1 = cpu_to_le32(RX_BUFF_SZ);
+               rx_ring[i].buf =
+                       cpu_to_le32(phys_to_bus((u32)net_rx_packets[i]));
+               rx_ring[i].next = 0;
+       }
+
+       for (i = 0; i < NUM_TX_DESC; i++) {
+               tx_ring[i].status = 0;
+               tx_ring[i].des1 = 0;
+               tx_ring[i].buf = 0;
+               tx_ring[i].next = 0;
        }
+
+       rx_ring_size = NUM_RX_DESC;
+       tx_ring_size = NUM_TX_DESC;
+
+       /* Write the end of list marker to the descriptor lists. */
+       rx_ring[rx_ring_size - 1].des1 |= cpu_to_le32(RD_RER);
+       tx_ring[tx_ring_size - 1].des1 |= cpu_to_le32(TD_TER);
+
+       /* Tell the adapter where the TX/RX rings are located. */
+       dc2114x_outl(dev, phys_to_bus((u32)&rx_ring), DE4X5_RRBA);
+       dc2114x_outl(dev, phys_to_bus((u32)&tx_ring), DE4X5_TRBA);
+
+       start_de4x5(dev);
+
+       tx_new = 0;
+       rx_new = 0;
+
+       send_setup_frame(dev, bis);
+
+       return 0;
+}
+
+static void dc21x4x_halt(struct eth_device *dev)
+{
+       int devbusfn = (int)dev->priv;
+
+       stop_de4x5(dev);
+       dc2114x_outl(dev, 0, DE4X5_SICR);
+
+       pci_write_config_byte(devbusfn, PCI_CFDA_PSM, SLEEP);
+}
+
+static void read_hw_addr(struct eth_device *dev, bd_t *bis)
+{
+       u_short tmp, *p = (u_short *)(&dev->enetaddr[0]);
+       int i, j = 0;
+
+       for (i = 0; i < (ETH_ALEN >> 1); i++) {
+               tmp = read_srom(dev, DE4X5_APROM, (SROM_HWADD >> 1) + i);
+               *p = le16_to_cpu(tmp);
+               j += *p++;
+       }
+
+       if (!j || j == 0x2fffd) {
+               memset(dev->enetaddr, 0, ETH_ALEN);
+               debug("Warning: can't read HW address from SROM.\n");
+#ifdef UPDATE_SROM
+               update_srom(dev, bis);
+#endif
+       }
+}
+
+static struct pci_device_id supported[] = {
+       { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST },
+       { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21142 },
+       { }
+};
+
+int dc21x4x_initialize(bd_t *bis)
+{
+       struct eth_device *dev;
+       unsigned short status;
+       unsigned char timer;
+       unsigned int iobase;
+       int card_number = 0;
+       pci_dev_t devbusfn;
+       unsigned int cfrv;
+       int idx = 0;
+
+       while (1) {
+               devbusfn = pci_find_devices(supported, idx++);
+               if (devbusfn == -1)
+                       break;
+
+               /* Get the chip configuration revision register. */
+               pci_read_config_dword(devbusfn, PCI_REVISION_ID, &cfrv);
+
+               if ((cfrv & CFRV_RN) < DC2114x_BRK) {
+                       printf("Error: The chip is not DC21143.\n");
+                       continue;
+               }
+
+               pci_read_config_word(devbusfn, PCI_COMMAND, &status);
+               status |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
+               pci_write_config_word(devbusfn, PCI_COMMAND, status);
+
+               pci_read_config_word(devbusfn, PCI_COMMAND, &status);
+               if (!(status & PCI_COMMAND_MEMORY)) {
+                       printf("Error: Can not enable MEMORY access.\n");
+                       continue;
+               }
+
+               if (!(status & PCI_COMMAND_MASTER)) {
+                       printf("Error: Can not enable Bus Mastering.\n");
+                       continue;
+               }
+
+               /* Check the latency timer for values >= 0x60. */
+               pci_read_config_byte(devbusfn, PCI_LATENCY_TIMER, &timer);
+
+               if (timer < 0x60) {
+                       pci_write_config_byte(devbusfn, PCI_LATENCY_TIMER,
+                                             0x60);
+               }
+
+               /* read BAR for memory space access */
+               pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_1, &iobase);
+               iobase &= PCI_BASE_ADDRESS_MEM_MASK;
+               debug("dc21x4x: DEC 21142 PCI Device @0x%x\n", iobase);
+
+               dev = (struct eth_device *)malloc(sizeof(*dev));
+               if (!dev) {
+                       printf("Can not allocalte memory of dc21x4x\n");
+                       break;
+               }
+
+               memset(dev, 0, sizeof(*dev));
+
+               sprintf(dev->name, "dc21x4x#%d", card_number);
+
+               dev->iobase = pci_mem_to_phys(devbusfn, iobase);
+               dev->priv = (void *)devbusfn;
+               dev->init = dc21x4x_init;
+               dev->halt = dc21x4x_halt;
+               dev->send = dc21x4x_send;
+               dev->recv = dc21x4x_recv;
+
+               /* Ensure we're not sleeping. */
+               pci_write_config_byte(devbusfn, PCI_CFDA_PSM, WAKEUP);
+
+               udelay(10 * 1000);
+
+               read_hw_addr(dev, bis);
+
+               eth_register(dev);
+
+               card_number++;
+       }
+
+       return card_number;
 }
-#endif /* UPDATE_SROM */
index 63f2086dece4a726f72abb830c9bab06cdb8f2d6..60dfd17a74d31d55c9f4a4bd3d1f687d970ed3f9 100644 (file)
@@ -1288,9 +1288,9 @@ static int eqos_start(struct udevice *dev)
                struct eqos_desc *rx_desc = &(eqos->rx_descs[i]);
                rx_desc->des0 = (u32)(ulong)(eqos->rx_dma_buf +
                                             (i * EQOS_MAX_PACKET_SIZE));
-               rx_desc->des3 |= EQOS_DESC3_OWN | EQOS_DESC3_BUF1V;
+               rx_desc->des3 = EQOS_DESC3_OWN | EQOS_DESC3_BUF1V;
+               eqos->config->ops->eqos_flush_desc(rx_desc);
        }
-       eqos->config->ops->eqos_flush_desc(eqos->descs);
 
        writel(0, &eqos->dma_regs->ch0_txdesc_list_haddress);
        writel((ulong)eqos->tx_descs, &eqos->dma_regs->ch0_txdesc_list_address);
@@ -1419,7 +1419,8 @@ static int eqos_send(struct udevice *dev, void *packet, int length)
        tx_desc->des3 = EQOS_DESC3_OWN | EQOS_DESC3_FD | EQOS_DESC3_LD | length;
        eqos->config->ops->eqos_flush_desc(tx_desc);
 
-       writel((ulong)(tx_desc + 1), &eqos->dma_regs->ch0_txdesc_tail_pointer);
+       writel((ulong)(&(eqos->tx_descs[eqos->tx_desc_idx])),
+               &eqos->dma_regs->ch0_txdesc_tail_pointer);
 
        for (i = 0; i < 1000000; i++) {
                eqos->config->ops->eqos_inval_desc(tx_desc);
@@ -1442,6 +1443,7 @@ static int eqos_recv(struct udevice *dev, int flags, uchar **packetp)
        debug("%s(dev=%p, flags=%x):\n", __func__, dev, flags);
 
        rx_desc = &(eqos->rx_descs[eqos->rx_desc_idx]);
+       eqos->config->ops->eqos_inval_desc(rx_desc);
        if (rx_desc->des3 & EQOS_DESC3_OWN) {
                debug("%s: RX packet not available\n", __func__);
                return -EAGAIN;
@@ -1474,6 +1476,11 @@ static int eqos_free_pkt(struct udevice *dev, uchar *packet, int length)
        }
 
        rx_desc = &(eqos->rx_descs[eqos->rx_desc_idx]);
+
+       rx_desc->des0 = 0;
+       mb();
+       eqos->config->ops->eqos_flush_desc(rx_desc);
+       eqos->config->ops->eqos_inval_buffer(packet, length);
        rx_desc->des0 = (u32)(ulong)packet;
        rx_desc->des1 = 0;
        rx_desc->des2 = 0;
@@ -1482,7 +1489,7 @@ static int eqos_free_pkt(struct udevice *dev, uchar *packet, int length)
         * writes to the rest of the descriptor too.
         */
        mb();
-       rx_desc->des3 |= EQOS_DESC3_OWN | EQOS_DESC3_BUF1V;
+       rx_desc->des3 = EQOS_DESC3_OWN | EQOS_DESC3_BUF1V;
        eqos->config->ops->eqos_flush_desc(rx_desc);
 
        writel((ulong)rx_desc, &eqos->dma_regs->ch0_rxdesc_tail_pointer);
@@ -1536,6 +1543,9 @@ static int eqos_probe_resources_core(struct udevice *dev)
        }
        debug("%s: rx_pkt=%p\n", __func__, eqos->rx_pkt);
 
+       eqos->config->ops->eqos_inval_buffer(eqos->rx_dma_buf,
+                       EQOS_MAX_PACKET_SIZE * EQOS_DESCRIPTORS_RX);
+
        debug("%s: OK\n", __func__);
        return 0;
 
index b4ad11d3fa583262c080662c5cebf8ccab88c01a..f97e7f8c6a38e3e9668f3ae10fb8df485d0e859c 100644 (file)
 #define PCNET_DEBUG2(fmt,args...)      \
        debug_cond(PCNET_DEBUG_LEVEL > 1, fmt ,##args)
 
-#if !defined(CONF_PCNET_79C973) && defined(CONF_PCNET_79C975)
-#error "Macro for PCnet chip version is not defined!"
-#endif
-
 /*
  * Set the number of Tx and Rx buffers, using Log_2(# buffers).
  * Reasonable default values are 4 Tx buffers, and 16 Rx buffers.
@@ -95,37 +91,49 @@ static pcnet_priv_t *lp;
 
 static u16 pcnet_read_csr(struct eth_device *dev, int index)
 {
-       outw(index, dev->iobase + PCNET_RAP);
-       return inw(dev->iobase + PCNET_RDP);
+       void __iomem *base = (void __iomem *)dev->iobase;
+
+       writew(index, base + PCNET_RAP);
+       return readw(base + PCNET_RDP);
 }
 
 static void pcnet_write_csr(struct eth_device *dev, int index, u16 val)
 {
-       outw(index, dev->iobase + PCNET_RAP);
-       outw(val, dev->iobase + PCNET_RDP);
+       void __iomem *base = (void __iomem *)dev->iobase;
+
+       writew(index, base + PCNET_RAP);
+       writew(val, base + PCNET_RDP);
 }
 
 static u16 pcnet_read_bcr(struct eth_device *dev, int index)
 {
-       outw(index, dev->iobase + PCNET_RAP);
-       return inw(dev->iobase + PCNET_BDP);
+       void __iomem *base = (void __iomem *)dev->iobase;
+
+       writew(index, base + PCNET_RAP);
+       return readw(base + PCNET_BDP);
 }
 
 static void pcnet_write_bcr(struct eth_device *dev, int index, u16 val)
 {
-       outw(index, dev->iobase + PCNET_RAP);
-       outw(val, dev->iobase + PCNET_BDP);
+       void __iomem *base = (void __iomem *)dev->iobase;
+
+       writew(index, base + PCNET_RAP);
+       writew(val, base + PCNET_BDP);
 }
 
 static void pcnet_reset(struct eth_device *dev)
 {
-       inw(dev->iobase + PCNET_RESET);
+       void __iomem *base = (void __iomem *)dev->iobase;
+
+       readw(base + PCNET_RESET);
 }
 
 static int pcnet_check(struct eth_device *dev)
 {
-       outw(88, dev->iobase + PCNET_RAP);
-       return inw(dev->iobase + PCNET_RAP) == 88;
+       void __iomem *base = (void __iomem *)dev->iobase;
+
+       writew(88, base + PCNET_RAP);
+       return readw(base + PCNET_RAP) == 88;
 }
 
 static int pcnet_init (struct eth_device *dev, bd_t * bis);
@@ -183,14 +191,14 @@ int pcnet_initialize(bd_t *bis)
                /*
                 * Setup the PCI device.
                 */
-               pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, &bar);
-               dev->iobase = pci_io_to_phys(devbusfn, bar);
+               pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_1, &bar);
+               dev->iobase = pci_mem_to_phys(devbusfn, bar);
                dev->iobase &= ~0xf;
 
                PCNET_DEBUG1("%s: devbusfn=0x%x iobase=0x%lx: ",
                             dev->name, devbusfn, (unsigned long)dev->iobase);
 
-               command = PCI_COMMAND_IO | PCI_COMMAND_MASTER;
+               command = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER;
                pci_write_config_word(devbusfn, PCI_COMMAND, command);
                pci_read_config_word(devbusfn, PCI_COMMAND, &status);
                if ((status & command) != command) {
@@ -254,16 +262,12 @@ static int pcnet_probe(struct eth_device *dev, bd_t *bis, int dev_nr)
        case 0x2621:
                chipname = "PCnet/PCI II 79C970A";      /* PCI */
                break;
-#ifdef CONFIG_PCNET_79C973
        case 0x2625:
                chipname = "PCnet/FAST III 79C973";     /* PCI */
                break;
-#endif
-#ifdef CONFIG_PCNET_79C975
        case 0x2627:
                chipname = "PCnet/FAST III 79C975";     /* PCI */
                break;
-#endif
        default:
                printf("%s: PCnet version %#x not supported\n",
                       dev->name, chip_version);
@@ -340,7 +344,9 @@ static int pcnet_init(struct eth_device *dev, bd_t *bis)
                addr = (unsigned long)memalign(ARCH_DMA_MINALIGN,
                                               sizeof(*lp->uc));
                flush_dcache_range(addr, addr + sizeof(*lp->uc));
-               addr = UNCACHED_SDRAM(addr);
+               addr = (unsigned long)map_physmem(addr,
+                               roundup(sizeof(*lp->uc), ARCH_DMA_MINALIGN),
+                               MAP_NOCACHE);
                lp->uc = (struct pcnet_uncached_priv *)addr;
 
                addr = (unsigned long)memalign(ARCH_DMA_MINALIGN,
index 3783d155e79cf8dd753fc94de8f7e9d10150464a..47ff9f8d44c079cefe98557f9d459b96adc2e452 100644 (file)
  *
  * Copyright 2011, 2013 Freescale Semiconductor, Inc.
  * author Andy Fleming
+ * Copyright (c) 2019 Michael Walle <michael@walle.cc>
  */
 #include <common.h>
 #include <phy.h>
+#include <dm/device_compat.h>
+#include <linux/bitfield.h>
+#include <dt-bindings/net/qca-ar803x.h>
 
 #define AR803x_PHY_DEBUG_ADDR_REG      0x1d
 #define AR803x_PHY_DEBUG_DATA_REG      0x1e
 
+/* Debug registers */
+#define AR803x_DEBUG_REG_0             0x0
+#define AR803x_RGMII_RX_CLK_DLY                BIT(15)
+
 #define AR803x_DEBUG_REG_5             0x5
-#define AR803x_RGMII_TX_CLK_DLY                0x100
+#define AR803x_RGMII_TX_CLK_DLY                BIT(8)
 
-#define AR803x_DEBUG_REG_0             0x0
-#define AR803x_RGMII_RX_CLK_DLY                0x8000
+#define AR803x_DEBUG_REG_1F            0x1f
+#define AR803x_PLL_ON                  BIT(2)
+#define AR803x_RGMII_1V8               BIT(3)
+
+/* CLK_25M register is at MMD 7, address 0x8016 */
+#define AR803x_CLK_25M_SEL_REG         0x8016
+
+#define AR803x_CLK_25M_MASK            GENMASK(4, 2)
+#define AR803x_CLK_25M_25MHZ_XTAL      0
+#define AR803x_CLK_25M_25MHZ_DSP       1
+#define AR803x_CLK_25M_50MHZ_PLL       2
+#define AR803x_CLK_25M_50MHZ_DSP       3
+#define AR803x_CLK_25M_62_5MHZ_PLL     4
+#define AR803x_CLK_25M_62_5MHZ_DSP     5
+#define AR803x_CLK_25M_125MHZ_PLL      6
+#define AR803x_CLK_25M_125MHZ_DSP      7
+#define AR8035_CLK_25M_MASK            GENMASK(4, 3)
+
+#define AR803x_CLK_25M_DR_MASK         GENMASK(8, 7)
+#define AR803x_CLK_25M_DR_FULL         0
+#define AR803x_CLK_25M_DR_HALF         1
+#define AR803x_CLK_25M_DR_QUARTER      2
+
+#define AR8021_PHY_ID 0x004dd040
+#define AR8031_PHY_ID 0x004dd074
+#define AR8035_PHY_ID 0x004dd072
+
+struct ar803x_priv {
+       int flags;
+#define AR803x_FLAG_KEEP_PLL_ENABLED   BIT(0) /* don't turn off internal PLL */
+#define AR803x_FLAG_RGMII_1V8          BIT(1) /* use 1.8V RGMII I/O voltage */
+       u16 clk_25m_reg;
+       u16 clk_25m_mask;
+};
+
+static int ar803x_debug_reg_read(struct phy_device *phydev, u16 reg)
+{
+       int ret;
+
+       ret = phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_ADDR_REG,
+                       reg);
+       if (ret < 0)
+               return ret;
+
+       return phy_read(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_DATA_REG);
+}
+
+static int ar803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
+                                u16 clear, u16 set)
+{
+       int val;
+
+       val = ar803x_debug_reg_read(phydev, reg);
+       if (val < 0)
+               return val;
+
+       val &= 0xffff;
+       val &= ~clear;
+       val |= set;
+
+       return phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_DATA_REG,
+                        val);
+}
+
+static int ar803x_enable_rx_delay(struct phy_device *phydev, bool on)
+{
+       u16 clear = 0, set = 0;
+
+       if (on)
+               set = AR803x_RGMII_RX_CLK_DLY;
+       else
+               clear = AR803x_RGMII_RX_CLK_DLY;
+
+       return ar803x_debug_reg_mask(phydev, AR803x_DEBUG_REG_0, clear, set);
+}
+
+static int ar803x_enable_tx_delay(struct phy_device *phydev, bool on)
+{
+       u16 clear = 0, set = 0;
+
+       if (on)
+               set = AR803x_RGMII_TX_CLK_DLY;
+       else
+               clear = AR803x_RGMII_TX_CLK_DLY;
+
+       return ar803x_debug_reg_mask(phydev, AR803x_DEBUG_REG_5, clear, set);
+}
 
 static int ar8021_config(struct phy_device *phydev)
 {
-       phy_write(phydev, MDIO_DEVAD_NONE, 0x00, 0x1200);
-       phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05);
-       phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x3D47);
+       phy_write(phydev, MDIO_DEVAD_NONE, MII_BMCR,
+                 BMCR_ANENABLE | BMCR_ANRESTART);
+
+       ar803x_enable_tx_delay(phydev, true);
 
        phydev->supported = phydev->drv->features;
        return 0;
 }
 
-static int ar8031_config(struct phy_device *phydev)
+static int ar803x_delay_config(struct phy_device *phydev)
 {
+       int ret;
+
        if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
-           phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
-               phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_ADDR_REG,
-                         AR803x_DEBUG_REG_5);
-               phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_DATA_REG,
-                         AR803x_RGMII_TX_CLK_DLY);
-       }
+           phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+               ret = ar803x_enable_tx_delay(phydev, true);
+       else
+               ret = ar803x_enable_tx_delay(phydev, false);
 
        if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
-           phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
-               phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_ADDR_REG,
-                         AR803x_DEBUG_REG_0);
-               phy_write(phydev, MDIO_DEVAD_NONE, AR803x_PHY_DEBUG_DATA_REG,
-                         AR803x_RGMII_RX_CLK_DLY);
-       }
+           phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+               ret = ar803x_enable_rx_delay(phydev, true);
+       else
+               ret = ar803x_enable_rx_delay(phydev, false);
 
-       phydev->supported = phydev->drv->features;
+       return ret;
+}
 
-       genphy_config_aneg(phydev);
-       genphy_restart_aneg(phydev);
+static int ar803x_regs_config(struct phy_device *phydev)
+{
+       struct ar803x_priv *priv = phydev->priv;
+       u16 set = 0, clear = 0;
+       int val;
+       int ret;
+
+       /* no configuration available */
+       if (!priv)
+               return 0;
+
+       /*
+        * Only supported on the AR8031, AR8035 has strappings for the PLL mode
+        * as well as the RGMII voltage.
+        */
+       if (phydev->drv->uid == AR8031_PHY_ID) {
+               if (priv->flags & AR803x_FLAG_KEEP_PLL_ENABLED)
+                       set |= AR803x_PLL_ON;
+               else
+                       clear |= AR803x_PLL_ON;
+
+               if (priv->flags & AR803x_FLAG_RGMII_1V8)
+                       set |= AR803x_RGMII_1V8;
+               else
+                       clear |= AR803x_RGMII_1V8;
+
+               ret = ar803x_debug_reg_mask(phydev, AR803x_DEBUG_REG_1F, clear,
+                                           set);
+               if (ret < 0)
+                       return ret;
+       }
+
+       /* save the write access if the mask is empty */
+       if (priv->clk_25m_mask) {
+               val = phy_read_mmd(phydev, MDIO_MMD_AN, AR803x_CLK_25M_SEL_REG);
+               if (val < 0)
+                       return val;
+               val &= ~priv->clk_25m_mask;
+               val |= priv->clk_25m_reg;
+               ret = phy_write_mmd(phydev, MDIO_MMD_AN,
+                                   AR803x_CLK_25M_SEL_REG, val);
+               if (ret < 0)
+                       return ret;
+       }
 
        return 0;
 }
 
-static int ar8035_config(struct phy_device *phydev)
+static int ar803x_of_init(struct phy_device *phydev)
 {
-       int regval;
-
-       phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x0007);
-       phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016);
-       phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007);
-       regval = phy_read(phydev, MDIO_DEVAD_NONE, 0xe);
-       phy_write(phydev, MDIO_DEVAD_NONE, 0xe, (regval|0x0018));
-
-       phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05);
-       regval = phy_read(phydev, MDIO_DEVAD_NONE, 0x1e);
-       phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, (regval|0x0100));
-
-       if ((phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
-               /* select debug reg 5 */
-               phy_write(phydev, MDIO_DEVAD_NONE, 0x1D, 0x5);
-               /* enable tx delay */
-               phy_write(phydev, MDIO_DEVAD_NONE, 0x1E, 0x0100);
+#if defined(CONFIG_DM_ETH)
+       struct ar803x_priv *priv;
+       ofnode node, vddio_reg_node;
+       u32 strength, freq, min_uV, max_uV;
+       int sel;
+
+       node = phy_get_ofnode(phydev);
+       if (!ofnode_valid(node))
+               return -EINVAL;
+
+       priv = malloc(sizeof(*priv));
+       if (!priv)
+               return -ENOMEM;
+       memset(priv, 0, sizeof(*priv));
+
+       phydev->priv = priv;
+
+       debug("%s: found PHY node: %s\n", __func__, ofnode_get_name(node));
+
+       if (ofnode_read_bool(node, "qca,keep-pll-enabled"))
+               priv->flags |= AR803x_FLAG_KEEP_PLL_ENABLED;
+
+       /*
+        * We can't use the regulator framework because the regulator is
+        * a subnode of the PHY. So just read the two properties we are
+        * interested in.
+        */
+       vddio_reg_node = ofnode_find_subnode(node, "vddio-regulator");
+       if (ofnode_valid(vddio_reg_node)) {
+               min_uV = ofnode_read_u32_default(vddio_reg_node,
+                                                "regulator-min-microvolt", 0);
+               max_uV = ofnode_read_u32_default(vddio_reg_node,
+                                                "regulator-max-microvolt", 0);
+
+               if (min_uV != max_uV) {
+                       free(priv);
+                       return -EINVAL;
+               }
+
+               switch (min_uV) {
+               case 1500000:
+                       break;
+               case 1800000:
+                       priv->flags |= AR803x_FLAG_RGMII_1V8;
+                       break;
+               default:
+                       free(priv);
+                       return -EINVAL;
+               }
+       }
+
+       /*
+        * Get the CLK_25M frequency from the device tree. Only XTAL and PLL
+        * sources are supported right now. There is also the possibilty to use
+        * the DSP as frequency reference, this is used for synchronous
+        * ethernet.
+        */
+       if (!ofnode_read_u32(node, "qca,clk-out-frequency", &freq)) {
+               switch (freq) {
+               case 25000000:
+                       sel = AR803x_CLK_25M_25MHZ_XTAL;
+                       break;
+               case 50000000:
+                       sel = AR803x_CLK_25M_50MHZ_PLL;
+                       break;
+               case 62500000:
+                       sel = AR803x_CLK_25M_62_5MHZ_PLL;
+                       break;
+               case 125000000:
+                       sel = AR803x_CLK_25M_125MHZ_PLL;
+                       break;
+               default:
+                       dev_err(phydev->dev,
+                               "invalid qca,clk-out-frequency\n");
+                       free(priv);
+                       return -EINVAL;
+               }
+
+               priv->clk_25m_mask |= AR803x_CLK_25M_MASK;
+               priv->clk_25m_reg |= FIELD_PREP(AR803x_CLK_25M_MASK, sel);
+               /*
+                * Fixup for the AR8035 which only has two bits. The two
+                * remaining bits map to the same frequencies.
+                */
+               if (phydev->drv->uid == AR8035_PHY_ID) {
+                       u16 clear = AR803x_CLK_25M_MASK & AR8035_CLK_25M_MASK;
+
+                       priv->clk_25m_mask &= ~clear;
+                       priv->clk_25m_reg &= ~clear;
+               }
        }
 
-       if ((phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
-           (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)) {
-               /* select debug reg 0 */
-               phy_write(phydev, MDIO_DEVAD_NONE, 0x1D, 0x0);
-               /* enable rx delay */
-               phy_write(phydev, MDIO_DEVAD_NONE, 0x1E, 0x8000);
+       if (phydev->drv->uid == AR8031_PHY_ID &&
+           !ofnode_read_u32(node, "qca,clk-out-strength", &strength)) {
+               switch (strength) {
+               case AR803X_STRENGTH_FULL:
+                       sel = AR803x_CLK_25M_DR_FULL;
+                       break;
+               case AR803X_STRENGTH_HALF:
+                       sel = AR803x_CLK_25M_DR_HALF;
+                       break;
+               case AR803X_STRENGTH_QUARTER:
+                       sel = AR803x_CLK_25M_DR_QUARTER;
+                       break;
+               default:
+                       dev_err(phydev->dev,
+                               "invalid qca,clk-out-strength\n");
+                       free(priv);
+                       return -EINVAL;
+               }
+               priv->clk_25m_mask |= AR803x_CLK_25M_DR_MASK;
+               priv->clk_25m_reg |= FIELD_PREP(AR803x_CLK_25M_DR_MASK, sel);
        }
 
+       debug("%s: flags=%x clk_25m_reg=%04x clk_25m_mask=%04x\n", __func__,
+             priv->flags, priv->clk_25m_reg, priv->clk_25m_mask);
+#endif
+
+       return 0;
+}
+
+static int ar803x_config(struct phy_device *phydev)
+{
+       int ret;
+
+       ret = ar803x_of_init(phydev);
+       if (ret < 0)
+               return ret;
+
+       ret = ar803x_delay_config(phydev);
+       if (ret < 0)
+               return ret;
+
+       ret = ar803x_regs_config(phydev);
+       if (ret < 0)
+               return ret;
+
        phydev->supported = phydev->drv->features;
 
        genphy_config_aneg(phydev);
@@ -93,8 +337,8 @@ static int ar8035_config(struct phy_device *phydev)
 
 static struct phy_driver AR8021_driver =  {
        .name = "AR8021",
-       .uid = 0x4dd040,
-       .mask = 0x4ffff0,
+       .uid = AR8021_PHY_ID,
+       .mask = 0xfffffff0,
        .features = PHY_GBIT_FEATURES,
        .config = ar8021_config,
        .startup = genphy_startup,
@@ -103,20 +347,20 @@ static struct phy_driver AR8021_driver =  {
 
 static struct phy_driver AR8031_driver =  {
        .name = "AR8031/AR8033",
-       .uid = 0x4dd074,
+       .uid = AR8031_PHY_ID,
        .mask = 0xffffffef,
        .features = PHY_GBIT_FEATURES,
-       .config = ar8031_config,
+       .config = ar803x_config,
        .startup = genphy_startup,
        .shutdown = genphy_shutdown,
 };
 
 static struct phy_driver AR8035_driver =  {
        .name = "AR8035",
-       .uid = 0x4dd072,
+       .uid = AR8035_PHY_ID,
        .mask = 0xffffffef,
        .features = PHY_GBIT_FEATURES,
-       .config = ar8035_config,
+       .config = ar803x_config,
        .startup = genphy_startup,
        .shutdown = genphy_shutdown,
 };
index bb59629f81cb737f13520ad9708f8f58c7aca37e..1f083972917780bbf986b44c9c6eb92fdeb206d4 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * rtl8139.c : U-Boot driver for the RealTek RTL8139
  *
@@ -8,71 +9,68 @@
  */
 
 /* rtl8139.c - etherboot driver for the Realtek 8139 chipset
-
-  ported from the linux driver written by Donald Becker
-  by Rainer Bawidamann (Rainer.Bawidamann@informatik.uni-ulm.de) 1999
-
-  This software may be used and distributed according to the terms
-  of the GNU Public License, incorporated herein by reference.
-
-  changes to the original driver:
-  - removed support for interrupts, switching to polling mode (yuck!)
-  - removed support for the 8129 chip (external MII)
-
-*/
+ *
+ * ported from the linux driver written by Donald Becker
+ * by Rainer Bawidamann (Rainer.Bawidamann@informatik.uni-ulm.de) 1999
+ *
+ * changes to the original driver:
+ * - removed support for interrupts, switching to polling mode (yuck!)
+ * - removed support for the 8129 chip (external MII)
+ */
 
 /*********************************************************************/
 /* Revision History                                                 */
 /*********************************************************************/
 
 /*
 28 Dec 2002  ken_yap@users.sourceforge.net (Ken Yap)
-     Put in virt_to_bus calls to allow Etherboot relocation.
-
 06 Apr 2001  ken_yap@users.sourceforge.net (Ken Yap)
-     Following email from Hyun-Joon Cha, added a disable routine, otherwise
-     NIC remains live and can crash the kernel later.
-
 4 Feb 2000   espenlaub@informatik.uni-ulm.de (Klaus Espenlaub)
-     Shuffled things around, removed the leftovers from the 8129 support
-     that was in the Linux driver and added a bit more 8139 definitions.
-     Moved the 8K receive buffer to a fixed, available address outside the
    0x98000-0x9ffff range.  This is a bit of a hack, but currently the only
-     way to make room for the Etherboot features that need substantial amounts
    of code like the ANSI console support.  Currently the buffer is just below
-     0x10000, so this even conforms to the tagged boot image specification,
    which reserves the ranges 0x00000-0x10000 and 0x98000-0xA0000.  My
-     interpretation of this "reserved" is that Etherboot may do whatever it
-     likes, as long as its environment is kept intact (like the BIOS
    variables).  Hopefully fixed rtl_poll() once and for all. The symptoms
-     were that if Etherboot was left at the boot menu for several minutes, the
    first eth_poll failed.  Seems like I am the only person who does this.
-     First of all I fixed the debugging code and then set out for a long bug
    hunting session.  It took me about a week full time work - poking around
-     various places in the driver, reading Don Becker's and Jeff Garzik's Linux
-     driver and even the FreeBSD driver (what a piece of crap!) - and
-     eventually spotted the nasty thing: the transmit routine was acknowledging
-     each and every interrupt pending, including the RxOverrun and RxFIFIOver
    interrupts.  This confused the RTL8139 thoroughly.         It destroyed the
-     Rx ring contents by dumping the 2K FIFO contents right where we wanted to
    get the next packet.  Oh well, what fun.
-
 18 Jan 2000  mdc@thinguin.org (Marty Connor)
    Drastically simplified error handling.  Basically, if any error
-     in transmission or reception occurs, the card is reset.
-     Also, pointed all transmit descriptors to the same buffer to
    save buffer space.         This should decrease driver size and avoid
-     corruption because of exceeding 32K during runtime.
-
 28 Jul 1999  (Matthias Meixner - meixner@rbg.informatik.tu-darmstadt.de)
    rtl_poll was quite broken: it used the RxOK interrupt flag instead
-     of the RxBufferEmpty flag which often resulted in very bad
-     transmission performace - below 1kBytes/s.
-
-*/
* 28 Dec 2002 ken_yap@users.sourceforge.net (Ken Yap)
*    Put in virt_to_bus calls to allow Etherboot relocation.
+ *
* 06 Apr 2001 ken_yap@users.sourceforge.net (Ken Yap)
*    Following email from Hyun-Joon Cha, added a disable routine, otherwise
*    NIC remains live and can crash the kernel later.
+ *
* 4 Feb 2000 espenlaub@informatik.uni-ulm.de (Klaus Espenlaub)
*    Shuffled things around, removed the leftovers from the 8129 support
*    that was in the Linux driver and added a bit more 8139 definitions.
*    Moved the 8K receive buffer to a fixed, available address outside the
*    0x98000-0x9ffff range. This is a bit of a hack, but currently the only
*    way to make room for the Etherboot features that need substantial amounts
*    of code like the ANSI console support. Currently the buffer is just below
*    0x10000, so this even conforms to the tagged boot image specification,
*    which reserves the ranges 0x00000-0x10000 and 0x98000-0xA0000. My
*    interpretation of this "reserved" is that Etherboot may do whatever it
*    likes, as long as its environment is kept intact (like the BIOS
*    variables). Hopefully fixed rtl8139_recv() once and for all. The symptoms
*    were that if Etherboot was left at the boot menu for several minutes, the
*    first eth_poll failed. Seems like I am the only person who does this.
*    First of all I fixed the debugging code and then set out for a long bug
*    hunting session. It took me about a week full time work - poking around
*    various places in the driver, reading Don Becker's and Jeff Garzik's Linux
*    driver and even the FreeBSD driver (what a piece of crap!) - and
*    eventually spotted the nasty thing: the transmit routine was acknowledging
*    each and every interrupt pending, including the RxOverrun and RxFIFIOver
*    interrupts. This confused the RTL8139 thoroughly. It destroyed the
*    Rx ring contents by dumping the 2K FIFO contents right where we wanted to
*    get the next packet. Oh well, what fun.
+ *
* 18 Jan 2000 mdc@thinguin.org (Marty Connor)
*    Drastically simplified error handling. Basically, if any error
*    in transmission or reception occurs, the card is reset.
*    Also, pointed all transmit descriptors to the same buffer to
*    save buffer space. This should decrease driver size and avoid
*    corruption because of exceeding 32K during runtime.
+ *
* 28 Jul 1999 (Matthias Meixner - meixner@rbg.informatik.tu-darmstadt.de)
*    rtl8139_recv was quite broken: it used the RxOK interrupt flag instead
*    of the RxBufferEmpty flag which often resulted in very bad
*    transmission performace - below 1kBytes/s.
+ *
+ */
 
 #include <common.h>
 #include <cpu_func.h>
+#include <linux/types.h>
 #include <malloc.h>
 #include <net.h>
 #include <netdev.h>
@@ -81,8 +79,8 @@
 
 #define RTL_TIMEOUT    100000
 
-/* PCI Tuning Parameters
-   Threshold is bytes transferred to chip before transmission starts. */
+/* PCI Tuning Parameters */
+/* Threshold is bytes transferred to chip before transmission starts. */
 #define TX_FIFO_THRESH 256     /* In bytes, rounded down to 32 byte units. */
 #define RX_FIFO_THRESH 4       /* Rx buffer level before first PCI xfer.  */
 #define RX_DMA_BURST   4       /* Maximum PCI burst, '4' is 256 bytes */
 #define phys_to_bus(a) pci_phys_to_mem((pci_dev_t)dev->priv, a)
 
 /* Symbolic offsets to registers. */
-enum RTL8139_registers {
-       MAC0=0,                 /* Ethernet hardware address. */
-       MAR0=8,                 /* Multicast filter. */
-       TxStatus0=0x10,         /* Transmit status (four 32bit registers). */
-       TxAddr0=0x20,           /* Tx descriptors (also four 32bit). */
-       RxBuf=0x30, RxEarlyCnt=0x34, RxEarlyStatus=0x36,
-       ChipCmd=0x37, RxBufPtr=0x38, RxBufAddr=0x3A,
-       IntrMask=0x3C, IntrStatus=0x3E,
-       TxConfig=0x40, RxConfig=0x44,
-       Timer=0x48,             /* general-purpose counter. */
-       RxMissed=0x4C,          /* 24 bits valid, write clears. */
-       Cfg9346=0x50, Config0=0x51, Config1=0x52,
-       TimerIntrReg=0x54,      /* intr if gp counter reaches this value */
-       MediaStatus=0x58,
-       Config3=0x59,
-       MultiIntr=0x5C,
-       RevisionID=0x5E,        /* revision of the RTL8139 chip */
-       TxSummary=0x60,
-       MII_BMCR=0x62, MII_BMSR=0x64, NWayAdvert=0x66, NWayLPAR=0x68,
-       NWayExpansion=0x6A,
-       DisconnectCnt=0x6C, FalseCarrierCnt=0x6E,
-       NWayTestReg=0x70,
-       RxCnt=0x72,             /* packet received counter */
-       CSCR=0x74,              /* chip status and configuration register */
-       PhyParm1=0x78,TwisterParm=0x7c,PhyParm2=0x80,   /* undocumented */
-       /* from 0x84 onwards are a number of power management/wakeup frame
-        * definitions we will probably never need to know about.  */
-};
-
-enum ChipCmdBits {
-       CmdReset=0x10, CmdRxEnb=0x08, CmdTxEnb=0x04, RxBufEmpty=0x01, };
-
-/* Interrupt register bits, using my own meaningful names. */
-enum IntrStatusBits {
-       PCIErr=0x8000, PCSTimeout=0x4000, CableLenChange= 0x2000,
-       RxFIFOOver=0x40, RxUnderrun=0x20, RxOverflow=0x10,
-       TxErr=0x08, TxOK=0x04, RxErr=0x02, RxOK=0x01,
-};
-enum TxStatusBits {
-       TxHostOwns=0x2000, TxUnderrun=0x4000, TxStatOK=0x8000,
-       TxOutOfWindow=0x20000000, TxAborted=0x40000000,
-       TxCarrierLost=0x80000000,
-};
-enum RxStatusBits {
-       RxMulticast=0x8000, RxPhysical=0x4000, RxBroadcast=0x2000,
-       RxBadSymbol=0x0020, RxRunt=0x0010, RxTooLong=0x0008, RxCRCErr=0x0004,
-       RxBadAlign=0x0002, RxStatusOK=0x0001,
-};
-
-enum MediaStatusBits {
-       MSRTxFlowEnable=0x80, MSRRxFlowEnable=0x40, MSRSpeed10=0x08,
-       MSRLinkFail=0x04, MSRRxPauseFlag=0x02, MSRTxPauseFlag=0x01,
-};
-
-enum MIIBMCRBits {
-       BMCRReset=0x8000, BMCRSpeed100=0x2000, BMCRNWayEnable=0x1000,
-       BMCRRestartNWay=0x0200, BMCRDuplex=0x0100,
-};
-
-enum CSCRBits {
-       CSCR_LinkOKBit=0x0400, CSCR_LinkChangeBit=0x0800,
-       CSCR_LinkStatusBits=0x0f000, CSCR_LinkDownOffCmd=0x003c0,
-       CSCR_LinkDownCmd=0x0f3c0,
-};
-
-/* Bits in RxConfig. */
-enum rx_mode_bits {
-       RxCfgWrap=0x80,
-       AcceptErr=0x20, AcceptRunt=0x10, AcceptBroadcast=0x08,
-       AcceptMulticast=0x04, AcceptMyPhys=0x02, AcceptAllPhys=0x01,
-};
+/* Ethernet hardware address. */
+#define RTL_REG_MAC0                           0x00
+/* Multicast filter. */
+#define RTL_REG_MAR0                           0x08
+/* Transmit status (four 32bit registers). */
+#define RTL_REG_TXSTATUS0                      0x10
+/* Tx descriptors (also four 32bit). */
+#define RTL_REG_TXADDR0                                0x20
+#define RTL_REG_RXBUF                          0x30
+#define RTL_REG_RXEARLYCNT                     0x34
+#define RTL_REG_RXEARLYSTATUS                  0x36
+#define RTL_REG_CHIPCMD                                0x37
+#define RTL_REG_CHIPCMD_CMDRESET               BIT(4)
+#define RTL_REG_CHIPCMD_CMDRXENB               BIT(3)
+#define RTL_REG_CHIPCMD_CMDTXENB               BIT(2)
+#define RTL_REG_CHIPCMD_RXBUFEMPTY             BIT(0)
+#define RTL_REG_RXBUFPTR                       0x38
+#define RTL_REG_RXBUFADDR                      0x3A
+#define RTL_REG_INTRMASK                       0x3C
+#define RTL_REG_INTRSTATUS                     0x3E
+#define RTL_REG_INTRSTATUS_PCIERR              BIT(15)
+#define RTL_REG_INTRSTATUS_PCSTIMEOUT          BIT(14)
+#define RTL_REG_INTRSTATUS_CABLELENCHANGE      BIT(13)
+#define RTL_REG_INTRSTATUS_RXFIFOOVER          BIT(6)
+#define RTL_REG_INTRSTATUS_RXUNDERRUN          BIT(5)
+#define RTL_REG_INTRSTATUS_RXOVERFLOW          BIT(4)
+#define RTL_REG_INTRSTATUS_TXERR               BIT(3)
+#define RTL_REG_INTRSTATUS_TXOK                        BIT(2)
+#define RTL_REG_INTRSTATUS_RXERR               BIT(1)
+#define RTL_REG_INTRSTATUS_RXOK                        BIT(0)
+#define RTL_REG_TXCONFIG                       0x40
+#define RTL_REG_RXCONFIG                       0x44
+#define RTL_REG_RXCONFIG_RXCFGWRAP             BIT(7)
+#define RTL_REG_RXCONFIG_ACCEPTERR             BIT(5)
+#define RTL_REG_RXCONFIG_ACCEPTRUNT            BIT(4)
+#define RTL_REG_RXCONFIG_ACCEPTBROADCAST       BIT(3)
+#define RTL_REG_RXCONFIG_ACCEPTMULTICAST       BIT(2)
+#define RTL_REG_RXCONFIG_ACCEPTMYPHYS          BIT(1)
+#define RTL_REG_RXCONFIG_ACCEPTALLPHYS         BIT(0)
+/* general-purpose counter. */
+#define RTL_REG_TIMER                          0x48
+/* 24 bits valid, write clears. */
+#define RTL_REG_RXMISSED                       0x4C
+#define RTL_REG_CFG9346                                0x50
+#define RTL_REG_CONFIG0                                0x51
+#define RTL_REG_CONFIG1                                0x52
+/* intr if gp counter reaches this value */
+#define RTL_REG_TIMERINTRREG                   0x54
+#define RTL_REG_MEDIASTATUS                    0x58
+#define RTL_REG_MEDIASTATUS_MSRTXFLOWENABLE    BIT(7)
+#define RTL_REG_MEDIASTATUS_MSRRXFLOWENABLE    BIT(6)
+#define RTL_REG_MEDIASTATUS_MSRSPEED10         BIT(3)
+#define RTL_REG_MEDIASTATUS_MSRLINKFAIL                BIT(2)
+#define RTL_REG_MEDIASTATUS_MSRRXPAUSEFLAG     BIT(1)
+#define RTL_REG_MEDIASTATUS_MSRTXPAUSEFLAG     BIT(0)
+#define RTL_REG_CONFIG3                                0x59
+#define RTL_REG_MULTIINTR                      0x5C
+/* revision of the RTL8139 chip */
+#define RTL_REG_REVISIONID                     0x5E
+#define RTL_REG_TXSUMMARY                      0x60
+#define RTL_REG_MII_BMCR                       0x62
+#define RTL_REG_MII_BMSR                       0x64
+#define RTL_REG_NWAYADVERT                     0x66
+#define RTL_REG_NWAYLPAR                       0x68
+#define RTL_REG_NWAYEXPANSION                  0x6A
+#define RTL_REG_DISCONNECTCNT                  0x6C
+#define RTL_REG_FALSECARRIERCNT                        0x6E
+#define RTL_REG_NWAYTESTREG                    0x70
+/* packet received counter */
+#define RTL_REG_RXCNT                          0x72
+/* chip status and configuration register */
+#define RTL_REG_CSCR                           0x74
+#define RTL_REG_PHYPARM1                       0x78
+#define RTL_REG_TWISTERPARM                    0x7c
+/* undocumented */
+#define RTL_REG_PHYPARM2                       0x80
+/*
+ * from 0x84 onwards are a number of power management/wakeup frame
+ * definitions we will probably never need to know about.
+ */
 
+#define RTL_STS_RXMULTICAST                    BIT(15)
+#define RTL_STS_RXPHYSICAL                     BIT(14)
+#define RTL_STS_RXBROADCAST                    BIT(13)
+#define RTL_STS_RXBADSYMBOL                    BIT(5)
+#define RTL_STS_RXRUNT                         BIT(4)
+#define RTL_STS_RXTOOLONG                      BIT(3)
+#define RTL_STS_RXCRCERR                       BIT(2)
+#define RTL_STS_RXBADALIGN                     BIT(1)
+#define RTL_STS_RXSTATUSOK                     BIT(0)
+
+static unsigned int cur_rx, cur_tx;
 static int ioaddr;
-static unsigned int cur_rx,cur_tx;
 
 /* The RTL8139 can only transmit from a contiguous, aligned memory block.  */
-static unsigned char tx_buffer[TX_BUF_SIZE] __attribute__((aligned(4)));
-static unsigned char rx_ring[RX_BUF_LEN+16] __attribute__((aligned(4)));
-
-static int rtl8139_probe(struct eth_device *dev, bd_t *bis);
-static int read_eeprom(int location, int addr_len);
-static void rtl_reset(struct eth_device *dev);
-static int rtl_transmit(struct eth_device *dev, void *packet, int length);
-static int rtl_poll(struct eth_device *dev);
-static void rtl_disable(struct eth_device *dev);
-static int rtl_bcast_addr(struct eth_device *dev, const u8 *bcast_mac, int join)
-{
-       return (0);
-}
-
-static struct pci_device_id supported[] = {
-       {PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139},
-       {PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_8139},
-       {}
-};
-
-int rtl8139_initialize(bd_t *bis)
-{
-       pci_dev_t devno;
-       int card_number = 0;
-       struct eth_device *dev;
-       u32 iobase;
-       int idx=0;
-
-       while(1){
-               /* Find RTL8139 */
-               if ((devno = pci_find_devices(supported, idx++)) < 0)
-                       break;
-
-               pci_read_config_dword(devno, PCI_BASE_ADDRESS_1, &iobase);
-               iobase &= ~0xf;
-
-               debug ("rtl8139: REALTEK RTL8139 @0x%x\n", iobase);
-
-               dev = (struct eth_device *)malloc(sizeof *dev);
-               if (!dev) {
-                       printf("Can not allocate memory of rtl8139\n");
-                       break;
-               }
-               memset(dev, 0, sizeof(*dev));
-
-               sprintf (dev->name, "RTL8139#%d", card_number);
-
-               dev->priv = (void *) devno;
-               dev->iobase = (int)bus_to_phys(iobase);
-               dev->init = rtl8139_probe;
-               dev->halt = rtl_disable;
-               dev->send = rtl_transmit;
-               dev->recv = rtl_poll;
-               dev->mcast = rtl_bcast_addr;
-
-               eth_register (dev);
-
-               card_number++;
-
-               pci_write_config_byte (devno, PCI_LATENCY_TIMER, 0x20);
-
-               udelay (10 * 1000);
-       }
-
-       return card_number;
-}
-
-static int rtl8139_probe(struct eth_device *dev, bd_t *bis)
-{
-       int i;
-       int addr_len;
-       unsigned short *ap = (unsigned short *)dev->enetaddr;
-
-       ioaddr = dev->iobase;
-
-       /* Bring the chip out of low-power mode. */
-       outb(0x00, ioaddr + Config1);
-
-       addr_len = read_eeprom(0,8) == 0x8129 ? 8 : 6;
-       for (i = 0; i < 3; i++)
-               *ap++ = le16_to_cpu (read_eeprom(i + 7, addr_len));
-
-       rtl_reset(dev);
-
-       if (inb(ioaddr + MediaStatus) & MSRLinkFail) {
-               printf("Cable not connected or other link failure\n");
-               return -1 ;
-       }
-
-       return 0;
-}
+static unsigned char tx_buffer[TX_BUF_SIZE] __aligned(4);
+static unsigned char rx_ring[RX_BUF_LEN + 16] __aligned(4);
 
 /* Serial EEPROM section. */
 
@@ -278,51 +206,57 @@ static int rtl8139_probe(struct eth_device *dev, bd_t *bis)
 #define EE_DATA_READ   0x01    /* EEPROM chip data out. */
 #define EE_ENB         (0x80 | EE_CS)
 
-/*
-       Delay between EEPROM clock transitions.
-       No extra delay is needed with 33MHz PCI, but 66MHz may change this.
-*/
-
-#define eeprom_delay() inl(ee_addr)
-
 /* The EEPROM commands include the alway-set leading bit. */
-#define EE_WRITE_CMD   (5)
-#define EE_READ_CMD    (6)
-#define EE_ERASE_CMD   (7)
+#define EE_WRITE_CMD   5
+#define EE_READ_CMD    6
+#define EE_ERASE_CMD   7
 
-static int read_eeprom(int location, int addr_len)
+static void rtl8139_eeprom_delay(uintptr_t regbase)
 {
-       int i;
+       /*
+        * Delay between EEPROM clock transitions.
+        * No extra delay is needed with 33MHz PCI, but 66MHz may change this.
+        */
+       inl(regbase + RTL_REG_CFG9346);
+}
+
+static int rtl8139_read_eeprom(unsigned int location, unsigned int addr_len)
+{
+       unsigned int read_cmd = location | (EE_READ_CMD << addr_len);
+       uintptr_t ee_addr = ioaddr + RTL_REG_CFG9346;
        unsigned int retval = 0;
-       long ee_addr = ioaddr + Cfg9346;
-       int read_cmd = location | (EE_READ_CMD << addr_len);
+       u8 dataval;
+       int i;
 
        outb(EE_ENB & ~EE_CS, ee_addr);
        outb(EE_ENB, ee_addr);
-       eeprom_delay();
+       rtl8139_eeprom_delay(ioaddr);
 
        /* Shift the read command bits out. */
        for (i = 4 + addr_len; i >= 0; i--) {
-               int dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
+               dataval = (read_cmd & BIT(i)) ? EE_DATA_WRITE : 0;
                outb(EE_ENB | dataval, ee_addr);
-               eeprom_delay();
+               rtl8139_eeprom_delay(ioaddr);
                outb(EE_ENB | dataval | EE_SHIFT_CLK, ee_addr);
-               eeprom_delay();
+               rtl8139_eeprom_delay(ioaddr);
        }
+
        outb(EE_ENB, ee_addr);
-       eeprom_delay();
+       rtl8139_eeprom_delay(ioaddr);
 
        for (i = 16; i > 0; i--) {
                outb(EE_ENB | EE_SHIFT_CLK, ee_addr);
-               eeprom_delay();
-               retval = (retval << 1) | ((inb(ee_addr) & EE_DATA_READ) ? 1 : 0);
+               rtl8139_eeprom_delay(ioaddr);
+               retval <<= 1;
+               retval |= inb(ee_addr) & EE_DATA_READ;
                outb(EE_ENB, ee_addr);
-               eeprom_delay();
+               rtl8139_eeprom_delay(ioaddr);
        }
 
        /* Terminate the EEPROM access. */
        outb(~EE_CS, ee_addr);
-       eeprom_delay();
+       rtl8139_eeprom_delay(ioaddr);
+
        return retval;
 }
 
@@ -331,149 +265,174 @@ static const unsigned int rtl8139_rx_config =
        (RX_FIFO_THRESH << 13) |
        (RX_DMA_BURST << 8);
 
-static void set_rx_mode(struct eth_device *dev) {
-       unsigned int mc_filter[2];
-       int rx_mode;
+static void rtl8139_set_rx_mode(struct eth_device *dev)
+{
        /* !IFF_PROMISC */
-       rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
-       mc_filter[1] = mc_filter[0] = 0xffffffff;
+       unsigned int rx_mode = RTL_REG_RXCONFIG_ACCEPTBROADCAST |
+                              RTL_REG_RXCONFIG_ACCEPTMULTICAST |
+                              RTL_REG_RXCONFIG_ACCEPTMYPHYS;
 
-       outl(rtl8139_rx_config | rx_mode, ioaddr + RxConfig);
+       outl(rtl8139_rx_config | rx_mode, ioaddr + RTL_REG_RXCONFIG);
 
-       outl(mc_filter[0], ioaddr + MAR0 + 0);
-       outl(mc_filter[1], ioaddr + MAR0 + 4);
+       outl(0xffffffff, ioaddr + RTL_REG_MAR0 + 0);
+       outl(0xffffffff, ioaddr + RTL_REG_MAR0 + 4);
 }
 
-static void rtl_reset(struct eth_device *dev)
+static void rtl8139_hw_reset(struct eth_device *dev)
 {
+       u8 reg;
        int i;
 
-       outb(CmdReset, ioaddr + ChipCmd);
-
-       cur_rx = 0;
-       cur_tx = 0;
+       outb(RTL_REG_CHIPCMD_CMDRESET, ioaddr + RTL_REG_CHIPCMD);
 
        /* Give the chip 10ms to finish the reset. */
-       for (i=0; i<100; ++i){
-               if ((inb(ioaddr + ChipCmd) & CmdReset) == 0) break;
-               udelay (100); /* wait 100us */
+       for (i = 0; i < 100; i++) {
+               reg = inb(ioaddr + RTL_REG_CHIPCMD);
+               if (!(reg & RTL_REG_CHIPCMD_CMDRESET))
+                       break;
+
+               udelay(100);
        }
+}
+
+static void rtl8139_reset(struct eth_device *dev)
+{
+       int i;
+
+       cur_rx = 0;
+       cur_tx = 0;
 
+       rtl8139_hw_reset(dev);
 
        for (i = 0; i < ETH_ALEN; i++)
-               outb(dev->enetaddr[i], ioaddr + MAC0 + i);
+               outb(dev->enetaddr[i], ioaddr + RTL_REG_MAC0 + i);
 
        /* Must enable Tx/Rx before setting transfer thresholds! */
-       outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd);
-       outl((RX_FIFO_THRESH<<13) | (RX_BUF_LEN_IDX<<11) | (RX_DMA_BURST<<8),
-               ioaddr + RxConfig);             /* accept no frames yet!  */
-       outl((TX_DMA_BURST<<8)|0x03000000, ioaddr + TxConfig);
-
-       /* The Linux driver changes Config1 here to use a different LED pattern
-        * for half duplex or full/autodetect duplex (for full/autodetect, the
-        * outputs are TX/RX, Link10/100, FULL, while for half duplex it uses
-        * TX/RX, Link100, Link10).  This is messy, because it doesn't match
-        * the inscription on the mounting bracket.  It should not be changed
-        * from the configuration EEPROM default, because the card manufacturer
-        * should have set that to match the card.  */
-
-       debug_cond(DEBUG_RX,
-               "rx ring address is %lX\n",(unsigned long)rx_ring);
-       flush_cache((unsigned long)rx_ring, RX_BUF_LEN);
-       outl(phys_to_bus((int)rx_ring), ioaddr + RxBuf);
+       outb(RTL_REG_CHIPCMD_CMDRXENB | RTL_REG_CHIPCMD_CMDTXENB,
+            ioaddr + RTL_REG_CHIPCMD);
+
+       /* accept no frames yet! */
+       outl(rtl8139_rx_config, ioaddr + RTL_REG_RXCONFIG);
+       outl((TX_DMA_BURST << 8) | 0x03000000, ioaddr + RTL_REG_TXCONFIG);
+
+       /*
+        * The Linux driver changes RTL_REG_CONFIG1 here to use a different
+        * LED pattern for half duplex or full/autodetect duplex (for
+        * full/autodetect, the outputs are TX/RX, Link10/100, FULL, while
+        * for half duplex it uses TX/RX, Link100, Link10).  This is messy,
+        * because it doesn't match the inscription on the mounting bracket.
+        * It should not be changed from the configuration EEPROM default,
+        * because the card manufacturer should have set that to match the
+        * card.
+        */
+       debug_cond(DEBUG_RX, "rx ring address is %p\n", rx_ring);
 
-       /* If we add multicast support, the MAR0 register would have to be
-        * initialized to 0xffffffffffffffff (two 32 bit accesses).  Etherboot
-        * only needs broadcast (for ARP/RARP/BOOTP/DHCP) and unicast.  */
+       flush_cache((unsigned long)rx_ring, RX_BUF_LEN);
+       outl(phys_to_bus((int)rx_ring), ioaddr + RTL_REG_RXBUF);
 
-       outb(CmdRxEnb | CmdTxEnb, ioaddr + ChipCmd);
+       /*
+        * If we add multicast support, the RTL_REG_MAR0 register would have
+        * to be initialized to 0xffffffffffffffff (two 32 bit accesses).
+        * Etherboot only needs broadcast (for ARP/RARP/BOOTP/DHCP) and
+        * unicast.
+        */
+       outb(RTL_REG_CHIPCMD_CMDRXENB | RTL_REG_CHIPCMD_CMDTXENB,
+            ioaddr + RTL_REG_CHIPCMD);
 
-       outl(rtl8139_rx_config, ioaddr + RxConfig);
+       outl(rtl8139_rx_config, ioaddr + RTL_REG_RXCONFIG);
 
        /* Start the chip's Tx and Rx process. */
-       outl(0, ioaddr + RxMissed);
+       outl(0, ioaddr + RTL_REG_RXMISSED);
 
-       /* set_rx_mode */
-       set_rx_mode(dev);
+       rtl8139_set_rx_mode(dev);
 
        /* Disable all known interrupts by setting the interrupt mask. */
-       outw(0, ioaddr + IntrMask);
+       outw(0, ioaddr + RTL_REG_INTRMASK);
 }
 
-static int rtl_transmit(struct eth_device *dev, void *packet, int length)
+static int rtl8139_send(struct eth_device *dev, void *packet, int length)
 {
-       unsigned int status;
-       unsigned long txstatus;
        unsigned int len = length;
+       unsigned long txstatus;
+       unsigned int status;
        int i = 0;
 
        ioaddr = dev->iobase;
 
-       memcpy((char *)tx_buffer, (char *)packet, (int)length);
+       memcpy(tx_buffer, packet, length);
 
        debug_cond(DEBUG_TX, "sending %d bytes\n", len);
 
-       /* Note: RTL8139 doesn't auto-pad, send minimum payload (another 4
-        * bytes are sent automatically for the FCS, totalling to 64 bytes). */
-       while (len < ETH_ZLEN) {
+       /*
+        * Note: RTL8139 doesn't auto-pad, send minimum payload (another 4
+        * bytes are sent automatically for the FCS, totalling to 64 bytes).
+        */
+       while (len < ETH_ZLEN)
                tx_buffer[len++] = '\0';
-       }
 
        flush_cache((unsigned long)tx_buffer, length);
-       outl(phys_to_bus((int)tx_buffer), ioaddr + TxAddr0 + cur_tx*4);
-       outl(((TX_FIFO_THRESH<<11) & 0x003f0000) | len,
-               ioaddr + TxStatus0 + cur_tx*4);
+       outl(phys_to_bus((unsigned long)tx_buffer),
+            ioaddr + RTL_REG_TXADDR0 + cur_tx * 4);
+       outl(((TX_FIFO_THRESH << 11) & 0x003f0000) | len,
+            ioaddr + RTL_REG_TXSTATUS0 + cur_tx * 4);
 
        do {
-               status = inw(ioaddr + IntrStatus);
-               /* Only acknlowledge interrupt sources we can properly handle
-                * here - the RxOverflow/RxFIFOOver MUST be handled in the
-                * rtl_poll() function.  */
-               outw(status & (TxOK | TxErr | PCIErr), ioaddr + IntrStatus);
-               if ((status & (TxOK | TxErr | PCIErr)) != 0) break;
+               status = inw(ioaddr + RTL_REG_INTRSTATUS);
+               /*
+                * Only acknlowledge interrupt sources we can properly
+                * handle here - the RTL_REG_INTRSTATUS_RXOVERFLOW/
+                * RTL_REG_INTRSTATUS_RXFIFOOVER MUST be handled in the
+                * rtl8139_recv() function.
+                */
+               status &= RTL_REG_INTRSTATUS_TXOK | RTL_REG_INTRSTATUS_TXERR |
+                         RTL_REG_INTRSTATUS_PCIERR;
+               outw(status, ioaddr + RTL_REG_INTRSTATUS);
+               if (status)
+                       break;
+
                udelay(10);
        } while (i++ < RTL_TIMEOUT);
 
-       txstatus = inl(ioaddr + TxStatus0 + cur_tx*4);
-
-       if (status & TxOK) {
-               cur_tx = (cur_tx + 1) % NUM_TX_DESC;
+       txstatus = inl(ioaddr + RTL_REG_TXSTATUS0 + cur_tx * 4);
 
+       if (!(status & RTL_REG_INTRSTATUS_TXOK)) {
                debug_cond(DEBUG_TX,
-                       "tx done, status %hX txstatus %lX\n",
-                       status, txstatus);
+                          "tx timeout/error (%d usecs), status %hX txstatus %lX\n",
+                          10 * i, status, txstatus);
 
-               return length;
-       } else {
-
-               debug_cond(DEBUG_TX,
-                       "tx timeout/error (%d usecs), status %hX txstatus %lX\n",
-                       10*i, status, txstatus);
-
-               rtl_reset(dev);
+               rtl8139_reset(dev);
 
                return 0;
        }
+
+       cur_tx = (cur_tx + 1) % NUM_TX_DESC;
+
+       debug_cond(DEBUG_TX, "tx done, status %hX txstatus %lX\n",
+                  status, txstatus);
+
+       return length;
 }
 
-static int rtl_poll(struct eth_device *dev)
+static int rtl8139_recv(struct eth_device *dev)
 {
-       unsigned int status;
-       unsigned int ring_offs;
+       const unsigned int rxstat = RTL_REG_INTRSTATUS_RXFIFOOVER |
+                                   RTL_REG_INTRSTATUS_RXOVERFLOW |
+                                   RTL_REG_INTRSTATUS_RXOK;
        unsigned int rx_size, rx_status;
-       int length=0;
+       unsigned int ring_offs;
+       unsigned int status;
+       int length = 0;
 
        ioaddr = dev->iobase;
 
-       if (inb(ioaddr + ChipCmd) & RxBufEmpty) {
+       if (inb(ioaddr + RTL_REG_CHIPCMD) & RTL_REG_CHIPCMD_RXBUFEMPTY)
                return 0;
-       }
 
-       status = inw(ioaddr + IntrStatus);
+       status = inw(ioaddr + RTL_REG_INTRSTATUS);
        /* See below for the rest of the interrupt acknowledges.  */
-       outw(status & ~(RxFIFOOver | RxOverflow | RxOK), ioaddr + IntrStatus);
+       outw(status & ~rxstat, ioaddr + RTL_REG_INTRSTATUS);
 
-       debug_cond(DEBUG_RX, "rtl_poll: int %hX ", status);
+       debug_cond(DEBUG_RX, "%s: int %hX ", __func__, status);
 
        ring_offs = cur_rx % RX_BUF_LEN;
        /* ring_offs is guaranteed being 4-byte aligned */
@@ -481,52 +440,137 @@ static int rtl_poll(struct eth_device *dev)
        rx_size = rx_status >> 16;
        rx_status &= 0xffff;
 
-       if ((rx_status & (RxBadSymbol|RxRunt|RxTooLong|RxCRCErr|RxBadAlign)) ||
-           (rx_size < ETH_ZLEN) || (rx_size > ETH_FRAME_LEN + 4)) {
+       if ((rx_status & (RTL_STS_RXBADSYMBOL | RTL_STS_RXRUNT |
+                         RTL_STS_RXTOOLONG | RTL_STS_RXCRCERR |
+                         RTL_STS_RXBADALIGN)) ||
+           (rx_size < ETH_ZLEN) ||
+           (rx_size > ETH_FRAME_LEN + 4)) {
                printf("rx error %hX\n", rx_status);
-               rtl_reset(dev); /* this clears all interrupts still pending */
+               /* this clears all interrupts still pending */
+               rtl8139_reset(dev);
                return 0;
        }
 
        /* Received a good packet */
        length = rx_size - 4;   /* no one cares about the FCS */
-       if (ring_offs+4+rx_size-4 > RX_BUF_LEN) {
-               int semi_count = RX_BUF_LEN - ring_offs - 4;
+       if (ring_offs + 4 + rx_size - 4 > RX_BUF_LEN) {
                unsigned char rxdata[RX_BUF_LEN];
+               int semi_count = RX_BUF_LEN - ring_offs - 4;
 
                memcpy(rxdata, rx_ring + ring_offs + 4, semi_count);
-               memcpy(&(rxdata[semi_count]), rx_ring, rx_size-4-semi_count);
+               memcpy(&rxdata[semi_count], rx_ring,
+                      rx_size - 4 - semi_count);
 
                net_process_received_packet(rxdata, length);
                debug_cond(DEBUG_RX, "rx packet %d+%d bytes",
-                       semi_count, rx_size-4-semi_count);
+                          semi_count, rx_size - 4 - semi_count);
        } else {
                net_process_received_packet(rx_ring + ring_offs + 4, length);
-               debug_cond(DEBUG_RX, "rx packet %d bytes", rx_size-4);
+               debug_cond(DEBUG_RX, "rx packet %d bytes", rx_size - 4);
        }
        flush_cache((unsigned long)rx_ring, RX_BUF_LEN);
 
-       cur_rx = (cur_rx + rx_size + 4 + 3) & ~3;
-       outw(cur_rx - 16, ioaddr + RxBufPtr);
-       /* See RTL8139 Programming Guide V0.1 for the official handling of
-        * Rx overflow situations.  The document itself contains basically no
-        * usable information, except for a few exception handling rules.  */
-       outw(status & (RxFIFOOver | RxOverflow | RxOK), ioaddr + IntrStatus);
+       cur_rx = ROUND(cur_rx + rx_size + 4, 4);
+       outw(cur_rx - 16, ioaddr + RTL_REG_RXBUFPTR);
+       /*
+        * See RTL8139 Programming Guide V0.1 for the official handling of
+        * Rx overflow situations. The document itself contains basically
+        * no usable information, except for a few exception handling rules.
+        */
+       outw(status & rxstat, ioaddr + RTL_REG_INTRSTATUS);
+
        return length;
 }
 
-static void rtl_disable(struct eth_device *dev)
+static int rtl8139_init(struct eth_device *dev, bd_t *bis)
 {
-       int i;
+       unsigned short *ap = (unsigned short *)dev->enetaddr;
+       int addr_len, i;
+       u8 reg;
 
        ioaddr = dev->iobase;
 
-       /* reset the chip */
-       outb(CmdReset, ioaddr + ChipCmd);
+       /* Bring the chip out of low-power mode. */
+       outb(0x00, ioaddr + RTL_REG_CONFIG1);
 
-       /* Give the chip 10ms to finish the reset. */
-       for (i=0; i<100; ++i){
-               if ((inb(ioaddr + ChipCmd) & CmdReset) == 0) break;
-               udelay (100); /* wait 100us */
+       addr_len = rtl8139_read_eeprom(0, 8) == 0x8129 ? 8 : 6;
+       for (i = 0; i < 3; i++)
+               *ap++ = le16_to_cpu(rtl8139_read_eeprom(i + 7, addr_len));
+
+       rtl8139_reset(dev);
+
+       reg = inb(ioaddr + RTL_REG_MEDIASTATUS);
+       if (reg & RTL_REG_MEDIASTATUS_MSRLINKFAIL) {
+               printf("Cable not connected or other link failure\n");
+               return -1;
        }
+
+       return 0;
+}
+
+static void rtl8139_stop(struct eth_device *dev)
+{
+       ioaddr = dev->iobase;
+
+       rtl8139_hw_reset(dev);
+}
+
+static int rtl8139_bcast_addr(struct eth_device *dev, const u8 *bcast_mac,
+                             int join)
+{
+       return 0;
+}
+
+static struct pci_device_id supported[] = {
+       { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139 },
+       { PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_8139 },
+       { }
+};
+
+int rtl8139_initialize(bd_t *bis)
+{
+       struct eth_device *dev;
+       int card_number = 0;
+       pci_dev_t devno;
+       int idx = 0;
+       u32 iobase;
+
+       while (1) {
+               /* Find RTL8139 */
+               devno = pci_find_devices(supported, idx++);
+               if (devno < 0)
+                       break;
+
+               pci_read_config_dword(devno, PCI_BASE_ADDRESS_1, &iobase);
+               iobase &= ~0xf;
+
+               debug("rtl8139: REALTEK RTL8139 @0x%x\n", iobase);
+
+               dev = (struct eth_device *)malloc(sizeof(*dev));
+               if (!dev) {
+                       printf("Can not allocate memory of rtl8139\n");
+                       break;
+               }
+               memset(dev, 0, sizeof(*dev));
+
+               sprintf(dev->name, "RTL8139#%d", card_number);
+
+               dev->priv = (void *)devno;
+               dev->iobase = (int)bus_to_phys(iobase);
+               dev->init = rtl8139_init;
+               dev->halt = rtl8139_stop;
+               dev->send = rtl8139_send;
+               dev->recv = rtl8139_recv;
+               dev->mcast = rtl8139_bcast_addr;
+
+               eth_register(dev);
+
+               card_number++;
+
+               pci_write_config_byte(devno, PCI_LATENCY_TIMER, 0x20);
+
+               udelay(10 * 1000);
+       }
+
+       return card_number;
 }
index 257b0385c2a927dcde1465d7dad5476473086bc3..45ecd6a263382cb5c2a70dec92b6b8c455147887 100644 (file)
 #include <malloc.h>
 #include <net.h>
 #include <miiphy.h>
+#include <linux/io.h>
+#include <linux/types.h>
 
 #include "smc911x.h"
 
-u32 pkt_data_pull(struct eth_device *dev, u32 addr) \
-       __attribute__ ((weak, alias ("smc911x_reg_read")));
-void pkt_data_push(struct eth_device *dev, u32 addr, u32 val) \
-       __attribute__ ((weak, alias ("smc911x_reg_write")));
+struct chip_id {
+       u16 id;
+       char *name;
+};
 
-static void smc911x_handle_mac_address(struct eth_device *dev)
+struct smc911x_priv {
+#ifndef CONFIG_DM_ETH
+       struct eth_device       dev;
+#endif
+       phys_addr_t             iobase;
+       const struct chip_id    *chipid;
+       unsigned char           enetaddr[6];
+};
+
+static const struct chip_id chip_ids[] =  {
+       { CHIP_89218, "LAN89218" },
+       { CHIP_9115, "LAN9115" },
+       { CHIP_9116, "LAN9116" },
+       { CHIP_9117, "LAN9117" },
+       { CHIP_9118, "LAN9118" },
+       { CHIP_9211, "LAN9211" },
+       { CHIP_9215, "LAN9215" },
+       { CHIP_9216, "LAN9216" },
+       { CHIP_9217, "LAN9217" },
+       { CHIP_9218, "LAN9218" },
+       { CHIP_9220, "LAN9220" },
+       { CHIP_9221, "LAN9221" },
+       { 0, NULL },
+};
+
+#define DRIVERNAME "smc911x"
+
+#if defined (CONFIG_SMC911X_32_BIT) && \
+       defined (CONFIG_SMC911X_16_BIT)
+#error "SMC911X: Only one of CONFIG_SMC911X_32_BIT and \
+       CONFIG_SMC911X_16_BIT shall be set"
+#endif
+
+#if defined (CONFIG_SMC911X_32_BIT)
+static u32 smc911x_reg_read(struct smc911x_priv *priv, u32 offset)
+{
+       return readl(priv->iobase + offset);
+}
+
+static void smc911x_reg_write(struct smc911x_priv *priv, u32 offset, u32 val)
+{
+       writel(val, priv->iobase + offset);
+}
+#elif defined (CONFIG_SMC911X_16_BIT)
+static u32 smc911x_reg_read(struct smc911x_priv *priv, u32 offset)
+{
+       return (readw(priv->iobase + offset) & 0xffff) |
+              (readw(priv->iobase + offset + 2) << 16);
+}
+static void smc911x_reg_write(struct smc911x_priv *priv, u32 offset, u32 val)
+{
+       writew(val & 0xffff, priv->iobase + offset);
+       writew(val >> 16, priv->iobase + offset + 2);
+}
+#else
+#error "SMC911X: undefined bus width"
+#endif /* CONFIG_SMC911X_16_BIT */
+
+static u32 smc911x_get_mac_csr(struct smc911x_priv *priv, u8 reg)
+{
+       while (smc911x_reg_read(priv, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+       smc911x_reg_write(priv, MAC_CSR_CMD,
+                       MAC_CSR_CMD_CSR_BUSY | MAC_CSR_CMD_R_NOT_W | reg);
+       while (smc911x_reg_read(priv, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+
+       return smc911x_reg_read(priv, MAC_CSR_DATA);
+}
+
+static void smc911x_set_mac_csr(struct smc911x_priv *priv, u8 reg, u32 data)
+{
+       while (smc911x_reg_read(priv, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+       smc911x_reg_write(priv, MAC_CSR_DATA, data);
+       smc911x_reg_write(priv, MAC_CSR_CMD, MAC_CSR_CMD_CSR_BUSY | reg);
+       while (smc911x_reg_read(priv, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+}
+
+static int smc911x_detect_chip(struct smc911x_priv *priv)
+{
+       unsigned long val, i;
+
+       val = smc911x_reg_read(priv, BYTE_TEST);
+       if (val == 0xffffffff) {
+               /* Special case -- no chip present */
+               return -1;
+       } else if (val != 0x87654321) {
+               printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n", val);
+               return -1;
+       }
+
+       val = smc911x_reg_read(priv, ID_REV) >> 16;
+       for (i = 0; chip_ids[i].id != 0; i++) {
+               if (chip_ids[i].id == val) break;
+       }
+       if (!chip_ids[i].id) {
+               printf(DRIVERNAME ": Unknown chip ID %04lx\n", val);
+               return -1;
+       }
+
+       priv->chipid = &chip_ids[i];
+
+       return 0;
+}
+
+static void smc911x_reset(struct smc911x_priv *priv)
+{
+       int timeout;
+
+       /*
+        *  Take out of PM setting first
+        *  Device is already wake up if PMT_CTRL_READY bit is set
+        */
+       if ((smc911x_reg_read(priv, PMT_CTRL) & PMT_CTRL_READY) == 0) {
+               /* Write to the bytetest will take out of powerdown */
+               smc911x_reg_write(priv, BYTE_TEST, 0x0);
+
+               timeout = 10;
+
+               while (timeout-- &&
+                       !(smc911x_reg_read(priv, PMT_CTRL) & PMT_CTRL_READY))
+                       udelay(10);
+               if (timeout < 0) {
+                       printf(DRIVERNAME
+                               ": timeout waiting for PM restore\n");
+                       return;
+               }
+       }
+
+       /* Disable interrupts */
+       smc911x_reg_write(priv, INT_EN, 0);
+
+       smc911x_reg_write(priv, HW_CFG, HW_CFG_SRST);
+
+       timeout = 1000;
+       while (timeout-- && smc911x_reg_read(priv, E2P_CMD) & E2P_CMD_EPC_BUSY)
+               udelay(10);
+
+       if (timeout < 0) {
+               printf(DRIVERNAME ": reset timeout\n");
+               return;
+       }
+
+       /* Reset the FIFO level and flow control settings */
+       smc911x_set_mac_csr(priv, FLOW, FLOW_FCPT | FLOW_FCEN);
+       smc911x_reg_write(priv, AFC_CFG, 0x0050287F);
+
+       /* Set to LED outputs */
+       smc911x_reg_write(priv, GPIO_CFG, 0x70070000);
+}
+
+static void smc911x_handle_mac_address(struct smc911x_priv *priv)
 {
        unsigned long addrh, addrl;
-       uchar *m = dev->enetaddr;
+       unsigned char *m = priv->enetaddr;
 
        addrl = m[0] | (m[1] << 8) | (m[2] << 16) | (m[3] << 24);
        addrh = m[4] | (m[5] << 8);
-       smc911x_set_mac_csr(dev, ADDRL, addrl);
-       smc911x_set_mac_csr(dev, ADDRH, addrh);
+       smc911x_set_mac_csr(priv, ADDRL, addrl);
+       smc911x_set_mac_csr(priv, ADDRH, addrh);
 
        printf(DRIVERNAME ": MAC %pM\n", m);
 }
 
-static int smc911x_eth_phy_read(struct eth_device *dev,
+static int smc911x_eth_phy_read(struct smc911x_priv *priv,
                                u8 phy, u8 reg, u16 *val)
 {
-       while (smc911x_get_mac_csr(dev, MII_ACC) & MII_ACC_MII_BUSY)
+       while (smc911x_get_mac_csr(priv, MII_ACC) & MII_ACC_MII_BUSY)
                ;
 
-       smc911x_set_mac_csr(dev, MII_ACC, phy << 11 | reg << 6 |
+       smc911x_set_mac_csr(priv, MII_ACC, phy << 11 | reg << 6 |
                                MII_ACC_MII_BUSY);
 
-       while (smc911x_get_mac_csr(dev, MII_ACC) & MII_ACC_MII_BUSY)
+       while (smc911x_get_mac_csr(priv, MII_ACC) & MII_ACC_MII_BUSY)
                ;
 
-       *val = smc911x_get_mac_csr(dev, MII_DATA);
+       *val = smc911x_get_mac_csr(priv, MII_DATA);
 
        return 0;
 }
 
-static int smc911x_eth_phy_write(struct eth_device *dev,
+static int smc911x_eth_phy_write(struct smc911x_priv *priv,
                                u8 phy, u8 reg, u16  val)
 {
-       while (smc911x_get_mac_csr(dev, MII_ACC) & MII_ACC_MII_BUSY)
+       while (smc911x_get_mac_csr(priv, MII_ACC) & MII_ACC_MII_BUSY)
                ;
 
-       smc911x_set_mac_csr(dev, MII_DATA, val);
-       smc911x_set_mac_csr(dev, MII_ACC,
+       smc911x_set_mac_csr(priv, MII_DATA, val);
+       smc911x_set_mac_csr(priv, MII_ACC,
                phy << 11 | reg << 6 | MII_ACC_MII_BUSY | MII_ACC_MII_WRITE);
 
-       while (smc911x_get_mac_csr(dev, MII_ACC) & MII_ACC_MII_BUSY)
+       while (smc911x_get_mac_csr(priv, MII_ACC) & MII_ACC_MII_BUSY)
                ;
        return 0;
 }
 
-static int smc911x_phy_reset(struct eth_device *dev)
+static int smc911x_phy_reset(struct smc911x_priv *priv)
 {
        u32 reg;
 
-       reg = smc911x_reg_read(dev, PMT_CTRL);
+       reg = smc911x_reg_read(priv, PMT_CTRL);
        reg &= ~0xfffff030;
        reg |= PMT_CTRL_PHY_RST;
-       smc911x_reg_write(dev, PMT_CTRL, reg);
+       smc911x_reg_write(priv, PMT_CTRL, reg);
 
        mdelay(100);
 
        return 0;
 }
 
-static void smc911x_phy_configure(struct eth_device *dev)
+static void smc911x_phy_configure(struct smc911x_priv *priv)
 {
        int timeout;
        u16 status;
 
-       smc911x_phy_reset(dev);
+       smc911x_phy_reset(priv);
 
-       smc911x_eth_phy_write(dev, 1, MII_BMCR, BMCR_RESET);
+       smc911x_eth_phy_write(priv, 1, MII_BMCR, BMCR_RESET);
        mdelay(1);
-       smc911x_eth_phy_write(dev, 1, MII_ADVERTISE, 0x01e1);
-       smc911x_eth_phy_write(dev, 1, MII_BMCR, BMCR_ANENABLE |
+       smc911x_eth_phy_write(priv, 1, MII_ADVERTISE, 0x01e1);
+       smc911x_eth_phy_write(priv, 1, MII_BMCR, BMCR_ANENABLE |
                                BMCR_ANRESTART);
 
        timeout = 5000;
@@ -96,7 +251,7 @@ static void smc911x_phy_configure(struct eth_device *dev)
                if ((timeout--) == 0)
                        goto err_out;
 
-               if (smc911x_eth_phy_read(dev, 1, MII_BMSR, &status) != 0)
+               if (smc911x_eth_phy_read(priv, 1, MII_BMSR, &status) != 0)
                        goto err_out;
        } while (!(status & BMSR_LSTATUS));
 
@@ -108,65 +263,65 @@ err_out:
        printf(DRIVERNAME ": autonegotiation timed out\n");
 }
 
-static void smc911x_enable(struct eth_device *dev)
+static void smc911x_enable(struct smc911x_priv *priv)
 {
        /* Enable TX */
-       smc911x_reg_write(dev, HW_CFG, 8 << 16 | HW_CFG_SF);
+       smc911x_reg_write(priv, HW_CFG, 8 << 16 | HW_CFG_SF);
 
-       smc911x_reg_write(dev, GPT_CFG, GPT_CFG_TIMER_EN | 10000);
+       smc911x_reg_write(priv, GPT_CFG, GPT_CFG_TIMER_EN | 10000);
 
-       smc911x_reg_write(dev, TX_CFG, TX_CFG_TX_ON);
+       smc911x_reg_write(priv, TX_CFG, TX_CFG_TX_ON);
 
        /* no padding to start of packets */
-       smc911x_reg_write(dev, RX_CFG, 0);
+       smc911x_reg_write(priv, RX_CFG, 0);
 
-       smc911x_set_mac_csr(dev, MAC_CR, MAC_CR_TXEN | MAC_CR_RXEN |
+       smc911x_set_mac_csr(priv, MAC_CR, MAC_CR_TXEN | MAC_CR_RXEN |
                                MAC_CR_HBDIS);
-
 }
 
-static int smc911x_init(struct eth_device *dev, bd_t * bd)
+static int smc911x_init_common(struct smc911x_priv *priv)
 {
-       struct chip_id *id = dev->priv;
+       const struct chip_id *id = priv->chipid;
 
        printf(DRIVERNAME ": detected %s controller\n", id->name);
 
-       smc911x_reset(dev);
+       smc911x_reset(priv);
 
        /* Configure the PHY, initialize the link state */
-       smc911x_phy_configure(dev);
+       smc911x_phy_configure(priv);
 
-       smc911x_handle_mac_address(dev);
+       smc911x_handle_mac_address(priv);
 
        /* Turn on Tx + Rx */
-       smc911x_enable(dev);
+       smc911x_enable(priv);
 
        return 0;
 }
 
-static int smc911x_send(struct eth_device *dev, void *packet, int length)
+static int smc911x_send_common(struct smc911x_priv *priv,
+                              void *packet, int length)
 {
        u32 *data = (u32*)packet;
        u32 tmplen;
        u32 status;
 
-       smc911x_reg_write(dev, TX_DATA_FIFO, TX_CMD_A_INT_FIRST_SEG |
+       smc911x_reg_write(priv, TX_DATA_FIFO, TX_CMD_A_INT_FIRST_SEG |
                                TX_CMD_A_INT_LAST_SEG | length);
-       smc911x_reg_write(dev, TX_DATA_FIFO, length);
+       smc911x_reg_write(priv, TX_DATA_FIFO, length);
 
        tmplen = (length + 3) / 4;
 
        while (tmplen--)
-               pkt_data_push(dev, TX_DATA_FIFO, *data++);
+               smc911x_reg_write(priv, TX_DATA_FIFO, *data++);
 
        /* wait for transmission */
-       while (!((smc911x_reg_read(dev, TX_FIFO_INF) &
+       while (!((smc911x_reg_read(priv, TX_FIFO_INF) &
                                        TX_FIFO_INF_TSUSED) >> 16));
 
        /* get status. Ignore 'no carrier' error, it has no meaning for
         * full duplex operation
         */
-       status = smc911x_reg_read(dev, TX_STATUS_FIFO) &
+       status = smc911x_reg_read(priv, TX_STATUS_FIFO) &
                        (TX_STS_LOC | TX_STS_LATE_COLL | TX_STS_MANY_COLL |
                        TX_STS_MANY_DEFER | TX_STS_UNDERRUN);
 
@@ -183,117 +338,296 @@ static int smc911x_send(struct eth_device *dev, void *packet, int length)
        return -1;
 }
 
-static void smc911x_halt(struct eth_device *dev)
+static void smc911x_halt_common(struct smc911x_priv *priv)
 {
-       smc911x_reset(dev);
-       smc911x_handle_mac_address(dev);
+       smc911x_reset(priv);
+       smc911x_handle_mac_address(priv);
 }
 
-static int smc911x_rx(struct eth_device *dev)
+static int smc911x_recv_common(struct smc911x_priv *priv, u32 *data)
 {
-       u32 *data = (u32 *)net_rx_packets[0];
        u32 pktlen, tmplen;
        u32 status;
 
-       if ((smc911x_reg_read(dev, RX_FIFO_INF) & RX_FIFO_INF_RXSUSED) >> 16) {
-               status = smc911x_reg_read(dev, RX_STATUS_FIFO);
-               pktlen = (status & RX_STS_PKT_LEN) >> 16;
+       status = smc911x_reg_read(priv, RX_FIFO_INF);
+       if (!(status & RX_FIFO_INF_RXSUSED))
+               return 0;
 
-               smc911x_reg_write(dev, RX_CFG, 0);
+       status = smc911x_reg_read(priv, RX_STATUS_FIFO);
+       pktlen = (status & RX_STS_PKT_LEN) >> 16;
 
-               tmplen = (pktlen + 3) / 4;
-               while (tmplen--)
-                       *data++ = pkt_data_pull(dev, RX_DATA_FIFO);
+       smc911x_reg_write(priv, RX_CFG, 0);
 
-               if (status & RX_STS_ES)
-                       printf(DRIVERNAME
-                               ": dropped bad packet. Status: 0x%08x\n",
-                               status);
-               else
-                       net_process_received_packet(net_rx_packets[0], pktlen);
+       tmplen = (pktlen + 3) / 4;
+       while (tmplen--)
+               *data++ = smc911x_reg_read(priv, RX_DATA_FIFO);
+
+       if (status & RX_STS_ES) {
+               printf(DRIVERNAME
+                       ": dropped bad packet. Status: 0x%08x\n",
+                       status);
+               return 0;
        }
 
-       return 0;
+       return pktlen;
 }
 
+#ifndef CONFIG_DM_ETH
+
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 /* wrapper for smc911x_eth_phy_read */
 static int smc911x_miiphy_read(struct mii_dev *bus, int phy, int devad,
                               int reg)
 {
-       u16 val = 0;
        struct eth_device *dev = eth_get_dev_by_name(bus->name);
-       if (dev) {
-               int retval = smc911x_eth_phy_read(dev, phy, reg, &val);
-               if (retval < 0)
-                       return retval;
-               return val;
-       }
-       return -ENODEV;
+       struct smc911x_priv *priv = container_of(dev, struct smc911x_priv, dev);
+       u16 val = 0;
+       int ret;
+
+       if (!dev || !priv)
+               return -ENODEV;
+
+       ret = smc911x_eth_phy_read(priv, phy, reg, &val);
+       if (ret < 0)
+               return ret;
+
+       return val;
 }
+
 /* wrapper for smc911x_eth_phy_write */
 static int smc911x_miiphy_write(struct mii_dev *bus, int phy, int devad,
                                int reg, u16 val)
 {
        struct eth_device *dev = eth_get_dev_by_name(bus->name);
-       if (dev)
-               return smc911x_eth_phy_write(dev, phy, reg, val);
-       return -ENODEV;
+       struct smc911x_priv *priv = container_of(dev, struct smc911x_priv, dev);
+
+       if (!dev || !priv)
+               return -ENODEV;
+
+       return smc911x_eth_phy_write(priv, phy, reg, val);
+}
+
+static int smc911x_initialize_mii(struct smc911x_priv *priv)
+{
+       struct mii_dev *mdiodev = mdio_alloc();
+       int ret;
+
+       if (!mdiodev)
+               return -ENOMEM;
+
+       strncpy(mdiodev->name, priv->dev.name, MDIO_NAME_LEN);
+       mdiodev->read = smc911x_miiphy_read;
+       mdiodev->write = smc911x_miiphy_write;
+
+       ret = mdio_register(mdiodev);
+       if (ret < 0) {
+               mdio_free(mdiodev);
+               return ret;
+       }
+
+       return 0;
+}
+#else
+static int smc911x_initialize_mii(struct smc911x_priv *priv)
+{
+       return 0;
 }
 #endif
 
+static int smc911x_init(struct eth_device *dev, bd_t *bd)
+{
+       struct smc911x_priv *priv = container_of(dev, struct smc911x_priv, dev);
+
+       return smc911x_init_common(priv);
+}
+
+static void smc911x_halt(struct eth_device *dev)
+{
+       struct smc911x_priv *priv = container_of(dev, struct smc911x_priv, dev);
+
+       smc911x_halt_common(priv);
+}
+
+static int smc911x_send(struct eth_device *dev, void *packet, int length)
+{
+       struct smc911x_priv *priv = container_of(dev, struct smc911x_priv, dev);
+
+       return smc911x_send_common(priv, packet, length);
+}
+
+static int smc911x_recv(struct eth_device *dev)
+{
+       struct smc911x_priv *priv = container_of(dev, struct smc911x_priv, dev);
+       u32 *data = (u32 *)net_rx_packets[0];
+       int ret;
+
+       ret = smc911x_recv_common(priv, data);
+       if (ret)
+               net_process_received_packet(net_rx_packets[0], ret);
+
+       return ret;
+}
+
 int smc911x_initialize(u8 dev_num, int base_addr)
 {
        unsigned long addrl, addrh;
-       struct eth_device *dev;
+       struct smc911x_priv *priv;
+       int ret;
 
-       dev = malloc(sizeof(*dev));
-       if (!dev) {
-               return -1;
-       }
-       memset(dev, 0, sizeof(*dev));
+       priv = calloc(1, sizeof(*priv));
+       if (!priv)
+               return -ENOMEM;
 
-       dev->iobase = base_addr;
+       priv->iobase = base_addr;
+       priv->dev.iobase = base_addr;
 
        /* Try to detect chip. Will fail if not present. */
-       if (smc911x_detect_chip(dev)) {
-               free(dev);
-               return 0;
+       ret = smc911x_detect_chip(priv);
+       if (ret) {
+               ret = 0;        /* Card not detected is not an error */
+               goto err_detect;
        }
 
-       addrh = smc911x_get_mac_csr(dev, ADDRH);
-       addrl = smc911x_get_mac_csr(dev, ADDRL);
+       addrh = smc911x_get_mac_csr(priv, ADDRH);
+       addrl = smc911x_get_mac_csr(priv, ADDRL);
        if (!(addrl == 0xffffffff && addrh == 0x0000ffff)) {
                /* address is obtained from optional eeprom */
-               dev->enetaddr[0] = addrl;
-               dev->enetaddr[1] = addrl >>  8;
-               dev->enetaddr[2] = addrl >> 16;
-               dev->enetaddr[3] = addrl >> 24;
-               dev->enetaddr[4] = addrh;
-               dev->enetaddr[5] = addrh >> 8;
+               priv->enetaddr[0] = addrl;
+               priv->enetaddr[1] = addrl >>  8;
+               priv->enetaddr[2] = addrl >> 16;
+               priv->enetaddr[3] = addrl >> 24;
+               priv->enetaddr[4] = addrh;
+               priv->enetaddr[5] = addrh >> 8;
+               memcpy(priv->dev.enetaddr, priv->enetaddr, 6);
        }
 
-       dev->init = smc911x_init;
-       dev->halt = smc911x_halt;
-       dev->send = smc911x_send;
-       dev->recv = smc911x_rx;
-       sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
+       priv->dev.init = smc911x_init;
+       priv->dev.halt = smc911x_halt;
+       priv->dev.send = smc911x_send;
+       priv->dev.recv = smc911x_recv;
+       sprintf(priv->dev.name, "%s-%hu", DRIVERNAME, dev_num);
 
-       eth_register(dev);
+       eth_register(&priv->dev);
 
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
-       int retval;
-       struct mii_dev *mdiodev = mdio_alloc();
-       if (!mdiodev)
-               return -ENOMEM;
-       strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN);
-       mdiodev->read = smc911x_miiphy_read;
-       mdiodev->write = smc911x_miiphy_write;
-
-       retval = mdio_register(mdiodev);
-       if (retval < 0)
-               return retval;
-#endif
+       ret = smc911x_initialize_mii(priv);
+       if (ret)
+               goto err_mii;
 
        return 1;
+
+err_mii:
+       eth_unregister(&priv->dev);
+err_detect:
+       free(priv);
+       return ret;
+}
+
+#else  /* ifdef CONFIG_DM_ETH */
+
+static int smc911x_start(struct udevice *dev)
+{
+       struct eth_pdata *plat = dev_get_platdata(dev);
+       struct smc911x_priv *priv = dev_get_priv(dev);
+
+       memcpy(priv->enetaddr, plat->enetaddr, sizeof(plat->enetaddr));
+
+       return smc911x_init_common(priv);
+}
+
+static void smc911x_stop(struct udevice *dev)
+{
+       struct smc911x_priv *priv = dev_get_priv(dev);
+
+       smc911x_halt_common(priv);
+}
+
+static int smc911x_send(struct udevice *dev, void *packet, int length)
+{
+       struct smc911x_priv *priv = dev_get_priv(dev);
+       int ret;
+
+       ret = smc911x_send_common(priv, packet, length);
+
+       return ret ? 0 : -ETIMEDOUT;
+}
+
+static int smc911x_recv(struct udevice *dev, int flags, uchar **packetp)
+{
+       struct smc911x_priv *priv = dev_get_priv(dev);
+       u32 *data = (u32 *)net_rx_packets[0];
+       int ret;
+
+       ret = smc911x_recv_common(priv, data);
+       if (ret)
+               *packetp = (void *)data;
+
+       return ret ? ret : -EAGAIN;
+}
+
+static int smc911x_bind(struct udevice *dev)
+{
+       return device_set_name(dev, dev->name);
 }
+
+static int smc911x_probe(struct udevice *dev)
+{
+       struct smc911x_priv *priv = dev_get_priv(dev);
+       unsigned long addrh, addrl;
+       int ret;
+
+       /* Try to detect chip. Will fail if not present. */
+       ret = smc911x_detect_chip(priv);
+       if (ret)
+               return ret;
+
+       addrh = smc911x_get_mac_csr(priv, ADDRH);
+       addrl = smc911x_get_mac_csr(priv, ADDRL);
+       if (!(addrl == 0xffffffff && addrh == 0x0000ffff)) {
+               /* address is obtained from optional eeprom */
+               priv->enetaddr[0] = addrl;
+               priv->enetaddr[1] = addrl >>  8;
+               priv->enetaddr[2] = addrl >> 16;
+               priv->enetaddr[3] = addrl >> 24;
+               priv->enetaddr[4] = addrh;
+               priv->enetaddr[5] = addrh >> 8;
+       }
+
+       return 0;
+}
+
+static int smc911x_ofdata_to_platdata(struct udevice *dev)
+{
+       struct smc911x_priv *priv = dev_get_priv(dev);
+       struct eth_pdata *pdata = dev_get_platdata(dev);
+
+       pdata->iobase = devfdt_get_addr(dev);
+       priv->iobase = pdata->iobase;
+
+       return 0;
+}
+
+static const struct eth_ops smc911x_ops = {
+       .start  = smc911x_start,
+       .send   = smc911x_send,
+       .recv   = smc911x_recv,
+       .stop   = smc911x_stop,
+};
+
+static const struct udevice_id smc911x_ids[] = {
+       { .compatible = "smsc,lan9115" },
+       { }
+};
+
+U_BOOT_DRIVER(smc911x) = {
+       .name           = "eth_smc911x",
+       .id             = UCLASS_ETH,
+       .of_match       = smc911x_ids,
+       .bind           = smc911x_bind,
+       .ofdata_to_platdata = smc911x_ofdata_to_platdata,
+       .probe          = smc911x_probe,
+       .ops            = &smc911x_ops,
+       .priv_auto_alloc_size = sizeof(struct smc911x_priv),
+       .platdata_auto_alloc_size = sizeof(struct eth_pdata),
+       .flags          = DM_FLAG_ALLOC_PRIV_DMA,
+};
+#endif
index 3145fbde2bd9251f82822e2818faf0ae88acaf54..ce66900f4cf9e0ed1978223d84c4120d787fffa4 100644 (file)
@@ -8,47 +8,6 @@
 #ifndef _SMC911X_H_
 #define _SMC911X_H_
 
-#include <linux/types.h>
-
-#define DRIVERNAME "smc911x"
-
-#if defined (CONFIG_SMC911X_32_BIT) && \
-       defined (CONFIG_SMC911X_16_BIT)
-#error "SMC911X: Only one of CONFIG_SMC911X_32_BIT and \
-       CONFIG_SMC911X_16_BIT shall be set"
-#endif
-
-#if defined (CONFIG_SMC911X_32_BIT)
-static inline u32 __smc911x_reg_read(struct eth_device *dev, u32 offset)
-{
-       return *(volatile u32*)(dev->iobase + offset);
-}
-u32 smc911x_reg_read(struct eth_device *dev, u32 offset)
-       __attribute__((weak, alias("__smc911x_reg_read")));
-
-static inline void __smc911x_reg_write(struct eth_device *dev,
-                                       u32 offset, u32 val)
-{
-       *(volatile u32*)(dev->iobase + offset) = val;
-}
-void smc911x_reg_write(struct eth_device *dev, u32 offset, u32 val)
-       __attribute__((weak, alias("__smc911x_reg_write")));
-#elif defined (CONFIG_SMC911X_16_BIT)
-static inline u32 smc911x_reg_read(struct eth_device *dev, u32 offset)
-{
-       volatile u16 *addr_16 = (u16 *)(dev->iobase + offset);
-       return ((*addr_16 & 0x0000ffff) | (*(addr_16 + 1) << 16));
-}
-static inline void smc911x_reg_write(struct eth_device *dev,
-                                       u32 offset, u32 val)
-{
-       *(volatile u16 *)(dev->iobase + offset) = (u16)val;
-       *(volatile u16 *)(dev->iobase + offset + 2) = (u16)(val >> 16);
-}
-#else
-#error "SMC911X: undefined bus width"
-#endif /* CONFIG_SMC911X_16_BIT */
-
 /* Below are the register offsets and bit definitions
  * of the Lan911x memory space
  */
@@ -380,120 +339,4 @@ static inline void smc911x_reg_write(struct eth_device *dev,
 #define CHIP_9220      0x9220
 #define CHIP_9221      0x9221
 
-struct chip_id {
-       u16 id;
-       char *name;
-};
-
-static const struct chip_id chip_ids[] =  {
-       { CHIP_89218, "LAN89218" },
-       { CHIP_9115, "LAN9115" },
-       { CHIP_9116, "LAN9116" },
-       { CHIP_9117, "LAN9117" },
-       { CHIP_9118, "LAN9118" },
-       { CHIP_9211, "LAN9211" },
-       { CHIP_9215, "LAN9215" },
-       { CHIP_9216, "LAN9216" },
-       { CHIP_9217, "LAN9217" },
-       { CHIP_9218, "LAN9218" },
-       { CHIP_9220, "LAN9220" },
-       { CHIP_9221, "LAN9221" },
-       { 0, NULL },
-};
-
-static u32 smc911x_get_mac_csr(struct eth_device *dev, u8 reg)
-{
-       while (smc911x_reg_read(dev, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
-               ;
-       smc911x_reg_write(dev, MAC_CSR_CMD,
-                       MAC_CSR_CMD_CSR_BUSY | MAC_CSR_CMD_R_NOT_W | reg);
-       while (smc911x_reg_read(dev, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
-               ;
-
-       return smc911x_reg_read(dev, MAC_CSR_DATA);
-}
-
-static void smc911x_set_mac_csr(struct eth_device *dev, u8 reg, u32 data)
-{
-       while (smc911x_reg_read(dev, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
-               ;
-       smc911x_reg_write(dev, MAC_CSR_DATA, data);
-       smc911x_reg_write(dev, MAC_CSR_CMD, MAC_CSR_CMD_CSR_BUSY | reg);
-       while (smc911x_reg_read(dev, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
-               ;
-}
-
-static int smc911x_detect_chip(struct eth_device *dev)
-{
-       unsigned long val, i;
-
-       val = smc911x_reg_read(dev, BYTE_TEST);
-       if (val == 0xffffffff) {
-               /* Special case -- no chip present */
-               return -1;
-       } else if (val != 0x87654321) {
-               printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n", val);
-               return -1;
-       }
-
-       val = smc911x_reg_read(dev, ID_REV) >> 16;
-       for (i = 0; chip_ids[i].id != 0; i++) {
-               if (chip_ids[i].id == val) break;
-       }
-       if (!chip_ids[i].id) {
-               printf(DRIVERNAME ": Unknown chip ID %04lx\n", val);
-               return -1;
-       }
-
-       dev->priv = (void *)&chip_ids[i];
-
-       return 0;
-}
-
-static void smc911x_reset(struct eth_device *dev)
-{
-       int timeout;
-
-       /*
-        *  Take out of PM setting first
-        *  Device is already wake up if PMT_CTRL_READY bit is set
-        */
-       if ((smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY) == 0) {
-               /* Write to the bytetest will take out of powerdown */
-               smc911x_reg_write(dev, BYTE_TEST, 0x0);
-
-               timeout = 10;
-
-               while (timeout-- &&
-                       !(smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY))
-                       udelay(10);
-               if (timeout < 0) {
-                       printf(DRIVERNAME
-                               ": timeout waiting for PM restore\n");
-                       return;
-               }
-       }
-
-       /* Disable interrupts */
-       smc911x_reg_write(dev, INT_EN, 0);
-
-       smc911x_reg_write(dev, HW_CFG, HW_CFG_SRST);
-
-       timeout = 1000;
-       while (timeout-- && smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
-               udelay(10);
-
-       if (timeout < 0) {
-               printf(DRIVERNAME ": reset timeout\n");
-               return;
-       }
-
-       /* Reset the FIFO level and flow control settings */
-       smc911x_set_mac_csr(dev, FLOW, FLOW_FCPT | FLOW_FCEN);
-       smc911x_reg_write(dev, AFC_CFG, 0x0050287F);
-
-       /* Set to LED outputs */
-       smc911x_reg_write(dev, GPIO_CFG, 0x70070000);
-}
-
 #endif
index bd089b7a435176f521952920a64f1cedc6cc69ce..81525a48b70a03f3b3a25c2669ec7255edcd3a4b 100644 (file)
 /* version V1 sub-banks offset base address */
 /* banks shared by multiple phys */
 #define SSUSB_SIFSLV_V1_SPLLC          0x000   /* shared by u3 phys */
+#define SSUSB_SIFSLV_V1_U2FREQ         0x100   /* shared by u2 phys */
 #define SSUSB_SIFSLV_V1_CHIP           0x300   /* shared by u3 phys */
+/* u2 phy bank */
+#define SSUSB_SIFSLV_V1_U2PHY_COM      0x000
 /* u3/pcie/sata phy banks */
 #define SSUSB_SIFSLV_V1_U3PHYD         0x000
 #define SSUSB_SIFSLV_V1_U3PHYA         0x200
 
+/* version V2 sub-banks offset base address */
+/* u2 phy banks */
+#define SSUSB_SIFSLV_V2_MISC           0x000
+#define SSUSB_SIFSLV_V2_U2FREQ         0x100
+#define SSUSB_SIFSLV_V2_U2PHY_COM      0x300
+/* u3/pcie/sata phy banks */
+#define SSUSB_SIFSLV_V2_SPLLC          0x000
+#define SSUSB_SIFSLV_V2_CHIP           0x100
+#define SSUSB_SIFSLV_V2_U3PHYD         0x200
+#define SSUSB_SIFSLV_V2_U3PHYA         0x400
+
+#define U3P_USBPHYACR0                 0x000
+#define PA0_RG_U2PLL_FORCE_ON          BIT(15)
+#define PA0_RG_USB20_INTR_EN           BIT(5)
+
+#define U3P_USBPHYACR5                 0x014
+#define PA5_RG_U2_HSTX_SRCAL_EN                BIT(15)
+#define PA5_RG_U2_HSTX_SRCTRL          GENMASK(14, 12)
+#define PA5_RG_U2_HSTX_SRCTRL_VAL(x)   ((0x7 & (x)) << 12)
+#define PA5_RG_U2_HS_100U_U3_EN                BIT(11)
+
+#define U3P_USBPHYACR6                 0x018
+#define PA6_RG_U2_BC11_SW_EN           BIT(23)
+#define PA6_RG_U2_OTG_VBUSCMP_EN       BIT(20)
+#define PA6_RG_U2_SQTH                 GENMASK(3, 0)
+#define PA6_RG_U2_SQTH_VAL(x)          (0xf & (x))
+
+#define U3P_U2PHYACR4                  0x020
+#define P2C_RG_USB20_GPIO_CTL          BIT(9)
+#define P2C_USB20_GPIO_MODE            BIT(8)
+#define P2C_U2_GPIO_CTR_MSK    \
+               (P2C_RG_USB20_GPIO_CTL | P2C_USB20_GPIO_MODE)
+
+#define U3P_U2PHYDTM0                  0x068
+#define P2C_FORCE_UART_EN              BIT(26)
+#define P2C_FORCE_DATAIN               BIT(23)
+#define P2C_FORCE_DM_PULLDOWN          BIT(21)
+#define P2C_FORCE_DP_PULLDOWN          BIT(20)
+#define P2C_FORCE_XCVRSEL              BIT(19)
+#define P2C_FORCE_SUSPENDM             BIT(18)
+#define P2C_FORCE_TERMSEL              BIT(17)
+#define P2C_RG_DATAIN                  GENMASK(13, 10)
+#define P2C_RG_DATAIN_VAL(x)           ((0xf & (x)) << 10)
+#define P2C_RG_DMPULLDOWN              BIT(7)
+#define P2C_RG_DPPULLDOWN              BIT(6)
+#define P2C_RG_XCVRSEL                 GENMASK(5, 4)
+#define P2C_RG_XCVRSEL_VAL(x)          ((0x3 & (x)) << 4)
+#define P2C_RG_SUSPENDM                        BIT(3)
+#define P2C_RG_TERMSEL                 BIT(2)
+#define P2C_DTM0_PART_MASK     \
+               (P2C_FORCE_DATAIN | P2C_FORCE_DM_PULLDOWN | \
+               P2C_FORCE_DP_PULLDOWN | P2C_FORCE_XCVRSEL | \
+               P2C_FORCE_TERMSEL | P2C_RG_DMPULLDOWN | \
+               P2C_RG_DPPULLDOWN | P2C_RG_TERMSEL)
+
+#define U3P_U2PHYDTM1                  0x06C
+#define P2C_RG_UART_EN                 BIT(16)
+#define P2C_FORCE_IDDIG                        BIT(9)
+#define P2C_RG_VBUSVALID               BIT(5)
+#define P2C_RG_SESSEND                 BIT(4)
+#define P2C_RG_AVALID                  BIT(2)
+#define P2C_RG_IDDIG                   BIT(1)
+
 #define U3P_U3_CHIP_GPIO_CTLD          0x0c
 #define P3C_REG_IP_SW_RST              BIT(31)
 #define P3C_MCU_BUS_CK_GATE_EN         BIT(30)
 #define P3A_RG_CLKDRV_AMP              GENMASK(31, 29)
 #define P3A_RG_CLKDRV_AMP_VAL(x)       ((0x7 & (x)) << 29)
 
+#define U3P_U3_PHYA_REG6               0x018
+#define P3A_RG_TX_EIDLE_CM             GENMASK(31, 28)
+#define P3A_RG_TX_EIDLE_CM_VAL(x)      ((0xf & (x)) << 28)
+
+#define U3P_U3_PHYA_REG9               0x024
+#define P3A_RG_RX_DAC_MUX              GENMASK(5, 1)
+#define P3A_RG_RX_DAC_MUX_VAL(x)       ((0x1f & (x)) << 1)
+
 #define U3P_U3_PHYA_DA_REG0            0x100
 #define P3A_RG_XTAL_EXT_PE2H           GENMASK(17, 16)
 #define P3A_RG_XTAL_EXT_PE2H_VAL(x)    ((0x3 & (x)) << 16)
 #define P3A_RG_PLL_DELTA_PE2H          GENMASK(15, 0)
 #define P3A_RG_PLL_DELTA_PE2H_VAL(x)   (0xffff & (x))
 
+#define U3P_U3_PHYD_LFPS1              0x00c
+#define P3D_RG_FWAKE_TH                        GENMASK(21, 16)
+#define P3D_RG_FWAKE_TH_VAL(x)         ((0x3f & (x)) << 16)
+
+#define U3P_U3_PHYD_CDR1               0x05c
+#define P3D_RG_CDR_BIR_LTD1            GENMASK(28, 24)
+#define P3D_RG_CDR_BIR_LTD1_VAL(x)     ((0x1f & (x)) << 24)
+#define P3D_RG_CDR_BIR_LTD0            GENMASK(12, 8)
+#define P3D_RG_CDR_BIR_LTD0_VAL(x)     ((0x1f & (x)) << 8)
+
 #define U3P_U3_PHYD_RXDET1             0x128
 #define P3D_RG_RXDET_STB2_SET          GENMASK(17, 9)
 #define P3D_RG_RXDET_STB2_SET_VAL(x)   ((0x1ff & (x)) << 9)
 #define P3D_RG_RXDET_STB2_SET_P3       GENMASK(8, 0)
 #define P3D_RG_RXDET_STB2_SET_P3_VAL(x)        (0x1ff & (x))
 
+#define U3P_SPLLC_XTALCTL3             0x018
+#define XC3_RG_U3_XTAL_RX_PWD          BIT(9)
+#define XC3_RG_U3_FRC_XTAL_RX_PWD      BIT(8)
+
+enum mtk_phy_version {
+       MTK_TPHY_V1 = 1,
+       MTK_TPHY_V2,
+};
+
+struct u2phy_banks {
+       void __iomem *misc;
+       void __iomem *fmreg;
+       void __iomem *com;
+};
+
 struct u3phy_banks {
        void __iomem *spllc;
        void __iomem *chip;
@@ -95,26 +194,136 @@ struct u3phy_banks {
 struct mtk_phy_instance {
        void __iomem *port_base;
        const struct device_node *np;
+       union {
+               struct u2phy_banks u2_banks;
+               struct u3phy_banks u3_banks;
+       };
 
-       struct u3phy_banks u3_banks;
-
-       /* reference clock of anolog phy */
-       struct clk ref_clk;
+       struct clk ref_clk;     /* reference clock of (digital) phy */
+       struct clk da_ref_clk;  /* reference clock of analog phy */
        u32 index;
-       u8 type;
+       u32 type;
 };
 
 struct mtk_tphy {
+       struct udevice *dev;
        void __iomem *sif_base;
+       enum mtk_phy_version version;
        struct mtk_phy_instance **phys;
        int nphys;
 };
 
+static void u2_phy_instance_init(struct mtk_tphy *tphy,
+                                struct mtk_phy_instance *instance)
+{
+       struct u2phy_banks *u2_banks = &instance->u2_banks;
+
+       /* switch to USB function, and enable usb pll */
+       clrsetbits_le32(u2_banks->com + U3P_U2PHYDTM0,
+                       P2C_FORCE_UART_EN | P2C_FORCE_SUSPENDM,
+                       P2C_RG_XCVRSEL_VAL(1) | P2C_RG_DATAIN_VAL(0));
+
+       clrbits_le32(u2_banks->com + U3P_U2PHYDTM1, P2C_RG_UART_EN);
+       setbits_le32(u2_banks->com + U3P_USBPHYACR0, PA0_RG_USB20_INTR_EN);
+
+       /* disable switch 100uA current to SSUSB */
+       clrbits_le32(u2_banks->com + U3P_USBPHYACR5, PA5_RG_U2_HS_100U_U3_EN);
+
+       clrbits_le32(u2_banks->com + U3P_U2PHYACR4, P2C_U2_GPIO_CTR_MSK);
+
+       /* DP/DM BC1.1 path Disable */
+       clrsetbits_le32(u2_banks->com + U3P_USBPHYACR6,
+                       PA6_RG_U2_BC11_SW_EN | PA6_RG_U2_SQTH,
+                       PA6_RG_U2_SQTH_VAL(2));
+
+       /* set HS slew rate */
+       clrsetbits_le32(u2_banks->com + U3P_USBPHYACR5,
+                       PA5_RG_U2_HSTX_SRCTRL, PA5_RG_U2_HSTX_SRCTRL_VAL(4));
+
+       dev_dbg(tphy->dev, "%s(%d)\n", __func__, instance->index);
+}
+
+static void u2_phy_instance_power_on(struct mtk_tphy *tphy,
+                                    struct mtk_phy_instance *instance)
+{
+       struct u2phy_banks *u2_banks = &instance->u2_banks;
+
+       clrbits_le32(u2_banks->com + U3P_U2PHYDTM0,
+                    P2C_RG_XCVRSEL | P2C_RG_DATAIN | P2C_DTM0_PART_MASK);
+
+       /* OTG Enable */
+       setbits_le32(u2_banks->com + U3P_USBPHYACR6,
+                    PA6_RG_U2_OTG_VBUSCMP_EN);
+
+       clrsetbits_le32(u2_banks->com + U3P_U2PHYDTM1,
+                       P2C_RG_SESSEND, P2C_RG_VBUSVALID | P2C_RG_AVALID);
+
+       dev_dbg(tphy->dev, "%s(%d)\n", __func__, instance->index);
+}
+
+static void u2_phy_instance_power_off(struct mtk_tphy *tphy,
+                                     struct mtk_phy_instance *instance)
+{
+       struct u2phy_banks *u2_banks = &instance->u2_banks;
+
+       clrbits_le32(u2_banks->com + U3P_U2PHYDTM0,
+                    P2C_RG_XCVRSEL | P2C_RG_DATAIN);
+
+       /* OTG Disable */
+       clrbits_le32(u2_banks->com + U3P_USBPHYACR6,
+                    PA6_RG_U2_OTG_VBUSCMP_EN);
+
+       clrsetbits_le32(u2_banks->com + U3P_U2PHYDTM1,
+                       P2C_RG_VBUSVALID | P2C_RG_AVALID, P2C_RG_SESSEND);
+
+       dev_dbg(tphy->dev, "%s(%d)\n", __func__, instance->index);
+}
+
+static void u3_phy_instance_init(struct mtk_tphy *tphy,
+                                struct mtk_phy_instance *instance)
+{
+       struct u3phy_banks *u3_banks = &instance->u3_banks;
+
+       /* gating PCIe Analog XTAL clock */
+       setbits_le32(u3_banks->spllc + U3P_SPLLC_XTALCTL3,
+                    XC3_RG_U3_XTAL_RX_PWD | XC3_RG_U3_FRC_XTAL_RX_PWD);
+
+       /* gating XSQ */
+       clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_DA_REG0,
+                       P3A_RG_XTAL_EXT_EN_U3, P3A_RG_XTAL_EXT_EN_U3_VAL(2));
+
+       clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_REG9,
+                       P3A_RG_RX_DAC_MUX, P3A_RG_RX_DAC_MUX_VAL(4));
+
+       clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_REG6,
+                       P3A_RG_TX_EIDLE_CM, P3A_RG_TX_EIDLE_CM_VAL(0xe));
+
+       clrsetbits_le32(u3_banks->phyd + U3P_U3_PHYD_CDR1,
+                       P3D_RG_CDR_BIR_LTD0 | P3D_RG_CDR_BIR_LTD1,
+                       P3D_RG_CDR_BIR_LTD0_VAL(0xc) |
+                       P3D_RG_CDR_BIR_LTD1_VAL(0x3));
+
+       clrsetbits_le32(u3_banks->phyd + U3P_U3_PHYD_LFPS1,
+                       P3D_RG_FWAKE_TH, P3D_RG_FWAKE_TH_VAL(0x34));
+
+       clrsetbits_le32(u3_banks->phyd + U3P_U3_PHYD_RXDET1,
+                       P3D_RG_RXDET_STB2_SET, P3D_RG_RXDET_STB2_SET_VAL(0x10));
+
+       clrsetbits_le32(u3_banks->phyd + U3P_U3_PHYD_RXDET2,
+                       P3D_RG_RXDET_STB2_SET_P3,
+                       P3D_RG_RXDET_STB2_SET_P3_VAL(0x10));
+
+       dev_dbg(tphy->dev, "%s(%d)\n", __func__, instance->index);
+}
+
 static void pcie_phy_instance_init(struct mtk_tphy *tphy,
                                   struct mtk_phy_instance *instance)
 {
        struct u3phy_banks *u3_banks = &instance->u3_banks;
 
+       if (tphy->version != MTK_TPHY_V1)
+               return;
+
        clrsetbits_le32(u3_banks->phya + U3P_U3_PHYA_DA_REG0,
                        P3A_RG_XTAL_EXT_PE1H | P3A_RG_XTAL_EXT_PE2H,
                        P3A_RG_XTAL_EXT_PE1H_VAL(0x2) |
@@ -187,9 +396,16 @@ static void pcie_phy_instance_power_off(struct mtk_tphy *tphy,
 static void phy_v1_banks_init(struct mtk_tphy *tphy,
                              struct mtk_phy_instance *instance)
 {
+       struct u2phy_banks *u2_banks = &instance->u2_banks;
        struct u3phy_banks *u3_banks = &instance->u3_banks;
 
        switch (instance->type) {
+       case PHY_TYPE_USB2:
+               u2_banks->misc = NULL;
+               u2_banks->fmreg = tphy->sif_base + SSUSB_SIFSLV_V1_U2FREQ;
+               u2_banks->com = instance->port_base + SSUSB_SIFSLV_V1_U2PHY_COM;
+               break;
+       case PHY_TYPE_USB3:
        case PHY_TYPE_PCIE:
                u3_banks->spllc = tphy->sif_base + SSUSB_SIFSLV_V1_SPLLC;
                u3_banks->chip = tphy->sif_base + SSUSB_SIFSLV_V1_CHIP;
@@ -197,6 +413,32 @@ static void phy_v1_banks_init(struct mtk_tphy *tphy,
                u3_banks->phya = instance->port_base + SSUSB_SIFSLV_V1_U3PHYA;
                break;
        default:
+               dev_err(tphy->dev, "incompatible PHY type\n");
+               return;
+       }
+}
+
+static void phy_v2_banks_init(struct mtk_tphy *tphy,
+                             struct mtk_phy_instance *instance)
+{
+       struct u2phy_banks *u2_banks = &instance->u2_banks;
+       struct u3phy_banks *u3_banks = &instance->u3_banks;
+
+       switch (instance->type) {
+       case PHY_TYPE_USB2:
+               u2_banks->misc = instance->port_base + SSUSB_SIFSLV_V2_MISC;
+               u2_banks->fmreg = instance->port_base + SSUSB_SIFSLV_V2_U2FREQ;
+               u2_banks->com = instance->port_base + SSUSB_SIFSLV_V2_U2PHY_COM;
+               break;
+       case PHY_TYPE_USB3:
+       case PHY_TYPE_PCIE:
+               u3_banks->spllc = instance->port_base + SSUSB_SIFSLV_V2_SPLLC;
+               u3_banks->chip = instance->port_base + SSUSB_SIFSLV_V2_CHIP;
+               u3_banks->phyd = instance->port_base + SSUSB_SIFSLV_V2_U3PHYD;
+               u3_banks->phya = instance->port_base + SSUSB_SIFSLV_V2_U3PHYA;
+               break;
+       default:
+               dev_err(tphy->dev, "incompatible PHY type\n");
                return;
        }
 }
@@ -208,14 +450,30 @@ static int mtk_phy_init(struct phy *phy)
        int ret;
 
        ret = clk_enable(&instance->ref_clk);
-       if (ret)
+       if (ret < 0) {
+               dev_err(tphy->dev, "failed to enable ref_clk\n");
+               return ret;
+       }
+
+       ret = clk_enable(&instance->da_ref_clk);
+       if (ret < 0) {
+               dev_err(tphy->dev, "failed to enable da_ref_clk %d\n", ret);
+               clk_disable(&instance->ref_clk);
                return ret;
+       }
 
        switch (instance->type) {
+       case PHY_TYPE_USB2:
+               u2_phy_instance_init(tphy, instance);
+               break;
+       case PHY_TYPE_USB3:
+               u3_phy_instance_init(tphy, instance);
+               break;
        case PHY_TYPE_PCIE:
                pcie_phy_instance_init(tphy, instance);
                break;
        default:
+               dev_err(tphy->dev, "incompatible PHY type\n");
                return -EINVAL;
        }
 
@@ -227,7 +485,10 @@ static int mtk_phy_power_on(struct phy *phy)
        struct mtk_tphy *tphy = dev_get_priv(phy->dev);
        struct mtk_phy_instance *instance = tphy->phys[phy->id];
 
-       pcie_phy_instance_power_on(tphy, instance);
+       if (instance->type == PHY_TYPE_USB2)
+               u2_phy_instance_power_on(tphy, instance);
+       else if (instance->type == PHY_TYPE_PCIE)
+               pcie_phy_instance_power_on(tphy, instance);
 
        return 0;
 }
@@ -237,7 +498,10 @@ static int mtk_phy_power_off(struct phy *phy)
        struct mtk_tphy *tphy = dev_get_priv(phy->dev);
        struct mtk_phy_instance *instance = tphy->phys[phy->id];
 
-       pcie_phy_instance_power_off(tphy, instance);
+       if (instance->type == PHY_TYPE_USB2)
+               u2_phy_instance_power_off(tphy, instance);
+       else if (instance->type == PHY_TYPE_PCIE)
+               pcie_phy_instance_power_off(tphy, instance);
 
        return 0;
 }
@@ -247,6 +511,7 @@ static int mtk_phy_exit(struct phy *phy)
        struct mtk_tphy *tphy = dev_get_priv(phy->dev);
        struct mtk_phy_instance *instance = tphy->phys[phy->id];
 
+       clk_disable(&instance->da_ref_clk);
        clk_disable(&instance->ref_clk);
 
        return 0;
@@ -285,13 +550,19 @@ static int mtk_phy_xlate(struct phy *phy,
        instance->type = args->args[1];
        if (!(instance->type == PHY_TYPE_USB2 ||
              instance->type == PHY_TYPE_USB3 ||
-             instance->type == PHY_TYPE_PCIE ||
-             instance->type == PHY_TYPE_SATA)) {
+             instance->type == PHY_TYPE_PCIE)) {
                dev_err(phy->dev, "unsupported device type\n");
                return -EINVAL;
        }
 
-       phy_v1_banks_init(tphy, instance);
+       if (tphy->version == MTK_TPHY_V1) {
+               phy_v1_banks_init(tphy, instance);
+       } else if (tphy->version == MTK_TPHY_V2) {
+               phy_v2_banks_init(tphy, instance);
+       } else {
+               dev_err(phy->dev, "phy version is not supported\n");
+               return -EINVAL;
+       }
 
        return 0;
 }
@@ -310,17 +581,22 @@ static int mtk_tphy_probe(struct udevice *dev)
        ofnode subnode;
        int index = 0;
 
-       dev_for_each_subnode(subnode, dev)
-               tphy->nphys++;
+       tphy->nphys = dev_get_child_count(dev);
 
        tphy->phys = devm_kcalloc(dev, tphy->nphys, sizeof(*tphy->phys),
                                  GFP_KERNEL);
        if (!tphy->phys)
                return -ENOMEM;
 
-       tphy->sif_base = dev_read_addr_ptr(dev);
-       if (!tphy->sif_base)
-               return -ENOENT;
+       tphy->dev = dev;
+       tphy->version = dev_get_driver_data(dev);
+
+       /* v1 has shared banks */
+       if (tphy->version == MTK_TPHY_V1) {
+               tphy->sif_base = dev_read_addr_ptr(dev);
+               if (!tphy->sif_base)
+                       return -ENOENT;
+       }
 
        dev_for_each_subnode(subnode, dev) {
                struct mtk_phy_instance *instance;
@@ -345,13 +621,19 @@ static int mtk_tphy_probe(struct udevice *dev)
                                             &instance->ref_clk);
                if (err)
                        return err;
+
+               err = clk_get_optional_nodev(subnode, "da_ref",
+                                            &instance->da_ref_clk);
+               if (err)
+                       return err;
        }
 
        return 0;
 }
 
 static const struct udevice_id mtk_tphy_id_table[] = {
-       { .compatible = "mediatek,generic-tphy-v1", },
+       { .compatible = "mediatek,generic-tphy-v1", .data = MTK_TPHY_V1, },
+       { .compatible = "mediatek,generic-tphy-v2", .data = MTK_TPHY_V2, },
        { }
 };
 
index e463b0b400ed45047d400fffe6e6566afb7e9d57..6ab78448af31822b1a856b2e4209fbb2b850bcf7 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <dm/devres.h>
 #include <generic-phy.h>
 
 static inline struct phy_ops *phy_dev_ops(struct udevice *dev)
@@ -167,6 +168,102 @@ int generic_phy_power_off(struct phy *phy)
        return ops->power_off ? ops->power_off(phy) : 0;
 }
 
+int generic_phy_get_bulk(struct udevice *dev, struct phy_bulk *bulk)
+{
+       int i, ret, count;
+
+       bulk->count = 0;
+
+       /* Return if no phy declared */
+       if (!dev_read_prop(dev, "phys", NULL))
+               return 0;
+
+       count = dev_count_phandle_with_args(dev, "phys", "#phy-cells");
+       if (count < 1)
+               return count;
+
+       bulk->phys = devm_kcalloc(dev, count, sizeof(struct phy), GFP_KERNEL);
+       if (!bulk->phys)
+               return -ENOMEM;
+
+       for (i = 0; i < count; i++) {
+               ret = generic_phy_get_by_index(dev, i, &bulk->phys[i]);
+               if (ret) {
+                       pr_err("Failed to get PHY%d for %s\n", i, dev->name);
+                       return ret;
+               }
+               bulk->count++;
+       }
+
+       return 0;
+}
+
+int generic_phy_init_bulk(struct phy_bulk *bulk)
+{
+       struct phy *phys = bulk->phys;
+       int i, ret;
+
+       for (i = 0; i < bulk->count; i++) {
+               ret = generic_phy_init(&phys[i]);
+               if (ret) {
+                       pr_err("Can't init PHY%d\n", i);
+                       goto phys_init_err;
+               }
+       }
+
+       return 0;
+
+phys_init_err:
+       for (; i > 0; i--)
+               generic_phy_exit(&phys[i - 1]);
+
+       return ret;
+}
+
+int generic_phy_exit_bulk(struct phy_bulk *bulk)
+{
+       struct phy *phys = bulk->phys;
+       int i, ret = 0;
+
+       for (i = 0; i < bulk->count; i++)
+               ret |= generic_phy_exit(&phys[i]);
+
+       return ret;
+}
+
+int generic_phy_power_on_bulk(struct phy_bulk *bulk)
+{
+       struct phy *phys = bulk->phys;
+       int i, ret;
+
+       for (i = 0; i < bulk->count; i++) {
+               ret = generic_phy_power_on(&phys[i]);
+               if (ret) {
+                       pr_err("Can't power on PHY%d\n", i);
+                       goto phys_poweron_err;
+               }
+       }
+
+       return 0;
+
+phys_poweron_err:
+       for (; i > 0; i--)
+               generic_phy_power_off(&phys[i - 1]);
+
+       return ret;
+}
+
+int generic_phy_power_off_bulk(struct phy_bulk *bulk)
+{
+       struct phy *phys = bulk->phys;
+       int i, ret = 0;
+
+       for (i = 0; i < bulk->count; i++)
+               ret |= generic_phy_power_off(&phys[i]);
+
+       return ret;
+}
+
 UCLASS_DRIVER(phy) = {
        .id             = UCLASS_PHY,
        .name           = "phy",
index 24549ece653cf4a20d64e2daae236323cfc4a032..fbad124b51cf461b2796a62514367693dbc4c470 100644 (file)
@@ -440,7 +440,8 @@ static void qe_upload_microcode(const void *base,
 /*
  * Upload a microcode to the I-RAM at a specific address.
  *
- * See docs/README.qe_firmware for information on QE microcode uploading.
+ * See Documentation/powerpc/qe_firmware.rst in the Linux kernel tree for
+ * information on QE microcode uploading.
  *
  * Currently, only version 1 is supported, so the 'version' field must be
  * set to 1.
@@ -579,7 +580,8 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
 /*
  * Upload a microcode to the I-RAM at a specific address.
  *
- * See docs/README.qe_firmware for information on QE microcode uploading.
+ * See Documentation/powerpc/qe_firmware.rst in the Linux kernel tree for
+ * information on QE microcode uploading.
  *
  * Currently, only version 1 is supported, so the 'version' field must be
  * set to 1.
index edb6152bb9d43ee8ef95d379a76d0a9b1af595de..e4b22d79ebcfb1f692213358f8094050ec1934e8 100644 (file)
@@ -31,4 +31,12 @@ config RNG_STM32MP1
        help
          Enable STM32MP1 rng driver.
 
+config RNG_ROCKCHIP
+       bool "Enable random number generator for rockchip crypto rng"
+       depends on ARCH_ROCKCHIP && DM_RNG
+       default n
+       help
+         Enable random number generator for rockchip.This driver is
+         support rng module of crypto v1 and crypto v2.
+
 endif
index 6a8a66779b5b30e4a077612d10e7eb6578d30a0a..44a00039173531d0cb7dad05c65561cf7b1303a3 100644 (file)
@@ -7,3 +7,4 @@ obj-$(CONFIG_DM_RNG) += rng-uclass.o
 obj-$(CONFIG_RNG_MESON) += meson-rng.o
 obj-$(CONFIG_RNG_SANDBOX) += sandbox_rng.o
 obj-$(CONFIG_RNG_STM32MP1) += stm32mp1_rng.o
+obj-$(CONFIG_RNG_ROCKCHIP) += rockchip_rng.o
diff --git a/drivers/rng/rockchip_rng.c b/drivers/rng/rockchip_rng.c
new file mode 100644 (file)
index 0000000..47fb140
--- /dev/null
@@ -0,0 +1,224 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
+ */
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/io.h>
+#include <common.h>
+#include <dm.h>
+#include <linux/iopoll.h>
+#include <linux/string.h>
+#include <rng.h>
+
+#define RK_HW_RNG_MAX 32
+
+#define _SBF(s, v)     ((v) << (s))
+
+/* start of CRYPTO V1 register define */
+#define CRYPTO_V1_CTRL                         0x0008
+#define CRYPTO_V1_RNG_START                    BIT(8)
+#define CRYPTO_V1_RNG_FLUSH                    BIT(9)
+
+#define CRYPTO_V1_TRNG_CTRL                    0x0200
+#define CRYPTO_V1_OSC_ENABLE                   BIT(16)
+#define CRYPTO_V1_TRNG_SAMPLE_PERIOD(x)                (x)
+
+#define CRYPTO_V1_TRNG_DOUT_0                  0x0204
+/* end of CRYPTO V1 register define */
+
+/* start of CRYPTO V2 register define */
+#define CRYPTO_V2_RNG_CTL                      0x0400
+#define CRYPTO_V2_RNG_64_BIT_LEN               _SBF(4, 0x00)
+#define CRYPTO_V2_RNG_128_BIT_LEN              _SBF(4, 0x01)
+#define CRYPTO_V2_RNG_192_BIT_LEN              _SBF(4, 0x02)
+#define CRYPTO_V2_RNG_256_BIT_LEN              _SBF(4, 0x03)
+#define CRYPTO_V2_RNG_FATESY_SOC_RING          _SBF(2, 0x00)
+#define CRYPTO_V2_RNG_SLOWER_SOC_RING_0                _SBF(2, 0x01)
+#define CRYPTO_V2_RNG_SLOWER_SOC_RING_1                _SBF(2, 0x02)
+#define CRYPTO_V2_RNG_SLOWEST_SOC_RING         _SBF(2, 0x03)
+#define CRYPTO_V2_RNG_ENABLE                   BIT(1)
+#define CRYPTO_V2_RNG_START                    BIT(0)
+#define CRYPTO_V2_RNG_SAMPLE_CNT               0x0404
+#define CRYPTO_V2_RNG_DOUT_0                   0x0410
+/* end of CRYPTO V2 register define */
+
+#define RK_RNG_TIME_OUT        50000  /* max 50ms */
+
+struct rk_rng_soc_data {
+       int (*rk_rng_read)(struct udevice *dev, void *data, size_t len);
+};
+
+struct rk_rng_platdata {
+       fdt_addr_t base;
+       struct rk_rng_soc_data *soc_data;
+};
+
+static int rk_rng_read_regs(fdt_addr_t addr, void *buf, size_t size)
+{
+       u32 count = RK_HW_RNG_MAX / sizeof(u32);
+       u32 reg, tmp_len;
+
+       if (size > RK_HW_RNG_MAX)
+               return -EINVAL;
+
+       while (size && count) {
+               reg = readl(addr);
+               tmp_len = min(size, sizeof(u32));
+               memcpy(buf, &reg, tmp_len);
+               addr += sizeof(u32);
+               buf += tmp_len;
+               size -= tmp_len;
+               count--;
+       }
+
+       return 0;
+}
+
+static int rk_v1_rng_read(struct udevice *dev, void *data, size_t len)
+{
+       struct rk_rng_platdata *pdata = dev_get_priv(dev);
+       u32 reg = 0;
+       int retval;
+
+       if (len > RK_HW_RNG_MAX)
+               return -EINVAL;
+
+       /* enable osc_ring to get entropy, sample period is set as 100 */
+       writel(CRYPTO_V1_OSC_ENABLE | CRYPTO_V1_TRNG_SAMPLE_PERIOD(100),
+              pdata->base + CRYPTO_V1_TRNG_CTRL);
+
+       rk_clrsetreg(pdata->base + CRYPTO_V1_CTRL, CRYPTO_V1_RNG_START,
+                    CRYPTO_V1_RNG_START);
+
+       retval = readl_poll_timeout(pdata->base + CRYPTO_V1_CTRL, reg,
+                                   !(reg & CRYPTO_V1_RNG_START),
+                                   RK_RNG_TIME_OUT);
+       if (retval)
+               goto exit;
+
+       rk_rng_read_regs(pdata->base + CRYPTO_V1_TRNG_DOUT_0, data, len);
+
+exit:
+       /* close TRNG */
+       rk_clrreg(pdata->base + CRYPTO_V1_CTRL, CRYPTO_V1_RNG_START);
+
+       return 0;
+}
+
+static int rk_v2_rng_read(struct udevice *dev, void *data, size_t len)
+{
+       struct rk_rng_platdata *pdata = dev_get_priv(dev);
+       u32 reg = 0;
+       int retval;
+
+       if (len > RK_HW_RNG_MAX)
+               return -EINVAL;
+
+       /* enable osc_ring to get entropy, sample period is set as 100 */
+       writel(100, pdata->base + CRYPTO_V2_RNG_SAMPLE_CNT);
+
+       reg |= CRYPTO_V2_RNG_256_BIT_LEN;
+       reg |= CRYPTO_V2_RNG_SLOWER_SOC_RING_0;
+       reg |= CRYPTO_V2_RNG_ENABLE;
+       reg |= CRYPTO_V2_RNG_START;
+
+       rk_clrsetreg(pdata->base + CRYPTO_V2_RNG_CTL, 0xffff, reg);
+
+       retval = readl_poll_timeout(pdata->base + CRYPTO_V2_RNG_CTL, reg,
+                                   !(reg & CRYPTO_V2_RNG_START),
+                                   RK_RNG_TIME_OUT);
+       if (retval)
+               goto exit;
+
+       rk_rng_read_regs(pdata->base + CRYPTO_V2_RNG_DOUT_0, data, len);
+
+exit:
+       /* close TRNG */
+       rk_clrreg(pdata->base + CRYPTO_V2_RNG_CTL, 0xffff);
+
+       return retval;
+}
+
+static int rockchip_rng_read(struct udevice *dev, void *data, size_t len)
+{
+       unsigned char *buf = data;
+       unsigned int i;
+       int ret = -EIO;
+
+       struct rk_rng_platdata *pdata = dev_get_priv(dev);
+
+       if (!len)
+               return 0;
+
+       if (!pdata->soc_data || !pdata->soc_data->rk_rng_read)
+               return -EINVAL;
+
+       for (i = 0; i < len / RK_HW_RNG_MAX; i++, buf += RK_HW_RNG_MAX) {
+               ret = pdata->soc_data->rk_rng_read(dev, buf, RK_HW_RNG_MAX);
+               if (ret)
+                       goto exit;
+       }
+
+       if (len % RK_HW_RNG_MAX)
+               ret = pdata->soc_data->rk_rng_read(dev, buf,
+                                                  len % RK_HW_RNG_MAX);
+
+exit:
+       return ret;
+}
+
+static int rockchip_rng_ofdata_to_platdata(struct udevice *dev)
+{
+       struct rk_rng_platdata *pdata = dev_get_priv(dev);
+
+       memset(pdata, 0x00, sizeof(*pdata));
+
+       pdata->base = (fdt_addr_t)dev_read_addr_ptr(dev);
+       if (!pdata->base)
+               return -ENOMEM;
+
+       return 0;
+}
+
+static int rockchip_rng_probe(struct udevice *dev)
+{
+       struct rk_rng_platdata *pdata = dev_get_priv(dev);
+
+       pdata->soc_data = (struct rk_rng_soc_data *)dev_get_driver_data(dev);
+
+       return 0;
+}
+
+static const struct rk_rng_soc_data rk_rng_v1_soc_data = {
+       .rk_rng_read = rk_v1_rng_read,
+};
+
+static const struct rk_rng_soc_data rk_rng_v2_soc_data = {
+       .rk_rng_read = rk_v2_rng_read,
+};
+
+static const struct dm_rng_ops rockchip_rng_ops = {
+       .read = rockchip_rng_read,
+};
+
+static const struct udevice_id rockchip_rng_match[] = {
+       {
+               .compatible = "rockchip,cryptov1-rng",
+               .data = (ulong)&rk_rng_v1_soc_data,
+       },
+       {
+               .compatible = "rockchip,cryptov2-rng",
+               .data = (ulong)&rk_rng_v2_soc_data,
+       },
+       {},
+};
+
+U_BOOT_DRIVER(rockchip_rng) = {
+       .name = "rockchip-rng",
+       .id = UCLASS_RNG,
+       .of_match = rockchip_rng_match,
+       .ops = &rockchip_rng_ops,
+       .probe = rockchip_rng_probe,
+       .ofdata_to_platdata = rockchip_rng_ofdata_to_platdata,
+       .priv_auto_alloc_size = sizeof(struct rk_rng_platdata),
+};
index 9b31048e97261814de2f354bcd545adf9fdd9de6..af94bcfdf44918c26817e24b19a1bf042c657666 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2001-2008
+ * Copyright 2020 NXP
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  * Keith Outwater, keith_outwater@mvis.com`
  */
@@ -12,6 +13,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <dm.h>
 #include <rtc.h>
 #include <i2c.h>
 
@@ -60,6 +62,7 @@
 #define RTC_STAT_BIT_OSF       0x80    /* Oscillator stop flag         */
 
 
+#if !CONFIG_IS_ENABLED(DM_RTC)
 static uchar rtc_read (uchar reg);
 static void rtc_write (uchar reg, uchar val);
 
@@ -188,3 +191,128 @@ static void rtc_write (uchar reg, uchar val)
 {
        i2c_reg_write (CONFIG_SYS_I2C_RTC_ADDR, reg, val);
 }
+#else
+static uchar rtc_read(struct udevice *dev, uchar reg)
+{
+       return dm_i2c_reg_read(dev, reg);
+}
+
+static void rtc_write(struct udevice *dev, uchar reg, uchar val)
+{
+       dm_i2c_reg_write(dev, reg, val);
+}
+
+static int ds1337_rtc_get(struct udevice *dev, struct rtc_time *tmp)
+{
+       int rel = 0;
+       uchar sec, min, hour, mday, wday, mon_cent, year, control, status;
+
+       control = rtc_read(dev, RTC_CTL_REG_ADDR);
+       status = rtc_read(dev, RTC_STAT_REG_ADDR);
+       sec = rtc_read(dev, RTC_SEC_REG_ADDR);
+       min = rtc_read(dev, RTC_MIN_REG_ADDR);
+       hour = rtc_read(dev, RTC_HR_REG_ADDR);
+       wday = rtc_read(dev, RTC_DAY_REG_ADDR);
+       mday = rtc_read(dev, RTC_DATE_REG_ADDR);
+       mon_cent = rtc_read(dev, RTC_MON_REG_ADDR);
+       year = rtc_read(dev, RTC_YR_REG_ADDR);
+
+       /* No century bit, assume year 2000 */
+#ifdef CONFIG_RTC_DS1388
+       mon_cent |= 0x80;
+#endif
+
+       debug("Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x\n",
+             year, mon_cent, mday, wday);
+       debug("hr: %02x min: %02x sec: %02x control: %02x status: %02x\n",
+             hour, min, sec, control, status);
+
+       if (status & RTC_STAT_BIT_OSF) {
+               printf("### Warning: RTC oscillator has stopped\n");
+               /* clear the OSF flag */
+               rtc_write(dev, RTC_STAT_REG_ADDR,
+                         rtc_read(dev, RTC_STAT_REG_ADDR) & ~RTC_STAT_BIT_OSF);
+               rel = -1;
+       }
+
+       tmp->tm_sec = bcd2bin(sec & 0x7F);
+       tmp->tm_min = bcd2bin(min & 0x7F);
+       tmp->tm_hour = bcd2bin(hour & 0x3F);
+       tmp->tm_mday = bcd2bin(mday & 0x3F);
+       tmp->tm_mon  = bcd2bin(mon_cent & 0x1F);
+       tmp->tm_year = bcd2bin(year) + ((mon_cent & 0x80) ? 2000 : 1900);
+       tmp->tm_wday = bcd2bin((wday - 1) & 0x07);
+       tmp->tm_yday = 0;
+       tmp->tm_isdst = 0;
+
+       debug("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
+             tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+             tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return rel;
+}
+
+static int ds1337_rtc_set(struct udevice *dev, const struct rtc_time *tmp)
+{
+       uchar century;
+
+       debug("Set DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
+             tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+             tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       rtc_write(dev, RTC_YR_REG_ADDR, bin2bcd(tmp->tm_year % 100));
+
+       century = (tmp->tm_year >= 2000) ? 0x80 : 0;
+       rtc_write(dev, RTC_MON_REG_ADDR, bin2bcd(tmp->tm_mon) | century);
+
+       rtc_write(dev, RTC_DAY_REG_ADDR, bin2bcd(tmp->tm_wday + 1));
+       rtc_write(dev, RTC_DATE_REG_ADDR, bin2bcd(tmp->tm_mday));
+       rtc_write(dev, RTC_HR_REG_ADDR, bin2bcd(tmp->tm_hour));
+       rtc_write(dev, RTC_MIN_REG_ADDR, bin2bcd(tmp->tm_min));
+       rtc_write(dev, RTC_SEC_REG_ADDR, bin2bcd(tmp->tm_sec));
+
+       return 0;
+}
+
+#ifdef CONFIG_RTC_DS1337_NOOSC
+ #define RTC_DS1337_RESET_VAL \
+       (RTC_CTL_BIT_INTCN | RTC_CTL_BIT_RS1 | RTC_CTL_BIT_RS2)
+#else
+ #define RTC_DS1337_RESET_VAL (RTC_CTL_BIT_RS1 | RTC_CTL_BIT_RS2)
+#endif
+static int ds1337_rtc_reset(struct udevice *dev)
+{
+#ifdef CONFIG_RTC_DS1337
+       rtc_write(dev, RTC_CTL_REG_ADDR, RTC_DS1337_RESET_VAL);
+#elif defined CONFIG_RTC_DS1388
+       rtc_write(dev, RTC_CTL_REG_ADDR, 0x0); /* hw default */
+#endif
+#ifdef CONFIG_RTC_DS1339_TCR_VAL
+       rtc_write(dev, RTC_TC_REG_ADDR, CONFIG_RTC_DS1339_TCR_VAL);
+#endif
+#ifdef CONFIG_RTC_DS1388_TCR_VAL
+       rtc_write(dev, RTC_TC_REG_ADDR, CONFIG_RTC_DS1388_TCR_VAL);
+#endif
+       return 0;
+}
+
+static const struct rtc_ops ds1337_rtc_ops = {
+       .get = ds1337_rtc_get,
+       .set = ds1337_rtc_set,
+       .reset = ds1337_rtc_reset,
+};
+
+static const struct udevice_id ds1337_rtc_ids[] = {
+       { .compatible = "ds1337" },
+       { .compatible = "ds1338" },
+       { .compatible = "ds1338" },
+       { }
+};
+
+U_BOOT_DRIVER(rtc_ds1337) = {
+       .name   = "rtc-ds1337",
+       .id     = UCLASS_RTC,
+       .of_match = ds1337_rtc_ids,
+       .ops    = &ds1337_rtc_ops,
+};
+#endif
index f6953505a5ae12ffda2c892a74aacdc0a28739eb..b34ed63bf051f9d4f4fbbd36a16ae1549b495b7c 100644 (file)
@@ -56,7 +56,7 @@ static int pcf2127_rtc_set(struct udevice *dev, const struct rtc_time *tm)
        buf[i++] = tm->tm_wday & 0x07;
 
        /* month, 1 - 12 */
-       buf[i++] = bin2bcd(tm->tm_mon + 1);
+       buf[i++] = bin2bcd(tm->tm_mon);
 
        /* year */
        buf[i++] = bin2bcd(tm->tm_year % 100);
@@ -83,7 +83,7 @@ static int pcf2127_rtc_get(struct udevice *dev, struct rtc_time *tm)
        tm->tm_min  = bcd2bin(buf[PCF2127_REG_MN] & 0x7F);
        tm->tm_hour = bcd2bin(buf[PCF2127_REG_HR] & 0x3F);
        tm->tm_mday = bcd2bin(buf[PCF2127_REG_DM] & 0x3F);
-       tm->tm_mon  = bcd2bin(buf[PCF2127_REG_MO] & 0x1F) - 1;
+       tm->tm_mon  = bcd2bin(buf[PCF2127_REG_MO] & 0x1F);
        tm->tm_year = bcd2bin(buf[PCF2127_REG_YR]) + 1900;
        if (tm->tm_year < 1970)
                tm->tm_year += 100;     /* assume we are in 1970...2069 */
index 6a19fe1d23fe242d307ff47fb7c0fa77d0ba8e82..5211d0758689cf2b889f7ae887ef7664e938dc76 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  *
  * Author:     Priyanka Jain <Priyanka.Jain@freescale.com>
  */
@@ -19,6 +20,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <dm.h>
 #include <rtc.h>
 #include <i2c.h>
 
@@ -46,6 +48,7 @@
 #define RTC_PT7C4338_RESET_VAL \
        (RTC_CTL_STAT_BIT_RS0 | RTC_CTL_STAT_BIT_RS1 | RTC_CTL_STAT_BIT_OUT)
 
+#if !CONFIG_IS_ENABLED(DM_RTC)
 /****** Helper functions ****************************************/
 static u8 rtc_read(u8 reg)
 {
@@ -125,3 +128,100 @@ void rtc_reset(void)
        rtc_write(RTC_SEC_REG_ADDR, 0x00);      /* clearing Clock Halt  */
        rtc_write(RTC_CTL_STAT_REG_ADDR, RTC_PT7C4338_RESET_VAL);
 }
+#else
+static u8 rtc_read(struct udevice *dev, u8 reg)
+{
+       return dm_i2c_reg_read(dev, reg);
+}
+
+static void rtc_write(struct udevice *dev, u8 reg, u8 val)
+{
+       dm_i2c_reg_write(dev, reg, val);
+}
+
+static int pt7c4338_rtc_get(struct udevice *dev, struct rtc_time *tmp)
+{
+       int ret = 0;
+       u8 sec, min, hour, mday, wday, mon, year, ctl_stat;
+
+       ctl_stat = rtc_read(dev, RTC_CTL_STAT_REG_ADDR);
+       sec = rtc_read(dev, RTC_SEC_REG_ADDR);
+       min = rtc_read(dev, RTC_MIN_REG_ADDR);
+       hour = rtc_read(dev, RTC_HR_REG_ADDR);
+       wday = rtc_read(dev, RTC_DAY_REG_ADDR);
+       mday = rtc_read(dev, RTC_DATE_REG_ADDR);
+       mon = rtc_read(dev, RTC_MON_REG_ADDR);
+       year = rtc_read(dev, RTC_YR_REG_ADDR);
+       debug("Get RTC year: %02x mon: %02x mday: %02x wday: %02x\n",
+             year, mon, mday, wday);
+       debug("hr: %02x min: %02x sec: %02x control_status: %02x\n",
+             hour, min, sec, ctl_stat);
+
+       if (ctl_stat & RTC_CTL_STAT_BIT_OSF) {
+               printf("### Warning: RTC oscillator has stopped\n");
+               /* clear the OSF flag */
+               rtc_write(dev, RTC_CTL_STAT_REG_ADDR,
+                         rtc_read(dev,
+                                  RTC_CTL_STAT_REG_ADDR)
+                                  & ~RTC_CTL_STAT_BIT_OSF);
+               ret = -1;
+       }
+
+       tmp->tm_sec = bcd2bin(sec & 0x7F);
+       tmp->tm_min = bcd2bin(min & 0x7F);
+       tmp->tm_hour = bcd2bin(hour & 0x3F);
+       tmp->tm_mday = bcd2bin(mday & 0x3F);
+       tmp->tm_mon = bcd2bin(mon & 0x1F);
+       tmp->tm_year = bcd2bin(year) + 2000;
+       tmp->tm_wday = bcd2bin((wday - 1) & 0x07);
+       tmp->tm_yday = 0;
+       tmp->tm_isdst = 0;
+       debug("Get DATE: %4d-%02d-%02d [wday=%d]  TIME: %2d:%02d:%02d\n",
+             tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+             tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return ret;
+}
+
+static int pt7c4338_rtc_set(struct udevice *dev, const struct rtc_time *tmp)
+{
+       debug("Set DATE: %4d-%02d-%02d [wday=%d]  TIME: %2d:%02d:%02d\n",
+             tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+             tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       rtc_write(dev, RTC_YR_REG_ADDR, bin2bcd(tmp->tm_year % 100));
+       rtc_write(dev, RTC_MON_REG_ADDR, bin2bcd(tmp->tm_mon));
+       rtc_write(dev, RTC_DAY_REG_ADDR, bin2bcd(tmp->tm_wday + 1));
+       rtc_write(dev, RTC_DATE_REG_ADDR, bin2bcd(tmp->tm_mday));
+       rtc_write(dev, RTC_HR_REG_ADDR, bin2bcd(tmp->tm_hour));
+       rtc_write(dev, RTC_MIN_REG_ADDR, bin2bcd(tmp->tm_min));
+       rtc_write(dev, RTC_SEC_REG_ADDR, bin2bcd(tmp->tm_sec));
+
+       return 0;
+}
+
+static int pt7c4338_rtc_reset(struct udevice *dev)
+{
+       rtc_write(dev, RTC_SEC_REG_ADDR, 0x00); /* clearing Clock Halt  */
+       rtc_write(dev, RTC_CTL_STAT_REG_ADDR, RTC_PT7C4338_RESET_VAL);
+       return 0;
+}
+
+static const struct rtc_ops pt7c4338_rtc_ops = {
+       .get = pt7c4338_rtc_get,
+       .set = pt7c4338_rtc_set,
+       .reset = pt7c4338_rtc_reset,
+};
+
+static const struct udevice_id pt7c4338_rtc_ids[] = {
+       { .compatible = "pericom,pt7c4338" },
+       { }
+};
+
+U_BOOT_DRIVER(rtc_pt7c4338) = {
+       .name   = "rtc-pt7c4338",
+       .id     = UCLASS_RTC,
+       .of_match = pt7c4338_rtc_ids,
+       .ops    = &pt7c4338_rtc_ops,
+};
+#endif
index 2a5f256184f2c195ed0088a211f31ca59540ab8c..6e5d81ce34a422663b41d5716ee0755b6bc1b034 100644 (file)
 /* Simple U-Boot driver for the PrimeCell PL010/PL011 UARTs */
 
 #include <common.h>
+/* For get_bus_freq() */
+#include <clock_legacy.h>
 #include <dm.h>
+#include <clk.h>
 #include <errno.h>
 #include <watchdog.h>
 #include <asm/io.h>
@@ -149,21 +152,24 @@ static int pl01x_generic_setbrg(struct pl01x_regs *regs, enum pl01x_type type,
                unsigned int remainder;
                unsigned int fraction;
 
-               /*
-               * Set baud rate
-               *
-               * IBRD = UART_CLK / (16 * BAUD_RATE)
-               * FBRD = RND((64 * MOD(UART_CLK,(16 * BAUD_RATE)))
-               *               / (16 * BAUD_RATE))
-               */
-               temp = 16 * baudrate;
-               divider = clock / temp;
-               remainder = clock % temp;
-               temp = (8 * remainder) / baudrate;
-               fraction = (temp >> 1) + (temp & 1);
-
-               writel(divider, &regs->pl011_ibrd);
-               writel(fraction, &regs->pl011_fbrd);
+               /* Without a valid clock rate we cannot set up the baudrate. */
+               if (clock) {
+                       /*
+                        * Set baud rate
+                        *
+                        * IBRD = UART_CLK / (16 * BAUD_RATE)
+                        * FBRD = RND((64 * MOD(UART_CLK,(16 * BAUD_RATE)))
+                        *              / (16 * BAUD_RATE))
+                        */
+                       temp = 16 * baudrate;
+                       divider = clock / temp;
+                       remainder = clock % temp;
+                       temp = (8 * remainder) / baudrate;
+                       fraction = (temp >> 1) + (temp & 1);
+
+                       writel(divider, &regs->pl011_ibrd);
+                       writel(fraction, &regs->pl011_fbrd);
+               }
 
                pl011_set_line_control(regs);
                /* Finally, enable the UART */
@@ -337,17 +343,28 @@ static const struct udevice_id pl01x_serial_id[] ={
        {}
 };
 
+#ifndef CONFIG_PL011_CLOCK
+#define CONFIG_PL011_CLOCK 0
+#endif
+
 int pl01x_serial_ofdata_to_platdata(struct udevice *dev)
 {
        struct pl01x_serial_platdata *plat = dev_get_platdata(dev);
+       struct clk clk;
        fdt_addr_t addr;
+       int ret;
 
        addr = devfdt_get_addr(dev);
        if (addr == FDT_ADDR_T_NONE)
                return -EINVAL;
 
        plat->base = addr;
-       plat->clock = dev_read_u32_default(dev, "clock", 1);
+       plat->clock = dev_read_u32_default(dev, "clock", CONFIG_PL011_CLOCK);
+       ret = clk_get_by_index(dev, 0, &clk);
+       if (!ret) {
+               clk_enable(&clk);
+               plat->clock = clk_get_rate(&clk);
+       }
        plat->type = dev_get_driver_data(dev);
        plat->skip_init = dev_read_bool(dev, "skip-init");
 
index 83b114ffe741cfc6f8e90b4c648840f6acb48402..994a5948f1ee99568d17031f1e57b7a78749a00d 100644 (file)
@@ -166,11 +166,28 @@ static int cadence_spi_probe(struct udevice *bus)
 {
        struct cadence_spi_platdata *plat = bus->platdata;
        struct cadence_spi_priv *priv = dev_get_priv(bus);
+       struct clk clk;
        int ret;
 
        priv->regbase = plat->regbase;
        priv->ahbbase = plat->ahbbase;
 
+       if (plat->ref_clk_hz == 0) {
+               ret = clk_get_by_index(bus, 0, &clk);
+               if (ret) {
+#ifdef CONFIG_CQSPI_REF_CLK
+                       plat->ref_clk_hz = CONFIG_CQSPI_REF_CLK;
+#else
+                       return ret;
+#endif
+               } else {
+                       plat->ref_clk_hz = clk_get_rate(&clk);
+                       clk_free(&clk);
+                       if (IS_ERR_VALUE(plat->ref_clk_hz))
+                               return plat->ref_clk_hz;
+               }
+       }
+
        ret = reset_get_bulk(bus, &priv->resets);
        if (ret)
                dev_warn(bus, "Can't get reset: %d\n", ret);
@@ -268,8 +285,6 @@ static int cadence_spi_ofdata_to_platdata(struct udevice *bus)
 {
        struct cadence_spi_platdata *plat = bus->platdata;
        ofnode subnode;
-       struct clk clk;
-       int ret;
 
        plat->regbase = (void *)devfdt_get_addr_index(bus, 0);
        plat->ahbbase = (void *)devfdt_get_addr_size_index(bus, 1,
@@ -305,20 +320,6 @@ static int cadence_spi_ofdata_to_platdata(struct udevice *bus)
        plat->tchsh_ns = ofnode_read_u32_default(subnode, "cdns,tchsh-ns", 20);
        plat->tslch_ns = ofnode_read_u32_default(subnode, "cdns,tslch-ns", 20);
 
-       ret = clk_get_by_index(bus, 0, &clk);
-       if (ret) {
-#ifdef CONFIG_CQSPI_REF_CLK
-               plat->ref_clk_hz = CONFIG_CQSPI_REF_CLK;
-#else
-               return ret;
-#endif
-       } else {
-               plat->ref_clk_hz = clk_get_rate(&clk);
-               clk_free(&clk);
-               if (IS_ERR_VALUE(plat->ref_clk_hz))
-                       return plat->ref_clk_hz;
-       }
-
        debug("%s: regbase=%p ahbbase=%p max-frequency=%d page-size=%d\n",
              __func__, plat->regbase, plat->ahbbase, plat->max_hz,
              plat->page_size);
index 8e2a09df3661293caa4fdd3a01c030a1bced73bf..ee2c8b67dc91f6bf5bb46f7c02d33166324aa41e 100644 (file)
 // SPDX-License-Identifier: GPL-2.0+
+
 /*
- * Copyright 2013-2015 Freescale Semiconductor, Inc.
+ * Freescale QuadSPI driver.
+ *
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ * Copyright (C) 2018 Bootlin
+ * Copyright (C) 2018 exceet electronics GmbH
+ * Copyright (C) 2018 Kontron Electronics GmbH
+ * Copyright 2019-2020 NXP
+ *
+ * This driver is a ported version of Linux Freescale QSPI driver taken from
+ * v5.5-rc1 tag having following information.
  *
- * Freescale Quad Serial Peripheral Interface (QSPI) driver
+ * Transition to SPI MEM interface:
+ * Authors:
+ *     Boris Brezillon <bbrezillon@kernel.org>
+ *     Frieder Schrempf <frieder.schrempf@kontron.de>
+ *     Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
+ *     Suresh Gupta <suresh.gupta@nxp.com>
+ *
+ * Based on the original fsl-quadspi.c spi-nor driver.
+ * Transition to spi-mem in spi-fsl-qspi.c
  */
 
 #include <common.h>
-#include <malloc.h>
-#include <spi.h>
 #include <asm/io.h>
-#include <linux/sizes.h>
-#include <linux/iopoll.h>
 #include <dm.h>
-#include <errno.h>
-#include <watchdog.h>
-#include <wait_bit.h>
-#include "fsl_qspi.h"
+#include <linux/iopoll.h>
+#include <linux/sizes.h>
+#include <linux/err.h>
+#include <spi.h>
+#include <spi-mem.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define OFFSET_BITS_MASK       GENMASK(23, 0)
-
-#define FLASH_STATUS_WEL       0x02
-
-/* SEQID */
-#define SEQID_WREN             1
-#define SEQID_FAST_READ                2
-#define SEQID_RDSR             3
-#define SEQID_SE               4
-#define SEQID_CHIP_ERASE       5
-#define SEQID_PP               6
-#define SEQID_RDID             7
-#define SEQID_BE_4K            8
-#ifdef CONFIG_SPI_FLASH_BAR
-#define SEQID_BRRD             9
-#define SEQID_BRWR             10
-#define SEQID_RDEAR            11
-#define SEQID_WREAR            12
-#endif
-#define SEQID_WRAR             13
-#define SEQID_RDAR             14
-
-/* QSPI CMD */
-#define QSPI_CMD_PP            0x02    /* Page program (up to 256 bytes) */
-#define QSPI_CMD_RDSR          0x05    /* Read status register */
-#define QSPI_CMD_WREN          0x06    /* Write enable */
-#define QSPI_CMD_FAST_READ     0x0b    /* Read data bytes (high frequency) */
-#define QSPI_CMD_BE_4K         0x20    /* 4K erase */
-#define QSPI_CMD_CHIP_ERASE    0xc7    /* Erase whole flash chip */
-#define QSPI_CMD_SE            0xd8    /* Sector erase (usually 64KiB) */
-#define QSPI_CMD_RDID          0x9f    /* Read JEDEC ID */
-
-/* Used for Micron, winbond and Macronix flashes */
-#define        QSPI_CMD_WREAR          0xc5    /* EAR register write */
-#define        QSPI_CMD_RDEAR          0xc8    /* EAR reigster read */
-
-/* Used for Spansion flashes only. */
-#define        QSPI_CMD_BRRD           0x16    /* Bank register read */
-#define        QSPI_CMD_BRWR           0x17    /* Bank register write */
-
-/* Used for Spansion S25FS-S family flash only. */
-#define QSPI_CMD_RDAR          0x65    /* Read any device register */
-#define QSPI_CMD_WRAR          0x71    /* Write any device register */
-
-/* 4-byte address QSPI CMD - used on Spansion and some Macronix flashes */
-#define QSPI_CMD_FAST_READ_4B  0x0c    /* Read data bytes (high frequency) */
-#define QSPI_CMD_PP_4B         0x12    /* Page program (up to 256 bytes) */
-#define QSPI_CMD_SE_4B         0xdc    /* Sector erase (usually 64KiB) */
-
-/* fsl_qspi_platdata flags */
-#define QSPI_FLAG_REGMAP_ENDIAN_BIG    BIT(0)
-
-/* default SCK frequency, unit: HZ */
-#define FSL_QSPI_DEFAULT_SCK_FREQ      50000000
-
-/* QSPI max chipselect signals number */
-#define FSL_QSPI_MAX_CHIPSELECT_NUM     4
-
-/* Controller needs driver to swap endian */
+/*
+ * The driver only uses one single LUT entry, that is updated on
+ * each call of exec_op(). Index 0 is preset at boot with a basic
+ * read operation, so let's use the last entry (15).
+ */
+#define        SEQID_LUT                       15
+
+/* Registers used by the driver */
+#define QUADSPI_MCR                    0x00
+#define QUADSPI_MCR_RESERVED_MASK      GENMASK(19, 16)
+#define QUADSPI_MCR_MDIS_MASK          BIT(14)
+#define QUADSPI_MCR_CLR_TXF_MASK       BIT(11)
+#define QUADSPI_MCR_CLR_RXF_MASK       BIT(10)
+#define QUADSPI_MCR_DDR_EN_MASK                BIT(7)
+#define QUADSPI_MCR_END_CFG_MASK       GENMASK(3, 2)
+#define QUADSPI_MCR_SWRSTHD_MASK       BIT(1)
+#define QUADSPI_MCR_SWRSTSD_MASK       BIT(0)
+
+#define QUADSPI_IPCR                   0x08
+#define QUADSPI_IPCR_SEQID(x)          ((x) << 24)
+#define QUADSPI_FLSHCR                 0x0c
+#define QUADSPI_FLSHCR_TCSS_MASK       GENMASK(3, 0)
+#define QUADSPI_FLSHCR_TCSH_MASK       GENMASK(11, 8)
+#define QUADSPI_FLSHCR_TDH_MASK                GENMASK(17, 16)
+
+#define QUADSPI_BUF3CR                 0x1c
+#define QUADSPI_BUF3CR_ALLMST_MASK     BIT(31)
+#define QUADSPI_BUF3CR_ADATSZ(x)       ((x) << 8)
+#define QUADSPI_BUF3CR_ADATSZ_MASK     GENMASK(15, 8)
+
+#define QUADSPI_BFGENCR                        0x20
+#define QUADSPI_BFGENCR_SEQID(x)       ((x) << 12)
+
+#define QUADSPI_BUF0IND                        0x30
+#define QUADSPI_BUF1IND                        0x34
+#define QUADSPI_BUF2IND                        0x38
+#define QUADSPI_SFAR                   0x100
+
+#define QUADSPI_SMPR                   0x108
+#define QUADSPI_SMPR_DDRSMP_MASK       GENMASK(18, 16)
+#define QUADSPI_SMPR_FSDLY_MASK                BIT(6)
+#define QUADSPI_SMPR_FSPHS_MASK                BIT(5)
+#define QUADSPI_SMPR_HSENA_MASK                BIT(0)
+
+#define QUADSPI_RBCT                   0x110
+#define QUADSPI_RBCT_WMRK_MASK         GENMASK(4, 0)
+#define QUADSPI_RBCT_RXBRD_USEIPS      BIT(8)
+
+#define QUADSPI_TBDR                   0x154
+
+#define QUADSPI_SR                     0x15c
+#define QUADSPI_SR_IP_ACC_MASK         BIT(1)
+#define QUADSPI_SR_AHB_ACC_MASK                BIT(2)
+
+#define QUADSPI_FR                     0x160
+#define QUADSPI_FR_TFF_MASK            BIT(0)
+
+#define QUADSPI_RSER                   0x164
+#define QUADSPI_RSER_TFIE              BIT(0)
+
+#define QUADSPI_SPTRCLR                        0x16c
+#define QUADSPI_SPTRCLR_IPPTRC         BIT(8)
+#define QUADSPI_SPTRCLR_BFPTRC         BIT(0)
+
+#define QUADSPI_SFA1AD                 0x180
+#define QUADSPI_SFA2AD                 0x184
+#define QUADSPI_SFB1AD                 0x188
+#define QUADSPI_SFB2AD                 0x18c
+#define QUADSPI_RBDR(x)                        (0x200 + ((x) * 4))
+
+#define QUADSPI_LUTKEY                 0x300
+#define QUADSPI_LUTKEY_VALUE           0x5AF05AF0
+
+#define QUADSPI_LCKCR                  0x304
+#define QUADSPI_LCKER_LOCK             BIT(0)
+#define QUADSPI_LCKER_UNLOCK           BIT(1)
+
+#define QUADSPI_LUT_BASE               0x310
+#define QUADSPI_LUT_OFFSET             (SEQID_LUT * 4 * 4)
+#define QUADSPI_LUT_REG(idx) \
+       (QUADSPI_LUT_BASE + QUADSPI_LUT_OFFSET + (idx) * 4)
+
+/* Instruction set for the LUT register */
+#define LUT_STOP               0
+#define LUT_CMD                        1
+#define LUT_ADDR               2
+#define LUT_DUMMY              3
+#define LUT_MODE               4
+#define LUT_MODE2              5
+#define LUT_MODE4              6
+#define LUT_FSL_READ           7
+#define LUT_FSL_WRITE          8
+#define LUT_JMP_ON_CS          9
+#define LUT_ADDR_DDR           10
+#define LUT_MODE_DDR           11
+#define LUT_MODE2_DDR          12
+#define LUT_MODE4_DDR          13
+#define LUT_FSL_READ_DDR       14
+#define LUT_FSL_WRITE_DDR      15
+#define LUT_DATA_LEARN         16
+
+/*
+ * The PAD definitions for LUT register.
+ *
+ * The pad stands for the number of IO lines [0:3].
+ * For example, the quad read needs four IO lines,
+ * so you should use LUT_PAD(4).
+ */
+#define LUT_PAD(x) (fls(x) - 1)
+
+/*
+ * Macro for constructing the LUT entries with the following
+ * register layout:
+ *
+ *  ---------------------------------------------------
+ *  | INSTR1 | PAD1 | OPRND1 | INSTR0 | PAD0 | OPRND0 |
+ *  ---------------------------------------------------
+ */
+#define LUT_DEF(idx, ins, pad, opr)                                    \
+       ((((ins) << 10) | ((pad) << 8) | (opr)) << (((idx) % 2) * 16))
+
+/* Controller needs driver to swap endianness */
 #define QUADSPI_QUIRK_SWAP_ENDIAN      BIT(0)
 
-enum fsl_qspi_devtype {
-       FSL_QUADSPI_VYBRID,
-       FSL_QUADSPI_IMX6SX,
-       FSL_QUADSPI_IMX6UL_7D,
-       FSL_QUADSPI_IMX7ULP,
-};
+/* Controller needs 4x internal clock */
+#define QUADSPI_QUIRK_4X_INT_CLK       BIT(1)
 
-struct fsl_qspi_devtype_data {
-       enum fsl_qspi_devtype devtype;
-       u32 rxfifo;
-       u32 txfifo;
-       u32 ahb_buf_size;
-       u32 driver_data;
-};
+/*
+ * TKT253890, the controller needs the driver to fill the txfifo with
+ * 16 bytes at least to trigger a data transfer, even though the extra
+ * data won't be transferred.
+ */
+#define QUADSPI_QUIRK_TKT253890                BIT(2)
 
-/**
- * struct fsl_qspi_platdata - platform data for Freescale QSPI
- *
- * @flags: Flags for QSPI QSPI_FLAG_...
- * @speed_hz: Default SCK frequency
- * @reg_base: Base address of QSPI registers
- * @amba_base: Base address of QSPI memory mapping
- * @amba_total_size: size of QSPI memory mapping
- * @flash_num: Number of active slave devices
- * @num_chipselect: Number of QSPI chipselect signals
+/* TKT245618, the controller cannot wake up from wait mode */
+#define QUADSPI_QUIRK_TKT245618                BIT(3)
+
+/*
+ * Controller adds QSPI_AMBA_BASE (base address of the mapped memory)
+ * internally. No need to add it when setting SFXXAD and SFAR registers
  */
-struct fsl_qspi_platdata {
-       u32 flags;
-       u32 speed_hz;
-       fdt_addr_t reg_base;
-       fdt_addr_t amba_base;
-       fdt_size_t amba_total_size;
-       u32 flash_num;
-       u32 num_chipselect;
-};
+#define QUADSPI_QUIRK_BASE_INTERNAL    BIT(4)
 
-/**
- * struct fsl_qspi_priv - private data for Freescale QSPI
- *
- * @flags: Flags for QSPI QSPI_FLAG_...
- * @bus_clk: QSPI input clk frequency
- * @speed_hz: Default SCK frequency
- * @cur_seqid: current LUT table sequence id
- * @sf_addr: flash access offset
- * @amba_base: Base address of QSPI memory mapping of every CS
- * @amba_total_size: size of QSPI memory mapping
- * @cur_amba_base: Base address of QSPI memory mapping of current CS
- * @flash_num: Number of active slave devices
- * @num_chipselect: Number of QSPI chipselect signals
- * @regs: Point to QSPI register structure for I/O access
+/*
+ * Controller uses TDH bits in register QUADSPI_FLSHCR.
+ * They need to be set in accordance with the DDR/SDR mode.
  */
-struct fsl_qspi_priv {
-       u32 flags;
-       u32 bus_clk;
-       u32 speed_hz;
-       u32 cur_seqid;
-       u32 sf_addr;
-       u32 amba_base[FSL_QSPI_MAX_CHIPSELECT_NUM];
-       u32 amba_total_size;
-       u32 cur_amba_base;
-       u32 flash_num;
-       u32 num_chipselect;
-       struct fsl_qspi_regs *regs;
-       struct fsl_qspi_devtype_data *devtype_data;
+#define QUADSPI_QUIRK_USE_TDH_SETTING  BIT(5)
+
+struct fsl_qspi_devtype_data {
+       unsigned int rxfifo;
+       unsigned int txfifo;
+       unsigned int ahb_buf_size;
+       unsigned int quirks;
+       bool little_endian;
 };
 
 static const struct fsl_qspi_devtype_data vybrid_data = {
-       .devtype = FSL_QUADSPI_VYBRID,
-       .rxfifo = 128,
-       .txfifo = 64,
-       .ahb_buf_size = 1024,
-       .driver_data = QUADSPI_QUIRK_SWAP_ENDIAN,
+       .rxfifo = SZ_128,
+       .txfifo = SZ_64,
+       .ahb_buf_size = SZ_1K,
+       .quirks = QUADSPI_QUIRK_SWAP_ENDIAN,
+       .little_endian = true,
 };
 
 static const struct fsl_qspi_devtype_data imx6sx_data = {
-       .devtype = FSL_QUADSPI_IMX6SX,
-       .rxfifo = 128,
-       .txfifo = 512,
-       .ahb_buf_size = 1024,
-       .driver_data = 0,
+       .rxfifo = SZ_128,
+       .txfifo = SZ_512,
+       .ahb_buf_size = SZ_1K,
+       .quirks = QUADSPI_QUIRK_4X_INT_CLK | QUADSPI_QUIRK_TKT245618,
+       .little_endian = true,
+};
+
+static const struct fsl_qspi_devtype_data imx7d_data = {
+       .rxfifo = SZ_128,
+       .txfifo = SZ_512,
+       .ahb_buf_size = SZ_1K,
+       .quirks = QUADSPI_QUIRK_TKT253890 | QUADSPI_QUIRK_4X_INT_CLK |
+                 QUADSPI_QUIRK_USE_TDH_SETTING,
+       .little_endian = true,
 };
 
-static const struct fsl_qspi_devtype_data imx6ul_7d_data = {
-       .devtype = FSL_QUADSPI_IMX6UL_7D,
-       .rxfifo = 128,
-       .txfifo = 512,
-       .ahb_buf_size = 1024,
-       .driver_data = 0,
+static const struct fsl_qspi_devtype_data imx6ul_data = {
+       .rxfifo = SZ_128,
+       .txfifo = SZ_512,
+       .ahb_buf_size = SZ_1K,
+       .quirks = QUADSPI_QUIRK_TKT253890 | QUADSPI_QUIRK_4X_INT_CLK |
+                 QUADSPI_QUIRK_USE_TDH_SETTING,
+       .little_endian = true,
 };
 
-static const struct fsl_qspi_devtype_data imx7ulp_data = {
-       .devtype = FSL_QUADSPI_IMX7ULP,
-       .rxfifo = 64,
-       .txfifo = 64,
-       .ahb_buf_size = 128,
-       .driver_data = 0,
+static const struct fsl_qspi_devtype_data ls1021a_data = {
+       .rxfifo = SZ_128,
+       .txfifo = SZ_64,
+       .ahb_buf_size = SZ_1K,
+       .quirks = 0,
+       .little_endian = false,
 };
 
-static u32 qspi_read32(u32 flags, u32 *addr)
+static const struct fsl_qspi_devtype_data ls1088a_data = {
+       .rxfifo = SZ_128,
+       .txfifo = SZ_128,
+       .ahb_buf_size = SZ_1K,
+       .quirks = QUADSPI_QUIRK_TKT253890,
+       .little_endian = true,
+};
+
+static const struct fsl_qspi_devtype_data ls2080a_data = {
+       .rxfifo = SZ_128,
+       .txfifo = SZ_64,
+       .ahb_buf_size = SZ_1K,
+       .quirks = QUADSPI_QUIRK_TKT253890 | QUADSPI_QUIRK_BASE_INTERNAL,
+       .little_endian = true,
+};
+
+struct fsl_qspi {
+       struct udevice *dev;
+       void __iomem *iobase;
+       void __iomem *ahb_addr;
+       u32 memmap_phy;
+       const struct fsl_qspi_devtype_data *devtype_data;
+       int selected;
+};
+
+static inline int needs_swap_endian(struct fsl_qspi *q)
 {
-       return flags & QSPI_FLAG_REGMAP_ENDIAN_BIG ?
-               in_be32(addr) : in_le32(addr);
+       return q->devtype_data->quirks & QUADSPI_QUIRK_SWAP_ENDIAN;
 }
 
-static void qspi_write32(u32 flags, u32 *addr, u32 val)
+static inline int needs_4x_clock(struct fsl_qspi *q)
 {
-       flags & QSPI_FLAG_REGMAP_ENDIAN_BIG ?
-               out_be32(addr, val) : out_le32(addr, val);
+       return q->devtype_data->quirks & QUADSPI_QUIRK_4X_INT_CLK;
 }
 
-static inline int is_controller_busy(const struct fsl_qspi_priv *priv)
+static inline int needs_fill_txfifo(struct fsl_qspi *q)
 {
-       u32 val;
-       u32 mask = QSPI_SR_BUSY_MASK | QSPI_SR_AHB_ACC_MASK |
-                  QSPI_SR_IP_ACC_MASK;
-
-       if (priv->flags & QSPI_FLAG_REGMAP_ENDIAN_BIG)
-               mask = (u32)cpu_to_be32(mask);
-
-       return readl_poll_timeout(&priv->regs->sr, val, !(val & mask), 1000);
+       return q->devtype_data->quirks & QUADSPI_QUIRK_TKT253890;
 }
 
-/* QSPI support swapping the flash read/write data
- * in hardware for LS102xA, but not for VF610 */
-static inline u32 qspi_endian_xchg(struct fsl_qspi_priv *priv, u32 data)
+static inline int needs_wakeup_wait_mode(struct fsl_qspi *q)
 {
-       if (priv->devtype_data->driver_data & QUADSPI_QUIRK_SWAP_ENDIAN)
-               return swab32(data);
-       else
-               return data;
+       return q->devtype_data->quirks & QUADSPI_QUIRK_TKT245618;
 }
 
-static void qspi_set_lut(struct fsl_qspi_priv *priv)
+static inline int needs_amba_base_offset(struct fsl_qspi *q)
 {
-       struct fsl_qspi_regs *regs = priv->regs;
-       u32 lut_base;
-
-       /* Unlock the LUT */
-       qspi_write32(priv->flags, &regs->lutkey, LUT_KEY_VALUE);
-       qspi_write32(priv->flags, &regs->lckcr, QSPI_LCKCR_UNLOCK);
-
-       /* Write Enable */
-       lut_base = SEQID_WREN * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_WREN) |
-               PAD0(LUT_PAD1) | INSTR0(LUT_CMD));
-       qspi_write32(priv->flags, &regs->lut[lut_base + 1], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 2], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 3], 0);
-
-       /* Fast Read */
-       lut_base = SEQID_FAST_READ * 4;
-#ifdef CONFIG_SPI_FLASH_BAR
-       qspi_write32(priv->flags, &regs->lut[lut_base],
-                    OPRND0(QSPI_CMD_FAST_READ) | PAD0(LUT_PAD1) |
-                    INSTR0(LUT_CMD) | OPRND1(ADDR24BIT) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-#else
-       if (FSL_QSPI_FLASH_SIZE  <= SZ_16M)
-               qspi_write32(priv->flags, &regs->lut[lut_base],
-                            OPRND0(QSPI_CMD_FAST_READ) | PAD0(LUT_PAD1) |
-                            INSTR0(LUT_CMD) | OPRND1(ADDR24BIT) |
-                            PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-       else
-               qspi_write32(priv->flags, &regs->lut[lut_base],
-                            OPRND0(QSPI_CMD_FAST_READ_4B) |
-                            PAD0(LUT_PAD1) | INSTR0(LUT_CMD) |
-                            OPRND1(ADDR32BIT) | PAD1(LUT_PAD1) |
-                            INSTR1(LUT_ADDR));
-#endif
-       qspi_write32(priv->flags, &regs->lut[lut_base + 1],
-                    OPRND0(8) | PAD0(LUT_PAD1) | INSTR0(LUT_DUMMY) |
-                    OPRND1(priv->devtype_data->rxfifo) | PAD1(LUT_PAD1) |
-                    INSTR1(LUT_READ));
-       qspi_write32(priv->flags, &regs->lut[lut_base + 2], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 3], 0);
-
-       /* Read Status */
-       lut_base = SEQID_RDSR * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_RDSR) |
-               PAD0(LUT_PAD1) | INSTR0(LUT_CMD) | OPRND1(1) |
-               PAD1(LUT_PAD1) | INSTR1(LUT_READ));
-       qspi_write32(priv->flags, &regs->lut[lut_base + 1], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 2], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 3], 0);
-
-       /* Erase a sector */
-       lut_base = SEQID_SE * 4;
-#ifdef CONFIG_SPI_FLASH_BAR
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_SE) |
-                    PAD0(LUT_PAD1) | INSTR0(LUT_CMD) | OPRND1(ADDR24BIT) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-#else
-       if (FSL_QSPI_FLASH_SIZE  <= SZ_16M)
-               qspi_write32(priv->flags, &regs->lut[lut_base],
-                            OPRND0(QSPI_CMD_SE) | PAD0(LUT_PAD1) |
-                            INSTR0(LUT_CMD) | OPRND1(ADDR24BIT) |
-                            PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-       else
-               qspi_write32(priv->flags, &regs->lut[lut_base],
-                            OPRND0(QSPI_CMD_SE_4B) | PAD0(LUT_PAD1) |
-                            INSTR0(LUT_CMD) | OPRND1(ADDR32BIT) |
-                            PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-#endif
-       qspi_write32(priv->flags, &regs->lut[lut_base + 1], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 2], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 3], 0);
-
-       /* Erase the whole chip */
-       lut_base = SEQID_CHIP_ERASE * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base],
-                    OPRND0(QSPI_CMD_CHIP_ERASE) |
-                    PAD0(LUT_PAD1) | INSTR0(LUT_CMD));
-       qspi_write32(priv->flags, &regs->lut[lut_base + 1], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 2], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 3], 0);
-
-       /* Page Program */
-       lut_base = SEQID_PP * 4;
-#ifdef CONFIG_SPI_FLASH_BAR
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_PP) |
-                    PAD0(LUT_PAD1) | INSTR0(LUT_CMD) | OPRND1(ADDR24BIT) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-#else
-       if (FSL_QSPI_FLASH_SIZE  <= SZ_16M)
-               qspi_write32(priv->flags, &regs->lut[lut_base],
-                            OPRND0(QSPI_CMD_PP) | PAD0(LUT_PAD1) |
-                            INSTR0(LUT_CMD) | OPRND1(ADDR24BIT) |
-                            PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-       else
-               qspi_write32(priv->flags, &regs->lut[lut_base],
-                            OPRND0(QSPI_CMD_PP_4B) | PAD0(LUT_PAD1) |
-                            INSTR0(LUT_CMD) | OPRND1(ADDR32BIT) |
-                            PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-#endif
-       /* Use IDATSZ in IPCR to determine the size and here set 0. */
-       qspi_write32(priv->flags, &regs->lut[lut_base + 1], OPRND0(0) |
-                    PAD0(LUT_PAD1) | INSTR0(LUT_WRITE));
-       qspi_write32(priv->flags, &regs->lut[lut_base + 2], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 3], 0);
-
-       /* READ ID */
-       lut_base = SEQID_RDID * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_RDID) |
-               PAD0(LUT_PAD1) | INSTR0(LUT_CMD) | OPRND1(8) |
-               PAD1(LUT_PAD1) | INSTR1(LUT_READ));
-       qspi_write32(priv->flags, &regs->lut[lut_base + 1], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 2], 0);
-       qspi_write32(priv->flags, &regs->lut[lut_base + 3], 0);
-
-       /* SUB SECTOR 4K ERASE */
-       lut_base = SEQID_BE_4K * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_BE_4K) |
-                    PAD0(LUT_PAD1) | INSTR0(LUT_CMD) | OPRND1(ADDR24BIT) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-
-#ifdef CONFIG_SPI_FLASH_BAR
-       /*
-        * BRRD BRWR RDEAR WREAR are all supported, because it is hard to
-        * dynamically check whether to set BRRD BRWR or RDEAR WREAR during
-        * initialization.
-        */
-       lut_base = SEQID_BRRD * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_BRRD) |
-                    PAD0(LUT_PAD1) | INSTR0(LUT_CMD) | OPRND1(1) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_READ));
-
-       lut_base = SEQID_BRWR * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_BRWR) |
-                    PAD0(LUT_PAD1) | INSTR0(LUT_CMD) | OPRND1(1) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_WRITE));
-
-       lut_base = SEQID_RDEAR * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_RDEAR) |
-                    PAD0(LUT_PAD1) | INSTR0(LUT_CMD) | OPRND1(1) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_READ));
-
-       lut_base = SEQID_WREAR * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base], OPRND0(QSPI_CMD_WREAR) |
-                    PAD0(LUT_PAD1) | INSTR0(LUT_CMD) | OPRND1(1) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_WRITE));
-#endif
-
-       /*
-        * Read any device register.
-        * Used for Spansion S25FS-S family flash only.
-        */
-       lut_base = SEQID_RDAR * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base],
-                    OPRND0(QSPI_CMD_RDAR) | PAD0(LUT_PAD1) |
-                    INSTR0(LUT_CMD) | OPRND1(ADDR24BIT) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-       qspi_write32(priv->flags, &regs->lut[lut_base + 1],
-                    OPRND0(8) | PAD0(LUT_PAD1) | INSTR0(LUT_DUMMY) |
-                    OPRND1(1) | PAD1(LUT_PAD1) |
-                    INSTR1(LUT_READ));
+       return !(q->devtype_data->quirks & QUADSPI_QUIRK_BASE_INTERNAL);
+}
 
-       /*
-        * Write any device register.
-        * Used for Spansion S25FS-S family flash only.
-        */
-       lut_base = SEQID_WRAR * 4;
-       qspi_write32(priv->flags, &regs->lut[lut_base],
-                    OPRND0(QSPI_CMD_WRAR) | PAD0(LUT_PAD1) |
-                    INSTR0(LUT_CMD) | OPRND1(ADDR24BIT) |
-                    PAD1(LUT_PAD1) | INSTR1(LUT_ADDR));
-       qspi_write32(priv->flags, &regs->lut[lut_base + 1],
-                    OPRND0(1) | PAD0(LUT_PAD1) | INSTR0(LUT_WRITE));
-
-       /* Lock the LUT */
-       qspi_write32(priv->flags, &regs->lutkey, LUT_KEY_VALUE);
-       qspi_write32(priv->flags, &regs->lckcr, QSPI_LCKCR_LOCK);
+static inline int needs_tdh_setting(struct fsl_qspi *q)
+{
+       return q->devtype_data->quirks & QUADSPI_QUIRK_USE_TDH_SETTING;
 }
 
-#if defined(CONFIG_SYS_FSL_QSPI_AHB)
 /*
- * If we have changed the content of the flash by writing or erasing,
- * we need to invalidate the AHB buffer. If we do not do so, we may read out
- * the wrong data. The spec tells us reset the AHB domain and Serial Flash
- * domain at the same time.
+ * An IC bug makes it necessary to rearrange the 32-bit data.
+ * Later chips, such as IMX6SLX, have fixed this bug.
  */
-static inline void qspi_ahb_invalid(struct fsl_qspi_priv *priv)
+static inline u32 fsl_qspi_endian_xchg(struct fsl_qspi *q, u32 a)
 {
-       struct fsl_qspi_regs *regs = priv->regs;
-       u32 reg;
-
-       reg = qspi_read32(priv->flags, &regs->mcr);
-       reg |= QSPI_MCR_SWRSTHD_MASK | QSPI_MCR_SWRSTSD_MASK;
-       qspi_write32(priv->flags, &regs->mcr, reg);
-
-       /*
-        * The minimum delay : 1 AHB + 2 SFCK clocks.
-        * Delay 1 us is enough.
-        */
-       udelay(1);
-
-       reg &= ~(QSPI_MCR_SWRSTHD_MASK | QSPI_MCR_SWRSTSD_MASK);
-       qspi_write32(priv->flags, &regs->mcr, reg);
+       return needs_swap_endian(q) ? __swab32(a) : a;
 }
 
-/* Read out the data from the AHB buffer. */
-static inline void qspi_ahb_read(struct fsl_qspi_priv *priv, u8 *rxbuf, int len)
+/*
+ * R/W functions for big- or little-endian registers:
+ * The QSPI controller's endianness is independent of
+ * the CPU core's endianness. So far, although the CPU
+ * core is little-endian the QSPI controller can use
+ * big-endian or little-endian.
+ */
+static void qspi_writel(struct fsl_qspi *q, u32 val, void __iomem *addr)
 {
-       struct fsl_qspi_regs *regs = priv->regs;
-       u32 mcr_reg;
-       void *rx_addr;
-
-       mcr_reg = qspi_read32(priv->flags, &regs->mcr);
-
-       qspi_write32(priv->flags, &regs->mcr,
-                    QSPI_MCR_CLR_RXF_MASK | QSPI_MCR_CLR_TXF_MASK |
-                    mcr_reg);
+       if (q->devtype_data->little_endian)
+               out_le32(addr, val);
+       else
+               out_be32(addr, val);
+}
 
-       rx_addr = (void *)(uintptr_t)(priv->cur_amba_base + priv->sf_addr);
-       /* Read out the data directly from the AHB buffer. */
-       memcpy(rxbuf, rx_addr, len);
+static u32 qspi_readl(struct fsl_qspi *q, void __iomem *addr)
+{
+       if (q->devtype_data->little_endian)
+               return in_le32(addr);
 
-       qspi_write32(priv->flags, &regs->mcr, mcr_reg);
+       return in_be32(addr);
 }
 
-static void qspi_enable_ddr_mode(struct fsl_qspi_priv *priv)
+static int fsl_qspi_check_buswidth(struct fsl_qspi *q, u8 width)
 {
-       u32 reg, reg2;
-       struct fsl_qspi_regs *regs = priv->regs;
+       switch (width) {
+       case 1:
+       case 2:
+       case 4:
+               return 0;
+       }
 
-       reg = qspi_read32(priv->flags, &regs->mcr);
-       /* Disable the module */
-       qspi_write32(priv->flags, &regs->mcr, reg | QSPI_MCR_MDIS_MASK);
-
-       /* Set the Sampling Register for DDR */
-       reg2 = qspi_read32(priv->flags, &regs->smpr);
-       reg2 &= ~QSPI_SMPR_DDRSMP_MASK;
-       reg2 |= (2 << QSPI_SMPR_DDRSMP_SHIFT);
-       qspi_write32(priv->flags, &regs->smpr, reg2);
-
-       /* Enable the module again (enable the DDR too) */
-       reg |= QSPI_MCR_DDR_EN_MASK;
-       /* Enable bit 29 for imx6sx */
-       reg |= BIT(29);
-       qspi_write32(priv->flags, &regs->mcr, reg);
-
-       /* Enable the TDH to 1 for some platforms like imx6ul, imx7d, etc
-        * These two bits are reserved on other platforms
-        */
-       reg = qspi_read32(priv->flags, &regs->flshcr);
-       reg &= ~(BIT(17));
-       reg |= BIT(16);
-       qspi_write32(priv->flags, &regs->flshcr, reg);
+       return -ENOTSUPP;
 }
 
-/*
- * There are two different ways to read out the data from the flash:
- *  the "IP Command Read" and the "AHB Command Read".
- *
- * The IC guy suggests we use the "AHB Command Read" which is faster
- * then the "IP Command Read". (What's more is that there is a bug in
- * the "IP Command Read" in the Vybrid.)
- *
- * After we set up the registers for the "AHB Command Read", we can use
- * the memcpy to read the data directly. A "missed" access to the buffer
- * causes the controller to clear the buffer, and use the sequence pointed
- * by the QUADSPI_BFGENCR[SEQID] to initiate a read from the flash.
- */
-static void qspi_init_ahb_read(struct fsl_qspi_priv *priv)
+static bool fsl_qspi_supports_op(struct spi_slave *slave,
+                                const struct spi_mem_op *op)
 {
-       struct fsl_qspi_regs *regs = priv->regs;
+       struct fsl_qspi *q = dev_get_priv(slave->dev->parent);
+       int ret;
+
+       ret = fsl_qspi_check_buswidth(q, op->cmd.buswidth);
+
+       if (op->addr.nbytes)
+               ret |= fsl_qspi_check_buswidth(q, op->addr.buswidth);
+
+       if (op->dummy.nbytes)
+               ret |= fsl_qspi_check_buswidth(q, op->dummy.buswidth);
 
-       /* AHB configuration for access buffer 0/1/2 .*/
-       qspi_write32(priv->flags, &regs->buf0cr, QSPI_BUFXCR_INVALID_MSTRID);
-       qspi_write32(priv->flags, &regs->buf1cr, QSPI_BUFXCR_INVALID_MSTRID);
-       qspi_write32(priv->flags, &regs->buf2cr, QSPI_BUFXCR_INVALID_MSTRID);
-       qspi_write32(priv->flags, &regs->buf3cr, QSPI_BUF3CR_ALLMST_MASK |
-                    ((priv->devtype_data->ahb_buf_size >> 3) << QSPI_BUF3CR_ADATSZ_SHIFT));
+       if (op->data.nbytes)
+               ret |= fsl_qspi_check_buswidth(q, op->data.buswidth);
 
-       /* We only use the buffer3 */
-       qspi_write32(priv->flags, &regs->buf0ind, 0);
-       qspi_write32(priv->flags, &regs->buf1ind, 0);
-       qspi_write32(priv->flags, &regs->buf2ind, 0);
+       if (ret)
+               return false;
 
        /*
-        * Set the default lut sequence for AHB Read.
-        * Parallel mode is disabled.
+        * The number of instructions needed for the op, needs
+        * to fit into a single LUT entry.
         */
-       qspi_write32(priv->flags, &regs->bfgencr,
-                    SEQID_FAST_READ << QSPI_BFGENCR_SEQID_SHIFT);
-
-       /*Enable DDR Mode*/
-       qspi_enable_ddr_mode(priv);
+       if (op->addr.nbytes +
+          (op->dummy.nbytes ? 1 : 0) +
+          (op->data.nbytes ? 1 : 0) > 6)
+               return false;
+
+       /* Max 64 dummy clock cycles supported */
+       if (op->dummy.nbytes &&
+           (op->dummy.nbytes * 8 / op->dummy.buswidth > 64))
+               return false;
+
+       /* Max data length, check controller limits and alignment */
+       if (op->data.dir == SPI_MEM_DATA_IN &&
+           (op->data.nbytes > q->devtype_data->ahb_buf_size ||
+            (op->data.nbytes > q->devtype_data->rxfifo - 4 &&
+             !IS_ALIGNED(op->data.nbytes, 8))))
+               return false;
+
+       if (op->data.dir == SPI_MEM_DATA_OUT &&
+           op->data.nbytes > q->devtype_data->txfifo)
+               return false;
+
+       return true;
 }
-#endif
 
-#ifdef CONFIG_SPI_FLASH_BAR
-/* Bank register read/write, EAR register read/write */
-static void qspi_op_rdbank(struct fsl_qspi_priv *priv, u8 *rxbuf, u32 len)
+static void fsl_qspi_prepare_lut(struct fsl_qspi *q,
+                                const struct spi_mem_op *op)
 {
-       struct fsl_qspi_regs *regs = priv->regs;
-       u32 reg, mcr_reg, data, seqid;
+       void __iomem *base = q->iobase;
+       u32 lutval[4] = {};
+       int lutidx = 1, i;
 
-       mcr_reg = qspi_read32(priv->flags, &regs->mcr);
-       qspi_write32(priv->flags, &regs->mcr,
-                    QSPI_MCR_CLR_RXF_MASK | QSPI_MCR_CLR_TXF_MASK |
-                    mcr_reg);
-       qspi_write32(priv->flags, &regs->rbct, QSPI_RBCT_RXBRD_USEIPS);
+       lutval[0] |= LUT_DEF(0, LUT_CMD, LUT_PAD(op->cmd.buswidth),
+                            op->cmd.opcode);
 
-       qspi_write32(priv->flags, &regs->sfar, priv->cur_amba_base);
+       /*
+        * For some unknown reason, using LUT_ADDR doesn't work in some
+        * cases (at least with only one byte long addresses), so
+        * let's use LUT_MODE to write the address bytes one by one
+        */
+       for (i = 0; i < op->addr.nbytes; i++) {
+               u8 addrbyte = op->addr.val >> (8 * (op->addr.nbytes - i - 1));
 
-       if (priv->cur_seqid == QSPI_CMD_BRRD)
-               seqid = SEQID_BRRD;
-       else
-               seqid = SEQID_RDEAR;
-
-       qspi_write32(priv->flags, &regs->ipcr,
-                    (seqid << QSPI_IPCR_SEQID_SHIFT) | len);
-
-       /* Wait previous command complete */
-       while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
-               ;
-
-       while (1) {
-               WATCHDOG_RESET();
-
-               reg = qspi_read32(priv->flags, &regs->rbsr);
-               if (reg & QSPI_RBSR_RDBFL_MASK) {
-                       data = qspi_read32(priv->flags, &regs->rbdr[0]);
-                       data = qspi_endian_xchg(priv, data);
-                       memcpy(rxbuf, &data, len);
-                       qspi_write32(priv->flags, &regs->mcr,
-                                    qspi_read32(priv->flags, &regs->mcr) |
-                                    QSPI_MCR_CLR_RXF_MASK);
-                       break;
-               }
+               lutval[lutidx / 2] |= LUT_DEF(lutidx, LUT_MODE,
+                                             LUT_PAD(op->addr.buswidth),
+                                             addrbyte);
+               lutidx++;
        }
 
-       qspi_write32(priv->flags, &regs->mcr, mcr_reg);
-}
-#endif
-
-static void qspi_op_rdid(struct fsl_qspi_priv *priv, u32 *rxbuf, u32 len)
-{
-       struct fsl_qspi_regs *regs = priv->regs;
-       u32 mcr_reg, rbsr_reg, data, size;
-       int i;
-
-       mcr_reg = qspi_read32(priv->flags, &regs->mcr);
-       qspi_write32(priv->flags, &regs->mcr,
-                    QSPI_MCR_CLR_RXF_MASK | QSPI_MCR_CLR_TXF_MASK |
-                    mcr_reg);
-       qspi_write32(priv->flags, &regs->rbct, QSPI_RBCT_RXBRD_USEIPS);
-
-       qspi_write32(priv->flags, &regs->sfar, priv->cur_amba_base);
-
-       qspi_write32(priv->flags, &regs->ipcr,
-                    (SEQID_RDID << QSPI_IPCR_SEQID_SHIFT) | 0);
-       while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
-               ;
-
-       i = 0;
-       while ((priv->devtype_data->rxfifo >= len) && (len > 0)) {
-               WATCHDOG_RESET();
-
-               rbsr_reg = qspi_read32(priv->flags, &regs->rbsr);
-               if (rbsr_reg & QSPI_RBSR_RDBFL_MASK) {
-                       data = qspi_read32(priv->flags, &regs->rbdr[i]);
-                       data = qspi_endian_xchg(priv, data);
-                       size = (len < 4) ? len : 4;
-                       memcpy(rxbuf, &data, size);
-                       len -= size;
-                       rxbuf++;
-                       i++;
-               }
+       if (op->dummy.nbytes) {
+               lutval[lutidx / 2] |= LUT_DEF(lutidx, LUT_DUMMY,
+                                             LUT_PAD(op->dummy.buswidth),
+                                             op->dummy.nbytes * 8 /
+                                             op->dummy.buswidth);
+               lutidx++;
        }
 
-       qspi_write32(priv->flags, &regs->mcr, mcr_reg);
-}
-
-/* If not use AHB read, read data from ip interface */
-static void qspi_op_read(struct fsl_qspi_priv *priv, u32 *rxbuf, u32 len)
-{
-       struct fsl_qspi_regs *regs = priv->regs;
-       u32 mcr_reg, data;
-       int i, size;
-       u32 to_or_from;
-       u32 seqid;
-
-       if (priv->cur_seqid == QSPI_CMD_RDAR)
-               seqid = SEQID_RDAR;
-       else
-               seqid = SEQID_FAST_READ;
-
-       mcr_reg = qspi_read32(priv->flags, &regs->mcr);
-       qspi_write32(priv->flags, &regs->mcr,
-                    QSPI_MCR_CLR_RXF_MASK | QSPI_MCR_CLR_TXF_MASK |
-                    mcr_reg);
-       qspi_write32(priv->flags, &regs->rbct, QSPI_RBCT_RXBRD_USEIPS);
-
-       to_or_from = priv->sf_addr + priv->cur_amba_base;
-
-       while (len > 0) {
-               WATCHDOG_RESET();
-
-               qspi_write32(priv->flags, &regs->sfar, to_or_from);
-
-               size = (len > priv->devtype_data->rxfifo) ?
-                       priv->devtype_data->rxfifo : len;
-
-               qspi_write32(priv->flags, &regs->ipcr,
-                            (seqid << QSPI_IPCR_SEQID_SHIFT) |
-                            size);
-               while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
-                       ;
-
-               to_or_from += size;
-               len -= size;
-
-               i = 0;
-               while ((priv->devtype_data->rxfifo >= size) && (size > 0)) {
-                       data = qspi_read32(priv->flags, &regs->rbdr[i]);
-                       data = qspi_endian_xchg(priv, data);
-                       if (size < 4)
-                               memcpy(rxbuf, &data, size);
-                       else
-                               memcpy(rxbuf, &data, 4);
-                       rxbuf++;
-                       size -= 4;
-                       i++;
-               }
-               qspi_write32(priv->flags, &regs->mcr,
-                            qspi_read32(priv->flags, &regs->mcr) |
-                            QSPI_MCR_CLR_RXF_MASK);
+       if (op->data.nbytes) {
+               lutval[lutidx / 2] |= LUT_DEF(lutidx,
+                                             op->data.dir == SPI_MEM_DATA_IN ?
+                                             LUT_FSL_READ : LUT_FSL_WRITE,
+                                             LUT_PAD(op->data.buswidth),
+                                             0);
+               lutidx++;
        }
 
-       qspi_write32(priv->flags, &regs->mcr, mcr_reg);
-}
+       lutval[lutidx / 2] |= LUT_DEF(lutidx, LUT_STOP, 0, 0);
 
-static void qspi_op_write(struct fsl_qspi_priv *priv, u8 *txbuf, u32 len)
-{
-       struct fsl_qspi_regs *regs = priv->regs;
-       u32 mcr_reg, data, reg, status_reg, seqid;
-       int i, size, tx_size;
-       u32 to_or_from = 0;
-
-       mcr_reg = qspi_read32(priv->flags, &regs->mcr);
-       qspi_write32(priv->flags, &regs->mcr,
-                    QSPI_MCR_CLR_RXF_MASK | QSPI_MCR_CLR_TXF_MASK |
-                    mcr_reg);
-       qspi_write32(priv->flags, &regs->rbct, QSPI_RBCT_RXBRD_USEIPS);
-
-       status_reg = 0;
-       while ((status_reg & FLASH_STATUS_WEL) != FLASH_STATUS_WEL) {
-               WATCHDOG_RESET();
-
-               qspi_write32(priv->flags, &regs->ipcr,
-                            (SEQID_WREN << QSPI_IPCR_SEQID_SHIFT) | 0);
-               while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
-                       ;
-
-               qspi_write32(priv->flags, &regs->ipcr,
-                            (SEQID_RDSR << QSPI_IPCR_SEQID_SHIFT) | 1);
-               while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
-                       ;
-
-               reg = qspi_read32(priv->flags, &regs->rbsr);
-               if (reg & QSPI_RBSR_RDBFL_MASK) {
-                       status_reg = qspi_read32(priv->flags, &regs->rbdr[0]);
-                       status_reg = qspi_endian_xchg(priv, status_reg);
-               }
-               qspi_write32(priv->flags, &regs->mcr,
-                            qspi_read32(priv->flags, &regs->mcr) |
-                            QSPI_MCR_CLR_RXF_MASK);
-       }
+       /* unlock LUT */
+       qspi_writel(q, QUADSPI_LUTKEY_VALUE, q->iobase + QUADSPI_LUTKEY);
+       qspi_writel(q, QUADSPI_LCKER_UNLOCK, q->iobase + QUADSPI_LCKCR);
+
+       dev_dbg(q->dev, "CMD[%x] lutval[0:%x \t 1:%x \t 2:%x \t 3:%x]\n",
+               op->cmd.opcode, lutval[0], lutval[1], lutval[2], lutval[3]);
 
-       /* Default is page programming */
-       seqid = SEQID_PP;
-       if (priv->cur_seqid == QSPI_CMD_WRAR)
-               seqid = SEQID_WRAR;
-#ifdef CONFIG_SPI_FLASH_BAR
-       if (priv->cur_seqid == QSPI_CMD_BRWR)
-               seqid = SEQID_BRWR;
-       else if (priv->cur_seqid == QSPI_CMD_WREAR)
-               seqid = SEQID_WREAR;
-#endif
+       /* fill LUT */
+       for (i = 0; i < ARRAY_SIZE(lutval); i++)
+               qspi_writel(q, lutval[i], base + QUADSPI_LUT_REG(i));
 
-       to_or_from = priv->sf_addr + priv->cur_amba_base;
+       /* lock LUT */
+       qspi_writel(q, QUADSPI_LUTKEY_VALUE, q->iobase + QUADSPI_LUTKEY);
+       qspi_writel(q, QUADSPI_LCKER_LOCK, q->iobase + QUADSPI_LCKCR);
+}
 
-       qspi_write32(priv->flags, &regs->sfar, to_or_from);
+/*
+ * If we have changed the content of the flash by writing or erasing, or if we
+ * read from flash with a different offset into the page buffer, we need to
+ * invalidate the AHB buffer. If we do not do so, we may read out the wrong
+ * data. The spec tells us reset the AHB domain and Serial Flash domain at
+ * the same time.
+ */
+static void fsl_qspi_invalidate(struct fsl_qspi *q)
+{
+       u32 reg;
 
-       tx_size = (len > priv->devtype_data->txfifo) ?
-               priv->devtype_data->txfifo : len;
+       reg = qspi_readl(q, q->iobase + QUADSPI_MCR);
+       reg |= QUADSPI_MCR_SWRSTHD_MASK | QUADSPI_MCR_SWRSTSD_MASK;
+       qspi_writel(q, reg, q->iobase + QUADSPI_MCR);
 
-       size = tx_size / 16;
        /*
-        * There must be atleast 128bit data
-        * available in TX FIFO for any pop operation
+        * The minimum delay : 1 AHB + 2 SFCK clocks.
+        * Delay 1 us is enough.
         */
-       if (tx_size % 16)
-               size++;
-       for (i = 0; i < size * 4; i++) {
-               memcpy(&data, txbuf, 4);
-               data = qspi_endian_xchg(priv, data);
-               qspi_write32(priv->flags, &regs->tbdr, data);
-               txbuf += 4;
-       }
-
-       qspi_write32(priv->flags, &regs->ipcr,
-                    (seqid << QSPI_IPCR_SEQID_SHIFT) | tx_size);
-       while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
-               ;
+       udelay(1);
 
-       qspi_write32(priv->flags, &regs->mcr, mcr_reg);
+       reg &= ~(QUADSPI_MCR_SWRSTHD_MASK | QUADSPI_MCR_SWRSTSD_MASK);
+       qspi_writel(q, reg, q->iobase + QUADSPI_MCR);
 }
 
-static void qspi_op_rdsr(struct fsl_qspi_priv *priv, void *rxbuf, u32 len)
+static void fsl_qspi_select_mem(struct fsl_qspi *q, struct spi_slave *slave)
 {
-       struct fsl_qspi_regs *regs = priv->regs;
-       u32 mcr_reg, reg, data;
-
-       mcr_reg = qspi_read32(priv->flags, &regs->mcr);
-       qspi_write32(priv->flags, &regs->mcr,
-                    QSPI_MCR_CLR_RXF_MASK | QSPI_MCR_CLR_TXF_MASK |
-                    mcr_reg);
-       qspi_write32(priv->flags, &regs->rbct, QSPI_RBCT_RXBRD_USEIPS);
-
-       qspi_write32(priv->flags, &regs->sfar, priv->cur_amba_base);
-
-       qspi_write32(priv->flags, &regs->ipcr,
-                    (SEQID_RDSR << QSPI_IPCR_SEQID_SHIFT) | 0);
-       while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
-               ;
-
-       while (1) {
-               WATCHDOG_RESET();
-
-               reg = qspi_read32(priv->flags, &regs->rbsr);
-               if (reg & QSPI_RBSR_RDBFL_MASK) {
-                       data = qspi_read32(priv->flags, &regs->rbdr[0]);
-                       data = qspi_endian_xchg(priv, data);
-                       memcpy(rxbuf, &data, len);
-                       qspi_write32(priv->flags, &regs->mcr,
-                                    qspi_read32(priv->flags, &regs->mcr) |
-                                    QSPI_MCR_CLR_RXF_MASK);
-                       break;
-               }
-       }
+       struct dm_spi_slave_platdata *plat =
+               dev_get_parent_platdata(slave->dev);
+
+       if (q->selected == plat->cs)
+               return;
 
-       qspi_write32(priv->flags, &regs->mcr, mcr_reg);
+       q->selected = plat->cs;
+       fsl_qspi_invalidate(q);
 }
 
-static void qspi_op_erase(struct fsl_qspi_priv *priv)
+static void fsl_qspi_read_ahb(struct fsl_qspi *q, const struct spi_mem_op *op)
 {
-       struct fsl_qspi_regs *regs = priv->regs;
-       u32 mcr_reg;
-       u32 to_or_from = 0;
-
-       mcr_reg = qspi_read32(priv->flags, &regs->mcr);
-       qspi_write32(priv->flags, &regs->mcr,
-                    QSPI_MCR_CLR_RXF_MASK | QSPI_MCR_CLR_TXF_MASK |
-                    mcr_reg);
-       qspi_write32(priv->flags, &regs->rbct, QSPI_RBCT_RXBRD_USEIPS);
-
-       to_or_from = priv->sf_addr + priv->cur_amba_base;
-       qspi_write32(priv->flags, &regs->sfar, to_or_from);
-
-       qspi_write32(priv->flags, &regs->ipcr,
-                    (SEQID_WREN << QSPI_IPCR_SEQID_SHIFT) | 0);
-       while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
-               ;
-
-       if (priv->cur_seqid == QSPI_CMD_SE) {
-               qspi_write32(priv->flags, &regs->ipcr,
-                            (SEQID_SE << QSPI_IPCR_SEQID_SHIFT) | 0);
-       } else if (priv->cur_seqid == QSPI_CMD_BE_4K) {
-               qspi_write32(priv->flags, &regs->ipcr,
-                            (SEQID_BE_4K << QSPI_IPCR_SEQID_SHIFT) | 0);
-       }
-       while (qspi_read32(priv->flags, &regs->sr) & QSPI_SR_BUSY_MASK)
-               ;
-
-       qspi_write32(priv->flags, &regs->mcr, mcr_reg);
+       memcpy_fromio(op->data.buf.in,
+                     q->ahb_addr + q->selected * q->devtype_data->ahb_buf_size,
+                     op->data.nbytes);
 }
 
-int qspi_xfer(struct fsl_qspi_priv *priv, unsigned int bitlen,
-               const void *dout, void *din, unsigned long flags)
+static void fsl_qspi_fill_txfifo(struct fsl_qspi *q,
+                                const struct spi_mem_op *op)
 {
-       u32 bytes = DIV_ROUND_UP(bitlen, 8);
-       static u32 wr_sfaddr;
-       u32 txbuf;
-
-       WATCHDOG_RESET();
-
-       if (dout) {
-               if (flags & SPI_XFER_BEGIN) {
-                       priv->cur_seqid = *(u8 *)dout;
-                       memcpy(&txbuf, dout, 4);
-               }
-
-               if (flags == SPI_XFER_END) {
-                       priv->sf_addr = wr_sfaddr;
-                       qspi_op_write(priv, (u8 *)dout, bytes);
-                       return 0;
-               }
-
-               if (priv->cur_seqid == QSPI_CMD_FAST_READ ||
-                   priv->cur_seqid == QSPI_CMD_RDAR) {
-                       priv->sf_addr = swab32(txbuf) & OFFSET_BITS_MASK;
-               } else if ((priv->cur_seqid == QSPI_CMD_SE) ||
-                          (priv->cur_seqid == QSPI_CMD_BE_4K)) {
-                       priv->sf_addr = swab32(txbuf) & OFFSET_BITS_MASK;
-                       qspi_op_erase(priv);
-               } else if (priv->cur_seqid == QSPI_CMD_PP ||
-                          priv->cur_seqid == QSPI_CMD_WRAR) {
-                       wr_sfaddr = swab32(txbuf) & OFFSET_BITS_MASK;
-               } else if ((priv->cur_seqid == QSPI_CMD_BRWR) ||
-                        (priv->cur_seqid == QSPI_CMD_WREAR)) {
-#ifdef CONFIG_SPI_FLASH_BAR
-                       wr_sfaddr = 0;
-#endif
-               }
-       }
+       void __iomem *base = q->iobase;
+       int i;
+       u32 val;
 
-       if (din) {
-               if (priv->cur_seqid == QSPI_CMD_FAST_READ) {
-#ifdef CONFIG_SYS_FSL_QSPI_AHB
-                       qspi_ahb_read(priv, din, bytes);
-#else
-                       qspi_op_read(priv, din, bytes);
-#endif
-               } else if (priv->cur_seqid == QSPI_CMD_RDAR) {
-                       qspi_op_read(priv, din, bytes);
-               } else if (priv->cur_seqid == QSPI_CMD_RDID)
-                       qspi_op_rdid(priv, din, bytes);
-               else if (priv->cur_seqid == QSPI_CMD_RDSR)
-                       qspi_op_rdsr(priv, din, bytes);
-#ifdef CONFIG_SPI_FLASH_BAR
-               else if ((priv->cur_seqid == QSPI_CMD_BRRD) ||
-                        (priv->cur_seqid == QSPI_CMD_RDEAR)) {
-                       priv->sf_addr = 0;
-                       qspi_op_rdbank(priv, din, bytes);
-               }
-#endif
+       for (i = 0; i < ALIGN_DOWN(op->data.nbytes, 4); i += 4) {
+               memcpy(&val, op->data.buf.out + i, 4);
+               val = fsl_qspi_endian_xchg(q, val);
+               qspi_writel(q, val, base + QUADSPI_TBDR);
        }
 
-#ifdef CONFIG_SYS_FSL_QSPI_AHB
-       if ((priv->cur_seqid == QSPI_CMD_SE) ||
-           (priv->cur_seqid == QSPI_CMD_PP) ||
-           (priv->cur_seqid == QSPI_CMD_BE_4K) ||
-           (priv->cur_seqid == QSPI_CMD_WREAR) ||
-           (priv->cur_seqid == QSPI_CMD_BRWR))
-               qspi_ahb_invalid(priv);
-#endif
+       if (i < op->data.nbytes) {
+               memcpy(&val, op->data.buf.out + i, op->data.nbytes - i);
+               val = fsl_qspi_endian_xchg(q, val);
+               qspi_writel(q, val, base + QUADSPI_TBDR);
+       }
 
-       return 0;
+       if (needs_fill_txfifo(q)) {
+               for (i = op->data.nbytes; i < 16; i += 4)
+                       qspi_writel(q, 0, base + QUADSPI_TBDR);
+       }
 }
 
-void qspi_module_disable(struct fsl_qspi_priv *priv, u8 disable)
+static void fsl_qspi_read_rxfifo(struct fsl_qspi *q,
+                                const struct spi_mem_op *op)
 {
-       u32 mcr_val;
+       void __iomem *base = q->iobase;
+       int i;
+       u8 *buf = op->data.buf.in;
+       u32 val;
 
-       mcr_val = qspi_read32(priv->flags, &priv->regs->mcr);
-       if (disable)
-               mcr_val |= QSPI_MCR_MDIS_MASK;
-       else
-               mcr_val &= ~QSPI_MCR_MDIS_MASK;
-       qspi_write32(priv->flags, &priv->regs->mcr, mcr_val);
+       for (i = 0; i < ALIGN_DOWN(op->data.nbytes, 4); i += 4) {
+               val = qspi_readl(q, base + QUADSPI_RBDR(i / 4));
+               val = fsl_qspi_endian_xchg(q, val);
+               memcpy(buf + i, &val, 4);
+       }
+
+       if (i < op->data.nbytes) {
+               val = qspi_readl(q, base + QUADSPI_RBDR(i / 4));
+               val = fsl_qspi_endian_xchg(q, val);
+               memcpy(buf + i, &val, op->data.nbytes - i);
+       }
 }
 
-void qspi_cfg_smpr(struct fsl_qspi_priv *priv, u32 clear_bits, u32 set_bits)
+static int fsl_qspi_readl_poll_tout(struct fsl_qspi *q, void __iomem *base,
+                                   u32 mask, u32 delay_us, u32 timeout_us)
 {
-       u32 smpr_val;
+       u32 reg;
 
-       smpr_val = qspi_read32(priv->flags, &priv->regs->smpr);
-       smpr_val &= ~clear_bits;
-       smpr_val |= set_bits;
-       qspi_write32(priv->flags, &priv->regs->smpr, smpr_val);
+       if (!q->devtype_data->little_endian)
+               mask = (u32)cpu_to_be32(mask);
+
+       return readl_poll_timeout(base, reg, !(reg & mask), timeout_us);
 }
 
-static int fsl_qspi_child_pre_probe(struct udevice *dev)
+static int fsl_qspi_do_op(struct fsl_qspi *q, const struct spi_mem_op *op)
 {
-       struct spi_slave *slave = dev_get_parent_priv(dev);
-       struct fsl_qspi_priv *priv = dev_get_priv(dev_get_parent(dev));
+       void __iomem *base = q->iobase;
+       int err = 0;
 
-       slave->max_write_size = priv->devtype_data->txfifo;
+       /*
+        * Always start the sequence at the same index since we update
+        * the LUT at each exec_op() call. And also specify the DATA
+        * length, since it's has not been specified in the LUT.
+        */
+       qspi_writel(q, op->data.nbytes | QUADSPI_IPCR_SEQID(SEQID_LUT),
+                   base + QUADSPI_IPCR);
 
-       return 0;
+       /* wait for the controller being ready */
+       err = fsl_qspi_readl_poll_tout(q, base + QUADSPI_SR,
+                                      (QUADSPI_SR_IP_ACC_MASK |
+                                       QUADSPI_SR_AHB_ACC_MASK),
+                                       10, 1000);
+
+       if (!err && op->data.nbytes && op->data.dir == SPI_MEM_DATA_IN)
+               fsl_qspi_read_rxfifo(q, op);
+
+       return err;
 }
 
-static int fsl_qspi_probe(struct udevice *bus)
+static int fsl_qspi_exec_op(struct spi_slave *slave,
+                           const struct spi_mem_op *op)
 {
-       u32 amba_size_per_chip;
-       struct fsl_qspi_platdata *plat = dev_get_platdata(bus);
-       struct fsl_qspi_priv *priv = dev_get_priv(bus);
-       struct dm_spi_bus *dm_spi_bus;
-       int i, ret;
+       struct fsl_qspi *q = dev_get_priv(slave->dev->parent);
+       void __iomem *base = q->iobase;
+       u32 addr_offset = 0;
+       int err = 0;
 
-       dm_spi_bus = bus->uclass_priv;
+       /* wait for the controller being ready */
+       fsl_qspi_readl_poll_tout(q, base + QUADSPI_SR, (QUADSPI_SR_IP_ACC_MASK |
+                                QUADSPI_SR_AHB_ACC_MASK), 10, 1000);
 
-       dm_spi_bus->max_hz = plat->speed_hz;
+       fsl_qspi_select_mem(q, slave);
 
-       priv->regs = (struct fsl_qspi_regs *)(uintptr_t)plat->reg_base;
-       priv->flags = plat->flags;
+       if (needs_amba_base_offset(q))
+               addr_offset = q->memmap_phy;
+
+       qspi_writel(q,
+                   q->selected * q->devtype_data->ahb_buf_size + addr_offset,
+                   base + QUADSPI_SFAR);
+
+       qspi_writel(q, qspi_readl(q, base + QUADSPI_MCR) |
+                   QUADSPI_MCR_CLR_RXF_MASK | QUADSPI_MCR_CLR_TXF_MASK,
+                   base + QUADSPI_MCR);
+
+       qspi_writel(q, QUADSPI_SPTRCLR_BFPTRC | QUADSPI_SPTRCLR_IPPTRC,
+                   base + QUADSPI_SPTRCLR);
+
+       fsl_qspi_prepare_lut(q, op);
 
-       priv->speed_hz = plat->speed_hz;
        /*
-        * QSPI SFADR width is 32bits, the max dest addr is 4GB-1.
-        * AMBA memory zone should be located on the 0~4GB space
-        * even on a 64bits cpu.
+        * If we have large chunks of data, we read them through the AHB bus
+        * by accessing the mapped memory. In all other cases we use
+        * IP commands to access the flash.
         */
-       priv->amba_base[0] = (u32)plat->amba_base;
-       priv->amba_total_size = (u32)plat->amba_total_size;
-       priv->flash_num = plat->flash_num;
-       priv->num_chipselect = plat->num_chipselect;
-
-       priv->devtype_data = (struct fsl_qspi_devtype_data *)dev_get_driver_data(bus);
-       if (!priv->devtype_data) {
-               printf("ERROR : No devtype_data found\n");
-               return -ENODEV;
+       if (op->data.nbytes > (q->devtype_data->rxfifo - 4) &&
+           op->data.dir == SPI_MEM_DATA_IN) {
+               fsl_qspi_read_ahb(q, op);
+       } else {
+               qspi_writel(q, QUADSPI_RBCT_WMRK_MASK |
+                           QUADSPI_RBCT_RXBRD_USEIPS, base + QUADSPI_RBCT);
+
+               if (op->data.nbytes && op->data.dir == SPI_MEM_DATA_OUT)
+                       fsl_qspi_fill_txfifo(q, op);
+
+               err = fsl_qspi_do_op(q, op);
        }
 
-       debug("devtype=%d, txfifo=%d, rxfifo=%d, ahb=%d, data=0x%x\n",
-               priv->devtype_data->devtype,
-               priv->devtype_data->txfifo,
-               priv->devtype_data->rxfifo,
-               priv->devtype_data->ahb_buf_size,
-               priv->devtype_data->driver_data);
+       /* Invalidate the data in the AHB buffer. */
+       fsl_qspi_invalidate(q);
 
-       /* make sure controller is not busy anywhere */
-       ret = is_controller_busy(priv);
+       return err;
+}
 
-       if (ret) {
-               debug("ERROR : The controller is busy\n");
-               return ret;
+static int fsl_qspi_adjust_op_size(struct spi_slave *slave,
+                                  struct spi_mem_op *op)
+{
+       struct fsl_qspi *q = dev_get_priv(slave->dev->parent);
+
+       if (op->data.dir == SPI_MEM_DATA_OUT) {
+               if (op->data.nbytes > q->devtype_data->txfifo)
+                       op->data.nbytes = q->devtype_data->txfifo;
+       } else {
+               if (op->data.nbytes > q->devtype_data->ahb_buf_size)
+                       op->data.nbytes = q->devtype_data->ahb_buf_size;
+               else if (op->data.nbytes > (q->devtype_data->rxfifo - 4))
+                       op->data.nbytes = ALIGN_DOWN(op->data.nbytes, 8);
        }
 
-       qspi_write32(priv->flags, &priv->regs->mcr,
-                    QSPI_MCR_RESERVED_MASK | QSPI_MCR_MDIS_MASK |
-                    QSPI_MCR_END_CFD_LE);
+       return 0;
+}
+
+static int fsl_qspi_default_setup(struct fsl_qspi *q)
+{
+       void __iomem *base = q->iobase;
+       u32 reg, addr_offset = 0;
+
+       /* Reset the module */
+       qspi_writel(q, QUADSPI_MCR_SWRSTSD_MASK | QUADSPI_MCR_SWRSTHD_MASK,
+                   base + QUADSPI_MCR);
+       udelay(1);
 
-       qspi_cfg_smpr(priv, ~(QSPI_SMPR_FSDLY_MASK | QSPI_SMPR_DDRSMP_MASK |
-               QSPI_SMPR_FSPHS_MASK | QSPI_SMPR_HSENA_MASK), 0);
+       /* Disable the module */
+       qspi_writel(q, QUADSPI_MCR_MDIS_MASK | QUADSPI_MCR_RESERVED_MASK,
+                   base + QUADSPI_MCR);
 
        /*
-        * Assign AMBA memory zone for every chipselect
-        * QuadSPI has two channels, every channel has two chipselects.
-        * If the property 'num-cs' in dts is 2, the AMBA memory will be divided
-        * into two parts and assign to every channel. This indicate that every
-        * channel only has one valid chipselect.
-        * If the property 'num-cs' in dts is 4, the AMBA memory will be divided
-        * into four parts and assign to every chipselect.
-        * Every channel will has two valid chipselects.
+        * Previous boot stages (BootROM, bootloader) might have used DDR
+        * mode and did not clear the TDH bits. As we currently use SDR mode
+        * only, clear the TDH bits if necessary.
         */
-       amba_size_per_chip = priv->amba_total_size >>
-                            (priv->num_chipselect >> 1);
-       for (i = 1 ; i < priv->num_chipselect ; i++)
-               priv->amba_base[i] =
-                       amba_size_per_chip + priv->amba_base[i - 1];
+       if (needs_tdh_setting(q))
+               qspi_writel(q, qspi_readl(q, base + QUADSPI_FLSHCR) &
+                           ~QUADSPI_FLSHCR_TDH_MASK,
+                           base + QUADSPI_FLSHCR);
+
+       reg = qspi_readl(q, base + QUADSPI_SMPR);
+       qspi_writel(q, reg & ~(QUADSPI_SMPR_FSDLY_MASK
+                       | QUADSPI_SMPR_FSPHS_MASK
+                       | QUADSPI_SMPR_HSENA_MASK
+                       | QUADSPI_SMPR_DDRSMP_MASK), base + QUADSPI_SMPR);
+
+       /* We only use the buffer3 for AHB read */
+       qspi_writel(q, 0, base + QUADSPI_BUF0IND);
+       qspi_writel(q, 0, base + QUADSPI_BUF1IND);
+       qspi_writel(q, 0, base + QUADSPI_BUF2IND);
+
+       qspi_writel(q, QUADSPI_BFGENCR_SEQID(SEQID_LUT),
+                   q->iobase + QUADSPI_BFGENCR);
+       qspi_writel(q, QUADSPI_RBCT_WMRK_MASK, base + QUADSPI_RBCT);
+       qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK |
+                   QUADSPI_BUF3CR_ADATSZ(q->devtype_data->ahb_buf_size / 8),
+                   base + QUADSPI_BUF3CR);
+
+       if (needs_amba_base_offset(q))
+               addr_offset = q->memmap_phy;
 
        /*
-        * Any read access to non-implemented addresses will provide
-        * undefined results.
-        *
-        * In case single die flash devices, TOP_ADDR_MEMA2 and
-        * TOP_ADDR_MEMB2 should be initialized/programmed to
-        * TOP_ADDR_MEMA1 and TOP_ADDR_MEMB1 respectively - in effect,
-        * setting the size of these devices to 0.  This would ensure
-        * that the complete memory map is assigned to only one flash device.
+        * In HW there can be a maximum of four chips on two buses with
+        * two chip selects on each bus. We use four chip selects in SW
+        * to differentiate between the four chips.
+        * We use ahb_buf_size for each chip and set SFA1AD, SFA2AD, SFB1AD,
+        * SFB2AD accordingly.
         */
-       qspi_write32(priv->flags, &priv->regs->sfa1ad,
-                    priv->amba_base[0] + amba_size_per_chip);
-       switch (priv->num_chipselect) {
-       case 1:
-               break;
-       case 2:
-               qspi_write32(priv->flags, &priv->regs->sfa2ad,
-                            priv->amba_base[1]);
-               qspi_write32(priv->flags, &priv->regs->sfb1ad,
-                            priv->amba_base[1] + amba_size_per_chip);
-               qspi_write32(priv->flags, &priv->regs->sfb2ad,
-                            priv->amba_base[1] + amba_size_per_chip);
-               break;
-       case 4:
-               qspi_write32(priv->flags, &priv->regs->sfa2ad,
-                            priv->amba_base[2]);
-               qspi_write32(priv->flags, &priv->regs->sfb1ad,
-                            priv->amba_base[3]);
-               qspi_write32(priv->flags, &priv->regs->sfb2ad,
-                            priv->amba_base[3] + amba_size_per_chip);
-               break;
-       default:
-               debug("Error: Unsupported chipselect number %u!\n",
-                     priv->num_chipselect);
-               qspi_module_disable(priv, 1);
-               return -EINVAL;
-       }
-
-       qspi_set_lut(priv);
-
-#ifdef CONFIG_SYS_FSL_QSPI_AHB
-       qspi_init_ahb_read(priv);
-#endif
-
-       qspi_module_disable(priv, 0);
-
+       qspi_writel(q, q->devtype_data->ahb_buf_size + addr_offset,
+                   base + QUADSPI_SFA1AD);
+       qspi_writel(q, q->devtype_data->ahb_buf_size * 2 + addr_offset,
+                   base + QUADSPI_SFA2AD);
+       qspi_writel(q, q->devtype_data->ahb_buf_size * 3 + addr_offset,
+                   base + QUADSPI_SFB1AD);
+       qspi_writel(q, q->devtype_data->ahb_buf_size * 4 + addr_offset,
+                   base + QUADSPI_SFB2AD);
+
+       q->selected = -1;
+
+       /* Enable the module */
+       qspi_writel(q, QUADSPI_MCR_RESERVED_MASK | QUADSPI_MCR_END_CFG_MASK,
+                   base + QUADSPI_MCR);
        return 0;
 }
 
-static int fsl_qspi_ofdata_to_platdata(struct udevice *bus)
+static const struct spi_controller_mem_ops fsl_qspi_mem_ops = {
+       .adjust_op_size = fsl_qspi_adjust_op_size,
+       .supports_op = fsl_qspi_supports_op,
+       .exec_op = fsl_qspi_exec_op,
+};
+
+static int fsl_qspi_probe(struct udevice *bus)
 {
-       struct fdt_resource res_regs, res_mem;
-       struct fsl_qspi_platdata *plat = bus->platdata;
+       struct dm_spi_bus *dm_bus = bus->uclass_priv;
+       struct fsl_qspi *q = dev_get_priv(bus);
        const void *blob = gd->fdt_blob;
        int node = dev_of_offset(bus);
-       int ret, flash_num = 0, subnode;
+       struct fdt_resource res;
+       int ret;
 
-       if (fdtdec_get_bool(blob, node, "big-endian"))
-               plat->flags |= QSPI_FLAG_REGMAP_ENDIAN_BIG;
+       q->dev = bus;
+       q->devtype_data = (struct fsl_qspi_devtype_data *)
+                          dev_get_driver_data(bus);
 
-       ret = fdt_get_named_resource(blob, node, "reg", "reg-names",
-                                    "QuadSPI", &res_regs);
+       /* find the resources */
+       ret = fdt_get_named_resource(blob, node, "reg", "reg-names", "QuadSPI",
+                                    &res);
        if (ret) {
-               debug("Error: can't get regs base addresses(ret = %d)!\n", ret);
+               dev_err(bus, "Can't get regs base addresses(ret = %d)!\n", ret);
                return -ENOMEM;
        }
+
+       q->iobase = map_physmem(res.start, res.end - res.start, MAP_NOCACHE);
+
        ret = fdt_get_named_resource(blob, node, "reg", "reg-names",
-                                    "QuadSPI-memory", &res_mem);
+                                    "QuadSPI-memory", &res);
        if (ret) {
-               debug("Error: can't get AMBA base addresses(ret = %d)!\n", ret);
+               dev_err(bus, "Can't get AMBA base addresses(ret = %d)!\n", ret);
                return -ENOMEM;
        }
 
-       /* Count flash numbers */
-       fdt_for_each_subnode(subnode, blob, node)
-               ++flash_num;
+       q->ahb_addr = map_physmem(res.start, res.end - res.start, MAP_NOCACHE);
+       q->memmap_phy = res.start;
 
-       if (flash_num == 0) {
-               debug("Error: Missing flashes!\n");
-               return -ENODEV;
-       }
+       dm_bus->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency",
+                                       66000000);
 
-       plat->speed_hz = fdtdec_get_int(blob, node, "spi-max-frequency",
-                                       FSL_QSPI_DEFAULT_SCK_FREQ);
-       plat->num_chipselect = fdtdec_get_int(blob, node, "num-cs",
-                                             FSL_QSPI_MAX_CHIPSELECT_NUM);
-
-       plat->reg_base = res_regs.start;
-       plat->amba_base = res_mem.start;
-       plat->amba_total_size = res_mem.end - res_mem.start + 1;
-       plat->flash_num = flash_num;
-
-       debug("%s: regs=<0x%llx> <0x%llx, 0x%llx>, max-frequency=%d, endianess=%s\n",
-             __func__,
-             (u64)plat->reg_base,
-             (u64)plat->amba_base,
-             (u64)plat->amba_total_size,
-             plat->speed_hz,
-             plat->flags & QSPI_FLAG_REGMAP_ENDIAN_BIG ? "be" : "le"
-             );
+       fsl_qspi_default_setup(q);
 
        return 0;
 }
 
 static int fsl_qspi_xfer(struct udevice *dev, unsigned int bitlen,
-               const void *dout, void *din, unsigned long flags)
+                        const void *dout, void *din, unsigned long flags)
 {
-       struct fsl_qspi_priv *priv;
-       struct udevice *bus;
-
-       bus = dev->parent;
-       priv = dev_get_priv(bus);
-
-       return qspi_xfer(priv, bitlen, dout, din, flags);
+       return 0;
 }
 
 static int fsl_qspi_claim_bus(struct udevice *dev)
 {
-       struct fsl_qspi_priv *priv;
-       struct udevice *bus;
-       struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
-       int ret;
-
-       bus = dev->parent;
-       priv = dev_get_priv(bus);
-
-       /* make sure controller is not busy anywhere */
-       ret = is_controller_busy(priv);
-
-       if (ret) {
-               debug("ERROR : The controller is busy\n");
-               return ret;
-       }
-
-       priv->cur_amba_base = priv->amba_base[slave_plat->cs];
-
-       qspi_module_disable(priv, 0);
-
        return 0;
 }
 
 static int fsl_qspi_release_bus(struct udevice *dev)
 {
-       struct fsl_qspi_priv *priv;
-       struct udevice *bus;
-
-       bus = dev->parent;
-       priv = dev_get_priv(bus);
-
-       qspi_module_disable(priv, 1);
-
        return 0;
 }
 
 static int fsl_qspi_set_speed(struct udevice *bus, uint speed)
 {
-       /* Nothing to do */
        return 0;
 }
 
 static int fsl_qspi_set_mode(struct udevice *bus, uint mode)
 {
-       /* Nothing to do */
        return 0;
 }
 
@@ -1146,14 +785,17 @@ static const struct dm_spi_ops fsl_qspi_ops = {
        .xfer           = fsl_qspi_xfer,
        .set_speed      = fsl_qspi_set_speed,
        .set_mode       = fsl_qspi_set_mode,
+       .mem_ops        = &fsl_qspi_mem_ops,
 };
 
 static const struct udevice_id fsl_qspi_ids[] = {
-       { .compatible = "fsl,vf610-qspi", .data = (ulong)&vybrid_data },
-       { .compatible = "fsl,imx6sx-qspi", .data = (ulong)&imx6sx_data },
-       { .compatible = "fsl,imx6ul-qspi", .data = (ulong)&imx6ul_7d_data },
-       { .compatible = "fsl,imx7d-qspi", .data = (ulong)&imx6ul_7d_data },
-       { .compatible = "fsl,imx7ulp-qspi", .data = (ulong)&imx7ulp_data },
+       { .compatible = "fsl,vf610-qspi", .data = (ulong)&vybrid_data, },
+       { .compatible = "fsl,imx6sx-qspi", .data = (ulong)&imx6sx_data, },
+       { .compatible = "fsl,imx6ul-qspi", .data = (ulong)&imx6ul_data, },
+       { .compatible = "fsl,imx7d-qspi", .data = (ulong)&imx7d_data, },
+       { .compatible = "fsl,ls1021a-qspi", .data = (ulong)&ls1021a_data, },
+       { .compatible = "fsl,ls1088a-qspi", .data = (ulong)&ls1088a_data, },
+       { .compatible = "fsl,ls2080a-qspi", .data = (ulong)&ls2080a_data, },
        { }
 };
 
@@ -1162,9 +804,6 @@ U_BOOT_DRIVER(fsl_qspi) = {
        .id     = UCLASS_SPI,
        .of_match = fsl_qspi_ids,
        .ops    = &fsl_qspi_ops,
-       .ofdata_to_platdata = fsl_qspi_ofdata_to_platdata,
-       .platdata_auto_alloc_size = sizeof(struct fsl_qspi_platdata),
-       .priv_auto_alloc_size = sizeof(struct fsl_qspi_priv),
+       .priv_auto_alloc_size = sizeof(struct fsl_qspi),
        .probe  = fsl_qspi_probe,
-       .child_pre_probe = fsl_qspi_child_pre_probe,
 };
diff --git a/drivers/spi/fsl_qspi.h b/drivers/spi/fsl_qspi.h
deleted file mode 100644 (file)
index 9e61a85..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright 2013-2014 Freescale Semiconductor, Inc.
- *
- * Register definitions for Freescale QSPI
- */
-
-#ifndef _FSL_QSPI_H_
-#define _FSL_QSPI_H_
-
-struct fsl_qspi_regs {
-       u32 mcr;
-       u32 rsvd0[1];
-       u32 ipcr;
-       u32 flshcr;
-       u32 buf0cr;
-       u32 buf1cr;
-       u32 buf2cr;
-       u32 buf3cr;
-       u32 bfgencr;
-       u32 soccr;
-       u32 rsvd1[2];
-       u32 buf0ind;
-       u32 buf1ind;
-       u32 buf2ind;
-       u32 rsvd2[49];
-       u32 sfar;
-       u32 rsvd3[1];
-       u32 smpr;
-       u32 rbsr;
-       u32 rbct;
-       u32 rsvd4[15];
-       u32 tbsr;
-       u32 tbdr;
-       u32 rsvd5[1];
-       u32 sr;
-       u32 fr;
-       u32 rser;
-       u32 spndst;
-       u32 sptrclr;
-       u32 rsvd6[4];
-       u32 sfa1ad;
-       u32 sfa2ad;
-       u32 sfb1ad;
-       u32 sfb2ad;
-       u32 rsvd7[28];
-       u32 rbdr[32];
-       u32 rsvd8[32];
-       u32 lutkey;
-       u32 lckcr;
-       u32 rsvd9[2];
-       u32 lut[64];
-};
-
-#define QSPI_IPCR_SEQID_SHIFT          24
-#define QSPI_IPCR_SEQID_MASK           (0xf << QSPI_IPCR_SEQID_SHIFT)
-
-#define QSPI_MCR_END_CFD_SHIFT         2
-#define QSPI_MCR_END_CFD_MASK          (3 << QSPI_MCR_END_CFD_SHIFT)
-#ifdef CONFIG_SYS_FSL_QSPI_AHB
-/* AHB needs 64bit operation */
-#define QSPI_MCR_END_CFD_LE            (3 << QSPI_MCR_END_CFD_SHIFT)
-#else
-#define QSPI_MCR_END_CFD_LE            (1 << QSPI_MCR_END_CFD_SHIFT)
-#endif
-#define QSPI_MCR_DDR_EN_SHIFT          7
-#define QSPI_MCR_DDR_EN_MASK           (1 << QSPI_MCR_DDR_EN_SHIFT)
-#define QSPI_MCR_CLR_RXF_SHIFT         10
-#define QSPI_MCR_CLR_RXF_MASK          (1 << QSPI_MCR_CLR_RXF_SHIFT)
-#define QSPI_MCR_CLR_TXF_SHIFT         11
-#define QSPI_MCR_CLR_TXF_MASK          (1 << QSPI_MCR_CLR_TXF_SHIFT)
-#define QSPI_MCR_MDIS_SHIFT            14
-#define QSPI_MCR_MDIS_MASK             (1 << QSPI_MCR_MDIS_SHIFT)
-#define QSPI_MCR_RESERVED_SHIFT                16
-#define QSPI_MCR_RESERVED_MASK         (0xf << QSPI_MCR_RESERVED_SHIFT)
-#define QSPI_MCR_SWRSTHD_SHIFT         1
-#define QSPI_MCR_SWRSTHD_MASK          (1 << QSPI_MCR_SWRSTHD_SHIFT)
-#define QSPI_MCR_SWRSTSD_SHIFT         0
-#define QSPI_MCR_SWRSTSD_MASK          (1 << QSPI_MCR_SWRSTSD_SHIFT)
-
-#define QSPI_SMPR_HSENA_SHIFT          0
-#define QSPI_SMPR_HSENA_MASK           (1 << QSPI_SMPR_HSENA_SHIFT)
-#define QSPI_SMPR_FSPHS_SHIFT          5
-#define QSPI_SMPR_FSPHS_MASK           (1 << QSPI_SMPR_FSPHS_SHIFT)
-#define QSPI_SMPR_FSDLY_SHIFT          6
-#define QSPI_SMPR_FSDLY_MASK           (1 << QSPI_SMPR_FSDLY_SHIFT)
-#define QSPI_SMPR_DDRSMP_SHIFT         16
-#define QSPI_SMPR_DDRSMP_MASK          (7 << QSPI_SMPR_DDRSMP_SHIFT)
-
-#define QSPI_BUFXCR_INVALID_MSTRID     0xe
-#define QSPI_BUF3CR_ALLMST_SHIFT       31
-#define QSPI_BUF3CR_ALLMST_MASK                (1 << QSPI_BUF3CR_ALLMST_SHIFT)
-#define QSPI_BUF3CR_ADATSZ_SHIFT       8
-#define QSPI_BUF3CR_ADATSZ_MASK                (0xFF << QSPI_BUF3CR_ADATSZ_SHIFT)
-
-#define QSPI_BFGENCR_SEQID_SHIFT       12
-#define QSPI_BFGENCR_SEQID_MASK                (0xf << QSPI_BFGENCR_SEQID_SHIFT)
-#define QSPI_BFGENCR_PAR_EN_SHIFT      16
-#define QSPI_BFGENCR_PAR_EN_MASK       (1 << QSPI_BFGENCR_PAR_EN_SHIFT)
-
-#define QSPI_RBSR_RDBFL_SHIFT          8
-#define QSPI_RBSR_RDBFL_MASK           (0x3f << QSPI_RBSR_RDBFL_SHIFT)
-
-#define QSPI_RBCT_RXBRD_SHIFT          8
-#define QSPI_RBCT_RXBRD_USEIPS         (1 << QSPI_RBCT_RXBRD_SHIFT)
-
-#define QSPI_SR_AHB_ACC_SHIFT          2
-#define QSPI_SR_AHB_ACC_MASK           (1 << QSPI_SR_AHB_ACC_SHIFT)
-#define QSPI_SR_IP_ACC_SHIFT           1
-#define QSPI_SR_IP_ACC_MASK            (1 << QSPI_SR_IP_ACC_SHIFT)
-#define QSPI_SR_BUSY_SHIFT             0
-#define QSPI_SR_BUSY_MASK              (1 << QSPI_SR_BUSY_SHIFT)
-
-#define QSPI_LCKCR_LOCK                        0x1
-#define QSPI_LCKCR_UNLOCK              0x2
-
-#define LUT_KEY_VALUE                  0x5af05af0
-
-#define OPRND0_SHIFT                   0
-#define OPRND0(x)                      ((x) << OPRND0_SHIFT)
-#define PAD0_SHIFT                     8
-#define PAD0(x)                                ((x) << PAD0_SHIFT)
-#define INSTR0_SHIFT                   10
-#define INSTR0(x)                      ((x) << INSTR0_SHIFT)
-#define OPRND1_SHIFT                   16
-#define OPRND1(x)                      ((x) << OPRND1_SHIFT)
-#define PAD1_SHIFT                     24
-#define PAD1(x)                                ((x) << PAD1_SHIFT)
-#define INSTR1_SHIFT                   26
-#define INSTR1(x)                      ((x) << INSTR1_SHIFT)
-
-#define LUT_CMD                                1
-#define LUT_ADDR                       2
-#define LUT_DUMMY                      3
-#define LUT_READ                       7
-#define LUT_WRITE                      8
-
-#define LUT_PAD1                       0
-#define LUT_PAD2                       1
-#define LUT_PAD4                       2
-
-#define ADDR24BIT                      0x18
-#define ADDR32BIT                      0x20
-
-#endif /* _FSL_QSPI_H_ */
index e900c997bd7f529d4a71c63b3ab732a6d7159c0c..ffbe20c5b1e6c7b282128a3546cfd7fe0d2993d5 100644 (file)
@@ -153,7 +153,7 @@ bool spi_mem_default_supports_op(struct spi_slave *slave,
            spi_check_buswidth_req(slave, op->dummy.buswidth, true))
                return false;
 
-       if (op->data.nbytes &&
+       if (op->data.dir != SPI_MEM_NO_DATA &&
            spi_check_buswidth_req(slave, op->data.buswidth,
                                   op->data.dir == SPI_MEM_DATA_OUT))
                return false;
index 969bd4b75cbd318361c0b14e6fa9a283c373fd1f..4cab0391f7d12cdbee03f64e3c1ae47c13ffed88 100644 (file)
@@ -8,8 +8,10 @@
 
 #include <common.h>
 #include <dm.h>
+#include <dm/device_compat.h>
 #include <malloc.h>
-#include <spi.h>
+#include <spi-mem.h>
+#include <wait_bit.h>
 #include <asm/io.h>
 #include <linux/log2.h>
 #include <clk.h>
 #define SIFIVE_SPI_IP_TXWM               BIT(0)
 #define SIFIVE_SPI_IP_RXWM               BIT(1)
 
+/* format protocol */
+#define SIFIVE_SPI_PROTO_QUAD          4 /* 4 lines I/O protocol transfer */
+#define SIFIVE_SPI_PROTO_DUAL          2 /* 2 lines I/O protocol transfer */
+#define SIFIVE_SPI_PROTO_SINGLE                1 /* 1 line I/O protocol transfer */
+
 struct sifive_spi {
        void            *regs;          /* base address of the registers */
        u32             fifo_depth;
@@ -92,28 +99,29 @@ struct sifive_spi {
        u32             cs_inactive;    /* Level of the CS pins when inactive*/
        u32             freq;
        u32             num_cs;
+       u8              fmt_proto;
 };
 
 static void sifive_spi_prep_device(struct sifive_spi *spi,
-                                  struct dm_spi_slave_platdata *slave)
+                                  struct dm_spi_slave_platdata *slave_plat)
 {
        /* Update the chip select polarity */
-       if (slave->mode & SPI_CS_HIGH)
-               spi->cs_inactive &= ~BIT(slave->cs);
+       if (slave_plat->mode & SPI_CS_HIGH)
+               spi->cs_inactive &= ~BIT(slave_plat->cs);
        else
-               spi->cs_inactive |= BIT(slave->cs);
+               spi->cs_inactive |= BIT(slave_plat->cs);
        writel(spi->cs_inactive, spi->regs + SIFIVE_SPI_REG_CSDEF);
 
        /* Select the correct device */
-       writel(slave->cs, spi->regs + SIFIVE_SPI_REG_CSID);
+       writel(slave_plat->cs, spi->regs + SIFIVE_SPI_REG_CSID);
 }
 
 static int sifive_spi_set_cs(struct sifive_spi *spi,
-                            struct dm_spi_slave_platdata *slave)
+                            struct dm_spi_slave_platdata *slave_plat)
 {
        u32 cs_mode = SIFIVE_SPI_CSMODE_MODE_HOLD;
 
-       if (slave->mode & SPI_CS_HIGH)
+       if (slave_plat->mode & SPI_CS_HIGH)
                cs_mode = SIFIVE_SPI_CSMODE_MODE_AUTO;
 
        writel(cs_mode, spi->regs + SIFIVE_SPI_REG_CSMODE);
@@ -127,8 +135,8 @@ static void sifive_spi_clear_cs(struct sifive_spi *spi)
 }
 
 static void sifive_spi_prep_transfer(struct sifive_spi *spi,
-                                    bool is_rx_xfer,
-                                    struct dm_spi_slave_platdata *slave)
+                                    struct dm_spi_slave_platdata *slave_plat,
+                                    u8 *rx_ptr)
 {
        u32 cr;
 
@@ -141,21 +149,26 @@ static void sifive_spi_prep_transfer(struct sifive_spi *spi,
 
        /* LSB first? */
        cr &= ~SIFIVE_SPI_FMT_ENDIAN;
-       if (slave->mode & SPI_LSB_FIRST)
+       if (slave_plat->mode & SPI_LSB_FIRST)
                cr |= SIFIVE_SPI_FMT_ENDIAN;
 
        /* Number of wires ? */
        cr &= ~SIFIVE_SPI_FMT_PROTO_MASK;
-       if ((slave->mode & SPI_TX_QUAD) || (slave->mode & SPI_RX_QUAD))
+       switch (spi->fmt_proto) {
+       case SIFIVE_SPI_PROTO_QUAD:
                cr |= SIFIVE_SPI_FMT_PROTO_QUAD;
-       else if ((slave->mode & SPI_TX_DUAL) || (slave->mode & SPI_RX_DUAL))
+               break;
+       case SIFIVE_SPI_PROTO_DUAL:
                cr |= SIFIVE_SPI_FMT_PROTO_DUAL;
-       else
+               break;
+       default:
                cr |= SIFIVE_SPI_FMT_PROTO_SINGLE;
+               break;
+       }
 
        /* SPI direction in/out ? */
        cr &= ~SIFIVE_SPI_FMT_DIR;
-       if (!is_rx_xfer)
+       if (!rx_ptr)
                cr |= SIFIVE_SPI_FMT_DIR;
 
        writel(cr, spi->regs + SIFIVE_SPI_REG_FMT);
@@ -186,50 +199,62 @@ static void sifive_spi_tx(struct sifive_spi *spi, const u8 *tx_ptr)
        writel(tx_data, spi->regs + SIFIVE_SPI_REG_TXDATA);
 }
 
+static int sifive_spi_wait(struct sifive_spi *spi, u32 bit)
+{
+       return wait_for_bit_le32(spi->regs + SIFIVE_SPI_REG_IP,
+                                bit, true, 100, false);
+}
+
 static int sifive_spi_xfer(struct udevice *dev, unsigned int bitlen,
                           const void *dout, void *din, unsigned long flags)
 {
        struct udevice *bus = dev->parent;
        struct sifive_spi *spi = dev_get_priv(bus);
-       struct dm_spi_slave_platdata *slave = dev_get_parent_platdata(dev);
-       const unsigned char *tx_ptr = dout;
+       struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+       const u8 *tx_ptr = dout;
        u8 *rx_ptr = din;
        u32 remaining_len;
        int ret;
 
        if (flags & SPI_XFER_BEGIN) {
-               sifive_spi_prep_device(spi, slave);
+               sifive_spi_prep_device(spi, slave_plat);
 
-               ret = sifive_spi_set_cs(spi, slave);
+               ret = sifive_spi_set_cs(spi, slave_plat);
                if (ret)
                        return ret;
        }
 
-       sifive_spi_prep_transfer(spi, true, slave);
+       sifive_spi_prep_transfer(spi, slave_plat, rx_ptr);
 
        remaining_len = bitlen / 8;
 
        while (remaining_len) {
-               int n_words, tx_words, rx_words;
-
-               n_words = min(remaining_len, spi->fifo_depth);
+               unsigned int n_words = min(remaining_len, spi->fifo_depth);
+               unsigned int tx_words, rx_words;
 
                /* Enqueue n_words for transmission */
-               if (tx_ptr) {
-                       for (tx_words = 0; tx_words < n_words; ++tx_words) {
-                               sifive_spi_tx(spi, tx_ptr);
-                               sifive_spi_rx(spi, NULL);
-                               tx_ptr++;
-                       }
+               for (tx_words = 0; tx_words < n_words; tx_words++) {
+                       if (!tx_ptr)
+                               sifive_spi_tx(spi, NULL);
+                       else
+                               sifive_spi_tx(spi, tx_ptr++);
                }
 
-               /* Read out all the data from the RX FIFO */
                if (rx_ptr) {
-                       for (rx_words = 0; rx_words < n_words; ++rx_words) {
-                               sifive_spi_tx(spi, NULL);
-                               sifive_spi_rx(spi, rx_ptr);
-                               rx_ptr++;
-                       }
+                       /* Wait for transmission + reception to complete */
+                       writel(n_words - 1, spi->regs + SIFIVE_SPI_REG_RXMARK);
+                       ret = sifive_spi_wait(spi, SIFIVE_SPI_IP_RXWM);
+                       if (ret)
+                               return ret;
+
+                       /* Read out all the data from the RX FIFO */
+                       for (rx_words = 0; rx_words < n_words; rx_words++)
+                               sifive_spi_rx(spi, rx_ptr++);
+               } else {
+                       /* Wait for transmission to complete */
+                       ret = sifive_spi_wait(spi, SIFIVE_SPI_IP_TXWM);
+                       if (ret)
+                               return ret;
                }
 
                remaining_len -= n_words;
@@ -241,6 +266,80 @@ static int sifive_spi_xfer(struct udevice *dev, unsigned int bitlen,
        return 0;
 }
 
+static int sifive_spi_exec_op(struct spi_slave *slave,
+                             const struct spi_mem_op *op)
+{
+       struct udevice *dev = slave->dev;
+       struct sifive_spi *spi = dev_get_priv(dev->parent);
+       unsigned long flags = SPI_XFER_BEGIN;
+       u8 opcode = op->cmd.opcode;
+       unsigned int pos = 0;
+       const void *tx_buf = NULL;
+       void *rx_buf = NULL;
+       int op_len, i;
+       int ret;
+
+       if (!op->addr.nbytes && !op->dummy.nbytes && !op->data.nbytes)
+               flags |= SPI_XFER_END;
+
+       spi->fmt_proto = op->cmd.buswidth;
+
+       /* send the opcode */
+       ret = sifive_spi_xfer(dev, 8, (void *)&opcode, NULL, flags);
+       if (ret < 0) {
+               dev_err(dev, "failed to xfer opcode\n");
+               return ret;
+       }
+
+       op_len = op->addr.nbytes + op->dummy.nbytes;
+       u8 op_buf[op_len];
+
+       /* send the addr + dummy */
+       if (op->addr.nbytes) {
+               /* fill address */
+               for (i = 0; i < op->addr.nbytes; i++)
+                       op_buf[pos + i] = op->addr.val >>
+                               (8 * (op->addr.nbytes - i - 1));
+
+               pos += op->addr.nbytes;
+
+               /* fill dummy */
+               if (op->dummy.nbytes)
+                       memset(op_buf + pos, 0xff, op->dummy.nbytes);
+
+               /* make sure to set end flag, if no data bytes */
+               if (!op->data.nbytes)
+                       flags |= SPI_XFER_END;
+
+               spi->fmt_proto = op->addr.buswidth;
+
+               ret = sifive_spi_xfer(dev, op_len * 8, op_buf, NULL, flags);
+               if (ret < 0) {
+                       dev_err(dev, "failed to xfer addr + dummy\n");
+                       return ret;
+               }
+       }
+
+       /* send/received the data */
+       if (op->data.nbytes) {
+               if (op->data.dir == SPI_MEM_DATA_IN)
+                       rx_buf = op->data.buf.in;
+               else
+                       tx_buf = op->data.buf.out;
+
+               spi->fmt_proto = op->data.buswidth;
+
+               ret = sifive_spi_xfer(dev, op->data.nbytes * 8,
+                                     tx_buf, rx_buf, SPI_XFER_END);
+               if (ret) {
+                       dev_err(dev, "failed to xfer data\n");
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
 static int sifive_spi_set_speed(struct udevice *bus, uint speed)
 {
        struct sifive_spi *spi = dev_get_priv(bus);
@@ -309,6 +408,10 @@ static void sifive_spi_init_hw(struct sifive_spi *spi)
        /* Watermark interrupts are disabled by default */
        writel(0, spi->regs + SIFIVE_SPI_REG_IE);
 
+       /* Default watermark FIFO threshold values */
+       writel(1, spi->regs + SIFIVE_SPI_REG_TXMARK);
+       writel(0, spi->regs + SIFIVE_SPI_REG_RXMARK);
+
        /* Set CS/SCK Delays and Inactive Time to defaults */
        writel(SIFIVE_SPI_DELAY0_CSSCK(1) | SIFIVE_SPI_DELAY0_SCKCS(1),
               spi->regs + SIFIVE_SPI_REG_DELAY0);
@@ -348,11 +451,16 @@ static int sifive_spi_probe(struct udevice *bus)
        return 0;
 }
 
+static const struct spi_controller_mem_ops sifive_spi_mem_ops = {
+       .exec_op        = sifive_spi_exec_op,
+};
+
 static const struct dm_spi_ops sifive_spi_ops = {
        .xfer           = sifive_spi_xfer,
        .set_speed      = sifive_spi_set_speed,
        .set_mode       = sifive_spi_set_mode,
        .cs_info        = sifive_spi_cs_info,
+       .mem_ops        = &sifive_spi_mem_ops,
 };
 
 static const struct udevice_id sifive_spi_ids[] = {
index b5e76bd3586199e10070e093476007c2ec5cfb46..e99135e5becded143c518bae58b20da28060f241 100644 (file)
@@ -71,6 +71,7 @@ static const struct timer_ops mtk_timer_ops = {
 
 static const struct udevice_id mtk_timer_ids[] = {
        { .compatible = "mediatek,timer" },
+       { .compatible = "mediatek,mt6577-timer" },
        { }
 };
 
index 4ec3f6df6a9a8130704e47c73bc193ea2e3c2bc4..a8982bdc0946285c7cd7f2b74c00cd386910665f 100644 (file)
@@ -838,87 +838,32 @@ MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
 
 #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
-int dwc3_setup_phy(struct udevice *dev, struct phy **array, int *num_phys)
+int dwc3_setup_phy(struct udevice *dev, struct phy_bulk *phys)
 {
-       int i, ret, count;
-       struct phy *usb_phys;
-
-       /* Return if no phy declared */
-       if (!dev_read_prop(dev, "phys", NULL))
-               return 0;
-       count = dev_count_phandle_with_args(dev, "phys", "#phy-cells");
-       if (count <= 0)
-               return count;
-
-       usb_phys = devm_kcalloc(dev, count, sizeof(struct phy),
-                               GFP_KERNEL);
-       if (!usb_phys)
-               return -ENOMEM;
-
-       for (i = 0; i < count; i++) {
-               ret = generic_phy_get_by_index(dev, i, &usb_phys[i]);
-               if (ret && ret != -ENOENT) {
-                       pr_err("Failed to get USB PHY%d for %s\n",
-                              i, dev->name);
-                       return ret;
-               }
-       }
-
-       for (i = 0; i < count; i++) {
-               ret = generic_phy_init(&usb_phys[i]);
-               if (ret) {
-                       pr_err("Can't init USB PHY%d for %s\n",
-                              i, dev->name);
-                       goto phys_init_err;
-               }
-       }
-
-       for (i = 0; i < count; i++) {
-               ret = generic_phy_power_on(&usb_phys[i]);
-               if (ret) {
-                       pr_err("Can't power USB PHY%d for %s\n",
-                              i, dev->name);
-                       goto phys_poweron_err;
-               }
-       }
-
-       *array = usb_phys;
-       *num_phys =  count;
-       return 0;
-
-phys_poweron_err:
-       for (i = count - 1; i >= 0; i--)
-               generic_phy_power_off(&usb_phys[i]);
+       int ret;
 
-       for (i = 0; i < count; i++)
-               generic_phy_exit(&usb_phys[i]);
+       ret = generic_phy_get_bulk(dev, phys);
+       if (ret)
+               return ret;
 
-       return ret;
+       ret = generic_phy_init_bulk(phys);
+       if (ret)
+               return ret;
 
-phys_init_err:
-       for (; i >= 0; i--)
-               generic_phy_exit(&usb_phys[i]);
+       ret = generic_phy_power_on_bulk(phys);
+       if (ret)
+               generic_phy_exit_bulk(phys);
 
        return ret;
 }
 
-int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys, int num_phys)
+int dwc3_shutdown_phy(struct udevice *dev, struct phy_bulk *phys)
 {
-       int i, ret;
-
-       for (i = 0; i < num_phys; i++) {
-               if (!generic_phy_valid(&usb_phys[i]))
-                       continue;
-
-               ret = generic_phy_power_off(&usb_phys[i]);
-               ret |= generic_phy_exit(&usb_phys[i]);
-               if (ret) {
-                       pr_err("Can't shutdown USB PHY%d for %s\n",
-                              i, dev->name);
-               }
-       }
+       int ret;
 
-       return 0;
+       ret = generic_phy_power_off_bulk(phys);
+       ret |= generic_phy_exit_bulk(phys);
+       return ret;
 }
 #endif
 
index febcfc0f54c48e80ba932c351de1565ab3d7b60f..eabd53a36dc9e85bf1c2319b60e9ab2daa8011da 100644 (file)
@@ -33,8 +33,7 @@ struct dwc3_generic_plat {
 struct dwc3_generic_priv {
        void *base;
        struct dwc3 dwc3;
-       struct phy *phys;
-       int num_phys;
+       struct phy_bulk phys;
 };
 
 struct dwc3_generic_host_priv {
@@ -56,7 +55,7 @@ static int dwc3_generic_probe(struct udevice *dev,
        dwc3_of_parse(dwc3);
 #endif
 
-       rc = dwc3_setup_phy(dev, &priv->phys, &priv->num_phys);
+       rc = dwc3_setup_phy(dev, &priv->phys);
        if (rc)
                return rc;
 
@@ -79,7 +78,7 @@ static int dwc3_generic_remove(struct udevice *dev,
        struct dwc3 *dwc3 = &priv->dwc3;
 
        dwc3_remove(dwc3);
-       dwc3_shutdown_phy(dev, priv->phys, priv->num_phys);
+       dwc3_shutdown_phy(dev, &priv->phys);
        unmap_physmem(dwc3->regs, MAP_NOCACHE);
 
        return 0;
index b9c814cf73e22832194c8f75b305a54179d62511..9f21af2923d7e5a3968a2482e7d91ca2c1636be0 100644 (file)
@@ -943,8 +943,7 @@ int usb_gadget_handle_interrupts(int index)
 struct dwc2_priv_data {
        struct clk_bulk         clks;
        struct reset_ctl_bulk   resets;
-       struct phy *phys;
-       int num_phys;
+       struct phy_bulk phys;
        struct udevice *usb33d_supply;
 };
 
@@ -953,87 +952,29 @@ int dm_usb_gadget_handle_interrupts(struct udevice *dev)
        return dwc2_udc_handle_interrupt();
 }
 
-int dwc2_phy_setup(struct udevice *dev, struct phy **array, int *num_phys)
+static int dwc2_phy_setup(struct udevice *dev, struct phy_bulk *phys)
 {
-       int i, ret, count;
-       struct phy *usb_phys;
-
-       /* Return if no phy declared */
-       if (!dev_read_prop(dev, "phys", NULL))
-               return 0;
-
-       count = dev_count_phandle_with_args(dev, "phys", "#phy-cells");
-       if (count <= 0)
-               return count;
-
-       usb_phys = devm_kcalloc(dev, count, sizeof(struct phy),
-                               GFP_KERNEL);
-       if (!usb_phys)
-               return -ENOMEM;
-
-       for (i = 0; i < count; i++) {
-               ret = generic_phy_get_by_index(dev, i, &usb_phys[i]);
-               if (ret && ret != -ENOENT) {
-                       dev_err(dev, "Failed to get USB PHY%d for %s\n",
-                               i, dev->name);
-                       return ret;
-               }
-       }
-
-       for (i = 0; i < count; i++) {
-               ret = generic_phy_init(&usb_phys[i]);
-               if (ret) {
-                       dev_err(dev, "Can't init USB PHY%d for %s\n",
-                               i, dev->name);
-                       goto phys_init_err;
-               }
-       }
-
-       for (i = 0; i < count; i++) {
-               ret = generic_phy_power_on(&usb_phys[i]);
-               if (ret) {
-                       dev_err(dev, "Can't power USB PHY%d for %s\n",
-                               i, dev->name);
-                       goto phys_poweron_err;
-               }
-       }
-
-       *array = usb_phys;
-       *num_phys =  count;
-
-       return 0;
-
-phys_poweron_err:
-       for (i = count - 1; i >= 0; i--)
-               generic_phy_power_off(&usb_phys[i]);
+       int ret;
 
-       for (i = 0; i < count; i++)
-               generic_phy_exit(&usb_phys[i]);
+       ret = generic_phy_get_bulk(dev, phys);
+       if (ret)
+               return ret;
 
-       return ret;
+       ret = generic_phy_init_bulk(phys);
+       if (ret)
+               return ret;
 
-phys_init_err:
-       for (; i >= 0; i--)
-               generic_phy_exit(&usb_phys[i]);
+       ret = generic_phy_power_on_bulk(phys);
+       if (ret)
+               generic_phy_exit_bulk(phys);
 
        return ret;
 }
 
-void dwc2_phy_shutdown(struct udevice *dev, struct phy *usb_phys, int num_phys)
+static void dwc2_phy_shutdown(struct udevice *dev, struct phy_bulk *phys)
 {
-       int i, ret;
-
-       for (i = 0; i < num_phys; i++) {
-               if (!generic_phy_valid(&usb_phys[i]))
-                       continue;
-
-               ret = generic_phy_power_off(&usb_phys[i]);
-               ret |= generic_phy_exit(&usb_phys[i]);
-               if (ret) {
-                       dev_err(dev, "Can't shutdown USB PHY%d for %s\n",
-                               i, dev->name);
-               }
-       }
+       generic_phy_power_off_bulk(phys);
+       generic_phy_exit_bulk(phys);
 }
 
 static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev)
@@ -1158,7 +1099,7 @@ static int dwc2_udc_otg_probe(struct udevice *dev)
        if (ret)
                return ret;
 
-       ret = dwc2_phy_setup(dev, &priv->phys, &priv->num_phys);
+       ret = dwc2_phy_setup(dev, &priv->phys);
        if (ret)
                return ret;
 
@@ -1208,7 +1149,7 @@ static int dwc2_udc_otg_remove(struct udevice *dev)
 
        clk_release_bulk(&priv->clks);
 
-       dwc2_phy_shutdown(dev, priv->phys, priv->num_phys);
+       dwc2_phy_shutdown(dev, &priv->phys);
 
        return dm_scan_fdt_dev(dev);
 }
index 94ac969058e680a0c4bdccb414346382213d2446..2f381dc9580c37794d86efeddca63e6dc2eac18d 100644 (file)
@@ -30,6 +30,12 @@ config USB_XHCI_DWC3_OF_SIMPLE
          Support USB2/3 functionality in simple SoC integrations with
          USB controller based on the DesignWare USB3 IP Core.
 
+config USB_XHCI_MTK
+       bool "Support for MediaTek on-chip xHCI USB controller"
+       depends on ARCH_MEDIATEK
+       help
+         Enables support for the on-chip xHCI controller on MediaTek SoCs.
+
 config USB_XHCI_MVEBU
        bool "MVEBU USB 3.0 support"
        default y
index b62f346094fad811a2ebf75a71ecca564397ba9f..e8e3b17e42c6f4f03839dfca657d89d900d4f9a7 100644 (file)
@@ -51,6 +51,7 @@ obj-$(CONFIG_USB_XHCI_DWC3_OF_SIMPLE) += dwc3-of-simple.o
 obj-$(CONFIG_USB_XHCI_ROCKCHIP) += xhci-rockchip.o
 obj-$(CONFIG_USB_XHCI_EXYNOS) += xhci-exynos5.o
 obj-$(CONFIG_USB_XHCI_FSL) += xhci-fsl.o
+obj-$(CONFIG_USB_XHCI_MTK) += xhci-mtk.o
 obj-$(CONFIG_USB_XHCI_MVEBU) += xhci-mvebu.o
 obj-$(CONFIG_USB_XHCI_OMAP) += xhci-omap.o
 obj-$(CONFIG_USB_XHCI_PCI) += xhci-pci.o
index 9fcfa39d4b5afdac9be67d91172e6b838f8b4913..563db1a4260508a4100be763cac8de624a19ad8e 100644 (file)
@@ -19,8 +19,7 @@
 #include <linux/usb/otg.h>
 
 struct xhci_dwc3_platdata {
-       struct phy *usb_phys;
-       int num_phys;
+       struct phy_bulk *usb_phys;
 };
 
 void dwc3_set_mode(struct dwc3 *dwc3_reg, u32 mode)
@@ -125,7 +124,7 @@ static int xhci_dwc3_probe(struct udevice *dev)
        hcor = (struct xhci_hcor *)((uintptr_t)hccr +
                        HC_LENGTH(xhci_readl(&(hccr)->cr_capbase)));
 
-       ret = dwc3_setup_phy(dev, &plat->usb_phys, &plat->num_phys);
+       ret = dwc3_setup_phy(dev, plat->usb_phys);
        if (ret && (ret != -ENOTSUPP))
                return ret;
 
@@ -168,7 +167,7 @@ static int xhci_dwc3_remove(struct udevice *dev)
 {
        struct xhci_dwc3_platdata *plat = dev_get_platdata(dev);
 
-       dwc3_shutdown_phy(dev, plat->usb_phys, plat->num_phys);
+       dwc3_shutdown_phy(dev, plat->usb_phys);
 
        return xhci_deregister(dev);
 }
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
new file mode 100644 (file)
index 0000000..8ff7185
--- /dev/null
@@ -0,0 +1,303 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2019 MediaTek, Inc.
+ * Authors: Chunfeng Yun <chunfeng.yun@mediatek.com>
+ */
+
+#include <clk.h>
+#include <common.h>
+#include <dm.h>
+#include <dm/devres.h>
+#include <generic-phy.h>
+#include <malloc.h>
+#include <usb.h>
+#include <linux/errno.h>
+#include <linux/compat.h>
+#include <power/regulator.h>
+#include <linux/iopoll.h>
+#include <usb/xhci.h>
+
+/* IPPC (IP Port Control) registers */
+#define IPPC_IP_PW_CTRL0               0x00
+#define CTRL0_IP_SW_RST                        BIT(0)
+
+#define IPPC_IP_PW_CTRL1               0x04
+#define CTRL1_IP_HOST_PDN              BIT(0)
+
+#define IPPC_IP_PW_STS1                        0x10
+#define STS1_IP_SLEEP_STS              BIT(30)
+#define STS1_U3_MAC_RST                        BIT(16)
+#define STS1_XHCI_RST                  BIT(11)
+#define STS1_SYS125_RST                        BIT(10)
+#define STS1_REF_RST                   BIT(8)
+#define STS1_SYSPLL_STABLE             BIT(0)
+
+#define IPPC_IP_XHCI_CAP               0x24
+#define CAP_U3_PORT_NUM(p)             ((p) & 0xff)
+#define CAP_U2_PORT_NUM(p)             (((p) >> 8) & 0xff)
+
+#define IPPC_U3_CTRL_0P                        0x30
+#define CTRL_U3_PORT_HOST_SEL          BIT(2)
+#define CTRL_U3_PORT_PDN               BIT(1)
+#define CTRL_U3_PORT_DIS               BIT(0)
+
+#define IPPC_U2_CTRL_0P                        0x50
+#define CTRL_U2_PORT_HOST_SEL          BIT(2)
+#define CTRL_U2_PORT_PDN               BIT(1)
+#define CTRL_U2_PORT_DIS               BIT(0)
+
+#define IPPC_U3_CTRL(p)        (IPPC_U3_CTRL_0P + ((p) * 0x08))
+#define IPPC_U2_CTRL(p)        (IPPC_U2_CTRL_0P + ((p) * 0x08))
+
+struct mtk_xhci {
+       struct xhci_ctrl ctrl;  /* Needs to come first in this struct! */
+       struct xhci_hccr *hcd;
+       void __iomem *ippc;
+       struct udevice *dev;
+       struct udevice *vusb33_supply;
+       struct udevice *vbus_supply;
+       struct clk_bulk clks;
+       struct phy_bulk phys;
+       int num_u2ports;
+       int num_u3ports;
+};
+
+static int xhci_mtk_host_enable(struct mtk_xhci *mtk)
+{
+       u32 value;
+       u32 check_val;
+       int ret;
+       int i;
+
+       /* power on host ip */
+       clrbits_le32(mtk->ippc + IPPC_IP_PW_CTRL1, CTRL1_IP_HOST_PDN);
+
+       /* power on and enable all u3 ports */
+       for (i = 0; i < mtk->num_u3ports; i++) {
+               clrsetbits_le32(mtk->ippc + IPPC_U3_CTRL(i),
+                               CTRL_U3_PORT_PDN | CTRL_U3_PORT_DIS,
+                               CTRL_U3_PORT_HOST_SEL);
+       }
+
+       /* power on and enable all u2 ports */
+       for (i = 0; i < mtk->num_u2ports; i++) {
+               clrsetbits_le32(mtk->ippc + IPPC_U2_CTRL(i),
+                               CTRL_U2_PORT_PDN | CTRL_U2_PORT_DIS,
+                               CTRL_U2_PORT_HOST_SEL);
+       }
+
+       /*
+        * wait for clocks to be stable, and clock domains reset to
+        * be inactive after power on and enable ports
+        */
+       check_val = STS1_SYSPLL_STABLE | STS1_REF_RST |
+                       STS1_SYS125_RST | STS1_XHCI_RST;
+
+       if (mtk->num_u3ports)
+               check_val |= STS1_U3_MAC_RST;
+
+       ret = readl_poll_timeout(mtk->ippc + IPPC_IP_PW_STS1, value,
+                                (check_val == (value & check_val)), 20000);
+       if (ret)
+               dev_err(mtk->dev, "clocks are not stable 0x%x!\n", value);
+
+       return ret;
+}
+
+static int xhci_mtk_host_disable(struct mtk_xhci *mtk)
+{
+       int i;
+
+       /* power down all u3 ports */
+       for (i = 0; i < mtk->num_u3ports; i++)
+               setbits_le32(mtk->ippc + IPPC_U3_CTRL(i), CTRL_U3_PORT_PDN);
+
+       /* power down all u2 ports */
+       for (i = 0; i < mtk->num_u2ports; i++)
+               setbits_le32(mtk->ippc + IPPC_U2_CTRL(i), CTRL_U2_PORT_PDN);
+
+       /* power down host ip */
+       setbits_le32(mtk->ippc + IPPC_IP_PW_CTRL1, CTRL1_IP_HOST_PDN);
+
+       return 0;
+}
+
+static int xhci_mtk_ssusb_init(struct mtk_xhci *mtk)
+{
+       u32 value;
+
+       /* reset whole ip */
+       setbits_le32(mtk->ippc + IPPC_IP_PW_CTRL0, CTRL0_IP_SW_RST);
+       udelay(1);
+       clrbits_le32(mtk->ippc + IPPC_IP_PW_CTRL0, CTRL0_IP_SW_RST);
+
+       value = readl(mtk->ippc + IPPC_IP_XHCI_CAP);
+       mtk->num_u3ports = CAP_U3_PORT_NUM(value);
+       mtk->num_u2ports = CAP_U2_PORT_NUM(value);
+       dev_info(mtk->dev, "u2p:%d, u3p:%d\n",
+                mtk->num_u2ports, mtk->num_u3ports);
+
+       return xhci_mtk_host_enable(mtk);
+}
+
+static int xhci_mtk_ofdata_get(struct mtk_xhci *mtk)
+{
+       struct udevice *dev = mtk->dev;
+       int ret = 0;
+
+       mtk->hcd = devfdt_remap_addr_name(dev, "mac");
+       if (!mtk->hcd) {
+               dev_err(dev, "failed to get xHCI base address\n");
+               return -ENXIO;
+       }
+
+       mtk->ippc = devfdt_remap_addr_name(dev, "ippc");
+       if (!mtk->ippc) {
+               dev_err(dev, "failed to get IPPC base address\n");
+               return -ENXIO;
+       }
+
+       dev_info(dev, "hcd: 0x%p, ippc: 0x%p\n", mtk->hcd, mtk->ippc);
+
+       ret = clk_get_bulk(dev, &mtk->clks);
+       if (ret) {
+               dev_err(dev, "failed to get clocks %d!\n", ret);
+               return ret;
+       }
+
+       ret = device_get_supply_regulator(dev, "vusb33-supply",
+                                         &mtk->vusb33_supply);
+       if (ret)
+               debug("can't get vusb33 regulator %d!\n", ret);
+
+       ret = device_get_supply_regulator(dev, "vbus-supply",
+                                         &mtk->vbus_supply);
+       if (ret)
+               debug("can't get vbus regulator %d!\n", ret);
+
+       return 0;
+}
+
+static int xhci_mtk_ldos_enable(struct mtk_xhci *mtk)
+{
+       int ret;
+
+       ret = regulator_set_enable(mtk->vusb33_supply, true);
+       if (ret < 0 && ret != -ENOSYS) {
+               dev_err(mtk->dev, "failed to enable vusb33 %d!\n", ret);
+               return ret;
+       }
+
+       ret = regulator_set_enable(mtk->vbus_supply, true);
+       if (ret < 0 && ret != -ENOSYS) {
+               dev_err(mtk->dev, "failed to enable vbus %d!\n", ret);
+               regulator_set_enable(mtk->vusb33_supply, false);
+               return ret;
+       }
+
+       return 0;
+}
+
+static void xhci_mtk_ldos_disable(struct mtk_xhci *mtk)
+{
+       regulator_set_enable(mtk->vbus_supply, false);
+       regulator_set_enable(mtk->vusb33_supply, false);
+}
+
+static int xhci_mtk_phy_setup(struct mtk_xhci *mtk)
+{
+       struct udevice *dev = mtk->dev;
+       struct phy_bulk *phys = &mtk->phys;
+       int ret;
+
+       ret = generic_phy_get_bulk(dev, phys);
+       if (ret)
+               return ret;
+
+       ret = generic_phy_init_bulk(phys);
+       if (ret)
+               return ret;
+
+       ret = generic_phy_power_on_bulk(phys);
+       if (ret)
+               generic_phy_exit_bulk(phys);
+
+       return ret;
+}
+
+static void xhci_mtk_phy_shutdown(struct mtk_xhci *mtk)
+{
+       generic_phy_power_off_bulk(&mtk->phys);
+       generic_phy_exit_bulk(&mtk->phys);
+}
+
+static int xhci_mtk_probe(struct udevice *dev)
+{
+       struct mtk_xhci *mtk = dev_get_priv(dev);
+       struct xhci_hcor *hcor;
+       int ret;
+
+       mtk->dev = dev;
+       ret = xhci_mtk_ofdata_get(mtk);
+       if (ret)
+               return ret;
+
+       ret = xhci_mtk_ldos_enable(mtk);
+       if (ret)
+               goto ldos_err;
+
+       ret = clk_enable_bulk(&mtk->clks);
+       if (ret)
+               goto clks_err;
+
+       ret = xhci_mtk_phy_setup(mtk);
+       if (ret)
+               goto phys_err;
+
+       ret = xhci_mtk_ssusb_init(mtk);
+       if (ret)
+               goto ssusb_init_err;
+
+       hcor = (struct xhci_hcor *)((uintptr_t)mtk->hcd +
+                       HC_LENGTH(xhci_readl(&mtk->hcd->cr_capbase)));
+
+       return xhci_register(dev, mtk->hcd, hcor);
+
+ssusb_init_err:
+       xhci_mtk_phy_shutdown(mtk);
+phys_err:
+       clk_disable_bulk(&mtk->clks);
+clks_err:
+       xhci_mtk_ldos_disable(mtk);
+ldos_err:
+       return ret;
+}
+
+static int xhci_mtk_remove(struct udevice *dev)
+{
+       struct mtk_xhci *mtk = dev_get_priv(dev);
+
+       xhci_deregister(dev);
+       xhci_mtk_host_disable(mtk);
+       xhci_mtk_ldos_disable(mtk);
+       clk_disable_bulk(&mtk->clks);
+
+       return 0;
+}
+
+static const struct udevice_id xhci_mtk_ids[] = {
+       { .compatible = "mediatek,mtk-xhci" },
+       { }
+};
+
+U_BOOT_DRIVER(usb_xhci) = {
+       .name = "xhci-mtk",
+       .id = UCLASS_USB,
+       .of_match = xhci_mtk_ids,
+       .probe = xhci_mtk_probe,
+       .remove = xhci_mtk_remove,
+       .ops = &xhci_usb_ops,
+       .bind = dm_scan_fdt_dev,
+       .priv_auto_alloc_size = sizeof(struct mtk_xhci),
+       .flags = DM_FLAG_ALLOC_PRIV_DMA,
+};
index 40dee2e6d9bb1d3a2ef7cb01bf0b608e7d6fcaf8..c370eb639428dbce514ad3d719d81f13e8c134a4 100644 (file)
@@ -610,6 +610,16 @@ static int xhci_set_configuration(struct usb_device *udev)
                ep_ctx[ep_index]->tx_info =
                        cpu_to_le32(EP_MAX_ESIT_PAYLOAD_LO(max_esit_payload) |
                        EP_AVG_TRB_LENGTH(avg_trb_len));
+
+               /*
+                * The MediaTek xHCI defines some extra SW parameters which
+                * are put into reserved DWs in Slot and Endpoint Contexts
+                * for synchronous endpoints.
+                */
+               if (IS_ENABLED(CONFIG_USB_XHCI_MTK)) {
+                       ep_ctx[ep_index]->reserved[0] =
+                               cpu_to_le32(EP_BPKTS(1) | EP_BBM(1));
+               }
        }
 
        return xhci_configure_endpoints(udev, false);
index f4444b9c3487494d20ef524967ea512d3bd354b1..71d3faf169dec23b4e9801a91736ddcbac3a1b80 100644 (file)
@@ -8,7 +8,6 @@
 #include <clk.h>
 #include <display.h>
 #include <dm.h>
-#include <fdtdec.h>
 #include <panel.h>
 #include <regmap.h>
 #include "rk_mipi.h"
index 74ebe770a9521b13d7b515aa79592de404fb3fed..cfaa37797eda6f1f3bd70a5cf21a64999e0e1083 100644 (file)
@@ -8,7 +8,6 @@
 #include <clk.h>
 #include <display.h>
 #include <dm.h>
-#include <fdtdec.h>
 #include <panel.h>
 #include <regmap.h>
 #include "rk_mipi.h"
index cf84b886e72d2dc700cda202bec250f122309e16..99b16cd95edc021fe96f9481d31807a3497340c9 100644 (file)
@@ -997,7 +997,7 @@ static int rk_edp_ofdata_to_platdata(struct udevice *dev)
 {
        struct rk_edp_priv *priv = dev_get_priv(dev);
 
-       priv->regs = (struct rk3288_edp *)devfdt_get_addr(dev);
+       priv->regs = dev_read_addr_ptr(dev);
        priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
 
        return 0;
index 79e24baf53bd6459bd702d3ffea2e43258fc148b..c92c2e3c6c0eaaa9de020d96ec3b60b3bb4386d0 100644 (file)
@@ -161,8 +161,7 @@ int rk_lvds_enable(struct udevice *dev, int panel_bpp,
 
 int rk_lvds_read_timing(struct udevice *dev, struct display_timing *timing)
 {
-       if (fdtdec_decode_display_timing
-           (gd->fdt_blob, dev_of_offset(dev), 0, timing)) {
+       if (ofnode_decode_display_timing(dev_ofnode(dev), 0, timing)) {
                debug("%s: Failed to decode display timing\n", __func__);
                return -EINVAL;
        }
@@ -173,13 +172,11 @@ int rk_lvds_read_timing(struct udevice *dev, struct display_timing *timing)
 static int rk_lvds_ofdata_to_platdata(struct udevice *dev)
 {
        struct rk_lvds_priv *priv = dev_get_priv(dev);
-       const void *blob = gd->fdt_blob;
-       int node = dev_of_offset(dev);
        int ret;
-       priv->regs = (void *)devfdt_get_addr(dev);
+       priv->regs = dev_read_addr_ptr(dev);
        priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
 
-       ret = fdtdec_get_int(blob, node, "rockchip,output", -1);
+       ret = dev_read_s32_default(dev, "rockchip,output", -1);
        if (ret != -1) {
                priv->output = ret;
                debug("LVDS output : %d\n", ret);
@@ -188,7 +185,7 @@ static int rk_lvds_ofdata_to_platdata(struct udevice *dev)
                priv->output = LVDS_OUTPUT_RGB;
        }
 
-       ret = fdtdec_get_int(blob, node, "rockchip,data-mapping", -1);
+       ret = dev_read_s32_default(dev, "rockchip,data-mapping", -1);
        if (ret != -1) {
                priv->format = ret;
                debug("LVDS data-mapping : %d\n", ret);
@@ -197,7 +194,7 @@ static int rk_lvds_ofdata_to_platdata(struct udevice *dev)
                priv->format = LVDS_FORMAT_JEIDA;
        }
 
-       ret = fdtdec_get_int(blob, node, "rockchip,data-width", -1);
+       ret = dev_read_s32_default(dev, "rockchip,data-width", -1);
        if (ret != -1) {
                debug("LVDS data-width : %d\n", ret);
                if (ret == 24) {
index f9280e860705a65c5dd646cdab6deaa1e98dce02..f1c21bb8d7e436d1743f77675afbaf783f59df4e 100644 (file)
@@ -8,7 +8,6 @@
 #include <clk.h>
 #include <display.h>
 #include <dm.h>
-#include <fdtdec.h>
 #include <panel.h>
 #include <regmap.h>
 #include "rk_mipi.h"
@@ -29,8 +28,7 @@ int rk_mipi_read_timing(struct udevice *dev,
 {
        int ret;
 
-       ret = fdtdec_decode_display_timing(gd->fdt_blob, dev_of_offset(dev),
-                                        0, timing);
+       ret = ofnode_decode_display_timing(dev_ofnode(dev), 0, timing);
        if (ret) {
                debug("%s: Failed to decode display timing (ret=%d)\n",
                      __func__, ret);
@@ -77,7 +75,7 @@ static void rk_mipi_dsi_write(uintptr_t regs, u32 reg, u32 val)
 int rk_mipi_dsi_enable(struct udevice *dev,
                       const struct display_timing *timing)
 {
-       int node, timing_node;
+       ofnode node, timing_node;
        int val;
        struct rk_mipi_priv *priv = dev_get_priv(dev);
        uintptr_t regs = priv->regs;
@@ -120,10 +118,10 @@ int rk_mipi_dsi_enable(struct udevice *dev,
        rk_mipi_dsi_write(regs, VID_PKT_SIZE, 0x4b0);
 
        /* Set dpi color coding depth 24 bit */
-       timing_node = fdt_subnode_offset(gd->fdt_blob, dev_of_offset(dev),
-                                                                        "display-timings");
-       node = fdt_first_subnode(gd->fdt_blob, timing_node);
-       val = fdtdec_get_int(gd->fdt_blob, node, "bits-per-pixel", -1);
+       timing_node = ofnode_find_subnode(dev->node, "display-timings");
+       node = ofnode_first_subnode(timing_node);
+
+       val = ofnode_read_u32_default(node, "bits-per-pixel", -1);
        switch (val) {
        case 16:
                rk_mipi_dsi_write(regs, DPI_COLOR_CODING, DPI_16BIT_CFG_1);
index 6cafd243e049841251470929be7b83c7b3567e37..bf06180cddfca9c4e4b527f24fb1705b1668daff 100644 (file)
@@ -49,6 +49,7 @@ config ULP_WATCHDOG
 config DESIGNWARE_WATCHDOG
        bool "Designware watchdog timer support"
        select HW_WATCHDOG if !WDT
+       default y if WDT && ROCKCHIP_RK3399
        help
          Enable this to support Designware Watchdog Timer IP, present e.g.
          on Altera SoCFPGA SoCs.
index 669a32320d44cd5443ab9556eec72682e8fe0ed9..b3c597e1d03621b72e95a28582902cc3e81b0971 100644 (file)
@@ -143,6 +143,7 @@ static const struct wdt_ops mtk_wdt_ops = {
 
 static const struct udevice_id mtk_wdt_ids[] = {
        { .compatible = "mediatek,wdt"},
+       { .compatible = "mediatek,mt6589-wdt"},
        {}
 };
 
index 22b70ad3197fade01b4365623c175d3f9e592dff..64c57f2cdf98661e04d577197c131f9279d0aa3f 100644 (file)
--- a/env/sf.c
+++ b/env/sf.c
@@ -305,7 +305,7 @@ U_BOOT_ENV_LOCATION(sf) = {
        .location       = ENVL_SPI_FLASH,
        ENV_NAME("SPI Flash")
        .load           = env_sf_load,
-       .save           = ENV_SAVE_PTR(env_sf_save),
+       .save           = CONFIG_IS_ENABLED(SAVEENV) ? ENV_SAVE_PTR(env_sf_save) : NULL,
 #if defined(INITENV) && (CONFIG_ENV_ADDR != 0x0)
        .init           = env_sf_init,
 #endif
index 779e2528b77e8a8494855d639d85479ed4552731..4a34813804f634741c7f9896b8c6572de8a69750 100644 (file)
@@ -5,10 +5,13 @@
 
 extra-y        := hello_world
 extra-$(CONFIG_SMC91111)           += smc91111_eeprom
-extra-$(CONFIG_SMC911X)            += smc911x_eeprom
 extra-$(CONFIG_SPI_FLASH_ATMEL)    += atmel_df_pow2
 extra-$(CONFIG_PPC)                += sched
 
+ifndef CONFIG_DM_ETH
+extra-$(CONFIG_SMC911X)            += smc911x_eeprom
+endif
+
 #
 # Some versions of make do not handle trailing white spaces properly;
 # leading to build failures. The problem was found with GNU Make 3.80.
index 2c05ed902d0c55734fc6f13784eaed4de9e93105..270588bcf5ea66d4bb2ba65785dbb6b6e1a37c2a 100644 (file)
 #include <console.h>
 #include <exports.h>
 #include <linux/ctype.h>
+#include <linux/types.h>
 #include "../drivers/net/smc911x.h"
 
+#define DRIVERNAME "smc911x"
+
+#if defined (CONFIG_SMC911X_32_BIT) && \
+       defined (CONFIG_SMC911X_16_BIT)
+#error "SMC911X: Only one of CONFIG_SMC911X_32_BIT and \
+       CONFIG_SMC911X_16_BIT shall be set"
+#endif
+
+struct chip_id {
+       u16 id;
+       char *name;
+};
+
+static const struct chip_id chip_ids[] =  {
+       { CHIP_89218, "LAN89218" },
+       { CHIP_9115, "LAN9115" },
+       { CHIP_9116, "LAN9116" },
+       { CHIP_9117, "LAN9117" },
+       { CHIP_9118, "LAN9118" },
+       { CHIP_9211, "LAN9211" },
+       { CHIP_9215, "LAN9215" },
+       { CHIP_9216, "LAN9216" },
+       { CHIP_9217, "LAN9217" },
+       { CHIP_9218, "LAN9218" },
+       { CHIP_9220, "LAN9220" },
+       { CHIP_9221, "LAN9221" },
+       { 0, NULL },
+};
+
+#if defined (CONFIG_SMC911X_32_BIT)
+static u32 smc911x_reg_read(struct eth_device *dev, u32 offset)
+{
+       return *(volatile u32*)(dev->iobase + offset);
+}
+
+static void smc911x_reg_write(struct eth_device *dev, u32 offset, u32 val)
+{
+       *(volatile u32*)(dev->iobase + offset) = val;
+}
+#elif defined (CONFIG_SMC911X_16_BIT)
+static u32 smc911x_reg_read(struct eth_device *dev, u32 offset)
+{
+       volatile u16 *addr_16 = (u16 *)(dev->iobase + offset);
+       return (*addr_16 & 0x0000ffff) | (*(addr_16 + 1) << 16);
+}
+static void smc911x_reg_write(struct eth_device *dev, u32 offset, u32 val)
+{
+       *(volatile u16 *)(dev->iobase + offset) = (u16)val;
+       *(volatile u16 *)(dev->iobase + offset + 2) = (u16)(val >> 16);
+}
+#else
+#error "SMC911X: undefined bus width"
+#endif /* CONFIG_SMC911X_16_BIT */
+
+static u32 smc911x_get_mac_csr(struct eth_device *dev, u8 reg)
+{
+       while (smc911x_reg_read(dev, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+       smc911x_reg_write(dev, MAC_CSR_CMD,
+                       MAC_CSR_CMD_CSR_BUSY | MAC_CSR_CMD_R_NOT_W | reg);
+       while (smc911x_reg_read(dev, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+
+       return smc911x_reg_read(dev, MAC_CSR_DATA);
+}
+
+static void smc911x_set_mac_csr(struct eth_device *dev, u8 reg, u32 data)
+{
+       while (smc911x_reg_read(dev, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+       smc911x_reg_write(dev, MAC_CSR_DATA, data);
+       smc911x_reg_write(dev, MAC_CSR_CMD, MAC_CSR_CMD_CSR_BUSY | reg);
+       while (smc911x_reg_read(dev, MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+}
+
+static int smc911x_detect_chip(struct eth_device *dev)
+{
+       unsigned long val, i;
+
+       val = smc911x_reg_read(dev, BYTE_TEST);
+       if (val == 0xffffffff) {
+               /* Special case -- no chip present */
+               return -1;
+       } else if (val != 0x87654321) {
+               printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n", val);
+               return -1;
+       }
+
+       val = smc911x_reg_read(dev, ID_REV) >> 16;
+       for (i = 0; chip_ids[i].id != 0; i++) {
+               if (chip_ids[i].id == val) break;
+       }
+       if (!chip_ids[i].id) {
+               printf(DRIVERNAME ": Unknown chip ID %04lx\n", val);
+               return -1;
+       }
+
+       dev->priv = (void *)&chip_ids[i];
+
+       return 0;
+}
+
+static void smc911x_reset(struct eth_device *dev)
+{
+       int timeout;
+
+       /*
+        *  Take out of PM setting first
+        *  Device is already wake up if PMT_CTRL_READY bit is set
+        */
+       if ((smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY) == 0) {
+               /* Write to the bytetest will take out of powerdown */
+               smc911x_reg_write(dev, BYTE_TEST, 0x0);
+
+               timeout = 10;
+
+               while (timeout-- &&
+                       !(smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY))
+                       udelay(10);
+               if (timeout < 0) {
+                       printf(DRIVERNAME
+                               ": timeout waiting for PM restore\n");
+                       return;
+               }
+       }
+
+       /* Disable interrupts */
+       smc911x_reg_write(dev, INT_EN, 0);
+
+       smc911x_reg_write(dev, HW_CFG, HW_CFG_SRST);
+
+       timeout = 1000;
+       while (timeout-- && smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
+               udelay(10);
+
+       if (timeout < 0) {
+               printf(DRIVERNAME ": reset timeout\n");
+               return;
+       }
+
+       /* Reset the FIFO level and flow control settings */
+       smc911x_set_mac_csr(dev, FLOW, FLOW_FCPT | FLOW_FCEN);
+       smc911x_reg_write(dev, AFC_CFG, 0x0050287F);
+
+       /* Set to LED outputs */
+       smc911x_reg_write(dev, GPIO_CFG, 0x70070000);
+}
+
 /**
  *     smsc_ctrlc - detect press of CTRL+C (common ctrlc() isnt exported!?)
  */
index f8524e5a99abb51dcb5400c2c666c3ec2a656b91..0ceb73d9c916201327f89dcc04bfc546ac4bc4dc 100644 (file)
@@ -107,22 +107,18 @@ void ext4fs_free_journal(void)
        for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
                if (dirty_block_ptr[i]->blknr == -1)
                        break;
-               if (dirty_block_ptr[i]->buf)
-                       free(dirty_block_ptr[i]->buf);
+               free(dirty_block_ptr[i]->buf);
        }
 
        for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
                if (journal_ptr[i]->blknr == -1)
                        break;
-               if (journal_ptr[i]->buf)
-                       free(journal_ptr[i]->buf);
+               free(journal_ptr[i]->buf);
        }
 
        for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
-               if (journal_ptr[i])
-                       free(journal_ptr[i]);
-               if (dirty_block_ptr[i])
-                       free(dirty_block_ptr[i]);
+               free(journal_ptr[i]);
+               free(dirty_block_ptr[i]);
        }
        gindex = 0;
        gd_index = 0;
@@ -272,8 +268,7 @@ void ext4fs_free_revoke_blks(void)
        struct revoke_blk_list *next_node = NULL;
 
        while (tmp_node != NULL) {
-               if (tmp_node->content)
-                       free(tmp_node->content);
+               free(tmp_node->content);
                tmp_node = tmp_node->next;
        }
 
index b7b447b1fe3ba307bf2113a82605b5c6bdf2dde0..3754c7f2b2ab22dc90fc66873e64a7441929e759 100644 (file)
@@ -3,7 +3,7 @@
 
 /* Supporting routines */
 int bedbug_puts (const char *);
-void bedbug_init (void);
+int bedbug_init(void);
 void bedbug860_init (void);
 void do_bedbug_breakpoint (struct pt_regs *);
 void bedbug_main_loop (unsigned long, struct pt_regs *);
index 3948d68014a1ef6cd570c9580513c111d6a50af7..6abfe393fc03d744abb6a867923baedcd767e41b 100644 (file)
  */
 #define CONFIG_SYS_LOAD_ADDR           0xcc000000      /* Half of RAM */
 #define CONFIG_LOADADDR                        CONFIG_SYS_LOAD_ADDR
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MONITOR_BASE - \
-                                        CONFIG_ENV_SIZE - \
-                                        CONFIG_SYS_MALLOC_LEN -        \
-                                        0x10000)
 
 #endif /* __CONFIG_H */
index 97bce43ce438be3f6bcb47d0df47ebed321512bd..445eef8b15017bc0b1f9e1a34b632bbc45211fa1 100644 (file)
  */
 #define CONFIG_SYS_LOAD_ADDR           0xd4000000      /* Half of RAM */
 #define CONFIG_LOADADDR                        CONFIG_SYS_LOAD_ADDR
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MONITOR_BASE - \
-                                        CONFIG_ENV_SIZE - \
-                                        CONFIG_SYS_MALLOC_LEN -        \
-                                        0x10000)
 
 #endif /* __CONFIG_H */
index abecf90c743e521fa301c6aaec17e827a9e03cc5..67639458b416d5dcc4a8e130ae8bd4cd8e274fda 100644 (file)
@@ -128,8 +128,6 @@ unsigned long get_board_ddr_clk(void);
 #if 0
 #define CONFIG_POST CONFIG_SYS_POST_MEMORY     /* test POST memory test */
 #endif
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
 
 /*
  *  Config the L3 Cache as L3 SRAM
index 31879f86e590e44c6a17f48167f35b2b906b2b79..879173f6f2ec95e49f4314381d1ae4a5659d3929 100644 (file)
@@ -56,9 +56,6 @@
 #define CONFIG_L2_CACHE                        /* toggle L2 cache */
 #define CONFIG_BTB                     /* enable branch predition */
 
-#define CONFIG_SYS_MEMTEST_START       0x01000000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x01ffffff
-
 /* DDR Setup */
 #undef CONFIG_SYS_DDR_RAW_TIMING
 #undef CONFIG_DDR_SPD
index 4fc64a8f187b7ba74675af9198ffa125b7fe2923..ac37ae7cb8fe5658add470311a59f2b6a88899ea 100644 (file)
@@ -94,9 +94,6 @@
 #define CONFIG_L2_CACHE                        /* toggle L2 cache */
 #define CONFIG_BTB                     /* enable branch predition */
 
-#define CONFIG_SYS_MEMTEST_START       0x01000000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x01ffffff
-
 /* DDR Setup */
 #define CONFIG_SYS_SPD_BUS_NUM         0
 #define SPD_EEPROM_ADDRESS1            0x54 /* I2C access */
index d21537c7735fd9f964490c96b0515aecef6779a8..62ad50bad5442774f7523397d5a2136bf855ad68 100644 (file)
 #define CONFIG_ADDR_MAP                        1
 #define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /* DDR Setup */
 #define CONFIG_DDR_SPD
 #define CONFIG_SYS_SPD_BUS_NUM         0
index d1cb003ff533c9828a2cd7f2568f372890081689..fc389b8e87f76ad39521ced2d8b58ec261b4bb00 100644 (file)
 #define CONFIG_SYS_SDRAM_EMOD          0x80010000
 #define CONFIG_SYS_SDRAM_MODE          0x00CD0000
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #define CONFIG_SYS_MONITOR_BASE                (CONFIG_SYS_FLASH_BASE + 0x400)
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor */
 
index 884ed11dbab9880bf8870d26fcf7dbd8a090ec0f..f110cac2741d93dd67726b77dfd8869bf4ac3156 100644 (file)
 #define CONFIG_SYS_SDRAM_MODE          0x00CD0000
 #define CONFIG_SYS_SDRAM_DRV_STRENGTH  0x00
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #ifdef CONFIG_CF_SBF
 #      define CONFIG_SYS_MONITOR_BASE  (CONFIG_SYS_TEXT_BASE + 0x400)
 #else
index 2a905252560d928ede04d975c695f90829387e2d..4ab3d4831c7651b4097875059a7048ac93753cae 100644 (file)
 #define CONFIG_SYS_SDRAM_BASE          0x00000000
 #define CONFIG_SYS_SDRAM_SIZE          16      /* SDRAM size in MB */
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_FLASH_BASE + 0x400)
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor */
 
index 97c09f94c7b7015bdb60cab1b7bd5fcb5445892b..065e1e928189fac46fa69a497541a766e1ff0b0f 100644 (file)
@@ -39,9 +39,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x200000        /* default load address */
 
-#define CONFIG_SYS_MEMTEST_START       0x400
-#define CONFIG_SYS_MEMTEST_END         0x380000
-
 /*
  * Clock configuration: enable only one of the following options
  */
index 9fc0f5f4d19bc31c12c1d16869da318273822d87..e79a7e98dc2597fd364371361eec2181a82d6dd8 100644 (file)
@@ -84,9 +84,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x00100000
 
-#define CONFIG_SYS_MEMTEST_START       0x400
-#define CONFIG_SYS_MEMTEST_END         0x380000
-
 #undef CONFIG_SYS_PLL_BYPASS           /* bypass PLL for test purpose */
 #define CONFIG_SYS_FAST_CLK
 #ifdef CONFIG_SYS_FAST_CLK
index 4f5e6092554dd4d34d80eb59c7fbb61634fe84d5..5056629043823b98a8843b85c7b92be0ecb8bd54 100644 (file)
@@ -79,8 +79,6 @@
        ""
 
 #define CONFIG_SYS_LOAD_ADDR           0x20000
-#define CONFIG_SYS_MEMTEST_START       0x400
-#define CONFIG_SYS_MEMTEST_END         0x380000
 #define CONFIG_SYS_CLK                 66000000
 
 /*
index 3efed0fb37b04637cfec3666f6cbcd79bc7417fd..ed93f4ad78a54bc21a7ba9fd4288b41bd582ccdd 100644 (file)
@@ -72,8 +72,6 @@
 #define CONFIG_SYS_LOAD_ADDR           0x800000
 
 #define CONFIG_BOOTCOMMAND     "bootm ffe40000"
-#define CONFIG_SYS_MEMTEST_START       0x400
-#define CONFIG_SYS_MEMTEST_END         0x380000
 
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_NET_RETRY_COUNT   5
index 62b3d3183d0e1ea44a7d3dee48a3de38ba9405bb..e7859f334ad8d0892294a8f23dac9d16479751fd 100644 (file)
@@ -77,9 +77,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x20000
 
-#define CONFIG_SYS_MEMTEST_START       0x400
-#define CONFIG_SYS_MEMTEST_END         0x380000
-
 #define        CONFIG_SYS_CLK                  64000000
 
 /* PLL Configuration: Ext Clock * 6 (see table 9-4 of MCF user manual) */
index 9ae38ff3cf02c75fb199c8da3595b76056597dfa..b934dc1388979d0ec07f0a60244f90a05d31a06c 100644 (file)
 #define CONFIG_SYS_SDRAM_EMOD          0x80010000
 #define CONFIG_SYS_SDRAM_MODE          0x00CD0000
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #define CONFIG_SYS_MONITOR_BASE                (CONFIG_SYS_FLASH_BASE + 0x400)
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor */
 
index d0ddd089af8030c93ba90e40fefd6f67a6b5b7e1..5c88f09f64fbfbf70fe23f6e7fd722cc7176a7d8 100644 (file)
 #define CONFIG_SYS_SDRAM_EMOD          0x40010000
 #define CONFIG_SYS_SDRAM_MODE          0x018D0000
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_FLASH_BASE + 0x400)
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor */
 
index fe0f5b84fd2742e0a33a4b5cca7e66c453088eaf..6297aea143d2041d6a3f13ccd7aa9714d6be4203 100644 (file)
 #define CONFIG_SYS_SDRAM_EMOD          0x40010000
 #define CONFIG_SYS_SDRAM_MODE          0x018D0000
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_FLASH_BASE + 0x400)
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor */
 
index 62e34538606acd5856ce64039352be6066771b28..cdf169f6a79a73d66a461588a183f30a3c0869ba 100644 (file)
 #define CONFIG_SYS_SDRAM_BASE          0x40000000
 #define CONFIG_SYS_SDRAM_SIZE          128     /* SDRAM size in MB */
 
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE + 0x400)
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
 #define CONFIG_SYS_DRAM_TEST
 
 #if defined(CONFIG_CF_SBF) || defined(CONFIG_SYS_NAND_BOOT)
index 7b48c662be6a8e2b328843aab8882f8d60f52c40..8d0b1db73e5b4715ce4557971c27dfcb6a95b6f4 100644 (file)
 #define CONFIG_SYS_SDRAM_MODE          0x008D0000
 #define CONFIG_SYS_SDRAM_DRV_STRENGTH  0x44
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #ifdef CONFIG_CF_SBF
 #      define CONFIG_SERIAL_BOOT
 #      define CONFIG_SYS_MONITOR_BASE  (CONFIG_SYS_TEXT_BASE + 0x400)
index 34653f7a464b31f568f249cdea5d1aab10a50229..6e43522fda314046d3209378506b395ef91d0502 100644 (file)
 #define CONFIG_SYS_SDRAM_MODE          0x00010033
 #define CONFIG_SYS_SDRAM_DRV_STRENGTH  0xAA
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #ifdef CONFIG_CF_SBF
 #      define CONFIG_SERIAL_BOOT
 #      define CONFIG_SYS_MONITOR_BASE  (CONFIG_SYS_TEXT_BASE + 0x400)
index f5c007127ef5a666890c71a3bd000f7184d6c859..406830c98d56da4dc501e59805b939ebe4d247f3 100644 (file)
 #      define CONFIG_SYS_SDRAM_SIZE    CONFIG_SYS_DRAMSZ
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_FLASH_BASE + 0x400)
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor */
 
index ccc88ac316d4df77d702dfa46235907b5c5126d7..cd8dd67043f0ca9fe26f3067604ad5096f716138 100644 (file)
 #      define CONFIG_SYS_SDRAM_SIZE    CONFIG_SYS_DRAMSZ
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE + 0x400
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
-
 #define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_FLASH_BASE + 0x400)
 #define CONFIG_SYS_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor */
 
index 72533bc807234d182e767f87adcbd4322bd71fff..557c2ebcdb4835b1f4cc957d428c1698a474cf56 100644 (file)
@@ -60,9 +60,6 @@
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x00002000
-#define CONFIG_SYS_MEMTEST_END         0x00800000
-
 #define        CONFIG_SYS_LOAD_ADDR            0x200000
 
 #define        CONFIG_SYS_HZ                   1000
index 29561c41016cbb65c7d3cb157aa72e10cc46defa..f55e9a09950919da8aeb668f6437124dc0699e05 100644 (file)
 /*
  * Memory test
  */
-#define CONFIG_SYS_MEMTEST_START       0x00001000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x07f00000
 
 /*
  * The reserved memory
index ea5762a5ef8dea2d8f67e38aa0bfe6123b366f1c..68298533430c8b51f3ba49b68b530fd472ac912f 100644 (file)
@@ -57,9 +57,6 @@
 #define CONFIG_DEFAULT_IMMR    CONFIG_SYS_IMMR
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00001000
-#define CONFIG_SYS_MEMTEST_END         0x07f00000
-
 /* Early revs of this board will lock up hard when attempting
  * to access the PMC registers, unless a JTAG debugger is
  * connected, or some resistor modifications are made.
index 9d4a6716c76f5db173d98ff0860c40aaa818f38f..382c39ccb4cd8b1f699f620712a04cca9ce0f153 100644 (file)
@@ -29,9 +29,6 @@
 #define CONFIG_VSC7385_ENET
 #define CONFIG_TSEC2
 
-#define CONFIG_SYS_MEMTEST_START       0x00001000
-#define CONFIG_SYS_MEMTEST_END         0x07f00000
-
 /* Early revs of this board will lock up hard when attempting
  * to access the PMC registers, unless a JTAG debugger is
  * connected, or some resistor modifications are made.
index 5085a95635e19b1b0de3e3f56e754b0ed7d50d98..2c35223868287f992f5a702ede398b4eb2f2c5d3 100644 (file)
@@ -98,8 +98,6 @@
  * Memory test
  */
 #undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00040000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00140000
 
 /*
  * The reserved memory
index d39ba8f5d95c2159fb77afc64d0997ee6aa83ff9..289cd9a8600ab65e949543b0525391a1e2570222 100644 (file)
@@ -85,8 +85,6 @@
  * Memory test
  */
 #undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00030000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x03f00000
 
 /*
  * The reserved memory
index f410763a7ec8480acf1a3795b21ae2766d6553da..bfcff2e4f885d9093d420660c7aaac7b0ef3c626 100644 (file)
@@ -85,8 +85,6 @@
  * Memory test
  */
 #undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00100000
 
 /*
  * The reserved memory
index 295cb169903d20213868dee70317ce36abb58291..0a80a60d30112fa66c7aa5120b417b86fc1e6320 100644 (file)
@@ -18,8 +18,6 @@
 #define CONFIG_E300            1       /* E300 Family */
 
 #undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00100000
 
 /*
  * DDR Setup
index 79f2e38e952b3d8ad16360544223591abd539ce6..79dd95617414cadeb785b909fdd926a515ffd0c2 100644 (file)
@@ -18,8 +18,6 @@
 #define CONFIG_E300            1       /* E300 Family */
 
 #undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00100000
 
 /*
  * DDR Setup
index d0ae923ec3e7bf5d2f96956141cda2020d979e7d..90046fd1ee3bb1dabc4524775c4812b919394536 100644 (file)
  */
 #define CONFIG_SYS_SDRAM_BASE          0x00000000 /* DDR is system memory*/
 #define CONFIG_SYS_83XX_DDR_USES_CS0
-#define CONFIG_SYS_MEMTEST_START       0x1000  /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x2000
 
 #define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  (DDR_SDRAM_CLK_CNTL_SS_EN \
                                        | DDR_SDRAM_CLK_CNTL_CLK_ADJUST_075)
index e5b411b12cb6347dcc6c88db875c5ec48d73ec4b..1254b4fc10e7bfcc2686636f1a14df16ec0eb149 100644 (file)
  * Memory test
  */
 #undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00040000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00140000
 
 /*
  * The reserved memory
index 2ceb123a0788674ca76264b495b5508131fc1e9f..21bd9f09c17f90fc6cfc9733d8d3c0f843b32c58 100644 (file)
  * Memory test
  */
 #undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00040000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x0ef70010
 
 /*
  * The reserved memory
index 8fc8dfd2b2f104da8edbe4167539f839595a9336..fb115e23457865f17d1a58b421c3d9f57bf5a8be 100644 (file)
@@ -58,9 +58,6 @@
 #define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
 #endif
 
-#define CONFIG_SYS_MEMTEST_START 0x00010000    /* skip exception vectors */
-#define CONFIG_SYS_MEMTEST_END   0x1f000000    /* skip u-boot at top of RAM */
-
 /*
  * Config the L2 Cache as L2 SRAM
  */
index a5483dabaf826119586277773e6e58394aa09d4d..2ba73220211ae2c3145f7ef5acd95f8607d44b47 100644 (file)
@@ -58,9 +58,6 @@
 #define CONFIG_L2_CACHE                        /* toggle L2 cache */
 #define CONFIG_BTB                     /* toggle branch predition */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 #define CONFIG_SYS_CCSRBAR             0xe0000000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
index f81f4b0e646813b84f7ab1ff6a5c7412730a8e6a..b2a320107203b363fd87e81b5bc2a4755b7c6b78 100644 (file)
@@ -32,9 +32,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_L2_CACHE                            /* toggle L2 cache  */
 #define CONFIG_BTB                         /* toggle branch predition */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 #define CONFIG_SYS_CCSRBAR             0xe0000000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
index 4eb2888caeae8495908228fb877f0423e89e8e7a..2092e3da15927d404682d8db2d2d1400c5fabd67 100644 (file)
@@ -37,9 +37,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
  */
 #define CONFIG_ENABLE_36BIT_PHYS       1
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 #define CONFIG_SYS_CCSRBAR             0xe0000000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
index a68d190f6ab5ae8a06a04bbe646260a50c231048..6e44a072db88a1c4747e48c94daf0166e7989a1a 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2004, 2007, 2010-2011 Freescale Semiconductor.
+ * Copyright 2020 NXP
  */
 
 /*
@@ -46,9 +47,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 #define CONFIG_SYS_CCSRBAR             0xe0000000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
@@ -304,12 +302,18 @@ extern unsigned long get_clock_freq(void);
 /*
  * I2C
  */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SPEED       400000
 #define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
 #define CONFIG_SYS_I2C_NOPROBES                { {0, 0x69} }
+#else
+#define CONFIG_SYS_SPD_BUS_NUM 0
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
+#define CONFIG_SYS_I2C_FSL
 
 /* EEPROM */
 #define CONFIG_ID_EEPROM
index d53e156f3089386c9ca80b5352770b2feaf98c1c..d964b4e121733be299ab6d34899621f7a71c0638 100644 (file)
@@ -32,9 +32,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_L2_CACHE                            /* toggle L2 cache  */
 #define CONFIG_BTB                         /* toggle branch predition */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 #define CONFIG_SYS_CCSRBAR             0xe0000000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
index e61c9786c0b85161a419c123497851d4c50fdae2..866049febf2c533514eae01254b7707731063f51 100644 (file)
@@ -57,9 +57,6 @@
 
 #define CONFIG_SYS_INIT_DBCR DBCR_IDM          /* Enable Debug Exceptions */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 #define CONFIG_SYS_CCSRBAR             0xe0000000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
index 3a078a363c36305ca9870ed8d69118d6c8cc5855..a0bd5f4d40f6e0bd6f47621d5658d936aceae5e8 100644 (file)
@@ -35,9 +35,6 @@ extern unsigned long get_clock_freq(void);
  */
 #define CONFIG_ENABLE_36BIT_PHYS       1
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 #define CONFIG_SYS_CCSRBAR             0xe0000000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
index da86f94e544f066a929e4630c2b9ea0bf5502630..beba848214e74521bd4daa09bdcb56a701277a94 100644 (file)
@@ -47,9 +47,6 @@ extern unsigned long get_clock_freq(void);
 
 #define CONFIG_HWCONFIG
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /*
  * Config the L2 Cache as L2 SRAM
  */
index 0f4c7e6f4885c69ed83623b862f766465e8db8cd..65da3d7009b47283409f8fb9247ce31e309a0bde 100644 (file)
@@ -48,9 +48,6 @@
 #define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x7fffffff
-
 /*
  * Config the L2 Cache as L2 SRAM
  */
index 8b10a6cfef94362a1fc0cfc3f078639098dd35f1..f3d603c634849d44e4318c2b8c5f997d7c56695b 100644 (file)
@@ -56,9 +56,6 @@
 #define CONFIG_SYS_CLK_FREQ    get_board_sys_clk(0)
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /*
  * Base addresses -- Note these are effective addresses where the
  * actual resources get mapped (not physical addresses)
index db05a6cb077a61eb74f8b240c2013214e08b1e64..e97d780cea097aa85e6a80ad0a5d3f3c77fb3173 100644 (file)
@@ -63,9 +63,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_CLK_FREQ    get_board_sys_clk(0)
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /*
  * With the exception of PCI Memory and Rapid IO, most devices will simply
  * add CONFIG_SYS_PHYS_ADDR_HIGH to the front of the 32-bit VA to get the PA
index c58b7814ba942aee1054a48d9b8f2a3925442aaa..b6f315a47b99239a715fe2296c9f24b87aa44b29 100644 (file)
 /* SCIF */
 #define CONFIG_CONS_SCIF0      1
 
-#define CONFIG_SYS_MEMTEST_START       (MIGO_R_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + (60 * 1024 * 1024))
-
 /* Enable alternate, more extensive, memory test */
 /* Scratch address used by the alternate memory test */
-#undef  CONFIG_SYS_MEMTEST_SCRATCH
 
 /* Enable temporary baudrate change while serial download */
 #undef  CONFIG_SYS_LOADS_BAUD_CHANGE
index 60e8904d429477dffb612c4d91cb2bfef30f2d14..f578e0bd8752ae459af77e6e8a993b0b714856f4 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 /*
 #if defined(CONFIG_PCI)
 #define CONFIG_PCIE1                   /* PCIE controller 1 (slot 1) */
 #define CONFIG_PCIE2                   /* PCIE controller 2 (slot 2) */
-#define CONFIG_FSL_PCI_INIT            /* Use common FSL init code */
-#define CONFIG_PCI_INDIRECT_BRIDGE     /* indirect PCI bridge support */
 #define CONFIG_SYS_PCI_64BIT           /* enable 64-bit PCI resources */
 
 /*
  * Memory space is mapped 1-1, but I/O space must start from 0.
  */
 /* controller 1, Slot 1, tgtid 1, Base address a000 */
-#define CONFIG_SYS_PCIE1_NAME          "mini PCIe Slot"
 #define CONFIG_SYS_PCIE1_MEM_VIRT      0x80000000
 #ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE1_MEM_BUS       0x80000000
 #define CONFIG_SYS_PCIE1_MEM_PHYS      0xc00000000ull
 #else
-#define CONFIG_SYS_PCIE1_MEM_BUS       0x80000000
 #define CONFIG_SYS_PCIE1_MEM_PHYS      0x80000000
 #endif
-#define CONFIG_SYS_PCIE1_MEM_SIZE      0x20000000      /* 512M */
 #define CONFIG_SYS_PCIE1_IO_VIRT       0xffc00000
-#define CONFIG_SYS_PCIE1_IO_BUS                0x00000000
-#define CONFIG_SYS_PCIE1_IO_SIZE       0x00010000      /* 64k */
 #ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_PCIE1_IO_PHYS       0xfffc00000ull
 #else
 #endif
 
 /* controller 2, Slot 2, tgtid 2, Base address 9000 */
+#define CONFIG_SYS_PCIE2_MEM_VIRT      0xa0000000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_PCIE2_MEM_PHYS      0xc20000000ull
+#else
+#define CONFIG_SYS_PCIE2_MEM_PHYS      0xa0000000
+#endif
+#define CONFIG_SYS_PCIE2_IO_VIRT       0xffc10000
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_PCIE2_IO_PHYS       0xfffc10000ull
+#else
+#define CONFIG_SYS_PCIE2_IO_PHYS       0xffc10000
+#endif
+
+#if !defined(CONFIG_DM_PCI)
+#define CONFIG_FSL_PCI_INIT            /* Use common FSL init code */
+#define CONFIG_PCI_INDIRECT_BRIDGE     /* indirect PCI bridge support */
+#define CONFIG_SYS_PCIE1_NAME          "mini PCIe Slot"
+#ifdef CONFIG_PHYS_64BIT
+#define CONFIG_SYS_PCIE1_MEM_BUS       0x80000000
+#else
+#define CONFIG_SYS_PCIE1_MEM_BUS       0x80000000
+#endif
+#define CONFIG_SYS_PCIE1_MEM_SIZE      0x20000000      /* 512M */
+#define CONFIG_SYS_PCIE1_IO_BUS                0x00000000
+#define CONFIG_SYS_PCIE1_IO_SIZE       0x00010000      /* 64k */
+
 #if defined(CONFIG_TARGET_P1010RDB_PA)
 #define CONFIG_SYS_PCIE2_NAME          "PCIe Slot"
 #elif defined(CONFIG_TARGET_P1010RDB_PB)
 #define CONFIG_SYS_PCIE2_NAME          "mini PCIe Slot"
 #endif
-#define CONFIG_SYS_PCIE2_MEM_VIRT      0xa0000000
 #ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_PCIE2_MEM_BUS       0xc0000000
-#define CONFIG_SYS_PCIE2_MEM_PHYS      0xc20000000ull
 #else
 #define CONFIG_SYS_PCIE2_MEM_BUS       0xa0000000
-#define CONFIG_SYS_PCIE2_MEM_PHYS      0xa0000000
 #endif
 #define CONFIG_SYS_PCIE2_MEM_SIZE      0x20000000      /* 512M */
-#define CONFIG_SYS_PCIE2_IO_VIRT       0xffc10000
 #define CONFIG_SYS_PCIE2_IO_BUS                0x00000000
 #define CONFIG_SYS_PCIE2_IO_SIZE       0x00010000      /* 64k */
-#ifdef CONFIG_PHYS_64BIT
-#define CONFIG_SYS_PCIE2_IO_PHYS       0xfffc10000ull
-#else
-#define CONFIG_SYS_PCIE2_IO_PHYS       0xffc10000
 #endif
 
 #define CONFIG_PCI_SCAN_SHOW           /* show pci devices on startup */
 #define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x1fffffff
-
 /* DDR Setup */
 #define CONFIG_SYS_DDR_RAW_TIMING
 #define CONFIG_DDR_SPD
@@ -522,17 +530,22 @@ extern unsigned long get_sdram_size(void);
 #define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_CCSRBAR+0x4600)
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SPEED       400000
 #define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
 #define CONFIG_SYS_FSL_I2C2_SPEED      400000
 #define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
 #define I2C_PCA9557_ADDR1              0x18
 #define I2C_PCA9557_ADDR2              0x19
 #define I2C_PCA9557_BUS_NUM            0
+#define CONFIG_SYS_I2C_FSL
 
 /* I2C EEPROM */
 #if defined(CONFIG_TARGET_P1010RDB_PB)
index 5cc2e0697972f4fa2ec586c8dd47a600ce17ba7b..e99d509a36b214e706455cde6f0e62cb5e5ad66c 100644 (file)
 #define CONFIG_L2_CACHE
 #define CONFIG_BTB
 
-#define CONFIG_SYS_MEMTEST_START       0x00000000
-#define CONFIG_SYS_MEMTEST_END         0x7fffffff
-
 #define CONFIG_SYS_CCSRBAR             0xffe00000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
 #endif
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SPEED       400000
 #define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
 #define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 #define CONFIG_SYS_I2C_NOPROBES                {{0, 0x29}}
+#endif
+#define CONFIG_SYS_I2C_FSL
 
 /*
  * I2C2 EEPROM
index 8ed351c5dc77b348b0b2811156c741137afbcf77..2f3831e2599281a7bbe0d20dd618fce2bdfe6c00 100644 (file)
@@ -42,9 +42,6 @@ extern unsigned long get_clock_freq(void);
 
 #define CONFIG_ENABLE_36BIT_PHYS
 
-#define CONFIG_SYS_MEMTEST_START       0x01000000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x02000000
-
 /* Implement conversion of addresses in the LBC */
 #define CONFIG_SYS_LBC_LBCR            0x00000000
 #define CONFIG_SYS_LBC_LCRR            LCRR_CLKDIV_8
index 0dcba7deeae428f5b5209d711a1ec1477f538612..09427776e28157f8686342da257edaa075eb4de9 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2011-2012 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 /*
@@ -74,8 +75,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #endif
 
 #define CONFIG_POST CONFIG_SYS_POST_MEMORY     /* test POST memory test */
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
 
 /*
  *  Config the L3 Cache as L3 SRAM
@@ -267,14 +266,20 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_NS16550_COM4        (CONFIG_SYS_CCSRBAR+0x11D600)
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SPEED       400000
 #define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET      0x118000
 #define CONFIG_SYS_FSL_I2C2_SPEED      400000
 #define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x118100
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
+#define CONFIG_SYS_I2C_FSL
+
 
 /*
  * RapidIO
index b17113ab9a8202f22828a786b41c4d8e24fdcd6f..8f31fc4c745669ee428ace1c66d7635d6654a13b 100644 (file)
@@ -80,8 +80,6 @@
 /*
  * Other required minimal configurations
  */
-#define CONFIG_SYS_MEMTEST_START 0x00400000    /* 4M */
-#define CONFIG_SYS_MEMTEST_END 0x007fffff      /*(_8M -1) */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000    /* Rst Vector Adr */
 
 /*
index 462e62c7c20442e328a45fc1395b83d6d263f49c..f4440e57646617ca2243c0d4f805eb2773190d0f 100644 (file)
@@ -80,8 +80,6 @@
 /*
  * Other required minimal configurations
  */
-#define CONFIG_SYS_MEMTEST_START 0x00400000    /* 4M */
-#define CONFIG_SYS_MEMTEST_END 0x007fffff      /*(_8M -1) */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000    /* Rst Vector Adr */
 
 /*
index 20c0534f5a3e23d6f3d2db2577cf17decc977b97..5f358c13eae695547dd662026df253e93886a60e 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 /*
@@ -147,9 +148,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_MEM_INIT_VALUE          0xdeadbeef
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /*
  *  Config the L3 Cache as L3 SRAM
  */
@@ -437,14 +435,20 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL             /* Use FSL common I2C driver */
 #define CONFIG_SYS_FSL_I2C_SPEED       50000   /* I2C speed in Hz */
 #define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
 #define CONFIG_SYS_FSL_I2C2_SPEED      50000   /* I2C speed in Hz */
 #define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET      0x118000
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x118100
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
+
+#define CONFIG_SYS_I2C_FSL             /* Use FSL common I2C driver */
 
 #define I2C_MUX_PCA_ADDR               0x77
 #define I2C_MUX_PCA_ADDR_PRI           0x77 /* Primary Mux*/
@@ -460,6 +464,7 @@ unsigned long get_board_ddr_clk(void);
 /* LDI/DVI Encoder for display */
 #define CONFIG_SYS_I2C_LDI_ADDR         0x38
 #define CONFIG_SYS_I2C_DVI_ADDR         0x75
+#define CONFIG_SYS_I2C_DVI_BUS_NUM 0
 
 /*
  * RTC configuration
index 094795cc6d5979adfa4c203240581686357218e6..c96d6e5f35e07b1986090e648ba8418668901be3 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 /*
@@ -162,9 +163,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_MEM_INIT_VALUE          0xdeadbeef
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /*
  *  Config the L3 Cache as L3 SRAM
  */
@@ -434,15 +432,20 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL             /* Use FSL common I2C driver */
 #define CONFIG_SYS_FSL_I2C_SPEED       50000   /* I2C speed in Hz */
 #define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
 #define CONFIG_SYS_FSL_I2C2_SPEED      50000   /* I2C speed in Hz */
 #define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET      0x118000
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x118100
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
 
+#define CONFIG_SYS_I2C_FSL             /* Use FSL common I2C driver */
 #define I2C_PCA6408_BUS_NUM            1
 #define I2C_PCA6408_ADDR               0x20
 
index cda8251036e029e8d85ba8c6ed469220153ebaa6..ca6ae776fa41659fb7d1c1342324f8e390f06b08 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright 2013-2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -90,9 +91,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_ADDR_MAP
 #define CONFIG_SYS_NUM_ADDR_MAP                64      /* number of TLB1 entries */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /*
  *  Config the L3 Cache as L3 SRAM
  */
@@ -360,6 +358,8 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /* I2C */
+
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_FSL             /* Use FSL common I2C driver */
 #define CONFIG_SYS_FSL_I2C_SPEED       50000   /* I2C speed in Hz */
@@ -374,6 +374,9 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x118100
 #define CONFIG_SYS_FSL_I2C3_OFFSET     0x119000
 #define CONFIG_SYS_FSL_I2C4_OFFSET     0x119100
+#endif
+
+#define CONFIG_SYS_I2C_FSL             /* Use FSL common I2C driver */
 
 #define I2C_MUX_PCA_ADDR               0x77
 #define I2C_MUX_PCA_ADDR_PRI           0x77 /* Primary Mux*/
@@ -385,6 +388,7 @@ unsigned long get_board_ddr_clk(void);
 /* LDI/DVI Encoder for display */
 #define CONFIG_SYS_I2C_LDI_ADDR         0x38
 #define CONFIG_SYS_I2C_DVI_ADDR         0x75
+#define CONFIG_SYS_I2C_DVI_BUS_NUM     0
 
 /*
  * RTC configuration
index bc651186578078704dc9dadcf33246cde39d09bb..aa7bf7d1193c50734f0b0598371dc8319dacffe6 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 #ifndef __CONFIG_H
@@ -27,6 +28,7 @@
 #define CONFIG_SPL_SKIP_RELOCATE
 #define CONFIG_SPL_COMMON_INIT_DDR
 #define CONFIG_SYS_CCSR_DO_NOT_RELOCATE
+#undef CONFIG_DM_I2C
 #endif
 #define RESET_VECTOR_OFFSET            0x27FFC
 #define BOOT_PAGE_OFFSET               0x27000
@@ -185,9 +187,6 @@ $(SRCTREE)/board/freescale/t104xrdb/t1042d4_sd_rcw.cfg
 #define CONFIG_ADDR_MAP
 #define CONFIG_SYS_NUM_ADDR_MAP                64      /* number of TLB1 entries */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /*
  *  Config the L3 Cache as L3 SRAM
  */
@@ -459,8 +458,8 @@ $(SRCTREE)/board/freescale/t104xrdb/t1042d4_sd_rcw.cfg
 #endif
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL             /* Use FSL common I2C driver */
 #define CONFIG_SYS_FSL_I2C_SPEED       400000  /* I2C speed in Hz */
 #define CONFIG_SYS_FSL_I2C2_SPEED      400000
 #define CONFIG_SYS_FSL_I2C3_SPEED      400000
@@ -473,7 +472,12 @@ $(SRCTREE)/board/freescale/t104xrdb/t1042d4_sd_rcw.cfg
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x118100
 #define CONFIG_SYS_FSL_I2C3_OFFSET     0x119000
 #define CONFIG_SYS_FSL_I2C4_OFFSET     0x119100
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
 
+#define CONFIG_SYS_I2C_FSL             /* Use FSL common I2C driver */
 /* I2C bus multiplexer */
 #define I2C_MUX_PCA_ADDR                0x70
 #define I2C_MUX_CH_DEFAULT      0x8
@@ -484,6 +488,7 @@ $(SRCTREE)/board/freescale/t104xrdb/t1042d4_sd_rcw.cfg
 /* LDI/DVI Encoder for display */
 #define CONFIG_SYS_I2C_LDI_ADDR                0x38
 #define CONFIG_SYS_I2C_DVI_ADDR                0x75
+#define CONFIG_SYS_I2C_DVI_BUS_NUM     0
 
 /*
  * RTC configuration
index 96801e5f099d8ccc685b73fc6308a11d246257a7..aed2e87a1a1186d9279320e917cea3baa88be8e5 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2011-2013 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 /*
@@ -385,8 +386,8 @@ unsigned long get_board_ddr_clk(void);
 /*
  * I2C
  */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SLAVE   0x7F
 #define CONFIG_SYS_FSL_I2C2_SLAVE  0x7F
 #define CONFIG_SYS_FSL_I2C3_SLAVE  0x7F
@@ -399,6 +400,10 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_FSL_I2C2_SPEED  100000
 #define CONFIG_SYS_FSL_I2C3_SPEED  100000
 #define CONFIG_SYS_FSL_I2C4_SPEED  100000
+#endif
+
+#define CONFIG_SYS_I2C_FSL
+
 #define I2C_MUX_PCA_ADDR_PRI   0x77 /* I2C bus multiplexer,primary */
 #define I2C_MUX_PCA_ADDR_SEC1  0x75 /* I2C bus multiplexer,secondary 1 */
 #define I2C_MUX_PCA_ADDR_SEC2  0x76 /* I2C bus multiplexer,secondary 2 */
index a90ea11a2f8587023ea5a09b68c9ac08bf891009..619b287258f7185a38dcad2db01b3da38106a424 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 /*
 #define CONFIG_MEM_INIT_VALUE          0xdeadbeef
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 #if defined(CONFIG_SPIFLASH)
 #elif defined(CONFIG_SDCARD)
 #define CONFIG_SYS_MMC_ENV_DEV 0
@@ -333,8 +331,8 @@ unsigned long get_board_ddr_clk(void);
 /*
  * I2C
  */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SLAVE   0x7F
 #define CONFIG_SYS_FSL_I2C2_SLAVE  0x7F
 #define CONFIG_SYS_FSL_I2C3_SLAVE  0x7F
@@ -347,6 +345,13 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_FSL_I2C2_SPEED  100000
 #define CONFIG_SYS_FSL_I2C3_SPEED  100000
 #define CONFIG_SYS_FSL_I2C4_SPEED  100000
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
+
+#define CONFIG_SYS_I2C_FSL
+
 #define I2C_MUX_PCA_ADDR_PRI   0x77 /* I2C bus multiplexer,primary */
 #define I2C_MUX_PCA_ADDR_SEC1  0x75 /* I2C bus multiplexer,secondary 1 */
 #define I2C_MUX_PCA_ADDR_SEC2  0x76 /* I2C bus multiplexer,secondary 2 */
index 91a7c70356edef88e1f23ee44ebaa14c9f8ee00d..5f91a52bbe9bf5021d30e210e8be4d2064665815 100644 (file)
@@ -280,6 +280,19 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
+#define CONFIG_SYS_I2C
+#else
+#undef CONFIG_SYS_I2C
+#undef CONFIG_SYS_FSL_I2C2_OFFSET
+#undef CONFIG_SYS_FSL_I2C2_SLAVE
+#undef CONFIG_SYS_FSL_I2C2_SPEED
+#undef CONFIG_SYS_FSL_I2C_SLAVE
+#undef CONFIG_SYS_FSL_I2C_SPEED
+#undef CONFIG_SYS_FSL_I2C_OFFSET
+#endif
+
+#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SPEED       100000  /* I2C speed */
 #define CONFIG_SYS_FSL_I2C2_SPEED      100000  /* I2C2 speed */
 #define I2C_MUX_PCA_ADDR_PRI           0x77 /* I2C bus multiplexer,primary */
index 31cb1cf34a84922a24bdca482dd3923e6b20783a..f051998b0fffb1a9d0d3d5e57eafa10f4e8d1b90 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 /*
@@ -80,9 +81,6 @@
 #define CONFIG_ADDR_MAP
 #define CONFIG_SYS_NUM_ADDR_MAP                64      /* number of TLB1 entries */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /*
  *  Config the L3 Cache as L3 SRAM
  */
 #define CONFIG_SYS_NS16550_COM4        (CONFIG_SYS_CCSRBAR+0x11D600)
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET      0x118000
 #define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x118100
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
+
+#define CONFIG_SYS_I2C_FSL
 
 /*
  * General PCI
index f557a3c93624d151cd7347f5e94bb42711257be6..40fe62fdf0b64b1d22041a0882cac51ffae03ef8 100644 (file)
@@ -30,8 +30,6 @@
 #undef CONFIG_SPD_EEPROM       /* do not use SPD EEPROM for DDR setup */
 
 #undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00100000
 
 /*
  * FLASH on the Local Bus
index 68276a15a748e4208f03a894b3617a7f12dac7fe..5086077afb5a67bc8e1b85a1d8a6f96fbd6f3dc6 100644 (file)
 
 #define CONFIG_ENABLE_36BIT_PHYS
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x1fffffff
-
 #define CONFIG_SYS_CCSRBAR             0xffe00000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
index 5b035c7ec5a3668c490141e6195ab3ac0bf30608..48dfe68ff9ebd49b933f2d17b2c4e393d634a961 100644 (file)
 #define CONFIG_SYS_LOAD_ADDR           0x300000
 
 /* memtest works on 63 MB in DRAM */
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM_0
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_0 + 0x03F00000)
 
 /*
  * Static memory controller configuration
index 71c7fe929d3d4df1787d36dec9c828d911dad62b..2c316a76e1ccb69c50cbaed423d7540d86a01bbc 100644 (file)
 #define CONFIG_SYS_LOAD_ADDR           0x300000
 
 /* memtest works on 63 MB in DRAM */
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM_0
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_0 + 0x03F00000)
 
 /*
  * Static memory controller configuration
index deb4374d1c4a939651f2ac7e54ad25e54c21302b..d44028d510c50ad6b1751d5bfbed7cd14e3aa4e1 100644 (file)
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index 6087a29ef4c4c235530e2cd33ba897d0de8c8291..5c00191f4d491406b987e2bc997ee2fc7ecb55c4 100644 (file)
 #define CONFIG_SYS_MAXARGS             32      /* max number of command */
                                                /* args */
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)
-#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
-                                       0x01F00000) /* 31MB */
 
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0) /* default load */
                                                                /* address */
index 89c82cee07eec4b83cc7d25203d4dfbe046ad117..cc5e8314c71bb11dfb4357bbffef99568e89ea27 100644 (file)
 #define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
 
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)
-#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
-                                       0x01F00000) /* 31MB */
 
 /* Physical Memory Map */
 #define CONFIG_SYS_CS0_SIZE            (256 * 1024 * 1024)
index bc1fc8c7b015df141f0f1fe0f1ba4042a32c9f3f..641d8fdbd53dbc8546ba1014796b7f094ab8b916 100644 (file)
@@ -32,9 +32,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x20000 /* default load address */
 
-#define CONFIG_SYS_MEMTEST_START       0x0
-#define CONFIG_SYS_MEMTEST_END         0x1000000
-
 #define CONFIG_SYS_HZ                  1000
 
 #define CONFIG_SYS_CLK                 45000000
index 07ba195a126c72ffd579d400f909255a4223c3cb..4902d07247e69c7af123f804418b9bb3df77e518 100644 (file)
@@ -35,7 +35,5 @@
 /*
  * Diagnostics
  */
-#define CONFIG_SYS_MEMTEST_START        0x80100000
-#define CONFIG_SYS_MEMTEST_END          0x83f00000
 
 #endif  /* __CONFIG_H */
index d6c22d54893aac6cbcdd7cb418fe95a8b06b52c6..c79e050dc9c5315096e834c67a6c86d9e508edbf 100644 (file)
@@ -39,7 +39,5 @@
 /*
  * Diagnostics
  */
-#define CONFIG_SYS_MEMTEST_START        0x80100000
-#define CONFIG_SYS_MEMTEST_END          0x83f00000
 
 #endif  /* __CONFIG_H */
index 73378b95f3f4a6c78dc1593b593ad540ee44dbad..0d2c484bb9c1539a0008d9c684ee5e15d2c62d2e 100644 (file)
@@ -41,7 +41,5 @@
 /*
  * Diagnostics
  */
-#define CONFIG_SYS_MEMTEST_START        0x80100000
-#define CONFIG_SYS_MEMTEST_END          0x83f00000
 
 #endif  /* __CONFIG_H */
index 4003715733958c6b1b97a256f7272a4ef7ebb818..08d34db1061ec8c1b82e8668c67a566dad6829d2 100644 (file)
@@ -83,9 +83,6 @@
 
 #define CONFIG_SYS_INIT_SP_ADDR                0x80200000
 
-#define CONFIG_SYS_MEMTEST_START       0x88000000
-#define CONFIG_SYS_MEMTEST_END         0x89000000
-
 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
 #define CONFIG_SYS_MMC_ENV_DEV         0       /* USDHC1 eMMC */
 #define CONFIG_SYS_MMC_ENV_PART                1
index fb0037444f4b3cff9fecfb2ce4360331dd0c3a43..034eb07eaa99c32cb98cec4b3701d5924c0597e9 100644 (file)
 #undef CONFIG_SYS_MAXARGS
 #define CONFIG_SYS_MAXARGS             48
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index 351b27094a61512a7786308b878c36a30274dd2b..c26cf89f5ff7f526174ff77b4fbf12d4267bd82a 100644 (file)
@@ -54,8 +54,6 @@
 #define PHYS_SDRAM_2                   0xB0000000
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (512<<10))
-#define CONFIG_SYS_MEMTEST_START       0xA0000000      /* memtest test area  */
-#define CONFIG_SYS_MEMTEST_END         0xA0300000      /* 3 MiB RAM test */
 
 #define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_SDRAM_BASE  \
                + PHYS_SDRAM_1_SIZE - 0x0100000)
index 5f4a4f854f9c740f5b8566f29d67a4eaea688bb6..2674cb8b76b79bc1682d401132e89fa84eafeb53 100644 (file)
 
 #define CONFIG_ARP_TIMEOUT             200UL
 
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x100000)
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
 
index e56929628bc78c3cfa4714a8d31637ccd6460b3b..f85cd981409e5c12664d692e110eba3a59345046 100644 (file)
 #define SCIF4_BASE             0xe6c80000
 #define        CONFIG_SCIF_A
 
-#define CONFIG_SYS_MEMTEST_START       (ARMADILLO_800EVA_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                        504 * 1024 * 1024)
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_SDRAM_BASE          (ARMADILLO_800EVA_SDRAM_BASE)
index e1128043b02a987d4d7e02d9eb5f2d5a84d34b04..7eec226173e2e0c9618df4ebf3f86ae0306dccfc 100644 (file)
 
 /* Defines memory range for test */
 
-#define CONFIG_SYS_MEMTEST_START       0x40020000
-#define CONFIG_SYS_MEMTEST_END         0x41ffffff
-
 /*
  * Low Level Configuration Settings
  * (address mappings, register initial values, etc.)
index e52f7e440bb96aaed5d7de8195db79f733f4ee63..37b9cc3b6fcd2989458b27db5dc1aeac0efe144f 100644 (file)
 #define CONFIG_SYS_SDRAM_BASE          0x20000000
 #define CONFIG_SYS_SDRAM_SIZE          SZ_32M
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         \
-               (CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - SZ_256K)
-
 /*
  * LowLevel Init
  */
index 3156118e9637b35b8b0a1e2a2f8efc70473832f8..e27c276a460c9fd37e917c40af9a264ac668bd9d 100644 (file)
 
 #define CONFIG_SYS_LOAD_ADDR                   0x22000000      /* load address */
 
-#define CONFIG_SYS_MEMTEST_START               CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END                 0x23e00000
-
 #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
index 39b879b3b1bcff4c2706335febf098d3415bb57e..c3fe41636bfc517cea6e5e0aa42b7bd980163934 100644 (file)
@@ -95,9 +95,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR                   0x22000000      /* load address */
 
-#define CONFIG_SYS_MEMTEST_START               CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END                 0x23e00000
-
 #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
index c08845b3c8d319a3b88af21c73c5e4f2a2172d3c..85bfacb7acc09c997071c1ff4248e62be692614e 100644 (file)
 
 #define CONFIG_SYS_LOAD_ADDR                   0x22000000      /* load address */
 
-#define CONFIG_SYS_MEMTEST_START               CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END                 0x23e00000
-
 #ifdef CONFIG_SYS_USE_DATAFLASH
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
index ee207cfcca2f5752b5bb8449c2b98500853fbc41..8e2a7631f41915acc574d83b16b6959c9cad8ddf 100644 (file)
@@ -69,9 +69,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x22000000      /* load address */
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         0x23e00000
-
 #ifdef CONFIG_NAND_BOOT
 /* bootstrap + u-boot + env in nandflash */
 
index caa487b038b80f3a45404a1c231303959de0d61a..7ee569521e648928e46fd0cf87c62aefa19a921e 100644 (file)
@@ -68,9 +68,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x22000000 /* load address */
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         0x26e00000
-
 /* USB host */
 #ifdef CONFIG_CMD_USB
 #define CONFIG_USB_ATMEL
index 1da26049fd9a90ed74a4028c772872031988be3d..92b87a2b492a485e06f1c758633afe6e461e598c 100644 (file)
@@ -66,9 +66,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR                   0x22000000      /* load address */
 
-#define CONFIG_SYS_MEMTEST_START               CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END                 0x23e00000
-
 #ifdef CONFIG_SYS_USE_DATAFLASH
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
index d85a4867648aca745b1fadf5abc0a5f525a06996..eb94a1907280ee876f948621dc3d323c40f88d4c 100644 (file)
@@ -67,9 +67,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x22000000      /* load address */
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         0x26e00000
-
 #ifdef CONFIG_NAND_BOOT
 /* bootstrap + u-boot + env + linux in nandflash */
 #define CONFIG_BOOTCOMMAND     "nand read " \
index 45049621710f05e14e27452e93d26da55b109db3..34fc6b616e7b4608df31dc04b4e991410b29a213 100644 (file)
@@ -91,8 +91,6 @@
 /*
  * memtest works on 512 MB in DRAM
  */
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM_0
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE)
 
 /*
  * FLASH and environment organization
index 0566892e157a425ed325d470e5ad79d554b877b4..f88172a05c55a4b4741c358ec7d7acc8ca9f889c 100644 (file)
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x80010000
-#define CONFIG_SYS_MEMTEST_END         0x87C00000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical memory map */
index 7ee38a7ef9bc787016ad6a6203aae8f9c0b8d460..fd29c5d0f1ed9792e085a2fbc7e51dc74a06f9e2 100644 (file)
@@ -22,7 +22,6 @@
 #define RCAR_GEN2_SDRAM_SIZE           (1024u * 1024 * 1024)
 #define RCAR_GEN2_UBOOT_SDRAM_SIZE     (512 * 1024 * 1024)
 
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 /* FLASH */
index e5dc0c8e328690f1cd361d3cfd38109613d44c14..b9a9965eec32f372a1454ab5dfdd47a59d335aa3 100644 (file)
@@ -35,9 +35,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x08000000)
 
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE + 0)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x10000000)
-
 #define CONFIG_SYS_MALLOC_LEN          (256 * 1024)
 
 /*
index 6c073ab383d2e3456b4cbe0de15b9f6334fe0baa..e95769b2d726928aca27dc77fb18fd97724d1b44 100644 (file)
@@ -90,8 +90,6 @@ BUR_COMMON_ENV \
 /* RAM */
 #define PHYS_SDRAM_1                   MMDC0_ARB_BASE_ADDR
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
 #define CONFIG_SYS_INIT_SP_OFFSET \
index 63a7581d68219f0d6a09001795da5b90df6fa221..459712190a0399439e8161532ba58771964d18f8 100644 (file)
@@ -26,8 +26,6 @@
 #undef CONFIG_MPC83XX_PCI2             /* support for 2nd PCI controller */
 
 #undef CONFIG_SYS_DRAM_TEST                    /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00100000
 
 /*
  * DDR Setup
index 254b3a5a760245c444aaf00aecde3c468b31edf2..2ad54f49072606717c76739161c5407c163719b0 100644 (file)
 #define PHYS_SDRAM_1_SIZE              0x40000000      /* 1 GB */
 #define PHYS_SDRAM_2_SIZE              0x00000000      /* 0 GB */
 
-#define CONFIG_SYS_MEMTEST_START       0xA0000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                        (PHYS_SDRAM_1_SIZE >> 2))
-
 /* Console buffer and boot args */
 #define CONFIG_SYS_CBSIZE              2048
 #define CONFIG_SYS_MAXARGS             64
index 797fcb14590a9e406db3dba02f8bca8d14459bd6..bd4456aa02e94f6c6ae3cc8091d31fa5ab356aaa 100644 (file)
                "fi; " \
        "else run netboot; fi"
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END        0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 /* Physical Memory Map */
 #define PHYS_SDRAM                    MMDC0_ARB_BASE_ADDR
 
index 0f9c2ac53a34563b43404a52351401e49bca4050..e6b4e233d62184472628b74784e5cce1a7066a2a 100644 (file)
@@ -25,8 +25,6 @@
 #define CONFIG_SYS_INIT_SP_OFFSET      0x400000
 #define CONFIG_SYS_LOAD_ADDR           0x81000000
 #define CONFIG_LOADADDR                        CONFIG_SYS_LOAD_ADDR
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x88000000
 
 #define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_TEXT_BASE
 
index d47bdd228d6a30b1b6a84323ddcce3ac035c8b0c..b923bae9b283db43132e5fa7b054d5ea5149a74b 100644 (file)
        "echo eMMC boot attempt ...; run emmcbootscript; run emmcboot; " \
        "echo USB boot attempt ...; run usbbootscript; "
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x20000000)
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
 
index e62130f8ec0e9d332ce6c91104f864986b16a645..302907dcfb4e23d8fe0876578396baffe6f196f9 100644 (file)
@@ -24,8 +24,6 @@
 #define PHYS_SDRAM_1                   MMDC0_ARB_BASE_ADDR
 #define PHYS_SDRAM_2                   MMDC1_ARB_BASE_ADDR
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
 #define CONFIG_SYS_INIT_SP_OFFSET \
index 5bd9a49f4d017ff75eba08336079717618094f1e..fffea0da183ed408f5e22ddb86594a00540b7492 100644 (file)
 #define CONFIG_TIMESTAMP
 #define CONFIG_SYS_AUTOLOAD            "no"
 
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)     /* memtest */
                                                                /* works on */
-#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
-                                       0x01F00000) /* 31MB */
 
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0)     /* default */
                                                        /* load address */
index a9f5e5e8a550f69b76d7439d749808bfe2855836..fe23c2396c9f9ce43b92ddba1b37f3931793628a 100644 (file)
@@ -155,9 +155,6 @@ from which user programs will be started */
  * ---
  */
 
-#define CONFIG_SYS_MEMTEST_START       0x400
-#define CONFIG_SYS_MEMTEST_END         0x380000
-
 /* ---
  * Low Level Configuration Settings
  * (address mappings, register initial values, etc.)
index 2a76f576a877ce6987a6f39c8bed858a69f61dfd..2d3b4c18177b070583c0048c14ef89e3ad836b0c 100644 (file)
        "videomode=video=ctfb:x:640,y:480,depth:18,pclk:39722,le:48,ri:16,up:33,lo:10,hs:96,vs:2,sync:0,vmode:0\0" \
        "vidargs=video=mxsfb:640x480M-16@60"
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x08000000)
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index 311ed439f61b93a2b4ea08306397a13d08a81db3..03bb1701f9d957c3822b6009562172f19d28224c 100644 (file)
 
 #define CONFIG_SYS_INIT_SP_ADDR                0x80200000
 
-#define CONFIG_SYS_MEMTEST_START       0x88000000
-#define CONFIG_SYS_MEMTEST_END         0x89000000
-
 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
 #define CONFIG_SYS_MMC_ENV_DEV         0       /* USDHC1 eMMC */
 #define CONFIG_SYS_MMC_ENV_PART                1
index 4cdd3c53afbb2d7b57890684dd8887f87472ed50..2d649e6e219f09599e33b55b84083e2992035e32 100644 (file)
 #undef CONFIG_SYS_MAXARGS
 #define CONFIG_SYS_MAXARGS             48
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index 7c00f78ef199b0ce163f6445920d710c0cce77d9..09722f47e782a2ee1be7d9ffaca2e592152390ef 100644 (file)
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x0c000000)
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
 
index 111bb27126aee206434d609b22f12e899423ecdb..29827f1ee84175a58ff0c3eaf6af54172a4b36bf 100644 (file)
@@ -86,9 +86,6 @@
 #define        CONFIG_SYS_DRAM_BASE            0xa0000000      /* CS0 */
 #define        CONFIG_SYS_DRAM_SIZE            0x04000000      /* 64 MB DRAM */
 
-#define CONFIG_SYS_MEMTEST_START       0xa0400000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0xa0800000      /* 4 ... 8 MB in DRAM */
-
 #define        CONFIG_SYS_LOAD_ADDR            PHYS_SDRAM_1
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM_1
 #define        CONFIG_SYS_INIT_SP_ADDR         0x5c010000
index b03ccaf094121643b5b321a66385dd02f3efdf5f..7d17bd8e6a0cb55e11af2c3ae7c912c2c42c8107 100644 (file)
 #define CONFIG_SYS_CBSIZE              1024    /* Console I/O Buffer Size */
 #define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
 
-#define CONFIG_SYS_MEMTEST_START       0x80010000
-#define CONFIG_SYS_MEMTEST_END         0x87C00000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
 
index d62c784e5b797de769d40434fa6be1647f59bfa4..5fbe77320189f19eb920df73da77e03141aaca8b 100644 (file)
 #define CONFIG_DIMM_SLOTS_PER_CTLR     1
 #define CONFIG_CHIP_SELECTS_PER_CTRL   (2 * CONFIG_DIMM_SLOTS_PER_CTLR)
 
-#define CONFIG_SYS_MEMTEST_START       0x00000000
-#define CONFIG_SYS_MEMTEST_END         0x3fffffff
-
 #ifdef CONFIG_TRAILBLAZER
 #define CONFIG_SPD_EEPROM
 #define SPD_EEPROM_ADDRESS 0x52
index b2c86ff722b207e7393ac063ec356054b2728d0a..091f3c07d1d2c940ca95d20f736226fcbd42b574 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2009-2012 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 /*
@@ -87,8 +88,6 @@
 #endif
 
 #define CONFIG_POST CONFIG_SYS_POST_MEMORY     /* test POST memory test */
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
 
 /*
  *  Config the L3 Cache as L3 SRAM
 #define CONFIG_SYS_NS16550_COM4        (CONFIG_SYS_CCSRBAR+0x11D600)
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SPEED       400000
 #define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET      0x118000
 #define CONFIG_SYS_FSL_I2C2_SPEED      400000
 #define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x118100
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
+#define CONFIG_SYS_I2C_FSL
 
 /*
  * RapidIO
index 49fee9249bf9e2c24f55f4f0cbba9a7c11b31dc7..9ab92e699dc49fbc3af8a8f4f35a8bc6b99715bc 100644 (file)
@@ -75,8 +75,6 @@
 
 /* test POST memory test */
 #undef CONFIG_POST
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
 
 /*
  *  Config the L3 Cache as L3 SRAM
index 5bd5cd85c84c5755dfed9a04b147434fdc8f00ba..4d651264dd2ef443e32e205a6d956314313f38c6 100644 (file)
 #define CONFIG_SPL_BSS_START_ADDR DAVINCI_DDR_EMIF_DATA_BASE
 #define CONFIG_SPL_BSS_MAX_SIZE 0x1080000
 /* memtest start addr */
-#define CONFIG_SYS_MEMTEST_START       (PHYS_SDRAM_1 + 0x2000000)
 
 /* memtest will be run on 16MB */
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_1 + 0x2000000 + 16*1024*1024)
 
 #define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (      \
        DAVINCI_SYSCFG_SUSPSRC_TIMER0 |         \
index 894a8d7973fc60871b283de0614c238c21b0195f..15d6884ca5d4df28a0753089dc48b9e23d2305c9 100644 (file)
@@ -62,8 +62,6 @@
 #endif
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x8000000)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index 749adb29075bde0a43ca7aea85a546617330035c..cc51e6646ee32e5ce11a48a4b3bd5e5ee10e924c 100644 (file)
@@ -69,8 +69,6 @@
 /*
  * Other required minimal configurations
  */
-#define CONFIG_SYS_MEMTEST_START 0x00400000    /* 4M */
-#define CONFIG_SYS_MEMTEST_END 0x007fffff      /* (_8M - 1) */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000    /* Rst Vector Adr */
 
 /*
index 4c0229e4cc8177dc554b8e9d53be24e25006d4cb..f1f2be0797bc21e0f9225caa3f6529372b52e1d3 100644 (file)
@@ -24,8 +24,6 @@
 #define CONFIG_SYS_MALLOC_LEN          SZ_1M
 #define CONFIG_SYS_SDRAM_BASE          EMC_DYCS0_BASE
 #define CONFIG_SYS_SDRAM_SIZE          SZ_64M
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE + SZ_32K)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_TEXT_BASE - SZ_1M)
 
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + SZ_32K)
 
index baf1a73b956c803845aaf355a030220625df804d..21af126c4bde5c3ee3ff195dd05e779209833fdf 100644 (file)
 #define CONFIG_BOOTCOMMAND "run autoboot"
 
 /* Boot Argument Buffer Size */
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0 + 0x07000000)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                       0x01000000) /* 16MB */
 
 /* SRAM config */
 #define CONFIG_SYS_SRAM_START              0x40200000
index 087d020cdd378fba032612b0ad02faadd4c85e5a..efb3cfee3529e40727a744b34371a89b4ddddee9 100644 (file)
 #define CONFIG_SYS_INIT_SP_ADDR \
        (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x20000000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 /* Environment */
 
 #endif /* __DH_IMX6_CONFIG_H */
index 61c321c13204b809acf0a2f77c1aec91c08c509e..d441f28d4afece709e9cd13d39189e907d15b2d9 100644 (file)
@@ -54,8 +54,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x20000
 
-#define CONFIG_SYS_MEMTEST_START       0x100000
-#define CONFIG_SYS_MEMTEST_END         0x400000
 /*#define CONFIG_SYS_DRAM_TEST         1 */
 #undef CONFIG_SYS_DRAM_TEST
 
index 3e174e9aa53504c32c2562cc32cf8b303e5bde16..3918a9fc1c371e93c176f78ca39e563ddce51fdf 100644 (file)
@@ -25,9 +25,6 @@
 
 #define CONFIG_SYS_MALLOC_LEN                  (128 * 1024 * 1024)
 
-#define CONFIG_SYS_MEMTEST_START               0x00100000
-#define CONFIG_SYS_MEMTEST_END                 0x01000000
-
 /* Environment */
 #define CONFIG_SYS_MMC_ENV_DEV                 0
 #define CONFIG_SYS_MMC_ENV_PART                        0
index 60dfee81b71b3ded00e716b2844cbae58fbd563e..cfee974045230c92fe3a1f2e55f20e0fea7f355c 100644 (file)
  */
 
 #define CONFIG_SYS_LOAD_ADDR           0x00800000
-#define CONFIG_SYS_MEMTEST_START       0x00400000
-#define CONFIG_SYS_MEMTEST_END         0x007fffff
 #define CONFIG_SYS_RESET_ADDRESS       0xffff0000
 
 /* Enable command line editing */
index 95c04c3797060814b23ae3c03522fd131b1d860c..fe63bcaaa6204ba429fb30bf07454478adba33b0 100644 (file)
 
 #define CONFIG_ARP_TIMEOUT     200UL
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10800000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
 
index 62561116bbe320990e53450a0dd5b02c638bd715..24a0025eda3d953bb1a378928389b7bf5d213abc 100644 (file)
 
 #define CONFIG_ARP_TIMEOUT     200UL
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
 
index 39a4a066ad04e2136e5b4af5682e4716170ff3de..d121b395dfe8a067d1a49cedeade6ec066ecbf1c 100644 (file)
@@ -37,9 +37,6 @@
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_SYS_SDRAM_BASE
 #define CONFIG_LOADADDR                        CONFIG_SYS_LOAD_ADDR
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (1 << 20))
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_TEXT_BASE \
-                                       - CONFIG_SYS_MALLOC_LEN)
 
 /* 512kB on-chip NOR flash */
 # define CONFIG_SYS_MAX_FLASH_BANKS    1
index 7a0ea753be03d56585529ad28518a48a9d85d5dc..0ff01af833b5837b620626cb942f3b4dd0e23891 100644 (file)
@@ -11,9 +11,6 @@
 
 #include <configs/aspeed-common.h>
 
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE + 0x300000)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x5000000)
-
 #define CONFIG_SYS_UBOOT_BASE          CONFIG_SYS_TEXT_BASE
 
 /* Memory Info */
index 5911a8a63992d358874299ad9baa212702cd302c..dff6a26f3b95f16a0c145972d652319a0c4b89f1 100644 (file)
@@ -49,8 +49,6 @@
 
 /* Boot Argument Buffer Size */
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x5E00000)
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
 
 #define CONFIG_RD_LVL
index fded5a11dac71b21a40b47820f8eec89c9ad1769..02fedb1823fa3aaf63879d158a2663298a1a1381 100644 (file)
@@ -79,9 +79,6 @@
 /* Print Buffer Size */
 #define CONFIG_SYS_MAXARGS     32      /* max number of command args */
 
-#define CONFIG_SYS_MEMTEST_START       0       /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x10000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /*
index 6412efcbf88e5a126e6d09b55e2f14f93e4a7053..261749db8d3409623aab4f4132f4c9405af4b1c3 100644 (file)
@@ -44,8 +44,6 @@
                                          230400, 460800, 921600 }
 
 /* RAM */
-#define CONFIG_SYS_MEMTEST_START       0x80100000
-#define CONFIG_SYS_MEMTEST_END         0x80400000
 
 /* Memory usage */
 #define CONFIG_SYS_MAXARGS             64
index 6a7a93144bf2adfbc6f3360f67b6fcda0501482e..f8df0c8ceb4fbf139b5936f504b81d8d8677bce9 100644 (file)
@@ -20,8 +20,6 @@
  * Memory test
  * TODO: Migrate!
  */
-#define CONFIG_SYS_MEMTEST_START       0x00001000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x07e00000
 
 /*
  * The reserved memory
index 3bf0cd518c1a23c04c6cc207d9e3a0a2e1afd4b6..e40be93ca78c0867274a0fe514c7ad5bcc7b295c 100644 (file)
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index f1ea729eb38ba31379e2d6c3861133146e897b4e..001e9d385ba1cd7a9d39b5eec9b3c59d79f47c94 100644 (file)
@@ -16,7 +16,6 @@
 
 /* Miscellaneous */
 #define CONFIG_SYS_PBSIZE      256
-#define CONFIG_SYS_ARM_CACHE_WRITETHROUGH
 #define CONFIG_CMDLINE_TAG
 
 /* Internal RAM Size (RZ/A1=3M, RZ/A1M=5M, RZ/A1H=10M) */
index d169aa19de49974125f1012ea576fc141f038e3b..bf4b3b297eee41b53f395afca136d5ae5f94aaec 100644 (file)
 #define CONFIG_HWCONFIG
 
 /* Memory configuration */
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END        0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index 8d16e18d8b6e0158643c17c9319a791325e5fa85..76add4eba8e1521f47bea18eb5f58c6018ebd19a 100644 (file)
@@ -51,8 +51,6 @@
  * The DRAM is already setup, so do not touch the DT node later.
  */
 #define PHYS_SDRAM_1_SIZE              (4089 << 20)
-#define CONFIG_SYS_MEMTEST_START       0x100000
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_1_SIZE - 0x100000)
 
 /* Environment data setup
 */
index 5d850929db0e86921548b234a67baaebf1364a6e..bf1feb8708cef8afe380548ad39d383460ff9f6d 100644 (file)
@@ -90,8 +90,6 @@
 /*
  * Memory test
  */
-#define CONFIG_SYS_MEMTEST_START       0x00001000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x07f00000
 
 /*
  * The reserved memory
index b96d4e82adf7828bf776778bba3565c1fc2476f8..3274ff64377b13ec0c9973e22eef4a1872cc1fdc 100644 (file)
 #define CONFIG_SYS_CBSIZE              1024
 #define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
 
-#define CONFIG_SYS_MEMTEST_START       0x00001000
-#define CONFIG_SYS_MEMTEST_END         0x00C00000
-
 #define CONFIG_SYS_LOAD_ADDR           0x100000
 #define CONFIG_LOADS_ECHO
 #define CONFIG_TIMESTAMP
index 82ac4242bbf3a12f44efd198aadd39fd4c8c62d1..67fa4a5a09ff22804bc3106926a164487625339b 100644 (file)
@@ -70,8 +70,6 @@
 /* malloc() len */
 #define CONFIG_SYS_MALLOC_LEN          (0x10000 + 512 * 1024)
 /* memtest start address */
-#define CONFIG_SYS_MEMTEST_START       0xA0000000
-#define CONFIG_SYS_MEMTEST_END         0xA1000000      /* 16MB RAM test */
 #define PHYS_SDRAM_1           0xA0000000      /* DDR Start */
 #define PHYS_SDRAM_1_SIZE      0x08000000      /* DDR size 128MB */
 
index 18327fb4c3d1f4c328de0632eb5239f741b3fd6a..69b7f3378eba636bb8419ca0a393df83adf74bdf 100644 (file)
 #define CONFIG_BOOTCOMMAND             "run $modeboot"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x8000000)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index 2274db0e2295380d0b87b6fb40042074c851a50c..63662dd18d400d9633c452bbd8341c63b5ca3a12 100644 (file)
 
 #define CONFIG_ARP_TIMEOUT     200UL
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
index b6e336a33d99b6a53f08eec389b8f85ec806fe1c..d4a613d0ada6450c6ca7ff04c97164689bdb4bf2 100644 (file)
@@ -70,8 +70,6 @@
 #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR                0x1000  /* 2MB */
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x8000000)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index 7da2b9005299bc0a31c3da923e07e02701df1526..5982522ecaf857eb6ec4e31c7dcbecc4832039b2 100644 (file)
 #define PHYS_SDRAM                      0x40000000
 #define PHYS_SDRAM_SIZE                        0x80000000 /* 2GB DDR */
 
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + (PHYS_SDRAM_SIZE >> 1))
-
 #define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
 
 /* Monitor Command Prompt */
index ce73ca6b0aea5a4f7b2ed65c6df74ac9dad33508..395ddf5816b58158ac6dd58f5a6b3b889a961b37 100644 (file)
 #define PHYS_SDRAM                      0x40000000
 #define PHYS_SDRAM_SIZE                        0x80000000 /* 2GB DDR */
 
-#define CONFIG_SYS_MEMTEST_START    PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END      (CONFIG_SYS_MEMTEST_START + (PHYS_SDRAM_SIZE >> 1))
-
 #define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
 
 /* Monitor Command Prompt */
index e91c71036d7e5067a7a508829aabc706ce03fe28..80e57389614d0853c4d9dff53c7dc041f510086f 100644 (file)
 #define PHYS_SDRAM_2                   0x100000000
 #define PHYS_SDRAM_2_SIZE              0xC0000000      /* 3 GB */
 
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                       (PHYS_SDRAM_SIZE >> 1))
-
 #define CONFIG_MXC_UART_BASE           UART2_BASE_ADDR
 
 /* Monitor Command Prompt */
index ecf4c2e46b7ba61b7c1428288a22d8c441fc0670..724d572c228f065c20e2b6cfd2c5e87f8650e67e 100644 (file)
 #define PHYS_SDRAM                      0x40000000
 #define PHYS_SDRAM_SIZE                        0xC0000000 /* 3GB DDR */
 
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                       (PHYS_SDRAM_SIZE >> 1))
-
 #define CONFIG_BAUDRATE                        115200
 
 #define CONFIG_MXC_UART
index ac25549a18320a7e033b5c176e77f2f35c6b477f..b59641e37fc2cfd7ed84903779da6cf9431f4fe9 100644 (file)
 /* LPDDR4 board total DDR is 6GB, DDR4 board total DDR is 4 GB */
 #define PHYS_SDRAM_2_SIZE              0x80000000      /* 2 GB */
 
-#define CONFIG_SYS_MEMTEST_START       0xA0000000
-#define CONFIG_SYS_MEMTEST_END      (CONFIG_SYS_MEMTEST_START + (PHYS_SDRAM_1_SIZE >> 2))
-
 /* Serial */
 #define CONFIG_BAUDRATE                        115200
 
index 9223fc2cde963e1ec1ff84aeebb4c3e53f2036b1..89ab0da50cdde9224b2baf36c2093dba99e31039 100644 (file)
@@ -6,8 +6,6 @@
  * Common ARM Integrator configuration settings
  */
 
-#define CONFIG_SYS_MEMTEST_START       0x100000
-#define CONFIG_SYS_MEMTEST_END         0x10000000
 #define CONFIG_SYS_TIMERBASE           0x13000100      /* Timer1 */
 #define CONFIG_SYS_LOAD_ADDR           0x7fc0  /* default load address */
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 128*1024) /* Size of malloc() pool */
index 84594874b88ef7fb7bc17ee56eedab93b8c08324..fde84871787671d6facb4b0715986418637e9cb5 100644 (file)
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      3  /* 8 Byte write page */
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  10
 
-#define CONFIG_SYS_MEMTEST_START 0x00100000    /* memtest works on */
-
-#define CONFIG_SYS_MEMTEST_END 0x00f00000      /* 1 ... 15 MB in DRAM  */
-
 #define CONFIG_SYS_LOAD_ADDR   0x100000        /* default load address */
 
 /* Reserve 4 MB for malloc */
index 156edfba22691fe7a9af0389432945a1befc7f28..fa9d7b5dfa0e0d4465f7b86225fe45bc6f4f1502 100644 (file)
@@ -37,8 +37,6 @@
 
 #include "asm/arch/config.h"
 
-#define CONFIG_SYS_MEMTEST_START 0x00400000    /* 4M */
-#define CONFIG_SYS_MEMTEST_END 0x007fffff      /*(_8M -1) */
 #define CONFIG_SYS_LOAD_ADDR   0x00800000      /* default load adr- 8M */
 
 /* architecture specific default bootargs */
index cdfb280aeeee3dd9770a483fac0d35cac768323f..4d01f236c31f2a8694b7b89a8872f6e9abda7dbe 100644 (file)
@@ -51,7 +51,7 @@
 /* enable POST tests */
 #define CONFIG_POST (CONFIG_SYS_POST_MEMORY|CONFIG_SYS_POST_MEM_REGIONS)
 #define CONFIG_POST_EXTERNAL_WORD_FUNCS /* use own functions, not generic */
-#define CPM_POST_WORD_ADDR  CONFIG_SYS_MEMTEST_END
+#define CPM_POST_WORD_ADDR  0x00f00000
 #define CONFIG_TESTPIN_REG  gprt3      /* for kmcoge5ne */
 #define CONFIG_TESTPIN_MASK 0x20       /* for kmcoge5ne */
 
index cceabdf66363f3dc3bb1427e7985be2468f85466..0724df154e99786a075a2cfed6a1ccee477d107c 100644 (file)
 /* SCIF */
 #define CONFIG_CONS_SCIF4
 
-#define CONFIG_SYS_MEMTEST_START       (KZM_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END \
-       (CONFIG_SYS_MEMTEST_START + (60 * 1024 * 1024))
-#undef  CONFIG_SYS_MEMTEST_SCRATCH
 #undef  CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_INIT_RAM_ADDR       (0xE5600000) /* on MERAM */
index 0bfa67a7c09c5825874496f66a5f3472b2142384..a5f7fab15e2fee1793107885e5a5296b9deb4baf 100644 (file)
 #define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
 
 /* memtest start addr */
-#define CONFIG_SYS_MEMTEST_START       (PHYS_SDRAM_1 + 0x2000000)
 
 /* memtest will be run on 16MB */
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_1 + 0x2000000 + 16*1024*1024)
 
 /*
  * Serial Driver info
index 4276e95dee2798aba6fdb8b6434d6db8d8b09f6b..d7ebfeda4c568498fbc8fc38d2095932b2b9585b 100644 (file)
@@ -45,8 +45,6 @@
                                          230400, 460800, 921600 }
 
 /* RAM */
-#define CONFIG_SYS_MEMTEST_START       0x80100000
-#define CONFIG_SYS_MEMTEST_END         0x80400000
 
 /* Memory usage */
 #define CONFIG_SYS_MAXARGS             64
index 6aba6a616eacb6da9bdece48353bf1008f1ed792..fa7d5896f58a7c68cef91a22db8c26ad7e8eba37 100644 (file)
           "else run netboot; fi"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + SZ_128M)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index 5943b69716e094d0fb9c23733fda524b688ba051..869e0ad6b82ee097f2d1a759eb5b30d4041d0937 100644 (file)
@@ -13,8 +13,6 @@
 #define CONFIG_CHIP_SELECTS_PER_CTRL   1
 #define CONFIG_SYS_SDRAM_SIZE          0x40000000
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 /*  MMC  */
 #ifdef CONFIG_MMC
@@ -33,8 +31,6 @@
 #define CONFIG_SYS_SCSI_MAX_DEVICE             (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
                                                CONFIG_SYS_SCSI_MAX_LUN)
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS              \
index 8a3ebf06f2d449f112ccaebdcb4b479acb6265a7..54ea43420ff09f2c39e4d42f1fd107649e131b76 100644 (file)
@@ -14,8 +14,6 @@
 #define CONFIG_SYS_SDRAM_SIZE          0x20000000
 #define CONFIG_CHIP_SELECTS_PER_CTRL   1
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 #ifndef CONFIG_SPL_BUILD
 #undef BOOT_TARGET_DEVICES
@@ -73,7 +71,5 @@
 #endif
 
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 #endif /* __LS1012ARDB_H__ */
index 4d4c1a04f2942704cac559624b9a999803b6804c..97d3eb2f3d330ac7d4ae50af0ce1b2cf89d08dde 100644 (file)
@@ -22,9 +22,6 @@
 #define SYS_SDRAM_SIZE_1024            0x40000000
 #define CONFIG_CHIP_SELECTS_PER_CTRL   1
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_CMD_MEMTEST
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 /* ENV */
 #define CONFIG_SYS_FSL_QSPI_BASE       0x40000000
                           "env exists secureboot && esbc_halt;"
 #endif
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_CMD_MEMTEST
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 #include <asm/fsl_secure_boot.h>
 
index fb0d1ba6b27df4be14504fa335971ce3e80030d5..99840dcfc4fc779f9a5bcdeb35d1d8326f694f9a 100644 (file)
@@ -13,8 +13,6 @@
 #define CONFIG_CHIP_SELECTS_PER_CTRL   1
 #define CONFIG_SYS_SDRAM_SIZE          0x40000000
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 /*
  * QIXIS Definitions
 #define CONFIG_PCI_SCAN_SHOW
 
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 #include <asm/fsl_secure_boot.h>
 #endif /* __LS1012AQDS_H__ */
index 0738b243c435b03f3cd871c5d87b194868de1f7e..c9d116d4d56d517be0eec68d7bb1c8353856a0c0 100644 (file)
@@ -14,8 +14,6 @@
 #define CONFIG_CHIP_SELECTS_PER_CTRL   1
 #define CONFIG_SYS_SDRAM_SIZE          0x40000000
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 
 /* ENV */
@@ -55,8 +53,6 @@
 #define CONFIG_PCI_SCAN_SHOW
 
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS              \
index 0e1eff71d226fec017597f51746e5fbb2b30500c..031bc6f172fe3b325feeff9e00f4b0c4c4755ef9 100644 (file)
@@ -472,9 +472,6 @@ unsigned long get_board_ddr_clk(void);
  */
 #define CONFIG_SYS_BOOTMAPSZ           (256 << 20)
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
-
 #define CONFIG_SYS_LOAD_ADDR           0x82000000
 
 #define CONFIG_LS102XA_STREAM_ID
index 45ce460dca2a2d7a10d289a213d805b8fce06e3e..cb56037a412d66f69692dd3f6e63d2385cff12bd 100644 (file)
  */
 #define CONFIG_SYS_BOOTMAPSZ           (256 << 20)
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
-
 #define CONFIG_SYS_LOAD_ADDR           0x82000000
 
 #define CONFIG_LS102XA_STREAM_ID
index 6905694d102cce79b589305aa5c323342a9aea05..f9040e661d018e7723fd85cec3a75decafe000b9 100644 (file)
 #define CONFIG_SYS_DDR_BLOCK2_BASE     0x2080000000ULL
 #define CONFIG_SYS_FSL_DDR_MAIN_NUM_CTRLS      1
 
-#define CONFIG_CMD_MEMTEST
-#define CONFIG_SYS_MEMTEST_START        0x80000000
-#define CONFIG_SYS_MEMTEST_END          0x9fffffff
-
 /*
  * SMP Definitinos
  */
index 5769dc43a93112887111b06e1902aa3f0e069bab..95bf5fa1024999ab5f01195848dcba903e245d87 100644 (file)
@@ -390,9 +390,6 @@ unsigned long get_board_ddr_clk(void);
  * Miscellaneous configurable options
  */
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
-
 #define CONFIG_SYS_HZ                  1000
 
 #define CONFIG_SYS_INIT_SP_OFFSET \
index 9ff248cefad1cb1b3353690ecf968220e4e1bd90..ff0d5fad9c2fc852588ea2dc43ac97371da86e47 100644 (file)
@@ -409,9 +409,6 @@ unsigned long get_board_ddr_clk(void);
  * Miscellaneous configurable options
  */
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
-
 #define CONFIG_SYS_HZ                  1000
 
 #define CONFIG_SYS_INIT_SP_OFFSET \
index 301945fc8c77d4c46460f16150c26a69c461e3fe..3bfd1d2a86aa259c35317127c900ddf14d83849a 100644 (file)
@@ -376,8 +376,6 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
index 7cb0704849866cc53cd22933c52192483afe2a48..dec1ff9d7d41152bfd8c6ef6033522fe1a4bdfa1 100644 (file)
 #endif
 
 #define CONFIG_CMD_MEMINFO
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x9fffffff
 
 #ifdef CONFIG_SPL_BUILD
 #define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
index af6fc3ae7aec3eda2e5c3fd36af40db512981a08..6be88831f04027a0b78455fafe62621ef68cf0e6 100644 (file)
@@ -25,8 +25,6 @@
 #define PHYS_SDRAM_2_SIZE              (gd->bd->bi_dram[1].size)
 #define PHYS_SDRAM_SIZE                        (gd->ram_size)
 #define CONFIG_SYS_MALLOC_LEN          (10 * 1024 * 1024)
-#define CONFIG_SYS_MEMTEST_START       0x70000000
-#define CONFIG_SYS_MEMTEST_END         0x8ff00000
 
 #define CONFIG_SYS_SDRAM_BASE          (PHYS_SDRAM_1)
 #define CONFIG_SYS_INIT_RAM_ADDR       (IRAM_BASE_ADDR)
index bb8a44433eba4471ec5588b015fc58f03659cef5..773d7c23ed87bc70efa64c9ee091b5c89dc06820 100644 (file)
@@ -16,7 +16,6 @@
 #define CONFIG_PCI_GT64120
 #define CONFIG_PCI_MSC01
 #define CONFIG_PCNET
-#define CONFIG_PCNET_79C973
 #define PCNET_HAS_PROM
 
 #define CONFIG_SYS_ISA_IO_BASE_ADDRESS 0
@@ -42,8 +41,6 @@
 #define CONFIG_SYS_INIT_SP_OFFSET      0x400000
 
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x01000000)
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE + 0x00100000)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x00800000)
 
 #define CONFIG_SYS_MALLOC_LEN          (128 * 1024)
 #define CONFIG_SYS_BOOTPARAMS_LEN      (128 * 1024)
index 0aee1e1cf6b75863b22faa9b628736772044b0b0..ee942a48fc8817010f41d9f111b435228dde259d 100644 (file)
@@ -31,9 +31,6 @@
 #define CONFIG_BOARD_LATE_INIT
 #define CONFIG_MXC_UART_BASE           UART1_BASE
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
-
 /* MMC Configuration */
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
index 2dc3156b266d9221cac1ca33e1d449f9630fab79..33172a6b97a941dc4df39a6f77fd3b3bda846849 100644 (file)
@@ -17,9 +17,6 @@
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (32 * SZ_1M)
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x20000000)
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
 
index 9d6c3b83006ee9822c55807e760fcf9cf73a0832..bd4bac7aab38f7768ac9ed8c730016f68195ba51 100644 (file)
@@ -58,8 +58,6 @@
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
 #define CONFIG_SYS_SDRAM_SIZE          PHYS_SDRAM_SIZE
 
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE + 0x00100000)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x01E00000)
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x00100000)
 
 /*
index 2f90ab31757189ceaa802f6457647312a25cf4f4..8ddfc6f14d939f510cc23cb5878d6b5b11d5e426 100644 (file)
@@ -54,8 +54,6 @@
 /*
  * memtest works on DRAM
  */
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM_0
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE)
 
 /* When we use RAM as ENV */
 
index cc58e806defc0a6cde22490dfd5c6e24dcdf43b9..97578cdb823cb8e99cda90e78a4b313435071230 100644 (file)
 /*
  * Memory test
  */
-#define CONFIG_SYS_MEMTEST_START       0x00001000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x07f00000
 
 /*
  * The reserved memory
index faab0913fc9e65c599154b4d13a94d428ce745de..fe436cca38916620c9db9a8f231d7747ab7e1f71 100644 (file)
 #define CONFIG_SYS_SDRAM_BASE          0x80000000
 
 /* This is needed for kernel booting */
-#define FDT_HIGH                       "fdt_high=0xac000000\0"
+#define FDT_HIGH                       "0xac000000"
 
-/* Extra environment variables */
-#define CONFIG_EXTRA_ENV_SETTINGS      \
-       FDT_HIGH
+#define ENV_MEM_LAYOUT_SETTINGS                                \
+       "fdt_high=" FDT_HIGH "\0"                       \
+       "kernel_addr_r=0x84000000\0"                    \
+       "fdt_addr_r=" FDT_HIGH "\0"                     \
+       "fdtfile=mt7623n-bananapi-bpi-r2.dtb" "\0"
 
 /* Ethernet */
 #define CONFIG_IPADDR                  192.168.1.1
 
 #define CONFIG_SYS_MMC_ENV_DEV         0
 
+#ifdef CONFIG_DISTRO_DEFAULTS
+
+#define BOOT_TARGET_DEVICES(func)      \
+               func(MMC, mmc, 1)
+
+#include <config_distro_bootcmd.h>
+
+/* Extra environment variables */
+#define CONFIG_EXTRA_ENV_SETTINGS      \
+       ENV_MEM_LAYOUT_SETTINGS         \
+       BOOTENV
+
+#endif /* ifdef CONFIG_DISTRO_DEFAULTS*/
+
 #endif
index a041ddb79bb0c65ac14e109b23163b9d8884c423..e3a00ed1cf4e9e61f7995a6af23719134a46933e 100644 (file)
@@ -59,8 +59,6 @@
  * Other required minimal configurations
  */
 #define CONFIG_SYS_LOAD_ADDR   0x00800000      /* default load adr- 8M */
-#define CONFIG_SYS_MEMTEST_START 0x00800000    /* 8M */
-#define CONFIG_SYS_MEMTEST_END 0x00ffffff      /*(_16M -1) */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000    /* Rst Vector Adr */
 #define CONFIG_SYS_MAXARGS     32      /* max number of command args */
 
index 024a9717087a7b49fcba0765246b510b5a8e34fa..24a83fdbbe0ade86fdc6d5669e8a2d0de614f7ba 100644 (file)
@@ -38,8 +38,6 @@
  * Other required minimal configurations
  */
 #define CONFIG_SYS_LOAD_ADDR   0x00800000      /* default load adr- 8M */
-#define CONFIG_SYS_MEMTEST_START 0x00800000    /* 8M */
-#define CONFIG_SYS_MEMTEST_END 0x00ffffff      /*(_16M -1) */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000    /* Rst Vector Adr */
 #define CONFIG_SYS_MAXARGS     32      /* max number of command args */
 
index b72a0a5b9ed7468b2ed48f14bbff10035d221814..19b5b5b386e248cef660fca9a34c0bf84f643bb7 100644 (file)
@@ -39,8 +39,6 @@
  * Other required minimal configurations
  */
 #define CONFIG_SYS_LOAD_ADDR   0x00800000      /* default load adr- 8M */
-#define CONFIG_SYS_MEMTEST_START 0x00800000    /* 8M */
-#define CONFIG_SYS_MEMTEST_END 0x00ffffff      /*(_16M -1) */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000    /* Rst Vector Adr */
 #define CONFIG_SYS_MAXARGS     32      /* max number of command args */
 
index 174f038be8eb1f379989f0bf9e5cdfc75912f2a4..683d442e75b4d6b0beaf54dd940ae61a9635dbdc 100644 (file)
@@ -41,8 +41,6 @@
        (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
 /* Memory Test */
-#define CONFIG_SYS_MEMTEST_START       (PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE/2)
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE)
 
 /* Serial Info */
 #define CONFIG_MXC_UART
index 4082a0bd642483a191511accf3a664f959c85fe9..f910d6199b28ac7aa484af49267cc77a7eca30e0 100644 (file)
@@ -71,8 +71,6 @@
  */
 
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         0x80010000
 
 /* default load address */
 #define CONFIG_SYS_LOAD_ADDR           0x81000000
index 222d13eb1fddc91ca040bd1eb738ade0f626804a..8f1213fd8af0fc6916c4fda1576896a489af8bf7 100644 (file)
@@ -93,9 +93,6 @@
  * Miscellaneous configurable options
  */
 
-#define CONFIG_SYS_MEMTEST_START       0       /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x10000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /*
index 10aa1bcd87c5d109b9145fd27fc0bc517f973318..182648a0f19ea0161841c4e03c0494f6dd12cbc4 100644 (file)
  * Miscellaneous configurable options
  */
 
-#define CONFIG_SYS_MEMTEST_START       0x90000000
-#define CONFIG_SYS_MEMTEST_END         0x90010000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /*-----------------------------------------------------------------------
index ff71435776a4d042bbf6e10bd727b5bff835bdee..b43be1c55c7f832bf2e42f1ac7331bd6a52e6128 100644 (file)
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x70000000
-#define CONFIG_SYS_MEMTEST_END         0x70010000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index 0ebff26ba09c4be329c84f9bf847c4acd4692046..e0210047ff5ef0c5865711b6b7608c4b84b9a6b8 100644 (file)
@@ -75,9 +75,6 @@
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_CBSIZE              512     /* Console I/O Buffer Size */
 
-#define CONFIG_SYS_MEMTEST_START       0x70000000
-#define CONFIG_SYS_MEMTEST_END         0x70010000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index 2e687b9bdc0bb56a351ef1988220e22b8cbc163b..ab02aa072ffb76508468557fc7d346d9b343f265 100644 (file)
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x70000000
-#define CONFIG_SYS_MEMTEST_END         0x70010000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index 1798a92efc533fabd491b06c8a17776463db4f0e..2e015ad9f89f580cc88e5cadb04236d1d93f13ea 100644 (file)
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_CBSIZE              512     /* Console I/O Buffer Size */
 
-#define CONFIG_SYS_MEMTEST_START       0x70000000
-#define CONFIG_SYS_MEMTEST_END         0x70010000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index 196eab05c2688e1001f19e0fa90d455ceb475b6b..c32f02635b6ff9c4213b662135616abca83eeaf3 100644 (file)
 #define CONFIG_SYS_MAXARGS     48      /* max number of command args */
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
 
-#define CONFIG_SYS_MEMTEST_START       0x70000000
-#define CONFIG_SYS_MEMTEST_END         0x70010000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 #define CONFIG_SYS_BOOTMAPSZ (256 << 20)     /* 256M */
index 610e6e8a11fbeff245ac4fd7a4461013e0d84069..b3322c639ce79e62e5ebc32a94d467b0370f06cb 100644 (file)
@@ -92,9 +92,6 @@
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x70000000
-#define CONFIG_SYS_MEMTEST_END         0x70010000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical Memory Map */
index 6fd87c2abcd4ead8bd04aeca5504860b2f447b64..3d79a7e43765aebed657f3a33526b1ed4bd6423e 100644 (file)
@@ -18,8 +18,6 @@
 #undef CONFIG_GENERIC_MMC
 #undef CONFIG_CMD_FUSE
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x20000000
 #define CONFIG_SYS_MALLOC_LEN          (64 * 1024 * 1024)
 
 #define CONFIG_MXC_UART
index 7e6917b9670ed23e3219323c163f1f9b562c749f..ec2ac6951587d75f89bf73f7cba2817dce4708c7 100644 (file)
 #define CONFIG_ARP_TIMEOUT     200UL
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index ee3b754910cc3e9545852c8a244a6fe180826968..cb0253c306caf0fef27b789339a46911d6b81fc6 100644 (file)
 
 #define CONFIG_ARP_TIMEOUT     200UL
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
-
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
 
index 193931b91ba637869b0f94a929383ad80cc2ccb5..d889c99d5120024881bcabefb3168618633d5d22 100644 (file)
           "else run netboot; fi"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + SZ_512M)
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index 8ae1e0a2e636e59d6176104f6f761b54753f769a..03c0c88e505dd9173dfd186b4b94a2da584113b7 100644 (file)
           "else run netboot; fi"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + SZ_128M)
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index dc5e81844316ea8faac1fba314da885edaa2ae75..2c7db39c2967588a4c5769767e0a4149836c4415 100644 (file)
@@ -91,8 +91,6 @@
           "else run netboot; fi"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x10000)
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index 3bff496bad2633b003659ed7ab2881ebb631d92c..8633756dd0e3acff9a375c7d3f54b0bb6fa46bf7 100644 (file)
           "else run netboot; fi"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x10000)
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index 1bdd5779403bbeed5ce96f2b456b4be8f089fbde..7927779cc84f53aafad430440c4c8553b389df8d 100644 (file)
           "else run netboot; fi"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x8000000)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index 3d42d26aa4943e2474c93aec4d68b5059a4355d7..7e3a5c7cf3bb81da52fd10ce8e1e6d8033e0a842 100644 (file)
           "else run netboot; fi"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x8000000)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index fa59748776db3ea099eb2f7c0d0f8e3ca5c80a0b..7e1e8b02cb7d59c6bdf44098c15b8847d32cae25 100644 (file)
@@ -94,9 +94,6 @@
 
 #include <config_distro_bootcmd.h>
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x20000000)
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
 
index f6e173d7d53ac7c97ed008994c28469cc0179e27..f7f940447944f6641788beb44bc91430afcb3cd2 100644 (file)
 /* Physical Memory Map */
 
 #define PHYS_SDRAM                     0x60000000
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
 
 #define CONFIG_LOADADDR                        0x60800000
 
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + SZ_512M)
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "image=zImage\0" \
        "console=ttyLP0\0" \
index c1b379bdeaf34098b8654cf677d4cd9c26c2d330..9216b0948c0f204ee3324ee945460133fe9898df 100644 (file)
 
 #define PHYS_SDRAM                     0x60000000
 #define PHYS_SDRAM_SIZE                        SZ_1G
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
 
 #define CONFIG_LOADADDR             0x60800000
 
-#define CONFIG_SYS_MEMTEST_END      0x9E000000
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "script=boot.scr\0" \
        "image=zImage\0" \
index e079f8035b8baf8fc1f822c761dd6f0d26b0614c..325c3ee00ce367837062ec8aac8c4212dc40f9c0 100644 (file)
@@ -51,8 +51,6 @@
 
 /* Memory sizes */
 #define CONFIG_SYS_MALLOC_LEN          0x00400000      /* 4 MB for malloc */
-#define CONFIG_SYS_MEMTEST_START       0x40000000      /* Memtest start adr */
-#define CONFIG_SYS_MEMTEST_END         0x40400000      /* 4 MB RAM test */
 
 /* OCRAM at 0x0 ; 32kB on MX23 ; 128kB on MX28 */
 #define CONFIG_SYS_INIT_RAM_ADDR       0x00000000
index 9ef6ea90a3f64f30f1ea6f3f9df115140bec7b17..a5ca5f9c4b256499bd70843e3939023f059f0da8 100644 (file)
        BOOTENV
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END        0x10010000
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                    MMDC0_ARB_BASE_ADDR
index fd755bbceae8a3a794c7e6cccd6d29a225ef3c3c..5d1c7bf83536e8240ad2b1dee84ec45c68294ef6 100644 (file)
@@ -274,9 +274,6 @@ int rx51_kp_getc(struct stdio_dev *sdev);
  * Miscellaneous configurable options
  */
 
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)
-#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + 0x01F00000)/*31MB*/
-
 /* default load address */
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0)
 
index 2b8419563c209ee9daca5d8e59f00b4f898567eb..6f964e43076bf6d3b0e7d469d41bef4f5ba682fb 100644 (file)
@@ -44,9 +44,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR \
        (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x20000000
-
 #define CONFIG_SYS_MALLOC_LEN          (64 * 1024 * 1024)
 
 /* SPL */
index a7e2a3d9a233d5f7d895ac6a046447df4f36266e..03229910b2f4670da8e0fb35d1fa5ac23db7dd8b 100644 (file)
@@ -29,8 +29,6 @@
 #define CONFIG_TZSW_RESERVED_DRAM_SIZE CONFIG_SYS_MEM_TOP_HIDE
 
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x5E00000)
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
 
 #include <linux/sizes.h>
@@ -64,7 +62,6 @@
        ""PARTS_BOOT" part 0 1;" \
        ""PARTS_ROOT" part 0 2\0" \
 
-#define CONFIG_SET_DFU_ALT_INFO
 #define CONFIG_SET_DFU_ALT_BUF_LEN     (SZ_1K)
 
 #define CONFIG_DFU_ALT_BOOT_EMMC \
index 47c30543f8f07b7003e1b7b428f741a705b7379b..564319c2311f9ed13a4508191885fa2b928ffcbe 100644 (file)
@@ -76,7 +76,6 @@
 
 /* Enable: board/samsung/common/misc.c to use set_dfu_alt_info() */
 #define CONFIG_MISC_COMMON
-#define CONFIG_SET_DFU_ALT_INFO
 #define CONFIG_SET_DFU_ALT_BUF_LEN     (SZ_1K)
 
 /* Set soc_rev, soc_id, board_rev, board_name, fdtfile */
index 4ad7dc18b104c2a081affa43acf2684ffb8a0b36..8dc30be8b72d26201931b3f60ba4bf70e6232bfe 100644 (file)
@@ -71,8 +71,6 @@
 
 #endif
 
-#define CONFIG_SYS_MTDPARTS_RUNTIME
-
 /* OneNAND config */
 #define CONFIG_USE_ONENAND_BOARD_INIT
 #define CONFIG_SYS_ONENAND_BASE                ONENAND_MAP
index ddf6d790ab30d02dc0901ecbc94eed356a15ccb2..dd0ea2dbde2ab76ce51825c59b02479e96ff38eb 100644 (file)
 /* Miscellaneous configurable options */
 
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)
-#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
-                                       0x01F00000) /* 31MB */
 
 /* FLASH and environment organization */
 
index 04f37559cc960cda5eeabb5c99a8987c64f22ef1..9a5b9f297c626aa337c358fd0851750ae8717b45 100644 (file)
        "run nanddtsboot; " \
 
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)
-#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
-                                       0x01F00000) /* 31MB */
 
 /* FLASH and environment organization */
 #if defined(CONFIG_MTD_RAW_NAND)
index 211078464d97516143b0971817af7f1e5ef592e5..ecf308e3819ea65d9bdee7d2545b1af9db4569d1 100644 (file)
@@ -48,9 +48,6 @@
        BOOTENV \
 
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)
-#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
-                                       0x01F00000) /* 31MB */
 
 #if defined(CONFIG_MTD_RAW_NAND)
 #define CONFIG_SYS_FLASH_BASE          NAND_BASE
index a4ba7dbcc56ba668965915b33d62b61f809c2a74..24884b26fb9a554771b527ec646f6b8752058e05 100644 (file)
 /*
  * Miscellaneous configurable options
  */
-#define CONFIG_SYS_MEMTEST_START       (PHYS_SDRAM_1)  /* memtest */
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_2 + \
-                                       0x01F00000) /* 31MB */
 
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
index aac7f182f2566a89988010ca406b1c08cd93dfec..58fa5ccfa3efa242ab8e718360611d21958a8623 100644 (file)
 #define CONFIG_SPL_BSS_MAX_SIZE 0x1080000
 
 /* memtest start addr */
-#define CONFIG_SYS_MEMTEST_START       (PHYS_SDRAM_1 + 0x2000000)
 
 /* memtest will be run on 16MB */
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_1 + 0x2000000 + 16*1024*1024)
 
 #define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (      \
        DAVINCI_SYSCFG_SUSPSRC_TIMER0 |         \
index ff9318a81b8fb0c03ce590e85b3368bf2c4e49d9..3bedc4784b7cc23771e7623f90666f9593c5d25f 100644 (file)
@@ -20,8 +20,6 @@
 #define SDRAM_BANK_SIZE                        (256 << 20)     /* 256 MB */
 
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x6000000)
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
 
 #define CONFIG_MACH_TYPE               MACH_TYPE_ORIGEN
index c42f1a9fce7427ded7444c0eca94d9686b373c83..af278ded9a44be95e382b7e4bcb546d4cb30d47f 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ * Copyright 2020 NXP
  */
 
 /*
 #define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x1fffffff
-
 #define CONFIG_SYS_CCSRBAR             0xffe00000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
 #define CONFIG_SYS_NS16550_COM2        (CONFIG_SYS_CCSRBAR+0x4600)
 
 /* I2C */
+#ifndef CONFIG_DM_I2C
 #define CONFIG_SYS_I2C
-#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_FSL_I2C_SPEED       400000
 #define CONFIG_SYS_FSL_I2C_SLAVE       0x7F
 #define CONFIG_SYS_FSL_I2C_OFFSET      0x3000
 #define CONFIG_SYS_FSL_I2C2_SLAVE      0x7F
 #define CONFIG_SYS_FSL_I2C2_OFFSET     0x3100
 #define CONFIG_SYS_I2C_NOPROBES                { {0, 0x29} }
+#else
+#define CONFIG_I2C_SET_DEFAULT_BUS_NUM
+#define CONFIG_I2C_DEFAULT_BUS_NUMBER  0
+#endif
+
+#define CONFIG_SYS_I2C_FSL
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x52
 #define CONFIG_SYS_SPD_BUS_NUM         1 /* For rom_loc and flash bank */
 
index 6dc5039560ec99cb315f1214aa7d2e51ca1c5929..e99b41cc8849c6cfeb39998dece3b4f7c295cdde 100644 (file)
@@ -54,9 +54,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_L2_CACHE
 #define CONFIG_BTB
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x1fffffff
-
 #define CONFIG_SYS_CCSRBAR             0xffe00000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
 
index 238b03f600ebd93441266bce49e32dbd3561a73e..2156da671b251edb11240b90fc12fc4853119d94 100644 (file)
@@ -35,8 +35,6 @@
 #define CONFIG_SYS_FSL_ESDHC_ADDR      USDHC1_BASE_ADDR
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x10000000)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index d2459874706a44183ad0256c69a8bff0a138283d..6aa77f1f5e9f0ad1ae6de3f9244a0f7c7af42d58 100644 (file)
@@ -43,8 +43,6 @@
 #endif
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x10000000)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index 290e652ec98c20bbd3319b4c4d7bd3ad83a442c8..706a8a2a876e55ade905f8422538d6ae54323144 100644 (file)
@@ -94,9 +94,6 @@
  * memtest works on 8 MB in DRAM after skipping 32MB from
  * start addr of ram disk
  */
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE + (64 << 20))
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START \
-                                       + (8 * 1024 * 1024))
 
 /* NS16550 Configuration */
 #define CONFIG_SYS_NS16550_COM1                0x44e09000      /* Base EVM has UART0 */
index d4d6ad2143f220b1e68071422e1fcf5a3d5812d8..0bfaaf784a6c5ab944afbf3f13ba199588366158 100644 (file)
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x80010000
-#define CONFIG_SYS_MEMTEST_END         0x87C00000
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 
 /* Physical memory map */
index 1a89c56f41a0f5f82cc1234df94297c36f15e17a..73edd28f1a6f16aa4e2a74167e83e7b45f144040 100644 (file)
@@ -42,8 +42,6 @@
 #define CONFIG_SYS_FDT_ADDR            0x89d00000
 
 /* Memory Test */
-#define CONFIG_SYS_MEMTEST_START       0x88000000
-#define CONFIG_SYS_MEMTEST_END         0x88080000
 
 /*----------------------------------------------------------------------
  * Commands
index 7cc55cb8d5fd52e7e280e815707afbded2e2dca6..27cbfe276da905db3fd4ed91f273eb6b329abaf4 100644 (file)
@@ -30,9 +30,6 @@
 #define CONFIG_MXC_UART
 #define CONFIG_MXC_UART_BASE           UART1_BASE
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
-
 /* MMC Configuration */
 #define CONFIG_SYS_FSL_ESDHC_ADDR      USDHC3_BASE_ADDR
 #define CONFIG_SUPPORT_EMMC_BOOT
index 27e83b47cd6309261764a8ea3e6233df957a296b..b0e2f6ce33a9090b22d3aed6a862faf3465d1c67 100644 (file)
 
 #include <config_distro_bootcmd.h>
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         CONFIG_SYS_MEMTEST_START + SZ_128M
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
 
index 4dc206566ef8e66a67c9e1bdd2ee132519bc6b63..9a987f41500befaa447cd28ccdbccd9289cc8b9b 100644 (file)
 
 #include <config_distro_bootcmd.h>
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x20000000)
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
 
index cb8338f384778788379b0f374aea3a441915031e..771fd8db97f2089abbdbe681a837cbb4abfa08bc 100644 (file)
@@ -86,9 +86,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x22000000      /* load address */
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         0x23e00000
-
 #ifdef CONFIG_SYS_USE_MMC
 /* bootstrap + u-boot + env + linux in mmc */
 
index 210927f4de005d2876680f403efbd64f4f2dae2a..5e81c4568a14401e854028101d2e396ad8bf06bd 100644 (file)
 
 /* Board startup config */
 
-#define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END                 (CONFIG_SYS_MEMTEST_START + \
-                                                PHYS_SDRAM_SIZE - (12 << 20))
-
 #define CONFIG_BOOTCOMMAND                     "run bootubi_scr"
 
 /* Miscellaneous configurable options */
index f958ceb30531a43d375eb632fa74968bef61deb5..9a4bfd1e0ec057e8e74147e442f1033ea8da174f 100644 (file)
 
 #define CONFIG_SYS_LOAD_ADDR                   0x22000000
 
-#define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END                 0x23e00000
-
 #undef CONFIG_SYS_USE_DATAFLASH_CS0
 #undef CONFIG_SYS_USE_NANDFLASH
 #define CONFIG_SYS_USE_FLASH   1
index 50d953a8e891a55f9c74a6b35c82f05de0543055..7f87edb42d390cd567920fa1b4ffd3addf799f6d 100644 (file)
 
 #define CONFIG_SYS_LOAD_ADDR                   0x22000000      /* load address */
 
-#define CONFIG_SYS_MEMTEST_START               PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END                 0x23e00000
-
 #define CONFIG_SYS_USE_FLASH   1
 #undef CONFIG_SYS_USE_DATAFLASH
 #undef CONFIG_SYS_USE_NANDFLASH
index 8c181e64afdbcd662a4249730a45b1d81a626de2..b0511beb8f94d1c77af27969a7507fc1ab4b50b2 100644 (file)
@@ -59,9 +59,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           0x22000000      /* load address */
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         0x23e00000
-
 #ifdef CONFIG_NAND_BOOT
 /* bootstrap + u-boot + env in nandflash */
 
index 023092e486da6fe78a4012e20ee6ba20b0f57aa5..51177f44feedd0e7de5d3e8061531518900a3827 100644 (file)
 #define GICD_BASE                      0xf7011000
 #define GICC_BASE                      0xf7012000
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x00100000
-#define CONFIG_SYS_MEMTEST_START       0x05000000
-#define CONFIG_SYS_MEMTEST_END         0x0D000000
-
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (8 << 20))
 
index e25800a0958da3e3ec6b3f764694d558c5a491a3..2632d48cc9cbb82c1de97a2221635f2e4e4e753c 100644 (file)
@@ -8,8 +8,6 @@
 #ifndef        __CONFIG_PXA_COMMON_H__
 #define        __CONFIG_PXA_COMMON_H__
 
-#define        CONFIG_SYS_ARM_CACHE_WRITETHROUGH
-
 /*
  * KGDB
  */
index 42a25623c37b24313e90707728c02fc66998884e..4227a280c75a82b26b60dafa1eb2088e33fab14f 100644 (file)
@@ -73,9 +73,6 @@
 /* default load address */
 #define CONFIG_SYS_LOAD_ADDR           0x81000000
 
-#define CONFIG_SYS_MEMTEST_START       0x80100000
-#define CONFIG_SYS_MEMTEST_END         0x80800000
-
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
  */
index e4a78fbddadd8ca89783a3d47b76f796ca16c741..801ba76b3ecc92e89a7994854ee64258b3b3a65d 100644 (file)
@@ -73,9 +73,6 @@
 /* default load address */
 #define CONFIG_SYS_LOAD_ADDR           0xffffffff81000000
 
-#define CONFIG_SYS_MEMTEST_START       0xffffffff80100000
-#define CONFIG_SYS_MEMTEST_END         0xffffffff80800000
-
 /*-----------------------------------------------------------------------
  * FLASH and environment organization
  */
index 47fb181693247ed209af4c7de2fe25c96983004d..cfbd472c821f5c4ede457e87766acdc0452bbbbb 100644 (file)
@@ -24,9 +24,6 @@
 #define CONFIG_ADDR_MAP
 #define CONFIG_SYS_NUM_ADDR_MAP                16      /* number of TLB1 entries */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /* Needed to fill the ccsrbar pointer */
 
 /* Virtual address to CCSRBAR */
index afa446f53a4b0a50596a7d794caa9dc93e190f27..a8886251e01a9da1f3381d9f0aa6d8db069c3362 100644 (file)
@@ -17,9 +17,6 @@
 
 #define CONFIG_SYS_PBSIZE              256
 
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_TEXT_BASE - 0x100000)
-
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 32 * 1024 * 1024)
 /* Address of u-boot image in Flash */
 #define CONFIG_SYS_MONITOR_BASE        (CONFIG_SYS_FLASH_BASE)
index b562308db8bfc3c0091ed294a91029b6216d1153..e32ab9d7aee810cc9aae25b1bb7469a13c93d9d1 100644 (file)
@@ -25,9 +25,6 @@
 
 #define CONFIG_SYS_PBSIZE              256
 
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_TEXT_BASE - 0x100000)
-
 /* Flash board support */
 #define CONFIG_SYS_FLASH_BASE          (0xA0000000)
 #ifdef CONFIG_SYS_R7780MP_OLD_FLASH
index 89a8a44bbe22030aa3160ba66d9e4b5bfe910373..f0ae6e67a710e06b2de0b22b5211bb837974a044 100644 (file)
@@ -48,6 +48,8 @@
 
 #define ENV_MEM_LAYOUT_SETTINGS \
        "scriptaddr=0x00500000\0" \
+       "script_offset_f=0xffe000\0" \
+       "script_size_f=0x2000\0" \
        "pxefile_addr_r=0x00600000\0" \
        "fdt_addr_r=0x01f00000\0" \
        "kernel_addr_r=0x02080000\0" \
@@ -58,6 +60,7 @@
 #endif
 
 #include <config_distro_bootcmd.h>
+#include <environment/distro/sf.h>
 #define CONFIG_EXTRA_ENV_SETTINGS \
        ENV_MEM_LAYOUT_SETTINGS \
        "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
index b55e09a9ca1f69084311b3eb1ff72078f69f4636..bf8c60d6dddb0e5f77e729604f85bf8998cb1dd5 100644 (file)
        #define BOOT_TARGET_DHCP(func)
 #endif
 
+#if CONFIG_IS_ENABLED(CMD_SF)
+       #define BOOT_TARGET_SF(func)    func(SF, sf, 0)
+#else
+       #define BOOT_TARGET_SF(func)
+#endif
+
+#ifdef CONFIG_ROCKCHIP_RK3399
+#define BOOT_TARGET_DEVICES(func) \
+       BOOT_TARGET_MMC(func) \
+       BOOT_TARGET_USB(func) \
+       BOOT_TARGET_PXE(func) \
+       BOOT_TARGET_DHCP(func) \
+       BOOT_TARGET_SF(func)
+#else
 #define BOOT_TARGET_DEVICES(func) \
        BOOT_TARGET_MMC(func) \
        BOOT_TARGET_USB(func) \
        BOOT_TARGET_PXE(func) \
        BOOT_TARGET_DHCP(func)
+#endif
 
 #ifdef CONFIG_ARM64
 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"
index b53a4b65d0bf2dfa9114e4f5ede8932d310a0107..834f1cd23640d88663ce51ad805269530bfccdf9 100644 (file)
@@ -55,8 +55,6 @@
                                         CONFIG_SYS_SDRAM_SIZE - \
                                         GENERATED_GBL_DATA_SIZE)
 #define CONFIG_SYS_MALLOC_LEN          SZ_4M
-#define CONFIG_SYS_MEMTEST_START       0x00100000
-#define CONFIG_SYS_MEMTEST_END         0x00200000
 #define CONFIG_LOADADDR                        0x00200000
 
 #ifdef CONFIG_ARM64
index 53c94ed70e6f1040254f47e8f104929ebfa21763..5b1504d2dfe86145a36b12f67bb067b8f1786733 100644 (file)
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_PROMPT              "=> "
 
-#define CONFIG_SYS_MEMTEST_START       (DDR_BASE_ADDR)
-#define CONFIG_SYS_MEMTEST_END         (DDR_BASE_ADDR + 0x7C00000)
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                          1000
 
index 20538df0252b946e6d934afe95712f3f04a8229b..620217f528801035cfd155ec89fd9750eb777194 100644 (file)
 
 #define CONFIG_SYS_PBSIZE      384     /* Print Buffer Size */
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x5000000)
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x4000000)
 
 /* Goni has 3 banks of DRAM, but swap the bank */
index ec9abaf584ed0cc734552b204e2e103d9c5bc860..5a80958739df1ddbcaf2c91b7f99c9b98a26d44e 100644 (file)
@@ -37,8 +37,6 @@
 #define CONFIG_SYS_MONITOR_BASE        0x00000000
 
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x5000000)
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x4800000)
 
 /* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */
index 1c13055cdc05de306d167f88c645733ab4473925..7fda63f71a5eb91451d64863b2082b4f492b0186 100644 (file)
@@ -43,8 +43,6 @@
 
 /* Memory things - we don't really want a memory test */
 #define CONFIG_SYS_LOAD_ADDR           0x00000000
-#define CONFIG_SYS_MEMTEST_START       0x00100000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x1000)
 #define CONFIG_SYS_FDT_LOAD_ADDR               0x100
 
 #define CONFIG_PHYSMEM
index 9d655848388217d37d0b03617e86642864b674e6..55b9a3c1822db10b3a7cd11755fe1ae24096a1ec 100644 (file)
@@ -23,8 +23,6 @@
 #undef CONFIG_MPC83XX_PCI2             /* support for 2nd PCI controller */
 
 #undef CONFIG_SYS_DRAM_TEST            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00100000
 
 /*
  * DDR Setup
index ae2c0033d06ffe8fa4b651e4fa80e43ac1faf3b1..f5462549a52654ec2505c8b08b238b3c0f5f294c 100644 (file)
@@ -73,8 +73,6 @@
 #define CONFIG_ENABLE_36BIT_PHYS       1
 
 #undef CONFIG_SYS_DRAM_TEST                    /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
 
 #define CONFIG_SYS_CCSRBAR             0xe0000000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
index 011e5736e272328795d7cf632f4545e0e3d2643d..4ab364ae9a2f50d62088995cd006c58c4e1d2461 100644 (file)
@@ -69,8 +69,6 @@
 #endif
 
 #undef CONFIG_SYS_DRAM_TEST                            /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
 
 /*
  * Base addresses -- Note these are effective addresses where the
index 20acc403634822b69f4913f4af73065995667cf0..b390c2fc52e99b53e5588c6f09a982a44a1db822 100644 (file)
@@ -18,9 +18,6 @@
 #define CONFIG_MXC_UART
 #define CONFIG_MXC_UART_BASE           UART2_BASE
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
-
 /* MMC Configuration */
 #define CONFIG_SYS_FSL_USDHC_NUM        2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
index c45b33a91a97e4b212d3fa21d7c72ae9485c031d..7211a2afa68ae992e2eb56169c2f525b46846b67 100644 (file)
 /* SCIF */
 #define CONFIG_CONS_SCIF2      1
 
-#define CONFIG_SYS_MEMTEST_START       (SH7752EVB_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                        480 * 1024 * 1024)
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_SDRAM_BASE          (SH7752EVB_SDRAM_BASE)
index 70e7fb932484aa81ebbe596b1e80717a6134b5e9..464a5524809e8a14d9d4d283196395031529e4ac 100644 (file)
 /* SCIF */
 #define CONFIG_CONS_SCIF2      1
 
-#define CONFIG_SYS_MEMTEST_START       (SH7753EVB_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                        480 * 1024 * 1024)
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_SDRAM_BASE          (SH7753EVB_SDRAM_BASE)
index 6a34dc7954b65b5652fba3dec07d41e78b8e02a3..ac6338cec1c72ef453c98a0f62e981a4ff84711c 100644 (file)
 /* SCIF */
 #define CONFIG_CONS_SCIF2      1
 
-#define CONFIG_SYS_MEMTEST_START       (SH7757LCR_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                        224 * 1024 * 1024)
-#undef CONFIG_SYS_MEMTEST_SCRATCH
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE
 
 #define CONFIG_SYS_SDRAM_BASE          (SH7757LCR_SDRAM_BASE)
index 5122c8bf44fefd7b76bfa303997dde7fb5fe8870..b66442880637a69a46761e46183b79e16d051cd3 100644 (file)
@@ -26,8 +26,6 @@
 /* SDRAM */
 #define CONFIG_SYS_SDRAM_BASE          (0x8C000000)
 #define CONFIG_SYS_SDRAM_SIZE          (64 * 1024 * 1024)
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + (60 * 1024 * 1024))
 
 /* Flash(NOR) */
 #define CONFIG_SYS_FLASH_BASE          (0xA0000000)
index cab2876651898e85e99397a8889373c7a357a796..ed931176504a69236ce6590bb43b88209964c56d 100644 (file)
@@ -54,9 +54,6 @@
  * memtest works on 8 MB in DRAM after skipping 32MB from
  * start addr of ram disk
  */
-#define CONFIG_SYS_MEMTEST_START       (PHYS_DRAM_1 + (64 * 1024 * 1024))
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START \
-                                       + (8 * 1024 * 1024))
 
 #define CONFIG_SYS_LOAD_ADDR           0x81000000 /* Default load address */
 
index 624ad3b7688ebe44d262d64a792367111055c38b..aacdd1263e7b545ebf7b9206e0b2417c3a07f3ee 100644 (file)
@@ -69,8 +69,6 @@
  * Perform a SDRAM Memtest from the start of SDRAM
  * till the beginning of the U-Boot position in RAM.
  */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_TEXT_BASE - 0x100000)
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN \
index dbdb9a4a07a59503cbf2b338959f09e3fa2eef43..20d60636767c30b950596f141a766c0967c07a99 100644 (file)
  */
 #define CONFIG_SYS_PBSIZE      384     /* Print Buffer Size */
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x5e00000)
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_SYS_SDRAM_BASE
 
 /* SMDKC100 has 1 banks of DRAM, we use only one in U-Boot */
index 13e81ee2ffedc2836dcc656980f954bc8f4ea665..336571d4c4e06d5b868464c8580367a55095e48c 100644 (file)
@@ -42,8 +42,6 @@
 /* Miscellaneous configurable options */
 #define CONFIG_DEFAULT_CONSOLE         "console=ttySAC2,115200n8\0"
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x6000000)
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
 
 /* SMDKV310 has 4 bank of DRAM */
index b0408a559252ddcb4efafe04ef62ff21108f15e3..35cd7f69c1d803e311e913d83c5c1218dd657b2b 100644 (file)
@@ -32,8 +32,6 @@
                                         GENERATED_GBL_DATA_SIZE)
 
 /* Mem test settings */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + (1024 * 1024))
 
 /* NAND Flash */
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
index ffcfdcaafcde995b03c11e9345d85a1089fab687..9b95054308410e7ec3e8221cc5d36d8673798d0d 100644 (file)
@@ -31,8 +31,6 @@
                                         GENERATED_GBL_DATA_SIZE)
 
 /* Mem test settings */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + (1024 * 1024))
 
 /* NAND Flash */
 #define CONFIG_SYS_NAND_ECC_BASE       ATMEL_BASE_ECC
index 410ec80618f5890e1606863ff60d3826f7991416..0579a00d40a3b854836c0a426f7dbc63a660b14c 100644 (file)
@@ -17,8 +17,6 @@
  */
 #define PHYS_SDRAM_1                   0x0
 #define CONFIG_SYS_MALLOC_LEN          (64 * 1024 * 1024)
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM_1
-#define CONFIG_SYS_MEMTEST_END         PHYS_SDRAM_1_SIZE
 #if defined(CONFIG_TARGET_SOCFPGA_GEN5)
 #define CONFIG_SYS_INIT_RAM_ADDR       0xFFFF0000
 #define CONFIG_SYS_INIT_RAM_SIZE       SOCFPGA_PHYS_OCRAM_SIZE
index 87c73457a0ae7eba8e576be10ea91a2b6759ac7d..61f7b254b59a957dfc3c910678b690d43ac0e679 100644 (file)
@@ -117,8 +117,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define PHYS_SDRAM_1                   0x0
 #define PHYS_SDRAM_1_SIZE              (1 * 1024 * 1024 * 1024)
 #define CONFIG_SYS_SDRAM_BASE          0
-#define CONFIG_SYS_MEMTEST_START       0
-#define CONFIG_SYS_MEMTEST_END         PHYS_SDRAM_1_SIZE - 0x200000
 
 /*
  * Serial / UART configurations
index 4fe67dced85062871f760306d7b7adf11946e88d..da60546966cd8339550aa2def441c7254e537fba 100644 (file)
@@ -51,8 +51,6 @@
 #define CONFIG_SYS_INIT_DBCR DBCR_IDM          /* Enable Debug Exceptions      */
 
 #undef CONFIG_SYS_DRAM_TEST                    /* memory test, takes time      */
-#define CONFIG_SYS_MEMTEST_START       0x00400000
-#define CONFIG_SYS_MEMTEST_END         0x00C00000
 
 #define CONFIG_SYS_CCSRBAR             0xE0000000
 #define CONFIG_SYS_CCSRBAR_PHYS_LOW    CONFIG_SYS_CCSRBAR
index 6759f24c08348427709c3de00e41b274f100c072..85c68cdee65d78378d0b8c64d4e07a7fe02dbbe0 100644 (file)
@@ -73,8 +73,6 @@
        "fi"
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x8000000)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index 85e498dc6687d261656c37ebf75fbdbfeeda85a3..e74ba6cc34cc1ea4bc6b194bf9283e587f6a3ce7 100644 (file)
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
 
-#define CONFIG_SYS_MEMTEST_START               0x00800000
-#define CONFIG_SYS_MEMTEST_END                 0x04000000
 #define CONFIG_SYS_MALLOC_LEN                  (1024*1024)
 #define CONFIG_SYS_LOAD_ADDR                   0x00800000
 
index 2ba4fb1305a843c38d7ce7124a9348ea6712dd0e..be5afe9c6fa2adbcdcca20f93b293f9256c4f2e8 100644 (file)
 #define CONFIG_SPL_STACK               (STM32_SYSRAM_BASE + \
                                         STM32_SYSRAM_SIZE)
 #endif /* #ifdef CONFIG_SPL */
-
-#define CONFIG_SYS_MEMTEST_START       STM32_DDR_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + SZ_64M)
-#define CONFIG_SYS_MEMTEST_SCRATCH     (CONFIG_SYS_MEMTEST_END + 4)
-
 /*MMC SD*/
 #define CONFIG_SYS_MMC_MAX_DEVICE      3
 
 #define CONFIG_SYS_AUTOLOAD            "no"
 #endif
 
-/* Dynamic MTD partition support */
-#if defined(CONFIG_STM32_QSPI) || defined(CONFIG_NAND_STM32_FMC2)
-#define CONFIG_SYS_MTDPARTS_RUNTIME
-#endif
-
-#define CONFIG_SET_DFU_ALT_INFO
-
 #ifdef CONFIG_DM_VIDEO
 #define CONFIG_VIDEO_BMP_RLE8
 #define CONFIG_BMP_16BPP
index 4df2750a896c2dd3dc7da4056a0fa09cdf19b0d3..b5bfac77f1b1dc351391657e87c0827583a3aef7 100644 (file)
 #define CONFIG_SYS_SDRAM_BASE          0x40000000
 #define CONFIG_SYS_SDRAM_SIZE          128     /* SDRAM size in MB */
 
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE + 0x400)
-#define CONFIG_SYS_MEMTEST_END         ((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
 #define CONFIG_SYS_DRAM_TEST
 
 #if defined(CONFIG_CF_SBF)
index 06a86bbc2085cd9fbe784d96f3540b3ffa7e3ff1..d5f710be592f0f05289e8a1152aec86b99c0248d 100644 (file)
@@ -90,8 +90,6 @@
 /*
  * Memory test
  */
-#define CONFIG_SYS_MEMTEST_START       0x00001000 /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x07f00000
 
 /*
  * The reserved memory
index 81e1e49c928a8e1bc3ec44d31ed708c707591553..0058dcd4bba53e73bb661a8896480a631ceca17a 100644 (file)
@@ -35,9 +35,6 @@
 /* Command support defines */
 #define CONFIG_PHY_RESET_DELAY                 10000           /* in usec */
 
-#define CONFIG_SYS_MEMTEST_START               0x0000
-#define CONFIG_SYS_MEMTEST_END                 1024*1024
-
 /* Misc configuration */
 
 #define CONFIG_BOOTCOMMAND                     "go 0x40040000"
index 5d087caf31e47562fc4795f0822944ae082d2b24..976d527a08850438b4330292627bd610d6941c1f 100644 (file)
@@ -45,9 +45,6 @@
 #define CONFIG_ADDR_MAP
 #define CONFIG_SYS_NUM_ADDR_MAP                64      /* number of TLB1 entries */
 
-#define CONFIG_SYS_MEMTEST_START       0x00200000      /* memtest works on */
-#define CONFIG_SYS_MEMTEST_END         0x00400000
-
 /*
  *  Config the L3 Cache as L3 SRAM
  */
index a2bb1b55eb12ad4698bf84591ac64025c7575b62..c13e9979219a1355dc6a18983c4603694f4a4700 100644 (file)
@@ -81,9 +81,6 @@
 #define CONFIG_SYS_MAXARGS             32      /* max number of command */
                                                /* args */
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0)
-#define CONFIG_SYS_MEMTEST_END         (OMAP34XX_SDRC_CS0 + \
-                                       0x01F00000) /* 31MB */
 
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0) /* default load */
                                                                /* address */
index e95cd0087d3f49ca6f65bc315f57f75a08babeee..a283e1e029034c5bb6a1066a9cfb191dd7913b2a 100644 (file)
 
 /* turn on command-line edit/hist/auto */
 
-#define CONFIG_SYS_MEMTEST_START       (0x82000000)            /* memtest */
                                                                /* defaults */
-#define CONFIG_SYS_MEMTEST_END         (0x83FFFFFF)            /* 64MB */
-#define CONFIG_SYS_MEMTEST_SCRATCH     (0x81000000)    /* dummy address */
 
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0)     /* default */
                                                        /* load address */
index b598fca1ecb39b0461387159f72bf19274594c21..7376b91f550a8a30143ef456515956101f0c0bae 100644 (file)
 
 #define CONFIG_SYS_MALLOC_LEN          (128 * 1024 * 1024)
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END \
-       (CONFIG_SYS_MEMTEST_START + 500 * 1024 * 1024)
-
 #define CONFIG_SYS_BOOTMAPSZ           0x10000000
 
 /* Serial console */
index f2cdd9c0194047c7fb5b5ba895d54851e22724f0..175c55c61382f0805c2b38af406ee3577786cafa 100644 (file)
@@ -52,9 +52,6 @@
 /* Boot Argument Buffer Size */
 #define CONFIG_SYS_BARGSIZE            (CONFIG_SYS_CBSIZE)
 
-#define CONFIG_SYS_MEMTEST_START       (NV_PA_SDRC_CS0 + 0x600000)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x100000)
-
 /*-----------------------------------------------------------------------
  * Physical Memory Map
  */
index dac7e4ad9594b02f0d1307522c1b3e154e40b5eb..4d3c58d1e8f5d9125141e5452bcfb5d311187af2 100644 (file)
@@ -25,9 +25,6 @@
 /* Generic Timer Definitions */
 #define COUNTER_FREQUENCY              (0x1800000)     /* 24MHz */
 
-#define CONFIG_SYS_MEMTEST_START       MEM_BASE
-#define CONFIG_SYS_MEMTEST_END         (MEM_BASE + PHYS_SDRAM_1_SIZE)
-
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 1024 * 1024)
 
index cc32729496f82aa41b591288b7c04405cc853058..99ddc3e923c786421fe8117b0b2a699cc7513ecc 100644 (file)
 /* Console I/O Buffer Size */
 #define CONFIG_SYS_CBSIZE              512
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START \
-                                       + PHYS_DRAM_1_SIZE - (8 << 12))
-
 #define CONFIG_SYS_LOAD_ADDR           0x81000000      /* Default */
 
 /**
index d6ab5e4393ee0e39665ade101dba482bf5970e2a..ec316f325cfa6f1a54b60830993d50404261215e 100644 (file)
@@ -47,9 +47,6 @@
 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS   0
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + (500 << 20))
-
 #define CONFIG_HOSTNAME                        "titanium"
 #define CONFIG_UBI_PART                        ubi
 #define CONFIG_UBIFS_VOLUME            rootfs0
index 73fdfae4610c793e06486f910c970239e99caecf..0e4a824c4242ac269e4454d53cea4d57047c7904 100644 (file)
 /* FPGA commands that we don't use */
 
 /* Extras */
-#undef CONFIG_SYS_MEMTEST_START
-#define CONFIG_SYS_MEMTEST_START       0
-#undef CONFIG_SYS_MEMTEST_END
-#define CONFIG_SYS_MEMTEST_END 0x18000000
 
 /* Faster flash, ours may run at 108 MHz */
 #undef CONFIG_SPI_FLASH_WINBOND
index 8f13744c322faaeb0869670ad6676663207c9986..75e745806753ae50943e2b52bdf52ef4dc26c1fd 100644 (file)
@@ -51,8 +51,6 @@
 /*
  * Diagnostics
  */
-#define CONFIG_SYS_MEMTEST_START       0x80100000
-#define CONFIG_SYS_MEMTEST_END         0x83f00000
 
 #define CONFIG_CMD_MII
 
index 37fadc52102a2c90a70ed36d2e667f95d0f4c56f..f39a7c726a2b5baf380d82565caf7ad212d90a90 100644 (file)
@@ -27,8 +27,6 @@
 #define SDRAM_BANK_SIZE                        (256 << 20)     /* 256 MB */
 
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x5000000)
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x4800000)
 
 /* select serial console configuration */
index 8b71c2575735c68d1fcdabe1f018a246c2902000..f6593e227b9ecf5b9e7326f52ab9cfaa0bbd5eb1 100644 (file)
@@ -25,8 +25,6 @@
 #define PHYS_SDRAM_1                   CONFIG_SYS_SDRAM_BASE
 #define SDRAM_BANK_SIZE                        (256 << 20)     /* 256 MB */
 /* memtest works on */
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + 0x5E00000)
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + 0x3E00000)
 
 /* select serial console configuration */
index 1e4459747d5414a7ca7e4a385816c09f6530930e..83aa3cd468978adc1f5e482ca7c7a9f318368aef 100644 (file)
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_CBSIZE              512     /* Console I/O Buffer Size */
 
-#define CONFIG_SYS_MEMTEST_START       (OMAP34XX_SDRC_CS0 + 0x00000000)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                       0x07000000) /* 112 MB */
-
 #define CONFIG_SYS_LOAD_ADDR           (OMAP34XX_SDRC_CS0 + 0x02000000)
 
 /*
 #define CONFIG_SYS_SPL_MALLOC_START    0x80208000
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x100000        /* 1 MB */
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0x81000000
 #endif /* __CONFIG_H */
index e414f90fe1e4b0c6df00d92d9b55159c46af2079..49279fca4046a78337854b74210f2b06362b81eb 100644 (file)
  * Other required minimal configurations
  */
 #define CONFIG_SYS_LOAD_ADDR   0x00800000      /* default load adr- 8M */
-#define CONFIG_SYS_MEMTEST_START 0x00800000    /* 8M */
-#define CONFIG_SYS_MEMTEST_END 0x00ffffff      /*(_16M -1) */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000    /* Rst Vector Adr */
 #define CONFIG_SYS_MAXARGS     32      /* max number of command args */
 
-#define CONFIG_SYS_ALT_MEMTEST
-
 /* End of 16M scrubbed by training in bootrom */
 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_TEXT_BASE + 0xFF0000)
 
index bf9106e239fe223800e825e1d073c1a7ac246337..163cbbb54edd4abebdd04b3ddd4bf2367c6b67c0 100644 (file)
@@ -38,9 +38,6 @@
 #define CONFIG_ETHPRIME                 "FEC"
 #define CONFIG_FEC_MXC_PHYADDR          6
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
-
 /* MMC Configuration */
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
 
index f4a2837b3913a8b296803128c9d8d43b473a047c..4b3df0451a96d31376a9fc7983cbe51bc9d0eeed 100644 (file)
@@ -60,8 +60,6 @@
 #include <config_distro_bootcmd.h>
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x10000)
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index c0ba647d094fe10fcdc5ccde81def635f7ac0955..73bf2d19da6ffdc586cfc0452c3409b4412509d8 100644 (file)
@@ -73,9 +73,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR                   0x22000000
 
-#define CONFIG_SYS_MEMTEST_START               CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END                 0x23e00000
-
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_BOOTCOMMAND     "nboot 21000000 0"
 #define CONFIG_EXTRA_ENV_SETTINGS \
index 91c8b478b3af55441fb5e07f6ed946628826fe52..fcf5c67dc892bae63e205e23d7fa2855ba9b7462 100644 (file)
@@ -91,9 +91,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR \
        (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
-#define CONFIG_SYS_MEMTEST_START       0x70000000
-#define CONFIG_SYS_MEMTEST_END         0x90000000
-
 #define CONFIG_SYS_MALLOC_LEN          (10 * 1024 * 1024)
 
 #endif                         /* __CONFIG_H */
index 6a2f80c2fb42dd80c1cd96c83c4c629ded9124d7..d5b2a785bcf764de7022c82274911ccd44896174 100644 (file)
 
 #define CONFIG_CONS_INDEX              1
 
-#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_SDRAM_BASE + \
-                                        CONFIG_SYS_SDRAM_SIZE - SZ_4M)
-
 #define CONFIG_SYS_MONITOR_BASE         CONFIG_SYS_TEXT_BASE
 
 #define CONFIG_BOARD_EARLY_INIT_R
index 34726b942538ab98ddbb876aaf5a8ee8a870a885..bdacd81885351a4c799036dfe652f18475fcd898 100644 (file)
@@ -23,8 +23,6 @@
  * On-board devices
  *
  */
-#define CONFIG_SYS_MEMTEST_START       0x00001000
-#define CONFIG_SYS_MEMTEST_END         0x07000000
 
 /*
  * Device configurations
index 82bff3608c5bf1b40f794ffa34b34244ad831591..ca528598f2f16e253aa32a71b4bc76627f4d1047 100644 (file)
 #define PHYS_SDRAM                      0x40000000
 #define PHYS_SDRAM_SIZE                        SZ_2G /* 2GB DDR */
 
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + \
-                                        (PHYS_SDRAM_SIZE >> 1))
-
 /* UART */
 #define CONFIG_MXC_UART_BASE           UART1_BASE_ADDR
 
index 4f3a792f496f4520823ee0ce526a7c22367f28c3..09cdd3dab5b3b53ec42170e69c1246c513cdade3 100644 (file)
@@ -7,12 +7,6 @@
 #ifndef __VEXPRESS_AEMV8A_H
 #define __VEXPRESS_AEMV8A_H
 
-#ifdef CONFIG_TARGET_VEXPRESS64_BASE_FVP
-#ifndef CONFIG_SEMIHOSTING
-#error CONFIG_TARGET_VEXPRESS64_BASE_FVP requires CONFIG_SEMIHOSTING
-#endif
-#endif
-
 #define CONFIG_REMAKE_ELF
 
 /* Link Definitions */
 
 /* PL011 Serial Configuration */
 #ifdef CONFIG_TARGET_VEXPRESS64_JUNO
-#define CONFIG_PL011_CLOCK             7273800
+#define CONFIG_PL011_CLOCK             7372800
 #else
 #define CONFIG_PL011_CLOCK             24000000
 #endif
 #endif
 
 /* Enable memtest */
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM_1
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE)
 
 /* Initial environment variables */
 #ifdef CONFIG_TARGET_VEXPRESS64_JUNO
 #define CONFIG_EXTRA_ENV_SETTINGS      \
                                "kernel_name=norkern\0" \
                                "kernel_alt_name=Image\0"       \
-                               "kernel_addr=0x80080000\0" \
-                               "initrd_name=ramdisk.img\0"     \
-                               "initrd_addr=0x84000000\0"      \
+                               "kernel_addr_r=0x80080000\0" \
+                               "ramdisk_name=ramdisk.img\0"    \
+                               "ramdisk_addr_r=0x88000000\0"   \
                                "fdtfile=board.dtb\0" \
                                "fdt_alt_name=juno\0" \
-                               "fdt_addr=0x83000000\0" \
-                               "fdt_high=0xffffffffffffffff\0" \
-                               "initrd_high=0xffffffffffffffff\0" \
+                               "fdt_addr_r=0x80000000\0" \
 
 /* Copy the kernel and FDT to DRAM memory and boot */
-#define CONFIG_BOOTCOMMAND     "afs load ${kernel_name} ${kernel_addr} ; " \
+#define CONFIG_BOOTCOMMAND     "afs load ${kernel_name} ${kernel_addr_r} ;"\
                                "if test $? -eq 1; then "\
                                "  echo Loading ${kernel_alt_name} instead of "\
                                "${kernel_name}; "\
-                               "  afs load ${kernel_alt_name} ${kernel_addr};"\
+                               "  afs load ${kernel_alt_name} ${kernel_addr_r};"\
                                "fi ; "\
-                               "afs load  ${fdtfile} ${fdt_addr} ; " \
+                               "afs load ${fdtfile} ${fdt_addr_r} ;"\
                                "if test $? -eq 1; then "\
                                "  echo Loading ${fdt_alt_name} instead of "\
                                "${fdtfile}; "\
-                               "  afs load ${fdt_alt_name} ${fdt_addr}; "\
+                               "  afs load ${fdt_alt_name} ${fdt_addr_r}; "\
                                "fi ; "\
-                               "fdt addr ${fdt_addr}; fdt resize; " \
-                               "if afs load  ${initrd_name} ${initrd_addr} ; "\
+                               "fdt addr ${fdt_addr_r}; fdt resize; " \
+                               "if afs load  ${ramdisk_name} ${ramdisk_addr_r} ; "\
                                "then "\
-                               "  setenv initrd_param ${initrd_addr}; "\
-                               "  else setenv initrd_param -; "\
+                               "  setenv ramdisk_param ${ramdisk_addr_r}; "\
+                               "  else setenv ramdisk_param -; "\
                                "fi ; " \
-                               "booti ${kernel_addr} ${initrd_param} ${fdt_addr}"
+                               "booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}"
 
 
 #elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
 #define CONFIG_SYS_FLASH_CFI_WIDTH     FLASH_CFI_32BIT
 #define CONFIG_SYS_MAX_FLASH_BANKS     1
 
+#ifdef CONFIG_USB_EHCI_HCD
+#define CONFIG_USB_OHCI_NEW
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
+#endif
+
 #define CONFIG_SYS_FLASH_EMPTY_INFO    /* flinfo indicates empty blocks */
 #define FLASH_MAX_SECTOR_SIZE          0x00040000
 
index e73658a9e6e37b7dd422fd57a4d76a3a5dffbe08..ca765579e821d0463e2adfa96f5f8701bc1b0b54 100644 (file)
 #define SYS_ID                         V2M_SYSREGS
 #define CONFIG_REVISION_TAG            1
 
-#define CONFIG_SYS_MEMTEST_START       V2M_BASE
-#define CONFIG_SYS_MEMTEST_END         0x20000000
-
 #define CONFIG_CMDLINE_TAG             1       /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS       1
 #define CONFIG_SYS_L2CACHE_OFF         1
index d52a5a7e833ca799d3d5cc74e5d8a0c485deeb81..739219e8f8ba0a78e9d87634ae141733cf44a0fc 100644 (file)
 
 /* Miscellaneous configurable options */
 
-#define CONFIG_SYS_MEMTEST_START       0x80010000
-#define CONFIG_SYS_MEMTEST_END         0x87C00000
-
 /* Physical memory map */
 #define PHYS_SDRAM                     (0x80000000)
 #define PHYS_SDRAM_SIZE                        (128 * 1024 * 1024)
index 7120aa64df62eacbe3bf84e1be96282325255236..c4db6f4b3c1ace3832aee7eb6be0973755f42451 100644 (file)
@@ -26,8 +26,6 @@
 #include <config_distro_bootcmd.h>
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x10000)
 
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
index f40c9002e590efc9d085240a44eb661a5b9fe7bf..c11507e5502710c0e354405fac34eea7e6c4f151 100644 (file)
@@ -26,8 +26,6 @@
 #undef CONFIG_MPC83XX_PCI2             /* support for 2nd PCI controller */
 
 #undef CONFIG_SYS_DRAM_TEST                    /* memory test, takes time */
-#define CONFIG_SYS_MEMTEST_START       0x00000000      /* memtest region */
-#define CONFIG_SYS_MEMTEST_END         0x00100000
 
 /*
  * DDR Setup
index 8100e4dca7be099c2fc1e8cec80179f740fd8c11..5aa3ad8ddf21e3d12496dab72d13ca917c074889 100644 (file)
@@ -37,8 +37,6 @@
 #define CONFIG_CONS_INDEX              3
 
 /* RAM */
-#define CONFIG_SYS_MEMTEST_START       0x80100000
-#define CONFIG_SYS_MEMTEST_END         0x80400000
 
 /* Memory usage */
 #define CONFIG_SYS_MAXARGS             64
index a65d23bbe80a9af493075ae31e01b39bdf0992fb..9d2bd7b278283a70cf7e31dde86648fa53245995 100644 (file)
@@ -29,9 +29,6 @@
 #define CONFIG_LBA48
 #endif
 
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
-
 /* MMC Configuration */
 #define CONFIG_SYS_FSL_USDHC_NUM       2
 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
index 68361a6199ee4d29b0d0c1c2da819d4d09a6caf9..654f8349f4df6df0683efd7d4a4d88ce834f273b 100644 (file)
@@ -26,9 +26,6 @@
 
 /* Watchdog */
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + SZ_256M)
-
 /* Physical Memory Map */
 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
 
index 39c00480bd9813f9c75d756b371a0c6e88356a65..60a902b2c74735fb71e5ff45e06d7afb871a5ad2 100644 (file)
                   "fi; " \
           "fi"
 
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x20000000)
-
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
 
index 36060975c10eef002cbd10d649f071f1f49a731c..fea07056b06192d95bfd1d3fd915248d7dc1a1a8 100644 (file)
@@ -61,8 +61,6 @@
 
 /* System */
 #define CONFIG_SYS_LOAD_ADDR        0x22000000 /* load address */
-#define CONFIG_SYS_MEMTEST_START    CONFIG_SYS_SDRAM_BASE
-#define CONFIG_SYS_MEMTEST_END      0x23e00000
 
 #ifdef CONFIG_SYS_USE_NANDFLASH
 /* bootstrap + u-boot + env + linux in nandflash */
index ca1619f251166247bf5dbc67c552dbf8df3818b0..bb4deeac9b7dec1a37ced092d302ff8a24e09762 100644 (file)
@@ -44,9 +44,6 @@
     (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
 #endif
 
-#define CONFIG_SYS_MEMTEST_START    0x21000000
-#define CONFIG_SYS_MEMTEST_END      0x22000000
-
 /* NAND flash */
 #define CONFIG_SYS_MAX_NAND_DEVICE  1
 #define CONFIG_SYS_NAND_BASE        ATMEL_BASE_CS3
index 54d211ab664ece639a38739343d2428ec59c1e6a..421384d9ba5ee6f21c861afa160e783e8d6e02d2 100644 (file)
@@ -29,8 +29,6 @@
 #define CONFIG_SYS_MALLOC_LEN          SZ_1M
 #define CONFIG_SYS_SDRAM_BASE          EMC_DYCS0_BASE
 #define CONFIG_SYS_SDRAM_SIZE          SZ_128M
-#define CONFIG_SYS_MEMTEST_START       (CONFIG_SYS_SDRAM_BASE + SZ_32K)
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_TEXT_BASE - SZ_1M)
 
 #define CONFIG_SYS_LOAD_ADDR           (CONFIG_SYS_SDRAM_BASE + SZ_32K)
 
index 290e13de00757888d446953e196a80316c349534..9081f416605ef3492f9ef7ee39ec06b4718cc62a 100644 (file)
@@ -83,8 +83,6 @@
  */
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000    /* Rst Vector Adr */
 
-#define CONFIG_SYS_ALT_MEMTEST
-
 /* Keep device tree and initrd in low memory so the kernel can access them */
 #define CONFIG_EXTRA_ENV_SETTINGS      \
        "fdt_high=0x10000000\0"         \
index 8b6caae7be73190a6444db82996374be6eca94b1..0dd57227948b99a8f538025efc5f58c8a883ba62 100644 (file)
@@ -92,8 +92,6 @@
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
 
-#define CONFIG_SYS_MEMTEST_START               0x00800000
-#define CONFIG_SYS_MEMTEST_END                 0x04000000
 #define CONFIG_SYS_MALLOC_LEN                  (8 << 20)
 #define CONFIG_SYS_LOAD_ADDR                   0x00800000
 
index 329b270467e20c9264377044392edc56005fe304..016b797a534ecca7822f17705aa8b9aa8dba5e02 100644 (file)
@@ -61,8 +61,6 @@
  */
 #define CONFIG_SYS_CBSIZE                      512
 
-#define CONFIG_SYS_MEMTEST_START               0x00100000
-#define CONFIG_SYS_MEMTEST_END                 0x01000000
 #define CONFIG_SYS_LOAD_ADDR                   0x20000000
 
 /*-----------------------------------------------------------------------
index 0c259a181f1080eb084642684b7539e74ebfc076..da640d6f14dcb02462853794fe9372876f442f8d 100644 (file)
 #define GICD_BASE      0xF9000000
 #define GICR_BASE      0xF9080000
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0xfffc0000
-
-#define CONFIG_SYS_MEMTEST_START       0
-#define CONFIG_SYS_MEMTEST_END         1000
 
 #define CONFIG_SYS_INIT_SP_ADDR                CONFIG_SYS_TEXT_BASE
 
index ee305e0226b3e664e2a28db816aa4643af670cbd..ae7eca11553f6958446e2b2a553e7eba53181877 100644 (file)
@@ -10,7 +10,6 @@
 #ifndef __CONFIG_VERSAL_MINI_H
 #define __CONFIG_VERSAL_MINI_H
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0xfffc0000
 
 #define CONFIG_EXTRA_ENV_SETTINGS
 
index eddc2b4020068f0d9e1553b0d9962cfa2e6a8fbe..b744a91fa60fc173a98e70da8625e78cc1b62cda 100644 (file)
 #define GICD_BASE      0xF9010000
 #define GICC_BASE      0xF9020000
 
-#ifndef CONFIG_SYS_MEMTEST_SCRATCH
-# define CONFIG_SYS_MEMTEST_SCRATCH    0x10800000
-#endif
-
-#define CONFIG_SYS_MEMTEST_START       0
-#define CONFIG_SYS_MEMTEST_END         1000
-
 #define CONFIG_SYS_INIT_SP_ADDR                CONFIG_SYS_TEXT_BASE
 
 /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
index a6922896e0e12cb85d17e1ebdf5e9ed06c359411..3078b9c55b529507bd9a1b4e0264285aaa57e531 100644 (file)
@@ -10,7 +10,6 @@
 #ifndef __CONFIG_ZYNQMP_MINI_H
 #define __CONFIG_ZYNQMP_MINI_H
 
-#define CONFIG_SYS_MEMTEST_SCRATCH     0xfffc0000
 
 #define CONFIG_EXTRA_ENV_SETTINGS
 
index 155d7fe883f059bec431e4534400b7db63fbf97c..c6cf82e244553bef73eff15c861a813664269743 100644 (file)
@@ -37,9 +37,4 @@
 
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
-/* 0x0 - 0x40 is used for placing exception vectors */
-#define CONFIG_SYS_MEMTEST_START       0x40
-#define CONFIG_SYS_MEMTEST_END         0x100
-#define CONFIG_SYS_MEMTEST_SCRATCH     0
-
 #endif /* __CONFIG_ZYNQ_ZYNQMP_R5_H */
index 634ee42409936e2719c3f8ed00ce6b137d549294..6c9991fa039857af2ab7e3550e94624ad9d66f49 100644 (file)
@@ -76,8 +76,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 /*
  * Diagnostics
  */
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x20000000
 #define CONFIG_POST                    (CONFIG_SYS_POST_MEMORY |\
                                         CONFIG_SYS_POST_I2C)
 /* The XPedite5170 can host an XMC which has an EEPROM at address 0x50 */
index 0186aaa1027773f9c09c743c76b85775be1b3cd8..c9bd369029dd11e6e62656bc3c3c5c9187518433 100644 (file)
@@ -52,8 +52,6 @@
 /*
  * Diagnostics
  */
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x20000000
 #define CONFIG_POST                    (CONFIG_SYS_POST_MEMORY | \
                                         CONFIG_SYS_POST_I2C)
 #define I2C_ADDR_LIST                  {CONFIG_SYS_I2C_MAX1237_ADDR,   \
index 5e027bebcabe68c867a2701e31bb9836630e49e4..6d847cb79398a5d01d8dbeb39ce0f41b950d8feb 100644 (file)
@@ -67,8 +67,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 /*
  * Diagnostics
  */
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x20000000
 #define CONFIG_POST                    (CONFIG_SYS_POST_MEMORY | \
                                         CONFIG_SYS_POST_I2C)
 /* The XPedite5370 can host an XMC which has an EEPROM at address 0x50 */
index 611089cbb9359ee8c7c5ede510d2d6ac1d5dd1eb..106269bae08b3edf970075c85a513c7e48ac681c 100644 (file)
@@ -66,8 +66,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 /*
  * Diagnostics
  */
-#define CONFIG_SYS_MEMTEST_START       0x10000000
-#define CONFIG_SYS_MEMTEST_END         0x20000000
 #define CONFIG_POST                    (CONFIG_SYS_POST_MEMORY | \
                                         CONFIG_SYS_POST_I2C)
 #define I2C_ADDR_LIST                  {CONFIG_SYS_I2C_EEPROM_ADDR,    \
index 1bc46f6fb28eb286fbb7abd079c69b0e37e47087..ba7fc84bf2f00b6f806221185cb30830b6c66628 100644 (file)
@@ -31,8 +31,6 @@
 #define CONFIG_SYS_I2C_SPEED           100000
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_MEMTEST_START       0x80000000
-#define CONFIG_SYS_MEMTEST_END         (CONFIG_SYS_MEMTEST_START + 0x10000000)
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
 #define CONFIG_SYS_HZ                  1000
index 8b73900130d77f9e13ff77a3d2f47d0db8bb71a0..516a6089f6d8d668e499b279b56268acd3b41ce8 100644 (file)
@@ -71,8 +71,6 @@
 #define CONFIG_SYS_BOOTPARAMS_LEN      (64  << 10)
 
 /* Memory test is destructive so default must not overlap vectors or U-Boot*/
-#define CONFIG_SYS_MEMTEST_START       MEMADDR(0x01000000)
-#define CONFIG_SYS_MEMTEST_END         MEMADDR(0x02000000)
 
 /* Load address for stand-alone applications.
  * MEMADDR cannot be used here, because the definition needs to be
index a8c6f0be10d4856c8ce98b85cee1174546cd5e9e..e76c5cbe6b855553d7a3462821f3b04db117c81f 100644 (file)
@@ -91,9 +91,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR           CONFIG_SYS_SDRAM_BASE
 
-#define CONFIG_SYS_MEMTEST_START       (PHYS_SDRAM + (512*1024))
-#define CONFIG_SYS_MEMTEST_END         (PHYS_SDRAM + PHYS_SDRAM_SIZE)
-
 
 /*
  * Size of malloc() pool
index a93172b02cd6692315fc9349dd54965a6422cdab..9e83e177752502587a3e9809d4263fbad5e77a3f 100644 (file)
 #define CONFIG_SYS_MAXARGS             32 /* max number of command args */
 #define CONFIG_SYS_CBSIZE              2048 /* Console I/O Buffer Size */
 
-#define CONFIG_SYS_MEMTEST_START       0
-#define CONFIG_SYS_MEMTEST_END         0x1000
-
 #define CONFIG_SYS_INIT_RAM_ADDR       0xFFFF0000
 #define CONFIG_SYS_INIT_RAM_SIZE       0x2000
 #define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_INIT_RAM_ADDR + \
diff --git a/include/crypto/pkcs7_parser.h b/include/crypto/pkcs7_parser.h
new file mode 100644 (file)
index 0000000..b8234da
--- /dev/null
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* PKCS#7 crypto data parser internal definitions
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ */
+
+#ifndef _PKCS7_PARSER_H
+#define _PKCS7_PARSER_H
+
+#include <linux/oid_registry.h>
+#include <crypto/pkcs7.h>
+#include "x509_parser.h"
+
+#define kenter(FMT, ...) \
+       pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__)
+#define kleave(FMT, ...) \
+       pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
+
+struct pkcs7_signed_info {
+       struct pkcs7_signed_info *next;
+       struct x509_certificate *signer; /* Signing certificate (in msg->certs) */
+       unsigned        index;
+       bool            unsupported_crypto;     /* T if not usable due to missing crypto */
+       bool            blacklisted;
+
+       /* Message digest - the digest of the Content Data (or NULL) */
+       const void      *msgdigest;
+       unsigned        msgdigest_len;
+
+       /* Authenticated Attribute data (or NULL) */
+       unsigned        authattrs_len;
+       const void      *authattrs;
+       unsigned long   aa_set;
+#define        sinfo_has_content_type          0
+#define        sinfo_has_signing_time          1
+#define        sinfo_has_message_digest        2
+#define sinfo_has_smime_caps           3
+#define        sinfo_has_ms_opus_info          4
+#define        sinfo_has_ms_statement_type     5
+       time64_t        signing_time;
+
+       /* Message signature.
+        *
+        * This contains the generated digest of _either_ the Content Data or
+        * the Authenticated Attributes [RFC2315 9.3].  If the latter, one of
+        * the attributes contains the digest of the the Content Data within
+        * it.
+        *
+        * THis also contains the issuing cert serial number and issuer's name
+        * [PKCS#7 or CMS ver 1] or issuing cert's SKID [CMS ver 3].
+        */
+       struct public_key_signature *sig;
+};
+
+struct pkcs7_message {
+       struct x509_certificate *certs; /* Certificate list */
+       struct x509_certificate *crl;   /* Revocation list */
+       struct pkcs7_signed_info *signed_infos;
+       u8              version;        /* Version of cert (1 -> PKCS#7 or CMS; 3 -> CMS) */
+       bool            have_authattrs; /* T if have authattrs */
+
+       /* Content Data (or NULL) */
+       enum OID        data_type;      /* Type of Data */
+       size_t          data_len;       /* Length of Data */
+       size_t          data_hdrlen;    /* Length of Data ASN.1 header */
+       const void      *data;          /* Content Data (or 0) */
+};
+#endif /* _PKCS7_PARSER_H */
diff --git a/include/crypto/x509_parser.h b/include/crypto/x509_parser.h
new file mode 100644 (file)
index 0000000..4cbdc1d
--- /dev/null
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* X.509 certificate parser internal definitions
+ *
+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ */
+
+#ifndef _X509_PARSER_H
+#define _X509_PARSER_H
+
+#include <linux/time.h>
+#include <crypto/public_key.h>
+#include <keys/asymmetric-type.h>
+
+struct x509_certificate {
+       struct x509_certificate *next;
+       struct x509_certificate *signer;        /* Certificate that signed this one */
+       struct public_key *pub;                 /* Public key details */
+       struct public_key_signature *sig;       /* Signature parameters */
+       char            *issuer;                /* Name of certificate issuer */
+       char            *subject;               /* Name of certificate subject */
+       struct asymmetric_key_id *id;           /* Issuer + Serial number */
+       struct asymmetric_key_id *skid;         /* Subject + subjectKeyId (optional) */
+       time64_t        valid_from;
+       time64_t        valid_to;
+       const void      *tbs;                   /* Signed data */
+       unsigned        tbs_size;               /* Size of signed data */
+       unsigned        raw_sig_size;           /* Size of sigature */
+       const void      *raw_sig;               /* Signature data */
+       const void      *raw_serial;            /* Raw serial number in ASN.1 */
+       unsigned        raw_serial_size;
+       unsigned        raw_issuer_size;
+       const void      *raw_issuer;            /* Raw issuer name in ASN.1 */
+       const void      *raw_subject;           /* Raw subject name in ASN.1 */
+       unsigned        raw_subject_size;
+       unsigned        raw_skid_size;
+       const void      *raw_skid;              /* Raw subjectKeyId in ASN.1 */
+       unsigned        index;
+       bool            seen;                   /* Infinite recursion prevention */
+       bool            verified;
+       bool            self_signed;            /* T if self-signed (check unsupported_sig too) */
+       bool            unsupported_key;        /* T if key uses unsupported crypto */
+       bool            unsupported_sig;        /* T if signature uses unsupported crypto */
+       bool            blacklisted;
+};
+
+/*
+ * x509_cert_parser.c
+ */
+extern void x509_free_certificate(struct x509_certificate *cert);
+extern struct x509_certificate *x509_cert_parse(const void *data, size_t datalen);
+extern int x509_decode_time(time64_t *_t,  size_t hdrlen,
+                           unsigned char tag,
+                           const unsigned char *value, size_t vlen);
+
+/*
+ * x509_public_key.c
+ */
+extern int x509_get_sig_params(struct x509_certificate *cert);
+extern int x509_check_for_self_signed(struct x509_certificate *cert);
+#endif /* _X509_PARSER_H */
index 618fc10390e8407ec26792b87423b90e48dc8244..a0d3df77868434e7ae17df8a72ff5eee456a13fc 100644 (file)
@@ -879,6 +879,14 @@ ofnode ofnode_by_prop_value(ofnode from, const char *propname,
             ofnode_valid(node); \
             node = ofnode_next_subnode(node))
 
+/**
+ * ofnode_get_child_count() - get the child count of a ofnode
+ *
+ * @node: valid node to get its child count
+ * @return the number of subnodes
+ */
+int ofnode_get_child_count(ofnode parent);
+
 /**
  * ofnode_translate_address() - Translate a device-tree address
  *
index 03c15b85506b6d31c636d097ba0ea2c253442b18..b952551d5552dc04e097c230f5a42cb8a723e932 100644 (file)
@@ -669,6 +669,14 @@ u64 dev_translate_dma_address(const struct udevice *dev,
  */
 int dev_read_alias_highest_id(const char *stem);
 
+/**
+ * dev_get_child_count() - get the child count of a device
+ *
+ * @dev: device to use for interation (struct udevice *)
+ * @return the count of child subnode
+ */
+int dev_get_child_count(const struct udevice *dev);
+
 #else /* CONFIG_DM_DEV_READ_INLINE is enabled */
 
 static inline int dev_read_u32(const struct udevice *dev,
@@ -978,6 +986,11 @@ static inline int dev_read_alias_highest_id(const char *stem)
        return fdtdec_get_alias_highest_id(gd->fdt_blob, stem);
 }
 
+static inline int dev_get_child_count(const struct udevice *dev)
+{
+       return ofnode_get_child_count(dev_ofnode(dev));
+}
+
 #endif /* CONFIG_DM_DEV_READ_INLINE */
 
 /**
index cde61ed8830bbb6912125f649cdba01856fcd21b..555b4ff660ae6d3fa5b53bbf27d3b28a99d6a6c2 100644 (file)
@@ -1,6 +1,7 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
- * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ * Copyright (c) 2016 Rockchip Electronics Co. Ltd.
+ * Author: Elaine <zhangqing@rock-chips.com>
  */
 
 #ifndef _DT_BINDINGS_CLK_ROCKCHIP_RK3328_H
 #define SCLK_MAC2IO_EXT                102
 
 /* dclk gates */
-#define DCLK_LCDC              180
-#define DCLK_HDMIPHY           181
-#define HDMIPHY                        182
-#define USB480M                        183
-#define DCLK_LCDC_SRC          184
+#define DCLK_LCDC              120
+#define DCLK_HDMIPHY           121
+#define HDMIPHY                        122
+#define USB480M                        123
+#define DCLK_LCDC_SRC          124
 
 /* aclk gates */
-#define ACLK_AXISRAM           190
-#define ACLK_VOP_PRE           191
-#define ACLK_USB3OTG           192
-#define ACLK_RGA_PRE           193
-#define ACLK_DMAC              194
-#define ACLK_GPU               195
-#define ACLK_BUS_PRE           196
-#define ACLK_PERI_PRE          197
-#define ACLK_RKVDEC_PRE                198
-#define ACLK_RKVDEC            199
-#define ACLK_RKVENC            200
-#define ACLK_VPU_PRE           201
-#define ACLK_VIO_PRE           202
-#define ACLK_VPU               203
-#define ACLK_VIO               204
-#define ACLK_VOP               205
-#define ACLK_GMAC              206
-#define ACLK_H265              207
-#define ACLK_H264              208
-#define ACLK_MAC2PHY           209
-#define ACLK_MAC2IO            210
-#define ACLK_DCF               211
-#define ACLK_TSP               212
-#define ACLK_PERI              213
-#define ACLK_RGA               214
-#define ACLK_IEP               215
-#define ACLK_CIF               216
-#define ACLK_HDCP              217
+#define ACLK_AXISRAM           130
+#define ACLK_VOP_PRE           131
+#define ACLK_USB3OTG           132
+#define ACLK_RGA_PRE           133
+#define ACLK_DMAC              134
+#define ACLK_GPU               135
+#define ACLK_BUS_PRE           136
+#define ACLK_PERI_PRE          137
+#define ACLK_RKVDEC_PRE                138
+#define ACLK_RKVDEC            139
+#define ACLK_RKVENC            140
+#define ACLK_VPU_PRE           141
+#define ACLK_VIO_PRE           142
+#define ACLK_VPU               143
+#define ACLK_VIO               144
+#define ACLK_VOP               145
+#define ACLK_GMAC              146
+#define ACLK_H265              147
+#define ACLK_H264              148
+#define ACLK_MAC2PHY           149
+#define ACLK_MAC2IO            150
+#define ACLK_DCF               151
+#define ACLK_TSP               152
+#define ACLK_PERI              153
+#define ACLK_RGA               154
+#define ACLK_IEP               155
+#define ACLK_CIF               156
+#define ACLK_HDCP              157
 
 /* pclk gates */
-#define PCLK_GPIO0             300
-#define PCLK_GPIO1             301
-#define PCLK_GPIO2             302
-#define PCLK_GPIO3             303
-#define PCLK_GRF               304
-#define PCLK_I2C0              305
-#define PCLK_I2C1              306
-#define PCLK_I2C2              307
-#define PCLK_I2C3              308
-#define PCLK_SPI               309
-#define PCLK_UART0             310
-#define PCLK_UART1             311
-#define PCLK_UART2             312
-#define PCLK_TSADC             313
-#define PCLK_PWM               314
-#define PCLK_TIMER             315
-#define PCLK_BUS_PRE           316
-#define PCLK_PERI_PRE          317
-#define PCLK_HDMI_CTRL         318
-#define PCLK_HDMI_PHY          319
-#define PCLK_GMAC              320
-#define PCLK_H265              321
-#define PCLK_MAC2PHY           322
-#define PCLK_MAC2IO            323
-#define PCLK_USB3PHY_OTG       324
-#define PCLK_USB3PHY_PIPE      325
-#define PCLK_USB3_GRF          326
-#define PCLK_USB2_GRF          327
-#define PCLK_HDMIPHY           328
-#define PCLK_DDR               329
-#define PCLK_PERI              330
-#define PCLK_HDMI              331
-#define PCLK_HDCP              332
-#define PCLK_DCF               333
-#define PCLK_SARADC            334
+#define PCLK_GPIO0             200
+#define PCLK_GPIO1             201
+#define PCLK_GPIO2             202
+#define PCLK_GPIO3             203
+#define PCLK_GRF               204
+#define PCLK_I2C0              205
+#define PCLK_I2C1              206
+#define PCLK_I2C2              207
+#define PCLK_I2C3              208
+#define PCLK_SPI               209
+#define PCLK_UART0             210
+#define PCLK_UART1             211
+#define PCLK_UART2             212
+#define PCLK_TSADC             213
+#define PCLK_PWM               214
+#define PCLK_TIMER             215
+#define PCLK_BUS_PRE           216
+#define PCLK_PERI_PRE          217
+#define PCLK_HDMI_CTRL         218
+#define PCLK_HDMI_PHY          219
+#define PCLK_GMAC              220
+#define PCLK_H265              221
+#define PCLK_MAC2PHY           222
+#define PCLK_MAC2IO            223
+#define PCLK_USB3PHY_OTG       224
+#define PCLK_USB3PHY_PIPE      225
+#define PCLK_USB3_GRF          226
+#define PCLK_USB2_GRF          227
+#define PCLK_HDMIPHY           228
+#define PCLK_DDR               229
+#define PCLK_PERI              230
+#define PCLK_HDMI              231
+#define PCLK_HDCP              232
+#define PCLK_DCF               233
+#define PCLK_SARADC            234
+#define PCLK_ACODECPHY         235
+#define PCLK_WDT               236
 
 /* hclk gates */
-#define HCLK_PERI              408
-#define HCLK_TSP               409
-#define HCLK_GMAC              410
-#define HCLK_I2S0_8CH          411
-#define HCLK_I2S1_8CH          413
-#define HCLK_I2S2_2CH          413
-#define HCLK_SPDIF_8CH         414
-#define HCLK_VOP               415
-#define HCLK_NANDC             416
-#define HCLK_SDMMC             417
-#define HCLK_SDIO              418
-#define HCLK_EMMC              419
-#define HCLK_SDMMC_EXT         420
-#define HCLK_RKVDEC_PRE                421
-#define HCLK_RKVDEC            422
-#define HCLK_RKVENC            423
-#define HCLK_VPU_PRE           424
-#define HCLK_VIO_PRE           425
-#define HCLK_VPU               426
-#define HCLK_VIO               427
-#define HCLK_BUS_PRE           428
-#define HCLK_PERI_PRE          429
-#define HCLK_H264              430
-#define HCLK_CIF               431
-#define HCLK_OTG_PMU           432
-#define HCLK_OTG               433
-#define HCLK_HOST0             434
-#define HCLK_HOST0_ARB         435
-#define HCLK_CRYPTO_MST                436
-#define HCLK_CRYPTO_SLV                437
-#define HCLK_PDM               438
-#define HCLK_IEP               439
-#define HCLK_RGA               440
-#define HCLK_HDCP              441
+#define HCLK_PERI              308
+#define HCLK_TSP               309
+#define HCLK_GMAC              310
+#define HCLK_I2S0_8CH          311
+#define HCLK_I2S1_8CH          312
+#define HCLK_I2S2_2CH          313
+#define HCLK_SPDIF_8CH         314
+#define HCLK_VOP               315
+#define HCLK_NANDC             316
+#define HCLK_SDMMC             317
+#define HCLK_SDIO              318
+#define HCLK_EMMC              319
+#define HCLK_SDMMC_EXT         320
+#define HCLK_RKVDEC_PRE                321
+#define HCLK_RKVDEC            322
+#define HCLK_RKVENC            323
+#define HCLK_VPU_PRE           324
+#define HCLK_VIO_PRE           325
+#define HCLK_VPU               326
+#define HCLK_BUS_PRE           328
+#define HCLK_PERI_PRE          329
+#define HCLK_H264              330
+#define HCLK_CIF               331
+#define HCLK_OTG_PMU           332
+#define HCLK_OTG               333
+#define HCLK_HOST0             334
+#define HCLK_HOST0_ARB         335
+#define HCLK_CRYPTO_MST                336
+#define HCLK_CRYPTO_SLV                337
+#define HCLK_PDM               338
+#define HCLK_IEP               339
+#define HCLK_RGA               340
+#define HCLK_HDCP              341
 
 #define CLK_NR_CLKS            (HCLK_HDCP + 1)
 
-#define CLKGRF_NR_CLKS         (SCLK_MAC2PHY + 1)
-
 /* soft-reset indices */
 #define SRST_CORE0_PO          0
 #define SRST_CORE1_PO          1
diff --git a/include/dt-bindings/net/qca-ar803x.h b/include/dt-bindings/net/qca-ar803x.h
new file mode 100644 (file)
index 0000000..9c046c7
--- /dev/null
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Device Tree constants for the Qualcomm Atheros AR803x PHYs
+ */
+
+#ifndef _DT_BINDINGS_QCA_AR803X_H
+#define _DT_BINDINGS_QCA_AR803X_H
+
+#define AR803X_STRENGTH_FULL           0
+#define AR803X_STRENGTH_HALF           1
+#define AR803X_STRENGTH_QUARTER                2
+
+#endif
diff --git a/include/dt-bindings/power/rk3328-power.h b/include/dt-bindings/power/rk3328-power.h
new file mode 100644 (file)
index 0000000..02e3d7f
--- /dev/null
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __DT_BINDINGS_POWER_RK3328_POWER_H__
+#define __DT_BINDINGS_POWER_RK3328_POWER_H__
+
+/**
+ * RK3328 idle id Summary.
+ */
+#define RK3328_PD_CORE         0
+#define RK3328_PD_GPU          1
+#define RK3328_PD_BUS          2
+#define RK3328_PD_MSCH         3
+#define RK3328_PD_PERI         4
+#define RK3328_PD_VIDEO                5
+#define RK3328_PD_HEVC         6
+#define RK3328_PD_SYS          7
+#define RK3328_PD_VPU          8
+#define RK3328_PD_VIO          9
+
+#endif
index 3c9e204cf0705bfdd6aed4e8e2fbf765ce9e82e1..ce835fd1b2b11ec7fe018d9b2081ba8d8c04480a 100644 (file)
@@ -9,6 +9,7 @@
 #ifndef __DWC3_UBOOT_H_
 #define __DWC3_UBOOT_H_
 
+#include <generic-phy.h>
 #include <linux/usb/otg.h>
 #include <linux/usb/phy.h>
 
@@ -43,17 +44,15 @@ void dwc3_uboot_handle_interrupt(int index);
 
 struct phy;
 #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
-int dwc3_setup_phy(struct udevice *dev, struct phy **array, int *num_phys);
-int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys, int num_phys);
+int dwc3_setup_phy(struct udevice *dev, struct phy_bulk *phys);
+int dwc3_shutdown_phy(struct udevice *dev, struct phy_bulk *phys);
 #else
-static inline int dwc3_setup_phy(struct udevice *dev, struct phy **array,
-                                int *num_phys)
+static inline int dwc3_setup_phy(struct udevice *dev, struct phy_bulk *phys)
 {
        return -ENOTSUPP;
 }
 
-static inline int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys,
-                                   int num_phys)
+static inline int dwc3_shutdown_phy(struct udevice *dev, struct phy_bulk *phys)
 {
        return -ENOTSUPP;
 }
index 79118eb83ded490d6779cff6062347fa6f446268..6820844cea3ae2bdfbdba0e72f29bb168741235c 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef __EEPROM_LEGACY_H
 #define __EEPROM_LEGACY_H
 
-#ifdef CONFIG_CMD_EEPROM
+#if defined(CONFIG_CMD_EEPROM) || defined(CONFIG_ENV_IS_IN_EEPROM)
 void eeprom_init(int bus);
 int eeprom_read(uint dev_addr, uint offset, uchar *buffer, uint cnt);
 int eeprom_write(uint dev_addr, uint offset, uchar *buffer, uint cnt);
@@ -17,8 +17,8 @@ int eeprom_write(uint dev_addr, uint offset, uchar *buffer, uint cnt);
  * some macros here so we don't have to touch every one of those uses
  */
 #define eeprom_init(bus)
-#define eeprom_read(dev_addr, offset, buffer, cnt) ((void)-ENOSYS)
-#define eeprom_write(dev_addr, offset, buffer, cnt) ((void)-ENOSYS)
+#define eeprom_read(dev_addr, offset, buffer, cnt) (-ENOSYS)
+#define eeprom_write(dev_addr, offset, buffer, cnt) (-ENOSYS)
 #endif
 
 #if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR)
index f92bfe57e68474ef5660cb7036f4f1447e46c4dd..0e924ad1093c4a07fe7ba408ee6b71d8005932f4 100644 (file)
@@ -394,6 +394,8 @@ efi_status_t efi_disk_register(void);
 int efi_disk_create_partitions(efi_handle_t parent, struct blk_desc *desc,
                               const char *if_typename, int diskid,
                               const char *pdevname);
+/* Check if it is EFI system partition */
+bool efi_disk_is_system_part(efi_handle_t handle);
 /* Called by bootefi to make GOP (graphical) interface available */
 efi_status_t efi_gop_register(void);
 /* Called by bootefi to make the network interface available */
diff --git a/include/environment/distro/sf.h b/include/environment/distro/sf.h
new file mode 100644 (file)
index 0000000..e793be0
--- /dev/null
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2020 Amarula Solutions(India)
+ *
+ * SF distro configurations.
+ */
+
+#ifndef __DISTRO_SF_CONFIG_H
+#define __DISTRO_SF_CONFIG_H
+
+#if CONFIG_IS_ENABLED(CMD_SF)
+#define BOOTENV_SHARED_SF(devtypel)                            \
+       #devtypel "_boot="                                      \
+       "if " #devtypel " probe ${busnum}; then "               \
+               "devtype=" #devtypel "; "                       \
+               "run scan_sf_for_scripts; "                     \
+       "fi\0"
+#define BOOTENV_DEV_SF(devtypeu, devtypel, instance)           \
+       "bootcmd_" #devtypel #instance "="                      \
+               "busnum=" #instance "; "                        \
+               "run " #devtypel "_boot\0"
+#define BOOTENV_DEV_NAME_SF(devtypeu, devtypel, instance)      \
+       #devtypel #instance " "
+#else
+#define BOOTENV_SHARED_SF(devtypel)
+#define BOOTENV_DEV_SF \
+       BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF
+#define BOOTENV_DEV_NAME_SF \
+       BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF
+
+#endif /* CONFIG_CMD_SF */
+
+#define BOOTENV_SF \
+       BOOTENV_SHARED_SF(sf) \
+       "scan_sf_for_scripts="                                  \
+               "${devtype} read ${scriptaddr} "                \
+                       "${script_offset_f} ${script_size_f}; " \
+               "source ${scriptaddr}; "                        \
+               "echo SCRIPT FAILED: continuing...\0"
+
+#endif /* __DISTRO_SF_CONFIG_H */
index d4eba8243653e72d7d1a992e7d46405d6f4267d3..6e44cbdb562d7cabb8440547568fbecf52d4a1ea 100644 (file)
@@ -227,7 +227,8 @@ typedef enum qe_clock {
 
 /* Structure that defines QE firmware binary files.
  *
- * See doc/README.qe_firmware for a description of these fields.
+ * See Documentation/powerpc/qe_firmware.rst in the Linux kernel tree for
+ * a description of these fields.
  */
 struct qe_firmware {
        struct qe_header {
index 73537025c2c365a404fe95da0e929d83d1b9a816..55629ae0b41109a1d50f47c436a1c070d7691c04 100644 (file)
@@ -124,6 +124,23 @@ struct phy_ops {
        int     (*power_off)(struct phy *phy);
 };
 
+/**
+ * struct phy_bulk - A handle to (allowing control of) a bulk of phys.
+ *
+ * Consumers provide storage for the phy bulk. The content of the structure is
+ * managed solely by the phy API. A phy bulk struct is initialized
+ * by "get"ing the phy bulk struct.
+ * The phy bulk struct is passed to all other bulk phy APIs to apply
+ * the API to all the phy in the bulk struct.
+ *
+ * @phys: An array of phy handles.
+ * @count: The number of phy handles in the phys array.
+ */
+struct phy_bulk {
+       struct phy *phys;
+       unsigned int count;
+};
+
 #ifdef CONFIG_PHY
 
 /**
@@ -250,6 +267,55 @@ int generic_phy_get_by_node(ofnode node, int index, struct phy *phy);
 int generic_phy_get_by_name(struct udevice *user, const char *phy_name,
                            struct phy *phy);
 
+/**
+ * generic_phy_get_bulk - Get all phys of a device.
+ *
+ * This looks up and gets all phys of the consumer device; each device is
+ * assumed to have n phys associated with it somehow, and this function finds
+ * and gets all of them in a separate structure.
+ *
+ * @dev:       The consumer device.
+ * @bulk       A pointer to a phy bulk struct to initialize.
+ * @return 0 if OK, or a negative error code.
+ */
+int generic_phy_get_bulk(struct udevice *dev, struct phy_bulk *bulk);
+
+/**
+ * generic_phy_init_bulk() - Initialize all phys in a phy bulk struct.
+ *
+ * @bulk:      A phy bulk struct that was previously successfully requested
+ *             by generic_phy_get_bulk().
+ * @return 0 if OK, or negative error code.
+ */
+int generic_phy_init_bulk(struct phy_bulk *bulk);
+
+/**
+ * generic_phy_exit_bulk() - de-initialize all phys in a phy bulk struct.
+ *
+ * @bulk:      A phy bulk struct that was previously successfully requested
+ *             by generic_phy_get_bulk().
+ * @return 0 if OK, or negative error code.
+ */
+int generic_phy_exit_bulk(struct phy_bulk *bulk);
+
+/**
+ * generic_phy_power_on_bulk() - Power on all phys in a phy    bulk struct.
+ *
+ * @bulk:      A phy bulk struct that was previously successfully requested
+ *             by generic_phy_get_bulk().
+ * @return 0 if OK, or negative error code.
+ */
+int generic_phy_power_on_bulk(struct phy_bulk *bulk);
+
+/**
+ * generic_phy_power_off_bulk() - Power off all phys in a phy bulk struct.
+ *
+ * @bulk:      A phy bulk struct that was previously successfully requested
+ *             by generic_phy_get_bulk().
+ * @return 0 if OK, or negative error code.
+ */
+int generic_phy_power_off_bulk(struct phy_bulk *bulk);
+
 #else /* CONFIG_PHY */
 
 static inline int generic_phy_init(struct phy *phy)
@@ -289,6 +355,32 @@ static inline int generic_phy_get_by_name(struct udevice *user, const char *phy_
        return 0;
 }
 
+static inline int
+generic_phy_get_bulk(struct udevice *dev, struct phy_bulk *bulk)
+{
+       return 0;
+}
+
+static inline int generic_phy_init_bulk(struct phy_bulk *bulk)
+{
+       return 0;
+}
+
+static inline int generic_phy_exit_bulk(struct phy_bulk *bulk)
+{
+       return 0;
+}
+
+static inline int generic_phy_power_on_bulk(struct phy_bulk *bulk)
+{
+       return 0;
+}
+
+static inline int generic_phy_power_off_bulk(struct phy_bulk *bulk)
+{
+       return 0;
+}
+
 #endif /* CONFIG_PHY */
 
 /**
index ec144a08d8f822752556b484489a07b08771e0d4..233fdc341a782128d995616f197269497509e160 100644 (file)
@@ -22,6 +22,7 @@
 #define SNOR_MFR_INTEL         CFI_MFR_INTEL
 #define SNOR_MFR_ST            CFI_MFR_ST /* ST Micro <--> Micron */
 #define SNOR_MFR_MICRON                CFI_MFR_MICRON /* ST Micro <--> Micron */
+#define SNOR_MFR_ISSI          CFI_MFR_PMC
 #define SNOR_MFR_MACRONIX      CFI_MFR_MACRONIX
 #define SNOR_MFR_SPANSION      CFI_MFR_AMD
 #define SNOR_MFR_SST           CFI_MFR_SST
index be01e1e82e594f9ed74fd825702590258c92fba6..83eafb184e65c3b44b5d65d359ae2c46772dd908 100644 (file)
@@ -204,6 +204,7 @@ struct spinand_manufacturer {
 extern const struct spinand_manufacturer gigadevice_spinand_manufacturer;
 extern const struct spinand_manufacturer macronix_spinand_manufacturer;
 extern const struct spinand_manufacturer micron_spinand_manufacturer;
+extern const struct spinand_manufacturer toshiba_spinand_manufacturer;
 extern const struct spinand_manufacturer winbond_spinand_manufacturer;
 
 /**
index 2d227c20bd5da54ffc9b555b299d7d7bedc74b03..9ab9b21ebb933efbef7f76a56dcdb56d8112ac58 100644 (file)
@@ -9,6 +9,7 @@
 struct menu;
 
 struct menu *menu_create(char *title, int timeout, int prompt,
+                               void (*display_statusline)(struct menu *),
                                void (*item_data_print)(void *),
                                char *(*item_choice)(void *),
                                void *item_choice_data);
@@ -16,7 +17,6 @@ int menu_default_set(struct menu *m, char *item_key);
 int menu_get_choice(struct menu *m, void **choice);
 int menu_item_add(struct menu *m, char *item_key, void *item_data);
 int menu_destroy(struct menu *m);
-void menu_display_statusline(struct menu *m);
 int menu_default_choice(struct menu *m, void **choice);
 
 /**
index 68a3fceab663415ca4c51318cd4a92a54ae490ce..f2d21c45d0f3bd037543ce668db698ef74239dbc 100644 (file)
@@ -125,6 +125,7 @@ int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
 /*
  * Allow FEC to fine-tune MII configuration on boards which require this.
  */
+struct eth_device;
 int fecmxc_register_mii_postcall(struct eth_device *dev, int (*cb)(int));
 #endif
 
index 36814efa861355928efe1caf7915c5fd90c6cfa4..893f7bd73370efcfb6186b928a1d6f31e7b293b1 100644 (file)
 /**
  * enum spi_mem_data_dir - describes the direction of a SPI memory data
  *                        transfer from the controller perspective
+ * @SPI_MEM_NO_DATA: no data transferred
  * @SPI_MEM_DATA_IN: data coming from the SPI memory
  * @SPI_MEM_DATA_OUT: data sent the SPI memory
  */
 enum spi_mem_data_dir {
+       SPI_MEM_NO_DATA,
        SPI_MEM_DATA_IN,
        SPI_MEM_DATA_OUT,
 };
index 2a75211008323a833af62bfc315e13a6ad099a1d..029288de88069675c598a40c4a88d876d2897756 100644 (file)
@@ -41,7 +41,29 @@ struct unit_test {
        int flags;
 };
 
-/* Declare a new unit test */
+/**
+ * UNIT_TEST() - create linker generated list entry for unit a unit test
+ *
+ * The macro UNIT_TEST() is used to create a linker generated list entry. These
+ * list entries are enumerate tests that can be execute using the ut command.
+ * The list entries are used both by the implementation of the ut command as
+ * well as in a related Python test.
+ *
+ * For Python testing the subtests are collected in Python function
+ * generate_ut_subtest() by applying a regular expression to the lines of file
+ * u-boot.sym. The list entries have to follow strict naming conventions to be
+ * matched by the expression.
+ *
+ * Use UNIT_TEST(foo_test_bar, _flags, foo_test) for a test bar in test suite
+ * foo that can be executed via command 'ut foo bar' and is implemented in
+ * function foo_test_bar().
+ *
+ * @_name:     concatenation of name of the test suite, "_test_", and the name
+ *             of the test
+ * @_flags:    an integer field that can be evaluated by the test suite
+ *             implementation
+ * @_suite:    name of the test suite concatenated with "_test"
+ */
 #define UNIT_TEST(_name, _flags, _suite)                               \
        ll_entry_declare(struct unit_test, _name, _suite) = {           \
                .file = __FILE__,                                       \
index 60175044884937dc8e7ff4bd3b284d52bd54cebd..20e4a21066fbd008eb72bded60d16d20e5f35c93 100644 (file)
@@ -670,6 +670,9 @@ struct xhci_ep_ctx {
 /* deq bitmasks */
 #define EP_CTX_CYCLE_MASK              (1 << 0)
 
+/* reserved[0] bitmasks, MediaTek xHCI used */
+#define EP_BPKTS(p)    (((p) & 0x7f) << 0)
+#define EP_BBM(p)      (((p) & 0x1) << 11)
 
 /**
  * struct xhci_input_control_context
index f5dda1179f8aa957eceb53b1ca9b57be9a271565..0ee207b6b1c8cf0588fe606c694146eb697f08c1 100644 (file)
 #include <linux/err.h>
 #include <linux/oid_registry.h>
 #include <crypto/public_key.h>
+#ifdef __UBOOT__
+#include <crypto/pkcs7_parser.h>
+#else
 #include "pkcs7_parser.h"
+#endif
 #include "pkcs7.asn1.h"
 
 MODULE_DESCRIPTION("PKCS#7 parser");
diff --git a/lib/crypto/pkcs7_parser.h b/lib/crypto/pkcs7_parser.h
deleted file mode 100644 (file)
index 6565fdc..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/* PKCS#7 crypto data parser internal definitions
- *
- * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- */
-
-#include <linux/oid_registry.h>
-#include <crypto/pkcs7.h>
-#include "x509_parser.h"
-
-#define kenter(FMT, ...) \
-       pr_devel("==> %s("FMT")\n", __func__, ##__VA_ARGS__)
-#define kleave(FMT, ...) \
-       pr_devel("<== %s()"FMT"\n", __func__, ##__VA_ARGS__)
-
-struct pkcs7_signed_info {
-       struct pkcs7_signed_info *next;
-       struct x509_certificate *signer; /* Signing certificate (in msg->certs) */
-       unsigned        index;
-       bool            unsupported_crypto;     /* T if not usable due to missing crypto */
-       bool            blacklisted;
-
-       /* Message digest - the digest of the Content Data (or NULL) */
-       const void      *msgdigest;
-       unsigned        msgdigest_len;
-
-       /* Authenticated Attribute data (or NULL) */
-       unsigned        authattrs_len;
-       const void      *authattrs;
-       unsigned long   aa_set;
-#define        sinfo_has_content_type          0
-#define        sinfo_has_signing_time          1
-#define        sinfo_has_message_digest        2
-#define sinfo_has_smime_caps           3
-#define        sinfo_has_ms_opus_info          4
-#define        sinfo_has_ms_statement_type     5
-       time64_t        signing_time;
-
-       /* Message signature.
-        *
-        * This contains the generated digest of _either_ the Content Data or
-        * the Authenticated Attributes [RFC2315 9.3].  If the latter, one of
-        * the attributes contains the digest of the the Content Data within
-        * it.
-        *
-        * THis also contains the issuing cert serial number and issuer's name
-        * [PKCS#7 or CMS ver 1] or issuing cert's SKID [CMS ver 3].
-        */
-       struct public_key_signature *sig;
-};
-
-struct pkcs7_message {
-       struct x509_certificate *certs; /* Certificate list */
-       struct x509_certificate *crl;   /* Revocation list */
-       struct pkcs7_signed_info *signed_infos;
-       u8              version;        /* Version of cert (1 -> PKCS#7 or CMS; 3 -> CMS) */
-       bool            have_authattrs; /* T if have authattrs */
-
-       /* Content Data (or NULL) */
-       enum OID        data_type;      /* Type of Data */
-       size_t          data_len;       /* Length of Data */
-       size_t          data_hdrlen;    /* Length of Data ASN.1 header */
-       const void      *data;          /* Content Data (or 0) */
-};
index 4e41cffd2301dc1d906556b447e297fd51393dce..18f5407a076cdd48b35cb80a0dd7c830f7ef58e8 100644 (file)
 #include <linux/string.h>
 #endif
 #include <crypto/public_key.h>
+#ifdef __UBOOT__
+#include <crypto/x509_parser.h>
+#else
 #include "x509_parser.h"
+#endif
 #include "x509.asn1.h"
 #include "x509_akid.asn1.h"
 
diff --git a/lib/crypto/x509_parser.h b/lib/crypto/x509_parser.h
deleted file mode 100644 (file)
index c233f13..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/* X.509 certificate parser internal definitions
- *
- * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- */
-
-#include <linux/time.h>
-#include <crypto/public_key.h>
-#include <keys/asymmetric-type.h>
-
-struct x509_certificate {
-       struct x509_certificate *next;
-       struct x509_certificate *signer;        /* Certificate that signed this one */
-       struct public_key *pub;                 /* Public key details */
-       struct public_key_signature *sig;       /* Signature parameters */
-       char            *issuer;                /* Name of certificate issuer */
-       char            *subject;               /* Name of certificate subject */
-       struct asymmetric_key_id *id;           /* Issuer + Serial number */
-       struct asymmetric_key_id *skid;         /* Subject + subjectKeyId (optional) */
-       time64_t        valid_from;
-       time64_t        valid_to;
-       const void      *tbs;                   /* Signed data */
-       unsigned        tbs_size;               /* Size of signed data */
-       unsigned        raw_sig_size;           /* Size of sigature */
-       const void      *raw_sig;               /* Signature data */
-       const void      *raw_serial;            /* Raw serial number in ASN.1 */
-       unsigned        raw_serial_size;
-       unsigned        raw_issuer_size;
-       const void      *raw_issuer;            /* Raw issuer name in ASN.1 */
-       const void      *raw_subject;           /* Raw subject name in ASN.1 */
-       unsigned        raw_subject_size;
-       unsigned        raw_skid_size;
-       const void      *raw_skid;              /* Raw subjectKeyId in ASN.1 */
-       unsigned        index;
-       bool            seen;                   /* Infinite recursion prevention */
-       bool            verified;
-       bool            self_signed;            /* T if self-signed (check unsupported_sig too) */
-       bool            unsupported_key;        /* T if key uses unsupported crypto */
-       bool            unsupported_sig;        /* T if signature uses unsupported crypto */
-       bool            blacklisted;
-};
-
-/*
- * x509_cert_parser.c
- */
-extern void x509_free_certificate(struct x509_certificate *cert);
-extern struct x509_certificate *x509_cert_parse(const void *data, size_t datalen);
-extern int x509_decode_time(time64_t *_t,  size_t hdrlen,
-                           unsigned char tag,
-                           const unsigned char *value, size_t vlen);
-
-/*
- * x509_public_key.c
- */
-extern int x509_get_sig_params(struct x509_certificate *cert);
-extern int x509_check_for_self_signed(struct x509_certificate *cert);
index 676c0df17410740957b022e837402950bed36ff8..571af9a0adf9373fb9539a499c7c1841b1596ca6 100644 (file)
 #include <linux/module.h>
 #endif
 #include <linux/kernel.h>
-#ifndef __UBOOT__
+#ifdef __UBOOT__
+#include <crypto/x509_parser.h>
+#else
 #include <linux/slab.h>
 #include <keys/asymmetric-subtype.h>
 #include <keys/asymmetric-parser.h>
 #include <keys/system_keyring.h>
 #include <crypto/hash.h>
 #include "asymmetric_keys.h"
-#endif
 #include "x509_parser.h"
+#endif
 
 /*
  * Set up the signature parameters in an X.509 certificate.  This involves
index eff3c25ec30161feebe46966904bf164dc254330..84d61df55b93d89039e561ee4ec6734babf624db 100644 (file)
@@ -17,6 +17,7 @@ CFLAGS_REMOVE_helloworld.o := $(CFLAGS_NON_EFI)
 
 ifneq ($(CONFIG_CMD_BOOTEFI_HELLO_COMPILE),)
 always += helloworld.efi
+targets += helloworld.o
 endif
 
 obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
index 73f1fe75a8331ca52403fda0f35f75efe8d52b68..f9349484a66572f22c02f1eb113072f4505a62f4 100644 (file)
@@ -530,7 +530,7 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev)
 #ifdef CONFIG_SANDBOX
                case UCLASS_ROOT: {
                        /* stop traversing parents at this point: */
-                       struct efi_device_path_vendor *dp = buf;
+                       struct efi_device_path_vendor *dp;
                        struct blk_desc *desc = dev_get_uclass_platdata(dev);
 
                        dp_fill(buf, dev->parent);
index fd3df80b0b9627649cc47328cfcab91bad36a49d..0582e02158fc172179e0c407bccd505773d6c65f 100644 (file)
@@ -588,3 +588,32 @@ efi_status_t efi_disk_register(void)
 
        return EFI_SUCCESS;
 }
+
+/**
+ * efi_disk_is_system_part() - check if handle refers to an EFI system partition
+ *
+ * @handle:    handle of partition
+ *
+ * Return:     true if handle refers to an EFI system partition
+ */
+bool efi_disk_is_system_part(efi_handle_t handle)
+{
+       struct efi_handler *handler;
+       struct efi_disk_obj *diskobj;
+       disk_partition_t info;
+       efi_status_t ret;
+       int r;
+
+       /* check if this is a block device */
+       ret = efi_search_protocol(handle, &efi_block_io_guid, &handler);
+       if (ret != EFI_SUCCESS)
+               return false;
+
+       diskobj = container_of(handle, struct efi_disk_obj, header);
+
+       r = part_get_info(diskobj->desc, diskobj->part, &info);
+       if (r)
+               return false;
+
+       return !!(info.bootable & PART_EFI_SYSTEM_PARTITION);
+}
index 6c270ce94f445feb8a2f038f522773dc6e61544f..4e075ae416e66e8be2b0053f1807b60710751d58 100644 (file)
@@ -13,7 +13,8 @@
 #include <malloc.h>
 #include <pe.h>
 #include <sort.h>
-#include "../lib/crypto/pkcs7_parser.h"
+#include <crypto/pkcs7_parser.h>
+#include <linux/err.h>
 
 const efi_guid_t efi_global_variable_guid = EFI_GLOBAL_VARIABLE_GUID;
 const efi_guid_t efi_guid_device_path = EFI_DEVICE_PATH_PROTOCOL_GUID;
@@ -538,8 +539,9 @@ static bool efi_image_authenticate(void *efi, size_t efi_size)
                }
                msg = pkcs7_parse_message((void *)wincert + sizeof(*wincert),
                                          wincert->dwLength - sizeof(*wincert));
-               if (!msg) {
+               if (IS_ERR(msg)) {
                        debug("Parsing image's signature failed\n");
+                       msg = NULL;
                        goto err;
                }
 
index 1b648c84673aa1eba9f08a078d3d7a43a947011b..26a7423203626d429aabdb515849afb060ee72f9 100644 (file)
@@ -86,7 +86,7 @@ out:
 /**
  * efi_init_secure_boot - initialize secure boot state
  *
- * Return:     EFI_SUCCESS on success, status code (negative) on error
+ * Return:     status code
  */
 static efi_status_t efi_init_secure_boot(void)
 {
@@ -135,6 +135,11 @@ efi_status_t efi_init_obj_list(void)
        /* On ARM switch from EL3 or secure mode to EL2 or non-secure mode */
        switch_to_non_secure_mode();
 
+#ifdef CONFIG_PARTITIONS
+       ret = efi_disk_register();
+       if (ret != EFI_SUCCESS)
+               goto out;
+#endif
        /* Initialize variable services */
        ret = efi_init_variables();
        if (ret != EFI_SUCCESS)
@@ -183,11 +188,6 @@ efi_status_t efi_init_obj_list(void)
        ret = efi_console_register();
        if (ret != EFI_SUCCESS)
                goto out;
-#ifdef CONFIG_PARTITIONS
-       ret = efi_disk_register();
-       if (ret != EFI_SUCCESS)
-               goto out;
-#endif
 #if defined(CONFIG_LCD) || defined(CONFIG_DM_VIDEO)
        ret = efi_gop_register();
        if (ret != EFI_SUCCESS)
index 658e3547da379d7aefcf2019c3a96dd1806a7f0a..adcb8c9cca650f01796fe727520cfd148361dd3a 100644 (file)
 #include <image.h>
 #include <hexdump.h>
 #include <malloc.h>
+#include <crypto/pkcs7_parser.h>
 #include <linux/compat.h>
 #include <linux/oid_registry.h>
 #include <u-boot/rsa.h>
 #include <u-boot/sha256.h>
-#include "../lib/crypto/pkcs7_parser.h"
 
 const efi_guid_t efi_guid_image_security_database =
                EFI_IMAGE_SECURITY_DATABASE_GUID;
@@ -528,7 +528,7 @@ out:
  * pointed to by @regs. If @nocheck is false, overlapping among entries
  * will be checked first.
  *
- * Return:     0 on success, status code (negative) on error
+ * Return:     status code
  */
 efi_status_t efi_image_region_add(struct efi_image_regions *regs,
                                  const void *start, const void *end,
@@ -667,7 +667,7 @@ efi_sigstore_parse_siglist(struct efi_signature_list *esl)
        esd = (struct efi_signature_data *)
                        ((u8 *)esl + sizeof(*esl) + esl->signature_header_size);
 
-       while ((left > 0) && left >= esl->signature_size) {
+       while (left > 0) {
                /* Signature must exist if there is remaining data. */
                if (left < esl->signature_size) {
                        debug("Certificate is too small\n");
index 7df881a74b4496d24e44e930926c9d0e51ff4508..60c1201757842f59b07291cf130e07ebdc048902 100644 (file)
@@ -12,9 +12,9 @@
 #include <malloc.h>
 #include <rtc.h>
 #include <search.h>
+#include <crypto/pkcs7_parser.h>
 #include <linux/compat.h>
 #include <u-boot/crc.h>
-#include "../lib/crypto/pkcs7_parser.h"
 
 enum efi_secure_mode {
        EFI_MODE_SETUP,
@@ -30,6 +30,18 @@ static u8 efi_vendor_keys;
 
 #define READ_ONLY BIT(31)
 
+static efi_status_t efi_get_variable_common(u16 *variable_name,
+                                           const efi_guid_t *vendor,
+                                           u32 *attributes,
+                                           efi_uintn_t *data_size, void *data);
+
+static efi_status_t efi_set_variable_common(u16 *variable_name,
+                                           const efi_guid_t *vendor,
+                                           u32 attributes,
+                                           efi_uintn_t data_size,
+                                           const void *data,
+                                           bool ro_check);
+
 /*
  * Mapping between EFI variables and u-boot variables:
  *
@@ -169,176 +181,95 @@ static const char *parse_attr(const char *str, u32 *attrp, u64 *timep)
        return str;
 }
 
-static efi_status_t efi_set_variable_internal(u16 *variable_name,
-                                             const efi_guid_t *vendor,
-                                             u32 attributes,
-                                             efi_uintn_t data_size,
-                                             const void *data,
-                                             bool ro_check);
+/**
+ * efi_set_secure_state - modify secure boot state variables
+ * @sec_boot:          value of SecureBoot
+ * @setup_mode:                value of SetupMode
+ * @audit_mode:                value of AuditMode
+ * @deployed_mode:     value of DeployedMode
+ *
+ * Modify secure boot stat-related variables as indicated.
+ *
+ * Return:             status code
+ */
+static efi_status_t efi_set_secure_state(int sec_boot, int setup_mode,
+                                        int audit_mode, int deployed_mode)
+{
+       u32 attributes;
+       efi_status_t ret;
+
+       attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                    EFI_VARIABLE_RUNTIME_ACCESS |
+                    READ_ONLY;
+       ret = efi_set_variable_common(L"SecureBoot", &efi_global_variable_guid,
+                                     attributes, sizeof(sec_boot), &sec_boot,
+                                     false);
+       if (ret != EFI_SUCCESS)
+               goto err;
+
+       ret = efi_set_variable_common(L"SetupMode", &efi_global_variable_guid,
+                                     attributes, sizeof(setup_mode),
+                                     &setup_mode, false);
+       if (ret != EFI_SUCCESS)
+               goto err;
+
+       ret = efi_set_variable_common(L"AuditMode", &efi_global_variable_guid,
+                                     attributes, sizeof(audit_mode),
+                                     &audit_mode, false);
+       if (ret != EFI_SUCCESS)
+               goto err;
+
+       ret = efi_set_variable_common(L"DeployedMode",
+                                     &efi_global_variable_guid, attributes,
+                                     sizeof(deployed_mode), &deployed_mode,
+                                     false);
+err:
+       return ret;
+}
 
 /**
  * efi_transfer_secure_state - handle a secure boot state transition
  * @mode:      new state
  *
  * Depending on @mode, secure boot related variables are updated.
- * Those variables are *read-only* for users, efi_set_variable_internal()
+ * Those variables are *read-only* for users, efi_set_variable_common()
  * is called here.
  *
- * Return:     EFI_SUCCESS on success, status code (negative) on error
+ * Return:     status code
  */
 static efi_status_t efi_transfer_secure_state(enum efi_secure_mode mode)
 {
-       u32 attributes;
-       u8 val;
        efi_status_t ret;
 
-       debug("Secure state from %d to %d\n", efi_secure_mode, mode);
+       debug("Switching secure state from %d to %d\n", efi_secure_mode, mode);
 
-       attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                    EFI_VARIABLE_RUNTIME_ACCESS;
        if (mode == EFI_MODE_DEPLOYED) {
-               val = 1;
-               ret = efi_set_variable_internal(L"SecureBoot",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 0;
-               ret = efi_set_variable_internal(L"SetupMode",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 0;
-               ret = efi_set_variable_internal(L"AuditMode",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 1;
-               ret = efi_set_variable_internal(L"DeployedMode",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
+               ret = efi_set_secure_state(1, 0, 0, 1);
                if (ret != EFI_SUCCESS)
                        goto err;
 
                efi_secure_boot = true;
        } else if (mode == EFI_MODE_AUDIT) {
-               ret = efi_set_variable_internal(L"PK",
-                                               &efi_global_variable_guid,
-                                               attributes,
-                                               0, NULL,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 0;
-               ret = efi_set_variable_internal(L"SecureBoot",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
+               ret = efi_set_variable_common(L"PK", &efi_global_variable_guid,
+                                             EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                             EFI_VARIABLE_RUNTIME_ACCESS,
+                                             0, NULL, false);
                if (ret != EFI_SUCCESS)
                        goto err;
-               val = 1;
-               ret = efi_set_variable_internal(L"SetupMode",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 1;
-               ret = efi_set_variable_internal(L"AuditMode",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 0;
-               ret = efi_set_variable_internal(L"DeployedMode",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
+
+               ret = efi_set_secure_state(0, 1, 1, 0);
                if (ret != EFI_SUCCESS)
                        goto err;
 
                efi_secure_boot = true;
        } else if (mode == EFI_MODE_USER) {
-               val = 1;
-               ret = efi_set_variable_internal(L"SecureBoot",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 0;
-               ret = efi_set_variable_internal(L"SetupMode",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 0;
-               ret = efi_set_variable_internal(L"AuditMode",
-                                               &efi_global_variable_guid,
-                                               attributes,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 0;
-               ret = efi_set_variable_internal(L"DeployedMode",
-                                               &efi_global_variable_guid,
-                                               attributes,
-                                               sizeof(val), &val,
-                                               false);
+               ret = efi_set_secure_state(1, 0, 0, 0);
                if (ret != EFI_SUCCESS)
                        goto err;
 
                efi_secure_boot = true;
        } else if (mode == EFI_MODE_SETUP) {
-               val = 0;
-               ret = efi_set_variable_internal(L"SecureBoot",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 1;
-               ret = efi_set_variable_internal(L"SetupMode",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 0;
-               ret = efi_set_variable_internal(L"AuditMode",
-                                               &efi_global_variable_guid,
-                                               attributes,
-                                               sizeof(val), &val,
-                                               false);
-               if (ret != EFI_SUCCESS)
-                       goto err;
-               val = 0;
-               ret = efi_set_variable_internal(L"DeployedMode",
-                                               &efi_global_variable_guid,
-                                               attributes | READ_ONLY,
-                                               sizeof(val), &val,
-                                               false);
+               ret = efi_set_secure_state(0, 1, 0, 0);
                if (ret != EFI_SUCCESS)
                        goto err;
        } else {
@@ -358,7 +289,7 @@ err:
 /**
  * efi_init_secure_state - initialize secure boot state
  *
- * Return:     EFI_SUCCESS on success, status code (negative) on error
+ * Return:     status code
  */
 static efi_status_t efi_init_secure_state(void)
 {
@@ -374,8 +305,8 @@ static efi_status_t efi_init_secure_state(void)
         */
 
        size = 0;
-       ret = EFI_CALL(efi_get_variable(L"PK", &efi_global_variable_guid,
-                                       NULL, &size, NULL));
+       ret = efi_get_variable_common(L"PK", &efi_global_variable_guid,
+                                     NULL, &size, NULL);
        if (ret == EFI_BUFFER_TOO_SMALL) {
                if (IS_ENABLED(CONFIG_EFI_SECURE_BOOT))
                        mode = EFI_MODE_USER;
@@ -392,14 +323,13 @@ static efi_status_t efi_init_secure_state(void)
 
        ret = efi_transfer_secure_state(mode);
        if (ret == EFI_SUCCESS)
-               ret = efi_set_variable_internal(L"VendorKeys",
-                                               &efi_global_variable_guid,
-                                               EFI_VARIABLE_BOOTSERVICE_ACCESS
-                                                | EFI_VARIABLE_RUNTIME_ACCESS
-                                                | READ_ONLY,
-                                               sizeof(efi_vendor_keys),
-                                               &efi_vendor_keys,
-                                               false);
+               ret = efi_set_variable_common(L"VendorKeys",
+                                             &efi_global_variable_guid,
+                                             EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                             EFI_VARIABLE_RUNTIME_ACCESS |
+                                             READ_ONLY,
+                                             sizeof(efi_vendor_keys),
+                                             &efi_vendor_keys, false);
 
 err:
        return ret;
@@ -513,7 +443,7 @@ out:
  * attributes and signed time will also be returned in @env_attr and @time,
  * respectively.
  *
- * Return:     EFI_SUCCESS on success, status code (negative) on error
+ * Return:     status code
  */
 static efi_status_t efi_variable_authenticate(u16 *variable,
                                              const efi_guid_t *vendor,
@@ -594,9 +524,8 @@ static efi_status_t efi_variable_authenticate(u16 *variable,
        var_sig = efi_variable_parse_signature(auth->auth_info.cert_data,
                                               auth->auth_info.hdr.dwLength
                                                   - sizeof(auth->auth_info));
-       if (IS_ERR(var_sig)) {
+       if (!var_sig) {
                debug("Parsing variable's signature failed\n");
-               var_sig = NULL;
                goto err;
        }
 
@@ -662,12 +591,10 @@ static efi_status_t efi_variable_authenticate(u16 *variable,
 }
 #endif /* CONFIG_EFI_SECURE_BOOT */
 
-static
-efi_status_t EFIAPI efi_get_variable_common(u16 *variable_name,
+static efi_status_t efi_get_variable_common(u16 *variable_name,
                                            const efi_guid_t *vendor,
                                            u32 *attributes,
-                                           efi_uintn_t *data_size, void *data,
-                                           bool is_non_volatile)
+                                           efi_uintn_t *data_size, void *data)
 {
        char *native_name;
        efi_status_t ret;
@@ -750,27 +677,6 @@ out:
        return ret;
 }
 
-static
-efi_status_t EFIAPI efi_get_volatile_variable(u16 *variable_name,
-                                             const efi_guid_t *vendor,
-                                             u32 *attributes,
-                                             efi_uintn_t *data_size,
-                                             void *data)
-{
-       return efi_get_variable_common(variable_name, vendor, attributes,
-                                      data_size, data, false);
-}
-
-efi_status_t EFIAPI efi_get_nonvolatile_variable(u16 *variable_name,
-                                                const efi_guid_t *vendor,
-                                                u32 *attributes,
-                                                efi_uintn_t *data_size,
-                                                void *data)
-{
-       return efi_get_variable_common(variable_name, vendor, attributes,
-                                      data_size, data, true);
-}
-
 /**
  * efi_efi_get_variable() - retrieve value of a UEFI variable
  *
@@ -795,12 +701,8 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name,
        EFI_ENTRY("\"%ls\" %pUl %p %p %p", variable_name, vendor, attributes,
                  data_size, data);
 
-       ret = efi_get_volatile_variable(variable_name, vendor, attributes,
-                                       data_size, data);
-       if (ret == EFI_NOT_FOUND)
-               ret = efi_get_nonvolatile_variable(variable_name, vendor,
-                                                  attributes, data_size, data);
-
+       ret = efi_get_variable_common(variable_name, vendor, attributes,
+                                     data_size, data);
        return EFI_EXIT(ret);
 }
 
@@ -964,14 +866,12 @@ efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size,
        return EFI_EXIT(ret);
 }
 
-static
-efi_status_t EFIAPI efi_set_variable_common(u16 *variable_name,
+static efi_status_t efi_set_variable_common(u16 *variable_name,
                                            const efi_guid_t *vendor,
                                            u32 attributes,
                                            efi_uintn_t data_size,
                                            const void *data,
-                                           bool ro_check,
-                                           bool is_non_volatile)
+                                           bool ro_check)
 {
        char *native_name = NULL, *old_data = NULL, *val = NULL, *s;
        efi_uintn_t old_size;
@@ -996,16 +896,8 @@ efi_status_t EFIAPI efi_set_variable_common(u16 *variable_name,
        /* check if a variable exists */
        old_size = 0;
        attr = 0;
-       ret = EFI_CALL(efi_get_variable(variable_name, vendor, &attr,
-                                       &old_size, NULL));
-       if (ret == EFI_BUFFER_TOO_SMALL) {
-               if ((is_non_volatile && !(attr & EFI_VARIABLE_NON_VOLATILE)) ||
-                   (!is_non_volatile && (attr & EFI_VARIABLE_NON_VOLATILE))) {
-                       ret = EFI_INVALID_PARAMETER;
-                       goto err;
-               }
-       }
-
+       ret = efi_get_variable_common(variable_name, vendor, &attr,
+                                     &old_size, NULL);
        append = !!(attributes & EFI_VARIABLE_APPEND_WRITE);
        attributes &= ~(u32)EFI_VARIABLE_APPEND_WRITE;
        delete = !append && (!data_size || !attributes);
@@ -1092,11 +984,11 @@ efi_status_t EFIAPI efi_set_variable_common(u16 *variable_name,
        if (append) {
                old_data = malloc(old_size);
                if (!old_data) {
-                       return EFI_OUT_OF_RESOURCES;
+                       ret = EFI_OUT_OF_RESOURCES;
                        goto err;
                }
-               ret = EFI_CALL(efi_get_variable(variable_name, vendor,
-                                               &attr, &old_size, old_data));
+               ret = efi_get_variable_common(variable_name, vendor,
+                                             &attr, &old_size, old_data);
                if (ret != EFI_SUCCESS)
                        goto err;
        } else {
@@ -1179,7 +1071,7 @@ out:
                /* update VendorKeys */
                if (vendor_keys_modified & efi_vendor_keys) {
                        efi_vendor_keys = 0;
-                       ret = efi_set_variable_internal(
+                       ret = efi_set_variable_common(
                                                L"VendorKeys",
                                                &efi_global_variable_guid,
                                                EFI_VARIABLE_BOOTSERVICE_ACCESS
@@ -1201,54 +1093,6 @@ err:
        return ret;
 }
 
-static
-efi_status_t EFIAPI efi_set_volatile_variable(u16 *variable_name,
-                                             const efi_guid_t *vendor,
-                                             u32 attributes,
-                                             efi_uintn_t data_size,
-                                             const void *data,
-                                             bool ro_check)
-{
-       return efi_set_variable_common(variable_name, vendor, attributes,
-                                      data_size, data, ro_check, false);
-}
-
-efi_status_t EFIAPI efi_set_nonvolatile_variable(u16 *variable_name,
-                                                const efi_guid_t *vendor,
-                                                u32 attributes,
-                                                efi_uintn_t data_size,
-                                                const void *data,
-                                                bool ro_check)
-{
-       efi_status_t ret;
-
-       ret = efi_set_variable_common(variable_name, vendor, attributes,
-                                     data_size, data, ro_check, true);
-
-       return ret;
-}
-
-static efi_status_t efi_set_variable_internal(u16 *variable_name,
-                                             const efi_guid_t *vendor,
-                                             u32 attributes,
-                                             efi_uintn_t data_size,
-                                             const void *data,
-                                             bool ro_check)
-{
-       efi_status_t ret;
-
-       if (attributes & EFI_VARIABLE_NON_VOLATILE)
-               ret = efi_set_nonvolatile_variable(variable_name, vendor,
-                                                  attributes,
-                                                  data_size, data, ro_check);
-       else
-               ret = efi_set_volatile_variable(variable_name, vendor,
-                                               attributes, data_size, data,
-                                               ro_check);
-
-       return ret;
-}
-
 /**
  * efi_set_variable() - set value of a UEFI variable
  *
@@ -1274,9 +1118,9 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
        /* READ_ONLY bit is not part of API */
        attributes &= ~(u32)READ_ONLY;
 
-       return EFI_EXIT(efi_set_variable_internal(variable_name, vendor,
-                                                 attributes, data_size, data,
-                                                 true));
+       return EFI_EXIT(efi_set_variable_common(variable_name, vendor,
+                                               attributes, data_size, data,
+                                               true));
 }
 
 /**
index e71732dc6db93aa108a7372d281b7516311dc7bd..4d32a28006136d3a4ba364fe32aa78f596d991d0 100644 (file)
@@ -176,9 +176,9 @@ static int execute(void)
        /* Check memory reservation for the device tree */
        if (fdt_addr &&
            find_in_memory_map(map_size, memory_map, desc_size, fdt_addr,
-                              EFI_BOOT_SERVICES_DATA) != EFI_ST_SUCCESS) {
+                              EFI_ACPI_RECLAIM_MEMORY) != EFI_ST_SUCCESS) {
                efi_st_error
-                       ("Device tree not marked as boot services data\n");
+                       ("Device tree not marked as ACPI reclaim memory\n");
                return EFI_ST_FAILURE;
        }
        return EFI_ST_SUCCESS;
index 420ab2eba05ff1afbb5322bb390cebfd830c972e..62b2557cc288eb3ab11abebfdf0db3c67f8421bd 100644 (file)
@@ -262,8 +262,8 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,
        if (!prop->public_exponent)
                key.exponent = RSA_DEFAULT_PUBEXP;
        else
-               key.exponent =
-                       fdt64_to_cpu(*((uint64_t *)(prop->public_exponent)));
+               rsa_convert_big_endian((uint32_t *)&key.exponent,
+                                      prop->public_exponent, 2);
 
        if (!key.len || !prop->modulus || !prop->rr) {
                debug("%s: Missing RSA key info", __func__);
index 1138c7012aee50c4928f953c4d1d24852b659115..8fc7e48d9942178d07c4e3ef76283ad4011e04d9 100644 (file)
@@ -242,6 +242,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
                                goto abort;
                        case 'u':
                        case 'd':
+                       case 'i':
                                div = 1000000000;
                                if (islong) {
                                        num = va_arg(va, unsigned long);
@@ -251,7 +252,7 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
                                        num = va_arg(va, unsigned int);
                                }
 
-                               if (ch == 'd') {
+                               if (ch != 'u') {
                                        if (islong && (long)num < 0) {
                                                num = -(long)num;
                                                out(info, '-');
index 63fbadd757d1273bc3c2cea13d4ee262b11e9741..734001c952a175f63b9d4a616533dde4096f97eb 100644 (file)
@@ -418,6 +418,8 @@ $(obj)/efi_reloc.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_RELOC:.o=.c) $(recordmcoun
 $(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
        $(call cmd,efi_ld)
 
+targets += $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
+
 # ACPI
 # ---------------------------------------------------------------------------
 #
index 12a6698958e0b624fb8e9ef22de69e620c69657c..741e9545e9ca94674f0df4ac7358c04ca17c2f8c 100644 (file)
@@ -1292,8 +1292,6 @@ CONFIG_PCI_SYS_BUS
 CONFIG_PCI_SYS_PHYS
 CONFIG_PCI_SYS_SIZE
 CONFIG_PCNET
-CONFIG_PCNET_79C973
-CONFIG_PCNET_79C975
 CONFIG_PEN_ADDR_BIG_ENDIAN
 CONFIG_PERIF1_FREQ
 CONFIG_PERIF2_FREQ
@@ -1525,7 +1523,6 @@ CONFIG_SETUP_MEMORY_TAGS
 CONFIG_SET_BIST
 CONFIG_SET_BOOTARGS
 CONFIG_SET_DFU_ALT_BUF_LEN
-CONFIG_SET_DFU_ALT_INFO
 CONFIG_SFIO
 CONFIG_SF_DATAFLASH
 CONFIG_SGI_IP28
@@ -1770,7 +1767,6 @@ CONFIG_SYS_AMASK4
 CONFIG_SYS_AMASK5
 CONFIG_SYS_AMASK6
 CONFIG_SYS_AMASK7
-CONFIG_SYS_ARM_CACHE_WRITETHROUGH
 CONFIG_SYS_AT91_CPU_NAME
 CONFIG_SYS_AT91_MAIN_CLOCK
 CONFIG_SYS_AT91_PLLA
@@ -3079,9 +3075,6 @@ CONFIG_SYS_MECR_VAL
 CONFIG_SYS_MEMAC_LITTLE_ENDIAN
 CONFIG_SYS_MEMORY_BASE
 CONFIG_SYS_MEMORY_SIZE
-CONFIG_SYS_MEMTEST_END
-CONFIG_SYS_MEMTEST_SCRATCH
-CONFIG_SYS_MEMTEST_START
 CONFIG_SYS_MEM_MAP
 CONFIG_SYS_MEM_RESERVE_SECURE
 CONFIG_SYS_MEM_SIZE
@@ -3195,7 +3188,6 @@ CONFIG_SYS_MRAM_SIZE
 CONFIG_SYS_MSC0_VAL
 CONFIG_SYS_MSC1_VAL
 CONFIG_SYS_MSC2_VAL
-CONFIG_SYS_MTDPARTS_RUNTIME
 CONFIG_SYS_MX5_CLK32
 CONFIG_SYS_MX5_HCLK
 CONFIG_SYS_MX6_CLK32
@@ -4078,9 +4070,6 @@ CONFIG_TSECV2_1
 CONFIG_TSEC_TBI
 CONFIG_TSEC_TBICR_SETTINGS
 CONFIG_TULIP
-CONFIG_TULIP_FIX_DAVICOM
-CONFIG_TULIP_SELECT_MEDIA
-CONFIG_TULIP_USE_IO
 CONFIG_TWL6030_INPUT
 CONFIG_TWL6030_POWER
 CONFIG_TWR
index da86a9d69ccc7e0d67c23681c4c375464b3695ed..d1f2ce4d5c51ed1324d4ffec4482965d1ec3a3fa 100755 (executable)
@@ -35,7 +35,7 @@ cp ${env_obj_file_path} ${ENV_OBJ_FILE_COPY}
 ${OBJCOPY} -O binary -j ".rodata.default_environment" ${ENV_OBJ_FILE_COPY}
 
 # Replace default '\0' with '\n' and sort entries
-tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort -u
+tr '\0' '\n' < ${ENV_OBJ_FILE_COPY} | sort --field-separator== -k1,1 --stable
 
 rm ${ENV_OBJ_FILE_COPY}
 
index 1c49eaf38bff96f68e55e6ddccc55dd0bad1d725..07d5c7d7a6567b6541193170ec8c2c102c3aaada 100644 (file)
@@ -113,3 +113,24 @@ static int dm_test_ofnode_read_chosen(struct unit_test_state *uts)
        return 0;
 }
 DM_TEST(dm_test_ofnode_read_chosen, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+static int dm_test_ofnode_get_child_count(struct unit_test_state *uts)
+{
+       ofnode node, child_node;
+       u32 val;
+
+       node = ofnode_path("/i-test");
+       ut_assert(ofnode_valid(node));
+
+       val = ofnode_get_child_count(node);
+       ut_asserteq(3, val);
+
+       child_node = ofnode_first_subnode(node);
+       ut_assert(ofnode_valid(child_node));
+       val = ofnode_get_child_count(child_node);
+       ut_asserteq(0, val);
+
+       return 0;
+}
+DM_TEST(dm_test_ofnode_get_child_count,
+       DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
index 21d92194b976d43fedca7b007ef7cc3d80190443..92455d94affac090642f6a5f914b5a576f24c68b 100644 (file)
@@ -110,3 +110,36 @@ static int dm_test_phy_ops(struct unit_test_state *uts)
        return 0;
 }
 DM_TEST(dm_test_phy_ops, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+static int dm_test_phy_bulk(struct unit_test_state *uts)
+{
+       struct phy_bulk phys;
+       struct udevice *parent;
+
+       /* test normal operations */
+       ut_assertok(uclass_get_device_by_name(UCLASS_SIMPLE_BUS,
+                                             "gen_phy_user1", &parent));
+
+       ut_assertok(generic_phy_get_bulk(parent, &phys));
+       ut_asserteq(2, phys.count);
+
+       ut_asserteq(0, generic_phy_init_bulk(&phys));
+       ut_asserteq(0, generic_phy_power_on_bulk(&phys));
+       ut_asserteq(0, generic_phy_power_off_bulk(&phys));
+       ut_asserteq(0, generic_phy_exit_bulk(&phys));
+
+       /* has a known problem phy */
+       ut_assertok(uclass_get_device_by_name(UCLASS_SIMPLE_BUS,
+                                             "gen_phy_user", &parent));
+
+       ut_assertok(generic_phy_get_bulk(parent, &phys));
+       ut_asserteq(3, phys.count);
+
+       ut_asserteq(0, generic_phy_init_bulk(&phys));
+       ut_asserteq(-EIO, generic_phy_power_on_bulk(&phys));
+       ut_asserteq(-EIO, generic_phy_power_off_bulk(&phys));
+       ut_asserteq(0, generic_phy_exit_bulk(&phys));
+
+       return 0;
+}
+DM_TEST(dm_test_phy_bulk, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
index d2b3f67e68da211d2a5212738dc3bfbd2808b366..8661fdd30687e0d4fb226a24f33e338abab5d279 100644 (file)
 #include <test/ut.h>
 
 #ifdef CONFIG_PKCS7_MESSAGE_PARSER
-#include "../../lib/crypto/pkcs7_parser.h"
+#include <crypto/pkcs7_parser.h>
 #else
 #ifdef CONFIG_X509_CERTIFICATE_PARSER
-#include "../../lib/crypto/x509_parser.h"
+#include <crypto/x509_parser.h>
 #endif
 #endif
 
index 84619521c9148c8667ce851bcf142de4fc06efa3..c418ed07c9a2e5b51ecd961fc17704238146502b 100644 (file)
@@ -19,7 +19,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define BUFFSIZE 32
 
-static int nolog_test_log_err(struct unit_test_state *uts)
+static int log_test_nolog_err(struct unit_test_state *uts)
 {
        char buf[BUFFSIZE];
 
@@ -31,9 +31,9 @@ static int nolog_test_log_err(struct unit_test_state *uts)
        ut_assertok(ut_check_console_end(uts));
        return 0;
 }
-LOG_TEST(nolog_test_log_err);
+LOG_TEST(log_test_nolog_err);
 
-static int nolog_test_log_warning(struct unit_test_state *uts)
+static int log_test_nolog_warning(struct unit_test_state *uts)
 {
        char buf[BUFFSIZE];
 
@@ -45,9 +45,9 @@ static int nolog_test_log_warning(struct unit_test_state *uts)
        ut_assertok(ut_check_console_end(uts));
        return 0;
 }
-LOG_TEST(nolog_test_log_warning);
+LOG_TEST(log_test_nolog_warning);
 
-static int nolog_test_log_notice(struct unit_test_state *uts)
+static int log_test_nolog_notice(struct unit_test_state *uts)
 {
        char buf[BUFFSIZE];
 
@@ -59,9 +59,9 @@ static int nolog_test_log_notice(struct unit_test_state *uts)
        ut_assertok(ut_check_console_end(uts));
        return 0;
 }
-LOG_TEST(nolog_test_log_notice);
+LOG_TEST(log_test_nolog_notice);
 
-static int nolog_test_log_info(struct unit_test_state *uts)
+static int log_test_nolog_info(struct unit_test_state *uts)
 {
        char buf[BUFFSIZE];
 
@@ -73,7 +73,7 @@ static int nolog_test_log_info(struct unit_test_state *uts)
        ut_assertok(ut_check_console_end(uts));
        return 0;
 }
-LOG_TEST(nolog_test_log_info);
+LOG_TEST(log_test_nolog_info);
 
 #undef _DEBUG
 #define _DEBUG 0
@@ -90,7 +90,7 @@ static int nolog_test_nodebug(struct unit_test_state *uts)
 }
 LOG_TEST(nolog_test_nodebug);
 
-static int nolog_test_log_nodebug(struct unit_test_state *uts)
+static int log_test_nolog_nodebug(struct unit_test_state *uts)
 {
        char buf[BUFFSIZE];
 
@@ -102,7 +102,7 @@ static int nolog_test_log_nodebug(struct unit_test_state *uts)
        ut_assertok(ut_check_console_end(uts));
        return 0;
 }
-LOG_TEST(nolog_test_log_nodebug);
+LOG_TEST(log_test_nolog_nodebug);
 
 #undef _DEBUG
 #define _DEBUG 1
@@ -120,7 +120,7 @@ static int nolog_test_debug(struct unit_test_state *uts)
 }
 LOG_TEST(nolog_test_debug);
 
-static int nolog_test_log_debug(struct unit_test_state *uts)
+static int log_test_nolog_debug(struct unit_test_state *uts)
 {
        char buf[BUFFSIZE];
 
@@ -132,4 +132,4 @@ static int nolog_test_log_debug(struct unit_test_state *uts)
        ut_assertok(ut_check_console_end(uts));
        return 0;
 }
-LOG_TEST(nolog_test_log_debug);
+LOG_TEST(log_test_nolog_debug);
index 6ca5760eac3ae29b5d38511ed29270518cbc14ab..26536ebca79d35bba8af7d9c08a245122b53a004 100644 (file)
@@ -92,12 +92,12 @@ static int sb_log_tx_handler(struct udevice *dev, void *packet,
 }
 
 /**
- * syslog_test_log_err() - test log_err() function
+ * log_test_syslog_err() - test log_err() function
  *
  * @uts:       unit test state
  * Return:     0 = success
  */
-static int syslog_test_log_err(struct unit_test_state *uts)
+static int log_test_syslog_err(struct unit_test_state *uts)
 {
        int old_log_level = gd->default_log_level;
        struct sb_log_env env;
@@ -106,7 +106,7 @@ static int syslog_test_log_err(struct unit_test_state *uts)
        gd->default_log_level = LOGL_INFO;
        env_set("ethact", "eth@10002000");
        env_set("log_hostname", "sandbox");
-       env.expected = "<3>sandbox uboot: syslog_test_log_err() "
+       env.expected = "<3>sandbox uboot: log_test_syslog_err() "
                       "testing log_err\n";
        env.uts = uts;
        sandbox_eth_set_tx_handler(0, sb_log_tx_handler);
@@ -119,15 +119,15 @@ static int syslog_test_log_err(struct unit_test_state *uts)
 
        return 0;
 }
-LOG_TEST(syslog_test_log_err);
+LOG_TEST(log_test_syslog_err);
 
 /**
- * syslog_test_log_warning() - test log_warning() function
+ * log_test_syslog_warning() - test log_warning() function
  *
  * @uts:       unit test state
  * Return:     0 = success
  */
-static int syslog_test_log_warning(struct unit_test_state *uts)
+static int log_test_syslog_warning(struct unit_test_state *uts)
 {
        int old_log_level = gd->default_log_level;
        struct sb_log_env env;
@@ -136,7 +136,7 @@ static int syslog_test_log_warning(struct unit_test_state *uts)
        gd->default_log_level = LOGL_INFO;
        env_set("ethact", "eth@10002000");
        env_set("log_hostname", "sandbox");
-       env.expected = "<4>sandbox uboot: syslog_test_log_warning() "
+       env.expected = "<4>sandbox uboot: log_test_syslog_warning() "
                       "testing log_warning\n";
        env.uts = uts;
        sandbox_eth_set_tx_handler(0, sb_log_tx_handler);
@@ -150,15 +150,15 @@ static int syslog_test_log_warning(struct unit_test_state *uts)
 
        return 0;
 }
-LOG_TEST(syslog_test_log_warning);
+LOG_TEST(log_test_syslog_warning);
 
 /**
- * syslog_test_log_notice() - test log_notice() function
+ * log_test_syslog_notice() - test log_notice() function
  *
  * @uts:       unit test state
  * Return:     0 = success
  */
-static int syslog_test_log_notice(struct unit_test_state *uts)
+static int log_test_syslog_notice(struct unit_test_state *uts)
 {
        int old_log_level = gd->default_log_level;
        struct sb_log_env env;
@@ -167,7 +167,7 @@ static int syslog_test_log_notice(struct unit_test_state *uts)
        gd->default_log_level = LOGL_INFO;
        env_set("ethact", "eth@10002000");
        env_set("log_hostname", "sandbox");
-       env.expected = "<5>sandbox uboot: syslog_test_log_notice() "
+       env.expected = "<5>sandbox uboot: log_test_syslog_notice() "
                       "testing log_notice\n";
        env.uts = uts;
        sandbox_eth_set_tx_handler(0, sb_log_tx_handler);
@@ -181,15 +181,15 @@ static int syslog_test_log_notice(struct unit_test_state *uts)
 
        return 0;
 }
-LOG_TEST(syslog_test_log_notice);
+LOG_TEST(log_test_syslog_notice);
 
 /**
- * syslog_test_log_info() - test log_info() function
+ * log_test_syslog_info() - test log_info() function
  *
  * @uts:       unit test state
  * Return:     0 = success
  */
-static int syslog_test_log_info(struct unit_test_state *uts)
+static int log_test_syslog_info(struct unit_test_state *uts)
 {
        int old_log_level = gd->default_log_level;
        struct sb_log_env env;
@@ -198,7 +198,7 @@ static int syslog_test_log_info(struct unit_test_state *uts)
        gd->default_log_level = LOGL_INFO;
        env_set("ethact", "eth@10002000");
        env_set("log_hostname", "sandbox");
-       env.expected = "<6>sandbox uboot: syslog_test_log_info() "
+       env.expected = "<6>sandbox uboot: log_test_syslog_info() "
                       "testing log_info\n";
        env.uts = uts;
        sandbox_eth_set_tx_handler(0, sb_log_tx_handler);
@@ -212,15 +212,15 @@ static int syslog_test_log_info(struct unit_test_state *uts)
 
        return 0;
 }
-LOG_TEST(syslog_test_log_info);
+LOG_TEST(log_test_syslog_info);
 
 /**
- * syslog_test_log_debug() - test log_debug() function
+ * log_test_syslog_debug() - test log_debug() function
  *
  * @uts:       unit test state
  * Return:     0 = success
  */
-static int syslog_test_log_debug(struct unit_test_state *uts)
+static int log_test_syslog_debug(struct unit_test_state *uts)
 {
        int old_log_level = gd->default_log_level;
        struct sb_log_env env;
@@ -229,7 +229,7 @@ static int syslog_test_log_debug(struct unit_test_state *uts)
        gd->default_log_level = LOGL_DEBUG;
        env_set("ethact", "eth@10002000");
        env_set("log_hostname", "sandbox");
-       env.expected = "<7>sandbox uboot: syslog_test_log_debug() "
+       env.expected = "<7>sandbox uboot: log_test_syslog_debug() "
                       "testing log_debug\n";
        env.uts = uts;
        sandbox_eth_set_tx_handler(0, sb_log_tx_handler);
@@ -243,10 +243,10 @@ static int syslog_test_log_debug(struct unit_test_state *uts)
 
        return 0;
 }
-LOG_TEST(syslog_test_log_debug);
+LOG_TEST(log_test_syslog_debug);
 
 /**
- * syslog_test_log_nodebug() - test logging level filter
+ * log_test_syslog_nodebug() - test logging level filter
  *
  * Verify that log_debug() does not lead to a log message if the logging level
  * is set to LOGL_INFO.
@@ -254,7 +254,7 @@ LOG_TEST(syslog_test_log_debug);
  * @uts:       unit test state
  * Return:     0 = success
  */
-static int syslog_test_log_nodebug(struct unit_test_state *uts)
+static int log_test_syslog_nodebug(struct unit_test_state *uts)
 {
        int old_log_level = gd->default_log_level;
        struct sb_log_env env;
@@ -263,7 +263,7 @@ static int syslog_test_log_nodebug(struct unit_test_state *uts)
        gd->default_log_level = LOGL_INFO;
        env_set("ethact", "eth@10002000");
        env_set("log_hostname", "sandbox");
-       env.expected = "<7>sandbox uboot: syslog_test_log_nodebug() "
+       env.expected = "<7>sandbox uboot: log_test_syslog_nodebug() "
                       "testing log_debug\n";
        env.uts = uts;
        sandbox_eth_set_tx_handler(0, sb_log_tx_handler);
@@ -277,4 +277,4 @@ static int syslog_test_log_nodebug(struct unit_test_state *uts)
 
        return 0;
 }
-LOG_TEST(syslog_test_log_nodebug);
+LOG_TEST(log_test_syslog_nodebug);
index 55dcaa95f1eacb1ae5232a256e3c064ce9cfd275..9912694a3e3d317bd3b9f09bff88b75a829135fd 100644 (file)
@@ -133,7 +133,7 @@ class TestEfiAuthVar(object):
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
                 'fatload host 0:1 4000000 PK.auth',
-                'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+                'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK; echo',
                 'fatload host 0:1 4000000 KEK.auth',
                 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
                 'fatload host 0:1 4000000 db.auth',
@@ -174,7 +174,7 @@ class TestEfiAuthVar(object):
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
                 'fatload host 0:1 4000000 PK.auth',
-                'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+                'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK; echo',
                 'fatload host 0:1 4000000 KEK.auth',
                 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
                 'fatload host 0:1 4000000 db.auth',
@@ -215,7 +215,7 @@ class TestEfiAuthVar(object):
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
                 'fatload host 0:1 4000000 PK.auth',
-                'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+                'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK; echo',
                 'fatload host 0:1 4000000 KEK.auth',
                 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
                 'fatload host 0:1 4000000 db.auth',
@@ -249,7 +249,7 @@ class TestEfiAuthVar(object):
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
                 'fatload host 0:1 4000000 PK.auth',
-                'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK',
+                'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK; echo',
                 'fatload host 0:1 4000000 KEK.auth',
                 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
                 'fatload host 0:1 4000000 db.auth',
index 584282b338bc927986dbf7046d7b66b80fa9e545..fc722ab506c9a944c18c8368280c682126594961 100644 (file)
@@ -29,7 +29,7 @@ class TestEfiSignedImage(object):
             # Test Case 1a, run signed image if no db/dbx
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
-                'efidebug boot add 1 HELLO1 host 0:1 /helloworld.efi.signed ""',
+                'efidebug boot add 1 HELLO1 host 0:1 /helloworld.efi.signed ""; echo',
                 'efidebug boot next 1',
                 'bootefi bootmgr'])
             assert(re.search('Hello, world!', ''.join(output)))
@@ -81,7 +81,7 @@ class TestEfiSignedImage(object):
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
                 'fatload host 0:1 4000000 db.auth',
-                'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx',
+                'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx; echo',
                 'fatload host 0:1 4000000 KEK.auth',
                 'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
                 'fatload host 0:1 4000000 PK.auth',
index 22d849afb89badfc859a1c55f8a6820b0affa304..a4af845c514e54baebfbfa83def099686177beaf 100644 (file)
@@ -30,7 +30,7 @@ class TestEfiUnsignedImage(object):
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
                'fatload host 0:1 4000000 KEK.auth',
-               'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
+               'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK; echo',
                'fatload host 0:1 4000000 PK.auth',
                'setenv -e -nv -bs -rt -at -i 4000000,$filesize PK'])
             assert(not re.search('Failed to set EFI variable', ''.join(output)))
@@ -58,7 +58,7 @@ class TestEfiUnsignedImage(object):
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
                'fatload host 0:1 4000000 db_hello.auth',
-               'setenv -e -nv -bs -rt -at -i 4000000,$filesize db',
+               'setenv -e -nv -bs -rt -at -i 4000000,$filesize db; echo',
                'fatload host 0:1 4000000 KEK.auth',
                'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
                'fatload host 0:1 4000000 PK.auth',
@@ -82,7 +82,7 @@ class TestEfiUnsignedImage(object):
             output = u_boot_console.run_command_list([
                 'host bind 0 %s' % disk_img,
                'fatload host 0:1 4000000 db_hello.auth',
-               'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx',
+               'setenv -e -nv -bs -rt -at -i 4000000,$filesize dbx; echo',
                'fatload host 0:1 4000000 KEK.auth',
                'setenv -e -nv -bs -rt -at -i 4000000,$filesize KEK',
                'fatload host 0:1 4000000 PK.auth',
index 6c7b8dd2b30edac62e8c218e7ad5185010d6f0ad..01c2b3ffa121761adbac09e6a8f874ff52374cba 100644 (file)
@@ -22,7 +22,22 @@ def test_ut_dm_init(u_boot_console):
             fh.write(data)
 
 def test_ut(u_boot_console, ut_subtest):
-    """Execute a "ut" subtest."""
+    """Execute a "ut" subtest.
+
+    The subtests are collected in function generate_ut_subtest() from linker
+    generated lists by applying a regular expression to the lines of file
+    u-boot.sym. The list entries are created using the C macro UNIT_TEST().
+
+    Strict naming conventions have to be followed to match the regular
+    expression. Use UNIT_TEST(foo_test_bar, _flags, foo_test) for a test bar in
+    test suite foo that can be executed via command 'ut foo bar' and is
+    implemented in C function foo_test_bar().
+
+    Args:
+        u_boot_console (ConsoleBase): U-Boot console
+        ut_subtest (str): test to be executed via command ut, e.g 'foo bar' to
+            execute command 'ut foo bar'
+    """
 
     output = u_boot_console.run_command('ut ' + ut_subtest)
     assert output.endswith('Failures: 0')
index e67f2b3d0f609c148da75a52627c4518a61c7ae2..6b998cfd70e8c6997d6d921e0439ac94f67ff1e0 100644 (file)
@@ -30,11 +30,16 @@ import u_boot_utils as util
 import vboot_forge
 
 TESTDATA = [
-    ['sha1', '', False],
-    ['sha1', '-pss', False],
-    ['sha256', '', False],
-    ['sha256', '-pss', False],
-    ['sha256', '-pss', True],
+    ['sha1', '', None, False],
+    ['sha1', '', '-E -p 0x10000', False],
+    ['sha1', '-pss', None, False],
+    ['sha1', '-pss', '-E -p 0x10000', False],
+    ['sha256', '', None, False],
+    ['sha256', '', '-E -p 0x10000', False],
+    ['sha256', '-pss', None, False],
+    ['sha256', '-pss', '-E -p 0x10000', False],
+    ['sha256', '-pss', None, True],
+    ['sha256', '-pss', '-E -p 0x10000', True],
 ]
 
 @pytest.mark.boardspec('sandbox')
@@ -43,8 +48,8 @@ TESTDATA = [
 @pytest.mark.requiredtool('fdtget')
 @pytest.mark.requiredtool('fdtput')
 @pytest.mark.requiredtool('openssl')
-@pytest.mark.parametrize("sha_algo,padding,required", TESTDATA)
-def test_vboot(u_boot_console, sha_algo, padding, required):
+@pytest.mark.parametrize("sha_algo,padding,sign_options,required", TESTDATA)
+def test_vboot(u_boot_console, sha_algo, padding, sign_options, required):
     """Test verified boot signing with mkimage and verification with 'bootm'.
 
     This works using sandbox only as it needs to update the device tree used
@@ -104,7 +109,7 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
         util.run_and_log(cons, [mkimage, '-D', dtc_args, '-f',
                                 '%s%s' % (datadir, its), fit])
 
-    def sign_fit(sha_algo):
+    def sign_fit(sha_algo, options):
         """Sign the FIT
 
         Signs the FIT and writes the signature into it. It also writes the
@@ -113,10 +118,13 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
         Args:
             sha_algo: Either 'sha1' or 'sha256', to select the algorithm to
                     use.
+            options: Options to provide to mkimage.
         """
+        args = [mkimage, '-F', '-k', tmpdir, '-K', dtb, '-r', fit]
+        if options:
+            args += options.split(' ')
         cons.log.action('%s: Sign images' % sha_algo)
-        util.run_and_log(cons, [mkimage, '-F', '-k', tmpdir, '-K', dtb,
-                                '-r', fit])
+        util.run_and_log(cons, args)
 
     def replace_fit_totalsize(size):
         """Replace FIT header's totalsize with something greater.
@@ -154,7 +162,7 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
         util.run_and_log(cons, 'openssl req -batch -new -x509 -key %s%s.key '
                          '-out %s%s.crt' % (tmpdir, name, tmpdir, name))
 
-    def test_with_algo(sha_algo, padding):
+    def test_with_algo(sha_algo, padding, sign_options):
         """Test verified boot with the given hash algorithm.
 
         This is the main part of the test code. The same procedure is followed
@@ -163,6 +171,9 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
         Args:
             sha_algo: Either 'sha1' or 'sha256', to select the algorithm to
                     use.
+            padding: Either '' or '-pss', to select the padding to use for the
+                    rsa signature algorithm.
+            sign_options: Options to mkimage when signing a fit image.
         """
         # Compile our device tree files for kernel and U-Boot. These are
         # regenerated here since mkimage will modify them (by adding a
@@ -176,7 +187,7 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
         run_bootm(sha_algo, 'unsigned images', 'dev-', True)
 
         # Sign images with our dev keys
-        sign_fit(sha_algo)
+        sign_fit(sha_algo, sign_options)
         run_bootm(sha_algo, 'signed images', 'dev+', True)
 
         # Create a fresh .dtb without the public keys
@@ -187,7 +198,7 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
         run_bootm(sha_algo, 'unsigned config', '%s+ OK' % sha_algo, True)
 
         # Sign images with our dev keys
-        sign_fit(sha_algo)
+        sign_fit(sha_algo, sign_options)
         run_bootm(sha_algo, 'signed config', 'dev+', True)
 
         cons.log.action('%s: Check signed config on the host' % sha_algo)
@@ -209,7 +220,7 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
 
         # Create a new properly signed fit and replace header bytes
         make_fit('sign-configs-%s%s.its' % (sha_algo, padding))
-        sign_fit(sha_algo)
+        sign_fit(sha_algo, sign_options)
         bcfg = u_boot_console.config.buildconfig
         max_size = int(bcfg.get('config_fit_signature_max_size', 0x10000000), 0)
         existing_size = replace_fit_totalsize(max_size + 1)
@@ -240,7 +251,7 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
             cons, [fit_check_sign, '-f', fit, '-k', dtb],
             1, 'Failed to verify required signature')
 
-    def test_required_key(sha_algo, padding):
+    def test_required_key(sha_algo, padding, sign_options):
         """Test verified boot with the given hash algorithm.
 
         This function tests if U-Boot rejects an image when a required key isn't
@@ -248,6 +259,9 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
 
         Args:
             sha_algo: Either 'sha1' or 'sha256', to select the algorithm to use
+            padding: Either '' or '-pss', to select the padding to use for the
+                    rsa signature algorithm.
+            sign_options: Options to mkimage when signing a fit image.
         """
         # Compile our device tree files for kernel and U-Boot. These are
         # regenerated here since mkimage will modify them (by adding a
@@ -260,12 +274,12 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
         # Build the FIT with prod key (keys required) and sign it. This puts the
         # signature into sandbox-u-boot.dtb, marked 'required'
         make_fit('sign-configs-%s%s-prod.its' % (sha_algo, padding))
-        sign_fit(sha_algo)
+        sign_fit(sha_algo, sign_options)
 
         # Build the FIT with dev key (keys NOT required). This adds the
         # signature into sandbox-u-boot.dtb, NOT marked 'required'.
         make_fit('sign-configs-%s%s.its' % (sha_algo, padding))
-        sign_fit(sha_algo)
+        sign_fit(sha_algo, sign_options)
 
         # So now sandbox-u-boot.dtb two signatures, for the prod and dev keys.
         # Only the prod key is set as 'required'. But FIT we just built has
@@ -297,9 +311,9 @@ def test_vboot(u_boot_console, sha_algo, padding, required):
         old_dtb = cons.config.dtb
         cons.config.dtb = dtb
         if required:
-            test_required_key(sha_algo, padding)
+            test_required_key(sha_algo, padding, sign_options)
         else:
-            test_with_algo(sha_algo, padding)
+            test_with_algo(sha_algo, padding, sign_options)
     finally:
         # Go back to the original U-Boot with the correct dtb.
         cons.config.dtb = old_dtb
index 4aeabbcfe97b64f6dd728e1c74f8c904df13bc64..88ff093d05bed6f5da152dbbad8428eec219e4d7 100644 (file)
@@ -17,6 +17,7 @@
 #include "fit_common.h"
 #include "mkimage.h"
 #include <image.h>
+#include <string.h>
 #include <stdarg.h>
 #include <version.h>
 #include <u-boot/crc.h>
@@ -744,6 +745,9 @@ static int fit_handle_file(struct image_tool_params *params)
                snprintf(cmd, sizeof(cmd), "cp \"%s\" \"%s\"",
                         params->imagefile, tmpfile);
        }
+       if (strlen(cmd) >= MKIMAGE_MAX_DTC_CMDLINE_LEN - 1) {
+               fprintf(stderr, "WARNING: command-line for FIT creation might be truncated and will probably fail.\n");
+       }
 
        if (*cmd && system(cmd) == -1) {
                fprintf (stderr, "%s: system(%s) failed: %s\n",
index 0254af59fbed9531d994907d91b4d80a7c2df93b..5b096a545b79e96dee9475eac5cd54eb53576dd7 100644 (file)
@@ -42,6 +42,6 @@ static inline ulong map_to_sysmem(void *ptr)
 #define MKIMAGE_TMPFILE_SUFFIX         ".tmp"
 #define MKIMAGE_MAX_TMPFILE_LEN                256
 #define MKIMAGE_DEFAULT_DTC_OPTIONS    "-I dts -O dtb -p 500"
-#define MKIMAGE_MAX_DTC_CMDLINE_LEN    512
+#define MKIMAGE_MAX_DTC_CMDLINE_LEN    2 * MKIMAGE_MAX_TMPFILE_LEN + 35
 
 #endif /* _MKIIMAGE_H_ */