u-boot.git
5 years agoMLK-20664-1 imx8qxp: spl: Enable SPL container support for NAND
Ye Li [Thu, 27 Dec 2018 05:45:54 +0000 (21:45 -0800)]
MLK-20664-1 imx8qxp: spl: Enable SPL container support for NAND

Add the NAND support to SPL container parser and enable it for imx8qxp arm2
nand reworked board.
The SPL NAND will read from nandfit mtdpart (128MB offset) to parsing the entire
boot image and get the 3rd container from it. This requires burning tool (uuu)
to program the entire boot image into nandfit.

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

5 years agoMLK-20559-6 f_sdp: Support searching and loading FIT or container image
Ye Li [Thu, 3 Jan 2019 08:50:24 +0000 (00:50 -0800)]
MLK-20559-6 f_sdp: Support searching and loading FIT or container image

Add support to f_sdp to search and load iMX8 container image or iMX8M
FIT image by new UUU command SDPV.

When using the SDPV, the uuu will continue to send out data after first
level boot loader used by ROM. This means uuu won't skip to the offset
of the second boot loader, and the padding data before second boot loader
will be sent out. So we have to search the FIT header or container header
in the buffer that SDP received.

The new BCD value is used by uuu to distinguish if the SPL supports the
SDPV.

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

5 years agoMLK-20559-5 f_sdp: Add a callback to clean up USB driver
Ye Li [Thu, 3 Jan 2019 08:46:09 +0000 (00:46 -0800)]
MLK-20559-5 f_sdp: Add a callback to clean up USB driver

Because SDP directly jumps to next level boot image, we'd better
clean up the USB driver before it. Implement a weak callback function,
that spl sdp can use it to clean up USB driver.

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

5 years agoMLK-20559-4 f_sdp: Fix wrong usb request size
Ye Li [Thu, 3 Jan 2019 08:41:07 +0000 (00:41 -0800)]
MLK-20559-4 f_sdp: Fix wrong usb request size

Because the buffer length of sdp usb request is 65, we have to allocate
65 bytes not 64 bytes. Otherwise there is potential buffer overflow.

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

5 years agoMLK-20559-3 f_sdp: Add high speed endpoint descriptor
Ye Li [Thu, 3 Jan 2019 06:58:15 +0000 (22:58 -0800)]
MLK-20559-3 f_sdp: Add high speed endpoint descriptor

Add HS endpoint descriptor for SDP. So that we can use high speed endpoint,
and the SDP device can send packet with 512 byte size.

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

5 years agoMLK-20559-2 spl: Enable cdns3 USB driver for SPL building
Ye Li [Thu, 3 Jan 2019 06:40:23 +0000 (22:40 -0800)]
MLK-20559-2 spl: Enable cdns3 USB driver for SPL building

The imx8qm/qxp uses cdns3 USB driver. To support SPL SDP, we have
to enable the driver.

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

5 years agoMLK-20559-1 spl_sdp: Add CONFIG_SPL_SDP_USB_DEV for USB device
Ye Li [Thu, 3 Jan 2019 06:37:49 +0000 (22:37 -0800)]
MLK-20559-1 spl_sdp: Add CONFIG_SPL_SDP_USB_DEV for USB device

Add a new configuration CONFIG_SPL_SDP_USB_DEV to specify the
usb index for spl sdp driver, so that we change use different device.
The default value is 0.

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

5 years agoMLK-18707-1: SDP: use CONFIG_SDP_LOADADDR as default load address
Frank Li [Fri, 29 Jun 2018 08:34:28 +0000 (03:34 -0500)]
MLK-18707-1: SDP: use CONFIG_SDP_LOADADDR as default load address

if SDP_WRITE and SDP_JUMP addr is zero, use CONFIG_SDP_LOADADDR
as default address

Signed-off-by: Frank Li <Frank.Li@nxp.com>
(cherry picked from commit 192a26dbcd88da7d1773bb6336d855c408239d4a)
(cherry picked from commit 7d24d618fc00cdd1f6e0f214a5b80d00cb6f9f18)

5 years agoMLK-19181-1: sdp: call board_usb_init at spl_sdp_load_image
Frank Li [Thu, 9 Aug 2018 15:23:37 +0000 (10:23 -0500)]
MLK-19181-1: sdp: call board_usb_init at spl_sdp_load_image

Need initialize UDC before run sdp download

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

5 years agoMLK-20663 imx8: Fix malloc issue in container parser
Ye Li [Thu, 27 Dec 2018 05:42:24 +0000 (21:42 -0800)]
MLK-20663 imx8: Fix malloc issue in container parser

The size used for malloc is wrong, the following read function will
read 1KB to the container header buffer not the size of the header.

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

5 years agoMLK-21856 imx8: Check the RevA ROM pass over info only in u-boot
Ye Li [Tue, 23 Apr 2019 08:47:11 +0000 (01:47 -0700)]
MLK-21856 imx8: Check the RevA ROM pass over info only in u-boot

Since we only support RevA booting without SPL, so move the ROM pass
over info checking to u-boot build. Because the we get CPU revision
from SCU, need moving it to arch_cpu_init_dm after SCFW driver is ready.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-20654-2 imx8: SPL: Move arch_cpu_init to board_init_f
Ye Li [Thu, 25 Apr 2019 04:57:23 +0000 (21:57 -0700)]
MLK-20654-2 imx8: SPL: Move arch_cpu_init to board_init_f

Since we have data section save/restore in arch_cpu_init, need it
in early stage, so move arch_cpu_init to board_init_f

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-20654 imx8: Recover SPL data section for partition reboot
Ye Li [Wed, 26 Dec 2018 08:28:31 +0000 (00:28 -0800)]
MLK-20654 imx8: Recover SPL data section for partition reboot

When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

For SPL, the problem is DATA section will be updated at runtime, so in
next partition reboot the data is not same as the initial value from
cold boot. If any code depends on the initial value, then it will have
problem.

This patch introduces a mechanism to recover the data section for partition
reboot. It adds a new section in image for saving data section. When from cold
boot, the data section will be saved to that new section at SPL early phase.
When from partition reboot, the data section will be restored from the new section.

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

5 years agoMLK-20602 imx8mq: Change clock source of GIC
Bai Ping [Mon, 17 Dec 2018 08:10:37 +0000 (16:10 +0800)]
MLK-20602 imx8mq: Change clock source of GIC

