About t1042 fsl sata driver

Yusuf Kaya ysf.kya34 at gmail.com
Thu Dec 24 11:47:39 CET 2020


Hi,

I'm confused about usage of DCC(Data DWord Count) Field of PRD Entries in
fsl_sata.c

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 working but according to t1042
reference manual it should work wrongly.


I guess I misunderstand something about PRD Entries. Could you explain
it for me ?


thanks a lot.


More information about the U-Boot mailing list