u-boot.git
4 years agoMLK-20886-5 imx8qm/qxp: Implement VService function and buffer pagetable
Ye Li [Thu, 31 Jan 2019 06:09:23 +0000 (22:09 -0800)]
MLK-20886-5 imx8qm/qxp: Implement VService function and buffer pagetable

Override the board_imx_vservice_find_mu for finding MU device for
virtual devices. The matching logic is if the M4_0 partition ownes
the resource of the device, we select MU8 for this Vservice channel.
Otherwise, if the M4_1 partition ownes the resource, we select MU9.

We reuse the kernel RPMSG Vring buffer for VService buffer, because it is
shared between OS partition and M4 partition. The pagetable is needed for
this region, since it is not in memregs of OS partition.

board_imx_vservice_get_buffer is also overriden is this patch to divide
VService buffer for MU8 and MU9.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 4358b4cdfc4752822066d480dd1c10086c211be7)
(cherry picked from commit 8c407ea63ad7c7cf59eb6d8b96766cd163026d82)
(cherry picked from commit 10decd628e25e4ac07651b35f7e11b2efc331edd)

4 years agoMLK-20886-4 lpi2c: Provide override binding function
Ye Li [Thu, 31 Jan 2019 06:05:43 +0000 (22:05 -0800)]
MLK-20886-4 lpi2c: Provide override binding function

We provide override binding function, so the ARCH level can use it
to determine if it is ok to bind with lpi2c driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit b19418270a3d532eacb1069606fa2ab100e04601)
(cherry picked from commit 3624faca59ed1dda7cd5f9c688598ea4941cac61)
(cherry picked from commit 7cdd8d0ff362c26fd1c5b7682a6b69393ccda59c)

4 years agoMLK-20886-3 i2c: Add virtual i2c and virtual i2c mux drivers
Ye Li [Thu, 31 Jan 2019 05:50:31 +0000 (21:50 -0800)]
MLK-20886-3 i2c: Add virtual i2c and virtual i2c mux drivers

Add virtual i2c driver which replies on the VService to send SRTM i2c
messages with M4.
For each output on i2c mux, M4 side abstracts a i2c bus with special bus
id. The virtual i2c mux follows basic mux design, but uses dedicated flag
to pass the abstract bus id for the mux output to virtual i2c driver.

Virtual i2c and virtual i2c mux will bind nodes with compatible string
"fsl,imx-virt-i2c" and "fsl,imx-virt-i2c-mux".

To support binding local i2c driver or virtual i2c driver at runtime. We
provides a override function for the driver bind. ARCH level is responsible
to implement it.

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

4 years agoMLK-20886-2 imx: Add Virtual service glue layer
Ye Li [Thu, 31 Jan 2019 05:31:27 +0000 (21:31 -0800)]
MLK-20886-2 imx: Add Virtual service glue layer

We use a glue layer to link the low level MU driver and virtual drivers.
This glue layer is named to virtual service (iMX VService). Virtual service
provides unified interfaces for setup connection with M4, get message buffer
and send/receive message, etc.

Multiple virtual drivers (i2c, gpio, etc)
             |
         iMX Vservice
             |
       imx_mu_m4 driver

For each virtual device, by default, the Vservice uses the device node property
"fsl,vservice-mu" to specify the MU node handler. A override function is also provided,
so te ARCH level can define its rule. We will use the override function for dynamically
select MU on 8QM/QXP.

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

4 years agoMLK-20886-1 misc: MU: Add MU driver to communicate with M4
Ye Li [Thu, 31 Jan 2019 05:21:35 +0000 (21:21 -0800)]
MLK-20886-1 misc: MU: Add MU driver to communicate with M4

Add a common iMX MU driver in misc uclass to communicate with M4.
The MU message format is defined to use 4 words as below, the driver
will use all 4 TR/RR in MU to pass one message

|WORD 0     | WORD 1      | WORD 2          | WORD 3         |
|SEQ        | TYPE        | PAYLOAD ADDRESS | PAYLOAD LENGTH |

 - SEQ:
   A sequence id starts from 0 and increases for each request message

 - TYPE:
   0x1:  Request.  Message sent from AP will set to this value.
   0x2:  Response. Message responded from M4 set to this value.
   0x3:  MU A side is ready.
   0x4:  MU B side is ready.

 - PAYLOAD ADDRESS:
   A pointer to the memory address where the uplayer message is stored

 - PAYLOAD LENGTH:
   The uplayer message length

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit aba0e51cc397e1d98be950f9c15619de06ebf782)
(cherry picked from commit 57c95d6476052a052f026f8e4d7c98bd05792a1f)
(cherry picked from commit 7cf313495381878b46173bb567ebf5814d403d58)

4 years agoMLK-20794-1 imx8: Add legacy kernel FDT updating for fused parts
Ye Li [Thu, 24 Jan 2019 07:42:57 +0000 (23:42 -0800)]
MLK-20794-1 imx8: Add legacy kernel FDT updating for fused parts

Before booting kernel, we check all nodes in kernel FDT whether they
are owned in our partition. If it is not owned, we will disable it in FDT.

For fused iMX8X 17x17 parts, like DC0 is disabled, SCFW only disable SC_R_DC_0,
other sub-modules in DC0 SS are still assign to our partition. Since DC0 is fused,
we actually can't access these sub-modules.

This patch changes the algorithm to check resources along the power domain tree to the
top node of that SS power domain. If any resource in the PD tree is not owned, we will
disable the peripheral node.
For example, the i2c0_mipi_lvds1 peripheral node, according to power domain tree,
we checks resources: SC_R_MIPI_1_I2C_0  -->  SC_R_MIPI_1  --> SC_R_DC_0. When SC_R_DC_0
is not owned, we will disable the i2c0_mipi_lvds1 peripheral node from FDT.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit da636e4b8eda4698be6e2e53767cc1a598aadb0b)
(cherry picked from commit 8b83db421811d9d761c004d000eb0259902ad150)
(cherry picked from commit 0819497d68537c20d1d8d05e0e6e5a49710b4c35)

4 years agoMLK-18393 imx8: Check the eDMA channels and update DTB
Ye Li [Fri, 18 May 2018 02:49:03 +0000 (19:49 -0700)]
MLK-18393 imx8: Check the eDMA channels and update DTB

Since M4 will arrange some eDMA channels to its partition, the A core
can't use them. We have to remove these eDMA channels from DTB dynamically.

Different like other resources, disabling the eDMA channels require to modify
the edma nodes by removing relevant registers, interrupts configurations, and
adjust dma channels number.

This patch searches the edma nodes from kernel DTB, checks the channels by
binding their registers base address with their resource IDs. Then update
the reg, interrupts, interrupt-names and dma-channels properties.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by : Robin Gong <yibin.gong@nxp.com>

(cherry picked from commit 37efd38e5306680047ab9545f271716fea15fa95)
(cherry picked from commit ec6a694c1430f023401286862902bd14ca9acf87)
(cherry picked from commit 1aa411d4a3f401ab85b62eadc7c426a797d59b74)

