u-boot.git
5 years agoMLK-22570-1 mx8mqevk: Add OP-TEE Device Tree Bindings
Clement Faure [Fri, 30 Aug 2019 14:37:08 +0000 (11:37 -0300)]
MLK-22570-1 mx8mqevk: Add OP-TEE Device Tree Bindings

Currently is not possible to use dek_blob command in
mx8mq:

u-boot=> dek_blob 0x40400000 0x40401000 128
Cannot get OP-TEE device

Add OP-TEE Device Tree Bindings to fix this issue.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Clement Faure <clement.faure@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit f762fe218ec60025e2dfd6173efaa826286ba297)

5 years agoMLK-22748 imx8mn: Fix flexspi flash SCLK violation
Ye Li [Fri, 11 Oct 2019 04:05:20 +0000 (21:05 -0700)]
MLK-22748 imx8mn: Fix flexspi flash SCLK violation

Current flexspi driver enables the Quad DTR read, so the measured
100Mhz SCLK is actually for DTR mode not SDR. However, according to
MT25QU256ABA datasheet, this flash only supports max DTR at 90Mhz and
max SDR at 166Mhz. It means current clock setting violate the flash
spec. So change back the flexspi clock to align with imx8mm.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 3bf41bae974003550b70ea1a8b44ccb3117d818f)
(cherry picked from commit 4a369b527c3842751a4edf0171562a0e40c331ba)

5 years agoMLK-22749 imx8mq: Add workaround to fix sticky bits lock up
Ye Li [Tue, 27 Aug 2019 06:39:57 +0000 (23:39 -0700)]
MLK-22749 imx8mq: Add workaround to fix sticky bits lock up

On B1 chips with HAB v4.4, the sticky bits are not locked up in
HAB closed mode. We introduce a workaround in SPL to lock up
these bits and clear Manufacturing Protection Private Key for
secure boot.

For field return case, user has to build a SPL with
CONFIG_SECURE_STICKY_BITS_LOCKUP=n and set CONFIG_IMX_UNIQUE_ID to
part's unique id. When the UID check is passed, sticky bits are not
lockup and users can burn field return fuse. Otherwise the boot will
stop.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit c98b47f1ff60e1f99807e24fd76053ad880f803e)

5 years agoMLK-22743 mx7ulp: Update unlock and refresh sequences in sWDOG driver
Breno Lima [Thu, 10 Oct 2019 13:43:02 +0000 (10:43 -0300)]
MLK-22743 mx7ulp: Update unlock and refresh sequences in sWDOG driver

According to i.MX7ULP Reference Manual the second word write for both
UNLOCK and REFRESH operations must occur in maximum 16 bus clock.

The current code is using writel() function which has a DMB barrier to
order the memory access. The DMB between two words write may introduce
some delay in certain circumstance, causing a WDOG timeout due to 16 bus
clock window requirement.

Replace writel() function by __raw_writel() to achieve a faster memory
access and avoid such issue.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 5dd8c46d68d3267e989f980598a4e3e2ed04d4f9)

5 years agoMLK-22711-2: fastboot: emmc: update bootloader to offset 0 for RevC QXP chip
Frank Li [Tue, 8 Oct 2019 15:20:55 +0000 (10:20 -0500)]
MLK-22711-2: fastboot: emmc: update bootloader to offset 0 for RevC QXP chip

ROM update emmc offset to 0.
previous B0 is 32K.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
(cherry picked from commit b642241380227b97f0fa434e3d38dc746adbd9e0)
(cherry picked from commit 2065bf0a12180f73eb918d09dbe809c10077b033)

5 years agoMLK-22711-1 show RevC instead of Rev? at boot log
Frank Li [Tue, 8 Oct 2019 15:18:20 +0000 (10:18 -0500)]
MLK-22711-1 show RevC instead of Rev? at boot log

Add REVC informaiton.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
(cherry picked from commit c7231f2c7a5c1dc754b5fb9bf05941141877a0ec)
(cherry picked from commit 9a33170a4f4ff2ad2ab0d87e74e722a0e833abaa)

5 years agoMLK-22723-2: nandbcb: fix the issue cannot support gf_14 NAND boot
Han Xu [Wed, 9 Oct 2019 15:31:38 +0000 (10:31 -0500)]
MLK-22723-2: nandbcb: fix the issue cannot support gf_14 NAND boot

bchtype in FCB should be associated to the gf_13/14 settings in BCH, fix
the issue and test on Micron 29F64G08CBABB, it can boot after the
change.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit 9cc7bf9b17565b4e0d73acd690e32394034dfae2)

5 years agoMLK-22723-1: mtd: mxs_nand: fix the gf_13/14 definition issue
Han Xu [Wed, 9 Oct 2019 15:30:21 +0000 (10:30 -0500)]
MLK-22723-1: mtd: mxs_nand: fix the gf_13/14 definition issue

gf_13/14 mask was not set correctly in register definition.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit b8aed98b2ecfb0def64c474e1ae171930da4c9fc)

5 years agoMLK-22697: configs: fix the imx6ul/ull mtdparts settings
Han Xu [Thu, 3 Oct 2019 21:02:43 +0000 (16:02 -0500)]
MLK-22697: configs: fix the imx6ul/ull mtdparts settings

imx6ul/ull were not set the mtdparts properly which causes the uuu cannot recognized the correct mtd partition.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit e7bbaadd03df7acbd84e5fbdbce037a369b82d68)

5 years agoMLK-22579: fix: iMX8MM: fix the compilation error of i.MX8MM caused by MLK-22444
Alice Guo [Mon, 30 Sep 2019 18:22:57 +0000 (02:22 +0800)]
MLK-22579: fix: iMX8MM: fix the compilation error of i.MX8MM caused by MLK-22444

