u-boot.git
7 years agoMA-11349 [Android] Use fast avb_ab_flow for AVB verify
Haoran.Wang [Tue, 14 Nov 2017 04:36:45 +0000 (12:36 +0800)]
MA-11349 [Android] Use fast avb_ab_flow for AVB verify

The verify process will check the higher priority slot
and once this slot bootable then continue this one.

Change-Id: I4667ccf45892040da913b88c2bb264da9861146a
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
7 years agoMA-11339 [Android] skip ramdisk when booti for normal boot
zhang sanshan [Mon, 5 Feb 2018 11:10:26 +0000 (19:10 +0800)]
MA-11339 [Android] skip ramdisk when booti for normal boot

Do not copy ramdisk to address ramdisk_addr on normal boot.
Skip passing ramdisk address to booti.

Change-Id: I4ef001734db6aaacbb4bde41f7f794775849ff8e
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
7 years agoMLK-17493: imx8qm: Fix mmcargs variable missing terminator
Leonard Crestez [Thu, 1 Feb 2018 16:07:29 +0000 (18:07 +0200)]
MLK-17493: imx8qm: Fix mmcargs variable missing terminator

Missing the '\0' means the value of the mmcargs value includes the
declaration of loadbootscript below.

Fixes: 432e5b434784 ("MLK-17205-3 video: imx: hdp: Adding configs for HDP firmware loading")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17494: imx8mq: config: fix the mscale u-boot env setting for NAND boot
Han Xu [Thu, 1 Feb 2018 17:58:01 +0000 (11:58 -0600)]
MLK-17494: imx8mq: config: fix the mscale u-boot env setting for NAND boot

Fix the NAND environment settings including save environment to NAND,
correct offset and console settings.

Signed-off-by: Han Xu <han.xu@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17476: imx: optee: change misc partition to optee partition
Han Xu [Tue, 30 Jan 2018 22:02:54 +0000 (16:02 -0600)]
MLK-17476: imx: optee: change misc partition to optee partition

Previous OPTEE change for NAND add a new tee partition which changed the
following NAND partition index. Changed the unused misc partition and
enlarge the default size to 16MB. This will keep the mtd index fixed and
all partitions should be start from the block boundary for most NAND
chips.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-17465 imx8: use random ethaddr when ethaddr not set
Peng Fan [Sat, 27 Jan 2018 01:44:44 +0000 (09:44 +0800)]
MLK-17465 imx8: use random ethaddr when ethaddr not set

Use random ethaddr when ethaddr not set. This could avoid user
to set ethaddr mannualy.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMA-11259 [Android] Fastboot oem unlock fail on imx8
Luo Ji [Thu, 25 Jan 2018 11:08:15 +0000 (19:08 +0800)]
MA-11259 [Android] Fastboot oem unlock fail on imx8

Commit 5dc5928 (MA-11108 [Android] decrypt lock store fail on imx7d) fix
some micros can't be enabled in drivers/usb/gadget/fastboot_lock_unlock.c
even if they have been defined in header files, which enables micro
CONFIG_ANDROID_AB_SUPPORT too. No "prdata" partition exist in Android or
Android Things which causes errors when try to read lock ability flag
from "prdata".

Moreover, imx8 don't use CAAM to decrypt/encrypt lock status, so we
should always return "FASTBOOT_UL_ENABLE" like what we have done on Android
Things.

Change-Id: Iff36485742815d5758e523ee2e6e6e1b4b8f7ac5
Signed-off-by: Luo Ji <ji.luo@nxp.com>
7 years agoMA-11241 [Android] Use strlen() to calculate the string length
Luo Ji [Thu, 25 Jan 2018 06:48:23 +0000 (14:48 +0800)]
MA-11241 [Android] Use strlen() to calculate the string length

Calculate the string length with strlen() instead of hard code.

Change-Id: I6028c249ca03f5d3d08225c528d3584e507c64b3
Signed-off-by: Luo Ji <ji.luo@nxp.com>
7 years agoUse fastboot_tx_write_more() to send multiple packets
Luo Ji [Wed, 22 Nov 2017 05:26:54 +0000 (13:26 +0800)]
Use fastboot_tx_write_more() to send multiple packets

fastboot_tx_write_more() is designed to send multiple packets to
fastboot host in u-boot, make related changes.

Change-Id: Ic856eb87b89cab2d0c2222a0c48d0bc75567a559
Signed-off-by: Luo Ji <ji.luo@nxp.com>
7 years agoMA-10703 [Android] use the usb_ep_queue for muti request
Luo Ji [Wed, 22 Nov 2017 04:18:57 +0000 (12:18 +0800)]
MA-10703 [Android] use the usb_ep_queue for muti request

It need to send muti data through usb for fastboot commands(fastboot getcar all)
this patch use usb_ep_queue to queue usb data.

Change-Id: I5fd2568683c43163a21417a0634dd194e31f3eb7
Signed-off-by: Luo Ji <ji.luo@nxp.com>
7 years ago[iot] Support fastboot oem fuse at-bootloader-vboot-key command
ji.luo [Fri, 20 Oct 2017 07:57:02 +0000 (15:57 +0800)]
[iot] Support fastboot oem fuse at-bootloader-vboot-key command

Support "fastboot oem fuse at-bootloader-vboot-key" command.
Since we don't program the verified boot key in bootloader,
so this command will simply return "OKAY".

Change-Id: Ic750803e7780f2cb0e0eb776ddc2a46932f2be09
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years ago[iot] fastboot:Add 'get_staged' command support
Haoran Wang [Wed, 25 Oct 2017 10:08:42 +0000 (18:08 +0800)]
[iot] fastboot:Add 'get_staged' command support

When host end execute "fastboot get_staged [ <outfile> ]"
The staged data from the last command will be output to host end.
If the last command did not result in staged data or the target data
larger than end point buffer size, this command will be fail.

This patch also alloc new buffer that is larger than normal end point's
as the this command need to transfer data by one packet. So that
only the file that less than 128KB will be transfered.

