All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] board/common: Add support for QIXIS read/write using i2c
@ 2013-01-15  4:26 Prabhakar Kushwaha
  2013-01-23 22:06 ` Andy Fleming
  0 siblings, 1 reply; 3+ messages in thread
From: Prabhakar Kushwaha @ 2013-01-15  4:26 UTC (permalink / raw)
  To: u-boot

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>
---
 board/freescale/common/qixis.c |   12 ++++++++++++
 board/freescale/common/qixis.h |    5 +++++
 2 files changed, 17 insertions(+)

diff --git a/board/freescale/common/qixis.c b/board/freescale/common/qixis.c
index c92902a..71d857d 100644
--- a/board/freescale/common/qixis.c
+++ b/board/freescale/common/qixis.c
@@ -14,8 +14,20 @@
 #include <common.h>
 #include <command.h>
 #include <asm/io.h>
+#include <i2c.h>
 #include "qixis.h"
 
+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);
+}
+
 u8 qixis_read(unsigned int reg)
 {
 	void *p = (void *)QIXIS_BASE;
diff --git a/board/freescale/common/qixis.h b/board/freescale/common/qixis.h
index b98b180..f2e83f1 100644
--- a/board/freescale/common/qixis.h
+++ b/board/freescale/common/qixis.h
@@ -88,8 +88,13 @@ struct qixis {
 
 u8 qixis_read(unsigned int reg);
 void qixis_write(unsigned int reg, u8 value);
+u8 qixis_read_i2c(unsigned int reg);
+void qixis_write_i2c(unsigned int reg, u8 value);
 
 #define QIXIS_READ(reg) qixis_read(offsetof(struct qixis, reg))
 #define QIXIS_WRITE(reg, value) qixis_write(offsetof(struct qixis, reg), value)
+#define QIXIS_READ_I2C(reg) qixis_read_i2c(offsetof(struct qixis, reg))
+#define QIXIS_WRITE_I2C(reg, value) \
+			qixis_write_i2c(offsetof(struct qixis, reg), value)
 
 #endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] board/common: Add support for QIXIS read/write using i2c
  2013-01-15  4:26 [U-Boot] [PATCH] board/common: Add support for QIXIS read/write using i2c Prabhakar Kushwaha
@ 2013-01-23 22:06 ` Andy Fleming
  2013-01-24  3:28   ` Prabhakar Kushwaha
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Fleming @ 2013-01-23 22:06 UTC (permalink / raw)
  To: u-boot

>
> +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);
> +}
> +



This breaks ALL other boards with QIXIS, as they don't all define
CONFIG_SYS_I2C_FPGA_ADDR.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] board/common: Add support for QIXIS read/write using i2c
  2013-01-23 22:06 ` Andy Fleming
@ 2013-01-24  3:28   ` Prabhakar Kushwaha
  0 siblings, 0 replies; 3+ messages in thread
From: Prabhakar Kushwaha @ 2013-01-24  3:28 UTC (permalink / raw)
  To: u-boot

On 01/24/2013 03:36 AM, Andy Fleming wrote:
>
>
>     +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);
>     +}
>     +
>
>
>
> This breaks ALL other boards with QIXIS, as they don't all define 
> CONFIG_SYS_I2C_FPGA_ADDR.

oh..
Then, I will put this code under #ifdef CONFIG_SYS_I2C_FPGA_ADDR and 
provide v2 version of this patch.

Regards,
Prabhakar

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-24  3:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-15  4:26 [U-Boot] [PATCH] board/common: Add support for QIXIS read/write using i2c Prabhakar Kushwaha
2013-01-23 22:06 ` Andy Fleming
2013-01-24  3:28   ` Prabhakar Kushwaha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.