1*1da177e4SLinus Torvalds /* 2*1da177e4SLinus Torvalds * linux/arch/m68k/amiga/config.c 3*1da177e4SLinus Torvalds * 4*1da177e4SLinus Torvalds * Copyright (C) 1993 Hamish Macdonald 5*1da177e4SLinus Torvalds * 6*1da177e4SLinus Torvalds * This file is subject to the terms and conditions of the GNU General Public 7*1da177e4SLinus Torvalds * License. See the file COPYING in the main directory of this archive 8*1da177e4SLinus Torvalds * for more details. 9*1da177e4SLinus Torvalds */ 10*1da177e4SLinus Torvalds 11*1da177e4SLinus Torvalds /* 12*1da177e4SLinus Torvalds * Miscellaneous Amiga stuff 13*1da177e4SLinus Torvalds */ 14*1da177e4SLinus Torvalds 15*1da177e4SLinus Torvalds #include <linux/config.h> 16*1da177e4SLinus Torvalds #include <linux/types.h> 17*1da177e4SLinus Torvalds #include <linux/kernel.h> 18*1da177e4SLinus Torvalds #include <linux/mm.h> 19*1da177e4SLinus Torvalds #include <linux/tty.h> 20*1da177e4SLinus Torvalds #include <linux/console.h> 21*1da177e4SLinus Torvalds #include <linux/rtc.h> 22*1da177e4SLinus Torvalds #include <linux/init.h> 23*1da177e4SLinus Torvalds #include <linux/vt_kern.h> 24*1da177e4SLinus Torvalds #include <linux/delay.h> 25*1da177e4SLinus Torvalds #include <linux/interrupt.h> 26*1da177e4SLinus Torvalds #ifdef CONFIG_ZORRO 27*1da177e4SLinus Torvalds #include <linux/zorro.h> 28*1da177e4SLinus Torvalds #endif 29*1da177e4SLinus Torvalds 30*1da177e4SLinus Torvalds #include <asm/bootinfo.h> 31*1da177e4SLinus Torvalds #include <asm/setup.h> 32*1da177e4SLinus Torvalds #include <asm/system.h> 33*1da177e4SLinus Torvalds #include <asm/pgtable.h> 34*1da177e4SLinus Torvalds #include <asm/amigahw.h> 35*1da177e4SLinus Torvalds #include <asm/amigaints.h> 36*1da177e4SLinus Torvalds #include <asm/irq.h> 37*1da177e4SLinus Torvalds #include <asm/rtc.h> 38*1da177e4SLinus Torvalds #include <asm/machdep.h> 39*1da177e4SLinus Torvalds #include <asm/io.h> 40*1da177e4SLinus Torvalds 41*1da177e4SLinus Torvalds unsigned long amiga_model; 42*1da177e4SLinus Torvalds unsigned long amiga_eclock; 43*1da177e4SLinus Torvalds unsigned long amiga_masterclock; 44*1da177e4SLinus Torvalds unsigned long amiga_colorclock; 45*1da177e4SLinus Torvalds unsigned long amiga_chipset; 46*1da177e4SLinus Torvalds unsigned char amiga_vblank; 47*1da177e4SLinus Torvalds unsigned char amiga_psfreq; 48*1da177e4SLinus Torvalds struct amiga_hw_present amiga_hw_present; 49*1da177e4SLinus Torvalds 50*1da177e4SLinus Torvalds static char s_a500[] __initdata = "A500"; 51*1da177e4SLinus Torvalds static char s_a500p[] __initdata = "A500+"; 52*1da177e4SLinus Torvalds static char s_a600[] __initdata = "A600"; 53*1da177e4SLinus Torvalds static char s_a1000[] __initdata = "A1000"; 54*1da177e4SLinus Torvalds static char s_a1200[] __initdata = "A1200"; 55*1da177e4SLinus Torvalds static char s_a2000[] __initdata = "A2000"; 56*1da177e4SLinus Torvalds static char s_a2500[] __initdata = "A2500"; 57*1da177e4SLinus Torvalds static char s_a3000[] __initdata = "A3000"; 58*1da177e4SLinus Torvalds static char s_a3000t[] __initdata = "A3000T"; 59*1da177e4SLinus Torvalds static char s_a3000p[] __initdata = "A3000+"; 60*1da177e4SLinus Torvalds static char s_a4000[] __initdata = "A4000"; 61*1da177e4SLinus Torvalds static char s_a4000t[] __initdata = "A4000T"; 62*1da177e4SLinus Torvalds static char s_cdtv[] __initdata = "CDTV"; 63*1da177e4SLinus Torvalds static char s_cd32[] __initdata = "CD32"; 64*1da177e4SLinus Torvalds static char s_draco[] __initdata = "Draco"; 65*1da177e4SLinus Torvalds static char *amiga_models[] __initdata = { 66*1da177e4SLinus Torvalds [AMI_500-AMI_500] = s_a500, 67*1da177e4SLinus Torvalds [AMI_500PLUS-AMI_500] = s_a500p, 68*1da177e4SLinus Torvalds [AMI_600-AMI_500] = s_a600, 69*1da177e4SLinus Torvalds [AMI_1000-AMI_500] = s_a1000, 70*1da177e4SLinus Torvalds [AMI_1200-AMI_500] = s_a1200, 71*1da177e4SLinus Torvalds [AMI_2000-AMI_500] = s_a2000, 72*1da177e4SLinus Torvalds [AMI_2500-AMI_500] = s_a2500, 73*1da177e4SLinus Torvalds [AMI_3000-AMI_500] = s_a3000, 74*1da177e4SLinus Torvalds [AMI_3000T-AMI_500] = s_a3000t, 75*1da177e4SLinus Torvalds [AMI_3000PLUS-AMI_500] = s_a3000p, 76*1da177e4SLinus Torvalds [AMI_4000-AMI_500] = s_a4000, 77*1da177e4SLinus Torvalds [AMI_4000T-AMI_500] = s_a4000t, 78*1da177e4SLinus Torvalds [AMI_CDTV-AMI_500] = s_cdtv, 79*1da177e4SLinus Torvalds [AMI_CD32-AMI_500] = s_cd32, 80*1da177e4SLinus Torvalds [AMI_DRACO-AMI_500] = s_draco, 81*1da177e4SLinus Torvalds }; 82*1da177e4SLinus Torvalds 83*1da177e4SLinus Torvalds static char amiga_model_name[13] = "Amiga "; 84*1da177e4SLinus Torvalds 85*1da177e4SLinus Torvalds extern char m68k_debug_device[]; 86*1da177e4SLinus Torvalds 87*1da177e4SLinus Torvalds static void amiga_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *)); 88*1da177e4SLinus Torvalds /* amiga specific irq functions */ 89*1da177e4SLinus Torvalds extern void amiga_init_IRQ (void); 90*1da177e4SLinus Torvalds extern irqreturn_t (*amiga_default_handler[]) (int, void *, struct pt_regs *); 91*1da177e4SLinus Torvalds extern int amiga_request_irq (unsigned int irq, 92*1da177e4SLinus Torvalds irqreturn_t (*handler)(int, void *, struct pt_regs *), 93*1da177e4SLinus Torvalds unsigned long flags, const char *devname, 94*1da177e4SLinus Torvalds void *dev_id); 95*1da177e4SLinus Torvalds extern void amiga_free_irq (unsigned int irq, void *dev_id); 96*1da177e4SLinus Torvalds extern void amiga_enable_irq (unsigned int); 97*1da177e4SLinus Torvalds extern void amiga_disable_irq (unsigned int); 98*1da177e4SLinus Torvalds static void amiga_get_model(char *model); 99*1da177e4SLinus Torvalds static int amiga_get_hardware_list(char *buffer); 100*1da177e4SLinus Torvalds extern int show_amiga_interrupts (struct seq_file *, void *); 101*1da177e4SLinus Torvalds /* amiga specific timer functions */ 102*1da177e4SLinus Torvalds static unsigned long amiga_gettimeoffset (void); 103*1da177e4SLinus Torvalds static int a3000_hwclk (int, struct rtc_time *); 104*1da177e4SLinus Torvalds static int a2000_hwclk (int, struct rtc_time *); 105*1da177e4SLinus Torvalds static int amiga_set_clock_mmss (unsigned long); 106*1da177e4SLinus Torvalds static unsigned int amiga_get_ss (void); 107*1da177e4SLinus Torvalds extern void amiga_mksound( unsigned int count, unsigned int ticks ); 108*1da177e4SLinus Torvalds #ifdef CONFIG_AMIGA_FLOPPY 109*1da177e4SLinus Torvalds extern void amiga_floppy_setup(char *, int *); 110*1da177e4SLinus Torvalds #endif 111*1da177e4SLinus Torvalds static void amiga_reset (void); 112*1da177e4SLinus Torvalds extern void amiga_init_sound(void); 113*1da177e4SLinus Torvalds static void amiga_savekmsg_init(void); 114*1da177e4SLinus Torvalds static void amiga_mem_console_write(struct console *co, const char *b, 115*1da177e4SLinus Torvalds unsigned int count); 116*1da177e4SLinus Torvalds void amiga_serial_console_write(struct console *co, const char *s, 117*1da177e4SLinus Torvalds unsigned int count); 118*1da177e4SLinus Torvalds static void amiga_debug_init(void); 119*1da177e4SLinus Torvalds #ifdef CONFIG_HEARTBEAT 120*1da177e4SLinus Torvalds static void amiga_heartbeat(int on); 121*1da177e4SLinus Torvalds #endif 122*1da177e4SLinus Torvalds 123*1da177e4SLinus Torvalds static struct console amiga_console_driver = { 124*1da177e4SLinus Torvalds .name = "debug", 125*1da177e4SLinus Torvalds .flags = CON_PRINTBUFFER, 126*1da177e4SLinus Torvalds .index = -1, 127*1da177e4SLinus Torvalds }; 128*1da177e4SLinus Torvalds 129*1da177e4SLinus Torvalds 130*1da177e4SLinus Torvalds /* 131*1da177e4SLinus Torvalds * Motherboard Resources present in all Amiga models 132*1da177e4SLinus Torvalds */ 133*1da177e4SLinus Torvalds 134*1da177e4SLinus Torvalds static struct { 135*1da177e4SLinus Torvalds struct resource _ciab, _ciaa, _custom, _kickstart; 136*1da177e4SLinus Torvalds } mb_resources = { 137*1da177e4SLinus Torvalds ._ciab = { 138*1da177e4SLinus Torvalds .name = "CIA B", .start = 0x00bfd000, .end = 0x00bfdfff 139*1da177e4SLinus Torvalds }, 140*1da177e4SLinus Torvalds ._ciaa = { 141*1da177e4SLinus Torvalds .name = "CIA A", .start = 0x00bfe000, .end = 0x00bfefff 142*1da177e4SLinus Torvalds }, 143*1da177e4SLinus Torvalds ._custom = { 144*1da177e4SLinus Torvalds .name = "Custom I/O", .start = 0x00dff000, .end = 0x00dfffff 145*1da177e4SLinus Torvalds }, 146*1da177e4SLinus Torvalds ._kickstart = { 147*1da177e4SLinus Torvalds .name = "Kickstart ROM", .start = 0x00f80000, .end = 0x00ffffff 148*1da177e4SLinus Torvalds } 149*1da177e4SLinus Torvalds }; 150*1da177e4SLinus Torvalds 151*1da177e4SLinus Torvalds static struct resource rtc_resource = { 152*1da177e4SLinus Torvalds .start = 0x00dc0000, .end = 0x00dcffff 153*1da177e4SLinus Torvalds }; 154*1da177e4SLinus Torvalds 155*1da177e4SLinus Torvalds static struct resource ram_resource[NUM_MEMINFO]; 156*1da177e4SLinus Torvalds 157*1da177e4SLinus Torvalds 158*1da177e4SLinus Torvalds /* 159*1da177e4SLinus Torvalds * Parse an Amiga-specific record in the bootinfo 160*1da177e4SLinus Torvalds */ 161*1da177e4SLinus Torvalds 162*1da177e4SLinus Torvalds int amiga_parse_bootinfo(const struct bi_record *record) 163*1da177e4SLinus Torvalds { 164*1da177e4SLinus Torvalds int unknown = 0; 165*1da177e4SLinus Torvalds const unsigned long *data = record->data; 166*1da177e4SLinus Torvalds 167*1da177e4SLinus Torvalds switch (record->tag) { 168*1da177e4SLinus Torvalds case BI_AMIGA_MODEL: 169*1da177e4SLinus Torvalds amiga_model = *data; 170*1da177e4SLinus Torvalds break; 171*1da177e4SLinus Torvalds 172*1da177e4SLinus Torvalds case BI_AMIGA_ECLOCK: 173*1da177e4SLinus Torvalds amiga_eclock = *data; 174*1da177e4SLinus Torvalds break; 175*1da177e4SLinus Torvalds 176*1da177e4SLinus Torvalds case BI_AMIGA_CHIPSET: 177*1da177e4SLinus Torvalds amiga_chipset = *data; 178*1da177e4SLinus Torvalds break; 179*1da177e4SLinus Torvalds 180*1da177e4SLinus Torvalds case BI_AMIGA_CHIP_SIZE: 181*1da177e4SLinus Torvalds amiga_chip_size = *(const int *)data; 182*1da177e4SLinus Torvalds break; 183*1da177e4SLinus Torvalds 184*1da177e4SLinus Torvalds case BI_AMIGA_VBLANK: 185*1da177e4SLinus Torvalds amiga_vblank = *(const unsigned char *)data; 186*1da177e4SLinus Torvalds break; 187*1da177e4SLinus Torvalds 188*1da177e4SLinus Torvalds case BI_AMIGA_PSFREQ: 189*1da177e4SLinus Torvalds amiga_psfreq = *(const unsigned char *)data; 190*1da177e4SLinus Torvalds break; 191*1da177e4SLinus Torvalds 192*1da177e4SLinus Torvalds case BI_AMIGA_AUTOCON: 193*1da177e4SLinus Torvalds #ifdef CONFIG_ZORRO 194*1da177e4SLinus Torvalds if (zorro_num_autocon < ZORRO_NUM_AUTO) { 195*1da177e4SLinus Torvalds const struct ConfigDev *cd = (struct ConfigDev *)data; 196*1da177e4SLinus Torvalds struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon++]; 197*1da177e4SLinus Torvalds dev->rom = cd->cd_Rom; 198*1da177e4SLinus Torvalds dev->slotaddr = cd->cd_SlotAddr; 199*1da177e4SLinus Torvalds dev->slotsize = cd->cd_SlotSize; 200*1da177e4SLinus Torvalds dev->resource.start = (unsigned long)cd->cd_BoardAddr; 201*1da177e4SLinus Torvalds dev->resource.end = dev->resource.start+cd->cd_BoardSize-1; 202*1da177e4SLinus Torvalds } else 203*1da177e4SLinus Torvalds printk("amiga_parse_bootinfo: too many AutoConfig devices\n"); 204*1da177e4SLinus Torvalds #endif /* CONFIG_ZORRO */ 205*1da177e4SLinus Torvalds break; 206*1da177e4SLinus Torvalds 207*1da177e4SLinus Torvalds case BI_AMIGA_SERPER: 208*1da177e4SLinus Torvalds /* serial port period: ignored here */ 209*1da177e4SLinus Torvalds break; 210*1da177e4SLinus Torvalds 211*1da177e4SLinus Torvalds default: 212*1da177e4SLinus Torvalds unknown = 1; 213*1da177e4SLinus Torvalds } 214*1da177e4SLinus Torvalds return(unknown); 215*1da177e4SLinus Torvalds } 216*1da177e4SLinus Torvalds 217*1da177e4SLinus Torvalds /* 218*1da177e4SLinus Torvalds * Identify builtin hardware 219*1da177e4SLinus Torvalds */ 220*1da177e4SLinus Torvalds 221*1da177e4SLinus Torvalds static void __init amiga_identify(void) 222*1da177e4SLinus Torvalds { 223*1da177e4SLinus Torvalds /* Fill in some default values, if necessary */ 224*1da177e4SLinus Torvalds if (amiga_eclock == 0) 225*1da177e4SLinus Torvalds amiga_eclock = 709379; 226*1da177e4SLinus Torvalds 227*1da177e4SLinus Torvalds memset(&amiga_hw_present, 0, sizeof(amiga_hw_present)); 228*1da177e4SLinus Torvalds 229*1da177e4SLinus Torvalds printk("Amiga hardware found: "); 230*1da177e4SLinus Torvalds if (amiga_model >= AMI_500 && amiga_model <= AMI_DRACO) { 231*1da177e4SLinus Torvalds printk("[%s] ", amiga_models[amiga_model-AMI_500]); 232*1da177e4SLinus Torvalds strcat(amiga_model_name, amiga_models[amiga_model-AMI_500]); 233*1da177e4SLinus Torvalds } 234*1da177e4SLinus Torvalds 235*1da177e4SLinus Torvalds switch(amiga_model) { 236*1da177e4SLinus Torvalds case AMI_UNKNOWN: 237*1da177e4SLinus Torvalds goto Generic; 238*1da177e4SLinus Torvalds 239*1da177e4SLinus Torvalds case AMI_600: 240*1da177e4SLinus Torvalds case AMI_1200: 241*1da177e4SLinus Torvalds AMIGAHW_SET(A1200_IDE); 242*1da177e4SLinus Torvalds AMIGAHW_SET(PCMCIA); 243*1da177e4SLinus Torvalds case AMI_500: 244*1da177e4SLinus Torvalds case AMI_500PLUS: 245*1da177e4SLinus Torvalds case AMI_1000: 246*1da177e4SLinus Torvalds case AMI_2000: 247*1da177e4SLinus Torvalds case AMI_2500: 248*1da177e4SLinus Torvalds AMIGAHW_SET(A2000_CLK); /* Is this correct for all models? */ 249*1da177e4SLinus Torvalds goto Generic; 250*1da177e4SLinus Torvalds 251*1da177e4SLinus Torvalds case AMI_3000: 252*1da177e4SLinus Torvalds case AMI_3000T: 253*1da177e4SLinus Torvalds AMIGAHW_SET(AMBER_FF); 254*1da177e4SLinus Torvalds AMIGAHW_SET(MAGIC_REKICK); 255*1da177e4SLinus Torvalds /* fall through */ 256*1da177e4SLinus Torvalds case AMI_3000PLUS: 257*1da177e4SLinus Torvalds AMIGAHW_SET(A3000_SCSI); 258*1da177e4SLinus Torvalds AMIGAHW_SET(A3000_CLK); 259*1da177e4SLinus Torvalds AMIGAHW_SET(ZORRO3); 260*1da177e4SLinus Torvalds goto Generic; 261*1da177e4SLinus Torvalds 262*1da177e4SLinus Torvalds case AMI_4000T: 263*1da177e4SLinus Torvalds AMIGAHW_SET(A4000_SCSI); 264*1da177e4SLinus Torvalds /* fall through */ 265*1da177e4SLinus Torvalds case AMI_4000: 266*1da177e4SLinus Torvalds AMIGAHW_SET(A4000_IDE); 267*1da177e4SLinus Torvalds AMIGAHW_SET(A3000_CLK); 268*1da177e4SLinus Torvalds AMIGAHW_SET(ZORRO3); 269*1da177e4SLinus Torvalds goto Generic; 270*1da177e4SLinus Torvalds 271*1da177e4SLinus Torvalds case AMI_CDTV: 272*1da177e4SLinus Torvalds case AMI_CD32: 273*1da177e4SLinus Torvalds AMIGAHW_SET(CD_ROM); 274*1da177e4SLinus Torvalds AMIGAHW_SET(A2000_CLK); /* Is this correct? */ 275*1da177e4SLinus Torvalds goto Generic; 276*1da177e4SLinus Torvalds 277*1da177e4SLinus Torvalds Generic: 278*1da177e4SLinus Torvalds AMIGAHW_SET(AMI_VIDEO); 279*1da177e4SLinus Torvalds AMIGAHW_SET(AMI_BLITTER); 280*1da177e4SLinus Torvalds AMIGAHW_SET(AMI_AUDIO); 281*1da177e4SLinus Torvalds AMIGAHW_SET(AMI_FLOPPY); 282*1da177e4SLinus Torvalds AMIGAHW_SET(AMI_KEYBOARD); 283*1da177e4SLinus Torvalds AMIGAHW_SET(AMI_MOUSE); 284*1da177e4SLinus Torvalds AMIGAHW_SET(AMI_SERIAL); 285*1da177e4SLinus Torvalds AMIGAHW_SET(AMI_PARALLEL); 286*1da177e4SLinus Torvalds AMIGAHW_SET(CHIP_RAM); 287*1da177e4SLinus Torvalds AMIGAHW_SET(PAULA); 288*1da177e4SLinus Torvalds 289*1da177e4SLinus Torvalds switch(amiga_chipset) { 290*1da177e4SLinus Torvalds case CS_OCS: 291*1da177e4SLinus Torvalds case CS_ECS: 292*1da177e4SLinus Torvalds case CS_AGA: 293*1da177e4SLinus Torvalds switch (custom.deniseid & 0xf) { 294*1da177e4SLinus Torvalds case 0x0c: 295*1da177e4SLinus Torvalds AMIGAHW_SET(DENISE_HR); 296*1da177e4SLinus Torvalds break; 297*1da177e4SLinus Torvalds case 0x08: 298*1da177e4SLinus Torvalds AMIGAHW_SET(LISA); 299*1da177e4SLinus Torvalds break; 300*1da177e4SLinus Torvalds } 301*1da177e4SLinus Torvalds break; 302*1da177e4SLinus Torvalds default: 303*1da177e4SLinus Torvalds AMIGAHW_SET(DENISE); 304*1da177e4SLinus Torvalds break; 305*1da177e4SLinus Torvalds } 306*1da177e4SLinus Torvalds switch ((custom.vposr>>8) & 0x7f) { 307*1da177e4SLinus Torvalds case 0x00: 308*1da177e4SLinus Torvalds AMIGAHW_SET(AGNUS_PAL); 309*1da177e4SLinus Torvalds break; 310*1da177e4SLinus Torvalds case 0x10: 311*1da177e4SLinus Torvalds AMIGAHW_SET(AGNUS_NTSC); 312*1da177e4SLinus Torvalds break; 313*1da177e4SLinus Torvalds case 0x20: 314*1da177e4SLinus Torvalds case 0x21: 315*1da177e4SLinus Torvalds AMIGAHW_SET(AGNUS_HR_PAL); 316*1da177e4SLinus Torvalds break; 317*1da177e4SLinus Torvalds case 0x30: 318*1da177e4SLinus Torvalds case 0x31: 319*1da177e4SLinus Torvalds AMIGAHW_SET(AGNUS_HR_NTSC); 320*1da177e4SLinus Torvalds break; 321*1da177e4SLinus Torvalds case 0x22: 322*1da177e4SLinus Torvalds case 0x23: 323*1da177e4SLinus Torvalds AMIGAHW_SET(ALICE_PAL); 324*1da177e4SLinus Torvalds break; 325*1da177e4SLinus Torvalds case 0x32: 326*1da177e4SLinus Torvalds case 0x33: 327*1da177e4SLinus Torvalds AMIGAHW_SET(ALICE_NTSC); 328*1da177e4SLinus Torvalds break; 329*1da177e4SLinus Torvalds } 330*1da177e4SLinus Torvalds AMIGAHW_SET(ZORRO); 331*1da177e4SLinus Torvalds break; 332*1da177e4SLinus Torvalds 333*1da177e4SLinus Torvalds case AMI_DRACO: 334*1da177e4SLinus Torvalds panic("No support for Draco yet"); 335*1da177e4SLinus Torvalds 336*1da177e4SLinus Torvalds default: 337*1da177e4SLinus Torvalds panic("Unknown Amiga Model"); 338*1da177e4SLinus Torvalds } 339*1da177e4SLinus Torvalds 340*1da177e4SLinus Torvalds #define AMIGAHW_ANNOUNCE(name, str) \ 341*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(name)) \ 342*1da177e4SLinus Torvalds printk(str) 343*1da177e4SLinus Torvalds 344*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_VIDEO, "VIDEO "); 345*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_BLITTER, "BLITTER "); 346*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMBER_FF, "AMBER_FF "); 347*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_AUDIO, "AUDIO "); 348*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_FLOPPY, "FLOPPY "); 349*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A3000_SCSI, "A3000_SCSI "); 350*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A4000_SCSI, "A4000_SCSI "); 351*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A1200_IDE, "A1200_IDE "); 352*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A4000_IDE, "A4000_IDE "); 353*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(CD_ROM, "CD_ROM "); 354*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "KEYBOARD "); 355*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_MOUSE, "MOUSE "); 356*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_SERIAL, "SERIAL "); 357*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_PARALLEL, "PARALLEL "); 358*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A2000_CLK, "A2000_CLK "); 359*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A3000_CLK, "A3000_CLK "); 360*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(CHIP_RAM, "CHIP_RAM "); 361*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(PAULA, "PAULA "); 362*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(DENISE, "DENISE "); 363*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(DENISE_HR, "DENISE_HR "); 364*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(LISA, "LISA "); 365*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AGNUS_PAL, "AGNUS_PAL "); 366*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AGNUS_NTSC, "AGNUS_NTSC "); 367*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "AGNUS_HR_PAL "); 368*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "AGNUS_HR_NTSC "); 369*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(ALICE_PAL, "ALICE_PAL "); 370*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(ALICE_NTSC, "ALICE_NTSC "); 371*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(MAGIC_REKICK, "MAGIC_REKICK "); 372*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA "); 373*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(ZORRO)) 374*1da177e4SLinus Torvalds printk("ZORRO%s ", AMIGAHW_PRESENT(ZORRO3) ? "3" : ""); 375*1da177e4SLinus Torvalds printk("\n"); 376*1da177e4SLinus Torvalds 377*1da177e4SLinus Torvalds #undef AMIGAHW_ANNOUNCE 378*1da177e4SLinus Torvalds } 379*1da177e4SLinus Torvalds 380*1da177e4SLinus Torvalds /* 381*1da177e4SLinus Torvalds * Setup the Amiga configuration info 382*1da177e4SLinus Torvalds */ 383*1da177e4SLinus Torvalds 384*1da177e4SLinus Torvalds void __init config_amiga(void) 385*1da177e4SLinus Torvalds { 386*1da177e4SLinus Torvalds int i; 387*1da177e4SLinus Torvalds 388*1da177e4SLinus Torvalds amiga_debug_init(); 389*1da177e4SLinus Torvalds amiga_identify(); 390*1da177e4SLinus Torvalds 391*1da177e4SLinus Torvalds /* Yuk, we don't have PCI memory */ 392*1da177e4SLinus Torvalds iomem_resource.name = "Memory"; 393*1da177e4SLinus Torvalds for (i = 0; i < 4; i++) 394*1da177e4SLinus Torvalds request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]); 395*1da177e4SLinus Torvalds 396*1da177e4SLinus Torvalds mach_sched_init = amiga_sched_init; 397*1da177e4SLinus Torvalds mach_init_IRQ = amiga_init_IRQ; 398*1da177e4SLinus Torvalds mach_default_handler = &amiga_default_handler; 399*1da177e4SLinus Torvalds mach_request_irq = amiga_request_irq; 400*1da177e4SLinus Torvalds mach_free_irq = amiga_free_irq; 401*1da177e4SLinus Torvalds enable_irq = amiga_enable_irq; 402*1da177e4SLinus Torvalds disable_irq = amiga_disable_irq; 403*1da177e4SLinus Torvalds mach_get_model = amiga_get_model; 404*1da177e4SLinus Torvalds mach_get_hardware_list = amiga_get_hardware_list; 405*1da177e4SLinus Torvalds mach_get_irq_list = show_amiga_interrupts; 406*1da177e4SLinus Torvalds mach_gettimeoffset = amiga_gettimeoffset; 407*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(A3000_CLK)){ 408*1da177e4SLinus Torvalds mach_hwclk = a3000_hwclk; 409*1da177e4SLinus Torvalds rtc_resource.name = "A3000 RTC"; 410*1da177e4SLinus Torvalds request_resource(&iomem_resource, &rtc_resource); 411*1da177e4SLinus Torvalds } 412*1da177e4SLinus Torvalds else{ /* if (AMIGAHW_PRESENT(A2000_CLK)) */ 413*1da177e4SLinus Torvalds mach_hwclk = a2000_hwclk; 414*1da177e4SLinus Torvalds rtc_resource.name = "A2000 RTC"; 415*1da177e4SLinus Torvalds request_resource(&iomem_resource, &rtc_resource); 416*1da177e4SLinus Torvalds } 417*1da177e4SLinus Torvalds 418*1da177e4SLinus Torvalds mach_max_dma_address = 0xffffffff; /* 419*1da177e4SLinus Torvalds * default MAX_DMA=0xffffffff 420*1da177e4SLinus Torvalds * on all machines. If we don't 421*1da177e4SLinus Torvalds * do so, the SCSI code will not 422*1da177e4SLinus Torvalds * be able to allocate any mem 423*1da177e4SLinus Torvalds * for transfers, unless we are 424*1da177e4SLinus Torvalds * dealing with a Z2 mem only 425*1da177e4SLinus Torvalds * system. /Jes 426*1da177e4SLinus Torvalds */ 427*1da177e4SLinus Torvalds 428*1da177e4SLinus Torvalds mach_set_clock_mmss = amiga_set_clock_mmss; 429*1da177e4SLinus Torvalds mach_get_ss = amiga_get_ss; 430*1da177e4SLinus Torvalds #ifdef CONFIG_AMIGA_FLOPPY 431*1da177e4SLinus Torvalds mach_floppy_setup = amiga_floppy_setup; 432*1da177e4SLinus Torvalds #endif 433*1da177e4SLinus Torvalds mach_reset = amiga_reset; 434*1da177e4SLinus Torvalds #ifdef CONFIG_DUMMY_CONSOLE 435*1da177e4SLinus Torvalds conswitchp = &dummy_con; 436*1da177e4SLinus Torvalds #endif 437*1da177e4SLinus Torvalds #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) 438*1da177e4SLinus Torvalds mach_beep = amiga_mksound; 439*1da177e4SLinus Torvalds #endif 440*1da177e4SLinus Torvalds 441*1da177e4SLinus Torvalds #ifdef CONFIG_HEARTBEAT 442*1da177e4SLinus Torvalds mach_heartbeat = amiga_heartbeat; 443*1da177e4SLinus Torvalds #endif 444*1da177e4SLinus Torvalds 445*1da177e4SLinus Torvalds /* Fill in the clock values (based on the 700 kHz E-Clock) */ 446*1da177e4SLinus Torvalds amiga_masterclock = 40*amiga_eclock; /* 28 MHz */ 447*1da177e4SLinus Torvalds amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */ 448*1da177e4SLinus Torvalds 449*1da177e4SLinus Torvalds /* clear all DMA bits */ 450*1da177e4SLinus Torvalds custom.dmacon = DMAF_ALL; 451*1da177e4SLinus Torvalds /* ensure that the DMA master bit is set */ 452*1da177e4SLinus Torvalds custom.dmacon = DMAF_SETCLR | DMAF_MASTER; 453*1da177e4SLinus Torvalds 454*1da177e4SLinus Torvalds /* don't use Z2 RAM as system memory on Z3 capable machines */ 455*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(ZORRO3)) { 456*1da177e4SLinus Torvalds int i, j; 457*1da177e4SLinus Torvalds u32 disabled_z2mem = 0; 458*1da177e4SLinus Torvalds for (i = 0; i < m68k_num_memory; i++) 459*1da177e4SLinus Torvalds if (m68k_memory[i].addr < 16*1024*1024) { 460*1da177e4SLinus Torvalds if (i == 0) { 461*1da177e4SLinus Torvalds /* don't cut off the branch we're sitting on */ 462*1da177e4SLinus Torvalds printk("Warning: kernel runs in Zorro II memory\n"); 463*1da177e4SLinus Torvalds continue; 464*1da177e4SLinus Torvalds } 465*1da177e4SLinus Torvalds disabled_z2mem += m68k_memory[i].size; 466*1da177e4SLinus Torvalds m68k_num_memory--; 467*1da177e4SLinus Torvalds for (j = i; j < m68k_num_memory; j++) 468*1da177e4SLinus Torvalds m68k_memory[j] = m68k_memory[j+1]; 469*1da177e4SLinus Torvalds i--; 470*1da177e4SLinus Torvalds } 471*1da177e4SLinus Torvalds if (disabled_z2mem) 472*1da177e4SLinus Torvalds printk("%dK of Zorro II memory will not be used as system memory\n", 473*1da177e4SLinus Torvalds disabled_z2mem>>10); 474*1da177e4SLinus Torvalds } 475*1da177e4SLinus Torvalds 476*1da177e4SLinus Torvalds /* request all RAM */ 477*1da177e4SLinus Torvalds for (i = 0; i < m68k_num_memory; i++) { 478*1da177e4SLinus Torvalds ram_resource[i].name = 479*1da177e4SLinus Torvalds (m68k_memory[i].addr >= 0x01000000) ? "32-bit Fast RAM" : 480*1da177e4SLinus Torvalds (m68k_memory[i].addr < 0x00c00000) ? "16-bit Fast RAM" : 481*1da177e4SLinus Torvalds "16-bit Slow RAM"; 482*1da177e4SLinus Torvalds ram_resource[i].start = m68k_memory[i].addr; 483*1da177e4SLinus Torvalds ram_resource[i].end = m68k_memory[i].addr+m68k_memory[i].size-1; 484*1da177e4SLinus Torvalds request_resource(&iomem_resource, &ram_resource[i]); 485*1da177e4SLinus Torvalds } 486*1da177e4SLinus Torvalds 487*1da177e4SLinus Torvalds /* initialize chipram allocator */ 488*1da177e4SLinus Torvalds amiga_chip_init (); 489*1da177e4SLinus Torvalds 490*1da177e4SLinus Torvalds /* debugging using chipram */ 491*1da177e4SLinus Torvalds if (!strcmp( m68k_debug_device, "mem" )){ 492*1da177e4SLinus Torvalds if (!AMIGAHW_PRESENT(CHIP_RAM)) 493*1da177e4SLinus Torvalds printk("Warning: no chipram present for debugging\n"); 494*1da177e4SLinus Torvalds else { 495*1da177e4SLinus Torvalds amiga_savekmsg_init(); 496*1da177e4SLinus Torvalds amiga_console_driver.write = amiga_mem_console_write; 497*1da177e4SLinus Torvalds register_console(&amiga_console_driver); 498*1da177e4SLinus Torvalds } 499*1da177e4SLinus Torvalds } 500*1da177e4SLinus Torvalds 501*1da177e4SLinus Torvalds /* our beloved beeper */ 502*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(AMI_AUDIO)) 503*1da177e4SLinus Torvalds amiga_init_sound(); 504*1da177e4SLinus Torvalds 505*1da177e4SLinus Torvalds /* 506*1da177e4SLinus Torvalds * if it is an A3000, set the magic bit that forces 507*1da177e4SLinus Torvalds * a hard rekick 508*1da177e4SLinus Torvalds */ 509*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(MAGIC_REKICK)) 510*1da177e4SLinus Torvalds *(unsigned char *)ZTWO_VADDR(0xde0002) |= 0x80; 511*1da177e4SLinus Torvalds } 512*1da177e4SLinus Torvalds 513*1da177e4SLinus Torvalds static unsigned short jiffy_ticks; 514*1da177e4SLinus Torvalds 515*1da177e4SLinus Torvalds static void __init amiga_sched_init(irqreturn_t (*timer_routine)(int, void *, 516*1da177e4SLinus Torvalds struct pt_regs *)) 517*1da177e4SLinus Torvalds { 518*1da177e4SLinus Torvalds static struct resource sched_res = { 519*1da177e4SLinus Torvalds .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff, 520*1da177e4SLinus Torvalds }; 521*1da177e4SLinus Torvalds jiffy_ticks = (amiga_eclock+HZ/2)/HZ; 522*1da177e4SLinus Torvalds 523*1da177e4SLinus Torvalds if (request_resource(&mb_resources._ciab, &sched_res)) 524*1da177e4SLinus Torvalds printk("Cannot allocate ciab.ta{lo,hi}\n"); 525*1da177e4SLinus Torvalds ciab.cra &= 0xC0; /* turn off timer A, continuous mode, from Eclk */ 526*1da177e4SLinus Torvalds ciab.talo = jiffy_ticks % 256; 527*1da177e4SLinus Torvalds ciab.tahi = jiffy_ticks / 256; 528*1da177e4SLinus Torvalds 529*1da177e4SLinus Torvalds /* install interrupt service routine for CIAB Timer A 530*1da177e4SLinus Torvalds * 531*1da177e4SLinus Torvalds * Please don't change this to use ciaa, as it interferes with the 532*1da177e4SLinus Torvalds * SCSI code. We'll have to take a look at this later 533*1da177e4SLinus Torvalds */ 534*1da177e4SLinus Torvalds request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL); 535*1da177e4SLinus Torvalds /* start timer */ 536*1da177e4SLinus Torvalds ciab.cra |= 0x11; 537*1da177e4SLinus Torvalds } 538*1da177e4SLinus Torvalds 539*1da177e4SLinus Torvalds #define TICK_SIZE 10000 540*1da177e4SLinus Torvalds 541*1da177e4SLinus Torvalds /* This is always executed with interrupts disabled. */ 542*1da177e4SLinus Torvalds static unsigned long amiga_gettimeoffset (void) 543*1da177e4SLinus Torvalds { 544*1da177e4SLinus Torvalds unsigned short hi, lo, hi2; 545*1da177e4SLinus Torvalds unsigned long ticks, offset = 0; 546*1da177e4SLinus Torvalds 547*1da177e4SLinus Torvalds /* read CIA B timer A current value */ 548*1da177e4SLinus Torvalds hi = ciab.tahi; 549*1da177e4SLinus Torvalds lo = ciab.talo; 550*1da177e4SLinus Torvalds hi2 = ciab.tahi; 551*1da177e4SLinus Torvalds 552*1da177e4SLinus Torvalds if (hi != hi2) { 553*1da177e4SLinus Torvalds lo = ciab.talo; 554*1da177e4SLinus Torvalds hi = hi2; 555*1da177e4SLinus Torvalds } 556*1da177e4SLinus Torvalds 557*1da177e4SLinus Torvalds ticks = hi << 8 | lo; 558*1da177e4SLinus Torvalds 559*1da177e4SLinus Torvalds if (ticks > jiffy_ticks / 2) 560*1da177e4SLinus Torvalds /* check for pending interrupt */ 561*1da177e4SLinus Torvalds if (cia_set_irq(&ciab_base, 0) & CIA_ICR_TA) 562*1da177e4SLinus Torvalds offset = 10000; 563*1da177e4SLinus Torvalds 564*1da177e4SLinus Torvalds ticks = jiffy_ticks - ticks; 565*1da177e4SLinus Torvalds ticks = (10000 * ticks) / jiffy_ticks; 566*1da177e4SLinus Torvalds 567*1da177e4SLinus Torvalds return ticks + offset; 568*1da177e4SLinus Torvalds } 569*1da177e4SLinus Torvalds 570*1da177e4SLinus Torvalds static int a3000_hwclk(int op, struct rtc_time *t) 571*1da177e4SLinus Torvalds { 572*1da177e4SLinus Torvalds tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD; 573*1da177e4SLinus Torvalds 574*1da177e4SLinus Torvalds if (!op) { /* read */ 575*1da177e4SLinus Torvalds t->tm_sec = tod_3000.second1 * 10 + tod_3000.second2; 576*1da177e4SLinus Torvalds t->tm_min = tod_3000.minute1 * 10 + tod_3000.minute2; 577*1da177e4SLinus Torvalds t->tm_hour = tod_3000.hour1 * 10 + tod_3000.hour2; 578*1da177e4SLinus Torvalds t->tm_mday = tod_3000.day1 * 10 + tod_3000.day2; 579*1da177e4SLinus Torvalds t->tm_wday = tod_3000.weekday; 580*1da177e4SLinus Torvalds t->tm_mon = tod_3000.month1 * 10 + tod_3000.month2 - 1; 581*1da177e4SLinus Torvalds t->tm_year = tod_3000.year1 * 10 + tod_3000.year2; 582*1da177e4SLinus Torvalds if (t->tm_year <= 69) 583*1da177e4SLinus Torvalds t->tm_year += 100; 584*1da177e4SLinus Torvalds } else { 585*1da177e4SLinus Torvalds tod_3000.second1 = t->tm_sec / 10; 586*1da177e4SLinus Torvalds tod_3000.second2 = t->tm_sec % 10; 587*1da177e4SLinus Torvalds tod_3000.minute1 = t->tm_min / 10; 588*1da177e4SLinus Torvalds tod_3000.minute2 = t->tm_min % 10; 589*1da177e4SLinus Torvalds tod_3000.hour1 = t->tm_hour / 10; 590*1da177e4SLinus Torvalds tod_3000.hour2 = t->tm_hour % 10; 591*1da177e4SLinus Torvalds tod_3000.day1 = t->tm_mday / 10; 592*1da177e4SLinus Torvalds tod_3000.day2 = t->tm_mday % 10; 593*1da177e4SLinus Torvalds if (t->tm_wday != -1) 594*1da177e4SLinus Torvalds tod_3000.weekday = t->tm_wday; 595*1da177e4SLinus Torvalds tod_3000.month1 = (t->tm_mon + 1) / 10; 596*1da177e4SLinus Torvalds tod_3000.month2 = (t->tm_mon + 1) % 10; 597*1da177e4SLinus Torvalds if (t->tm_year >= 100) 598*1da177e4SLinus Torvalds t->tm_year -= 100; 599*1da177e4SLinus Torvalds tod_3000.year1 = t->tm_year / 10; 600*1da177e4SLinus Torvalds tod_3000.year2 = t->tm_year % 10; 601*1da177e4SLinus Torvalds } 602*1da177e4SLinus Torvalds 603*1da177e4SLinus Torvalds tod_3000.cntrl1 = TOD3000_CNTRL1_FREE; 604*1da177e4SLinus Torvalds 605*1da177e4SLinus Torvalds return 0; 606*1da177e4SLinus Torvalds } 607*1da177e4SLinus Torvalds 608*1da177e4SLinus Torvalds static int a2000_hwclk(int op, struct rtc_time *t) 609*1da177e4SLinus Torvalds { 610*1da177e4SLinus Torvalds int cnt = 5; 611*1da177e4SLinus Torvalds 612*1da177e4SLinus Torvalds tod_2000.cntrl1 = TOD2000_CNTRL1_HOLD; 613*1da177e4SLinus Torvalds 614*1da177e4SLinus Torvalds while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) 615*1da177e4SLinus Torvalds { 616*1da177e4SLinus Torvalds tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD; 617*1da177e4SLinus Torvalds udelay(70); 618*1da177e4SLinus Torvalds tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD; 619*1da177e4SLinus Torvalds } 620*1da177e4SLinus Torvalds 621*1da177e4SLinus Torvalds if (!cnt) 622*1da177e4SLinus Torvalds printk(KERN_INFO "hwclk: timed out waiting for RTC (0x%x)\n", tod_2000.cntrl1); 623*1da177e4SLinus Torvalds 624*1da177e4SLinus Torvalds if (!op) { /* read */ 625*1da177e4SLinus Torvalds t->tm_sec = tod_2000.second1 * 10 + tod_2000.second2; 626*1da177e4SLinus Torvalds t->tm_min = tod_2000.minute1 * 10 + tod_2000.minute2; 627*1da177e4SLinus Torvalds t->tm_hour = (tod_2000.hour1 & 3) * 10 + tod_2000.hour2; 628*1da177e4SLinus Torvalds t->tm_mday = tod_2000.day1 * 10 + tod_2000.day2; 629*1da177e4SLinus Torvalds t->tm_wday = tod_2000.weekday; 630*1da177e4SLinus Torvalds t->tm_mon = tod_2000.month1 * 10 + tod_2000.month2 - 1; 631*1da177e4SLinus Torvalds t->tm_year = tod_2000.year1 * 10 + tod_2000.year2; 632*1da177e4SLinus Torvalds if (t->tm_year <= 69) 633*1da177e4SLinus Torvalds t->tm_year += 100; 634*1da177e4SLinus Torvalds 635*1da177e4SLinus Torvalds if (!(tod_2000.cntrl3 & TOD2000_CNTRL3_24HMODE)){ 636*1da177e4SLinus Torvalds if (!(tod_2000.hour1 & TOD2000_HOUR1_PM) && t->tm_hour == 12) 637*1da177e4SLinus Torvalds t->tm_hour = 0; 638*1da177e4SLinus Torvalds else if ((tod_2000.hour1 & TOD2000_HOUR1_PM) && t->tm_hour != 12) 639*1da177e4SLinus Torvalds t->tm_hour += 12; 640*1da177e4SLinus Torvalds } 641*1da177e4SLinus Torvalds } else { 642*1da177e4SLinus Torvalds tod_2000.second1 = t->tm_sec / 10; 643*1da177e4SLinus Torvalds tod_2000.second2 = t->tm_sec % 10; 644*1da177e4SLinus Torvalds tod_2000.minute1 = t->tm_min / 10; 645*1da177e4SLinus Torvalds tod_2000.minute2 = t->tm_min % 10; 646*1da177e4SLinus Torvalds if (tod_2000.cntrl3 & TOD2000_CNTRL3_24HMODE) 647*1da177e4SLinus Torvalds tod_2000.hour1 = t->tm_hour / 10; 648*1da177e4SLinus Torvalds else if (t->tm_hour >= 12) 649*1da177e4SLinus Torvalds tod_2000.hour1 = TOD2000_HOUR1_PM + 650*1da177e4SLinus Torvalds (t->tm_hour - 12) / 10; 651*1da177e4SLinus Torvalds else 652*1da177e4SLinus Torvalds tod_2000.hour1 = t->tm_hour / 10; 653*1da177e4SLinus Torvalds tod_2000.hour2 = t->tm_hour % 10; 654*1da177e4SLinus Torvalds tod_2000.day1 = t->tm_mday / 10; 655*1da177e4SLinus Torvalds tod_2000.day2 = t->tm_mday % 10; 656*1da177e4SLinus Torvalds if (t->tm_wday != -1) 657*1da177e4SLinus Torvalds tod_2000.weekday = t->tm_wday; 658*1da177e4SLinus Torvalds tod_2000.month1 = (t->tm_mon + 1) / 10; 659*1da177e4SLinus Torvalds tod_2000.month2 = (t->tm_mon + 1) % 10; 660*1da177e4SLinus Torvalds if (t->tm_year >= 100) 661*1da177e4SLinus Torvalds t->tm_year -= 100; 662*1da177e4SLinus Torvalds tod_2000.year1 = t->tm_year / 10; 663*1da177e4SLinus Torvalds tod_2000.year2 = t->tm_year % 10; 664*1da177e4SLinus Torvalds } 665*1da177e4SLinus Torvalds 666*1da177e4SLinus Torvalds tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD; 667*1da177e4SLinus Torvalds 668*1da177e4SLinus Torvalds return 0; 669*1da177e4SLinus Torvalds } 670*1da177e4SLinus Torvalds 671*1da177e4SLinus Torvalds static int amiga_set_clock_mmss (unsigned long nowtime) 672*1da177e4SLinus Torvalds { 673*1da177e4SLinus Torvalds short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60; 674*1da177e4SLinus Torvalds 675*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(A3000_CLK)) { 676*1da177e4SLinus Torvalds tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD; 677*1da177e4SLinus Torvalds 678*1da177e4SLinus Torvalds tod_3000.second1 = real_seconds / 10; 679*1da177e4SLinus Torvalds tod_3000.second2 = real_seconds % 10; 680*1da177e4SLinus Torvalds tod_3000.minute1 = real_minutes / 10; 681*1da177e4SLinus Torvalds tod_3000.minute2 = real_minutes % 10; 682*1da177e4SLinus Torvalds 683*1da177e4SLinus Torvalds tod_3000.cntrl1 = TOD3000_CNTRL1_FREE; 684*1da177e4SLinus Torvalds } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ { 685*1da177e4SLinus Torvalds int cnt = 5; 686*1da177e4SLinus Torvalds 687*1da177e4SLinus Torvalds tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD; 688*1da177e4SLinus Torvalds 689*1da177e4SLinus Torvalds while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) 690*1da177e4SLinus Torvalds { 691*1da177e4SLinus Torvalds tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD; 692*1da177e4SLinus Torvalds udelay(70); 693*1da177e4SLinus Torvalds tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD; 694*1da177e4SLinus Torvalds } 695*1da177e4SLinus Torvalds 696*1da177e4SLinus Torvalds if (!cnt) 697*1da177e4SLinus Torvalds printk(KERN_INFO "set_clock_mmss: timed out waiting for RTC (0x%x)\n", tod_2000.cntrl1); 698*1da177e4SLinus Torvalds 699*1da177e4SLinus Torvalds tod_2000.second1 = real_seconds / 10; 700*1da177e4SLinus Torvalds tod_2000.second2 = real_seconds % 10; 701*1da177e4SLinus Torvalds tod_2000.minute1 = real_minutes / 10; 702*1da177e4SLinus Torvalds tod_2000.minute2 = real_minutes % 10; 703*1da177e4SLinus Torvalds 704*1da177e4SLinus Torvalds tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD; 705*1da177e4SLinus Torvalds } 706*1da177e4SLinus Torvalds 707*1da177e4SLinus Torvalds return 0; 708*1da177e4SLinus Torvalds } 709*1da177e4SLinus Torvalds 710*1da177e4SLinus Torvalds static unsigned int amiga_get_ss( void ) 711*1da177e4SLinus Torvalds { 712*1da177e4SLinus Torvalds unsigned int s; 713*1da177e4SLinus Torvalds 714*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(A3000_CLK)) { 715*1da177e4SLinus Torvalds tod_3000.cntrl1 = TOD3000_CNTRL1_HOLD; 716*1da177e4SLinus Torvalds s = tod_3000.second1 * 10 + tod_3000.second2; 717*1da177e4SLinus Torvalds tod_3000.cntrl1 = TOD3000_CNTRL1_FREE; 718*1da177e4SLinus Torvalds } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ { 719*1da177e4SLinus Torvalds s = tod_2000.second1 * 10 + tod_2000.second2; 720*1da177e4SLinus Torvalds } 721*1da177e4SLinus Torvalds return s; 722*1da177e4SLinus Torvalds } 723*1da177e4SLinus Torvalds 724*1da177e4SLinus Torvalds static NORET_TYPE void amiga_reset( void ) 725*1da177e4SLinus Torvalds ATTRIB_NORET; 726*1da177e4SLinus Torvalds 727*1da177e4SLinus Torvalds static void amiga_reset (void) 728*1da177e4SLinus Torvalds { 729*1da177e4SLinus Torvalds unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040); 730*1da177e4SLinus Torvalds unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label); 731*1da177e4SLinus Torvalds 732*1da177e4SLinus Torvalds local_irq_disable(); 733*1da177e4SLinus Torvalds if (CPU_IS_040_OR_060) 734*1da177e4SLinus Torvalds /* Setup transparent translation registers for mapping 735*1da177e4SLinus Torvalds * of 16 MB kernel segment before disabling translation 736*1da177e4SLinus Torvalds */ 737*1da177e4SLinus Torvalds __asm__ __volatile__ 738*1da177e4SLinus Torvalds ("movel %0,%/d0\n\t" 739*1da177e4SLinus Torvalds "andl #0xff000000,%/d0\n\t" 740*1da177e4SLinus Torvalds "orw #0xe020,%/d0\n\t" /* map 16 MB, enable, cacheable */ 741*1da177e4SLinus Torvalds ".chip 68040\n\t" 742*1da177e4SLinus Torvalds "movec %%d0,%%itt0\n\t" 743*1da177e4SLinus Torvalds "movec %%d0,%%dtt0\n\t" 744*1da177e4SLinus Torvalds ".chip 68k\n\t" 745*1da177e4SLinus Torvalds "jmp %0@\n\t" 746*1da177e4SLinus Torvalds : /* no outputs */ 747*1da177e4SLinus Torvalds : "a" (jmp_addr040)); 748*1da177e4SLinus Torvalds else 749*1da177e4SLinus Torvalds /* for 680[23]0, just disable translation and jump to the physical 750*1da177e4SLinus Torvalds * address of the label 751*1da177e4SLinus Torvalds */ 752*1da177e4SLinus Torvalds __asm__ __volatile__ 753*1da177e4SLinus Torvalds ("pmove %/tc,%@\n\t" 754*1da177e4SLinus Torvalds "bclr #7,%@\n\t" 755*1da177e4SLinus Torvalds "pmove %@,%/tc\n\t" 756*1da177e4SLinus Torvalds "jmp %0@\n\t" 757*1da177e4SLinus Torvalds : /* no outputs */ 758*1da177e4SLinus Torvalds : "a" (jmp_addr)); 759*1da177e4SLinus Torvalds jmp_addr_label040: 760*1da177e4SLinus Torvalds /* disable translation on '040 now */ 761*1da177e4SLinus Torvalds __asm__ __volatile__ 762*1da177e4SLinus Torvalds ("moveq #0,%/d0\n\t" 763*1da177e4SLinus Torvalds ".chip 68040\n\t" 764*1da177e4SLinus Torvalds "movec %%d0,%%tc\n\t" /* disable MMU */ 765*1da177e4SLinus Torvalds ".chip 68k\n\t" 766*1da177e4SLinus Torvalds : /* no outputs */ 767*1da177e4SLinus Torvalds : /* no inputs */ 768*1da177e4SLinus Torvalds : "d0"); 769*1da177e4SLinus Torvalds 770*1da177e4SLinus Torvalds jmp_addr_label: 771*1da177e4SLinus Torvalds /* pickup reset address from AmigaOS ROM, reset devices and jump 772*1da177e4SLinus Torvalds * to reset address 773*1da177e4SLinus Torvalds */ 774*1da177e4SLinus Torvalds __asm__ __volatile__ 775*1da177e4SLinus Torvalds ("movew #0x2700,%/sr\n\t" 776*1da177e4SLinus Torvalds "leal 0x01000000,%/a0\n\t" 777*1da177e4SLinus Torvalds "subl %/a0@(-0x14),%/a0\n\t" 778*1da177e4SLinus Torvalds "movel %/a0@(4),%/a0\n\t" 779*1da177e4SLinus Torvalds "subql #2,%/a0\n\t" 780*1da177e4SLinus Torvalds "bra 1f\n\t" 781*1da177e4SLinus Torvalds /* align on a longword boundary */ 782*1da177e4SLinus Torvalds __ALIGN_STR "\n" 783*1da177e4SLinus Torvalds "1:\n\t" 784*1da177e4SLinus Torvalds "reset\n\t" 785*1da177e4SLinus Torvalds "jmp %/a0@" : /* Just that gcc scans it for % escapes */ ); 786*1da177e4SLinus Torvalds 787*1da177e4SLinus Torvalds for (;;); 788*1da177e4SLinus Torvalds 789*1da177e4SLinus Torvalds } 790*1da177e4SLinus Torvalds 791*1da177e4SLinus Torvalds 792*1da177e4SLinus Torvalds /* 793*1da177e4SLinus Torvalds * Debugging 794*1da177e4SLinus Torvalds */ 795*1da177e4SLinus Torvalds 796*1da177e4SLinus Torvalds #define SAVEKMSG_MAXMEM 128*1024 797*1da177e4SLinus Torvalds 798*1da177e4SLinus Torvalds #define SAVEKMSG_MAGIC1 0x53415645 /* 'SAVE' */ 799*1da177e4SLinus Torvalds #define SAVEKMSG_MAGIC2 0x4B4D5347 /* 'KMSG' */ 800*1da177e4SLinus Torvalds 801*1da177e4SLinus Torvalds struct savekmsg { 802*1da177e4SLinus Torvalds unsigned long magic1; /* SAVEKMSG_MAGIC1 */ 803*1da177e4SLinus Torvalds unsigned long magic2; /* SAVEKMSG_MAGIC2 */ 804*1da177e4SLinus Torvalds unsigned long magicptr; /* address of magic1 */ 805*1da177e4SLinus Torvalds unsigned long size; 806*1da177e4SLinus Torvalds char data[0]; 807*1da177e4SLinus Torvalds }; 808*1da177e4SLinus Torvalds 809*1da177e4SLinus Torvalds static struct savekmsg *savekmsg; 810*1da177e4SLinus Torvalds 811*1da177e4SLinus Torvalds static void amiga_mem_console_write(struct console *co, const char *s, 812*1da177e4SLinus Torvalds unsigned int count) 813*1da177e4SLinus Torvalds { 814*1da177e4SLinus Torvalds if (savekmsg->size+count <= SAVEKMSG_MAXMEM-sizeof(struct savekmsg)) { 815*1da177e4SLinus Torvalds memcpy(savekmsg->data+savekmsg->size, s, count); 816*1da177e4SLinus Torvalds savekmsg->size += count; 817*1da177e4SLinus Torvalds } 818*1da177e4SLinus Torvalds } 819*1da177e4SLinus Torvalds 820*1da177e4SLinus Torvalds static void amiga_savekmsg_init(void) 821*1da177e4SLinus Torvalds { 822*1da177e4SLinus Torvalds static struct resource debug_res = { .name = "Debug" }; 823*1da177e4SLinus Torvalds 824*1da177e4SLinus Torvalds savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res); 825*1da177e4SLinus Torvalds savekmsg->magic1 = SAVEKMSG_MAGIC1; 826*1da177e4SLinus Torvalds savekmsg->magic2 = SAVEKMSG_MAGIC2; 827*1da177e4SLinus Torvalds savekmsg->magicptr = ZTWO_PADDR(savekmsg); 828*1da177e4SLinus Torvalds savekmsg->size = 0; 829*1da177e4SLinus Torvalds } 830*1da177e4SLinus Torvalds 831*1da177e4SLinus Torvalds static void amiga_serial_putc(char c) 832*1da177e4SLinus Torvalds { 833*1da177e4SLinus Torvalds custom.serdat = (unsigned char)c | 0x100; 834*1da177e4SLinus Torvalds while (!(custom.serdatr & 0x2000)) 835*1da177e4SLinus Torvalds ; 836*1da177e4SLinus Torvalds } 837*1da177e4SLinus Torvalds 838*1da177e4SLinus Torvalds void amiga_serial_console_write(struct console *co, const char *s, 839*1da177e4SLinus Torvalds unsigned int count) 840*1da177e4SLinus Torvalds { 841*1da177e4SLinus Torvalds while (count--) { 842*1da177e4SLinus Torvalds if (*s == '\n') 843*1da177e4SLinus Torvalds amiga_serial_putc('\r'); 844*1da177e4SLinus Torvalds amiga_serial_putc(*s++); 845*1da177e4SLinus Torvalds } 846*1da177e4SLinus Torvalds } 847*1da177e4SLinus Torvalds 848*1da177e4SLinus Torvalds #ifdef CONFIG_SERIAL_CONSOLE 849*1da177e4SLinus Torvalds void amiga_serial_puts(const char *s) 850*1da177e4SLinus Torvalds { 851*1da177e4SLinus Torvalds amiga_serial_console_write(NULL, s, strlen(s)); 852*1da177e4SLinus Torvalds } 853*1da177e4SLinus Torvalds 854*1da177e4SLinus Torvalds int amiga_serial_console_wait_key(struct console *co) 855*1da177e4SLinus Torvalds { 856*1da177e4SLinus Torvalds int ch; 857*1da177e4SLinus Torvalds 858*1da177e4SLinus Torvalds while (!(custom.intreqr & IF_RBF)) 859*1da177e4SLinus Torvalds barrier(); 860*1da177e4SLinus Torvalds ch = custom.serdatr & 0xff; 861*1da177e4SLinus Torvalds /* clear the interrupt, so that another character can be read */ 862*1da177e4SLinus Torvalds custom.intreq = IF_RBF; 863*1da177e4SLinus Torvalds return ch; 864*1da177e4SLinus Torvalds } 865*1da177e4SLinus Torvalds 866*1da177e4SLinus Torvalds void amiga_serial_gets(struct console *co, char *s, int len) 867*1da177e4SLinus Torvalds { 868*1da177e4SLinus Torvalds int ch, cnt = 0; 869*1da177e4SLinus Torvalds 870*1da177e4SLinus Torvalds while (1) { 871*1da177e4SLinus Torvalds ch = amiga_serial_console_wait_key(co); 872*1da177e4SLinus Torvalds 873*1da177e4SLinus Torvalds /* Check for backspace. */ 874*1da177e4SLinus Torvalds if (ch == 8 || ch == 127) { 875*1da177e4SLinus Torvalds if (cnt == 0) { 876*1da177e4SLinus Torvalds amiga_serial_putc('\007'); 877*1da177e4SLinus Torvalds continue; 878*1da177e4SLinus Torvalds } 879*1da177e4SLinus Torvalds cnt--; 880*1da177e4SLinus Torvalds amiga_serial_puts("\010 \010"); 881*1da177e4SLinus Torvalds continue; 882*1da177e4SLinus Torvalds } 883*1da177e4SLinus Torvalds 884*1da177e4SLinus Torvalds /* Check for enter. */ 885*1da177e4SLinus Torvalds if (ch == 10 || ch == 13) 886*1da177e4SLinus Torvalds break; 887*1da177e4SLinus Torvalds 888*1da177e4SLinus Torvalds /* See if line is too long. */ 889*1da177e4SLinus Torvalds if (cnt >= len + 1) { 890*1da177e4SLinus Torvalds amiga_serial_putc(7); 891*1da177e4SLinus Torvalds cnt--; 892*1da177e4SLinus Torvalds continue; 893*1da177e4SLinus Torvalds } 894*1da177e4SLinus Torvalds 895*1da177e4SLinus Torvalds /* Store and echo character. */ 896*1da177e4SLinus Torvalds s[cnt++] = ch; 897*1da177e4SLinus Torvalds amiga_serial_putc(ch); 898*1da177e4SLinus Torvalds } 899*1da177e4SLinus Torvalds /* Print enter. */ 900*1da177e4SLinus Torvalds amiga_serial_puts("\r\n"); 901*1da177e4SLinus Torvalds s[cnt] = 0; 902*1da177e4SLinus Torvalds } 903*1da177e4SLinus Torvalds #endif 904*1da177e4SLinus Torvalds 905*1da177e4SLinus Torvalds static void __init amiga_debug_init(void) 906*1da177e4SLinus Torvalds { 907*1da177e4SLinus Torvalds if (!strcmp( m68k_debug_device, "ser" )) { 908*1da177e4SLinus Torvalds /* no initialization required (?) */ 909*1da177e4SLinus Torvalds amiga_console_driver.write = amiga_serial_console_write; 910*1da177e4SLinus Torvalds register_console(&amiga_console_driver); 911*1da177e4SLinus Torvalds } 912*1da177e4SLinus Torvalds } 913*1da177e4SLinus Torvalds 914*1da177e4SLinus Torvalds #ifdef CONFIG_HEARTBEAT 915*1da177e4SLinus Torvalds static void amiga_heartbeat(int on) 916*1da177e4SLinus Torvalds { 917*1da177e4SLinus Torvalds if (on) 918*1da177e4SLinus Torvalds ciaa.pra &= ~2; 919*1da177e4SLinus Torvalds else 920*1da177e4SLinus Torvalds ciaa.pra |= 2; 921*1da177e4SLinus Torvalds } 922*1da177e4SLinus Torvalds #endif 923*1da177e4SLinus Torvalds 924*1da177e4SLinus Torvalds /* 925*1da177e4SLinus Torvalds * Amiga specific parts of /proc 926*1da177e4SLinus Torvalds */ 927*1da177e4SLinus Torvalds 928*1da177e4SLinus Torvalds static void amiga_get_model(char *model) 929*1da177e4SLinus Torvalds { 930*1da177e4SLinus Torvalds strcpy(model, amiga_model_name); 931*1da177e4SLinus Torvalds } 932*1da177e4SLinus Torvalds 933*1da177e4SLinus Torvalds 934*1da177e4SLinus Torvalds static int amiga_get_hardware_list(char *buffer) 935*1da177e4SLinus Torvalds { 936*1da177e4SLinus Torvalds int len = 0; 937*1da177e4SLinus Torvalds 938*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(CHIP_RAM)) 939*1da177e4SLinus Torvalds len += sprintf(buffer+len, "Chip RAM:\t%ldK\n", amiga_chip_size>>10); 940*1da177e4SLinus Torvalds len += sprintf(buffer+len, "PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n", 941*1da177e4SLinus Torvalds amiga_psfreq, amiga_eclock); 942*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(AMI_VIDEO)) { 943*1da177e4SLinus Torvalds char *type; 944*1da177e4SLinus Torvalds switch(amiga_chipset) { 945*1da177e4SLinus Torvalds case CS_OCS: 946*1da177e4SLinus Torvalds type = "OCS"; 947*1da177e4SLinus Torvalds break; 948*1da177e4SLinus Torvalds case CS_ECS: 949*1da177e4SLinus Torvalds type = "ECS"; 950*1da177e4SLinus Torvalds break; 951*1da177e4SLinus Torvalds case CS_AGA: 952*1da177e4SLinus Torvalds type = "AGA"; 953*1da177e4SLinus Torvalds break; 954*1da177e4SLinus Torvalds default: 955*1da177e4SLinus Torvalds type = "Old or Unknown"; 956*1da177e4SLinus Torvalds break; 957*1da177e4SLinus Torvalds } 958*1da177e4SLinus Torvalds len += sprintf(buffer+len, "Graphics:\t%s\n", type); 959*1da177e4SLinus Torvalds } 960*1da177e4SLinus Torvalds 961*1da177e4SLinus Torvalds #define AMIGAHW_ANNOUNCE(name, str) \ 962*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(name)) \ 963*1da177e4SLinus Torvalds len += sprintf (buffer+len, "\t%s\n", str) 964*1da177e4SLinus Torvalds 965*1da177e4SLinus Torvalds len += sprintf (buffer + len, "Detected hardware:\n"); 966*1da177e4SLinus Torvalds 967*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_VIDEO, "Amiga Video"); 968*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_BLITTER, "Blitter"); 969*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMBER_FF, "Amber Flicker Fixer"); 970*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_AUDIO, "Amiga Audio"); 971*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_FLOPPY, "Floppy Controller"); 972*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A3000_SCSI, "SCSI Controller WD33C93 (A3000 style)"); 973*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A4000_SCSI, "SCSI Controller NCR53C710 (A4000T style)"); 974*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A1200_IDE, "IDE Interface (A1200 style)"); 975*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A4000_IDE, "IDE Interface (A4000 style)"); 976*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(CD_ROM, "Internal CD ROM drive"); 977*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "Keyboard"); 978*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_MOUSE, "Mouse Port"); 979*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_SERIAL, "Serial Port"); 980*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AMI_PARALLEL, "Parallel Port"); 981*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A2000_CLK, "Hardware Clock (A2000 style)"); 982*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(A3000_CLK, "Hardware Clock (A3000 style)"); 983*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(CHIP_RAM, "Chip RAM"); 984*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(PAULA, "Paula 8364"); 985*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(DENISE, "Denise 8362"); 986*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(DENISE_HR, "Denise 8373"); 987*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(LISA, "Lisa 8375"); 988*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AGNUS_PAL, "Normal/Fat PAL Agnus 8367/8371"); 989*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AGNUS_NTSC, "Normal/Fat NTSC Agnus 8361/8370"); 990*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "Fat Hires PAL Agnus 8372"); 991*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "Fat Hires NTSC Agnus 8372"); 992*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(ALICE_PAL, "PAL Alice 8374"); 993*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(ALICE_NTSC, "NTSC Alice 8374"); 994*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(MAGIC_REKICK, "Magic Hard Rekick"); 995*1da177e4SLinus Torvalds AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA Slot"); 996*1da177e4SLinus Torvalds #ifdef CONFIG_ZORRO 997*1da177e4SLinus Torvalds if (AMIGAHW_PRESENT(ZORRO)) 998*1da177e4SLinus Torvalds len += sprintf(buffer+len, "\tZorro II%s AutoConfig: %d Expansion " 999*1da177e4SLinus Torvalds "Device%s\n", 1000*1da177e4SLinus Torvalds AMIGAHW_PRESENT(ZORRO3) ? "I" : "", 1001*1da177e4SLinus Torvalds zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s"); 1002*1da177e4SLinus Torvalds #endif /* CONFIG_ZORRO */ 1003*1da177e4SLinus Torvalds 1004*1da177e4SLinus Torvalds #undef AMIGAHW_ANNOUNCE 1005*1da177e4SLinus Torvalds 1006*1da177e4SLinus Torvalds return(len); 1007*1da177e4SLinus Torvalds } 1008