About SATA PRD Entries

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

About SATA PRD Entries

2,349 次查看
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.

标签 (1)
标记 (2)
0 项奖励
回复
5 回复数

2,333 次查看
ufedor
NXP Employee
NXP Employee

Which file is in question?

0 项奖励
回复

2,328 次查看
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 项奖励
回复

2,318 次查看
ufedor
NXP Employee
NXP Employee
0 项奖励
回复

2,302 次查看
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.

标记 (1)
0 项奖励
回复

2,256 次查看
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 项奖励
回复