Commit Graph

12708 Commits

Author SHA1 Message Date
Braden Kell 7db36bcbef [iot] iMX7D: Load device tree from oem_bootloader
Load kernel.dtb from oem_bootloader root, or fall
back to default behavior if that doesn't work.
oem_bootloader should be ext2 or ext4.

Bug: 72662957
Test: U-Boot loads modified dtb from
      oem_bootloader, or loads original dtb if
      kernel.dtb doesn't exist or oem_bootloader
      isn't formatted

Change-Id: Ic93b572a482e85726e2fa0792997348c855f41a1
2018-08-20 21:25:41 +08:00
zhang sanshan 1731bacd1a MA-12196 [Android] system can't enter recovery mode in android auto
CONFIG_CMD_RUN is set to n which do not suppert "run".
use getenv to pass boot cmd to bootcmd

Change-Id: I3866786758b8dd16b2685ec157e8322daa304374
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>

Conflicts:
	drivers/usb/gadget/f_fastboot.c
2018-08-16 13:50:49 +08:00
Ye Li 0fe527d322 MLK-19132-1 fastboot: Use CONFIG_BCB_SUPPORT to control bcb relevant operations
BSP u-boot has enabled fastboot for uuu. But the BCB is not needed. It will
gives some errors during u-boot boot up.
This patch uses CONFIG_BCB_SUPPORT to control bcb codes, so that BSP u-boot can
disable it.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit e64a0eedb1ea84fbdbb67630fba88b92d1b49ed2)
2018-08-14 23:36:15 -07:00
Han Xu 4752217d6a MLK-19212: set the fastboot_bytes env
set the fastboot_bytes env for uuu download

Signed-off-by: Han Xu <han.xu@nxp.com>
2018-08-13 10:24:45 -05:00
Ye Li 6069aa09d9 MLK-19133 pinctrl: Fix select input issue in pinctrl driver
The pinctrl supports to set any bit in input register on iMX6 if
the MSB of input value is 0xff. But the driver uses signed int for
input value, so when executing the codes below, it won't meet.
Because this is arithmetic right shift.

    if (input_val >> 24 == 0xff)

Fix the issue by changing the input_val, config_val and mux_mode to u32.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit e464bbcd13d472ddf2df5b62b0002a127147e17b)
2018-08-13 00:51:40 -07:00
Ye Li e5de85ba36 MLK-19200-2 Revert "Add iMX8DX DDR3 arm2 board support"
This is debug patch, pushed by mistake. Since we already support
DDR3 ARM2 in previous commit, must revert it.

This reverts commit d0602d2ee6.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-08-12 19:21:32 -07:00
Ye Li d0602d2ee6 Add iMX8DX DDR3 arm2 board support
When rewoked eMMC to MMC socket, change MMC driver can recognize the card
Enable the fastboot to test usb gadget

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-08-10 15:25:40 -05:00
Li Jun bc76fe6dad MLK-19181-4 usb: gadget: don't change ep name for dwc3 while ep autoconfig
As the SDP protocol use the predefined ep num for communication, we can't
change its name hence reset its ep num while do ep autoconfig, this is
only apply for SPL.

Signed-off-by: Li Jun <jun.li@nxp.com>
2018-08-10 12:10:31 -05:00
Richard Zhu cdedbb42e0 MLK-19194 PCI: imx: disable the ltssm when link is down in uboot
Disable the LTSSM when link is down in uboot.
Otherwise, the pcie ep/rc validation system in kernel
would be impacted by the enabled ltssm stat in the uboot.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
2018-08-10 17:14:01 +08:00
Abel Vesa 2355481419 MLK-19183-9 iMX8QXP SPL: drivers: pca953x_gpio: Do not build it in SPL
The pca953x_gpio is not SPL non-DM ready, so make it build only in uboot proper

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
2018-08-09 15:18:21 -05:00
Abel Vesa 7586aa50fd MLK-19183-1 iMX8QXP SPL: serial_lpuart: Add non DM serial device
In case CONFIG_DM is not enabled, the driver needs to be initialized through
serial_initfunc. All the ops are implemented again this time using the
lpuart_serial_data.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
2018-08-09 15:14:28 -05:00
Ye Li 0203415434 MLK-19138 fsl_caam: move the g_jrdata global variable to data section
The imx_sec_init is called at board_f phase, this phase forbids to
write any global variable in BSS section, because the BSS section is
overlay with u-boot dynamic relocation entries (or DTB) which are used during
u-boot relocation after board_f phase.

Now the g_jrdata is in BSS section and it is initialized during imx_sec_init.
Therefore, it destroys the relocation entries (or DTB) and causes various u-boot
issues.

Fix the problem by assiging default value to g_jrdata.status, so g_jrdata is
moved to data section.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-08-07 05:38:31 -07:00
Luo Ji 9337077a29 MA-12219 [Android] Fix build errors for imx8mm
Android build use different tool chain(gcc 4.9) with yocto(gcc 6.2),
'for' loop initial declarations are not supported in C90, define the
variable first before use it.

Test: build pass for imx8mm_evk.

Change-Id: Idf9a9f21626a02e2e679d2e74410378cd143c3f1
Signed-off-by: Luo Ji <ji.luo@nxp.com>
2018-08-07 11:50:46 +08:00
Bai Ping fea0b43ca7 MLK-18431-02: add a more generic dram init flow for imx8m
the dram init is board related. But there is still some common
part can be reused on different board. The basic flow is common
for all the board. only the DDRC and DDR PHY config register setting
is different on different board. So extract the LPDDR4 init common
flow to make it more generic. baord level only need to provide
the DDRC and PHY config register parameter to the common code to finish
the dram init.

the same method can be use for DDR4. will be added later.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
(cherry picked from commit 220d0cc79a3f340e0da664242bb19ccda7a071d1)
2018-08-05 22:36:07 -07:00
Jun Li 8481dd21de MLK-19101 usb: gadget: update os_desc_config when add config
Always use the new added config for os_desc_config to fix cdev->
os_desc_config may miss set in case we restart usb gadget driver.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit e8efb32e9b7a4fe45c7f21e86052c7f5bcdb6695)
2018-08-03 09:52:11 -05:00
Ye Li 694351cb02 MLK-18945-8 video: mxsfb: Update LCDIF driver for sec_mipi_dsi on iMX8MM
Update LCDIF driver for integrating with samsung mipi dsi controller on
iMX8MM platform.

The changes include:
1. Fix build warning for ARM64 platform.
2. Change max outstanding transactions req to 16 for better performance
   on system bus.
3. Set ENABLE signal to active low for valid data transfer.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 43ee03181bd4e26ea389882dcd5285398438390d)
2018-07-19 21:14:37 -07:00
Ye Li 074cbb1c8f MLK-18945-7 video: Add mipi panel driver RM67191
Add a mipi dsi panel driver for RM67191 panel which is attached to mipi dsi
controller.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 01e116ccd2e2705be3fb427da74cb19bab7ab4e0)
2018-07-19 21:14:29 -07:00
Ye Li 782400a718 MLK-18945-6 video: Add driver sec_mipi_dsim for mipi dsi on iMX8MM and iMX7D
Add new mipi dsi driver sec_mipi_dsim to support the samsung mipi dsi used
on iMX8MM and iMX7D platforms. This driver implements the interfaces required
by mipi dsi bridge. Users can use mipi dsi bridge common APIs to access it.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit b08b17cde486a232b602b806862de56a26117c51)
2018-07-19 21:14:18 -07:00
Ye Li 13b1696184 MLK-18945-4 video: mxsfb: Update LCDIF driver to use dsi bridge
Remove the functions for northwest driver and HX8363 driver, change
to use mipi dsi bridge interfaces.
The mipi_dsi_northwest driver setup and hx8363 init will move to
board level codes.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 0b8dc73e42ade9f44a3bbcf3662898772434988d)
2018-07-19 20:56:57 -07:00
Ye Li 1bd8d4f4a3 MLK-18945-3 video: Update mipi panel driver HX8363
Update the HX8363 mipi panel to use new mipi dsi bridge interfaces
to register a panel device and send command packets. So this panel
driver can decouple with mipi_dsi_northwest driver.

A new header file mipi_dsi_panel.h is added for all panel init
functions declare.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 1d355d37cce9a844011fbf27f7d4801068919ac4)
2018-07-19 20:56:47 -07:00
Ye Li f7a9859569 MLK-18945-2 video: Update mipi dsi northwest to implement bridge interface
Update the mipi_dsi_northwest driver to implement mipi dsi bridge interfaces
and register it as a bridge controller. Users can call bridge common interfaces
to access the northwest driver, don't need to call its private driver functions.

We also add a kconfig entry for this driver, the name is changed to
CONFIG_IMX_NORTHWEST_MIPI_DSI

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit a668cdb1ef5bcef4a574640f5c06ff07520254df)
2018-07-19 20:56:37 -07:00
Ye Li 2880a49732 MLK-18945-1 video: Add mipi dsi bridge driver
Add a mipi dsi bridge driver to abstract mipi dsi interfaces for
mipi panel and display controller drivers.
So for panel and display conntroller drivers, they can use same functions
to access mipi dsi controller.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 4bb9c1168a9b2796a1360d5e93420e4737fc3ba3)
2018-07-19 20:56:27 -07:00
Ye Li 065c4a2bdd MLK-18934 usb: fastboot: Remove CONFIG_BOOTLOADER_OFFSET_xxx configurations
We can get the bootimage SD/MMC offset at runtime according to the SOC type and
version. No need to use CONFIG_BOOTLOADER_OFFSET_33K and CONFIG_BOOTLOADER_OFFSET_32K
any longer, so remove them.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 63af66f27c2c1b836c6dd48eb9901d622007e4a4)
2018-07-19 20:45:40 -07:00
Luo Ji 4397a056bf MA-12216 [Android] Fix u-boot build errors
Type mismatch will cause some build warnings and they will be treated
as errors when '-Werror' is specified. Fix the error logs loke below:
  error: cast from pointer to integer of different size
  [-Werror=pointer-to-int-cast]

Test: build pass for evk_imx8mm

Change-Id: I48489815c8310c659a5c7c860433c4a93cb0dc66
Signed-off-by: Luo Ji <ji.luo@nxp.com>
2018-07-19 18:15:34 +08:00
Aymen Sghaier 1cf8780e46 MLK-18703: crypto: caam: Fix build error for i.MX7ULP
For i.MX7ULP SoC the header file crm_regs.h is replaced by pcc.h

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
2018-07-19 11:48:38 +02:00
Aymen Sghaier 1f4134c85f MLK-18703: crypto: caam: Add init TRNG into SPL or U-Boot
The following reasons lead to instantiate the TRNG into U-Boot/SPL:

 - On some i.MX platforms Linux Kernel could not instantiate RNG
 - RNG could be used/needed by M4/M0 cores before Kernel stage
 - Having the RNG instantiation implemented only once for
   almost i.MX platforms

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
2018-07-17 15:09:23 +02:00
Frank Li 7d24d618fc MLK-18707-1: SDP: use CONFIG_SDP_LOADADDR as default load address
if SDP_WRITE and SDP_JUMP addr is zero, use CONFIG_SDP_LOADADDR
as default address

