summaryrefslogtreecommitdiff
path: root/board/st/u8500/u8500_i2c.c
AgeCommit message (Collapse)Author
2010-12-08db8500: New GPIO driver and config, from Linux kernelJoakim Axelsson
Copied the GPIO configurator written for the Linux kernel. The Nomadik db8500 GPIO driver. Purpose is to be able to just cut-n-paste the GPIO config from Linux to U-boot. Also at the same time remove the obsolete and old gpio_alt_funcenable/disable methods. Now all is configured using a table in u8500.c. Now drivers doesn't have to worry about setting up the GPIO pins. Actually no driver today uses GPIO pins directly, only via hardware blocks within db8500. Functions are still added to be able to interact directly with a GPIO pin. This also cleaned up a lot of driver by not having to bit manipulate GPIO registers them self. The new driver is called db8500_gpio and placed in driver/gpio/. Functions are in include/db8500_gpio.h: void db8500_gpio_set_pull(unsigned gpio, enum db8500_gpio_pull pull); void db8500_gpio_make_input(unsigned gpio); int db8500_gpio_get_input(unsigned gpio); void db8500_gpio_make_output(unsigned gpio, int val); void db8500_gpio_set_output(unsigned gpio, int val); And for the configurator in include/db8500_pincfg.h: void db8500_gpio_config_pins(pin_cfg_t *cfgs, size_t num); All in all the final binary size has decreased. This is only done for db8500 nomadik GPIO. The code for gpio expanders has not been touched. All references to Nomadik has been removed in this driver. Only db8500 is left. ST-Ericsson ID: None Signed-off-by: Joakim Axelsson <joakim.axelsson@stericsson.com> Change-Id: I90aa1d46c813ffb5a777c3492b5751f5054f71cf Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/9904 Reviewed-by: QATOOLS Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-11-19U8500: Removed duplicates of common.h and gpio.hMichael Brandt
common.h and gpio.h were present in the u8500 board directory and in the SoC include directory include/asm-arch/arch-stw8500. This patch removes the duplicates in the board directory and replaces all "common.h" and "gpio.h" with <asm/arch/common.h> and <asm/arch/gpio.h>, respectively. Change-Id: I4ff2a3a11324200222e3ae5b9d22eee6427f6d4c Signed-off-by: Michael Brandt <michael.brandt@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/8838 Reviewed-by: Markus HELGESSON <markus.helgesson@stericsson.com> Reviewed-by: Rikard OLSSON <rikard.p.olsson@stericsson.com>
2010-11-12U8500: Enabled support for i2c1-3Robert Rosengren
Moved enabling of clocks into i2c driver, making it possible to use all i2c from 0 to 3. Changed sanity check of i2c_read function to make it possible read from devices with 2 byte address. ST-Ericsson ID: CR275232 Change-Id: I6c9c2efe20dcb6903419ba531a86228a5f4491ca Signed-off-by: Robert Rosengren <robert.rosengren@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/8340 Reviewed-by: Markus HELGESSON <markus.helgesson@stericsson.com> Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com>
2010-05-19HREF V1 updatesMichael Brandt
This patch is part of WP254081 which depends on WP252006. * Fixed I2C, use real timeouts instead of counter * Undefined CONFIG_BOOTTIME, since it as to be changed to new timer.c * Merged V1 patches from Bangalore The patches were merged manually, because of the differences of the U-Boot baseline (Bangalore U-Boot 1.3.1, Lund 2009.11). The original patches were created by Rabin Vincent <rabin.vincent@stericsson.com>. and were applied originally to Branches: blr_lsp, remotes/origin/blr_lsp Follows: qpppaaa_20100210_094651 0001-u8500-gpio-add-I2C0-altfun.patch 0002-u8500-use-correct-v1-macros.patch 0003-emmc-clean-up-paritioning.patch 0004-u8500-remove-incorrect-ram-settings.patch 0005-u8500-gpio-remove-unnecessary-ifdefs.patch 0006-u8500-add-ED-v1-detection-and-handle-eMMC-diff.patch 0008-u8500-mmc-don-t-disable-altfuns.patch 0009-u8500-gpio-remove-unused-defined.patch 0010-u8500-mmc-add-barrier-for-while-loop.patch 0011-u8500-mmc-handle-non-block-addressed-cards.patch 0012-u8500-mmc-remove-unused-gpio-settings-on-v1.patch 0013-u8500-emmc-build-fix.patch 0014-u8500-handle-v1-gpios-and-clocks.patch 0015-mmc-build-fix-for-block-addressing.patch 0016-u8500-add-clocks-and-hardware-files.patch 0017-u8500-enable-PRCUM-timers-reg-for-ED.patch 0018-u8500-handle-MTU-for-v1-ED.patch 0019-u8500-emmc-remove-unnecessary-GPIO-settings.patch 0020-u8500-remove-dead-code.patch 0021-u8500-add-working-MTU-timer.patch 0022-pl011-empty-rx-fifo-if-necessary.patch 0023-u8500-gpio-fix-cont-handling-in-altfunc.patch 0024-u8500-reduce-bootdelay-to-1-and-enable-zero-check.patch 0025-u8500-disable-forcing-of-verify-but-set-n-by-default.patch 0029-u8500-fix-some-gpio-settings.patch 0030-emmc-make-v1-paritioning-differences-explicit.patch Signed-off-by: Michael Brandt <Michael.Brandt@stericsson.com> Change-Id: I1106702e393c34f630e71f071e06c3952b0d3a1a Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/182 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2010-05-19General I2C refactoring and environment settings cleanupMichael Brandt
These are the patches for WP252006. There will be a follow-up patched for WP254081. Environment settings * board_id bootargs parameter from board_id environment var set in board_late_init(). * decreased bootdelay to 1 second * added check for keypress on bootdelay==0 * removed preboot command and introduced "run cmdfile" instead * changed rootfstype from ext2 to ext3 General I2C refactoring * include/configs/u8500.h: Enabled i2c command line commands. Changed environment settings to use board_id as set in board_late_init(). Added I2C address and configuration defines. * board/st/u8500/Makefile: Replaced i2c.o with u8500_i2c.o. * board/st/u8500/gpio.c, gpio.h: Added I2C busses to altfunc_table. * board/st/u8500/init_mmc.c: removed config_extended_gpio() and therefore I2C references. GPIOE settings are now in board_late_init(). * board/st/u8500/u8500.c: Removed I2C/SD gpio settings from addr,value array. board_late_init(): Determine and set board_id environment variable 0: mop500, 1: href500 Above boards have different GPIO expander chips which we can distinguish by the chip id (1 and 3). The board_id environment variable is needed for the Linux bootargs. Signed-off-by: Michael Brandt <Michael.Brandt@stericsson.com> Change-Id: I4c2cab28c1cb74692e0c72b2daa422e97787ff8d Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/167 Reviewed-by: Michael BRANDT <michael.brandt@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>