Commit Graph

36 Commits

Author SHA1 Message Date
Ji Luo 327cb93b3e MA-14147-1 Trusty: change the dram attribute to inner shareable
Trusty OS will check and require the memory passed from non-secure world
is inner shareable. Change the memory attribute as PTE_BLOCK_INNER_SHARE
in u-boot to meet the requirement.

Test: build and boot on imx8qm/imx8qxp.

Change-Id: I1aac9b430ecc0fa94f9a1f6dd519b34ce6fef7bd
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-03-05 16:27:21 +08:00
Ye Li 2519b6cd92 MLK-20971 imx8mq: Not disable DCSS for 8MQLite new part
The iMX8MQLite new part will not disable DCSS in fuse. So change
the codes to check the DCSS fuse before disable relevant FDT nodes
and u-boot HDMI splash screen.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 9e6ab0397b8d94de8b904250884726e58633066b)
2019-02-23 05:11:33 -08:00
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 b238046e0c MLK-20552 imx8mq: Disable sound-hdmi-arc FDT node for 8MQlite
Due to dcss is disabled on iMX8MQLite, the hdmi won't work, we have
to disable all hdmi relavent nodes. The sound-hdmi-arc is missed in
previous patch.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-12-12 18:28:53 -08:00
Peng Fan 781f2d8feb MLK-20479 imx8mq: clear ocotp error bit
In case ocotp error bit is set, clear it.
This is a workaround to ocotp error bit.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2018-11-28 13:39:58 +08:00
Ji Luo b57739cac7 [iot] Support fastboot variable 'at-vboot-state'
Add support for fastboot variable 'at-vboot-state', it's composed
by 6 sub-variable: 'bootloader-locked', 'bootloader-min-versions',
'avb-perm-attr-set', 'avb-locked', 'avb-unlock-disabled' and
'avb-min-versions'.

Test: All 'at-vboot-state' variables are returned
      correctly on imx7d_pico and AIY.

Change-Id: Ibb855cbcc7c41657af62dafb98a96c4dfb96ef22
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-11-12 09:18:37 +08:00
Ye Li 2790e221b6 MLK-20051-1 imx8m: Fix MMU table issue for OPTEE memory
When running with OPTEE, the MMU table in u-boot does not remove the OPTEE
memory from its settings. So ARM speculative prefetch in u-boot may access
that OPTEE memory. Due to trust zone is enabled by OPTEE and that memory
is set to secure access, then the speculative prefetch will fail and cause
various memory issue in u-boot.
The fail address register and int_status register in trustzone has logged
that speculative access from u-boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-11-02 20:50:10 -05:00
Li Jun 27d6b4cf3d MLK-19995 imx8mq: disconnect usb from host for uuu
Stop the usb device controller before enter kernel, this is required
to make kernel can properly init usb controller with it's in stopped
state.

Suggested-by: Ye.Li <ye.li@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
2018-10-23 13:22:40 +08:00
Ye Li 4a732af597 MLK-19960-3 imx8mm: power down core 1/2/3 for variant parts
Power down the A53 cores for dual core and single core iMX8MM parts
to save power.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2018-10-17 19:32:47 -07:00
Ye Li 1d72b97d94 MLK-19960-2 imx8mm: Update kernel DTB for variant parts
According the part type, delete A53 cores' nodes and disable VPU
decoder/encoder nodes from kernel DTB.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-10-17 01:58:31 -07:00
Ye Li 264f90d763 MLK-19960-1 imx8mm: Add support for variant parts
iMX8MM family has several variant parts below.
Add CPU type and relevant updates

i.MX 8M Mini Quad		Full featured, 4x A53
i.MX 8M Mini QuadLite		No VPU, 4x A53
i.MX 8M Mini Dual		Full featured, 2x A53
i.MX 8M Mini DualLite		No VPU, 2x A53
i.MX 8M Mini Solo		Full featured, 1x A53
i.MX 8M Mini SoloLite		No VPU, 1x A53

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-10-17 01:57:42 -07:00
Zhang Bo 1a34c017d7 MA-12536-1[Android] Enable RTC for imx8m in uboot
Enable RTC in bootloader to avoid rtc time less than jiffies time
when linux first bootup after RTC lose power.
It will cause the issue as
MA-9554[Android_6DL_SD]RTC: Sometimes the RTC reset to the initial
time 1970 after softare reboot the first time. 40%