Conditional compilation added in MLK-22444 caused U-Boot compilation
of i.MX8MM error. Delete the wrong conditional compilation.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
(cherry picked from commit 5638f06c300edf87461b822e2c42df2c9ccdd40f)

5 years agoMLK-22622 imx8m: Add Workaround for ROM SError issue
Ye Li [Fri, 6 Sep 2019 08:21:00 +0000 (01:21 -0700)]
MLK-22622 imx8m: Add Workaround for ROM SError issue

ROM SError happens on two cases:

1. ERR050342, on iMX8MQ HDCP enabled parts ROM writes to GPV1 register, but
when ROM patch lock is fused, this write will cause SError.

2. ERR050350, on iMX8MQ/MM/MN, when the field return fuse is burned, HAB
is field return mode, but the last 4K of ROM is still protected and cause SError.

Since ROM mask SError until ATF unmask it, so then ATF always meets the exception.
This patch works around the issue in SPL by enabling SPL Exception vectors table
and the SError exception, take the exception to eret immediately to clear the SError.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit f05dd45251ca82cc54e13a616f00744c26faab53)
(cherry picked from commit 25d059411e702a4002f1aa157839001f796dd9f6)

5 years agoimx: add lowlevel init for ARM64
Peng Fan [Mon, 15 Apr 2019 05:20:43 +0000 (05:20 +0000)]
imx: add lowlevel init for ARM64

Sometimes we met SERROR, but only to catch it when Linux boots up.
Let's enable catching in U-Boot to catch it ealier and ease debug.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 7a0c9b08886e5dc7d50e640ed56eed0fe612161f)
(cherry picked from commit 33da22c4793e56077033a4f6c567894badb8e907)
(cherry picked from commit 4da3e872b7c61b93fa227935a7b45eb5fcb252e1)

5 years agoMLK-22574-2: mx7dsabresd: configs: add default mtdids and mtdparts configs
Alice Guo [Mon, 30 Sep 2019 14:16:07 +0000 (22:16 +0800)]
MLK-22574-2: mx7dsabresd: configs: add default mtdids and mtdparts configs

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

Signed-off-by: Alice Guo <alice.guo@nxp.com>
(cherry picked from commit 820e3bc68f1c8695e6dc9a93be2c7ef27ece929d)

5 years agoMLK-22574-1: mx7dsabresd: config: remove space from mtdparts definition
Alice Guo [Mon, 30 Sep 2019 14:14:18 +0000 (22:14 +0800)]
MLK-22574-1: mx7dsabresd: config: remove space from mtdparts definition

there should no extra space in mtdparts definition

Signed-off-by: Alice Guo <alice.guo@nxp.com>
(cherry picked from commit 3e50cae62b1f83635ad835b8da840a7e294b7065)

5 years agoMLK-22444-5: imx: nandbcb: add support for writing BCB only
Igor Opaniuk [Mon, 16 Sep 2019 10:41:21 +0000 (13:41 +0300)]
MLK-22444-5: imx: nandbcb: add support for writing BCB only

Add subcommand for add writing BCB only, where we provide appropriate
offsets for firmware1 and firmware2 and size.

Example of usage:
> nandbcb bcbonly 0x00180000 0x00080000 0x00200000
Writing 1024 bytes to 0x0: randomizing
OK
Writing 1024 bytes to 0x20000: randomizing
OK

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
(cherry picked from commit 353a38576ed6f21431bf499a4b402a5ca571f0fa)

5 years agoMLK-22444-4: imx: nandbcb: refactor update function
Igor Opaniuk [Mon, 16 Sep 2019 10:41:20 +0000 (13:41 +0300)]
MLK-22444-4: imx: nandbcb: refactor update function

Move code for writing FCB/DBBT pages to a separate function

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
(cherry picked from commit c4e8b725681c9e7d18845260ac1061aedb9166a4)

5 years agoMLK-22444-3: imx: nandbcb: add support for i.MX7
Igor Opaniuk [Mon, 16 Sep 2019 10:41:19 +0000 (13:41 +0300)]
MLK-22444-3: imx: nandbcb: add support for i.MX7

Add support for updating FCB/DBBT on i.MX7:
- additional new fields in FCB structure
- Leverage hardware BCH/randomizer for writing FCB

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
(cherry picked from commit b4b3049b1e4a069e522a1112bf4f9e0253836b2d)

5 years agoMLK-22444-2: nand: mxs_nand: add API for switching different BCH layouts
Igor Opaniuk [Mon, 16 Sep 2019 10:41:18 +0000 (13:41 +0300)]
MLK-22444-2: nand: mxs_nand: add API for switching different BCH layouts

On i.MX7 in a sake of reducing the disturbances caused by a neighboring
cells in the FCB page in the NAND chip, a randomizer is enabled when
reading the FCB page by ROM bootloader.

Add API for setting BCH to specific layout (and restoring it back) used by
ROM bootloader to be able to burn it in a proper way to NAND using
nandbcb command.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Signed-off-by: Anti Sullin <anti.sullin@artecdesign.ee>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
(cherry picked from commit eaba02830252ed044e319571a7f3ebed412ae93b)

5 years agoMLK-22444-1: imx: gpmi: add defines for hw randominizer
Igor Opaniuk [Mon, 16 Sep 2019 10:41:17 +0000 (13:41 +0300)]
MLK-22444-1: imx: gpmi: add defines for hw randominizer

Extend GPMI Integrated ECC Control Register Description, include
additional defines for enabling randomizer function and providing
proper randomizer type.

For additional details check i.MX7 APR, section
9.6.6.3 GPMI Integrated ECC Control Register Description
(GPMI_ECCCTRLn)

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
(cherry picked from commit 212ab2205175b9be726ef6c00f523391882a7824)