4 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>
(cherry picked from commit b4ebefe7b0d6252f1c210d7f5f84b3c63d383530)
(cherry picked from commit 8f82f30e93bc8876d62af7a0f4d677a88d1b4cc8)

4 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>
(cherry picked from commit 736ea652c6dbc7bb9f52bceff35a5f4bb98ca4dc)
(cherry picked from commit 724a10ad40720fd13bdd3c43cfc7f9e317aeb0a5)

4 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)
(cherry picked from commit 9e0ec51fc5a95cb197c9579414343ab3e1d0419a)
(cherry picked from commit 7435792b692f56009eb55d794e5056e917963af2)

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

Apply the same power off interface to SPL as well.

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

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

4 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)
(cherry picked from commit e3ba5c0719e4b6b7867451b815f11a3683dd393d)
(cherry picked from commit 931d1bd7a4fd6675d0f0b891afc6203bdfd185f6)

4 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)
(cherry picked from commit 4cadac201b480ac28dcbb27903489a98c0303a3d)
(cherry picked from commit 60d41ce815e5bd63952794d2868ee7dd3be54157)

4 years agoMLK-18172-2: imx8: Introduce xenlinux_addr for dom0 kernel
Leonard Crestez [Fri, 27 Apr 2018 11:49:01 +0000 (14:49 +0300)]
MLK-18172-2: imx8: Introduce xenlinux_addr for dom0 kernel

Avoid overloading variable meaning and overlap with hdp_addr.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
(cherry picked from commit 9e4b3e80b4b2f40bb35a2c8f1b5ede9868788a34)
(cherry picked from commit 7dea0df52f0100f2b363b79d793f271fac5b6fab)
(cherry picked from commit dfb3c57f9313ed0bee355dd7217135d05c824be6)
(cherry picked from commit e5f701e32d3f516f15c0c7c53a85d94381838a17)

4 years agoMLK-18172-1: imx8qm_mek: Load hdmi fw before dom0 kernel for xenboot
Leonard Crestez [Thu, 26 Apr 2018 19:17:45 +0000 (22:17 +0300)]
MLK-18172-1: imx8qm_mek: Load hdmi fw before dom0 kernel for xenboot

Xen boot writes ${filesize} to /chosen/module but if HDMI fw is present
then the size of hdmitxfw.bin is written instead of the size of dom0
kernel.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
(cherry picked from commit 8823d52896aedf740899c59db3da73f8478c40ed)
(cherry picked from commit 0efebadd915a999030c2462be9c714db3ae51895)
(cherry picked from commit 02e8bbe4e659a7ffb360c392ea79ce073b90f276)
(cherry picked from commit a12d5e0559843c6870aa0fb2091ebe9f23bdbc56)

4 years agoMLK-18129-2 imx8qm/qxp: Add secure boot environment
Ye Li [Wed, 25 Apr 2018 09:45:32 +0000 (02:45 -0700)]
MLK-18129-2 imx8qm/qxp: Add secure boot environment

Add the secure boot relevant environment variables to MEK.
When CONFIG_AHAB_BOOT is enabled, we will switch to boot in this
new way:
1. Load the OS container to address 0x98000000
2. Using auth_cntr to authenticate the OS container. It will load the
   kernel and FDT to destination address.
3. Using booti to boot kernel.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 545c8fe112244f20377e97921389c86eacc8551f)
(cherry picked from commit cba5acebbe6be0736f229ef719b1a1e5835e1a5f)
(cherry picked from commit 07b9850354b27dafa4cc774c59770931af2ac898)
(cherry picked from commit 149006de99c9c214232d30cc2e9795401766fe4b)

4 years agoMLK-17998 configs: imx8qxp_mek: add xenmmcboot and xennetboot
Peng Fan [Wed, 11 Apr 2018 07:53:18 +0000 (15:53 +0800)]
MLK-17998 configs: imx8qxp_mek: add xenmmcboot and xennetboot

Add xenmmcboot and xennetboot command.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 13f791db9a2bd0fe442115e77c91e8a56a4cf217)
(cherry picked from commit f71b5a989d0292e17f8a5ad526ea8faa3d28ea60)
(cherry picked from commit e7d4d1ff4a6a1055d1339623edd81d52fa81a6d9)
(cherry picked from commit 1410ee49abf27cbd98245fbd4d2f2103b69c006f)

4 years agoMLK-17842 imx8: introduce partition cmd
Peng Fan [Tue, 20 Mar 2018 03:17:53 +0000 (11:17 +0800)]
MLK-17842 imx8: introduce partition cmd

Add partition API cmd support.
And parse dtb support, see
arch/arm64/boot/dts/freescale/fsl-imx8qm-mek-dom0.dts for example.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit f61119240922ad13fd573f16c02361d7228fbd67)
(cherry picked from commit ef488a85953398838c5242aed66c917547f7f918)
(cherry picked from commit 9689d96fd7406c56bcc7fb9cc551f4c6cb6e4933)
(cherry picked from commit 6c4b850c164899bbe2e57e8d537e5f9108b08295)

4 years agoMLK-17786: imx8qm: add xen boot script
Peng Fan [Tue, 13 Mar 2018 01:46:39 +0000 (09:46 +0800)]
MLK-17786: imx8qm: add xen boot script

Add XEN boot script to ease booting.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 2fd813fcfcb82f28f353fbdc727765d6e848bfd7)
(cherry picked from commit 28caf1e050765a040b1290c210b40563b30cca3c)
(cherry picked from commit 9a50c211a07975cc36646a4188d1774260274429)
(cherry picked from commit 5637d852810c6de23f6acab2d3b4d1857c1ac1a5)

4 years agoMLK-17143 imx8qxp: mek: add xen env
Peng Fan [Sun, 10 Dec 2017 02:01:30 +0000 (10:01 +0800)]
MLK-17143 imx8qxp: mek: add xen env

Add xen env, "run xenboot" to boot xen.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit d5f756f0de780d6e8db2f43f8388083f9454dcac)
(cherry picked from commit 9c9f854b7a5952f66423145ea18c77a9dfb0a99c)
(cherry picked from commit 2b4556ce58f3d6b1ff69ad16f7b22e808173373b)
(cherry picked from commit f9dd1a9154c6e67003b477b5d126cf730809b27f)

4 years agoMLK-21842-1 DTS: imx8mq: Update DTS files for imx8mq and imx8mq EVK
Ye Li [Wed, 25 Mar 2020 03:45:28 +0000 (20:45 -0700)]
MLK-21842-1 DTS: imx8mq: Update DTS files for imx8mq and imx8mq EVK

Update thermal node properties, i2c pinmux, gpmi/apbh-dma nodes and
alias for mmc/usb/qspi.

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

4 years agoMLK-21834-2 imx8qxp_mek: Update board codes and config
Ye Li [Tue, 24 Mar 2020 09:19:03 +0000 (02:19 -0700)]
MLK-21834-2 imx8qxp_mek: Update board codes and config

Add ENET no-DM support, CDNS USB3 host/gadget, M4 bootaux and memtest etc
Update some SPL configs:
1. Remove FIT support and enable TINY printf for saving SPL size.
2. Fix wrong SPL regulator driver enabled, show use fixed regulator not
   gpio.
