[Top] [All Lists]

Re: [PATCH V2 2/4] MIPS: Add board support for Loongson1B

To: Giuseppe CAVALLARO <>
Subject: Re: [PATCH V2 2/4] MIPS: Add board support for Loongson1B
From: Kelvin Cheung <>
Date: Tue, 25 Oct 2011 10:12:43 +0800
Cc: Wu Zhangjin <>,,,,,
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vFVgWudIQSI2aYjzAq1xwwcQ/cIuhV4ByydXVvH9fuU=; b=n1wJAurGOvfNguH/YsqpDg0Ujb0wEzN2WXb2oFzwyN5y1/QYyfSZvrI9e4v8jHHzxo 39pewFOozZOK6cIbOFuOfoCfuxphgYIb0GVd9a02d2ZfmaeoGsf2Y/b133Xub1YjRdp/ 4/bOh4oOUHOgfDAClJRc/ILwSEqdDtMi8C4ZQ=
In-reply-to: <>
References: <> <> <> <> <> <> <> <>
2011/10/24, Giuseppe CAVALLARO <>:
> On 10/24/2011 4:05 PM, Kelvin Cheung wrote:
>> 2011/10/24, Giuseppe CAVALLARO <>:
>>> Hello Kelvin.
>>> On 10/24/2011 12:36 PM, Kelvin Cheung wrote:
>>> [snip]
>>>> According to datasheet of Loongson 1B, the buffer size in RX/TX
>>>> descriptor is only 2KB. So the Loongson1B's GMAC could not handle
>>>> jumbo frames. And the second buffer is useless in this case. Am I
>>>> right? Is there a better way than ifdef CONFIG_MACH_LOONGSON1 to
>>>> avoid duplicate code?
>>> Sorry for my misunderstanding.
>>> I think you have to use the normal descriptor and remove the enh_desc
>>> from the platform w/o modifying the driver at all.
>>> The driver will be able to select/configure all automatically (also
>>> jumbo).
>>> Let me know.
>> That's the problem.
>> The bitfield definition of Loongson1B is also different from normal
>> descriptor.
> The problem is not in the Loongson1B gmac.

I found that the bit checksum_insertion is not existed in normal descriptor.

> The normal descriptor fields in the stmmac refer to an old synopsys
> databook.

Could you send me the new databook of Synopsys GMAC?

> New chips have the same structure you have added; so we should fix this
> in the driver w/o breaking the compatibility for old chips.


> I kindly ask you to confirm if the currently normal descriptor structure
> (w/o your changes) doesn't work on your platform.
> Did you test it?

Well, the normal descriptor works on my platform except TX checksum offload.

>> Moreover, I want to enable the TX checksum offload function which is
>> not supported in normal descriptor.
>> Any suggestions?
> It is supported but you have to pass from the platform: tx_coe = 1.

I noticed that the flag csum_insertion is passed to
ndesc_prepare_tx_desc() in stmmac_xmit(). But ndesc_prepare_tx_desc()
just ignores it.
In other words, the TX checksum offload function is disabled in normal
descriptor currently.

Should we fix this problem for normal descriptor?

> Peppe
>>> Note:
>>> IIRC, there is a bit difference in case of normal descriptors for
>>> Synopsys databook newer than the 1.91 (I used for testing this mode).
>>> In any case, I remember that, on some platforms, the normal descriptors
>>> have been used w/o problems also on these new chip generations.
>>> Peppe

Best Regards!

<Prev in Thread] Current Thread [Next in Thread>