About SATA PRD Entries

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

About SATA PRD Entries

1,896 Views
love_hate_and_repeat
Contributor III

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.

Labels (1)
Tags (2)
0 Kudos
Reply
5 Replies

1,880 Views
ufedor
NXP Employee
NXP Employee

Which file is in question?

0 Kudos
Reply

1,875 Views
love_hate_and_repeat
Contributor III

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.

0 Kudos
Reply

1,865 Views
ufedor
NXP Employee
NXP Employee
0 Kudos
Reply

1,849 Views
love_hate_and_repeat
Contributor III

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.

Tags (1)
0 Kudos
Reply

1,803 Views
ufedor
NXP Employee
NXP Employee

> sata driver of u-boot writes data length in bytes

Please use a debugger and provide debug data for the corresponding operation.

0 Kudos
Reply