wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
Wolfgang Denk | 67ffef3 | 2006-05-12 16:15:46 +0200 | [diff] [blame] | 2 | * (C) Copyright 2000-2006 |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | * |
| 23 | ******************************************************************** |
| 24 | * |
| 25 | * Lots of code copied from: |
| 26 | * |
| 27 | * m8xx_pcmcia.c - Linux PCMCIA socket driver for the mpc8xx series. |
| 28 | * (C) 1999-2000 Magnus Damm <damm@bitsmart.com> |
| 29 | * |
| 30 | * "The ExCA standard specifies that socket controllers should provide |
| 31 | * two IO and five memory windows per socket, which can be independently |
| 32 | * configured and positioned in the host address space and mapped to |
| 33 | * arbitrary segments of card address space. " - David A Hinds. 1999 |
| 34 | * |
| 35 | * This controller does _not_ meet the ExCA standard. |
| 36 | * |
| 37 | * m8xx pcmcia controller brief info: |
| 38 | * + 8 windows (attrib, mem, i/o) |
| 39 | * + up to two slots (SLOT_A and SLOT_B) |
| 40 | * + inputpins, outputpins, event and mask registers. |
| 41 | * - no offset register. sigh. |
| 42 | * |
| 43 | * Because of the lacking offset register we must map the whole card. |
| 44 | * We assign each memory window PCMCIA_MEM_WIN_SIZE address space. |
| 45 | * Make sure there is (PCMCIA_MEM_WIN_SIZE * PCMCIA_MEM_WIN_NO |
| 46 | * * PCMCIA_SOCKETS_NO) bytes at PCMCIA_MEM_WIN_BASE. |
| 47 | * The i/o windows are dynamically allocated at PCMCIA_IO_WIN_BASE. |
| 48 | * They are maximum 64KByte each... |
| 49 | */ |
| 50 | |
| 51 | /* #define DEBUG 1 */ |
| 52 | |
| 53 | /* |
| 54 | * PCMCIA support |
| 55 | */ |
| 56 | #include <common.h> |
| 57 | #include <command.h> |
| 58 | #include <config.h> |
| 59 | #include <pcmcia.h> |
wdenk | 54070ab | 2004-12-31 09:32:47 +0000 | [diff] [blame] | 60 | #include <asm/io.h> |
| 61 | |
wdenk | 90e7e42 | 2002-12-04 23:39:58 +0000 | [diff] [blame] | 62 | /* -------------------------------------------------------------------- */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 63 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 64 | #if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 65 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 66 | extern int pcmcia_on (void); |
| 67 | extern int pcmcia_off (void); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 68 | |
| 69 | int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) |
| 70 | { |
| 71 | int rcode = 0; |
| 72 | |
| 73 | if (argc != 2) { |
| 74 | printf ("Usage: pinit {on | off}\n"); |
| 75 | return 1; |
| 76 | } |
| 77 | if (strcmp(argv[1],"on") == 0) { |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 78 | rcode = pcmcia_on (); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 79 | } else if (strcmp(argv[1],"off") == 0) { |
| 80 | rcode = pcmcia_off (); |
| 81 | } else { |
| 82 | printf ("Usage: pinit {on | off}\n"); |
| 83 | return 1; |
| 84 | } |
| 85 | |
| 86 | return rcode; |
| 87 | } |
wdenk | e5d61c7 | 2003-05-18 11:30:09 +0000 | [diff] [blame] | 88 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 89 | U_BOOT_CMD( |
| 90 | pinit, 2, 1, do_pinit, |
| 91 | "pinit - PCMCIA sub-system\n", |
| 92 | "on - power on PCMCIA socket\n" |
| 93 | "pinit off - power off PCMCIA socket\n" |
| 94 | ); |
wdenk | e5d61c7 | 2003-05-18 11:30:09 +0000 | [diff] [blame] | 95 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 96 | #endif /* CONFIG_COMMANDS & CFG_CMD_PCMCIA */ |
wdenk | e5d61c7 | 2003-05-18 11:30:09 +0000 | [diff] [blame] | 97 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 98 | /* -------------------------------------------------------------------- */ |
wdenk | e5d61c7 | 2003-05-18 11:30:09 +0000 | [diff] [blame] | 99 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 100 | #undef CHECK_IDE_DEVICE |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 101 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 102 | #if (CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD) |
| 103 | #define CHECK_IDE_DEVICE |
wdenk | 4b6e905 | 2004-02-06 21:48:22 +0000 | [diff] [blame] | 104 | #endif |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 105 | |
| 106 | #if defined(CONFIG_PXA_PCMCIA) |
| 107 | #define CHECK_IDE_DEVICE |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 108 | #endif |
| 109 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 110 | #ifdef CHECK_IDE_DEVICE |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 111 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 112 | int ide_devices_found; |
| 113 | static uchar *known_cards[] = { |
| 114 | (uchar *)"ARGOSY PnPIDE D5", |
| 115 | NULL |
| 116 | }; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 117 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 118 | #define MAX_TUPEL_SZ 512 |
| 119 | #define MAX_FEATURES 4 |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 120 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 121 | #define MAX_IDENT_CHARS 64 |
| 122 | #define MAX_IDENT_FIELDS 4 |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 123 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 124 | #define indent "\t " |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 125 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 126 | static void print_funcid (int func) |
| 127 | { |
| 128 | puts (indent); |
| 129 | switch (func) { |
| 130 | case CISTPL_FUNCID_MULTI: |
| 131 | puts (" Multi-Function"); |
wdenk | 4b6e905 | 2004-02-06 21:48:22 +0000 | [diff] [blame] | 132 | break; |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 133 | case CISTPL_FUNCID_MEMORY: |
| 134 | puts (" Memory"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 135 | break; |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 136 | case CISTPL_FUNCID_SERIAL: |
| 137 | puts (" Serial Port"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 138 | break; |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 139 | case CISTPL_FUNCID_PARALLEL: |
| 140 | puts (" Parallel Port"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 141 | break; |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 142 | case CISTPL_FUNCID_FIXED: |
| 143 | puts (" Fixed Disk"); |
wdenk | 67f1336 | 2003-12-27 19:24:54 +0000 | [diff] [blame] | 144 | break; |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 145 | case CISTPL_FUNCID_VIDEO: |
| 146 | puts (" Video Adapter"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 147 | break; |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 148 | case CISTPL_FUNCID_NETWORK: |
| 149 | puts (" Network Adapter"); |
| 150 | break; |
| 151 | case CISTPL_FUNCID_AIMS: |
| 152 | puts (" AIMS Card"); |
| 153 | break; |
| 154 | case CISTPL_FUNCID_SCSI: |
| 155 | puts (" SCSI Adapter"); |
| 156 | break; |
| 157 | default: |
| 158 | puts (" Unknown"); |
| 159 | break; |
wdenk | 2029f4d | 2002-11-21 23:11:29 +0000 | [diff] [blame] | 160 | } |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 161 | puts (" Card\n"); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 162 | } |
| 163 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 164 | static void print_fixed (volatile uchar *p) |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 165 | { |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 166 | if (p == NULL) |
| 167 | return; |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 168 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 169 | puts(indent); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 170 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 171 | switch (*p) { |
| 172 | case CISTPL_FUNCE_IDE_IFACE: |
| 173 | { uchar iface = *(p+2); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 174 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 175 | puts ((iface == CISTPL_IDE_INTERFACE) ? " IDE" : " unknown"); |
| 176 | puts (" interface "); |
| 177 | break; |
| 178 | } |
| 179 | case CISTPL_FUNCE_IDE_MASTER: |
| 180 | case CISTPL_FUNCE_IDE_SLAVE: |
| 181 | { uchar f1 = *(p+2); |
| 182 | uchar f2 = *(p+4); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 183 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 184 | puts ((f1 & CISTPL_IDE_SILICON) ? " [silicon]" : " [rotating]"); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 185 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 186 | if (f1 & CISTPL_IDE_UNIQUE) |
| 187 | puts (" [unique]"); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 188 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 189 | puts ((f1 & CISTPL_IDE_DUAL) ? " [dual]" : " [single]"); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 190 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 191 | if (f2 & CISTPL_IDE_HAS_SLEEP) |
| 192 | puts (" [sleep]"); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 193 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 194 | if (f2 & CISTPL_IDE_HAS_STANDBY) |
| 195 | puts (" [standby]"); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 196 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 197 | if (f2 & CISTPL_IDE_HAS_IDLE) |
| 198 | puts (" [idle]"); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 199 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 200 | if (f2 & CISTPL_IDE_LOW_POWER) |
| 201 | puts (" [low power]"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 202 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 203 | if (f2 & CISTPL_IDE_REG_INHIBIT) |
| 204 | puts (" [reg inhibit]"); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 205 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 206 | if (f2 & CISTPL_IDE_HAS_INDEX) |
| 207 | puts (" [index]"); |
wdenk | e5d61c7 | 2003-05-18 11:30:09 +0000 | [diff] [blame] | 208 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 209 | if (f2 & CISTPL_IDE_IOIS16) |
| 210 | puts (" [IOis16]"); |
wdenk | e5d61c7 | 2003-05-18 11:30:09 +0000 | [diff] [blame] | 211 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 212 | break; |
| 213 | } |
| 214 | } |
| 215 | putc ('\n'); |
wdenk | e5d61c7 | 2003-05-18 11:30:09 +0000 | [diff] [blame] | 216 | } |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 217 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 218 | static int identify (volatile uchar *p) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 219 | { |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 220 | uchar id_str[MAX_IDENT_CHARS]; |
| 221 | uchar data; |
| 222 | uchar *t; |
| 223 | uchar **card; |
| 224 | int i, done; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 225 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 226 | if (p == NULL) |
| 227 | return (0); /* Don't know */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 228 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 229 | t = id_str; |
| 230 | done =0; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 231 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 232 | for (i=0; i<=4 && !done; ++i, p+=2) { |
| 233 | while ((data = *p) != '\0') { |
| 234 | if (data == 0xFF) { |
| 235 | done = 1; |
| 236 | break; |
| 237 | } |
| 238 | *t++ = data; |
| 239 | if (t == &id_str[MAX_IDENT_CHARS-1]) { |
| 240 | done = 1; |
| 241 | break; |
| 242 | } |
| 243 | p += 2; |
| 244 | } |
| 245 | if (!done) |
| 246 | *t++ = ' '; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 247 | } |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 248 | *t = '\0'; |
| 249 | while (--t > id_str) { |
| 250 | if (*t == ' ') |
| 251 | *t = '\0'; |
| 252 | else |
| 253 | break; |
| 254 | } |
| 255 | puts ((char *)id_str); |
| 256 | putc ('\n'); |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 257 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 258 | for (card=known_cards; *card; ++card) { |
| 259 | debug ("## Compare against \"%s\"\n", *card); |
| 260 | if (strcmp((char *)*card, (char *)id_str) == 0) { /* found! */ |
| 261 | debug ("## CARD FOUND ##\n"); |
| 262 | return (1); |
| 263 | } |
| 264 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 265 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 266 | return (0); /* don't know */ |
wdenk | 634d2f7 | 2004-04-15 23:14:49 +0000 | [diff] [blame] | 267 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 268 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 269 | int check_ide_device (int slot) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 270 | { |
| 271 | volatile uchar *ident = NULL; |
| 272 | volatile uchar *feature_p[MAX_FEATURES]; |
wdenk | 2029f4d | 2002-11-21 23:11:29 +0000 | [diff] [blame] | 273 | volatile uchar *p, *start, *addr; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 274 | int n_features = 0; |
| 275 | uchar func_id = ~0; |
| 276 | uchar code, len; |
| 277 | ushort config_base = 0; |
| 278 | int found = 0; |
| 279 | int i; |
| 280 | |
wdenk | 90e7e42 | 2002-12-04 23:39:58 +0000 | [diff] [blame] | 281 | addr = (volatile uchar *)(CFG_PCMCIA_MEM_ADDR + |
| 282 | CFG_PCMCIA_MEM_SIZE * (slot * 4)); |
wdenk | e7f34c6 | 2003-01-11 09:48:40 +0000 | [diff] [blame] | 283 | debug ("PCMCIA MEM: %08lX\n", (ulong)addr); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 284 | |
wdenk | 2029f4d | 2002-11-21 23:11:29 +0000 | [diff] [blame] | 285 | start = p = (volatile uchar *) addr; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 286 | |
| 287 | while ((p - start) < MAX_TUPEL_SZ) { |
| 288 | |
| 289 | code = *p; p += 2; |
| 290 | |
| 291 | if (code == 0xFF) { /* End of chain */ |
| 292 | break; |
| 293 | } |
| 294 | |
| 295 | len = *p; p += 2; |
| 296 | #if defined(DEBUG) && (DEBUG > 1) |
| 297 | { volatile uchar *q = p; |
| 298 | printf ("\nTuple code %02x length %d\n\tData:", |
| 299 | code, len); |
| 300 | |
| 301 | for (i = 0; i < len; ++i) { |
| 302 | printf (" %02x", *q); |
| 303 | q+= 2; |
| 304 | } |
| 305 | } |
| 306 | #endif /* DEBUG */ |
| 307 | switch (code) { |
| 308 | case CISTPL_VERS_1: |
| 309 | ident = p + 4; |
| 310 | break; |
| 311 | case CISTPL_FUNCID: |
| 312 | /* Fix for broken SanDisk which may have 0x80 bit set */ |
| 313 | func_id = *p & 0x7F; |
| 314 | break; |
| 315 | case CISTPL_FUNCE: |
| 316 | if (n_features < MAX_FEATURES) |
| 317 | feature_p[n_features++] = p; |
| 318 | break; |
| 319 | case CISTPL_CONFIG: |
| 320 | config_base = (*(p+6) << 8) + (*(p+4)); |
| 321 | debug ("\n## Config_base = %04x ###\n", config_base); |
| 322 | default: |
| 323 | break; |
| 324 | } |
| 325 | p += 2 * len; |
| 326 | } |
| 327 | |
| 328 | found = identify (ident); |
| 329 | |
| 330 | if (func_id != ((uchar)~0)) { |
| 331 | print_funcid (func_id); |
| 332 | |
| 333 | if (func_id == CISTPL_FUNCID_FIXED) |
| 334 | found = 1; |
| 335 | else |
| 336 | return (1); /* no disk drive */ |
| 337 | } |
| 338 | |
| 339 | for (i=0; i<n_features; ++i) { |
| 340 | print_fixed (feature_p[i]); |
| 341 | } |
| 342 | |
| 343 | if (!found) { |
| 344 | printf ("unknown card type\n"); |
| 345 | return (1); |
| 346 | } |
| 347 | |
wdenk | 4fc9569 | 2003-02-28 00:49:47 +0000 | [diff] [blame] | 348 | ide_devices_found |= (1 << slot); |
| 349 | |
wdenk | 54070ab | 2004-12-31 09:32:47 +0000 | [diff] [blame] | 350 | #if CONFIG_CPC45 |
| 351 | #else |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 352 | /* set I/O area in config reg -> only valid for ARGOSY D5!!! */ |
wdenk | 2029f4d | 2002-11-21 23:11:29 +0000 | [diff] [blame] | 353 | *((uchar *)(addr + config_base)) = 1; |
wdenk | 54070ab | 2004-12-31 09:32:47 +0000 | [diff] [blame] | 354 | #endif |
| 355 | #if 0 |
| 356 | printf("\n## Config_base = %04x ###\n", config_base); |
| 357 | printf("Configuration Option Register: %02x @ %x\n", readb(addr + config_base), addr + config_base); |
| 358 | printf("Card Configuration and Status Register: %02x\n", readb(addr + config_base + 2)); |
| 359 | printf("Pin Replacement Register Register: %02x\n", readb(addr + config_base + 4)); |
| 360 | printf("Socket and Copy Register: %02x\n", readb(addr + config_base + 6)); |
| 361 | #endif |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 362 | return (0); |
| 363 | } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 364 | |
Wolfgang Denk | 50440e7 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 365 | #endif /* CHECK_IDE_DEVICE */ |