5 years agoMLK-22673: sdp: Change bInterval of interrupt endpoint to 3
Sherry Sun [Thu, 26 Sep 2019 14:04:07 +0000 (10:04 -0400)]
MLK-22673: sdp: Change bInterval of interrupt endpoint to 3

Since the USB HID limits the maximum bandwidth(3072) for interrupt
endpoint transfers, when the bInterval set to 1, we can only support 3
boards to run sdp at the same time. In order to support more boards,
change the bInterval of interrupt endpoint to 3, which will not affect
the transmission speed.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit beb0283e6bac3d42cc87757e3c0e200e2ac3b68f)

5 years agoMLK-22577-2: usb: cdns3: Change the max packetsize of interrupt endpoint
Sherry Sun [Mon, 9 Sep 2019 21:14:16 +0000 (17:14 -0400)]
MLK-22577-2: usb: cdns3: Change the max packetsize of interrupt endpoint

When use ep1out interrupt endpoint to receive data in sdp, the max
packetsize of ep1out is set to 1024. But in cdns3 gadget driver, the
max packetsize is limited to 512 bytes in high speed. So we can't
implement data download through ep1out of cdns3 driver, here need
change the max packesize of interrupt endpoints to 1024.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 17f321b4a32cfaac52339172dc354729e641451a)

5 years agoMLK-22577-1: sdp: Add EP1_OUT as default data receive pipe in sdp
Sherry Sun [Mon, 9 Sep 2019 21:13:40 +0000 (17:13 -0400)]
MLK-22577-1: sdp: Add EP1_OUT as default data receive pipe in sdp

EP0 has been used to transfer file data in sdp before, but the max
packetsize of ep0 is 64 bytes. So in order to improve the file transfer
speed, here add the EP1_OUT interrupt endpoint which max packetsize is
set to 1024 byte.

After testing, it turns out that using ep1out is twice as fast as using
ep0 while receiving data in sdp.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 22614e317b7fdf4a716f2e5bde876649414ffd6c)

5 years agoMA-15334-2 enable trusty for imx8q standard Android uboot
faqiang.zhu [Wed, 18 Sep 2019 06:09:59 +0000 (14:09 +0800)]
MA-15334-2 enable trusty for imx8q standard Android uboot

"CONFIG_IMX_TRUSTY_OS=y" is added to the corresponding defconfig files
to include trusty related code.

MACROs are added in corresponding header files. standard android uboot
has more content than android auto uboot, the uboot malloc pool size is
changed from 76MB to 90MB to make the boot process can be handed over to
kernel without malloc problem.

Change-Id: I5072c20aa28fb1da93e889bb920955d2f1cfbefd
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMA-15334-1 add two defconfig files for trusty supported uboot
faqiang.zhu [Tue, 17 Sep 2019 06:37:07 +0000 (14:37 +0800)]
MA-15334-1 add two defconfig files for trusty supported uboot

add below two defconfig files:
configs/imx8qm_mek_android_trusty_defconfig
configs/imx8qxp_mek_android_trusty_defconfig

they are directly copied from below two files for the ease of tracking
the modifications:
configs/imx8qm_mek_android_defconfig
configs/imx8qxp_mek_android_defconfig

Change-Id: I84ca6ce62698b48bceb651df95ad61cf3e565e99
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMLK-22654 mx7ulp: Update wdog disable sequence
Ye Li [Wed, 18 Sep 2019 08:56:34 +0000 (01:56 -0700)]
MLK-22654 mx7ulp: Update wdog disable sequence

Update the mx7ulp wdog disable sequence to avoid potential reset issue
in unlock or refresh sequence. Both sequence need two words write
to wdog CNT register in 16 bus clocks window, if miss the window,
the write will cause violation in wdog and reset the chip.

Current u-boot code is using writel() function which has a DMB barrier
to order the memory access. The DMB between two words write may introduce
some delay in certain circumstance, causing the wdog reset due to 16 bus
clock window requirement.

This patch replaces writel() function by __raw_writel() to avoid such issue,
and improve to check if watchdog is already disabled or unlocked.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit b8c99d5f5bcc5573d3394b68890db16b6bb5fc88)

5 years agoMA-15467 Fix imx8mq build break
Jessie Hao [Wed, 18 Sep 2019 08:21:48 +0000 (16:21 +0800)]
MA-15467 Fix imx8mq build break

Disable some unnecessary configs to decrease the spl
size.

Test: build and boot on imx8mq_evk.

Change-Id: I6ad56af21ecf538c9e920581d870cce0d2fec286
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMLK-22576 imx8: video: Set clock parent for DC0 display channel
Ye Li [Mon, 9 Sep 2019 08:54:47 +0000 (01:54 -0700)]
MLK-22576 imx8: video: Set clock parent for DC0 display channel

When enable u-boot splash screen and set kernel dtb with -hdmi.dtb on
imx8qm, the kernel reboot (partition reboot) will hang in u-boot if HDMI
cable is plugged in.
The root cause is kernel set the clock source of DC0 display0 channel to
bypass clock, when doing reboot this clock setting may not be cleared. So
u-boot has wrong clock source and cause lpcg stop bit always set.

Fix the issue by adding the clock parent setting and not depend on default
parent value.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 104c4b5cdc83fb671c6474708bdd00c2dfb01113)
(cherry picked from commit 8a287c629018e6bf647c3c617fca3e6c94a3d2a4)

5 years agoMLK-22589 imx8: Enable lpcg for some clocks
Ye Li [Tue, 10 Sep 2019 12:56:24 +0000 (05:56 -0700)]
MLK-22589 imx8: Enable lpcg for some clocks

Have missed the lpcg settings when porting to 2019.04 u-boot

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 4096d7806a0dcc501123c8c2cdf734620e37d169)

