Commit Graph

50078 Commits

Author SHA1 Message Date
Alexandre Bard 5b716b4e5f HW23: Set environnement to boot from ostree image
BugzID: 57825
2019-07-10 10:20:05 +02:00
Alexandre Bard 0fbd99d1de hw23: Move uboot environnement below first partition
First partition (root) starts at 64k.
Writing the environnement at this place breaks it.
64k is now the top boundary of the environnement.

BugzID: 57825
2019-07-09 16:07:25 +02:00
Ramon Moesching 74585ec488 imx8_nmhw23: enable support for loading fitimage from ext4
Enable ext4 supoort and allow importing existing environment
file from filesystem

Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
2019-07-02 17:37:40 +02:00
Andrejs Cainikovs 4d207268d5 nmhw23: SCU firmware with new *temporary* PMIC config 2019-06-13 17:26:15 +02:00
Andrejs Cainikovs 87a5d72dbc Update .gitignore: do not track external build tools 2019-06-06 17:05:32 +02:00
Andrejs Cainikovs a352c62e0c nmhw23: skip resource check 2019-06-06 17:04:16 +02:00
Andrejs Cainikovs fead87fe65 Update .gitignore: track firmware files 2019-06-06 12:21:11 +02:00
Andrejs Cainikovs 8ca326d9a4 nmhw23: port changes to NXP branch 2019-06-05 12:26:32 +02:00
Andrejs Cainikovs f3931b64d7 Fix nmhw23 build script 2019-06-04 14:57:07 +02:00
Andrejs Cainikovs 678b917dd3 Update nmhw23 build script 2019-06-04 14:49:02 +02:00
Andrejs Cainikovs 5e66c72de4 nmhw23: support large uncompressed images 2019-06-04 14:28:50 +02:00
Andrejs Cainikovs 7a57d88098 nmhw23: include mtest command
Plus tab fixes in board header file
2019-06-04 14:28:41 +02:00
Andrejs Cainikovs 614105eaa1 nmhw23: add ethernet config 2019-06-04 14:27:26 +02:00
Andrejs Cainikovs b093d301fc nmhw23: add sjainfo command 2019-06-04 14:27:06 +02:00
Andrejs Cainikovs 411c5216d4 nmhw23: add extra clock cycle for spi3 2019-06-04 14:26:57 +02:00
Andrejs Cainikovs e353eae859 spi: soft_spi: add spi-cex option
Adding spi-cex option to SPI controller definition in device
tree will force SPI driver to produce one extra clock cycle.
2019-06-04 14:26:44 +02:00
Andrejs Cainikovs 0962de82c7 nmhw23: add sja1105 driver 2019-06-04 14:26:25 +02:00
Andrejs Cainikovs e4c4fa35ee Update .gitignore to skip .log files 2019-06-04 14:25:01 +02:00
Andrejs Cainikovs 969cf01b7b Update .gitignore to skip .sd files 2019-06-04 14:24:13 +02:00
Andrejs Cainikovs 1583ea5c0c nmhw23: Add spi3 software SPI 2019-06-04 14:24:03 +02:00
Horatiu Vultur fbdd02057f spi: soft_spi: Fix null ptr when probing soft_spi.
When probing soft_spi the result of dev_get_parent_priv(dev) in probe
function is null ptr because the spi is on the ahb bus which has
per_child_auto_alloc_size set to 0. Therefore it would generate an Ooops
messages when accessing spi_slave structure.

The fix consist of updating the soft_spi_platdata flags inside the
.set_mode.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
2019-06-04 14:23:50 +02:00
Andrejs Cainikovs b8c82b4747 Add iMX8 NMHW23 build script 2019-06-04 14:23:12 +02:00
Andrejs Cainikovs be788e5b50 Add iMX8 NMHW23 firmware:
- iMX8QXP ARM Trusted Firmware (bl31)
- iMX8QX Security Controller Firmware (ahab-container)
- Custom MHW23 System Controller Unit Firmware (scfw)
2019-06-04 14:22:52 +02:00
Andrejs Cainikovs c7fb43d5ae Add iMX8 NMHW23 target 2019-06-04 14:22:06 +02:00
faqiang.zhu 0d6d880779 MA-14629 fix build warnings for varialbe initialization and type cast
initialize potential uninitialized variable with the type of"char*" to
be NULL in AVB. That "hashtree_error_mode" in code is manually specified
with a known value, the cases listed cover all potential value of
"hashtree_error_mode"

explicitly do a type cast for memcpy parameters.

Change-Id: Ie5d234422a273d6dab75585bd0d8eb81583707ca
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2019-04-18 18:49:33 +08:00
Ji Luo 87a19df5e4 MA-14511 AIY: Change the GPU reserved memory to 32M
Reserve 32M memory for GPU on AIY 1G DDR board.

