u-boot.git
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>
5 years agoMA-15152 erase user data before setting lock/unlock status
faqiang.zhu [Wed, 17 Jul 2019 07:32:00 +0000 (15:32 +0800)]
MA-15152 erase user data before setting lock/unlock status

when conduct fastboot lock/unlock operations, erase the userdata first
and then set lock/unlock status to improve security level.

Change-Id: I74c571c35b88afd6fdd4c287463f7209da8c15ff
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMA-15151 Limit some hwcrypto commands within bootloader
Ji Luo [Wed, 17 Jul 2019 04:21:09 +0000 (12:21 +0800)]
MA-15151 Limit some hwcrypto commands within bootloader

It can be dangerous to export some hwcrypto commands to Linux,
add commands to limit some commands within bootloader.

Test: hwcrypto commands can't be used after locking boot state.

Change-Id: Ib0a96a87f661778c133178840d8dccf49f151c22
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15017 Add new command to generate bkek from trusty
Ji Luo [Sat, 22 Jun 2019 02:18:01 +0000 (10:18 +0800)]
MA-15017 Add new command to generate bkek from trusty

Add new command to generate bkek from trusty.

Test: generate and dump bkek.

Change-Id: I6b2a30b87c755eecd00ced7c53cfb86e432040de
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15015 Add sha256_hmac support
Ji Luo [Fri, 21 Jun 2019 00:52:40 +0000 (08:52 +0800)]
MA-15015 Add sha256_hmac support

Add sha256 hmac support in u-boot.

Test: hmac calculation.

Change-Id: I0f1438fed8290620a1bb0663d19c21e20098eb5a
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15142 Support secure attestation provision
Haoran.Wang [Tue, 16 Jul 2019 05:12:15 +0000 (13:12 +0800)]
MA-15142 Support secure attestation provision

In host end, need encrypt the attestation keys and certs
by manufacture protection public key though  AES-128-ECB.
Then use below 4 set of commands to provision encrypted
RSA attestation and EC attestation:
  * $fastboot stage atte_rsa_key.bin
  * $fastboot oem set-rsa-atte-key-enc
  * $fastboot stage atte_rsa_cert.bin
  * $fastboot oem append-rsa-atte-cert-enc
  * $fastboot stage atte_ec_key.bin
  * $fastboot oem set-ec-atte-key-enc
  * $fastboot stage atte_ec_cert.bin
  * $fastboot oem append-ec-atte-cert-enc

Change-Id: I8a7c64004a17f7dde89f28c3123a2e2b1a6d3346
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
5 years agoMA-15019-1 Support Manufacture Protection public key generation
Ji Luo [Mon, 15 Jul 2019 09:26:30 +0000 (17:26 +0800)]
MA-15019-1 Support Manufacture Protection public key generation

Add new keymaster commands to get Manufacure Production key (mppubk).
Since the mppubk can only be generated in OEM CLOSED imx8q board, so
we can only use this command when the board is HAB/AHAB closed.

Commands to extract the mppubk:
        * $fastboot oem get-mppubk
        * $fastboot get_staged mppubk.bin

Test: Generate and dump the mppubk.bin

Change-Id: Idc59e78ca6345497e744162664b8293f50d1eda4
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15087-4 Support mmc loader for imx8mn_evk
Haoran.Wang [Tue, 9 Jul 2019 04:16:23 +0000 (12:16 +0800)]
MA-15087-4 Support mmc loader for imx8mn_evk

Align using emmc loader when there is no Trusty OS for Android standard
boot in SD/EMMC.

Add hook for getting correct offset when load uboot.

Change-Id: I5898cf196e734ffaca1a513918a049ce504b14e9
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
5 years agoMA-15087-1 Enable Trusty OS on imx8mn
Haoran.Wang [Mon, 8 Jul 2019 09:08:05 +0000 (17:08 +0800)]
MA-15087-1 Enable Trusty OS on imx8mn

This patch removed the SDP support in imx8mn due
it will cause the memory resource limitation when run
SPL.

This patch also removed ROMAPI loader. Due Trusty OS
need SPL support mmc related features. So fall back to use
mmc loader instead of ROMAPI.

To fix mmc loader, correct the uboot raw loader offset.

Change-Id: If13f6c9133226efd0831a1867377b8ab0abb6327
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
5 years agoMA-15087 Duplicate imx8mn defconfig to trusty one
Haoran.Wang [Mon, 8 Jul 2019 09:06:35 +0000 (17:06 +0800)]
MA-15087 Duplicate imx8mn defconfig to trusty one

