Commit 32e9ec1f8812ffe5874a2e3a0a1b8fe85c489ab8
1 parent
7337fcd8c0
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
x86: Move link to use driver model for SCSI
As a demonstration of how to use SCSI with driver model, move link over to use this. This patch needs more work, but illustrates the concept. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Showing 4 changed files with 27 additions and 1 deletions Side-by-side Diff
arch/x86/cpu/ivybridge/sata.c
... | ... | @@ -6,6 +6,7 @@ |
6 | 6 | */ |
7 | 7 | |
8 | 8 | #include <common.h> |
9 | +#include <ahci.h> | |
9 | 10 | #include <dm.h> |
10 | 11 | #include <fdtdec.h> |
11 | 12 | #include <asm/io.h> |
... | ... | @@ -208,6 +209,20 @@ |
208 | 209 | dm_pci_write_config16(dev, 0x90, map); |
209 | 210 | } |
210 | 211 | |
212 | +static int bd82x6x_sata_bind(struct udevice *dev) | |
213 | +{ | |
214 | + struct udevice *scsi_dev; | |
215 | + int ret; | |
216 | + | |
217 | + if (gd->flags & GD_FLG_RELOC) { | |
218 | + ret = ahci_bind_scsi(dev, &scsi_dev); | |
219 | + if (ret) | |
220 | + return ret; | |
221 | + } | |
222 | + | |
223 | + return 0; | |
224 | +} | |
225 | + | |
211 | 226 | static int bd82x6x_sata_probe(struct udevice *dev) |
212 | 227 | { |
213 | 228 | struct udevice *pch; |
214 | 229 | |
... | ... | @@ -219,8 +234,12 @@ |
219 | 234 | |
220 | 235 | if (!(gd->flags & GD_FLG_RELOC)) |
221 | 236 | bd82x6x_sata_enable(dev); |
222 | - else | |
237 | + else { | |
223 | 238 | bd82x6x_sata_init(dev, pch); |
239 | + ret = ahci_probe_scsi(dev); | |
240 | + if (ret) | |
241 | + return ret; | |
242 | + } | |
224 | 243 | |
225 | 244 | return 0; |
226 | 245 | } |
... | ... | @@ -234,6 +253,7 @@ |
234 | 253 | .name = "ahci_ivybridge", |
235 | 254 | .id = UCLASS_AHCI, |
236 | 255 | .of_match = bd82x6x_ahci_ids, |
256 | + .bind = bd82x6x_sata_bind, | |
237 | 257 | .probe = bd82x6x_sata_probe, |
238 | 258 | }; |
configs/chromebook_link64_defconfig
configs/chromebook_link_defconfig