All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] ARM: shmobile: r8a7740: Fix ethernet device name in clock definition
Date: Mon, 22 Jul 2013 09:15:05 +0000	[thread overview]
Message-ID: <51ECF819.1020400@renesas.com> (raw)
In-Reply-To: <1373966374-15716-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

Hello,

(2013/07/19 21:17), Sergei Shtylyov wrote:
> Hello.
> 
> On 19-07-2013 8:30, Shimoda, Yoshihiro wrote:
> 
>> < snip >
> 
>>>>>>>> board code callback in sh_eth_plat_data (.set_mdio_gate) isn't used on
>>>>>>>> ARM platforms, so the driver should support pure DT bindings without
>>>>>>>> auxiliary data.
> 
>>>>>>> Maybe it isn't used on ARM but it exists. IMO that's enough reason not to
>>>>>>> convert the platform data to the DT properties.
> 
>>>>>> I don't agree. The proper fix would be to fix the SuperH platform that
>>>>>> uses that callback (there's one only) to replace the callback function
>>>>>> with a proper kernel framework.
> 
>>>>> At least suggest such framework first.
> 
>>>> I would first need to understand what the board code implementes in the
>>>> set_mdio_gate() callback. The callback is used by the SH7757LCR board only, do
>>>> you have access to the board schematics and SH7757 datasheet ?
> 
>>>     No, only for SH7751 manual by coincidence. This SoC doesn't have Ether.
>>> Maybe the original commit (sh: add GETHER's platform_device in board-sh7757lcr) author, Shimoda-san, could help us here? I've CC'ed him.
> 
>> - The SH7757 has 2 MDIO/MDC channels for Gigabit Ethernet.
>> - The board has VSC8244 Gigabit Ethernet PHY.
>> - The VSC8244 has 4 MAC channels. But it has one MDIO/MDC port.
>> - The board's schematic about MDIO/MDC is like below:
>> +--------+ <--- GETHER ch0's MDIO/MDC ---> +-----------+
>> | SH7757 | <--- GETHER ch1's MDIO/MDC ---> | bus swith | <--- MDIO/MDC ---> VSC8244
>> +--------+ <--- GPIO --------------------> +-----------+
> 
>    You apparently forgot to mention 2 Ether devices for which set_mdio_gate() method is also used (this is introduced by the same patch). What is the GBECONT register you also didn't mention?

Sorry, I forgot to mention the GBECONT register.
So, I would like to rewrite my description about .set_mdio_gate() of board-sh7757lcr.c:

- The SH7757 has 2 Gigabit Ethernet controllers (GETHER) and
  2 Fast Ethernet controllers (ETHER).
- The SH7757 has 2 MDIO/MDC channels, but those are multiplexed port.
- The SH7757 has the GBECONT register:
 - If "RMII0" is set to 1, the ETHER channel 0 can use the MDIO/MDC channel 0.
 - If "RMII0" is set to 0, the GETHER channel 0 can use the MDIO/MDC channel 0.
 - If "RMII1" is set to 1, the ETHER channel 1 can use the MDIO/MDC channel 1.
 - If "RMII1" is set to 0, the GETHER channel 1 can use the MDIO/MDC channel 1.
- The board has 2 DP83848C Fast Ethernet PHYs.
- The board has VSC8244 Gigabit Ethernet PHY.
- The VSC8244 has 4 MAC channels. But it has one MDIO/MDC port.
- The board's schematic about MDIO/MDC is like below:
+--------+                     +--> DP83848C
|        | <-- MDIO/MDC ch 0 --+--> +------------+
| SH7757 | <-- GPIO --------------> | bus switch | <-- MDIO/MDC --> VSC8244
|        | <-- MDIO/MDC ch 1 --+--> +------------+
+--------+                     +--> DP83848C
- About the bus switch:
 - If the GPIO is set to high, the bus switch will conenct the MDIO/MDC ch 0 to VSC8244.
 - If the GPIO is set to low, the bus switch will conenct the MDIO/MDC ch 1 to VSC8244.

So, if the ETHER channel 0 wants to use the MDIO/MDC ch 0,
the "RMII0" should be set to 1.
So, if the GETHER channel 0 wants to use the MDIO/MDC ch 0,
the "RMII0" should be set to 0 and the GPIO should be set to High.

Best regards,
Yoshihiro Shimoda

>> So, I added to control the GPIO using the set_mdio_gate() callback on the board.
> 
>> Best regards,
>> Yoshihiro Shimoda
> 
> WBR, Sergei
> 
> 

  parent reply	other threads:[~2013-07-22  9:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16  9:19 [PATCH] ARM: shmobile: r8a7740: Fix ethernet device name in clock definition Laurent Pinchart
2013-07-16 12:27 ` Sergei Shtylyov
2013-07-16 14:26 ` Sergei Shtylyov
2013-07-17 10:47 ` Laurent Pinchart
2013-07-17 13:05 ` Sergei Shtylyov
2013-07-17 13:11 ` Laurent Pinchart
2013-07-17 13:40 ` Sergei Shtylyov
2013-07-17 14:04 ` Laurent Pinchart
2013-07-17 14:20 ` Sergei Shtylyov
2013-07-17 14:48 ` Laurent Pinchart
2013-07-17 23:04 ` Simon Horman
2013-07-18 20:28 ` Sergei Shtylyov
2013-07-18 20:57 ` Laurent Pinchart
2013-07-19  4:30 ` Shimoda, Yoshihiro
2013-07-19 12:17 ` Sergei Shtylyov
2013-07-22  9:15 ` Shimoda, Yoshihiro [this message]
2013-07-22 11:47 ` Sergei Shtylyov

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=51ECF819.1020400@renesas.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=linux-sh@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.