Change-Id: I566a4a027982c8d4e41f280162f2f3cd67f1f5cd
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-04-11 13:58:39 +08:00
Michael Brooks 2aa4163329 MA-14521 AIY: Explicitly set USB Switch (PTN5150A) to UFP
* The default configuration (via resistor stuffing) is DFP (host). This
means that on Type-C hosts fastboot won't work.
* Set to UFP to ensure fastboot works properly.

Change-Id: I2b63d95e08df70da43dee1f8f7bb59d1863943f4
2019-04-11 13:58:29 +08:00
Michael Brooks 7191db0835 MA-14520 AIY: Limit USB to High Speed
* There is an enumeration problem when using superspeed.
* This doesn't fix it with all hubs, but can enable fastboot to work on
some 3.0 hosts.

Change-Id: If4a603126b945bd8f84c3d6e975e1185530eb193
2019-04-11 13:58:23 +08:00
Michael Brooks 1f27791878 MA-14519 Phanbell: Explicitly set buck voltages in SPL
* Bucks 1-4 will be reconfigured via DVS in the kernel.
* Buck 5 is explicitly set to 1.0V
* Regulator lock/unlock is added, this ensures that in warm or cold
reset the values will be set.

Change-Id: I8d8be74bddbbd081030fe1762b9f9c6534c7fb77
2019-04-11 13:57:29 +08:00
Leonid Lobachev be25ff5c10 MA-14518 AIY: Enable i2c2 and i2c3 in u-boot.
Enable i2c2 and i2c3 for AIY.

Change-Id: I984e2e76e7c8929cc62088b6838c81f5dc838568
2019-04-11 13:56:03 +08:00
Breno Lima 98a6ffadea MLK-21420 crypto: fsl: blob: Flush dcache range for destination address
The blob command is not working on i.MX7D, i.MX8MQ and i.MX8MM
devices.

Due to different cache management it's necessary to flush dcache
range for destination address so data can be available in memory.

Add necessary operations in blob_encap() and blob_decap() functions.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 639e5c15816c3eea0d4904a72ad175627be043d8)
2019-04-09 18:56:00 -07:00
Breno Lima d1515ca9cd MLK-21389 imx: hab: Check if IVT header is HABv4
The HABv4 implementation in ROM checks if HAB major version
in IVT header is 4.x.

The current implementation in hab.c code is only validating
HAB v4.0 and HAB v4.1 and may be incompatible with newer
HABv4 versions.

Modify verify_ivt_header() function to align with HABv4
implementation in ROM code.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 33f51b401dffa393274a28f9d49a87af3eb02fe0)
2019-04-09 18:33:31 -07:00
Breno Lima 822252fdc1 MLK-21251-2 doc: imx: habv4: Fix typo in csf_additional_images.txt CSF example
The csf_additional_images.txt example should match with
mx6_mx7_secure_boot.txt guide.

Fix addresses provided in csf_additional_images.txt CSF
example.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit 17c3af7a1935a40057c01459766d41ff0a19723b)
2019-04-09 18:33:24 -07:00
Breno Lima f905f893e3 MLK-21251-1 imx: hab: Fix build warnings in 32-bit targets
When building 32-bit targets with CONFIG_SECURE_BOOT and DEBUG enabled
the following warnings are displayed:

arch/arm/mach-imx/hab.c:840:41: warning: format '%lx' expects argument \
of type 'long unsigned int', but argument 3 has type 'uint32_t \
{aka unsigned int}' [-Wformat=]
   printf("HAB check target 0x%08x-0x%08lx fail\n",
                                     ~~~~^
                                     %08x
          ddr_start, ddr_start + bytes);

arch/arm/mach-imx/hab.c:845:45: warning: format '%x' expects argument \
of type 'unsigned int', but argument 3 has type 'ulong \
{aka long unsigned int}' [-Wformat=]
  printf("\nivt_offset = 0x%x, ivt addr = 0x%x\n", ivt_offset, ivt_addr);
                                            ~^
                                            %lx

Fix warnings by providing the correct data type.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit 050beb8ee3fc4c690c9ce7c4f47adfc6f48dccdf)
2019-04-09 18:33:16 -07:00
Breno Lima dd058bca4a MLK-21174 mx7ulp: hab: Add hab_status command for HABv4 M4 boot
When booting in low power or dual boot modes the M4 binary is
authenticated by the M4 ROM code.

Add an option in hab_status command so users can retrieve M4 HAB
failure and warning events.

=> hab_status m4

   Secure boot disabled

   HAB Configuration: 0xf0, HAB State: 0x66
   No HAB Events Found!