3. Add flexspi defconfig which uses SPI relevant SPL configs and disable
   MMC, GPIO and regulator SPL drivers.
4. Enable the panic. Since we use PSCI to reset, but ATF is not boot when
   SPL is running.
5. Use full malloc not simple malloc which has dedicated malloc pool
   to support large pool size. The simple malloc size is also used by
   early malloc which occupies the stack space. This causes we can't
   have a large malloc pool

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

4 years agoMLK-21834-1 DTS: Update iMX8QXP MEK board DTS
Ye Li [Tue, 24 Mar 2020 08:02:46 +0000 (01:02 -0700)]
MLK-21834-1 DTS: Update iMX8QXP MEK board DTS

Add i2c alias for i2c mux bus, add mipi lvds i2c nodes, usbotg1, usbotg3,
fec, flexspi, and update iomux.

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

4 years agoMLK-21840-2 imx8qm_mek: Update iMX8QM MEK board
Ye Li [Thu, 19 Mar 2020 08:16:41 +0000 (01:16 -0700)]
MLK-21840-2 imx8qm_mek: Update iMX8QM MEK board

Add board codes and defconfig file for iMX8QM MEK board. Support
peripherals: UART, USB3 host/gadget, Flexspi, SD/eMMC, ENET, i2c.

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

4 years agoMLK-21840-1 DTS: imx8qm_mek: Update DTS files for QM MEK board
Ye Li [Tue, 17 Mar 2020 06:43:05 +0000 (23:43 -0700)]
MLK-21840-1 DTS: imx8qm_mek: Update DTS files for QM MEK board

Update DTS files for iMX8QM MEK board. Porting them from imx_v2019.04
u-boot

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

4 years agoMLK-23574-10 imx8: Enable UART0 LPCG clock for early serial
Ye Li [Wed, 3 Jul 2019 09:30:27 +0000 (02:30 -0700)]
MLK-23574-10 imx8: Enable UART0 LPCG clock for early serial

Enable the UART0 LPCG clock in sc_pm_setup_uart for early print
not depending on the reset default value.

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

4 years agoMLK-21837-2 imx8: clock: Update non-DM clock functions
Ye Li [Wed, 10 Apr 2019 04:06:02 +0000 (21:06 -0700)]
MLK-21837-2 imx8: clock: Update non-DM clock functions

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

4 years agoMLK-17821-2 imx8: clock: Add cdns3 and usbotg clock enable and disable
Ye Li [Thu, 21 Mar 2019 08:21:29 +0000 (01:21 -0700)]
MLK-17821-2 imx8: clock: Add cdns3 and usbotg clock enable and disable

Implemented the clock enable and disable interfaces for CDNS3 USB
driver and EHCI-MX6 USB otg driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
(cherry picked from commit 2f0dc4c503d8ac831fb809ec124e79712defae77)
(cherry picked from commit c7a808574b37557199bd2b17c963ec207854b801)
(cherry picked from commit a369a235e5595b2a59754bd13f47cd699017fec3)

4 years agoMLK-21830-2 DTS: imx8qm: Add DTS and binding header files
Ye Li [Tue, 19 Mar 2019 07:40:31 +0000 (00:40 -0700)]
MLK-21830-2 DTS: imx8qm: Add DTS and binding header files

Copy the imx8qm DTS files from imx_4.14.y kernel (rel_imx_4.14.98_2.0.0_ga_rc1)

Add extra support used in u-boot:
1. Add mbox-cells used for mailbox
2. Add alias for FSPI nodes
3. Add the usb alias for OTG and USB3.
4. Add "u-boot,dm-pre-reloc" to thermal node to DTSi
5. Add "simple-bus" compatible strings to imx8qm-pm node.

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

4 years agoMLK-21830-1 imx8qm: Update soc codes for iMX8QM
Ye Li [Tue, 19 Mar 2019 03:54:06 +0000 (20:54 -0700)]
MLK-21830-1 imx8qm: Update soc codes for iMX8QM

Add CPU type, Kconfig for iMX8QM and update SoC codes.

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

4 years agoMLK-21829 dts: imx8qxp: Update DTSi files and binding header files
Ye Li [Tue, 19 Mar 2019 08:05:52 +0000 (01:05 -0700)]
MLK-21829 dts: imx8qxp: Update DTSi files and binding header files

Update the imx8qxp/dx/dxp DTSi files from imx_v2019.04 u-boot

Add extra support used in u-boot:
1. Add alias for FSPI nodes
2. Add GPIO alias which is used as seq number in u-boot DM GPIO driver.
3. Add i2c alias for i2c0 to i2c3.
4. Add i2c alias for mipi0/mipi1 i2c0.
5. Add "u-boot,dm-pre-reloc" to thermal node in QXP DTSi
6. Add USB alias for OTG and USB3 ports, add USB3 reg-name
7. Add APBH-DMA clock to GPMI node

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

4 years agoMLK-16441 imx8qm/qxp: print commit hash for SCFW, SECO, IMX-MKIMAGE and ATF
Ye Li [Thu, 12 Mar 2020 02:40:19 +0000 (19:40 -0700)]
MLK-16441 imx8qm/qxp: print commit hash for SCFW, SECO, IMX-MKIMAGE and ATF

Since we have many software running on QM/QXP, it is better to print their
commit ids in u-boot to know their versions.

This patch gets the commit ids for SCFW and ATF via their APIs and get the
commit for imx-mkimage at the end of u-boot.bin loading address.

Once the commit ids are acquired, show them in console like:
BuildInfo:
    - SCFW e2e62ca4, SECO-FW c121d4a4, IMX-MKIMAGE fe2ff1e9, ATF 8673a8e
    - U-Boot 2018.03-imx_v2018.03+g557a2e5

and set them to environment variables like:
    commit_atf=8673a8e
    commit_mkimage=fe2ff1e9
    commit_scfw=e2e62ca4
    commit_secofw=c121d4a4

If old software are running which does not support provide commit it, the patch
use 0 instead.

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

4 years agoMLK-14938-9 imx8: bootaux: Add i.MX8 M4 boot support
Ye Li [Mon, 16 Apr 2018 06:45:40 +0000 (23:45 -0700)]
MLK-14938-9 imx8: bootaux: Add i.MX8 M4 boot support

1. Implement bootaux for the M4 boot on i.MX8QM and QXP. Users need to download
   M4 image to any DDR address first. Then use the
   "bootaux <M4 download DDR address> [M4 core id]" to boot CM4_0
   or CM4_1, the default core id is 0 for CM4_0.

   Since current M4 only supports running in TCM. The bootaux will copy
   the M4 image from DDR to its TCML.

2. Implment bootaux for HIFI on QXP
   command: bootaux 0x81000000 1

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

4 years agoMLK-22279-4 imx8mn_evk: Enable multiple env storages
Ye Li [Tue, 16 Jul 2019 09:11:04 +0000 (02:11 -0700)]
MLK-22279-4 imx8mn_evk: Enable multiple env storages

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

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

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

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

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

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

