Commit Graph

50078 Commits

Author SHA1 Message Date
Ye Li 5bc91d52ba MLK-20952 imx8mm: clock: Fix DRAM PLL settings issue
According to iMX8MM DRAM PLL spec, the Fvco range is from 1600Mhz to 3200Mhz,
and (Fin / P) range is from 6Mhz to 25Mhz. However, our current PLL settings
violates the spec.
This patch changes the dividers to meet the spec requirement.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit 3b303840f625121c08898f4c43cf29cf2a2d0170)
2019-02-20 00:24:36 -08:00
Ye Li 88a27bb2d4 MLK-20945-7 imx8qm/qxp: Update MEK SPL configurations
Update MEK SPL configs to enable SPL NOR support and change ENV to
SD as default.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit f21f2571befdad09b9c9df4fe1fc8e27cf315019)
2019-02-19 00:46:37 -08:00
Ye Li b414527f79 MLK-20945-6 spl: Fix DM_SPI_FLASH build error in SPL
SPL should not use DM_SPI_FLASH, this is already cleaned in
Makefile.uncmd_spl, but not in config_uncmd_spl.h

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit cf8468482ec3cceb05700a326df044dc41f38793)
2019-02-19 00:46:37 -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 cad69cc0f5 MLK-20945-4 imx8: Update container parser for RAW NOR SPL
Since FSPI is assigned to M4 partition, A core only can read it from its
memory-map address. So we have to enable SPL NOR which won't access
flexspi driver.

Update SPL container parser for the RAW NOR support.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 7ea7a16fd892558098fb8cbea134ac275d1220d3)
2019-02-19 00:46:36 -08:00
Ye Li 10f2ac28f3 MLK-20945-3 imx_virt_i2c: Add DM_FLAG_IGNORE_POWER_ON flag
When we probe device with virtual i2c driver, it will definitely
fail to power up the PD. Becasue the resource is owned by M4. So
set this driver to ignore the power up result

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 7f753d1b5950015b11be58aa937e5c14b9f26d7a)
2019-02-19 00:46:36 -08:00
Ye Li 363214f9f6 MLK-20945-2 dm: device: Check the power up result in probe
If a device has relevant power domain, we will check the power up
result in probing the device. If the power up is failed, the device_probe
will return failure immediately.

The only exception is the new FLAG (DM_FLAG_IGNORE_POWER_ON) is set by driver
to indicate ignore the power up result.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 8524ca764d8fbd05da1593abfed62bb075c50cd4)
2019-02-19 00:46:36 -08:00
Ye Li 5b45c754fd MLK-20945-1 imx8-power-domain: Check owned resource in power on
When fspi is assigned to M4, we have to let the fspi probe failed when
its power domain is failed to power up. Because not all devices have power
domain (for example, external devices on the board). Current checking
resource owner in power domain probe is not good, change to check it in
power on.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit b62b82ad595a744f07306db4b88d644ae024872a)
2019-02-19 00:46:32 -08:00
Ye Li db81911299 MLK-20939 imx_virt_i2c: Add a STOP flag for last message
Add a new private flag I2C_M_SRTM_STOP(0x0200) to indicate if STOP
is needed for current message.
When reading/writing registers for slave devices, generally we have two messages,
the first message writes the register address, second message reads/writes the value.
Only the last message needs STOP. But previously M4 sends STOP for each message,
this causes some slave devices treat it as end of transfer. Then, second message won't
have any effect. To solve the problem, we introduce this private STOP flag, so M4 can
STOP according to the flag.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit e8f70409620da897917dfa29dbe65be82c9129fd)
2019-02-17 23:31:31 -08:00
Ye Li d812591ace MLK-20938 imx8: Change signed os container loading address
Current signed OS container loading address is 0x88000000. It conflicts
with DDR memory reserved for M4. If we build image with ALT_CONFIG enabled.
SCFW will assign that memory to M4. Then authentication to kernel image
will have problem. So modify to new address 0x98000000 which is safe.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 545b972a59c86e2b45b40e53a8e6c13f79e3e265)
2019-02-17 21:25:16 -08:00
Ye Li c6f1a81008 MLK-20933 imx8: ahab: Check image address before using it
Check the OS container image address is belonged to valiad DRAM memory
before accessing it to avoid u-boot crash on invalid address.

