06 May, 2020

40 commits

  • iMX8 has consective address for TCML and TCMU, so the M4 image size
    could exceed the TCML boundary and put its data section in TCMU.

    So change the size limitation in bootaux to 256KB to include TCMU.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit cdc80200841055b949677ae8633c6d64fe0d0985)
    (cherry picked from commit 086aa956a8e2a98aeb601eba337d02e7ad5076dc)

    Ye Li
     
  • As the M4 use different DDR memory size in normal android/car2 and car
    image, use different defconfig for car2 to decrease DDR memory
    reservation. So memory reserved for each M4 core is 8MB in car2 and
    normal android image. it's 32MB for car image.

    Change-Id: Idf608f539cd614a154c78e3a1af28eff1da5c1f2
    Signed-off-by: Zhang Bo
    Signed-off-by: Ye Li
    (cherry picked from commit 565f2204e7925d3bd25623ff1104a54ee0f8a601)

    Ye Li
     
  • Add new u-boot command "imx_tamper" to configure and check the tamper pins.
    The codes are used for reference and test. So command is disabled at default,
    user can enable it by adding CONFIG_IMX_TAMPER=y to defconfig

    The iMX7D has 10 tamper pins those can be used for SNVS tamper detection.

    Tamper 9 pin is NVCC_DRAM power switch for LPSR by default.
    It must be fused to tamper function by command
    => fuse prog -y 1 3 0x80000000
    Otherwise, SNVS power consumption would be high

    When tamper is detected, CPU can't enter/stay in SNVS mode,
    the tamper must be cleared and disabled before enter SNVS.

    Signed-off-by: Ye Li
    Signed-off-by: Shaojun Wang
    Acked-by: Peng Fan
    (cherry picked from commit d520e1c6067c08103a020b0bc19feb620473e543)
    (cherry picked from commit 4333529337a554352e1f9fb7486287dea31aeb79)

    Ye Li
     
  • The imx8mm new fuse map uses 3bits SPEED_GRADE and add 2Ghz speed.

    SPEED SPEED_GRADE
    2000 ’100’
    1800 ’011’
    1600 ’010’
    1200 ’001’
    800 ’000’

    Signed-off-by: Ye Li
    (cherry picked from commit d747d5e2d055b1191166f5bf3395f7933023b323)
    (cherry picked from commit fb27a5a05757ccf9fbae56ab041a6428e339ea0f)

    Ye Li
     
  • Wrong bmode value is used in community u-boot for usb reboot. And cause
    it failed. Fix this by using a reserved bootcfg value.

    Signed-off-by: Ye Li
    (cherry picked from commit eacd50f370203218a8e96c28c8a7adc0b638fc6d)
    (cherry picked from commit aed4820fa81c1da9206f946a61ff851a255c9288)
    (cherry picked from commit 1a944ae01addda559d1bf9869288424c00043406)

    Ye Li
     
  • To support the uuu, pack the common qspi header with u-boot binary for
    i.MX6/7 qspi u-boot.

    1. The qspi-header file need to be copied out of source tree.
    2. In mkimage flags, we need to add $(QSPI-HEADER) and %$(PLUGIN).bin.
    Otherwise it will fails to filter out $(QSPI-HEADER) and $(PLUGIN).bin because the $(PLUGIN) is
    extend to full path.
    3. u-boot-dtb.imx and u-boot.imx are updated to add qspi-header.

    Signed-off-by: Han Xu
    (cherry picked from commit 2804e4248bf638165c54c450528a14fe27cc58cd)
    (cherry picked from commit 23b270202916fe32450590c4e9330916e97c18f6)
    Signed-off-by: Ye Li

    Han Xu
     
  • The SPL loads the FIT image FDT part to an address related with the device
    block length. This length is 512 for SD/MMC and is 1 for other devices
    like SDP, NOR, NAND, SPI, etc.
    When signing FIT image, we use fixed address caculated by SD/MMC block length
    to sign FDT part. Thus, when booting through uuu, this causes mismatch and
    gets authentication failed.

    Fix the issue by providing a override function for this FIT buffer address.
    When secure boot is enabled, adjust the addresses of other devices to be same
    with SD/MMC.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 710efd3ccb99e144bd30af8e1ee46459b4a54dd6)
    (cherry picked from commit f48835f0b6b801cb267b4c27a50136c93dfd3bcf)

    Ye Li
     
  • Stop the usb device controller before enter kernel, this is required
    to make kernel can properly init usb controller with it's in stopped
    state.

    Suggested-by: Ye.Li
    Reviewed-by: Ye Li
    Signed-off-by: Li Jun
    (cherry picked from commit 27d6b4cf3d8d6701aeb800b307ef52afd18540ba)
    (cherry picked from commit dfcd809622bd994937724dc8c3252c16a2131056)

    Li Jun
     
  • Enable DWC3 USB support at i.MX850D platform

    Signed-off-by: Li Jun
    Signed-off-by: Frank Li
    (cherry picked from commit 7c3d2a17bf85e97a486d01e231480baaa7e7a167)
    (cherry picked from commit 1dd830df85ef684d8b6acd4655204ce7bd6be997)

    Frank Li
     
  • For flash devices, like spi nor, weim nor and qspi/flexspi,
    we don't define the ENV in MMC, but UUU fastboot always use the
    mmc_get_env_dev. So we have to decouple the function with
    CONFIG_ENV_IS_IN_MMC

    Signed-off-by: Ye Li
    (cherry picked from commit ef480647da5686403c7fed09aaf47ca1ace54731)

    Ye Li
     
  • Base on MLK-18406: uuu write to any positionn of mmc
    Support i.MX6 boards.

    Signed-off-by: Xiaoning Wang
    (cherry picked from commit 808ccb44593b58552d3356d52f9ae23b7b77fd0a)
    (cherry picked from commit ae4b9669cc6e2054fbf32e2e38aec3e43488cbb1)

    Xiaoning Wang
     
  • uuu can write to any position of mmc
    sdps: boot -f ../mkimage_imx8dv/imx-mkimage/iMX8QX/flash.bin

    FB: ucmd setenv fastboot_dev mmc
    FB: ucmd setenv mmcdev ${emmc_dev}
    FB: ucmd mmc dev ${emmc_dev}
    FB: flash -raw2sparse all xx.sdcard

    Signed-off-by: Frank Li
    (cherry picked from commit ca96e0bd1aea1996904b0a71fb1d74c3f5176929)
    (cherry picked from commit 482d31e412f5b373d143dbdf363667b066762711)

    Frank Li
     
  • uuu can change emmc device number for fastboot

    Signed-off-by: Frank Li
    (cherry picked from commit 4da1ab91f864b804ad561e04f44b618ec86b99b7)
    (cherry picked from commit 922533b57d134d68817dbadc62314e3345438606)

    Frank Li
     
  • The get_boot_device will return USB type from ROM info if booting from
    serial download, so change the is_boot_from_usb to use this function.

    Signed-off-by: Ye Li
    (cherry picked from commit 306fca12fb21829be552a6262e310a90664a8cc2)

    Ye Li
     
  • Because the ROM info on iMX7D does not set device type to USB when booting
    from serial download mode, we have to use the mechanism on mx6 to implement
    the is_boot_from_usb. The original implementation is checking USB controller
    register, it can't work correctly after any USB functionality is run in u-boot.

    Signed-off-by: Ye Li
    (cherry picked from commit 4934c765c6f1c9c997a28aa79f08c14fc4e91202)

    Ye Li
     
  • The mmc_get_boot_dev reads from SRC SBMR register. When booting with USB
    serial download, this function does not return correctly. Because SBMR won't
    reflect the USB boot.

    The patch adds USB boot checking to this function to fix the issue.

    Signed-off-by: Ye Li
    (cherry picked from commit f49acb763ec7165d634a119626620c596d74e419)

    Ye Li
     
  • We introduce a new arch-specific flag GD_FLG_ARCH_IMX_USB_BOOT to indicate if it is
    USB boot. We check the USB PHY PWD bit at early of boot stage then set that flag
    in global variable. So any following calling of is_boot_from_usb will return
    correct value.

    Signed-off-by: Ye Li
    (cherry picked from commit 50b30746a9aac8785bfe6ea8077c8572b02065c2)

    Ye Li
     
  • Use trusty_os_init to load Trusty OS from CONFIG_TRUSTY_OS_ENTRY
    before u-boot ready.

    Add Trusty OS SOC level codes and u-boot/SPL common codes.

    Signed-off-by: Ye Li
    Signed-off-by: Haoran.Wang
    (cherry picked from commit 1ae9ecc73f5001b8bd743011c06a7d07861be64e)
    (cherry picked from commit 6fa4f4a42fd90631f8dc8303b17f600c085d8595)

    Ye Li
     
  • Porting the FSL android fastboot features from imx u-boot v2018.03 to
    support all SoCs: imx6/imx7/imx7ulp/imx8/imx8m.

    The UUU commands like UCmd and ACmd are also added. Users need set
    CONFIG_FASTBOOT_UUU_SUPPORT=y to enable the feature.

    Signed-off-by: Frank Li
    Signed-off-by: Ye Li
    (cherry picked from commit 65120b06a7f750b9b1a6e0db3d2082cc7088d5a8)
    (cherry picked from commit 9b149c2a28829fe7017f83981d634157bc31cc94)

    Ye Li
     
  • Since we enabled MMC alias, the USDHC index in u-boot is the usdhc port.
    So we don't need to convert them for kernel and u-boot env device.

    Signed-off-by: Ye Li
    (cherry picked from commit 8fd6e14f5c1598684bc08a7917f89cd94e988d8f)
    (cherry picked from commit 96bc8f724159a3a9e2ba9f605b84f53534bc3e1f)

    Ye Li
     
  • 1. Add emmc, nand, and qspi boot support: defconfigs and DTS
    2. Support USB2NET dongle
    3. Fix is_mx6ull to include 6ulz
    4. Update DTS model name
    5. Modify ENV offset to 896KB for SD/eMMC

    Signed-off-by: Ye Li

    Ye Li
     
  • In optee enabled defconfig, the trust zone is enabled in DCD. On iMX6UL/ULL, there
    is IC limitation that LCDIF master access can only be non-secure, because PL301
    hard code the m_3/4/5 to non-secure masters. It causes LCDIF fails to fetch data
    from memory.

    This patch adds a workaround to change trust zone Region 0 attribute to allow both secure
    and non-secure read/write. So it permits the LCDIF master access to memory.
    Since optee will configure Region 0 by itself, this should not introduce problem to optee.

    Signed-off-by: Ye Li
    (cherry picked from commit 85be73bb5bab319c096f0893729835b3ceddafde)
    (cherry picked from commit a7ab49a0856caea6114b4f9d1f6cddb75c944c33)
    (cherry picked from commit 5a54394012b76adbd7efe2aa2cea8a8dade860c0)
    (cherry picked from commit f27090f07733d322108c0798bad3770adf527794)

    Ye Li
     
  • Add IMX_OPTEE Kconfig entry

    Signed-off-by: Peng Fan
    (cherry picked from commit 28b0bcbef4dadd33a273dd18a2274f3c679efb2d)
    (cherry picked from commit bda0f36309e7752bf6c78d71473cc5cf7f8f58c1)
    (cherry picked from commit d3188f62b659dda60128a67f8cdf2920108e004d)
    (cherry picked from commit 8c1260dcd7adbd1225bd0b8e2bb9ee3971c76e36)

    Peng Fan
     
  • Since from B0 TO, there is a Mirror of JTAG ID register added in
    SIM. We can read the part revision from this register.
    Update codes to use this register.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit de14e88698b9ae9b0a9ac674f16d65b3ceb4ccc2)
    (cherry picked from commit 0d0d9acc04972792890776e3c066f05a349bb623)
    (cherry picked from commit 00dfa82643b4e06c4c5e3830d35a82801e74ad81)

    Ye Li
     
  • Align the new pinfunc names with header file for all iMX7ULP EVK DTS files.
    Also update the EVK DTS files to align with kernel for Rev A3
    board. Removed the extcon node for USB ID, since A3 board uses USB ID pin
    not GPIO.

    Signed-off-by: Ye Li
    (cherry picked from commit 4404440535e3ecdb645e68b69f66c475aa56dd05)
    (cherry picked from commit 68abcc89a3ad3853adf78aa13dcb473e7605140b)
    (cherry picked from commit 1d0b81b7d325fbfd54bdf5cf89ca32af182d3710)

    Ye Li
     
  • i.MX7ULP B0 silicon has below updates in iomux

    - GPIO function input buffer enable (IBE)/output buffer enable (OBE) is
    now controlled by RGPIO module. IOMUXC IBE/OBE is used as an override.
    - LPUART2_TX (I/O) to PTB12 (ALT4)
    - LPUART2_RX (I) to PTB13 (ALT4)
    - USB0_ID (I) to PTC13 (ALT11), PTC18 (ALT11) and PTC19 (ALT10)
    - VIU_DE (I) to PTC18 (ALT12), PTC19 (ALT12) and PTE5 (ALT12)
    - RTC_CLKOUT (O) to PTB5 (ALT11) and PTB14 (ALT11)
    - SEC_VIO_B (I) to PTB4 (ALT11)
    - Added new Input Selection Registers
    PSMI1_USB0_ID Address: 0x40ac_0338 To select USB_ID input pad/source
    PSMI1_VIU_DE Address: 0x40ac_033c To select VIU_DE input pad/source

    Copy the imx7ulp-pinfunc.h from latest kernel dts
    (commit 18cdeadfe1967ea33d3bdfc7ccead6d6d06a98a6), and update
    the mx7ulp-pins.h accordingly.

    Signed-off-by: Ye Li
    (cherry picked from commit 5e3da4cf8e217e7efe683bc63114e45927ebb28b)
    (cherry picked from commit 459c2fe202175e7201b4b863eb6d98d15406d923)
    (cherry picked from commit 20c7ae29346df608836df3efa4511af4a58b4f21)

    Ye Li
     
  • MX7ULP needs to have the QSPI interrupt configured as a wakeup source
    in the SIM_WKPU_WAKEUP_ENABLE register, otherwise the QSPI interrupts
    do not wakeup the CPU from idle mode leading to poor performance in
    Linux.

    The SIM_WKPU_WAKEUP_ENABLE register only exists in B0 silicon, so
    make sure to only write to this register in the B0 version (or greater).

    Signed-off-by: Fabio Estevam
    (cherry picked from commit 1ab33446d6843f560fb6d14c781f6417225f8f3d)
    (cherry picked from commit 8116f34387f8164dd72656fb8278e6df9fdf4c05)
    (cherry picked from commit 3d64768b1b1064aed71974842a781b69ee34f8c9)

    Fabio Estevam
     
  • Change USDHC0 and USDHC1 per clock source from APLL_PFD1,
    and set the APll_PFD1 clock rate to 352.8MHz.

    Also gate off APll_PFD1/2/3 before boot OS, otherwise set
    the clock rate of APll_PFD1/2/3 during OS boot up will triger
    some warning message.

    Reviewed-by: Ye Li
    Signed-off-by: Haibo Chen
    (cherry picked from commit 07ef0fab23204684d82f27baf721a72b247f30c5)
    (cherry picked from commit 1c30a73542990afbe48bf7a398baba9c5efaf4fe)
    (cherry picked from commit 0e4ce4b6b3f8d06f5b63850e04a1e4deb9b07624)

    Haibo Chen
     
  • Add ARCH_MX7ULP as a CONFIG_IMX_HAB dependency, so we can enable
    IMX_HAB on mx7ulp

    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li
    (cherry picked from commit d4c01cd3f6f5ba59ca17ebf52f610f629895ac7a)
    (cherry picked from commit 4ba6e5aa05ec8872426aa68da3879e8fcd835710)
    (cherry picked from commit 78e717c7e0897e759abdbe5bf28b46ae56d403ee)

    Breno Lima
     
  • Add build configuration and DTS file to enable eMMC for eMMC reworked
    EVK board.
    Because the eMMC DTS file has QSPI node disabled, so we change to use
    non-DM QSPI driver.

    Signed-off-by: Ye Li
    (cherry picked from commit 9ae0e03eb829f694d26caec22f91d1f0fdba980d)
    (cherry picked from commit 29a10734150e91d3b5596f11a7533cb52dc5a4d2)
    (cherry picked from commit 6d8c9e8567eff4f5be860bc5f0e48a03e368c653)

    Ye Li
     
  • Porting the QSPI flash board support from v2016.03, and convert to use
    DM QSPI driver.
    Since we need to support QSPI at default in u-boot, change the default
    DTS file to qspi enabled DTS.

    Signed-off-by: Ye Li
    (cherry picked from commit 41895cd598be6c4a64fc4fec521120e4962abc28)
    (cherry picked from commit b4698ce0e5b6952a88702075ce905a059da277d9)
    (cherry picked from commit 2fa81543fa49924a92a470cce62fbca7544ecd56)

    Ye Li
     
  • The single boot mode in MX7ULP will only boot up A7, the M4 is running in ROM
    by checking entry from SIM0 GP register.

    In this patch, We bind M4 image with u-boot.bin by allocating a section for m4 image.
    So the whole image (included M4 image) will be loaded by A7 ROM into DDR. Then
    when u-boot is up, it will try to load M4 image into TCML and boot it there.

    Since M4 image will not be relocated in u-boot codes, we must load it during
    board_f. Current implementation put it in arch_cpu_init to get M4 booted
    as quick as possible.

    We requires the M4 image with IVT head and padding embedded, not a RAW binary. The
    image should be same as what is used for M4 QSPI boot in dual boot mode.

    Signed-off-by: Ye Li
    (cherry picked from commit 04163dbd4f6190f310fff17b53b4bc7b8370ba89)
    (cherry picked from commit 81b5ea14493ef25a6cca22bc5651ec3e93e941f3)
    (cherry picked from commit 1e4414da2e9a671896af1af887ab710489a2007e)
    (cherry picked from commit b3a50e57aafe2830388d1295a8583c4e2515594b)

    Ye Li
     
  • Add the fuse checking in drivers, when the module is disabled in fuse,
    the driver will not work.

    Changed drivers: BEE, GPMI, APBH-DMA, ESDHC, FEC, QSPI, ECSPI, I2C,
    USB-EHCI, GIS, LCDIF and EPDC.

    Signed-off-by: Ye Li
    (cherry picked from commit 1704e116f9b39aeb99201919a18bc2b1e19a980e)
    (cherry picked from commit 2d3b5df8530cd5ef883750378838dea7c40259af)
    (cherry picked from commit 6e8c9ae136bee8ec0121c1db4b935510caad09db)
    (cherry picked from commit 99b54a6965904a879afdb6883a519de726cb4e96)

    Ye Li
     
  • To align with v2019.04, add functions:
    1. Support GPMI NAND
    2. Support LCD splash screen
    3. Add 9x9 EVK board support with LPDDR2 used
    4. Update PMIC and LDO bypass for 9x9 EVK
    5. Support two ethernet controllers

    Signed-off-by: Ye Li
    (cherry picked from commit 154d6c905a848eed3bcc1ae2e142da3508a61b92)
    (cherry picked from commit e7617471ab33579da972db82e042937233c857fa)

    Ye Li
     
  • Update the DTS files for 14x14 EVK and 9x9 EVK to align with
    v2019.04.

    Signed-off-by: Ye Li

    Ye Li
     
  • Update iMX6UL EVK DTS file to align with v5.4 kernel. And add DTS
    for eMMC and NAND.

    Signed-off-by: Ye Li

    Ye Li
     
  • Update DTS, DTSi and clock binding file for mx6sllevk:
    1. Fix USDHC pad settings
    2. Add pin settings for i2c bus force idle
    3. Fix non-removable bug for usdhc2
    4. Update clock
    5. Update model name
    6. Update pmic node name

    Signed-off-by: Ye Li
    (cherry picked from commit 26bd5feefec059a0176768e89016cdc289839103)
    (cherry picked from commit f57952362eda7f56005e306ce6ef42e5a8e1b9e3)

    Ye Li
     
  • Copy the DTS and DTSi from 4.14 kernel.

    Changes in DTS specified for u-boot:
    1. Add alias for mmc and usb
    2. Add pin settings for i2c bus force idle
    3. Change PMIC node name
    4. Update model name to remove freescale

    Signed-off-by: Ye Li
    (cherry picked from commit e669373fc5f861750b2b7b59cde6c31c43cf61fb)
    (cherry picked from commit 877d09b0d104db8e377aa6e213b7cee46217fbbd)

    Ye Li
     
  • Copy the DTS from 4.14 kernel

    Compared with kernel DTS, the changes in DTS for u-boot:
    1. Add pin settings for supporting i2c bus force idle.
    2. Change pfuze name
    3. Change board model name, remove freescale

    Signed-off-by: Ye Li
    (cherry picked from commit 67d0c3427562a81713ac8d00f5a976ac2942cb1a)

    Ye Li
     
  • Update i.MX6SX dtsi file and relevant DTS header files.
    Add the imx6sx-sdb-emmc DTS file for reworked eMMC board.

    Changes in DTS and DTSi:
    1. Add spi0 and spi1 alias for qspi1 and qspi2.
    2. Add USB alias for usb0 and usb1

    Signed-off-by: Ye Li
    (cherry picked from commit 9d8838cb1409c265db3dd0b64219e1286202c10d)
    (cherry picked from commit deed82bb1d09d6163b3e69e04d723dc91563225b)

    Ye Li