u-boot.git
5 years agoMLK-18591-8 android: Add imx8/imx8m reference boards support
Ye Li [Thu, 7 Jun 2018 14:19:57 +0000 (07:19 -0700)]
MLK-18591-8 android: Add imx8/imx8m reference boards support

Add board level support for android and android auto. Each board has
android/andriod_auto specified header file for defining relevant configuraitons.
And add build targets for their android uboot images building.

Change-Id: Ib7c10404dbca9237ab074427d3cb10d98bfc0ed9
Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMA-14916-4 support dual bootloader for imx8m, imx8q
Ji Luo [Fri, 21 Jun 2019 07:53:50 +0000 (15:53 +0800)]
MA-14916-4 support dual bootloader for imx8m, imx8q

this commit is a merge of three patches from imx_v2018.03 as below:

1.
commit dbcf1e3cc079d2f1b3df6c4c9ec3a34d0c05eb4c
Author: Luo Ji <ji.luo@nxp.com>
Date:   Fri Jun 8 10:31:11 2018 +0800

    [iot] Support dual bootloader in SPL

    Move the A/B slot check to SPL, the A/B slot switch
    workflow is just like what we have in libavb_ab.

    Test: A/B select works fine on imx8m.

2.
commit 71562aae3b8123ccd7503e596e478951568fcd24
Author: Ji Luo <ji.luo@nxp.com>
Date:   Mon Jan 14 18:28:08 2019 +0800

    MA-13938 [Android] imx8q: Support dual bootloader feature

    Support dual bootloader feature for imx8q which uses the
    container format. Move the A/B slot select and verify to
    SPL stage, the bootloader rollback index will be stored
    at the last 8K bytes of eMMC rpmb storage.

    Test: Boot and rbindex verify pass on imx8q.

Change-Id: Ic9410a48092cc05de599dd897fc912177e2a1fe1
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMLK-22258 imx8mn: Update speed grade
Ye Li [Fri, 12 Jul 2019 06:20:02 +0000 (23:20 -0700)]
MLK-22258 imx8mn: Update speed grade

imx8mn speed grade fuse uses new definitions as below. So have
to update get_cpu_speed_grade_hz function to match it.

SPEED_GRADING[5:0]:
SPEED_GRADE[5:4]    SPEED_GRADE[3:0]    MHz
      xx                0000            2300
      xx                0001            2200
      xx                0010            2100
      xx                0011            2000
      xx                0100            1900
      xx                0101            1800
      xx                0110            1700
      xx                0111            1600
      xx                1000            1500
      xx                1001            1400
      xx                1010            1300
      xx                1011            1200
      xx                1100            1100
      xx                1101            1000
      xx                1110             900
      xx                1111             800

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

5 years agoMLK-21297 imx8: Add DEK blob encapsulation
Clement Faure [Tue, 28 May 2019 15:01:07 +0000 (17:01 +0200)]
MLK-21297 imx8: Add DEK blob encapsulation

Add DEK encapsulation support for imx8. The DEK blob is generated by the
SECO through the SCFW API.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
5 years agoMLK-20373-2 dm: serial: introduce puts hook
Peng Fan [Thu, 15 Nov 2018 05:13:14 +0000 (13:13 +0800)]
MLK-20373-2 dm: serial: introduce puts hook

Introduce puts hook for dm serial driver.

Change-Id: I75423998c7d8db20949bae6ac46a094dc62c9612
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
5 years agoMA-14916-8 [iot] Set power-on write protection for boot1 partition
Luo Ji [Wed, 3 Jul 2019 06:38:16 +0000 (14:38 +0800)]
MA-14916-8 [iot] Set power-on write protection for boot1 partition

The RPMB keyslot is stored in last block of boot1 partition which
is easily erased or tampered, set power-on write protection for this
partition to prevent corruption.

Test: Power-on write protection works as expected on imx8m.

Change-Id: Ib7e1094b979f7d94c0a2817391c5b3b5f3205d76
Signed-off-by: Luo Ji <ji.luo@nxp.com>
5 years agoMA-14916-7 comply with mmc struct definition in avb library
faqiang.zhu [Wed, 3 Jul 2019 06:23:06 +0000 (14:23 +0800)]
MA-14916-7 comply with mmc struct definition in avb library

Driver Module may be used in SPL, with CONFIG_BLK enabled for U-Boot,
CONFIG_SPL_BLK will be enabled, struct mmc definition will be different.
comply with that mmc struct definition in fsl_avbkey.c file to handle
conditions when DM is used in SPL.

Change-Id: I632600556e764b25228ba467a5e5141cf3fc3dfe
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMA-13937 Enable CAAM for imx8q
Ji Luo [Fri, 11 Jan 2019 01:46:53 +0000 (09:46 +0800)]
MA-13937 Enable CAAM for imx8q

The CAAM driver in u-boot will use JR0 by default, but for
imx8q, both JR0 and JR1 are assigned to SECO and  A core
should never access them.
Power on the JR3 in this patchset and use it to complete
the CAAM operations for imx8q.

Test: CAAM self test cases pass for imx8q.

below patches are merged to this commit:
MA-13964 imx8q: Kick the CAAM JR before kicking the SMMU
MA-13969 Fix CAAM build warnings

Change-Id: Ie3d77d1f2910e7f4c257c797c12b5c8a30ad936a
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-13936 Add CAAM self test
Ji Luo [Fri, 11 Jan 2019 01:01:37 +0000 (09:01 +0800)]
MA-13936 Add CAAM self test

Add CAAM RNG generating and BLOB encap/decap
self test cases.

Test: Test cases pass on imx8qm_mek/imx6qp_sabresd.

Change-Id: I538f7b1581b36df83a3006ac133ca9e7b57ab4f0
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-14916-3: Add mx6/7 reference board support to enable android fastboot
Ye Li [Mon, 21 May 2018 09:32:08 +0000 (02:32 -0700)]
MA-14916-3: Add mx6/7 reference board support to enable android fastboot

this commit is based on the cherrypick of a patch from imx_v2018.03 with
below commit info:
"
commit f15e20eeb42d421d694e75d6f159d908b5606e1f
Author: Ye Li <ye.li@nxp.com>
Date:   Mon May 21 02:32:08 2018 -0700

MLK-18591-7 android: Add mx6/7 reference board support to enable android
fastboot

Add board level support for android fastboot feature. Each board has
a android specified header file for defining android related configuraitons.
And add build targets for their android uboot images building.
"
and then some modification is made to make the compilation pass.
the defconfig files modification is based on corresponding files from
BSP team, ucmd/acmd function is disabled for Android U-Boot.

with defconfig files for 6ul chips, the compilation will terminate with
failure on imx_v2018.03, so no modification was made on them.