Change-Id: I1dbefa130df9ca348a30d7bc52cb856c052776bf
Signed-off-by: Haoran Wang <elven.wang@nxp.com>
7 years ago[fastboot] Refine erase-block-size and logical-block-size command
ji.luo [Mon, 30 Oct 2017 05:42:35 +0000 (13:42 +0800)]
[fastboot] Refine erase-block-size and logical-block-size command

This patch did:
1.Correct the 'erase-block-size' to actual value.
2.Refine the code to get 'logical-block-size'

Bug: 68394448

Change-Id: I3c13eab92d875c8faa2f468662d61d142cca3225
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years ago[iot] Refine Android related configs
Haoran Wang [Wed, 11 Oct 2017 07:44:24 +0000 (15:44 +0800)]
[iot] Refine Android related configs

Refined Android related configs to avoid
duplicated defined macros.

Test: Passed build for all i.MX SoMs.

Merged-In: I0e93bd8173e3a0b9b0601d359950233702729fb3

Change-Id: I0e93bd8173e3a0b9b0601d359950233702729fb3
Signed-off-by: Haoran Wang <elven.wang@nxp.com>
7 years agoMA-10052 [iot] Extensions of AXP152 to support stream812
fang hui [Thu, 11 May 2017 04:18:38 +0000 (12:18 +0800)]
MA-10052 [iot] Extensions of AXP152 to support stream812

Necessary extensions of axp152 to support stream812.

merge patches from Martin Pietryka <martin.pietryka@streamunlimited.com>

Change-Id: I7708db4e59d6403a3576f17a221b448866f469a0
Signed-off-by: fang hui <hui.fang@nxp.com>
7 years agoMA-10071 [iot] Add board support imx7d multa
fang hui [Thu, 24 Aug 2017 07:17:35 +0000 (15:17 +0800)]
MA-10071 [iot] Add board support imx7d multa

Add board support imx7d multa

Change-Id: I5c50363681d7cb1d93bf8d8a14d93496bd152bcb
Signed-off-by: fang hui <hui.fang@nxp.com>
7 years agoMA-10732[Android] Change pmic sw3 mode to avoid DDR power off
Zhang Bo [Thu, 23 Nov 2017 06:29:28 +0000 (14:29 +0800)]
MA-10732[Android] Change pmic sw3 mode to avoid DDR power off

Write 1 to bit5 of PMIC SW3MODE(0x3f) register to change sw3 mode to avoid DDR
power off. It will avoid DRAM lose data when reset or reboot.

This feature is essental for pstore/ramoops work normally.

Change-Id: I92a1e198d57d77ae117d0d49675fc8afffec9656
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
7 years agoMLK-17458: imx8mq: config: change the imx8mq ddr4 arm2 FIT offset
Han Xu [Wed, 24 Jan 2018 22:02:00 +0000 (16:02 -0600)]
MLK-17458: imx8mq: config: change the imx8mq ddr4 arm2 FIT offset

Change the FIT image offset from 128MB to 64MB according to the NAND
partition setting.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMA-11226 [Android] Set active slot fail after flashing bootloader
Luo Ji [Wed, 24 Jan 2018 11:01:24 +0000 (19:01 +0800)]
MA-11226 [Android] Set active slot fail after flashing bootloader

Flash bootloader will switch the mmc hwpart to boot0 partition which
will cause errors when read/write blocks from user partition. Fix
this bug by switching hwpart to user partition before read/write
user partition every time.

Change-Id: I5e3405de04e22db352efa59f0286e5c5c4697ac5
Signed-off-by: Luo Ji <ji.luo@nxp.com>
7 years agoMLK-17439 mx7ulp: Change clock rate calculation for NIC1 BUS and EXT
Ye Li [Mon, 22 Jan 2018 03:22:40 +0000 (19:22 -0800)]
MLK-17439 mx7ulp: Change clock rate calculation for NIC1 BUS and EXT

On i.MX7ULP B0, there is change in NIC clock dividers architecture.
On A0, the NIC1 BUS and EXT dividers were in a chain with NIC1 DIV, but
on B0 they are parallel with NIC1 DIV. So now the dividers are independent.
This patch modifies the scg_nic_get_rate function according to this change.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17402 imx8qm/qxp_arm2: Reset ENET1 PHY and MAX7322 at init
Ye Li [Wed, 17 Jan 2018 07:46:54 +0000 (23:46 -0800)]
MLK-17402 imx8qm/qxp_arm2: Reset ENET1 PHY and MAX7322 at init

Since kernel enables both ENET0 and ENET1, so change to reset ENET1
PHY and MAX7322 as well even the configuration is set to use ENET0
in u-boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17375 video: imx: hdp: fix "n" arg for strncmp call
Oliver Brown [Mon, 15 Jan 2018 21:25:55 +0000 (15:25 -0600)]
MLK-17375 video: imx: hdp: fix "n" arg for strncmp call

Renaming hdpload to hdp_load for consistancy.
Correcting the strncmp to use only 4 characters to match "load" argument

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMA-10983-1 Load HDMI firmware from u-boot.bin
Haoran.Wang [Thu, 4 Jan 2018 13:02:38 +0000 (21:02 +0800)]
MA-10983-1 Load HDMI firmware from u-boot.bin

Load HDMI firmware from u-boot.bin instead of
/system partition.

Change-Id: I8945940cfe14db50c95a56b8bff2a94990a7fbaf
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
7 years agoMA-11121 [Android] Enlarge heap size to 96M Bytes for imx8
Luo Ji [Tue, 16 Jan 2018 10:54:55 +0000 (18:54 +0800)]
MA-11121 [Android] Enlarge heap size to 96M Bytes for imx8

After align BSP uboot configuration (commit: e363a68), some vedio
related operations was enabled and will take some heap space. AVB
will take about 62M Bytes heap size to load both boot_a and boot_b,
64M Bytes is not enough anymore.