5 years agoMLK-22556-5 mtd: nand-spi: Add micron chip MT29F2G01ABBGD
Ye Li [Wed, 4 Sep 2019 09:51:15 +0000 (02:51 -0700)]
MLK-22556-5 mtd: nand-spi: Add micron chip MT29F2G01ABBGD

Add the another 2Gb SPI-NAND flash which is 1.8v device and using
different device id.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-22556-4 mtd: nand-spi: Add micron chip MT29F4G01
Ye Li [Mon, 19 Aug 2019 02:36:52 +0000 (19:36 -0700)]
MLK-22556-4 mtd: nand-spi: Add micron chip MT29F4G01

Add 4Gb micron SPI nand chip MT29F4G01 which does not support QUAD IO
and has two dies. Also fix the BBM size to 4 Bytes according to datasheet.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22556-3 mtd: nand-spi: Print NAND flash device ID
Ye Li [Wed, 28 Aug 2019 05:30:39 +0000 (22:30 -0700)]
MLK-22556-3 mtd: nand-spi: Print NAND flash device ID

Current print for unrecognized ID only shows the buffer address not
show its device ID. Add a print to show the ID.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22556-2 mtd: nand: Fix NAND core build error
Ye Li [Mon, 1 Jul 2019 10:59:11 +0000 (03:59 -0700)]
MLK-22556-2 mtd: nand: Fix NAND core build error

Miss including common.h in two files and cause build error

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22556-1 spi: flexspi_nand: Add new flexspi nand driver
Ye Li [Mon, 1 Jul 2019 10:58:29 +0000 (03:58 -0700)]
MLK-22556-1 spi: flexspi_nand: Add new flexspi nand driver

Add flexspi_nand driver which works on iMX flexspi controller to support
SPI NAND flash. This driver requires DM_SPI and follows SPI-MEM interfaces
to adapt to the SPI NAND framework.

Note: Current implementation limits to the 12-bit column address. This is
popular in main stream SPI NAND and flash devices supported in u-boot.
If device with larger page size (> 4096) needs to support, we have to change
the driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22528 imx8: cpu: get reg with new bindings for sid
Peng Fan [Fri, 30 Aug 2019 03:37:31 +0000 (11:37 +0800)]
MLK-22528 imx8: cpu: get reg with new bindings for sid

The dash-linux tree has dropped pd tree, so we could not get the reg.
The power-doamins property has a cell indicating the resource id,
let's use it for sid programming.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22418 imx8: Support new power domain design during updating kernel DTB
Ye Li [Fri, 9 Aug 2019 01:12:31 +0000 (18:12 -0700)]
MLK-22418 imx8: Support new power domain design during updating kernel DTB

Upstream kernel refactors the power domain nodes and the usage of
power-domains property in DTB. So when checking available resources
in AP partition with this kernel DTB, u-boot will reports some
warnings.
This patch will support both two power domain designs during updating
kernel DTB.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoMA-15360 Verify vbmeta public key for non-trusty devices
Ji Luo [Tue, 27 Aug 2019 07:41:57 +0000 (15:41 +0800)]
MA-15360 Verify vbmeta public key for non-trusty devices

Don't skip vbmeta public key verify for non-trusty
platforms.

Test: boot on imx8mm.

Change-Id: I4712e5dd6e5c8848468e9d85c6b38eb5fb11377f
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMLK-22515 doc: habv4: mx8m: Remove u-boot.bin dependency
Breno Lima [Tue, 27 Aug 2019 13:48:51 +0000 (10:48 -0300)]
MLK-22515 doc: habv4: mx8m: Remove u-boot.bin dependency

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 <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agoMLK-22513 doc: ahab: Update OS container image target
Breno Lima [Tue, 27 Aug 2019 11:39:15 +0000 (08:39 -0300)]
MLK-22513 doc: ahab: Update OS container image target

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 <frank.zhang@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agoMLK-22505 mx7ulp: Enable UUU support for mx7ulp_evk_m4boot_defconfig target
Breno Lima [Mon, 26 Aug 2019 21:05:05 +0000 (18:05 -0300)]
MLK-22505 mx7ulp: Enable UUU support for mx7ulp_evk_m4boot_defconfig target

Currently it's not possible to boot mx7ulp_evk_m4boot_defconfig target:

  OBJCOPY examples/standalone/hello_world.bin
  LD      u-boot
arch/arm/lib/built-in.o: In function `setup_serial_tag':
/home/breno/NXP/bootloader/uboot-imx/arch/arm/lib/bootm.c:192: \
undefined reference to `get_board_serial'
Makefile:1505: recipe for target 'u-boot' failed
make: *** [u-boot] Error 1

Fix this issue by enabling UUU support for mx7ulp_evk_m4boot_defconfig target.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
5 years agoMA-15321-5 Enable secure unlock
Ji Luo [Mon, 19 Aug 2019 02:19:09 +0000 (10:19 +0800)]
MA-15321-5 Enable secure unlock

Enable secure unlock for imx8m and imx8q.

Test: build and unlock on closed imx8mm_evk and
      imx8qm_mek.

Change-Id: I4c8038ddffdd07084ea41735b90e6a76fd1076dd
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15321-4 Duplicate configs to enable secure unlock
Ji Luo [Mon, 19 Aug 2019 01:31:14 +0000 (09:31 +0800)]
MA-15321-4 Duplicate configs to enable secure unlock

Duplicate some configs for imx8m and imx8q.

Test: build.

Change-Id: I2d33685d68187eb831c48528da06684017951232
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15321-3 Support secure unlock feature
Ji Luo [Thu, 15 Aug 2019 12:53:53 +0000 (20:53 +0800)]
MA-15321-3 Support secure unlock feature

