pinctrl: sh-pfc: r8a7794: add EtherAVB pin groups
diff mbox

Message ID 3010555.FcVIno0yOe@wasted.cogentembedded.com
State New
Headers show

Commit Message

Sergei Shtylyov Feb. 17, 2016, 10:32 p.m. UTC
Add the EtherAVB pin groups to the R8A7794 PFC driver.

Based on the patches by Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against the 'devel' branch of Linus Walleij's 'linux-pinctrl.git'
repo plus the SSI/audio clock patches posted last week.

 drivers/pinctrl/sh-pfc/pfc-r8a7794.c |  123 +++++++++++++++++++++++++++++++++++
 1 file changed, 123 insertions(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Geert Uytterhoeven Feb. 18, 2016, 8:36 a.m. UTC | #1
Hi Sergei,

On Wed, Feb 17, 2016 at 11:32 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Add the EtherAVB pin groups to the R8A7794 PFC driver.
>
> Based on the patches by Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>.

Thank you for your patch!

> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> +static const unsigned int avb_avtp_capture_pins[] = {
> +       RCAR_GP_PIN(5, 11),
> +};
> +static const unsigned int avb_avtp_capture_mux[] = {
> +       AVB_AVTP_CAPTURE_MARK,
> +};
> +static const unsigned int avb_avtp_match_pins[] = {
> +       RCAR_GP_PIN(5, 12),
> +};
> +static const unsigned int avb_avtp_match_mux[] = {
> +       AVB_AVTP_MATCH_MARK,
> +};
> +static const unsigned int avb_avtp_capture_b_pins[] = {
> +       RCAR_GP_PIN(1, 1),
> +};
> +static const unsigned int avb_avtp_capture_b_mux[] = {
> +       AVB_AVTP_CAPTURE_B_MARK,
> +};
> +static const unsigned int avb_avtp_match_b_pins[] = {
> +       RCAR_GP_PIN(1, 2),
> +};
> +static const unsigned int avb_avtp_match_b_mux[] = {
> +       AVB_AVTP_MATCH_B_MARK,
> +};

BTW, the capture pin seems to be available on R-Car E2 only.
The match pin seems to be available on R-Car E2 and V2H only.
The EtherAVB section in the datasheet doesn't clarify this.
Do you know more?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Feb. 18, 2016, 5:40 p.m. UTC | #2
Hello.

On 02/18/2016 11:36 AM, Geert Uytterhoeven wrote:

>> Add the EtherAVB pin groups to the R8A7794 PFC driver.
>>
>> Based on the patches by Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>.
>
> Thank you for your patch!
>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
>> +static const unsigned int avb_avtp_capture_pins[] = {
>> +       RCAR_GP_PIN(5, 11),
>> +};
>> +static const unsigned int avb_avtp_capture_mux[] = {
>> +       AVB_AVTP_CAPTURE_MARK,
>> +};
>> +static const unsigned int avb_avtp_match_pins[] = {
>> +       RCAR_GP_PIN(5, 12),
>> +};
>> +static const unsigned int avb_avtp_match_mux[] = {
>> +       AVB_AVTP_MATCH_MARK,
>> +};
>> +static const unsigned int avb_avtp_capture_b_pins[] = {
>> +       RCAR_GP_PIN(1, 1),
>> +};
>> +static const unsigned int avb_avtp_capture_b_mux[] = {
>> +       AVB_AVTP_CAPTURE_B_MARK,
>> +};
>> +static const unsigned int avb_avtp_match_b_pins[] = {
>> +       RCAR_GP_PIN(1, 2),
>> +};
>> +static const unsigned int avb_avtp_match_b_mux[] = {
>> +       AVB_AVTP_MATCH_B_MARK,
>> +};
>
> BTW, the capture pin seems to be available on R-Car E2 only.

    Yes, I've noticed.

> The match pin seems to be available on R-Car E2 and V2H only.

    Don't have V2H manual, have to trust you. :-)

> The EtherAVB section in the datasheet doesn't clarify this.
> Do you know more?

    Unfortunately, no. I only know what AVTP in the pin name probably stands 
for: Audio/Video Transport Protocol.

> Gr{oetje,eeting}s,
>
>                          Geert

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Feb. 18, 2016, 7:49 p.m. UTC | #3
On Thu, Feb 18, 2016 at 9:36 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:

> On Wed, Feb 17, 2016 at 11:32 PM, Sergei Shtylyov
> <sergei.shtylyov@cogentembedded.com> wrote:
>> Add the EtherAVB pin groups to the R8A7794 PFC driver.
>>
>> Based on the patches by Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>.
>
> Thank you for your patch!
>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

I guess this means you're queueing it too?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Feb. 19, 2016, 8:32 a.m. UTC | #4
On Thu, Feb 18, 2016 at 8:49 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Thu, Feb 18, 2016 at 9:36 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
>
>> On Wed, Feb 17, 2016 at 11:32 PM, Sergei Shtylyov
>> <sergei.shtylyov@cogentembedded.com> wrote:
>>> Add the EtherAVB pin groups to the R8A7794 PFC driver.
>>>
>>> Based on the patches by Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>.
>>
>> Thank you for your patch!
>>
>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> I guess this means you're queueing it too?

Indeed.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

Index: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
===================================================================
--- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
+++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7794.c
@@ -1583,6 +1583,105 @@  static const unsigned int audio_clkout_c
 static const unsigned int audio_clkout_c_mux[] = {
 	AUDIO_CLKOUT_C_MARK,
 };
+/* - AVB -------------------------------------------------------------------- */
+static const unsigned int avb_link_pins[] = {
+	RCAR_GP_PIN(3, 26),
+};
+static const unsigned int avb_link_mux[] = {
+	AVB_LINK_MARK,
+};
+static const unsigned int avb_magic_pins[] = {
+	RCAR_GP_PIN(3, 27),
+};
+static const unsigned int avb_magic_mux[] = {
+	AVB_MAGIC_MARK,
+};
+static const unsigned int avb_phy_int_pins[] = {
+	RCAR_GP_PIN(3, 28),
+};
+static const unsigned int avb_phy_int_mux[] = {
+	AVB_PHY_INT_MARK,
+};
+static const unsigned int avb_mdio_pins[] = {
+	RCAR_GP_PIN(3, 24), RCAR_GP_PIN(3, 25),
+};
+static const unsigned int avb_mdio_mux[] = {
+	AVB_MDC_MARK, AVB_MDIO_MARK,
+};
+static const unsigned int avb_mii_pins[] = {
+	RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+	RCAR_GP_PIN(3, 17),
+
+	RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+	RCAR_GP_PIN(3, 5),
+
+	RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 0), RCAR_GP_PIN(3, 1),
+	RCAR_GP_PIN(3, 29), RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 22),
+	RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 11),
+};
+static const unsigned int avb_mii_mux[] = {
+	AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
+	AVB_TXD3_MARK,
+
+	AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
+	AVB_RXD3_MARK,
+
+	AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
+	AVB_CRS_MARK, AVB_TX_EN_MARK, AVB_TX_ER_MARK,
+	AVB_TX_CLK_MARK, AVB_COL_MARK,
+};
+static const unsigned int avb_gmii_pins[] = {
+	RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
+	RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18), RCAR_GP_PIN(3, 19),
+	RCAR_GP_PIN(3, 20), RCAR_GP_PIN(3, 21),
+
+	RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
+	RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
+	RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
+
+	RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 0), RCAR_GP_PIN(3, 1),
+	RCAR_GP_PIN(3, 29), RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 30),
+	RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 22), RCAR_GP_PIN(3, 13),
+	RCAR_GP_PIN(3, 11),
+};
+static const unsigned int avb_gmii_mux[] = {
+	AVB_TXD0_MARK, AVB_TXD1_MARK, AVB_TXD2_MARK,
+	AVB_TXD3_MARK, AVB_TXD4_MARK, AVB_TXD5_MARK,
+	AVB_TXD6_MARK, AVB_TXD7_MARK,
+
+	AVB_RXD0_MARK, AVB_RXD1_MARK, AVB_RXD2_MARK,
+	AVB_RXD3_MARK, AVB_RXD4_MARK, AVB_RXD5_MARK,
+	AVB_RXD6_MARK, AVB_RXD7_MARK,
+
+	AVB_RX_ER_MARK, AVB_RX_CLK_MARK, AVB_RX_DV_MARK,
+	AVB_CRS_MARK, AVB_GTX_CLK_MARK, AVB_GTXREFCLK_MARK,
+	AVB_TX_EN_MARK, AVB_TX_ER_MARK, AVB_TX_CLK_MARK,
+	AVB_COL_MARK,
+};
+static const unsigned int avb_avtp_capture_pins[] = {
+	RCAR_GP_PIN(5, 11),
+};
+static const unsigned int avb_avtp_capture_mux[] = {
+	AVB_AVTP_CAPTURE_MARK,
+};
+static const unsigned int avb_avtp_match_pins[] = {
+	RCAR_GP_PIN(5, 12),
+};
+static const unsigned int avb_avtp_match_mux[] = {
+	AVB_AVTP_MATCH_MARK,
+};
+static const unsigned int avb_avtp_capture_b_pins[] = {
+	RCAR_GP_PIN(1, 1),
+};
+static const unsigned int avb_avtp_capture_b_mux[] = {
+	AVB_AVTP_CAPTURE_B_MARK,
+};
+static const unsigned int avb_avtp_match_b_pins[] = {
+	RCAR_GP_PIN(1, 2),
+};
+static const unsigned int avb_avtp_match_b_mux[] = {
+	AVB_AVTP_MATCH_B_MARK,
+};
 /* - ETH -------------------------------------------------------------------- */
 static const unsigned int eth_link_pins[] = {
 	/* LINK */
@@ -3255,6 +3354,16 @@  static const struct sh_pfc_pin_group pin
 	SH_PFC_PIN_GROUP(audio_clkout),
 	SH_PFC_PIN_GROUP(audio_clkout_b),
 	SH_PFC_PIN_GROUP(audio_clkout_c),
+	SH_PFC_PIN_GROUP(avb_link),
+	SH_PFC_PIN_GROUP(avb_magic),
+	SH_PFC_PIN_GROUP(avb_phy_int),
+	SH_PFC_PIN_GROUP(avb_mdio),
+	SH_PFC_PIN_GROUP(avb_mii),
+	SH_PFC_PIN_GROUP(avb_gmii),
+	SH_PFC_PIN_GROUP(avb_avtp_capture),
+	SH_PFC_PIN_GROUP(avb_avtp_match),
+	SH_PFC_PIN_GROUP(avb_avtp_capture_b),
+	SH_PFC_PIN_GROUP(avb_avtp_match_b),
 	SH_PFC_PIN_GROUP(eth_link),
 	SH_PFC_PIN_GROUP(eth_magic),
 	SH_PFC_PIN_GROUP(eth_mdio),
@@ -3500,6 +3609,19 @@  static const char * const audio_clk_grou
 	"audio_clkout_c",
 };
 
+static const char * const avb_groups[] = {
+	"avb_link",
+	"avb_magic",
+	"avb_phy_int",
+	"avb_mdio",
+	"avb_mii",
+	"avb_gmii",
+	"avb_avtp_capture",
+	"avb_avtp_match",
+	"avb_avtp_capture_b",
+	"avb_avtp_match_b",
+};
+
 static const char * const eth_groups[] = {
 	"eth_link",
 	"eth_magic",
@@ -3846,6 +3968,7 @@  static const char * const vin1_groups[]
 
 static const struct sh_pfc_function pinmux_functions[] = {
 	SH_PFC_FUNCTION(audio_clk),
+	SH_PFC_FUNCTION(avb),
 	SH_PFC_FUNCTION(eth),
 	SH_PFC_FUNCTION(hscif0),
 	SH_PFC_FUNCTION(hscif1),