4 years agoMLK-22339: mx6qsabreauto: configs: add default mtdids and mtdparts
Yang-yang Guo [Sat, 3 Aug 2019 09:57:12 +0000 (17:57 +0800)]
MLK-22339: mx6qsabreauto: configs: add default mtdids and mtdparts
configs

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

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

Signed-off-by: Yang-yang Guo <alice.guo@nxp.com>
(cherry picked from commit 22c74fdc455d35346756c9fb82292db57db2c96f)
(cherry picked from commit cddec24d6c9f45ccbfd5cd59cf8bd02f05f164a3)

4 years agoMLK-22259-4: mx6dlsabreauto: configs: add default mtdids and mtdparts configs
Han Xu [Fri, 12 Jul 2019 21:19:56 +0000 (16:19 -0500)]
MLK-22259-4: mx6dlsabreauto: configs: add default mtdids and mtdparts configs

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

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

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

4 years agoMLK-22259-2: cmd: mtdparts: skip invalid devices rather than quit
Han Xu [Fri, 12 Jul 2019 20:52:58 +0000 (15:52 -0500)]
MLK-22259-2: cmd: mtdparts: skip invalid devices rather than quit

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

For instance,

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

Device nor0 not found!

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

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

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

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

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

4 years agoMLK-22259-1: cmd: Kconfig: add new option CONFIG_MTDPARTS_SKIP_INVALID
Han Xu [Fri, 12 Jul 2019 20:52:46 +0000 (15:52 -0500)]
MLK-22259-1: cmd: Kconfig: add new option CONFIG_MTDPARTS_SKIP_INVALID

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

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

4 years agoFix P0/EVT boards boot without serial cable connection.
Leonid Lobachev [Mon, 16 Jul 2018 19:30:01 +0000 (12:30 -0700)]
Fix P0/EVT boards boot without serial cable connection.

Change-Id: I5969217e400ab494f9a74662d1d228fcf2e2d465
(cherry picked from commit 92c762e1b80b3b12852e3f766cdb16a6be3cbbf8)
(cherry picked from commit c5469efd6cda82cacdbb5549da3f8be1f1195032)

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

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

Signed-off-by: Clement Faure <clement.faure@nxp.com>
(cherry picked from commit b785e44ce2d042c51386dadb6ec6693344a16fc6)
(cherry picked from commit 14f7558113319025508e38fbd36ad057c56e3237)

4 years agoMLK-20373-2 dm: serial: introduce puts hook
Peng Fan [Thu, 15 Nov 2018 05:13:14 +0000 (13:13 +0800)]
MLK-20373-2 dm: serial: introduce puts hook

Introduce puts hook for dm serial driver.

Change-Id: I75423998c7d8db20949bae6ac46a094dc62c9612
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit bb986d4ff2124285ec0d99a51a2702a53f485813)
(cherry picked from commit c2cf89d2035598ca2601bb405cece474ed337817)

4 years agoTEE-346 Add DEK blob encapsulation for imx8m
Clement Faure [Thu, 23 May 2019 14:00:11 +0000 (16:00 +0200)]
TEE-346 Add DEK blob encapsulation for imx8m

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

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

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 7ffd25bddc89db30612f4e805d103c7d8dde5d95)
(cherry picked from commit e8b33b19b34e0653aff0950becb533ae845a5feb)

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

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

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

4 years agoMLK-23574-34 imx8mn_evk: Update board codes for iMX8MN DDR4 EVK
Ye Li [Fri, 9 Apr 2021 10:39:35 +0000 (03:39 -0700)]
MLK-23574-34 imx8mn_evk: Update board codes for iMX8MN DDR4 EVK

Update below codes for DDR4 EVK:
1. Add PMIC BD71837 support
2. Add DM FEC ENET support
3. Enable Flexspi NOR support
4. Add USB typec host and device mode support
5. SPL stack top moves to 0x960000 to avoid conflict with ATF address

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

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

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

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

4 years agoMLK-23574-32 DTS: imx8mn: Update DDR4 EVK DTS and binding files
Ye Li [Sat, 18 Apr 2020 14:13:41 +0000 (07:13 -0700)]
MLK-23574-32 DTS: imx8mn: Update DDR4 EVK DTS and binding files

Sync the DTS and binding files with v5.10.y kernel.
Some updates in u-boot:
1. Add alias for flexspi, usbotg1 and usbotg2.
2. Add usbotg2 nodes
3. Add i2c force idle pins
4. Update usbotg nodes to use excon
5. Add pmic and i2c to -u-boot.dtsi for SPL DM

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

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

Enable GPT command to allow create gpt partitoin in uboot

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

4 years agoMLK-22103 doc: ahab: Update imx-mkimage SPL build target
Ye Li [Tue, 25 Jun 2019 02:11:57 +0000 (19:11 -0700)]
MLK-22103 doc: ahab: Update imx-mkimage SPL build target

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

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

4 years agoMLK-21956-3 mx6qdlsabreauto: Enable i2c gpio mux to fix io expander issue
Ye Li [Thu, 6 Jun 2019 08:44:42 +0000 (01:44 -0700)]
MLK-21956-3 mx6qdlsabreauto: Enable i2c gpio mux to fix io expander issue

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

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

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

4 years agoMLK-22035-1 lmb: Add lmb_reserve_overlap for fdt reserved memory
Ye Li [Tue, 18 Jun 2019 08:24:10 +0000 (01:24 -0700)]
MLK-22035-1 lmb: Add lmb_reserve_overlap for fdt reserved memory

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

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

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

4 years agoMLK-21885 lmb: Handle the overlap case for lmb reserve
Ye Li [Wed, 5 Jun 2019 06:33:38 +0000 (23:33 -0700)]
MLK-21885 lmb: Handle the overlap case for lmb reserve

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

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

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

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

4 years agoMLK-21905 mx7ulp_evk: Change kernel DTB to EVKB board
Ye Li [Wed, 5 Jun 2019 02:14:42 +0000 (19:14 -0700)]
MLK-21905 mx7ulp_evk: Change kernel DTB to EVKB board

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

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

4 years agoMLK-20935-4 doc: imx: ahab: Fix typo in mx8_mx8x_secure_boot.txt guide
Breno Lima [Fri, 15 Feb 2019 18:51:36 +0000 (16:51 -0200)]
MLK-20935-4 doc: imx: ahab: Fix typo in mx8_mx8x_secure_boot.txt guide

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

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

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

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

Add a note to avoid a possible mistake.

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

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

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

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

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

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

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

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

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

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

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

4 years agoMLK-20916-2: doc: imx: ahab: Update AHAB document to include ahab_status command
Breno Lima [Tue, 12 Feb 2019 16:51:12 +0000 (14:51 -0200)]
MLK-20916-2: doc: imx: ahab: Update AHAB document to include ahab_status command

Since commit cf2acc5b7cde ("MLK-18942-2 imx8: ahab: Add ahab_status
 command") the U-Boot is able to display and parse the SECO events.

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

Starting in SECO FW v0.2.0 engineering release an invalid image
integrity is logged as an event in open mode. As ahab_status
is able to return this event the note can be removed.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 385ed19051a47f5858e8d326e5ee97f8a08a679d)
(cherry picked from commit 4a88ca0aecec31d0877d7a620fa796a83387a195)
(cherry picked from commit d28e60d27186fef3dd9da2de7780e3ac62855ee1)

