u-boot.git
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>
7 years agoMLK-16703: HAB : Check if CSF is valid before authenticating image
Utkarsh Gupta [Sat, 18 Nov 2017 01:20:33 +0000 (19:20 -0600)]
MLK-16703: HAB : Check if CSF is valid before authenticating image

For proper authentication users must check if the CSF is valid. This patch
calls the csf_is_valid function prior to authenticating the image to parse
the CSF and returns a failure if an invalid command is found as shown below.

Authenticate image from DDR location 0x12000000...
Check CSF for Write Data command before authenticating image

Error - WRITE Data command found

Authenticate zImage Fail, Please check

Signed-off-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
7 years agoMLK-16882: imx8qxp: config: add NAND boot environment
Han Xu [Thu, 16 Nov 2017 22:57:29 +0000 (16:57 -0600)]
MLK-16882: imx8qxp: config: add NAND boot environment

add the nand boot related environments for i.MX8QXP ARM2 board.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMA-10633 [Android] enlarge the timeout for waiting DATA0
zhang sanshan [Thu, 16 Nov 2017 07:38:11 +0000 (15:38 +0800)]
MA-10633 [Android] enlarge the timeout for waiting DATA0

600ms is not enough to erase erase_grp_size for some sdcard.
enlarge to to 1200ms.

Change-Id: Ic980794fa3064f92b479b87380e694f853f83c6a
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
7 years agoMA-10621 Fix no error returned when lock/unlock fail
ji.luo [Wed, 15 Nov 2017 05:20:44 +0000 (13:20 +0800)]
MA-10621 Fix no error returned when lock/unlock fail

Make do_fastboot_unlock() and fastboot_lock() return FbLockState
type and correct the compare logic in cb_flashing().

Change-Id: I6df6f39a8aa3197299daa0d64408ac72a54fb5e9
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years agoMLK-16831 imx8m: Remove cpu-idle-states property from kernel FDT for rev A0
Ye Li [Thu, 16 Nov 2017 05:29:33 +0000 (23:29 -0600)]
MLK-16831 imx8m: Remove cpu-idle-states property from kernel FDT for rev A0

Since i.MX8M A0 has HW issue in CPU idle, we must disable the function
when running on A0 chip. This patch checks the CPU rev and remove the
"cpu-idle-states" from cpu nodes to disable the CPU idle.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMA-10622 add android configure to support mx8qm mek board
Richard Liu [Tue, 14 Nov 2017 12:30:38 +0000 (20:30 +0800)]
MA-10622 add android configure to support mx8qm mek board

Add android configure to support mx8qm mek board on android build.

Change-Id: I6dd885258f58c2f81b81bba87ca56184c653b9a1
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
7 years agoMLK-16758-4 SPL: Add HAB image authentication to FIT
Ye Li [Thu, 9 Nov 2017 05:23:04 +0000 (23:23 -0600)]
MLK-16758-4 SPL: Add HAB image authentication to FIT

Introduce two board level callback functions to FIT image loading process, and
a SPL_FIT_FOUND flag to differentiate FIT image or RAW image.

Implement functions in imx common SPL codes to call HAB funtion
to authenticate the FIT image. Generally, we have to sign multiple regions
in FIT image:
1. Sign FIT FDT data (configuration)
2. Sign FIT external data (Sub-images)

Because the CSF supports to sign multiple memory blocks, so that we can use one
signature to cover all regions in FIT image and only authenticate once.
The authentication should be done after the entire FIT image is loaded into
memory including all sub-images.
We use "-p" option to generate FIT image to reserve a space for FIT IVT
and FIT CSF, also this help to fix the offset of the external data (u-boot-nodtb.bin,
ATF, u-boot DTB).

