
Hi Ken,
On 27 March 2017 at 02:28, Ken Ma make@marvell.com wrote:
Hi Stefan
Thanks a lot for your kind reply.
But I still do not think it's very good to change sata's uclass id from "UCLASS_AHCI" to "UCLASS_SCSI".
If we do such change, UCLASS_AHCI is lost since from the sata.c codes, it does the AHCI initialization work but not SCSI initialization work.
If u-boot supports ISIS scanner which supports SCSI, I think its uclass id should be like UCLASS_ISIS but not UCLASS_SCSI.
And if we set sata's uclass id as "UCLASS_SCSI", it should provide basic SCSI function, then why can’t we connect a parallel SCSI device like SCSI scanner or cd-rom to the SATA interface?
From https://en.wikipedia.org/wiki/Serial_ATA#SATA_and_SCSI
In general, SATA devices link compatibly to SAS enclosures and adapters, whereas SCSI devices cannot be directly connected to a SATA bus
Actually Marvell’s sata controller is SAS(Serial Attached SCSI system), it integrates SCSI and SATA(AHCI); SAS provides a SCSI bus which works only in SAS range(for example, 2 sata ports in SAS), so actually the SCSI bus controller is not "virtual" controllers but has the same device base register as SATA.
From https://en.wikipedia.org/wiki/Serial_Attached_SCSI
A typical Serial Attached SCSI system consists of the following basic components:
- An initiator: a device that originates device-service and
task-management requests for processing by a target device and receives responses for the same requests from other target devices. Initiators may be provided as an on-board component on the motherboard (as is the case with many server-oriented motherboards) or as an add-on host bus adapter.
- A target: …
So in my opinion, there are two ways to implement SAS as below
A. If our codes provide SAS controller as an on-board component – then a uclass id of UCLASS_SAS should be defined and then in scsi_scan() of scsi_scan.c, both devices of UCLASS_SCSI and UCLASS_SAS should be scanned. In such implementation, UCLASS_SCSI is for parallel SCSI while UCLASS_SAS is for serial attached SCSI;
B. SAS works as an add-on host bus adapter as above said, SAS’s SCSI controller and AHCI controller are both itself as below - SCSI controller is not a virtual device, it exists and only works in SAS internal range(since there is no UCLASS_SAS, I take this way);
Although the SAS’s SCSI controller does not need to any special hardware configuration; but actually I think there is something to do, we should bind special scsi_exec() to SCSI devices in SCSI driver or SAS driver (For different SCSI controls, SAS must have different implementation of scsi_exec() comparing to SCSI scanner, or other SCSI devices)
By the way, I think we should move the work of creating block devices to scsi-uclass.c
scsi: scsi@e0000 {
compatible = "marvell,mvebu-scsi";
reg = <0xe0000 0x2000>;
sata: sata@e0000 { compatible = "marvell,armada-3700-ahci"; reg = <0xe0000 0x2000>; interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>; };
Does this match the Linux DT?
};
Yours,
Ken
Regards, Simon