summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-cdns.c
Commit message (Collapse)AuthorAgeLines
* i2c: i2c-cdns: No need for dedicated probe functionMoritz Fischer2017-01-18-21/+0
| | | | | | | | | The generic probe code in dm works, so get rid of the leftover cruft. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Cc: Heiko Schocher <hs@denx.de> Cc: Michal Simek <michal.simek@xilinx.com> Cc: u-boot@lists.denx.de
* i2c: i2c-cdns: Implement workaround for hold quirk of the rev 1.0Moritz Fischer2017-01-18-30/+89
| | | | | | | | | | | | | | | Revision 1.0 of this IP has a quirk where if during a long read transfer the transfer_size register will go to 0, the master will send a NACK to the slave prematurely. The way to work around this is to reprogram the transfer_size register mid-transfer when the only the receive fifo is known full, i.e. the I2C bus is known non-active. The workaround is based on the implementation in the linux-kernel. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Cc: Heiko Schocher <hs@denx.de> Cc: Michal Simek <michal.simek@xilinx.com> Cc: u-boot@lists.denx.de
* i2c: i2c-cdns: Reorder timeout loop for interrupt waitingMoritz Fischer2017-01-18-1/+1
| | | | | | | | | | | | Reorder the timeout loop such that we first check if the condition is already true, and then call udelay() so if the condition is already true, break early. Reviewed-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Cc: Heiko Schocher <hs@denx.de> Cc: Michal Simek <michal.simek@xilinx.com> Cc: u-boot@lists.denx.de
* i2c: i2c-cdns: Detect unsupported sequences for rev 1.0Moritz Fischer2017-01-18-14/+52
| | | | | | | | | | | | | | | | Revision 1.0 of this IP has a couple of issues, such as not supporting repeated start conditions for read transfers. So scan through the list of i2c messages for these conditions and report an error if they are attempted. This has been fixed for revision 1.4 of the IP, so only report the error when the IP can really not do it. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Cc: Heiko Schocher <hs@denx.de> Cc: Michal Simek <michal.simek@xilinx.com> Cc: u-boot@lists.denx.de
* i2c: cdns: Add additional compatible string for r1p14 of the IP.Moritz Fischer2017-01-10-0/+1
| | | | | | | | | Adding additional compatible string for version 1.4 of the IP block. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Heiko Schocher <hs@denx.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* treewide: replace #include <asm/errno.h> with <linux/errno.h>Masahiro Yamada2016-09-23-1/+1
| | | | | | | | | | | Now, arch/${ARCH}/include/asm/errno.h and include/linux/errno.h have the same content. (both just wrap <asm-generic/errno.h>) Replace all include directives for <asm/errno.h> with <linux/errno.h>. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [trini: Fixup include/clk.] Signed-off-by: Tom Rini <trini@konsulko.com>
* i2c: cdns: Support different bus speedsMichal Simek2016-05-17-7/+69
| | | | | | | | | | 400kHz is maximum freq which can be used on Xilinx ZynqMP. Support it with standard divider calculator. Input freq is hardcoded to 100MHz input freq till we have clock driver which can provide this information for exact configuration. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* i2c: cdns: Moving speed setup from probe to set_bus_speed functionMichal Simek2016-05-17-37/+11
| | | | | | | | set_bus_speed is the right function where bus speed should be setup. This move enable option to remove probe and remove functions which are empty. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* i2c: cdns: Read address from DT in ofdata_to_platdataMichal Simek2016-05-17-4/+12
| | | | | | | | Extract reading IP base address in function which is designed for it. Also enable option to read more information from DT in this function. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* dm: i2c: Add driver for Cadence I2C IPMoritz Fischer2016-04-13-0/+335
This is a possible drop in replacement for drivers/i2c/zynq-i2c.c Since this is cadence IP it has been renamed to cdns-i2c, to make sense with the compatible string. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>