Signed-off-by: Frank Li <Frank.Li@nxp.com>
(cherry picked from commit 192a26dbcd88da7d1773bb6336d855c408239d4a)
2018-07-16 10:11:30 -05:00
Ye Li 5527e5674c MLK-17638 video: imx8m_hdmi: Checks HDMI FW before enabling video output
Checks whether the HDMI FW is running before initialize the HDMI display.
So that for cases like mfgtool and imx-boot image without HDMI FW, the
u-boot won't be blocked.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 273b45dd3cf8773462400857c8b48b70bcfe96bb)
2018-07-15 19:44:30 -07: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
Ye Li 1288dc25fb MLK-18686-2 sc_thermal: Fix interpreting tenths as millicelsius
When calculate the temperature in millicelsius, the tenths are
handled incorrectly.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 72796a2e138bb7b5b4db9f771a3f9b823b66ade5)
2018-07-01 20:57:48 -07:00
Ye Li c1e72c232d MLK-18686-1 sc_thermal: Update thermal resources for iMX8QXP
Since the DRC_0 thermal is disabled by SCFW, we should use SC_R_SYSTEM for
CPU thermal. Update the resources table to align with kernel.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 3f8e5aaa173b5d3cdf05df7867cdca8776854fd6)
2018-07-01 20:57:38 -07:00
Ye Li 2c7b640aef MLK-18654-1 usb: gadget: Update SDP to support FIT
Current SDP only supports to boot legacy image(raw). Add support to
boot FIT image.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-06-21 19:25:55 -07:00
Luo Ji ea6784ee56 MA-11958 Fix userdata partition size overflow
The userdata partition size for some platforms
(like imx8/imx8m) could be larger than 4GB, use
"unsigned long int" to store the partition size
instead of "unsigned int".

Test: Get correct userdata partition size for imx8m.

Change-Id: Ib626fa2c4c64dde4eba3a93ee0455f45d1286c9f
Signed-off-by: Luo Ji <ji.luo@nxp.com>
(cherry picked from commit 5a0a2948b0b2222ae5e261e5f67b3f4b9a5f21f3)
2018-06-14 19:48:09 -07:00
Peng Fan 695ae513cd MLK-18577-4 serial: add simple xen debug output
Add simple debug output when uboot runs in a VM.
Needs DM_SERIAL disabled, and XEN_DEBUG_SERIAL enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit b41475b83c8d7c83bd6069f4fea05d3405e81e50)
2018-06-13 21:52:59 -07:00
Ye Li ec37a2cef2 MLK-18437-1 usb: ehci-mx6: fix board_usb_clean issue
The board_usb_clean in ehci-mx6 always set to HOST. This is wrong
when we running gadget. Change to use type in private data.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 47809d46abafd91c8fbb90393881f1daddd08af1)
2018-06-13 19:52:13 -07:00
Peng Fan 81e64d882c MLK-18435-2 power: imx8: remove the resource owned check before poewr off
For all the devices used and set ACTIVE in U-Boot, U-Boot needs
to power off all of them without the check of resource owner.

When we create software partition before booting Linux, the resource
own checkw will return false, and cause the power domain not powered
off. If without the check of resource owner, the power domain in
the other software partition could be powered off with parent
partition could access child partition resources.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 3e29e8adace18035850be9d56cc277c64a221e85)
2018-06-13 19:50:46 -07:00
Jun Li c7cd977fcd MLK-18376-6 usb: gadget: set correct usb_configuration for os_desc_config
The current way to set cdev->os_desc_config is wrong if user restart
fastboot, as the old config is not used anymore and new allocated
usb_configuration will be used, so set the os_desc_config while
usb_add_config.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
(cherry picked from commit d401df4812e6c4b368b1c4aa02b584563822b59e)
2018-06-13 19:44:12 -07:00
Li Jun a505d1ed5f MLK-18376-5 usb: gadget: fastboot: add ext properties for WCID
Add device interface GUID for Microsoft Extended Properties Feature
Descriptor.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit afee07bcc82b4f1900731a5a68ad920dc89fe88c)
2018-06-13 19:43:59 -07:00
Li Jun 02ce3d5443 MLK-18376-4 usb: gadget: add WCID support for mfgtool
Enable WCID(Microsoft Compatible ID Feature Descriptor) for mfgtool.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 7a98d176be377e5df4f7199445977318aa868272)
2018-06-13 19:43:48 -07:00
Li Jun b524637d50 MLK-18376-3 usb: gadget: OS Feature Descriptors support
This is a proting patch from linux kernel: 37a3a533429e
("usb: gadget: OS Feature Descriptors support"), the original commit
log see below:

There is a custom (non-USB IF) extension to the USB standard:

http://msdn.microsoft.com/library/windows/hardware/gg463182

They grant permission to use the specification - there is
"Microsoft OS Descriptor Specification License Agreement"
under the link mentioned above, and its Section 2 "Grant
of License", letter (b) reads:

"Patent license. Microsoft hereby grants to You a nonexclusive,
royalty-free, nontransferable, worldwide license under Microsoft’s
patents embodied solely within the Specification and that are owned
or licensable by Microsoft to make, use, import, offer to sell,
sell and distribute directly or indirectly to Your Licensees Your
Implementation. You may sublicense this patent license to Your
Licensees under the same terms and conditions."

The said extension is maintained by Microsoft for Microsoft.

Yet it is fairly common for various devices to use it, and a
popular proprietary operating system expects devices to provide
"OS descriptors", so Linux-based USB gadgets whishing to be able
to talk to a variety of operating systems should be able to provide
the "OS descriptors".

This patch adds optional support for gadgets whishing to expose
the so called "OS Feature Descriptors", that is "Extended Compatibility ID"
and "Extended Properties".

Hosts which do request "OS descriptors" from gadgets do so during
the enumeration phase and before the configuration is set with
SET_CONFIGURATION. What is more, those hosts never ask for configurations
at indices other than 0. Therefore, gadgets whishing to provide
"OS descriptors" must designate one configuration to be used with
this kind of hosts - this is what os_desc_config is added for in
struct usb_composite_dev. There is an additional advantage to it:
if a gadget provides "OS descriptors" and designates one configuration
to be used with such non-USB-compliant hosts it can invoke
"usb_add_config" in any order because the designated configuration
will be reported to be at index 0 anyway.

This patch also adds handling vendor-specific requests addressed
at device or interface and related to handling "OS descriptors"."

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 859be2fc12dbd1b99e140641f2d7fa14df29c9dd)
2018-06-13 19:43:37 -07:00
Li Jun 80150d7617 MLK-18376-2 usb: gadget: move utf8_to_utf16le to header file
As other users may use utf8_to_utf16le() to convert the utf8
to utf16 for usb, so move it to head file.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 94870cb6b587243e0a68ee9a3ec43540d76152cc)
2018-06-13 19:43:26 -07:00
Li Jun ccc7596829 MLK-18376-1 usb: gadget: OS String support
This is a porting patch from linux kernel: 19824d5eeece
("usb: gadget: OS String support"), original commit log
see below:

"There is a custom (non-USB IF) extension to the USB standard:

http://msdn.microsoft.com/library/windows/hardware/gg463182

They grant permission to use the specification - there is
"Microsoft OS Descriptor Specification License Agreement"
under the link mentioned above, and its Section 2 "Grant
of License", letter (b) reads:

"Patent license. Microsoft hereby grants to You a nonexclusive,
royalty-free, nontransferable, worldwide license under Microsoft’s
patents embodied solely within the Specification and that are owned
or licensable by Microsoft to make, use, import, offer to sell,
sell and distribute directly or indirectly to Your Licensees Your
Implementation. You may sublicense this patent license to Your
Licensees under the same terms and conditions."

The said extension is maintained by Microsoft for Microsoft.

Yet it is fairly common for various devices to use it, and a
popular proprietary operating system expects devices to provide
"OS descriptors", so Linux-based USB gadgets whishing to be able
to talk to a variety of operating systems should be able to provide
the "OS descriptors".

This patch adds optional support for gadgets whishing to expose
the so called "OS String" under index 0xEE of language 0.
The contents of the string is generated based on the qw_sign
array and b_vendor_code.

Interested gadgets need to set the cdev->use_os_string flag,
fill cdev->qw_sign with appropriate values and fill cdev->b_vendor_code
with a value of their choice.

This patch does not however implement responding to any vendor-specific
USB requests."

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit b6ea0aaee307be0defaf8dc2c1eae9110bdae9a7)
2018-06-13 19:43:15 -07:00
Luo Ji 244e083d5d MA-11948 [Android] Support flash bootloader to target device
Sometimes we need flash bootloader to other mmc device instead
of the current one. Support flash bootloader to the device which
is specified by 'target_ubootdev' environment variable, fall back
to default one if 'target_ubootdev' is not set.

Change-Id: I5dd796aaa7b46e5209f245aa8131e4cac90ed086
Signed-off-by: Luo Ji <ji.luo@nxp.com>
(cherry picked from commit f80ce90aab1cffde391782f6a3adb914433dc52b)
2018-06-13 03:19:35 -07:00
Frank Li ccffd6e0b9 MLK-18257-5 enhence fastboot uboot cmd
Signed-off-by: Frank Li <Frank.Li@nxp.com>
(cherry picked from commit 3b1fa9d8fedba70a60a89d78af54ca11938ca635)
2018-06-13 03:07:04 -07:00
Ye Li 1ae9ecc73f MLK-18591-6 android: iot: Add boot Trusty OS codes for imx6 and imx7
Use trusty_os_init to load Trusty OS from CONFIG_TRUSTY_OS_ENTRY
before u-boot ready.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
2018-06-13 03:06:47 -07:00
Haoran.Wang ce4e9dc35f MLK-18591-5 android: iot: Export eMMC RPMB interface for Secure Storage proxy
Secure Storage service in Trusty OS will compute
the encrypted mmc frame and the rpmb proxy inject the frame
to driver directly. So that need to export RPMB related
interface for Secure Storage proxy use.

Change-Id: I7f69831a20a440f597d323b610fa615fd4344d05
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
(cherry picked from commit 4d2c1873ce8221e35874265e41dc42a6df169659)
2018-06-13 03:06:46 -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 4ec81a0b07 MLK-18591-2 crypto: caam: Add fsl caam driver
Add the fsl CAAM driver and new commands to implement DEK blob operations,
like "caam genblob" to generate encrypted blob and "caam decap" to output
orignal plain data.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-06-13 02:41:08 -07:00
fang hui 56b3054ae1 MA-10052 [iot] Extensions of AXP152 to support stream812
Necessary extensions of axp152 to support stream812.

merge patches from Martin Pietryka <martin.pietryka@streamunlimited.com>

Change-Id: I7708db4e59d6403a3576f17a221b448866f469a0
Signed-off-by: fang hui <hui.fang@nxp.com>
(cherry picked from commit 6f51148d75869415bb4e9920572e8fffb1eb0099)
2018-06-13 02:41:08 -07:00
Ye Li acdc5c297a MLK-18590 pmic: bd71837: Change to use new fdt API
Changed to use dev_read_subnode to get the ofnode type of the bd71837 device node.
Because the pmic_bind_children is changed to use ofnode.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-06-13 02:41:08 -07:00
Ye Li 178792da1e MLK-18455 mxc_spi: Fix issue for DM driver
Since the fdt API is changed, update to use devfdt_get_addr.
Otherwise, build the DM SPI will fail.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-05-31 06:17:14 -07:00
Ye Li f68b8d4e0b MLK-18341-1 thermal: nxp_tmu: Add support for thermal sensor on iMX8MM
The analog sensors on iMX8MM are new, used for 14LPP process. So the
Temperature Sensor Monitoring Unit (TMU) has some change accordingly.
We use version 2 in TMU driver to represent the new TMU, so the one driver
can service for both MQ and MM.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 86fab918e607221249acc5c9a8f8eca01c17ec37)
2018-05-23 04:15:59 -07:00
Sandor Yu 43bc31a270 MLK-17997: video: imx: hdp: Add HDMI RX firmware loading
Add iMX8QM HDMI RX firmware loading.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit 969d93660e1b34765627ff9f6f8dcab08dcd1250)
2018-05-23 04:15:57 -07:00
Ye Li c2f83b46c2 MLK-18290-4 usb: ci_udc: Add function to remove usb device
When unregister gadget driver in ci_udc, the usb device is not
removed or stop. This causes next "usb start" fails to work.

