Commit Graph

43728 Commits

Author SHA1 Message Date
Ley Foon Tan
86f032e630 arm: socfpga: Add system manager for Arria 10
Add system manager register struct and macros for Arria 10.

Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-05-18 11:33:18 +02:00
Ley Foon Tan
177ba1f927 arm: socfpga: Add clock driver for Arria 10
Add clock driver support for Arria 10.

Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-05-18 11:33:17 +02:00
Ley Foon Tan
827e6a7e0d arm: socfpga: Add reset driver support for Arria 10
Add reset driver support for Arria 10.

Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-05-18 11:33:17 +02:00
Ley Foon Tan
d83b8193ad arm: socfpga: Add A10 macros
Add i2c, timer and other A10 macros.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-05-18 11:33:17 +02:00
Ley Foon Tan
d1c559af5f arm: socfpga: Restructure misc driver
Restructure misc driver in the preparation to support A10.
Move the Gen5 specific code to gen5 file.

Change all uint32_t_to u32.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-05-18 11:33:17 +02:00
Ley Foon Tan
4ddd541d6c arm: socfpga: Restructure system manager
Restructure system manager in the preparation to support A10.
No functional change.

Change uint32_t to u32.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-05-18 11:33:17 +02:00
Ley Foon Tan
2b09ea48dd arm: socfpga: Restructure reset manager driver
Restructure reset manager driver in the preparation to support A10.
Move the Gen5 specific code to gen5 files.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-05-18 11:33:17 +02:00
Ley Foon Tan
de77811589 arm: socfpga: Restructure clock manager driver
Restructure clock manager driver in the preparation to support A10.
Move the Gen5 specific code to _gen5 files.

- Change all uint32_t to u32 and change to use macro BIT(n) for bit shift.
- Check return value from wait_for_bit(). So change return type to int for
  cm_write_with_phase() and cm_basic_init().

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2017-05-18 11:33:16 +02:00
Liam Beguin
9ad69f0ba4 usb: lpc32xx: add i2c DM support
Add DM support for i2c functions.

Signed-off-by: Liam Beguin <lbeguin@tycoint.com>
Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2017-05-18 11:31:56 +02:00
Peng Fan
c1d1e9d677 pinctrl: imx: fix memory leak
Each time set_state is called, a new piece memory will
be allocated for pin_data, but not freed, this will
incur memory leak.

When error, the devm API could not free memory automatically.
So need call devm_kfree when error.