Decrypt and verify the secure credential in keymaster TA, unlock
operation can only be allowed after secure credential verify pass.

Since the mppubk can only be generated on hab closed imx8q, so secure
unlock feature can only supported when hab is closed.

Test: secure unlock credential verify on hab closed imx8mm_evk.

Change-Id: I1ab5e24df28d1e75ff853de3adf29f34da1d0a71
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15321-2 Add command to get serial number
Ji Luo [Thu, 15 Aug 2019 03:17:00 +0000 (11:17 +0800)]
MA-15321-2 Add command to get serial number

Add commands to support extract serial number from device.
Commands:
    $ fastboot oem get-serial-number
    $ fastboot get_staged <path-to-serial-number>

Test: serial number upload on imx8mm.

Change-Id: I5c905ab797d4fd28d76c8403914f191eaf2ef687
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMLK-22437-2 spi: fsl_qspi: Use driver data for different SOCs
Ye Li [Tue, 13 Aug 2019 10:57:56 +0000 (03:57 -0700)]
MLK-22437-2 spi: fsl_qspi: Use driver data for different SOCs

Add the driver data for each compatible string of different SOC. So we
can remove the SOC config and use driver data instead.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-22437-1 spi: fsl_qspi: Enable DDR mode on iMX7ULP
Ye Li [Tue, 13 Aug 2019 10:34:57 +0000 (03:34 -0700)]
MLK-22437-1 spi: fsl_qspi: Enable DDR mode on iMX7ULP

On iMX7ULP A0, PCC divider for QSPI has timing issue and it is
only possible to use the divider ratio equal to 1 (PCD=0).
This timing issue causes page program working abnormal if DDR_EN
is set. So current QSPI driver has disabled DDR mode on iMX7ULP

Since iMX7ULP B0 has fixed the issue, so re-enable the DDR mode
for iMX7ULP.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22425 TMU: iMX8MN: Enable loading TASR and TCALIV from fuse
Ye Li [Mon, 12 Aug 2019 03:42:27 +0000 (20:42 -0700)]
MLK-22425 TMU: iMX8MN: Enable loading TASR and TCALIV from fuse

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 <ye.li@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit 9fb7f904ff6a03e2951a770daba12a522373c8ae)

5 years agoMLK-22398-10 mx6sabresd: Enable PCIE IMX DM driver
Ye Li [Tue, 6 Aug 2019 08:04:55 +0000 (01:04 -0700)]
MLK-22398-10 mx6sabresd: Enable PCIE IMX DM driver

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 <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-22398-9 DTS: imx6qdl: Update DTS for PCIE
Ye Li [Tue, 6 Aug 2019 07:27:38 +0000 (00:27 -0700)]
MLK-22398-9 DTS: imx6qdl: Update DTS for PCIE

Add pci0 alias and gpr property for pcie node.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22398-8 mx6sxsdb: Enable PCIE IMX DM driver
Ye Li [Tue, 6 Aug 2019 08:02:41 +0000 (01:02 -0700)]
MLK-22398-8 mx6sxsdb: Enable PCIE IMX DM driver

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 <ye.li@nxp.com>
5 years agoMLK-22398-7 DTS: imx6sx: Update iMX6SX SDB DTS for PCIE
Ye Li [Tue, 6 Aug 2019 07:25:29 +0000 (00:25 -0700)]
MLK-22398-7 DTS: imx6sx: Update iMX6SX SDB DTS for PCIE

Add pci0 alias and gpr property for pcie node, and fix its reset-gpio
polarity.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22398-6 imx8qxp_mek: Enable PCIE on imx8qxp MEK board
Ye Li [Mon, 5 Aug 2019 06:17:20 +0000 (23:17 -0700)]
MLK-22398-6 imx8qxp_mek: Enable PCIE on imx8qxp MEK board

Update the configs tp enable the PCIE iMX DM driver on imx8qxp
MEK board.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22398-5 DTS: imx8qxp_mek: Add PCI alias and node for MEK board
Ye Li [Mon, 5 Aug 2019 06:16:15 +0000 (23:16 -0700)]
MLK-22398-5 DTS: imx8qxp_mek: Add PCI alias and node for MEK board

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

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22398-4 imx8qm_mek: Enable PCIE IMX DM driver on MEK board
Ye Li [Tue, 30 Jul 2019 08:36:47 +0000 (01:36 -0700)]
MLK-22398-4 imx8qm_mek: Enable PCIE IMX DM driver on MEK board

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 <ye.li@nxp.com>
5 years agoMLK-22398-3 DTS: imx8qm_mek: Add PCI alias and node for MEK board
Ye Li [Tue, 30 Jul 2019 08:36:13 +0000 (01:36 -0700)]
MLK-22398-3 DTS: imx8qm_mek: Add PCI alias and node for MEK board

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 <ye.li@nxp.com>
5 years agoMLK-22398-2 clk-imx8: Add pcie clocks for imx8qm/qxp
Ye Li [Tue, 30 Jul 2019 08:34:55 +0000 (01:34 -0700)]
MLK-22398-2 clk-imx8: Add pcie clocks for imx8qm/qxp

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

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22398-1 pcie_imx: Update PCIE IMX driver
Ye Li [Tue, 30 Jul 2019 08:34:07 +0000 (01:34 -0700)]
MLK-22398-1 pcie_imx: Update PCIE IMX driver

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 <ye.li@nxp.com>
5 years agopci: imx: Add DM and DT support
Marek Vasut [Sun, 9 Jun 2019 01:50:55 +0000 (03:50 +0200)]
pci: imx: Add DM and DT support