Change the the GIC clock source to sys_pll2_200m.
Improve the IRQ response latency.

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

5 years agoMLK-20569 usb: ehci-mx6: configure usb out of suspend state
Peng Fan [Wed, 12 Dec 2018 02:26:33 +0000 (10:26 +0800)]
MLK-20569 usb: ehci-mx6: configure usb out of suspend state

When moving to support partition reboot or android auto on XEN,
linux kernel will runs into runtime suspend state, and the usb
will be configured to low power suspend state by Linux.

Then we reboot and runs into U-Boot, however the usb already in
suspended state and uboot not able to lock the phy pll,
after clearing PHCD to out of suspended state, the phy pll could be
locked and fastboot works.

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

5 years agoMLK-20479 imx8mq: clear ocotp error bit
Peng Fan [Wed, 28 Nov 2018 04:32:21 +0000 (12:32 +0800)]
MLK-20479 imx8mq: clear ocotp error bit

In case ocotp error bit is set, clear it.
This is a workaround to ocotp error bit.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 781f2d8febe954b2ef3e51b6a2eebcfbf24b08eb)

5 years agoMLK-20414 imx8m: jailhouse: loadimage before mmcboot
Peng Fan [Tue, 20 Nov 2018 02:04:16 +0000 (10:04 +0800)]
MLK-20414 imx8m: jailhouse: loadimage before mmcboot

Need loadimage before execute mmcboot.

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

5 years agoTEE-329-2: OP-TEE: Allow u-boot to add optee node in dtb
Silvano di Ninno [Wed, 21 Nov 2018 04:41:20 +0000 (05:41 +0100)]
TEE-329-2: OP-TEE: Allow u-boot to add optee node in dtb

If OP-TEE is loaded by ATF, u-boot will add
optee device tree node in th edtb so that
Linux can loads OP-TEE driver.

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
(cherry picked from commit 441c23698ffd5c90c6421113da55fae420072473)

5 years agoTEE-329-1: OP-TEE: Allow ATF to pass boot arg to u-boot
Silvano di Ninno [Wed, 21 Nov 2018 04:36:49 +0000 (05:36 +0100)]
TEE-329-1: OP-TEE: Allow ATF to pass boot arg to u-boot

u-boot currently needs information from ATF to know if
OP-TEE os has been loaded.
this information is transmitted via bootargs.
this patch enables saving those bootargs into a structure.

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
(cherry picked from commit 697cfe9dbdc079b68d8b5685b728a7283c837607)

5 years agoMLK-20233 spl_spi: Add QSPI boot device support to the container parser
Abel Vesa [Wed, 7 Nov 2018 16:13:08 +0000 (18:13 +0200)]
MLK-20233 spl_spi: Add QSPI boot device support to the container parser

Before parsing the image header, try to check if there is a container and
validate it first. If no (valid) container then as a fall-through parse
the image as before.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 2bd8277fd7eceed3aa4b07b6fe238b7beef62530)

5 years agoMLK-20233 imx8: Fix QSPI read in container parser
Abel Vesa [Wed, 7 Nov 2018 16:12:22 +0000 (18:12 +0200)]
MLK-20233 imx8: Fix QSPI read in container parser

The check for CONFIG_SPL_SPI_LOAD is fixed, get rid of ret local variable
(that's actually a bug) and fix the length for the spi_flash_read call.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 32adc4aed8864fe274de13f14f4e29759062ee1d)

5 years agoMLK-20233 arch: imx8: Add container parser for loading ATF and uboot proper
Abel Vesa [Thu, 1 Nov 2018 15:02:48 +0000 (17:02 +0200)]
MLK-20233 arch: imx8: Add container parser for loading ATF and uboot proper

This intends to replace the FIT image support since that cannot be
authenticated. Instead, we append another container at the end of
flash.bin, this new one containing a new container with two
images representing the ATF and uboot proper.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit c853049068ba2026cf91a6268958913db379a432)

5 years agoMLK-19877-1: iMX8: SPL: Add NAND SPL support
Teo Hall [Mon, 15 Oct 2018 22:03:45 +0000 (17:03 -0500)]
MLK-19877-1: iMX8: SPL: Add NAND SPL support

Add implementation necessary for supporting SPL loading image from NAND.

Signed-off-by: Teo Hall <teo.hall@nxp.com>
(cherry picked from commit fe6af144930a0a32cbc4599635a96c8a629432a1)

5 years agoMLK-20160-1 usb: ehci-mx6: Fix PHY power up issue on iMX8 platforms
Ye Li [Thu, 1 Nov 2018 07:30:47 +0000 (00:30 -0700)]
MLK-20160-1 usb: ehci-mx6: Fix PHY power up issue on iMX8 platforms

On iMX8 platforms like 8QM/QXP, we must power up the USB PHY resource
before accessing the PHY. However, current init flow access the USB PHY
in ehci_mx6_common_init prior than ehci_usb_phy_mode where the PHY is power
up.

Fix the issue by adding ehci_get_usb_phy function to parse the PHY address
from DTB and power up the PHY before ehci_mx6_common_init.

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

5 years agoMLK-20107 fspi: Keep the module enabled after probe
Ye Li [Thu, 25 Oct 2018 08:37:52 +0000 (01:37 -0700)]
MLK-20107 fspi: Keep the module enabled after probe

In flexspi driver, each sf command will disable the module in release bus
function. So reading from flexspi memory-map address using "md" command
can't work. When iMX8MM kicks M4 image to run flexspi NOR XIP,
this causes problem.

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

5 years agoMLK-20057 usb: ehci-mx6: Fix usb type issue in DM driver
Ye Li [Wed, 24 Oct 2018 08:08:26 +0000 (01:08 -0700)]
MLK-20057 usb: ehci-mx6: Fix usb type issue in DM driver

Currently the clocks and power of USB controller and USB PHY are both
controlled by ehci-mx6 driver in device probe. However, the function
"ehci_usb_ofdata_to_platdata" calls "ehci_usb_phy_mode"
to access PHY registers when "dr_mode" is set to OTG, both "dr_mode" and
"extcon" properties are not set in DTB. This may cause hang at accessing
USB PHY registers if the power and clocks are not enabled.

