Changeset 1647
- Timestamp:
- 04/03/07 16:17:53 (6 years ago)
- Location:
- trunk/src/host/qemu-neo1973
- Files:
-
- 7 edited
-
hw/neo1973.c (modified) (1 diff)
-
hw/s3c.h (modified) (1 diff)
-
hw/s3c2410.c (modified) (9 diffs)
-
openmoko/download.sh (modified) (1 diff)
-
openmoko/env (modified) (1 diff)
-
openmoko/flash.sh (modified) (3 diffs)
-
vl.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/host/qemu-neo1973/hw/neo1973.c
r1640 r1647 101 101 static void neo_gsm_switch(int line, int level, void *opaque) 102 102 { 103 neo_printf("GSM %sabled.\n", level ? " en" : "dis");103 neo_printf("GSM %sabled.\n", level ? "dis" : "en"); 104 104 } 105 105 -
trunk/src/host/qemu-neo1973/hw/s3c.h
r1640 r1647 110 110 struct s3c_uart_state_s; 111 111 struct s3c_uart_state_s *s3c_uart_init(target_phys_addr_t base, 112 void *pic, void *dma, int irq[], int drq[] ,113 CharDriverState *chr);112 void *pic, void *dma, int irq[], int drq[]); 113 void s3c_uart_attach(struct s3c_uart_state_s *s, CharDriverState *chr); 114 114 115 115 struct s3c_adc_state_s; -
trunk/src/host/qemu-neo1973/hw/s3c2410.c
r1640 r1647 1050 1050 int rxstart; 1051 1051 int rxlen; 1052 CharDriverState *chr; 1052 #define UART_MAX_CHR 4 1053 int chr_num; 1054 CharDriverState *chr[UART_MAX_CHR]; 1053 1055 1054 1056 uint8_t lcontrol; … … 1075 1077 { 1076 1078 QEMUSerialSetParams ssp; 1079 int i; 1077 1080 if (!s->chr) 1078 1081 return; … … 1098 1101 ssp.stop_bits = (s->lcontrol & (1 << 2)) ? 2 : 1; 1099 1102 1100 qemu_chr_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp); 1103 for (i = 0; i < s->chr_num; i ++) 1104 qemu_chr_ioctl(s->chr[i], CHR_IOCTL_SERIAL_SET_PARAMS, &ssp); 1101 1105 } 1102 1106 … … 1235 1239 struct s3c_uart_state_s *s = (struct s3c_uart_state_s *) opaque; 1236 1240 uint8_t ch; 1241 int i, afc; 1237 1242 addr -= s->base; 1238 1243 … … 1257 1262 break; 1258 1263 case S3C_UMCON: 1259 s->mcontrol = value & 0xe1; 1264 if ((s->mcontrol ^ value) & (1 << 4)) { 1265 afc = (value >> 4) & 1; 1266 for (i = 0; i < s->chr_num; i ++) 1267 qemu_chr_ioctl(s->chr[i], CHR_IOCTL_MODEM_SET_AFC, &afc); 1268 } 1269 s->mcontrol = value & 0x11; 1260 1270 break; 1261 1271 case S3C_UTXH: 1262 1272 ch = value & 0xff; 1263 if (s->chr)1264 qemu_chr_write(s->chr , &ch, 1);1273 for (i = 0; i < s->chr_num; i ++) 1274 qemu_chr_write(s->chr[i], &ch, 1); 1265 1275 s3c_uart_empty(s); 1266 1276 break; … … 1287 1297 1288 1298 struct s3c_uart_state_s *s3c_uart_init(target_phys_addr_t base, 1289 void *pic, void *dma, int irq[], int drq[], 1290 CharDriverState *chr) 1299 void *pic, void *dma, int irq[], int drq[]) 1291 1300 { 1292 1301 int iomemtype; … … 1299 1308 s->irq = irq; 1300 1309 s->drq = drq; 1301 s->chr = chr;1302 1310 1303 1311 s3c_uart_reset(s); … … 1307 1315 cpu_register_physical_memory(s->base, 0xfff, iomemtype); 1308 1316 1309 if (chr) 1310 qemu_chr_add_read_handler(chr, s3c_uart_is_empty, s3c_uart_rx, s); 1317 return s; 1318 } 1319 1320 void s3c_uart_attach(struct s3c_uart_state_s *s, CharDriverState *chr) 1321 { 1322 if (s->chr_num >= UART_MAX_CHR) 1323 cpu_abort(cpu_single_env, "%s: Too many devices\n", __FUNCTION__); 1324 s->chr[s->chr_num ++] = chr; 1325 1326 qemu_chr_add_read_handler(chr, s3c_uart_is_empty, s3c_uart_rx, s); 1311 1327 /* S3C2410 UART doesn't seem to understand break conditions. */ 1312 1313 return s;1314 1328 } 1315 1329 … … 2190 2204 cpu_register_physical_memory(s->nand_base, 0xffffff, iomemtype); 2191 2205 2192 for (i = 0; s3c2410_uart[i].base; i ++) 2206 for (i = 0; s3c2410_uart[i].base; i ++) { 2193 2207 s->uart[i] = s3c_uart_init(s3c2410_uart[i].base, s->pic, s->dma, 2194 s3c2410_uart[i].irq, s3c2410_uart[i].dma, 2195 serial_hds[i]); 2208 s3c2410_uart[i].irq, s3c2410_uart[i].dma); 2209 if (serial_hds[i]) 2210 s3c_uart_attach(s->uart[i], serial_hds[i]); 2211 } 2196 2212 2197 2213 s->timers = s3c_timers_init(0x51000000, s->pic, s->dma); -
trunk/src/host/qemu-neo1973/openmoko/download.sh
r1640 r1647 1 #! /bin/ sh1 #! /bin/bash 2 2 # Chooses and downloads some OpenMoko image snapshots for flash.sh to use. 3 3 # -
trunk/src/host/qemu-neo1973/openmoko/env
r1640 r1647 8 8 qemu="$src_dir/$qemu_relative" 9 9 flash_image=openmoko-flash.image 10 make=gmake 10 11 11 12 kernel_addr=0x32000000 -
trunk/src/host/qemu-neo1973/openmoko/flash.sh
r1640 r1647 1 #! /bin/ sh1 #! /bin/bash 2 2 # Generates a ready to use OpenMoko NAND flash image. Vaguely based 3 3 # on devirginator and http://wiki.openmoko.org/wiki/NAND_bad_blocks. … … 32 32 fi 33 33 34 makesplash.gz || exit -134 ${make} splash.gz || exit -1 35 35 36 36 # Find the most recent OpenMoko images in the current directory. … … 57 57 58 58 rm -rf $flash_image 59 make$flash_image || exit -159 ${make} $flash_image || exit -1 60 60 61 61 # Launch the emulator assuming that u-boot is now functional enough -
trunk/src/host/qemu-neo1973/vl.h
r1639 r1647 292 292 #define CHR_IOCTL_PP_WRITE_CONTROL 6 293 293 #define CHR_IOCTL_PP_READ_STATUS 7 294 295 #define CHR_IOCTL_MODEM_SET_AFC 8 294 296 295 297 typedef void IOEventHandler(void *opaque, int event);
Note: See TracChangeset
for help on using the changeset viewer.