Add DM support and support for probing the iMX PCI driver from DT.
The legacy non-DM support is retained, however shall be removed once
DM PCI is the only option remaining.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
(cherry picked from commit a11c0f44b77b745519e35d30fc5eecb6206107fb)

5 years agopci: imx: Pass driver private data around
Marek Vasut [Sun, 9 Jun 2019 01:50:54 +0000 (03:50 +0200)]
pci: imx: Pass driver private data around

Pass the driver private data around the driver as much as possible, instead
of having it as a static global variable. This is done in preparation for
the DM conversion, no functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
(cherry picked from commit d2cc2e86f8e12393f2adf47c9a8694475e92e05a)

5 years agopci: imx: Fix potential 64bit memory access clamping
Marek Vasut [Sun, 9 Jun 2019 01:50:53 +0000 (03:50 +0200)]
pci: imx: Fix potential 64bit memory access clamping

The driver limits the config space base to 32bit, however it can be
64bit on 64bit iMX hardware too. Remove that limitation. This patch
has no impact on the iMX6, which is the only SoC currently supported
by this driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
(cherry picked from commit 90f87fb5258c57bbb8497ac23454e659169483e4)

5 years agopci: imx: Factor out hard-coded register base addresses
Marek Vasut [Sun, 9 Jun 2019 01:50:52 +0000 (03:50 +0200)]
pci: imx: Factor out hard-coded register base addresses

Pull out hard-coded register base addresses into driver private
structure in preparation for DM conversion. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
(cherry picked from commit 33f794be36e846a522c7020e642a1e89c0769b17)

5 years agoARM: imx: Call imx_pcie_remove() only for non-DM PCI driver
Marek Vasut [Sun, 9 Jun 2019 01:50:51 +0000 (03:50 +0200)]
ARM: imx: Call imx_pcie_remove() only for non-DM PCI driver

The DM iMX PCI driver has DM_FLAG_OS_PREPARE set and will call
imx_pcie_remove() from the .remove callback. Do not call it from
the architecture code again.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
(cherry picked from commit 42dc1230cdec48d0278dcc683bc14527cbea12c5)

5 years agoMLK-22387 configs: imx7dsabresd: correct the emmc_dev
Haibo Chen [Fri, 9 Aug 2019 06:10:33 +0000 (14:10 +0800)]
MLK-22387 configs: imx7dsabresd: correct the emmc_dev

For imx7d-sdb board, the emmc dev is 2, correct it, so
UUU can work well.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
5 years agoMLK-22417 imx8qxp_mek: Fix build break in fspi defconfig
Ye Li [Fri, 9 Aug 2019 02:51:44 +0000 (19:51 -0700)]
MLK-22417 imx8qxp_mek: Fix build break in fspi defconfig

When CI_UDC DM driver is enabled in SPL, it must enable EHCI host. Then when
building SPL DM USB host, the usb_hub.c requires to enable SPL ENV.
The imx8qxp fspi config save ENV in MMC due to fspi can't write when running with M4.
But MMC driver is not enabled in fspi SPL, so the build was broken.
Fix the issue by adding CONFIG_SPL_ENV_IS_NOWHERE to all defconfig with SPL ENV
is enabled.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22357-4 imx8: Enable usb2 configs on imx8 platform
Sherry Sun [Wed, 31 Jul 2019 19:31:46 +0000 (15:31 -0400)]
MLK-22357-4 imx8: Enable usb2 configs on imx8 platform

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 <sherry.sun@nxp.com>
5 years agoMLK-22357-3 usb: Clear the value of bEndpointAddress before refill it
Sherry Sun [Wed, 31 Jul 2019 21:07:04 +0000 (17:07 -0400)]
MLK-22357-3 usb: Clear the value of bEndpointAddress before refill it

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 <sherry.sun@nxp.com>
5 years agoMLK-22357-2 sdp/fastboot: Add board_usb_gadget_port_auto() to autodetect the connecte...
Sherry Sun [Fri, 2 Aug 2019 17:58:03 +0000 (13:58 -0400)]
MLK-22357-2 sdp/fastboot: Add board_usb_gadget_port_auto() to autodetect the connected usb port

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 <sherry.sun@nxp.com>
5 years agoMLK-22357-1 usb: Add handle_interrupts function pointer for UCLASS_USB_GADGET_GENERIC
Sherry Sun [Wed, 31 Jul 2019 00:42:02 +0000 (20:42 -0400)]
MLK-22357-1 usb: Add handle_interrupts function pointer for UCLASS_USB_GADGET_GENERIC

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 <sherry.sun@nxp.com>
5 years agoMLK-22409 imx8qm_mek: Remove the spl defconfig
Ye Li [Thu, 8 Aug 2019 02:18:53 +0000 (19:18 -0700)]
MLK-22409 imx8qm_mek: Remove the spl defconfig

imx8qm_mek_spl_defconfig was wrongly added when porting android support
from 2018.03. Since we have enabled SPL building in imx8qm_mek_defconfig,
no need to keep this defconfig

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22405 DTS: imx8mn: Add USB gadget nodes and alias
Ye Li [Wed, 7 Aug 2019 07:06:16 +0000 (00:06 -0700)]
MLK-22405 DTS: imx8mn: Add USB gadget nodes and alias

Since the DM USB gadget is enabled at default, have to add USB gadget
nodes and alias to DTS, otherwise u-boot will fails to find gadget
devices.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoTEE-427 DTS: imx8mn: add optee node
Clement Faure [Fri, 26 Jul 2019 13:05:19 +0000 (15:05 +0200)]
TEE-427 DTS: imx8mn: add optee node

Add Optee device tree node to enable Optee driver.
The Optee driver is required on imx8mn for the DEK blob encapsulation.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Acked-by: Ye Li <ye.li@nxp.com>
5 years agoMA-15282-2 Set AIY display as 720p mode
Ji Luo [Mon, 5 Aug 2019 01:24:51 +0000 (09:24 +0800)]
MA-15282-2 Set AIY display as 720p mode