Add command documentation in mx6_mx7_secure_boot.txt guide.

As HAB M4 API cannot be called from A7 core the code is parsing
the M4 HAB persistent memory region. The HAB persistent memory
stores HAB events, public keys and others HAB related information.

The HAB persistent memory region addresses and sizes can be found
in AN12263 "HABv4 RVT Guidelines and Recommendations".

Reviewed-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit 0efff16579fabcf57acb9c8857afac8fb58de355)
2019-04-09 18:33:07 -07:00
Ye Li 5cc3fbe211 MLK-21400 mx6solosabre: Enable fastboot for UUU support
Enable fastboot configurations in mx6solo sabresd and sabreauto
defconfigs to support UUU. Since the DDR size on mx6solo sabre
boards is smaller, also change the fastboot buffer to 256MB.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit c482755fb22fa1a459927ed9aadf2477c42b1a59)
2019-04-09 02:46:48 -07:00
Breno Lima 625d4faf5c MLK-21386 Revert "drivers/crypto/fsl: assign job-rings to non-TrustZone"
Commit 22191ac353 ("drivers/crypto/fsl: assign job-rings to
 non-TrustZone") breaks HABv4 encrypted boot support in the
following i.MX devices:

- i.MX6UL
- i.MX7S
- i.MX7D
- i.MX7ULP

For preparing a HABv4 encrypted boot image it's necessary to
encapsulated the generated DEK in a blob. The blob generation
function takes into consideration the Job Ring TrustZone
ownership configuration (JROWN_NS) and can be only decapsulated
by the same configuration.

The ROM code expects DEK blobs encapsulated by the Secure World
environments which commonly have JROWN_NS = 0.

As U-Boot is running in Secure World we must have JROWN_NS=0
so the blobs generated by dek_blob tool can be decapsulated
by the ROM code.

As NXP BSP does not requires all job-rings assigned to
non-Secure world this commit can be safely reverted.

This reverts commit 22191ac353.

Reviewed-by: Silvano Di Ninno <silvano.dininno@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
(cherry picked from commit 3eebc76f5571f7ce74d385235019e8eb4a6718f6)
2019-04-08 22:29:22 -07: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
Ji Luo f3e266d088 MA-14494 Support DVT AIY 1G board
Add support for DVT AIY 1G board, distinguish the board type
with the board id.
  TYPE:         ID:
  Micron 1G     0x5
  HYNIX  1G     0x3
  Micron 3G     0x1

Test: Boot on AIY 1G/3G ddr board.

Change-Id: I3c7b6ebe8bc5d4e59917fcc3947e9ebfefc940da
Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-04-01 10:28:10 +08:00
Peng Fan b22b70ff0b MLK-21291 imx8mm: evk: not restrict uart4 when enabling jailhouse
When booting dual linux with jailhouse, inmate linux will use
the 2nd uart, so not restrict access the uart for jailhouse case.

The best solution would be using SIP call to ATF, for simplicity,
directly modify the RDC register.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-03-29 16:58:58 +08:00
Teo Hall 77ee38dd28 MLK-21277: imx8qm: spl: Add support for container parsing on validation board
Sync support for container parsing for validation board as on MEK
boards.

Signed-off-by: Teo Hall <teo.hall@nxp.com>
2019-03-28 11:58:01 -05:00
Jacky Bai f85f740805 MLK-21214 board: imx8mm_evk: Use the default QoS setting for imx8mm_evk ddr4
previous setting can NOT meet the USB stream mode performance settting.
So use the default QoS setting on the i.MX8MM DDR4.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit dc9b5e2ffb1d74477c7ec766c6312f9e98afa64c)
2019-03-21 17:53:10 +08:00
Utkarsh Gupta 2330001afc MLK-20893: imx: in_le32 out_le32 preprocessor casting issue with addresses involving math
The sec_in32 preprocessor is defined as follows in include/fsl_sec.h file:
When address "a" is calculated using math for ex: addition of base address and an offset, then casting is applied only to the first address which in this example is base address.

caam_ccbvid_reg = sec_in32(CONFIG_SYS_FSL_SEC_ADDR + CAAM_CCBVID_OFFSET)
resolves to:
caam_ccbvid_reg = in_le32((ulong *)(ulong)CONFIG_SYS_FSL_SEC_ADDR + CAAM_CCBVID_OFFSET)
instead it should resolve to:
caam_ccbvid_reg = in_le32((ulong *)(ulong)(CONFIG_SYS_FSL_SEC_ADDR + CAAM_CCBVID_OFFSET))

Thus add parenthesis around the address "a" so that however the address is calculated, the casting is applied to the final calculated address.

Bug introduced by commit 79e90af14a ("MLK-18044-2: crypto: caam: Fix build warnings pointer casting").

