U.Mutlu wrote on 04/25/2019 06:52 PM:
Hi, I'm trying to understand the SATA/AHCI protocol and the libata library in linux. The SATA/AHCI protocol has many operation modes to chose from, like Command based or FIS based, DMA yes/no, specifiying FIFO depth, SATA mode or ATAPI/IDE mode, and there is also something with SCSI etc. etc. Does there exist a (linux) tool which can give information about the current configuration of the SATA/AHCI host controller? Another question is: when the sata/ahci driver gets loaded, to which degree is libata involved in the device initialisation process (for example assigning FIS base address, assigning FIFO buffers etc.)? I stumbled upon this problem because a driver says in its P0FB (offset 0x0108) port register, that it uses the address 0x4a060400 (ARM 32bit platform) as its FIS base address. The spec says the normal FIS receive area size is 256 bytes. But then it says that when using FIS-based switching, software shall allocate a FIS receive area that is 16 times larger than the normal FIS receive area size, ie. 4096 bytes. I couldn't determine yet whether the normal FIS receive area is in use or a different 4096-byte memory area. In the normal case the address is required to be 256-byte aligned, and in the other case 4096-byte aligned. But neither of these requirements holds for the above address.
Oops. Sorry, my bad: I did the calculation as "4a060400 / 256" in hex mode of the calculator... :-)
Of course should have divided by 100 instead of 256 :-)
So, I suspect the device is not optimally configured. And also the device performance is very slow. OTOH I couldn't find any indication in the driver code that it sets this FIS address, so then is it a device issue (default reset-values?), or could it perhaps be a libata issue? # cat /proc/iomem 01c18000-01c18fff : sata@1c18000 ... 40000000-7fffffff : System RAM 40008000-40afffff : Kernel code 40c00000-40cb59cf : Kernel data Thx