Change the usb type logic to more clear way:
1. plat->init_type: The requested USB mode type from uplayers
2. priv->init_type: The USB mode type specified by DTB or by the USB ID pin or
   by external controller like tcpc or GPIO.
3. If two init_type are not same, return failure. Align with non-DM driver.
4. USB PHY access is moved after power and clock enabled.

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

5 years agoMLK-20026 caam: Fix CAAM RNG init hang on imx8mq RevA
Ye Li [Mon, 22 Oct 2018 07:45:09 +0000 (00:45 -0700)]
MLK-20026 caam: Fix CAAM RNG init hang on imx8mq RevA

Found the imx8mq Rev A chip (B0 and B1 chips are ok) boot hang at CAAM RNG init.
The jobring 0 can't complete instantiation descriptor and spins on checking ORSFR_JR0.

In current implementation, the descriptor and jobring input and output base address locate
on TCM, because the driver uses raw_data array in jr_data_st structure as the buffer.
This seems cause the issue. If switched from TCM to OCRAM, the issue will go.

Since accessing TCM by CAAM is not very reliable. Add this patch to use OCRAM for SPL case.
The early malloc is ready on SPL before calling board_init_f. So we can use malloc to allocate
memory instead of the raw_data array.

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

5 years agoMLK-19882 imx8qm/qxp: introduce dom0fdt_file env
Peng Fan [Thu, 11 Oct 2018 06:38:46 +0000 (14:38 +0800)]
MLK-19882 imx8qm/qxp: introduce dom0fdt_file env

Introduce dom0fdt_file env to let user could change
the dom0 dtb file.

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

5 years agoMLK-19789 mach-imx: imx8: Make the eMMC container offset SOC dependant
Abel Vesa [Fri, 28 Sep 2018 15:02:49 +0000 (18:02 +0300)]
MLK-19789 mach-imx: imx8: Make the eMMC container offset SOC dependant

This is a hack for imx8qm-mek, since the offset of the flash.bin image
on eMMC differs when compared to imx8qxp-mek. Basically, the default value
is 32K, but for 8qm-mek it's 0. This can go away once the qm and qxp get
aligned (again) from this point of view.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit e9f87deae7e8cb3e71012f85c488e0a0d108762a)

5 years agoMLK-21848-4 iMX8QXP/QM: SPL: Disable power domain before booting into next level
Ye Li [Tue, 23 Apr 2019 06:53:15 +0000 (23:53 -0700)]
MLK-21848-4 iMX8QXP/QM: SPL: Disable power domain before booting into next level

Disable the power domain for the devices we used in SPL before we booting
into ATF

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-18161-12 imx8qm/imx8qxp - Power down devices enabled by uboot before launching...
Ye Li [Thu, 19 Apr 2018 02:34:11 +0000 (19:34 -0700)]
MLK-18161-12 imx8qm/imx8qxp - Power down devices enabled by uboot before launching the  kernel

Make sure that all devices that are powered up by uboot
are powered down before bringing up kernel.
Else the subsystem/device will never be powered down by SCFW even though
from the kernel's point of view it should be powered down.

Benefiting from power domain driver, We have implemented the function "power_off_pd_devices"
to power off all active devices. No need to explicitly power off them in board_quiesce_devices.

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

5 years agoMLK-21848-3 DTS: imx8qm: Enable the flexspi node for SPL DM
Ye Li [Tue, 23 Apr 2019 07:10:32 +0000 (00:10 -0700)]
MLK-21848-3 DTS: imx8qm: Enable the flexspi node for SPL DM

Add the "u-boot,dm-spl;" property to flexspi0 node, so we can use
it in SPL.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-21848-2 DTS: imx8qxp: Enable the flexspi node for SPL DM
Ye Li [Tue, 23 Apr 2019 06:33:18 +0000 (23:33 -0700)]
MLK-21848-2 DTS: imx8qxp: Enable the flexspi node for SPL DM

Add the "u-boot,dm-spl;" property to flexspi0 node and its pd node,
so we can use it in SPL

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-21848-1 iMX8QXP/QM: SPL: enable dm-spl for pm
Peng Fan [Thu, 7 Mar 2019 12:43:37 +0000 (12:43 +0000)]
MLK-21848-1 iMX8QXP/QM: SPL: enable dm-spl for pm

with u-boot,dm-spl added for imx8qx-pm node, and SPL_SIMPLE_BUS enabled,
the bind and probe code in board file could be removed.

Also we need to enlarge SYS_MALLOC_F_LEN to avoid calloc fail.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-19219-4 iMX8QXP/QM: Add support to get container image set size from QSPI
Abel Vesa [Mon, 17 Sep 2018 10:18:19 +0000 (13:18 +0300)]
MLK-19219-4 iMX8QXP/QM: Add support to get container image set size from QSPI

This transforms almost all related functions from mmc specific to device
independent. This allows the container size to be computed from QSPI and other
future devices that will be supported for boot.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit c70afc348ee9fae242f00be56cde556822f93156)

5 years agoMLK-19053: crypto: caam: RNG4 TRNG errata
Aymen Sghaier [Thu, 13 Sep 2018 16:19:13 +0000 (18:19 +0200)]
MLK-19053: crypto: caam: RNG4 TRNG errata

  The TRNG as used in RNG4, used in CAAM has a documentation issue. The
 effect is that it is possible that the entropy used to instantiate the
 DRBG may be old entropy, rather than newly generated entropy. There is
 proper programming guidance, but it is not in the documentation.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(cherry picked from commit 2aff5ffb2c4bb19106f3faa76415b51591cbc2b2)

5 years agoMLK-19526-5 imx8mq: Power down core 2/3 for iMX8MD
Ye Li [Tue, 11 Sep 2018 06:03:55 +0000 (23:03 -0700)]
MLK-19526-5 imx8mq: Power down core 2/3 for iMX8MD

CPU 2/3 are fused on iMX8MD, power down the two cores in SPL to
save power.

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

5 years agoMLK-19526-4 imx8mq: Disable Splash screen for old iMX8MQLite
Ye Li [Mon, 10 Sep 2018 05:08:11 +0000 (22:08 -0700)]
MLK-19526-4 imx8mq: Disable Splash screen for old iMX8MQLite

Since iMX8MQLite has disabled DCSS and HDMI by fuse on old part.
We should check it when initialize HDMI splash screen and exit.

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