Add a new interface "usb_remove_ehci_gadget" in usb-uclass to
remove the usb device for DM driver. Using "usb_lowlevel_stop" for
non-DM driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit c73d137e0a4a613a49f6f63ec63332508afb88c0)
2018-05-23 04:15:55 -07:00
Ye Li 13c19c6214 MLK-18290-2 ehci-mx6: Update driver to support i.MX8MM
Since the i.MX8MM reuses the otg controllers on i.MX7D. We can use
CONFIG_USB_EHCI_MX7 for them.

Due the TCPC and load switch are used on Typec circuit. Add the
board_usb_init and board_usb_cleanup to ehci-mx6 DM driver. So
we can implement the TCPC settings in these board functions.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 67699e88aed8bd36e919f54f9555ae15595faaf7)
2018-05-23 04:15:54 -07:00
Li Jun 8da7e8dc00 MLK-18262 usb: cnds3: gadget: correct maxpacketsize to be 512 for HS
In case CONFIG_USB_CDNS3_GADGET_FORCE_HIGHSPEED, we should set
the maxpacketsize to be 512 instead of 1024.

Reviewed-by: Ye Li <ye.li@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 5e05784a89ec2fbbda9298f2c74ade134213b8c4)
2018-05-23 04:15:53 -07:00
Ye Li 3c29cba6ab MLK-18243-15 spi: fspi: Fix 3bytes access
The address size is 3 bytes when using BAR mode, but the driver
supposes the 4bytes mode is enabled and uses 4 bytes address. This
cause address issue.

Also the mask needs set to 23bits for 3 bytes address.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 2e9a9e0fe379306f7c1065f9afa9e67386be2503)
2018-05-23 04:15:51 -07:00
Peng Fan bce752cfe4 MLK-18243-14 spi: fspi: init unused LUT to 0
If not initialize unused LUT to 0, the value is random which might
cause qspi command failure.

On i.MX8QM/QXP, it works ok because ROM inittialize them to 0, but on
i.MX8MM, ROM not initialize them, so let's do it here.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit c4bd49c7b249073415f052fb28cd5a4ad374a318)
2018-05-23 04:15:51 -07:00
Peng Fan fa8e4ac67e MLK-18243-13 drivers: pinctrl: support i.MX8MM
Add compatible entry in imx8m pinctrl driver for i.MX8MM

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 34b5eaaafe81db4d0cbe07c39aad2ec4c8d2c9a2)
2018-05-23 04:15:51 -07:00
Ye Li e9a3bec2e9 MLK-18387 pmic: Add pmic driver for BD71837
The iMX8MM EVK board uses BD71837MWV pmic. Add its driver to u-boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-05-23 04:15:48 -07:00
Aymen Sghaier 1733916155 MLK-18044-4: crypto: caam: Fix pointer size to 32bit for i.MX8M
The CAAM block used in i.MX8M is 32 bits address size but when the flag
 PHYS_64BIT is enabled for armv8, the CAAM driver will try to use a
 wrong pointer size.
  This patch fixes this issue.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(cherry picked from commit 9e1ef25c121240cf3f6a142058e617dd7df0030b)
2018-05-23 04:15:46 -07:00
Aymen Sghaier 79e90af14a MLK-18044-2: crypto: caam: Fix build warnings pointer casting
Enabling CAAM driver for i.MX8M platforms, a 64 bits architecture,
 lead to casting warnings: from/to pointer to/from integer with
 different size. This patch fix these warnings

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(cherry picked from commit d02fbc7d2957f4788ced017ccf17fd35ab968121)
2018-05-23 04:15:45 -07:00
Aymen Sghaier b0f889b77b MLK-18044-1: crypto: caam: Add CAAM support to i.MX8M platforms
This patch enable CAAM support for i.MX8M platforms.

Signed-off-by: Aymen Sghaier <aymen.sghaier@nxp.com>
(cherry picked from commit 1fc92e6e34b06bdee81240ce06326aca1d9c02d8)
2018-05-23 04:15:45 -07:00
Franck LENORMAND c26db25a13 MLK-18043 2/4: caam: enable support for iMX7ULP
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit 5f429339ab5a5f0d1f00a2880ce05cf479f11ba5)
2018-05-23 04:15:44 -07:00
Franck LENORMAND d1d10af5a1 MLK-18043 1/4: caam: change JR running loop
Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com>
(cherry picked from commit 6503c1ed0264fc61945c2b3b5948b793f104fc32)
2018-05-23 04:15:44 -07:00
guoyin.chen 49ae851ccd MA-11789 Flash system.img failed due to erasing timeout
Flash system partition with fastboot will earse the partition firstly
The 1.2s timeout will fail on some SD Card.
Enlarge it to 5s to make it works for most of sdcard

Change-Id: I285df411c7a07025251fd19f4c8e8b549bee2421
Signed-off-by: guoyin.chen <guoyin.chen@nxp.com>
(cherry picked from commit 642d77fb6d6412095faa6584eeef7bb0132cae57)
2018-04-27 06:15:40 -07:00
Breno Lima d7b900dfa7 MLK-18169 imx: imx7 Support for Manufacturing Protection
This code was originally developed by Raul Cardenas <raul.casas@nxp.com>
and modified to be applied in U-Boot imx_v2017.03.

More information about the initial submission can be seen
in the link below:
https://lists.denx.de/pipermail/u-boot/2016-February/245273.html

i.MX7D has an a protection feature for Manufacturing process.
This feature uses asymmetric encryption to sign and verify
authenticated software handled between parties. This command
enables the use of such feature.

The private key is unique and generated once per device.
And it is stored in secure memory and only accessible by CAAM.
Therefore, the public key generation and signature functions
are the only functions available for the user.

The manufacturing-protection authentication process can be used to
authenticate the chip to the OEM's server.

Command usage:

Print the public key for the device.
- mfgprot pubk

Generates Signature over given data.
- mfgprot sign <data_address> <data_size>

Signed-off-by: Raul Ulises Cardenas <raul.casas@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit db2dbf622d3c711b2fbd85e6814992e023479dad)
2018-04-27 06:14:56 -07:00
Ye Li 0533fa7e8d MLK-18161-20 usb: xhci-mem: Fix scratchpad array issue
After updating the value of dev_context_ptrs[0], we should flush this
from cache to memory. Otherwise the controller won't use it.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 06:14:51 -07:00
Ye Li db2cc879f7 MLK-17821-1 USB: gadget: Add the cadence USB3 gadget driver
Porting the cadence USB3 (CDNS3) driver from kernel to u-boot. We only support
the gadget (device mode), while the host mode is not supported. Users remains
to use xhci-imx8 driver for host mode.

Some changes in the CDNS3 driver porting:

1. Add match_ep call back to usb_gadget_ops. The CDNS3 gadget driver replies
   on this operation to bind the usb_ep/usb_ss_ep with the endpoint descriptor
   when function layer uses usb_ep_autoconfig to add endpoint descriptors to gadget.
   So that CDNS3 driver can know the EP information and configure the EP once the
   set configuration request is received.

2. U-boot does not have CMA, so it won't allocate uncached memory. Need to flush
   TRB and its DMA buffer before prime to usb controller and after complete transfer.

3. In core.c, we add functions to hook with u-boot. It needs uplayer like
   to pass the register base address of each part of the USB controller.

4. Force the CDNS3 gadget max speed to HS. The SuperSpeed is not supported by u-boot,
   so disable it in gadget driver. A configuration USB_CDNS3_GADGET_FORCE_HIGHSPEED is
   selected.

5. Added gadget_is_cdns3 checking to provide bcdUSB value in device descriptor.

6. Moved some new fields in usb_ep structure to usb_ss_ep, since u-boot does not have them.

7. Remove host part codes as it is not supported by this driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
(cherry picked from commit 70514bd095ff9a94e9a523845641381486284257)
2018-04-27 06:14:50 -07:00
Oliver Brown 0857e58bc7 MLK-17404-6 video: Adding i.MX8 HDMI support to configuration
Adding i.MX8 HDMI support to build configuration.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
(cherry picked from commit 2edbbe51df0817876b943760a272640e3c9bff70)
2018-04-27 06:14:49 -07:00
Oliver Brown 485bccc476 MLK-17404-1 video: imx: hdp: Adding support for HDMI splash screen
Adding HDMI support for splash screen.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
(cherry picked from commit a95018c0d3b0ac8f0893b9408ae598324de4a530)
2018-04-27 06:14:47 -07:00
Oliver Brown d470258255 MLK-17205-2 video: imx: hdp: Adding HDP firmware loading to the build
Adding the HDP firmware loading to the build.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2018-04-27 06:14:46 -07:00
Oliver Brown 21edff320e MLK-17205-1 video: imx: hdp: Adding support for HDP firmware loading
This adds a command to load the HDP firmware and supporting libraries.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
(cherry picked from commit 94c9c7022c5b6cffb74bb2e34336cffc2790d0d8)
2018-04-27 06:14:46 -07:00
Ye Li 0768f229e8 MLK-18161-16 fsl_esdhc: Update esdhc driver to support HS400 ES mode
Update for HS400 ES and enable iMX8QM/QXP for HS400 and HS400 ES.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 06:14:45 -07:00
Ye Li 0972a7219f MLK-18161-15 mmc: Add HS400 Enhanced Strobe mode support
The eMMC 5.1 supports the HS400 Enhanced Strobe mode, add this
support to mmc.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 06:14:45 -07:00
Ye Li 5d8bd51fea MLK-18161-13 i2c-mux: pca954x: Update driver to support pca9646 i2c switch
Add the PCA9646 support, which is 2-wire bus switch and buffered 4-channel.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 06:14:44 -07:00
zhang sanshan 3f4f3e0519 MA-10633 [Android] enlarge the timeout for waiting DATA0
600ms is not enough to erase erase_grp_size for some sdcard.
enlarge to to 1200ms.

Change-Id: Ic980794fa3064f92b479b87380e694f853f83c6a
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
(cherry picked from commit 4a1db2cd700ea434e25c0692c545e571f5841a00)
2018-04-27 06:14:44 -07:00
Ye Li 2a8a0cf0f5 MLK-17239 mmc: fsl_esdhc: fix sd/mmc ddr mode clock setting issue
When sd/mmc work at DDR mode, like HS400/HS400ES/DDR52/DDR50 mode,
the actual clock rate is just half of the expected clock.

