u-boot.git
4 years agoMA-16940 remove logically dead code
faqiang.zhu [Thu, 16 Apr 2020 12:46:24 +0000 (20:46 +0800)]
MA-16940 remove logically dead code

boot_buf was used to point to the memory allocated in do_boota function
to save boot partition data. now boot partition is loaded by AVB, this
boot_buf should be removed.

Change-Id: I614c412b5f7ed980d29106b364a8193c56db13dc
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
(cherry picked from commit 2a27f021798e31a8bab37804b053d2b9ebaea928)
(cherry picked from commit 4ae3275bb7065dfcf99dcdf559eaf99d044c51e0)

4 years agoMA-16877 Skip kernel hab authentication for android
Ji Luo [Wed, 8 Apr 2020 04:34:55 +0000 (12:34 +0800)]
MA-16877 Skip kernel hab authentication for android

Android use AVB to verify the kernel, hab authentication is
not necessary for boot image.

For imx8m, don't authenticate the kernel image when AVB
(CONFIG_AVB_SUPPORT) is enabled. For imx8q, as android uses
different 'CONFIG_EXTRA_ENV_SETTINGS' and 'CONFIG_BOOTCOMMAND'
with linux bsp, so it won't try to do kernel hab authentication.
by default.

Test: boot imx8mp with "CONFIG_IMX_HAB" and imx8qxp with
      'CONFIG_AHAB_BOOT'.

Change-Id: I1b2087ce7d8f9795422a053b6b68a694c86f0b3d
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit f907e4ac090e960ba5110b8039cccc4296841595)
(cherry picked from commit f9f6ae742696f51326ec7da5b0c74a7fca21f774)

4 years agoMA-16594-1 Set dtb load offset in bootloader
Ji Luo [Thu, 5 Mar 2020 07:41:06 +0000 (15:41 +0800)]
MA-16594-1 Set dtb load offset in bootloader

This commit sets the dtb load address in bootloader, the
dtb load address would be 'kernel_addr + FDT_OFFSET_TO_KERNEL'.

For imx8m, this commit will reserve 64MB for kernel, 2MB for fdt
and 16MB for ramdisk. For imx8q, this commit will reserve 60MB for
kernel, 1.5MB for fdt and 16MB for ramdisk.

This commit is a merge of below commits:
  f581f72be1 MA-16594-1 Set dtb load offset in bootloader
  207f813b2d MA-16668-2 Fix kernel hang after enabling debug configs
  42cdd5ef6d MA-16939-1 correct reserved space for kernel image for non-imx8 SoC

Change-Id: Ie597731992107ec2343e5ab6db0cab0e123f009c
Signed-off-by: Ji Luo <ji.luo@nxp.com>
4 years agoMA-16457-2 support reboot-fastboot command in u-boot
Haoran.Wang [Wed, 26 Feb 2020 00:45:13 +0000 (08:45 +0800)]
MA-16457-2 support reboot-fastboot command in u-boot

Android implement the userspace fastboot in Android Recovery.
Follow Google's spec, added below 2 fastboot command support:
  * fastboot getvar is-userspace
  * fastboot reboot fastboot

TEST: fastboot commands.

Change-Id: Ib6047413be0a45b3c00626cdb8594809eb8a2b6b
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
(cherry picked from commit 314bded076dfc3e544cc7094ce3f6c4c330be4dd)
(cherry picked from commit 89e63a8f1b20dfe5633f4d854aeb6d712b3ccaa4)

4 years agoMA-16457-1 avoid to try to access system partition
faqiang.zhu [Tue, 25 Feb 2020 02:18:24 +0000 (10:18 +0800)]
MA-16457-1 avoid to try to access system partition

To enable dynamic partition feature, system partition will be a logic
parition in "super" partition, uboot can't access system partition
anymore.

In i.MX Android use case, only vbmeta partition is used to verify other
imags. boot and system are not used. so there is no need to access
system partition to get avb device info, remove system partition from
avb lib for standard android.

Now, standard Android will boot with ramdisk in boot.img, there is no
need to provide root info to kernel for standard Android. so only
Android Auto will provide this info.

Change-Id: I99a43eb8f7aa1dc635e3937c93266f881c9b3655
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
(cherry picked from commit 3a2418a1cc097cd956347fc12b0b4e0566652bfd)
(cherry picked from commit 133644540d6e5c89cc6e8109b2bf3ac6a9b897d1)

4 years agoMA-16418 [Android] Support imx8mp spl boot from mmc
Ji Luo [Tue, 18 Feb 2020 07:32:39 +0000 (15:32 +0800)]
MA-16418 [Android] Support imx8mp spl boot from mmc

Add mmc board level implementation for imx8mp, so we can support
boot from mmc besides ROMAPI.

Test: eMMC/SD boot.

Change-Id: Ie3c28e5622dd819583e2146557ac75f89dbe19ef
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit 05b64483e5f46f82beb7f542d0148498fc21334f)

4 years agoMA-16203 Load boot/dtbo image to fixed memory
Ji Luo [Fri, 6 Dec 2019 09:34:46 +0000 (17:34 +0800)]
MA-16203 Load boot/dtbo image to fixed memory

When the device is locked, avb will try to verify one slot
first, it will continue to verify another if the first slot
returns failure. Function load_full_partition() will alloc memory
to load boot/dtbo images from heap (which is a big and continuous
memory region), this memory will be freed if the first slot returns
verify failure. but because part of the continous memory region
will be used in following verify process, even total available memory
is enough, u-boot can't find a continous memory region to load the
boot/dtbo image for another slot and will return error "Failed to
allocate memory".

Instead, this commit use fixed memory region start from 96MB offset of
CONFIG_FASTBOOT_BUF_ADDR to load the boot/dtbo images.

Test: slot verify and A/B slot switch.

Change-Id: Ifc83bed5a6be37196c0fd109d942eaf9b07b6a74
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit d13752e831957fb84c71f8ca24fd1979d3605cde)
(cherry picked from commit 11f79ca63338a00960e90763d4764956907fdcb5)

4 years agoMA-16191 eliminate warning info about "is-logical" when flash images
faqiang.zhu [Thu, 26 Dec 2019 05:35:28 +0000 (13:35 +0800)]
MA-16191 eliminate warning info about "is-logical" when flash images

"is-logical" is used to check whether the partition to be flashed is
dynamic partition, if it is, a partition resize command will be issued
by host fastboot. this can be well processed in fastbootd.

process this "is-logical" in uboot, now there is no logical partition,
for every partition found in u-boot, returns "no".

Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
Change-Id: I4d93a0c7b32fed9fe5a5ac846bc4e97bfbe69e67
(cherry picked from commit 7b27a2290aec78b49ce7c2aed497db858f436eb4)
(cherry picked from commit cfc8e3034c5ce4f6f777bc7faff3dbb880de43fe)

