diff options
author | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-04-14 21:05:22 +0000 |
---|---|---|
committer | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-04-14 21:05:22 +0000 |
commit | 827df9f3c5fdea53531acf02b2db0afb9858f053 (patch) | |
tree | 95cb9c8d0ab76f1155f25df9cda123ce97cb0643 /hw/omap_i2c.c | |
parent | f93eb9ff66868df42f8433d16f2dc48a4af2490f (diff) |
Add basic OMAP2 chip support.
Add the OMAP242x (arm1136 core) initialisation with basic on-chip
peripherals and update OMAP1 peripherals which are re-used in OMAP2.
Make palmte.c and sd.c errors go to stderr.
Allow disabling SD chipselect.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4213 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/omap_i2c.c')
-rw-r--r-- | hw/omap_i2c.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/hw/omap_i2c.c b/hw/omap_i2c.c index de63309ca..9915676b1 100644 --- a/hw/omap_i2c.c +++ b/hw/omap_i2c.c @@ -150,6 +150,8 @@ static void omap_i2c_fifo_run(struct omap_i2c_s *s) } if (ack && s->count_cur) s->stat |= 1 << 4; /* XRDY */ + else + s->stat &= ~(1 << 4); /* XRDY */ if (!s->count_cur) { s->stat |= 1 << 2; /* ARDY */ s->control &= ~(1 << 10); /* MST */ @@ -161,6 +163,8 @@ static void omap_i2c_fifo_run(struct omap_i2c_s *s) } if (s->rxlen) s->stat |= 1 << 3; /* RRDY */ + else + s->stat &= ~(1 << 3); /* RRDY */ } if (!s->count_cur) { if ((s->control >> 1) & 1) { /* STP */ @@ -321,7 +325,8 @@ static void omap_i2c_write(void *opaque, target_phys_addr_t addr, return; } - s->stat &= ~(value & 0x3f); + /* RRDY and XRDY are reset by hardware. (in all versions???) */ + s->stat &= ~(value & 0x27); omap_i2c_interrupts_update(s); break; @@ -376,11 +381,13 @@ static void omap_i2c_write(void *opaque, target_phys_addr_t addr, break; } if ((value & (1 << 15)) && !(value & (1 << 10))) { /* MST */ - printf("%s: I^2C slave mode not supported\n", __FUNCTION__); + fprintf(stderr, "%s: I^2C slave mode not supported\n", + __FUNCTION__); break; } if ((value & (1 << 15)) && value & (1 << 8)) { /* XA */ - printf("%s: 10-bit addressing mode not supported\n", __FUNCTION__); + fprintf(stderr, "%s: 10-bit addressing mode not supported\n", + __FUNCTION__); break; } if ((value & (1 << 15)) && value & (1 << 0)) { /* STT */ @@ -427,7 +434,7 @@ static void omap_i2c_write(void *opaque, target_phys_addr_t addr, omap_i2c_interrupts_update(s); } if (value & (1 << 15)) /* ST_EN */ - printf("%s: System Test not supported\n", __FUNCTION__); + fprintf(stderr, "%s: System Test not supported\n", __FUNCTION__); break; default: |