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