]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/configs/RPXlite.h
Merge branch 'master' of git://git.denx.de/u-boot-i2c
[karo-tx-uboot.git] / include / configs / RPXlite.h
index 28132566df9479cb803beaf43c8fc6f55a3d3624..ada7e145c07fbe0dcbee8442f4cb85fdc2392b79 100644 (file)
 #undef CONFIG_SYS_LOADS_BAUD_CHANGE            /* don't allow baudrate change  */
 
 #define CONFIG_BZIP2           /* Include support for bzip2 compressed images  */
+
+/* enable I2C and select the hardware/software driver */
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_SOFT            /* I2C bit-banged */
+#define CONFIG_SYS_I2C_SOFT_SPEED      40000   /* 40 kHz is supposed to work */
+#define CONFIG_SYS_I2C_SOFT_SLAVE      0xFE
+/* Software (bit-bang) I2C driver configuration */
+#define PB_SCL         0x00000020      /* PB 26 */
+#define PB_SDA         0x00000010      /* PB 27 */
+
+#define I2C_INIT       (immr->im_cpm.cp_pbdir |=  PB_SCL)
+#define I2C_ACTIVE     (immr->im_cpm.cp_pbdir |=  PB_SDA)
+#define I2C_TRISTATE   (immr->im_cpm.cp_pbdir &= ~PB_SDA)
+#define I2C_READ       ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
+#define I2C_SDA(bit)   if (bit) \
+                               immr->im_cpm.cp_pbdat |=  PB_SDA; \
+                       else \
+                               immr->im_cpm.cp_pbdat &= ~PB_SDA
+#define I2C_SCL(bit)   if (bit) \
+                               immr->im_cpm.cp_pbdat |=  PB_SCL; \
+                       else \
+                               immr->im_cpm.cp_pbdat &= ~PB_SCL
+#define I2C_DELAY      udelay(5)       /* 1/4 I2C clock duration */
+
+/* M41T11 Serial Access Timekeeper(R) SRAM */
+#define CONFIG_RTC_M41T11 1
+#define CONFIG_SYS_I2C_RTC_ADDR 0x68
+/* play along with the linux driver */
+#define CONFIG_SYS_M41T11_BASE_YEAR 1900
+
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
 /*