This patch set the DDR_EN bit first for DDR mode, hardware divide
the usdhc clock automatically, then follow the original sdr clock
setting method.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 06:14:44 -07:00
Peng Fan 1a97595aeb MLK-16188-4: drivers: regulator: fixed: add off-on-delay-us
Add off-on-delay-us for fixed regulator.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 53856166e9df6d2e204c5d0f3469b9333ecf734e)
2018-04-27 06:14:43 -07:00
Han Xu 029cce25cc MLK-16034-02: enable GPMI NAND driver for i.MX8
enable the GPMI NAND driver for i.MX8, the major changes

- register defination for i.mx8
- Makefile change for misc.c
- DMA structure must be 32bit address

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit 474c4270108551647c7064a23abdc2e11d7f37ab)
2018-04-27 06:14:41 -07:00
Ye Li 0873cbf1aa MLK-16208-1 thermal: Add driver to support i.MX8QM/QXP CPU thermal sensor
Add the DM thermal driver for i.MX8QM and QXP. The driver depends on DTB thermal
sensor nodes. Will create device for each thermal in thermal-zones. User can
use the thermal name to get the device from UCLASS_THERMAL.

The driver flag is set to DM_FLAG_PRE_RELOC, to support run it at early stage,
need add "u-boot,dm-pre-reloc" property to the thermal node.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 98005e0b5a46bd17160fac18be2374c15dba54f9)
2018-04-27 02:32:34 -07:00
Ye Li 02b99a8ce3 MLK-15324-2 video: imxdpuv1: Add DPU driver for i.MX8
Adding new IMXDPUV1 (aka Seeris, Iris-lite) display control driver.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 43541cba14f851c6eebaa84becd42967f94a9cfd)
2018-04-27 02:32:33 -07:00
Ye Li 8a2330424c MLK-15324-1 video: cfb_console: Fix 64 bits support problem
There are some integer to pointer convert. To support 64 bits system,
change the unsigned int to unsigned long.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit c3b5c2df452eac82a970ba304e94550be8e27335)
2018-04-27 02:32:33 -07:00
Peter Chen 952d331f7b MLK-15026 usb: host: xhci-imx8: add imx8 USB3 driver
It is for imx8qm and imx8qxp, and the cadence IP is in it.

Both DM and Non-DM are supported in this driver. The DM support
only probes the USB3 node, but won't parse any properties from node in DTS.
The registers address are still hard coded, that share with non-DM codes.

The DM driver will enable the power of USB3 controller and USB3 PHY. But
for Non-DM driver, users need to power up them in board level codes.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:33 -07:00
Ye Li 79122202a4 MLK-16175-1 usb: ehci-mx6: Turn on the power domain of USB PHY
Since there is no uclass for USB PHY. The device won't be setup for the USB PHY
node in DTB. And its associated power domain device won't be turned on neither
by DM framework.

This patch modifies the ehci-mx6 driver to enable the power domain device before
access the USB PHY. This is only for DM driver. For non-DM part, users still
need to power on the USB PHY in boards/SoC codes.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 3c59c8ea95d401d06736c68c186aec80e214bee8)
2018-04-27 02:32:32 -07:00
Ye Li 821d6b7b06 MLK-16118-7 spi: flexspi: Add init_clk_fspi function to setup clock
When the power domain driver is enabled, we need to enable clocks after power
domain on. The clock settings in board level codes must be removed, needs to
set them when the device is probed. Add this weak function in flexspi driver,
that SoC codes can implement the clock settings.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit a4d334e70839021a50dca2ad4ad98ecee16081f9)
2018-04-27 02:32:32 -07:00
Ye Li 187ea37698 MLK-16118-6 net: fec_mxc: Add the init_clk_fec function
When the power domain driver is enabled, we need to enable clocks after power
domain on. So the clock settings can't set in board_init, needs to set them
when the device is probed. Add this weak function in driver, that SoC codes
can implement the clock settings.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit c0e4ac66196b20f363f711fb18e40b70e3be9240)
2018-04-27 02:32:32 -07:00
Ye Li 2fde20b3dd MLK-16118-3 core: Add power domain operation to device probe
When power domain driver is enabled, power on the power domain
for the device be probed.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit bf3e8ecc36ed9f84b9ad1348be48088fbe4eef55)
2018-04-27 02:32:31 -07:00
Ye Li 68b9f562f4 MLK-16118-2 power: Add PD device lookup interface to power domain uclass
Add power_domain_lookup_name interface to power domain uclass to find
a power domain device by its DTB node name, not using its associated
client device.

Through this interface, we can operate the power domain devices directly.
This is needed for non-DM drivers.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit f5fcb1903d935c2e1037b6a1fc61f1c290818727)
2018-04-27 02:32:31 -07:00
Ye Li 5fa9718410 MLK-16118-1 power: Add power domain driver for i.MX8QM/QXP
Add the power domain DM driver for i.MX8, that it depends on the DTB
power domain trees to generate the power domain provider devices. Users
needs add power domain trees with property "compatible = "nxp,imx8-pd";"

- When power on one PD device, the driver will power on its ancestor PD devices
in power domain tree.

- When power off on PD device, the driver will check its child PD devices first,
only all child PD devices are off, then power off the current PD device. Then the
driver checks sibling PD devices. If sibling PD devices are off, then it will power
off parent PD device.

- There is no counter maintained in this driver, but a state to hold current on/off
state. So the request and free functions are empty.

- The power domain implemetation in i.MX8 DTB set the "#power-domain-cells" to 0, so
there is no ID binding with each PD device. We don't use "id" variable in
struct power_domain. At same time, we have to set of_xlate to empty to bypass standard
of_xlate in uclass driver.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 19c5632dc481d0fe983a4699d263bc9fc14edfcf)
2018-04-27 02:32:31 -07:00
Ye Li 15669d09e2 MLK-16094-1 pinctrl: Add pinctrl driver for i.MX8 platform
Add pinctrl driver for i.MX8 platform (QM/QXP). The driver can
parse the iomuxc settings from DTB and set them through IPC to SCU.

Enable CONFIG_PINCTRL_IMX8 to use this pinctrl driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit e881106f14f879a0861caa39ce0cdc278e0806a6)
2018-04-27 02:32:31 -07:00
Ye Li f4ebe53335 MLK-15013-1 ehci-mx6: Add i.MX8 OTG controller support
The i.MX8 has two USB controllers: USBOH and USB3. The USBOH reuses
previous i.MX6/7. It has same PHY IP as i.MX7ULP but NC registers
are same as i.MX7D. So add its support in ehci-mx6 driver.

Also the driver is updated to remove build warning for 64 bits CPU.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit cf0dd3af4c1d6d96e7394da46258e19cf281c6f0)
2018-04-27 02:32:30 -07:00
Teo Hall a360802ec1 MLK-14938-24 mailbox: add imx mu DM mailbox driver
implement i.MX Messaging Unit driver within the DM Mailbox uclass

Signed-off-by: Teo Hall <teo.hall@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 9caafe21ddf12c9ab994fe9e65dc7afe5e7bab3d)
2018-04-27 02:32:30 -07:00
Teo Hall afcfb7e510 MLK-14938-23 mailbox: enable mbox_send non-blocking use
Add a timeout to allow non-blocking use in the
same way as mbox_recv

Signed-off-by: Teo Hall <teo.hall@nxp.com>
(cherry picked from commit c2296701fa91dc8d4144c84c19ffe40dba3df88c)
2018-04-27 02:32:30 -07:00
Adrian Alonso 3733fc85c1 MLK-14938-21 mxc_gpio: add support for i.MX8
Add support for iMX8 SoC platforms, and extend to support LSIO GPIO0..GPIO7 ports.
Since the i.MX8 GPIO banks are indexed from 0 not 1 on other i.MX platforms,
so we have to adjust the index accordingly.

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit cb3eabdb56173a75495717bf88fbc1d04623f6d7)
2018-04-27 02:32:29 -07:00
Han Xu 71368855b6 MLK-16186: spi: flexspi: reset the flexspi DLL register to default value
i.MX8QM ROM didn't calculate the DLL correctly in some cases, to avoid
the wrong DLL setting impact the following functions, reset them to the
default value when probe.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit da3c2a9f09afa45a428809b7bf3f981a1ccb7f2e)
2018-04-27 02:32:29 -07:00
Ye Li 24c5cdaa45 MLK-15958-2 spi: fsl_fspi: Add support for 4bytes address mode
Update the LUT settings, spi_xfer to use the 4bytes address read/write/erase
commands.
Also add a function to enter the 4bytes mode for flash device.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 704c1c357d5566e6b3a72c57427d90ba08f9ef0f)
2018-04-27 02:32:29 -07:00
Ye Li 18dd143b9f MLK-15958-1 mtd: spi: Add 4bytes extend address support
Current SPI flash framework only supports to set bank register
(CONFIG_SPI_FLASH_BAR) for flash with size > 16MiB. But some new flash device
(for example, mt35xu512g) does not support this way, it only supports
4bytes extend address.

To access the whole memory size for such flash device, we add the support
for this 4bytes extend address mode to SPI flash framework.
The configuration CONFIG_SPI_FLASH_4BYTES_ADDR is used to enable the feature.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit c6815bcc44622861e3606c9aa7efa14c7db5ea5a)
2018-04-27 02:32:29 -07:00
Ye Li f98d2f7530 MLK-14938-20 spi_flash: Remove SECT_4K flag for mt35xu512aba
Found the 4K subsector erase can't work on this mt35xu512aba flash.
Remove this flag to use 128K sector erase.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 243aa3ddea8ee7f2e512d2a524b3553b0b144f92)
2018-04-27 02:32:28 -07:00
Ye Li dcd5504f64 MLK-14938-19 spi: Add FlexSPI Driver for i.MX8QM
Add fsl_fspi driver for flexspi controller. This driver supports:
1. DDR Quad output
2. Prefetch function for improve read performance.
3. Fast read and Quad read for one line read mode.
4. Read flash FSR register.
5. DM.

Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit ae4e80b7b0debd2ad868781aaeb28ca4f2d9a8aa)
2018-04-27 02:32:28 -07:00
Ye Li 83812d4d63 MLK-14938-18 sata: Add i.MX8 SATA support
- some delay is required between SATA_CTRL0 RST SET and CLR.
  Otherwise, sata phy link would be down.
- specific the ahci modification by imx8qm platform.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:28 -07:00
Ye Li 99c90ff2de MLK-14938-17 pcie: Add support for i.MX8QM/QXP PCIe
- one lane pcie gen2 link is okay, the cfg space
  of the rc/ep can be accessed.
  rc cfg base 0x5f00_0000. ep cfg base 0x6000_0000
- limit to gen2 speed
- mask the wait of eq3 finish, because it is used
  for gen3.
- use pcie_ctrla_init_rc() to do the initialization
  of the pciea controller
- setup the common pcie codes in pcie_imx8x.c, separate
  the different soc speicifed initialization codes into
  their own pcie/board codes, move the macro definitions
  into the new header file imx8_hsio.h.
- i.MX8QXP only have PCIe Control B. Enable PORT B at default.
  i.MX8QM needs to set CONFIG_IMX_PCIEB to enable PORT B.
