Commit Graph

50082 Commits

Author SHA1 Message Date
Ye Li 9dada8a697 MLK-20784-2 imx8mm: Load fuse for TMU TCALIV and TASR
On iMX8MM, the default value of TMU registers TCALIV and TASR need
be loaded from fuse. HW won't do this, it expect SW loads them before
using TMU.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-01-21 19:36:21 -08:00
Ye Li 1a66350d1b MLK-20784-1 TMU: Add a interface for TMU arch level initialization
Since imx8mm TMU needs to load some registers from fuse, this is arch
dependent operation and may vary on different platforms. So add
a interface for arch level initialization.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-21 19:36:21 -08:00
Luo Ji a9bf75b337 MA-13969 Fix CAAM build warnings
Fix some warinings as "defined but not used [-Wunused-function]".
for CAAM.

Test: Build and boot on imx8qm_mek.

Change-Id: I632257615a237ca2de96937e121e7a4bcab415ce
Signed-off-by: Luo Ji <ji.luo@nxp.com>
2019-01-21 17:50:48 +08:00
Ye Li 71f5000023 MLK-20783 imx8mm: spl: Change VDD_SOC to typical value 0.85V
According to the latest datasheet, software is expected to program
the VDD_SOC voltage to the typical value 0.85V prior to the first
DRAM memory access. At default the VDD_SOC is 0.8V from PMIC BUCK1,
so we have to change it to 0.85V in SPL.

Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Anson Huang <Anson.Huang@nxp.com>
2019-01-21 00:41:40 -08:00
Ye Li adb2db588c MLK-20781-4 mx7ulp_evk: Enable new mipi panel RM68200_WXGA
Enable the new mipi panel driver and add parameters to board codes.
We enable the RM68200_WXGA as default panel, users can set "panel"
environment variable to switch to different panel.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
2019-01-21 00:41:40 -08:00
Ye Li fcd5fac9eb MLK-20781-3 mx7ulp: clock: adjust LCDIF pixclock algorithm
Since LCDIF does not have a dedicated PLL as its source, we have to
find a best frequency closed to the target frequency. The previous
method is finding a closed clock with actual frequency higher than target.
But this causes problem to DSI PHY clock which uses target frequency to
calculate its clock parameters.  When the actaul pixclock is higher,
it may violates the requirement between DSI PHY clock and LCDIF pixclock clock.
clk_byte_freq >= dpi_pclk_freq * DPI_pixel_size / ( 8 * (cfg_num_lanes + 1))

So we'd better selecting a LCDIF clock not exceed the target frequency.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-21 00:41:40 -08:00
Ye Li d84ddab71e MLK-20781-2 video: dsi_northwest: Change the DSI PHY clock settings
The previous driver uses a hard coded value which generates the DSI
PHY clock can fit HX8363 WVGA screen. But when switching to new WXGA
screen which needs higher pixclock and higher DSI PHY clock, the
hard coded parameters can't work.
Change to follow kernel codes to find the best value of CM, CN, CO
parameters for DSI PHY clock to meet pixclock requirement.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-21 00:41:40 -08:00
Ye Li 0d68c30cfa MLK-20781-1 video: Add new mipi DSI panel RM68200_WXGA driver
mx7ulp EVK B will use two mipi dsi panels, the new panel RM68200_WXGA
supports WXGA resolution.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-21 00:41:40 -08:00
Ji Luo a5ab0289c7 MA-13964 imx8q: Kick the CAAM JR before kicking the SMMU
Kick the CAAM JR3 before kicking the SMMU, so SMMU error
won't affect CAAM functions.

Test: build and boot on imx8qxp_mek.

Change-Id: Iaa9a6084f226f81a087aac1eced93e8785861113
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-01-18 18:30:29 +08:00
Flynn xu a6792ed6e5 MLK-20775: imx8qm/qxp: change xenlinux_addr to avoid memory conflict
When booting M4 with alt_config enabled, M4 will reserve 128MB for
video framebuffer from 0x88000000 to its partition, but Dom0 linux
loading address is 0x85000000, which will cause confict, so change
xenlinux_addr from 0x85000000 to 0x92000000.

Signed-off-by: Flynn xu <flynn.xu@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-01-18 20:01:43 -05:00
Ji Luo 1594150dba MA-13940 [Auto] imx8q: Enable dual bootloader
Open configs to enable dual bootloader feature for
imx8q Android Auto.

Test: Build and boot on imx8q.

Change-Id: I99da2ee6b87efd201e16df1046188ae86cab1466
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-01-18 12:07:21 +08:00
Ji Luo 71562aae3b MA-13938 [Android] imx8q: Support dual bootloader feature
Support dual bootloader feature for imx8q which uses the
container format. Move the A/B slot select and verify to
SPL stage, the bootloader rollback index will be stored
at the last 8K bytes of eMMC rpmb storage.