Change-Id: Ibe5979239e5e6a78b06f332c9041d1f1de2566fc
Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMA-14916-1 adapt to the directory change of libavb
faqiang.zhu [Tue, 11 Jun 2019 03:02:32 +0000 (11:02 +0800)]
MA-14916-1 adapt to the directory change of libavb

libavb is now under the directory of lib/, not lib/avb/ as before, to
adapt to this change, some modifications are made:
1. header file inclusion change, including parameter of -I option in
Makefile
2. remove avb_sysdeps_posix.o in Makefile since the functions in
avb_sysdeps_posix.c has beed redefined in fsl_avb_sysdeps_uboot.c

Change-Id: I4216e3ddb4e3e810783e4f46b953eda510c2627b
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMLK-22245 mx6qp: Fix issue caused by moving pre_misc_setting()
Ye Li [Wed, 10 Jul 2019 05:28:40 +0000 (22:28 -0700)]
MLK-22245 mx6qp: Fix issue caused by moving pre_misc_setting()

The commit "MLK-22219 mx6: Place pre_misc_setting() into a common location"
causes iMX6QP boot hang. Because QoS settings in pre_misc_setting depends on
IPU and PRG clocks enabled.
So still calling pre_misc_setting in enable_ipu_clock, and move
enable_ipu_clock to arch_cpu_init

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoTEE-346 Add DEK blob encapsulation for imx8m
Clement Faure [Thu, 23 May 2019 14:00:11 +0000 (16:00 +0200)]
TEE-346 Add DEK blob encapsulation for imx8m

Add DEK blob encapsulation support for IMX8M through "dek_blob" command.
On ARMv8, u-boot runs in non-secure, thus cannot encapsulate a DEK blob
for encrypted boot.
The DEK blob is encapsulated by OP-TEE through a trusted application call.
U-boot sends and receives the DEK and the DEK blob binaries through OP-TEE
dynamic shared memory.

To enable the DEK blob encapsulation, add to the defconfig:
CONFIG_SECURE_BOOT=y
CONFIG_FAT_WRITE=y
CONFIG_CMD_DEKBLOB=y

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22192 imx8mn: Add variant parts support
Ye Li [Thu, 4 Jul 2019 09:20:23 +0000 (02:20 -0700)]
MLK-22192 imx8mn: Add variant parts support

According to datasheet, there are totally 6 variant parts for imx8mn:
Quad, Dual, Solo with core number changed.
QuadLite, DualLite, SoloLite with core number changed and GPU disabled.

Add the support for these variant parts
1. Recognize the variant parts according to fuse
2. Power down disabled cores
3. Remove the cores node and disable GPU node from kernel DTB before
   entering kernel.
4. Since the mscale dummy id has been used out, increase one more bit
   (bit 8) for cpu id.

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

5 years agoMLK-22101 configs: imx8mn: add jailhouse env
Peng Fan [Tue, 25 Jun 2019 01:42:02 +0000 (09:42 +0800)]
MLK-22101 configs: imx8mn: add jailhouse env

Add jailhouse env for booting linux to support jailhouse

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

5 years agoMLK-22080 imx8mn_evk: add SPL and u-boot build for nominal mode
Ye Li [Fri, 21 Jun 2019 03:49:56 +0000 (20:49 -0700)]
MLK-22080 imx8mn_evk: add SPL and u-boot build for nominal mode

Add imx8mn_ddr4_evk_nom_defconfig to generate SPL and u-boot to force SOC
to nominal mode. So the VDD_SOC will be 0.85V and ARM will be fixed to 0.85V
with DVFS disabled in kernel.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit 0dca81742f51141ce0fb2117cbc1e99b84945009)

5 years agoMLK-22078 romapi: Fix issue for stream mode with secure boot enabled
Ye Li [Fri, 21 Jun 2019 03:09:07 +0000 (20:09 -0700)]
MLK-22078 romapi: Fix issue for stream mode with secure boot enabled

When download image through ROM API for stream mode (USB, eMMC fastboot).
We uses tricky way to get the total image size:
The spl_load_simple_fit is called but the data reading is invalid, so the image
data is not really downloaded.
We should not call HAB authenticate in this tricky way. Otherwise it
will alway fail.
This patch add a new flag SPL_FIT_BYPASS_POST_LOAD to skip the authentication
only for this tricky using.

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

5 years agoMLK-22047 imx8mn: pins: add SION for I2C
Peng Fan [Wed, 19 Jun 2019 09:34:52 +0000 (17:34 +0800)]
MLK-22047 imx8mn: pins: add SION for I2C

SION bit needs to be set when the pin are used for I2C.

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

5 years agoMLK-22001 imx8mn_evk: tune DDR4 QoS to improve performance
Jian Li [Mon, 10 Jun 2019 06:43:12 +0000 (14:43 +0800)]
MLK-22001 imx8mn_evk: tune DDR4 QoS to improve performance

DDR efficiency improved to 78% while runing LCDIF,GPU,CPU

Signed-off-by: Jian Li <jian.li@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
(cherry picked from commit cb91ff49c461974f1b2e1aa2e41e802cbbe4a087)

5 years agoMLK-21992-2 imx8mn_evk: add defconfig for flexspi nor boot
Ye Li [Tue, 11 Jun 2019 03:58:58 +0000 (20:58 -0700)]
MLK-21992-2 imx8mn_evk: add defconfig for flexspi nor boot

Add imx8mn_ddr4_evk_fspi_defconfig used for flexspi nor boot. Move
the u-boot environments to flexspi nor.

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

5 years agoMLK-21992-1 imx8mn_evk: Remove SPL MMC and SPL USB SDP configs
Ye Li [Tue, 11 Jun 2019 02:41:24 +0000 (19:41 -0700)]
MLK-21992-1 imx8mn_evk: Remove SPL MMC and SPL USB SDP configs

Since we are using ROM API to load image, then drivers like
SPL MMC and SPL USB SDP are not needed. Remove them from defconfig
file to reduce SPL size.

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

5 years agoMLK-21988 imx8mn: rom_api: Change to support secondary boot on SD/eMMC
Ye Li [Mon, 10 Jun 2019 11:02:00 +0000 (04:02 -0700)]
MLK-21988 imx8mn: rom_api: Change to support secondary boot on SD/eMMC

ROM supports secondary boot which can boot from a new offset specified
by fuse. So adjust the offset calculation by counting the ROM's image_offset
parameter for SD/eMMC.
The secondary boot on flexspi is different like SD/eMMC. ROM will map the
space of secondary boot to the start of flexspi AHB memory. So it is same
as primary boot for SPL.

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

5 years agoMLK-21950-02 board: imx8mn_evk: update the ddr performance setting
Jacky Bai [Wed, 5 Jun 2019 05:37:44 +0000 (13:37 +0800)]
MLK-21950-02 board: imx8mn_evk: update the ddr performance setting