- Disable the LTSSM when link is down.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 03141c2b955ce6034f06e701126aea1493dc2b4b)
2018-04-27 02:32:28 -07:00
Ye Li fd99a9f057 MLK-14938-16 net: fec: do not access reserved register for i.MX8
The MIB RAM and FIFO receive start register does not exist on
i.MX8. Accessing these register will cause SERROR in kernel.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 2a47ebbccb95e8482360813d6dff5288429f1248)
2018-04-27 02:32:27 -07:00
Ye Li 8cae207d03 MLK-17357-2 lpi2c: Add bus busy error handling
When doing "i2c dev 4; i2c probe" with ENET daughter card connected on iMX8QXP MEK
board, we met a i2c bus busy issue, that the BBF of lpi2c always show busy, but the
master is idle, and stop is detected (SDF set).

This patch addes a handling to re-init the lpi2c master for this case. Then the issue
can be worked around.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 6b4021d04c7f637fd60cf73f9cc46fdebc853790)
2018-04-27 02:32:27 -07:00
Ye Li 95a530df83 MLK-16192 lpi2c: Fix bus stop problem in xfer
In xfer function, both bus_i2c_read and bus_i2c_write will
send a STOP command.  This causes a problem when reading register
data from i2c device.

Generally two operations comprise the register data reading:
   1. Write the register address to i2c device.
      START | chip_addr | W | ACK | register_addr | ACK |

   2. Read the Data from i2c device.
      START | chip_addr | R | ACK | DATA          | NACK | STOP

The STOP command should happen at the end of the transfer, otherwise
we will always get data from register address 0

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit c8dac8ea2f07c4fb358b824365a1d345bab017fc)
2018-04-27 02:32:27 -07:00
Gao Pan 867499766e MLK-14698 imx: lpi2c: fix clock issue when NACK detected
For LPI2C IP, NACK is detected by the rising edge of the ninth clock.
In current uboot driver, once NACK is detected, it will reset and then
disable LPI2C master. As a result, we can never see the falling edge
of the ninth clock.

Signed-off-by: Gao Pan <pandy.gao@nxp.com>
(cherry picked from commit dd139ee52b709c95af3e0c968bcbc3cf42cca408)
(cherry picked from commit 59643c7b34415c6a23e0d73a8aed9145b0220a47)
2018-04-27 02:32:27 -07:00
Ye Li c947b75c5f MLK-14938-13 imx_lpi2c: Update lpi2c driver to support imx8
Add compatible string for i.MX8 and move imx_lpi2c.h from mx7ulp directory
to u-boot include directory as a common header file.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit d016611b59c688df6a8330984f2636c420e5adb5)
2018-04-27 02:32:26 -07:00
Ye Li 0acb32fd61 MLK-17131 serial: lpuart: Enable RX and TX FIFO
Enable the RX and TX FIFO in LPUART driver to avoid the input lost
during u-boot boot up.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit e8079cd6e5940ab9b3b89da03cf109d46a47aa0e)
2018-04-27 02:32:26 -07:00
Ye Li 3e64628387 MLK-16467 serial_lpuart: Fix FIFO_RXFE definition in LPUART driver
Accroding to RM, the Receive FIFO Enable (RXFE) field in LPUART FIFO register
is bit 3, so the definition should change to 0x08 not 0x40.
Otherwise the Receive FIFO is not disabled.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit b949b7c8dc5492dd08a2e2828fc686bd190ea094)
2018-04-27 02:32:26 -07:00
Ye Li 9168fd3982 MLK-14938-12 serial_lpuart: Update lpuart driver to support i.MX8
Add i.MX8 compatible string and cpu type support to lpuart driver,
to use little endian 32 bits configurations.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 0b1a70b2e3f519d6bf6c34f0df3a81ff1a4852cb)
2018-04-27 02:32:25 -07:00
Ye Li a89a8bf416 MLK-14938-10 fsl_esdhc: Update usdhc driver to support i.MX8
Add CONFIG_MX8 to use the 64bits support in usdhc driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit ec3bed8d0a73cea364981839c7a8ea716640c92f)
2018-04-27 02:32:25 -07:00
Ye Li 9d5fd38a31 MLK-17153-1 nand: Update SPL MXS NAND mini driver
Update the mini driver to add support for getting ecc info from ONFI and
support read image data from page unaligned NAND address.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 56cb2142cfb29d01a3ee8c160737167ccc3b2be6)
2018-04-27 02:32:19 -07:00
Ye Li 468509f86a MLK-17109-3 mxs_nand: Add support for i.MX8M
Update the gpmi/apbh_dma/bch drivers and relevant registers for i.MX8M.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 6cb839cabb42b81e37214e00448fc5dac89fd1f1)
2018-04-27 02:32:19 -07:00
Ye Li 25672f82ef MLK-17109-2 spi_flash: Add gd25q16c to flash ids table
The i.MX8MQ DDR3L ARM2 boards uses gd25q16c flash device, add its id
to spi flash ids table.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 945ec087f6481ccc24b124aa9b1a0e159174e4d4)
2018-04-27 02:32:18 -07:00
Ye Li 8e09d0f0ab MLK-16238-1 thermal: Add TMU driver for i.MX8M
Porting the TMU driver from kernel and supporting DM in the driver.
Users need to provide the TMU node and sensors nodes in DTB.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit f883de99b93de8c2fadd382d8cf961667bacd038)
2018-04-27 02:32:16 -07:00
Ye Li bff4001d09 MLK-18159-10 xhci-imx8m: Add DM USB support
Since the CONFIG_BLK is defined by DM MMC, to support USB storage,
we have to use DM USB. Add the basic DM support for xhci-imx8m driver.
Also update DTSi to add USB alias seq.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:15 -07:00
Li Jun 5a6326b049 MLK-16066-1 usb: host: add imx8m xhci host driver
imx8mq usb xhci is a dwc3 based controller, its synopsys PHY
can be controlled by usbmix glue layer. imx8mq has 2 USB3 instance,
this patch enables both two USB3 controllers.

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

(cherry picked from commit cb77028d960277df2dc357a86e6851da74924c1a)
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:32:15 -07:00
Li Jun ac64f46053 MLK-16273-1 usb: dwc3: add suspend clock setting interface
Some dwc3 based USB3 IP may have a wrong default suspend clk
setting, so add an interface to correct it by board setting.

Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 240b636718313e03db505a713e66e3f893cb7727)
2018-04-27 02:32:14 -07:00
Ye Li e953113b7f MLK-18159-5 imx8m: Enable wdog reset for i.MX8MQ
We will use watch dog to reset system for i.MX8MQ not through the PSCI.
Build watchdog driver for imx8mq.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:31:01 -07:00
Ye Li c0d5846b02 MLK-18159-2 fsl_qspi: Add support for i.MX8M
The i.MX8M reuses the QSPI controller from i.MX7D. Add the CONFIG_IMX8M
define to the driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:30:59 -07:00
Peng Fan cc1f5c2bf7 MLK-16132-4: power: pmic/regulator allow dm be omited by SPL
Allow the dm driver be omited by SPL.
Fix wrong config name for pfuze100 regulator.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:30:59 -07:00
Peng Fan 80bc3fccc0 MLK-16132-3 i2c: Kconfig: add dependency for SYS_I2C_MXC
add dependency for CONFIG_SYS_I2C_MXC

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit cc88d9708a38e82073bfa3ecde3f329a7103b0ff)
2018-04-27 02:30:58 -07:00
Peng Fan b24a4b06cd MLK-16132-2: pinctrl: add imx8m support
Add i.mx8m pinctrl driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 70e17c13b99ae41f416b5c72c364a0e4483188e8)
2018-04-27 02:30:58 -07:00
Ye Li c76cd4e58d MLK-18159-1 imx8m: Change name from mx8m to imx8m
The formal production name starts with imx, so change relevant names
in codes to use this prefix.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:30:58 -07:00
Ye Li c08b971781 MLK-13929-3 video: Update LCDIF driver to support MIPI-DSI
The LCDIF provides video source for MIPI DSI host at DPI-2 interface.
When the LCDIF Framebuffer driver is enabled, it uses the panel
parameters setup by environments to create a panel device and register
it to DSI host driver and then enable the DSI host.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 85659ea5ee975fa2d5fa7215e17a01f7006c39bf)
(cherry picked from commit 7ef1d78154fef4f799dbf7de0f3d9679911ffa39)
2018-04-27 02:30:52 -07:00
Ye Li 86264cba4b MLK-13929-2 video: Add mipi panel driver for hx8363
Add the mipi dsi panel driver for device HX8363 from kernel. The panel
driver needs work with mipi_dsi_northwest driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 0c6d0f4202bae7f61d38ecff1c9d255261f022f2)
(cherry picked from commit d65bbb0585a906072f01a2d72169be0b13b1d9b8)
2018-04-27 02:30:51 -07:00
Ye Li a4f1e8b676 MLK-13929-1 video: Add MIPI DSI host controller driver for i.MX7ULP
Add the host driver base from kernel for MIPI DSI controller on i.MX7ULP.
The controller provides a DPI-2 interface for LCDIF video stream, and a APB interface
for packet transmission.

The driver provides APIs to register a MIPI panel device and its driver. The panel
driver can use the write packet function provided by the host driver to send control
packets to panel device via APB interface.

MIPI DSI has its PHY and dedicated PLL. The driver will setup them when enabling the DSI
host.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit e02115dd1c5d36ec06eabcb5a0b8e09aaf0f29a0)
(cherry picked from commit 1e984bba8cd961daa4c5bf994a6a90a72cc2f114)
2018-04-27 02:30:51 -07:00
Ye Li 02af80fd3b MLK-13450-17 sf: Add Macronix MX25R6435F SPI NOR flash to flash parameters array
On mx7ulp EVK board, we use MX25R6435F NOR flash, add its parameters
and IDs to flash parameter array. Otherwise, the flash probe will fails.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 0d6bee19bb3e87ebf984fdc218b3b020006cb2e9)
2018-04-27 02:30:48 -07:00
Ye Li 6e8c9ae136 MLK-12483-4 mx6: Modify drivers to disable fused modules
Add the fuse checking in drivers, when the module is disabled in fuse,
the driver will not work.

Changed drivers: BEE, GPMI, APBH-DMA, ESDHC, FEC, QSPI, ECSPI, I2C,
USB-EHCI, GIS, LCDIF and EPDC.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 1704e116f9b39aeb99201919a18bc2b1e19a980e)
(cherry picked from commit 2d3b5df8530cd5ef883750378838dea7c40259af)
2018-04-27 02:30:47 -07:00
Liu Ying 1e926d6752 MLK-10747-2 video: ipu: Enable/disable LDB_DI clock when necessary
This patch adds enable/disable hooks support for ldb_di[0/1] clocks
and enables/disables them when necessary.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit 615d4c51679a6c2ee0ed4c5e3922eec76646eef1)
(cherry picked from commit 152192507c3bbaba093783d7da32b88327705c63)
(cherry picked from commit 036b71e1cd77ddb1827fd85eb7035fb7eccb7b12)
2018-04-27 02:21:28 -07:00
Liu Ying e83a985b71 MLK-10747-1 video: ipu: Build ldb_di clock relevant code only for MX6 and MX53
The LDB is found in MX6 variants and MX53, so this patch makes the ldb_di clock
relevant code be built only for them.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit 3e40c7466ae7d1d6ca74011bfe69ae059d412a3b)
(cherry picked from commit 0c47d4138fd2fe8aa864160e23428b2ef95f16ae)
(cherry picked from commit a59c901317e70da111b426db1be77f289eccbcbc)
2018-04-27 02:21:28 -07:00
Ye Li 2afd266e19 MLK-14445-5 ehci-mx6: Add OTG ID detecting by GPIO
The i.MX7ulp EVK board uses GPIO to detect ID for USB OTG0,
but when using DM USB driver, it is hard coded to use OTG ID pin.
Add a board override function that when extcon property is provided,
the function can check the GPIO to get ID.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 8382781a59fbae1d8ab797d64761136277e291d1)
2018-04-27 02:21:28 -07:00
Ye Li b3ec67eece MLK-13450-15 ehci-mx6: Add powerup_fixup implementation
When doing port reset, the PR bit of PORTSC1 will be automatically
cleared by our IP, but standard EHCI needs explicit clear by software. The
EHCI-HCD driver follow the EHCI specification, so after 50ms wait, it
clear the PR bit by writting to the PORTSC1 register with value loaded before
setting PR.