Test: Boot and rbindex verify pass on imx8q.

Change-Id: I0a48210f65984a083037a0cd3f9558951029ed7d
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-01-18 12:07:21 +08:00
Ji Luo 1614541095 MA-13937 Enable CAAM for imx8q
The CAAM driver in u-boot will use JR0 by default, but for
imx8q, both JR0 and JR1 are assigned to SECO and  A core
should never access them.
Power on the JR3 in this patchset and use it to complete
the CAAM operations for imx8q.

Test: CAAM self test cases pass for imx8q.

Change-Id: Ie3d77d1f2910e7f4c257c797c12b5c8a30ad936a
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-01-18 12:07:21 +08:00
Ji Luo 2a7d6b51d7 MA-13936 Add CAAM self test
Add CAAM RNG generating and BLOB encap/decap
self test cases.

Test: Test cases pass on imx8qm_mek/imx6qp_sabresd.

Change-Id: I538f7b1581b36df83a3006ac133ca9e7b57ab4f0
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-01-18 12:07:21 +08:00
Ye Li d520e1c606 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>
2019-01-16 22:32:42 -08:00
Ye Li edc9581d87 MLK-20664-4 mtd: mxc_nand: Enable flash BBT
Current MXC NAND driver uses memory BBT, it will create memory BBT in each
booting by searching bad blocks.

This patch enables the flash BBT, so the NAND driver can read back Bad block
table on the flash chip to create memory BBT.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2019-01-16 02:23:57 -08:00
Ye Li 48d58d07b9 MLK-20664-3 imx8m: Enable redundant offset for SPL NAND FIT
The new uuu will change to burn entire boot image to nandfit mtdpart not
only the FIT image. We enable REDUND offset configuration here, so that SPL will
try to find FIT header at two locations: the begin of nandfit mtdpart and
the 0x57c00 offset of nandfit mtdpart. This helps to be compatible with both
old and new uuu.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-16 02:17:43 -08:00
Ye Li ca7ebfcf07 MLK-20664-2 imx8/imx8m: Disable the SPL RAW image support
The RAW image support must be disabled, otherwise a RAW image can be used
to bypass FIT image.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-16 02:17:43 -08:00
Ye Li 4b2850ccfd MLK-20664-1 imx8qxp: spl: Enable SPL container support for NAND
Add the NAND support to SPL container parser and enable it for imx8qxp arm2
nand reworked board.
The SPL NAND will read from nandfit mtdpart (128MB offset) to parsing the entire
boot image and get the 3rd container from it. This requires burning tool (uuu)
to program the entire boot image into nandfit.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-16 02:17:43 -08:00
Ye Li cf2acc5b7c MLK-18942-2 imx8: ahab: Add ahab_status command
Add new u-boot command "ahab_status" to display seco events
and current lifecycle. It parses the seco event only for authenticating
container command, so that user can know the authentication failure.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2019-01-14 23:51:49 -08:00
Ye Li 30eb1b2443 MLK-18942-1 imx8: Update SCFW API to latest version
Update SCFW API from below SCFW commit which provides
the API to get seco events

    commit 50355d4b11b089be8fc1bc13afa7da001b081a44
    Author: Chuck Cannon <chuck.cannon@nxp.com>
    Date:   Mon Jan 14 12:30:42 2019 -0600

    SCF-275: Fix monitor error on command 'event'.

    Signed-off-by: Chuck Cannon <chuck.cannon@nxp.com>

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-14 21:32:25 -08:00
Ye Li 3f4b5b9cf4 MLK-20559-9 Android: imx8qm/qxp: Update android configurations
Due to some USB configurations are moved to header file to bypass
SPL build. Changes android and androidatuo defconfigs and header
files to avoid build break.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Ye Li 188aea7489 MLK-20559-8 imx8qm/qxp: Update MEK board codes to support UUU
Enable the SPL SDP driver and USB driver in MEK board codes and defconfigs.
Because the USB driver needs larger malloc pool, increase the malloc size
and disable simple malloc

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Ye Li 69dfae092f MLK-20559-7 tcpc: Bypass the vbus disable for SPL
The SPL won't use host mode, and the tcpc is default set as device mode.
So we don't need to access tcpc in SPL.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Ye Li cddb0fde37 MLK-20559-6 f_sdp: Support searching and loading FIT or container image
Add support to f_sdp to search and load iMX8 container image or iMX8M
FIT image by new UUU command SDPV.

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

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

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Ye Li 1f6b3efc62 MLK-20559-5 f_sdp: Add a callback to clean up USB driver
Because SDP directly jumps to next level boot image, we'd better
clean up the USB driver before it. Implement a weak callback function,
that spl sdp can use it to clean up USB driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Ye Li 6ca3fc0bbd MLK-20559-4 f_sdp: Fix wrong usb request size
Because the buffer length of sdp usb request is 65, we have to allocate
65 bytes not 64 bytes. Otherwise there is potential buffer overflow.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Ye Li 825c6f13b7 MLK-20559-3 f_sdp: Add high speed endpoint descriptor
Add HS endpoint descriptor for SDP. So that we can use high speed endpoint,
and the SDP device can send packet with 512 byte size.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Ye Li 18cbba9e33 MLK-20559-2 spl: Enable cdns3 USB driver for SPL building
The imx8qm/qxp uses cdns3 USB driver. To support SPL SDP, we have
to enable the driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Ye Li dba0d7c7dc MLK-20559-1 spl_sdp: Add CONFIG_SPL_SDP_USB_DEV for USB device
Add a new configuration CONFIG_SPL_SDP_USB_DEV to specify the
usb index for spl sdp driver, so that we change use different device.
The default value is 0.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:46:31 -08:00
Ye Li bb5ed5774d MLK-20666-2 DTS: imx8mq: Enable i2c force idle
Add i2c gpio pinctrl settings and properties to enable i2c force idle.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-01-08 21:45:35 -08:00
Ye Li 94b6e0f525 MLK-20666-1 DTS: imx8mm: Enable i2c force idle
Add i2c gpio pinctrl settings and properties to enable i2c force idle.
Avoid any i2c bus not released by device during reboot.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-08 21:45:18 -08:00
Ji Luo 0e202ab93e MA-13906 [Trusty] Support commands to set attestation materials
Keystore attestation requires provision keys and cerificate chains into
secure storage. Add commands to support rsa/ecdsa keys and certificate
chains provision, each key/certificate should be staged before provision.
Usage:
  Set rsa attestation key:
      fastboot stage <path-to-rsa-atte-key>
      fastboot oem set-rsa-atte-key
  Set ec attestation key:
      fastboot stage <path-to-ec-atte-key>
      fastboot oem set-ec-atte-key
  Append rsa attestation certs:
      fastboot stage <path-to-rsa-atte-cert>
      fastboot oem append-rsa-atte-cert
  Append ec attestation certs:
      fastboot stage <path-to-ec-atte-cert>
      fastboot oem append-ec-atte-cert