Change-Id: I048a148003241f73345aeb8ff0fda8fc328c0efb
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
2018-09-26 15:20:50 +08:00
Ye Li 0fc24973f5 MLK-19526-5 imx8mq: Power down core 2/3 for iMX8MD
CPU 2/3 are fused on iMX8MD, power down the two cores in SPL to
save power.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2018-09-11 21:55:57 -07:00
Ye Li 79e8d0441d MLK-19526-2 imx8mq: Update kernel DTB for iMX8MD and iMX8MQLite
Since VPU/DCSS/HDMI are disabled on iMX8QLite, the CPU core 2/3 are disabled
on iMX8MD, we have to update kernel DTB to disable relevant nodes. The MIPI-DSI
can input from DCSS or LCDIF, so we need to check the input in DTB and only

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-09-11 21:55:32 -07:00
Ye Li 58b77b5413 MLK-19526-1 imx8mq: Add CPU ID for iMX8MD and iMX8MQLite
iMX8MQ has two variant versions: iMX8MD and iMX8MQLite. Add dummy CPU ID
for these two, and check the fuses to get correct versions.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-09-11 03:28:39 -07:00
Ye Li 0377dc881a MLK-19465 imx8mq: Fix cpu rev issue on B0.1 chip
We read the ROM version to determine the CPU revision before B1 chip.
The rom version is 4 bytes word, it has major version at low byte,
minor version at second byte.

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

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

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 8d0812e63155cca91ecb78c630a450e7d5e5fd00)
2018-09-05 23:58:39 -07:00
Ye Li 11a44009a6 MLK-19433-2 imx8mq: Get chip rev for B1 revision
The mscale B1 uses OCOTP_HW_OCOTP_READ_FUSE_DATA register for chip id.
It returns a magic number 0xff0055aa.
Update get_cpu_rev to support this way, also enable OCOTP clock to allow
access OCOTP register.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 866631c2140b9352c6f74ec36d1a51fea40c0445)
2018-09-04 01:57:19 -07:00
Ye Li ebdf2c75f3 MLK-19263-1 imx8m: Configure trustzone region 0 for non-secure access
Set trustzone region 0 to allow both non-secure and secure access when trust zone is enabled.
We found USB controller fails to access DDR if the default region 0 is secure access
only.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-08-21 01:51:39 -07:00
Silvano di Ninno 76c9db3ccc MLK-18502: board:imx8mm_evk enable tzasc
Enable TZASC on i.MX 8mm.
There is a need on 8MM to enable
the BYPASS ID SWAP bit (GPR10 bit 1) in order
for GPU not to generated AXI bus errors.

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2018-08-16 08:48:47 +02:00
Li Jun 3a1e7c188d MLK-19181-6 arm: imx8m: Fix compile warning
In file included from arch/arm/mach-imx/imx8m/soc.c:11:0:
arch/arm/mach-imx/imx8m/soc.c: In function ‘imx_gpc_set_m_core_pgc’:
./arch/arm/include/asm/io.h:44:28: warning: cast to pointer from integer of differen                                                                                                                                                         t size [-Wint-to-pointer-cast]
 #define __arch_getl(a)   (*(volatile unsigned int *)(a))
                            ^
./arch/arm/include/asm/io.h:122:31: note: in expansion of macro ‘__arch_getl’
 #define readl(c) ({ u32 __v = __arch_getl(c); __iormb(); __v; })
                               ^~~~~~~~~~~
arch/arm/mach-imx/imx8m/soc.c:427:8: note: in expansion of macro ‘readl’
  val = readl(GPC_BASE_ADDR + offset);
        ^~~~~
./arch/arm/include/asm/io.h:49:29: warning: cast to pointer from integer of differen                                                                                                                                                         t size [-Wint-to-pointer-cast]
 #define __arch_putl(v,a)  (*(volatile unsigned int *)(a) = (v))
                             ^
./arch/arm/include/asm/io.h:117:48: note: in expansion of macro ‘__arch_putl’
 #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; })
                                                ^~~~~~~~~~~
arch/arm/mach-imx/imx8m/soc.c:432:2: note: in expansion of macro ‘writel’
  writel(val, GPC_BASE_ADDR + offset);
  ^~~~~~