Also refine the error print.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit f40dc07b3df9ad71ea501c77a19924361b133de7)
2019-02-17 21:25:15 -08:00
Oliver Brown 58a48836d8 MLK-17405 iMX8QM: Change HDMI TX clocks.
The HDMI digital PLL, bus clock and core clock need to change to match the
settings used by the Linux driver. This allows the SECO to start and
initialize the HDMI/DP firmware.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
(cherry picked from commit d2713d11afc35bc2ce546f9bd065cc7477ee65cc)
2019-02-17 21:25:15 -08:00
Oliver Brown 3f9fe7d14e MLK-17405 iMX8QM: Add athentication for HDMI/DP firmware
Add firmware athentication to the hdp and hdprx load functions.
If hdp_authenticate_fw is set to yes, the hdp tx firmware is athenticated.
If hdprx_authenticate_fw is set to yes, the hdp rx firmware is athenticated.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
(cherry picked from commit 6c0246888012c50127b40f1ab6fa6d581f725f7a)
2019-02-17 21:25:07 -08:00
Ye Li 0921dce1e0 MLK-20928 imx8: Update SCFW API to latest
Update to latest SCFW API with below commit. Add version API and
remove some resource ids.

    commit 004247e14afc74a21d65569415c4b2e35bfaabc3
    Author: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
    Date:   Thu Feb 14 14:55:12 2019 -0800

        SCF-341 Fix bug in setting large slice clock divider

        Incorrect mask was applied when clearing out the bits in the
        DSC large slice  divider.

        Signed-off-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 745f2e597613e96f1ac630e842faafdc060ee029)
2019-02-15 00:59:22 -08:00
Breno Lima a52ac63177 MLK-20916-2: doc: imx: ahab: Update AHAB document to include ahab_status command
Since commit cf2acc5b7c ("MLK-18942-2 imx8: ahab: Add ahab_status
 command") the U-Boot is able to display and parse the SECO events.

Update AHAB guides to use U-Boot ahab_status command instead of
SCFW CLI.

Starting in SECO FW v0.2.0 engineering release an invalid image
integrity is logged as an event in open mode. As ahab_status
is able to return this event the note can be removed.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 385ed19051a47f5858e8d326e5ee97f8a08a679d)
2019-02-13 17:56:53 -08:00
Breno Lima 6279960ae5 MLK-20916-1: doc: imx: habv4: Fix typo in iMX6 and iMX7 encrypted boot guide
The set_priblob_bitfield command is enabled by selecting
CONFIG_CMD_PRIBLOB.

Fix typo in mx6_mx7_encrypted_boot.txt guide.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit 99f9696ef5f7d1c0f93b7d910e884890fca6c973)
2019-02-13 17:56:52 -08:00
Breno Lima eb169fe3b3 MLK-20915: imx8: ahab: Add verify image response tag
The current U-Boot implementation is not decoding the verify image message
response.

=> ahab_status
Lifecycle: 0x0020, NXP closed

SECO Event[0] = 0x0088F100

Starting in SECO FW v0.2.0 engineering release an invalid image integrity
is logged as an event in open mode.