Change-Id: I9f93cd8d32410d144a0c5a976046773fbd07a539
Signed-off-by: Luo Ji <ji.luo@nxp.com>
7 years agoMLK-17376 typec: support power source with 2 stages of capability
Jun Li [Tue, 16 Jan 2018 10:06:52 +0000 (18:06 +0800)]
MLK-17376 typec: support power source with 2 stages of capability

Some power delivery source send the source capability by 2 stages:
1st stage send the source capability message with only basic 5V
PDO, after the 5V power session setup, 2nd stage it will send full
source capabilities with all PDOs it can support, in this case, we
should go on to process the following PD source cap to have a new
power session setup.

Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-17369 imx8qm/qxp: Add controls for display controller resets
Oliver Brown [Fri, 12 Jan 2018 18:10:32 +0000 (12:10 -0600)]
MLK-17369 imx8qm/qxp: Add controls for display controller resets

 "
 commit cfdb9821531da523fd1f01536eb67c8b8451477f
 Author: Oliver Brown <oliver.brown@nxp.com>
 Date:   Tue Jan 2 07:46:06 2018 -0600

 dc: Add controls for display controller resets.
 "

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMA-11108 [Android] decrypt lock store fail on imx7d
Luo Ji [Thu, 11 Jan 2018 08:49:03 +0000 (16:49 +0800)]
MA-11108 [Android] decrypt lock store fail on imx7d

Macro FASTBOOT_ENCRYPT_LOCK can't be enabled because
of the order of header files.

Change-Id: Id46b2f595e316b70b71ec957d196e36b9eecc297
Signed-off-by: Luo Ji <ji.luo@nxp.com>
7 years agoMLK-17357-2 lpi2c: Add bus busy error handling
Ye Li [Wed, 10 Jan 2018 08:42:39 +0000 (02:42 -0600)]
MLK-17357-2 lpi2c: Add bus busy error handling

When doing "i2c dev 4; i2c probe" with ENET daughter card connected on iMX8QXP MEK
board, we met a i2c bus busy issue, that the BBF of lpi2c always show busy, but the
master is idle, and stop is detected (SDF set).

This patch addes a handling to re-init the lpi2c master for this case. Then the issue
can be worked around.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17357-1 dts: imx8qxp_mek: set the i2c mux register offset to 0
Ye Li [Wed, 10 Jan 2018 08:37:29 +0000 (02:37 -0600)]
MLK-17357-1 dts: imx8qxp_mek: set the i2c mux register offset to 0

The i2c mux PCA9646 does not have register offset. We should read/write
its control register immediately following the i2c device address.
Use u-boot,i2c-offset-len to set the register offset length to 0.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17313-3 imx8mq_evk: Add USB PD power sink support
Ye Li [Mon, 8 Jan 2018 14:09:43 +0000 (08:09 -0600)]
MLK-17313-3 imx8mq_evk: Add USB PD power sink support

Enable the TCPC driver for i.MX8MQ EVK board. When booting with dead battery,
the TCPC driver will setup USB PD connection to negotiate the power with PD
power charger.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Jun Li <jun.li@nxp.com>
7 years agoMLK-17313-2 imx8qm/qxp mek: Update codes to use new TCPC interfaces
Ye Li [Mon, 8 Jan 2018 14:08:57 +0000 (08:08 -0600)]
MLK-17313-2 imx8qm/qxp mek: Update codes to use new TCPC interfaces

Since the TCPC driver is updated, change the QM/QXP MEK board level codes
accordingly to use new interfaces.
Because the typec circuit on iMX8QM/QXP MEK boards only support power role
as source, so set the CONFIG_USB_TCPC_PD_SINK_DISABLE.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Jun Li <jun.li@nxp.com>
7 years agoMLK-17313-1 tcpc: Add support for power sink in dead battery
Ye Li [Mon, 8 Jan 2018 14:05:51 +0000 (08:05 -0600)]
MLK-17313-1 tcpc: Add support for power sink in dead battery

To add support for power sink when booting in dead battery, we
have to setup PD connection with PD source and send/receive PD messages
to negotiate a proper voltage and current.

This patch refactors the TCPC driver with this new function and also
keep DFP mode support for USB host.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Jun Li <jun.li@nxp.com>
7 years agoMLK-17348 xhci: Reset endpoint when endpoint is halted
Ye Li [Thu, 4 Jan 2018 15:17:57 +0000 (09:17 -0600)]
MLK-17348 xhci: Reset endpoint when endpoint is halted

When testing a poor USB disk "Transcend JetFlash XPGMC7W5 ", sometime we
will get TRB TX error during getting string descriptors, then the usb process
aborts due to the context state changed to halted.

Actually when the endpoint context state is halted, we can send reset endpoint
command to put it to stopped state, then set TR dequeue pointer for following
doorbell ring to re-run it. This patch adds this error recovery mechanism.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17345 mxc_ocotp: Update redundancy banks for mx7ulp B0
Ye Li [Fri, 5 Jan 2018 02:55:03 +0000 (20:55 -0600)]
MLK-17345 mxc_ocotp: Update redundancy banks for mx7ulp B0

On mx7ulp B0, beside bank 0 and 1, the fuse bank 9, 10, 28 are changed to
Redundancy mode not ECC, so they can support to program different bits of
a word in multiple times.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMA-10983 Load HDMI firmware before boot
Haoran.Wang [Fri, 29 Dec 2017 08:35:56 +0000 (16:35 +0800)]
MA-10983 Load HDMI firmware before boot

Load HDMI firmware to make HDMI module work.
The firmware stored in /system partition.
Now choose the target boot slot's system partition
to load the firmware.

Change-Id: Icfcd5f6c8237ee0c8875317395cf86c07d53c58e
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
7 years agoMA-10967 Add append bootargs env in uboot
Luo Ji [Wed, 3 Jan 2018 05:50:58 +0000 (13:50 +0800)]
MA-10967 Add append bootargs env in uboot

Add 'append_bootargs' to hold some paramemters which need to be
appended to bootargs.