Change the density for 1GB DDR AIY to 160 tvdpi
to match 720p display mode.

Test: boot.

Change-Id: Ie4d30023f66af028d1e3ad7fbeb5b4f7169d2e6c
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMLK-22339: mx6qsabreauto: configs: add default mtdids and mtdparts
Yang-yang Guo [Sat, 3 Aug 2019 09:57:12 +0000 (17:57 +0800)]
MLK-22339: mx6qsabreauto: configs: add default mtdids and mtdparts
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 <alice.guo@nxp.com>
5 years agoMA-15285 Sync config CONFIG_CI_UDC to fix build error
Ji Luo [Fri, 2 Aug 2019 06:44:44 +0000 (14:44 +0800)]
MA-15285 Sync config CONFIG_CI_UDC to fix build error

Add "CONFIG_CI_UDC" for some configs to fix build error.

Test: build.

Change-Id: Id6a39a6ff354b22fdadf9c3096a82c2aec397fc9
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15282 Set AIY display as 720p mode
Ji Luo [Thu, 1 Aug 2019 10:59:03 +0000 (18:59 +0800)]
MA-15282 Set AIY display as 720p mode

Setting the "androidboot.gui_resolution" will not make AIY use
720p ui resolution, set the "androidboot.displaymode" instead.

Test: boot on AIY.

Change-Id: I6575a77e23308946d02cf5faf56105fccc0b25b8
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15259-1 Enable trusty for imx8mq_evk
Ji Luo [Tue, 30 Jul 2019 07:56:46 +0000 (15:56 +0800)]
MA-15259-1 Enable trusty for imx8mq_evk

Open configs to enable trusty for imx8mq_evk.

Test: build and boot on imx8mq_evk.

Change-Id: I4770ddeabfe5f97e4c74324c3e2bbdb5ea9b8bde
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15257 Duplicate configs to enable trusty for imx8mq_evk
Ji Luo [Tue, 30 Jul 2019 06:43:58 +0000 (14:43 +0800)]
MA-15257 Duplicate configs to enable trusty for imx8mq_evk

Duplicate configs to enable trusty for imx8mq_evk.

Test: build.

Change-Id: Iefa6669f91b976e39c9ade6c014546741112c325
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15217-2 Enable dual bootloader for imx8m
Ji Luo [Mon, 29 Jul 2019 09:15:55 +0000 (17:15 +0800)]
MA-15217-2 Enable dual bootloader for imx8m

Open configs to enable dual bootloader feature for imx8m
platforms.

Test: A/B slot switch and spl recovery mode test.

Change-Id: I12a84bad52b74a2fe04f54dc4950a04b8e118384
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15217-1 Enable dual bootloader for imx8m
Ji Luo [Mon, 29 Jul 2019 05:20:36 +0000 (13:20 +0800)]
MA-15217-1 Enable dual bootloader for imx8m

Duplicate configs to enable dual bootloader for imx8m.

Change-Id: Iae2ec1f48023ef58970f13a8d1374fdee6b88aeb
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15180 Refine dual bootloader flow for imx8m
Ji Luo [Mon, 22 Jul 2019 01:14:28 +0000 (09:14 +0800)]
MA-15180 Refine dual bootloader flow for imx8m

We may need to enable the dual bootloader feature on non-trusty
platforms, skip the bootloader rollback index check in spl if
trusty is not enabled.

Don't generate rpmb key in spl, it should be generated in u-boot
proper with u-boot commands.

Test: dual bootloader on imx8mm.

Change-Id: Iac454e0140cd6f4472a66d267d9ba0d40df7102c
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMLK-22351 iMX8DXL: Add iMX8DXL phantom chip MEK board
Ye Li [Wed, 12 Jun 2019 03:27:12 +0000 (20:27 -0700)]
MLK-22351 iMX8DXL: Add iMX8DXL phantom chip MEK board

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 <ye.li@nxp.com>
5 years agoMLK-22336-4 imx8mm/8mn: configs: Move CONFIG_CI_UDC
Sherry Sun [Sat, 27 Jul 2019 01:22:54 +0000 (21:22 -0400)]
MLK-22336-4 imx8mm/8mn: configs: Move CONFIG_CI_UDC

For imx8mm/8mn, the CONFIG_CI_UDC is defined in
include/configs/imx8m*.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/imx8m*.h
files.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22336-3 usb: Kconfig: imply DM_USB_GADGET
Sherry Sun [Sat, 27 Jul 2019 01:12:21 +0000 (21:12 -0400)]
MLK-22336-3 usb: Kconfig: imply DM_USB_GADGET

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 <sherry.sun@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22336-2 dts: Add a new usb gadget node on imx6/7/7ulp/8/8mm
Sherry Sun [Thu, 25 Jul 2019 21:20:26 +0000 (17:20 -0400)]
MLK-22336-2 dts: Add a new usb gadget node on imx6/7/7ulp/8/8mm

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 <sherry.sun@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22336-1 usb: ci_udc: Convert driver to DM_USB_GADGET
Sherry Sun [Tue, 23 Jul 2019 19:21:57 +0000 (15:21 -0400)]
MLK-22336-1 usb: ci_udc: Convert driver to DM_USB_GADGET

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 <sherry.sun@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22179-2 imx8mn_evk: Enable FSPI DQS loopback for high freq
Ye Li [Wed, 3 Jul 2019 08:01:44 +0000 (01:01 -0700)]
MLK-22179-2 imx8mn_evk: Enable FSPI DQS loopback for high freq

