summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2020-03-05net: fec: Add possibility to enable TXC delayPhilippe Schenker
Related-to: ELB-1299 Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
2020-03-04drivers: net: phy: micrel_ksz90x1.c: Add basic support for KSZ9131Philippe Schenker
This adds basic support for the new Micrel KSZ9131 phy. Related-to: ELB-1299 Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> (cherry picked from commit cc96ed419f7585db15855dd53046562aadece3fb)
2020-03-04net: phy: micrel: Use defines for PHY_IDs and MASKPhilippe Schenker
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com> (cherry picked from commit 28491c802d36accbb4d8562114ce8085ca53e1b0)
2019-11-27net: dm: fec: Fix regulator enable when using DM_REGULATORAdam Ford
When DM_REGULATOR is enabled, the driver attempts to call regulator_autoset() which expects the regulators to be on at boot and/or always on and fails if they are not true. For a more generic approach, this patch just calls regulator_set_enable() which shouldn't have such restrictions. Fixes: ad8c43cbcafb ("net: dm: fec: Support the phy-supply binding") Signed-off-by: Adam Ford <aford173@gmail.com> Tested-by: Martin Fuzzey <martin.fuzzey@flowbird.group> Acked-by: Joe Hershberger <joe.hershberger@ni.com> (cherry picked from commit 8f1a5ac797baac5b40f93eac80a7810f0a771ecf)
2019-11-27net: dm: fec: Support the phy-supply bindingMartin Fuzzey
Configure the phy regulator if defined by the "phy-supply" DT phandle. Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group> Acked-by: Joe Hershberger <joe.hershberger@ni.com> (cherry picked from commit ad8c43cbcafbbb21efc9e26bda7a6b1e37428adc)
2019-11-27ddr_init.c: provide external function needed for the cherry-picksMax Krummenacher
Note: this code base does not support i.MX 8MN at all. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2019-11-27MA-14981-1 Add evk_imx8mm 4GB DDR supportJi Luo
Add configs to support evk_imx8mm 4GB DDR board. The 4GB DDR will be split into two banks, one is 3GB (0x4000_0000~0xffff_0000) and another is 1GB(0x1_0000_0000~0x1_4000_0000). Test: build and boot with or without trusty. Change-Id: I02f6465fc5709b15fd76820edb846452d011dd56 Signed-off-by: Ji Luo <ji.luo@nxp.com> (cherry picked from commit e7db3f3b68bf792f7df5c113c385ebecd468f6ce)
2019-11-27MLK-21950-01 driver: ddr: skip ddr_ss_gpr config on imx8mnJacky Bai
There is no DDR_SS_GPR0 exits on i.MX8MN, so skip setting this register on i.MX8MN. Signed-off-by: Jacky Bai <ping.bai@nxp.com> (cherry picked from commit a8040bc4524687ca026b9960fda18eb19606dade)
2019-11-27MLK-21821 ddr: imx8m: Fix the ddr init hang on imx8mqJacky Bai
On, i.MX8MQ, the PLL config must be done when ddrmix isolation is released. So move the dram pll init after iso config done. For other i.MX8M SOC, either init pll before or after isolation is ok. Signed-off-by: Jacky Bai <ping.bai@nxp.com> (cherry picked from commit c5dcc21c214badd5b48b48dfaa62d17ba13c6b17)
2019-11-27MLK-21745-01 driver: ddr: Refine the ddr init driver on imx8mJacky Bai
Refine the ddr init driver to make it more reusable for different DDR type(LPDDR4, DDR4 & DDR3L). So we can reduce some redundant code. Signed-off-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 3c0b1b346a891fef7a81856e3ee9019e2b81602d)
2019-09-18fec_mxc.c: add possibility for phy-reset-post-delayPhilippe Schenker
This adds the possibility to add a delay after a reset in DT. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
2019-04-11net: dm: fec: Fix phy-reset-duration clamping and defaultsMartin Fuzzey
The DT binding says: - phy-reset-duration : Reset duration in milliseconds. Should present only if property "phy-reset-gpios" is available. Missing the property will have the duration be 1 millisecond. Numbers greater than 1000 are invalid and 1 millisecond will be used instead. However the current code: - clamps values greater than 1000ms to 1000ms rather than 1. - does not initialize the delay if the property does not exist (else clause mismatch) - returns an error if phy-reset-gpios is not defined Fix all this and simplify by using dev_read_u32_default() Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group> Acked-by: Joe Hershberger <joe.hershberger@ni.com> (cherry picked from commit 331fcabe4f9b4c7ec58d070da039f875673c9c9d) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2019-04-11net: dm: fec: Fix time unit error in phy-reset-durationMartin Fuzzey
The DT binding says that phy-reset-duration is in ms, but the driver currently uses udelay(). Switch to mdelay() to fix this. Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> (cherry picked from commit 9b8b91888493d25873b835d262b89f1c4efa0df7) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2019-04-11eth: dm: fec: Add gpio phy reset bindingMichael Trimarchi
Add the missing gpio phy reset binding to the gpio and reset time configuration Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> (cherry picked from commit efd0b791069af93e9d439a70d1fe2ae8994dbbfa) Conflicts: drivers/net/fec_mxc.c Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2018-12-24MA-13832 [Trusty] Support random rpmb key setJi Luo
Sometimes we need to set random rpmb key which is invisible except for the device. Generate the random key with hwcrypto interface and support fastboot command "fastboot oem set-rpmb-random-key" to set it. Test: build and boot on imx8q. Change-Id: I44e1b6b091366d8ffceb1159fc65c17610ce5243 Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-12-21MA-13303 fix the issue with 8qm boot from eMMC to flash SDfaqiang.zhu
For mek_8qm, bootloader offset in SD card is 32kb, in eMMC bootpartition, it's 0kb. This patch fix the issue that bootloader offset used in uboot is always based on the device that the board boot from. Now, if uboot environment variable "target_ubootdev" is set, bootloader offset used in uboot is based on the device "target_ubootdev" specified. So boot from eMMC to flash SD, the board can boot from SD and vice versa. Change-Id: Ia2cd64ba6ece02b98ea3d2addbce00b1661077de Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-12-20MA-13785 remove the fastboot command of ucmd and acmdfaqiang.zhu
To avoid end user executing uboot command through fastboot, the fastboot command of "ucmd" and "acmd" in the uboot to be flashed into non-volatile storage device is removed in this partch. Change-Id: I999b8688a53c2201d02979be68266afc110dfb15 Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-12-12MA-13759-1 imx8mm: Enable trusty supportJi Luo
Open configs to enable trusty for imx8mm_evk and also add new config imx8mm_evk_android_trusty_defconfig based on imx8mm_evk_android_defconfig. Test: Trusty starts ok. Change-Id: Iaea90de21f886ed23082a5e8e8d2fa7fb139a9cb Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-12-12MLK-20569 usb: ehci-mx6: configure usb out of suspend statePeng Fan
When moving to support partition reboot or android auto on XEN, linux kernel will runs into runtime suspend state, and the usb will be configured to low power suspend state by Linux. Then we reboot and runs into U-Boot, however the usb already in suspended state and uboot not able to lock the phy pll, after clearing PHCD to out of suspended state, the phy pll could be locked and fastboot works. Signed-off-by: Peng Fan <peng.fan@nxp.com> Suggested-by: Li Jun <jun.li@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 999ae3e37bc8fea05ac984eb043dd925d80f1208)
2018-12-06MA-13715 Alway return UNLOCK state for uboot boot from USBfaqiang.zhu
Now "is_boot_from_usb()" can work for imx6, imx7 and imx8, use this function to judge whether boot from USB, and then return FASTBOOT_UNLOCK. This can save some time for imx8 to flash images if the board is locked. Change-Id: Iaa63f326f33400f2fdf13bf2e175cd9ac7d60317 Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-12-06MA-13696 Android-auto: erase misc when change lock statusfaqiang.zhu
When change lock status, misc partition, which stores data generated by users, is erased. Before, we take different actions on misc partition for Android and Android Things. The situation of Android Auto is not handled. Change-Id: Ia290b8e351b7a688d7a3a562cd30fca858e5a30c Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-12-04MA-13629 [Trusty] Add commands to set vbmeta public keyJi Luo
Add commands to write/read vbmeta public key to/from secure storage. The vbmeta public key can only be set once. Comands to set the public key: fastboot stage <path-to-your-public-key> fastboot oem set-public-key Test: build and boot on imx8qxp_mek. Change-Id: Id3ad4aa5aacef4fc8443f6a2d6ccb931310970ca Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-11-29MA-13537-4 remove the feature that imx6 and imx7 can always unlockfaqiang.zhu
now the uboot used by uuu is compiled indepently from the one flashed to the board, and for imx6 and imx7, defconfig from BSP team is used to configure the uboot for uuu, so there is no need to unlock the device when flash the board. Change-Id: Ieefbd67e095dd51eab87e9a32b586cdf88f05d81 Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-11-29MA-13603 change unlock logic to firstly judge unlocked or notfaqiang.zhu
to handle situations that it is not allowed to unlock but the board is already unlocked, unlock logic is modified in this patch Change-Id: I90b22c2dfbc1c64ed9514032986e98b27526c7b9 Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-11-22MA-13487 Refine fsl avb functionsLuo Ji
Too many macros are used in fsl_avbkey.c and make it difficult to maintain. This patch made some refine by: 1. Move all avb/atx operations to fsl_avb.c. 2. Refine the functions logic. 3. Drop some unsupported conditions/functions. Test: build and boot on imx8qm_mek/imx8mq_evk/imx6qp_sabresd/imx7d_pico/imx8m_aiy. Change-Id: I5c99732acfc47d53cdf188d69223983777e577f4 Signed-off-by: Luo Ji <ji.luo@nxp.com>
2018-11-20MLK-20394 imx8mq: Update the ddrc QoS setting for B1 chipBai Ping
Update the ddrc Qos setting for B1 to align with B0'ssetting. Correct the initial clock for dram_pll. This setting will be overwrite before ddr phy training. Although there is no impact on the dram init, we still need to correct it to eliminate confusion. Signed-off-by: Bai Ping <ping.bai@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> Tested-by: Robby Cai <robby.cai@nxp.com> (cherry picked from commit 566b798213ab9690966f163de2765acdbfe647a7)
2018-11-15MLK-20373-5 serial: serial_xen: support normal uboot consolePeng Fan
Support output/input using `xl console [domid]`. 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-15MLK-20373-2 dm: serial: introduce puts hookPeng Fan
Introduce puts hook for dm serial driver. 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-14MLK-20356-2 dwc_ahsata: Fix incorrect freeYe Li
Fix coverity issue CID 43665: Free of address-of expression (BAD_FREE) incorrect_free: free frees incorrect pointer pp. pp points the port array field of struct ahci_uc_priv, should not free it. Signed-off-by: Ye Li <ye.li@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com>
2018-11-13MLK-20305 usb: gadget: fastboot: fix GUID data length errorLi Jun
Current code uses strlen of string to get the property data length, which is wrong for unicode string, also the whole property length also should be corrected(descriptor length minus head length, 142-10=132), detail data format of single GUID see below table: Table 4a: Microsoft Extended Properties Feature Descriptor =================================================================== Value | TYPE | Description =================================================================== 0x8E, 0x00, 0x00, 0x00 | DWORD (LE) | Descriptor length | | (142 bytes) -------------------------------------------------------------------- 0x00, 0x01 | BCD WORD (LE) | Version ('1.0') -------------------------------------------------------------------- 0x05, 0x00 | WORD (LE) | Extended Property | | Descriptor index (5) -------------------------------------------------------------------- 0x01, 0x00 | WORD (LE) | Number of sections (1) -------------------------------------------------------------------- 0x84, 0x00, 0x00, 0x00 | DWORD (LE) | Size of the property | | section (132 bytes) -------------------------------------------------------------------- 0x01, 0x00, 0x00, 0x00 | DWORD (LE) | Property data type | | (1 = Unicode | | REG_SZ, | | see table below) -------------------------------------------------------------------- 0x28, 0x00 | WORD (LE) | Property name | | length (40 bytes) -------------------------------------------------------------------- 0x44, 0x00, 0x65, 0x00, | NUL-terminated | Property name (...) | Unicode String | "DeviceInterfaceGUID" 0x74, 0x00, 0x00, 0x00 | (LE) | -------------------------------------------------------------------- 0x4e, 0x00, 0x00, 0x00 | DWORD (LE) | Property data | | length (78 bytes) -------------------------------------------------------------------- 0x7b, 0x00, 0x46, 0x00, | NUL-terminated | Property name (...) | Unicode String | "{xxxxxxxx-xxxx- 0x7d, 0x00, 0x00, 0x00 | (LE) | xxxx-xxxx- | | xxxxxxxxxxxx}\0" -------------------------------------------------------------------- Details of WCID see below link: https://github.com/pbatard/libwdi/wiki/WCID-Devices Reviewed-by: Ye Li <ye.li@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
2018-11-12MLK-20240-8 fastboot: Add NULL check for mmc variableYe Li
Fix coverity issue CID 5015449: Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking mmc suggests that it may be null, but it has already been dereferenced on all paths leading to the check Signed-off-by: Ye Li <ye.li@nxp.com>
2018-11-12MLK-20240-7 fastboot: Add NULL return checkYe Li
Fix coverity issue CID 1898965: Dereference null return value (NULL_RETURNS) dereference: Dereferencing a pointer that might be NULL dev_desc when calling write_backup_gpt_partitions Signed-off-by: Ye Li <ye.li@nxp.com>
2018-11-12MLK-20240-6 fastboot: Fix potential buffer overflowYe Li
Fix coverity issue CID 3826473: Destination buffer too small (STRING_OVERFLOW) string_overflow: You might overrun the 16-character destination string buffer by writing 20 characters from The size of g_ptable->name is 20, but we use 16 bytes buffer for strcpy. It may cause buffer overflow. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-11-12MLK-20240-5 fsl_usdhc: Fix fsl_esdhc_get_cd issueYe Li
Fix coverity issue CID 3606685: Structurally dead code (UNREACHABLE) unreachable: This code cannot be reached: return esdhc_getcd_common Should not return true directly, otherwise the esdhc_getcd_common is bypassed. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-11-12MLK-20240-4 pxp: Fix missing break in switchYe Li
Fix coverity issue CID 3411367: Missing break in switch (MISSING_BREAK) unterminated_case: The case for value 1U is not terminated by a 'break' statement. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-11-12MLK-20240-3 gis: Add NULL pointer checkYe Li
Fix coverity issue CID 3768406: Dereference null return value (NULL_RETURNS) dereference: Dereferencing a pointer that might be NULL gis_input when calling strcmp. The gis_input may returns NULL from env_get, need check it before strcmp. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-11-12MLK-20240-2 sata: ahsata: Fix wrong operand for checking SERR DIAG_XYe Li
Fix coverity issue CID 3261683: Wrong operator used (CONSTANT_EXPRESSION_RESULT) operator_confusion: ({...; __v;}) | 67108864 is always 1/true regardless of the values of its operand. This occurs as the logical operand of ! When DIAG_X is set, the PHY COMINIT signal is detected, so should use '&' to check whether it is set. Signed-off-by: Ye Li <ye.li@nxp.com>
2018-11-12MLK-20240-1 sata: ahsata: Fix resource leakYe Li
Fix coverity issue CID 3606684: Resource leak (RESOURCE_LEAK) leaked_storage: Variable uc_priv going out of scope leaks the storage it points to Signed-off-by: Ye Li <ye.li@nxp.com>
2018-11-12[iot] Update rollback index when slot has been marked as successfulJi Luo
The rollback index should be updated when avb verify pass and the slot has been marked as successful, update the rollback index also for those enabled dual bootloader feature. This commit also fix some configs condition issue so read/write rollback index with trusty will work. Test: rollback index updated successfully on imx7d_pico and AIY. Change-Id: I2344d6462249d8d88f0622d331cdeffc7e12f885 Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-11-12[iot] Calculate VBH in bootloaderJi Luo
SHA256 hash of the entire verified software stack should be calculated and passed to 'trusty_set_boot_params'. This commit will calculate the SHA256 hash which represents spl.bin and bootloader.img, and then extend that hash with the hash of vbmeta image into the final VBH. Bug: 110905171 Test: VBH is calculated and passed ok on AIY. Change-Id: Id83ad36f3de79bedd435ca8f26035a35cca66b07 Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-11-12[iot] Support fastboot variable 'at-vboot-state'Ji Luo
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[iot] Support command 'oem at-disable-unlock-vboot'Ji Luo
Device will be locked permanently after disabling the unlcok vboot, store the disable unlock vboot status into fuse. Since the fuse write operation is irreversible so config 'CONFIG_AVB_FUSE' is disabled by default, user need to add this config manually and run this command again. Test: Disable unlock vboot bit is set after enabling "CONFIG_AVB_FUSE", device was locked permanently after running this command. This is verified on both imx7d_pico and AIY. Change-Id: Iad8991a238763b1d662e33cba65f0b9eb44e97ef Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-11-12[iot] Support lock vboot for Android ThingsJi Luo
Supoort "fastboot oem at-lock-vboot" command for Android Things, this command can only be called after perm-attr have been fused. Test: build and boot ok on imx7d_pico and AIY. Change-Id: Ifcfeb2a38d88c5d12b46a1d9ea61b182ae2e7bcb Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-11-12[iot] Support authenticated unlockJi Luo
Add fastboot commands "fastboot oem at-get-vboot-unlock-challenge" and "fastboot oem at-unlock-vboot" to support the authenticated unlock feature for Android Things devices. Use software random numbers generator to generate the 16 bytes random challenge, it should be replaced with hardware encrypted random generator when the TEE part is ready. Test: Generate unlock challenge by: ./avbtool make_atx_unlock_credential --output=atx_unlock_credential.bin --intermediate_key_certificate=atx_pik_certificate.bin --unlock_key_certificate=atx_puk_certificate.bin --challenge=my_generated_challenge.bin --unlock_key=testkey_atx_puk.pem validated the unlock credential successfully on imx7d_pico and AIY. Change-Id: I4b8cee87c9e96924169479b65020a081136681f6 Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-11-12[iot] Support at-attest-dh variableHaoran.Wang
Per security requirement, attestation of keymaster supported by Trusty OS should support both P256 and curve25519 algorithm for Diffie-Hellman. TEST: Works on AIY boards by below commands: $fastboot getvar at-attest-dh Change-Id: I3244f8d8b677222463b4e8fc75412e54dadeb23e Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
2018-11-12Fix buffer overflow in kernel cmdline handlingBraden Kell
Flashing a signed vbmeta image adds extra parameters to the kernel command line, overflowing the buffer and corrupting the global data struct. Increase the command line buffer size from 512 to 1024 to accomodate the extra data, and change the sprintf's to snprintf's to prevent this from happening if more parameters are added later. This bug was exposed by Idd55dde79eed793dccdd7319600fbd04e11ca12d. Bug: 112397808 Test: Device boots with images from console and from local build. Change-Id: If73d04007d54193527e11e11c6ef326110e899b6
2018-11-12Fix P0/EVT boards boot without serial cable connection.Leonid Lobachev
Change-Id: I5969217e400ab494f9a74662d1d228fcf2e2d465
2018-11-06MLK-19852 imx: fastboot: eliminate confused printYe Li
When booting from NAND/SPINOR/WEIMNOR boot devices, the fastboot will print "unsupported boot device". This warning is used by android fastboot when setting its "bootcmd". Since android does not support these devices. so it gives the warning correctly. But for BSP normal boot, this warning will bring confuse to users. So change to check the "bootcmd" before giving such warning. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2018-11-02MLK-20163-02 imx8m: ddr: update the dram driver for i.MX8MBai Ping
Sometimes, SPL need to pass the trained FSP drate to ATF if DDR PHY bypass mode is not enabled. So add a fsp_table to pass these info to ATF. additionally, add more clock frequency point config to support for code reuse for i.MX8MQ. Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-11-02MLK-20160-1 usb: ehci-mx6: Fix PHY power up issue on iMX8 platformsYe Li
On iMX8 platforms like 8QM/QXP, we must power up the USB PHY resource before accessing the PHY. However, current init flow access the USB PHY in ehci_mx6_common_init prior than ehci_usb_phy_mode where the PHY is power up. Fix the issue by adding ehci_get_usb_phy function to parse the PHY address from DTB and power up the PHY before ehci_mx6_common_init. Signed-off-by: Ye Li <ye.li@nxp.com>