Commit Graph

12708 Commits

Author SHA1 Message Date
Andrejs Cainikovs 8ca326d9a4 nmhw23: port changes to NXP branch 2019-06-05 12:26:32 +02:00
Andrejs Cainikovs b093d301fc nmhw23: add sjainfo command 2019-06-04 14:27:06 +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
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
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 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
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
Luo Ji 9d6623f13f MA-14379 [coverity] Resource leak (RESOURCE_LEAK)
Fix coverity issue: CID 2970630: Resource leak (RESOURCE_LEAK)
leaked_storage: Variable cdns going out of scope leaks the storage
it points to.

Memory allocated by devm_kzalloc() won't be freed automatically in
u-boot, free the memory manually here.

Test: Coverity scan pass.

Change-Id: I3000a2385941cef3b8b7e01611cfdc999971a4ca
Signed-off-by: Luo Ji <ji.luo@nxp.com>
2019-03-14 17:24:21 +08:00
Luo Ji 682826b332 MA-14370 [coverity] Buffer not null terminated
Fix coverity issue:
  CID 43787: Buffer not null terminated (BUFFER_SIZE_WARNING)
  buffer_size_warning: Calling strncpy with a maximum size argument
  of 32 bytes on destination array sdev.name of size 32 bytes might
  leave the destination string unterminated.

Test: Coverity scan pass.

Change-Id: Ib10e631bab893cb9cd1484082229f806b02849ba
Signed-off-by: Luo Ji <ji.luo@nxp.com>
2019-03-14 17:24:18 +08:00
Luo Ji 026360c2db MA-14322 [coverity] Uninitialized scalar variable
Fix coverity issue: CID 1477258: Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value txbuf when calling __fswab32.

Test: Coverity scan pass.

Change-Id: If57f70c272ef49a6636a59ae3b5dcc5430fd1753
Signed-off-by: Luo Ji <ji.luo@nxp.com>
2019-03-14 17:24:13 +08:00
Ji Luo e0343ea466 MA-14318-1 Support dual bootloader for xen
Trusty is not supported for xen so we don't need to check
the keyslot package or rollback index in spl. Reassign the
dram address for spl and u-boot to avoid conflicts.

Support serial init functions to enable debug console
in spl when xen is running.

Test: Boot and A/B slot switch on imx8qm_mek.

Change-Id: If6829252f1ec2e32255f951715c8747181951fd0
Signed-off-by: Ji Luo <ji.luo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-03-12 17:33:39 +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
Li Jun 6195c47b8d MLK-21055 usb: dwc3: gadget: disable U1 and U2
Currenlty U1 and U2 low power modes are allowed in device mode.
Allowing U1 and U2 low power modes during data transfers in
device mode is causing U1 exit failure on some USB3 host: which
will transite to SS.inactive instead of U0, then host will send
warm reset and ultimately result in reenumeration. This is observed
on UUU tool with some PC host. Hence disable U1 and U2 low power
modes for now.

USB3 spec 7.5.10.4.2 Exit from Recovery.Configuration
The port shall transition to eSS.Inactive when the following
conditions are met:
1. Either the Ux_EXIT_TIMER or the 6-ms timer
   (tRecoveryConfigurationTimeout) times out.
2. For a downstream port, the transition to Recovery is not to
   attempt a Hot Reset.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit ae0cdc741f7313398539f7b576ced73871f6cd71)
2019-03-08 13:45:29 +08:00
Oliver Brown 60fd0ed90a MLK-21045 iMX8QM: Need to change u-boot HDMI TX clocks
The HDMI digital PLL, bus clock and core clock need to change to improve the
firmware loading time. The clock are now set to 800 MHz for DPLL, 200 MHz for
HDMI core, and 100 MHz for HDMI bus.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2019-03-05 07:11:11 -06:00
Ye Li c466dbc650 MLK-21019 TMU: Check the TEMP range for iMX8MM
On iMX8MM, the V flag in TRISTR register only reflect the state of SNSR
value, not the calibrated TEMP value. So checking this flag is not
reliable. Per IC suggestion, change to read the TEMP/AVG_TEMP directly
and check whether it in valid range 10-125C.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit fe41c5fa6af88cce7f5a9723c82d6ad4e61357ce)
2019-03-03 17:39:44 -08:00
Ye Li e4ab28d1b2 MLK-20966 TMU: Fix for temperature out of range
When the temperature is out of sensor's range, the Valid bit won't be
set in TRITSR register. So the polling loop won't go out.

Change the codes to retry 10 times with 100ms interval for the Valid bit.
If the timeout, we give a warning for the invalid data.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit 7ea2168e06d4f77a872f51a167ee1ed6bf2b0632)
2019-02-23 05:10:14 -08:00
Han Xu f1b6c814f7 MLK-20962: Support legacy full id NAND in SPL
Current SPL code only support ONFI-compatible NAND, porting the code
from nand_base.c to support legacy full id NAND chips, such as Toshiba
TC58NVG2S0H.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit 4086c6b9556acbec2a8748578eb4a9e719ab4ae7)
2019-02-22 09:55:31 -06: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
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
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 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 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 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
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 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 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 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 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 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
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 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
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