4 years agoMA-15860 Get and switch the target dev in fastboot erase
Ji Luo [Wed, 20 Nov 2019 05:53:54 +0000 (13:53 +0800)]
MA-15860 Get and switch the target dev in fastboot erase

Target mmc dev is not properly switched when the device enters
fastboot mode via uuu "-i" parameter, which causes "erase"
operation doesn't work.

Get and switch the target mmc dev every time before erase operations
happen.

Test: "fastboot erase boot_a" in uuu fastboot mode.

Change-Id: I4822d2b4ecfd2d874dfbe7474d6824b8fc3a7903
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit 46161b62c341139dcdbb13e00634ae8ae903c5da)
(cherry picked from commit b66d13c7ecd1c1e44dd9edb6c0d5566b4f738bbe)

4 years agoMA-15813 [Android] imx8q: Enable reset in spl stage
Ji Luo [Mon, 4 Nov 2019 14:32:45 +0000 (22:32 +0800)]
MA-15813 [Android] imx8q: Enable reset in spl stage

To avoid both A/B slots are marked as unbootable because
of some random failures, we will need to reset at spl stage
when current slot load/verify fail but already with flag
"successful_boot" set.

imx8q can't be reset via the psci driver because the atf
is not avaiable at spl stage, porting the sc_pm_reboot()
scu api so we can do reset at spl stage for imx8qm/imx8qxp
mek boards.

Test: reset on imx8qm_mek and imx8qxp_mek.

Change-Id: Ifa0bdea9393e413942a8a0188a4f937fa0aa9ab8
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from a5c5748101c383bc3afb424a3ef2689ab2664846)
(cherry picked from c9f8d7c19a7fc20c99e061beabbb094b6bd50f52)

4 years agoMA-15814 Check 'successful_boot' flag before marking unbootable
Ji Luo [Mon, 11 May 2020 03:47:46 +0000 (11:47 +0800)]
MA-15814 Check 'successful_boot' flag before marking unbootable

Slot will be marked as "unbootable" state if error happens during
image load/verify process, this may cause the board never boot up
if some random failures happen (like eMMC/DRAM access error at some
critical temperature).

Check the "successful_boot" flag before marking the slot as "unbootable",
this will help ease the "no bootable slot" issue.

Test: slot switch on imx8qm_mek.

Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit 6db8ebe2224ab6656e8e798288bd1b3c0472c0c0)
(cherry picked from commit b64a9dcd87da333265c2ac4da2be8a735186b77e)

Change-Id: Ib060b11cc6687a3bacd09cecda7dd925beba6316

4 years agoMA-16966 Add hdmi rx/tx fw loading function
Ji Luo [Mon, 11 May 2020 02:09:52 +0000 (10:09 +0800)]
MA-16966 Add hdmi rx/tx fw loading function

Add implementation to load hdmi rx/tx firmwares, use different config to
guide the function.

Change-Id: Ibb43c2301b5f6cdc8b5103bd04cc30baefac9b9f
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit 942bf95ae42750a1f8b8092040ebb3ca144777fd)

4 years agoMA-15715-1 Refine trusty logs
Ji Luo [Thu, 24 Oct 2019 06:06:41 +0000 (14:06 +0800)]
MA-15715-1 Refine trusty logs

Refine trusty logs output to make it more
simple.

Test: boots.

Change-Id: Id94fc245206c5f78e0dbcb0baf5db6475c9f744d
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit a50b4fca22111fe7b85b5584ff317db55d664c50)
(cherry picked from commit c17f0cb30c23ed6dab7312cec88707cb355e91a3)

4 years agoMA-15339-1 load ramdisk in boot image to do first stage mount
faqiang.zhu [Sun, 29 Sep 2019 01:56:31 +0000 (09:56 +0800)]
MA-15339-1 load ramdisk in boot image to do first stage mount

With Android10 code, to build GSI image for devices launching with
Android10, the target should be "aosp_$arch-user". Google releases GSI
images is so built in user mode.

To do CTS-on-GSI test, a debug ramdisk containing .prop file to enable
adb root permission and GSI keys to verify the GSI image is needed, this
ramdisk is in boot image. so ramdisk in boot image need to be loaded by
uboot even in non-recovery mode.

To save boot time, only standard Android use ramdisk to boot up Android,
Android Auto keeps the original way: kernel be responsible for verify
and mount system partition. Let the customers to decide whether to use
recovery ramdisk to boot the system. and under this condition, user-debug
Android Auto GSI image need to be used for VTS-on-GSI test.

when use ramdisk to bootup Android, info provided by "dm=" bootarg is
not used by kernel to setup dm-verity, so it is removed from the
bootargs. The 4.19 kernel used together with this uboot does not handle
"skip_initramfs", so it's also removed.

Change-Id: Ia8b8fa8b85a44acda2670b46504038a009ce01a8
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
(cherry picked from commit e7d3c9ee1a713434d2948928ff0c4daea09ce3dc)
(cherry picked from commit 8f191d088797e9fbea49f482d0aa517f989b7821)

4 years agoMA-15575-3 Add support for oemlock 1.0 hal
Ji Luo [Tue, 8 Oct 2019 13:22:24 +0000 (21:22 +0800)]
MA-15575-3 Add support for oemlock 1.0 hal

Add commands to read oem device unlock state from
trusty avb app. Use the oem device unlock state to
determine if the device can be unlocked instead of
the state in persistdata part.

Test: Read oem device unlock state from avb app.

Change-Id: Ifccaa788ba0f681c2b3a47151c8474e8da5a2559
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit c6eaf8e32987f120c0c5441ea39aa0f39a65b50d)
(cherry picked from commit 8b58afda1cd1f91048504b48b95260e930a37326)

4 years agoMA-15360 Verify vbmeta public key for non-trusty devices
Ji Luo [Tue, 27 Aug 2019 07:41:57 +0000 (15:41 +0800)]
MA-15360 Verify vbmeta public key for non-trusty devices

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

Test: boot on imx8mm.

Change-Id: I4712e5dd6e5c8848468e9d85c6b38eb5fb11377f
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit 9b8264c89ccb3e9179a438e428ad79d72c7efe9b)
(cherry picked from commit 75d9dfb2474d03bd83a5b4d3f03d0a5cea6ea25d)

4 years agoMA-15321-3 Support secure unlock feature
Ji Luo [Thu, 15 Aug 2019 12:53:53 +0000 (20:53 +0800)]
MA-15321-3 Support secure unlock feature

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

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