Duplicate imx8mn_ddr4_evk_android_defconfig to
imx8mn_ddr4_evk_android_trusty_defconfig to for the one
who support Trusty OS.

Change-Id: I0577324a913abc1a118d2e58bea2534b8873ae88
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
5 years agoMA-14981-1 Add evk_imx8mm 4GB DDR support
Ji Luo [Thu, 13 Jun 2019 06:45:25 +0000 (14:45 +0800)]
MA-14981-1 Add evk_imx8mm 4GB DDR support

Add configs to support evk_imx8mm 4GB DDR board. The 4GB DDR will
be split into two banks, one is 3GB (0x4000_0000~0xffff_0000) and
another is 1GB(0x1_0000_0000~0x1_4000_0000).

Test: build and boot with or without trusty.

Change-Id: I02f6465fc5709b15fd76820edb846452d011dd56
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-14948 Append lock status by Android Property
Haoran.Wang [Thu, 6 Jun 2019 04:51:06 +0000 (12:51 +0800)]
MA-14948 Append lock status by Android Property

Follow Bootloader requirement spec in
https://source.android.com/devices/bootloader/unlock-trusty.
Need to pass the flash lock status by androidboot.flash.locked.

This patch fixed the GTS failure
com.google.android.gts.persistentdata.PersistentDataHostTest#testTestGetFlashLockState.

Change-Id: I9a3508f7546b02c998e7668df2a33f864a58db75
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
5 years agoMA-15082 Do not pass btmacaddr from uboot if serial is all zero
yang.tian [Fri, 5 Jul 2019 09:48:33 +0000 (17:48 +0800)]
MA-15082 Do not pass btmacaddr from uboot if serial is all zero

Do not pass BDADDR from uboot cmdline when
serial is all zero, and instead btmacaddr
will be set from persist.service.bdroid.bdaddr
which is set in device's init.freescale.rc

Change-Id: I429c6f369d0b7aaca643443fe505d943a3901215
Signed-off-by: yang.tian <yang.tian@nxp.com>
5 years agoMA-15062-3 enable MCU firmware support on evk_8mn
faqiang.zhu [Tue, 2 Jul 2019 05:58:29 +0000 (13:58 +0800)]
MA-15062-3 enable MCU firmware support on evk_8mn

modify the defconfig file for evk_8mn running Android, to make evk_8mn
be able to be flashed with mcu firmware image and boot up the mcu.

Change-Id: Ic05c1d7800fb4eb7582c0da034af87374d40946a
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMA-15062-2 change mcu firmware partition name
Ji Luo [Tue, 23 Jul 2019 07:19:20 +0000 (15:19 +0800)]
MA-15062-2 change mcu firmware partition name

new imx8mn chips have Cortex-M7 inside, not like any other existing
multi-core i.MX MPU, users may manually flash mcu firmware with
fastboot, partition name need to be specified at the same time, so the
mcu firmware partition name need to be changed. related enum and
variable names are also modified.

Change-Id: Ia801e76fb3a20d0074dbbc1433258358c1a53907
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15062-1 change names of MACROs used to boot MCU on imx8m devices
faqiang.zhu [Tue, 2 Jul 2019 05:32:00 +0000 (13:32 +0800)]
MA-15062-1 change names of MACROs used to boot MCU on imx8m devices

new imx8mn chips have Cortex-M7 inside, not like other imx8m devices
of imx8mm and imx8mq which have Cortex-M4 inside. the names of MACROs
used to boot MCU on imx8m devices is modified to make them more common
to cover M4 and M7.
annotations are also modified based on the differences between M4 and
M7.

Change-Id: Ida272e6ecdf577eeaadb9f1242f4524bd1014cac
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMA-15062 change MACRO name of mcu TCM base address
faqiang.zhu [Tue, 2 Jul 2019 04:36:34 +0000 (12:36 +0800)]
MA-15062 change MACRO name of mcu TCM base address

imx-regs-imx8mm.h is used both for imx8mm and imx8mn, while mcu in
imx8mn is Cortex-M7, it's different from Cortex-M4 in imx8mm, change
the MACRO name of mcu TCM base address from M4_BOOTROM_BASE_ADDR to
MCU_BOOTROM_BASE_ADDR.
since this MACRO will be used in common code for i.MX chips, the same
MACRO name in other files are also modified.

