diff options
Diffstat (limited to 'arch/m68k/q40')
-rw-r--r-- | arch/m68k/q40/README | 5 | ||||
-rw-r--r-- | arch/m68k/q40/config.c | 62 | ||||
-rw-r--r-- | arch/m68k/q40/q40.h | 6 | ||||
-rw-r--r-- | arch/m68k/q40/q40ints.c | 20 |
4 files changed, 54 insertions, 39 deletions
diff --git a/arch/m68k/q40/README b/arch/m68k/q40/README index a4991d2d8af6..9760e9081f6f 100644 --- a/arch/m68k/q40/README +++ b/arch/m68k/q40/README @@ -30,11 +30,10 @@ drivers used by the Q40, apart from the very obvious (console etc.): genrtc.c # RTC char/joystick/* # most of this should work, not # in default config.in - block/q40ide.c # startup for ide - ide* # see Documentation/ide/ide.rst - floppy.c # normal PC driver, DMA emu in asm/floppy.h + block/floppy.c # normal PC driver, DMA emu in asm/floppy.h # and arch/m68k/kernel/entry.S # see drivers/block/README.fd + ata/pata_falcon.c net/ne.c video/q40fb.c parport/* diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index f31890078197..de7870ad2a30 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * arch/m68k/q40/config.c * @@ -6,10 +7,6 @@ * originally based on: * * linux/bvme/config.c - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file README.legal in the main directory of this archive - * for more details. */ #include <linux/errno.h> @@ -29,24 +26,21 @@ #include <asm/io.h> #include <asm/bootinfo.h> -#include <asm/pgtable.h> #include <asm/setup.h> #include <asm/irq.h> #include <asm/traps.h> #include <asm/machdep.h> #include <asm/q40_master.h> +#include <asm/config.h> + +#include "q40.h" -extern void q40_init_IRQ(void); static void q40_get_model(char *model); -extern void q40_sched_init(irq_handler_t handler); static int q40_hwclk(int, struct rtc_time *); -static unsigned int q40_get_ss(void); static int q40_get_rtc_pll(struct rtc_pll_info *pll); static int q40_set_rtc_pll(struct rtc_pll_info *pll); -extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/); - static void q40_mem_console_write(struct console *co, const char *b, unsigned int count); @@ -169,7 +163,6 @@ void __init config_q40(void) mach_init_IRQ = q40_init_IRQ; mach_hwclk = q40_hwclk; - mach_get_ss = q40_get_ss; mach_get_rtc_pll = q40_get_rtc_pll; mach_set_rtc_pll = q40_set_rtc_pll; @@ -186,11 +179,6 @@ void __init config_q40(void) /* disable a few things that SMSQ might have left enabled */ q40_disable_irqs(); - - /* no DMA at all, but ide-scsi requires it.. make sure - * all physical RAM fits into the boundary - otherwise - * allocator may play costly and useless tricks */ - mach_max_dma_address = 1024*1024*1024; } @@ -251,11 +239,6 @@ static int q40_hwclk(int op, struct rtc_time *t) return 0; } -static unsigned int q40_get_ss(void) -{ - return bcd2bin(Q40_RTC_SECS); -} - /* get and set PLL calibration of RTC clock */ #define Q40_RTC_PLL_MASK ((1<<5)-1) #define Q40_RTC_PLL_SIGN (1<<5) @@ -292,14 +275,39 @@ static int q40_set_rtc_pll(struct rtc_pll_info *pll) return -EINVAL; } -static __init int q40_add_kbd_device(void) -{ - struct platform_device *pdev; +#define PCIDE_BASE1 0x1f0 +#define PCIDE_BASE2 0x170 +#define PCIDE_CTL 0x206 +static const struct resource q40_pata_rsrc_0[] __initconst = { + DEFINE_RES_MEM(q40_isa_io_base + PCIDE_BASE1 * 4, 0x38), + DEFINE_RES_MEM(q40_isa_io_base + (PCIDE_BASE1 + PCIDE_CTL) * 4, 2), + DEFINE_RES_IO(PCIDE_BASE1, 8), + DEFINE_RES_IO(PCIDE_BASE1 + PCIDE_CTL, 1), + DEFINE_RES_IRQ(14), +}; + +static const struct resource q40_pata_rsrc_1[] __initconst = { + DEFINE_RES_MEM(q40_isa_io_base + PCIDE_BASE2 * 4, 0x38), + DEFINE_RES_MEM(q40_isa_io_base + (PCIDE_BASE2 + PCIDE_CTL) * 4, 2), + DEFINE_RES_IO(PCIDE_BASE2, 8), + DEFINE_RES_IO(PCIDE_BASE2 + PCIDE_CTL, 1), + DEFINE_RES_IRQ(15), +}; + +static __init int q40_platform_init(void) +{ if (!MACH_IS_Q40) return -ENODEV; - pdev = platform_device_register_simple("q40kbd", -1, NULL, 0); - return PTR_ERR_OR_ZERO(pdev); + platform_device_register_simple("q40kbd", -1, NULL, 0); + + platform_device_register_simple("atari-falcon-ide", 0, q40_pata_rsrc_0, + ARRAY_SIZE(q40_pata_rsrc_0)); + + platform_device_register_simple("atari-falcon-ide", 1, q40_pata_rsrc_1, + ARRAY_SIZE(q40_pata_rsrc_1)); + + return 0; } -arch_initcall(q40_add_kbd_device); +arch_initcall(q40_platform_init); diff --git a/arch/m68k/q40/q40.h b/arch/m68k/q40/q40.h new file mode 100644 index 000000000000..3146679bde0d --- /dev/null +++ b/arch/m68k/q40/q40.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* q40ints.c */ +void q40_init_IRQ(void); +void q40_mksound(unsigned int hz, unsigned int ticks); +void q40_sched_init(void); diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c index 1c696906c159..14b774b9d308 100644 --- a/arch/m68k/q40/q40ints.c +++ b/arch/m68k/q40/q40ints.c @@ -17,12 +17,15 @@ #include <linux/interrupt.h> #include <linux/irq.h> +#include <asm/machdep.h> #include <asm/ptrace.h> #include <asm/traps.h> #include <asm/q40_master.h> #include <asm/q40ints.h> +#include "q40.h" + /* * Q40 IRQs are defined as follows: * 3,4,5,6,7,10,11,14,15 : ISA dev IRQs @@ -31,7 +34,7 @@ * 33 : frame int (50/200 Hz periodic timer) * 34 : sample int (10/20 KHz periodic timer) * -*/ + */ static void q40_irq_handler(unsigned int, struct pt_regs *fp); static void q40_irq_enable(struct irq_data *data); @@ -103,7 +106,7 @@ void __init q40_init_IRQ(void) * this stuff doesn't really belong here.. */ -int ql_ticks; /* 200Hz ticks since last jiffie */ +int ql_ticks; /* 200Hz ticks since last jiffy */ static int sound_ticks; #define SVOL 45 @@ -129,8 +132,6 @@ void q40_mksound(unsigned int hz, unsigned int ticks) static irqreturn_t q40_timer_int(int irq, void *dev_id) { - irq_handler_t timer_routine = dev_id; - ql_ticks = ql_ticks ? 0 : 1; if (sound_ticks) { unsigned char sval=(sound_ticks & 1) ? 128-SVOL : 128+SVOL; @@ -143,19 +144,20 @@ static irqreturn_t q40_timer_int(int irq, void *dev_id) unsigned long flags; local_irq_save(flags); - timer_routine(0, NULL); + legacy_timer_tick(1); + timer_heartbeat(); local_irq_restore(flags); } return IRQ_HANDLED; } -void q40_sched_init (irq_handler_t timer_routine) +void q40_sched_init (void) { int timer_irq; timer_irq = Q40_IRQ_FRAME; - if (request_irq(timer_irq, q40_timer_int, 0, "timer", timer_routine)) + if (request_irq(timer_irq, q40_timer_int, 0, "timer", NULL)) panic("Couldn't register timer int"); master_outb(-1, FRAME_CLEAR_REG); @@ -201,8 +203,8 @@ static int ccleirq=60; /* ISA dev IRQs*/ #define DEBUG_Q40INT /*#define IP_USE_DISABLE *//* would be nice, but crashes ???? */ -static int mext_disabled=0; /* ext irq disabled by master chip? */ -static int aliased_irq=0; /* how many times inside handler ?*/ +static int mext_disabled; /* ext irq disabled by master chip? */ +static int aliased_irq; /* how many times inside handler ?*/ /* got interrupt, dispatch to ISA or keyboard/timer IRQs */ |