2 * linux/arch/m68k/atari/config.c
4 * Copyright (C) 1994 Bjoern Brauel
7 * Added setting of time_adj to get a better clock.
12 * 5/15/94 Roman Hodek:
13 * hard_reset_now() for Atari (and others?)
15 * 94/12/30 Andreas Schwab:
16 * atari_sched_init fixed to get precise clock.
18 * This file is subject to the terms and conditions of the GNU General Public
19 * License. See the file COPYING in the main directory of this archive
24 * Miscellaneous atari stuff
27 #include <linux/types.h>
29 #include <linux/seq_file.h>
30 #include <linux/console.h>
31 #include <linux/init.h>
32 #include <linux/delay.h>
33 #include <linux/ioport.h>
34 #include <linux/platform_device.h>
35 #include <linux/usb/isp116x.h>
36 #include <linux/vt_kern.h>
37 #include <linux/module.h>
39 #include <asm/bootinfo.h>
40 #include <asm/bootinfo-atari.h>
41 #include <asm/byteorder.h>
42 #include <asm/setup.h>
43 #include <asm/atarihw.h>
44 #include <asm/atariints.h>
45 #include <asm/atari_stram.h>
46 #include <asm/machdep.h>
47 #include <asm/hwtest.h>
49 #include <asm/config.h>
53 u_long atari_mch_cookie;
54 EXPORT_SYMBOL(atari_mch_cookie);
56 u_long atari_mch_type;
57 EXPORT_SYMBOL(atari_mch_type);
59 struct atari_hw_present atari_hw_present;
60 EXPORT_SYMBOL(atari_hw_present);
62 u_long atari_switches;
63 EXPORT_SYMBOL(atari_switches);
65 int atari_dont_touch_floppy_select;
66 EXPORT_SYMBOL(atari_dont_touch_floppy_select);
68 int atari_rtc_year_offset;
70 /* local function prototypes */
71 static void atari_reset(void);
72 static void atari_get_model(char *model);
73 static void atari_get_hardware_list(struct seq_file *m);
74 #ifdef CONFIG_HEARTBEAT
75 static void atari_heartbeat(int on);
78 /* ++roman: This is a more elaborate test for an SCC chip, since the plain
79 * Medusa board generates DTACK at the SCC's standard addresses, but a SCC
80 * board in the Medusa is possible. Also, the addresses where the ST_ESCC
81 * resides generate DTACK without the chip, too.
82 * The method is to write values into the interrupt vector register, that
83 * should be readable without trouble (from channel A!).
86 static int __init scc_test(volatile char *ctla)
88 if (!hwreg_present(ctla))
118 * Parse an Atari-specific record in the bootinfo
121 int __init atari_parse_bootinfo(const struct bi_record *record)
124 const void *data = record->data;
126 switch (be16_to_cpu(record->tag)) {
127 case BI_ATARI_MCH_COOKIE:
128 atari_mch_cookie = be32_to_cpup(data);
130 case BI_ATARI_MCH_TYPE:
131 atari_mch_type = be32_to_cpup(data);
141 /* Parse the Atari-specific switches= option. */
142 static int __init atari_switches_setup(char *str)
144 char switches[COMMAND_LINE_SIZE];
147 char *args = switches;
152 /* copy string to local array, strsep works destructively... */
153 strcpy(switches, str);
156 /* parse the options */
157 while ((p = strsep(&args, ",")) != NULL) {
161 if (strncmp(p, "ov_", 3) == 0) {
163 ovsc_shift = ATARI_SWITCH_OVSC_SHIFT;
166 if (strcmp(p, "ikbd") == 0) {
167 /* RTS line of IKBD ACIA */
168 atari_switches |= ATARI_SWITCH_IKBD << ovsc_shift;
169 } else if (strcmp(p, "midi") == 0) {
170 /* RTS line of MIDI ACIA */
171 atari_switches |= ATARI_SWITCH_MIDI << ovsc_shift;
172 } else if (strcmp(p, "snd6") == 0) {
173 atari_switches |= ATARI_SWITCH_SND6 << ovsc_shift;
174 } else if (strcmp(p, "snd7") == 0) {
175 atari_switches |= ATARI_SWITCH_SND7 << ovsc_shift;
181 early_param("switches", atari_switches_setup);
185 * Setup the Atari configuration info
188 void __init config_atari(void)
190 unsigned short tos_version;
192 memset(&atari_hw_present, 0, sizeof(atari_hw_present));
194 /* Change size of I/O space from 64KB to 4GB. */
195 ioport_resource.end = 0xFFFFFFFF;
197 mach_sched_init = atari_sched_init;
198 mach_init_IRQ = atari_init_IRQ;
199 mach_get_model = atari_get_model;
200 mach_get_hardware_list = atari_get_hardware_list;
201 mach_reset = atari_reset;
202 #if IS_ENABLED(CONFIG_INPUT_M68K_BEEP)
203 mach_beep = atari_mksound;
205 #ifdef CONFIG_HEARTBEAT
206 mach_heartbeat = atari_heartbeat;
209 /* Set switches as requested by the user */
210 if (atari_switches & ATARI_SWITCH_IKBD)
211 acia.key_ctrl = ACIA_DIV64 | ACIA_D8N1S | ACIA_RHTID;
212 if (atari_switches & ATARI_SWITCH_MIDI)
213 acia.mid_ctrl = ACIA_DIV16 | ACIA_D8N1S | ACIA_RHTID;
214 if (atari_switches & (ATARI_SWITCH_SND6|ATARI_SWITCH_SND7)) {
215 sound_ym.rd_data_reg_sel = 14;
216 sound_ym.wd_data = sound_ym.rd_data_reg_sel |
217 ((atari_switches&ATARI_SWITCH_SND6) ? 0x40 : 0) |
218 ((atari_switches&ATARI_SWITCH_SND7) ? 0x80 : 0);
222 * Determine hardware present
225 pr_info("Atari hardware found:");
226 if (MACH_IS_MEDUSA) {
227 /* There's no Atari video hardware on the Medusa, but all the
228 * addresses below generate a DTACK so no bus error occurs! */
229 } else if (hwreg_present(f030_xreg)) {
230 ATARIHW_SET(VIDEL_SHIFTER);
232 /* This is a temporary hack: If there is Falcon video
233 * hardware, we assume that the ST-DMA serves SCSI instead of
234 * ACSI. In the future, there should be a better method for
237 ATARIHW_SET(ST_SCSI);
238 pr_cont(" STDMA-SCSI");
239 } else if (hwreg_present(tt_palette)) {
240 ATARIHW_SET(TT_SHIFTER);
241 pr_cont(" TT_SHIFTER");
242 } else if (hwreg_present(&shifter_st.bas_hi)) {
243 if (hwreg_present(&shifter_st.bas_lo) &&
244 (shifter_st.bas_lo = 0x0aau, shifter_st.bas_lo == 0x0aau)) {
245 ATARIHW_SET(EXTD_SHIFTER);
246 pr_cont(" EXTD_SHIFTER");
248 ATARIHW_SET(STND_SHIFTER);
249 pr_cont(" STND_SHIFTER");
252 if (hwreg_present(&st_mfp.par_dt_reg)) {
256 if (hwreg_present(&tt_mfp.par_dt_reg)) {
260 if (hwreg_present(&tt_scsi_dma.dma_addr_hi)) {
261 ATARIHW_SET(SCSI_DMA);
262 pr_cont(" TT_SCSI_DMA");
265 * The ST-DMA address registers aren't readable
266 * on all Medusas, so the test below may fail
268 if (MACH_IS_MEDUSA ||
269 (hwreg_present(&st_dma.dma_vhi) &&
270 (st_dma.dma_vhi = 0x55) && (st_dma.dma_hi = 0xaa) &&
271 st_dma.dma_vhi == 0x55 && st_dma.dma_hi == 0xaa &&
272 (st_dma.dma_vhi = 0xaa) && (st_dma.dma_hi = 0x55) &&
273 st_dma.dma_vhi == 0xaa && st_dma.dma_hi == 0x55)) {
274 ATARIHW_SET(EXTD_DMA);
275 pr_cont(" EXTD_DMA");
277 if (hwreg_present(&tt_scsi.scsi_data)) {
278 ATARIHW_SET(TT_SCSI);
281 if (hwreg_present(&sound_ym.rd_data_reg_sel)) {
282 ATARIHW_SET(YM_2149);
285 if (!MACH_IS_MEDUSA && hwreg_present(&tt_dmasnd.ctrl)) {
286 ATARIHW_SET(PCM_8BIT);
289 if (hwreg_present(&falcon_codec.unused5)) {
293 if (hwreg_present(&dsp56k_host_interface.icr)) {
297 if (hwreg_present(&tt_scc_dma.dma_ctrl) &&
299 /* This test sucks! Who knows some better? */
300 (tt_scc_dma.dma_ctrl = 0x01, (tt_scc_dma.dma_ctrl & 1) == 1) &&
301 (tt_scc_dma.dma_ctrl = 0x00, (tt_scc_dma.dma_ctrl & 1) == 0)
306 ATARIHW_SET(SCC_DMA);
309 if (scc_test(&atari_scc.cha_a_ctrl)) {
313 if (scc_test(&st_escc.cha_b_ctrl)) {
314 ATARIHW_SET(ST_ESCC);
317 if (hwreg_present(&tt_scu.sys_mask)) {
319 /* Assume a VME bus if there's a SCU */
323 if (hwreg_present((void *)(0xffff9210))) {
324 ATARIHW_SET(ANALOG_JOY);
325 pr_cont(" ANALOG_JOY");
327 if (hwreg_present(blitter.halftone)) {
328 ATARIHW_SET(BLITTER);
331 if (hwreg_present((void *)0xfff00039)) {
335 #if 1 /* This maybe wrong */
336 if (!MACH_IS_MEDUSA && hwreg_present(&tt_microwire.data) &&
337 hwreg_present(&tt_microwire.mask) &&
338 (tt_microwire.mask = 0x7ff,
340 tt_microwire.data = MW_LM1992_PSG_HIGH | MW_LM1992_ADDR,
342 tt_microwire.data != 0)) {
343 ATARIHW_SET(MICROWIRE);
344 while (tt_microwire.mask != 0x7ff)
346 pr_cont(" MICROWIRE");
349 if (hwreg_present(&tt_rtc.regsel)) {
352 mach_hwclk = atari_tt_hwclk;
354 if (hwreg_present(&mste_rtc.sec_ones)) {
355 ATARIHW_SET(MSTE_CLK);
356 pr_cont(" MSTE_CLK");
357 mach_hwclk = atari_mste_hwclk;
359 if (!MACH_IS_MEDUSA && hwreg_present(&dma_wd.fdc_speed) &&
360 hwreg_write(&dma_wd.fdc_speed, 0)) {
361 ATARIHW_SET(FDCSPEED);
362 pr_cont(" FDC_SPEED");
364 if (!ATARIHW_PRESENT(ST_SCSI)) {
370 if (CPU_IS_040_OR_060)
371 /* Now it seems to be safe to turn of the tt0 transparent
372 * translation (the one that must not be turned off in
378 " movec %%d0,%%itt0\n"
379 " movec %%d0,%%dtt0\n"
385 /* allocator for memory that must reside in st-ram */
388 /* Set up a mapping for the VMEbus address region:
390 * VME is either at phys. 0xfexxxxxx (TT) or 0xa00000..0xdfffff
391 * (MegaSTE) In both cases, the whole 16 MB chunk is mapped at
392 * 0xfe000000 virt., because this can be done with a single
393 * transparent translation. On the 68040, lots of often unused
394 * page tables would be needed otherwise. On a MegaSTE or similar,
395 * the highest byte is stripped off by hardware due to the 24 bit
399 if (CPU_IS_020_OR_030) {
400 unsigned long tt1_val;
401 tt1_val = 0xfe008543; /* Translate 0xfexxxxxx, enable, cache
402 * inhibit, read and write, FDC mask = 3,
403 * FDC val = 4 -> Supervisor only */
416 : "d" (0xfe00a040)); /* Translate 0xfexxxxxx, enable,
417 * supervisor only, non-cacheable/
418 * serialized, writable */
422 /* Fetch tos version at Physical 2 */
424 * We my not be able to access this address if the kernel is
425 * loaded to st ram, since the first page is unmapped. On the
426 * Medusa this is always the case and there is nothing we can do
427 * about this, so we just assume the smaller offset. For the TT
428 * we use the fact that in head.S we have set up a mapping
429 * 0xFFxxxxxx -> 0x00xxxxxx, so that the first 16MB is accessible
430 * in the last 16MB of the address space.
432 tos_version = (MACH_IS_MEDUSA) ?
433 0xfff : *(unsigned short *)0xff000002;
434 atari_rtc_year_offset = (tos_version < 0x306) ? 70 : 68;
437 #ifdef CONFIG_HEARTBEAT
438 static void atari_heartbeat(int on)
443 if (atari_dont_touch_floppy_select)
446 local_irq_save(flags);
447 sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
448 tmp = sound_ym.rd_data_reg_sel;
449 sound_ym.wd_data = on ? (tmp & ~0x02) : (tmp | 0x02);
450 local_irq_restore(flags);
456 * This function does a reset on machines that lack the ability to
457 * assert the processor's _RESET signal somehow via hardware. It is
458 * based on the fact that you can find the initial SP and PC values
459 * after a reset at physical addresses 0 and 4. This works pretty well
460 * for Atari machines, since the lowest 8 bytes of physical memory are
461 * really ROM (mapped by hardware). For other 680x0 machines: don't
462 * know if it works...
464 * To get the values at addresses 0 and 4, the MMU better is turned
465 * off first. After that, we have to jump into physical address space
466 * (the PC before the pmove statement points to the virtual address of
467 * the code). Getting that physical address is not hard, but the code
468 * becomes a bit complex since I've tried to ensure that the jump
469 * statement after the pmove is in the cache already (otherwise the
470 * processor can't fetch it!). For that, the code first jumps to the
471 * jump statement with the (virtual) address of the pmove section in
472 * an address register . The jump statement is surely in the cache
473 * now. After that, that physical address of the reset code is loaded
474 * into the same address register, pmove is done and the same jump
475 * statements goes to the reset code. Since there are not many
476 * statements between the two jumps, I hope it stays in the cache.
478 * The C code makes heavy use of the GCC features that you can get the
479 * address of a C label. No hope to compile this with another compiler
483 /* ++andreas: no need for complicated code, just depend on prefetch */
485 static void atari_reset(void)
491 * On the Medusa, phys. 0x4 may contain garbage because it's no
492 * ROM. See above for explanation why we cannot use PTOV(4).
494 reset_addr = MACH_IS_MEDUSA || MACH_IS_AB40 ? 0xe00030 :
495 *(unsigned long *) 0xff000004;
497 /* reset ACIA for switch off OverScan, if it's active */
498 if (atari_switches & ATARI_SWITCH_OVSC_IKBD)
499 acia.key_ctrl = ACIA_RESET;
500 if (atari_switches & ATARI_SWITCH_OVSC_MIDI)
501 acia.mid_ctrl = ACIA_RESET;
503 /* processor independent: turn off interrupts and reset the VBR;
504 * the caches must be left enabled, else prefetching the final jump
505 * instruction doesn't work.
508 asm volatile ("movec %0,%%vbr"
511 if (CPU_IS_040_OR_060) {
512 unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
514 /* 68060: clear PCR to turn off superscalar operation */
524 " and.l #0xff000000,%%d0\n"
525 " or.w #0xe020,%%d0\n" /* map 16 MB, enable, cacheable */
527 " movec %%d0,%%itt0\n"
528 " movec %%d0,%%dtt0\n"
531 : : "a" (jmp_addr040)
544 /* the following setup of transparent translations is needed on the
545 * Afterburner040 to successfully reboot. Other machines shouldn't
546 * care about a different tt regs setup, they also didn't care in
547 * the past that the regs weren't turned off. */
548 " move.l #0xffc000,%%d0\n" /* whole insn space cacheable */
549 " movec %%d0,%%itt0\n"
550 " movec %%d0,%%itt1\n"
551 " or.w #0x40,%/d0\n" /* whole data space non-cacheable/ser. */
552 " movec %%d0,%%dtt0\n"
553 " movec %%d0,%%dtt1\n"
564 : "m" (tc_val), "a" (reset_addr));
568 static void atari_get_model(char *model)
570 strcpy(model, "Atari ");
571 switch (atari_mch_cookie >> 16) {
573 if (ATARIHW_PRESENT(MSTE_CLK))
574 strcat(model, "Mega ST");
580 strcat(model, "Mega STE");
582 strcat(model, "STE");
586 /* Medusa has TT _MCH cookie */
587 strcat(model, "Medusa");
591 case ATARI_MCH_FALCON:
592 strcat(model, "Falcon");
594 strcat(model, " (with Afterburner040)");
597 sprintf(model + strlen(model), "(unknown mach cookie 0x%lx)",
604 static void atari_get_hardware_list(struct seq_file *m)
608 for (i = 0; i < m68k_num_memory; i++)
609 seq_printf(m, "\t%3ld MB at 0x%08lx (%s)\n",
610 m68k_memory[i].size >> 20, m68k_memory[i].addr,
611 (m68k_memory[i].addr & 0xff000000 ?
612 "alternate RAM" : "ST-RAM"));
614 #define ATARIHW_ANNOUNCE(name, str) \
615 if (ATARIHW_PRESENT(name)) \
616 seq_printf(m, "\t%s\n", str)
618 seq_puts(m, "Detected hardware:\n");
619 ATARIHW_ANNOUNCE(STND_SHIFTER, "ST Shifter");
620 ATARIHW_ANNOUNCE(EXTD_SHIFTER, "STe Shifter");
621 ATARIHW_ANNOUNCE(TT_SHIFTER, "TT Shifter");
622 ATARIHW_ANNOUNCE(VIDEL_SHIFTER, "Falcon Shifter");
623 ATARIHW_ANNOUNCE(YM_2149, "Programmable Sound Generator");
624 ATARIHW_ANNOUNCE(PCM_8BIT, "PCM 8 Bit Sound");
625 ATARIHW_ANNOUNCE(CODEC, "CODEC Sound");
626 ATARIHW_ANNOUNCE(TT_SCSI, "SCSI Controller NCR5380 (TT style)");
627 ATARIHW_ANNOUNCE(ST_SCSI, "SCSI Controller NCR5380 (Falcon style)");
628 ATARIHW_ANNOUNCE(ACSI, "ACSI Interface");
629 ATARIHW_ANNOUNCE(IDE, "IDE Interface");
630 ATARIHW_ANNOUNCE(FDCSPEED, "8/16 Mhz Switch for FDC");
631 ATARIHW_ANNOUNCE(ST_MFP, "Multi Function Peripheral MFP 68901");
632 ATARIHW_ANNOUNCE(TT_MFP, "Second Multi Function Peripheral MFP 68901");
633 ATARIHW_ANNOUNCE(SCC, "Serial Communications Controller SCC 8530");
634 ATARIHW_ANNOUNCE(ST_ESCC, "Extended Serial Communications Controller SCC 85230");
635 ATARIHW_ANNOUNCE(ANALOG_JOY, "Paddle Interface");
636 ATARIHW_ANNOUNCE(MICROWIRE, "MICROWIRE(tm) Interface");
637 ATARIHW_ANNOUNCE(STND_DMA, "DMA Controller (24 bit)");
638 ATARIHW_ANNOUNCE(EXTD_DMA, "DMA Controller (32 bit)");
639 ATARIHW_ANNOUNCE(SCSI_DMA, "DMA Controller for NCR5380");
640 ATARIHW_ANNOUNCE(SCC_DMA, "DMA Controller for SCC");
641 ATARIHW_ANNOUNCE(TT_CLK, "Clock Chip MC146818A");
642 ATARIHW_ANNOUNCE(MSTE_CLK, "Clock Chip RP5C15");
643 ATARIHW_ANNOUNCE(SCU, "System Control Unit");
644 ATARIHW_ANNOUNCE(BLITTER, "Blitter");
645 ATARIHW_ANNOUNCE(VME, "VME Bus");
646 ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor");
650 * MSch: initial platform device support for Atari,
651 * required for EtherNAT/EtherNEC/NetUSBee drivers
654 #if defined(CONFIG_ATARI_ETHERNAT) || defined(CONFIG_ATARI_ETHERNEC)
655 static void isp1160_delay(struct device *dev, int delay)
661 #ifdef CONFIG_ATARI_ETHERNAT
663 * EtherNAT: SMC91C111 Ethernet chipset, handled by smc91x driver
666 #define ATARI_ETHERNAT_IRQ 140
668 static struct resource smc91x_resources[] = {
670 .name = "smc91x-regs",
671 .start = ATARI_ETHERNAT_PHYS_ADDR,
672 .end = ATARI_ETHERNAT_PHYS_ADDR + 0xfffff,
673 .flags = IORESOURCE_MEM,
676 .name = "smc91x-irq",
677 .start = ATARI_ETHERNAT_IRQ,
678 .end = ATARI_ETHERNAT_IRQ,
679 .flags = IORESOURCE_IRQ,
683 static struct platform_device smc91x_device = {
686 .num_resources = ARRAY_SIZE(smc91x_resources),
687 .resource = smc91x_resources,
691 * ISP 1160 - using the isp116x-hcd module
694 #define ATARI_USB_PHYS_ADDR 0x80000012
695 #define ATARI_USB_IRQ 139
697 static struct resource isp1160_resources[] = {
699 .name = "isp1160-data",
700 .start = ATARI_USB_PHYS_ADDR,
701 .end = ATARI_USB_PHYS_ADDR + 0x1,
702 .flags = IORESOURCE_MEM,
705 .name = "isp1160-regs",
706 .start = ATARI_USB_PHYS_ADDR + 0x4,
707 .end = ATARI_USB_PHYS_ADDR + 0x5,
708 .flags = IORESOURCE_MEM,
711 .name = "isp1160-irq",
712 .start = ATARI_USB_IRQ,
713 .end = ATARI_USB_IRQ,
714 .flags = IORESOURCE_IRQ,
718 /* (DataBusWidth16|AnalogOCEnable|DREQOutputPolarity|DownstreamPort15KRSel ) */
719 static struct isp116x_platform_data isp1160_platform_data = {
720 /* Enable internal resistors on downstream ports */
722 /* On-chip overcurrent protection */
724 /* INT output polarity */
726 /* INT edge or level triggered */
727 .int_edge_triggered = 0,
729 /* WAKEUP pin connected - NOT SUPPORTED */
730 /* .remote_wakeup_connected = 0, */
731 /* Wakeup by devices on usb bus enabled */
732 .remote_wakeup_enable = 0,
733 .delay = isp1160_delay,
736 static struct platform_device isp1160_device = {
737 .name = "isp116x-hcd",
739 .num_resources = ARRAY_SIZE(isp1160_resources),
740 .resource = isp1160_resources,
742 .platform_data = &isp1160_platform_data,
746 static struct platform_device *atari_ethernat_devices[] __initdata = {
750 #endif /* CONFIG_ATARI_ETHERNAT */
752 #ifdef CONFIG_ATARI_ETHERNEC
754 * EtherNEC: RTL8019 (NE2000 compatible) Ethernet chipset,
755 * handled by ne.c driver
758 #define ATARI_ETHERNEC_PHYS_ADDR 0xfffa0000
759 #define ATARI_ETHERNEC_BASE 0x300
760 #define ATARI_ETHERNEC_IRQ IRQ_MFP_TIMER1
762 static struct resource rtl8019_resources[] = {
764 .name = "rtl8019-regs",
765 .start = ATARI_ETHERNEC_BASE,
766 .end = ATARI_ETHERNEC_BASE + 0x20 - 1,
767 .flags = IORESOURCE_IO,
770 .name = "rtl8019-irq",
771 .start = ATARI_ETHERNEC_IRQ,
772 .end = ATARI_ETHERNEC_IRQ,
773 .flags = IORESOURCE_IRQ,
777 static struct platform_device rtl8019_device = {
780 .num_resources = ARRAY_SIZE(rtl8019_resources),
781 .resource = rtl8019_resources,
785 * NetUSBee: ISP1160 USB host adapter via ROM-port adapter
788 #define ATARI_NETUSBEE_PHYS_ADDR 0xfffa8000
789 #define ATARI_NETUSBEE_BASE 0x340
790 #define ATARI_NETUSBEE_IRQ IRQ_MFP_TIMER2
792 static struct resource netusbee_resources[] = {
794 .name = "isp1160-data",
795 .start = ATARI_NETUSBEE_BASE,
796 .end = ATARI_NETUSBEE_BASE + 0x1,
797 .flags = IORESOURCE_MEM,
800 .name = "isp1160-regs",
801 .start = ATARI_NETUSBEE_BASE + 0x20,
802 .end = ATARI_NETUSBEE_BASE + 0x21,
803 .flags = IORESOURCE_MEM,
806 .name = "isp1160-irq",
807 .start = ATARI_NETUSBEE_IRQ,
808 .end = ATARI_NETUSBEE_IRQ,
809 .flags = IORESOURCE_IRQ,
813 /* (DataBusWidth16|AnalogOCEnable|DREQOutputPolarity|DownstreamPort15KRSel ) */
814 static struct isp116x_platform_data netusbee_platform_data = {
815 /* Enable internal resistors on downstream ports */
817 /* On-chip overcurrent protection */
819 /* INT output polarity */
821 /* INT edge or level triggered */
822 .int_edge_triggered = 0,
824 /* WAKEUP pin connected - NOT SUPPORTED */
825 /* .remote_wakeup_connected = 0, */
826 /* Wakeup by devices on usb bus enabled */
827 .remote_wakeup_enable = 0,
828 .delay = isp1160_delay,
831 static struct platform_device netusbee_device = {
832 .name = "isp116x-hcd",
834 .num_resources = ARRAY_SIZE(netusbee_resources),
835 .resource = netusbee_resources,
837 .platform_data = &netusbee_platform_data,
841 static struct platform_device *atari_netusbee_devices[] __initdata = {
845 #endif /* CONFIG_ATARI_ETHERNEC */
847 #if IS_ENABLED(CONFIG_ATARI_SCSI)
848 static const struct resource atari_scsi_st_rsrc[] __initconst = {
850 .flags = IORESOURCE_IRQ,
851 .start = IRQ_MFP_FSCSI,
852 .end = IRQ_MFP_FSCSI,
856 static const struct resource atari_scsi_tt_rsrc[] __initconst = {
858 .flags = IORESOURCE_IRQ,
859 .start = IRQ_TT_MFP_SCSI,
860 .end = IRQ_TT_MFP_SCSI,
866 * Falcon IDE interface
869 #define FALCON_IDE_BASE 0xfff00000
871 static const struct resource atari_falconide_rsrc[] __initconst = {
872 DEFINE_RES_MEM(FALCON_IDE_BASE, 0x38),
873 DEFINE_RES_MEM(FALCON_IDE_BASE + 0x38, 2),
876 static int __init atari_platform_init(void)
878 struct platform_device *pdev;
884 #ifdef CONFIG_ATARI_ETHERNAT
886 unsigned char *enatc_virt;
887 enatc_virt = (unsigned char *)ioremap((ATARI_ETHERNAT_PHYS_ADDR+0x23), 0xf);
888 if (hwreg_present(enatc_virt)) {
889 rv = platform_add_devices(atari_ethernat_devices,
890 ARRAY_SIZE(atari_ethernat_devices));
896 #ifdef CONFIG_ATARI_ETHERNEC
899 unsigned char *enec_virt;
900 enec_virt = (unsigned char *)ioremap((ATARI_ETHERNEC_PHYS_ADDR), 0xf);
901 if (hwreg_present(enec_virt)) {
902 error = platform_add_devices(atari_netusbee_devices,
903 ARRAY_SIZE(atari_netusbee_devices));
911 #if IS_ENABLED(CONFIG_ATARI_SCSI)
912 if (ATARIHW_PRESENT(ST_SCSI))
913 platform_device_register_simple("atari_scsi", -1,
914 atari_scsi_st_rsrc, ARRAY_SIZE(atari_scsi_st_rsrc));
915 else if (ATARIHW_PRESENT(TT_SCSI))
916 platform_device_register_simple("atari_scsi", -1,
917 atari_scsi_tt_rsrc, ARRAY_SIZE(atari_scsi_tt_rsrc));
920 if (ATARIHW_PRESENT(IDE)) {
921 pdev = platform_device_register_simple("atari-falcon-ide", -1,
922 atari_falconide_rsrc, ARRAY_SIZE(atari_falconide_rsrc));
930 arch_initcall(atari_platform_init);