Change-Id: I80f18a421dea270cc8f555fe1b2799a5eb00aadc
Signed-off-by: Luo Ji <ji.luo@nxp.com>
7 years agoarm64 :show_regs: show the address before relocation
Peng Fan [Tue, 28 Nov 2017 02:08:08 +0000 (10:08 +0800)]
arm64 :show_regs: show the address before relocation

After relocation, when error happends, it is hard to track
ELR and LR with asm file objdumped from elf file.

So subtract the gd->reloc_off the reflect the compliation address.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit 082693f4f02ad7a9de192e73feae34e28856b8e3)

7 years agoMLK-17303-2 imx: 8qm: Fix ENET1 build
Peng Fan [Fri, 29 Dec 2017 06:20:15 +0000 (14:20 +0800)]
MLK-17303-2 imx: 8qm: Fix ENET1 build

Fix ENET1 build and enablement.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17303-1 imx: 8qxp: Fix ENET1 enablement
Peng Fan [Fri, 29 Dec 2017 07:06:14 +0000 (15:06 +0800)]
MLK-17303-1 imx: 8qxp: Fix ENET1 enablement

Fix build error.
Correct ENET1 enablement, Define CONFIG_FEC_ENET_DEV 1, to enable
ENET1 on Base board.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17324 DTS: imx8qm_mek: Add USBOTG1 node
Ye Li [Fri, 29 Dec 2017 03:27:58 +0000 (21:27 -0600)]
MLK-17324 DTS: imx8qm_mek: Add USBOTG1 node

Since android needs the USB OTG port on base board to run fastboot,
add the USBOTG1 node to imx8qm mek DTS, so that the OTG can work on
reworked board.

Tested-by: Chen Guoyin <guoyin.chen@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17292 mx7ulp: Set A7 core frequency to 500Mhz for B0 chip
Ye Li [Fri, 15 Dec 2017 07:28:06 +0000 (01:28 -0600)]
MLK-17292 mx7ulp: Set A7 core frequency to 500Mhz for B0 chip

The normal target frequency for ULP A7 core is 500Mhz, but now ROM
set the core frequency to 413Mhz. So change it to 500Mhz in u-boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17278 imx8qxp_mek: Enable USB OTG port on base board
Ye Li [Fri, 22 Dec 2017 06:30:29 +0000 (00:30 -0600)]
MLK-17278 imx8qxp_mek: Enable USB OTG port on base board

The USB OTG port on MEK base board is not enabled at default, due to the default
design connects it to M2 connector for BT/WIFI.
Since most boards have reworked it, we enable it to support both host and device
mode in u-boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17254: imx8qxp: configs: change the NAND ENV offset to avoid overlap
Han Xu [Wed, 20 Dec 2017 18:29:38 +0000 (12:29 -0600)]
MLK-17254: imx8qxp: configs: change the NAND ENV offset to avoid overlap

There is the 8M block sized NAND chip on QXP board, the previous 64MB
u-boot environment offset overlapped with the boot image location.
Changed the offset from 64MB to 120MB to avoid the overlap.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-17272 imx8mq_evk: Fix build warnings with usb power
Ye Li [Wed, 20 Dec 2017 10:28:32 +0000 (04:28 -0600)]
MLK-17272 imx8mq_evk: Fix build warnings with usb power

Fix build warnings below, because the imx8m_usb_power is not declared

board/freescale/imx8mq_evk/imx8m_evk.c: In function ‘board_usb_init’:
board/freescale/imx8mq_evk/imx8m_evk.c:205:2: warning: implicit
declaration of function ‘imx8m_usb_power’ [-Wimplicit-function-declaration]
  imx8m_usb_power(index, true);
  ^~~~~~~~~~~~~~~

drivers/usb/host/xhci-imx8m.c: In function ‘xhci_hcd_init’:
drivers/usb/host/xhci-imx8m.c:123:3: warning: implicit declaration of
function ‘imx8m_usb_power’ [-Wimplicit-function-declaration]
   imx8m_usb_power(ctr_data[index].usb_id, false);
   ^~~~~~~~~~~~~~~

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17262 video: Fix build break when CONFIG_VIDEO_IMX_HDP_LOAD is not selected
Ye Li [Wed, 20 Dec 2017 09:42:55 +0000 (03:42 -0600)]
MLK-17262 video: Fix build break when CONFIG_VIDEO_IMX_HDP_LOAD is not selected

Met build errors below when CONFIG_VIDEO_IMX_HDP_LOAD is not selected. Because the u-boot
make script checks the "$(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)" for built-in target.

aarch64-poky-linux-ld.bfd: cannot find drivers/video/imx/built-in.o: No such file or directory
scripts/Makefile.build:359: recipe for target 'drivers/video/built-in.o' failed

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMA-10933 [Android] android daily build failed
zhang sanshan [Wed, 20 Dec 2017 07:30:48 +0000 (15:30 +0800)]
MA-10933 [Android] android daily build failed

BSP add HDP firmware loading for video.
android daily build for the configure is not align with BSP.
align BSP uboot configure.

Change-Id: I56ce146a40eeed63e71795870d48387385903f8a
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
7 years agoMLK-17205-3 video: imx: hdp: Adding configs for HDP firmware loading
Oliver Brown [Wed, 13 Dec 2017 23:14:58 +0000 (17:14 -0600)]
MLK-17205-3 video: imx: hdp: Adding configs for HDP firmware loading

Added default environment for hdp loading.
Added hdp loading as default for iMX8QM ARM2 and MEK boards.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMLK-17205-2 video: imx: hdp: Adding HDP firmware loading to the build
Oliver Brown [Wed, 13 Dec 2017 23:12:45 +0000 (17:12 -0600)]
MLK-17205-2 video: imx: hdp: Adding HDP firmware loading to the build

Adding the HDP firmware loading to the build.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMLK-17205-1 video: imx: hdp: Adding support for HDP firmware loading
Oliver Brown [Wed, 13 Dec 2017 23:09:14 +0000 (17:09 -0600)]
MLK-17205-1 video: imx: hdp: Adding support for HDP firmware loading