Update U-Boot ahab_status command to decode this event.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 96a192eb1d09fbed0e7e544fa7cc4f9d83d4acac)
2019-02-13 17:56:45 -08:00
Ye Li 9388275e14 MLK-20919 imx8: ahab: Add command to close the chip
Add a new command "ahab_close" to close the chip from NXP closed lifecycle
state to OEM closed state. If the sample is not NXP closed, the command
will fail.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 771b824728caa59eebf2c3547b2e4296a08ee705)
2019-02-13 01:31:36 -08:00
Li Jun ac350411c7 MLK-20909 usb: dwc3: gadget: use usb_endpoint_maxp for req length
As endpoint.maxpackt is set at init for super speed, we can't use it
for USB2 connection, we need use the right max packet length according
to connection speed.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 9c6bb3684649b4ae6f0275b5ad3799ea5c8f32df)
2019-02-13 01:31:23 -08:00
Ye Li aad2dd8b58 MLK-20886-12: imx8qxp_mek: Enable i2c and i2c mux virtual drivers
Update the defconfig files for imx8qxp MEK to enable i2c and
i2c mux virtual drivers.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit f2d75f7925108d4cc89c8cd4f1d9f735803c8ad1)
2019-02-12 06:56:32 -08:00
Ye Li 466c923102 MLK-20886-11: imx8qxp_mek: Remove GPIO1_1 for IO Expander reset
Since we have asked SCFW to do this job to avoid issues in partition
reboot, remove relevant codes.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 8128566e843d76720cdc5c3e075fa303e401132f)
2019-02-12 06:56:32 -08:00
Ye Li 2795341aaa MLK-20886-10 imx8-power-domain: Check resource partition in probing the PD
If the resource is not owned by current partition, we can't power on/off
it, so we'd better return probe failure.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 327115c1d490d35afd94ae416ad91bebd595cfe2)
2019-02-12 06:56:32 -08:00
Ye Li 4d4715081c MLK-20886-9 pinctrl-scu: Check the pad partition before set pinmux
If a pad is not owned by current partition we should not set its
pinmux.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 547636514f8ae8b456f2351bc84cb7fb7b5fa3f3)
2019-02-12 06:56:32 -08:00
Ye Li bc49134b47 MLK-20886-8 DTS: imx8qxp_mek: Update for virtual i2c and i2c mux driver
Add compatible strings and properties to i2c1 node for using virtual
i2c and i2c mux drivers

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 9dbdbec24b2d0cd67d16cf93034b3ab60bb312bc)
2019-02-12 06:56:31 -08:00
Ye Li 70fa29c716 MLK-20886-7 DTS: imx8qm/qxp: Add MU8 and MU9 nodes
We use MU8 and MU9 to communicate with M4_0 and M4_1 in u-boot. Add
relevant nodes for the MU driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit b06674a91991fe3bfe5a2f6000195cb8546c72a6)
2019-02-12 06:56:31 -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 169dd006cb MLK-20886-4 lpi2c: Provide override binding function
We provide override binding function, so the ARCH level can use it
to determine if it is ok to bind with lpi2c driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit b19418270a3d532eacb1069606fa2ab100e04601)
2019-02-12 06:56:31 -08:00
Ye Li 09ffd8d155 MLK-20886-3 i2c: Add virtual i2c and virtual i2c mux drivers
Add virtual i2c driver which replies on the VService to send SRTM i2c
messages with M4.
For each output on i2c mux, M4 side abstracts a i2c bus with special bus
id. The virtual i2c mux follows basic mux design, but uses dedicated flag
to pass the abstract bus id for the mux output to virtual i2c driver.

Virtual i2c and virtual i2c mux will bind nodes with compatible string
"fsl,imx-virt-i2c" and "fsl,imx-virt-i2c-mux".

To support binding local i2c driver or virtual i2c driver at runtime. We
provides a override function for the driver bind. ARCH level is responsible
to implement it.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 25095e9f0d9816c22da97945b66439dfa277aa2b)
2019-02-12 06:56:30 -08:00
Ye Li 4db12a78ff MLK-20886-2 imx: Add Virtual service glue layer
We use a glue layer to link the low level MU driver and virtual drivers.
This glue layer is named to virtual service (iMX VService). Virtual service
provides unified interfaces for setup connection with M4, get message buffer
and send/receive message, etc.

Multiple virtual drivers (i2c, gpio, etc)
             |
         iMX Vservice
             |
       imx_mu_m4 driver

