blob: a3354c1f3d70ea4944b8457f88a4018e23875186 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Setup pointers to hardware-dependent routines.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle
9 * Copyright (C) 2001 MIPS Technologies, Inc.
10 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <linux/eisa.h>
12#include <linux/hdreg.h>
13#include <linux/init.h>
14#include <linux/ioport.h>
15#include <linux/sched.h>
16#include <linux/interrupt.h>
17#include <linux/mm.h>
18#include <linux/console.h>
19#include <linux/fb.h>
20#include <linux/ide.h>
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000021#include <linux/pm.h>
Ralf Baechle06e80112006-10-08 19:35:00 +010022#include <linux/screen_info.h>
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000023
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#include <asm/bootinfo.h>
25#include <asm/irq.h>
26#include <asm/jazz.h>
27#include <asm/jazzdma.h>
28#include <asm/ptrace.h>
29#include <asm/reboot.h>
30#include <asm/io.h>
31#include <asm/pgtable.h>
32#include <asm/time.h>
33#include <asm/traps.h>
34
35extern asmlinkage void jazz_handle_int(void);
36
37extern void jazz_machine_restart(char *command);
38extern void jazz_machine_halt(void);
39extern void jazz_machine_power_off(void);
40
Ralf Baechle54d0a212006-07-09 21:38:56 +010041void __init plat_time_init(struct irqaction *irq)
Linus Torvalds1da177e2005-04-16 15:20:36 -070042{
43 /* set the clock to 100 Hz */
44 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
45 setup_irq(JAZZ_TIMER_IRQ, irq);
46}
47
48static struct resource jazz_io_resources[] = {
Ralf Baechle2cf69e72006-10-08 19:19:11 +010049 {
50 .start = 0x00,
51 .end = 0x1f,
52 .name = "dma1",
53 .flags = IORESOURCE_BUSY
54 }, {
55 .start = 0x40,
56 .end = 0x5f,
57 .name = "timer",
58 .end = IORESOURCE_BUSY
59 }, {
60 .start = 0x80,
61 .end = 0x8f,
62 .name = "dma page reg",
63 .flags = IORESOURCE_BUSY
64 }, {
65 .start = 0xc0,
66 .end = 0xdf,
67 .name = "dma2",
68 .flags = IORESOURCE_BUSY
69 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070070};
71
Ralf Baechle2925aba2006-06-18 01:32:22 +010072void __init plat_mem_setup(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070073{
74 int i;
75
76 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
77 add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K);
78
79 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
80 add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M);
81
82 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
83 add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M);
84
85 set_io_port_base(JAZZ_PORT_BASE);
86#ifdef CONFIG_EISA
87 if (mips_machtype == MACH_MIPS_MAGNUM_4000)
88 EISA_bus = 1;
89#endif
90 isa_slot_offset = 0xe3000000;
91
92 /* request I/O space for devices used on all i[345]86 PCs */
93 for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++)
94 request_resource(&ioport_resource, jazz_io_resources + i);
95
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 /* The RTC is outside the port address space */
97
98 _machine_restart = jazz_machine_restart;
99 _machine_halt = jazz_machine_halt;
Ralf Baechlefcdb27a2006-01-18 17:37:07 +0000100 pm_power_off = jazz_machine_power_off;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 screen_info = (struct screen_info) {
103 0, 0, /* orig-x, orig-y */
104 0, /* unused */
105 0, /* orig_video_page */
106 0, /* orig_video_mode */
107 160, /* orig_video_cols */
108 0, 0, 0, /* unused, ega_bx, unused */
109 64, /* orig_video_lines */
110 0, /* orig_video_isVGA */
111 16 /* orig_video_points */
112 };
113
114 vdma_init();
115}