This adds a command to load the HDP firmware and supporting libraries.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
7 years agoMLK-17239 mmc: fsl_esdhc: fix sd/mmc ddr mode clock setting issue
Haibo Chen [Tue, 19 Dec 2017 06:46:55 +0000 (14:46 +0800)]
MLK-17239 mmc: fsl_esdhc: fix sd/mmc ddr mode clock setting issue

When sd/mmc work at DDR mode, like HS400/HS400ES/DDR52/DDR50 mode,
the actual clock rate is just half of the expected clock.

This patch set the DDR_EN bit first for DDR mode, hardware divide
the usdhc clock automatically, then follow the original sdr clock
setting method.

This patch also remove the unused variable 'is_ddr'.

Acked-by: Li Ye <ye.li@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
7 years agoMLK-17236 imx8qm_mek: Enable base board power
Ye Li [Mon, 18 Dec 2017 09:05:41 +0000 (03:05 -0600)]
MLK-17236 imx8qm_mek: Enable base board power

Since SCFW switches off the base board at default, we need to turn on it
in u-boot, so that perpherals on base board can work.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoimx8qm_arm2: Add xen boot commands
Leonard Crestez [Wed, 29 Nov 2017 12:56:54 +0000 (14:56 +0200)]
imx8qm_arm2: Add xen boot commands

These commands try to be as generic as possible and avoid duplicating
argument values used for regular boot.

The fdt_file parameter still needs to be set to a .dtb for dom0. Booting
xen with stock dtb would require more hacks, for example lpuart
interrupt-parent = <&wu> needs to be removed.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
7 years agoMLK-17210 usb: imx8m: Add PU power on/off to USB
Ye Li [Fri, 15 Dec 2017 01:56:40 +0000 (19:56 -0600)]
MLK-17210 usb: imx8m: Add PU power on/off to USB

ATF will power off all PUs at default, so for USB, we enable
its PU power for both host and device modes in board_usb_init and
disable the power when usb is stop in board_usb_cleanup.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-17200-3 mx7ulp: Select the SCG1 APLL PFD as a system clock source
Ye Li [Wed, 13 Dec 2017 06:22:09 +0000 (00:22 -0600)]
MLK-17200-3 mx7ulp: Select the SCG1 APLL PFD as a system clock source

Due to the APLL out glitch issue TKT332232, the APLLCFG PLLS bit must be set
to select SCG1 APLL PFD for generating system clock to align with the design.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17200-2 mx7ulp: Remove SNVS LP settings for B0
Ye Li [Wed, 13 Dec 2017 06:20:15 +0000 (00:20 -0600)]
MLK-17200-2 mx7ulp: Remove SNVS LP settings for B0

Since i.MX7ULP B0 moves the SNVS LP into M4 domain, A core can't access
it. So check the CPU rev and not apply the settings for B0.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17200-1 mx7ulp: Add CPU revision check for B0
Ye Li [Wed, 13 Dec 2017 06:16:31 +0000 (00:16 -0600)]
MLK-17200-1 mx7ulp: Add CPU revision check for B0

Since there is no register for CPU revision, we use ROM version to
check the A0 or B0 chip.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17189 imx8qxp: change the USDHC_CLK_ROOT source from AVPLL
Haibo Chen [Wed, 13 Dec 2017 02:56:10 +0000 (10:56 +0800)]
MLK-17189 imx8qxp: change the USDHC_CLK_ROOT source from AVPLL

Currently, the DPLL of conn ss is not stable, will cause usdhc
data CRC error. So here change USDHC_CLK_ROOT source from AVPLL
as a workaround. And config USDHC1_CLK_ROOT to 333MHz, USDHC2_CLK_ROOT
to 200MHz. This workaround do not impact SD performance, but decrease
the eMMC performance, HS400ES work clock change from 198MHz to 166MHz,
read performance drop about 10%, write performance drop about 6%.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
7 years agoMLK-17076 mmc: fsl_esdhc: fix the wrong sd/mmc clock frequency setting
Haibo Chen [Mon, 4 Dec 2017 09:35:13 +0000 (17:35 +0800)]
MLK-17076 mmc: fsl_esdhc: fix the wrong sd/mmc clock frequency setting

Change the pre_div to value 1, otherwise the actual sd/mmc clock
frequency is always half of the expect frequency.

Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
7 years agoMLK-17153-2 imx8mq_arm2: Resolve malloc memory problem for SPL NAND boot
Ye Li [Tue, 12 Dec 2017 06:02:19 +0000 (00:02 -0600)]
MLK-17153-2 imx8mq_arm2: Resolve malloc memory problem for SPL NAND boot

When using SPL NAND boot, the required malloc memory is larger than SD/eMMC boot.
Since we have used out OCRAM (for ATF) and OCRAM_S, there is no enough memory could be
allocated.

The solution is moving the malloc memory pool to DDR. The malloc pool is initialized in
board_init_r, so we moved the VDD_DRAM adjustment and DDR init to board_init_f. Then the DDR
can setup before memory pool initialization. Because the i2c and PMIC driver needs to malloc
data, this change has to enable malloc_f pool by setting CONFIG_MALLOC_F_ADDR to previous
malloc address on OCRAM_S.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17153-1 nand: Update SPL MXS NAND mini driver
Ye Li [Tue, 12 Dec 2017 05:49:53 +0000 (23:49 -0600)]
MLK-17153-1 nand: Update SPL MXS NAND mini driver

Update the mini driver to add support for getting ecc info from ONFI and
support read image data from page unaligned NAND address.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMA-10872 Write vaild size of gpt image for i.MX8
Luo Ji [Thu, 7 Dec 2017 09:04:59 +0000 (17:04 +0800)]
MA-10872 Write vaild size of gpt image for i.MX8

The offset of u-boot for i.MX8 boards is 33k bytes, writing whole gpt
image (34k) will break u-boot when the board is booted with SD card.
This patch only write vaild part (first 17k bytes) of gpt into SD card
and will keep backup gpt at the last LBA.