For each virtual device, by default, the Vservice uses the device node property
"fsl,vservice-mu" to specify the MU node handler. A override function is also provided,
so te ARCH level can define its rule. We will use the override function for dynamically
select MU on 8QM/QXP.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 4d872794cae55ffb654a55646bbf231e8d864e13)
2019-02-12 06:56:30 -08:00
Ye Li b5c9636a96 MLK-20886-1 misc: MU: Add MU driver to communicate with M4
Add a common iMX MU driver in misc uclass to communicate with M4.
The MU message format is defined to use 4 words as below, the driver
will use all 4 TR/RR in MU to pass one message

|WORD 0     | WORD 1      | WORD 2          | WORD 3         |
|SEQ        | TYPE        | PAYLOAD ADDRESS | PAYLOAD LENGTH |

 - SEQ:
   A sequence id starts from 0 and increases for each request message

 - TYPE:
   0x1:  Request.  Message sent from AP will set to this value.
   0x2:  Response. Message responded from M4 set to this value.
   0x3:  MU A side is ready.
   0x4:  MU B side is ready.

 - PAYLOAD ADDRESS:
   A pointer to the memory address where the uplayer message is stored

 - PAYLOAD LENGTH:
   The uplayer message length

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit aba0e51cc397e1d98be950f9c15619de06ebf782)
2019-02-12 06:56:21 -08:00
Ye Li d903cd890d MLK-20887 usb: gadget: Fix controller index in UMS
The usb mass storage (f_mass_storage.c) uses fixed usb index 0,
this causes problem while CDNS3 USB controller index is 1.
Modify the API of fsg to pass the controller index.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
2019-02-11 00:06:37 -08:00
Ye Li a726a0c38b MLK-20902 imx8mm_evk: Change VDD_DRAM to 0.975v
According to latest datasheet IMX8MMCEC_Rev_0, the typical voltage
of VDD_DRAM for 1.5GHz DDR clock is 0.95v. Because BD71847MWV PMIC
does not support 0.95v output. We change the voltage to 0.975v as
the note in datasheet mentioned it is acceptable and supported.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
2019-02-10 22:01:15 -08:00
Ye Li 2f3e58c8e9 MLK-20901 imx8: Sync SCFW API to latest
Sync the SCFW API to latest commit below:

    commit 0721a2af721fca45e9d7e9b673b669ffab9aca7f
    Author: Glen Wienecke <glen.wienecke@nxp.com>
    Date:   Sun Feb 10 19:16:56 2019 -0600

    SCF-296:  Partition reboot should not reset FSPI/OCRAM if in use
    - Update ss_rsrc_reset to return BUSY error if FSPI/OCRAM in use
    - Update pm_update_ridx to skip power transition if FSPI/OCRAM in use
    - For user_mode update requests, reflect mode achieved after pm_update_ridx
    - Add PM SVC call to get active mode (user_mode not accurate during transitions)
    - Undo some MISRA updates that changed ss_rsrc_reset to void function

    Signed-off-by: Glen Wienecke <glen.wienecke@nxp.com>

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
2019-02-10 22:00:02 -08:00
Utkarsh Gupta a9fdc0e4ef MLK-20787: imx: hab: Display All HAB events via hab_status command
Add ability for hab_status command to show All HAB events and not just
HAB failure events

Signed-off-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
2019-02-05 15:59:07 -06:00
Ji Luo fd421f74db MA-14051 Enable trusty for imx8q xen
Open configs to add trusty os support for imx8q xen
build. The rpmb keyslot package must be checked and
copied to secure memory before trusty os boot.

Change-Id: I66201783fa8439f2685377c10f257f064057dcfa
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-01-31 12:41:00 +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 bacee7266d MLK-20884-1 imx8qm/qxp: Update SCFW API to latest commit
Update SCFW API to below commit which has deprecated APIs with
misc_seco prefix.

