Commit Graph

29980 Commits

Author SHA1 Message Date
Przemyslaw Marczak cc73d37b7f dm: core: device: add function: dev_get_driver_ops()
This commit extends the driver model device's API by function:
- dev_get_driver_ops()

And this function returns the device's driver's operations if given:
- dev pointer, is non-NULL
- dev->driver->ops pointer, is non-NULL
in other case the, the NULL pointer is returned.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-22 11:03:15 -06:00
Przemyslaw Marczak b7af1a2da7 dm: core: uclass: add function: uclass_get_device_by_name()
This commit extends the driver model uclass's API by function:
- uclass_get_device_by_name()

And this function returns the device if:
- uclass with given ID, exists,
- device with exactly given name(dev->name), exists,
- device probe, doesn't return an error.

The returned device is activated and ready to use.

Note:
This function returns the first device, which name is equal
to the given one. This means, that using this function you must
assume, that the device name is unique in the given uclass's ID
device list.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-22 11:03:15 -06:00
Przemyslaw Marczak e0735a4c60 dm: core: uclass: add function: uclass_find_device_by_name()
This commit extends the driver model uclass's API by function:
- uclass_find_device_by_name()

And this function returns the device if:
- uclass with given ID, exists,
- device with exactly given name(dev->name), exists.

The returned device is not activated - need to be probed before use.

Note:
This function returns the first device, which name is equal
to the given one. This means, that using this function you must
assume, that the device name is unique in the given uclass's ID
device list.

uclass-internal.h: cleanup - move the uclass_find_device_by_seq()
declaration and description, near the other uclass_find*() functions.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-22 11:03:15 -06:00
Przemyslaw Marczak 9e85f13ddc dm: test: Add tests for get/find uclass devices
This commit introduces simple tests for functions:
- uclass_find_first_device()
- uclass_find_next_device()
- uclass_first_device()
- uclass_next_device()

Tests added by this commit:
- Test: dm_test_uclass_devices_find:
  * call uclass_find_first_device(), then check if: (dev != NULL), (ret == 0)
  * for the rest devices, call uclass_find_next_device() and do the same check

- Test: dm_test_uclass_devices_get:
  * call uclass_first_device(), then check if:
    -- (dev != NULL), (ret == 0), device_active()
  * for the rest devices, call uclass_next_device() and do the same check

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-22 11:03:14 -06:00
Przemyslaw Marczak 754e71e850 dm: test: Add tests for device's uclass platform data
This test introduces new test structure type:dm_test_perdev_uc_pdata.
The structure consists of three int values only. For the test purposes,
three pattern values are defined by enum, starting with TEST_UC_PDATA_INTVAL1.

This commit adds two test cases for uclass platform data:
- Test: dm_test_autobind_uclass_pdata_alloc - this tests if:
  * uclass driver sets: .per_device_platdata_auto_alloc_size field
  * the devices's: dev->uclass_platdata is non-NULL

- Test: dm_test_autobind_uclass_pdata_valid - this tests:
  * if the devices's: dev->uclass_platdata is non-NULL
  * the structure of type 'dm_test_perdev_uc_pdata' allocated at address
    pointed by dev->uclass_platdata. Each structure field, should be equal
    to proper pattern data, starting from .intval1 == TEST_UC_PDATA_INTVAL1.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-22 11:03:14 -06:00
Przemyslaw Marczak 5eaed88028 dm: core: Extend struct udevice by '.uclass_platdata' field.
This commit adds 'uclass_platdata' field to 'struct udevice', which
can be automatically allocated at bind. The allocation size is defined
in 'struct uclass_driver' as 'per_device_platdata_auto_alloc_size'.

New device's flag is added: DM_FLAG_ALLOC_UCLASS_PDATA, which is used
for memory freeing at device unbind method.

As for other udevice's fields, a complementary function is added:
- dev_get_uclass_platdata()

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-22 11:03:14 -06:00
Przemyslaw Marczak c1d6f91952 dm: core: add internal functions for getting the device without probe
This commit extends the uclass-internal functions by:
- uclass_find_first_device()
- uclass_find_next_device()
For both functions, the returned device is not probed.

