diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2007-02-15 04:20:52 -0500 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2007-02-15 04:20:52 -0500 |
| commit | 9c57548f17806ffd8e4dc4f7973ce78bbfbc2079 (patch) | |
| tree | b42b80e40e1f84fcea23ceb76fa697022df6ed9b | |
| parent | e65fa9f59e9230b72ac298d445b4a18a4eefeb34 (diff) | |
sh: rts7751r2d board updates.
This tidies up some of the rts7751r2d mess and gets it booting
again. Update the defconfig, too.
Signed-off-by: Masayuki Hosokawa <hosokawa@ace-jp.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| -rw-r--r-- | arch/sh/boards/renesas/rts7751r2d/Makefile | 2 | ||||
| -rw-r--r-- | arch/sh/boards/renesas/rts7751r2d/io.c | 302 | ||||
| -rw-r--r-- | arch/sh/boards/renesas/rts7751r2d/irq.c | 80 | ||||
| -rw-r--r-- | arch/sh/boards/renesas/rts7751r2d/setup.c | 123 | ||||
| -rw-r--r-- | arch/sh/cchips/voyagergx/irq.c | 70 | ||||
| -rw-r--r-- | arch/sh/cchips/voyagergx/setup.c | 4 | ||||
| -rw-r--r-- | arch/sh/configs/rts7751r2d_defconfig | 308 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4/setup-sh7750.c | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/io_generic.c | 12 | ||||
| -rw-r--r-- | include/asm-sh/rts7751r2d.h | 4 | ||||
| -rw-r--r-- | include/asm-sh/serial.h | 5 | ||||
| -rw-r--r-- | include/asm-sh/voyagergx.h | 5 |
12 files changed, 395 insertions, 522 deletions
diff --git a/arch/sh/boards/renesas/rts7751r2d/Makefile b/arch/sh/boards/renesas/rts7751r2d/Makefile index 833de1eac0e8..0d4c75a72be0 100644 --- a/arch/sh/boards/renesas/rts7751r2d/Makefile +++ b/arch/sh/boards/renesas/rts7751r2d/Makefile | |||
| @@ -2,4 +2,4 @@ | |||
| 2 | # Makefile for the RTS7751R2D specific parts of the kernel | 2 | # Makefile for the RTS7751R2D specific parts of the kernel |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := setup.o io.o irq.o | 5 | obj-y := setup.o irq.o |
diff --git a/arch/sh/boards/renesas/rts7751r2d/io.c b/arch/sh/boards/renesas/rts7751r2d/io.c deleted file mode 100644 index f2507a804979..000000000000 --- a/arch/sh/boards/renesas/rts7751r2d/io.c +++ /dev/null | |||
| @@ -1,302 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2001 Ian da Silva, Jeremy Siegel | ||
| 3 | * Based largely on io_se.c. | ||
| 4 | * | ||
| 5 | * I/O routine for Renesas Technology sales RTS7751R2D. | ||
| 6 | * | ||
| 7 | * Initial version only to support LAN access; some | ||
| 8 | * placeholder code from io_rts7751r2d.c left in with the | ||
| 9 | * expectation of later SuperIO and PCMCIA access. | ||
| 10 | */ | ||
| 11 | #include <linux/kernel.h> | ||
| 12 | #include <linux/types.h> | ||
| 13 | #include <linux/pci.h> | ||
| 14 | #include <linux/io.h> | ||
| 15 | #include <asm/rts7751r2d.h> | ||
| 16 | #include <asm/addrspace.h> | ||
| 17 | |||
| 18 | /* | ||
| 19 | * The 7751R RTS7751R2D uses the built-in PCI controller (PCIC) | ||
| 20 | * of the 7751R processor, and has a SuperIO accessible via the PCI. | ||
| 21 | * The board also includes a PCMCIA controller on its memory bus, | ||
| 22 | * like the other Solution Engine boards. | ||
| 23 | */ | ||
| 24 | |||
| 25 | static inline unsigned long port2adr(unsigned int port) | ||
| 26 | { | ||
| 27 | if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6) | ||
| 28 | if (port == 0x3f6) | ||
| 29 | return (PA_AREA5_IO + 0x80c); | ||
| 30 | else | ||
| 31 | return (PA_AREA5_IO + 0x1000 + ((port-0x1f0) << 1)); | ||
| 32 | else | ||
| 33 | maybebadio((unsigned long)port); | ||
| 34 | |||
| 35 | return port; | ||
| 36 | } | ||
| 37 | |||
| 38 | static inline unsigned long port88796l(unsigned int port, int flag) | ||
| 39 | { | ||
| 40 | unsigned long addr; | ||
| 41 | |||
| 42 | if (flag) | ||
| 43 | addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1); | ||
| 44 | else | ||
| 45 | addr = PA_AX88796L + ((port - AX88796L_IO_BASE) << 1) + 0x1000; | ||
| 46 | |||
| 47 | return addr; | ||
| 48 | } | ||
| 49 | |||
| 50 | /* The 7751R RTS7751R2D seems to have everything hooked */ | ||
| 51 | /* up pretty normally (nothing on high-bytes only...) so this */ | ||
| 52 | /* shouldn't be needed */ | ||
| 53 | static inline int shifted_port(unsigned long port) | ||
| 54 | { | ||
| 55 | /* For IDE registers, value is not shifted */ | ||
| 56 | if ((0x1f0 <= port && port < 0x1f8) || port == 0x3f6) | ||
| 57 | return 0; | ||
| 58 | else | ||
| 59 | return 1; | ||
| 60 | } | ||
| 61 | |||
| 62 | #if defined(CONFIG_NE2000) || defined(CONFIG_NE2000_MODULE) | ||
| 63 | #define CHECK_AX88796L_PORT(port) \ | ||
| 64 | ((port >= AX88796L_IO_BASE) && (port < (AX88796L_IO_BASE+0x20))) | ||
| 65 | #else | ||
| 66 | #define CHECK_AX88796L_PORT(port) (0) | ||
| 67 | #endif | ||
| 68 | |||
| 69 | /* | ||
| 70 | * General outline: remap really low stuff [eventually] to SuperIO, | ||
| 71 | * stuff in PCI IO space (at or above window at pci.h:PCIBIOS_MIN_IO) | ||
| 72 | * is mapped through the PCI IO window. Stuff with high bits (PXSEG) | ||
| 73 | * should be way beyond the window, and is used w/o translation for | ||
| 74 | * compatibility. | ||
| 75 | */ | ||
| 76 | unsigned char rts7751r2d_inb(unsigned long port) | ||
| 77 | { | ||
| 78 | if (CHECK_AX88796L_PORT(port)) | ||
| 79 | return (*(volatile unsigned short *)port88796l(port, 0)) & 0xff; | ||
| 80 | else if (PXSEG(port)) | ||
| 81 | return *(volatile unsigned char *)port; | ||
| 82 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
| 83 | return *(volatile unsigned char *)pci_ioaddr(port); | ||
| 84 | else | ||
| 85 | return (*(volatile unsigned short *)port2adr(port) & 0xff); | ||
| 86 | } | ||
| 87 | |||
| 88 | unsigned char rts7751r2d_inb_p(unsigned long port) | ||
| 89 | { | ||
| 90 | unsigned char v; | ||
| 91 | |||
| 92 | if (CHECK_AX88796L_PORT(port)) | ||
| 93 | v = (*(volatile unsigned short *)port88796l(port, 0)) & 0xff; | ||
| 94 | else if (PXSEG(port)) | ||
| 95 | v = *(volatile unsigned char *)port; | ||
| 96 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
| 97 | v = *(volatile unsigned char *)pci_ioaddr(port); | ||
| 98 | else | ||
| 99 | v = (*(volatile unsigned short *)port2adr(port) & 0xff); | ||
| 100 | |||
| 101 | ctrl_delay(); | ||
| 102 | |||
| 103 | return v; | ||
| 104 | } | ||
| 105 | |||
| 106 | unsigned short rts7751r2d_inw(unsigned long port) | ||
| 107 | { | ||
| 108 | if (CHECK_AX88796L_PORT(port)) | ||
| 109 | maybebadio(port); | ||
| 110 | else if (PXSEG(port)) | ||
| 111 | return *(volatile unsigned short *)port; | ||
| 112 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
| 113 | return *(volatile unsigned short *)pci_ioaddr(port); | ||
| 114 | else | ||
| 115 | maybebadio(port); | ||
| 116 | |||
| 117 | return 0; | ||
| 118 | } | ||
| 119 | |||
| 120 | unsigned int rts7751r2d_inl(unsigned long port) | ||
| 121 | { | ||
| 122 | if (CHECK_AX88796L_PORT(port)) | ||
| 123 | maybebadio(port); | ||
| 124 | else if (PXSEG(port)) | ||
| 125 | return *(volatile unsigned long *)port; | ||
| 126 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
| 127 | return *(volatile unsigned long *)pci_ioaddr(port); | ||
| 128 | else | ||
| 129 | maybebadio(port); | ||
| 130 | |||
| 131 | return 0; | ||
| 132 | } | ||
| 133 | |||
| 134 | void rts7751r2d_outb(unsigned char value, unsigned long port) | ||
| 135 | { | ||
| 136 | if (CHECK_AX88796L_PORT(port)) | ||
| 137 | *((volatile unsigned short *)port88796l(port, 0)) = value; | ||
| 138 | else if (PXSEG(port)) | ||
| 139 | *(volatile unsigned char *)port = value; | ||
| 140 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
| 141 | *(volatile unsigned char *)pci_ioaddr(port) = value; | ||
| 142 | else | ||
| 143 | *(volatile unsigned short *)port2adr(port) = value; | ||
| 144 | } | ||
| 145 | |||
| 146 | void rts7751r2d_outb_p(unsigned char value, unsigned long port) | ||
| 147 | { | ||
| 148 | if (CHECK_AX88796L_PORT(port)) | ||
| 149 | *((volatile unsigned short *)port88796l(port, 0)) = value; | ||
| 150 | else if (PXSEG(port)) | ||
| 151 | *(volatile unsigned char *)port = value; | ||
| 152 | else if (is_pci_ioaddr(port) || shifted_port(port)) | ||
| 153 | *(volatile unsigned char *)pci_ioaddr(port) = value; | ||
| 154 | else | ||
| 155 | *(volatile unsigned short *)port2adr(port) = value; | ||
| 156 | |||
| 157 | ctrl_delay(); | ||
| 158 | } | ||
| 159 | |||
| 160 | void rts7751r2d_outw(unsigned short value, unsigned long port) | ||
| 161 | { | ||
| 162 | if (CHECK_AX88796L_PORT(port)) | ||
| 163 | maybebadio(port); | ||
| 164 | else if (PXSEG(port)) | ||