commit 30b8f67097d65c6e22f218b106aeafdc636aece3
Author: Chuck Cannon <chuck.cannon@nxp.com>
Date:   Fri Jan 25 15:24:55 2019 -0600

    SCF-60: MISRA fixes.

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

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-30 05:42:23 -08:00
Ye Li f435435f2e MLK-20798 imx8: spl: Fix container header parser issue
Current container parser only load 0x400 as container header size.
However, the signature block in container header may exceed 0x400 size,
when using certificate or 4096bits RSA keys to sign image, so we
have to load the entire header according to container length field.
Otherwise the container authentication will fail

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-01-30 05:01:52 -08:00
Ye Li abef8ce6c2 MLK-20796 imx8qm_mek: Remove base board reset
SCFW has taken to reset the base board by deasserting BB_PER_RST_B(SCU_GPIO0_01) on
imx8QM MEK board, and has removed the SC_R_BOARD_R1 functionality.
So We don't need to explicitly use SC_R_BOARD_R1, delete the codes from u-boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-24 19:21:38 -08:00
Ye Li 2f8269b3d8 MLK-20794-3 imx8qxp_arm2: Using CONFIG_DEFAULT_FDT_FILE for kernel FDT
Since different ARM2/Validation boards use different kernel FDT, configure
them to CONFIG_DEFAULT_FDT_FILE in defconfig

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-01-24 18:38:07 -08:00
Ye Li 9eea203022 MLK-20794-2 imx8qxp_arm2: Add support for 17x17 validation boards
There are two new validation boards: LPDDR4 board (30123) and DDR3L board (30010)
for imx8x family 17x17 chips. These two boards have same design except the DDR.
Since SCFW is resposible for DDR initialization, U-boot could use one build to
cover two boards.
The 8DX 17x17 DDR3L ARM2 has been added into u-boot before, so we rename the config
CONFIG_TARGET_IMX8DX_DDR3_ARM2 to CONFIG_TARGET_IMX8X_17X17_VAL to cover DDR3L and
LPDDR4.

Considering 8DX and 8QXP 17x17 may solder to the boards, we create two defconfig:
one for DX and another for 8qxp to share with the CONFIG_TARGET_IMX8X_17X17_VAL
but with different FDTs.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-24 18:38:07 -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
Luo Ji accea7eb04 MA-13980 [Auto] Reboot when slot is marked as unbootable
For dual bootloader, slot selection is made at spl stage, go to
fastboot when current slot is marked as unbootable in AVB will
give the user a chance to recover current slot with fastboot
commands. But in this scenario, the device can't switch to another
bootable slot automatically when a slot is marked as unbootable.

Reboot the board when current slot is marked as unbootable to make the
slot switch happen in spl.

Test: Slot switch to 'b' automatically when 'a' is marked as unbootable
      on imx8qxp_mek.

Change-Id: I94237965970d0c17ed564cf76e08d353f7b9c047
Signed-off-by: Luo Ji <ji.luo@nxp.com>
2019-01-24 12:13:50 +08:00
Ye Li e448aa707c MLK-20760-2 imx8qm_arm2: Align initrd env with other imx8qm/qxp boards
The imx8qm_arm2 has duplcated settings for initrd_addr and initrd_high,
and needs to change initrd_addr to 0x83100000 to align with other imx8
boards.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-01-22 05:40:26 -08:00
Ye Li 2a092ea07e MLK-20760-1 mx6/7: Fix memory overlap between initrd and optee
On most of mx6 and mx7 platforms, we set the initrd address to 0x3800000
offset from DRAM base. However, the optee address is 0x4000000 offset from
DRAM base. So it will cause memory overlap when using initramfs and optee at
same time, for example using uuu to boot into kernel.

To fix the conflict, we set initrd address to 0x6680000 offset from DRAM base,
because OPTEE needs reserve 32MB memory from 0x4000000 offset to 0x6000000 offset.

Signed-off-by: Ye Li <ye.li@nxp.com>
2019-01-22 01:03:41 -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 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