Change-Id: Iac5d337fb11a3e3ad2a9686efbfbacf9523dae58
Signed-off-by: Luo Ji <ji.luo@nxp.com>
7 years agoMLK-17119 i.MX8QM DDR4 ARM2 Support
Teo Hall [Mon, 11 Dec 2017 18:27:06 +0000 (12:27 -0600)]
MLK-17119 i.MX8QM DDR4 ARM2 Support

Add support for DDR4 board in u-boot.
Main changes are the SD card slot and ddr
type

Signed-off-by: Teo Hall <teo.hall@nxp.com>
7 years agoMLK-17145 imx: mx6qpsabresd: use mx6qp.cfg for optee support
Peng Fan [Mon, 11 Dec 2017 04:55:19 +0000 (12:55 +0800)]
MLK-17145 imx: mx6qpsabresd: use mx6qp.cfg for optee support

Use mx6qp.cfg for optee support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 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>
7 years agoMLK-17109-4 imx8mq_arm2: Add i.MX8MQ DDR3L and DDR4 ARM2 boards support
Ye Li [Wed, 15 Nov 2017 06:58:18 +0000 (00:58 -0600)]
MLK-17109-4 imx8mq_arm2: Add i.MX8MQ DDR3L and DDR4 ARM2 boards support

Add board codes, configurations, DTS and DDR initialization codes for the
DDR3L and DDR4 ARM2 boards.

Supported modules
    - DDR3L ARM2: Two RANK DDR3L, QSPI B, eMMC/SD, RMII ENET, UART.
    - DDR4  ARM2: Two RANK DDR4, SD, NAND, RGMII ENET, UART.
      NAND read/write/erase is ok in u-boot, NAND SPL boot will be tested later
      when tool is ready.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17109-3 mxs_nand: Add support for i.MX8M
Ye Li [Thu, 16 Nov 2017 04:58:05 +0000 (22:58 -0600)]
MLK-17109-3 mxs_nand: Add support for i.MX8M

Update the gpmi/apbh_dma/bch drivers and relevant registers for i.MX8M.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17109-2 spi_flash: Add gd25q16c to flash ids table
Ye Li [Wed, 15 Nov 2017 06:46:16 +0000 (00:46 -0600)]
MLK-17109-2 spi_flash: Add gd25q16c to flash ids table

The i.MX8MQ DDR3L ARM2 boards uses gd25q16c flash device, add its id
to spi flash ids table.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17109-1 imx8m: clock: Add more frequencies support in dram pll init function
Ye Li [Wed, 15 Nov 2017 06:44:30 +0000 (00:44 -0600)]
MLK-17109-1 imx8m: clock: Add more frequencies support in dram pll init function

Add 400Mhz, 600Mhz and 800Mhz frequencies for dram pll init function to
support DDR3L/DDR4/LPDDR4.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17131 serial: lpuart: Enable RX and TX FIFO
Ye Li [Fri, 8 Dec 2017 07:53:58 +0000 (01:53 -0600)]
MLK-17131 serial: lpuart: Enable RX and TX FIFO

Enable the RX and TX FIFO in LPUART driver to avoid the input lost
during u-boot boot up.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17127 DTS: imx8qm_mek: Update fec pad settings
Ye Li [Fri, 8 Dec 2017 06:30:37 +0000 (00:30 -0600)]
MLK-17127 DTS: imx8qm_mek: Update fec pad settings

Sync the FEC1 and FEC2 pad settings with latest kernel DTS
(commit a67f777dfb805fa72ffe31911a18d8c0a9683f73)

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by Fugang Duan <fugang.duan@nxp.com>

7 years agoMLK-17086 bootm: Add authentication to optee image
Ye Li [Tue, 5 Dec 2017 07:16:08 +0000 (01:16 -0600)]
MLK-17086 bootm: Add authentication to optee image

When IMX_OPTEE is enabled for secure boot, update bootm to authenticate the optee
image and the kernel zImage before booting into optee.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17123 imx: fix mfgtool bootcmd
Peng Fan [Fri, 8 Dec 2017 05:12:25 +0000 (13:12 +0800)]
MLK-17123 imx: fix mfgtool bootcmd

Fix mfgtool bootcmd error

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17093 imx8qm/qxp: enable control bit for RGMII interface RX clock delay
Fugang Duan [Thu, 7 Dec 2017 01:42:24 +0000 (09:42 +0800)]
MLK-17093 imx8qm/qxp: enable control bit for RGMII interface RX clock delay

Due to RGMII interface timing requirement for imx8qm/qxp mek and arm2
board, it needs to enable RX clock delay.

It should not depend on HW default status since kernel may clear the
bit only on imx8qm/qxp platforms, then reboot test will cause uboot
networking failed.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
7 years agoMLK-17082-02 imx: add optee support for imx6sl
Bai Ping [Mon, 4 Dec 2017 04:49:13 +0000 (12:49 +0800)]
MLK-17082-02 imx: add optee support for imx6sl

  Add defconfig for tee support;
  Enable the TZASC support;
  Add env config for tee support.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17082-01 imx: add optee support for imx6sll
Bai Ping [Mon, 4 Dec 2017 02:50:33 +0000 (10:50 +0800)]
MLK-17082-01 imx: add optee support for imx6sll

  Add different defconfig for optee;
  Enable the TZASC support;
  Add env config for tee support.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17050 imx8m: print out atf commit
Peng Fan [Mon, 4 Dec 2017 07:29:20 +0000 (15:29 +0800)]
MLK-17050 imx8m: print out atf commit

Print out atf commit in U-Boot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17055 imx8mq: evk: update DDR seting for display flickering issue
Jian Li [Mon, 4 Dec 2017 02:30:46 +0000 (10:30 +0800)]
MLK-17055 imx8mq: evk: update DDR seting for display flickering issue

1. With this change, no flickering when LCDIF + MIPI-DSI
   in 720p60 single display case
2. With this change, no flickering when DCSS in 4kp60
   while running 4x memtester at the same time

side effect:
GPU resolve performance downgrade ~20%, no obvious impact
to non-resolve GPU cases.