4 years agoMLK-20916-1: doc: imx: habv4: Fix typo in iMX6 and iMX7 encrypted boot guide
Breno Lima [Tue, 12 Feb 2019 16:30:17 +0000 (14:30 -0200)]
MLK-20916-1: doc: imx: habv4: Fix typo in iMX6 and iMX7 encrypted boot guide

The set_priblob_bitfield command is enabled by selecting
CONFIG_CMD_PRIBLOB.

Fix typo in mx6_mx7_encrypted_boot.txt guide.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit 99f9696ef5f7d1c0f93b7d910e884890fca6c973)
(cherry picked from commit e3fbcaa744db8d4f0556c67c788ada939404a892)
(cherry picked from commit 636e69cbd2694c3c26f866799c60c0908a50069b)

4 years agoMLK-20758 mx7: Add new command for tamper pin
Ye Li [Mon, 14 Jan 2019 06:05:22 +0000 (22:05 -0800)]
MLK-20758 mx7: Add new command for tamper pin

Add new u-boot command "imx_tamper" to configure and check the tamper pins.
The codes are used for reference and test. So command is disabled at default,
user can enable it by adding CONFIG_IMX_TAMPER=y to defconfig

The iMX7D has 10 tamper pins those can be used for SNVS tamper detection.

Tamper 9 pin is NVCC_DRAM power switch for LPSR by default.
It must be fused to tamper function by command
=> fuse prog -y 1 3 0x80000000
Otherwise, SNVS power consumption would be high

When tamper is detected, CPU can't enter/stay in SNVS mode,
the tamper must be cleared and disabled before enter SNVS.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Shaojun Wang <shaojun.wang@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit d520e1c6067c08103a020b0bc19feb620473e543)
(cherry picked from commit 4333529337a554352e1f9fb7486287dea31aeb79)
(cherry picked from commit c8ca53e9891371c292d4e88a92dd52498ba1c1a2)

4 years agoMLK-20668-2 fat: Fix issue in rootdir table flush for FAT16/12
Ye Li [Wed, 2 Jan 2019 09:41:23 +0000 (01:41 -0800)]
MLK-20668-2 fat: Fix issue in rootdir table flush for FAT16/12

The FAT16/12 has rootdir area before data area, and the clusters for
rootdir are not mantained by FAT table. So we don't need to find empty
cluster for next rootdir space, just use next dir cluster. And the FAT
table don't need to update for this new dir cluster.

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

4 years agoMLK-20594-2 enable fat write for all configuration with uuu
Ye Li [Fri, 24 May 2019 04:48:36 +0000 (21:48 -0700)]
MLK-20594-2 enable fat write for all configuration with uuu

Enable the FAT write when UUU support is enabled

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

4 years agoMLK-20553-3 doc: imx: ahab: Add Secure Boot documentation for i.MX8 and i.MX8x SPL...
Breno Lima [Fri, 30 Nov 2018 20:48:06 +0000 (18:48 -0200)]
MLK-20553-3 doc: imx: ahab: Add Secure Boot documentation for i.MX8 and i.MX8x SPL targets

The current U-Boot implementation includes SPL targets for i.MX8QM and
i.MXQXP MEK boards:

- imx8qxp_mek_spl_defconfig
- imx8qxp_mek_spl_fspi_defconfig
- imx8qm_mek_spl_defconfig
- imx8qm_mek_spl_fspi_defconfig

The U-Boot proper and ATF are included in an additional container being
necessary a different procedure for signing the flash.bin image.

Add a step-by-step guide covering the signing procedure.
Add a CSF example for the 3rd container.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Frank Zhang <frank.zhang@nxp.com>
Reviewed-by: Marius Grigoras <marius.grigoras@nxp.com>
Reviewed-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
(cherry picked from commit 04505024d38eebbb5f39133b502c8e450ca40215)
(cherry picked from commit b139f10ccec5c57164f7e07e33984c845ce58b60)
(cherry picked from commit 82c70d0fc7cf8dcd0eafb48722ea978fffb414d8)

4 years agoMLK-20553-2 doc: imx: ahab: Add AHAB secure boot documentation for i.MX 8 and 8X...
Clement Le Marquis [Wed, 28 Nov 2018 12:10:22 +0000 (13:10 +0100)]
MLK-20553-2 doc: imx: ahab: Add AHAB secure boot documentation for i.MX 8 and 8X families

Add AHAB secure boot step-by-step guide for i.MX8 and i.MX8x families
devices.

Add 3 CSF example files:
- Example to sign flash.bin only using SRK keys.
- Example to sign flash.bin using a subordinate SGK key.
- Example to sign Linux image only using SRK keys.

Signed-off-by: Clement Le Marquis <clement.lemarquis@nxp.com>
Reviewed-by: Frank Zhang <frank.zhang@nxp.com>
Reviewed-by: Marius Grigoras <marius.grigoras@nxp.com>
Reviewed-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
(cherry picked from commit 7c46caba3b528b0399242f99612e5b094b1a4703)
(cherry picked from commit 20016c156f4f4e618de9eff6f5b1fc6a1c871e2a)
(cherry picked from commit 3c0fc7380132900628fe975643e7106032c861a6)

4 years agoMLK-20553-1 doc: imx: ahab: Add AHAB introduction
Breno Lima [Mon, 26 Nov 2018 16:32:43 +0000 (14:32 -0200)]
MLK-20553-1 doc: imx: ahab: Add AHAB introduction

The AHAB is currently supported in i.MX8QXP and i.MX8QM devices.

Add an introductory document containing the following topics:

- AHAB Secure Boot Architecture
- System Control Unit (SCU) introduction
- Security Controller (SECO) introduction
- i.MX8/8x secure boot flow
- AHAB PKI tree generation
- SRK Table and SRK Hash generation

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Frank Zhang <frank.zhang@nxp.com>
Reviewed-by: Marius Grigoras <marius.grigoras@nxp.com>
Reviewed-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
(cherry picked from commit 6e9ceb2526bd4a45c6ff669afb086cc3a0627e6b)
(cherry picked from commit d3534f1d0e9a0f777160a4a6732a30a2bb545733)
(cherry picked from commit 3cf95909fec8e0f6a367633fc0d52223fd456eae)

4 years agoMLK-20270-1 doc: imx: habv4: Add Secure Boot documentation for i.MX8M and i.MX8MM...
Breno Lima [Wed, 17 Oct 2018 21:45:22 +0000 (18:45 -0300)]
MLK-20270-1 doc: imx: habv4: Add Secure Boot documentation for i.MX8M and i.MX8MM devices

Add HABv4 documentation for i.MX8M and i.MX8MM targets covering the
following topics:

- How to sign an securely boot an flash.bin image.
- How to extend the root of trust for additional boot images.
- Add 2 CSF examples.

