Hi,
In T1042 Reference manual, DCC field is explained as the following way;
Data DWord count. A 0-based value that Indicates the length, in DWords, of the data block. A
maximum length of 32 Mbytes may exist for any entry. Bits 1-0 of this field must always be 0 to
indicate that size is in 4-byte words. A value of 24'b0 indicates a full 32 Mbytes transfer.
but in the fsl driver code of u-boot, this field is acted like DBC(Data Byte Count). The following is part of the driver code that handles PRD Entries.
if (len < PRD_ENTRY_MAX_XFER_SZ) { ext_c_ddc = PRD_ENTRY_DATA_SNOOP | len; debug("ext_c_ddc1 = %08x, len = %08x\n\r", ext_c_ddc, len); prde->ext_c_ddc = cpu_to_le32(ext_c_ddc); prde_count++; prde++; break; } else { ext_c_ddc = PRD_ENTRY_DATA_SNOOP; /* 4M bytes */ debug("ext_c_ddc2 = %08x, len = %08x\n\r", ext_c_ddc, len); prde->ext_c_ddc = cpu_to_le32(ext_c_ddc); buffer += PRD_ENTRY_MAX_XFER_SZ; len -= PRD_ENTRY_MAX_XFER_SZ; prde_count++; prde++; }
In the above code, PRD_ENTRY_MAX_XFER_SZ is defined as 4 MB and DDC field of PDR entries are using like DBC. I didnt understand that part of the code and Reference Manual also specifies maximum transfer size of data is 32 Mbytes not 4Mbytes.
the fsl sata driver code of u-boot is old or i misunderstand something about sata spec.
thanks a lot.
Which file is in question?
file is drivers/ata/fsl_sata.c
https://github.com/u-boot/u-boot/blob/master/drivers/ata/fsl_sata.c
DCC field explanation in T1042 ref manual is not correct or not very well.
Should be "sata_fsl.c":
https://source.codeaurora.org/external/qoriq/qoriq-components/linux/tree/drivers/ata/sata_fsl.c
I wonder how fsl sata driver of u-boot works because fsl sata driver of u-boot writes data length in bytes(not in dword count) to ddc field of prd entries.
> sata driver of u-boot writes data length in bytes
Please use a debugger and provide debug data for the corresponding operation.