Commit Graph

48953 Commits

Author SHA1 Message Date
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
Peng Fan bb628be4e9 MLK-12434-1: imx: dynamic setting mmcdev and mmcroot
Align to imx_v2015.04, dynamic setting mmcdev and mmcroot.
Then when boot linux, we can have correct "root=/dev/mmcblk[x]p2"

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit b46b99a901eb194e81fc4836ee2259ad8857f4d3)
(cherry picked from commit 6f6a828fbe7478efd5932c302e6368877107bbca)
2018-04-27 02:21:20 -07:00
Ye.Li 5265a30525 ENGR00315894-55 iMX6SX: add debug monitor support
Debug monitor will print out last failed AXI access info when
system reboot is caused by AXI access failure, only works when
debug monitor is enabled.

Enable this module on i.MX6SX.

Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit df6ac8531d498021ed379c74fc1847bd2cec7179)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(cherry picked from commit 4f4ecdbf6fe2673b8ad117df1a4974bdb7e6aa4a)
(cherry picked from commit e1c98a672e50fd0405686b74dad50680a75a8a9f)
2018-04-27 02:21:20 -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 e0cfa88953 ENGR00315894-77 mx6: soc: Add vadc power up/down function
Add vadc power up/down function.
When gis enable in uboot, the CSI0 input mux select setting
to vadc module, clean the bit when gis disabled

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
2018-04-27 02:21:19 -07:00
Ye.Li b6f962db57 ENGR00315894-76 mx6 clock: Add vadc clock enable function
Add vadc clock enable function.

Signed-off-by: Sandor Yu <R01008@freescale.com>
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit 721c7a1448c5b7265b597b83d18f8338a27ea213)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(cherry picked from commit 903a59ef941f39b6d7f693dd7c60528e166de079)
(cherry picked from commit dc767fb7d5c155f2a6ef01c4dee808b9c1944fc2)
(cherry picked from commit 0a48932f375a969e6f7e72d171522146981b2135)
2018-04-27 02:21:18 -07:00
Peng Fan d855bc0b78 MLK-11211 lcd: fix build warning
Fix build warning:
common/lcd.c: In function 'lcd_clear':
common/lcd.c:166:6: warning: variable 'bg_color' set but not used [-Wunused-but-set-variable]
int bg_color;
      ^
common/lcd.c: In function 'lcd_setmem':
common/lcd.c:296:2: warning: format '%d' expects argument of type 'int', but argument 2 has type 'u_long' [-Wformat=]
debug("LCD panel info: %d x %d, %d bit/pix\n", panel_info.vl_col,
  ^
common/lcd.c:296:2: warning: format '%d' expects argument of type 'int', but argument 3 has type 'u_long' [-Wformat=]

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(cherry picked from commit acfeb43685efb04423ce064c67228d15fa6d3da5)
(cherry picked from commit 69a7c6f0877f4a984209f1be3e14ed5fe56928ad)
2018-04-27 02:21:18 -07:00
Ye Li f56fdb7e6b MLK-12437-2 Video: Update the common board_video_skip to support MXS LCD
Update the board_video_skip to use CONFIG_VIDEO_MXS for LCD display support.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit d6d0265b09e66c576ab4c01841166415f834a1ff)
(cherry picked from commit 8fa188c1466e6a74536f1b46fff88bf9b08b0d78)
2018-04-27 02:21:18 -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 42a6fcbaf9 MLK-12483-3 mx6: Add a module fuse checking
Implement a functionality to read the soc fuses and check if any module
is fused. For fused module, we have to disable it in u-boot dynamically,
and change the its node in FDT to "disabled" status before starting the kernel.

In this patch, we implement the ft_system_setup for FDT fixup. This function will
be called during boot process or by "fdt systemsetup" command.

To enable the module fuse checking, two configurations must be defined:
CONFIG_MODULE_FUSE
CONFIG_OF_SYSTEM_SETUP

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 8aef13ebd92f709f4e6b80cf46c7cfe0f69bb211)
2018-04-27 02:21:17 -07:00
Ye Li d88863b467 MLK-18147-3 mx6sabreauto/sabresd: Port defconfigs from v2017.03
Add defconfigs to support various boot devices and platforms
for MX6DQ/DQP/DL/S sabreauto and sabresd boards.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:21:17 -07:00
Ye Li 3a3a0f07c8 MLK-18147-2 mx6sabreauto/sabresd: Update mx6dq/dqp/dl/s sabre boards codes
Porting the mx6dq/dqp/dl/s sabresd and sabreauto codes from v2017.03
The major change is moving back to non-SPL mode for sabre boards.
which means all old things like DCD, plugin are added back for each
platform. This inherits the way used in v2017.03

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:21:09 -07:00
Ye Li bedc2a2223 MLK-18147-1 arm: dts: mx6dq/dqp/dl/s: Porting DTS and binding files from v2017.03
Port the DTS and relevent binding files from v2017.03 for i.MX6DQ/DQP/DL/S
Sabreauto and SabreSD boards.