Test: secure unlock credential verify on hab closed imx8mm_evk.

Change-Id: I1ab5e24df28d1e75ff853de3adf29f34da1d0a71
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit 631149fc0fc8ce035311949db643c2708e41435a)
(cherry picked from commit 063d358ab4bbfea998e0c975f31724757243545a)

4 years agoMA-15321-2 Add command to get serial number
Ji Luo [Thu, 15 Aug 2019 03:17:00 +0000 (11:17 +0800)]
MA-15321-2 Add command to get serial number

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

Test: serial number upload on imx8mm.

Change-Id: I5c905ab797d4fd28d76c8403914f191eaf2ef687
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry picked from commit 250ef119c1dc02908046113893df5eeb9ef40605)

4 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>
(cherry picked from commit 46cc755cf3f42422ee1d7783394e14e8125df2b6)
(cherry picked from commit 047f09ef2ef33657d76fd92d8f5599e00158cd6b)

4 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>
(cherry picked from commit b81f0b617d23548cd30953b94aca4ff8cc4da723)
(cherry picked from commit fb9d5e07623098aefd12a81d74c0779060b0bf0a)

4 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>
(cherry picked from commit 3fc3f521957677b1f363624494ed866985a25505)
(cherry picked from commit 38f9975064dbd6b9c7183a5e7fc54a099a56e973)

4 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>
(cherry picked from commit 6c1087c030de491a12b7f1be9d332f30ba27d183)
(cherry picked from commit 02f0cd1484bc8883d784e08ea9c8fd2e9fc7dd3d)

4 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>
(cherry picked from 1e06de6ef23c1ae9d51383f3c57bb045ea180c03)

4 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>
(cherry picked from commit 58965915dd69050429142d3d180c75e98ad14788)

4 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>
(cherry picked from commit 52300d644a275dfa4fe73ecb51601a8efaff8ab7)

4 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>
(cherry picked from commit c5151ab339c9a37a6c95cabebe328aeba88636f9)

4 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>
(cherry picked from commit 3f2c4d49fe147637e61309421e5817b3e574ed56)

4 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>
(cherry picked from c23398fb379131ad3c5c17c3d762c582796698fb)

4 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>
(cherry picked from commit dc25b7b27fa5c2293d09789a338a1aed2e3a010f)

4 years agoMA-15208 Remap mmc device id in spl
Haoran.Wang [Mon, 22 Jul 2019 09:45:49 +0000 (17:45 +0800)]
MA-15208 Remap mmc device id in spl

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>
(cherry picked from commit c079188d06b3669df7836e1b8c6126558b1fa39e)

4 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>
(cherry picked from commit aa78cbe3d3148ab99ea039ede767e6d1152092b4)

4 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.

Change-Id: I7486d522696e9fe3dde8bdc8834ac11d25df7d79
Signed-off-by: Jindong <jindong.yue@nxp.com>
(cherry picked from commit db441a89a090c46149457ee29492bc315c2bdfa9)

4 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>
(cherry picked from commit 690a14ed2fc64328b417a9de448f4a18cc653698)

4 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 enables dual bootloader feature for imx8m/imx8q, but
as commit 'a2018ab' already brings in some dual bootloader codes
when enabling fastboot support, so this commit won't be a complete
and standalone patch to introduce the dual bootloader feature.

This commit will do the following:
  1. clean up dual bootloader flow and add missing implementation.
  2. Merge the dual bootloader entry for fit and container to one
     function 'mmc_load_image_raw_sector_dual_uboot'.

Change-Id: Ic9410a48092cc05de599dd897fc912177e2a1fe1
Signed-off-by: Ji Luo <ji.luo@nxp.com>
4 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>
(cherry picked from commit c7e207fbbcd8618d29b1192829c630777fea5220)
(cherry picked from commit 1bbf98ec8a550e4027f399f18781245c9faefc8e)

4 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>
(cherry picked from commit de905a8a3c6dfdf9241a188b2e22c76dbef851c1)

4 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 fsl_avb_sysdeps_uboot.c as the functions have been defined in
   avb_sysdeps_posix.c.

Change-Id: I4216e3ddb4e3e810783e4f46b953eda510c2627b
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
Signed-off-by: Ji Luo <ji.luo@nxp.com>
(cherry pick from 58010b99560eea2027dd39909eb5b35404e6030e)

4 years agoMLK-25486 mmc: fsl_esdhc_imx: Fix clock disable issue
Ye Li [Wed, 12 May 2021 10:31:23 +0000 (03:31 -0700)]
MLK-25486 mmc: fsl_esdhc_imx: Fix clock disable issue

The SD clock disable is wrapped by MMC_SUPPORTS_TUNING. So it
only works when UHS is enabled. However, in SD initialization the
power cycle does not depends on UHS. But the power cycle needs
disable the SD clock before power down.
So this causes a problem when UHS is not enabled. Some cards can't
become ready (ACMD14 timeout) due to the clock is enabled during
power cycle.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
4 years agoMLK-25486 imx8mp: Set MEDIA_AXI_CLK_ROOT to 400Mhz
Ye Li [Wed, 12 May 2021 06:03:22 +0000 (23:03 -0700)]
MLK-25486 imx8mp: Set MEDIA_AXI_CLK_ROOT to 400Mhz

MEDIA_AXI_CLK_ROOT is 400Mhz for nominal voltage while 500Mhz is
for overdrive voltage.
Since we use OD VDD_SOC voltage for LPDDR4 EVK board, but ND for
DDR4 EVK board. Using 500Mhz will break for DDR4 EVK. So set it to
400Mhz that can work both ND and OD.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
4 years agoMLK-25484 imx8mn: Set VDD_SOC suspend voltage to 0.75v
Ye Li [Wed, 12 May 2021 02:42:27 +0000 (19:42 -0700)]
MLK-25484 imx8mn: Set VDD_SOC suspend voltage to 0.75v

According to latest i.MX8MN datasheet, it introduces low-v suspend mode
which can set VDD_SOC to 0.75v to save power in suspend.
To align with this mode, adjust the PMIC suspend VDD_SOC to 0.75v in SPL.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
4 years agoMLK-25483 usb: ehci-mx6: Enable USB PHY clock for iMX8DXL
Ye Li [Tue, 11 May 2021 05:32:46 +0000 (22:32 -0700)]
MLK-25483 usb: ehci-mx6: Enable USB PHY clock for iMX8DXL