Update the ddr performance setting on i.MX8MN DDR4 EVK board.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
(cherry picked from commit 745f7a4e916d84bc61f2b131cffd50f53c6c1394)

5 years agoMLK-21950-01 driver: ddr: skip ddr_ss_gpr config on imx8mn
Jacky Bai [Wed, 5 Jun 2019 03:26:12 +0000 (11:26 +0800)]
MLK-21950-01 driver: ddr: skip ddr_ss_gpr config on imx8mn

There is no DDR_SS_GPR0 exits on i.MX8MN, so skip setting
this register on i.MX8MN.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
(cherry picked from commit a8040bc4524687ca026b9960fda18eb19606dade)

5 years agoMLK-21889-11 imx8mn_evk: Add board codes and defconfig for iMX8M Nano EVK
Ye Li [Wed, 8 May 2019 07:23:21 +0000 (00:23 -0700)]
MLK-21889-11 imx8mn_evk: Add board codes and defconfig for iMX8M Nano EVK

Add board level codes, header file, and defconfig for iMX8M Nano EVK
board. The board has similar design as iMX8MM EVK.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
(cherry picked from commit 01aa313aeb8df58a58bd1c7481e25fa89b42da2a)

5 years agoMLK-21889-10 DTS: imx8mn: Add DTS file for iMX8M Nano EVK board
Ye Li [Wed, 8 May 2019 07:12:28 +0000 (00:12 -0700)]
MLK-21889-10 DTS: imx8mn: Add DTS file for iMX8M Nano EVK board

Add the board DTS file for iMX8MN EVK. The base board re-use base board
of iMX8MM EVK. The CPU board has most of same design with iMX8MM CPU
board, except DDR4 and some PMIC power rails.

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

5 years agoMLK-21889-9 DTS: imx8mn: Add binding files and imx8mn.dtsi
Ye Li [Wed, 21 Nov 2018 07:42:04 +0000 (23:42 -0800)]
MLK-21889-9 DTS: imx8mn: Add binding files and imx8mn.dtsi

Add soc DTSi and clock/pinctrl binding files. The pinctrl binding
file is v0.03 generated by tool

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

5 years agoMLK-21889-8 fastboot: Set bootloader offset for imx8mn
Ye Li [Wed, 22 May 2019 12:40:50 +0000 (05:40 -0700)]
MLK-21889-8 fastboot: Set bootloader offset for imx8mn

The bootloader offset of SD and eMMC user area on imx8mn is 32KB.
When booting from eMMC boot0 or boot1 partition, no matter normal boot
or fastboot, the image offset is 0.

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

5 years agoMLK-21889-7 EHCI: Enable iMX EHCI driver for iMX8M Nano
Ye Li [Wed, 8 May 2019 07:10:57 +0000 (00:10 -0700)]
MLK-21889-7 EHCI: Enable iMX EHCI driver for iMX8M Nano

Add the IMX8MN to the EHCI-MX7 kconfig dependency.

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

5 years agoMLK-21889-6 video: Add iMX8M Nano support to MIPI DSI
Ye Li [Wed, 8 May 2019 07:09:54 +0000 (00:09 -0700)]
MLK-21889-6 video: Add iMX8M Nano support to MIPI DSI

Add the IMX8MN to the SEC MIPI DSI kconfig dependency, and
update display GPR registers for iMX8MN changes.

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

5 years agoMLK-21889-5 imx8mn: Update get_boot_device
Ye Li [Wed, 22 May 2019 11:03:09 +0000 (04:03 -0700)]
MLK-21889-5 imx8mn: Update get_boot_device

There is no ROM INFO structure on iMX8MN, we should Use new ROM API
to get boot device from ROM

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

5 years agoMLK-21889-4 imx8mn: Add ROMAPI calls for SPL FIT loading
Ye Li [Mon, 26 Nov 2018 10:55:56 +0000 (02:55 -0800)]
MLK-21889-4 imx8mn: Add ROMAPI calls for SPL FIT loading

i.MX8MNano ROM exports APIs to load images from boot device. We use this way
for SPL loading FIT image. Users need enable CONFIG_SPL_IMX_ROMAPI_SUPPORT
and set a buffer address via CONFIG_SPL_IMX_ROMAPI_LOADADDR

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

5 years agoMLK-21889-3 imx: Update SPL boot device for iMX8MN
Ye Li [Wed, 21 Nov 2018 08:10:42 +0000 (00:10 -0800)]
MLK-21889-3 imx: Update SPL boot device for iMX8MN

We use same boot device logic with iMX8MM

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

5 years agoMLK-21889-2 imx8mn: Add runtime soc type check
Ye Li [Tue, 25 Dec 2018 06:53:40 +0000 (22:53 -0800)]
MLK-21889-2 imx8mn: Add runtime soc type check

Add is_imx8mn for runtime soc type checking, and update drivers to use it.

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

5 years agoMLK-21889-1 imx8mn: Add new SoC iMX8M Nano
Ye Li [Fri, 16 Nov 2018 03:07:46 +0000 (19:07 -0800)]
MLK-21889-1 imx8mn: Add new SoC iMX8M Nano

Introduce a new SoC kconfig CONFIG_IMX8MN.
Since the chip is derived from iMX8MM, we reuse the clocks and registers
mapping files of iMX8MM. The iomux header file is the latest v0.03
generated by tool and add SION for i2c and usdhc3.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
(cherry picked from commit 3981af0da5ce4640fb1281526ae4b58108572e80)

5 years agoMA-14916-9 fix build warnings with BSP defconfig
faqiang.zhu [Mon, 8 Jul 2019 12:30:04 +0000 (20:30 +0800)]
MA-14916-9 fix build warnings with BSP defconfig

the warning info is as below:

drivers/fastboot/fb_fsl/fb_fsl_command.c:66:13: warning: 'process_erase_mmc' defined but not used [-Wunused-function]
static void process_erase_mmc(const char *cmdbuf, char *response)
             ^

move this process_erase_mmc function to fb_fsl_dev.c and make remove the
static attribute.

Change-Id: Ifc30348e53693e26119c760406b4c650e591aef4
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMA-14916-2 fix fastboot getvar issue in 32bit device
faqiang.zhu [Thu, 13 Jun 2019 02:27:11 +0000 (10:27 +0800)]
MA-14916-2 fix fastboot getvar issue in 32bit device

in imx_v2018.03, fastboot response buffer is an array defined in the
handle function for "fastboot getvar", sizeof(response) will get the
length of this array, which is FASTBOOT_RESPONSE_LEN.