Removed the MMC alias from v2017.03, since the MMC will use it as device index when
DM MMC is enabled. This causes mismatch with Non-DM MMC case.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-27 02:19:50 -07:00
Ye Li 183c12aeec MLK-18146-4 mx6: Update mx6 common head file
Align the common head file with v2017.03, since some configurations
have been moved to Kconfig, so don't need them in mx6_common.h now.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:42 -07:00
Ye Li 86c6ba24e5 MLK-18146-3 mx6: Update pads definition files
Update the pins.h for i.MX6SL/UL/ULL to align with v2017.03

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:41 -07:00
Ye Li 4479d29d34 MLK-18146-2 mx6: Update registers mapping file
Update the CCM and AIPS registers mapping files to align with v2017.03

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:41 -07:00
Ye Li 82ecba4727 MLK-18146-1 mx6: Align SOC level codes with v2017.03
Update codes for i.MX6 soc and clock settings to align with v2017.03

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:41 -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
Richard Zhu a117fc7b2b ENGR00319415 pcie: random link down issue after warm-rst
There are about 0.02% percentage on some imx6q/dl/solo
hw boards, random pcie link down when warm-reset is used.
Make sure to clear the ref_ssp_en bit16 of gpr1 before
warm-rst, and set ref_ssp_en after the pcie clks are
stable to workaround it.

imx6sl doesn't have the pcie module, mask the pcie
related codes from imx6sl.

rootcause:
* gpr regisers wouldn't be reset by warm-rst, while the
ref_ssp_en is required to be reset by pcie.
(work-around in u-boot)
* ref_ssp_en should be set after pcie clks are stable.
(work-around in kernel)

Signed-off-by: Richard Zhu <r65037@freescale.com>
(cherry picked from commit 5cc825b12c6b86a22f1a6a0535b52cf3ee142e77)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
(cherry picked from commit 6193cf4e3384a59e29546d13a67657f7faeafc9e)
(cherry picked from commit 7b4aabeddffabca46d7d6e7ef2611de468a6b4f7)
2018-04-26 02:26:40 -07:00
Ye.Li c4ebac1b9a MLK-11064 imx: mx6qp: Adjust AQos settings for peripherals
To resolve USB camera bandwidth issue, the patch sets recommended AQoS
setting from IC team value for peripheral and only on imx6qp.

The address is: 0xbb0608, the value is: 0x80000201

Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit 11906c712a52e7a20caf71d7c5da4e951a59db29)
(cherry picked from commit 5dcf073b8f2479a2adbb8d9fb03d9c9c70664e32)
2018-04-26 02:26:40 -07:00
Ye Li 2d7e33530f MLK-12534 mx6: shutdown vddpu and PCIE phy to save power
Shutdown VDDPU and PCIE phy to save power.

For PCIE, the i.MX6SL and i.MX6UL does not have this module,
so don't need it.

For VDDPU, the i.MX6UL does not have GPU, does not need it. And on
i.MX6QP there is narrow window that PRE driver is ready but GPU driver probe later,
and the later GPU driver turn on PU may cause 'PRE hang' issue. To simplify
thing, do not turn off PU in u-boot.

Reference:
commit: 6b0787b726e2ff32210d742d93ecd3f4bb2ae402
commit: 4bd0032c0eba50fa0caf43f50f735a3cfbe36a8d

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 5c96ea91fe89c67991c929c9b39ffaa940d28391)
(cherry picked from commit 6a5442b41ef400edd0b332962a3450e909b85df5)
2018-04-26 02:26:39 -07:00
Ye Li be7aa84842 MLK-18145 imx: Fix wrong pad name prefix
The pads name bind with CONFIG_MX6Q and CONFIG_6DL should start with MX6_PAD
not MX6Q_PAD and MX6DL_PAD. Otherwise we will get build break.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:39 -07:00
Ye Li f0f452da4b MLK-18144 mx6: Change CONFIG_MX6D kconfig to select MX6Q
The i.MX6D is a variant of i.MX6Q. The only difference is the core number.
So we can select CONFIG_MX6Q to reduce duplicated codes and remove duplicated
usages of CONFIG_MX6D.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:39 -07:00
Ye Li a56c1d98d8 MLK-18143 mx6: Add CONFIG_MX6QP kconfig
Since i.MX6QP is a variant of i.MX6Q, the CONFIG_MX6QP will select CONFIG_MX6Q.
Users can use is_mx6dqp to distinguish them at runtime.

