Commit Graph

47 Commits

Author SHA1 Message Date
Andrejs Cainikovs 4ea2816a36 imx8: suppress compiler warnings 2019-08-28 13:58:37 +02:00
Zhang Bo 57fa56f3ce MA-14501[Android] change BOOTAUX_RESERVED_MEM macro to defconfig
As the M4 use different DDR memory size in normal android/car2 and car
image, use different defconfig for car2 to decrease DDR memory
reservation. So memory reserved for each M4 core is 8MB in car2 and
normal android image. it's 32MB for car image.

Change-Id: Idf608f539cd614a154c78e3a1af28eff1da5c1f2
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
2019-04-02 18:48:27 +08:00
Leonard Crestez 4dc141f821 MLK-20958-2 imx8: Replace SC_R_LAST with SC_R_NONE in DTB
We are currently using SC_R_LAST as a marker for imx8 power domain tree
nodes without a resource attached. This value is compiled into dtb as
part of the linux build and used by uboot.

The SC_R_LAST constant changes frequently as SCFW resources are added
(by design) and every time we need to update linux and uboot headers
together or boot can fail.

Fix this by replacing SC_R_LAST usage with a new constant SC_R_NONE
defined to be 0xFFF0.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 93f302a6642adedfdd6336b22d08f32284539e35)
2019-03-11 13:41:58 +02:00
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
Ji Luo 91a544df4c MA-14239 Check return values for SCFW APIs
Check the return values for SCFW APIs and print error logs
if the return value is not "SC_ERR_NONE".

Test: boot on imx8qm.

Change-Id: Ic7008bd2656375875e77dd3c922dafb1be145357
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-03-04 15:56:23 +08:00
Peng Fan 61363f12ef MLK-20976-2 imx8: cpu: check resource before set sid
If resource is not owned, we ignore sid settings.
When support CM41 + android auto on xen, some resources
are owned by CM41, when CM41 releases those resources,
CM41 will program SID for those resources.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
(cherry picked from commit cd0ec61b235929d75965c43e82127b73e73e1697)
2019-02-26 10:51:07 +08:00
Ye Li 1fb976e838 MLK-20980 imx8qm/qxp_mek: Set kernel fdt according to M4 boot
When M4 is booted by ROM, we have to enable RPMSG in kernel, so need
to select the -rpmsg.dtb. If M4 is not enabled, use default kernel dtb.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 8a57be45e18295ce1b19799723775cf5b205281d)
2019-02-25 01:52:56 -08:00
Ye Li 94c631a9c8 MLK-20978 imx8: Fix uninitialized variable in kernel DTB updating
When using fdt_next_node, the depth variable needs being initialized
first, otherwise we many get undefined depth.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 1ae3d2d3859c5f2610c74cd192da2657e2600aff)
2019-02-25 01:52:48 -08:00
Ye Li 894d376542 MLK-20945-5 imx8: Select boot device dynamically
For fspi build, we will enable both SPL NOR support and SPL SPI
support. SPL will dynamically check the resource owner then
select corresponding boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 675cc6031033fbe5e7d8cfe01ebe1dedfd6c1b96)
2019-02-19 00:46:37 -08:00
Ye Li c882f43aef MLK-20886-6 imx8qm/qxp: Implement runtime i2c driver binding
When a i2c device is binding with drivers, we check whether current
partition ownes the resource. If not owned, the binding to local lpi2c
driver will fail, otherwise binding to virtual i2c driver will fail.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 81dd157fd0ba476c994e95a63515cb65164f1e87)
2019-02-12 06:56:31 -08:00
Ye Li caada879d1 MLK-20886-5 imx8qm/qxp: Implement VService function and buffer pagetable
Override the board_imx_vservice_find_mu for finding MU device for
virtual devices. The matching logic is if the M4_0 partition ownes
the resource of the device, we select MU8 for this Vservice channel.
Otherwise, if the M4_1 partition ownes the resource, we select MU9.

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

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

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 4358b4cdfc4752822066d480dd1c10086c211be7)
2019-02-12 06:56:31 -08:00
Ye Li 33a2b5d57a MLK-20884-2 imx8qm/qxp: Use new SCFW APIs for SECO
Since misc_seco APIs are deprecated in SCFW, need switch to new
APIs.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2019-01-30 18:28:56 -08:00
Ye Li da636e4b8e MLK-20794-1 imx8: Change kernel FDT updating for fused parts
Before booting kernel, we check all nodes in kernel FDT whether they
are owned in our partition. If it is not owned, we will disable it in FDT.

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

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

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-24 18:38:07 -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
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
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 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
Ye Li 484104758d MLK-20528-2 imx8: Enable clocks LPCG
To support partition reboot, the u-boot has to enable clocks by LPCG.
The LPCG will reset to default value only when the subsystem is totally
power off and reset. However, the resources in one subsystem may belong
to different partitions, so the partition reboot may not reboot the entire
subsystem.
Powers, clocks/lpcg, GPR, IP may not reset depends on various cases and
HW design. Thus, AP software has to ensure everything is reset by SW
itself to support such above cases.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-12-11 21:49:23 -08:00
Silvano di Ninno 441c23698f TEE-329-2: OP-TEE: Allow u-boot to add optee node in dtb
If OP-TEE is loaded by ATF, u-boot will add
optee device tree node in th edtb so that
Linux can loads OP-TEE driver.

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
2018-11-22 14:07:20 +01:00
Peng Fan c96a9844cd MLK-20373-4 imx8: update mem map table
Update mem map table for xen uboot.
xen console and some magic pages needs to be mappe as normal memory.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Flynn xu <flynn.xu@nxp.com>
2018-11-15 16:36:44 +08:00
zhang sanshan 23487f8f3e MA-12847 [Android] skip checking the resource on android auto
camera sometime can't been open once run M4 image.
ISI-CH0 probe funtion is not called when meet issue.