After some cleanup, the above functions are called by:
- uclass_first_device()
- uclass_next_device()
for which, the returned device is probed.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-22 11:03:14 -06:00
tang yuantian 1a1cf6ee47 cmd_scsi: Enable SoC AHCI device on platforms with PCI
Current driver assumes the AHCI is connected to PCI, this is not
true on some SoCs, e.g. LS1021A, which has PCI but the AHCI is
in SoC. This patch will enable embedded AHCI devices on platforms
with PCI.
PCI AHCI devices still can be used by commenting CONFIG_SCSI_AHCI_PLAT
option in head file.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-04-22 12:14:56 -04:00
rev13@wp.pl ed09a554be stm32f4: Add support for stm32f429-discovery board
Signed-off-by: Kamil Lulko <rev13@wp.pl>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-04-22 12:14:55 -04:00
rev13@wp.pl ab3f0c7dae stm32f4: Add serial driver
Signed-off-by: Kamil Lulko <rev13@wp.pl>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-04-22 12:14:55 -04:00
rev13@wp.pl eaaa4f7e0e ARMv7M: Add STM32F4 support
Signed-off-by: Kamil Lulko <rev13@wp.pl>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-04-22 12:14:55 -04:00
rev13@wp.pl 12d8a72913 ARM: Add ARMv7-M support
Signed-off-by: Kamil Lulko <rev13@wp.pl>
2015-04-22 12:14:55 -04:00
Eric Nelson 5d27223ea5 unzip: add gzwrite command to write compressed image to block device
Add gzwrite command to write gzip-compressed images to block devices.

Input must be gzip-compressed according to RFC1952, since the crc
and file size in the trailer will be confirmed during operation.
The decompressed file size must be specified on the command line
for images with decompressed sizes >= 4GiB because the trailer
only contains the low 32 bits of the original file size.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
2015-04-22 12:14:55 -04:00
Eric Nelson 918e9ebb45 gunzip: add gzwrite routine for extracting compresed images to block device
Initial filesystem images are generally highly compressible.

Add a routine gzwrite that allows gzip-compressed images to be
written to block devices.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Reviewed-by: Tom Rini <trini@ti.com>
2015-04-22 12:14:55 -04:00
Fabio Estevam cba4c255fc mx6sabresd: Remove uneeded ifdef
RTT_NOM_120OHM is not defined, so remove its ifdef.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2015-04-22 16:02:46 +02:00
Fabio Estevam 407be42d73 mx6sabresd: Fix SPL memory description
mx6sabresd has four MT41K128M16JT-125 chips. Each memory has 16-bit bus
and 2GiB, so fix the width and density fields accordingly.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2015-04-22 16:02:46 +02:00
Eric Nelson 761bc19501 nitrogen6x: allow gzipped bitmap display
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
2015-04-22 16:02:46 +02:00
gaurav rana 1c29ad7bc0 iMX: Fix compilation error when enabling SECURE_BOOT
Move the compilation of file fsl_validate.c in MACRO CONFIG_CMD_ESBC_VALIDATE.
This file should be compiled only when the above MACRO is defined

This caused a break in compilation of iMX platforms when compiling for SECURE_BOOT

Signed-off-by: Gaurav Rana <gaurav.rana@freescale.com>
2015-04-22 16:02:46 +02:00
Stefan Roese 6b396b3162 arm: mx6: tqma6: Extract baseboard configs into separate config file
This patch extracts all baseboard specific defines into a separate config file.
This makes it easier to add other baseboards that use the TQMa6 SoM.

