Changeset 1647


Ignore:
Timestamp:
04/03/07 16:17:53 (6 years ago)
Author:
andrew
Message:

Allow multiple devices on each UART, add modem ioctls.
Invert GSM power-on signal.
Explicitely use bash and GNU make in scripts. (GNU echo is still needed so we're not 100% BSD-friendly yet)

Location:
trunk/src/host/qemu-neo1973
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/host/qemu-neo1973/hw/neo1973.c

    r1640 r1647  
    101101static void neo_gsm_switch(int line, int level, void *opaque) 
    102102{ 
    103     neo_printf("GSM %sabled.\n", level ? "en" : "dis"); 
     103    neo_printf("GSM %sabled.\n", level ? "dis" : "en"); 
    104104} 
    105105 
  • trunk/src/host/qemu-neo1973/hw/s3c.h

    r1640 r1647  
    110110struct s3c_uart_state_s; 
    111111struct 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[]); 
     113void s3c_uart_attach(struct s3c_uart_state_s *s, CharDriverState *chr); 
    114114 
    115115struct s3c_adc_state_s; 
  • trunk/src/host/qemu-neo1973/hw/s3c2410.c

    r1640 r1647  
    10501050    int rxstart; 
    10511051    int rxlen; 
    1052     CharDriverState *chr; 
     1052#define UART_MAX_CHR    4 
     1053    int chr_num; 
     1054    CharDriverState *chr[UART_MAX_CHR]; 
    10531055 
    10541056    uint8_t lcontrol; 
     
    10751077{ 
    10761078    QEMUSerialSetParams ssp; 
     1079    int i; 
    10771080    if (!s->chr) 
    10781081        return; 
     
    10981101    ssp.stop_bits = (s->lcontrol & (1 << 2)) ? 2 : 1; 
    10991102 
    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); 
    11011105} 
    11021106 
     
    12351239    struct s3c_uart_state_s *s = (struct s3c_uart_state_s *) opaque; 
    12361240    uint8_t ch; 
     1241    int i, afc; 
    12371242    addr -= s->base; 
    12381243 
     
    12571262        break; 
    12581263    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; 
    12601270        break; 
    12611271    case S3C_UTXH: 
    12621272        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); 
    12651275        s3c_uart_empty(s); 
    12661276        break; 
     
    12871297 
    12881298struct 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[]) 
    12911300{ 
    12921301    int iomemtype; 
     
    12991308    s->irq = irq; 
    13001309    s->drq = drq; 
    1301     s->chr = chr; 
    13021310 
    13031311    s3c_uart_reset(s); 
     
    13071315    cpu_register_physical_memory(s->base, 0xfff, iomemtype); 
    13081316 
    1309     if (chr) 
    1310         qemu_chr_add_read_handler(chr, s3c_uart_is_empty, s3c_uart_rx, s); 
     1317    return s; 
     1318} 
     1319 
     1320void 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); 
    13111327    /* S3C2410 UART doesn't seem to understand break conditions.  */ 
    1312  
    1313     return s; 
    13141328} 
    13151329 
     
    21902204    cpu_register_physical_memory(s->nand_base, 0xffffff, iomemtype); 
    21912205 
    2192     for (i = 0; s3c2410_uart[i].base; i ++) 
     2206    for (i = 0; s3c2410_uart[i].base; i ++) { 
    21932207        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    } 
    21962212 
    21972213    s->timers = s3c_timers_init(0x51000000, s->pic, s->dma); 
  • trunk/src/host/qemu-neo1973/openmoko/download.sh

    r1640 r1647  
    1 #! /bin/sh 
     1#! /bin/bash 
    22# Chooses and downloads some OpenMoko image snapshots for flash.sh to use. 
    33# 
  • trunk/src/host/qemu-neo1973/openmoko/env

    r1640 r1647  
    88qemu="$src_dir/$qemu_relative" 
    99flash_image=openmoko-flash.image 
     10make=gmake 
    1011 
    1112kernel_addr=0x32000000 
  • trunk/src/host/qemu-neo1973/openmoko/flash.sh

    r1640 r1647  
    1 #! /bin/sh 
     1#! /bin/bash 
    22# Generates a ready to use OpenMoko NAND flash image.  Vaguely based 
    33# on devirginator and http://wiki.openmoko.org/wiki/NAND_bad_blocks. 
     
    3232fi 
    3333 
    34 make splash.gz || exit -1 
     34${make} splash.gz || exit -1 
    3535 
    3636# Find the most recent OpenMoko images in the current directory. 
     
    5757 
    5858rm -rf $flash_image 
    59 make $flash_image || exit -1 
     59${make} $flash_image || exit -1 
    6060 
    6161# Launch the emulator assuming that u-boot is now functional enough 
  • trunk/src/host/qemu-neo1973/vl.h

    r1639 r1647  
    292292#define CHR_IOCTL_PP_WRITE_CONTROL    6 
    293293#define CHR_IOCTL_PP_READ_STATUS      7 
     294 
     295#define CHR_IOCTL_MODEM_SET_AFC       8 
    294296 
    295297typedef void IOEventHandler(void *opaque, int event); 
Note: See TracChangeset for help on using the changeset viewer.