Test: Pass CTS cases:
      android.keystore.cts.KeyAttestationTest#testRsaAttestation
      android.keystore.cts.KeyAttestationTest#testEcAttestation

Change-Id: Ic3ed87e7e328a39b0f1bfb163356ea9e37d2f4fc
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-01-08 17:18:10 +08:00
Ji Luo e29e4022c5 MA-13904 [Trusty] Pass root trust to keymaster service
Pass the verified boot key hash to keymaster, it will be
treated as the root trust in keymaster service.
Also set the 'initialized' flag after initializing the
keymaster client or set keymaster boot parameters will fail.

Test: Pass CTS cases:
      android.keystore.cts.KeyAttestationTest#testRsaAttestation
      android.keystore.cts.KeyAttestationTest#testEcAttestation

Change-Id: I486b5493826160f42c61a3da0e6cd769df92254d
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-01-08 16:04:05 +08:00
Ye Li 4bddbabb10 MLK-19973 mx6ulz: Change to load uTee-6ulzevk for 6ULZ
When running on iMX6ULZ, need to set tee_file to uTee-6ulzevk not
uTee-6ullevk. Thus, add findtee script into env to set correct tee
file before booting.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-01-07 21:52:51 -08:00
yang.tian 3957eaafc0 MA-13879-2 Revert adding bootargs for multi-vendor of 8mm
Remove this patch to specify wifi vendor info from uboot,
instead we directly add the bootargs in cmdline.

Revert commit 9f1a11bdc3
MA-13879[wifi concurrency] Add bootargs to set a
property for wifi vendor of 8mm