The root cause is:
M4 image set assign resource SC_R_ISI_CH0 into m4 partition
when open camera in m4 side.
Uboot will call update_fdt_with_owned_resources to check the pd
in current dts node. it will call sc_rm_is_resource_owned to
check the pd whether in other partition, If yes, it will delete
the dts node. uboot delete isi_0 node whose pd is SC_R_ISI_CH0.

Change-Id: I4e2afbed2c55caad0a9f804fa8d85511c3bfea38
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
2018-09-21 17:00:39 +08:00
Peng Fan 884cada50b MLK-19552 imx8qm: xen: fix memory map
Fixes 9486251ced24("MLK-19494 configs: imx8qm mek android audo: correct xen physical memory")

correct text base, IPC address, memmap.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2018-09-12 15:34:49 +08:00
Ye Li 13fccde4c6 MLK-19546 imx8qm/qxp: Fix issue in get_effective_memsize
When Trusty OS allocates the mem region from 0xfe0000000-0xffffffff, the get_effective_memsize
does not return correct memory size. There is a check in get_effective_memsize to find the memreg
where the u-boot is running, and return the size of that memreg as the result of get_effective_memsize.
When using aligned start, the value is 0x80200000 since it is 2MB aligned. Thus the finding of memreg
will fail and return the PHYS_SDRAM_1_SIZE because u-boot text base is 0x80020000.
This cause u-boot relocating to the high memory where has been occupied by Trusty OS.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2018-09-11 21:56:56 -07:00
Han Xu e7cbfb4f2d MLK-19197: qxp: configs: enable fastboot for i.MX8QX MEK FlexSPI u-boot
enable fastboot for i.MX8QX MEK FlexSPI u-boot

Signed-off-by: Han Xu <han.xu@nxp.com>
2018-08-10 15:47:39 -05:00
Luo Ji 2a5e3a2d1f MA-12198 Fix build errors for imx8qm/imx8qxp
The API to get the value of environment variable is not
correct, use correct API. This fix the build errors like
below:
    arch/arm/mach-imx/built-in.o: In function `mmc_get_env_dev':
    uboot-imx/arch/arm/mach-imx/imx8/cpu.c:840:
    undefined reference to `get_env_ulong

Test: Build pass for imx8qm/imx8qxp.

Change-Id: I4fa65d1cd808ec6a737c419b278fce9cce2b1e7b
Signed-off-by: Luo Ji <ji.luo@nxp.com>
2018-07-15 15:37:07 +08:00
Frank Li 5423ef4784 MLK-18406 fastboot support all partition
uuu can write to any position of mmc
sdps: boot -f ../mkimage_imx8dv/imx-mkimage/iMX8QX/flash.bin

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

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

Conflicts:
	arch/arm/cpu/armv8/imx8/cpu.c
	drivers/usb/gadget/f_fastboot.c
	include/configs/imx8qxp_mek.h
2018-07-13 14:17:51 -05:00
Peng Fan c2ba2460d8 MLK-18577-5 imx8: update soc code to support uboot in XEN VM
Update SOC code to support U-Boot in a XEN VM. Currently
we only support to boot android using uboot in a VM,
so there is hardcode that using MMC1_BOOT boot.

There are a few small fixes included.

For the mmu configuration, the mem map is used from xen
guest VM and our iomem space in vm cfg file.