The signed FIT image layout is as below:
--------------------------------------------------
|     |     |     |   |           |     |        |
| FIT | FIT | FIT |   | U-BOOT    | ATF | U-BOOT |
| FDT | IVT | CSF |   | nodtb.bin |     |   DTB  |
|     |     |     |   |           |     |        |
--------------------------------------------------

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16787-3 SPL: Add FIT data-position property support
Ye Li [Thu, 9 Nov 2017 05:14:48 +0000 (23:14 -0600)]
MLK-16787-3 SPL: Add FIT data-position property support

For external data, FIT has a optional property "data-position" which
can set the external data to a fixed offset to FIT beginning.
Add the support for this property in SPL FIT.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16787-2 iMX8M: Add support to enable CONFIG_SECURE_BOOT
Ye Li [Thu, 9 Nov 2017 03:43:56 +0000 (21:43 -0600)]
MLK-16787-2 iMX8M: Add support to enable CONFIG_SECURE_BOOT

Add some SOC level codes and build configurations to use HAB lib for
CONFIG_SECURE_BOOT, like adding the SEC_CONFIG fuse, enable fuse driver,
CAAM clock function, and add CAAM secure RAM to MMU table.

The FSL_CAAM is temporally not enabled for iMX8M when CONFIG_SECURE_BOOT is set,
because we don't need the CAAM driver for SPL.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16787-1 HAB: Update hab codes to support ARM64 and i.MX8M
Ye Li [Thu, 9 Nov 2017 03:25:44 +0000 (21:25 -0600)]
MLK-16787-1 HAB: Update hab codes to support ARM64 and i.MX8M

There are some changes to support ARM64 i.MX8M platform in this patches:
1. The hab_rvt base and function vectors are different as i.MX6/7

2. Need to bypass an workaround for i.MX6 to fix problem in MMU.

3. The x18 register needed save & restore before calling any HAB API. According
   to ARM procedure call spec, the x18 is caller saved when it is used as
   temporary register. So calling HAB API may scratch this register, and
   cause crash once accessing the gd pointer.

   On ARMv7, the r9 is callee saved when it is used as variable register. So
   no need to save & restore it.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16802 imx8m: correct mmu mapping
Peng Fan [Sun, 12 Nov 2017 11:33:22 +0000 (19:33 +0800)]
MLK-16802 imx8m: correct mmu mapping

ATF has been moved to OCRAM, it is no longer in DRAM, so
let Uboot could use that space.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16794 imx8qxp: support ddr3 arm2 board
Peng Fan [Fri, 10 Nov 2017 08:38:23 +0000 (16:38 +0800)]
MLK-16794 imx8qxp: support ddr3 arm2 board

Support DDR3 ARM2 board.
Most parts are same as LPDDR4 ARM2 board, so share code
with LPDDR4 ARM2.
The DRAM size is 1GB on DDR3 ARM2 board.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16795 imx8mq_evk: Rename SPL DDR files and public functions
Ye Li [Fri, 10 Nov 2017 06:39:23 +0000 (00:39 -0600)]
MLK-16795 imx8mq_evk: Rename SPL DDR files and public functions

Change to use more generic name for DDR files and public functions used in SPL,
not specified to LPDDR4.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-16797 imx8qm/qxp: Fix memory bank size calculation issue
Ye Li [Fri, 10 Nov 2017 07:49:56 +0000 (01:49 -0600)]
MLK-16797 imx8qm/qxp: Fix memory bank size calculation issue

The calculation of memory bank size is wrong when the memory on the board is
less than 2GB. It causes memory bank exceeding the real DDR end, and cause
crash in kernel. Fix the issue in this patch.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16753-9 imx: mx7: add optee support
Peng Fan [Fri, 10 Nov 2017 05:31:43 +0000 (13:31 +0800)]
MLK-16753-9 imx: mx7: add optee support

Add different defconfigs.
Enable Trustzone.
Update env to runtime boot OP-TEE.
mx7d arm2 board not supported now.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16753-8 imx: mx6ul/ull: add optee support
Peng Fan [Fri, 10 Nov 2017 05:29:49 +0000 (13:29 +0800)]
MLK-16753-8 imx: mx6ul/ull: add optee support