5 years agoMLK-19526-2 imx8mq: Update kernel DTB for iMX8MD and iMX8MQLite
Ye Li [Tue, 11 Sep 2018 03:24:22 +0000 (20:24 -0700)]
MLK-19526-2 imx8mq: Update kernel DTB for iMX8MD and iMX8MQLite

Since VPU/HDMI are disabled on iMX8QLite, the CPU core 2/3 are disabled
on iMX8MD, we have to update kernel DTB to disable relevant nodes. The MIPI-DSI
can input from DCSS or LCDIF, so we need to check the input in DTB and only

The iMX8MQLite new part will not disable DCSS in fuse, but old will disable
DCSS. So the codes to check the DCSS fuse before disable relevant FDT nodes.

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

5 years agoMLK-19526-1 imx8mq: Add CPU ID for iMX8MD and iMX8MQLite
Ye Li [Tue, 11 Sep 2018 03:22:52 +0000 (20:22 -0700)]
MLK-19526-1 imx8mq: Add CPU ID for iMX8MD and iMX8MQLite

iMX8MQ has two variant versions: iMX8MD and iMX8MQLite. Add dummy CPU ID
for these two, and check the fuses to get correct versions.

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

5 years agoMLK-19477 iMX8QM: Power down HDMI_PLL_0 after firmware loading is done.
Ranjani Vaidyanathan [Wed, 29 Aug 2018 22:55:13 +0000 (17:55 -0500)]
MLK-19477 iMX8QM: Power down HDMI_PLL_0 after firmware loading is done.

Need to power down HDMI_PLL_0 after HDMI firmware is loaded, else
resource is left ON when entering low power states thus impacting low
power number.

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
(cherry picked from commit 93450bafc8dc7d9236c3f7520a2602e18c1d2ba3)

5 years agoMLK-19465 imx8mq: Fix cpu rev issue on B0.1 chip
Ye Li [Thu, 6 Sep 2018 06:30:59 +0000 (23:30 -0700)]
MLK-19465 imx8mq: Fix cpu rev issue on B0.1 chip

We read the ROM version to determine the CPU revision before B1 chip.
The rom version is 4 bytes word, it has major version at low byte,
minor version at second byte.

On B0.1 chip, the value is 0x1020 not 0x20, if reading the word and comparing
with 0x20, the result is wrong.

Fix the issue by only reading the lowest byte for major version.

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

5 years agoMLK-19433-3 mxc_ocotp: Disable fuse sense for imx8mq B1
Ye Li [Mon, 3 Sep 2018 07:53:20 +0000 (00:53 -0700)]
MLK-19433-3 mxc_ocotp: Disable fuse sense for imx8mq B1

On iMX8MQ Rev B1, reading from fuse box is not allowed. The
OCOTP_READ_FUSE_DATA register is tied to magic number 0xff0055aa
for chip rev. So u-boot has to disable the fuse sense function for it.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit da95f60611e8859eba3e7ccb715fdce4d6376774)
(cherry picked from commit 4a8a24ae8b77e394911fd83374ef9c0a89cb9688)

5 years agoMLK-19433-2 imx8mq: Get chip rev for B1 revision
Ye Li [Mon, 3 Sep 2018 07:46:09 +0000 (00:46 -0700)]
MLK-19433-2 imx8mq: Get chip rev for B1 revision

The mscale B1 uses OCOTP_HW_OCOTP_READ_FUSE_DATA register for chip id.
It returns a magic number 0xff0055aa.
Update get_cpu_rev to support this way, also enable OCOTP clock to allow
access OCOTP register.

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

5 years agoMLK-19263-1 imx8m: Configure trustzone region 0 for non-secure access
Ye Li [Tue, 21 Aug 2018 06:32:34 +0000 (23:32 -0700)]
MLK-19263-1 imx8m: Configure trustzone region 0 for non-secure access

Set trustzone region 0 to allow both non-secure and secure access when trust zone is enabled.
We found USB controller fails to access DDR if the default region 0 is secure access
only.

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

5 years agoMLK-18502: imx8mm: Bypass ID SWAP when trustzone is enabled
Silvano di Ninno [Mon, 13 Aug 2018 12:04:46 +0000 (14:04 +0200)]
MLK-18502: imx8mm: Bypass ID SWAP when trustzone is enabled

Enable TZASC on i.MX 8mm.
There is a need on 8MM to enable
the BYPASS ID SWAP bit (GPR10 bit 1) in order
for GPU not to generated AXI bus errors.

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 76c9db3ccc8c6e8f719172254c4f9bbdbd12db23)

5 years agoMLK-19203 configs: imx8qm_arm2: update xen boot args
Peng Fan [Mon, 13 Aug 2018 06:06:36 +0000 (14:06 +0800)]
MLK-19203 configs: imx8qm_arm2: update xen boot args

Remove clk_ignore_unused
Enlarge dom0 memory to 2048M
Support booting 6 cores
support creating partition from parsing device tree

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit dff1ad048f0767a91c6e62904612b0f5ac9c52d7)
(cherry picked from commit 53d8f8832a38e64da7e6f07d04d37b9f3ce70536)

5 years agoMLK-19219-2 imx8qm/qxp: Add support to get container image set size
Ye Li [Tue, 14 Aug 2018 10:45:30 +0000 (03:45 -0700)]
MLK-19219-2 imx8qm/qxp: Add support to get container image set size

Add relevant functions and files to parse the container image set from mmc/sd
and get the total size of it. So we can get the offset of u-boot-atf.bin image
when it is padded to container image set at 1KB alignment position.

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

5 years agoMLK-19219-1 spl: Add function to get u-boot raw sector
Ye Li [Tue, 14 Aug 2018 10:52:16 +0000 (03:52 -0700)]
MLK-19219-1 spl: Add function to get u-boot raw sector

Add a weak function spl_mmc_get_uboot_raw_sector to get u-boot raw sector.
At default it returns CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR. Users
can overwrite it to return customized offset.

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

5 years agoMLK-19131 configs: imx8mm_evk: add jailhouse boot command
Peng Fan [Mon, 6 Aug 2018 09:47:22 +0000 (17:47 +0800)]
MLK-19131 configs: imx8mm_evk: add jailhouse boot command

Add jailhouse env. Currently need to pass clk_ignore_unused to bootargs
to avoid linux root cell shutdown clocks used by inmates.

