Commit Graph

83 Commits

Author SHA1 Message Date
Simon Glass
382bee57f1 env: Rename setenv() to env_set()
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:22:18 -04:00
Stefano Babic
552a848e4f imx: reorganize IMX code as other SOCs
Change is consistent with other SOCs and it is in preparation
for adding SOMs. SOC's related files are moved from cpu/ to
mach-imx/<SOC>.

This change is also coherent with the structure in kernel.

Signed-off-by: Stefano Babic <sbabic@denx.de>

CC: Fabio Estevam <fabio.estevam@nxp.com>
CC: Akshay Bhat <akshaybhat@timesys.com>
CC: Ken Lin <Ken.Lin@advantech.com.tw>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Heiko Schocher <hs@denx.de>
CC: "Sébastien Szymanski" <sebastien.szymanski@armadeus.com>
CC: Christian Gmeiner <christian.gmeiner@gmail.com>
CC: Stefan Roese <sr@denx.de>
CC: Patrick Bruenn <p.bruenn@beckhoff.com>
CC: Troy Kisky <troy.kisky@boundarydevices.com>
CC: Nikita Kiryanov <nikita@compulab.co.il>
CC: Otavio Salvador <otavio@ossystems.com.br>
CC: "Eric Bénard" <eric@eukrea.com>
CC: Jagan Teki <jagan@amarulasolutions.com>
CC: Ye Li <ye.li@nxp.com>
CC: Peng Fan <peng.fan@nxp.com>
CC: Adrian Alonso <adrian.alonso@nxp.com>
CC: Alison Wang <b18965@freescale.com>
CC: Tim Harvey <tharvey@gateworks.com>
CC: Martin Donnelly <martin.donnelly@ge.com>
CC: Marcin Niestroj <m.niestroj@grinn-global.com>
CC: Lukasz Majewski <lukma@denx.de>
CC: Adam Ford <aford173@gmail.com>
CC: "Albert ARIBAUD (3ADEV)" <albert.aribaud@3adev.fr>
CC: Boris Brezillon <boris.brezillon@free-electrons.com>
CC: Soeren Moch <smoch@web.de>
CC: Richard Hu <richard.hu@technexion.com>
CC: Wig Cheng <wig.cheng@technexion.com>
CC: Vanessa Maegima <vanessa.maegima@nxp.com>
CC: Max Krummenacher <max.krummenacher@toradex.com>
CC: Stefan Agner <stefan.agner@toradex.com>
CC: Markus Niebel <Markus.Niebel@tq-group.com>
CC: Breno Lima <breno.lima@nxp.com>
CC: Francesco Montefoschi <francesco.montefoschi@udoo.org>
CC: Jaehoon Chung <jh80.chung@samsung.com>
CC: Scott Wood <oss@buserror.net>
CC: Joe Hershberger <joe.hershberger@ni.com>
CC: Anatolij Gustschin <agust@denx.de>
CC: Simon Glass <sjg@chromium.org>
CC: "Andrew F. Davis" <afd@ti.com>
CC: "Łukasz Majewski" <l.majewski@samsung.com>
CC: Patrice Chotard <patrice.chotard@st.com>
CC: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
CC: Hans de Goede <hdegoede@redhat.com>
CC: Masahiro Yamada <yamada.masahiro@socionext.com>
CC: Stephen Warren <swarren@nvidia.com>
CC: Andre Przywara <andre.przywara@arm.com>
CC: "Álvaro Fernández Rojas" <noltari@gmail.com>
CC: York Sun <york.sun@nxp.com>
CC: Xiaoliang Yang <xiaoliang.yang@nxp.com>
CC: Chen-Yu Tsai <wens@csie.org>
CC: George McCollister <george.mccollister@gmail.com>
CC: Sven Ebenfeld <sven.ebenfeld@gmail.com>
CC: Filip Brozovic <fbrozovic@gmail.com>
CC: Petr Kulhavy <brain@jikos.cz>
CC: Eric Nelson <eric@nelint.com>
CC: Bai Ping <ping.bai@nxp.com>
CC: Anson Huang <Anson.Huang@nxp.com>
CC: Sanchayan Maity <maitysanchayan@gmail.com>
CC: Lokesh Vutla <lokeshvutla@ti.com>
CC: Patrick Delaunay <patrick.delaunay@st.com>
CC: Gary Bisson <gary.bisson@boundarydevices.com>
CC: Alexander Graf <agraf@suse.de>
CC: u-boot@lists.denx.de
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-07-12 10:17:44 +02:00
Simon Glass
10e40d54b3 Kconfig: Add CONFIG_SATA to enable SATA
At present CONFIG_CMD_SATA enables the 'sata' command which also brings
in SATA support. Some boards may wish to enable SATA without the command.
Add a separate CONFIG to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11 10:08:19 -06:00
Simon Glass
5d9828563f arm: Include asm/setup.h explictly
Include this header where needed so we do not need to rely on common.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05 11:02:37 -04: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
Tom Rini
9ba8b9bdd7 gw_ventana: Fix unused variable warnings
The variable nfc_pads is only referenced when CONFIG_CMD_NAND is set,
move the existing guard and drop a now redundant comment.  The variable
gwproto_gpio_pads is never referenced, remove it.