The reason to add this kconfig is plugin mode will use this configuration.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:38 -07:00
Ye Li 9d592121be MLK-10958 imx: mx6ul support Bus Encryption Engine
This patch is to support Bus Encryption Engine(BEE) for i.MX 6UL.
Supported feature:
1. SNVS key and soft key
2. CTR and ECB mode
3. Specify address region to bee.

Two commands are included:
bee init [key] [mode] [start] [end] - BEE block initial
    "Example: bee init 1 1 0x80000000 0x80010000\n"
bee test [region]
    "Example: bee test 1\n"

Mapping:
[0x10000000 - (0x10000000 + size - 1)] : [start - (start + size - 1)]
[0x30000000 - (0x30000000 + IRAM_SIZE - 1)] : [IRAM_BASE_ADDR -
(IRAM_BASE_ADDR + IRAM_SIZE - 1)]

Whatever start is, start - (start + size -1) will be fixed mapping to
0x10000000 - (0x10000000 + size - 1)

Since default AES region's protected size is SZ_512M, so
on mx6ul evk board, you can not simply run 'bee init', it will
overlap with uboot execution environment, you can use
'bee init 0 0 0x80000000 0x81000000'.

If want to use bee, Need to define CONFIG_CMD_BEE in board configuration
header file, since CONFIG_CMD_BEE default is not enabled.

This patch also checks fuse bit 25 of bank 0 word 4 before initialize bee.
The bit: 0 means bee enabled, 1 means bee disabled.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:38 -07:00
Ye Li 6bceaf0097 MLK-12495 mx6: Add LDO bypass support to i.MX6 SOC
Port LDO bypass SOC codes from v2017 to support the features:

1. Add check for 1.2GHz core speed. If Speed grading fuse is for 1.2GHz,
   enable LDO bypass and setup PMIC voltages. LDO bypass is dependent
   on the flatten device tree file.

2. We set WDOG_B in set_anatop_bypass() before, because it is the only case, but now
   on i.mx6sabreauto board, we didn't use ldo-bypass mode, but have to use WDOG_B to
   reboot whole board, so split these code to independent function so that board file
   can call it freely.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:38 -07:00
Ye Li ff8902ab14 MLK-18142 imx: timer: Modify GPT timer driver for mx7
Modify the GPT common platform driver for mx7 which only use 24Mhz
OSC as clock source.

Note: at default, the mx7d will use system counter as timer. The GPT
is disabled.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
2018-04-26 02:26:37 -07:00
Ye Li 75b6d78fbb MLK-18141-2 env: Kconfig: Add ENV_IS_IN_SATA config
The ENV_IS_IN_SATA config is missed, add it into env/Kconfig, that
we can enable it for SATA boot.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:37 -07:00
Ye Li aaef173cba MLK-18141-1 env: sata: Fix build warning and break
Fix below build warning and errors:
env/sata.c: In function ‘env_sata_save’:
env/sata.c:59:9: warning: implicit declaration of function ‘sata_get_dev’ [-Wimplicit-function-declaration]
  sata = sata_get_dev(env_sata);
         ^~~~~~~~~~~~
env/sata.c:59:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  sata = sata_get_dev(env_sata);
       ^
env/sata.c: In function ‘env_sata_load’:
env/sata.c:101:10: warning: ‘return’ with a value, in function returning void
   return -EIO;
          ^
env/sata.c:94:13: note: declared here
 static void env_sata_load(void)
             ^~~~~~~~~~~~~
env/sata.c:105:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  sata = sata_get_dev(env_sata);
       ^
env/sata.c:108:10: warning: ‘return’ with a value, in function returning void
   return -EIO;
          ^
env/sata.c:94:13: note: declared here
 static void env_sata_load(void)
             ^~~~~~~~~~~~~
env/sata.c:113:10: warning: ‘return’ with a value, in function returning void
   return -EIO;
          ^
env/sata.c:94:13: note: declared here
 static void env_sata_load(void)
             ^~~~~~~~~~~~~
env/sata.c:116:9: warning: ‘return’ with a value, in function returning void
  return env_import(buf, 1);
         ^~~~~~~~~~~~~~~~~~
env/sata.c:94:13: note: declared here
 static void env_sata_load(void)
             ^~~~~~~~~~~~~
env/sata.c: At top level:
env/sata.c:120:14: error: ‘ENVL_ESATA’ undeclared here (not in a function)
  .location = ENVL_ESATA,
              ^~~~~~~~~~
env/sata.c:122:11: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  .load  = env_sata_load,

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:37 -07:00
Ye Li dbb414245b MLK-14828 env_sata: Fix SATA saveenv issue
Wrong env buffer was passed into sata write function, so the saveenv can't work.
Fix this issue.

Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 0fe7573cffcb50d6bcb401f644cc37f5af28b388)
2018-04-26 02:26:36 -07:00
Ye Li 6220bb6fb4 ENGR00328312 i2c: imx: Optimize the i2c device recovery solution
From i2c spec, if device pull down the SDA line that causes
i2c bus dead, host can send out 9 clock to let device release
SDA.