If only want a minimal clk being on in inmates, the clks could
be added in clk_inits_on in linux kernel drivers/clk/imx/clk-imx8mm.c
or use init-on-array under clk node.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 7732b3b87423069c1c31d25ec07201098062b717)
(cherry picked from commit 718b0792dfedcf68b6c2e93d3eefe499ec463433)

5 years agoMLK-19064 imx8qm: Add secure boot environment
Ye Li [Thu, 26 Jul 2018 14:54:34 +0000 (07:54 -0700)]
MLK-19064 imx8qm: Add secure boot environment

Add the secure boot relevant environment variables to ARM2 and MEK.
When CONFIG_AHAB_BOOT is enabled, we will switch to boot flow:
1. Load the signed OS container to address 0x88000000
2. Using auth_cntr to authenticate the OS container. It will load the
   kernel and FDT to destination addresses.
3. Using booti to boot kernel.

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

5 years agoMLK-18793 imx8mq: config: add jailhouse env
Peng Fan [Fri, 6 Jul 2018 06:07:02 +0000 (14:07 +0800)]
MLK-18793 imx8mq: config: add jailhouse env

Add jailhouse env. Currently need to pass clk_ignore_unused to bootargs
to avoid linux root cell shutdown clocks used by inmates.

If only want a minimal clk being on in inmates, the clks could
be added in clk_inits_on in linux kernel drivers/clk/imx/clk-imx8mq.c

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 0d33db00e96e7addb6910a7097a62222ff75480f)
(cherry picked from commit 56ea0d9280b22ce3e260851e88782cb877fad6ec)

5 years agoMLK-19011-2 configs: imx8qm_mek: add jailhouse boot env
Peng Fan [Mon, 23 Jul 2018 07:36:51 +0000 (15:36 +0800)]
MLK-19011-2 configs: imx8qm_mek: add jailhouse boot env

Add jailhouse boot env. run `jh_netboot` or `jh_mmcboot` to
boot Linux.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 2248152c7217ac78f4d399612679a45c54405502)
(cherry picked from commit 4b6b331c424c4d62844641c32c90915ebf5bf223)

5 years agoMLK-19011-1 configs: imx8qxp_mek: add jailhouse boot env
Peng Fan [Mon, 23 Jul 2018 07:29:07 +0000 (15:29 +0800)]
MLK-19011-1 configs: imx8qxp_mek: add jailhouse boot env

Add jailhouse boot env. Use `run jh_netboot` or `jh_mmcboot`
to boot Linux.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 8a575a160b8e4f8cfdd79177a8f9551106395cf9)
(cherry picked from commit 864c2f9cb3463bfa715cbfd1d7ca16d8bd323003)

5 years agoMLK-18703: crypto: caam: Fix typo for caam blob commands
Aymen Sghaier [Wed, 11 Jul 2018 16:23:18 +0000 (18:23 +0200)]
MLK-18703: crypto: caam: Fix typo for caam blob commands

 This fix a wrong trace error while executing caam genlob command.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(cherry picked from commit 7b80598100baf38562bee10bb4a19c3c834b945b)

5 years agoMLK-18703: crypto: caam: Add TRNG init function call
Aymen Sghaier [Tue, 3 Jul 2018 08:14:37 +0000 (10:14 +0200)]
MLK-18703: crypto: caam: Add TRNG init function call

 Call the TRNG init function at the end of arch_cpu_init()
 Concerned SoCs are: i.MX6, i.MX7 and i.MX8M

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(cherry picked from commit 996329904c0304a7bfbc6cda8287ab93de77870d)

5 years agoMLK-18703: crypto: caam: Add init TRNG into SPL or U-Boot
Aymen Sghaier [Tue, 24 Apr 2018 16:36:02 +0000 (18:36 +0200)]
MLK-18703: crypto: caam: Add init TRNG into SPL or U-Boot

 The following reasons lead to instantiate the TRNG into U-Boot/SPL:

 - On some i.MX platforms Linux Kernel could not instantiate RNG
 - RNG could be used/needed by M4/M0 cores before Kernel stage
 - Having the RNG instantiation implemented only once for
   almost i.MX platforms

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(cherry picked from commit 1f4134c85f6416cbdadaf5f4ff6321f6c685c74c)

5 years agoMLK-18591-2 crypto: caam: Add fsl caam driver
Ye Li [Wed, 6 Jun 2018 10:29:16 +0000 (03:29 -0700)]
MLK-18591-2 crypto: caam: Add fsl caam driver

Add the fsl CAAM driver and new commands to implement DEK blob operations,
like "caam genblob" to generate encrypted blob and "caam decap" to output
orignal plain data.

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

5 years agoMLK-21847 pinctrl: imx8m: Remove DEVRES selecting
Ye Li [Mon, 22 Apr 2019 07:31:38 +0000 (00:31 -0700)]
MLK-21847 pinctrl: imx8m: Remove DEVRES selecting

The CONFIG_DEVRES is not a necessary config for pinctrl. We decouple the
dependence from the kconfig. So the DEVRES is not default enabled.

When using DWC3 gadget driver, without enabling gadget DM driver, the calling
to devm_kzalloc will cause crash if CONFIG_DEVRES is set.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-18878 DTS: imx8mq: Change USB nodes compatible strings
Ye Li [Mon, 16 Jul 2018 06:48:54 +0000 (23:48 -0700)]
MLK-18878 DTS: imx8mq: Change USB nodes compatible strings

We enabled the DM for xhci-imx8m driver which uses compatible string
"fsl, imx8mq-dwc3". But found a issue that u-boot will get four USB bus not two.
The reason is the low level driver xhci-dwc3 also adds the DM support which uses
compatible string "snps,dwc3". Thus, one USB node and its dwc3 subnode are both
binded as independent USB bus.

Since the xhci-imx8m driver uses xhci-dwc3 as low level driver, to fix the issue
we add -u-boot.dtsi files to change the USB node compatible string to
"simple-bus" and change dwc3 node compatibe string to "fsl, imx8mq-dwc3". Then
xhci-dwc3 DM driver won't bind any node.

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

5 years agoMLK-21846-2 imx8mq_evk: Enable USB SDP in SPL
Ye Li [Mon, 22 Apr 2019 04:06:13 +0000 (21:06 -0700)]
MLK-21846-2 imx8mq_evk: Enable USB SDP in SPL

