summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* dm: serial: fix console putcMasahiro Yamada2014-10-231-3/+3
| | | | | | | | | | Commit b8893327e9d2 (dm: serial: Put common code into separate functions) consolidated getc() correctly, but introduced another bug to putc(); serial_stub_putc() passes sdev->priv to serial_putc_dev(), but serial_putc_dev() uses cur_dev instead of the given argument. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* serial: add static directive to local functionsMasahiro Yamada2014-10-232-19/+12
| | | | | | | | | | | | The functions _serial_putc, _serial_putc_raw, _serial_puts, _serial_getc, _serial_tstc, _serial_setbrg are defined and used locally in each of serial_ns16550.c and serial_s3c24x0.c. Add static directive to them and remove declarations from include/common.h. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: move platform data headers to include/dm/platform_dataMasahiro Yamada2014-10-232-2/+2
| | | | | | | | | | | | | | | | | | The platform_data definitions are generally referenced from both drivers and board files. That is why header files defining platform_data sturectures are placed in "include" directory, but our top level "include" directory is already too cluttered. Let's collect platform_data definitions under the directory "include/dm/platform_data" like Linux gathers ones around under "include/linux/platform_data". This commit moves two header files: include/serial_mxc.h -> include/dm/platform_data/serial_mxc.h include/serial_pl01x.h -> include/dm/platform_data/serial_pl01x.h Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* dm: x86: Convert coreboot serial to use driver modelSimon Glass2014-10-232-0/+39
| | | | | | | This makes use of the existing device tree node to use driver model for the serial console. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: x86: Convert Intel ICH6 GPIO driver to use driver modelSimon Glass2014-10-231-130/+120
| | | | | | | | | Convert over this driver, using device tree to pass in the required information. The peripheral is still probed, just the number of GPIO banks and their offsets is in the device tree (previously this was a table in the driver). Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: serial: ns16550: Add a cast to the I/O operationsSimon Glass2014-10-231-2/+2
| | | | | | | This generates a warning when driver model is enabled, so fix it by adding a cast. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: imx: Drop request()/free() in the driverSimon Glass2014-10-231-116/+0
| | | | | | | Now that the uclass supports gpio_request/free() there is no need for the driver to implement it too. Drop this unnecessary code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: exynos: Drop request()/free() in the driverSimon Glass2014-10-231-101/+0
| | | | | | | Now that the uclass supports gpio_request/free() there is no need for the driver to implement it too. Drop this unnecessary code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: rpi_b: Drop request()/free() in the driverSimon Glass2014-10-231-89/+0
| | | | | | | Now that the uclass supports gpio_request/free() there is no need for the driver to implement it too. Drop this unnecessary code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: omap3: Drop request()/free() in the driverSimon Glass2014-10-231-115/+1
| | | | | | | Now that the uclass supports gpio_request/free() there is no need for the driver to implement it too. Drop this unnecessary code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: tegra: Drop request()/free() in the driverSimon Glass2014-10-231-113/+0
| | | | | | | Now that the uclass supports gpio_request/free() there is no need for the driver to implement it too. Drop this unnecessary code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: Add gpio_requestf() helper for printf() stringsSimon Glass2014-10-231-0/+21
| | | | | | | Add a helper which permits a printf()-style format string for the requester string. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: sandbox: Drop request()/free() in the driverSimon Glass2014-10-231-82/+0
| | | | | | | Now that the uclass supports gpio_request/free() there is no need for the driver to implement it too. Drop this unnecessary code. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: sandbox: Implement the remove() methodSimon Glass2014-10-231-0/+8
| | | | | | This method frees memory so we must make sure to implement it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: sandbox: Implement the get_function() methodSimon Glass2014-10-231-1/+8
| | | | | | | Implement this method so that the 'gpio' command can do its job correctly. For sandbox we only support input and output states for a gpio. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Move the function for getting GPIO status into the uclassSimon Glass2014-10-231-0/+39
| | | | | | This function can be more easily tested if it is in the uclass. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: Add gpio_get_function() and friendsSimon Glass2014-10-231-0/+47
| | | | | | Add helpers to the uclass to allow finding out the pin function. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: gpio: Implement GPIO reservation in the uclassSimon Glass2014-10-231-14/+78
| | | | | | | | | | | | We have several GPIO drivers now and all are doing similar things to record which GPIOs are reserved. Move this logic into the uclass to make the drivers similar. We retain the request()/free() methods since currently one driver does use these for setting up the pin. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: omap: serial: Add driver model supportSimon Glass2014-10-232-0/+48
| | | | | | | | | Add driver model support to this driver, while retaining support for the legacy system. Driver model serial support is enabled with CONFIG_DM_SERIAL as usual. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: omap: gpio: Support driver modelSimon Glass2014-10-232-5/+231
| | | | | | | | | | | | Add driver model support to this driver, while retaining support for the legacy system. Driver model GPIO support is enabled with CONFIG_DM_GPIO as usual. Since gpio_is_valid() no longer exists, we can use the -EINVAL error returned from gpio_request(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: omap: gpio: Put _get_gpio_value() logic into its own functionSimon Glass2014-10-231-36/+42
| | | | | | | | | | | | Add a separate internal helper function to get a GPIO value, so that we will be able to call it with the driver model version and avoid code duplication. Also move gpio_get_bank() and check_gpio() down below the helper functions as these won't be needed with driver model. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: serial: Support CONFIG_CONS_INDEX if availableSimon Glass2014-10-231-1/+10
| | | | | | | | Try to use this option to select the correct uart for the console. This mimics the behaviour of drivers/serial.c. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: ns16550: Correct the probe logic for platform dataSimon Glass2014-10-231-2/+3
| | | | | | | | | | | | The probe logic sets up the pointer to the platform data in the device tree decode method. It should be done in the probe() method, and anyway the device tree decode method can't be used when CONFIG_OF_CONTROL is not enabled. Fix these two problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: ns16550: Use an address instead of a pointer for the uart baseSimon Glass2014-10-231-3/+3
| | | | | | | | | | | It is inconvenient to have to use casts when specifying platform data. Also it is not strictly correct, since we should use map_sysmem() to convert an address to a pointer. Adjust the platform data to use an address. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: serial: ns16550: Correct logic for checking for characterSimon Glass2014-10-231-1/+1
| | | | | | | | | There is a bug in the logic which checks for an available character. This can cause invalid characters to be received - this was noticed on beaglebone. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: serial: Reset the watchdog while waiting in getc()Simon Glass2014-10-231-0/+5
| | | | | | | | | | | | | We have moved the busy-wait loop out of drivers and into the uclass. This means that we must reset the watchdog when busy-waiting. Note: some drivers may still have a busy-wait even with driver model, as a transition mechanism. Driver model will tolerate this, and is can be cleaned up when all users of the driver use driver model. An example is ns16550. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* dm: gpio: Support numbered GPIOsSimon Glass2014-10-231-12/+25
| | | | | | | | | | | | At present banks must be named and it is not possible to refer to GPIOs by number in driver model. Some boards use numbering - e.g. OMAP. It is fairly easy to support by detecting the absense of a bank name (which starts with a letter). Add support for numbered GPIOs in addition to the existing bank support. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* Merge branch 'master' of git://git.denx.de/u-boot-tegraTom Rini2014-10-232-1/+4
|\
| * tegra: gpio: fix null label regressionMarcel Ziswiler2014-10-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Tegra GPIO driver to not crash resp. misbehave upon requesting GPIOs with an empty aka NULL label. As the driver uses exclusively the label to check for reservation status actually supplying one is mandatory! This fixes a regression introduced by commit: 2fccd2d96badcdf6165658a99771a4c475586279 tegra: Convert tegra GPIO driver to use driver model Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
| * mmc: Tegra: Fix timeout issue seen on certain eMMC partsMarcel Ziswiler2014-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During rigorous testing of our latest update infrastructure I came across quite consistent timeouts on certain eMMC parts (e.g. Hynix H26M21001ECR) when writing big (e.g. in excess of 400 MB) file system images: MMC write: dev # 0, block # 40960, count 944128 ... mmc_send_cmd_bounced: MMC Timeout Interrupt status 0x00000001 Interrupt status enable 0xdfff003b Interrupt signal enable 0xdfff0002 Present status 0x01870106 mmc write failed Comparing the various data sheets I came across the following timeout specification: Secure Erase/TRIM Timeout=300ms*2*10=6000ms Unfortunately empirical testing still failed albeit much more rarely. Increasing the timeout to 8000ms made it finally disappear entirely. This patch allows us writing various eMMC parts without seeing any further issues. Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
* | i2c: mvtwsi: Add support for Marvell Armada XPStefan Roese2014-10-231-1/+1
| | | | | | | | | | | | | | | | To support the Armada XP SoC, we just need to include the correct header. Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Heiko Schocher <hs@denx.de> Tested-by: Luka Perkov <luka@openwrt.org>
* | net: mvneta.c: Add support for the ethernet controller of the Marvell Armada ↵Stefan Roese2014-10-232-0/+1654
| | | | | | | | | | | | | | | | | | | | | | | | | | | | XP SoC This patch adds support for the NETA ethernet controller which is integrated in the Marvell Armada XP SoC's. This port is based on the Linux driver which has been stripped of the in U-Boot unused portions. Tested on the Marvell MV78460 eval board db-78460-bp. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Tested-by: Luka Perkov <luka@openwrt.org>
* | spi: kirkwood_spi.c: Change KW_SPI_BASE to MVEBU_SPI_BASEStefan Roese2014-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | This makes is possible to use this SPI driver from other MVEBU SoC's as well. As the upcoming Armada XP support will do. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Tested-by: Luka Perkov <luka@openwrt.org> Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
* | spi: kirkwood_spi.c: Compile MPP (pin-mux) only for kirkwood SoC'sStefan Roese2014-10-231-0/+10
| | | | | | | | | | | | | | | | | | | | Compile the pin multiplexing only on Kirkwood platforms. As the Armada XP doesn't need it. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Tested-by: Luka Perkov <luka@openwrt.org> Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
* | arm: marvell: Move arch-kirkwood/spi.h to arch-mvebu/spi.hStefan Roese2014-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | This move makes it possible to use this kirkwood SPI driver from other MVEBU platforms as well. This will be used by the upcoming Armada XP support. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Tested-by: Luka Perkov <luka@openwrt.org> Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
* | arm: marvell: Move arch/kirkwood.h to arch/soc.hStefan Roese2014-10-239-9/+9
| | | | | | | | | | | | | | | | | | This move makes is possible to use this header not only from kirkwood platforms but from all Marvell mvebu platforms. Signed-off-by: Stefan Roese <sr@denx.de> Tested-by: Luka Perkov <luka@openwrt.org> Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
* | Merge git://git.denx.de/u-boot-x86Tom Rini2014-10-231-2/+2
|\ \
| * | x86: cros_ec: Update LPC driver for new cros_ec headerSimon Glass2014-10-221-2/+2
| | | | | | | | | | | | | | | | | | There was a minor rename of one of the defines, so update the driver. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: serial: Support driver model in pl01x driverSimon Glass2014-10-221-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | Add driver model support in this driver, using platform data provided by the board. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@wwwdotorg.org>
* | | dm: serial: Tidy up the pl01x driverSimon Glass2014-10-223-140/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjust the driver so that leaf functions take a pointer to the serial port register base. Put all the global configuration in the init function, and use the same settings from then on. This makes it much easier to move to driver model without duplicating the code, since with driver model we use platform data rather than global settings. The driver is compiled with either the CONFIG_PL010_SERIAL or CONFIG_PL011_SERIAL option and this determines the uart type. With driver model this needs to come in from platform data, so create a new CONFIG_PL01X_SERIAL config which brings in the driver, and adjust the driver to support both peripheral variants. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@wwwdotorg.org>
* | | dm: rpi: Convert GPIO driver to driver modelSimon Glass2014-10-221-23/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the BCM2835 GPIO driver to use driver model, and switch over Raspberry Pi to use this, since it is the only board. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
* | | dm: core: Add support for simple-busSimon Glass2014-10-222-0/+34
| | | | | | | | | | | | | | | | | | | | | Add a driver for the simple-bus nodes, which allows devices within these nodes to be bound. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: imx: serial: Support driver model in the MXC serial driverSimon Glass2014-10-221-25/+145
| | | | | | | | | | | | | | | | | | | | | Add driver model support with this driver. Boards which use this driver should define platform data in their board files. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: imx: gpio: Support driver model in MXC gpio driverSimon Glass2014-10-221-1/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add driver model support with this driver. In this case the platform data is in the driver. It would be better to put this into an SOC-specific file, but this is best attempted when more boards are moved over to use driver model. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
* | | dm: serial: Put common code into separate functionsSimon Glass2014-10-221-15/+17
| | | | | | | | | | | | | | | | | | | | | Avoid duplicating the code which deals with getc() and putc(). It is fairly simple, but may expand later. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: exynos: cros_ec: Move cros_ec_spi to driver modelSimon Glass2014-10-221-9/+78
| | | | | | | | | | | | | | | | | | | | | | | | Adjust this driver to use driver model and move smdk5420 boards over to use it. Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: sandbox: cros_ec: Move sandbox cros_ec to driver moduleSimon Glass2014-10-221-5/+85
| | | | | | | | | | | | | | | | | | | | | | | | Adjust the sandbox cros_ec emulation driver to work with driver model, and switch over to driver model for sandbox cros_ec. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
* | | dm: cros_ec: Add support for driver modelSimon Glass2014-10-222-14/+117
| | | | | | | | | | | | | | | | | | | | | | | | Add support for driver model if enabled. This involves minimal changes to the code, mostly just plumbing around the edges. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
* | | dm: tegra: spi: Convert to driver modelSimon Glass2014-10-226-534/+392
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts the Tegra SPI drivers to use driver model. This is tested on: - Tegra20 - trimslice - Tegra30 - beaver - Tegra124 - dalmore (not tested on Tegra124) Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | | dm: sf: sandbox: Convert SPI flash driver to driver modelSimon Glass2014-10-221-47/+291
| | | | | | | | | | | | | | | | | | | | | Convert sandbox's spi flash emulation driver to use driver model. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
OpenPOWER on IntegriCloud