Skip to contentSkip to conversation

patch: add gt64260 I2C read function to bootwrapper

PATCH Dale Farnsworth 1 participant 1 message Mar 15, 2003

lore
Share & tools
lore
#0 lore raw

This patch adds a polled read-only I2C driver for the gt64260 that can be used by board-specific bootwrapper code.

Thanks,
-Dale

include/asm-ppc/gt64260_defs.h:
Add definitions for the I2C registers.

arch/ppc/boot/simple/gt64260_iic.c:
Add gt64260_iic_read() for reading I2C devices.

===== include/asm-ppc/gt64260_defs.h 1.11 vs edited =====

include/asm-ppc/gt64260_defs.h +25 -1
@@ -1108,7 +1108,31 @@
  *****************************************************************************
  */
 
-/* FIXME: fill in */
+#define GT64260_I2C_ADDR				0xc000
+#define GT64260_I2C_EX_ADDR				0xc010
+#define GT64260_I2C_DATA				0xc004
+#define GT64260_I2C_CONTROL				0xc008
+#define GT64260_I2C_STATUS				0xc00c
+#define GT64260_I2C_BAUD_RATE				0xc00c
+#define GT64260_I2C_RESET				0xc01c
+
+#define GT64260_I2C_ACK_BIT				(1<<2)
+#define GT64260_I2C_IFLG_BIT				(1<<3)
+#define GT64260_I2C_STOP_BIT				(1<<4)
+#define GT64260_I2C_START_BIT				(1<<5)
+#define GT64260_I2C_ENABLE_BIT				(1<<6)
+#define GT64260_I2C_INT_ENABLE_BIT			(1<<7)
+
+#define GT64260_I2C_DATA_READ_BIT			0x01
+
+#define GT64260_I2C_STATUS_SENT_START			0x08
+#define GT64260_I2C_STATUS_RESENT_START			0x10
+#define GT64260_I2C_STATUS_WRITE_ADDR_ACK		0x18
+#define GT64260_I2C_STATUS_WRITE_ACK			0x28
+#define GT64260_I2C_STATUS_READ_ADDR_ACK		0x40
+#define GT64260_I2C_STATUS_READ_ACK			0x50
+#define GT64260_I2C_STATUS_READ_NO_ACK			0x58
+#define GT64260_I2C_STATUS_IDLE				0xf8
 
 
 /*

===== arch/ppc/boot/simple/gt64260_iic.c null vs new =====

arch/ppc/boot/simple/gt64260_iic.c +186 -0

186 lines not on this page · raw message

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/