[PATCH linux 3/4] ftgmac100: Add devicetree option for the Aspeed g5 register interface

Cédric Le Goater clg at kaod.org
Fri Jun 24 03:09:30 AEST 2016


On 06/10/2016 02:08 PM, Cédric Le Goater wrote:
> Hello, 
> 
> On 06/10/2016 10:46 AM, Joel Stanley wrote:
>> On Thu, Jun 9, 2016 at 11:44 PM, Andrew Jeffery <andrew at aj.id.au> wrote:
>>> @@ -1346,6 +1358,15 @@ static int ftgmac100_probe(struct platform_device *pdev)
>>>                 priv->use_ncsi = false;
>>>         }
>>>
>>> +       if (pdev->dev.of_node &&
>>> +           of_get_property(pdev->dev.of_node, "aspeed-g5-interface", NULL)) {
>>
>> We should get our device tree experts to chime in here.
>>
>> An alternative could be to use
>> of_machine_is_compatible("aspeed,ast2500"). Then we don't need extra
>> properties.
> 
> yes. That would be better.
> 
> 
> So, given that there always has been fixes from Aspeed on the driver in
> u-boot (see below), it seems that these EDO bits have been wrong since
> the beginning in Linux.
> 
> I am wondering what how this was working. We should probably contact 
> Aspeed to have some clarification.

Aspeed said that they have a different design than Faraday and we should 
be using :

	#define FTGMAC100_TXDES0_EDOTR		(1 << 30) 
	#define FTGMAC100_RXDES0_EDORR		(1 << 30)	

for all boards : ast2400 *and* ast2500. 

I gave it a try on a palmetto and indeed, network works fine with the 
Aspeed EDO{T,R}R bits. 
  
Cheers,

C.
 

> Current SDK (fixed):
> 
> ./u-boot-v2016.05-ast2500/drivers/net/ftgmac100.h://#define FTGMAC100_TXDES0_EDOTR		(1 << 15)
> ./u-boot-v2016.05-ast2500/drivers/net/ftgmac100.h:#define FTGMAC100_TXDES0_EDOTR		(1 << 30) //org is 15 ->30
> ./u-boot-v2016.05-ast2500/drivers/net/ftgmac100.h://#define FTGMAC100_RXDES0_EDORR		(1 << 15)
> ./u-boot-v2016.05-ast2500/drivers/net/ftgmac100.h:#define FTGMAC100_RXDES0_EDORR		(1 << 30)	//org 15->30
> ./u-boot-2013.01-aspeed/drivers/net/ftgmac100.h://#define FTGMAC100_TXDES0_EDOTR		(1 << 15)
> ./u-boot-2013.01-aspeed/drivers/net/ftgmac100.h:#define FTGMAC100_TXDES0_EDOTR		(1 << 30) //org is 15 ->30
> ./u-boot-2013.01-aspeed/drivers/net/ftgmac100.h://#define FTGMAC100_RXDES0_EDORR		(1 << 15)
> ./u-boot-2013.01-aspeed/drivers/net/ftgmac100.h:#define FTGMAC100_RXDES0_EDORR		(1 << 30)	//org 15->30
> 
> Older SDK (only aspeednic is fixed with a comment)
> 
> ./u-boot-github-v2016.03-aspeed-openbmc/drivers/net/aspeednic.c://#define EDORR   0x00008000  /* Receive End Of Ring */
> ./u-boot-github-v2016.03-aspeed-openbmc/drivers/net/aspeednic.c:#define EDORR   0x40000000  /* Receive End Of Ring */
> ./u-boot-github-v2016.03-aspeed-openbmc/drivers/net/aspeednic.c://#define EDOTR   0x00008000  /* Transmit End Of Ring */
> ./u-boot-github-v2016.03-aspeed-openbmc/drivers/net/aspeednic.c:#define EDOTR   0x40000000  /* Transmit End Of Ring */
> ./u-boot-github-v2016.03-aspeed-openbmc/drivers/net/aspeednic.c:  rx_ring[rxRingSize - 1].status |= cpu_to_le32(EDORR);
> ./u-boot-github-v2016.03-aspeed-openbmc/drivers/net/aspeednic.c:  tx_ring[txRingSize - 1].status |= cpu_to_le32(EDOTR);
> 
> ./u-boot-github-v2016.03-aspeed-openbmc/drivers/net/ftgmac100.h:#define FTGMAC100_TXDES0_EDOTR		(1 << 15)
> ./u-boot-github-v2016.03-aspeed-openbmc/drivers/net/ftgmac100.h:#define FTGMAC100_RXDES0_EDORR		(1 << 15)
> 
> Mainline (broken):
> 
> ./u-boot/drivers/net/ftgmac100.h:#define FTGMAC100_TXDES0_EDOTR		(1 << 15)
> ./u-boot/drivers/net/ftgmac100.h:#define FTGMAC100_RXDES0_EDORR		(1 << 15)
> 
> 
> 
> 



More information about the openbmc mailing list