linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-sunxi] Re: [PATCH 04/10] net: stmmac: sunxi platfrom extensions for GMAC in Allwinner A20 SoC's
Date: Mon, 09 Dec 2013 20:04:21 +0100	[thread overview]
Message-ID: <52A61435.6040803@redhat.com> (raw)
In-Reply-To: <CAGb2v64LNxnz--vn0u9zwmt7MQJZ=uz2fs0H3zDSse_XDfdK4Q@mail.gmail.com>

Hi,

On 12/09/2013 06:56 PM, Chen-Yu Tsai wrote:
> Hi,
>
> On Tue, Dec 10, 2013 at 12:16 AM, Hans de Goede <hdegoede@redhat.com> wrote:
>> Hi,
>>
>>
>> On 12/09/2013 12:10 PM, srinivas kandagatla wrote:
>>>
>>> Hi Chen,
>>> Good to know that Allwinner uses gmac.
>>>
>>> On ST SoC, we have very similar requirements, before we merge any of
>>> these changes I think we need to come up with common way to solve both
>>> Allwinner and ST SOCs use cases.
>>>
>>> I have already posted few patches on to net-dev
>>> http://lkml.org/lkml/2013/11/12/243 to add Glue driver on top of stmmac
>>> driver.
>>>
>>>
>>> There are few reasons for the way I have done it.
>>>
>>> 1> I did not want to modify gmac driver in any sense to when a new SOC
>>> support is added.
>>> 2> As the SOC specific glue logic sits on top of standard GMAC IP, it
>>> makes sense to represent it proper harware hierarchy.
>>
>>
>> On top often is not the correct term / how things are done in practice.
>>
>> Most of the time the glue are modifications to the ip block, iow in
>> hardware they are not nested / hierarchical at all. We've had similar
>> constructs for ahci platform drivers and there we are actively trying to
>> move away from the whole nested platform devices as that has various
>> issues:
>>
>> 1) It is wrong / does not reflect reality
>> 2) It breaks deferred probing which is often used on SOCs
>>
>> I actually think Wens' approach using a SOC specific init function
>> in platform data is sound, and this is also used a lot else where.
>>
>> As for using the nested approach elsewhere, I only know about AHCI
>> platform driver doing that, and there we are actively trying to move
>> away from it.
>>
>>
>> Now reading this has also made me take a closer look at wens' patch
>> for this. Wens, I see that you directly modify registers in the ccm
>> that is a big no-no instead you should add a helper function to
>> sunxi-clk.c and use that, see ie:
>> https://bitbucket.org/emiliolopez/linux/commits/2b95847d9aa4aa13317dd7358ffcbd951dcb5eff?at=master
>
> Yes, this has been raised by Maxime. The odd "GMAC_IF_TYPE_RGMII" or
> "gmac interface type bit" has been bugging me.
>
> Additionally, the TX clock has 2 inputs (not counting MII [1]).
> The internal one is most likely controlled by the GMAC. The clock
> rate is set internally to match the link speed. The external clock
> source has controllable dividers to get the correct clock rate.
> This shouldn't be hard to model with CCF though.
>
> In hardware, this is probably a mux between the GMAC clock generator
> and the GMAC data transmit logic.
>
> My current plan is to choose MII when the clock is disabled,
> and choose either of the inputs when it is enabled. I will
> have to learn more about the CCF first.

OK, in this case I would be tempted to just go with a custom sunxi
function in the sunx-clk mode like what we have for the mmc stuff,
but if you think you can model this with the regular clock stuff,
that is of course fine too :)

Regards,

Hans

  reply	other threads:[~2013-12-09 19:04 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06 17:29 [PATCH 00/10] net: stmmac: Add sun7i GMAC glue layer Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 01/10] net: stmmac: Enable stmmac main clock when probing hardware Chen-Yu Tsai