This sequence is ok for our IP when the delay time is exact. But when the timer
is slower, some bits like PE, PSPD have been set by controller automatically
after the PR is automatically cleared. So the writing to the PORTSC1 will overwrite
these bits set by controller. And eventually the driver gets wrong status.

We implement the powerup_fixup operation which delays 50ms and will check
the PR until it is cleared by controller. And will update the reg value which is written
to PORTSC register by EHCI-HCD driver. This is much safer than depending on the delay
time to be accurate and aligining with controller's behaiver.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 8dfdf83abaff44efb487f801cd1757a729d427c5)
(cherry picked from commit cafc860907a408156a43fa20169dfc187648618e)
2018-04-27 02:21:27 -07:00
Ye Li 6ae64ed7f3 MLK-13450-14 ehci-mx6: Update EHCI driver to support OTG0 on i.MX7ULP
The ULP has two USB controllers. These two controllers have similar NC
registers layout as i.MX7D. But OTG0 uses UTMI PHY simliar as i.MX6, not
the integrated PHY on i.MX7D. The OTG1 needs off-chip HSIC PHY or ULPI PHY
to work.

This patch only supports OTG0 with UTMI PHY.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 1ac22cabb96a14ac4ca58df60ae2025fb5e94db6)
(cherry picked from commit 53cfed1f967e44507a80a0b8c8113ae67188304b)
2018-04-27 02:21:27 -07:00
Han Xu 55e83ccb58 MLK-17656: mtd: qspi: support read the flag status in fspi driver
support to read the flag status in driver to avoid the spi-nor framework
wait_for_ready hang issue.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit 767faa948d2d140b6d56ee505f81f8f57c045a3d)
2018-04-27 02:21:27 -07:00
Ye Li 1c84e2e3ce MLK-14878 qspi: Fix issue when enabling DDR mode
There are two problems in enabling DDR mode in this new driver:
1. The TDH bits in FLSHCR register should be set to 1. Otherwise, the TX DDR delay logic
   won't be enabled. Since u-boot driver does not have DDR commands in LUT. So this won't
   cause explicit problem.
2. When doing read/write/readid/erase operations, the MCR register is overwritten, the bits
   like DDR_EN are cleared during these operations.  When we using DDR mode QSPI boot, the TDH bit
   is set to 1 by ROM. if the DDR_EN is cleared, there is no clk2x output for TX data shift.
   So these operations will fail.
   The explicit problem is users may get "SF: unrecognized JEDEC id bytes: ff, ff, ff" error
   after using DDR mode QSPI boot on 6UL/ULL EVK boards.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 16270556212e6c7422e87f69572c90f1afe6998b)
2018-04-27 02:21:26 -07:00
Ye Li 227dcb415d MLK-13450-16 fsl_qspi: Update changes for mx7ulp
The mx7ulp has small TX/RX FIFO (64Bytes) and AHB buffer size (128Bytes)
than other i.MX. Change some parameters for it.

Also found when the DDR_EN bit is set, sometime the page programming will fail
during large data programming. The 64 bytes data is not programmed into flash.
But when DDR_EN is clear, there is no such issue. Suspect this is a IC issue.
We have disable the DDR_EN for mx7ulp.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 5a69ddb7e9886e082da42ddf673415702975ee60)
2018-04-27 02:21:26 -07:00
Ye Li a8ee235993 MLK-14484-1 mtd/spi: Add MT35XU512ABA NOR flash support
Add MT35XU512ABA parameters to NOR flash parameters array. Since the
manufactory ID is changed to 0x2C, add it for micron and using it for
relevant settings.

The MT35XU512ABA only supports 1 bit mode and 8 bits. It can't support
dual and quad. Because the 8 bits is not support by u-boot framework and
driver. We only use 1 bit mode for this flash.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 7595df64537e674df0a841563424b30b289d49fc)
2018-04-27 02:21:26 -07:00
Ye Li fe82358d1b MLK-17345 mxc_ocotp: Update redundancy banks for mx7ulp B0
On mx7ulp B0, beside bank 0 and 1, the fuse bank 9, 10, 28 are changed to
Redundancy mode not ECC, so they can support to program different bits of
a word in multiple times.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit af901cae281a617063559f60761ad4e912fccd5f)
2018-04-27 02:21:26 -07:00
Ye Li 7f8757016e MLK-12527-1 mxc_keyb: Add MXC keyboard driver
The i.MX6SL EVK needs this driver in android fastboot support. Add
this driver to u-boot.

To use the driver, user must define:

CONFIG_MXC_KPD          Enable the driver
CONFIG_MXC_KEYMAPPING   Key mapping matrix
CONFIG_MXC_KPD_COLMAX   The column size of key mapping matrix
CONFIG_MXC_KPD_ROWMAX   The row size of the key mapping matrix

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 5096e572667ff41217deb4ba9b1bd15e93fa6b59)
(cherry picked from commit e84160eaf5c057da45a227039c6f8a7911f43a82)
2018-04-27 02:21:25 -07:00
Ye Li 1484887284 MLK-14930-2 dwc_ahsata: Fix memory issue in reset_sata
The reset_sata should reset the sata device info and free the probe_ent
memory. Otherwise, it will cause memory leak if we init the sata again.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:21:25 -07:00
Ye Li 8cca3efba0 MLK-14938-22 mxc_gpio: Change to get value from DR register
Currently the driver gets value from PSR register, but this register
is only for input mode. For output mode, it always return 0 not the
value we set for output.

This patch changes to use DR register, which returns the DR value for
output mode, and PSR value for input mode.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 4afc3f90943c6b117f79b66d2cd04e64f437b0c2)
2018-04-27 02:21:25 -07:00
Ye.Li 74d68c1b9f ENGR00315894-60 GPIO: Modify driver mxc_gpio to support RDC Semaphores
For GPIO group which shared by multiple masters, it may set in RDC
to shared and semaphore required. Before access the GPIO register,
the GPIO driver must get the RDC semaphore, and release the semaphore
after the GPIO register access.

When CONFIG_MXC_RDC is set, the features related to RDC semaphores
is enabled in mxc_gpio driver.

Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit 84d63e2e2ce12f714e88baad8b2325684614a7c1)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>

Conflicts:
	drivers/gpio/mxc_gpio.c

(cherry picked from commit c9943b9c8a78bb2c9886bfe582e82978387d8dee)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(cherry picked from commit faf94726cac8316c4342e19936f1e03ef283ace3)
(cherry picked from commit 6c0474fe0e4fc543c62b22c05c2702a881f56418)
(cherry picked from commit 7cd5fec7ce6a9ecfdaa1a9c1aaaa0d0ac18a4f86)
2018-04-27 02:21:24 -07:00
Ye Li e799a09b72 MLK-16219 pca953x_gpio: Clear the polarity invert register at init
The pca953x_gpio driver uses default value of polarity inversion register.
For some devices like PCA9557 and MAX7310, their polarity inversion register
default value is 0xf0. So for high 4 ports, when reading their values,
the values are inverted as the actual level.

This patch clears the polarity inversion register to 0 at init. So that the port read
and write values are aligned.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit cc4e6b3786671ec2ce2ea74dc6334f72587cc756)
2018-04-27 02:21:24 -07:00
Ye Li 29aa878ffb MLK-12865 Nand: Fix BCH debug1 register access issue
Should have "&" to access the register address, otherwise uboot will hang.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 0b65071afaae9d6a49fb7dda2902f5c8bcd678c2)
(cherry picked from commit 712cbc4f23fa4276ae652b8767fd5a0646fab1da)
2018-04-27 02:21:24 -07:00
Peng Fan 5f50a850dd MLK-12693-2 nand: mxs: correct bitflip for erased NAND page
This patch is a porting of
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/?h=imx_4.1.15_1.0.0_ga&id=e4dacc44d22e9474ec456cb330df525cd805ea38
"
i.MX6QP and i.MX7D BCH module integrated a new feature to detect the
bitflip number for erased NAND page. So for these two platform, set the
erase threshold to gf/2 and if bitflip detected, GPMI driver will
correct the data to all 0xFF.

Also updated the imx6qp dts file to ditinguish the GPMI module for i.MX6Q
with the one for i.MX6QP.
"

In this patch, i.MX6UL is added and threshold changed to use ecc_strength.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 489929be0221bb7d4c46bb5bc6083650b78f73e0)
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 37d7f9614aa357f270312d7ceaab0f7006dc5aea)
2018-04-27 02:21:24 -07:00
Peng Fan 93b481f07b MLK-12693-1 nand: mxs: fix the bitflips for erased page when uncorrectable error
This patch is porting from linux:
http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/?h=imx_4.1.15_1.0.0_ga&id=3d42fcece496224fde59f9343763fb2dfc5b0768

"
We may meet the bitflips in reading an erased page(contains all 0xFF),
this may causes the UBIFS corrupt, please see the log from Elie:

-----------------------------------------------------------------
[    3.831323] UBI warning: ubi_io_read: error -74 (ECC error) while reading 16384 bytes from PEB 443:245760, read only 16384 bytes, retry
[    3.845026] UBI warning: ubi_io_read: error -74 (ECC error) while reading 16384 bytes from PEB 443:245760, read only 16384 bytes, retry
[    3.858710] UBI warning: ubi_io_read: error -74 (ECC error) while reading 16384 bytes from PEB 443:245760, read only 16384 bytes, retry
[    3.872408] UBI error: ubi_io_read: error -74 (ECC error) while reading 16384 bytes from PEB 443:245760, read 16384 bytes
...
[    4.011529] UBIFS error (pid 36): ubifs_recover_leb: corrupt empty space LEB 27:237568, corruption starts at 9815
[    4.021897] UBIFS error (pid 36): ubifs_scanned_corruption: corruption at LEB 27:247383
[    4.030000] UBIFS error (pid 36): ubifs_scanned_corruption: first 6569 bytes from LEB 27:247383
-----------------------------------------------------------------

This patch does a check for the uncorrectable failure in the following steps:

   [0] set the threshold.
       The threshold is set based on the truth:
       "A single 0 bit will lead to gf_len(13 or 14) bits 0 after the BCH
        do the ECC."

        For the sake of safe, we will set the threshold with half the gf_len, and
        do not make it bigger the ECC strength.

   [1] count the bitflips of the current ECC chunk, assume it is N.

   [2] if the (N <= threshold) is true, we continue to read out the page with
       ECC disabled. and we count the bitflips again, assume it is N2.
       (We read out the whole page, not just a chunk, this makes the check
        more strictly, and make the code more simple.)

   [3] if the (N2 <= threshold) is true again, we can regard this is a erased
       page. This is because a real erased page is full of 0xFF(maybe also has
       several bitflips), while a page contains the 0xFF data will definitely
       has many bitflips in the ECC parity areas.

   [4] if the [3] fails, we can regard this is a page filled with the '0xFF'
       data.