Reviewed-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit cc63be298a3e5f44e417f4098c124715917d09e1)
(cherry picked from commit ca9c6f091095d3bf09cac42c3eb4493490ac8912)
(cherry picked from commit 03865f7279b6f66625ecad83bf8364989e5da4c1)

4 years agoMLK-20061-1: doc: imx: habv4: Add Encrypted Boot documentation for i.MX 6 and i.MX...
Clement Le Marquis [Fri, 12 Oct 2018 16:44:45 +0000 (18:44 +0200)]
MLK-20061-1: doc: imx: habv4: Add Encrypted Boot documentation for i.MX 6 and i.MX 7 family devices

Add useful documentation for encrypted boot:
- Add 2 CSF examples for encrypt and sign
- How to encrypt and sign a U-Boot binary on closed device
- Why and how increase the PRIBLOB bitfield from CAAM SCFGR

Signed-off-by: Clement Le Marquis <clement.lemarquis@nxp.com>
(cherry picked from commit 3732dddfeddd989ca1fb930972f19303e3b67756)
(cherry picked from commit 9e7ccdd51a0754e728f2e27d282aaa3dbc8eec38)
(cherry picked from commit 570267bf173304655674bfa6f1640f310900f8f7)

4 years agoMLK-19194 PCI: imx: disable the ltssm when link is down in uboot
Richard Zhu [Fri, 10 Aug 2018 08:51:20 +0000 (16:51 +0800)]
MLK-19194 PCI: imx: disable the ltssm when link is down in uboot

Disable the LTSSM when link is down in uboot.
Otherwise, the pcie ep/rc validation system in kernel
would be impacted by the enabled ltssm stat in the uboot.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit cdedbb42e052d4bb3ff6b45044dd0d6023f3cb20)
(cherry picked from commit dcad2189b3d4f405a4675c1cc4f9ce38b524a947)
(cherry picked from commit 01007b8695df5c9f25d37a2f8d87037de5f14d3b)

4 years agoMLK-14831 mx6: Fix wrong bmode value used for usb boot
Ye Li [Mon, 8 May 2017 06:25:19 +0000 (01:25 -0500)]
MLK-14831 mx6: Fix wrong bmode value used for usb boot

Wrong bmode value is used in community u-boot for usb reboot. And cause
it failed. Fix this by using a reserved bootcfg value.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit eacd50f370203218a8e96c28c8a7adc0b638fc6d)
(cherry picked from commit aed4820fa81c1da9206f946a61ff851a255c9288)
(cherry picked from commit 1a944ae01addda559d1bf9869288424c00043406)
(cherry picked from commit 50b976a3b69f0de32e323ab95b28454c563916b9)

4 years agoMLK-19699: imx6ulz: configs: add fastboot to defconfigs
Ye Li [Thu, 23 May 2019 15:06:01 +0000 (08:06 -0700)]
MLK-19699: imx6ulz: configs: add fastboot to defconfigs

Add fastboot to iMX6ULZ EVK defconfig files to support UUU

Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 6a32a6bf6415633e1d22d8f0ddcc7e72d5742298)

4 years agoMLK-19150 fastboot: enable fastboot in mx7dsabresd
Ye Li [Thu, 23 May 2019 14:46:10 +0000 (07:46 -0700)]
MLK-19150 fastboot: enable fastboot in mx7dsabresd

Modify defconfig files to enable fastboot in mx7dsabresd board

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit b7a2347cc382c8d0c80762c12664a7287a2f3d65)
(cherry picked from commit 614dc04b62283a90735f967b97eb46c92ac4f1f7)

4 years agoMLK-19062-1 fastboot: enable fastboot in mx6ul
Ye Li [Thu, 23 May 2019 14:39:49 +0000 (07:39 -0700)]
MLK-19062-1 fastboot: enable fastboot in mx6ul

Modify mx6ul defconfig files to enable fastboot in
mx6ul_14x14 and mx6ul_9x9 EVK boards

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit a9a7715eb2471cdf01c160ac269f822abbd80cdc)
(cherry picked from commit 8192d0446e91933e30bbf87a7b7c9e4679e3450c)

4 years agoMLK-19062-2 fastboot: enable fastboot in mx6ull
Ye Li [Thu, 23 May 2019 14:33:02 +0000 (07:33 -0700)]
MLK-19062-2 fastboot: enable fastboot in mx6ull

Modify deconfig files to enable fastboot in
mx6ull_14x14 and mx6ull_9x9 EVK boards

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 41d3fd64b8791847d58a89cbb05b7135c012f323)
(cherry picked from commit 8c55ae15006eebf48a50653cb63e6a8e9ed3d5a8)

4 years agoMLK-19104 imx7ulp: Enable uuu support for mx7ulp.
Shenwei Wang [Wed, 1 Aug 2018 14:13:12 +0000 (09:13 -0500)]
MLK-19104 imx7ulp: Enable uuu support for mx7ulp.

iMX7ULP EVK boards enable fastboot as default to support uuu.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Acked-by : Frank Li <frank.li@nxp.com>

(cherry picked from commit 035506e86e4f054ec6e75a52e5d7fdbb0f18f8cd)
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 610f6b43c47ac963744442ec9801abf3ec0af784)
(cherry picked from commit 1c02ef7ba55ec35cd18645595af322f67eaac793)

4 years agoMLK-19059-5 Enable uuu for i.MX6SL EVK board
Ye Li [Thu, 23 May 2019 14:51:06 +0000 (07:51 -0700)]
MLK-19059-5 Enable uuu for i.MX6SL EVK board

i.MX6SL boards enable fastboot as default.
uuu will use fastboot command to write eMMC/SD/SPINOR.

Signed-off-by: Xiaoning Wang <xiaoning.wang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit d26e641870ff45c4cb48177603f46d566eb0cc4a)
(cherry picked from commit 488e399b3bdb4cc7e4361f629b3dadac858149f9)

4 years agoMLK-19059-4 Enable uuu for i.MX6SoloX SABRESD and SABREAUTO
Ye Li [Thu, 23 May 2019 14:13:56 +0000 (07:13 -0700)]
MLK-19059-4 Enable uuu for i.MX6SoloX SABRESD and SABREAUTO

i.MX6SoloX SABRE boards enable fastboot as default.
uuu will use fastboot command to write eMMC/SD/QSPI/NAND

Signed-off-by: Xiaoning Wang <xiaoning.wang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 231ccd13a0c2f18b2fe7fec7d23fc22df06e0324)
(cherry picked from commit e099746b62bbdd22f1b9e59cb7791ed4e8111ee4)

4 years agoMLK-19059-3 Enable uuu for i.MX6SLL EVK
Ye Li [Thu, 23 May 2019 14:04:48 +0000 (07:04 -0700)]
MLK-19059-3 Enable uuu for i.MX6SLL EVK

i.MX6SLL boards enable fastboot as default.
Support: mx6sllevk_defconfig
         mx6sllevk_epdc_defconfig
         mx6sllevk_optee_defconfig
         mx6sllevk_plugin_defconfig
uuu will use fastboot command to write emmc.

Signed-off-by: Xiaoning Wang <xiaoning.wang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit f3879673fa179a9c93a7f58de264b4ab463181db)
(cherry picked from commit 21b7edfd1c4ca0c1a2671d38fc10f079c0cb0d44)