2013-12-07 10:33   ` Maxime Ripard
2013-12-09  2:43     ` Chen-Yu Tsai
2013-12-09 10:09       ` [linux-sunxi] " Hans de Goede
2013-12-10 20:05       ` Maxime Ripard
2013-12-12  4:31         ` Chen-Yu Tsai
2013-12-09  7:14   ` Giuseppe CAVALLARO
2013-12-09  7:26     ` Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 02/10] net: stmmac: Honor DT parameter to force DMA store and forward mode Chen-Yu Tsai
2013-12-06 21:26   ` David Miller
2013-12-07  1:23     ` Chen-Yu Tsai
2013-12-07 10:07       ` maxime.ripard
2013-12-07 11:06         ` Tomasz Figa
2013-12-09  2:59           ` [linux-sunxi] " Chen-Yu Tsai
2013-12-10 20:10             ` maxime.ripard
2013-12-06 17:29 ` [PATCH 03/10] net: stmmac: Use platform data tied with compatible strings Chen-Yu Tsai
2013-12-06 21:26   ` David Miller
2013-12-07  2:13     ` Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 04/10] net: stmmac: sunxi platfrom extensions for GMAC in Allwinner A20 SoC's Chen-Yu Tsai
2013-12-07 10:27   ` Maxime Ripard
2013-12-07 11:12     ` Tomasz Figa
2013-12-07 11:46       ` Maxime Ripard
2013-12-07 12:50         ` Tomasz Figa
2013-12-07 13:34           ` [linux-sunxi] " Emilio López
2013-12-09 11:10   ` srinivas kandagatla
2013-12-09 16:16     ` [linux-sunxi] " Hans de Goede
2013-12-09 17:56       ` Chen-Yu Tsai
2013-12-09 19:04         ` Hans de Goede [this message]
2013-12-10 20:14           ` Maxime Ripard
2013-12-09 17:34     ` Chen-Yu Tsai
2013-12-10 14:59       ` srinivas kandagatla
2013-12-10 20:23         ` Maxime Ripard
2013-12-11 12:17         ` Chen-Yu Tsai
2013-12-11 14:45           ` srinivas kandagatla
2013-12-12  7:27             ` Chen-Yu Tsai
2013-12-12  9:04             ` Maxime Ripard
2013-12-12 10:31               ` Chen-Yu Tsai
2013-12-13 10:38                 ` Maxime Ripard
2013-12-24  3:27                   ` [linux-sunxi] " Chen-Yu Tsai
2014-01-02 13:11                     ` srinivas kandagatla
2014-01-07 10:24                       ` Chen-Yu Tsai
2013-12-09 11:21   ` srinivas kandagatla
2013-12-09 13:44     ` Sergei Shtylyov
2013-12-09 15:45       ` [linux-sunxi] " Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 05/10] ARM: dts: sun7i: Add GMAC controller node to sun7i DTSI Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 06/10] ARM: dts: sun7i: Add pin muxing options for the GMAC Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 07/10] ARM: dts: sun7i: cubietruck: Enable " Chen-Yu Tsai
2013-12-06 21:09   ` Florian Fainelli
2013-12-07  1:35     ` Chen-Yu Tsai
2013-12-07  1:57       ` Florian Fainelli
2013-12-09  2:55         ` Chen-Yu Tsai
2013-12-09 17:48           ` Florian Fainelli
2013-12-10  4:11             ` Chen-Yu Tsai
2013-12-10 17:23               ` Florian Fainelli
2013-12-13 10:21         ` Giuseppe CAVALLARO
2013-12-06 17:29 ` [PATCH 08/10] ARM: dts: sun7i: cubieboard2: Enable GMAC instead of EMAC Chen-Yu Tsai
2013-12-06 21:10   ` Florian Fainelli
2013-12-06 17:29 ` [PATCH 09/10] ARM: dts: sun7i: olinuxino-micro: " Chen-Yu Tsai
2013-12-06 17:29 ` [PATCH 10/10] ARM: dts: sun7i: Add ethernet alias for GMAC Chen-Yu Tsai
2013-12-07 10:15   ` Maxime Ripard
2013-12-07 16:20     ` Chen-Yu Tsai
2013-12-06 20:52 ` [linux-sunxi] [PATCH 00/10] net: stmmac: Add sun7i GMAC glue layer Michal Suchanek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52A61435.6040803@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).