Change-Id: I433dd78d11c485d0f4cb82bab299f61cb29dce45
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMA-14989-1 Add 2GB ddr support for AIY
Ji Luo [Mon, 17 Jun 2019 12:27:40 +0000 (20:27 +0800)]
MA-14989-1 Add 2GB ddr support for AIY

Add support for AIY 2GB DDR size. Wrap support for
3GB DDR board with CONFIG_AIY_LPDDR4_3G because of
the limited ocram size.

Test: build and boot on 2GB AIY board.

Change-Id: I04da60cc0d0b22c6c32ff705bcab4095068ba6ea
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-15198 Fix imx8mn fastboot flash fail
Ji Luo [Tue, 23 Jul 2019 06:44:26 +0000 (14:44 +0800)]
MA-15198 Fix imx8mn fastboot flash fail

Align the eMMC device id to '2' to get correct bootloader0
offset.

Test: bootloader0 partition flash.

Change-Id: Idac6bfe55857e3f80b7e18691bbe3c5e5c453e10
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMA-14893-2 Add android build target for imx8mn
Ji Luo [Wed, 29 May 2019 05:05:19 +0000 (13:05 +0800)]
MA-14893-2 Add android build target for imx8mn

Add configs to support evk_imx8mn android build.

Test: build and boot on eMMC and sd.

Change-Id: Id5c63b31e45357d791425976358635c18de928eb
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMLK-22298 tcpc: fix tcpc_debug_log usage
Peng Fan [Tue, 23 Jul 2019 06:17:56 +0000 (14:17 +0800)]
MLK-22298 tcpc: fix tcpc_debug_log usage

Adding missed port parameter.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agoMA-15181 use correct API in SPL to get mmc index
Haoran.Wang [Mon, 22 Jul 2019 09:45:49 +0000 (17:45 +0800)]
MA-15181 use correct API in SPL to get mmc index

Due SPL doesn't have env, so cannot use mmc_get_env_dev() get
the mmc index.
Following spl_mmc.c get correct mmc index in SPL.

Change-Id: I0f07a9ea35d5b3ba0d638af436238d0cfe925981
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
5 years agoMLK-22287 imx8mn: enable CONFIG_ENV_DEFAULT_NOWHERE at default
Ye Li [Fri, 19 Jul 2019 01:56:56 +0000 (18:56 -0700)]
MLK-22287 imx8mn: enable CONFIG_ENV_DEFAULT_NOWHERE at default

This CONFIG_ENV_DEFAULT_NOWHERE config must be enabled for USB download
when we implemented the override function to select env storage medium.
To avoid adding it to every imx8mn defconfig, enable the config as default
on imx8mn.

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

5 years agoMLK-22283 env: fix NAND ENV build issue introduced by env offset change
Ye Li [Thu, 18 Jul 2019 06:14:59 +0000 (23:14 -0700)]
MLK-22283 env: fix NAND ENV build issue introduced by env offset change

Get below build error in nand env, because we should not call function in
array initialization.

env/nand.c: In function ‘env_nand_save’:
env/nand.c:196:15: error: initializer element is not constant
.offset = env_get_offset(CONFIG_ENV_OFFSET),

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

5 years agoMLK-22279-5 imx8mn_evk: Remove flexspi defconfig
Ye Li [Wed, 17 Jul 2019 06:19:11 +0000 (23:19 -0700)]
MLK-22279-5 imx8mn_evk: Remove flexspi defconfig

Remove the defconfig for flexspi boot, we can use one defconfig
for both SD and flexspi.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-22279-4 imx8mn_evk: Enable multiple env storages
Ye Li [Tue, 16 Jul 2019 09:11:04 +0000 (02:11 -0700)]
MLK-22279-4 imx8mn_evk: Enable multiple env storages

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

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

5 years agoMLK-22279-3 imx8mn: override env_get_offset and env_get_location
Ye Li [Mon, 15 Jul 2019 08:16:46 +0000 (01:16 -0700)]
MLK-22279-3 imx8mn: override env_get_offset and env_get_location

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

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

5 years agoMLK-22279-2 env: Add a config to enable nowhere as default location
Ye Li [Tue, 16 Jul 2019 09:06:10 +0000 (02:06 -0700)]
MLK-22279-2 env: Add a config to enable nowhere as default location

When booting from USB there is no place to store the environment and
should use default env. However CONFIG_ENV_IS_NOWHERE has dependence
with other env storage config. If we enable multiple storages, NOWHERE
can't be enabled. And saveenv won't be built if NOWHERE is set.