4 years agoMLK-19483: i.MX6/7: pack qspi header with u-boot for i.MX6/7 qspi u-boot
Han Xu [Fri, 7 Sep 2018 03:42:15 +0000 (22:42 -0500)]
MLK-19483: i.MX6/7: pack qspi header with u-boot for i.MX6/7 qspi u-boot

To support the uuu, pack the common qspi header with u-boot binary for
i.MX6/7 qspi u-boot.

1. The qspi-header file need to be copied out of source tree.
2. In mkimage flags, we need to add $(QSPI-HEADER) and %$(PLUGIN).bin.
   Otherwise it will fails to filter out $(QSPI-HEADER) and $(PLUGIN).bin because the $(PLUGIN) is
   extend to full path.
3. u-boot-dtb.imx and u-boot.imx are updated to add qspi-header.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit 2804e4248bf638165c54c450528a14fe27cc58cd)
(cherry picked from commit 23b270202916fe32450590c4e9330916e97c18f6)
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 140a11362920a70e209b21894c6c48a0e989ac8d)

4 years agoMLK-19123-4 fastboot: Enable uuu for i.MX6DL sabre
Ye Li [Thu, 23 May 2019 13:32:50 +0000 (06:32 -0700)]
MLK-19123-4 fastboot: Enable uuu for i.MX6DL sabre

i.MX6DL boards enable fastboot as default, support both sabresd and
sabreauto.
uuu will use fastboot command to write emmc.

Signed-off-by: Xiaoning Wang <xiaoning.wang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 248dfa629aaef0ed72b8d3a86f4df2fed737eeb9)
(cherry picked from commit 303808f75374c76cd8af18d150d5bfe3f7fedf13)

4 years agoMLK-19123-3 fastboot: enable fastboot in mx6qsabre
Ye Li [Thu, 23 May 2019 13:32:05 +0000 (06:32 -0700)]
MLK-19123-3 fastboot: enable fastboot in mx6qsabre

Modify defconfig files to enable fastboot in mx6qsabre SDB/ARD boards

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit f4c7c993f6df4c8be69a0283c8b02c5df4aaf291)
(cherry picked from commit cca77ebe386aa7d76742fbea36341d099a408e76)

4 years agoMLK-19123-2 fastboot: enable fastboot in mx6qpsabre
Ye Li [Thu, 23 May 2019 13:31:10 +0000 (06:31 -0700)]
MLK-19123-2 fastboot: enable fastboot in mx6qpsabre

Modify defconfig files to enable fastboot in mx6qpsabre SDB/ARD boards

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 2de4c0110145b07009bb19ca5dfd809bb554369b)
(cherry picked from commit e1cb6dc1cf2eef282fd5e1cda1b6ce6c40fc22ef)

4 years agoMLK-21400 mx6solosabre: Enable fastboot for UUU support
Ye Li [Thu, 23 May 2019 13:30:37 +0000 (06:30 -0700)]
MLK-21400 mx6solosabre: Enable fastboot for UUU support

Enable fastboot configurations in mx6solo sabresd and sabreauto
defconfigs to support UUU. Since the DDR size on mx6solo sabre
boards is smaller, also change the fastboot buffer to 256MB.

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

4 years agoMLK-21055 usb: dwc3: gadget: disable U1 and U2
Li Jun [Wed, 6 Mar 2019 08:15:01 +0000 (16:15 +0800)]
MLK-21055 usb: dwc3: gadget: disable U1 and U2

Currenlty U1 and U2 low power modes are allowed in device mode.
Allowing U1 and U2 low power modes during data transfers in
device mode is causing U1 exit failure on some USB3 host: which
will transite to SS.inactive instead of U0, then host will send
warm reset and ultimately result in reenumeration. This is observed
on UUU tool with some PC host. Hence disable U1 and U2 low power
modes for now.

USB3 spec 7.5.10.4.2 Exit from Recovery.Configuration
The port shall transition to eSS.Inactive when the following
conditions are met:
1. Either the Ux_EXIT_TIMER or the 6-ms timer
   (tRecoveryConfigurationTimeout) times out.
2. For a downstream port, the transition to Recovery is not to
   attempt a Hot Reset.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit ae0cdc741f7313398539f7b576ced73871f6cd71)
(cherry picked from commit ac852ce99326e75806e007587fb695c48107d602)
(cherry picked from commit 0753f44c8168193c87000e1a72e517f88186d149)

4 years agoMLK-20909 usb: dwc3: gadget: use usb_endpoint_maxp for req length
Li Jun [Wed, 13 Feb 2019 06:26:13 +0000 (14:26 +0800)]
MLK-20909 usb: dwc3: gadget: use usb_endpoint_maxp for req length

As endpoint.maxpackt is set at init for super speed, we can't use it
for USB2 connection, we need use the right max packet length according
to connection speed.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 9c6bb3684649b4ae6f0275b5ad3799ea5c8f32df)
(cherry picked from commit be0f3cddac9fc393c1868b9b28e9291cf4746638)
(cherry picked from commit ef3a09e036b19312f5206da7fecd799e246d822a)

4 years agoMLK-20493-5 usb: dwc3: change the dwc3 to be USB3 capable
Li Jun [Thu, 13 Dec 2018 02:56:29 +0000 (10:56 +0800)]
MLK-20493-5 usb: dwc3: change the dwc3 to be USB3 capable

Change the dwc3 device mode to be super speed capable.

Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Tested-by: faqiang.zhu <faqiang.zhu@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit a9dac41fea56c0f41c5d15acd53a232bb1785841)
(cherry picked from commit 5b506ed4ca952429e819d2765ade20c0178e5a1b)
(cherry picked from commit 7801b72b7f4bb6b15409b36b1569adb88d1a2adf)

4 years agoMLK-20467 imx8m: Fix issue for booting signed image through uuu
Ye Li [Tue, 27 Nov 2018 02:21:15 +0000 (18:21 -0800)]
MLK-20467 imx8m: Fix issue for booting signed image through uuu

The SPL loads the FIT image FDT part to an address related with the device
block length. This length is 512 for SD/MMC and is 1 for other devices
like SDP, NOR, NAND, SPI, etc.
When signing FIT image, we use fixed address caculated by SD/MMC block length
to sign FDT part. Thus, when booting through uuu, this causes mismatch and
gets authentication failed.

Fix the issue by providing a override function for this FIT buffer address.
When secure boot is enabled, adjust the addresses of other devices to be same
with SD/MMC.

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

4 years agoMLK-19995 imx8mq: disconnect usb from host for uuu
Li Jun [Tue, 23 Oct 2018 02:31:21 +0000 (10:31 +0800)]
MLK-19995 imx8mq: disconnect usb from host for uuu

Stop the usb device controller before enter kernel, this is required
to make kernel can properly init usb controller with it's in stopped
state.

Suggested-by: Ye.Li <ye.li@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 27d6b4cf3d8d6701aeb800b307ef52afd18540ba)
(cherry picked from commit dfcd809622bd994937724dc8c3252c16a2131056)
(cherry picked from commit c08b3c7621b63d023563d5d5bdb21813568e2c0b)