On iMX8DXL, two USB controllers share clock (enabled by SCFW) for
controller but have dedicated LPCG clock for PHY.
The PHY LPCG will be cleared once the PHY is power down. So without
explictly enabling PHY LPCG clock, USB PHY access will cause
u-boot crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
4 years agoMLK-25481 imx8mm/mn/mp: Keep watchdog disabled by default
Ye Li [Mon, 10 May 2021 09:17:33 +0000 (02:17 -0700)]
MLK-25481 imx8mm/mn/mp: Keep watchdog disabled by default

WDOG HW can't be disabled once it is enabled. So after u-boot enables
the watchdog, kernel has to service the watchdog all the time.
However when suspend into s2idle mode, the WDOG counter is not stop,
then cause WDOG timeout and reset the system.

Change to not enable WDOG by default in u-boot to align previous release.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
4 years agoLF-3769 LS1021ATWR: Enable SPL_OF_CONTROL in SECURE Boot defconfig
Gaurav Jain [Mon, 10 May 2021 06:21:37 +0000 (11:51 +0530)]
LF-3769 LS1021ATWR: Enable SPL_OF_CONTROL in SECURE Boot defconfig

if enable SPL_DM without SPL_OF_CONTROL,
build errors "undefined reference to fdt_get_resource",
is coming in function `caam_jr_probe'.
Added SPL_OF_CONTROL to remove the error.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoMLK-25478-5 efi_loader: loosen buffer parameter check in efi_file_read_int
Peng Fan [Wed, 28 Apr 2021 13:54:01 +0000 (21:54 +0800)]
MLK-25478-5 efi_loader: loosen buffer parameter check in efi_file_read_int

This is same issue as https://bugzilla.redhat.com/show_bug.cgi?id=1733817,
but that fix was wrongly partial reverted.

When reading a directory, EFI_BUFFER_TOO_SMALL should be returned when
the supplied buffer is too small, so a use-case is to call
EFI_FILE_PROTOCOL.Read() with *buffer_size=0 and buffer=NULL to
obtain the needed size before doing the actual read.

So remove the check only for directory reading, file reading already
do the check by itself.

Fixes: db12f518edb0("efi_loader: implement non-blocking file services")
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Stefan Sørensen <stefan.sorensen@spectralink.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Michal Simek <michal.simek@xilinx.com>
4 years agoMLK-25478-4 imx8mm_evk: Update defconfig for ARM SR-IR cert
Ye Li [Thu, 6 May 2021 13:38:55 +0000 (06:38 -0700)]
MLK-25478-4 imx8mm_evk: Update defconfig for ARM SR-IR cert

Enable some EFI and DFU configs and DFU for ARM system ready IR
certification.

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoMLK-25478-3 workaround: disable verify time of signer and signee.
Ying-Chun Liu (PaulLiu) [Tue, 5 Jan 2021 15:42:36 +0000 (23:42 +0800)]
MLK-25478-3 workaround: disable verify time of signer and signee.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
(cherry picked from commit 696b7db183e6c20b7d0d65550ba644b1fb2568f0)
Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoMLK-25478-2 efi: clean memory and reset MemoryOverwriteRequestControl
Ying-Chun Liu (PaulLiu) [Sun, 3 Jan 2021 16:05:13 +0000 (00:05 +0800)]
MLK-25478-2 efi: clean memory and reset MemoryOverwriteRequestControl

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
(cherry picked from commit 2c20c3191a968e1c826aeb4e3d1249caae5fb844)

4 years agoMLK-25478-1 efi: add Platform-Reset-Attack variables
Ying-Chun Liu (PaulLiu) [Tue, 29 Dec 2020 15:10:28 +0000 (23:10 +0800)]
MLK-25478-1 efi: add Platform-Reset-Attack variables

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
(cherry picked from commit 9853e34839a96be1a3cd5d05b288f8b94b2a6a56)

4 years agoPull request #14: Job Ring Driver model
Ye Li [Fri, 7 May 2021 09:08:04 +0000 (11:08 +0200)]
Pull request #14: Job Ring Driver model

Merge in LFAC/uboot-nxp from ~NXF60555/uboot-nxp-gaurav:imx_v2021.04 to imx_v2021.04

* commit 'ecbf49601e34dfb550e8017d0e7bc9acc6a0cecf':
  LFU-126-11 LS(1012/1046/2080): Remove Sec initialization from board files.
  LFU-126-10 LS1021: Enable Job ring driver model in U-Boot.

4 years agoLF-3483-21 DTS: imx6sx: Set ENET interface to rgmii-id
Ye Li [Fri, 7 May 2021 03:02:54 +0000 (20:02 -0700)]
LF-3483-21 DTS: imx6sx: Set ENET interface to rgmii-id

The RX clock delay setting for atheros PHY is still needed on
6SX SDB and ARD. So remove the rgmii-txid to use rgmii-id

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoLFU-126-11 LS(1012/1046/2080): Remove Sec initialization from board files.
Gaurav Jain [Thu, 6 May 2021 06:40:42 +0000 (12:10 +0530)]
LFU-126-11 LS(1012/1046/2080): Remove Sec initialization from board files.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLFU-126-10 LS1021: Enable Job ring driver model in U-Boot.
Gaurav Jain [Thu, 6 May 2021 06:17:08 +0000 (11:47 +0530)]
LFU-126-10 LS1021: Enable Job ring driver model in U-Boot.

LS1021A(iot/qds/tsn/twr) - added support for JR driver.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLF-3483-20 imx8m: Add back fdt_addr variable for UUU download
Ye Li [Fri, 30 Apr 2021 13:25:56 +0000 (06:25 -0700)]
LF-3483-20 imx8m: Add back fdt_addr variable for UUU download

Since uuu script and boot env will use fdt_addr variable for
kernel fdt loading, need add back the fdt_addr

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoLF-3483-19 imx8mn/imx8mp: Change SPL stack and BSS address
Ye Li [Fri, 30 Apr 2021 10:12:55 +0000 (03:12 -0700)]
LF-3483-19 imx8mn/imx8mp: Change SPL stack and BSS address

To fit for large SPL image size, adjust the BSS address and SPL stack
address. Set the BSS address at higher space than stack, so when
SPL image grows, we don't need to re-adjust stack and BSS

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoLFU-126-9 i.MX8: added IMX8 config for HAB boot.
Gaurav Jain [Fri, 30 Apr 2021 08:11:05 +0000 (13:41 +0530)]
LFU-126-9 i.MX8: added IMX8 config for HAB boot.

i.MX8(QM/QXP/DX/DXL/DXL_phantom) - Added code for HAB checking.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLF-3767 imx8m: set mem=xMB to bootargs
Peng Fan [Fri, 30 Apr 2021 06:42:13 +0000 (14:42 +0800)]
LF-3767 imx8m: set mem=xMB to bootargs

Below two commit in Kernel cause no-map reserved memory are still kept
in kernel as memblock.
54d3a5761951 of/fdt: Make sure no-map does not remove already reserved regions
0674fa99a7d8 fdt: Properly handle "no-map" field in the memory region

So when jailhouse enabling, there will be resource conflict because
jailhouse pci will request the reserved memory for itself handling
virtual PCI trap.

So let's cut off the reserved memory using mem=xMB to avoid such issue.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoLF-2518 video: hdp: Adjust Layerscape HDP video driver folder
Ye Li [Fri, 16 Oct 2020 15:32:29 +0000 (15:32 +0000)]
LF-2518 video: hdp: Adjust Layerscape HDP video driver folder

Since the HDP will be shared with i.MX. Move the common HDP library
codes to "driver/video/nxp/hdp" directory.
And use platform specified directory "driver/video/nxp/layerscape"
for LS driver codes and configurations.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Alison Wang <alison.wang@nxp.com>
(cherry picked from commit f13b64fbea53ceff72ab5bb015aec77201b77439)

4 years agoLFU-126-8 i.MX8: Enable Job ring driver model in SPL and U-Boot.
Gaurav Jain [Wed, 28 Apr 2021 12:39:21 +0000 (18:09 +0530)]
LFU-126-8 i.MX8: Enable Job ring driver model in SPL and U-Boot.

i.MX8(QM/QXP/DX/DXL/DXL_phantom) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLFU-126-7 Layerscape: Enable Job ring driver model in U-Boot.
Gaurav Jain [Wed, 28 Apr 2021 08:31:15 +0000 (14:01 +0530)]
LFU-126-7 Layerscape: Enable Job ring driver model in U-Boot.

LS(1012/1028/1043/1046/1088/2088) - added support for JR driver.
LX2160, LX2162 - added support for JR driver.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLFU-126-6 i.MX7ULP: Enable Job ring driver model in U-Boot.
Gaurav Jain [Wed, 28 Apr 2021 06:45:06 +0000 (12:15 +0530)]
LFU-126-6 i.MX7ULP: Enable Job ring driver model in U-Boot.

sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLFU-126-5 i.MX7: Enable Job ring driver model in U-Boot.
Gaurav Jain [Wed, 28 Apr 2021 06:31:04 +0000 (12:01 +0530)]
LFU-126-5 i.MX7: Enable Job ring driver model in U-Boot.

i.MX7D - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLFU-126-4 i.MX6: Enable Job ring driver model in U-Boot.
Gaurav Jain [Wed, 28 Apr 2021 06:08:07 +0000 (11:38 +0530)]
LFU-126-4 i.MX6: Enable Job ring driver model in U-Boot.

i.MX6(Q/DL/QP/SOLO/SX/UL) - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLFU-126-3 i.MX8M: Enable Job ring driver model in SPL and U-Boot.
Gaurav Jain [Tue, 27 Apr 2021 11:29:31 +0000 (16:59 +0530)]
LFU-126-3 i.MX8M: Enable Job ring driver model in SPL and U-Boot.

i.MX8MM/MN/MP/MQ - added support for JR driver model.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLFU-126-2 crypto/fsl: Support BKEK generation
Gaurav Jain [Tue, 27 Apr 2021 09:55:03 +0000 (15:25 +0530)]
LFU-126-2 crypto/fsl: Support BKEK generation

Add support for generating BKEK.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLFU-126-1 crypto/fsl: Added support for Job ring driver model
Gaurav Jain [Tue, 27 Apr 2021 09:42:45 +0000 (15:12 +0530)]
LFU-126-1 crypto/fsl: Added support for Job ring driver model

added device tree support for job ring driver.
sec is initialized based on job ring information processed
from device tree.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
4 years agoLF-3483-19 imx8qm: xen: drop defconfig
Peng Fan [Wed, 28 Apr 2021 01:21:08 +0000 (09:21 +0800)]
LF-3483-19 imx8qm: xen: drop defconfig

Drop defconfig, it will be added back when android auto feature ready.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoMLK-24189-2 arm: imx: optee: ignore node create for xen
Peng Fan [Thu, 28 May 2020 07:41:57 +0000 (15:41 +0800)]
MLK-24189-2 arm: imx: optee: ignore node create for xen

Ignore node create for xen, currently we not have valid
registers when booting in xen, it might have garbage value and cause
kernel hang.

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

4 years agoMLK-24189-1 arm: dts: xen: drop power domain for gpio4/1
Peng Fan [Thu, 28 May 2020 07:41:09 +0000 (15:41 +0800)]
MLK-24189-1 arm: dts: xen: drop power domain for gpio4/1

gpio4/1 is handled by dom0, but shared with domu. without dropping
the power domain, probe will fail.

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

4 years agoMLK-24172-2 configs: imx8qm: disable SPL DM serial for domu
Peng Fan [Wed, 27 May 2020 06:08:27 +0000 (14:08 +0800)]
MLK-24172-2 configs: imx8qm: disable SPL DM serial for domu

Disable SPL DM SERIAL for domu, there is no mmu setup,
paravirtual console not work.

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

4 years agoMLK-24172-1 imx8qm: update xen defconfig/dts for 2020.04
Peng Fan [Tue, 26 May 2020 06:18:13 +0000 (14:18 +0800)]
MLK-24172-1 imx8qm: update xen defconfig/dts for 2020.04

Update xen defconfig
Update dts to let xen serial could be used in early stage,
but seems without mmu enabled, it output nothing. It only
output data after mmu enabled.

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

4 years agoMA-14318-1 Support dual bootloader for xen
Ji Luo [Tue, 12 Mar 2019 08:15:54 +0000 (16:15 +0800)]
MA-14318-1 Support dual bootloader for xen

Trusty is not supported for xen so we don't need to check
the keyslot package or rollback index in spl. Reassign the
dram address for spl and u-boot to avoid conflicts.

Support serial init functions to enable debug console
in spl when xen is running.

Test: Boot and A/B slot switch on imx8qm_mek.

Change-Id: If6829252f1ec2e32255f951715c8747181951fd0
Signed-off-by: Ji Luo <ji.luo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 30beee3fe6d4b35166c6e17203909231d33bc2db)
(cherry picked from commit a4ffa905d90d14ccdd146e4b38a69d40a568b747)
(cherry picked from commit ca5e676b7a7c5ea7b435cb05eba180f3a25e5335)

4 years agoMLK-20955 imx8qm: delete power-domains for lpuart0 on xen
Peng Fan [Thu, 21 Feb 2019 02:31:05 +0000 (10:31 +0800)]
MLK-20955 imx8qm: delete power-domains for lpuart0 on xen

To U-Boot on DomU, the lpuart0 is replaced with a xen paravirtual
consol driver, but reused the previous lpuart node. However
there is an power-domains entry in lpuart0 which will call
power_domain_on and failed to probe xen paravirtual driver,
because of recent change:
commit 8524ca764d8f("MLK-20945-2 dm: device: Check the power up result in probe ")

So remove the power-domains entry in lpuart0 to let DomU U-Boot could
output again.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit 38155100481a07e961f375052241d9d03e20a899)
(cherry picked from commit 92104edf74363ab1a322e186887bf4515d47aa9c)
(cherry picked from commit 75074ecb28d47cb1064d10e3d0b85defd7fb3c87)
(cherry picked from commit 10d04fd3f248e1a2f084811768c4690d2bcb2f89)

4 years agoMLK-20383 imx8qm: xen: enable dm usb
Peng Fan [Thu, 15 Nov 2018 09:46:06 +0000 (17:46 +0800)]
MLK-20383 imx8qm: xen: enable dm usb

Enable dm usb using the base board otg usb port for fastboot usage

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 88a1718aa7096782e9cf538e391762aaef631bb2)
(cherry picked from commit 279e82b731e7671536b729934e1dc88b760ea05a)
(cherry picked from commit 707c2aed80f747e3d50e2dcc48dce5be892634f2)

4 years agoMLK-20373-6 imx8qm: xen: enable dm serial
Peng Fan [Thu, 15 Nov 2018 05:20:02 +0000 (13:20 +0800)]
MLK-20373-6 imx8qm: xen: enable dm serial

Enable dm serial for xen uboot.

Log as below:
 #xl console 1
MMC:   FSL_SDHC: 0
Loading Environment from <NULL>... *** Warning - bad CRC, using default environment

Failed (-5)
In:    serial@5a060000
Out:   serial@5a060000
Err:   serial@5a060000
flash target is MMC:0
Fastboot: Normal
Normal Boot
=>

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>
(cherry picked from commit 132cb6f74bcd963b180de83279f00aef31bbbdca)
(cherry picked from commit 38313a6f8e437568dbc15075251d344fa67fd14b)
(cherry picked from commit 8cb20204281faf34731cbff05af14322d69358b3)

4 years agoMLK-20373-4 imx8: update mem map table
Peng Fan [Thu, 15 Nov 2018 05:17:37 +0000 (13:17 +0800)]
MLK-20373-4 imx8: update mem map table

Update mem map table for xen uboot.
xen console and some magic pages needs to be mappe as normal memory.

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>
(cherry picked from commit c96a9844cd3342f6e31627ccc4f3e63544ffd78e)
(cherry picked from commit 30b2d9f4a7c0cfc9b3f999f1c3a1a8c466d66a68)
(cherry picked from commit 03db7649c0f8c7a292160e2d5d8981e6c3b84ee3)

4 years agoMLK-20134 imx8qm: xen: correct DRAM SIZE and loadaddr
Peng Fan [Wed, 31 Oct 2018 01:14:43 +0000 (09:14 +0800)]
MLK-20134 imx8qm: xen: correct DRAM SIZE and loadaddr

The first DRAM BANK size should be 2GB and the load addr
are 0x80080000.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 56c9ac9734a59c68cb85125b7047087d00d141e8)
(cherry picked from commit fd9689b3a2bcd0de26594afa161c4e4acb4c7f58)
(cherry picked from commit ac0d7c6d0adb8e92ad8905d6d1037f20d624b1f4)

4 years agoMLK-19552 imx8qm: xen: fix memory map
Peng Fan [Wed, 12 Sep 2018 06:32:27 +0000 (14:32 +0800)]
MLK-19552 imx8qm: xen: fix memory map

Fixes 9486251ced24("MLK-19494 configs: imx8qm mek android audo: correct xen physical memory")

correct text base, IPC address, memmap.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 884cada50b9a9fcda09d259cf145d87a29122cac)
(cherry picked from commit 55822e16786817f843d32c1347d705c2a2a435dd)
(cherry picked from commit 042c104da526f522175122f1d626c2d13cc57492)

4 years agoMLK-19494 configs: imx8qm mek android audo: correct xen physical memory
Peng Fan [Fri, 7 Sep 2018 08:49:45 +0000 (16:49 +0800)]
MLK-19494 configs: imx8qm mek android audo: correct xen physical memory

XEN tool has changed GUEST_RAM0_BASE to 2GB, since we assigned
3584M RAM to DomU, so reflect the change in configuration file.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 9486251ced24e3bf3ecbff68a8f9476e694e5bf7)
(cherry picked from commit 0278b14507731b465652aa41c4a95dafa66da5d1)
(cherry picked from commit d9372c4502c7d958d608911b50a418871ccc4540)

4 years agoMLK-18614-3 Xen: imx8qm_mek: Fix the CONFIG_FASTBOOT_USB_DEV and DTB issue
Ye Li [Fri, 15 Jun 2018 02:04:36 +0000 (19:04 -0700)]
MLK-18614-3 Xen: imx8qm_mek: Fix the CONFIG_FASTBOOT_USB_DEV and DTB issue

Because the Xen u-boot is using OTG port not typec port, the CONFIG_FASTBOOT_USB_DEV
should set to 0 not 1. Otherwise the fastboot will fail.

Remove duplicated "/dts-v1/;" from Xen DTB.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit ceaa529b34752045dcd294572c30c7c56a48abe7)
(cherry picked from commit 2942cb192c0fff45307042bf60da08a30ccddaf2)
(cherry picked from commit 9e8b963dc74f54a781cdb495f24b9b6a669cd17e)
(cherry picked from commit be348f08fca7620698ec7fea3d94f7b95485aa2c)

4 years agoMLK-18577-7 imx8qm: mek: support uboot in vm
Peng Fan [Tue, 12 Jun 2018 08:18:00 +0000 (16:18 +0800)]
MLK-18577-7 imx8qm: mek: support uboot in vm

We are targeting let uboot loading images from emmc to boot android.
Currently only emmc1 is enabled, so other devices are disabled.

Also change memory layout according to VM layout. The memory layout
needs to be samesize as what you configured in as "memory = "3584"".

Add a new dts dedicated for this kind uboot, add a new defconfig
to select CONFIG_XEN/CONFIG_XEN_DEBUG_SERIAL, deselect CONFIG_DM_SERIAL,
select CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK, and disable some devices
compared with imx8qm_mek_androidauto_defconfig.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit a4e932cae433b9d2e1cff6a94b12e4abcac45543)
(cherry picked from commit a26de6e05563d3e3e6734e0d99e464437aa89db5)
(cherry picked from commit 74ac579ee195c4a2f6651ccc0f86efb0eebd889e)
(cherry picked from commit 7258e558b51a7f56d2b895c9c554423e12037ed3)

4 years agoMLK-18577-5 imx8: update soc code to support uboot in XEN VM
Peng Fan [Tue, 12 Jun 2018 08:07:24 +0000 (16:07 +0800)]
MLK-18577-5 imx8: update soc code to support uboot in XEN VM

Update SOC code to support U-Boot in a XEN VM. Currently
we only support to boot android using uboot in a VM,
so there is hardcode that using MMC1_BOOT boot.

There are a few small fixes included.

For the mmu configuration, the mem map is used from xen
guest VM and our iomem space in vm cfg file.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 533087bc1bce0c35fead0956b0613971862c280f)
(cherry picked from commit c2ba2460d8985aa0b084f7beef2d0bc8773d90e3)
(cherry picked from commit 2b0a537f59646f3f222d60ebe46611160ba6bdc9)

4 years agoMLK-18577-4 serial: add simple xen debug output
Peng Fan [Wed, 13 Jun 2018 03:02:33 +0000 (11:02 +0800)]
MLK-18577-4 serial: add simple xen debug output

Add simple debug output when uboot runs in a VM.
Needs DM_SERIAL disabled, and XEN_DEBUG_SERIAL enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit b41475b83c8d7c83bd6069f4fea05d3405e81e50)
(cherry picked from commit 695ae513cdf6c671cda5c32e4a2974e3119450d0)
(cherry picked from commit d4189c87bbd3a5fd0abc74f7e9ce12a2f86c0de0)
(cherry picked from commit bb686e0c1ac24fcb72eaab51c249020b40807ec7)

4 years agoMLK-18577-3 armv8: xen: add console write hypercall
Peng Fan [Tue, 12 Jun 2018 08:00:23 +0000 (16:00 +0800)]
MLK-18577-3 armv8: xen: add console write hypercall

Introduce console write hypercall to let Uboot could directly
output with xen console, this needs CONFIG_VERBOSE_DEBUG
enabled in xen.

Because input is not a must requirement in android VM,
and develop pvconsole needs more efforts, so let's use
this hypercall first.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 8836c3104a1edfe542e0c1cef6690bc9d3d842a0)
(cherry picked from commit aea71150857d4617009730683c95d858acb43392)
(cherry picked from commit 3173d3ac39bed27a3197829ea13ffce5a89b07ac)

4 years agoLF-3483-18 net: eqos: add function to get phy node and address
Ye Li [Wed, 28 Apr 2021 17:09:52 +0000 (10:09 -0700)]
LF-3483-18 net: eqos: add function to get phy node and address

Since new atheros PHY driver needs to access its PHY node through
phy device, we have to assign the phy node in ethernet controller
driver. Otherwise the PHY driver will fail to get some nodes
and properties.

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoLF-3483-17 imx: optee: Copy the fdt overlay before using it
Ye Li [Tue, 27 Apr 2021 21:55:44 +0000 (14:55 -0700)]
LF-3483-17 imx: optee: Copy the fdt overlay before using it

Since fdt overlay only can use once, but distro boot will call
"bootefi bootmgr" to apply the overlay to fdt. So when distro boot
is failed, following BSP default boot can't apply the overlay any
longer.

Using the patch to copy the fdt overlay before using it to avoid
above problem.

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoLF-3483-16 mmc: fix device_remove when HS400_ES is enabled
Ye Li [Wed, 28 Apr 2021 01:19:19 +0000 (18:19 -0700)]
LF-3483-16 mmc: fix device_remove when HS400_ES is enabled

HS400_ES is missed when down grade to HS mode when
device_remove the mmc device

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoLF-3483-15 mmc: fix switch issue with send_status disabled
Ye Li [Wed, 28 Apr 2021 01:16:30 +0000 (18:16 -0700)]
LF-3483-15 mmc: fix switch issue with send_status disabled

According to the comment, when send_status is false or wait_dat0
is not supported, the switch should not send CMD13 but directly
return.

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoLF-3483-14 pmic: pca9450: Add compatible string for pca9450c
Ye Li [Sat, 24 Apr 2021 00:17:31 +0000 (17:17 -0700)]
LF-3483-14 pmic: pca9450: Add compatible string for pca9450c

Add driver compatible string for pca9450c PMIC device. Otherwise
we will fail to bind the pmic

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agousb: ehci-hcd: Add IAA handshake for removing async QH
Ye Li [Tue, 9 Mar 2021 03:26:57 +0000 (19:26 -0800)]
usb: ehci-hcd: Add IAA handshake for removing async QH

According to EHCI spec, software needs to do handshake with HC for
safely removing QH from async list. This handshake is implemented by
setting IAAD (Interrupt on Async Advance Doorbell) bit in USB_USBCMD
register and poll the IAA (Interrupt on Async Advance bit) in the
USB_USBSTS to ensure the HC has released all on-chip state that may
potentially reference one of the data structures just removed.

Current codes only check active status of the last QTD, but this can't
ensure the QH is released from HC. We can meet unrecoverable
"EHCI timed out on TD" errors when running UEFI SCT tests on USB disk.
The USB_ASYNCLISTADDR register is changed to a invalid address when the
issue happens. It is fixed after adding the IAA handshake.

Steps to reproduce the issue:
1. Build the UEFI SCT from https://github.com/tianocore/edk2-test
2. Build the EDK2 UEFI Shell from https://github.com/tianocore/edk2
3. Copy SCT files and Shell.efi to USB disk FAT partition
4. Load the Shell.efi from USB FAT, and run bootefi to execute it
5. After booting into Shell, enter the SCT directory and run "sct -a"
   to execute all tests.
6. Tests run about 1 hour and stop with many EHCI timeout errors like
   EHCI timed out on TD - token=0x801f8c80

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

4 years agoMLK-25295 imx8mq_evk: Add new LPDDR4 timing files from RPA tool
Ye Li [Fri, 26 Feb 2021 14:55:22 +0000 (06:55 -0800)]
MLK-25295 imx8mq_evk: Add new LPDDR4 timing files from RPA tool

Update LPDDR4 timing generated from RPA tool

Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agommc: fsl_esdhc_imx: add extra delay for IO voltage switch if necessary
Haibo Chen [Mon, 22 Mar 2021 10:55:38 +0000 (18:55 +0800)]
mmc: fsl_esdhc_imx: add extra delay for IO voltage switch if necessary

Some board like imx8mm-evkb, IO voltage switch from 3.3v to 1.8v need
around 18ms, common code only delay 10ms, so need to delay extra 8ms.
Otherwise voltage switch will timeout when wait for data0 line.

This IO voltage switch time depends on board design, depend on the
PMIC and capacitance. imx8mm-evkb board use PCA9450(PMIC) and 10uF
capacitance.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 8974ff1a60365dedf1192632f5e0c21680d49dbc)

4 years agommc: fsl_esdhc_imx: remove redundant cmd11 related code.
Haibo Chen [Mon, 22 Mar 2021 10:55:37 +0000 (18:55 +0800)]
mmc: fsl_esdhc_imx: remove redundant cmd11 related code.

Common code already handle the voltage switch sequence based on spec,
so remove the redundant voltage switch code.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 1e595a81d9bc0d6fd30e3ba17e3f8a9278a381f8)

4 years agommc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output
Haibo Chen [Wed, 3 Mar 2021 09:05:46 +0000 (17:05 +0800)]
mmc: fsl_esdhc_imx: use VENDORSPEC_FRC_SDCLK_ON to control card clock output

For FSL_USDHC, it do not implement VENDORSPEC_CKEN/PEREN/HCKEN/IPGEN, these
are reserved bits. Instead, use VENDORSPEC_FRC_SDCLK_ON to gate on/off the
card clock output.

After commit b5874b552ffa ("mmc: fsl_esdhc_imx: add wait_dat0() support"),
we meet SD3.0 card can't work at UHS mode, mmc_switch_voltage() fail because
the second mmc_wait_dat0 return -ETIMEDOUT. According to SD spec, during
voltage switch, need to gate off/on the card clock. If not set the FRC_SDCLK_ON,
after CMD11, hardware will gate off the card clock automatically, so card do
not detect the clock off/on behavior, so will draw the data0 line low until
next command.

Fixes: b5874b552ffa ("mmc: fsl_esdhc_imx: add wait_dat0() support")
Tested-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 63756575b42b8b4fb3f59cbbf0cedf03331bc2d2)

4 years agoLF-3635: imx8qm: Use malloc for container processing
Nitin Garg [Fri, 9 Apr 2021 01:19:23 +0000 (20:19 -0500)]
LF-3635: imx8qm: Use malloc for container processing

If the container has image which conflicts with
spl_get_load_buffer address, there are processing failures.
Use malloc instead of spl_get_load_buffer.

Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 0dc262fb3698f5cfb5dbe95dd07c521c355c93b3)
(cherry picked from commit 1610ff18c73d110e9ca5ac8f0bfcbd9c30c434b3)
Signed-off-by: Ye Li <ye.li@nxp.com>
4 years agoLF-3635: imx8qm: Add u-boot-spl support for A72 cockpit
Nitin Garg [Fri, 9 Apr 2021 01:17:19 +0000 (20:17 -0500)]
LF-3635: imx8qm: Add u-boot-spl support for A72 cockpit

iMX8QM A72 cockpit requires SPL for OPTEE support.

Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 25140ad27467829e3c75f97c56bbc7aeb4dbf8a3)
(cherry picked from commit b4ca0880174e09fd74490412972f4b5930629b71)

4 years agoMLK-25346: Add cockpit device tree and config files
Nitin Garg [Mon, 15 Mar 2021 03:16:24 +0000 (22:16 -0500)]
MLK-25346: Add cockpit device tree and config files

Add defconfigs and dts files for each cluster.

Signed-off-by: Seb Fagard <sebastien.fagard@nxp.com>
Signed-off-by: Fabrice Goucem <fabrice.goucem@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
(cherry picked from commit 367e012ebd0a664ab36dc50436422efdb91ab9f4)
(cherry picked from commit 25572ccf8dc94554ab0ff46afe17354db497d198)

4 years agoMLK-25346: Add support for cockpit on i.MX8QM MEK board
Nitin Garg [Mon, 15 Mar 2021 03:17:35 +0000 (22:17 -0500)]
MLK-25346: Add support for cockpit on i.MX8QM MEK board

This allows the u-boot to be built separately for different
clusters (A53 or A72) on i.MX8QM.

Signed-off-by: Seb Fagard <sebastien.fagard@nxp.com>
Signed-off-by: Fabrice Goucem <fabrice.goucem@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
(cherry picked from commit edb54f88b014bdd0379370678d54de60e3962b38)
(cherry picked from commit e8ec7faa4cb53461da3c397ee3d95fc4a82a5d21)

4 years agoMLK-25271: new qspihdr subsystem for u-boot q(f)spi boot
Han Xu [Fri, 22 Jan 2021 03:18:53 +0000 (21:18 -0600)]
MLK-25271: new qspihdr subsystem for u-boot q(f)spi boot

qspihdr is a new subsystem in u-boot to check/updat q(f)spi boot config
headers. It's already integrated with uuu and can be used to burn
q(f)spi boot images for i.MX6/7/8 families.

Basic usage:
check [addr]: check if exists valid q(f)spi boot config header at
      spcified memory addr, or check the nor chip without addr
dump [addr] : dump q(f)spi boot config header content from spcified
      memory addr, or from nor chip without addr
init addr len safe: burn boot image from memory addr with size of len to
      q(f)spi, with safe boot config header
update safe : only update header in q(f)spi to a safe boot config

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

4 years agoMLK-25320 video: imx_lcdifv3: Add memory priority threshold setting
Ye Li [Fri, 26 Feb 2021 18:24:48 +0000 (10:24 -0800)]
MLK-25320 video: imx_lcdifv3: Add memory priority threshold setting

Add the panic control from kernel for lcdifv3 to increase the memory
request priority to resolve QoS issue.
User can adjust the thresholds by using 'thres-low' and 'thres-high'
properties in DTS.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jian Li <jian.li@nxp.com>
(cherry picked from commit f81e7caa100940206550ee4e2f64b5b799a5d92e)
(cherry picked from commit 613092e2fd58ac50f4416f73a37ed47de6275a51)

4 years agoMLK-25310 imx8m: ddr: Disable CA VREF Training for LPDDR4
Ye Li [Sat, 20 Feb 2021 18:45:37 +0000 (10:45 -0800)]
MLK-25310 imx8m: ddr: Disable CA VREF Training for LPDDR4

Users reported LPDDR4 MR12 value is set to 0 during PHY training,
not the value from FSP timing structure, which cause compliance test failed.
The root cause is the CATrainOpt[0] is set to 1 in 2D FSP timing
but not set in 1D.  According to PHY training application node,
to enable the feature both 1D and 2D need set this field to 1,
otherwise the training result will be incorrect.
The PHY training doc also recommends to set CATrainOpt[0] to 0 to use
MR12 value from message block (FSP structure). So update the LPDDR4
scripts of all mscale to clear CATrainOpt[0].

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