Cc: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-05-12 08:37:26 -04:00
Tim Harvey
214fb19bcc imx: ventana: add GW5903 support
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2017-03-20 19:10:50 +01:00
Tim Harvey
94a1d6c602 imx: ventana: add GW560x support
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2017-03-20 19:10:39 +01:00
Tim Harvey
8d1a6ff825 imx: ventana: add GW5904 support
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2017-03-20 19:10:22 +01:00
Tim Harvey
f938500f2c imx: ventana: make OTG VBUS power enable board specific
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
2017-03-19 17:30:03 +01:00
Tim Harvey
db1964cad7 imx: ventana: fix hwconfig
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
2017-03-19 17:29:58 +01:00
Tim Harvey
65da5c3b65 imx: ventana: move mmc_init to common
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
2017-03-19 17:29:46 +01:00
Tim Harvey
a5bfb4ff9e imx: ventana: add dt fixup for watchdog external reset
Added removal of the fsl,ext-reset-output property in the wdog node for board
revisions that pre-date the addition of the external watchdog reset signal.

This property is a recent addition to mainline linux kernel in order to
specify that the IMX watchdog external reset should be used instead of the
internal chip-level reset.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-07-28 13:27:18 +02:00
Tim Harvey
966fe02ee6 imx: ventana: refactor board-specific dt fixups (no functional change)
Re-factor the board-specific dt fixups so that they are easier to follow
and extend in the future:
 - use defines for DT paths
 - use switch/case per board
 - order models numerically

There is no functional change in the code

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-07-28 13:27:18 +02:00
Tim Harvey
5911c0924f imx: ventana: make hwconfig initialize based on board configuration
The hwconfig env var allows user to control hardware specific configuration
of board specific features but not all Ventana boards have the same features.

We will use the magic default value of "_UNKNOWN_" to signify that the
bootloader should create this based on detected board model.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-07-28 13:27:18 +02:00
Tim Harvey
1800ffa83e imx: ventana: make number of digital I/O's dynamic
Replace the static list of board-specific digital I/O's with a dynamic list.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-07-28 13:27:18 +02:00
Tim Harvey
5c34c2abb8 imx: ventana: add dt fixup for eth1 mac-address
Ventana boards with a PCI Marvell Sky2 GigE MAC require the MAC address to
be placed in a DT node in order for the mainline linux driver to obtain it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-07-28 13:27:16 +02:00
Tim Harvey
5a08ad6fdc imx: ventana: add dt fixup for GW16082 irq mapping
The GW16082 mini-PCI expansion mezzanine uses a TI XIO2001 PCIe-to-PCI
bridge with legacy INTA/B/C/D interrupts. These interrupts are assigned
in the reverse order according to the PCI spec.

If the TI bridge is found on the Ventana PCI bus, add device-tree nodes
according to bus enumeration explicitly defining the interrupt mapping
to override the default PCI mapping in the Linux kernel. This allows
the GW16082 to work with upstream kernels that support device-tree
irq parsing.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-07-28 13:27:16 +02:00
Tom Rini
3fc304b8d7 Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2016-06-12 12:51:34 -04:00
Tim Harvey
34b080b79c imx: ventana: add fdt fixup to enable UHS-I support on selected boards
UHS-I support is available on Ventana boards with micro-SD sockets depending
on the board revision. For backwards compatibility to not break users
who have old bootloaders and newer kernels the device-tree on boards with
microSD disables UHS-I support by default by defining the no-1-8-v property
in the esdhc controller node. For models/revisions that support switchable
1.8V/3.3V I/O which is detectable by the presence of a pull-down on the
SD3_VSELECT pin we remove that property to enable support in the kernel.

Additionally we add SD3_VSELECT to the pinmux for clarity (even though U-Boot
does not currently support UHS-I modes requiring 1.8V I/O).

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-05-31 17:26:27 +02:00
Tim Harvey
385575bcb6 imx: ventana: add GW553x support
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-05-31 17:26:12 +02:00
Tim Harvey
f17a9af846 imx: ventana: enable pwm device-tree property based on hwconfig
Most Ventana boards have a connector with off-board digital-I/O signals
including some that can be pinmuxed as either a PWM or a GPIO. The hwconfig
env variable is used to configure these and they will be pinmuxed according
to this configuration in the bootloader.