This patch will be used by the upcoming WRU-IV board support which also
uses the TQMa6 SoM.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Markus Niebel <Markus.Niebel@tq-group.com>
Cc: Stefano Babic <sbabic@denx.de>
Acked-By: Markus Niebel <Markus.Niebel@tq-group.com>
2015-04-22 16:02:45 +02:00
Tim Harvey 76962d0f8e power: pfuze100: fix LDO_EN bit value
The LDO_EN is bit 4, not value 4. This is only used on the Ventana boards so
we will change it in the header as the other values there are in terms of
values and not bit numbers.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:41:08 +02:00
Pushpal Sidhu 9e2b0c2d72 imx: ventana: Update missing memory/calib handling
This commit combines catching missing memory and calibration data into
one if() block. It further prints pertinent information in determining
why the failure occurred.

Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:12 +02:00
Pushpal Sidhu 767d88b037 imx: ventana: Add new memory configuration
Add memory configuration for an IMX6SDL + 1GB density DRAM.

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 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 7f14c31bba imx: ventana: remove 128x16 calibration (share with 128x32)
The calibration data for dual 2Gb density chips can be used for a single 2Gb
density chip.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:11 +02:00
Tim Harvey 06edcb9d37 imx: ventana: updated 16bit DDR calibration
Updated 16bit DDR calibration using values obtained from running the
i.MX6 DDR Stress Test tool over a set of boards over full operationg
temperature.

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 45af3f74bc imx: ventana: gsc: add new hwmon rails
Add a new voltage rail added in various -C revision PCB's.

Additionally make VDD_CORE, VDD_SOC, and VDD_IO2 common as all Ventana boards
have those.

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 16e369f5ec imx: ventana: remove GSC hwmon voltage rail min/max test
The min/max of each depends not only on board but on CPU. Simplify by removing
this rarely needed and difficult to maintain feature and just display the
rails and their values.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:10 +02:00
Tim Harvey e2801a9659 imx: ventana: update boot scripts to support ubifs boot vol
Added support in default boot scripts to find kernel/dtbs on a boot volume
separate from rootfs volume.

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 0417169054 imx: ventana: add usb_pgood_delay 2sec default
We have encountered many USB storage devices that require more warm-up
than the spec allows for.

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
Tim Harvey 30dc880ad1 imx: ventana: config: enable EXT4 filesystem read/write support
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:08 +02:00
Tim Harvey f6747cda78 imx: ventana: config: enable edid support
Enable the 'i2c edid' command to query and display data from an attached
HDMI monitor of LVDS display with an EDID device.

Example:
 Ventana > i2c dev 2 && i2c edid 0x50

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:08 +02:00
Tim Harvey 8cc25eb877 imx: ventana: config: Support ramdisk
Set the initrd_high env so that ramdisk range can be properly set.

See commit 7e9603e and README

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:08 +02:00
Tim Harvey 9543e9542e imx: ventana: config: add USB Mass Storage (ums) support
Add support for the USB mass storage gadget to enable access to on-board
storage.

Example:
 Ventana > ums 0 mmc 0 # provide ums access to the uSD
 Ventana > ums 0 usb 0 # provide ums access to the first USB device
 Ventana > ums 0 sata 0 # provide ums access to an mSATA device

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:08 +02:00
Tim Harvey 4717e1395e imx: ventana: set LTC3676 PMIC to appropriate values per datasheet
The IMX6 Datasheets specifies that when the IMX6 LDO is enabled
(internal Anatop LDO's for VDD_ARM, VDD_SOC, and VDD_xPU) you need to
provide 1350mV on VDD_ARM_IN and VDD_SOC_IN for IMX6Q@1GHz (Automotive)
and 1275mV for IMX6DL@800MHz (Industrial). While we are still about 50mV
shy on the IMX6Q operating at 1GHz we set it to the max we can and leave it
up to the kernel to implement a regulator driver for the LTC3676 and put
the LDO's in bypass mode which allows us to drop the voltages by 125mV
respectively.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:07 +02:00
Tim Harvey b0b83347a9 imx: ventana: add support for 4Gb density mem devices with IMX6DL
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:07 +02:00
Tim Harvey 29f0d6b1d0 imx: ventana: enable precharge power-down fast-exit mode
Enable fast-exit precharge mode necessary for some DDR3 devices being
used on Ventana boards.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:07 +02:00
Tim Harvey a51de276d8 imx: ventana: add usb_pcisel hwconfig support
The GW52xx has a MUX that can direct front-panel USB OTG to one of the
miniPCIe sockets (for use with a cellular modem for example). Use hwconfig
to steer this.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-04-22 14:39:07 +02:00