Issue reported by Coverity

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Agner <stefan.agner@toradex.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:34 +02:00
Stefano Babic
8ae5bb37fc imx: mx7dsabresd: fix secure config after switching to DM
mx7dsabresd_secure_defconfig was not updated after moving to DM.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:34 +02:00
Peng Fan
d1e204b566 imx: mx7dsabresd: switch to DM USB
Switch to use DM USB.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2017-05-18 11:24:34 +02:00
Peng Fan
709fef5131 imx: mx7dsabresd: reset ENET_RST_B
Reset ENET_RST_B to make ENET function stable.
Since DM_GPIO enabled, we use "gpio_spi@0_5" which corresponds
to ENET_RST_B.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:34 +02:00
Peng Fan
6fbbcfdf06 imx: mx7dsabresd: enable more DM drivers
Enable more DM drivers. The imx I2C/MMC DM drivers needs DM_GPIO
enabled. The 74x164 drivers needs SOFT_SPI and DM_GPIO enabled.
So needs to enable them together.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:34 +02:00
Peng Fan
aab203eb2e gpio: 74x164: make oe-pins optional
Make oe-pins optional because some boards have fixed it to enable.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-05-18 11:24:34 +02:00
Peng Fan
41eb8ff5ea spi: kconfig: add soft spi Kconfig entry
Add the Kconfig entry for SOFT_SPI which uses gpio to simulate the
SPI signals. We use it for accessing 74x164 on some i.MX boards.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Jagan Teki <jagan@openedev.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:34 +02:00
Peng Fan
e02ec19f4d arm: dts: imx7d-sdb: add usdhc support
Add usdhc support

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2017-05-18 11:24:34 +02:00
Peng Fan
00ad3a9f73 arm: dts: imx7d-sdb: add i2c support
Add i2c support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:34 +02:00
Peng Fan
63f3401d23 arm: dts: imx7d-sdb: add regulator node for usb and mmc
Add regulator node for usb and mmc.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:34 +02:00
Peng Fan
9880eed8bd arm: dts: imx7d-sdb: add spi gpio node
Add spi gpio node for 74LV595.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:34 +02:00
Peng Fan
896d2e82e6 arm: dts: imx7d-sdb add basic dts
Add basic dts for i.MX7D-SDB board.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:33 +02:00
Peng Fan
993274f485 arm: dts: imx7: sync with Linux
Sync with Linux commit 308ac756("Merge tag 'gpio-v4.11-3'").

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefan Agner <stefan.agner@toradex.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Stefano Babic <sbabic@denx.de>
2017-05-18 11:24:33 +02:00
Tim Harvey
9f0a3ac1b2 imx: ventana: update imx wdog external reset dt property
Early backports of the imx wdog external reset feature occured before the
property was accepted upstream and used 'ext-reset-output' instead of
'fsl,ext-reset-output'. In order to support older kernels remove both
properties.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2017-05-18 11:24:33 +02:00
Tim Harvey
27388d561c imx: ventana: fix GW520x external watchdog dt update
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2017-05-18 11:24:33 +02:00
Fabio Estevam
e2bab4b9ea mx6sabresd: Remove non-SPL targets
Now that mx6sabresd_spl_defconfig can be used to boot all
mx6sabresd variants, the non-SPL targets can be safely removed.

Signed-off-by: Fabio Estevam <fabio.estvam@nxp.com>
2017-05-18 11:24:33 +02:00
Fabio Estevam
b22841e582 mx6sabresd: Add SPL support for the mx6dl variant
Add support for the mx6dlsabresd board in SPL.

Retrieved the DCD table from:
board/freescale/mx6sabresd/mx6dlsabresd.cfg
(NXP U-Boot branch imx_v2015.04_4.1.15_1.0.0_ga)

Flashed SPL and u-boot.img to an SD card and could successfully boot it
on mx6q, mx6qp and mx6dl sabresd boards.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-05-18 11:24:33 +02:00
Fabio Estevam
ff9f71b499 mx6sabresd: Prepare for supporting MX6DL
Currently only MX6Q/QP sabresd boards are supported in SPL.

In order to also support MX6DL we need to convert to using
IOMUX_PADS and SETUP_IOMUX_PADS macros.

