diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 13:08:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 13:08:44 -0400 |
commit | 165bc513f7ec54d3fa3660f5c851c4bbc533d577 (patch) | |
tree | dca15424134900698d8dbff95e520322b4e5af28 | |
parent | e2823299cdc140cccd40484d690ab1d90d75b099 (diff) | |
parent | e00c73ee05dc38ecaccced55d4f5fc58b0b769f7 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
Pull m68k update from Geert Uytterhoeven.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
m68k: Remove inline strlen() implementation
m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCD
m68k: Implement ndelay() based on the existing udelay() logic
m68k/atari: EtherNAT - add interrupt chip definition for CPLD interrupts
m68k/atari: EtherNEC - add platform device support
m68k/atari: EtherNAT - platform device and IRQ support code
m68k/atari: use dedicated irq_chip for timer D interrupts
m68k/atari: ROM port ISA adapter support
m68k: Add missing cmpxchg64() if CONFIG_RMW_INSNS=y
-rw-r--r-- | arch/m68k/Kconfig.bus | 10 | ||||
-rw-r--r-- | arch/m68k/Kconfig.devices | 24 | ||||
-rw-r--r-- | arch/m68k/atari/ataints.c | 152 | ||||
-rw-r--r-- | arch/m68k/atari/config.c | 239 | ||||
-rw-r--r-- | arch/m68k/include/asm/atarihw.h | 6 | ||||
-rw-r--r-- | arch/m68k/include/asm/atariints.h | 11 | ||||
-rw-r--r-- | arch/m68k/include/asm/cmpxchg.h | 3 | ||||
-rw-r--r-- | arch/m68k/include/asm/delay.h | 23 | ||||
-rw-r--r-- | arch/m68k/include/asm/io_mm.h | 136 | ||||
-rw-r--r-- | arch/m68k/include/asm/irq.h | 6 | ||||
-rw-r--r-- | arch/m68k/include/asm/raw_io.h | 109 | ||||
-rw-r--r-- | arch/m68k/include/asm/string.h | 14 | ||||
-rw-r--r-- | arch/m68k/kernel/setup_mm.c | 6 | ||||
-rw-r--r-- | arch/m68k/lib/string.c | 2 |
14 files changed, 717 insertions, 24 deletions
diff --git a/arch/m68k/Kconfig.bus b/arch/m68k/Kconfig.bus index 93ef0346b209..675b087198f6 100644 --- a/arch/m68k/Kconfig.bus +++ b/arch/m68k/Kconfig.bus | |||
@@ -45,6 +45,16 @@ config ISA | |||
45 | (MCA) or VESA. ISA is an older system, now being displaced by PCI; | 45 | (MCA) or VESA. ISA is an older system, now being displaced by PCI; |
46 | newer boards don't support it. If you have ISA, say Y, otherwise N. | 46 | newer boards don't support it. If you have ISA, say Y, otherwise N. |
47 | 47 | ||
48 | config ATARI_ROM_ISA | ||
49 | bool "Atari ROM port ISA adapter support" | ||
50 | depends on ATARI | ||
51 | help | ||
52 | This option enables support for the ROM port ISA adapter used to | ||
53 | operate ISA cards on Atari. Only 8 bit cards are supported, and | ||
54 | no interrupt lines are connected. | ||
55 | The only driver currently using this adapter is the EtherNEC | ||
56 | driver for RTL8019AS based NE2000 compatible network cards. | ||
57 | |||
48 | config GENERIC_ISA_DMA | 58 | config GENERIC_ISA_DMA |
49 | def_bool ISA | 59 | def_bool ISA |
50 | 60 | ||
diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices index 4bc945dfe467..d163991c5717 100644 --- a/arch/m68k/Kconfig.devices +++ b/arch/m68k/Kconfig.devices | |||
@@ -55,6 +55,30 @@ config NFETH | |||
55 | which will emulate a regular ethernet device while presenting an | 55 | which will emulate a regular ethernet device while presenting an |
56 | ethertap device to the host system. | 56 | ethertap device to the host system. |
57 | 57 | ||
58 | config ATARI_ETHERNAT | ||
59 | bool "Atari EtherNAT Ethernet support" | ||
60 | depends on ATARI | ||
61 | ---help--- | ||
62 | Say Y to include support for the EtherNAT network adapter for the | ||
63 | CT/60 extension port. | ||
64 | |||
65 | To compile the actual ethernet driver, choose Y or M for the SMC91X | ||
66 | option in the network device section; the module will be called smc91x. | ||
67 | |||
68 | config ATARI_ETHERNEC | ||
69 | bool "Atari EtherNEC Ethernet support" | ||
70 | depends on ATARI_ROM_ISA | ||
71 | ---help--- | ||
72 | Say Y to include support for the EtherNEC network adapter for the | ||
73 | ROM port. The driver works by polling instead of interrupts, so it | ||
74 | is quite slow. | ||
75 | |||
76 | This driver also suppports the ethernet part of the NetUSBee ROM | ||
77 | port combined Ethernet/USB adapter. | ||
78 | |||
79 | To compile the actual ethernet driver, choose Y or M in for the NE2000 | ||
80 | option in the network device section; the module will be called ne. | ||
81 | |||
58 | endmenu | 82 | endmenu |
59 | 83 | ||
60 | menu "Character devices" | 84 | menu "Character devices" |
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index 3f41092d1b70..20cde4e9fc77 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <asm/atari_stdma.h> | 49 | #include <asm/atari_stdma.h> |
50 | #include <asm/irq.h> | 50 | #include <asm/irq.h> |
51 | #include <asm/entry.h> | 51 | #include <asm/entry.h> |
52 | #include <asm/io.h> | ||
52 | 53 | ||
53 | 54 | ||
54 | /* | 55 | /* |
@@ -122,6 +123,136 @@ static struct irq_chip atari_irq_chip = { | |||
122 | }; | 123 | }; |
123 | 124 | ||
124 | /* | 125 | /* |
126 | * ST-MFP timer D chained interrupts - each driver gets its own timer | ||
127 | * interrupt instance. | ||
128 | */ | ||
129 | |||
130 | struct mfptimerbase { | ||
131 | volatile struct MFP *mfp; | ||
132 | unsigned char mfp_mask, mfp_data; | ||
133 | unsigned short int_mask; | ||
134 | int handler_irq, mfptimer_irq, server_irq; | ||
135 | char *name; | ||
136 | } stmfp_base = { | ||
137 | .mfp = &st_mfp, | ||
138 | .int_mask = 0x0, | ||
139 | .handler_irq = IRQ_MFP_TIMD, | ||
140 | .mfptimer_irq = IRQ_MFP_TIMER1, | ||
141 | .name = "MFP Timer D" | ||
142 | }; | ||
143 | |||
144 | static irqreturn_t mfptimer_handler(int irq, void *dev_id) | ||
145 | { | ||
146 | struct mfptimerbase *base = dev_id; | ||
147 | int mach_irq; | ||
148 | unsigned char ints; | ||
149 | |||
150 | mach_irq = base->mfptimer_irq; | ||
151 | ints = base->int_mask; | ||
152 | for (; ints; mach_irq++, ints >>= 1) { | ||
153 | if (ints & 1) | ||
154 | generic_handle_irq(mach_irq); | ||
155 | } | ||
156 | return IRQ_HANDLED; | ||
157 | } | ||
158 | |||
159 | |||
160 | static void atari_mfptimer_enable(struct irq_data *data) | ||
161 | { | ||
162 | int mfp_num = data->irq - IRQ_MFP_TIMER1; | ||
163 | stmfp_base.int_mask |= 1 << mfp_num; | ||
164 | atari_enable_irq(IRQ_MFP_TIMD); | ||
165 | } | ||
166 | |||
167 | static void atari_mfptimer_disable(struct irq_data *data) | ||
168 | { | ||
169 | int mfp_num = data->irq - IRQ_MFP_TIMER1; | ||
170 | stmfp_base.int_mask &= ~(1 << mfp_num); | ||
171 | if (!stmfp_base.int_mask) | ||
172 | atari_disable_irq(IRQ_MFP_TIMD); | ||
173 | } | ||
174 | |||
175 | static struct irq_chip atari_mfptimer_chip = { | ||
176 | .name = "timer_d", | ||
177 | .irq_enable = atari_mfptimer_enable, | ||
178 | .irq_disable = atari_mfptimer_disable, | ||
179 | }; | ||
180 | |||
181 | |||
182 | /* | ||
183 | * EtherNAT CPLD interrupt handling | ||
184 | * CPLD interrupt register is at phys. 0x80000023 | ||
185 | * Need this mapped in at interrupt startup time | ||
186 | * Possibly need this mapped on demand anyway - | ||
187 | * EtherNAT USB driver needs to disable IRQ before | ||
188 | * startup! | ||
189 | */ | ||
190 | |||
191 | static unsigned char *enat_cpld; | ||
192 | |||
193 | static unsigned int atari_ethernat_startup(struct irq_data *data) | ||
194 | { | ||
195 | int enat_num = 140 - data->irq + 1; | ||
196 | |||
197 | m68k_irq_startup(data); | ||
198 | /* | ||
199 | * map CPLD interrupt register | ||
200 | */ | ||
201 | if (!enat_cpld) | ||
202 | enat_cpld = (unsigned char *)ioremap((ATARI_ETHERNAT_PHYS_ADDR+0x23), 0x2); | ||
203 | /* | ||
204 | * do _not_ enable the USB chip interrupt here - causes interrupt storm | ||
205 | * and triggers dead interrupt watchdog | ||
206 | * Need to reset the USB chip to a sane state in early startup before | ||
207 | * removing this hack | ||
208 | */ | ||
209 | if (enat_num == 1) | ||
210 | *enat_cpld |= 1 << enat_num; | ||
211 | |||
212 | return 0; | ||
213 | } | ||
214 | |||
215 | static void atari_ethernat_enable(struct irq_data *data) | ||
216 | { | ||
217 | int enat_num = 140 - data->irq + 1; | ||
218 | /* | ||
219 | * map CPLD interrupt register | ||
220 | */ | ||
221 | if (!enat_cpld) | ||
222 | enat_cpld = (unsigned char *)ioremap((ATARI_ETHERNAT_PHYS_ADDR+0x23), 0x2); | ||
223 | *enat_cpld |= 1 << enat_num; | ||
224 | } | ||
225 | |||
226 | static void atari_ethernat_disable(struct irq_data *data) | ||
227 | { | ||
228 | int enat_num = 140 - data->irq + 1; | ||
229 | /* | ||
230 | * map CPLD interrupt register | ||
231 | */ | ||
232 | if (!enat_cpld) | ||
233 | enat_cpld = (unsigned char *)ioremap((ATARI_ETHERNAT_PHYS_ADDR+0x23), 0x2); | ||
234 | *enat_cpld &= ~(1 << enat_num); | ||
235 | } | ||
236 | |||
237 | static void atari_ethernat_shutdown(struct irq_data *data) | ||
238 | { | ||
239 | int enat_num = 140 - data->irq + 1; | ||
240 | if (enat_cpld) { | ||
241 | *enat_cpld &= ~(1 << enat_num); | ||
242 | iounmap(enat_cpld); | ||
243 | enat_cpld = NULL; | ||
244 | } | ||
245 | } | ||
246 | |||
247 | static struct irq_chip atari_ethernat_chip = { | ||
248 | .name = "ethernat", | ||
249 | .irq_startup = atari_ethernat_startup, | ||
250 | .irq_shutdown = atari_ethernat_shutdown, | ||
251 | .irq_enable = atari_ethernat_enable, | ||
252 | .irq_disable = atari_ethernat_disable, | ||
253 | }; | ||
254 | |||
255 | /* | ||
125 | * void atari_init_IRQ (void) | 256 | * void atari_init_IRQ (void) |
126 | * | 257 | * |
127 | * Parameters: None | 258 | * Parameters: None |
@@ -198,6 +329,27 @@ void __init atari_init_IRQ(void) | |||
198 | /* Initialize the PSG: all sounds off, both ports output */ | 329 | /* Initialize the PSG: all sounds off, both ports output */ |
199 | sound_ym.rd_data_reg_sel = 7; | 330 | sound_ym.rd_data_reg_sel = 7; |
200 | sound_ym.wd_data = 0xff; | 331 | sound_ym.wd_data = 0xff; |
332 | |||
333 | m68k_setup_irq_controller(&atari_mfptimer_chip, handle_simple_irq, | ||
334 | IRQ_MFP_TIMER1, 8); | ||
335 | |||
336 | /* prepare timer D data for use as poll interrupt */ | ||
337 | /* set Timer D data Register - needs to be > 0 */ | ||
338 | st_mfp.tim_dt_d = 254; /* < 100 Hz */ | ||
339 | /* start timer D, div = 1:100 */ | ||
340 | st_mfp.tim_ct_cd = (st_mfp.tim_ct_cd & 0xf0) | 0x6; | ||
341 | |||
342 | /* request timer D dispatch handler */ | ||
343 | if (request_irq(IRQ_MFP_TIMD, mfptimer_handler, IRQF_SHARED, | ||
344 | stmfp_base.name, &stmfp_base)) | ||
345 | pr_err("Couldn't register %s interrupt\n", stmfp_base.name); | ||
346 | |||
347 | /* | ||
348 | * EtherNAT ethernet / USB interrupt handlers | ||
349 | */ | ||
350 | |||
351 | m68k_setup_irq_controller(&atari_ethernat_chip, handle_simple_irq, | ||
352 | 139, 2); | ||
201 | } | 353 | } |
202 | 354 | ||
203 | 355 | ||
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index 037c11c99331..fb2d0bd9b3ad 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/ioport.h> | 33 | #include <linux/ioport.h> |
34 | #include <linux/platform_device.h> | ||
35 | #include <linux/usb/isp116x.h> | ||
34 | #include <linux/vt_kern.h> | 36 | #include <linux/vt_kern.h> |
35 | #include <linux/module.h> | 37 | #include <linux/module.h> |
36 | 38 | ||
@@ -655,3 +657,240 @@ static void atari_get_hardware_list(struct seq_file *m) | |||
655 | ATARIHW_ANNOUNCE(VME, "VME Bus"); | 657 | ATARIHW_ANNOUNCE(VME, "VME Bus"); |
656 | ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor"); | 658 | ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor"); |
657 | } | 659 | } |
660 | |||
661 | /* | ||
662 | * MSch: initial platform device support for Atari, | ||
663 | * required for EtherNAT/EtherNEC/NetUSBee drivers | ||
664 | */ | ||
665 | |||
666 | #if defined(CONFIG_ATARI_ETHERNAT) || defined(CONFIG_ATARI_ETHERNEC) | ||
667 | static void isp1160_delay(struct device *dev, int delay) | ||
668 | { | ||
669 | ndelay(delay); | ||
670 | } | ||
671 | #endif | ||
672 | |||
673 | #ifdef CONFIG_ATARI_ETHERNAT | ||
674 | /* | ||
675 | * EtherNAT: SMC91C111 Ethernet chipset, handled by smc91x driver | ||
676 | */ | ||
677 | |||
678 | #define ATARI_ETHERNAT_IRQ 140 | ||
679 | |||
680 | static struct resource smc91x_resources[] = { | ||
681 | [0] = { | ||
682 | .name = "smc91x-regs", | ||
683 | .start = ATARI_ETHERNAT_PHYS_ADDR, | ||
684 | .end = ATARI_ETHERNAT_PHYS_ADDR + 0xfffff, | ||
685 | .flags = IORESOURCE_MEM, | ||
686 | }, | ||
687 | [1] = { | ||
688 | .name = "smc91x-irq", | ||
689 | .start = ATARI_ETHERNAT_IRQ, | ||
690 | .end = ATARI_ETHERNAT_IRQ, | ||
691 | .flags = IORESOURCE_IRQ, | ||
692 | }, | ||
693 | }; | ||
694 | |||
695 | static struct platform_device smc91x_device = { | ||
696 | .name = "smc91x", | ||
697 | .id = -1, | ||
698 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
699 | .resource = smc91x_resources, | ||
700 | }; | ||
701 | |||
702 | /* | ||
703 | * ISP 1160 - using the isp116x-hcd module | ||
704 | */ | ||
705 | |||
706 | #define ATARI_USB_PHYS_ADDR 0x80000012 | ||
707 | #define ATARI_USB_IRQ 139 | ||
708 | |||
709 | static struct resource isp1160_resources[] = { | ||
710 | [0] = { | ||
711 | .name = "isp1160-data", | ||
712 | .start = ATARI_USB_PHYS_ADDR, | ||
713 | .end = ATARI_USB_PHYS_ADDR + 0x1, | ||
714 | .flags = IORESOURCE_MEM, | ||
715 | }, | ||
716 | [1] = { | ||
717 | .name = "isp1160-regs", | ||
718 | .start = ATARI_USB_PHYS_ADDR + 0x4, | ||
719 | .end = ATARI_USB_PHYS_ADDR + 0x5, | ||
720 | .flags = IORESOURCE_MEM, | ||
721 | }, | ||
722 | [2] = { | ||
723 | .name = "isp1160-irq", | ||
724 | .start = ATARI_USB_IRQ, | ||
725 | .end = ATARI_USB_IRQ, | ||
726 | .flags = IORESOURCE_IRQ, | ||
727 | }, | ||
728 | }; | ||
729 | |||
730 | /* (DataBusWidth16|AnalogOCEnable|DREQOutputPolarity|DownstreamPort15KRSel ) */ | ||
731 | static struct isp116x_platform_data isp1160_platform_data = { | ||
732 | /* Enable internal resistors on downstream ports */ | ||
733 | .sel15Kres = 1, | ||
734 | /* On-chip overcurrent protection */ | ||
735 | .oc_enable = 1, | ||
736 | /* INT output polarity */ | ||
737 | .int_act_high = 1, | ||
738 | /* INT edge or level triggered */ | ||
739 | .int_edge_triggered = 0, | ||
740 | |||
741 | /* WAKEUP pin connected - NOT SUPPORTED */ | ||
742 | /* .remote_wakeup_connected = 0, */ | ||
743 | /* Wakeup by devices on usb bus enabled */ | ||
744 | .remote_wakeup_enable = 0, | ||
745 | .delay = isp1160_delay, | ||
746 | }; | ||
747 | |||
748 | static struct platform_device isp1160_device = { | ||
749 | .name = "isp116x-hcd", | ||
750 | .id = 0, | ||
751 | .num_resources = ARRAY_SIZE(isp1160_resources), | ||
752 | .resource = isp1160_resources, | ||
753 | .dev = { | ||
754 | .platform_data = &isp1160_platform_data, | ||
755 | }, | ||
756 | }; | ||
757 | |||
758 | static struct platform_device *atari_ethernat_devices[] __initdata = { | ||
759 | &smc91x_device, | ||
760 | &isp1160_device | ||
761 | }; | ||
762 | #endif /* CONFIG_ATARI_ETHERNAT */ | ||
763 | |||
764 | #ifdef CONFIG_ATARI_ETHERNEC | ||
765 | /* | ||
766 | * EtherNEC: RTL8019 (NE2000 compatible) Ethernet chipset, | ||
767 | * handled by ne.c driver | ||
768 | */ | ||
769 | |||
770 | #define ATARI_ETHERNEC_PHYS_ADDR 0xfffa0000 | ||
771 | #define ATARI_ETHERNEC_BASE 0x300 | ||
772 | #define ATARI_ETHERNEC_IRQ IRQ_MFP_TIMER1 | ||
773 | |||
774 | static struct resource rtl8019_resources[] = { | ||
775 | [0] = { | ||
776 | .name = "rtl8019-regs", | ||
777 | .start = ATARI_ETHERNEC_BASE, | ||
778 | .end = ATARI_ETHERNEC_BASE + 0x20 - 1, | ||
779 | .flags = IORESOURCE_IO, | ||
780 | }, | ||
781 | [1] = { | ||
782 | .name = "rtl8019-irq", | ||
783 | .start = ATARI_ETHERNEC_IRQ, | ||
784 | .end = ATARI_ETHERNEC_IRQ, | ||
785 | .flags = IORESOURCE_IRQ, | ||
786 | }, | ||
787 | }; | ||
788 | |||
789 | static struct platform_device rtl8019_device = { | ||
790 | .name = "ne", | ||
791 | .id = -1, | ||
792 | .num_resources = ARRAY_SIZE(rtl8019_resources), | ||
793 | .resource = rtl8019_resources, | ||
794 | }; | ||
795 | |||
796 | /* | ||
797 | * NetUSBee: ISP1160 USB host adapter via ROM-port adapter | ||
798 | */ | ||
799 | |||
800 | #define ATARI_NETUSBEE_PHYS_ADDR 0xfffa8000 | ||
801 | #define ATARI_NETUSBEE_BASE 0x340 | ||
802 | #define ATARI_NETUSBEE_IRQ IRQ_MFP_TIMER2 | ||
803 | |||
804 | static struct resource netusbee_resources[] = { | ||
805 | [0] = { | ||
806 | .name = "isp1160-data", | ||
807 | .start = ATARI_NETUSBEE_BASE, | ||
808 | .end = ATARI_NETUSBEE_BASE + 0x1, | ||
809 | .flags = IORESOURCE_MEM, | ||
810 | }, | ||
811 | [1] = { | ||
812 | .name = "isp1160-regs", | ||
813 | .start = ATARI_NETUSBEE_BASE + 0x20, | ||
814 | .end = ATARI_NETUSBEE_BASE + 0x21, | ||
815 | .flags = IORESOURCE_MEM, | ||
816 | }, | ||
817 | [2] = { | ||
818 | .name = "isp1160-irq", | ||
819 | .start = ATARI_NETUSBEE_IRQ, | ||
820 | .end = ATARI_NETUSBEE_IRQ, | ||
821 | .flags = IORESOURCE_IRQ, | ||
822 | }, | ||
823 | }; | ||
824 | |||
825 | /* (DataBusWidth16|AnalogOCEnable|DREQOutputPolarity|DownstreamPort15KRSel ) */ | ||
826 | static struct isp116x_platform_data netusbee_platform_data = { | ||
827 | /* Enable internal resistors on downstream ports */ | ||
828 | .sel15Kres = 1, | ||
829 | /* On-chip overcurrent protection */ | ||
830 | .oc_enable = 1, | ||
831 | /* INT output polarity */ | ||
832 | .int_act_high = 1, | ||
833 | /* INT edge or level triggered */ | ||
834 | .int_edge_triggered = 0, | ||
835 | |||
836 | /* WAKEUP pin connected - NOT SUPPORTED */ | ||
837 | /* .remote_wakeup_connected = 0, */ | ||
838 | /* Wakeup by devices on usb bus enabled */ | ||
839 | .remote_wakeup_enable = 0, | ||
840 | .delay = isp1160_delay, | ||
841 | }; | ||
842 | |||
843 | static struct platform_device netusbee_device = { | ||
844 | .name = "isp116x-hcd", | ||
845 | .id = 1, | ||
846 | .num_resources = ARRAY_SIZE(netusbee_resources), | ||
847 | .resource = netusbee_resources, | ||
848 | .dev = { | ||
849 | .platform_data = &netusbee_platform_data, | ||
850 | }, | ||
851 | }; | ||
852 | |||
853 | static struct platform_device *atari_netusbee_devices[] __initdata = { | ||
854 | &rtl8019_device, | ||
855 | &netusbee_device | ||
856 | }; | ||
857 | #endif /* CONFIG_ATARI_ETHERNEC */ | ||
858 | |||
859 | int __init atari_platform_init(void) | ||
860 | { | ||
861 | int rv = 0; | ||
862 | |||
863 | if (!MACH_IS_ATARI) | ||
864 | return -ENODEV; | ||
865 | |||
866 | #ifdef CONFIG_ATARI_ETHERNAT | ||
867 | { | ||
868 | unsigned char *enatc_virt; | ||
869 | enatc_virt = (unsigned char *)ioremap((ATARI_ETHERNAT_PHYS_ADDR+0x23), 0xf); | ||
870 | if (hwreg_present(enatc_virt)) { | ||
871 | rv = platform_add_devices(atari_ethernat_devices, | ||
872 | ARRAY_SIZE(atari_ethernat_devices)); | ||
873 | } | ||
874 | iounmap(enatc_virt); | ||
875 | } | ||
876 | #endif | ||
877 | |||
878 | #ifdef CONFIG_ATARI_ETHERNEC | ||
879 | { | ||
880 | int error; | ||
881 | unsigned char *enec_virt; | ||
882 | enec_virt = (unsigned char *)ioremap((ATARI_ETHERNEC_PHYS_ADDR), 0xf); | ||
883 | if (hwreg_present(enec_virt)) { | ||
884 | error = platform_add_devices(atari_netusbee_devices, | ||
885 | ARRAY_SIZE(atari_netusbee_devices)); | ||
886 | if (error && !rv) | ||
887 | rv = error; | ||
888 | } | ||
889 | iounmap(enec_virt); | ||
890 | } | ||
891 | #endif | ||
892 | |||
893 | return rv; | ||
894 | } | ||
895 | |||
896 | arch_initcall(atari_platform_init); | ||
diff --git a/arch/m68k/include/asm/atarihw.h b/arch/m68k/include/asm/atarihw.h index c0cb36350775..d887050e6da6 100644 --- a/arch/m68k/include/asm/atarihw.h +++ b/arch/m68k/include/asm/atarihw.h | |||
@@ -805,5 +805,11 @@ struct MSTE_RTC { | |||
805 | 805 | ||
806 | #define mste_rtc ((*(volatile struct MSTE_RTC *)MSTE_RTC_BAS)) | 806 | #define mste_rtc ((*(volatile struct MSTE_RTC *)MSTE_RTC_BAS)) |
807 | 807 | ||
808 | /* | ||
809 | ** EtherNAT add-on card for Falcon - combined ethernet and USB adapter | ||
810 | */ | ||
811 | |||
812 | #define ATARI_ETHERNAT_PHYS_ADDR 0x80000000 | ||
813 | |||
808 | #endif /* linux/atarihw.h */ | 814 | #endif /* linux/atarihw.h */ |
809 | 815 | ||
diff --git a/arch/m68k/include/asm/atariints.h b/arch/m68k/include/asm/atariints.h index 5fc13bdf9044..953e0ac6855e 100644 --- a/arch/m68k/include/asm/atariints.h +++ b/arch/m68k/include/asm/atariints.h | |||
@@ -32,7 +32,7 @@ | |||
32 | #define VME_SOURCE_BASE 56 | 32 | #define VME_SOURCE_BASE 56 |
33 | #define VME_MAX_SOURCES 16 | 33 | #define VME_MAX_SOURCES 16 |
34 | 34 | ||
35 | #define NUM_ATARI_SOURCES (VME_SOURCE_BASE+VME_MAX_SOURCES-STMFP_SOURCE_BASE) | 35 | #define NUM_ATARI_SOURCES 141 |
36 | 36 | ||
37 | /* convert vector number to int source number */ | 37 | /* convert vector number to int source number */ |
38 | #define IRQ_VECTOR_TO_SOURCE(v) ((v) - ((v) < 0x20 ? 0x18 : (0x40-8))) | 38 | #define IRQ_VECTOR_TO_SOURCE(v) ((v) - ((v) < 0x20 ? 0x18 : (0x40-8))) |
@@ -94,6 +94,15 @@ | |||
94 | #define IRQ_SCCA_RX (52) | 94 | #define IRQ_SCCA_RX (52) |
95 | #define IRQ_SCCA_SPCOND (54) | 95 | #define IRQ_SCCA_SPCOND (54) |
96 | 96 | ||
97 | /* shared MFP timer D interrupts - hires timer for EtherNEC et al. */ | ||
98 | #define IRQ_MFP_TIMER1 (64) | ||
99 | #define IRQ_MFP_TIMER2 (65) | ||
100 | #define IRQ_MFP_TIMER3 (66) | ||
101 | #define IRQ_MFP_TIMER4 (67) | ||
102 | #define IRQ_MFP_TIMER5 (68) | ||
103 | #define IRQ_MFP_TIMER6 (69) | ||
104 | #define IRQ_MFP_TIMER7 (70) | ||
105 | #define IRQ_MFP_TIMER8 (71) | ||
97 | 106 | ||
98 | #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */ | 107 | #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */ |
99 | #define INT_TICKS 246 /* to make sched_time = 99.902... HZ */ | 108 | #define INT_TICKS 246 /* to make sched_time = 99.902... HZ */ |
diff --git a/arch/m68k/include/asm/cmpxchg.h b/arch/m68k/include/asm/cmpxchg.h index 5c81d0eae5cf..bc755bc620ad 100644 --- a/arch/m68k/include/asm/cmpxchg.h +++ b/arch/m68k/include/asm/cmpxchg.h | |||
@@ -124,6 +124,9 @@ static inline unsigned long __cmpxchg(volatile void *p, unsigned long old, | |||
124 | #define cmpxchg_local(ptr, o, n) \ | 124 | #define cmpxchg_local(ptr, o, n) \ |
125 | ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ | 125 | ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ |
126 | (unsigned long)(n), sizeof(*(ptr)))) | 126 | (unsigned long)(n), sizeof(*(ptr)))) |
127 | |||
128 | #define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) | ||
129 | |||
127 | #else | 130 | #else |
128 | 131 | ||
129 | /* | 132 | /* |
diff --git a/arch/m68k/include/asm/delay.h b/arch/m68k/include/asm/delay.h index 12d8fe4f1d30..d28fa8fe26fe 100644 --- a/arch/m68k/include/asm/delay.h +++ b/arch/m68k/include/asm/delay.h | |||
@@ -92,5 +92,28 @@ static inline void __udelay(unsigned long usecs) | |||
92 | #define udelay(n) (__builtin_constant_p(n) ? \ | 92 | #define udelay(n) (__builtin_constant_p(n) ? \ |
93 | ((n) > 20000 ? __bad_udelay() : __const_udelay(n)) : __udelay(n)) | 93 | ((n) > 20000 ? __bad_udelay() : __const_udelay(n)) : __udelay(n)) |
94 | 94 | ||
95 | /* | ||
96 | * nanosecond delay: | ||
97 | * | ||
98 | * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) is the number of loops | ||
99 | * per microsecond | ||
100 | * | ||
101 | * 1000 / ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) is the number of | ||
102 | * nanoseconds per loop | ||
103 | * | ||
104 | * So n / ( 1000 / ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) ) would | ||
105 | * be the number of loops for n nanoseconds | ||
106 | */ | ||
107 | |||
108 | /* | ||
109 | * The simpler m68k and ColdFire processors do not have a 32*32->64 | ||
110 | * multiply instruction. So we need to handle them a little differently. | ||
111 | * We use a bit of shifting and a single 32*32->32 multiply to get close. | ||
112 | * This is a macro so that the const version can factor out the first | ||
113 | * multiply and shift. | ||
114 | */ | ||
115 | #define HZSCALE (268435456 / (1000000 / HZ)) | ||
116 | |||
117 | #define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000)); | ||
95 | 118 | ||
96 | #endif /* defined(_M68K_DELAY_H) */ | 119 | #endif /* defined(_M68K_DELAY_H) */ |
diff --git a/arch/m68k/include/asm/io_mm.h b/arch/m68k/include/asm/io_mm.h index a6686d26fe17..ffdf54f44bc6 100644 --- a/arch/m68k/include/asm/io_mm.h +++ b/arch/m68k/include/asm/io_mm.h | |||
@@ -63,6 +63,23 @@ | |||
63 | #endif | 63 | #endif |
64 | #endif /* AMIGA_PCMCIA */ | 64 | #endif /* AMIGA_PCMCIA */ |
65 | 65 | ||
66 | #ifdef CONFIG_ATARI_ROM_ISA | ||
67 | |||
68 | #define enec_isa_read_base 0xfffa0000 | ||
69 | #define enec_isa_write_base 0xfffb0000 | ||
70 | |||
71 | #define ENEC_ISA_IO_B(ioaddr) (enec_isa_read_base+((((unsigned long)(ioaddr))&0x7F)<<9)) | ||
72 | #define ENEC_ISA_IO_W(ioaddr) (enec_isa_read_base+((((unsigned long)(ioaddr))&0x7F)<<9)) | ||
73 | #define ENEC_ISA_MEM_B(madr) (enec_isa_read_base+((((unsigned long)(madr))&0x7F)<<9)) | ||
74 | #define ENEC_ISA_MEM_W(madr) (enec_isa_read_base+((((unsigned long)(madr))&0x7F)<<9)) | ||
75 | |||
76 | #ifndef MULTI_ISA | ||
77 | #define MULTI_ISA 0 | ||
78 | #else | ||
79 | #undef MULTI_ISA | ||
80 | #define MULTI_ISA 1 | ||
81 | #endif | ||
82 | #endif /* ATARI_ROM_ISA */ | ||
66 | 83 | ||
67 | 84 | ||
68 | #if defined(CONFIG_PCI) && defined(CONFIG_COLDFIRE) | 85 | #if defined(CONFIG_PCI) && defined(CONFIG_COLDFIRE) |
@@ -111,14 +128,15 @@ void mcf_pci_outsl(u32 addr, const u32 *buf, u32 len); | |||
111 | #define readw(addr) in_le16(addr) | 128 | #define readw(addr) in_le16(addr) |
112 | #define writew(v, addr) out_le16((addr), (v)) | 129 | #define writew(v, addr) out_le16((addr), (v)) |
113 | 130 | ||
114 | #elif defined(CONFIG_ISA) | 131 | #elif defined(CONFIG_ISA) || defined(CONFIG_ATARI_ROM_ISA) |
115 | 132 | ||
116 | #if MULTI_ISA == 0 | 133 | #if MULTI_ISA == 0 |
117 | #undef MULTI_ISA | 134 | #undef MULTI_ISA |
118 | #endif | 135 | #endif |
119 | 136 | ||
120 | #define ISA_TYPE_Q40 (1) | 137 | #define ISA_TYPE_Q40 (1) |
121 | #define ISA_TYPE_AG (2) | 138 | #define ISA_TYPE_AG (2) |
139 | #define ISA_TYPE_ENEC (3) | ||
122 | 140 | ||
123 | #if defined(CONFIG_Q40) && !defined(MULTI_ISA) | 141 | #if defined(CONFIG_Q40) && !defined(MULTI_ISA) |
124 | #define ISA_TYPE ISA_TYPE_Q40 | 142 | #define ISA_TYPE ISA_TYPE_Q40 |
@@ -128,6 +146,10 @@ void mcf_pci_outsl(u32 addr, const u32 *buf, u32 len); | |||
128 | #define ISA_TYPE ISA_TYPE_AG | 146 | #define ISA_TYPE ISA_TYPE_AG |
129 | #define ISA_SEX 1 | 147 | #define ISA_SEX 1 |
130 | #endif | 148 | #endif |
149 | #if defined(CONFIG_ATARI_ROM_ISA) && !defined(MULTI_ISA) | ||
150 | #define ISA_TYPE ISA_TYPE_ENEC | ||
151 | #define ISA_SEX 0 | ||
152 | #endif | ||
131 | 153 | ||
132 | #ifdef MULTI_ISA | 154 | #ifdef MULTI_ISA |
133 | extern int isa_type; | 155 | extern int isa_type; |
@@ -152,6 +174,9 @@ static inline u8 __iomem *isa_itb(unsigned long addr) | |||
152 | #ifdef CONFIG_AMIGA_PCMCIA | 174 | #ifdef CONFIG_AMIGA_PCMCIA |
153 | case ISA_TYPE_AG: return (u8 __iomem *)AG_ISA_IO_B(addr); | 175 | case ISA_TYPE_AG: return (u8 __iomem *)AG_ISA_IO_B(addr); |
154 | #endif | 176 | #endif |
177 | #ifdef CONFIG_ATARI_ROM_ISA | ||
178 | case ISA_TYPE_ENEC: return (u8 __iomem *)ENEC_ISA_IO_B(addr); | ||
179 | #endif | ||
155 | default: return NULL; /* avoid warnings, just in case */ | 180 | default: return NULL; /* avoid warnings, just in case */ |
156 | } | 181 | } |
157 | } | 182 | } |
@@ -165,6 +190,9 @@ static inline u16 __iomem *isa_itw(unsigned long addr) | |||
165 | #ifdef CONFIG_AMIGA_PCMCIA | 190 | #ifdef CONFIG_AMIGA_PCMCIA |
166 | case ISA_TYPE_AG: return (u16 __iomem *)AG_ISA_IO_W(addr); | 191 | case ISA_TYPE_AG: return (u16 __iomem *)AG_ISA_IO_W(addr); |
167 | #endif | 192 | #endif |
193 | #ifdef CONFIG_ATARI_ROM_ISA | ||
194 | case ISA_TYPE_ENEC: return (u16 __iomem *)ENEC_ISA_IO_W(addr); | ||
195 | #endif | ||
168 | default: return NULL; /* avoid warnings, just in case */ | 196 | default: return NULL; /* avoid warnings, just in case */ |
169 | } | 197 | } |
170 | } | 198 | } |
@@ -188,6 +216,9 @@ static inline u8 __iomem *isa_mtb(unsigned long addr) | |||
188 | #ifdef CONFIG_AMIGA_PCMCIA | 216 | #ifdef CONFIG_AMIGA_PCMCIA |
189 | case ISA_TYPE_AG: return (u8 __iomem *)addr; | 217 | case ISA_TYPE_AG: return (u8 __iomem *)addr; |
190 | #endif | 218 | #endif |
219 | #ifdef CONFIG_ATARI_ROM_ISA | ||
220 | case ISA_TYPE_ENEC: return (u8 __iomem *)ENEC_ISA_MEM_B(addr); | ||
221 | #endif | ||
191 | default: return NULL; /* avoid warnings, just in case */ | 222 | default: return NULL; /* avoid warnings, just in case */ |
192 | } | 223 | } |
193 | } | 224 | } |
@@ -201,6 +232,9 @@ static inline u16 __iomem *isa_mtw(unsigned long addr) | |||
201 | #ifdef CONFIG_AMIGA_PCMCIA | 232 | #ifdef CONFIG_AMIGA_PCMCIA |
202 | case ISA_TYPE_AG: return (u16 __iomem *)addr; | 233 | case ISA_TYPE_AG: return (u16 __iomem *)addr; |
203 | #endif | 234 | #endif |
235 | #ifdef CONFIG_ATARI_ROM_ISA | ||
236 | case ISA_TYPE_ENEC: return (u16 __iomem *)ENEC_ISA_MEM_W(addr); | ||
237 | #endif | ||
204 | default: return NULL; /* avoid warnings, just in case */ | 238 | default: return NULL; /* avoid warnings, just in case */ |
205 | } | 239 | } |
206 | } | 240 | } |
@@ -222,6 +256,36 @@ static inline u16 __iomem *isa_mtw(unsigned long addr) | |||
222 | (ISA_SEX ? out_be16(isa_mtw((unsigned long)(p)),(val)) \ | 256 | (ISA_SEX ? out_be16(isa_mtw((unsigned long)(p)),(val)) \ |
223 | : out_le16(isa_mtw((unsigned long)(p)),(val))) | 257 | : out_le16(isa_mtw((unsigned long)(p)),(val))) |
224 | 258 | ||
259 | #ifdef CONFIG_ATARI_ROM_ISA | ||
260 | #define isa_rom_inb(port) rom_in_8(isa_itb(port)) | ||
261 | #define isa_rom_inw(port) \ | ||
262 | (ISA_SEX ? rom_in_be16(isa_itw(port)) \ | ||
263 | : rom_in_le16(isa_itw(port))) | ||
264 | |||
265 | #define isa_rom_outb(val, port) rom_out_8(isa_itb(port), (val)) | ||
266 | #define isa_rom_outw(val, port) \ | ||
267 | (ISA_SEX ? rom_out_be16(isa_itw(port), (val)) \ | ||
268 | : rom_out_le16(isa_itw(port), (val))) | ||
269 | |||
270 | #define isa_rom_readb(p) rom_in_8(isa_mtb((unsigned long)(p))) | ||
271 | #define isa_rom_readw(p) \ | ||
272 | (ISA_SEX ? rom_in_be16(isa_mtw((unsigned long)(p))) \ | ||
273 | : rom_in_le16(isa_mtw((unsigned long)(p)))) | ||
274 | #define isa_rom_readw_swap(p) \ | ||
275 | (ISA_SEX ? rom_in_le16(isa_mtw((unsigned long)(p))) \ | ||
276 | : rom_in_be16(isa_mtw((unsigned long)(p)))) | ||
277 | #define isa_rom_readw_raw(p) rom_in_be16(isa_mtw((unsigned long)(p))) | ||
278 | |||
279 | #define isa_rom_writeb(val, p) rom_out_8(isa_mtb((unsigned long)(p)), (val)) | ||
280 | #define isa_rom_writew(val, p) \ | ||
281 | (ISA_SEX ? rom_out_be16(isa_mtw((unsigned long)(p)), (val)) \ | ||
282 | : rom_out_le16(isa_mtw((unsigned long)(p)), (val))) | ||
283 | #define isa_rom_writew_swap(val, p) \ | ||
284 | (ISA_SEX ? rom_out_le16(isa_mtw((unsigned long)(p)), (val)) \ | ||
285 | : rom_out_be16(isa_mtw((unsigned long)(p)), (val))) | ||
286 | #define isa_rom_writew_raw(val, p) rom_out_be16(isa_mtw((unsigned long)(p)), (val)) | ||
287 | #endif /* CONFIG_ATARI_ROM_ISA */ | ||
288 | |||
225 | static inline void isa_delay(void) | 289 | static inline void isa_delay(void) |
226 | { | 290 | { |
227 | switch(ISA_TYPE) | 291 | switch(ISA_TYPE) |
@@ -232,6 +296,9 @@ static inline void isa_delay(void) | |||
232 | #ifdef CONFIG_AMIGA_PCMCIA | 296 | #ifdef CONFIG_AMIGA_PCMCIA |
233 | case ISA_TYPE_AG: break; | 297 | case ISA_TYPE_AG: break; |
234 | #endif | 298 | #endif |
299 | #ifdef CONFIG_ATARI_ROM_ISA | ||
300 | case ISA_TYPE_ENEC: break; | ||
301 | #endif | ||
235 | default: break; /* avoid warnings */ | 302 | default: break; /* avoid warnings */ |
236 | } | 303 | } |
237 | } | 304 | } |
@@ -263,6 +330,29 @@ static inline void isa_delay(void) | |||
263 | raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) | 330 | raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) |
264 | 331 | ||
265 | 332 | ||
333 | #ifdef CONFIG_ATARI_ROM_ISA | ||
334 | #define isa_rom_inb_p(p) ({ u8 _v = isa_rom_inb(p); isa_delay(); _v; }) | ||
335 | #define isa_rom_inw_p(p) ({ u16 _v = isa_rom_inw(p); isa_delay(); _v; }) | ||
336 | #define isa_rom_outb_p(v, p) ({ isa_rom_outb((v), (p)); isa_delay(); }) | ||
337 | #define isa_rom_outw_p(v, p) ({ isa_rom_outw((v), (p)); isa_delay(); }) | ||
338 | |||
339 | #define isa_rom_insb(port, buf, nr) raw_rom_insb(isa_itb(port), (u8 *)(buf), (nr)) | ||
340 | |||
341 | #define isa_rom_insw(port, buf, nr) \ | ||
342 | (ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) : \ | ||
343 | raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) | ||
344 | |||
345 | #define isa_rom_outsb(port, buf, nr) raw_rom_outsb(isa_itb(port), (u8 *)(buf), (nr)) | ||
346 | |||
347 | #define isa_rom_outsw(port, buf, nr) \ | ||
348 | (ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) : \ | ||
349 | raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) | ||
350 | #endif /* CONFIG_ATARI_ROM_ISA */ | ||
351 | |||
352 | #endif /* CONFIG_ISA || CONFIG_ATARI_ROM_ISA */ | ||
353 | |||
354 | |||
355 | #if defined(CONFIG_ISA) && !defined(CONFIG_ATARI_ROM_ISA) | ||
266 | #define inb isa_inb | 356 | #define inb isa_inb |
267 | #define inb_p isa_inb_p | 357 | #define inb_p isa_inb_p |
268 | #define outb isa_outb | 358 | #define outb isa_outb |
@@ -285,9 +375,43 @@ static inline void isa_delay(void) | |||
285 | #define readw isa_readw | 375 | #define readw isa_readw |
286 | #define writeb isa_writeb | 376 | #define writeb isa_writeb |
287 | #define writew isa_writew | 377 | #define writew isa_writew |
378 | #endif /* CONFIG_ISA && !CONFIG_ATARI_ROM_ISA */ | ||
288 | 379 | ||
289 | #else /* CONFIG_ISA */ | 380 | #ifdef CONFIG_ATARI_ROM_ISA |
290 | 381 | /* | |
382 | * kernel with both ROM port ISA and IDE compiled in, those have | ||
383 | * conflicting defs for in/out. Simply consider port < 1024 | ||
384 | * ROM port ISA and everything else regular ISA for IDE. read,write defined | ||
385 | * below. | ||
386 | */ | ||
387 | #define inb(port) ((port) < 1024 ? isa_rom_inb(port) : in_8(port)) | ||
388 | #define inb_p(port) ((port) < 1024 ? isa_rom_inb_p(port) : in_8(port)) | ||
389 | #define inw(port) ((port) < 1024 ? isa_rom_inw(port) : in_le16(port)) | ||
390 | #define inw_p(port) ((port) < 1024 ? isa_rom_inw_p(port) : in_le16(port)) | ||
391 | #define inl isa_inl | ||
392 | #define inl_p isa_inl_p | ||
393 | |||
394 | #define outb(val, port) ((port) < 1024 ? isa_rom_outb((val), (port)) : out_8((port), (val))) | ||
395 | #define outb_p(val, port) ((port) < 1024 ? isa_rom_outb_p((val), (port)) : out_8((port), (val))) | ||
396 | #define outw(val, port) ((port) < 1024 ? isa_rom_outw((val), (port)) : out_le16((port), (val))) | ||
397 | #define outw_p(val, port) ((port) < 1024 ? isa_rom_outw_p((val), (port)) : out_le16((port), (val))) | ||
398 | #define outl isa_outl | ||
399 | #define outl_p isa_outl_p | ||
400 | |||
401 | #define insb(port, buf, nr) ((port) < 1024 ? isa_rom_insb((port), (buf), (nr)) : isa_insb((port), (buf), (nr))) | ||
402 | #define insw(port, buf, nr) ((port) < 1024 ? isa_rom_insw((port), (buf), (nr)) : isa_insw((port), (buf), (nr))) | ||
403 | #define insl isa_insl | ||
404 | #define outsb(port, buf, nr) ((port) < 1024 ? isa_rom_outsb((port), (buf), (nr)) : isa_outsb((port), (buf), (nr))) | ||
405 | #define outsw(port, buf, nr) ((port) < 1024 ? isa_rom_outsw((port), (buf), (nr)) : isa_outsw((port), (buf), (nr))) | ||
406 | #define outsl isa_outsl | ||
407 | |||
408 | #define readb(addr) in_8(addr) | ||
409 | #define writeb(val, addr) out_8((addr), (val)) | ||
410 | #define readw(addr) in_le16(addr) | ||
411 | #define writew(val, addr) out_le16((addr), (val)) | ||
412 | #endif /* CONFIG_ATARI_ROM_ISA */ | ||
413 | |||
414 | #if !defined(CONFIG_ISA) && !defined(CONFIG_ATARI_ROM_ISA) | ||
291 | /* | 415 | /* |
292 | * We need to define dummy functions for GENERIC_IOMAP support. | 416 | * We need to define dummy functions for GENERIC_IOMAP support. |
293 | */ | 417 | */ |
@@ -319,7 +443,7 @@ static inline void isa_delay(void) | |||
319 | #define readw(addr) in_le16(addr) | 443 | #define readw(addr) in_le16(addr) |
320 | #define writew(val,addr) out_le16((addr),(val)) | 444 | #define writew(val,addr) out_le16((addr),(val)) |
321 | 445 | ||
322 | #endif /* CONFIG_ISA */ | 446 | #endif /* !CONFIG_ISA && !CONFIG_ATARI_ROM_ISA */ |
323 | 447 | ||
324 | #define readl(addr) in_le32(addr) | 448 | #define readl(addr) in_le32(addr) |
325 | #define writel(val,addr) out_le32((addr),(val)) | 449 | #define writel(val,addr) out_le32((addr),(val)) |
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h index c1155f0e22cc..81ca118d58af 100644 --- a/arch/m68k/include/asm/irq.h +++ b/arch/m68k/include/asm/irq.h | |||
@@ -6,12 +6,16 @@ | |||
6 | * different m68k hosts compiled into the kernel. | 6 | * different m68k hosts compiled into the kernel. |
7 | * Currently the Atari has 72 and the Amiga 24, but if both are | 7 | * Currently the Atari has 72 and the Amiga 24, but if both are |
8 | * supported in the kernel it is better to make room for 72. | 8 | * supported in the kernel it is better to make room for 72. |
9 | * With EtherNAT add-on card on Atari, the highest interrupt | ||
10 | * number is 140 so NR_IRQS needs to be 141. | ||
9 | */ | 11 | */ |
10 | #if defined(CONFIG_COLDFIRE) | 12 | #if defined(CONFIG_COLDFIRE) |
11 | #define NR_IRQS 256 | 13 | #define NR_IRQS 256 |
12 | #elif defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X) | 14 | #elif defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X) |
13 | #define NR_IRQS 200 | 15 | #define NR_IRQS 200 |
14 | #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) | 16 | #elif defined(CONFIG_ATARI) |
17 | #define NR_IRQS 141 | ||
18 | #elif defined(CONFIG_MAC) | ||
15 | #define NR_IRQS 72 | 19 | #define NR_IRQS 72 |
16 | #elif defined(CONFIG_Q40) | 20 | #elif defined(CONFIG_Q40) |
17 | #define NR_IRQS 43 | 21 | #define NR_IRQS 43 |
diff --git a/arch/m68k/include/asm/raw_io.h b/arch/m68k/include/asm/raw_io.h index d9eb9834ccc8..932faa35655b 100644 --- a/arch/m68k/include/asm/raw_io.h +++ b/arch/m68k/include/asm/raw_io.h | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #ifdef __KERNEL__ | 11 | #ifdef __KERNEL__ |
12 | 12 | ||
13 | #include <asm/types.h> | 13 | #include <asm/byteorder.h> |
14 | 14 | ||
15 | 15 | ||
16 | /* Values for nocacheflag and cmode */ | 16 | /* Values for nocacheflag and cmode */ |
@@ -60,6 +60,57 @@ extern void __iounmap(void *addr, unsigned long size); | |||
60 | #define __raw_writew(val,addr) out_be16((addr),(val)) | 60 | #define __raw_writew(val,addr) out_be16((addr),(val)) |
61 | #define __raw_writel(val,addr) out_be32((addr),(val)) | 61 | #define __raw_writel(val,addr) out_be32((addr),(val)) |
62 | 62 | ||
63 | /* | ||
64 | * Atari ROM port (cartridge port) ISA adapter, used for the EtherNEC NE2000 | ||
65 | * network card driver. | ||
66 | * The ISA adapter connects address lines A9-A13 to ISA address lines A0-A4, | ||
67 | * and hardwires the rest of the ISA addresses for a base address of 0x300. | ||
68 | * | ||
69 | * Data lines D8-D15 are connected to ISA data lines D0-D7 for reading. | ||
70 | * For writes, address lines A1-A8 are latched to ISA data lines D0-D7 | ||
71 | * (meaning the bit pattern on A1-A8 can be read back as byte). | ||
72 | * | ||
73 | * Read and write operations are distinguished by the base address used: | ||
74 | * reads are from the ROM A side range, writes are through the B side range | ||
75 | * addresses (A side base + 0x10000). | ||
76 | * | ||
77 | * Reads and writes are byte only. | ||
78 | * | ||
79 | * 16 bit reads and writes are necessary for the NetUSBee adapter's USB | ||
80 | * chipset - 16 bit words are read straight off the ROM port while 16 bit | ||
81 | * reads are split into two byte writes. The low byte is latched to the | ||
82 | * NetUSBee buffer by a read from the _read_ window (with the data pattern | ||
83 | * asserted as A1-A8 address pattern). The high byte is then written to the | ||
84 | * write range as usual, completing the write cycle. | ||
85 | */ | ||
86 | |||
87 | #if defined(CONFIG_ATARI_ROM_ISA) | ||
88 | #define rom_in_8(addr) \ | ||
89 | ({ u16 __v = (*(__force volatile u16 *) (addr)); __v >>= 8; __v; }) | ||
90 | #define rom_in_be16(addr) \ | ||
91 | ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) | ||
92 | #define rom_in_le16(addr) \ | ||
93 | ({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; }) | ||
94 | |||
95 | #define rom_out_8(addr, b) \ | ||
96 | ({u8 __w, __v = (b); u32 _addr = ((u32) (addr)); \ | ||
97 | __w = ((*(__force volatile u8 *) ((_addr | 0x10000) + (__v<<1)))); }) | ||
98 | #define rom_out_be16(addr, w) \ | ||
99 | ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \ | ||
100 | __w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v & 0xFF)<<1)))); \ | ||
101 | __w = ((*(__force volatile u16 *) ((_addr | 0x10000) + ((__v >> 8)<<1)))); }) | ||
102 | #define rom_out_le16(addr, w) \ | ||
103 | ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \ | ||
104 | __w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v >> 8)<<1)))); \ | ||
105 | __w = ((*(__force volatile u16 *) ((_addr | 0x10000) + ((__v & 0xFF)<<1)))); }) | ||
106 | |||
107 | #define raw_rom_inb rom_in_8 | ||
108 | #define raw_rom_inw rom_in_be16 | ||
109 | |||
110 | #define raw_rom_outb(val, port) rom_out_8((port), (val)) | ||
111 | #define raw_rom_outw(val, port) rom_out_be16((port), (val)) | ||
112 | #endif /* CONFIG_ATARI_ROM_ISA */ | ||
113 | |||
63 | static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) | 114 | static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) |
64 | { | 115 | { |
65 | unsigned int i; | 116 | unsigned int i; |
@@ -342,6 +393,62 @@ static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, | |||
342 | : "d0", "a0", "a1", "d6"); | 393 | : "d0", "a0", "a1", "d6"); |
343 | } | 394 | } |
344 | 395 | ||
396 | |||
397 | #if defined(CONFIG_ATARI_ROM_ISA) | ||
398 | static inline void raw_rom_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) | ||
399 | { | ||
400 | unsigned int i; | ||
401 | |||
402 | for (i = 0; i < len; i++) | ||
403 | *buf++ = rom_in_8(port); | ||
404 | } | ||
405 | |||
406 | static inline void raw_rom_outsb(volatile u8 __iomem *port, const u8 *buf, | ||
407 | unsigned int len) | ||
408 | { | ||
409 | unsigned int i; | ||
410 | |||
411 | for (i = 0; i < len; i++) | ||
412 | rom_out_8(port, *buf++); | ||
413 | } | ||
414 | |||
415 | static inline void raw_rom_insw(volatile u16 __iomem *port, u16 *buf, | ||
416 | unsigned int nr) | ||
417 | { | ||
418 | unsigned int i; | ||
419 | |||
420 | for (i = 0; i < nr; i++) | ||
421 | *buf++ = rom_in_be16(port); | ||
422 | } | ||
423 | |||
424 | static inline void raw_rom_outsw(volatile u16 __iomem *port, const u16 *buf, | ||
425 | unsigned int nr) | ||
426 | { | ||
427 | unsigned int i; | ||
428 | |||
429 | for (i = 0; i < nr; i++) | ||
430 | rom_out_be16(port, *buf++); | ||
431 | } | ||
432 | |||
433 | static inline void raw_rom_insw_swapw(volatile u16 __iomem *port, u16 *buf, | ||
434 | unsigned int nr) | ||
435 | { | ||
436 | unsigned int i; | ||
437 | |||
438 | for (i = 0; i < nr; i++) | ||
439 | *buf++ = rom_in_le16(port); | ||
440 | } | ||
441 | |||
442 | static inline void raw_rom_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, | ||
443 | unsigned int nr) | ||
444 | { | ||
445 | unsigned int i; | ||
446 | |||
447 | for (i = 0; i < nr; i++) | ||
448 | rom_out_le16(port, *buf++); | ||
449 | } | ||
450 | #endif /* CONFIG_ATARI_ROM_ISA */ | ||
451 | |||
345 | #endif /* __KERNEL__ */ | 452 | #endif /* __KERNEL__ */ |
346 | 453 | ||
347 | #endif /* _RAW_IO_H */ | 454 | #endif /* _RAW_IO_H */ |
diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h index 32198454da70..9aea9f11fa25 100644 --- a/arch/m68k/include/asm/string.h +++ b/arch/m68k/include/asm/string.h | |||
@@ -4,15 +4,6 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/compiler.h> | 5 | #include <linux/compiler.h> |
6 | 6 | ||
7 | static inline size_t __kernel_strlen(const char *s) | ||
8 | { | ||
9 | const char *sc; | ||
10 | |||
11 | for (sc = s; *sc++; ) | ||
12 | ; | ||
13 | return sc - s - 1; | ||
14 | } | ||
15 | |||
16 | static inline char *__kernel_strcpy(char *dest, const char *src) | 7 | static inline char *__kernel_strcpy(char *dest, const char *src) |
17 | { | 8 | { |
18 | char *xdest = dest; | 9 | char *xdest = dest; |
@@ -27,11 +18,6 @@ static inline char *__kernel_strcpy(char *dest, const char *src) | |||
27 | 18 | ||
28 | #ifndef __IN_STRING_C | 19 | #ifndef __IN_STRING_C |
29 | 20 | ||
30 | #define __HAVE_ARCH_STRLEN | ||
31 | #define strlen(s) (__builtin_constant_p(s) ? \ | ||
32 | __builtin_strlen(s) : \ | ||
33 | __kernel_strlen(s)) | ||
34 | |||
35 | #define __HAVE_ARCH_STRNLEN | 21 | #define __HAVE_ARCH_STRNLEN |
36 | static inline size_t strnlen(const char *s, size_t count) | 22 | static inline size_t strnlen(const char *s, size_t count) |
37 | { | 23 | { |
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index 80cfbe56ea32..e67e53159573 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c | |||
@@ -381,6 +381,12 @@ void __init setup_arch(char **cmdline_p) | |||
381 | isa_sex = 1; | 381 | isa_sex = 1; |
382 | } | 382 | } |
383 | #endif | 383 | #endif |
384 | #ifdef CONFIG_ATARI_ROM_ISA | ||
385 | if (MACH_IS_ATARI) { | ||
386 | isa_type = ISA_TYPE_ENEC; | ||
387 | isa_sex = 0; | ||
388 | } | ||
389 | #endif | ||
384 | #endif | 390 | #endif |
385 | } | 391 | } |
386 | 392 | ||
diff --git a/arch/m68k/lib/string.c b/arch/m68k/lib/string.c index b9a57abfad08..4d61fa8a112c 100644 --- a/arch/m68k/lib/string.c +++ b/arch/m68k/lib/string.c | |||
@@ -17,6 +17,6 @@ EXPORT_SYMBOL(strcpy); | |||
17 | 17 | ||
18 | char *strcat(char *dest, const char *src) | 18 | char *strcat(char *dest, const char *src) |
19 | { | 19 | { |
20 | return __kernel_strcpy(dest + __kernel_strlen(dest), src); | 20 | return __kernel_strcpy(dest + strlen(dest), src); |
21 | } | 21 | } |
22 | EXPORT_SYMBOL(strcat); | 22 | EXPORT_SYMBOL(strcat); |