Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #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 Baechle | fcdb27a | 2006-01-18 17:37:07 +0000 | [diff] [blame] | 21 | #include <linux/pm.h> |
Ralf Baechle | 06e8011 | 2006-10-08 19:35:00 +0100 | [diff] [blame] | 22 | #include <linux/screen_info.h> |
Ralf Baechle | fcdb27a | 2006-01-18 17:37:07 +0000 | [diff] [blame] | 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #include <asm/bootinfo.h> |
| 25 | #include <asm/irq.h> |
| 26 | #include <asm/jazz.h> |
| 27 | #include <asm/jazzdma.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | #include <asm/reboot.h> |
| 29 | #include <asm/io.h> |
| 30 | #include <asm/pgtable.h> |
| 31 | #include <asm/time.h> |
| 32 | #include <asm/traps.h> |
| 33 | |
| 34 | extern asmlinkage void jazz_handle_int(void); |
| 35 | |
| 36 | extern void jazz_machine_restart(char *command); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Yoichi Yuasa | ea57428 | 2006-10-10 16:56:11 +0900 | [diff] [blame] | 38 | void __init plat_timer_setup(struct irqaction *irq) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | { |
| 40 | /* set the clock to 100 Hz */ |
| 41 | r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9); |
| 42 | setup_irq(JAZZ_TIMER_IRQ, irq); |
| 43 | } |
| 44 | |
| 45 | static struct resource jazz_io_resources[] = { |
Ralf Baechle | 2cf69e7 | 2006-10-08 19:19:11 +0100 | [diff] [blame] | 46 | { |
| 47 | .start = 0x00, |
| 48 | .end = 0x1f, |
| 49 | .name = "dma1", |
| 50 | .flags = IORESOURCE_BUSY |
| 51 | }, { |
| 52 | .start = 0x40, |
| 53 | .end = 0x5f, |
| 54 | .name = "timer", |
Alexey Dobriyan | 5da44ad | 2007-06-27 14:10:06 -0700 | [diff] [blame] | 55 | .flags = IORESOURCE_BUSY |
Ralf Baechle | 2cf69e7 | 2006-10-08 19:19:11 +0100 | [diff] [blame] | 56 | }, { |
| 57 | .start = 0x80, |
| 58 | .end = 0x8f, |
| 59 | .name = "dma page reg", |
| 60 | .flags = IORESOURCE_BUSY |
| 61 | }, { |
| 62 | .start = 0xc0, |
| 63 | .end = 0xdf, |
| 64 | .name = "dma2", |
| 65 | .flags = IORESOURCE_BUSY |
| 66 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | }; |
| 68 | |
Ralf Baechle | 2925aba | 2006-06-18 01:32:22 +0100 | [diff] [blame] | 69 | void __init plat_mem_setup(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | { |
| 71 | int i; |
| 72 | |
| 73 | /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */ |
| 74 | add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K); |
| 75 | |
| 76 | /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */ |
| 77 | add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M); |
| 78 | |
| 79 | /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */ |
| 80 | add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M); |
| 81 | |
| 82 | set_io_port_base(JAZZ_PORT_BASE); |
| 83 | #ifdef CONFIG_EISA |
| 84 | if (mips_machtype == MACH_MIPS_MAGNUM_4000) |
| 85 | EISA_bus = 1; |
| 86 | #endif |
| 87 | isa_slot_offset = 0xe3000000; |
| 88 | |
| 89 | /* request I/O space for devices used on all i[345]86 PCs */ |
| 90 | for (i = 0; i < ARRAY_SIZE(jazz_io_resources); i++) |
| 91 | request_resource(&ioport_resource, jazz_io_resources + i); |
| 92 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | /* The RTC is outside the port address space */ |
| 94 | |
| 95 | _machine_restart = jazz_machine_restart; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | screen_info = (struct screen_info) { |
| 98 | 0, 0, /* orig-x, orig-y */ |
| 99 | 0, /* unused */ |
| 100 | 0, /* orig_video_page */ |
| 101 | 0, /* orig_video_mode */ |
| 102 | 160, /* orig_video_cols */ |
| 103 | 0, 0, 0, /* unused, ega_bx, unused */ |
| 104 | 64, /* orig_video_lines */ |
| 105 | 0, /* orig_video_isVGA */ |
| 106 | 16 /* orig_video_points */ |
| 107 | }; |
| 108 | |
| 109 | vdma_init(); |
| 110 | } |