summaryrefslogtreecommitdiff
path: root/board/freescale/common/qixis.c
diff options
context:
space:
mode:
authorPrabhakar Kushwaha <prabhakar@freescale.com>2013-01-23 17:59:37 +0000
committerAndy Fleming <afleming@freescale.com>2013-01-30 11:25:15 -0600
commit960aa89bda0754cc1c4418c5d21e7ff23dc34a82 (patch)
tree89c1cca69d5186ef6e2882bfa2300a023074b2bb /board/freescale/common/qixis.c
parent72bd83cd0a12f411983d33b5f24adc16b9b77313 (diff)
downloadu-boot-imx-960aa89bda0754cc1c4418c5d21e7ff23dc34a82.zip
u-boot-imx-960aa89bda0754cc1c4418c5d21e7ff23dc34a82.tar.gz
u-boot-imx-960aa89bda0754cc1c4418c5d21e7ff23dc34a82.tar.bz2
board/common: Add support for QIXIS read/write using i2c
QIXIS FPGA is accessable via both i2c and flash controller. Only flash controller access is supported. Add support of i2c based access. It is quite useful in the scenario where either flash controller path is broken or not present. Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'board/freescale/common/qixis.c')
-rw-r--r--board/freescale/common/qixis.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/board/freescale/common/qixis.c b/board/freescale/common/qixis.c
index f7d2f46..2b74d02 100644
--- a/board/freescale/common/qixis.c
+++ b/board/freescale/common/qixis.c
@@ -15,8 +15,22 @@
#include <command.h>
#include <asm/io.h>
#include <linux/time.h>
+#include <i2c.h>
#include "qixis.h"
+#ifdef CONFIG_SYS_I2C_FPGA_ADDR
+u8 qixis_read_i2c(unsigned int reg)
+{
+ return i2c_reg_read(CONFIG_SYS_I2C_FPGA_ADDR, reg);
+}
+
+void qixis_write_i2c(unsigned int reg, u8 value)
+{
+ u8 val = value;
+ i2c_reg_write(CONFIG_SYS_I2C_FPGA_ADDR, reg, val);
+}
+#endif
+
u8 qixis_read(unsigned int reg)
{
void *p = (void *)QIXIS_BASE;