Add different defconfigs.
Enable Trustzone.
Update env to runtime boot OP-TEE.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16753-7 imx: mx6sx: add optee support
Peng Fan [Thu, 9 Nov 2017 01:14:12 +0000 (09:14 +0800)]
MLK-16753-7 imx: mx6sx: add optee support

Add different defconfigs.
Enable Trustzone.
Update env to runtime boot OP-TEE.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16753-6 imx: mx6sabresd: add optee support
Peng Fan [Thu, 9 Nov 2017 01:10:52 +0000 (09:10 +0800)]
MLK-16753-6 imx: mx6sabresd: add optee support

Add different defconfigs
Enable Trustzone.
Update env to runtime boot OP-TEE.
To 6QP SDB, TZASC enabled, need board rework and new ddr script.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16753-5 imx: mx6qsabreauto: add optee support
Peng Fan [Thu, 9 Nov 2017 01:04:01 +0000 (09:04 +0800)]
MLK-16753-5 imx: mx6qsabreauto: add optee support

Add defconfigs.
Enable Trustzone.
Update env to runtime boot OP-TEE.
To 6QP AUTO, TZASC not enabled now.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16753-4 tools: imximage: add SET_BIT command
Peng Fan [Fri, 3 Nov 2017 09:40:24 +0000 (17:40 +0800)]
MLK-16753-4 tools: imximage: add SET_BIT command

Add SET_BIT command

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16753-3 imx: reserve the high 32M
Peng Fan [Fri, 10 Nov 2017 04:52:49 +0000 (12:52 +0800)]
MLK-16753-3 imx: reserve the high 32M

To i.MX6/7, the high 32M is reserved for OP-TEE case.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16753-2 imx-common: add IMX_OPTEE entry
Peng Fan [Thu, 2 Nov 2017 08:01:19 +0000 (16:01 +0800)]
MLK-16753-2 imx-common: add IMX_OPTEE entry

Add IMX_OPTEE Kconfig entry

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16753-1 imx8m: add optee node according to runtime status
Peng Fan [Thu, 2 Nov 2017 05:47:24 +0000 (13:47 +0800)]
MLK-16753-1 imx8m: add optee node according to runtime status

If TEE is enabled according to rom_pointer[0,1] passed to BL33
from ATF, uboot need to add the optee node in dts to let
Kernel could probe the TEE driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16793: imx8qxp: config: fix the nand partition size and env offset
Han Xu [Thu, 9 Nov 2017 23:02:20 +0000 (17:02 -0600)]
MLK-16793: imx8qxp: config: fix the nand partition size and env offset

considering the boot binary/kernel size becomes larger, increase the
boot and kernel partition size and accordingly change the offset when
reading data.
Also changed the extra Android misc partition size to 8M which is block
size aligned.

Signed-off-by: Han Xu <han.xu@nxp.com>
7 years agoMLK-16773 imx8m: spl: implement wdog reset
Peng Fan [Tue, 7 Nov 2017 08:57:56 +0000 (16:57 +0800)]
MLK-16773 imx8m: spl: implement wdog reset

Implement wdog reset in SPL stage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMA-10587 [Android]u-boot: Remove build warning in f_fastboot.c
Zhang Bo [Mon, 6 Nov 2017 06:54:34 +0000 (14:54 +0800)]
MA-10587 [Android]u-boot: Remove build warning in f_fastboot.c

The warnings in f_fastboot.c is because the size of a pointer is 64bits,
while the variables in header structure is 32bits. Need to convert manually
at first.
The function partition_table_valid() is useful only when CONFIG_FSL_FASTBOOT and
CONFIG_FASTBOOT_LOCK are defined.

