summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorCástor Muñoz <cmvidal@gmail.com>2016-08-12 14:03:54 +0200
committerCástor Muñoz <cmvidal@gmail.com>2016-08-12 14:17:46 +0200
commit578525b4638f575e30edb963c0de5dde44e250d5 (patch)
treeae682f078999d2bc3def00fcefb85069f8b7ed23 /firmware/export
parentadbd2969e6e6fd584d46ef60a3fa40bf878d7e00 (diff)
downloadrockbox-578525b4638f575e30edb963c0de5dde44e250d5.zip
rockbox-578525b4638f575e30edb963c0de5dde44e250d5.tar.gz
rockbox-578525b4638f575e30edb963c0de5dde44e250d5.tar.bz2
rockbox-578525b4638f575e30edb963c0de5dde44e250d5.tar.xz
iPod Classic: rework on I2C driver
- Some rewrite with the intent to get ride of these random errors appearing on some builds/devices (not much noticeable on RB but can ruin bootloader builds). - Error handling (ACK). - IIC clock increased to be the same as in OF. Change-Id: Idf8cfa3c230a0a61ec9c879bf6f0ea8b061a4607
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/s5l8702.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/firmware/export/s5l8702.h b/firmware/export/s5l8702.h
index 4799b05..f9bf99e 100644
--- a/firmware/export/s5l8702.h
+++ b/firmware/export/s5l8702.h
@@ -196,6 +196,20 @@
#define I2CCLKGATE(i) ((i) == 1 ? CLOCKGATE_I2C1 : \
CLOCKGATE_I2C0)
+/* s5l8702 I2C controller is similar to s5l8700, known differences are:
+
+ * IICCON[5] is not used in s5l8702.
+ * IICCON[13:8] are used to enable interrupts.
+ IICSTA2[13:8] are used to read the status and write-clear interrupts.
+ Known interrupts:
+ [13] STOP on bus (TBC)
+ [12] START on bus (TBC)
+ [8] byte transmited or received in Master mode (not tested in Slave)
+ * IICCON[4] does not clear interrupts, it is enabled when a byte is
+ transmited or received, in Master mode the tx/rx of the next byte
+ starts when it is written as "1".
+*/
+
#define IICCON(bus) (*((uint32_t volatile*)(0x3C600000 + 0x300000 * (bus))))
#define IICSTAT(bus) (*((uint32_t volatile*)(0x3C600004 + 0x300000 * (bus))))
#define IICADD(bus) (*((uint32_t volatile*)(0x3C600008 + 0x300000 * (bus))))
@@ -203,6 +217,7 @@
#define IICUNK10(bus) (*((uint32_t volatile*)(0x3C600010 + 0x300000 * (bus))))
#define IICUNK14(bus) (*((uint32_t volatile*)(0x3C600014 + 0x300000 * (bus))))
#define IICUNK18(bus) (*((uint32_t volatile*)(0x3C600018 + 0x300000 * (bus))))
+#define IICSTA2(bus) (*((uint32_t volatile*)(0x3C600020 + 0x300000 * (bus))))
/////INTERRUPT CONTROLLERS/////