This patch introduces a new CONFIG_ENV_DEFAULT_NOWHERE, that can enable
NOWHERE as a default env location when other storage are not avaliable.
And allow to build saveenv.

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

5 years agoMLK-22279-1 env: Add env_get_offset to override static env offset
Ye Li [Tue, 16 Jul 2019 08:39:40 +0000 (01:39 -0700)]
MLK-22279-1 env: Add env_get_offset to override static env offset

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

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

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

5 years agoMA-14898 Fix build warnings
Ji Luo [Thu, 30 May 2019 02:23:10 +0000 (10:23 +0800)]
MA-14898 Fix build warnings

Include correct header files to avoid build warning:
  common/image-android.c:151:68: warning: implicit declaration
  of function ‘mmc_get_env_dev’ [-Wimplicit-function-declaration]
  " androidboot.boot_device_root=mmcblk%d", mmc_map_to_kernel_blk(mmc_get_env_dev()));

Change-Id: I932a178500e7397f72d717efae0dd2d954a909d8
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoMLK-22259-4: mx6dlsabreauto: configs: add default mtdids and mtdparts configs
Han Xu [Fri, 12 Jul 2019 21:19:56 +0000 (16:19 -0500)]
MLK-22259-4: mx6dlsabreauto: configs: add default mtdids and mtdparts configs

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

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

Signed-off-by: Han Xu <han.xu@nxp.com>
5 years agoMLK-22259-3: mx6sabre: config: remove space from mtdparts definition
Han Xu [Fri, 12 Jul 2019 20:53:12 +0000 (15:53 -0500)]
MLK-22259-3: mx6sabre: config: remove space from mtdparts definition

there should no extra space in mtdparts definition

Signed-off-by: Han Xu <han.xu@nxp.com>
5 years agoMLK-22259-2: cmd: mtdparts: skip invalid devices rather than quit
Han Xu [Fri, 12 Jul 2019 20:52:58 +0000 (15:52 -0500)]
MLK-22259-2: cmd: mtdparts: skip invalid devices rather than quit

mtdparts quit when invalid mtd devices found. Add thes patches to skip
the invalid devices, so NAND partitions can be alway found to burn boot
images.

For instance,

On i.MX6DL Sabreauto, nand config u-boot didn't enable the weim nor, so
parsing 8000000.nor leads to error:

Device nor0 not found!

With the patches, we can skip this invalid device and still get nand
boot partition table:

Device nor0 not found!
current device is invalid, skip it and check the next one

device nand0 <gpmi-nand>, # parts = 5
0: nandboot 0x04000000 0x00000000 0
1: nandkernel 0x01000000 0x04000000 0
2: nanddtb 0x01000000 0x05000000 0
3: nandtee 0x01000000 0x06000000 0
4: nandrootfs 0xf9000000 0x07000000 0

active partition: nand0,0 - (nandboot) 0x04000000 @ 0x00000000

Signed-off-by: Han Xu <han.xu@nxp.com>
5 years agoMLK-22259-1: cmd: Kconfig: add new option CONFIG_MTDPARTS_SKIP_INVALID
Han Xu [Fri, 12 Jul 2019 20:52:46 +0000 (15:52 -0500)]
MLK-22259-1: cmd: Kconfig: add new option CONFIG_MTDPARTS_SKIP_INVALID

add a new option in mtdparts to skip the invalid devices rather than
just quit

Signed-off-by: Han Xu <han.xu@nxp.com>
5 years agoi.MX6: nand: add nandbcb command for imx
Shyam Saini [Wed, 10 Jul 2019 19:19:45 +0000 (14:19 -0500)]
i.MX6: nand: add nandbcb command for imx

Writing/updating boot image in nand device is not
straight forward in i.MX6 platform and it requires
boot control block(BCB) to be configured.

It becomes difficult to use uboot 'nand' command to
write BCB since it requires platform specific attributes
need to be taken care of.

It is even difficult to use existing msx-nand.c driver by
incorporating BCB attributes like mxs_dma_desc does
because it requires change in mtd and nand command.

So, cmd_nandbcb implemented in arch/arm/mach-imx

BCB contains two data structures, Firmware Configuration Block(FCB)
and Discovered Bad Block Table(DBBT). FCB has nand timings,
DBBT search area, page address of firmware.

On summary, nandbcb update will
- erase the entire partition
- create BCB by creating 2 FCB/DBBT block followed by
  1 FW block based on partition size and erasesize.