Change-Id: I480f254465096bd61b9075dff0d3fb6ab4bc44af
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
7 years agoMA-10586 [Android]u-boot: Remove build warning in cmd_fsl_caam.c
Zhang Bo [Mon, 6 Nov 2017 06:44:53 +0000 (14:44 +0800)]
MA-10586 [Android]u-boot: Remove build warning in cmd_fsl_caam.c

This build warning is because unnecessary conversion.

Change-Id: Icfad58b95b62c15021ff57370d73b644133f6697
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
7 years agoMA-10585 [Android]u-boot: Fix build error "error: redefinition of 'init_csu'"
Zhang Bo [Mon, 6 Nov 2017 06:42:05 +0000 (14:42 +0800)]
MA-10585 [Android]u-boot: Fix build error "error: redefinition of 'init_csu'"

This build error in arch/arm/cpu/armv7/mx6/soc.c is introduced by mistake.

Change-Id: Ieecdc359bcd5a2eb60db4d96bcf06f19e8b2959f
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
7 years agoMA-10581 Add androidboot.verifiedbootstate kernel comdline for Android
ji.luo [Mon, 6 Nov 2017 11:07:11 +0000 (19:07 +0800)]
MA-10581 Add androidboot.verifiedbootstate kernel comdline for Android

Pass the 'androidboot.verifiedbootstate' kernel cmdline according to
the requirement.

Change-Id: Idc87b769e502d7a5779565ddcb3b14b29d8c5487
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years agoMA-10580 Open lock/unlock feature for evk_6sl and sabresd_7d
ji.luo [Mon, 6 Nov 2017 07:36:30 +0000 (15:36 +0800)]
MA-10580 Open lock/unlock feature for evk_6sl and sabresd_7d

Add configs to open lock/unlock feature for evk_6sl and sabresd_7d.

Change-Id: I18f8917df06290efb553b10c9bbdaeb145f8a423
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years agoMLK-16758-2 imx8qxp_mek: Enable USBOTG1 support on MEK base board for android
Ye Li [Thu, 2 Nov 2017 10:25:27 +0000 (05:25 -0500)]
MLK-16758-2 imx8qxp_mek: Enable USBOTG1 support on MEK base board for android

Android needs to use USBOTG port on MEK base board for fastboot (USB device mode).
Add relevant node to DTS and update configurations to enable the port in android build.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-16758-1 DTS: imx8qxp: Remove duplicated nodes for USB OTG1 and phy
Ye Li [Tue, 31 Oct 2017 09:14:31 +0000 (04:14 -0500)]
MLK-16758-1 DTS: imx8qxp: Remove duplicated nodes for USB OTG1 and phy

There are duplicated nodes for USBOTG1 and its PHY in imx8qxp DTSi,
remove them.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-16756 imx: imx8m: correct SOC type
Peng Fan [Thu, 2 Nov 2017 07:14:18 +0000 (15:14 +0800)]
MLK-16756 imx: imx8m: correct SOC type