The VM use a different MU, so use a wrap for SC_IPC_CH.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 533087bc1bce0c35fead0956b0613971862c280f)
2018-06-13 22:03:30 -07:00
Ye Li 37efd38e53 MLK-18393 imx8: Check the eDMA channels and update DTB
Since M4 will arrange some eDMA channels to its partition, the A core
can't use them. We have to remove these eDMA channels from DTB dynamically.

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

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

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by : Robin Gong <yibin.gong@nxp.com>
2018-06-13 18:56:11 -07: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
Ye Li 55dd2c8e17 MLK-18316 imx8: Fix USBOTG disconnect when XRDC blocking is enabled
We clean USBOTG register USBCMD if it is used in serial download mode.
When XRDC blocking is enabled, we can't write this register directly,
must enable the OTG power, otherwise the kernel will get SError
exception in mfgtool.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit cf2143dc97b2a8f21b828c7386c59ee965d981f2)
2018-05-23 04:15:57 -07:00
Ye Li 6f0010c581 MLK-18226 imx8: Fix build warning when CONFIG_ARCH_MISC_INIT is not set
When CONFIG_ARCH_MISC_INIT is disabled, the static function
acquire_buildinfo is defined but not used. Fix this build warning.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit cc9e00c090b9e99fe5793381b5798f75e745eefd)
2018-05-23 04:15:47 -07:00
Ye Li b0f2c69d6f MLK-18070-2 imx8: Print out SECO FW commit
SCFW has provided the sc_misc_seco_build_info to get seco FW commit,
so use it in u-boot to print out the commit.
For A0 chip and unsupported SCFW build, the SECO commit is always 0.

 BuildInfo:
  - SCFW 433c7fb7, SECO-FW 041c9f92, IMX-MKIMAGE 8b15026b, ATF 5e238f9
  - U-Boot 2017.03-00899-gdbd3637-dirty

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit a67dab1d01e81b226e14a65b595ba00e12c1f176)
2018-04-27 06:14:51 -07:00
Ye Li 3ab7cc2650 MLK-18161-12 imx8qm/imx8qxp - Power down devices enabled by uboot before launching the kernel
Make sure that all devices that are powered up by uboot
are powered down before bringing up kernel.
Else the subsystem/device will never be powered down by SCFW even though
from the kernel's point of view it should be powered down.

Benefiting from power domain driver, We have implemented the function "power_off_pd_devices"
to power off all active devices. No need to explicitly power off them in board_quiesce_devices.

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 06:14:43 -07:00
Ye Li 3a4f3e4328 MLK-18161-1 imx8qm/qxp: Print the CPU temperature
Using SC thermal sensor to get temperature and print the CPU
temperature at booting.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:34 -07:00
Ye Li 11dddc05ba MLK-15324-3 imx8: Add LVDS and DC setup common functions
Add common functions for LVDS/DC setup, video framebuffer init/disable,
LVDS to HDMI card settings, etc. Refactor it from video_imxdpuv1.c.
1. Add power, clocks, PLL relevant setup for LVDS and DC.
2. Configure the LVDS and its PHY settings for the display format and pixel link.
3. Setup the LVDS to HDMI card.
4. Implement the video_hw_init by calling DC driver API to output data to
   specified display panel.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 9317f7ea4d976335a633f7056bbac1f77b01247a)
2018-04-27 02:32:33 -07:00
Ye Li 5b443e3e26 MLK-16441 imx8qm/qxp: print commit hash for SCFW, IMX-MKIMAGE and ATF
Since we have many software running on QM/QXP, it is better to print their
commit ids in u-boot to know their versions.

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

Once the commit ids are acquired, show them in console like:
    BuildInfo:
      - SCFW f0cb8b8e, IMX-MKIMAGE cc994971, ATF 0
      - U-Boot 2017.03-00031-g0596078-dirty

and set them to environment variables like:
    commit_atf=0a9efa7
    commit_mkimage=cc994971
    commit_scfw=45c567e8

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

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:24 -07:00
Ye Li 86b6e2b08c MLK-16361-1 imx8qm/qxp: Send boot status to SCFW if booted by SC ROM
We met u-boot hang when booting from eMMC fastboot on QM/QXP boards.
The hang happens on u-boot accessing USB2 PHY for checking USB boot.
The root cause is when putting AP image (u-boot-atf.bin) in first container,
the USB2 PHY reset bit won’t be set in CONN SS by SCFW, because this SS has been
powered on by SC ROM.

In normal boot case, we won't meet such issue. Because we put u-boot-atf.bin in second
container and AP ROM will boot up for loading this binary. When AP ROM completes the
loading, it calls “misc_boot_status” API to power off the boot device and also power
off the CONN SS. Then when u-boot enables any the module in CONN, the CONN SS will power
on again by SCFW and set the USB2 PHY reset bit.

