Commit d1f193b0edb919ab109f88c53469ec9073f2e142

Authored by aurel32
1 parent b79e1752

SH4: SCI improvement

This patch simply implement one register of SH4's SCI := Serial Communication Interface.

R2D evaluation board uses SCI for SPI connection.  So, Linux kernel for R2D with
default configuration causes a QEMU assertion failure when it initializes SPI driver.
This patch avoids it and reduces the kernel config modification work for QEMU.

Completing SCI implementation task is left.  Other board support is desirable to confirm
this task, which uses SCI for a serial terminal.

(Shin-ichiro KAWASAKI)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5939 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 6 deletions
hw/sh_serial.c
... ... @@ -167,19 +167,19 @@ static void sh_serial_ioport_write(void *opaque, uint32_t offs, uint32_t val)
167 167 }
168 168 }
169 169 else {
170   -#if 0
171 170 switch(offs) {
  171 +#if 0
172 172 case 0x0c:
173 173 ret = s->dr;
174 174 break;
175 175 case 0x10:
176 176 ret = 0;
177 177 break;
  178 +#endif
178 179 case 0x1c:
179   - ret = s->sptr;
180   - break;
  180 + s->sptr = val & 0x8f;
  181 + return;
181 182 }
182   -#endif
183 183 }
184 184  
185 185 fprintf(stderr, "sh_serial: unsupported write to 0x%02x\n", offs);
... ... @@ -259,8 +259,8 @@ static uint32_t sh_serial_ioport_read(void *opaque, uint32_t offs)
259 259 }
260 260 }
261 261 else {
262   -#if 0
263 262 switch(offs) {
  263 +#if 0
264 264 case 0x0c:
265 265 ret = s->dr;
266 266 break;
... ... @@ -270,11 +270,11 @@ static uint32_t sh_serial_ioport_read(void *opaque, uint32_t offs)
270 270 case 0x14:
271 271 ret = s->rx_fifo[0];
272 272 break;
  273 +#endif
273 274 case 0x1c:
274 275 ret = s->sptr;
275 276 break;
276 277 }
277   -#endif
278 278 }
279 279 #ifdef DEBUG_SERIAL
280 280 printf("sh_serial: read offs=0x%02x val=0x%x\n",
... ...