Correct SoC type, otherwise get wrong soc type and access wrong
registers.
If not correct,  met kernel panic:
[    0.000000] Bad mode in Error handler detected on CPU0, code 0xbf000002 -- Sr
[    0.000000] Internal error: Oops - bad mode: 0 [#1] PREEMPT SMP
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.9.51-03585-gc9c62b70db7
[    0.000000] Hardware name: Freescale i.MX8MQ EVK (DT)
[    0.000000] task: ffff000009210700 task.stack: ffff000009200000
[    0.000000] PC is at setup_arch+0xf4/0x550
[    0.000000] LR is at setup_arch+0xf0/0x550
[    0.000000] pc : [<ffff0000090f2714>] lr : [<ffff0000090f2710>] pstate: 00005
[    0.000000] sp : ffff000009203f20
[    0.000000] x29: ffff000009203f20 x28: 00000000410f0018
[    0.000000] x27: 0000000000000400 x26: 00000000fff19b88
[    0.000000] x25: 00000000ff93a0b0 x24: 00000000fff83358
[    0.000000] x23: 0000000000000000 x22: ffff000009207000
[    0.000000] x21: ffff7dfffe800000 x20: ffff000009224000
[    0.000000] x19: ffff000008080000 x18: 0000000000000010
[    0.000000] x17: 0000000000009000 x16: 0000000000001800
[    0.000000] x15: 0000000000000006 x14: ffff00008933cbc7
[    0.000000] x13: ffff00000933cbd5 x12: 0000000000000000
[    0.000000] x11: 0000000000000007 x10: 0101010101010101
[    0.000000] x9 : ffffffffffffffff x8 : 0000000000000008
[    0.000000] x7 : 0000000000000007 x6 : 8000000000000000
[    0.000000] x5 : 0000000000000080 x4 : 000000000000006e
[    0.000000] x3 : 0000000000000000 x2 : 000000000000006e
[    0.000000] x1 : 0000000000000000 x0 : 0000000000000001

Signed-off-by: Peng Fan <peng.fan@nxp.com>
7 years agoMA-10570[Android] Change bootdelay to 1s for imx8 to avoid stopping at u-boot hardly
Zhang Bo [Thu, 2 Nov 2017 02:04:54 +0000 (10:04 +0800)]
MA-10570[Android] Change bootdelay to 1s for imx8 to avoid stopping at u-boot hardly

The BSP patch "MLK-16467 serial_lpuart: Fix FIFO_RXFE definition in
LPUART driver" disable the FIFO. The UART can only reveive input after some
log output and console is ready. So it is very hard to stop at u-boot if
we set the bootdelay as 0s.

Change the bootdelay time to 1s to avoid stopping at u-boot hardly.

Change-Id: I7134f559b3d43b8f1064171e60fd0098b59358a9
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
7 years agoMLK-16752 imx8mq: Add CPU rev get and use it for ROM_SW_INFO address
Ye Li [Wed, 1 Nov 2017 10:16:31 +0000 (05:16 -0500)]
MLK-16752 imx8mq: Add CPU rev get and use it for ROM_SW_INFO address

Implement the get_cpu_rev function by reading the DIGPROG register
to get the CPU ID. Since this register is not updated for B0,
we need also check ROM version. The ROM version address is different
on B0 (0x83c) and A0 (0x800), so have to check both two.

Additional, the address for ROM_SW_INFO is changed on B0, we have to use
the CPU version to determine the address.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-16749 imx8qm/qxp: Fix mmcpart env variable issue
Ye Li [Wed, 1 Nov 2017 10:41:59 +0000 (05:41 -0500)]
MLK-16749 imx8qm/qxp: Fix mmcpart env variable issue

When booting from flexspi, the mmcpart variable is not defined because
the CONFIG_SYS_MMC_IMG_LOAD_PART binds to SD/eMMC boot image only. This cause we
fails to load kernel image from SD after booting from flexspi.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-16747 imx8m: use SIP to start/check M4
Peng Fan [Wed, 1 Nov 2017 10:09:28 +0000 (18:09 +0800)]
MLK-16747 imx8m: use SIP to start/check M4

Use SIP to start/Check M4.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
7 years agoMLK-16739 imx8qm/qxp/mq: Change environment offset to avoid overlay
Ye Li [Tue, 31 Oct 2017 10:58:18 +0000 (05:58 -0500)]
MLK-16739 imx8qm/qxp/mq: Change environment offset to avoid overlay

When M4 images (m4_0 and m4_1) are included into flash.bin, the bin size exceeds
the 1.2MB, which cause overlay with u-boot environment area.
To fix the issue, we change the u-boot environment offset to 4MB for SD and FlexSPI,
and align this for all i.MX8 platforms (i.MX8QM/QXP/MQ).

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16729 tools: fix build break when libpython3-dev is installed
Ye Li [Tue, 31 Oct 2017 02:33:27 +0000 (21:33 -0500)]
MLK-16729 tools: fix build break when libpython3-dev is installed

The u-boot meets break, when host build server has installed swig and libpython3-dev,
but no libpython-dev installed.

tools/libfdt_wrap.c:147:21: fatal error: Python.h: No such file or directory

The root cause is tools/makefile checks the Python.h before building a libfdt Python module.
Since the u-boot is using "python" command not "python3", we should change to check the Python.h
under python2.x directory not every python directory (like python3.x). Otherwise when a python3
develop package is installed, the script will get the file and start to build libfdt if swig
is installed as well.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16732 DTS: imx8qm-arm2: Remove UART0 CTS and RTS pinmux
Ye Li [Mon, 30 Oct 2017 10:08:35 +0000 (05:08 -0500)]
MLK-16732 DTS: imx8qm-arm2: Remove UART0 CTS and RTS pinmux

The lpuart0 is configured as console port on i.MX8QM LPDDR4 ARM2 board,
so its cts/rts pins are not necessary. Since M4_1 core will use lpuart2
as its console. We remove these two pinmux from DTS file.

Signed-off-by: Ye Li <ye.li@nxp.com>
7 years agoMA-10557 [Android] enlarge malloc size
zhang sanshan [Tue, 31 Oct 2017 05:27:54 +0000 (13:27 +0800)]
MA-10557 [Android] enlarge malloc size

uboot will have below error log when verify boot.img
avb_util.c:199: ERROR: Failed to allocate memory.

the default size of malloc is 36M. But we need to load boot.img
with malloc addr. enlarge the size of malloc to 64M.

Change-Id: I64d0403b0cc970128cdfd1eafe7a4680a92f7c25
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
7 years agoMLK-16728 imx8mq: evk: reserve the tee space when tee enabled
Peng Fan [Mon, 30 Oct 2017 06:34:07 +0000 (14:34 +0800)]
MLK-16728 imx8mq: evk: reserve the tee space when tee enabled

rom_pointer[0] contains the base, rom_pointer[1] contains the size.
When TEE enabled, if not reserve the space, uboot relocation may
overwrite TEE or trigger fault when TZASC enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
7 years agoMA-10552-10 [Android] enable A/B system in android
zhang sanshan [Mon, 30 Oct 2017 09:19:45 +0000 (17:19 +0800)]
MA-10552-10 [Android] enable A/B system in android

CAAM do not work in imx8.
disable FASTBOOT_ENCRYPT_LOCK for lock&unlock and return 0
for fsl avb call back on imx8 device.

Change-Id: I79e2de2571a922ae22c2a52f0beb661762e11dd5
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
7 years agoMA-10552-7 [Android] enable A/B system in android
zhang sanshan [Sun, 29 Oct 2017 09:02:08 +0000 (17:02 +0800)]
MA-10552-7 [Android] enable A/B system in android

add macro which support A/B boot and AVB.
change CONFIG_ANDROID_THINGS_SUPPORT to CONFIG_ANDROID_AB_SUPPORT

Change-Id: I08688e7b19ec7b8d71c7adcd298ae2ccc1e309c3
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
7 years agoMA-10552-6 [Android] enable A/B system in android
zhang sanshan [Sun, 29 Oct 2017 08:46:26 +0000 (16:46 +0800)]
MA-10552-6 [Android] enable A/B system in android

support arm64 kernel image when enable AVB.
put the bootimage at hdr->kernel_addr - hdr->page_size.
copy ramdisk and dts to the addr in bootimage header.

Change-Id: I45c2f8238c2bf055130e6e7c2d5b431ca46e431e
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
7 years agoMLK-16725 imx8mq: clock: Set ARM core clock according to the CPU grade
Ye Li [Mon, 30 Oct 2017 03:16:31 +0000 (22:16 -0500)]
MLK-16725 imx8mq: clock: Set ARM core clock according to the CPU grade

According to the data sheet iMX8MXEC_Rev_E, the imx8mq has two CPU grades:
consumer and industrial, which has different maximum ARM CPU freq for nominal mode.

    consumer:    arm core clock @ 1Ghz
    industrial:  arm core clock @ 800Mhz.

So in u-boot we changed to check the CPU grade fuse and select the frequency for
ARM core clock.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16724 imx8mq: clock: Fix FRAC PLL caculation issue
Ye Li [Mon, 30 Oct 2017 02:53:21 +0000 (21:53 -0500)]
MLK-16724 imx8mq: clock: Fix FRAC PLL caculation issue

According to the FRAC PLL formula, DIVF_VAL = 1 + DIVFI + (DIVFF/224).
But in decode_frac_pll, the DIVFI and DIVFF are both added with 1. Fix it to
align with the formula.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoMLK-16723 imx8mq: Fix ARM clock print value
Ye Li [Mon, 30 Oct 2017 02:12:57 +0000 (21:12 -0500)]
MLK-16723 imx8mq: Fix ARM clock print value

Since imx8mq uses 25Mhz OSC as PLL's reference clock by default.
There is no 24Mhz used. So fix the ARM clock print value to 800Mhz and 1000Mhz.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
7 years agoRecover the leading underline of "androidboot.slot_suffix" cmdline
ji.luo [Thu, 19 Oct 2017 01:12:19 +0000 (09:12 +0800)]
Recover the leading underline of "androidboot.slot_suffix" cmdline

The androidboot.slot_suffix kernel cmdline will be used to constitute
the full name of some partitions(like vendor partition), removing the
leading underline will cause these partitions mount failed.

Bug: 65174205

Change-Id: Icda99b51af75633b62c1950e44b5c27f02370ea4
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years agoPass bootloader metrics to kernel by kernel cmdline
ji.luo [Tue, 10 Oct 2017 10:22:02 +0000 (18:22 +0800)]
Pass bootloader metrics to kernel by kernel cmdline

Pass bootloader metrics (nBLL, nBLE, KD, KL, AVB, ODT, SW)
to kernel by kernel cmdline.

Change-Id: Ibabff6844be86d028548d1ad697d948ef20590f3
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years agoRemove the leading underline in some slot suffix
ji.luo [Wed, 11 Oct 2017 13:40:06 +0000 (21:40 +0800)]
Remove the leading underline in some slot suffix

Change-Id: I17632f8d175177b5cb0a9165651fb3b732ae1145
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years agoRefine support for 'fastboot getvar all' command
ji.luo [Thu, 28 Sep 2017 10:54:27 +0000 (18:54 +0800)]
Refine support for 'fastboot getvar all' command

Make the device respond multiple packets after receiving fastboot
command "fastboot getvar all" from the host. It can make the
"fastboot getvar all" work both on Windows host and Linux host.

Change-Id: I428678369134b4228d7544fb3cbcb3469ffec6a1
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years agoEnable multiple packets sent on fastboot
ji.luo [Thu, 28 Sep 2017 10:49:47 +0000 (18:49 +0800)]
Enable multiple packets sent on fastboot

Change-Id: I2b8fd610258ffcf81fed25184e69a2d7f34c4b88
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years agoSupport 'fastboot flashing get-unlock-ability' command
ji.luo [Fri, 29 Sep 2017 06:36:17 +0000 (14:36 +0800)]
Support 'fastboot flashing get-unlock-ability' command

Change-Id: I7f3f8061da76a0a4957ff042058173b2a86da4ba
Signed-off-by: ji.luo <ji.luo@nxp.com>
7 years agoRemove leading zeroes of some getvar variables
ji.luo [Fri, 29 Sep 2017 05:15:50 +0000 (13:15 +0800)]
Remove leading zeroes of some getvar variables

Remove the leading zeroes of 'partition-size', 'max-download-size',
'erase-block-size' and 'logical-block-size' variables.

Change-Id: I981cfced2d82a43e87a8f244caf04c6920bff5b2
Signed-off-by: ji.luo <ji.luo@nxp.com>