4 years agoMLK-18707-2 iMX8MM enable fastboot as default
Ye Li [Mon, 20 May 2019 06:03:37 +0000 (23:03 -0700)]
MLK-18707-2 iMX8MM enable fastboot as default

uuu will use fastboot command to write emmc, enable it as
default for iMX8MM EVK board

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

4 years agoMLK-19181-5 imx8mq_evk: Force USB to be high speed for uuu
Li Jun [Fri, 10 Aug 2018 09:22:38 +0000 (17:22 +0800)]
MLK-19181-5 imx8mq_evk: Force USB to be high speed for uuu

As there is problem with super speed with SDP, we force the dwc3
usb speed to be high speed.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit eeb6a8d545e4810df6e3ce2125fa69a1781ea605)
(cherry picked from commit 6f2cb1d190acebd5e55260c1eaeb3b7666c1f70c)
(cherry picked from commit eca93dd1c6070e809d24aa40d7d719ad2aa2d880)

4 years agoMLK-19181-3: defconfig: iMX850D enable USB SDP
Frank Li [Thu, 9 Aug 2018 15:32:38 +0000 (10:32 -0500)]
MLK-19181-3: defconfig: iMX850D enable USB SDP

uuu can download whole uboot and run it
fastboot also enabled.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
(cherry picked from commit 21ce8ab67d0a8eae3df91b074ffad9fb4b987961)
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 95a805fe1fb46b0a49e89bfb99ebe0dd70705927)
(cherry picked from commit d97932a567f7333d00a9d70fdaabeb3175e54fcf)

4 years agoMLK-19181-2: i.MX850: SPL enable usb support
Frank Li [Thu, 9 Aug 2018 15:30:02 +0000 (10:30 -0500)]
MLK-19181-2: i.MX850: SPL enable usb support

Enable DWC3 USB support at i.MX850D platform

Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
(cherry picked from commit 7c3d2a17bf85e97a486d01e231480baaa7e7a167)
(cherry picked from commit 1dd830df85ef684d8b6acd4655204ce7bd6be997)
(cherry picked from commit 830584d72ad856fa71e37bfc61f3f590fbaea7e2)

4 years agoMLK-21854-2 imx: uuu: Update autoboot to run uuu or fastboot
Ye Li [Fri, 17 May 2019 08:52:27 +0000 (01:52 -0700)]
MLK-21854-2 imx: uuu: Update autoboot to run uuu or fastboot

When booting from USB device, change u-boot autoboot to default
run UUU bootcmd or enter fastboot directly for android.

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

4 years agoMLK-21854-1 imx: Add uuu relevant environment
Ye Li [Fri, 17 May 2019 08:49:27 +0000 (01:49 -0700)]
MLK-21854-1 imx: Add uuu relevant environment

Add the uuu environment to each board, when booting from USB, the
u-boot will use them by default

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

4 years agoMLK-19250 imx: uuu: Decouple mmc_get_env_dev with CONFIG_ENV_IS_IN_MMC
Ye Li [Tue, 21 May 2019 03:35:26 +0000 (20:35 -0700)]
MLK-19250 imx: uuu: Decouple mmc_get_env_dev with CONFIG_ENV_IS_IN_MMC

For flash devices, like spi nor, weim nor and qspi/flexspi,
we don't define the ENV in MMC, but UUU fastboot always use the
mmc_get_env_dev. So we have to decouple the function with
CONFIG_ENV_IS_IN_MMC

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

4 years agoMLK-19059-1 fastboot support all partiton for mx6
Xiaoning Wang [Fri, 27 Jul 2018 01:19:44 +0000 (09:19 +0800)]
MLK-19059-1 fastboot support all partiton for mx6

Base on MLK-18406: uuu write to any positionn of mmc
Support i.MX6 boards.

Signed-off-by: Xiaoning Wang <xiaoning.wang@nxp.com>
(cherry picked from commit 808ccb44593b58552d3356d52f9ae23b7b77fd0a)
(cherry picked from commit ae4b9669cc6e2054fbf32e2e38aec3e43488cbb1)
(cherry picked from commit 6480d90bf0f709bdf30863b56de96d4bbeb97825)

4 years agoMLK-18406 imx8: fastboot support all partition
Frank Li [Fri, 25 May 2018 21:56:25 +0000 (16:56 -0500)]
MLK-18406 imx8: fastboot support all partition

uuu can write to any position of mmc
sdps: boot -f ../mkimage_imx8dv/imx-mkimage/iMX8QX/flash.bin

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}
FB: flash -raw2sparse all xx.sdcard

Signed-off-by: Frank Li <Frank.Li@nxp.com>
(cherry picked from commit ca96e0bd1aea1996904b0a71fb1d74c3f5176929)
(cherry picked from commit 482d31e412f5b373d143dbdf363667b066762711)
(cherry picked from commit 0604ac76de5cb0be76573527a5a25defd9dcab6b)

4 years agoMLK-18906-3: imx8mm can choose emmc device by uuu
Frank Li [Fri, 13 Jul 2018 20:22:24 +0000 (15:22 -0500)]
MLK-18906-3: imx8mm can choose emmc device by uuu

uuu can change emmc device number for fastboot

Signed-off-by: Frank Li <Frank.Li@nxp.com>
(cherry picked from commit 4da1ab91f864b804ad561e04f44b618ec86b99b7)
(cherry picked from commit 922533b57d134d68817dbadc62314e3345438606)
(cherry picked from commit eb5edae29d75395ce72a3e6dc39b2b004b3ec8d8)

4 years agoMLK-20356-1 common: Fix resource leak in sparse image writting
Ye Li [Wed, 14 Nov 2018 09:10:53 +0000 (01:10 -0800)]
MLK-20356-1 common: Fix resource leak in sparse image writting

Fix coverity issue CID 18031: Resource leak (RESOURCE_LEAK)
leaked_storage: Variable fill_buf going out of scope leaks the storage it points to

Should free the fill_buf before function return.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit bc23ae569c7aaea338648c000b7b733b09eb735a)
(cherry picked from commit 0a496da0851e981b0ab19338145fcb622762af94)
(cherry picked from commit 8386299ae2ab18d02c8d5abc9a82cf4b6deb5e92)

4 years agoMLK-19969 fastboot: write to wrong position when size bigger than 4GB
Frank Li [Wed, 17 Oct 2018 18:58:23 +0000 (13:58 -0500)]
MLK-19969 fastboot: write to wrong position when size bigger than 4GB

chunk_data_sz = sparse_header->blk_sz * chunk_header->chunk_sz;
All is uint32. chunk_data_sz may be bigger than 4G.

Change chunk_data_sz to 64bit.
force chunk_header->chunk_sz and sparse_header->blk_sz to 64bit.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Ye Li <Ye.Li@nxp.com>
(cherry picked from commit 08090670625c4ccf86dbc9157dad4799f3669fb7)
(cherry picked from commit af09befee9c55525a6bc9844904048c324db7261)
(cherry picked from commit b3e9569163f2c05597c37bf125147a3c11c155e1)