There is an divider on imx8mn will always divide 2 to flexspi root clock.
So actual SCLK output to device is 50Mhz on imx8mn not 100Mhz.

After changing the root clock setting to configure SCLK to 100Mhz, found
the read data is not correct. Must enable the internal DQS pad loopback
to fix the problem.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 9ff3ae4f9ebbb81bd42d81729cec4525c6e9b33e)

5 years agoMLK-22179-1 fsl_fspi: Add a config to enable dummy DQS loopback from pad
Ye Li [Wed, 3 Jul 2019 07:58:13 +0000 (00:58 -0700)]
MLK-22179-1 fsl_fspi: Add a config to enable dummy DQS loopback from pad

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

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 256fcd3df1b0a0b9c0fb730fabb7497800cda3a6)

5 years agoMLK-22293-12 mx6q/qp: Update SATA codes and configs for sabre boards
Ye Li [Tue, 23 Jul 2019 03:53:31 +0000 (20:53 -0700)]
MLK-22293-12 mx6q/qp: Update SATA codes and configs for sabre boards

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 <ye.li@nxp.com>
5 years agoMLK-22293-11 DTS: imx6q/qp: Add gpr property to sata node
Ye Li [Tue, 23 Jul 2019 03:52:12 +0000 (20:52 -0700)]
MLK-22293-11 DTS: imx6q/qp: Add gpr property to sata node

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 <ye.li@nxp.com>
5 years agoMLK-22293-10 imx6: Remove AHCI device before boot OS
Ye Li [Tue, 23 Jul 2019 03:51:25 +0000 (20:51 -0700)]
MLK-22293-10 imx6: Remove AHCI device before boot OS

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

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22293-9 imx6: clock: Enable sata clock for imx AHCI
Ye Li [Tue, 23 Jul 2019 03:50:41 +0000 (20:50 -0700)]
MLK-22293-9 imx6: clock: Enable sata clock for imx AHCI

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 <ye.li@nxp.com>
5 years agoMLK-22293-8 iMX8QM: Clean up SATA and enable AHCI on MEK
Ye Li [Thu, 18 Jul 2019 03:12:47 +0000 (20:12 -0700)]
MLK-22293-8 iMX8QM: Clean up SATA and enable AHCI on MEK

Remove unused old codes and configs for SATA. 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 <ye.li@nxp.com>
5 years agoMLK-22293-7 DTS: Update iMX8QM MEK dts to enable SATA
Ye Li [Thu, 18 Jul 2019 03:16:24 +0000 (20:16 -0700)]
MLK-22293-7 DTS: Update iMX8QM MEK dts to enable SATA

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

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22293-6 clk-imx8: Add SATA relevant clock for iMX8QM
Ye Li [Fri, 19 Jul 2019 03:41:46 +0000 (20:41 -0700)]
MLK-22293-6 clk-imx8: Add SATA relevant clock for iMX8QM

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 <ye.li@nxp.com>
5 years agoMLK-22293-5 env: Update SATA env location driver to use SCSI
Ye Li [Tue, 23 Jul 2019 01:23:05 +0000 (18:23 -0700)]
MLK-22293-5 env: Update SATA env location driver to use SCSI

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

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22293-4 fastboot: Change to use SCSI interface for sata device
Ye Li [Fri, 19 Jul 2019 03:42:17 +0000 (20:42 -0700)]
MLK-22293-4 fastboot: Change to use SCSI interface for sata device

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

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22293-3 ata: ahci: Fix nport index issue
Ye Li [Fri, 19 Jul 2019 03:40:23 +0000 (20:40 -0700)]
MLK-22293-3 ata: ahci: Fix nport index issue

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 <ye.li@nxp.com>
5 years agoMLK-22293-2 ata: Add iMX AHCI driver
Ye Li [Thu, 18 Jul 2019 02:54:55 +0000 (19:54 -0700)]
MLK-22293-2 ata: Add iMX AHCI driver

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 <ye.li@nxp.com>
5 years agoMLK-22293-1 Revert "MLK-14938-18 sata: Add i.MX8 SATA support"
Ye Li [Tue, 23 Jul 2019 04:00:25 +0000 (21:00 -0700)]
MLK-22293-1 Revert "MLK-14938-18 sata: Add i.MX8 SATA support"

We will implement a new imx AHCI driver for imx6q/qp/imx8qm, so
revert previous changes for SATA on imx8qm.
This reverts commit 9f538d64a8f7b216751f722e9c9ab4dc3af598ce.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMA-15208 Remap mmc device id in spl
Ji Luo [Wed, 24 Jul 2019 03:52:18 +0000 (11:52 +0800)]
MA-15208 Remap mmc device id in spl

MMC device id remap function "board_mmc_get_env_dev()" was
removed in u-boot v2019 because we add the mmc device aliases
in dts file. But we still need to remap the mmc device id in
spl or read/write rpmb keyslot package will fail.

This patch adds mmc device id remap function in spl to get the
correct device id.

Test: boot on imx8mm with trusty enabled.

Change-Id: I41c46494326d9eb2658d2cda692968fb895d0292
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15158 Set spl recovery mode for dual bootloader
Ji Luo [Thu, 18 Jul 2019 05:56:45 +0000 (13:56 +0800)]
MA-15158 Set spl recovery mode for dual bootloader

The A/B slot selection is moved to spl, it may lead to hang
if no bootable slots found. The only way to recover the board
is re-flash images with uuu tool, which is quite inconvenient
for some customers who can't enter serial download mode.

This patch will set "spl recovery mode" which will give us a
chance to re-flash images with fastboot commands.

Test: Enter spl recovery mode and flash images when no bootable
      slots found.

Change-Id: I31278f5212bde7609fe2f49e77b3849e92c0c516
Signed-off-by: Ji Luo <ji.luo@nxp.com>