Enable the SPL SDP driver and SPL gadget drivers on iMX8MQ EVK board.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-21846-1 imx8mq_arm2: Enable USB SDP in SPL
Ye Li [Mon, 22 Apr 2019 03:46:42 +0000 (20:46 -0700)]
MLK-21846-1 imx8mq_arm2: Enable USB SDP in SPL

Enable the SPL SDP driver and SPL gadget drivers on iMX8MQ DDR4 and
DDR3L validation boards.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-17638 video: imx8m_hdmi: Checks HDMI FW before enabling video output
Ye Li [Wed, 28 Feb 2018 13:23:49 +0000 (05:23 -0800)]
MLK-17638 video: imx8m_hdmi: Checks HDMI FW before enabling video output

Checks whether the HDMI FW is running before initialize the HDMI display.
So that for cases like mfgtool and imx-boot image without HDMI FW, the
u-boot won't be blocked.

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

5 years agoMLK-18822 imx: Fix bootaux issue when running on ARM64
Ye Li [Wed, 11 Jul 2018 08:41:24 +0000 (01:41 -0700)]
MLK-18822 imx: Fix bootaux issue when running on ARM64

The bootaux from community uses ulong to read private data and write to M4 TCM,
this cause problem on ARM64 platform where the ulong is 8bytes.
Fix it by using u32 to replace ulong.

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

5 years agoMLK-13486: imx: logos: use NXP logo
Peng Fan [Tue, 22 Nov 2016 02:57:13 +0000 (10:57 +0800)]
MLK-13486: imx: logos: use NXP logo

Use NXP logo.
The vendor and board dir not changed, only replace the contents
of freescale.bmp.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 0b381fdf1a45cb06a057724e708ce0bbeee67f4d)
(cherry picked from commit 836461a95ca8df0f41dacf1d390a966624190524)
(cherry picked from commit ffbeb365642907957a385fe970fc69adcf87d600)

5 years agoMLK-18686-2 sc_thermal: Fix interpreting tenths as millicelsius
Ye Li [Tue, 26 Jun 2018 02:43:14 +0000 (19:43 -0700)]
MLK-18686-2 sc_thermal: Fix interpreting tenths as millicelsius

When calculate the temperature in millicelsius, the tenths are
handled incorrectly.

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

5 years agoMLK-18686-1 sc_thermal: Update thermal resources for iMX8QXP
Ye Li [Tue, 26 Jun 2018 02:40:08 +0000 (19:40 -0700)]
MLK-18686-1 sc_thermal: Update thermal resources for iMX8QXP

Since the DRC_0 thermal is disabled by SCFW, we should use SC_R_SYSTEM for
CPU thermal. Update the resources table to align with kernel.

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

5 years agoMLK-20049-2 imx8mm_val: Add DDR3L validation board support
Ye Li [Wed, 26 Sep 2018 03:27:48 +0000 (20:27 -0700)]
MLK-20049-2 imx8mm_val: Add DDR3L validation board support

Add DDR3 init codes, board codes, defconfig and DTS into u-boot.
Basic modules are ready: SD, UART, I2C, USB host and NAND.

There is a FPGA on this board. It controls WDOG_B, and ENET PHY RESET.
So reset and ethernet won't work at default.

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

5 years agoMLK-20154-1 mtd: spi: Add flash id for GD25LQ16
Ye Li [Thu, 1 Nov 2018 03:13:13 +0000 (20:13 -0700)]
MLK-20154-1 mtd: spi: Add flash id for GD25LQ16

iMX8MM DDR3L validation board uses GD25LQ16, but its id is not in
u-boot flash ids table. Add the new id and parameters into the table.

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

5 years agoMLK-18639-3 imx8mm_val: Add board codes for iMX8MM DDR4 validation board
Ye Li [Wed, 20 Jun 2018 03:06:35 +0000 (20:06 -0700)]
MLK-18639-3 imx8mm_val: Add board codes for iMX8MM DDR4 validation board

Add SPL/u-boot board codes and DDR4 settings for iMX8MM DDR4 validation board.
DDR overnight stress test is passed.

Supported modules:
    SD/eMMC, I2C, ENET, Flexspi, UART and USB.

Build config:
    imx8mm_ddr4_val_defconfig

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

5 years agoMLK-18639-2 DTS: imx8mm_val: Add DTS for iMX8MM DDR4 validation board
Ye Li [Wed, 20 Jun 2018 03:01:49 +0000 (20:01 -0700)]
MLK-18639-2 DTS: imx8mm_val: Add DTS for iMX8MM DDR4 validation board

Add a DTS file for iMX8MM DDR4 validation board whose design is similar
as iMX8MM EVK.

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

5 years agoMLK-18654-4 imx8mm_evk: Enable SPL SDP for iMX8MM EVK board
Ye Li [Fri, 19 Apr 2019 06:34:13 +0000 (23:34 -0700)]
MLK-18654-4 imx8mm_evk: Enable SPL SDP for iMX8MM EVK board

Enable the SPL SDP for iMX8MM EVK. So that when booting from USB serial
download mode, the SPL will enter SDP to download FIT image from USB host
(uuu tool) and boot into FIT image.

The SDP driver needs larger malloc pool size, so extend the SPL malloc pool
to 12KB and reduce the SPL BSS MAX to 4KB because BSS actual size is about 1KB.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-18654-3 spl: Un-define the DM USB for SPL
Ye Li [Fri, 22 Jun 2018 02:32:33 +0000 (19:32 -0700)]
MLK-18654-3 spl: Un-define the DM USB for SPL

Since we don't support DM in SPL, undefine the DM USB in SPL build,
so it can use non-DM USB driver.

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

5 years agoMLK-18654-2 imx: Change USB boot device type
Ye Li [Fri, 22 Jun 2018 02:26:47 +0000 (19:26 -0700)]
MLK-18654-2 imx: Change USB boot device type

The SPL SDP is configured as BOOT_DEVICE_BOARD, so when booting from
USB, change its type to BOOT_DEVICE_BOARD, so we can use SDP.

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

5 years agoMLK-18654-1 usb: gadget: Update SDP to support FIT
Ye Li [Thu, 21 Jun 2018 06:01:52 +0000 (23:01 -0700)]
MLK-18654-1 usb: gadget: Update SDP to support FIT