Signed-off-by: Jian Li <jian.li@nxp.com>
7 years agoimx: imx7 Support for Manufacturing Protection
Breno Lima [Tue, 14 Nov 2017 22:10:45 +0000 (20:10 -0200)]
imx: imx7 Support for Manufacturing Protection

This code was originally developed by Raul Cardenas <raul.casas@nxp.com>
and modified to be applied in U-Boot imx_v2017.03.

More information about the initial submission can be seen
in the link below:
https://lists.denx.de/pipermail/u-boot/2016-February/245273.html

i.MX7D has an a protection feature for Manufacturing process.
This feature uses asymmetric encryption to sign and verify
authenticated software handled between parties. This command
enables the use of such feature.

The private key is unique and generated once per device.
And it is stored in secure memory and only accessible by CAAM.
Therefore, the public key generation and signature functions
are the only functions available for the user.

The manufacturing-protection authentication process can be used to
authenticate the chip to the OEM's server.

Command usage:

Print the public key for the device.
- mfgprot pubk

Generates Signature over given data.
- mfgprot sign <data_address> <data_size>

Signed-off-by: Raul Ulises Cardenas <raul.casas@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17048 imx8mq_evk: Fix SD CD pad issue in SPL
Ye Li [Fri, 1 Dec 2017 07:28:58 +0000 (01:28 -0600)]
MLK-17048 imx8mq_evk: Fix SD CD pad issue in SPL

The EVK board does not use external pull up resistor for SD CD pin, it requires
the pad to be configured as pull up, otherwise the signal level is always low even
the card is not inserted.

This patch configures the pad of CD and RESET to pull up to align with kernel,
although there is already a external pull up for RESET.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17044-3 booti: Add kernel image authentication for secure boot
Ye Li [Thu, 30 Nov 2017 07:32:39 +0000 (01:32 -0600)]
MLK-17044-3 booti: Add kernel image authentication for secure boot

When secure boot is enabled, add authenticate_image in booti to authenticate
kernel image.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17044-2 HAB: Add SIP call for ARM64 platform
Ye Li [Thu, 30 Nov 2017 07:29:54 +0000 (01:29 -0600)]
MLK-17044-2 HAB: Add SIP call for ARM64 platform

When current EL is not EL3, the direct calling to HAB will fail because
CAAM/SNVS can't initialize at non-secure mode. In this case, we use
SIP call to run the HAB in ATF.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17044-1 imx-common: Adding new argument for SIP call interface
Ye Li [Thu, 30 Nov 2017 07:23:56 +0000 (01:23 -0600)]
MLK-17044-1 imx-common: Adding new argument for SIP call interface

Need to pass total 5 arguments for SIP HAB call, so update the interface
to add new argument.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17021 imx8m: Fix thermal temp printed not aligning with kernel
Ye Li [Wed, 29 Nov 2017 06:21:12 +0000 (00:21 -0600)]
MLK-17021 imx8m: Fix thermal temp printed not aligning with kernel

The TMU calibration data in u-boot DTB is not updated, so the temperature
we got in u-boot won't exceed 40C.
This patch updates the TMU node with latest kernel DTB
(commit ee0a9fbdca80b058c00d74c6afa70558f6c1dcc6)

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-17011 imx8qm/qxp: Fix wrong boot type for flexspi
Ye Li [Tue, 28 Nov 2017 06:21:08 +0000 (00:21 -0600)]
MLK-17011 imx8qm/qxp: Fix wrong boot type for flexspi

The codes use the QSPI when booting from Flexspi, this cause u-boot prints
out unknown device if we boot from Flexspi NOR.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-17018 Correct Copyright
Peng Fan [Wed, 29 Nov 2017 03:11:15 +0000 (11:11 +0800)]
MLK-17018 Correct Copyright

Correct Copyright

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16974 imx8m: Modify kernel DTB to limit USB to high-speed for mfgtool
Ye Li [Fri, 24 Nov 2017 07:33:21 +0000 (01:33 -0600)]
MLK-16974 imx8m: Modify kernel DTB to limit USB to high-speed for mfgtool

We found USB issue when using super-speed for mfgtool, temporally work around
the problem to use high-speed only.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16944: imx8qm/qxp: Add leading zeros to SCFW commit hash
Leonard Crestez [Wed, 22 Nov 2017 11:51:15 +0000 (13:51 +0200)]
MLK-16944: imx8qm/qxp: Add leading zeros to SCFW commit hash

This fixes SCFW commits with leading zeros like
0245582bf4a58289e25c59fb0befe84923ca6742 being displayed as "245582b".

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-16940 imx8m: Disable more HDMI and display nodes for mfgtool
Ye Li [Wed, 22 Nov 2017 09:01:14 +0000 (03:01 -0600)]
MLK-16940 imx8m: Disable more HDMI and display nodes for mfgtool

When running mfgtool, the HDMI FW won't be loaded. U-boot has to disable these
new added HDMI and display relevant nodes in DTB.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16939 imx8mq_evk: Change u-boot init stack address and size
Ye Li [Wed, 22 Nov 2017 08:57:05 +0000 (02:57 -0600)]
MLK-16939 imx8mq_evk: Change u-boot init stack address and size

Current u-boot init stack on mScale EVK is from 0x40f00000 to 0x41000000.
This address overlays with kernel load address. When running mfgtool, the
loaded kernel will be overwritten by this stack. So we change the init stack
to the first 512KB DDR memory.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16933 imx8m: clock: set NAND_USDHC_BUS_CLK_ROOT to sys pll1 266M
Peng Fan [Wed, 22 Nov 2017 04:45:01 +0000 (12:45 +0800)]
MLK-16933 imx8m: clock: set NAND_USDHC_BUS_CLK_ROOT to sys pll1 266M

Set NAND_USDHC_BUS_CLK_ROOT to sys pll1 266M

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMA-10703 [Android] use the usb_ep_queue for muti request
zhang sanshan [Wed, 22 Nov 2017 04:18:57 +0000 (12:18 +0800)]
MA-10703 [Android] use the usb_ep_queue for muti request