Change-Id: Icf7e89df2b4993f6e17a6b7cf38b891591f680d7
Signed-off-by: yang.tian <yang.tian@nxp.com>
2019-01-07 16:22:53 +08:00
Ye Li 9e0a33cacc 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>
2019-01-03 19:31:05 -08:00
Seung-Woo Kim 615283d0eb MLK-20668-1 fs: fat: fix wrong casting to unsigned value of sect_to_cluster()
After the commit 265edc03d5 ("fs/fat: Clean up open-coded sector
<-> cluster conversions"), it is hung up writing new file to FAT16
disk with more than 19 files in armv7. It is because result value
of sect_to_cluster() is not proper by casting from signed value to
unsigned value. Fix the wrong casting of sect_to_cluster().

Reported-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
(cherry picked from commit 6e2151c729)
2019-01-03 19:30:52 -08:00
Ye Li 81385a5b07 MLK-20669 lpuart: Fix tstc issue in Non-DM driver
The tstc function in Non-DM driver does not check the LPUART_FLAG_REGMAP_32BIT_REG
flag, it always use 8 bits register version and cause issue in 8QM/QXP SPL.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2019-01-03 01:21:20 -08:00
yang.tian 9f1a11bdc3 MA-13879[wifi concurrency] Add bootargs to set a property for wifi vendor of 8mm
Since evk_8mm will support both QCA9377 and BCM43455 wifi,
add bootargs to pass a property to differ which wifi is used.

Change-Id: I83f7fd657dbdedc54931148cd6dd3d59563b6ec3
Signed-off-by: yang.tian <yang.tian@nxp.com>
2019-01-03 10:33:00 +08:00
Ye Li cedcc6634b MLK-20663 imx8: Fix malloc issue in container parser
The size used for malloc is wrong, the following read function will
read 1KB to the container header buffer not the size of the header.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2018-12-28 18:04:42 -08:00
Ye Li b9c0bf271d MLK-20660 imx8: Check the ROM pass over info only for RevA
Only the ROM on RevA will pass over some info into OCRAM. U-boot gets
the info to determine whether it is eMMC fastboot.
Thus, change that codes only for RevA, otherwise if we protect
the OCRAM used by SPL on RevB, u-boot will fail to access it.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2018-12-26 20:51:46 -08:00
Ye Li 145c359ca5 MLK-20655-2 imx8qm/qxp: Fix wrong gpio resource used in SPL
Since the gpio non-dm driver maps to wrong GPIO register, the SPL
also powers up wrong GPIO resources.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2018-12-26 01:25:41 -08:00
Ye Li 81154aed77 MLK-20655-1 mxc_gpio: Fix non-DM driver issue for iMX8 platforms
The port index is not calculated correctly. It should not be descreased,
because the gpio number is from 0 on imx8 platform.
Otherwise we will access wrong registers.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-12-26 01:25:41 -08:00
Ye Li 9e406ea46a MLK-20654 imx8: Recover SPL data section for partition reboot
When doing partition reboot, the boot image won't be reloaded by ROM,
it is just CPU reset to boot entry. The SW has to keep the boot image
inside the RAM unchanged. It includes both the TEXT section and DATA
section.

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

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

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2018-12-26 01:25:41 -08:00
faqiang.zhu 45e94c08e6 MA-13850-1 change the device tree and DDR related configuration
After two defconfig files are directly copied from 8mm_evk_android
for 8mm_evk_ddr4_android, this patch adapt the defconfig files.

Device tree used in defconfig files are modifed, a configuration
item of "CONFIG_TARGET_IMX8MM_EVK" is modified to be
"CONFIG_TARGET_IMX8MM_DDR4_EVK"

Change-Id: Ib48449d0c7abab45aff3a58a9c78c481290e7e6a
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-12-26 10:31:10 +08:00
faqiang.zhu 4e36b29d2c MA-13850 add two defconfig files for evk_imx8mm ddr4 version
Add two defconfig files for imx8mm ddr4 version.
These two defconfig files are:
imx8mm_ddr4_evk_android_defconfig
imx8mm_ddr4_evk_android_uuu_defconfig

They are respectively copy from the files below:
imx8mm_evk_android_defconfig
imx8mm_evk_android_uuu_defconfig

Change-Id: Ic2ab2b51328b23446e8f264eb27308d226b57295
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-12-26 10:29:48 +08:00
Ji Luo e05d44f550 MA-13832 [Trusty] Support random rpmb key set
Sometimes we need to set random rpmb key which is invisible
except for the device.
Generate the random key with hwcrypto interface and support
fastboot command "fastboot oem set-rpmb-random-key" to set it.

Test: build and boot on imx8q.

Change-Id: I44e1b6b091366d8ffceb1159fc65c17610ce5243
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-12-24 09:13:38 +08:00
Ji Luo 4668e8a45e MA-13831-3 [trusty] Add command to generate rng with CAAM
Add new hwcrypto command to support rng generation with CAAM.

Test: rng generated on imx8qxp_mek.

Change-Id: I756f3e99423f0f9dfc2bcd30117a3f96e9f5f2f7
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-12-24 09:13:37 +08:00
faqiang.zhu 78becc7f83 MA-13303 fix the issue with 8qm boot from eMMC to flash SD
For mek_8qm, bootloader offset in SD card is 32kb, in eMMC
bootpartition, it's 0kb. This patch fix the issue that bootloader offset
used in uboot is always based on the device that the board boot from.

Now, if uboot environment variable "target_ubootdev" is set, bootloader
offset used in uboot is based on the device "target_ubootdev" specified.
So boot from eMMC to flash SD, the board can boot from SD and vice versa.

Change-Id: Ia2cd64ba6ece02b98ea3d2addbce00b1661077de
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-12-21 20:12:49 +08:00