Signed-off-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 5d10d1cab052f8af4fd00640e09642aa0a596922)
2019-03-20 02:00:56 -07:00
Adrian Negreanu 15ecd669ac env variable to specify androidboot.storage_type
The boota command boots an Android already written to mmc/emmc.
It calls get_boot_device() to figure out where to look for Android;
but when a board is booted over serial, get_boot_device() returns
an invalid boot mode.

Explicitly setting the storage_type will enable boota on
a board booted over serial.

   FB: ucmd setenv storage_type emmc
   FB: ucmd boota

Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
2019-03-20 09:17:31 +02:00
Haibo Chen 8915891b77 MLK-21176 mmc: correct the HS400 initialization process
After the commit b9a2a0e2e9 ("mmc: Add support for downgrading
HS200/HS400 to HS mode"), it add a parameter in mmc_set_card_speed()
which indicates that the HS200/HS400 to HS downgrade is happening.

During the HS400 initialization, first select to HS200, and config
the related clock rate, then downgrade to HS mode. So here also need
to config the downgrade value to be true, make sure in the function
mmc_set_card_speed(), after switch to HS mode, first config the
clock rate, then read the EXT_CSD. Otherwise read EXT_CSD in HS mode
at wrong clock rate, e.g. 200MHz, may lead to uncertain result.

Test on i.MX8QM MEK board, some Micron eMMC will stuck in transfer
mode in this case, and USDHC will never get data transfer complete
status, cause the uboot hang.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
(cherry picked from commit 0ba8e1c6efa2e9c34c9b54105d6c50ee293ec1d7)
2019-03-19 11:19:54 +08:00
Marek Vasut c421756879 mmc: Do not poll using CMD13 when changing timing
When using CMD6 to switch eMMC card timing from HS200/HS400 to HS/legacy,
do not poll for the completion status using CMD13, but rather wait 50mS.

Once the card receives the CMD6 and starts executing it, the bus is in
undefined state until both the card finishes executing the command and
until the controller switches the bus to matching timing configuration.
During this time, it is not possible to transport any commands or data
across the bus, which includes the CMD13.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
(cherry picked from commit 5dbade95cb7ebc1f3a309b00430ebf2b466d7aba)
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2019-03-19 11:19:42 +08:00
Marek Vasut 4c95f33890 mmc: Add support for downgrading HS200/HS400 to HS mode
The mmc_select_mode_and_width() function can be called while the card
is in HS200/HS400 mode and can be used to downgrade the card to lower
mode, e.g. HS. This is used for example by mmc_boot_part_access_chk()
which cannot access the card in HS200/HS400 mode and which is in turn
called by saveenv if env is in the MMC.

In such case, forcing the card clock to legacy frequency cannot work.
Instead, the card must be switched to HS mode first, from which it can
then be reprogrammed as needed.

However, this procedure needs additional code changes, since the current
implementation checks whether the card correctly switched to HS mode in
mmc_set_card_speed(). The check only expects that the card will be going
to HS mode from lower modes, not from higher modes, hence add a parameter
which indicates that the HS200/HS400 to HS downgrade is happening. This
makes the code send the switch command first, reconfigure the controller
next and finally perform the EXT_CSD readback check. The last two steps
cannot be done in reverse order as the card is already in HS mode when
the clock are being switched on the controller side.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
(cherry picked from commit 523f613609545252f08f01f346ba4b0403f78b7c)
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2019-03-19 11:19:29 +08:00
Jacky Bai 128b1aaf8d MLK-21068 board: imx8mm_evk: update the lpddr4 timing config
Update the lpddr4 timing config to align with the ddr tool

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit a1433dec3a03a6c944b61600e7b317e2a83f2981)
2019-03-18 17:39:44 +08:00
Ye Li 4c530d1979 MLK-21168 imx: Set timeout of virtual driver service connection to 2s
The normal ready time of M4 side is less than 1s, so we can use
2s as the timeout of connection.  The current value is 10s, which seems
a little long if M4 SRTM service does not run.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 4792d8967d3c631d055c133303bb6385b822a3ca)
2019-03-18 02:06:53 -07:00
Ye Li 487875a832 MLK-21165 imx8: Workaround LPCG HW issue
There are two LPCG HW issues reported in TKT322331. Add workaround
for them in u-boot.
1. Back to back LPCG write access must have 4x DSC cycle interval.
2. When DSC clock is gated, LPCG write access may be missed due to
   the edge detect is not see by DSC. Two writes shall be performed
   to re-enable the clock if DSC clock is gated

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 96186ca0048e6ae261176e5f3ebf02be09bacb08)
2019-03-18 02:06:44 -07:00