Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Denis Peter, MPL AG Switzerland |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #include <common.h> |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 9 | #include <dm.h> |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 10 | #include <inttypes.h> |
| 11 | #include <pci.h> |
| 12 | #include <scsi.h> |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 13 | #include <dm/device-internal.h> |
| 14 | #include <dm/uclass-internal.h> |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 15 | |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 16 | #if !defined(CONFIG_DM_SCSI) |
Simon Glass | 099c239 | 2017-06-14 21:28:35 -0600 | [diff] [blame] | 17 | # ifdef CONFIG_SCSI_DEV_LIST |
| 18 | # define SCSI_DEV_LIST CONFIG_SCSI_DEV_LIST |
| 19 | # else |
| 20 | # ifdef CONFIG_SATA_ULI5288 |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 21 | |
Simon Glass | 099c239 | 2017-06-14 21:28:35 -0600 | [diff] [blame] | 22 | # define SCSI_VEND_ID 0x10b9 |
| 23 | # define SCSI_DEV_ID 0x5288 |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 24 | |
Simon Glass | 099c239 | 2017-06-14 21:28:35 -0600 | [diff] [blame] | 25 | # elif !defined(CONFIG_SCSI_AHCI_PLAT) |
| 26 | # error no scsi device defined |
| 27 | # endif |
| 28 | # define SCSI_DEV_LIST {SCSI_VEND_ID, SCSI_DEV_ID} |
| 29 | # endif |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 30 | #endif |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 31 | |
| 32 | #if defined(CONFIG_PCI) && !defined(CONFIG_SCSI_AHCI_PLAT) |
| 33 | const struct pci_device_id scsi_device_list[] = { SCSI_DEV_LIST }; |
| 34 | #endif |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 35 | static struct scsi_cmd tempccb; /* temporary scsi command buffer */ |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 36 | |
| 37 | static unsigned char tempbuff[512]; /* temporary data buffer */ |
| 38 | |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 39 | #if !defined(CONFIG_DM_SCSI) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 40 | static int scsi_max_devs; /* number of highest available scsi device */ |
| 41 | |
| 42 | static int scsi_curr_dev; /* current device */ |
| 43 | |
| 44 | static struct blk_desc scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE]; |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 45 | #endif |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 46 | |
| 47 | /* almost the maximum amount of the scsi_ext command.. */ |
| 48 | #define SCSI_MAX_READ_BLK 0xFFFF |
| 49 | #define SCSI_LBA48_READ 0xFFFFFFF |
| 50 | |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 51 | static void scsi_print_error(struct scsi_cmd *pccb) |
Simon Glass | a6fb185 | 2017-06-14 21:28:23 -0600 | [diff] [blame] | 52 | { |
| 53 | /* Dummy function that could print an error for debugging */ |
| 54 | } |
| 55 | |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 56 | #ifdef CONFIG_SYS_64BIT_LBA |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 57 | void scsi_setup_read16(struct scsi_cmd *pccb, lbaint_t start, |
| 58 | unsigned long blocks) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 59 | { |
| 60 | pccb->cmd[0] = SCSI_READ16; |
| 61 | pccb->cmd[1] = pccb->lun << 5; |
| 62 | pccb->cmd[2] = (unsigned char)(start >> 56) & 0xff; |
| 63 | pccb->cmd[3] = (unsigned char)(start >> 48) & 0xff; |
| 64 | pccb->cmd[4] = (unsigned char)(start >> 40) & 0xff; |
| 65 | pccb->cmd[5] = (unsigned char)(start >> 32) & 0xff; |
| 66 | pccb->cmd[6] = (unsigned char)(start >> 24) & 0xff; |
| 67 | pccb->cmd[7] = (unsigned char)(start >> 16) & 0xff; |
| 68 | pccb->cmd[8] = (unsigned char)(start >> 8) & 0xff; |
| 69 | pccb->cmd[9] = (unsigned char)start & 0xff; |
| 70 | pccb->cmd[10] = 0; |
| 71 | pccb->cmd[11] = (unsigned char)(blocks >> 24) & 0xff; |
| 72 | pccb->cmd[12] = (unsigned char)(blocks >> 16) & 0xff; |
| 73 | pccb->cmd[13] = (unsigned char)(blocks >> 8) & 0xff; |
| 74 | pccb->cmd[14] = (unsigned char)blocks & 0xff; |
| 75 | pccb->cmd[15] = 0; |
| 76 | pccb->cmdlen = 16; |
| 77 | pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */ |
| 78 | debug("scsi_setup_read16: cmd: %02X %02X startblk %02X%02X%02X%02X%02X%02X%02X%02X blccnt %02X%02X%02X%02X\n", |
| 79 | pccb->cmd[0], pccb->cmd[1], |
| 80 | pccb->cmd[2], pccb->cmd[3], pccb->cmd[4], pccb->cmd[5], |
| 81 | pccb->cmd[6], pccb->cmd[7], pccb->cmd[8], pccb->cmd[9], |
| 82 | pccb->cmd[11], pccb->cmd[12], pccb->cmd[13], pccb->cmd[14]); |
| 83 | } |
| 84 | #endif |
| 85 | |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 86 | static void scsi_setup_read_ext(struct scsi_cmd *pccb, lbaint_t start, |
Michal Simek | 545a284 | 2016-11-30 11:53:43 +0100 | [diff] [blame] | 87 | unsigned short blocks) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 88 | { |
| 89 | pccb->cmd[0] = SCSI_READ10; |
| 90 | pccb->cmd[1] = pccb->lun << 5; |
| 91 | pccb->cmd[2] = (unsigned char)(start >> 24) & 0xff; |
| 92 | pccb->cmd[3] = (unsigned char)(start >> 16) & 0xff; |
| 93 | pccb->cmd[4] = (unsigned char)(start >> 8) & 0xff; |
| 94 | pccb->cmd[5] = (unsigned char)start & 0xff; |
| 95 | pccb->cmd[6] = 0; |
| 96 | pccb->cmd[7] = (unsigned char)(blocks >> 8) & 0xff; |
| 97 | pccb->cmd[8] = (unsigned char)blocks & 0xff; |
| 98 | pccb->cmd[6] = 0; |
| 99 | pccb->cmdlen = 10; |
| 100 | pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */ |
| 101 | debug("scsi_setup_read_ext: cmd: %02X %02X startblk %02X%02X%02X%02X blccnt %02X%02X\n", |
| 102 | pccb->cmd[0], pccb->cmd[1], |
| 103 | pccb->cmd[2], pccb->cmd[3], pccb->cmd[4], pccb->cmd[5], |
| 104 | pccb->cmd[7], pccb->cmd[8]); |
| 105 | } |
| 106 | |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 107 | static void scsi_setup_write_ext(struct scsi_cmd *pccb, lbaint_t start, |
Michal Simek | 545a284 | 2016-11-30 11:53:43 +0100 | [diff] [blame] | 108 | unsigned short blocks) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 109 | { |
| 110 | pccb->cmd[0] = SCSI_WRITE10; |
| 111 | pccb->cmd[1] = pccb->lun << 5; |
| 112 | pccb->cmd[2] = (unsigned char)(start >> 24) & 0xff; |
| 113 | pccb->cmd[3] = (unsigned char)(start >> 16) & 0xff; |
| 114 | pccb->cmd[4] = (unsigned char)(start >> 8) & 0xff; |
| 115 | pccb->cmd[5] = (unsigned char)start & 0xff; |
| 116 | pccb->cmd[6] = 0; |
| 117 | pccb->cmd[7] = ((unsigned char)(blocks >> 8)) & 0xff; |
| 118 | pccb->cmd[8] = (unsigned char)blocks & 0xff; |
| 119 | pccb->cmd[9] = 0; |
| 120 | pccb->cmdlen = 10; |
| 121 | pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */ |
| 122 | debug("%s: cmd: %02X %02X startblk %02X%02X%02X%02X blccnt %02X%02X\n", |
| 123 | __func__, |
| 124 | pccb->cmd[0], pccb->cmd[1], |
| 125 | pccb->cmd[2], pccb->cmd[3], pccb->cmd[4], pccb->cmd[5], |
| 126 | pccb->cmd[7], pccb->cmd[8]); |
| 127 | } |
| 128 | |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 129 | static void scsi_setup_inquiry(struct scsi_cmd *pccb) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 130 | { |
| 131 | pccb->cmd[0] = SCSI_INQUIRY; |
| 132 | pccb->cmd[1] = pccb->lun << 5; |
| 133 | pccb->cmd[2] = 0; |
| 134 | pccb->cmd[3] = 0; |
| 135 | if (pccb->datalen > 255) |
| 136 | pccb->cmd[4] = 255; |
| 137 | else |
| 138 | pccb->cmd[4] = (unsigned char)pccb->datalen; |
| 139 | pccb->cmd[5] = 0; |
| 140 | pccb->cmdlen = 6; |
| 141 | pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */ |
| 142 | } |
| 143 | |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 144 | #ifdef CONFIG_BLK |
| 145 | static ulong scsi_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, |
| 146 | void *buffer) |
| 147 | #else |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 148 | static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr, |
| 149 | lbaint_t blkcnt, void *buffer) |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 150 | #endif |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 151 | { |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 152 | #ifdef CONFIG_BLK |
| 153 | struct blk_desc *block_dev = dev_get_uclass_platdata(dev); |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 154 | struct udevice *bdev = dev->parent; |
| 155 | #else |
| 156 | struct udevice *bdev = NULL; |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 157 | #endif |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 158 | lbaint_t start, blks; |
| 159 | uintptr_t buf_addr; |
| 160 | unsigned short smallblks = 0; |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 161 | struct scsi_cmd *pccb = (struct scsi_cmd *)&tempccb; |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 162 | |
| 163 | /* Setup device */ |
Michal Simek | cdb93b2 | 2016-11-18 16:22:42 +0100 | [diff] [blame] | 164 | pccb->target = block_dev->target; |
| 165 | pccb->lun = block_dev->lun; |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 166 | buf_addr = (unsigned long)buffer; |
| 167 | start = blknr; |
| 168 | blks = blkcnt; |
| 169 | debug("\nscsi_read: dev %d startblk " LBAF |
| 170 | ", blccnt " LBAF " buffer %lx\n", |
Michal Simek | cdb93b2 | 2016-11-18 16:22:42 +0100 | [diff] [blame] | 171 | block_dev->devnum, start, blks, (unsigned long)buffer); |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 172 | do { |
| 173 | pccb->pdata = (unsigned char *)buf_addr; |
| 174 | #ifdef CONFIG_SYS_64BIT_LBA |
| 175 | if (start > SCSI_LBA48_READ) { |
| 176 | unsigned long blocks; |
| 177 | blocks = min_t(lbaint_t, blks, SCSI_MAX_READ_BLK); |
Michal Simek | cdb93b2 | 2016-11-18 16:22:42 +0100 | [diff] [blame] | 178 | pccb->datalen = block_dev->blksz * blocks; |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 179 | scsi_setup_read16(pccb, start, blocks); |
| 180 | start += blocks; |
| 181 | blks -= blocks; |
| 182 | } else |
| 183 | #endif |
| 184 | if (blks > SCSI_MAX_READ_BLK) { |
Michal Simek | cdb93b2 | 2016-11-18 16:22:42 +0100 | [diff] [blame] | 185 | pccb->datalen = block_dev->blksz * |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 186 | SCSI_MAX_READ_BLK; |
| 187 | smallblks = SCSI_MAX_READ_BLK; |
| 188 | scsi_setup_read_ext(pccb, start, smallblks); |
| 189 | start += SCSI_MAX_READ_BLK; |
| 190 | blks -= SCSI_MAX_READ_BLK; |
| 191 | } else { |
Michal Simek | cdb93b2 | 2016-11-18 16:22:42 +0100 | [diff] [blame] | 192 | pccb->datalen = block_dev->blksz * blks; |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 193 | smallblks = (unsigned short)blks; |
| 194 | scsi_setup_read_ext(pccb, start, smallblks); |
| 195 | start += blks; |
| 196 | blks = 0; |
| 197 | } |
| 198 | debug("scsi_read_ext: startblk " LBAF |
| 199 | ", blccnt %x buffer %" PRIXPTR "\n", |
| 200 | start, smallblks, buf_addr); |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 201 | if (scsi_exec(bdev, pccb)) { |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 202 | scsi_print_error(pccb); |
| 203 | blkcnt -= blks; |
| 204 | break; |
| 205 | } |
| 206 | buf_addr += pccb->datalen; |
| 207 | } while (blks != 0); |
| 208 | debug("scsi_read_ext: end startblk " LBAF |
| 209 | ", blccnt %x buffer %" PRIXPTR "\n", start, smallblks, buf_addr); |
| 210 | return blkcnt; |
| 211 | } |
| 212 | |
| 213 | /******************************************************************************* |
| 214 | * scsi_write |
| 215 | */ |
| 216 | |
| 217 | /* Almost the maximum amount of the scsi_ext command.. */ |
| 218 | #define SCSI_MAX_WRITE_BLK 0xFFFF |
| 219 | |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 220 | #ifdef CONFIG_BLK |
| 221 | static ulong scsi_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, |
| 222 | const void *buffer) |
| 223 | #else |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 224 | static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr, |
| 225 | lbaint_t blkcnt, const void *buffer) |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 226 | #endif |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 227 | { |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 228 | #ifdef CONFIG_BLK |
| 229 | struct blk_desc *block_dev = dev_get_uclass_platdata(dev); |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 230 | struct udevice *bdev = dev->parent; |
| 231 | #else |
| 232 | struct udevice *bdev = NULL; |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 233 | #endif |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 234 | lbaint_t start, blks; |
| 235 | uintptr_t buf_addr; |
| 236 | unsigned short smallblks; |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 237 | struct scsi_cmd *pccb = (struct scsi_cmd *)&tempccb; |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 238 | |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 239 | /* Setup device */ |
Michal Simek | cdb93b2 | 2016-11-18 16:22:42 +0100 | [diff] [blame] | 240 | pccb->target = block_dev->target; |
| 241 | pccb->lun = block_dev->lun; |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 242 | buf_addr = (unsigned long)buffer; |
| 243 | start = blknr; |
| 244 | blks = blkcnt; |
| 245 | debug("\n%s: dev %d startblk " LBAF ", blccnt " LBAF " buffer %lx\n", |
Michal Simek | cdb93b2 | 2016-11-18 16:22:42 +0100 | [diff] [blame] | 246 | __func__, block_dev->devnum, start, blks, (unsigned long)buffer); |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 247 | do { |
| 248 | pccb->pdata = (unsigned char *)buf_addr; |
| 249 | if (blks > SCSI_MAX_WRITE_BLK) { |
Michal Simek | cdb93b2 | 2016-11-18 16:22:42 +0100 | [diff] [blame] | 250 | pccb->datalen = (block_dev->blksz * |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 251 | SCSI_MAX_WRITE_BLK); |
| 252 | smallblks = SCSI_MAX_WRITE_BLK; |
| 253 | scsi_setup_write_ext(pccb, start, smallblks); |
| 254 | start += SCSI_MAX_WRITE_BLK; |
| 255 | blks -= SCSI_MAX_WRITE_BLK; |
| 256 | } else { |
Michal Simek | cdb93b2 | 2016-11-18 16:22:42 +0100 | [diff] [blame] | 257 | pccb->datalen = block_dev->blksz * blks; |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 258 | smallblks = (unsigned short)blks; |
| 259 | scsi_setup_write_ext(pccb, start, smallblks); |
| 260 | start += blks; |
| 261 | blks = 0; |
| 262 | } |
| 263 | debug("%s: startblk " LBAF ", blccnt %x buffer %" PRIXPTR "\n", |
| 264 | __func__, start, smallblks, buf_addr); |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 265 | if (scsi_exec(bdev, pccb)) { |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 266 | scsi_print_error(pccb); |
| 267 | blkcnt -= blks; |
| 268 | break; |
| 269 | } |
| 270 | buf_addr += pccb->datalen; |
| 271 | } while (blks != 0); |
| 272 | debug("%s: end startblk " LBAF ", blccnt %x buffer %" PRIXPTR "\n", |
| 273 | __func__, start, smallblks, buf_addr); |
| 274 | return blkcnt; |
| 275 | } |
| 276 | |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 277 | #if defined(CONFIG_PCI) && !defined(CONFIG_SCSI_AHCI_PLAT) |
| 278 | void scsi_init(void) |
| 279 | { |
| 280 | int busdevfunc = -1; |
| 281 | int i; |
| 282 | /* |
| 283 | * Find a device from the list, this driver will support a single |
| 284 | * controller. |
| 285 | */ |
| 286 | for (i = 0; i < ARRAY_SIZE(scsi_device_list); i++) { |
| 287 | /* get PCI Device ID */ |
| 288 | #ifdef CONFIG_DM_PCI |
| 289 | struct udevice *dev; |
| 290 | int ret; |
| 291 | |
| 292 | ret = dm_pci_find_device(scsi_device_list[i].vendor, |
| 293 | scsi_device_list[i].device, 0, &dev); |
| 294 | if (!ret) { |
| 295 | busdevfunc = dm_pci_get_bdf(dev); |
| 296 | break; |
| 297 | } |
| 298 | #else |
| 299 | busdevfunc = pci_find_device(scsi_device_list[i].vendor, |
| 300 | scsi_device_list[i].device, |
| 301 | 0); |
| 302 | #endif |
| 303 | if (busdevfunc != -1) |
| 304 | break; |
| 305 | } |
| 306 | |
| 307 | if (busdevfunc == -1) { |
| 308 | printf("Error: SCSI Controller(s) "); |
| 309 | for (i = 0; i < ARRAY_SIZE(scsi_device_list); i++) { |
| 310 | printf("%04X:%04X ", |
| 311 | scsi_device_list[i].vendor, |
| 312 | scsi_device_list[i].device); |
| 313 | } |
| 314 | printf("not found\n"); |
| 315 | return; |
| 316 | } |
| 317 | #ifdef DEBUG |
| 318 | else { |
| 319 | printf("SCSI Controller (%04X,%04X) found (%d:%d:%d)\n", |
| 320 | scsi_device_list[i].vendor, |
| 321 | scsi_device_list[i].device, |
| 322 | (busdevfunc >> 16) & 0xFF, |
| 323 | (busdevfunc >> 11) & 0x1F, |
| 324 | (busdevfunc >> 8) & 0x7); |
| 325 | } |
| 326 | #endif |
| 327 | bootstage_start(BOOTSTAGE_ID_ACCUM_SCSI, "ahci"); |
| 328 | scsi_low_level_init(busdevfunc); |
| 329 | scsi_scan(1); |
| 330 | bootstage_accum(BOOTSTAGE_ID_ACCUM_SCSI); |
| 331 | } |
| 332 | #endif |
| 333 | |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 334 | /* copy src to dest, skipping leading and trailing blanks |
| 335 | * and null terminate the string |
| 336 | */ |
Michal Simek | 545a284 | 2016-11-30 11:53:43 +0100 | [diff] [blame] | 337 | static void scsi_ident_cpy(unsigned char *dest, unsigned char *src, |
| 338 | unsigned int len) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 339 | { |
| 340 | int start, end; |
| 341 | |
| 342 | start = 0; |
| 343 | while (start < len) { |
| 344 | if (src[start] != ' ') |
| 345 | break; |
| 346 | start++; |
| 347 | } |
| 348 | end = len-1; |
| 349 | while (end > start) { |
| 350 | if (src[end] != ' ') |
| 351 | break; |
| 352 | end--; |
| 353 | } |
| 354 | for (; start <= end; start++) |
| 355 | *dest ++= src[start]; |
| 356 | *dest = '\0'; |
| 357 | } |
| 358 | |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 359 | static int scsi_read_capacity(struct udevice *dev, struct scsi_cmd *pccb, |
| 360 | lbaint_t *capacity, unsigned long *blksz) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 361 | { |
| 362 | *capacity = 0; |
| 363 | |
| 364 | memset(pccb->cmd, '\0', sizeof(pccb->cmd)); |
| 365 | pccb->cmd[0] = SCSI_RD_CAPAC10; |
| 366 | pccb->cmd[1] = pccb->lun << 5; |
| 367 | pccb->cmdlen = 10; |
| 368 | pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */ |
| 369 | |
| 370 | pccb->datalen = 8; |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 371 | if (scsi_exec(dev, pccb) != true) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 372 | return 1; |
| 373 | |
| 374 | *capacity = ((lbaint_t)pccb->pdata[0] << 24) | |
| 375 | ((lbaint_t)pccb->pdata[1] << 16) | |
| 376 | ((lbaint_t)pccb->pdata[2] << 8) | |
| 377 | ((lbaint_t)pccb->pdata[3]); |
| 378 | |
| 379 | if (*capacity != 0xffffffff) { |
| 380 | /* Read capacity (10) was sufficient for this drive. */ |
| 381 | *blksz = ((unsigned long)pccb->pdata[4] << 24) | |
| 382 | ((unsigned long)pccb->pdata[5] << 16) | |
| 383 | ((unsigned long)pccb->pdata[6] << 8) | |
| 384 | ((unsigned long)pccb->pdata[7]); |
| 385 | return 0; |
| 386 | } |
| 387 | |
| 388 | /* Read capacity (10) was insufficient. Use read capacity (16). */ |
| 389 | memset(pccb->cmd, '\0', sizeof(pccb->cmd)); |
| 390 | pccb->cmd[0] = SCSI_RD_CAPAC16; |
| 391 | pccb->cmd[1] = 0x10; |
| 392 | pccb->cmdlen = 16; |
| 393 | pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */ |
| 394 | |
| 395 | pccb->datalen = 16; |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 396 | if (scsi_exec(dev, pccb) != true) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 397 | return 1; |
| 398 | |
| 399 | *capacity = ((uint64_t)pccb->pdata[0] << 56) | |
| 400 | ((uint64_t)pccb->pdata[1] << 48) | |
| 401 | ((uint64_t)pccb->pdata[2] << 40) | |
| 402 | ((uint64_t)pccb->pdata[3] << 32) | |
| 403 | ((uint64_t)pccb->pdata[4] << 24) | |
| 404 | ((uint64_t)pccb->pdata[5] << 16) | |
| 405 | ((uint64_t)pccb->pdata[6] << 8) | |
| 406 | ((uint64_t)pccb->pdata[7]); |
| 407 | |
| 408 | *blksz = ((uint64_t)pccb->pdata[8] << 56) | |
| 409 | ((uint64_t)pccb->pdata[9] << 48) | |
| 410 | ((uint64_t)pccb->pdata[10] << 40) | |
| 411 | ((uint64_t)pccb->pdata[11] << 32) | |
| 412 | ((uint64_t)pccb->pdata[12] << 24) | |
| 413 | ((uint64_t)pccb->pdata[13] << 16) | |
| 414 | ((uint64_t)pccb->pdata[14] << 8) | |
| 415 | ((uint64_t)pccb->pdata[15]); |
| 416 | |
| 417 | return 0; |
| 418 | } |
| 419 | |
| 420 | |
| 421 | /* |
| 422 | * Some setup (fill-in) routines |
| 423 | */ |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 424 | static void scsi_setup_test_unit_ready(struct scsi_cmd *pccb) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 425 | { |
| 426 | pccb->cmd[0] = SCSI_TST_U_RDY; |
| 427 | pccb->cmd[1] = pccb->lun << 5; |
| 428 | pccb->cmd[2] = 0; |
| 429 | pccb->cmd[3] = 0; |
| 430 | pccb->cmd[4] = 0; |
| 431 | pccb->cmd[5] = 0; |
| 432 | pccb->cmdlen = 6; |
| 433 | pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */ |
| 434 | } |
| 435 | |
Michal Simek | 0b3a58e | 2016-11-30 12:50:58 +0100 | [diff] [blame] | 436 | /** |
| 437 | * scsi_init_dev_desc_priv - initialize only SCSI specific blk_desc properties |
| 438 | * |
| 439 | * @dev_desc: Block device description pointer |
| 440 | */ |
| 441 | static void scsi_init_dev_desc_priv(struct blk_desc *dev_desc) |
Michal Simek | 92ca476 | 2016-11-18 15:27:00 +0100 | [diff] [blame] | 442 | { |
| 443 | dev_desc->target = 0xff; |
| 444 | dev_desc->lun = 0xff; |
Michal Simek | 92ca476 | 2016-11-18 15:27:00 +0100 | [diff] [blame] | 445 | dev_desc->log2blksz = |
| 446 | LOG2_INVALID(typeof(dev_desc->log2blksz)); |
| 447 | dev_desc->type = DEV_TYPE_UNKNOWN; |
| 448 | dev_desc->vendor[0] = 0; |
| 449 | dev_desc->product[0] = 0; |
| 450 | dev_desc->revision[0] = 0; |
| 451 | dev_desc->removable = false; |
Michal Simek | 92ca476 | 2016-11-18 15:27:00 +0100 | [diff] [blame] | 452 | #ifndef CONFIG_BLK |
| 453 | dev_desc->block_read = scsi_read; |
| 454 | dev_desc->block_write = scsi_write; |
| 455 | #endif |
| 456 | } |
| 457 | |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 458 | #if !defined(CONFIG_DM_SCSI) |
Michal Simek | 0b3a58e | 2016-11-30 12:50:58 +0100 | [diff] [blame] | 459 | /** |
| 460 | * scsi_init_dev_desc - initialize all SCSI specific blk_desc properties |
| 461 | * |
| 462 | * @dev_desc: Block device description pointer |
| 463 | * @devnum: Device number |
| 464 | */ |
| 465 | static void scsi_init_dev_desc(struct blk_desc *dev_desc, int devnum) |
| 466 | { |
| 467 | dev_desc->lba = 0; |
| 468 | dev_desc->blksz = 0; |
| 469 | dev_desc->if_type = IF_TYPE_SCSI; |
| 470 | dev_desc->devnum = devnum; |
| 471 | dev_desc->part_type = PART_TYPE_UNKNOWN; |
| 472 | |
| 473 | scsi_init_dev_desc_priv(dev_desc); |
| 474 | } |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 475 | #endif |
Michal Simek | bccfd9e | 2016-11-18 16:14:24 +0100 | [diff] [blame] | 476 | |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 477 | /** |
| 478 | * scsi_detect_dev - Detect scsi device |
| 479 | * |
Michal Simek | bccfd9e | 2016-11-18 16:14:24 +0100 | [diff] [blame] | 480 | * @target: target id |
Jean-Jacques Hiblot | e39cecf | 2017-04-07 13:42:06 +0200 | [diff] [blame] | 481 | * @lun: target lun |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 482 | * @dev_desc: block device description |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 483 | * |
| 484 | * The scsi_detect_dev detects and fills a dev_desc structure when the device is |
Jean-Jacques Hiblot | e39cecf | 2017-04-07 13:42:06 +0200 | [diff] [blame] | 485 | * detected. |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 486 | * |
| 487 | * Return: 0 on success, error value otherwise |
| 488 | */ |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 489 | static int scsi_detect_dev(struct udevice *dev, int target, int lun, |
| 490 | struct blk_desc *dev_desc) |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 491 | { |
| 492 | unsigned char perq, modi; |
| 493 | lbaint_t capacity; |
| 494 | unsigned long blksz; |
Simon Glass | b9560ad | 2017-06-14 21:28:30 -0600 | [diff] [blame] | 495 | struct scsi_cmd *pccb = (struct scsi_cmd *)&tempccb; |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 496 | |
Michal Simek | bccfd9e | 2016-11-18 16:14:24 +0100 | [diff] [blame] | 497 | pccb->target = target; |
Jean-Jacques Hiblot | e39cecf | 2017-04-07 13:42:06 +0200 | [diff] [blame] | 498 | pccb->lun = lun; |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 499 | pccb->pdata = (unsigned char *)&tempbuff; |
| 500 | pccb->datalen = 512; |
| 501 | scsi_setup_inquiry(pccb); |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 502 | if (scsi_exec(dev, pccb) != true) { |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 503 | if (pccb->contr_stat == SCSI_SEL_TIME_OUT) { |
| 504 | /* |
| 505 | * selection timeout => assuming no |
| 506 | * device present |
| 507 | */ |
| 508 | debug("Selection timeout ID %d\n", |
| 509 | pccb->target); |
| 510 | return -ETIMEDOUT; |
| 511 | } |
| 512 | scsi_print_error(pccb); |
| 513 | return -ENODEV; |
| 514 | } |
| 515 | perq = tempbuff[0]; |
| 516 | modi = tempbuff[1]; |
| 517 | if ((perq & 0x1f) == 0x1f) |
| 518 | return -ENODEV; /* skip unknown devices */ |
| 519 | if ((modi & 0x80) == 0x80) /* drive is removable */ |
| 520 | dev_desc->removable = true; |
| 521 | /* get info for this device */ |
| 522 | scsi_ident_cpy((unsigned char *)dev_desc->vendor, |
| 523 | &tempbuff[8], 8); |
| 524 | scsi_ident_cpy((unsigned char *)dev_desc->product, |
| 525 | &tempbuff[16], 16); |
| 526 | scsi_ident_cpy((unsigned char *)dev_desc->revision, |
| 527 | &tempbuff[32], 4); |
| 528 | dev_desc->target = pccb->target; |
| 529 | dev_desc->lun = pccb->lun; |
| 530 | |
| 531 | pccb->datalen = 0; |
| 532 | scsi_setup_test_unit_ready(pccb); |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 533 | if (scsi_exec(dev, pccb) != true) { |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 534 | if (dev_desc->removable) { |
| 535 | dev_desc->type = perq; |
| 536 | goto removable; |
| 537 | } |
| 538 | scsi_print_error(pccb); |
| 539 | return -EINVAL; |
| 540 | } |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 541 | if (scsi_read_capacity(dev, pccb, &capacity, &blksz)) { |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 542 | scsi_print_error(pccb); |
| 543 | return -EINVAL; |
| 544 | } |
| 545 | dev_desc->lba = capacity; |
| 546 | dev_desc->blksz = blksz; |
| 547 | dev_desc->log2blksz = LOG2(dev_desc->blksz); |
| 548 | dev_desc->type = perq; |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 549 | removable: |
| 550 | return 0; |
| 551 | } |
| 552 | |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 553 | /* |
| 554 | * (re)-scan the scsi bus and reports scsi device info |
| 555 | * to the user if mode = 1 |
| 556 | */ |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 557 | #if defined(CONFIG_DM_SCSI) |
Jean-Jacques Hiblot | d52063b | 2017-04-24 11:51:26 +0200 | [diff] [blame] | 558 | static int do_scsi_scan_one(struct udevice *dev, int id, int lun, int mode) |
| 559 | { |
| 560 | int ret; |
| 561 | struct udevice *bdev; |
| 562 | struct blk_desc bd; |
| 563 | struct blk_desc *bdesc; |
| 564 | char str[10]; |
| 565 | |
| 566 | /* |
| 567 | * detect the scsi driver to get information about its geometry (block |
| 568 | * size, number of blocks) and other parameters (ids, type, ...) |
| 569 | */ |
| 570 | scsi_init_dev_desc_priv(&bd); |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 571 | if (scsi_detect_dev(dev, id, lun, &bd)) |
Jean-Jacques Hiblot | d52063b | 2017-04-24 11:51:26 +0200 | [diff] [blame] | 572 | return -ENODEV; |
| 573 | |
| 574 | /* |
| 575 | * Create only one block device and do detection |
| 576 | * to make sure that there won't be a lot of |
| 577 | * block devices created |
| 578 | */ |
| 579 | snprintf(str, sizeof(str), "id%dlun%d", id, lun); |
| 580 | ret = blk_create_devicef(dev, "scsi_blk", str, IF_TYPE_SCSI, -1, |
| 581 | bd.blksz, bd.blksz * bd.lba, &bdev); |
| 582 | if (ret) { |
| 583 | debug("Can't create device\n"); |
| 584 | return ret; |
| 585 | } |
| 586 | |
| 587 | bdesc = dev_get_uclass_platdata(bdev); |
| 588 | bdesc->target = id; |
| 589 | bdesc->lun = lun; |
| 590 | bdesc->removable = bd.removable; |
| 591 | bdesc->type = bd.type; |
| 592 | memcpy(&bdesc->vendor, &bd.vendor, sizeof(bd.vendor)); |
| 593 | memcpy(&bdesc->product, &bd.product, sizeof(bd.product)); |
| 594 | memcpy(&bdesc->revision, &bd.revision, sizeof(bd.revision)); |
| 595 | part_init(bdesc); |
| 596 | |
| 597 | if (mode == 1) { |
| 598 | printf(" Device %d: ", 0); |
| 599 | dev_print(bdesc); |
| 600 | } |
| 601 | return 0; |
| 602 | } |
| 603 | |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 604 | int scsi_scan(int mode) |
| 605 | { |
| 606 | unsigned char i, lun; |
| 607 | struct uclass *uc; |
| 608 | struct udevice *dev; /* SCSI controller */ |
| 609 | int ret; |
| 610 | |
| 611 | if (mode == 1) |
| 612 | printf("scanning bus for devices...\n"); |
| 613 | |
Michal Simek | f8f41ae | 2017-01-02 09:40:09 +0100 | [diff] [blame] | 614 | blk_unbind_all(IF_TYPE_SCSI); |
| 615 | |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 616 | ret = uclass_get(UCLASS_SCSI, &uc); |
| 617 | if (ret) |
| 618 | return ret; |
| 619 | |
| 620 | uclass_foreach_dev(dev, uc) { |
| 621 | struct scsi_platdata *plat; /* scsi controller platdata */ |
| 622 | |
| 623 | /* probe SCSI controller driver */ |
| 624 | ret = device_probe(dev); |
| 625 | if (ret) |
| 626 | return ret; |
| 627 | |
| 628 | /* Get controller platdata */ |
Simon Glass | 1dc64f6 | 2017-06-14 21:28:31 -0600 | [diff] [blame] | 629 | plat = dev_get_uclass_platdata(dev); |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 630 | |
Jean-Jacques Hiblot | d52063b | 2017-04-24 11:51:26 +0200 | [diff] [blame] | 631 | for (i = 0; i < plat->max_id; i++) |
| 632 | for (lun = 0; lun < plat->max_lun; lun++) |
| 633 | do_scsi_scan_one(dev, i, lun, mode); |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 634 | } |
| 635 | |
| 636 | return 0; |
| 637 | } |
| 638 | #else |
Michal Simek | c002e39 | 2016-11-30 12:12:31 +0100 | [diff] [blame] | 639 | int scsi_scan(int mode) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 640 | { |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 641 | unsigned char i, lun; |
| 642 | int ret; |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 643 | |
| 644 | if (mode == 1) |
| 645 | printf("scanning bus for devices...\n"); |
Michal Simek | 92ca476 | 2016-11-18 15:27:00 +0100 | [diff] [blame] | 646 | for (i = 0; i < CONFIG_SYS_SCSI_MAX_DEVICE; i++) |
| 647 | scsi_init_dev_desc(&scsi_dev_desc[i], i); |
| 648 | |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 649 | scsi_max_devs = 0; |
| 650 | for (i = 0; i < CONFIG_SYS_SCSI_MAX_SCSI_ID; i++) { |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 651 | for (lun = 0; lun < CONFIG_SYS_SCSI_MAX_LUN; lun++) { |
Simon Glass | 4682c8a | 2017-06-14 21:28:40 -0600 | [diff] [blame^] | 652 | ret = scsi_detect_dev(NULL, i, lun, |
Jean-Jacques Hiblot | e39cecf | 2017-04-07 13:42:06 +0200 | [diff] [blame] | 653 | &scsi_dev_desc[scsi_max_devs]); |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 654 | if (ret) |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 655 | continue; |
Jean-Jacques Hiblot | 1330a72 | 2017-04-07 13:42:07 +0200 | [diff] [blame] | 656 | part_init(&scsi_dev_desc[scsi_max_devs]); |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 657 | |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 658 | if (mode == 1) { |
Michal Simek | 570712f | 2016-11-18 15:42:13 +0100 | [diff] [blame] | 659 | printf(" Device %d: ", 0); |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 660 | dev_print(&scsi_dev_desc[scsi_max_devs]); |
| 661 | } /* if mode */ |
| 662 | scsi_max_devs++; |
| 663 | } /* next LUN */ |
| 664 | } |
| 665 | if (scsi_max_devs > 0) |
| 666 | scsi_curr_dev = 0; |
| 667 | else |
| 668 | scsi_curr_dev = -1; |
| 669 | |
| 670 | printf("Found %d device(s).\n", scsi_max_devs); |
| 671 | #ifndef CONFIG_SPL_BUILD |
| 672 | setenv_ulong("scsidevs", scsi_max_devs); |
| 673 | #endif |
Michal Simek | c002e39 | 2016-11-30 12:12:31 +0100 | [diff] [blame] | 674 | return 0; |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 675 | } |
Michal Simek | e8a016b | 2016-09-08 15:06:45 +0200 | [diff] [blame] | 676 | #endif |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 677 | |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 678 | #ifdef CONFIG_BLK |
| 679 | static const struct blk_ops scsi_blk_ops = { |
| 680 | .read = scsi_read, |
| 681 | .write = scsi_write, |
| 682 | }; |
| 683 | |
| 684 | U_BOOT_DRIVER(scsi_blk) = { |
| 685 | .name = "scsi_blk", |
| 686 | .id = UCLASS_BLK, |
| 687 | .ops = &scsi_blk_ops, |
| 688 | }; |
| 689 | #else |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 690 | U_BOOT_LEGACY_BLK(scsi) = { |
Ed Swarthout | 69c125f | 2016-06-01 08:11:24 -0500 | [diff] [blame] | 691 | .if_typename = "scsi", |
Simon Glass | 11f610e | 2016-05-01 11:36:09 -0600 | [diff] [blame] | 692 | .if_type = IF_TYPE_SCSI, |
| 693 | .max_devs = CONFIG_SYS_SCSI_MAX_DEVICE, |
| 694 | .desc = scsi_dev_desc, |
| 695 | }; |
Simon Glass | 535556b | 2016-05-01 11:36:24 -0600 | [diff] [blame] | 696 | #endif |