This patch adds a device-tree fixup that will enable the pwm controller
nodes appropriately for digital-I/O's that are configured as pwm via hwconfig
so that the pin can be used with the Linux kernel /sys/class/pwm API.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-05-31 17:25:31 +02:00
Tim Harvey
7853262330 imx: ventana: export backlight gpio after gpio driver is available
Calling request_gpio to register bklt_gpio with the GPIO driver had no effect
in setup_display called from early board init (although pinmuxing it and
configuring it as output-low does do what it should). Therefore move the
request_gpio later in enable_lvds so that its registered for use by the
gpio command if LVDS is actually enabled.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-05-31 17:25:02 +02:00
Robert P. J. Day
7ffe3cd62e Delete tests of CONFIG_OF_LIBFDT when testing CONFIG_OF_BOARD_SETUP
Since CONFIG_OF_BOARD_SETUP depends on CONFIG_OF_LIBFDT:

  config OF_BOARD_SETUP
          bool "Set up board-specific details in device tree before boot"
          depends on OF_LIBFDT
          ...

remove superfluous tests of CONFIG_OF_LIBFDT when testing for
CONFIG_OF_BOARD_SETUP.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
[trini: Typo fix: s/ifdefi/ifdef/]
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-05-27 15:41:16 -04:00
Tim Harvey
c2fd3f5704 imx: ventana: skip mtdparts fixup if no flash
This avoids an error message on NAND-less boards.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-06-01 09:48:23 +02:00
Tim Harvey
80d1a3ee72 imx: ventana: make fdt_file1 and fdt_file2 automatic and non-overridable
The fdt_file1 and fdt_file2 vars provide fallbacks for the fdt file loading
script. There is no need to allow the user to override these as if they
want to specify the fdt, they should do so in the first attempt which is
the fdt_file var.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-06-01 09:48:23 +02:00
Tim Harvey
40c746758c imx: ventana: make model env var automatic and non-overridable
We want to model env var to always reflect what was in the EEPROM. There
is no point in allowing a user to override this.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-06-01 09:48:23 +02:00
Tim Harvey
9a83a81545 imx: ventana: various board-specific GPIO config updates
- Added iomux for CAN_STBY and RS484_TEN (GW52xx/GW53xx/GW54xx/GW551x)
- Moved iomux of USBHUB_RST# out of board_ehci_hcd_init so that it is
  done regardless of USB being initialized in bootloader
- Added usb_sel iomux/hwconfig for GW552x
- Fixed mezzanine DIO for GW54xx
- Fixed PANLEDR# for GW54xx
- Fixed dio iomux/hwconfig for GW552x
- Fixed dio iomux for GW551x
- removed redundant #define

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-06-01 09:48:23 +02:00
Tim Harvey
6d38f3a85d imx: ventana: detect pmic using i2c probe instead of board model
Avoid requiring board-model and probe pmic by its i2c address.
This is in preparation for being able to call pmic_setup() from SPL
and not need board type.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-05-15 19:21:25 +02:00
Tim Harvey
2d833c8528 imx: ventana: move GSC boot watchdog disable function to gsc.c
Move the code that disables the GSC boot watchdog into gsc.c

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-05-15 19:21:25 +02:00
Tim Harvey
e56c5791af imx: ventana: split out common functions between SPL and uboot
Move shared functions used by both SPL and U-Boot to common.c:
 - setup_iomux_uart() and uart pad config
 - gpio pad config