but in imx_v2019.04, "response" in "fastboot getvar" function is a
pointer parameter transmitted to it, so sizeof(response) will only get
the length of the pointer, not the buffer length. in 32bit device, the
pointer length is 4, so the header info of fastboot can't be fully
stored in the buffer in this case, cause the response info can't be
parsed by host fastboot.

this commit replace "sizeof(response)" to be FASTBOOT_RESPONSE_LEN
directly.

Change-Id: I9d3893406c0361b7aba9cba74b2d751bc311d142
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMLK-22219 mx6: Place pre_misc_setting() into a common location
Fabio Estevam [Thu, 4 Jul 2019 17:12:24 +0000 (14:12 -0300)]
MLK-22219 mx6: Place pre_misc_setting() into a common location

Currently the NoC settings are only done if the splash screen
support is enabled.

However, this can cause IPU issues on i.MX6QP in the kernel, when
splash screen is not enabled in U-Boot.

To avoid such problems, place the pre_misc_setting() function
into a common location that will always run on i.MX6QP/DP.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
5 years agoMLK-22180 clk-imx8: Fix wrong name for iMX8QM ENET clock
Ye Li [Wed, 3 Jul 2019 10:05:29 +0000 (03:05 -0700)]
MLK-22180 clk-imx8: Fix wrong name for iMX8QM ENET clock

Fix the issue that using imx8qxp ENET clock name in iMX8QM table.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoMA-14916-4 [iot] Update size format for write_counter
Luo Ji [Thu, 21 Jun 2018 01:34:41 +0000 (09:34 +0800)]
MA-14916-4 [iot] Update size format for write_counter

This commit is cherry-picked from community:
commit 343749c42554b058e53086aefe21d47b383326d5
author Kever Yang <kever.yang@rock-chips.com>
date Wed, 19 Jul 2017 18:13:59 +0800 (19:13 +0900)

mmc: rpmb: update size format for write_counter

According to MMC spec, the write_counter is 4-byte length,
use 'int' instead of 'long' type for the 'long' is not 4-byte
in 64 bit CPU.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Test: Access RPMB successfully on imx8m.

Change-Id: I402b53c990856c2cdf7c3686eabf259f5581464d
Signed-off-by: Luo Ji <ji.luo@nxp.com>
5 years agoMA-14916 fix build and function issues of fastboot for Android
faqiang.zhu [Wed, 5 Jun 2019 11:52:48 +0000 (19:52 +0800)]
MA-14916 fix build and function issues of fastboot for Android

to fix build issues, add two header files, "fastboot_lock_unlock.h" is
copied from imx_v2018.03 branch, "fb_fsl_common.h" contains some
varialbes and a function used in more than one files.

the places where "fastboot_lock_unlock.h" is included is modified to
adapt to this change.
"fsl_fastboot.h" is renamed to "fb_fsl.h", the places where
"fsl_fastboot.h" is included is modified to adapt to this change.

to fix function issues, command handle function in "fb_fsl_command.c" is
modified.

build based on imx8mm_ddr4_evk, the board can boot and basic fastboot
function can work.

Change-Id: I34961ef70351a1ee4c84b6721dba5ac7b261a0d3
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMLK-22045-7 defconfig: Add CONFIG_DM_USB_GADGET and CONFIG_SPL_DM_USB_GADGET flag
Sherry Sun [Wed, 19 Jun 2019 19:47:04 +0000 (15:47 -0400)]
MLK-22045-7 defconfig: Add CONFIG_DM_USB_GADGET and CONFIG_SPL_DM_USB_GADGET flag

Add CONFIG_DM_USB_GADGET and CONFIG_SPL_DM_USB_GADGET flag on i.MX8QM
and QXP to support DM USB gadget driver.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
5 years agoMLK-22045-6 imx8qm/qxp: Delete the Non-DM USB board level codes
Sherry Sun [Wed, 19 Jun 2019 20:11:08 +0000 (16:11 -0400)]
MLK-22045-6 imx8qm/qxp: Delete the Non-DM USB board level codes

Since now we use DM USB gadget driver, Some parts of the Non-DM USB
gadget driver codes are not needed, so delete the Non-DM USB board
level codes on imx8 platform.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
5 years agoMLK-22045-5 cdns3: Change the usb3 host driver to match the new usb3 node
Sherry Sun [Thu, 27 Jun 2019 18:33:36 +0000 (14:33 -0400)]
MLK-22045-5 cdns3: Change the usb3 host driver to match the new usb3 node

In order to enable both DM usb3 gadget driver and host driver, a new usb3
host node was added. The DM usb3 host driver should also be changed to
match the new usb3 node in dts on imx8qm/qxp.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
5 years agoMLK-22045-4 dts: Add a new usb3 host node on imx8qm/qxp
Sherry Sun [Thu, 27 Jun 2019 18:10:31 +0000 (14:10 -0400)]
MLK-22045-4 dts: Add a new usb3 host node on imx8qm/qxp

Since one node in dts only can bind with one driver in u-boot,
now both DM usb gadget and host drivers are enabled in imx8qm/qxp,
but there only one usb3 node in dts, so the DM usb gadget driver
and host driver can not both work.

So add a new usb3 host node on imx8qm/qxp to fix this issue, and add
a new alias for the usb3 host node which is used as seq number in DM
USB host driver.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
5 years agoMLK-22045-3 cdns3: Add cdns3_generic_peripheral DM gadget driver
Sherry Sun [Wed, 19 Jun 2019 20:44:15 +0000 (16:44 -0400)]
MLK-22045-3 cdns3: Add cdns3_generic_peripheral DM gadget driver

Add cdns3_generic_peripheral DM gadget driver for i.MX8QM and QXP.

The driver flag is set to CONFIG_DM_USB_GADGET and
CONFIG_SPL_DM_USB_GADGET while using SPL, and the driver is belong to
UCLASS_USB_GADGET_GENERIC uclass.

For the DM gadget driver, it will parse the reg, clocks and usbphy
properties from node in DTS. So the power and clks of cdns3 controller
and cdns3 phy will be both enabled in DM gadget driver.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
5 years agoMLK-22045-2 sdp: Add DM gadget support for sdp
Sherry Sun [Wed, 19 Jun 2019 20:30:26 +0000 (16:30 -0400)]
MLK-22045-2 sdp: Add DM gadget support for sdp

When enable CONFG_SPL_DM_USB_GADGET, sdp should use
usb_gadget_initialize() and usb_gadget_release() to
support DM gadget driver.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
5 years agoMLK-22045-1 dts: Add "u-boot,dm-spl" property to the usbotg3 node
Sherry Sun [Wed, 19 Jun 2019 19:59:03 +0000 (15:59 -0400)]
MLK-22045-1 dts: Add "u-boot,dm-spl" property to the usbotg3 node

