06 May, 2020

40 commits

  • The u-boot.bin file is not included in flash.bin binary, remove it
    from mx8m_mx8mm_secure_boot.txt guide.

    Reviewed-by: Ye Li
    Signed-off-by: Breno Lima
    (cherry picked from commit 92f238a1faaae3bbad27873704d33277f0663c40)

    Breno Lima
     
  • Commit 28dd37699022("imx8: Clean up targets") in imx-mkimage project
    renamed flash_linux target to flash_kernel.

    Update AHAB documentation to align with this change.

    Reported-by: Frank Zhang
    Reviewed-by: Ye Li
    Signed-off-by: Breno Lima
    (cherry picked from commit 8713142afd953e89bb6aa460716692fbb0a6a413)

    Breno Lima
     
  • Like iMX8MM, iMX8MN also needs SW to load TMU TASR and TCALIV registers
    value from fuse before enabling TMU calibration. Otherwise the calibration
    is not exact.

    Signed-off-by: Ye Li
    Reviewed-by: Anson Huang
    (cherry picked from commit 9fb7f904ff6a03e2951a770daba12a522373c8ae)
    (cherry picked from commit 005e994bb358d8bf68d1688563ce4f2df4fd7b2c)

    Ye Li
     
  • Update the board codes and configs to enable PCIE IMX driver on all
    imx6dql sabresd boards.
    The always on regulators is powered up in board_init for enabling
    "pcie_reg" regulator.

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

    Ye Li
     
  • Add pci0 alias and gpr property for pcie node.

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

    Ye Li
     
  • Update the board codes and configs to enable pcie imx DM driver.
    The pcie node in SDB board DTS reply on the alway on regulator
    "reg_pcie". So power up the always on regulators in board_init.

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

    Ye Li
     
  • Update the configs tp enable the PCIE iMX DM driver on imx8qxp and
    imx8dxl_phantom MEK board.

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

    Ye Li
     
  • Add pci alias for pcieb.
    Enable the pcieb node in MEK board and add relevant pin config and
    regulator.

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

    Ye Li
     
  • Update the configs on iMX8QM MEK board to enable PCIE IMX DM driver.
    Users can use "pci enum" command to enumerate the devices.

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

    Ye Li
     
  • Add PCI alias for pciea and pcieb.
    Enable the pciea node in MEK board and add relevant pin config and
    regulator

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

    Ye Li
     
  • Add PCIE relevant clocks to clk-imx8 driver, so PCIE IMX driver can
    set the clocks through DTB

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

    Ye Li
     
  • Update PCIE IMX DM driver supports iMX8QM/QXP and
    iMX6QDL/QP/SX. Non-DM driver supports iMX6QDL/QP/SX.
    The changes in DM parses cfg/mem/io ranges, gpios, regulators and
    clocks (imx8 only) from DTS for RC mode, and set iATU mapping for
    each regions.

    The original iATU mapping sets full PCI region to CFG space. iATU
    translates MEM/IO TLP to CFG TLP when the address is falled into
    the region.
    The new mapping sets CFG/IO/MEM spaces to align with kernel like below
    ATU region 0 for MEM access
    ATU region 1 for CFG0 or CFG1 access by bus id
    ATU region 2 for IO access

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

    Ye Li
     
  • Enable the configs of usb2 so that both usb2 and usb3 gadget
    drivers are now supported on imx8 plaform. And add
    CONFIG_USB_PORT_AUTO to support usb port autodetect function
    for SDP/fastboot.

    Signed-off-by: Sherry Sun
    (cherry picked from commit 1aa6e3f84c65e99de1219aa5d58d454cef1129f9)

    Sherry Sun
     
  • For one usb controller driver, the transport endpoint address won't
    change after the driver initialize. So the value of bEndpointAddress
    have no need to be cleared.

    But when more than one usb controller drivers are used at the same time,
    different endpoints address is used by different controller driver
    usually, it will cause confusion of endpoint address. So the value of
    bEndpointAddress had better been cleared everytime before we refill
    endpoint address to it.

    Signed-off-by: Sherry Sun
    (cherry picked from commit 9f9102968a777cfdcf0609a5435b35406f57124c)

    Sherry Sun
     
  • On imx8 platform, the usb2 and usb3 ports are both supported. Which
    means we can use usb2(ci_udc_otg) and usb3(cdns3_generic_peripheral)
    gadget driver to run sdp/fastboot/ums at the same time.

    For sdp and the fastboot that runs automatically when uboot starts,
    board_usb_gadget_port_auto() is added to autodetect usb port, this
    means that we don't have to specify which USB port should be used to
    download in code, now we can just connect either usb port then it
    will download automatically.

    Signed-off-by: Sherry Sun
    (cherry picked from commit 2b6fd3da6fffae0732e8e91ef5c1f870ea393ca9)

    Sherry Sun
     
  • Since the orginal way to call interrupts handle function of DM usb
    gadget driver is through dm_usb_gadget_handle_interrupts(), when we want
    to use two or more different gadget drivers at the same time, it will
    cause error of duplicate names.

    So here add a handle_interrupts function pointer instead of driectly
    call dm_usb_gadget_handle_interrupts(), then the error can be avoided.

    Signed-off-by: Sherry Sun
    (cherry picked from commit 2458ddd952a6a2d2304dfe7ea34e4192cd1d5ed4)

    Sherry Sun
     
  • The iMX8DXL phantom chip is 15x15 iMX8QXP, so we will use 8QXP as SOC,
    add configs and codes for the new board.

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

    Ye Li
     
  • Update OTG1 and OTG2 assigned clocks for USB core ref clock.
    Remove the deleting of OTG assigned clocks since we have support
    them in clk drivers

    Signed-off-by: Ye Li

    Ye Li
     
  • Add USB relevant clocks to support usb clock settings for both
    DM USB host and gadget drivers

    Signed-off-by: Ye Li

    Ye Li
     
  • For imx8mm, the CONFIG_CI_UDC is defined in
    include/configs/imx8mm_evk.h, which leads to CONFIG_CI_UDC can not been
    enabled in Kconfig, and CONFIG_DM_USB_GADGET which we need selected by
    CONFIG_CI_UDC in Kconfig also can not work. So move CONFIG_CI_UDC to
    defconfig files.

    The CONFIG_USB_GADGET_DUALSPEED is selected by CONFIG_CI_UDC in Kconfig
    files too, so we don't need it to be defined in include/configs/imx8mm_evk.h
    files.

    Signed-off-by: Sherry Sun
    Reviewed-by: Ye Li
    (cherry picked from commit cb33ca7a2a5052bdb7b479ae2af5169360625962)

    Sherry Sun
     
  • Since the ci_udc driver has been converted to DM driver, the
    CONFIG_DM_USB_GADGET should also be selected when CONFIG_CI_UDC
    is enabled, then we can use DM ci_udc driver.

    Signed-off-by: Sherry Sun
    Reviewed-by: Ye Li
    (cherry picked from commit d456376b59459403c4570d66297cc34f7264bd6d)

    Sherry Sun
     
  • Since one dts node can only bind to one DM driver in uboot, for usbotg
    node, we can not use it for both DM usb host driver and DM usb gadget
    driver. So a new usb gadget node is added to each usbotg node, the
    original usbotg node is bind to usb host driver as default, and the
    new usb gadget node is bind to usb gadet driver as default.

    Signed-off-by: Sherry Sun
    Reviewed-by: Ye Li
    (cherry picked from commit 342adc8948def972dbd08b71009584745f7826f0)

    Sherry Sun
     
  • Convert the ci_udc driver to driver model by using the uclass
    UCLASS_USB_GADGET_GENERIC. The clk and power of USB controller and USB
    PHY both are initialized by parsing the device tree nodes.

    If CONFIG_DM_USB_GADGET is defined, we use the ci_udc driver in DM way,
    if it does not defined, we can use ci_udc driver in its original Non-DM
    way.

    Move some USB PHY register definitions from ehci-mx6.c to
    asm/mach-imx/regs-usbphy.h in order to share with DM usb gadget driver.

    Signed-off-by: Sherry Sun
    Reviewed-by: Ye Li
    (cherry picked from commit 5c50d6bd6fda34827a27387e42c9a803da40b1e5)

    Sherry Sun
     
  • Set MCR0 RXCLKSRC to 1 to enable DQS loopback from pad to support
    higher frequency.

    Signed-off-by: Ye Li
    (cherry picked from commit 256fcd3df1b0a0b9c0fb730fabb7497800cda3a6)
    (cherry picked from commit fd90ac4654cf63d7518fc549f7a2b39d6a2e0230)

    Ye Li
     
  • Enable the SCSI and imx AHCI driver in imx6q/qp sabreauto and sabresd
    SATA configs. Removed unused codes for old SATA driver.

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

    Ye Li
     
  • Because u-boot does not support syscon_regmap_lookup_by_compatible,
    we have to add a gpr phandle property to point to iomuxc gpr node.
    and uses syscon_regmap_lookup_by_phandle to get gpr node in driver.

    This is common implementation in other nodes and better than
    by_compatible interface.

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

    Ye Li
     
  • Since we remove SATA device before boot OS, when AHCI is enabled, update
    the codes to remove AHCI device.

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

    Ye Li
     
  • We reuse current sata clock interface in imx AHCI for imx6q/qp. So
    enable them when the config is set

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

    Ye Li
     
  • Enable the iMX AHCI driver and relevat codes on iMX8QM MEK board.
    User can access the SATA disk via SCSI commands.

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

    Ye Li
     
  • Enable the SATA node in iMX8QM MEK DTS file for iMX AHCI driver.

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

    Ye Li
     
  • Add the SATA clocks to clk-imx8, so we can use clk uclass interfaces
    to access the clocks in AHCI driver.

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

    Ye Li
     
  • When DM SCSI is enabled with AHCI, use SCSI device to replace SATA
    device to access the peripheral.

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

    Ye Li
     
  • After enabling AHCI driver and DM SCSI, we need to access SCSI device
    for SATA

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

    Ye Li
     
  • Ahci driver set max ports to 2, but the codes has comparing issue if we
    only has one port. Also suppress the print of invalid port.

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

    Ye Li
     
  • Add new iMX AHCI driver which is ported from kernel and support
    imx6q/qp/imx8qm.
    The new driver adapt to SCSI through common AHCI interfaces in ahci.c
    So after enabling it, we will use SCSI commands to access the SATA
    disk device.

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

    Ye Li
     
  • Enable multiple environment storage devices on iMX8MN DDR4 EVK board.
    Remove duplicated CONFIG_ENV_OFFSET since we use env_get_offset to
    override it.

    Signed-off-by: Ye Li
    (cherry picked from commit 5c93b1e7f58a0280f7dda71865361c62d3ba6270)
    (cherry picked from commit d34d36d32acb5aa1d91e349acd7fc8aee3f096fe)

    Ye Li
     
  • To use one defconfig for all boot device, we have to runtime set
    env offset and return env medium according to the boot device.
    This patch overrides the env_get_offset and env_get_location to
    implement the feature.

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

    Ye Li
     
  • Add env_get_offset interface to override static CONFIG_ENV_OFFSET,
    and update env location driver to use env_get_offset. So for different
    storage medium, we are able to store the env at different offset.

    We don't support this feature when CONFIG_ENV_IS_EMBEDDED is set.

    Signed-off-by: Ye Li
    (cherry picked from commit 5b12d7cabb14bab9a95af7460b36c6c85db1b328)
    (cherry picked from commit 565d9002ac59b03d5bc77c6d88f2b93492166b66)

    Ye Li
     
  • configs

    set the i.MX6q default mtdids value as
    "nor0=8000000.nor,nand0=gpmi-nand", nandbcb can directly write to the
    nandboot partition after u-boot brings up.

    => nandbcb update $loadaddr nandboot 924672
    Device nor0 not found!
    current device is invalid, skip it and check the next one
    device 0 offset 0x0, size 0x924672
    Erasing at 0x3f00000 -- 100% complete.
    NAND fw write: 0x200000 offset, 0x928000 bytes written: OK

    Signed-off-by: Yang-yang Guo
    (cherry picked from commit 22c74fdc455d35346756c9fb82292db57db2c96f)

    Yang-yang Guo
     
  • set the i.MX6DL default mtdids value as
    "nor0=8000000.nor,nand0=gpmi-nand", nandbcb can directly write to the
    nandboot partition after u-boot brings up.

    => nandbcb update $loadaddr nandboot 912384
    Device nor0 not found!
    current device is invalid, skip it and check the next one
    device 0 offset 0x0, size 0x912384
    Erasing at 0x3f00000 -- 100% complete.
    NAND fw write: 0x200000 offset, 0x916000 bytes written: OK

    Signed-off-by: Han Xu

    Han Xu