static void set_dma_addr( unsigned long paddr ) { unsigned long flags; save_flags(flags); cli(); dma_wd.dma_lo = (unsigned char)paddr; paddr >>= 8; MFPDELAY(); dma_wd.dma_md = (unsigned char)paddr; paddr >>= 8; MFPDELAY(); if (ATARIHW_PRESENT( EXTD_DMA )) st_dma_ext_dmahi = (unsigned short)paddr; else dma_wd.dma_hi = (unsigned char)paddr; MFPDELAY(); restore_flags(flags); }
static int __init atakbd_init(void) { int i, error; if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ST_MFP)) return -ENODEV; error = atari_keyb_init(); if (error) return error; atakbd_dev = input_allocate_device(); if (!atakbd_dev) return -ENOMEM; atakbd_dev->name = "Atari Keyboard"; atakbd_dev->phys = "atakbd/input0"; atakbd_dev->id.bustype = BUS_HOST; atakbd_dev->id.vendor = 0x0001; atakbd_dev->id.product = 0x0001; atakbd_dev->id.version = 0x0100; atakbd_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); atakbd_dev->keycode = atakbd_keycode; atakbd_dev->keycodesize = sizeof(unsigned char); atakbd_dev->keycodemax = ARRAY_SIZE(atakbd_keycode); for (i = 1; i < 0x72; i++) { set_bit(atakbd_keycode[i], atakbd_dev->keybit); } error = input_register_device(atakbd_dev); if (error) { input_free_device(atakbd_dev); return error; } atari_input_keyboard_interrupt_hook = atakbd_interrupt; return 0; }
int __init dsp56k_init(void) { if(!MACH_IS_ATARI || !ATARIHW_PRESENT(DSP56K)) { printk("DSP56k driver: Hardware not present\n"); return -ENODEV; } if(devfs_register_chrdev(DSP56K_MAJOR, "dsp56k", &dsp56k_fops)) { printk("DSP56k driver: Unable to register driver\n"); return -ENODEV; } devfs_handle = devfs_register (NULL, "dsp56k", DEVFS_FL_DEFAULT, DSP56K_MAJOR, 0, S_IFCHR | S_IRUSR | S_IWUSR, &dsp56k_fops, NULL); dsp56k.in_use = 0; printk("DSP56k driver installed\n"); return 0; }
static int __init falconide_init(void) { struct ide_host *host; hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; int rc; if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE)) return -ENODEV; printk(KERN_INFO "ide: Falcon IDE controller\n"); if (!request_mem_region(ATA_HD_BASE, 0x40, DRV_NAME)) { printk(KERN_ERR "%s: resources busy\n", DRV_NAME); return -EBUSY; } falconide_setup_ports(&hw); host = ide_host_alloc(&falconide_port_info, hws); if (host == NULL) { rc = -ENOMEM; goto err; } ide_get_lock(NULL, NULL); rc = ide_host_register(host, &falconide_port_info, hws); ide_release_lock(); if (rc) goto err_free; return 0; err_free: ide_host_free(host); err: release_mem_region(ATA_HD_BASE, 0x40); return rc; }
static int __init falconide_init(void) { struct ide_host *host; struct ide_hw hw, *hws[] = { &hw }; int rc; if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE)) return -ENODEV; ; if (!request_mem_region(ATA_HD_BASE, 0x40, DRV_NAME)) { ; return -EBUSY; } falconide_setup_ports(&hw); host = ide_host_alloc(&falconide_port_info, hws, 1); if (host == NULL) { rc = -ENOMEM; goto err; } falconide_get_lock(NULL, NULL); rc = ide_host_register(host, &falconide_port_info, hws); falconide_release_lock(); if (rc) goto err_free; return 0; err_free: ide_host_free(host); err: release_mem_region(ATA_HD_BASE, 0x40); return rc; }
static int __init atamouse_init(void) { int error; if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ST_MFP)) return -ENODEV; if (!atari_keyb_init()) return -ENODEV; atamouse_dev = input_allocate_device(); if (!atamouse_dev) return -ENOMEM; atamouse_dev->name = "Atari mouse"; atamouse_dev->phys = "atamouse/input0"; atamouse_dev->id.bustype = BUS_HOST; atamouse_dev->id.vendor = 0x0001; atamouse_dev->id.product = 0x0002; atamouse_dev->id.version = 0x0100; atamouse_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); atamouse_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); atamouse_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); atamouse_dev->open = atamouse_open; atamouse_dev->close = atamouse_close; error = input_register_device(atamouse_dev); if (error) { input_free_device(atamouse_dev); return error; } return 0; }
static int __init dsp56k_init_driver(void) { int err = 0; if(!MACH_IS_ATARI || !ATARIHW_PRESENT(DSP56K)) { printk("DSP56k driver: Hardware not present\n"); return -ENODEV; } if(register_chrdev(DSP56K_MAJOR, "dsp56k", &dsp56k_fops)) { printk("DSP56k driver: Unable to register driver\n"); return -ENODEV; } dsp56k_class = class_simple_create(THIS_MODULE, "dsp56k"); if (IS_ERR(dsp56k_class)) { err = PTR_ERR(dsp56k_class); goto out_chrdev; } class_simple_device_add(dsp56k_class, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k"); err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k"); if(err) goto out_class; printk(banner); goto out; out_class: class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0)); class_simple_destroy(dsp56k_class); out_chrdev: unregister_chrdev(DSP56K_MAJOR, "dsp56k"); out: return err; }
void atari_init_INTS(void) { int i; /* initialize the vector table */ for (i = 0; i < NUM_INT_SOURCES; ++i) { vectors[IRQ_SOURCE_TO_VECTOR(i)] = bad_interrupt; } /* Initialize the MFP(s) */ #ifdef ATARI_USE_SOFTWARE_EOI mfp.vec_adr = 0x48; /* Software EOI-Mode */ #else mfp.vec_adr = 0x40; /* Automatic EOI-Mode */ #endif mfp.int_en_a = /* turn off MFP-Ints */ mfp.int_en_b = 0x00; mfp.int_mk_a = /* no Masking */ mfp.int_mk_b = 0xff; if (ATARIHW_PRESENT(TT_MFP)) { #ifdef ATARI_USE_SOFTWARE_EOI tt_mfp.vec_adr = 0x58; /* Software EOI-Mode */ #else tt_mfp.vec_adr = 0x50; /* Automatic EOI-Mode */ #endif tt_mfp.int_en_a = /* turn off MFP-Ints */ tt_mfp.int_en_b = 0x00; tt_mfp.int_mk_a = /* no Masking */ tt_mfp.int_mk_b = 0xff; } if (ATARIHW_PRESENT(SCC)) { scc.cha_a_ctrl = 9; MFPDELAY(); scc.cha_a_ctrl = (char) 0xc0; /* hardware reset */ } if (ATARIHW_PRESENT(SCU)) { /* init the SCU if present */ tt_scu.sys_mask = 0x10; /* enable VBL (for the cursor) and * disable HSYNC interrupts (who * needs them?) MFP and SCC are * enabled in VME mask */ tt_scu.vme_mask = 0x60; /* enable MFP and SCC ints */ } else { /* If no SCU, the HSYNC interrupt needs to be disabled this * way. (Else _inthandler in kernel/sys_call.S gets overruns) */ vectors[VEC_INT2] = falcon_hblhandler; } if (ATARIHW_PRESENT(PCM_8BIT) && ATARIHW_PRESENT(MICROWIRE)) { /* Initialize the LM1992 Sound Controller to enable the PSG sound. This is misplaced here, it should be in a atasound_init(), that doesn't exist yet. */ atari_microwire_cmd(MW_LM1992_PSG_HIGH); } stdma_init(); /* Initialize the PSG: all sounds off, both ports output */ sound_ym.rd_data_reg_sel = 7; sound_ym.wd_data = 0xff; }
int atari_scsi_detect (Scsi_Host_Template *host) { static int called = 0; struct Scsi_Host *instance; if (!MACH_IS_ATARI || (!ATARIHW_PRESENT(ST_SCSI) && !ATARIHW_PRESENT(TT_SCSI)) || called) return( 0 ); host->proc_name = "Atari"; atari_scsi_reg_read = IS_A_TT() ? atari_scsi_tt_reg_read : atari_scsi_falcon_reg_read; atari_scsi_reg_write = IS_A_TT() ? atari_scsi_tt_reg_write : atari_scsi_falcon_reg_write; /* setup variables */ host->can_queue = (setup_can_queue > 0) ? setup_can_queue : IS_A_TT() ? ATARI_TT_CAN_QUEUE : ATARI_FALCON_CAN_QUEUE; host->cmd_per_lun = (setup_cmd_per_lun > 0) ? setup_cmd_per_lun : IS_A_TT() ? ATARI_TT_CMD_PER_LUN : ATARI_FALCON_CMD_PER_LUN; /* Force sg_tablesize to 0 on a Falcon! */ host->sg_tablesize = !IS_A_TT() ? ATARI_FALCON_SG_TABLESIZE : (setup_sg_tablesize >= 0) ? setup_sg_tablesize : ATARI_TT_SG_TABLESIZE; if (setup_hostid >= 0) host->this_id = setup_hostid; else { /* use 7 as default */ host->this_id = 7; /* Test if a host id is set in the NVRam */ if (ATARIHW_PRESENT(TT_CLK) && nvram_check_checksum()) { unsigned char b = nvram_read_byte( 14 ); /* Arbitration enabled? (for TOS) If yes, use configured host ID */ if (b & 0x80) host->this_id = b & 7; } } #ifdef SUPPORT_TAGS if (setup_use_tagged_queuing < 0) setup_use_tagged_queuing = DEFAULT_USE_TAGGED_QUEUING; #endif #ifdef REAL_DMA /* If running on a Falcon and if there's TT-Ram (i.e., more than one * memory block, since there's always ST-Ram in a Falcon), then allocate a * STRAM_BUFFER_SIZE byte dribble buffer for transfers from/to alternative * Ram. */ if (MACH_IS_ATARI && ATARIHW_PRESENT(ST_SCSI) && !ATARIHW_PRESENT(EXTD_DMA) && m68k_num_memory > 1) { atari_dma_buffer = atari_stram_alloc(STRAM_BUFFER_SIZE, "SCSI"); if (!atari_dma_buffer) { printk( KERN_ERR "atari_scsi_detect: can't allocate ST-RAM " "double buffer\n" ); return( 0 ); } atari_dma_phys_buffer = virt_to_phys( atari_dma_buffer ); atari_dma_orig_addr = 0; } #endif instance = scsi_register (host, sizeof (struct NCR5380_hostdata)); if(instance == NULL) { atari_stram_free(atari_dma_buffer); atari_dma_buffer = 0; return 0; } atari_scsi_host = instance; /* Set irq to 0, to avoid that the mid-level code disables our interrupt * during queue_command calls. This is completely unnecessary, and even * worse causes bad problems on the Falcon, where the int is shared with * IDE and floppy! */ instance->irq = 0; #ifdef CONFIG_ATARI_SCSI_RESET_BOOT atari_scsi_reset_boot(); #endif NCR5380_init (instance, 0); if (IS_A_TT()) { /* This int is actually "pseudo-slow", i.e. it acts like a slow * interrupt after having cleared the pending flag for the DMA * interrupt. */ if (request_irq(IRQ_TT_MFP_SCSI, scsi_tt_intr, IRQ_TYPE_SLOW, "SCSI NCR5380", scsi_tt_intr)) { printk(KERN_ERR "atari_scsi_detect: cannot allocate irq %d, aborting",IRQ_TT_MFP_SCSI); scsi_unregister(atari_scsi_host); atari_stram_free(atari_dma_buffer); atari_dma_buffer = 0; return 0; } tt_mfp.active_edge |= 0x80; /* SCSI int on L->H */ #ifdef REAL_DMA tt_scsi_dma.dma_ctrl = 0; atari_dma_residual = 0; #ifdef CONFIG_TT_DMA_EMUL if (MACH_IS_HADES) { if (request_irq(IRQ_AUTO_2, hades_dma_emulator, IRQ_TYPE_PRIO, "Hades DMA emulator", hades_dma_emulator)) { printk(KERN_ERR "atari_scsi_detect: cannot allocate irq %d, aborting (MACH_IS_HADES)",IRQ_AUTO_2); free_irq(IRQ_TT_MFP_SCSI, scsi_tt_intr); scsi_unregister(atari_scsi_host); atari_stram_free(atari_dma_buffer); atari_dma_buffer = 0; return 0; } } #endif if (MACH_IS_MEDUSA || MACH_IS_HADES) { /* While the read overruns (described by Drew Eckhardt in * NCR5380.c) never happened on TTs, they do in fact on the Medusa * (This was the cause why SCSI didn't work right for so long * there.) Since handling the overruns slows down a bit, I turned * the #ifdef's into a runtime condition. * * In principle it should be sufficient to do max. 1 byte with * PIO, but there is another problem on the Medusa with the DMA * rest data register. So 'atari_read_overruns' is currently set * to 4 to avoid having transfers that aren't a multiple of 4. If * the rest data bug is fixed, this can be lowered to 1. */ atari_read_overruns = 4; } #endif /*REAL_DMA*/ } else { /* ! IS_A_TT */ /* Nothing to do for the interrupt: the ST-DMA is initialized * already by atari_init_INTS() */ #ifdef REAL_DMA atari_dma_residual = 0; atari_dma_active = 0; atari_dma_stram_mask = (ATARIHW_PRESENT(EXTD_DMA) ? 0x00000000 : 0xff000000); #endif } printk(KERN_INFO "scsi%d: options CAN_QUEUE=%d CMD_PER_LUN=%d SCAT-GAT=%d " #ifdef SUPPORT_TAGS "TAGGED-QUEUING=%s " #endif "HOSTID=%d", instance->host_no, instance->hostt->can_queue, instance->hostt->cmd_per_lun, instance->hostt->sg_tablesize, #ifdef SUPPORT_TAGS setup_use_tagged_queuing ? "yes" : "no", #endif instance->hostt->this_id ); NCR5380_print_options (instance); printk ("\n"); called = 1; return( 1 ); }
void __init atari_init_IRQ(void) { m68k_setup_user_interrupt(VEC_USER, NUM_ATARI_SOURCES - IRQ_USER, NULL); m68k_setup_irq_controller(&atari_irq_controller, 1, NUM_ATARI_SOURCES - 1); /* Initialize the MFP(s) */ #ifdef ATARI_USE_SOFTWARE_EOI st_mfp.vec_adr = 0x48; /* Software EOI-Mode */ #else st_mfp.vec_adr = 0x40; /* Automatic EOI-Mode */ #endif st_mfp.int_en_a = 0x00; /* turn off MFP-Ints */ st_mfp.int_en_b = 0x00; st_mfp.int_mk_a = 0xff; /* no Masking */ st_mfp.int_mk_b = 0xff; if (ATARIHW_PRESENT(TT_MFP)) { #ifdef ATARI_USE_SOFTWARE_EOI tt_mfp.vec_adr = 0x58; /* Software EOI-Mode */ #else tt_mfp.vec_adr = 0x50; /* Automatic EOI-Mode */ #endif tt_mfp.int_en_a = 0x00; /* turn off MFP-Ints */ tt_mfp.int_en_b = 0x00; tt_mfp.int_mk_a = 0xff; /* no Masking */ tt_mfp.int_mk_b = 0xff; } if (ATARIHW_PRESENT(SCC) && !atari_SCC_reset_done) { scc.cha_a_ctrl = 9; MFPDELAY(); scc.cha_a_ctrl = (char) 0xc0; /* hardware reset */ } if (ATARIHW_PRESENT(SCU)) { /* init the SCU if present */ tt_scu.sys_mask = 0x10; /* enable VBL (for the cursor) and * disable HSYNC interrupts (who * needs them?) MFP and SCC are * enabled in VME mask */ tt_scu.vme_mask = 0x60; /* enable MFP and SCC ints */ } else { /* If no SCU and no Hades, the HSYNC interrupt needs to be * disabled this way. (Else _inthandler in kernel/sys_call.S * gets overruns) */ vectors[VEC_INT2] = falcon_hblhandler; vectors[VEC_INT4] = falcon_hblhandler; } if (ATARIHW_PRESENT(PCM_8BIT) && ATARIHW_PRESENT(MICROWIRE)) { /* Initialize the LM1992 Sound Controller to enable the PSG sound. This is misplaced here, it should be in an atasound_init(), that doesn't exist yet. */ atari_microwire_cmd(MW_LM1992_PSG_HIGH); } stdma_init(); /* Initialize the PSG: all sounds off, both ports output */ sound_ym.rd_data_reg_sel = 7; sound_ym.wd_data = 0xff; }
int atari_scsi_detect (Scsi_Host_Template *host) { static int called = 0; struct Scsi_Host *instance; if (!MACH_IS_ATARI || (!ATARIHW_PRESENT(ST_SCSI) && !ATARIHW_PRESENT(TT_SCSI)) || called) return( 0 ); host->proc_dir = &proc_scsi_atari; atari_scsi_reg_read = IS_A_TT() ? atari_scsi_tt_reg_read : atari_scsi_falcon_reg_read; atari_scsi_reg_write = IS_A_TT() ? atari_scsi_tt_reg_write : atari_scsi_falcon_reg_write; /* setup variables */ host->can_queue = (setup_can_queue > 0) ? setup_can_queue : IS_A_TT() ? ATARI_TT_CAN_QUEUE : ATARI_FALCON_CAN_QUEUE; host->cmd_per_lun = (setup_cmd_per_lun > 0) ? setup_cmd_per_lun : IS_A_TT() ? ATARI_TT_CMD_PER_LUN : ATARI_FALCON_CMD_PER_LUN; /* Force sg_tablesize to 0 on a Falcon! */ host->sg_tablesize = !IS_A_TT() ? ATARI_FALCON_SG_TABLESIZE : (setup_sg_tablesize >= 0) ? setup_sg_tablesize : ATARI_TT_SG_TABLESIZE; if (setup_hostid >= 0) host->this_id = setup_hostid; else { /* use 7 as default */ host->this_id = 7; /* Test if a host id is set in the NVRam */ if (ATARIHW_PRESENT(TT_CLK)) { unsigned char sum = 0, b; int i; /* Make checksum */ for( i = 14; i < 62; ++i ) sum += RTC_READ(i); if (/* NV-Ram checksum valid? */ RTC_READ(62) == sum && RTC_READ(63) == ~sum && /* Arbitration enabled? (for TOS) */ (b = RTC_READ( 30 )) & 0x80) { host->this_id = b & 7; } } } #ifdef SUPPORT_TAGS if (setup_use_tagged_queuing < 0) setup_use_tagged_queuing = DEFAULT_USE_TAGGED_QUEUING; #endif /* If running on a Falcon and if there's TT-Ram (i.e., more than one * memory block, since there's always ST-Ram in a Falcon), then allocate a * STRAM_BUFFER_SIZE byte dribble buffer for transfers from/to alternative * Ram. */ if (MACH_IS_ATARI && ATARIHW_PRESENT(ST_SCSI) && !ATARIHW_PRESENT(EXTD_DMA) && boot_info.num_memory > 1) { atari_dma_buffer = scsi_init_malloc(STRAM_BUFFER_SIZE, GFP_ATOMIC | GFP_DMA); atari_dma_phys_buffer = VTOP( atari_dma_buffer ); atari_dma_orig_addr = 0; } instance = scsi_register (host, sizeof (struct NCR5380_hostdata)); atari_scsi_host = instance; instance->irq = IS_A_TT() ? IRQ_TT_MFP_SCSI : IRQ_MFP_FSCSI; atari_scsi_reset_boot(); NCR5380_init (instance, 0); if (IS_A_TT()) { /* This int is actually "pseudo-slow", i.e. it acts like a slow * interrupt after having cleared the pending flag for the DMA * interrupt. */ add_isr(IRQ_TT_MFP_SCSI, scsi_tt_intr, IRQ_TYPE_SLOW, NULL, "SCSI NCR5380"); tt_mfp.active_edge |= 0x80; /* SCSI int on L->H */ #ifdef REAL_DMA tt_scsi_dma.dma_ctrl = 0; atari_dma_residual = 0; #endif /* REAL_DMA */ if (is_medusa) { /* While the read overruns (described by Drew Eckhardt in * NCR5380.c) never happened on TTs, they do in fact on the Medusa * (This was the cause why SCSI didn't work right for so long * there.) Since handling the overruns slows down a bit, I turned * the #ifdef's into a runtime condition. * * In principle it should be sufficient to do max. 1 byte with * PIO, but there is another problem on the Medusa with the DMA * rest data register. So 'atari_read_overruns' is currently set * to 4 to avoid having transfers that aren't a multiple of 4. If * the rest data bug is fixed, this can be lowered to 1. */ atari_read_overruns = 4; } } else { /* ! IS_A_TT */ /* Nothing to do for the interrupt: the ST-DMA is initialized * already by atari_init_INTS() */ #ifdef REAL_DMA atari_dma_residual = 0; atari_dma_active = 0; atari_dma_stram_mask = (ATARIHW_PRESENT(EXTD_DMA) ? 0x00000000 : 0xff000000); #endif } printk(KERN_INFO "scsi%d: options CAN_QUEUE=%d CMD_PER_LUN=%d SCAT-GAT=%d " #ifdef SUPPORT_TAGS "TAGGED-QUEUING=%s " #endif "HOSTID=%d", instance->host_no, instance->hostt->can_queue, instance->hostt->cmd_per_lun, instance->hostt->sg_tablesize, #ifdef SUPPORT_TAGS setup_use_tagged_queuing ? "yes" : "no", #endif instance->hostt->this_id ); NCR5380_print_options (instance); printk ("\n"); called = 1; return( 1 ); }
void atari_init_scc_port(int cflag) #endif { extern int atari_SCC_reset_done; static int clksrc_table[9] = /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 }; static int brgsrc_table[9] = /* reg 14: 0 = RTxC, 2 = PCLK */ { 2, 2, 2, 2, 2, 2, 0, 2, 2 }; static int clkmode_table[9] = /* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */ { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 }; static int div_table[9] = /* reg12 (BRG low) */ { 208, 138, 103, 50, 24, 11, 1, 0, 0 }; int baud = cflag & CBAUD; int clksrc, clkmode, div, reg3, reg5; if (cflag & CBAUDEX) baud += B38400; if (baud < B1200 || baud > B38400+2) baud = B9600; /* use default 9600bps for non-implemented rates */ baud -= B1200; /* tables starts at 1200bps */ clksrc = clksrc_table[baud]; clkmode = clkmode_table[baud]; div = div_table[baud]; if (ATARIHW_PRESENT(TT_MFP) && baud >= 6) { /* special treatment for TT, where rates >= 38400 are done via TRxC */ clksrc = 0x28; /* TRxC */ clkmode = baud == 6 ? 0xc0 : baud == 7 ? 0x80 : /* really 76800bps */ 0x40; /* really 153600bps */ div = 0; } reg3 = (cflag & CSIZE) == CS8 ? 0xc0 : 0x40; reg5 = (cflag & CSIZE) == CS8 ? 0x60 : 0x20 | 0x82 /* assert DTR/RTS */; (void)scc.cha_b_ctrl; /* reset reg pointer */ SCC_WRITE(9, 0xc0); /* reset */ LONG_DELAY(); /* extra delay after WR9 access */ SCC_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 | 0x04 /* 1 stopbit */ | clkmode); SCC_WRITE(3, reg3); SCC_WRITE(5, reg5); SCC_WRITE(9, 0); /* no interrupts */ LONG_DELAY(); /* extra delay after WR9 access */ SCC_WRITE(10, 0); /* NRZ mode */ SCC_WRITE(11, clksrc); /* main clock source */ SCC_WRITE(12, div); /* BRG value */ SCC_WRITE(13, 0); /* BRG high byte */ SCC_WRITE(14, brgsrc_table[baud]); SCC_WRITE(14, brgsrc_table[baud] | (div ? 1 : 0)); SCC_WRITE(3, reg3 | 1); SCC_WRITE(5, reg5 | 8); atari_SCC_reset_done = 1; atari_SCC_init_done = 1; }