To support run DM gadget usb3 driver at early stage, add
"u-boot,dm-spl" property to the usbotg3 node and the related nodes.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
5 years agoMLK-22105-3 imx8/imx8m: spl: Move bss clean up before arch_cpu_init
Ye Li [Tue, 25 Jun 2019 09:51:42 +0000 (02:51 -0700)]
MLK-22105-3 imx8/imx8m: spl: Move bss clean up before arch_cpu_init

Since rng_init is used arch_cpu_init, we have to clean up BSS section
before it.
Also remove the unnecessary memset to global data, because
board_init_f_init_reserve already memset it. If we memset it in board_init_f,
the gd->malloc_base is reset to 0 and will cause early malloc problem
when CONFIG_MALLOC_F_ADDR is not set.

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

5 years agoMLK-22105-2 caam: Move g_jrdata to bss section for SPL
Ye Li [Tue, 25 Jun 2019 09:21:36 +0000 (02:21 -0700)]
MLK-22105-2 caam: Move g_jrdata to bss section for SPL

We set SPL bss section on OCRAM. So move the g_jrdata to bss section
only on SPL. In normal u-boot, it is still in data section to avoid
overlay with relocation entries and DTB.

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

5 years agoMLK-22105-1 Revert "MLK-20026 caam: Fix CAAM RNG init hang on imx8mq RevA"
Ye Li [Tue, 25 Jun 2019 09:14:00 +0000 (02:14 -0700)]
MLK-22105-1 Revert "MLK-20026 caam: Fix CAAM RNG init hang on imx8mq RevA"

This reverts commit b12e170792c918efc7c371f86989d34fc397fe06.
The original patch has issue due to the early malloc pool is not ready
at this phase. So malloc always return NULL.

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

5 years agoMLK-22092 Enable GPT command
Frank Li [Fri, 21 Jun 2019 15:09:26 +0000 (10:09 -0500)]
MLK-22092 Enable GPT command

Enable GPT command to allow create gpt partitoin in uboot

Signed-off-by: Frank Li <Frank.Li@nxp.com>
5 years agoMLK-22103 doc: ahab: Update imx-mkimage SPL build target
Ye Li [Tue, 25 Jun 2019 02:11:57 +0000 (19:11 -0700)]
MLK-22103 doc: ahab: Update imx-mkimage SPL build target

Since we have changed imx-mkimage flash_spl_container target
to flash_spl, also update it in u-boot ahab document.

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

5 years agoMLK-22100 doc: Remove duplicated documentation directory
Breno Lima [Mon, 24 Jun 2019 13:39:04 +0000 (10:39 -0300)]
MLK-22100 doc: Remove duplicated documentation directory