Since the clock settings are different in SC ROM and SCFW, so it is suggested to power off
CONN SS when booting is completed. In this patch, we check the g_ap_mu field in pass over
structure which is used to pass into from SC ROM to AP ROM. This field is set only when AP
image is included in the second container. If this field is not set, we suppose the booting
only uses SC ROM, then u-boot calls "misc_boot_status" at early stage to power off
boot device.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 67bb87f16e3742d6fab0b7837ffdb8bbed1245d1)
2018-04-27 02:32:24 -07:00
Ye Li 05df95241d MLK-16560-4: imx8: Remove hardcoded sids for sdhc/fec
This is better done through dts.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2018-04-27 02:32:24 -07:00
Ye Li c6b64c4e29 MLK-16560-3: imx8: config_smmu_fdt: Support mmu-masters binding
This is deprecated in favor of the generic iommus binding but xen only
supports this older version.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2018-04-27 02:32:23 -07:00
Ye Li 75cdc9b6a4 MLK-16560-2: imx8: Use fsl,sc_rsrc_id binding to map device to rsrc
Using the SMMU for some devices (like dpu) requires a streamid to be
assigned to multiple resources.

Determining the resource ids for a device is a problem that occurs in
multiple contexts. So far uboot deals with this by parsing the
power-domain node which is insufficient here.

Add a new devicetree property called fsl,sc_rsrc_id which lists the
resource ids associated by a certain device.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2018-04-27 02:32:23 -07:00
Ye Li 3caa05e6dc MLK-16560-1: imx8: Configure sids based on iommu properties in dtb
Use streamids specified in dtb because they need to match anyway. This
removes the need to rebuild uboot for stream id assignments.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2018-04-27 02:32:22 -07:00
Ye Li 358372674b MLK-16087 imx8qm/qxp: Disable kernel FDT nodes for the resources are not owned
Before starting the kernel, need to check if the enabled nodes (resources) in FDT
are owned by current partition.  If it is not owned, need to disable it because A core
can't access it.
We use the node's power-domain property to get the PD node which has the SCFW resource
id in its reg property. Then we can check it with SCFW.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:22 -07:00
Ye Li d69861e390 MLK-16083 imx8qm/qxp: Setup MMU pagetables dynamically with owned memory regions
Since the memory regions assigned to u-boot partition is dynamically set by
ATF and SCD. We have to setup MMU pagetables according to the owned memory
regions, not set it for unassigned memory.

Additional, the memory region 0x0-0x1c000000 is for LSIO subsystem, including OCRAM,
AP ROM, flexspi0 mapped memory and flexspi1 buffer. If we set it to cachable,
the AHB read in flexspi driver will have coherence problem. So we set this memory
region to strongly order to avoid any issue in driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:22 -07:00
Ye Li efdb33975f MLK-16049 imx8qm/qxp: Add support for reserving DDR memory for M4
We assign the DDR memory from 0x88000000 to 0x8FFFFFFF to M4 on QM and QXP.
The M4 can allocate this memory by two ways, in SCD or u-boot.

There are 3 things needed to change in u-boot:
1. Move the u-boot INIT SP address to first 128M memory to avoid conflict with M4 memory.

2. The memory regions may be allocated in SCD or ATF. So we can't staticly set the memory
   bank information in u-boot, need to get it from owned memory regions.

3. u-boot addes the memory reserve node to DTB to pass the info to kernel, no matter
   the M4 memory is reserved in SCD or u-boot. So kernel won't access M4 reserved memory.

The codes for M4 resources and memory regions allocated by u-boot will be added
later when they are finalized.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:22 -07:00
Ye Li 778606204b MLK-14938-9 imx8: bootaux: Add i.MX8 M4 boot support
1. Implement bootaux for the M4 boot on i.MX8QM and QXP. Users need to download
   M4 image to any DDR address first. Then use the
   "bootaux <M4 download DDR address> [M4 core id]" to boot CM4_0
   or CM4_1, the default core id is 0 for CM4_0.

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

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

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:21 -07:00
Ye Li 45308e7da9 MLK-14938-8 imx8: Add SMMU setup to Soc codes
We setup SMMU in arch_preboot_os to avoid breaking u-boot driver.
Add a kconfig entry CONFIG_IMX_SMMU to enable it.
So far, the USDHC0-USDHC1 and FEC0-FEC1 are added into sid.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 7da6345919ee59a26cf65b4bc29072eea2fc0909)
2018-04-27 02:32:21 -07:00
Ye Li 3cfed63d0a MLK-14938-5 imx8: Add SoC level support
Add cpu, power, and clocks functions for support i.MX8QM and i.MX8QXP SoCs.

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:20 -07:00