arch/arm/mach-imx/imx8m/soc.c: In function ‘imx8m_usb_power’:
arch/arm/mach-imx/imx8m/soc.c:453:16: warning: unused variable ‘ret’ [-Wunused-varia                                                                                                                                                         ble]
  unsigned long ret;
                ^~~

Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-11 13:16:18 +08:00
Frank Li 7c3d2a17bf MLK-19181-2: i.MX850: SPL enable usb support
Enable DWC3 USB support at i.MX850D platform

Signed-off-by: Frank Li <Frank.Li@nxp.com>
2018-08-10 12:10:31 -05:00
Aymen Sghaier 996329904c MLK-18703: crypto: caam: Add TRNG init function call
Call the TRNG init function at the end of arch_cpu_init()
 Concerned SoCs are: i.MX6, i.MX7 and i.MX8M

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
2018-07-17 15:09:23 +02:00
Ye Li 2c840c82b3 MLK-18591-3 android: Add FSL android fastboot support
Porting the FSL android fastboot features from imx u-boot v2017.03 to
support all SoCs: imx6/imx7/imx7ulp/imx8/imx8m

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-06-13 03:06:25 -07:00
Silvano di Ninno 95e018dc7e MLK-18344: add OP-TEE support for i.Mx 8MM
like for i.MX 8mq ATF passes as argument to u-boot
the start and the length of the BL32 firmware.
u-boot uses this information to adjust the size of the DDR for linux.

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit e9ec5ea8dbe3d12b40ba22fe36400cfe98e1bd44)
2018-05-23 04:15:59 -07:00
Ye Li 05c72a41bb MLK-18290-3 imx8mm: Add SOC level support for OTG USB
Enable the OTG power on, add clock fuction and USB base address.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit d4f12cd92b18283daca35b35339a96c557f5127c)
2018-05-23 04:15:55 -07:00
Ye Li dcc51cc1fe MLK-18243-11 arm: imx8m: get cpu chip id for i.MX8MM
Using the cpu chip id in DIGPROG registers 0x824110

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 330051b4fbcdda201b67a94e72345ec47bd85a96)
2018-05-23 04:15:50 -07:00
Peng Fan f5cfd600cf MLK-18243-10 arm: imx8m: soc: enable SCTR clock before timer init
To i.MX8MM SCTR clock is disabled by ROM, so before timer init
need to enable it.
To i.MX8MQ, it does not hurt the clock is enabled again.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 2347541e9e79f833716fe88f7de860b5704b5e48)
2018-05-23 04:15:50 -07:00
Peng Fan 5ed2a6a4ac MLK-18243-7 arm: imx8m: refine the MMU table to cover larger DRAM space
i.MX8MM supports larger DRAM space beyond 4GB compared with i.MX8MQ.
The changes does not hurt i.MX8MQ, so let's share the same value.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit b1f5c76afc593952fbeba1bf299207d3178f6dc4)
2018-05-23 04:15:50 -07:00
Peng Fan 4341d35cc9 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>
2018-04-27 06:14:52 -07:00
Ye Li 330a3108e3 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>
(cherry picked from commit a0cba5678b10827bc4b5e4fb2e40945a5c332baa)
2018-04-27 02:32:17 -07:00
Ye Li 20e8f5ab5e 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>
2018-04-27 02:32:14 -07:00
Peng Fan 3a17aa1659 MLK-17050 imx8m: print out atf commit
Print out atf commit in U-Boot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit df89948806c38e38119767a67ef0e18f24ac886b)
2018-04-27 02:32:14 -07:00
Ye Li 6134c7ee39 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>
(cherry picked from commit e31f99c05c37ac35080e415cfd8c8e2a1c96f865)
2018-04-27 02:32:13 -07:00
Ye Li 89512c1b28 MLK-16246 imx8mq_evk: Update DTB to disable DCSS and HDMI for mfgtool
When booting for mfgtool, we need to disable DCSS and HDMI since the HDMI
firmware won't be loaded by mfgtool. Add the detect in u-boot and update the
DTB.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 1d01cec0296d56ba8436941864d8da81013e0732)
2018-04-27 02:32:13 -07:00
Ye Li c3f3c80e9f MLK-18159-4 imx8m: refine mmu table
Refine mmu table. Map TCML/TCMU as non-cachable.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:31:00 -07:00
Ye Li c76cd4e58d MLK-18159-1 imx8m: Change name from mx8m to imx8m
The formal production name starts with imx, so change relevant names
in codes to use this prefix.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:30:58 -07:00