Commit ad7061ed742e ("doc: Move device tree bindings documentation to
 doc/device-tree-bindings") moved all device tree binding documentation
to doc/device-tree-bindings directory.

The current U-Boot project still have two documentation directories:

- doc/
- Documentation/

Move all documentation and sphinx files to doc directory so all content
can be in a common place.

Adapted to U-Boot v2019.04

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Acked-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22036 DTS: imx7ulp-evk: Enable QSPI in eMMC dedicated DTS
Ye Li [Wed, 19 Jun 2019 03:09:27 +0000 (20:09 -0700)]
MLK-22036 DTS: imx7ulp-evk: Enable QSPI in eMMC dedicated DTS

The imx7ulp-evk-emmc.dts is used by imx7ulp_evk_emmc_defconfig, but
this dts does not enable QSPI. Since the 2019.04 u-boot has removed
non-DM driver for QSPI, so we have to enable the QSPI in DTS,
otherwise QSPI can't work on this build

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22035-2 imx8qm/qxp: Change some firmware and image loading addresses
Ye Li [Tue, 18 Jun 2019 08:31:02 +0000 (01:31 -0700)]
MLK-22035-2 imx8qm/qxp: Change some firmware and image loading addresses

To avoid the conflict with FDT reserved-memory, adjust the loading addresses
for hdmitxfw, hdmirxfw and xenlinux_addr

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22035-1 lmb: Add lmb_reserve_overlap for fdt reserved memory
Ye Li [Tue, 18 Jun 2019 08:24:10 +0000 (01:24 -0700)]
MLK-22035-1 lmb: Add lmb_reserve_overlap for fdt reserved memory

Previous patch "MLK-21885 lmb: Handle the overlap case for lmb reserve" adds
the overlap support to lmb reserve. However, u-boot has some places to use the
lmb_reserve when allocating memory in loading images.  If we allowed overlap
in this function, it means images loading address can overlap each other and
cause the address check mechanism not work.

So add another function to allow overlap and only use it for fdt reserved-memory
nodes. The FDT reserved-memory is ok to merge with other reserved memory, since
this won't break image loading address check.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-22003 fec_mxc: Fix fec_get_clk_rate failure issue
Ye Li [Wed, 12 Jun 2019 06:30:04 +0000 (23:30 -0700)]
MLK-22003 fec_mxc: Fix fec_get_clk_rate failure issue

If only FEC2 is enabled, fec_get_clk_rate will fail due to uclass_get_device
fails to get the device by using idx 1. Should use uclass_get_device_by_seq
instead, because the idx is from the udev seq which is specified by alias.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-21970: mtd: nand: mxs_nand: add i.MX6QP compatible string
Han Xu [Wed, 12 Jun 2019 18:51:02 +0000 (13:51 -0500)]
MLK-21970: mtd: nand: mxs_nand: add i.MX6QP compatible string

add the dedicate compatible string for i.MX6QP

Signed-off-by: Han Xu <han.xu@nxp.com>
6 years agoMLK-21994 imx8qm/qxp: Enlarge SPL MAX size to 192KB
Ye Li [Tue, 11 Jun 2019 07:21:42 +0000 (00:21 -0700)]
MLK-21994 imx8qm/qxp: Enlarge SPL MAX size to 192KB

2019 uboot has enabled DM in SPL on imx8qm/qxp builds. The DM needs
larger size than non-DM version. When enable both SPL DM USB host
and gadget drivers, we meets problem that SPL size exceeds the max.

This patch moves SPL runtime malloc to DDR memory. So we can have more
64KB OCRAM for SPL and its max size reaches to 192KB.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-21904 epdc: Fix EPDC waveform and logo file loading failure
Ye Li [Sat, 8 Jun 2019 06:09:55 +0000 (23:09 -0700)]
MLK-21904 epdc: Fix EPDC waveform and logo file loading failure

Since new u-boot will prohibit loading image into memory which is used
by u-boot, like (SP, malloc, relocate). When we allocate waveform buffer
and logo buffer from malloc, loading to them will fail.

Fix the issue by using system load address as a trampoline. Load the image
to system load address first, then copy the data to buffers

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-21942 DTS: imx8mq: Fix USB alias issue
Ye Li [Wed, 5 Jun 2019 10:10:36 +0000 (03:10 -0700)]
MLK-21942 DTS: imx8mq: Fix USB alias issue

Since we set the driver's compatible string to dwc3 nodes, should
use the dwc3 nodes as the USB alias, otherwise the alias won't work.
If first usb controller is probed failed, the second controller still
use 0 as seq and cause issue to the driver.

Because alias requires different names on the nodes, in the patch we have
to change the nodes name to dwc3_0 and dwc3_1

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-21956-3 mx6qdlsabreauto: Enable i2c gpio mux to fix io expander issue
Ye Li [Thu, 6 Jun 2019 08:44:42 +0000 (01:44 -0700)]
MLK-21956-3 mx6qdlsabreauto: Enable i2c gpio mux to fix io expander issue

The i2c gpio mux is not enabled, this causes i2c3 not work and all
io expander devices on i2c3 not work.  So we will meet such as
"usb start" fail due to the VBUS is not power up.

The patch add the i2c mux and i2c gpio mux configs. And remove codes of
controlling i2c steering from board, since i2c gpio mux does same thing.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-21956-2 mxc_i2c: Remove i2c_idle_bus from probe
Ye Li [Thu, 6 Jun 2019 08:29:03 +0000 (01:29 -0700)]
MLK-21956-2 mxc_i2c: Remove i2c_idle_bus from probe

i2c_idle_bus is already used in i2c_init_transfer. So before each tranfer
if the bus is not ready, the i2c_idle_bus will be used to force idle.
It is unnecessary to call it again in probe.

We found a issue when enabling i2c mux with the mxc_i2c. The mxc_i2c is probed
after mux probing. However, at this moment the mux is still in idle state,
won't select port. So if we call i2c_idle_bus in probe, it will fail and cause
mxc_i2c probe failed.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21956-1 i2c-mux-gpio: Fix GPIO request flag issue
Ye Li [Thu, 6 Jun 2019 08:25:54 +0000 (01:25 -0700)]
MLK-21956-1 i2c-mux-gpio: Fix GPIO request flag issue

When requesting GPIO, the GPIOD_IS_OUT is missed in flag, so the GPIO
is set the input mode not output and cause mux not work.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21961 imx: fix tee_addr for nand boot
Peng Fan [Thu, 6 Jun 2019 03:10:43 +0000 (11:10 +0800)]
MLK-21961 imx: fix tee_addr for nand boot

teeaddr is not set. Align with sd/emmc, use tee_addr and set tee_addr.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reported-by: Jessie Lee <jessie.lee@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21885 lmb: Handle the overlap case for lmb reserve
Ye Li [Wed, 5 Jun 2019 06:33:38 +0000 (23:33 -0700)]
MLK-21885 lmb: Handle the overlap case for lmb reserve

lmb reserve is used to reserve some memory so that when loading images
(like kernel, dtb, initrd), images won't be loaded into the reserved memory.

The problem in current lmb is it does not handle the overlap case. When adding
a new reserved memory, if the memory region is overlap with regions already been
added in lmb, it will fail. One example is reserved memory in DTB may overlap with
u-boot relocate address. lmb reserves the u-boot relocate address firstly, so when
adding reserved memory from DTB, we will meet failure.

Actually if we handle the overlap case, we can resolve the overlap by using a max
common region for the overlap regions. So that this case won't fail.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-21905 mx7ulp_evk: Change kernel DTB to EVKB board
Ye Li [Wed, 5 Jun 2019 02:14:42 +0000 (19:14 -0700)]
MLK-21905 mx7ulp_evk: Change kernel DTB to EVKB board

The latest mx7ulp evk board is renamed to EVKB board and has dedicated
DTB files. Modify the kernel DTB names in u-boot to use the new DTB.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-21899 imx8: sci: Add SCFW API sc_seco_gen_key_blob
Ye Li [Fri, 31 May 2019 03:49:44 +0000 (20:49 -0700)]
MLK-21899 imx8: sci: Add SCFW API sc_seco_gen_key_blob

Porting the sc_seco_gen_key_blob to sci_api.c which is used to
generate key blob

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-21898 fastboot: Enable fastboot on mx6qpsabresd
Ye Li [Mon, 3 Jun 2019 09:05:04 +0000 (02:05 -0700)]
MLK-21898 fastboot: Enable fastboot on mx6qpsabresd

Missed fastboot and uuu relevant configurations in mx6qpsabresd_defconfig.
This patch adds them.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
6 years agoMLK-21891-2 fastboot: fix issue in enabling FAT_WRITE
Ye Li [Wed, 29 May 2019 08:43:44 +0000 (01:43 -0700)]
MLK-21891-2 fastboot: fix issue in enabling FAT_WRITE

Wrong config name is used in kconfig for selecting FAT_WRITE,
introduced by patch
(MLK-20594-2 enable fat write for all configuration with uuu)

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21891-1 FAT: fix build error caused by cherry-pick
Ye Li [Wed, 29 May 2019 08:40:26 +0000 (01:40 -0700)]
MLK-21891-1 FAT: fix build error caused by cherry-pick

Fix issue introduced by cherry-pick patch below, the conflict
is not resolved correctly
(MLK-20668-2 fat: Fix issue in rootdir table flush for FAT16/12)

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21879-3 fsl_qspi: Fix flash write issue on mx7ulp
Ye Li [Tue, 28 May 2019 13:41:51 +0000 (06:41 -0700)]
MLK-21879-3 fsl_qspi: Fix flash write issue on mx7ulp

The page write sequence in spi-mem is changed with orignal spi-flash. When
the max_write_size is set by driver, the orignal sequence is
  1. WREN
  2. write max_write_size data to flash
  3. wait for WIP clean
  4. back to #1 if having data remained in a page.

The new sequence is:
  1. WREN
  2. write (max_write_size - command length) data to flash
  3. back to #2 if having data remained in a page
  4. wait for WIP clean

Since mx7ulp has 64 bytes TX buffer (max_write_size), while other iMX chips
have 512 bytes (page size is 256). So when adapt qspi with the new sequence,
we have to check the WIP before each write on mx7ulp. Otherwise the WIP may set
due to previous write is not completed by flash device, then cause current
write failed.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21879-2 spi-mem: Fix read data size issue
Ye Li [Tue, 28 May 2019 07:47:17 +0000 (00:47 -0700)]
MLK-21879-2 spi-mem: Fix read data size issue

When slave drivers not set the max_read_size, the spi-mem should directly
use data.nbytes and not limit to any size. But current logic will limit to
the max_write_size.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21879-1 fsl_qspi: increase timeout of is_controller_busy
Ye Li [Tue, 28 May 2019 07:42:25 +0000 (00:42 -0700)]
MLK-21879-1 fsl_qspi: increase timeout of is_controller_busy

The original codes uses 100ms timeout, but the new is_controller_busy only
try 5 times with each only 1us delay.
When the qspi clock is slower, the controller may need longer time in busy.
On mx7ulp, we meet problem that timeout always happen. So change the codes
to 100ms timeout

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21877 imx_lpi2c: Fix IPG clock issue
Ye Li [Mon, 27 May 2019 11:29:22 +0000 (04:29 -0700)]
MLK-21877 imx_lpi2c: Fix IPG clock issue

There are two clocks for lpi2c, PER and IPG. But the clk driver
only enables PER clock without IPG, this will cause problem if IPG clock
is disabled during partition reboot.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21864 mx7ulp_evk: Fix build break in eMMC defconfig
Ye Li [Sun, 26 May 2019 01:44:28 +0000 (18:44 -0700)]
MLK-21864 mx7ulp_evk: Fix build break in eMMC defconfig

Since the non-DM QSPI support is removed in 2019.04 u-boot, we have
to enable DM QSPI driver, otherwise will get build fail.

Also add missed CONFIG_CMD_BOOTZ to plugin defconfig.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-18333-2 imx8m: add QSPI boot dev
Peng Fan [Thu, 17 May 2018 07:15:59 +0000 (15:15 +0800)]
MLK-18333-2 imx8m: add QSPI boot dev

When boot type could not be detected from rom sw info,
read sbmr1 to detect, here we only use it to detect FLEXSPI
boot, because ROM not update it in rom sw info.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 3735aedbf6dbebfac830089618ca334c419f43bd)
(cherry picked from commit 8324d0f37a3dc8c2516dad439aa6b91d77eebcbc)

