From: nsekhar@ti.com (Sekhar Nori)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac
Date: Thu, 8 Aug 2013 21:35:37 +0530 [thread overview]
Message-ID: <5203C1D1.8020707@ti.com> (raw)
In-Reply-To: <CA+V-a8smEd_75Ab-_vxjBATr8Q9Sefs0tpxc+kgQJRtuLJad=w@mail.gmail.com>
On Thursday 08 August 2013 04:02 PM, Prabhakar Lad wrote:
> Hi Sekhar,
>
> Sorry for the delayed response I was on leave and now back again up
> and running.
>
> On Wed, Jul 31, 2013 at 11:17 AM, Sekhar Nori <nsekhar@ti.com> wrote:
>> On Sunday 23 June 2013 08:30 PM, Prabhakar Lad wrote:
>>> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
>>>
>>> This patch makes a common function for to configure emac and calls
>>> it appropriately in DT and non DT boot mode. The system configuration
>>> chip CFGCHIP3, controls the emac module. This patch appropriately
>>> configures this register for emac and sets DA850_MII_MDIO_CLKEN_PIN
>>> GPIO pin appropriately.
>>>
> [Snip]
>
>>> + if (rmii_enabled)
>>> + val |= BIT(8);
>>> + else
>>> + val &= ~BIT(8);
>>> +
>>> + /* configure the CFGCHIP3 register for RMII or MII */
>>> + writel(val, cfg_chip3_base);
>>> +
>>> + ret = davinci_cfg_reg(DA850_GPIO2_6);
>>> + if (ret)
>>> + pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
>>> +
>>> + ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
>>> + if (ret) {
>>> + pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
>>> + return;
>>> + }
>>
>> You cannot do this in SoC specific code. All boards wont use a GPIO to
>> choose between MII/RMII. You need to do this in a EVM specific manner.
>> This just means you retain the GPIO part of code in board-da850-evm.c
>
> OK
>
>> and for the DT case use a board specific GPIO node. See a similar
>> example in arch/arm/boot/dts/ste-nomadik-s8815.dts and how the code uses
> Alrite something similar to usb-s8815 node.
>
>> it in arch/arm/mach-nomadik/cpu-8815.c.
>>
> But I don't see any code to access this node in this file, can
> you point me to right direction ?
Look at cpu8815_eth_init() function in this file.
Thanks,
Sekhar
WARNING: multiple messages have this Message-ID (diff)
From: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>
To: Prabhakar Lad <prabhakar.csengg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: DLOS
<davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Heiko Schocher <hs-ynQEQJNshbs@public.gmane.org>,
LAK
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v3 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac
Date: Thu, 8 Aug 2013 21:35:37 +0530 [thread overview]
Message-ID: <5203C1D1.8020707@ti.com> (raw)
In-Reply-To: <CA+V-a8smEd_75Ab-_vxjBATr8Q9Sefs0tpxc+kgQJRtuLJad=w@mail.gmail.com>
On Thursday 08 August 2013 04:02 PM, Prabhakar Lad wrote:
> Hi Sekhar,
>
> Sorry for the delayed response I was on leave and now back again up
> and running.
>
> On Wed, Jul 31, 2013 at 11:17 AM, Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org> wrote:
>> On Sunday 23 June 2013 08:30 PM, Prabhakar Lad wrote:
>>> From: "Lad, Prabhakar" <prabhakar.csengg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>
>>> This patch makes a common function for to configure emac and calls
>>> it appropriately in DT and non DT boot mode. The system configuration
>>> chip CFGCHIP3, controls the emac module. This patch appropriately
>>> configures this register for emac and sets DA850_MII_MDIO_CLKEN_PIN
>>> GPIO pin appropriately.
>>>
> [Snip]
>
>>> + if (rmii_enabled)
>>> + val |= BIT(8);
>>> + else
>>> + val &= ~BIT(8);
>>> +
>>> + /* configure the CFGCHIP3 register for RMII or MII */
>>> + writel(val, cfg_chip3_base);
>>> +
>>> + ret = davinci_cfg_reg(DA850_GPIO2_6);
>>> + if (ret)
>>> + pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
>>> +
>>> + ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
>>> + if (ret) {
>>> + pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
>>> + return;
>>> + }
>>
>> You cannot do this in SoC specific code. All boards wont use a GPIO to
>> choose between MII/RMII. You need to do this in a EVM specific manner.
>> This just means you retain the GPIO part of code in board-da850-evm.c
>
> OK
>
>> and for the DT case use a board specific GPIO node. See a similar
>> example in arch/arm/boot/dts/ste-nomadik-s8815.dts and how the code uses
> Alrite something similar to usb-s8815 node.
>
>> it in arch/arm/mach-nomadik/cpu-8815.c.
>>
> But I don't see any code to access this node in this file, can
> you point me to right direction ?
Look at cpu8815_eth_init() function in this file.
Thanks,
Sekhar
WARNING: multiple messages have this Message-ID (diff)
From: Sekhar Nori <nsekhar@ti.com>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: DLOS <davinci-linux-open-source@linux.davincidsp.com>,
LAK <linux-arm-kernel@lists.infradead.org>,
<devicetree-discuss@lists.ozlabs.org>,
LKML <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
Heiko Schocher <hs@denx.de>
Subject: Re: [PATCH v3 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac
Date: Thu, 8 Aug 2013 21:35:37 +0530 [thread overview]
Message-ID: <5203C1D1.8020707@ti.com> (raw)
In-Reply-To: <CA+V-a8smEd_75Ab-_vxjBATr8Q9Sefs0tpxc+kgQJRtuLJad=w@mail.gmail.com>
On Thursday 08 August 2013 04:02 PM, Prabhakar Lad wrote:
> Hi Sekhar,
>
> Sorry for the delayed response I was on leave and now back again up
> and running.
>
> On Wed, Jul 31, 2013 at 11:17 AM, Sekhar Nori <nsekhar@ti.com> wrote:
>> On Sunday 23 June 2013 08:30 PM, Prabhakar Lad wrote:
>>> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
>>>
>>> This patch makes a common function for to configure emac and calls
>>> it appropriately in DT and non DT boot mode. The system configuration
>>> chip CFGCHIP3, controls the emac module. This patch appropriately
>>> configures this register for emac and sets DA850_MII_MDIO_CLKEN_PIN
>>> GPIO pin appropriately.
>>>
> [Snip]
>
>>> + if (rmii_enabled)
>>> + val |= BIT(8);
>>> + else
>>> + val &= ~BIT(8);
>>> +
>>> + /* configure the CFGCHIP3 register for RMII or MII */
>>> + writel(val, cfg_chip3_base);
>>> +
>>> + ret = davinci_cfg_reg(DA850_GPIO2_6);
>>> + if (ret)
>>> + pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
>>> +
>>> + ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
>>> + if (ret) {
>>> + pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
>>> + return;
>>> + }
>>
>> You cannot do this in SoC specific code. All boards wont use a GPIO to
>> choose between MII/RMII. You need to do this in a EVM specific manner.
>> This just means you retain the GPIO part of code in board-da850-evm.c
>
> OK
>
>> and for the DT case use a board specific GPIO node. See a similar
>> example in arch/arm/boot/dts/ste-nomadik-s8815.dts and how the code uses
> Alrite something similar to usb-s8815 node.
>
>> it in arch/arm/mach-nomadik/cpu-8815.c.
>>
> But I don't see any code to access this node in this file, can
> you point me to right direction ?
Look at cpu8815_eth_init() function in this file.
Thanks,
Sekhar
WARNING: multiple messages have this Message-ID (diff)
From: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>
To: Prabhakar Lad <prabhakar.csengg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: DLOS
<davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org>,
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Heiko Schocher <hs-ynQEQJNshbs@public.gmane.org>,
LAK
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v3 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac
Date: Thu, 8 Aug 2013 21:35:37 +0530 [thread overview]
Message-ID: <5203C1D1.8020707@ti.com> (raw)
In-Reply-To: <CA+V-a8smEd_75Ab-_vxjBATr8Q9Sefs0tpxc+kgQJRtuLJad=w@mail.gmail.com>
On Thursday 08 August 2013 04:02 PM, Prabhakar Lad wrote:
> Hi Sekhar,
>
> Sorry for the delayed response I was on leave and now back again up
> and running.
>
> On Wed, Jul 31, 2013 at 11:17 AM, Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org> wrote:
>> On Sunday 23 June 2013 08:30 PM, Prabhakar Lad wrote:
>>> From: "Lad, Prabhakar" <prabhakar.csengg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>
>>> This patch makes a common function for to configure emac and calls
>>> it appropriately in DT and non DT boot mode. The system configuration
>>> chip CFGCHIP3, controls the emac module. This patch appropriately
>>> configures this register for emac and sets DA850_MII_MDIO_CLKEN_PIN
>>> GPIO pin appropriately.
>>>
> [Snip]
>
>>> + if (rmii_enabled)
>>> + val |= BIT(8);
>>> + else
>>> + val &= ~BIT(8);
>>> +
>>> + /* configure the CFGCHIP3 register for RMII or MII */
>>> + writel(val, cfg_chip3_base);
>>> +
>>> + ret = davinci_cfg_reg(DA850_GPIO2_6);
>>> + if (ret)
>>> + pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
>>> +
>>> + ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
>>> + if (ret) {
>>> + pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
>>> + return;
>>> + }
>>
>> You cannot do this in SoC specific code. All boards wont use a GPIO to
>> choose between MII/RMII. You need to do this in a EVM specific manner.
>> This just means you retain the GPIO part of code in board-da850-evm.c
>
> OK
>
>> and for the DT case use a board specific GPIO node. See a similar
>> example in arch/arm/boot/dts/ste-nomadik-s8815.dts and how the code uses
> Alrite something similar to usb-s8815 node.
>
>> it in arch/arm/mach-nomadik/cpu-8815.c.
>>
> But I don't see any code to access this node in this file, can
> you point me to right direction ?
Look at cpu8815_eth_init() function in this file.
Thanks,
Sekhar
next prev parent reply other threads:[~2013-08-08 16:05 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-23 15:00 [PATCH v3 0/6] ARM: davinci: da850: add ethernet driver DT support Prabhakar Lad
2013-06-23 15:00 ` Prabhakar Lad
2013-06-23 15:00 ` [PATCH v3 1/6] ARM: davinci: da8xx: fix clock lookup for mdio device Prabhakar Lad
2013-06-23 15:00 ` Prabhakar Lad
2013-08-14 12:04 ` Sekhar Nori
2013-08-14 12:04 ` Sekhar Nori
2013-08-14 12:04 ` Sekhar Nori
2013-08-14 12:04 ` Sekhar Nori
2013-06-23 15:00 ` [PATCH v3 2/6] ARM: davinci: da850: add DT node " Prabhakar Lad
2013-06-23 15:00 ` Prabhakar Lad
2013-06-23 15:00 ` [PATCH v3 3/6] ARM: davinci: da850: add OF_DEV_AUXDATA entry for mdio Prabhakar Lad
2013-06-23 15:00 ` Prabhakar Lad
2013-06-23 15:00 ` [PATCH v3 4/6] ARM: davinci: da850: add DT node for eth0 Prabhakar Lad
2013-06-23 15:00 ` Prabhakar Lad
2013-06-23 15:00 ` [PATCH v3 5/6] ARM: davinci: da850: add OF_DEV_AUXDATA entry " Prabhakar Lad
2013-06-23 15:00 ` Prabhakar Lad
2013-06-23 15:00 ` [PATCH v3 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac Prabhakar Lad
2013-06-23 15:00 ` Prabhakar Lad
2013-07-31 5:47 ` Sekhar Nori
2013-07-31 5:47 ` Sekhar Nori
2013-07-31 5:47 ` Sekhar Nori
2013-07-31 5:47 ` Sekhar Nori
2013-08-08 10:32 ` Prabhakar Lad
2013-08-08 10:32 ` Prabhakar Lad
2013-08-08 16:05 ` Sekhar Nori [this message]
2013-08-08 16:05 ` Sekhar Nori
2013-08-08 16:05 ` Sekhar Nori
2013-08-08 16:05 ` Sekhar Nori
2013-08-08 10:39 ` Prabhakar Lad
2013-08-08 10:39 ` Prabhakar Lad
2013-08-08 10:39 ` Prabhakar Lad
2013-08-08 10:39 ` Prabhakar Lad
2013-07-11 17:12 ` [PATCH v3 0/6] ARM: davinci: da850: add ethernet driver DT support Prabhakar Lad
2013-07-11 17:12 ` Prabhakar Lad
2013-07-12 6:51 ` Sekhar Nori
2013-07-12 6:51 ` Sekhar Nori
2013-07-12 6:51 ` Sekhar Nori
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=5203C1D1.8020707@ti.com \
--to=nsekhar@ti.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 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.