24 May, 2019

40 commits

  • Call the TRNG init function at the end of arch_cpu_init()
    Concerned SoCs are: i.MX6, i.MX7 and i.MX8M

    Signed-off-by: Aymen Sghaier
    (cherry picked from commit 996329904c0304a7bfbc6cda8287ab93de77870d)

    Aymen Sghaier
     
  • The following reasons lead to instantiate the TRNG into U-Boot/SPL:

    - On some i.MX platforms Linux Kernel could not instantiate RNG
    - RNG could be used/needed by M4/M0 cores before Kernel stage
    - Having the RNG instantiation implemented only once for
    almost i.MX platforms

    Signed-off-by: Aymen Sghaier
    (cherry picked from commit 1f4134c85f6416cbdadaf5f4ff6321f6c685c74c)

    Aymen Sghaier
     
  • Add the fsl CAAM driver and new commands to implement DEK blob operations,
    like "caam genblob" to generate encrypted blob and "caam decap" to output
    orignal plain data.

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

    Ye Li
     
  • The CONFIG_DEVRES is not a necessary config for pinctrl. We decouple the
    dependence from the kconfig. So the DEVRES is not default enabled.

    When using DWC3 gadget driver, without enabling gadget DM driver, the calling
    to devm_kzalloc will cause crash if CONFIG_DEVRES is set.

    Signed-off-by: Ye Li

    Ye Li
     
  • We enabled the DM for xhci-imx8m driver which uses compatible string
    "fsl, imx8mq-dwc3". But found a issue that u-boot will get four USB bus not two.
    The reason is the low level driver xhci-dwc3 also adds the DM support which uses
    compatible string "snps,dwc3". Thus, one USB node and its dwc3 subnode are both
    binded as independent USB bus.

    Since the xhci-imx8m driver uses xhci-dwc3 as low level driver, to fix the issue
    we add -u-boot.dtsi files to change the USB node compatible string to
    "simple-bus" and change dwc3 node compatibe string to "fsl, imx8mq-dwc3". Then
    xhci-dwc3 DM driver won't bind any node.

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

    Ye Li
     
  • Enable the SPL SDP driver and SPL gadget drivers on iMX8MQ EVK board.

    Signed-off-by: Ye Li

    Ye Li
     
  • Enable the SPL SDP driver and SPL gadget drivers on iMX8MQ DDR4 and
    DDR3L validation boards.

    Signed-off-by: Ye Li

    Ye Li
     
  • Checks whether the HDMI FW is running before initialize the HDMI display.
    So that for cases like mfgtool and imx-boot image without HDMI FW, the
    u-boot won't be blocked.

    Signed-off-by: Ye Li
    (cherry picked from commit 273b45dd3cf8773462400857c8b48b70bcfe96bb)
    (cherry picked from commit 5527e5674c438cd7ef7735e2bdef37668d88676b)

    Ye Li
     
  • The bootaux from community uses ulong to read private data and write to M4 TCM,
    this cause problem on ARM64 platform where the ulong is 8bytes.
    Fix it by using u32 to replace ulong.

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

    Ye Li
     
  • Use NXP logo.
    The vendor and board dir not changed, only replace the contents
    of freescale.bmp.

    Signed-off-by: Peng Fan
    (cherry picked from commit 0b381fdf1a45cb06a057724e708ce0bbeee67f4d)
    (cherry picked from commit 836461a95ca8df0f41dacf1d390a966624190524)
    (cherry picked from commit ffbeb365642907957a385fe970fc69adcf87d600)

    Peng Fan
     
  • When calculate the temperature in millicelsius, the tenths are
    handled incorrectly.

    Signed-off-by: Ye Li
    Acked-by: Peng Fan
    (cherry picked from commit 72796a2e138bb7b5b4db9f771a3f9b823b66ade5)
    (cherry picked from commit 1288dc25fb849c98b01dce0b130d83cf33939c6b)

    Ye Li
     
  • Since the DRC_0 thermal is disabled by SCFW, we should use SC_R_SYSTEM for
    CPU thermal. Update the resources table to align with kernel.

    Signed-off-by: Ye Li
    (cherry picked from commit 3f8e5aaa173b5d3cdf05df7867cdca8776854fd6)
    (cherry picked from commit c1e72c232d85a662c2ddb2bc9601132d8dd4fb18)

    Ye Li
     
  • Add DDR3 init codes, board codes, defconfig and DTS into u-boot.
    Basic modules are ready: SD, UART, I2C, USB host and NAND.

    There is a FPGA on this board. It controls WDOG_B, and ENET PHY RESET.
    So reset and ethernet won't work at default.

    Signed-off-by: Ye Li
    Acked-by: Peng Fan
    (cherry picked from commit 1742883a1e9c6a02045f81a14e4aa833c781afe9)

    Ye Li
     
  • iMX8MM DDR3L validation board uses GD25LQ16, but its id is not in
    u-boot flash ids table. Add the new id and parameters into the table.

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

    Ye Li
     
  • Add SPL/u-boot board codes and DDR4 settings for iMX8MM DDR4 validation board.
    DDR overnight stress test is passed.

    Supported modules:
    SD/eMMC, I2C, ENET, Flexspi, UART and USB.

    Build config:
    imx8mm_ddr4_val_defconfig

    Signed-off-by: Ye Li
    (cherry picked from commit 6045484796a87a31938a19d2d8fa2ae095804586)
    (cherry picked from commit fa79b5236ac8a7debfefa8e42028e0871412aa50)

    Ye Li
     
  • Add a DTS file for iMX8MM DDR4 validation board whose design is similar
    as iMX8MM EVK.

    Signed-off-by: Ye Li
    (cherry picked from commit abe2268c73e409f8faafc80a182203f2fa6e39c2)
    (cherry picked from commit 7960baa9f44f06a3ef70d28c968eb50bafd8ea6f)

    Ye Li
     
  • Enable the SPL SDP for iMX8MM EVK. So that when booting from USB serial
    download mode, the SPL will enter SDP to download FIT image from USB host
    (uuu tool) and boot into FIT image.

    The SDP driver needs larger malloc pool size, so extend the SPL malloc pool
    to 12KB and reduce the SPL BSS MAX to 4KB because BSS actual size is about 1KB.

    Signed-off-by: Ye Li

    Ye Li
     
  • Since we don't support DM in SPL, undefine the DM USB in SPL build,
    so it can use non-DM USB driver.

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

    Ye Li
     
  • The SPL SDP is configured as BOOT_DEVICE_BOARD, so when booting from
    USB, change its type to BOOT_DEVICE_BOARD, so we can use SDP.

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

    Ye Li
     
  • Current SDP only supports to boot legacy image(raw). Add support to
    boot FIT image.

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

    Ye Li
     
  • The u-boot 2018 forces to use gcc 6.0 or later to save binary size for some platforms.
    This check causes problem for android building because android tool chain remains
    using gcc 4.9.
    Since iMX6/7/8 platforms don't meet binary size issue, we can remove the checkgcc6
    and use old gcc.

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

    Ye Li
     
  • The board_usb_clean in ehci-mx6 always set to HOST. This is wrong
    when we running gadget. Change to use type in private data.

    Signed-off-by: Ye Li
    (cherry picked from commit 47809d46abafd91c8fbb90393881f1daddd08af1)
    (cherry picked from commit ec37a2cef2e4c0e627e36d684d8bf657e0772e9c)

    Ye Li
     
  • Add board support for both iMX8MM LPDDR4 EVK and DDR4 EVK.
    Supported peripherals: UART, I2C, NAND (DDR4 EVK), SD, USB, TCPC, ENET
    FlexSPI and eMMC (LPDDR4 EVK)

    Signed-off-by: Peng Fan
    Signed-off-by: Ye Li

    Ye Li
     
  • Add two DTS files, one for iMX8MM LPDDR4 EVK (fsl-imx8mm-evk.dts)
    and another for iMX8MM DDR4 EVK.
    Two boards share same base board, the major difference is the DDR4 board
    installs NAND chip and removes flexspi and eMMC.

    Signed-off-by: Ye Li

    Ye Li
     
  • Since flexspi has different IVT offset with SD/MMC, add a new imximage
    for it.

    Signed-off-by: Ye Li

    Ye Li
     
  • iMX8MM DTS uses new compatible string "fsl,imx8mm-flexspi" in flexspi
    node. Add it into the flexspi driver.

    Signed-off-by: Ye Li

    Ye Li
     
  • Changed to use dev_read_subnode to get the ofnode type of the bd71837 device node.
    Because the pmic_bind_children is changed to use ofnode.

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

    Ye Li
     
  • Set wdog WCR register SRS bit to turn off internal reset signal WDOG_RESET_B_DEB
    for mx7d. So that the warm reset is disabled.
    The WDA is cleared to output WDOG_B immediately to reset the board.

    Signed-off-by: Ye Li
    (cherry picked from commit 6d09863801695d975060fbc240147a9067dbafbf)
    (cherry picked from commit cde504077e1ce94d9ad34ece0f3e882972404297)

    Ye Li
     
  • Because we power off all devices in board_quiesce_devices which is prior then
    executing dm_remove_devices_flags. So any access to HW in dm_remove_devices_flags
    will cause problem.
    However, some drivers like ethernet which implements the pre_remove callback is always
    called without any flags check, and this finally accesses FEC controller.

    Since we don't need to remove all devices in u-boot before starting kernel, disable
    this feature when power domain is enabled.

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

    Ye Li
     
  • On iMX8MM, the V flag in TRISTR register only reflect the state of SNSR
    value, not the calibrated TEMP value. So checking this flag is not
    reliable. Per IC suggestion, change to read the TEMP/AVG_TEMP directly
    and check whether it in valid range 10-125C.

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

    Ye Li
     
  • When the temperature is out of sensor's range, the Valid bit won't be
    set in TRITSR register. So the polling loop won't go out.

    Change the codes to retry 10 times with 100ms interval for the Valid bit.
    If the timeout, we give a warning for the invalid data.

    Signed-off-by: Ye Li
    Reviewed-by: Bai Ping
    (cherry picked from commit 7ea2168e06d4f77a872f51a167ee1ed6bf2b0632)

    Ye Li
     
  • On iMX8MM, the default value of TMU registers TCALIV and TASR need
    be loaded from fuse. HW won't do this, it expect SW loads them before
    using TMU.

    Signed-off-by: Ye Li
    Reviewed-by: Bai Ping
    (cherry picked from commit 9dada8a697b1c103fdb28f528f168da7ecc20849)

    Ye Li
     
  • Since imx8mm TMU needs to load some registers from fuse, this is arch
    dependent operation and may vary on different platforms. So add
    a interface for arch level initialization.

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

    Ye Li
     
  • The analog sensors on iMX8MM are new, used for 14LPP process. So the
    Temperature Sensor Monitoring Unit (TMU) has some change accordingly.
    We use version 2 in TMU driver to represent the new TMU, so the one driver
    can service for both MQ and MM.

    Signed-off-by: Ye Li
    (cherry picked from commit 86fab918e607221249acc5c9a8f8eca01c17ec37)
    (cherry picked from commit f68b8d4e0b256d376fd4ea8f1f4be0334327eca1)

    Ye Li
     
  • The imx8mm has changed the address of rvt_hab, use new address for imx8mm.

    The authentication procedure is same as imx8mq. In u-boot, the authentication
    uses SIP call to trap ATF to run HAB authenticate.
    Need to work with ATF commit:
    (commit 7a4d6f90e999ed413d520310cc199901b52b7a04)

    Users need to add CONFIG_SECURE_BOOT=y to defconfig to enable the feature.

    Signed-off-by: Ye Li
    Acked-by: Peng Fan

    Ye Li
     
  • Add iMX8QM HDMI RX firmware loading.

    Signed-off-by: Sandor Yu
    (cherry picked from commit 969d93660e1b34765627ff9f6f8dcab08dcd1250)
    (cherry picked from commit 43bc31a2700f4078ffc5f55ff3fea0ed554f4506)

    Sandor Yu
     
  • We clean USBOTG register USBCMD if it is used in serial download mode.
    When XRDC blocking is enabled, we can't write this register directly,
    must enable the OTG power, otherwise the kernel will get SError
    exception in mfgtool.

    Signed-off-by: Ye Li
    (cherry picked from commit cf2143dc97b2a8f21b828c7386c59ee965d981f2)
    (cherry picked from commit 55dd2c8e17eca27b3d393be9fd84a153ce7bf37b)

    Ye Li
     
  • When unregister gadget driver in ci_udc, the usb device is not
    removed or stop. This causes next "usb start" fails to work.

    Add a new interface "usb_remove_ehci_gadget" in usb-uclass to
    remove the usb device for DM driver. Using "usb_lowlevel_stop" for
    non-DM driver.

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

    Ye Li
     
  • Enable the OTG power on for EHCI OTG controller on iMX8MM

    Signed-off-by: Ye Li

    Ye Li
     
  • Since the i.MX8MM reuses the otg controllers on i.MX7D. We can use
    CONFIG_USB_EHCI_MX7 for them.

    Due the TCPC and load switch are used on Typec circuit. Add the
    board_usb_init and board_usb_cleanup to ehci-mx6 DM driver. So
    we can implement the TCPC settings in these board functions.

    Signed-off-by: Ye Li
    (cherry picked from commit 67699e88aed8bd36e919f54f9555ae15595faaf7)
    (cherry picked from commit 13c19c6214ebb69706bb6710ac3ff1db5c2de185)

    Ye Li