It need to send muti data through usb for fastboot commands(fastboot getcar all)
this patch use usb_ep_queue to queue usb data.

Change-Id: I5fd256868ac43163a21417a0634dd194e31f3eb7
Signed-off-by: Li Jun <jun.li@nxp.com>
7 years agoMLK-16931 imx8m: hab: Fix secure boot build warning
Ye Li [Wed, 22 Nov 2017 02:37:21 +0000 (20:37 -0600)]
MLK-16931 imx8m: hab: Fix secure boot build warning

Found HAB build warnings on mScale, those relate to ARM 64 bits conversion.

arch/arm/imx-common/hab.c: In function ‘csf_is_valid’:
arch/arm/imx-common/hab.c:556:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
!chk_bounds((const uint8_t *)ivt_initial->csf,
^
In file included from arch/arm/imx-common/hab.c:14:0:
arch/arm/imx-common/hab.c:557:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
HAB_HDR_LEN(*(const struct hab_hdr *)ivt_initial->csf),
^
./arch/arm/include/asm/imx-common/hab.h:177:40: note: in definition of macro ‘HAB_HDR_LEN’
((size_t)(((const struct hab_hdr *)&(hdr))->len[0] << 8) \
^~~
arch/arm/imx-common/hab.c:557:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
HAB_HDR_LEN(*(const struct hab_hdr *)ivt_initial->csf),
^
./arch/arm/include/asm/imx-common/hab.h:178:41: note: in definition of macro ‘HAB_HDR_LEN’
+ (size_t)((const struct hab_hdr *)&(hdr))->len[1])
^~~
arch/arm/imx-common/hab.c:563:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
csf_hdr = (const uint8_t *)ivt_initial->csf;

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16930 imx6: hab: Fix secure boot build error and warning
Ye Li [Wed, 22 Nov 2017 02:29:38 +0000 (20:29 -0600)]
MLK-16930 imx6: hab: Fix secure boot build error and warning

Found secure boot build error and warning for some i.MX6 platforms without
CONFIG_ROM_UNIFIED_SECTIONS defined. Fix them in this patch.

In file included from arch/arm/imx-common/hab.c:14:0:
arch/arm/imx-common/hab.c: In function ‘hab_rvt_report_event’:
./arch/arm/include/asm/imx-common/hab.h:152:59: error: ‘HAB_RVT_BASE_ARM64’ undeclared (first use in this function)
^
arch/arm/imx-common/hab.c:23:29: note: in expansion of macro ‘HAB_RVT_REPORT_EVENT_ARM64’
((hab_rvt_report_event_t *)HAB_RVT_REPORT_EVENT_ARM64) : \
^
arch/arm/imx-common/hab.c:153:30: note: in expansion of macro ‘hab_rvt_report_event_p’
hab_rvt_report_event_func = hab_rvt_report_event_p;
^
./arch/arm/include/asm/imx-common/hab.h:152:59: note: each undeclared identifier is reported only once for each function it appears in
^
arch/arm/imx-common/hab.c:23:29: note: in expansion of macro ‘HAB_RVT_REPORT_EVENT_ARM64’
((hab_rvt_report_event_t *)HAB_RVT_REPORT_EVENT_ARM64) : \

arch/arm/imx-common/hab.c:126:23: warning: 'gd_save' defined but not used [-Wunused-variable]
static volatile gd_t *gd_save;

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16921 imx8mq_evk: Change kernel load address to 0x40480000
Ye Li [Tue, 21 Nov 2017 05:46:55 +0000 (23:46 -0600)]
MLK-16921 imx8mq_evk: Change kernel load address to 0x40480000

The u-boot running address is 0x40200000, and the image size is larger than 512KB.
If we set kernel load address to 0x40280000, when using mfgtool, the kernel loading
will overwrite the u-boot image in DDR and cause u-boot crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16895 imx8: use netboot when mmcboot fail
Peng Fan [Tue, 21 Nov 2017 05:20:46 +0000 (13:20 +0800)]
MLK-16895 imx8: use netboot when mmcboot fail

Use netboot when mmcboot fail.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16903 imx8m: Add reset_cpu to use external WDOG_B for reset
Ye Li [Mon, 20 Nov 2017 06:54:45 +0000 (00:54 -0600)]
MLK-16903 imx8m: Add reset_cpu to use external WDOG_B for reset

The WDT is enabled for WDOG in current u-boot reset, this cause external WDOG_B
and internal WDOG_RESET_B_DEB both asserted for timeout. To avoid any unpredictable
behavior, change to use the WDOG_B only.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16889 PCI: imx: disable the ltssm when link is down
Richard Zhu [Fri, 3 Nov 2017 05:52:55 +0000 (13:52 +0800)]
MLK-16889 PCI: imx: disable the ltssm when link is down

Disable the LTSSM when link is down.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-16899 imx8mq: evk: Add back LPDDR4 performance register settings
Peng Fan [Mon, 20 Nov 2017 01:57:54 +0000 (09:57 +0800)]
MLK-16899 imx8mq: evk: Add back LPDDR4 performance register settings

Add back LPDDR4 performance register settings

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16880 imx8mq: evk: fix init ram space
Peng Fan [Thu, 16 Nov 2017 12:08:58 +0000 (20:08 +0800)]
MLK-16880 imx8mq: evk: fix init ram space

Fix init ram space. Otherwise uboot will override ATF stack space
and cause unexpected issues.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-14945 HAB: Check if IVT valid before authenticating image
Utkarsh Gupta [Sat, 18 Nov 2017 01:23:08 +0000 (19:23 -0600)]
MLK-14945 HAB: Check if IVT valid before authenticating image

For proper authentication users must check the IVT before authenticating the
kernel image. If the IVT DCD pointer is not 0, display an error as shown below
and return a boot failure.

Authenticate image from DDR location 0x12000000...
Error: DCD pointer must be 0

Authenticate zImage Fail, Please check

Signed-off-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>