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