Current SDP only supports to boot legacy image(raw). Add support to
boot FIT image.

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

5 years agoMLK-18641 arm: Remove the check for gcc6 requirement
Ye Li [Wed, 20 Jun 2018 06:40:35 +0000 (23:40 -0700)]
MLK-18641 arm: Remove the check for gcc6 requirement

The u-boot 2018 forces to use gcc 6.0 or later to save binary size for some platforms.
This check causes problem for android building because android tool chain remains
using gcc 4.9.
Since iMX6/7/8 platforms don't meet binary size issue, we can remove the checkgcc6
and use old gcc.

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

5 years agoMLK-18437-1 usb: ehci-mx6: fix board_usb_clean issue
Ye Li [Wed, 30 May 2018 03:30:46 +0000 (20:30 -0700)]
MLK-18437-1 usb: ehci-mx6: fix board_usb_clean issue

The board_usb_clean in ehci-mx6 always set to HOST. This is wrong
when we running gadget. Change to use type in private data.

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

5 years agoMLK-18243-18 imx8mm_evk: add i.MX8MM LPDDR4/DDR4 EVK board support
Ye Li [Fri, 19 Apr 2019 03:30:37 +0000 (20:30 -0700)]
MLK-18243-18 imx8mm_evk: add i.MX8MM LPDDR4/DDR4 EVK board support

Add board support for both iMX8MM LPDDR4 EVK and DDR4 EVK.
Supported peripherals: UART, I2C, NAND (DDR4 EVK), SD, USB, TCPC, ENET
FlexSPI and eMMC (LPDDR4 EVK)

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-18243 DTS: imx8mm_evk: Add DTS files for iMX8MM LPDDR4 and DDR4 EVK boards
Ye Li [Fri, 19 Apr 2019 03:26:12 +0000 (20:26 -0700)]
MLK-18243 DTS: imx8mm_evk: Add DTS files for iMX8MM LPDDR4 and DDR4 EVK boards

Add two DTS files, one for iMX8MM LPDDR4 EVK (fsl-imx8mm-evk.dts)
and another for iMX8MM DDR4 EVK.
Two boards share same base board, the major difference is the DDR4 board
installs NAND chip and removes flexspi and eMMC.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-21845-4 imx8m: Add imximage for flexspi boot image
Ye Li [Fri, 19 Apr 2019 03:24:42 +0000 (20:24 -0700)]
MLK-21845-4 imx8m: Add imximage for flexspi boot image

Since flexspi has different IVT offset with SD/MMC, add a new imximage
for it.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-21836-4 spi: fspi: Add compatible string for iMX8MM
Ye Li [Fri, 19 Apr 2019 02:52:23 +0000 (19:52 -0700)]
MLK-21836-4 spi: fspi: Add compatible string for iMX8MM

iMX8MM DTS uses new compatible string "fsl,imx8mm-flexspi" in flexspi
node. Add it into the flexspi driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-18590 pmic: bd71837: Change to use new fdt API
Ye Li [Wed, 13 Jun 2018 02:14:29 +0000 (19:14 -0700)]
MLK-18590 pmic: bd71837: Change to use new fdt API

Changed to use dev_read_subnode to get the ofnode type of the bd71837 device node.
Because the pmic_bind_children is changed to use ofnode.

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

5 years agoMLK-14422 imx7d: wdog: Overwrite the reset_cpu to turn off internal reset signal
Ye Li [Tue, 7 Feb 2017 14:48:01 +0000 (22:48 +0800)]
MLK-14422 imx7d: wdog: Overwrite the reset_cpu to turn off internal reset signal

Set wdog WCR register SRS bit to turn off internal reset signal WDOG_RESET_B_DEB
for mx7d. So that the warm reset is disabled.
The WDA is cleared to output WDOG_B immediately to reset the board.

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

5 years agoMLK-19726-2 arm: Don't remove all devices when power domain driver is enabled
Ye Li [Wed, 26 Sep 2018 09:15:00 +0000 (02:15 -0700)]
MLK-19726-2 arm: Don't remove all devices when power domain driver is enabled

Because we power off all devices in board_quiesce_devices which is prior then
executing dm_remove_devices_flags. So any access to HW in dm_remove_devices_flags
will cause problem.
However, some drivers like ethernet which implements the pre_remove callback is always
called without any flags check, and this finally accesses FEC controller.

Since we don't need to remove all devices in u-boot before starting kernel, disable
this feature when power domain is enabled.

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

5 years agoMLK-21019 TMU: Check the TEMP range for iMX8MM
Ye Li [Thu, 28 Feb 2019 07:50:39 +0000 (23:50 -0800)]
MLK-21019 TMU: Check the TEMP range for iMX8MM

On iMX8MM, the V flag in TRISTR register only reflect the state of SNSR
value, not the calibrated TEMP value. So checking this flag is not
reliable. Per IC suggestion, change to read the TEMP/AVG_TEMP directly
and check whether it in valid range 10-125C.

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

5 years agoMLK-20966 TMU: Fix for temperature out of range
Ye Li [Fri, 22 Feb 2019 05:12:57 +0000 (21:12 -0800)]
MLK-20966 TMU: Fix for temperature out of range

When the temperature is out of sensor's range, the Valid bit won't be
set in TRITSR register. So the polling loop won't go out.

Change the codes to retry 10 times with 100ms interval for the Valid bit.
If the timeout, we give a warning for the invalid data.

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

5 years agoMLK-20784-2 imx8mm: Load fuse for TMU TCALIV and TASR
Ye Li [Mon, 21 Jan 2019 08:33:38 +0000 (00:33 -0800)]
MLK-20784-2 imx8mm: Load fuse for TMU TCALIV and TASR

On iMX8MM, the default value of TMU registers TCALIV and TASR need
be loaded from fuse. HW won't do this, it expect SW loads them before
using TMU.

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

5 years agoMLK-20784-1 TMU: Add a interface for TMU arch level initialization
Ye Li [Mon, 21 Jan 2019 08:47:04 +0000 (00:47 -0800)]
MLK-20784-1 TMU: Add a interface for TMU arch level initialization

Since imx8mm TMU needs to load some registers from fuse, this is arch
dependent operation and may vary on different platforms. So add
a interface for arch level initialization.

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