- fill FCB/DBBT structures
- write FW/SPL on FW1
- write FCB/DBBT in first 2 blocks

for nand boot, up on reset bootrom look for FCB structure in
first block's if FCB found the nand timings are loaded for
further reads. once FCB read done, DTTB will load and finally
firmware will be loaded which is boot image.

Refer section "NAND Boot" from doc/imx/common/imx6.txt for more usage
information.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Sergey Kubushyn <ksi@koi8.net>
Signed-off-by: Shyam Saini <shyam.saini@amarulasolutions.com>
Signed-off-by: Han Xu <han.xu@nxp.com>
5 years agoarm: i.MX: Add CMD_NANDBCB Kconfig entry
Shyam Saini [Wed, 10 Jul 2019 19:15:49 +0000 (14:15 -0500)]
arm: i.MX: Add CMD_NANDBCB Kconfig entry

Add Kconfig entry for CMD_NANDBCB, and default y on i.MX6
platform with NAND_MXS defined.

Reviewed-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Shyam Saini <shyam.saini@amarulasolutions.com>
Signed-off-by: Han Xu <han.xu@nxp.com>
5 years agoMA-14916-10 fix fastboot reboot bootloader issue
faqiang.zhu [Tue, 9 Jul 2019 10:52:12 +0000 (18:52 +0800)]
MA-14916-10 fix fastboot reboot bootloader issue

In Android, the reboot bootloader flag is written to misc partition, in
the boot flow, u-boot will check that message to decide whether enter
fastboot mode or not. To be compatible with the common implemention,
keep the fastboot_set_reboot_flag there and redefine it to avoid the
error return value which block the reboot process.

Change-Id: Ifb55236d5a5daf3edd124d3ed01851ff6e916e1a
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
5 years agoMA-14712 change androidboot.storage_type to androidboot.boot_device_root
Jindong [Mon, 13 May 2019 10:10:25 +0000 (18:10 +0800)]
MA-14712 change androidboot.storage_type to androidboot.boot_device_root

storage_type is emmc or sd, which is not friendly
for user space, for example android health HAL need access
/sys/block/mmcblkX/stat.

Replace it with mmcblkX named as boot_device_root.
(Keep storage_type for compatibility now)

Change-Id: I7486d522696e9fe3dde8bdc8834ac11d25df7d79
Signed-off-by: Jindong <jindong.yue@nxp.com>
5 years agoMA-13453-1 Add new board target imx8mq_aiy
Ji Luo [Fri, 5 Jul 2019 04:41:43 +0000 (12:41 +0800)]
MA-13453-1 Add new board target imx8mq_aiy

Add support for new target imx8mq_aiy.

Test: build and boot ok on imx8mq_aiy.

Change-Id: Ie616c3ae5fc5273036e975acd88fccfa8c5c95ee
Signed-off-by: Ji Luo <ji.luo@nxp.com>
5 years agoFix P0/EVT boards boot without serial cable connection.
Leonid Lobachev [Mon, 16 Jul 2018 19:30:01 +0000 (12:30 -0700)]
Fix P0/EVT boards boot without serial cable connection.

Change-Id: I5969217e400ab494f9a74662d1d228fcf2e2d465

5 years agoMA-12973 [AUTO] Skip serial init in board_init_f
Ji Luo [Sun, 30 Sep 2018 07:24:09 +0000 (15:24 +0800)]
MA-12973 [AUTO] Skip serial init in board_init_f

Serial init in board_init_f will cost much time, skip it here
because the serial will be initialized again in board_init_r
and it's more faster (after cache is enabled). We will miss
some logs before the serial is ready but it's ok for Android Auto.
This commit will save about 190ms on imx8qm.

Test: boot ok for both imx8qm and imx8qxp.

Change-Id: If6efdc19794aecda862f22b6fec7f7aba2005766
Signed-off-by: Ji Luo <ji.luo@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
5 years agoMA-12421 Fix CAAM not work on Android Things
Ji Luo [Fri, 5 Jul 2019 01:18:36 +0000 (09:18 +0800)]
MA-12421 Fix CAAM not work on Android Things

Blob buffer size is 48 bytes larger than the plain text buffer,
set correct range when flush the dcache. Also use cache aligned
buffer for the blob/plain_text to avoid failure in CAAM.

Change-Id: I8f311b9d21fc7d26d60e9ba23dfb239d2582cedf
Signed-off-by: Ji Luo <ji.luo@nxp.com>
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>