Other than that move the <asm/arch/mx6-ddr.h> header inclusion to the
SPL code block in order to avoid build error.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
2017-05-18 11:24:33 +02:00
Jagan Teki
f9247569d8 engicam: common: Move board_late_init
Move board_late_init into common area from supported boards.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
ac880e7742 engicam: common: Move common board code
Move possible common board code into common area
from supported boards.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
a81b0fd667 geam6/isiot: Move the spl code common
SPL code for geam6 and isiot are same, so
move them in common area.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
d8de3c7326 icorem6[_rqs]: Move the spl code common
SPL code for icorem6 and icorem6_rqs are same, so
move them in common area.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
534bf2cc44 i.MX6UL: isiot: Add SETUP_IOMUX_PADS
Add generic SETUP_IOMUX_PADS function, for imx6ul mux pads
and use them in Is.IoT board.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
5f31ed4939 isiot: Fix to use usdhc2_pads for mmc2
mmc2 in Is.IoT using usdhc1_pads instead usdhc2_pads,
so update the same.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
671f458aae i.MX6UL: geam6ul: Add SETUP_IOMUX_PADS
Add generic SETUP_IOMUX_PADS function, for imx6ul mux pads.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
c0e2972741 icorem6: Use drive strength macros
Use driver strength macros instead of hex numbers.
- IMX6DQ_DRIVE_STRENGTH - 0x30
- IMX6SDL_DRIVE_STRENGTH - 0x28

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
d456ab0733 icorem6: Use proper iomux_ddr_regs drive strength values
Usually the drive strength values for DQ and SDL are 0x30 and
0x28 respectively, update them accordingly.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
b805b17466 engicam: Move uart mux init to SPL
Since, u-boot handle fdt through uart so move the UART code
to SPL instead make it to global area.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
bc1fe9006d icorem6: Make SPL to pick suitable fdt
SPL FIT is able to pick the suitable fdt file for u-boot,
so add that function through board_fit_config_name_match.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
6f1f3f59ed engicam: Set fdt_file env during run-time
Set fdt_file env variable during board_late_init

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
08273bc260 geam6ul: Add mmc_late_init
Let the runtime code can set the mmcdev and mmcroot based
on the devno using mmc_get_env_dev instead of defining
separately in build-time configs using mmc_late_init func.

Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
9786496cdc geam6ul: Add modeboot env via board_late_init
Add runtime, modeboot env which is setting mmcboot, or
nandboot based on the bootdevice so-that conditional
macros b/w MMC and NAND for CONFIG_BOOTCOMMAND should
be avoided in config files.

Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
4bbd40596b icorem6: Add mmc_late_init
Let the runtime code can set the mmcdev and mmcroot based
on the devno using mmc_get_env_dev instead of defining
separately in build-time configs using mmc_late_init func.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Jagan Teki
98f5661033 icorem6: Add modeboot env via board_late_init
Add runtime, modeboot env which is setting mmcboot, or
nandboot based on the bootdevice so-that conditional
macros b/w MMC and NAND for CONFIG_BOOTCOMMAND should
be avoided in config files.

Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2017-05-18 11:23:31 +02:00
Peng Fan
354fa86710 imx-common: rdc-sema: correct return value
When unlock, if caller is not the sema owner,
return -EACCES, not 1.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:23:31 +02:00
Peng Fan
80512547ba thermal: imx: fix calculation
Fix calculation. do_div can not handle negative values.
Use div_s64_rem to handle the calculation.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:23:31 +02:00
Peng Fan
4fac417168 imx: thermal: update imx6 thermal driver according new equation
>From IC guys:
"
After a thorough accuracy study of the Temp sense circuit,
we found that with our current equation, an average part can
read 7 degrees lower than a known forced temperature.
We also found out that the standard variance was around 2C;
which is the tightest distribution that we could create.
We need to change the temp sense equation to center the average
part around the target temperature.
"

New equation:
Tmeas = (Nmeas - n1) / slope + t1 + offset
n1= fused room count
t1= 25
offset=3.580661
slope= 0.4148468 – 0.0015423*n1

According the new equation, update the thermal driver.
c1 and c2 changed to u64 type and update comments.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
2017-05-18 11:23:31 +02:00
Peng Fan
2096da452b imx-common: timer: clean up
Drop the unneeded code. lib/time.c use timebase_l/h.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Stefano Babic <sbabic@denx.de>
2017-05-18 11:23:31 +02:00
Fabio Estevam
9e408a39b4 mx25pdk: Add fuse API support
Select CONFIG_FSL_IIM and CONFIG_CMD_FUSE so that the fuse API can
be used.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
2017-05-18 11:23:31 +02:00
Andy Duan
979a58936b net: fec_mxc: specify the registered eth index by dev_id
Specify the registered eth index by dev_id.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
2017-05-18 11:23:31 +02:00
Andy Duan
f01e4e1e14 net: fec_mxc: avoid transfer dev_id -1 to get mac address from fuse
Avoid transfer parameter dev_id value with "-1" to .fec_get_hwaddr(),
it should transfer fec->dev_id to get mac address from fuse.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2017-05-18 11:23:31 +02:00