But for some special device like pfuze100, it pull down SDA line
and the solution cannot take effort.

The patch just add NACK and STOP signal after 8 dummy clock, and pmic
can release SDA line after the recovery. Test case catch 375 times of
i2c hang, and all are recovered.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:36 -07:00
Ye Li db7ae71814 MLK-10496: Check the PL310 version for applying errata
Apply errata based on PL310 version instead of compile
time. Also set Prefetch offset to 15, since it improves
memcpy performance by 35%. Don't enable Incr double
Linefill enable since it adversely affects memcpy
performance by about 32MB/s and reads by 90MB/s. Tested
with 4K to 16MB sized src and dst aligned buffer.

Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2018-04-26 02:26:25 -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
Tom Rini f95ab1fb6e Prepare v2018.03
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-03-13 08:02:19 -04:00
Bryan O'Donoghue ca89df7dd4 imx: hab: Convert DCD non-NULL error to warning
commit 8c4037a09a ("imx: hab: Ensure the IVT DCD pointer is Null prior
to calling HAB authenticate function.") makes the DCD field being NULL a
dependency.

This change though will break loading and executing of existing pre-signed
binaries on a u-boot update i.e. if this change is deployed on a board you
will be forced to redo all images on that board to NULL out the DCD.

There is no prior guidance from NXP that the DCD must be NULL similarly
public guidance on usage of the HAB doesn't call out this NULL dependency
(see boundary devices link).

Since later SoCs will reject a non-NULL DCD there's no reason to make a
NULL DCD a requirement, however if there is an actual dependency for later
SoCs the appropriate fix would be to do SoC version checking.

Earlier SoCs are capable (and happy) to authenticate images with non-NULL
DCDs, we should not be forcing this change on downstream users -
particularly if it means those users now must rewrite their build systems
and/or redeploy signed images in the field.

Fixes: 8c4037a09a ("imx: hab: Ensure the IVT DCD pointer is Null prior
to calling HAB authenticate function.")

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Link: https://boundarydevices.com/high-assurance-boot-hab-dummies
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-03-13 07:51:32 -04:00
Breno Lima 6d7403bf72 doc: mxc_hab: Update i.MX HAB documentation
The README.mxc_hab is outdated and need improvements, add the following
modifications:

- Reorganize document and remove duplicate content
- Add CST download link
- Update CST package name
- Align command lines with CST v2.3.3
- Update U-Boot binary name
- Remove CSF padding since is not documented in AN4581

Signed-off-by: Breno Lima <breno.lima@nxp.com>
2018-03-11 16:00:21 +01:00
Breno Lima b887f0a68e doc: mxc_hab: Move HAB related info to the appropriate doc
Currently the High Assurance Boot procedure is documented in two
places:

- doc/README.imx6
- doc/README.mxc_hab

It is better to consolidate all HAB related information into
README.mxc_hab file, so move the content from README.imx6 to
README.mxc_hab.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-03-11 16:00:16 +01:00
Bryan O'Donoghue f0d5bd4ba5 imx: hab: Make usage of packed attribute consistent
commit cd2d46003c ("arm: imx: hab: Add IVT header definitions") declares
struct ivt_header as "__attribute__((packed))".

commit ed286bc80e ("imx: hab: Check if CSF is valid before
authenticating image") declares struct hab_hdr with __packed.

This patch makes the __packed convention consistent.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-03-11 16:00:00 +01:00
Bryan O'Donoghue ffab61f4aa imx: hab: Fix usage of packed attribute
commit ed286bc80e ("imx: hab: Check if CSF is valid before authenticating
image") makes use of "__packed" as a prefix to the "struct hab_hdr"
declaration.

With my compiler "gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)" we
get:

./arch/arm/include/asm/mach-imx/hab.h:42:25: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘{’ token
 struct __packed hab_hdr {

Fix this problem by including <linux/compiler.h>

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-03-11 15:59:51 +01:00
Jagan Teki 2b0bc47661 ARM: dts: imx6dl-icore-rqs: Fix to include correct dtsi
This patch fixes the wrongly included dtsi file which was
breaking mainline support for Engicam i.CoreM6 DualLite/Solo RQS.

Linux commit details for the same change as
"ARM: dts: imx6dl: Include correct dtsi file for Engicam i.CoreM6
DualLite/Solo RQS"
(sha1: c0c6bb2322964bd264b4ddedaa5776f40c709f0c)

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-03-11 15:59:43 +01:00