"

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit ceb324a2914487aa517a6c70a06a20b5e3438fda)
(cherry picked from commit 026751697e41c7376414a8716cf0ea4bf998b85f)
2018-04-27 02:21:24 -07:00
Han Xu 7110e7d24d MLK-12603: mtd: gpmi: may use legacy bch geometry in u-boot
provide one config "CONFIG_NAND_MXS_BCH_LEGACY_GEO" to keep using legacy
bch geometry.

NOTICE: the feature must be enabled/disabled in both u-boot and kernel.

Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit 0abc9c182c24f88522bd74fa1b53cd2fa3477184)
(cherry picked from commit 772af34b1216acc8e6a1a3faf43fef7c90b26a2f)
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 58794b3ebefea468bb1c57184b79df500f427927)
2018-04-27 02:21:23 -07:00
Ye.Li b9846931a2 MLK-12214 NAND:apbh_dma: Fix logically dead code issue
The list_first_entry always assumes the list is not empty, it won't return NULL pointer when
the list is empty. So the "if (pdesc == NULL)" becomes a dead code. Fix the issue by calling
the list_empty before the list_first_entry.

(Coverity CID 29934)

Signed-off-by: Ye.Li <ye.li@nxp.com>
(cherry picked from commit ff3923f294cc2e15f436d7520b4042736b1b48a6)
(cherry picked from commit 64c6a7b5d621080b8bd948c061a4f223a8c2d886)
2018-04-27 02:21:23 -07:00
Han Xu 732415543c MLK-11718-2: mtd: nand: change the BCH layout setting for large oob NAND
The cod change updated the NAND driver BCH ECC layout algorithm to
support large oob size NAND chips(oob > 1024 bytes).

Current implementation requires each chunk size larger than oob size so
the bad block marker (BBM) can be guaranteed located in data chunk. The
ECC layout always using the unbalanced layout(Ecc for both meta and
Data0 chunk), but for the NAND chips with oob larger than 1k, the driver
cannot support because BCH doesn’t support GF 15 for 2K chunk.

The change keeps the data chunk no larger than 1k and adjust the ECC
strength or ECC layout to locate the BBM in data chunk. General idea for
large oob NAND chips is

1.Try all ECC strength from the minimum value required by NAND spec to
the maximum one that works, any ECC makes the BBM locate in data chunk
can be chosen.

2.If none of them works, using separate ECC for meta, which will add one
extra ecc with the same ECC strength as other data chunks. This extra
ECC can guarantee BBM located in data chunk, of course, we need to check
if oob can afford it.

Signed-off-by: Han Xu <b45815@freescale.com>
(cherry picked from commit 78f620a6d6ab44bd34e42f00abe4673db099ca73)
(cherry picked from commit 242b2b889a9e18c587fafaa98cb9e9985b179df4)
2018-04-27 02:21:23 -07:00
Ye Li 9da605be6d MLK-14608 fsl_esdhc: Fix wp_enable issue
The wp-gpios property is used for gpio, if this is set, the WP pin is muxed
to gpio function, can't be used as internal WP checking.

This patch changes to examine the "fsl,wp-controller" for using internal WP checking. And
wp-gpios for using gpio pin.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 733a7fde6fea35d6f2ea18c7759a06904b655e54)
2018-04-27 02:21:23 -07:00
Ye Li da81fab877 net: fec: Fix issue in DM probe timeout
Since the probe function has changed to reset FEC controller prior than
setup PHY. If reset FEC controller timeout, the priv->phydev is not
initialized, so can't free it.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:21:22 -07:00
Peng Fan b3ff99f296 net: fex_mxc: add i.MX6UL/SX/SL/i.MX7D compatible
Add i.MX6UL/SX/SL/i.MX7D compatible.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-04-27 02:21:22 -07:00
Peng Fan e9503232ee net: fec: sharing MDIO for two enet controllers
On i.MX6SX, 6UL and 7D, there are two enet controllers each has a
MDIO port. But Some boards share one MDIO port for the two enets. So
introduce a configuration CONFIG_FEC_MXC_MDIO_BASE to indicate
the MDIO port for sharing.
In Kconfig, user needs enable CONFIG_FEC_MXC_SHARE_MDIO first to enter
the CONFIG_FEC_MXC_MDIO_BASE.

To i.MX28, adapt to use the new config

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
2018-04-27 02:21:22 -07:00
Peng Fan a9b2da9b85 net: fec: set dev->seq to priv->dev_id
To platforms has two enet interface, using dev->seq could
avoid conflict.

i.MX6UL/ULL evk board net get the wrong MAC address from fuse,
eth1 get MAC0 address, eth0 get MAC1 address from fuse. Set the
priv->dev_id to device->seq as the real net interface alias id then
.fec_get_hwaddr() read the related MAC address from fuse.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-04-27 02:21:22 -07:00
Peng Fan 4266aac456 net: fec_mxc: simplify fec_get_miibus
No need to provide two prototype for this function.
Use ulong for the first parameter, then this function
could be shared for DM/non DM case.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-04-27 02:21:21 -07:00
Ye Li 0cb58cfb87 net: fec_mxc: Fix DM driver issue in recv
When using ethernet DM driver, the recv interface has a
change with non-DM interface, that driver needs to set
the packet pointer and provide it to upper layer to process.

In fec driver, the fecmxc_recv functions does not handle the
packet pointer parameter. This may cause crash in upper layer
processing because the packet pointer is not set.

This patch allocates a buffer for the packet pointer and free it
through free_pkt interface.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-04-27 02:21:21 -07:00
Peng Fan e215385fcb MLK-18149-2 mmc: fsl_esdhc: enable HS400 feature
The strobe dll code is ported from Linux Kernel:
drivers/mmc/host/sdhci-esdhc-imx.c
The comments are from the above file,
"For HS400 eMMC, there is a data_strobe line. This signal is generated
by the device and used for data output and CRC status response output
in HS400 mode. The frequency of this signal follows the frequency of
CLK generated by host. The host receives the data which is aligned to the
edge of data_strobe line. Due to the time delay between CLK line and
data_strobe line, if the delay time is larger than one clock cycle,
then CLK and data_strobe line will be misaligned, read error shows up.
So when the CLK is higher than 100MHz, each clock cycle is short enough,
host should configure the delay target. "

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
2018-04-27 02:21:21 -07:00
Peng Fan 556cfdee9d MLK-18149-1 mmc: add HS400 support
Add HS400 support.
Selecting HS400 needs first select HS199 according to spec, so use
a dedicated function for HS400.
Add HS400 related macros.
Remove the restriction of only using the low 6 bits of
EXT_CSD_CARD_TYPE, using all the 8 bits.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
2018-04-27 02:21:21 -07:00
Peng Fan a5bb0b38e6 MLK-18148 mmc: fix return value check condition
sd_read_ssr returns 0, means no error.
Fixes: 5b2e72f32721484("mmc: read ssr only if MMC write support is enabled")

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-04-27 02:21:21 -07:00
Ye.Li 0864a17afb ENGR00315894-81 gis: Add gis module
Add gis module, current gis is support vadc input.
Add power down function to lcdif driver.

Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit a007b00dd8ef9f773dfdebef0b1deb0990281793)
(cherry picked from commit a31dcdafb0963381e7213c59f79a340ef27ec2e2)
(cherry picked from commit 02dfe2e4af5f51d39a51542fb0e81f93faf505bc)
(cherry picked from commit a8e94954d8ccc44c41d77a5e356d6a99b3d45649)
2018-04-27 02:21:20 -07:00
Ye.Li 40c2e2c216 ENGR00315894-80 pxp: Add pxp module
Add pxp module.
Support csc between YUV444 and RGB888 and scaling.

Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit 4c6e1f9ed1b2f5c98a34502b44b6414593fdd290)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(cherry picked from commit 92295fafcdbaa3a3fe0a63ede15f896dfc9ce0b0)
(cherry picked from commit 096a63e81a8c78b3f8bbc65a9d418aa032d62231)
(cherry picked from commit b24cce0ad3ec9f386ca7aa231d8a2db33462f092)
2018-04-27 02:21:20 -07:00
Ye.Li c7232ae1c2 ENGR00315894-79 csi: Add csi module
Add csi module.

Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit 854ae26758ec8132ef749b98645dd2f43b84e5e2)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(cherry picked from commit 5f133bd9420109951fd03bd5168801327e929c3b)
(cherry picked from commit 16960e59fa3334162d2e2212ee4bc1e7f0c420a3)
(cherry picked from commit bc0639ed8f5069f198067916caf088908492329d)
2018-04-27 02:21:19 -07:00
Ye.Li 99977a1152 ENGR00315894-78 vadc: Add vadc module
Add vadc module.
Both PAL and NTSC mode can work.

Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit 03c31ae30c1e81c99f6824221e4801433445e04a)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(cherry picked from commit b5d776ffc1519c16091736445b3217ffb7fcd7db)
(cherry picked from commit 2377eb9fd299b76888f11faf76383b68e77bcc8a)
(cherry picked from commit 808d447235bd0f9134c7d00fa480cd55b4e0426e)
2018-04-27 02:21:19 -07:00
Ye.Li 948c5c95e8 ENGR00315894-70 iMX6SX:Video Update MXS LCDIF driver
Add a new interface "mxs_lcd_panel_setup" to setup fb parameters and
specifies the LCDIF controller for multiple controllers of iMX6SX.
Pass fb parameters via "videomode" env remains work if the new interface
is not called before video initialization.

Modify LCDIF clock interface "mxs_set_lcdclk" to support multiple
LCDIF controllers on iMX6SX.

Signed-off-by: Ye.Li <B37916@freescale.com>
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(cherry picked from commit d7f49b9378547c3a57b96bcdb907fc44616beb3d)
(cherry picked from commit e1343191b9de227c582847e7eeb5ce9238be0754)
(cherry picked from commit 9632ebeccc34d663e21bd19f2fe62de51947296e)
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:21:17 -07:00
Peng Fan 21bf1c38b7 MLK-12425-2 video: epdc: introduce epdc support
Support EPDC.
E-Ink feature is supported by i.MX6DL/SL/SLL/ULL and i.MX7D.

This driver supports user defined logo file, if there is no logo file, it will
draw a black border around a white screen.

If need to enable EPDC, a waveform file is required to let all
work.

Since we need LCD_MONOCHROME mode for EPDC, we introduce LCD_MONOCHROME
support.

Please refer to Linux Reference Manual for how to flash WAVEFORM file.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Robby Cai <R63905@freescale.com>
Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit a7244f279cc3c3994bcd103f5e9a183b1075ae71)
2018-04-27 02:21:17 -07:00
Ye Li 4226ce46f2 ENGR00325255 pcie:enable pcie support on imx6sx sd
Enable pcie support in uboot on imx6sx sd boards
- enable_pcie_clock should be call before ssp_en is set,
  since that ssp_en control the phy_ref clk gate, turn on
  it after the source of the pcie clks are stable.
- add debug info
- add rx_eq of gpr12 on imx6sx
- there are random link down issue on imx6sx. It's
  pcie ep reset issue.
  solution:reset ep, then retry link can fix it.

