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,19 +167,19 @@ static void sh_serial_ioport_write(void *opaque, uint32_t offs, uint32_t val)
167 } 167 }
168 } 168 }
169 else { 169 else {
170 -#if 0  
171 switch(offs) { 170 switch(offs) {
  171 +#if 0
172 case 0x0c: 172 case 0x0c:
173 ret = s->dr; 173 ret = s->dr;
174 break; 174 break;
175 case 0x10: 175 case 0x10:
176 ret = 0; 176 ret = 0;
177 break; 177 break;
  178 +#endif
178 case 0x1c: 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 fprintf(stderr, "sh_serial: unsupported write to 0x%02x\n", offs); 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,8 +259,8 @@ static uint32_t sh_serial_ioport_read(void *opaque, uint32_t offs)
259 } 259 }
260 } 260 }
261 else { 261 else {
262 -#if 0  
263 switch(offs) { 262 switch(offs) {
  263 +#if 0
264 case 0x0c: 264 case 0x0c:
265 ret = s->dr; 265 ret = s->dr;
266 break; 266 break;
@@ -270,11 +270,11 @@ static uint32_t sh_serial_ioport_read(void *opaque, uint32_t offs) @@ -270,11 +270,11 @@ static uint32_t sh_serial_ioport_read(void *opaque, uint32_t offs)
270 case 0x14: 270 case 0x14:
271 ret = s->rx_fifo[0]; 271 ret = s->rx_fifo[0];
272 break; 272 break;
  273 +#endif
273 case 0x1c: 274 case 0x1c:
274 ret = s->sptr; 275 ret = s->sptr;
275 break; 276 break;
276 } 277 }
277 -#endif  
278 } 278 }
279 #ifdef DEBUG_SERIAL 279 #ifdef DEBUG_SERIAL
280 printf("sh_serial: read offs=0x%02x val=0x%x\n", 280 printf("sh_serial: read offs=0x%02x val=0x%x\n",