In the process also moved the following to common.c in preparation for
calling it from the SPL:
 - split i2c setup into a shared function
 - move pmic init to setup_pmic() function to call directly from
   power_init_board()
 - split gpio setup into early (iomux and default pin config)
   and late (output configuration based on env)

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-05-15 19:21:25 +02:00
Tim Harvey
77c5501893 imx: ventana: default msata/pci mux to pci before PCI enumeration
PCI enumeration occurs early, before we fully configure our GPIO's. Make
sure we steer the MSATA/PCI mux to PCI in board_init to ensure PCI is
selected before enumeration.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-05-15 19:21:25 +02:00
Tim Harvey
9ec3c8d4b0 imx: ventana: fix pcie reset for GW522x
The re-assignment of pcie_rst gpio for GW522x needs to occur earlier, before
the PCI subsystem calls the toggle funciton.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-05-15 19:21:25 +02:00
Tim Harvey
d41c8c8ece imx: ventana: enable DM_SERIAL
mxc_serial supports DM so lets use it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-05-15 19:21:25 +02:00
Tim Harvey
def6031533 imx: ventana: register gpio's with gpio_request
Prior to using a gpio a call to gpio_request() should be called to register
it with the gpio subsystem.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-05-15 19:21:25 +02:00
Tim Harvey
18b3a91a8f imx: ventana: set HDMI video in to yuv422bt656 for GW551x-A
The initial revision of the GW551x does not connect enough signals between
the HDMI receiver and the IMX6 CSI for 16bit capture mode necessary for
yuv422smp capture. Future revisions will, but for the initial rev force it
to yuv422bt656 mode which requires an 8bit video data bus.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:12 +02:00
Tim Harvey
a2559f113c imx: ventana: use hdmiinfmt env var to override HDMI capture format
The HDMI receiver used on the GW54xx and GW551x has a 16bit video data bus
interconnect between it and the IMX6 CSI. This can be used in two different
modes, each having advantages and disadvantages. Allow the hdmiinfmt env
var to specify which format is desired (yuv422smp or yuv422bt656).

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:12 +02:00
Pushpal Sidhu
e9fc6d137b imx: ventana: add DT fixup for GW522x to change PCIE_RST# GPIO
The GW522x is functionally the same as a GW52xx except for PCIE_RST#
GPIO. Add a DT fixup to change this gpio upon bootup.

Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:12 +02:00
Tim Harvey
ee5931d488 imx: ventana: add 'gsc wd' command for enabling and disabling GSC watchdog
This adds information about the Gateworks System Controller to the gsc command
such as the firmware version, firmware CRC and status of the GSC watchdog
(if its enabled and if its tripped).

Additionally the 'gsc wd' command can be used to enable or disable the
watchdog with the following usage:
 gsc wd enable [30|60]
 gsc wd disable

Note that the GSC registers are battery-backed by the GSC coincell so once
eanbled, they remain enabled across power-cycles or until either the GSC
firmware has been updated or FLASH has been re-programmed by the Gateworks
JTAG adapter.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:11 +02:00
Tim Harvey
4569cd561d imx: ventana: added device-tree display configuration for LVDS displays
Configure kernel device-tree for display from env var. This is useful
to specify the display present when the device-tree supports multiple
non-detectable display configurations.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:11 +02:00
Tim Harvey
f02390b6ab imx: ventana: add support for DLC-700JMGT4 and DLC-800FIGT3 LCD displays
Add LVDS support for two LVDS LCD displays:
 DLC-700JMGT4 - 7" 1024x600
 DLC-800FIGT3 - 8" 1024x768

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:11 +02:00
Tim Harvey
95069704cd imx: ventana: add DT fixup for GW54xx compatibility with older kernels
Certain older kernels in use by some customers erroneously define a uart3
for GW54xx with a pinmux that conflicts with NAND. This will remove
that node to avoid such conflicts.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:11 +02:00
Tim Harvey
eeca451ace imx: ventana: added DT fixup for GW551x-A video input
The GW551x-A revision does not have the CSI0_DATA_EN pin connected, therefore
we need to make sure that signal is not muxed to the CSI_DATA_EN signal
internally and do so by steering it to the unused GPIO5_IO20.

We do this so that the kernel device-tree can properly define the signal for
RevB and beyond boards that do have this hooked up properly and require it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:10 +02:00
Tim Harvey
e7329174c8 imx: ventana: add mem_mb dynamic env var
Certain OS bootscripts need to know how much memory a board has to adjust
kernel parameters (namely Android). This allows those boards to determine
mem size in MB.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:10 +02:00
Tim Harvey
aec3761a77 imx: ventana: only pinmux FEC enet signals for boards using it
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:09 +02:00
Tim Harvey
7c5cd42ab1 imx: ventana: add wdis config for GW5520
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:09 +02:00
Tim Harvey
75f21e3131 imx: ventana: Add support for GW551x
The GW551x is a small form factor board based on the IMX6 SoC that includes:
 * up to 512MB DDR3 memory
 * up to 2GB NAND flash
 * 1x miniPCIe socket (with USB)
 * HDMI out (micro-HDMI)
 * HDMI in (micro-HDMI)
 * TTL level I/O (supported by GW16111 breakout board):
  * I2C
  * 2x UART
  * CAN
  * 2x DIO (GPIO/PWM)
  * USB OTG

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:09 +02:00
Tim Harvey
0c81b14fac imx: ventana: disable IMX6 watchdogs on GW51xx RevA and RevB
A board level errata causes the IMX6 watchdog to be unstable on the GW51xx
RevA and RevB boards which can cause the watchdog to trip extremely early
(under 5seconds) under certain operating conditions. Disable the watchdog
node in the device-tree to work around this issue.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:09 +02:00
Tim Harvey
1274bd2c27 imx: ventana: fix various sparse warnings
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:08 +02:00