(cherry picked from commit ec78595a24b5ff1020baa97b6d6e79a3a3326307)
Signed-off-by: Richard Zhu <r65037@freescale.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 81fd30250110d72992758f08b66c07306126892b)
2018-04-26 02:26:40 -07:00
Mario Six a315da0f3f core: ofnode: Fix translation for #size-cells == 0
Commit 286ede6 ("drivers: core: Add translation in live tree case") made
dev_get_addr always use proper bus translations for addresses read from
the device tree. But this leads to problems with certain busses, e.g.
I2C busses, which run into an error during translation, and hence stop
working.

It turns out that of_translate_address() and fdt_translate_address()
stop the address translation with an error when they're asked to
translate addresses for busses where #size-cells == 0 (comment from
drivers/core/of_addr.c):

 * Note: We consider that crossing any level with #size-cells == 0 to mean
 * that translation is impossible (that is we are not dealing with a value
 * that can be mapped to a cpu physical address). This is not really specified
 * that way, but this is traditionally the way IBM at least do things

To fix this case, we check in both the live-tree and non-live tree-case,
whether the bus of the device whose address is about to be translated
has size-cell size zero. If this is the case, we just read the address
as a plain integer and return it, and only apply bus translations if the
size-cell size if greater than zero.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
Reported-by: Martin Fuzzey <mfuzzey@parkeon.com>
Fixes: 286ede6 ("drivers: core: Add translation in live tree case")
Reviewed-by: Simon Glass <sjg@chromium.org>
2018-04-26 02:26:13 -07:00
Alexander Graf c9bf43dd9d bcm283x_pl011: Flush RX queue after setting baud rate
After the UART was initialized, we may still have bogus data in the
RX queue if it was enabled with incorrect pin muxing before.

So let's flush the RX queue whenever we initialize baud rates.

This fixes a regression with the dynamic pinmuxing code when enable_uart=1
is not set in config.txt on Raspberry Pis that use pl011 for serial.

Fixes: caf2233b28 ("bcm283x: Add pinctrl driver")
Reported-by: Göran Lundberg <goran@lundberg.email>
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Tuomas Tynkkynen <tuomas@tuxera.com>
2018-03-09 12:31:04 -05:00
Alexander Graf 293b9814d7 serial_bcm283x_mu: Flush RX queue after setting baud rate
After the UART was initialized, we may still have bogus data in the
RX queue if it was enabled with incorrect pin muxing before.

So let's flush the RX queue whenever we initialize baud rates.

This fixes a regression with the dynamic pinmuxing code when enable_uart=1
is not set in config.txt.

Fixes: caf2233b28 ("bcm283x: Add pinctrl driver")
Reported-by: Göran Lundberg <goran@lundberg.email>
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Tuomas Tynkkynen <tuomas@tuxera.com>
2018-03-09 12:26:47 -05:00
Mario Six d38826a3dc treewide: Fix gdsys mail addresses
The @gdsys.cc addresses are supposed to be used for mailing lists.
Switch all occurrences of @gdsys.de mail addresses to their @gdsys.cc
equivalent.

Also, Dirk's address was wrong in one place; fix that as well.

Signed-off-by: Mario Six <six@gdsys.cc>
2018-03-09 09:23:10 -05:00
Tom Rini 81f077f40f Merge git://git.denx.de/u-boot-sh 2018-03-05 20:24:17 -05:00
Masahiro Yamada b08c8c4870 libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>
Thomas reported U-Boot failed to build host tools if libfdt-devel
package is installed because tools include libfdt headers from
/usr/include/ instead of using internal ones.

This commit moves the header code:
  include/libfdt.h         -> include/linux/libfdt.h
  include/libfdt_env.h     -> include/linux/libfdt_env.h

and replaces include directives:
  #include <libfdt.h>      -> #include <linux/libfdt.h>
  #include <libfdt_env.h>  -> #include <linux/libfdt_env.h>

Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-05 10:16:28 -05:00
Heinrich Schuchardt a84f559262 input: indicate that code page 437 is used
Add a comment indicating that the German key map assumes code page 437.

Add support for character ² (square sign) in the German key map.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-03-05 10:06:05 -05:00
Marek Behún de2069c761 pinctrl: Kconfig: Fix typo
Signed-off-by: Marek Behun <marek.behun@nic.cz>
2018-03-05 10:06:05 -05:00
Mario Six 1e5f89881a gpio: pca953x_gpio: Support label setting from DT
The PCA953x driver uses "gpio@%x_" as the GPIO bank name, where "%x" is
instantiated with the I2C address of the chip. While this works, it
becomes very confusing if a board has multiple PCAs with the same
address on different I2C busses, and it also becomes an issue when a
GPIO's value is to be set via the 'gpio' command, because this command
only ever sets the value of the first device it encounters, leaving the
other devices inaccessible to the command.

As to not break boards that rely on this naming scheme, we introduce a
new device tree string property "label" for the driver. If it exists, it
is used to build a bank name of the form "%s@%x_" (where %x is still
instantiated with the I2C address). If it does not exist, the legacy
labeling scheme is used.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-03-05 10:06:05 -05:00
Faiz Abbas b432b1ebdf spl: Kconfig: Rename SPL_USBETH_SUPPORT to SPL_USB_ETHER to match with the U-boot CONFIG
Rename CONFIG_SPL_USBETH_SUPPORT to CONFIG_SPL_USB_ETHER.

This enables users to block text using CONFIG_IS_ENABLED() instead
of resorting to #if ladders with SPL and non-SPL cases.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2018-03-05 10:06:05 -05:00
Jeremy Boone b3f4070340 Atmel TPM: Fix potential buffer overruns
Ensure that the Atmel TPM driver performs sufficient
validation of the length returned in the TPM response header.
This patch prevents memory corruption if the header contains a
length value that is larger than the destination buffer.

Signed-off-by: Jeremy Boone <jeremy.boone@nccgroup.trust>
2018-03-05 10:05:36 -05:00
Jeremy Boone afe0e6bddf Infineon TPM: Fix potential buffer overruns
Ensure that the Infineon I2C and SPI TPM driver performs adequate
validation of the length extracted from the TPM response header.
This patch prevents integer underflow when the length was too small,
which could lead to memory corruption.

Signed-off-by: Jeremy Boone <jeremy.boone@nccgroup.trust>
2018-03-05 10:05:36 -05:00
Jeremy Boone 12e0ab327d STMicro TPM: Fix potential buffer overruns
This patch prevents integer underflow when the length was too small,
which could lead to memory corruption.

Signed-off-by: Jeremy Boone <jeremy.boone@nccgroup.trust>
2018-03-05 10:05:36 -05:00
Marek Vasut 4f0533ffcd usb: xhci-rcar: Add R8A77965 M3N entries
Add entries for the R8A77965 M3N SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-03-05 10:59:38 +01:00
Marek Vasut d1fe3182fa pinctrl: rmobile: Add R8A77965 M3N entries
Add entries for the R8A77965 M3N SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-03-05 10:59:38 +01:00
Marek Vasut 7a7081e6f3 net: ravb: Add R8A77965 M3N entries
Add entries for the R8A77965 M3N SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>
2018-03-05 10:59:37 +01:00
Marek Vasut d6eb25c2f1 mmc: uniphier-sd: Add R8A77965 M3N entries
Add entries for the R8A77965 M3N SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-05 10:59:37 +01:00
Marek Vasut 76ed8f0542 gpio: rcar: Add R8A77965 M3N entries
Add entries for the R8A77965 M3N SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-03-05 10:59:37 +01:00
Marek Vasut c6d99986f0 clk: renesas: Add R8A77965 M3N entries
Add entries for the R8A77965 M3N SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-03-05 10:59:37 +01:00
Vipul Kumar 3ccc207a30 mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ
This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MIN_FREQ
and enabled it in respective defconfig.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-03-01 16:44:10 +01:00
Vipul Kumar 5dc5a53c5e mmc: Added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQ
This patch added Kconfig support for CONFIG_ZYNQ_SDHCI_MAX_FREQ
and enabled it in respective defconfig.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-03-01 16:44:10 +01:00
Vipul Kumar 71d5a14204 microblaze: Added Kconfig support for CONFIG_XILINX_GPIO
This patch added Kconfig support for CONFIG_XILINX_GPIO
and enabled it in respective defconfig.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-03-01 15:43:45 +01:00
Vipul Kumar e885b4255f i2c: Added kconfig support for CONFIG_ZYNQ_I2C0 and CONFIG_ZYNQ_I2C1
This patch added Kconfig support for CONFIG_ZYNQ_I2C0 and
CONFIG_ZYNQ_I2C1 and enabled it in respective defconfig.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-03-01 08:03:01 +01:00
Vipul Kumar 5c32de202b i2c: Added Kconfig support for CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET
This patch added Kconfig support for CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET
and enabled it in respective defconfig.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-03-01 08:03:01 +01:00
Vipul Kumar ce3c9a59af i2c: Added Kconfig support for CONFIG_SYS_I2C_ZYNQ_SPEED
This patch added Kconfig support for CONFIG_SYS_I2C_ZYNQ_SPEED
and set it to default value 100000.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-03-01 08:03:01 +01:00
Vipul Kumar e7affad190 i2c: Added Kconfig support for CONFIG_SYS_I2C_ZYNQ_SLAVE
This patch added Kconfig support for CONFIG_SYS_I2C_ZYNQ_SLAVE
and set it default to 0.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-03-01 08:03:01 +01:00
Vipul Kumar 38a69e96b3 i2c: Added Kconfig support for CONFIG_SYS_I2C_ZYNQ
This patch added Kconfig support for CONFIG_SYS_I2C_ZYNQ.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-03-01 08:03:00 +01:00
Vipul Kumar 3990c9d627 arm: zynq: fpga: Added Kconfig support for CONFIG_FPGA_ZYNQPL
This patch added Kconfig support for CONFIG_FPGA_ZYNQPL and migrates the
values over to the defconfigs.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
2018-02-28 13:00:25 -05:00
Vipul Kumar f415834608 fpga: Added Kconfig support for FPGA_SPARTAN3
This patch added Kconfig support for FPGA_SPARTAN3 and migrates the
values over to the defconfigs.

Signed-off-by: Vipul Kumar <vipulk@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
2018-02-28 13:00:04 -05:00
Arno Steffens a0fd381fc6 net: phy: smsc: Add SMSC LAN8741 support
Signed-off-by: Arno Steffens <star@gmx.li>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-02-26 15:51:37 -06:00
Bernhard Messerklinger 8f5672ea9d net: e1000: Fix e1000_igb semaphore handling
Fix commit f1bcad22dd ("net: e1000: add support for writing to
EEPROM").

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-02-26 15:51:36 -06:00
Eugeniy Paltsev 1693a577be NET: designware: fix clock enable
After commit ba1f966725 ("net: designware: add clock support")
we got NET broken on axs101 and axs103 platforms.

Some clock don't support gating so their clock drivers don't
implement .enable/.disable callbacks. In such case clk_enable
returns -ENOSYS.
Also some clock drivers implement .enable/.disable callbacks not for all
clock IDs and return -ENOSYS (or -ENOTSUPP) for others.

If we have such clock in 'clocks' list of designware ethernet controller
node we fail to probe designware ethernet.

Fix it.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-02-26 15:49:26 -06:00
Mario Six 8d6312032e phy: Fix style violations
Fix some style violations in the generic PHY management code.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-02-26 15:48:55 -06:00