5 years agoMLK-18341-1 thermal: nxp_tmu: Add support for thermal sensor on iMX8MM
Ye Li [Fri, 18 May 2018 02:21:46 +0000 (19:21 -0700)]
MLK-18341-1 thermal: nxp_tmu: Add support for thermal sensor on iMX8MM

The analog sensors on iMX8MM are new, used for 14LPP process. So the
Temperature Sensor Monitoring Unit (TMU) has some change accordingly.
We use version 2 in TMU driver to represent the new TMU, so the one driver
can service for both MQ and MM.

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

5 years agoMLK-18322 HAB: Add suport for iMX8MM
Ye Li [Thu, 18 Apr 2019 07:20:40 +0000 (00:20 -0700)]
MLK-18322 HAB: Add suport for iMX8MM

The imx8mm has changed the address of rvt_hab, use new address for imx8mm.

The authentication procedure is same as imx8mq. In u-boot, the authentication
uses SIP call to trap ATF to run HAB authenticate.
Need to work with ATF commit:
(commit 7a4d6f90e999ed413d520310cc199901b52b7a04)

Users need to add CONFIG_SECURE_BOOT=y to defconfig to enable the feature.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
5 years agoMLK-17997: video: imx: hdp: Add HDMI RX firmware loading
Sandor Yu [Mon, 9 Apr 2018 03:29:47 +0000 (11:29 +0800)]
MLK-17997: video: imx: hdp: Add HDMI RX firmware loading

Add iMX8QM HDMI RX firmware loading.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit 969d93660e1b34765627ff9f6f8dcab08dcd1250)
(cherry picked from commit 43bc31a2700f4078ffc5f55ff3fea0ed554f4506)

5 years agoMLK-18316 imx8: Fix USBOTG disconnect when XRDC blocking is enabled
Ye Li [Tue, 15 May 2018 09:03:19 +0000 (02:03 -0700)]
MLK-18316 imx8: Fix USBOTG disconnect when XRDC blocking is enabled

We clean USBOTG register USBCMD if it is used in serial download mode.
When XRDC blocking is enabled, we can't write this register directly,
must enable the OTG power, otherwise the kernel will get SError
exception in mfgtool.

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

5 years agoMLK-18290-4 usb: ci_udc: Add function to remove usb device
Ye Li [Fri, 11 May 2018 08:32:39 +0000 (01:32 -0700)]
MLK-18290-4 usb: ci_udc: Add function to remove usb device

When unregister gadget driver in ci_udc, the usb device is not
removed or stop. This causes next "usb start" fails to work.

Add a new interface "usb_remove_ehci_gadget" in usb-uclass to
remove the usb device for DM driver. Using "usb_lowlevel_stop" for
non-DM driver.

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

5 years agoMLK-18290-3 imx8mm: Add SOC level support for OTG USB
Ye Li [Thu, 18 Apr 2019 07:09:24 +0000 (00:09 -0700)]
MLK-18290-3 imx8mm: Add SOC level support for OTG USB

Enable the OTG power on for EHCI OTG controller on iMX8MM

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-18290-2 ehci-mx6: Update driver to support i.MX8MM
Ye Li [Fri, 11 May 2018 08:26:30 +0000 (01:26 -0700)]
MLK-18290-2 ehci-mx6: Update driver to support i.MX8MM

Since the i.MX8MM reuses the otg controllers on i.MX7D. We can use
CONFIG_USB_EHCI_MX7 for them.

Due the TCPC and load switch are used on Typec circuit. Add the
board_usb_init and board_usb_cleanup to ehci-mx6 DM driver. So
we can implement the TCPC settings in these board functions.

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

5 years agoMLK-18243-17: arm: mach-imx: fix sd to mmc1 and emmc to mmc2 for i.MX8MM
Ye Li [Wed, 9 May 2018 06:07:27 +0000 (14:07 +0800)]
MLK-18243-17: arm: mach-imx: fix sd to mmc1 and emmc to mmc2 for i.MX8MM

Since the SD is usdhc2 and eMMC is usdhc3, this cause mapping problem
for spl_boot_device. So far hard coded them to correct MMC index, so
that SD and eMMC boot can work.

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

5 years agoMLK-18243-16 arm: dts: add imx8mm dtsi and binding files
Peng Fan [Wed, 9 May 2018 05:59:54 +0000 (13:59 +0800)]
MLK-18243-16 arm: dts: add imx8mm dtsi and binding files

Sync dts from 4.14.98 Linux kernel commit
e88899128d81ea8b82dfd7d294572f21c388e568
("MLK-21424 can: flexcan: fix normal CAN can't receive
 remote frame after setting fd mode").

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 0e7a5484878338d0dff871b6d21092a0479f07b4)
(cherry picked from commit 54a97f31802ea568e04285e0f18689811eecedcb)
Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-18243-15 spi: fspi: Fix 3bytes access
Ye Li [Thu, 18 Apr 2019 06:33:38 +0000 (23:33 -0700)]
MLK-18243-15 spi: fspi: Fix 3bytes access

The address size is 3 bytes when using BAR mode, but the driver
supposes the 4bytes mode is enabled and uses 4 bytes address. This
cause address issue.

Signed-off-by: Ye Li <ye.li@nxp.com>
5 years agoMLK-18243-14 spi: fspi: init unused LUT to 0
Peng Fan [Wed, 9 May 2018 05:52:20 +0000 (13:52 +0800)]
MLK-18243-14 spi: fspi: init unused LUT to 0

If not initialize unused LUT to 0, the value is random which might
cause qspi command failure.

On i.MX8QM/QXP, it works ok because ROM inittialize them to 0, but on
i.MX8MM, ROM not initialize them, so let's do it here.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit c4bd49c7b249073415f052fb28cd5a4ad374a318)
(cherry picked from commit bce752cfe43b3378dbd84b64d46f1d1818e0300f)

5 years agoMLK-18243-12 arm: imx8m: add cpu revision for i.MX8MM
Peng Fan [Wed, 9 May 2018 05:48:59 +0000 (13:48 +0800)]
MLK-18243-12 arm: imx8m: add cpu revision for i.MX8MM

Add cpu revision for i.MX8MM
Add helper function

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 5fdfc7d73157a5eb9254b43f65edd1bb5f13fd16)
(cherry picked from commit e33f0d97423c29e130ddecbd8d7567ca8bf1826d)