6 years agoMLK-21863 mx6sabreauto: Fix SD index issue
Ye Li [Sat, 25 May 2019 15:41:41 +0000 (08:41 -0700)]
MLK-21863 mx6sabreauto: Fix SD index issue

The imx6qdl-sabreauto-u-boot.dtsi re-alias the usdhc3 to mmc0, and
cause boot issue on mx6sabreauto boards. Remove the re-alias, so
usdhc3 will map to mmc2.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21862 mx7: Enable CONFIG_CMD_BOOTD for all iMX7 boards
Ye Li [Sat, 25 May 2019 09:36:39 +0000 (02:36 -0700)]
MLK-21862 mx7: Enable CONFIG_CMD_BOOTD for all iMX7 boards

When CONFIG_CMD_BOOTD is disabled, we can't use "boot" or "bootd"
command. It causes problem for users to boot kernel.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21861 mx7dsabresd: Fix wrong gpio name for io expander
Ye Li [Sat, 25 May 2019 09:11:17 +0000 (02:11 -0700)]
MLK-21861 mx7dsabresd: Fix wrong gpio name for io expander

Since the io expander node in DTS is using name gpio-expander not gpio_spi,
must update the codes for the name, otherwise fec initialization will hang.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-12883 usb: limit usb storage max_xfer_blk to 256
Peng Fan [Mon, 6 Jun 2016 05:53:43 +0000 (13:53 +0800)]
MLK-12883 usb: limit usb storage max_xfer_blk to 256

For Some USB mass storage devices, such as:
"
 - Kingston DataTraveler 2.0 001D7D06CF09B04199C7B3EA
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0930  Product 0x6545 Version 1.16
"
When `usb read 0x80000000 0 0x2000`, we met
"EHCI timed out on TD - token=0x80008d80".

The devices does not support scsi VPD page, we are not able
to get the maximum transfer length for READ(10)/WRITE(10).

So we limit this to 256 blocks as READ(6).

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit df0052575b2bc9d66ae73584768e1a457ed5d914)
(cherry picked from commit 0716cc14a3739e9d161f5d0c3a0bebf0272759f9)
Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21856 imx8: fix build warning in sci.h
Ye Li [Fri, 24 May 2019 11:20:37 +0000 (04:20 -0700)]
MLK-21856 imx8: fix build warning in sci.h

./arch/arm/include/asm/arch/sci/sci.h: In function ‘sc_err_to_linux’:
./arch/arm/include/asm/arch/sci/sci.h:54:2: warning: implicit declaration
of function ‘debug’ [-Wimplicit-function-declaration]
  debug("%s %d %d\n", __func__, err, ret);
  ^~~~~

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21825 misc: scu: Increase the timeout for MU communication
Ye Li [Fri, 24 May 2019 08:19:34 +0000 (01:19 -0700)]
MLK-21825 misc: scu: Increase the timeout for MU communication

When power on some sources in Video system, current timeout 10ms is
too short and returns before SCU response. So increase the timeout
to 1s.

Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-21821 ddr: imx8m: Fix the ddr init hang on imx8mq
Jacky Bai [Fri, 24 May 2019 02:08:05 +0000 (10:08 +0800)]
MLK-21821 ddr: imx8m: Fix the ddr init hang on imx8mq

On, i.MX8MQ, the PLL config must be done when ddrmix
isolation is released. So move the dram pll init after
iso config done. For other i.MX8M SOC, either init pll
before or after isolation is ok.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
(cherry picked from commit c5dcc21c214badd5b48b48dfaa62d17ba13c6b17)

6 years agoMLK-21745-02 board: imx8mm_val: change the ddr init to the common driver
Jacky Bai [Thu, 16 May 2019 09:53:36 +0000 (17:53 +0800)]
MLK-21745-02 board: imx8mm_val: change the ddr init to the common driver

change the ddr init to use the common driver init driver as
we used on EVK board.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 2c5b74872bdc62b02a6e7c5761e27cdaeb677c8d)

6 years agoMLK-21745-01 driver: ddr: Refine the ddr init driver on imx8m
Jacky Bai [Wed, 15 May 2019 12:31:41 +0000 (20:31 +0800)]
MLK-21745-01 driver: ddr: Refine the ddr init driver on imx8m

Refine the ddr init driver to make it more reusable for different
DDR type(LPDDR4, DDR4 & DDR3L). So we can reduce some redundant
code.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 3c0b1b346a891fef7a81856e3ee9019e2b81602d)

6 years agoMLK-21759-2 mx6ull: Fix mispelling aaips in fuse_entry_desc path
Leonard Crestez [Thu, 16 May 2019 18:09:05 +0000 (21:09 +0300)]
MLK-21759-2 mx6ull: Fix mispelling aaips in fuse_entry_desc path

This is not intentional.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit c3d98667108a5f184624d9768c4f811b8c88c1df)

6 years agoMLK-21759-1 mx6ul: Fix module fuse paths for upstream naming
Leonard Crestez [Fri, 17 May 2019 11:40:58 +0000 (14:40 +0300)]
MLK-21759-1 mx6ul: Fix module fuse paths for upstream naming

According to upstream linux naming conventions node names must have no
leading zeros after the @ sign.

Recent imx_4.19.y changes to conform with this convention on 6ull broke
6ulz boot however looking at the code 6ul fuse checks were already
broken by upstream commit efb9adb27475 ("ARM: dts: imx6ul: Remove
leading zeroes from unit addresses")

Instead of reverting make uboot fuse check follow upstream standards.

Keep old paths for compatibility with imx_4.14.y

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 4b6287ce9275d2ffc6153188a9f2b656def539be)

6 years agoMLK-21354-2 mmc: fsl_esdhc: fix pre_div
Peng Fan [Wed, 8 May 2019 10:15:33 +0000 (18:15 +0800)]
MLK-21354-2 mmc: fsl_esdhc: fix pre_div

We have initialized pre_div, so no need to override it. And
it will break those have pre_div initialized as 2.

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

6 years agoMLK-21354-1 imx: define ARCH_MXC for i.MX8/8m/7ulp
Peng Fan [Wed, 8 May 2019 10:14:20 +0000 (18:14 +0800)]
MLK-21354-1 imx: define ARCH_MXC for i.MX8/8m/7ulp

Need define ARCH_MXC to avoid access wrong registers in fsl_esdhc

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-20394 imx8mq: Update the ddrc QoS setting for B1 chip
Bai Ping [Fri, 16 Nov 2018 03:57:54 +0000 (11:57 +0800)]
MLK-20394 imx8mq: Update the ddrc QoS setting for B1 chip

Update the ddrc Qos setting for B1 to align with B0'ssetting.
Correct the initial clock for dram_pll. This setting will be
overwrite before ddr phy training. Although there is no impact
on the dram init, we still need to correct it to eliminate
confusion.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Tested-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit 566b798213ab9690966f163de2765acdbfe647a7)

6 years agoMLK-21654 mx6sl: hab: Fix pu_irom_mmu_enabled address
Breno Lima [Tue, 7 May 2019 19:53:56 +0000 (16:53 -0300)]
MLK-21654 mx6sl: hab: Fix pu_irom_mmu_enabled address

According to hab.c code we have to notify the ROM code if the MMU is
enabled or not. This is achieved by setting the "pu_irom_mmu_enabled"
to 0x1.

The current address in hab.c code is wrong for i.MX6SL, according to ROM
map file the correct address is 0x00901c60.

As we are writing in the wrong address the ROM code is not flushing the
caches when needed, and the following HAB event is observed in certain
scenarios:

--------- HAB Event 1 -----------------
event data:
        0xdb 0x00 0x14 0x41 0x33 0x18 0xc0 0x00
        0xca 0x00 0x0c 0x00 0x01 0xc5 0x00 0x00
        0x00 0x00 0x07 0xe4

STS = HAB_FAILURE (0x33)
RSN = HAB_INV_SIGNATURE (0x18)
CTX = HAB_CTX_COMMAND (0xC0)
ENG = HAB_ENG_ANY (0x00)

Update MX6SL_PU_IROM_MMU_EN_VAR to address this issue.

Reported-by: Frank Zhang <frank.zhang@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 22fccea63a9ab8c2911dc81bc157963909606617)

6 years agoMLK-21485 imx8qm/qxp: Extend image size for bootaux M4
Ye Li [Tue, 7 May 2019 07:06:17 +0000 (00:06 -0700)]
MLK-21485 imx8qm/qxp: Extend image size for bootaux M4

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 <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit cdc80200841055b949677ae8633c6d64fe0d0985)

6 years agoMLK-21660 imx8qm: Disable SATA driver by default
Ye Li [Tue, 7 May 2019 06:39:20 +0000 (23:39 -0700)]
MLK-21660 imx8qm: Disable SATA driver by default

The imx8 SATA driver will cause crash when some gen3 SATA
device is connected. As there is no booting from SATA supported by ROM,
so enabling this driver is not necessary, change to disable it at default.
And will fix the issue in future.

Users who need to use the driver, have to set "CONFIG_SATA_IMX=y" in defconfig
to enable it.

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

6 years agoMA-14501[Android] change BOOTAUX_RESERVED_MEM macro to defconfig
Ye Li [Fri, 24 May 2019 06:07:18 +0000 (23:07 -0700)]
MA-14501[Android] change BOOTAUX_RESERVED_MEM macro to defconfig

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 <bo.zhang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
6 years agoMLK-20935-4 doc: imx: ahab: Fix typo in mx8_mx8x_secure_boot.txt guide
Breno Lima [Fri, 15 Feb 2019 18:51:36 +0000 (16:51 -0200)]
MLK-20935-4 doc: imx: ahab: Fix typo in mx8_mx8x_secure_boot.txt guide

Fix a typo in path provided for imx-mkimage iMX8QM and iMX8QXP directories.

Reported-by: Marius Grigoras <marius.grigoras@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit c75243c1a87a10f003377d9c144bcf412ba80440)

6 years agoMLK-20935-3 doc: imx: ahab: Add a note in SRK Hash fuses sanity check
Breno Lima [Fri, 15 Feb 2019 18:43:54 +0000 (16:43 -0200)]
MLK-20935-3 doc: imx: ahab: Add a note in SRK Hash fuses sanity check

The commands included in introduction guide should not be used as
reference for programming the SRK Hash fuses as they are in big
endian.

Add a note to avoid a possible mistake.

Reported-by: Clement Le Marquis <clement.lemarquis@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 137319826cc32d98a9b6890f35dd6670e104c2a5)

6 years agoMLK-20935-2 doc: imx: ahab: Include ahab_close command
Breno Lima [Fri, 15 Feb 2019 18:37:56 +0000 (16:37 -0200)]
MLK-20935-2 doc: imx: ahab: Include ahab_close command

Since commit 771b824728ca ("MLK-20919 imx8: ahab: Add command to
close the chip") the U-Boot is able to move the lifecycle from
NXP closed to OEM closed.

Update AHAB guides to use U-Boot ahab_close command instead of SCFW CLI.

As the procedure is now independent of SCFW terminal we can remove
this condition from documentation.

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

6 years agoMLK-20935-1 doc: imx: habv4: Add section to avoid crash when OP-TEE is enabled
Breno Lima [Fri, 15 Feb 2019 18:09:08 +0000 (16:09 -0200)]
MLK-20935-1 doc: imx: habv4: Add section to avoid crash when OP-TEE is enabled

Starting in L4.14.78 release, the OP-TEE CAAM driver does not set the
JROWN_NS field in case LMID is locked.

We need to include the Unlock MID command in CSF file otherwise device
will fail to boot in HAB closed mode.

Add section to avoid crash when OP-TEE is enabled.

Reported-by: Frank Zhang <frank.zhang@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit af03284ad38bd03ef1f0d4942842629db93d2c11)