public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again
@ 2016-02-11 15:45 Stefan Roese
  2016-02-11 15:49 ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Roese @ 2016-02-11 15:45 UTC (permalink / raw)
  To: u-boot

With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
model], cpu_eth_init() is not called on SoCFPGA any more. Since this
function configures the internal PHY interface to RGMII (via the physel_X
bits), its still needed. So lets rename this function and call it in
arch_early_init_r().

Tested on socfpga_sr1500.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Marek Vasut <marex@denx.de>
---
 arch/arm/mach-socfpga/misc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index 9b43b92..2b1cd4a 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int of_reset_id)
 	socfpga_per_reset(reset, 0);
 }
 
-int cpu_eth_init(bd_t *bis)
+static int dwmac_eth_init(void)
 {
 	const void *fdt = gd->fdt_blob;
 	struct fdtdec_phandle_args args;
@@ -363,6 +363,10 @@ int arch_early_init_r(void)
 	socfpga_per_reset(SOCFPGA_RESET(NAND), 0);
 #endif
 
+#ifdef CONFIG_ETH_DESIGNWARE
+	dwmac_eth_init();
+#endif
+
 	return 0;
 }
 
-- 
2.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again
  2016-02-11 15:45 [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again Stefan Roese
@ 2016-02-11 15:49 ` Marek Vasut
  2016-02-11 15:54   ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2016-02-11 15:49 UTC (permalink / raw)
  To: u-boot

On 02/11/2016 04:45 PM, Stefan Roese wrote:
> With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
> model], cpu_eth_init() is not called on SoCFPGA any more. Since this
> function configures the internal PHY interface to RGMII (via the physel_X
> bits), its still needed. So lets rename this function and call it in
> arch_early_init_r().
> 
> Tested on socfpga_sr1500.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> Cc: Marek Vasut <marex@denx.de>
> ---
>  arch/arm/mach-socfpga/misc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
> index 9b43b92..2b1cd4a 100644
> --- a/arch/arm/mach-socfpga/misc.c
> +++ b/arch/arm/mach-socfpga/misc.c
> @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int of_reset_id)
>  	socfpga_per_reset(reset, 0);
>  }

I just sent and applied very similar patch, can you try
u-boot-socfpga/master and see if it works for you?

Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again
  2016-02-11 15:49 ` Marek Vasut
@ 2016-02-11 15:54   ` Stefan Roese
  2016-02-11 20:28     ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Roese @ 2016-02-11 15:54 UTC (permalink / raw)
  To: u-boot

On 11.02.2016 16:49, Marek Vasut wrote:
> On 02/11/2016 04:45 PM, Stefan Roese wrote:
>> With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
>> model], cpu_eth_init() is not called on SoCFPGA any more. Since this
>> function configures the internal PHY interface to RGMII (via the physel_X
>> bits), its still needed. So lets rename this function and call it in
>> arch_early_init_r().
>>
>> Tested on socfpga_sr1500.
>>
>> Signed-off-by: Stefan Roese <sr@denx.de>
>> Cc: Simon Glass <sjg@chromium.org>
>> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
>> Cc: Marek Vasut <marex@denx.de>
>> ---
>>   arch/arm/mach-socfpga/misc.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
>> index 9b43b92..2b1cd4a 100644
>> --- a/arch/arm/mach-socfpga/misc.c
>> +++ b/arch/arm/mach-socfpga/misc.c
>> @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int of_reset_id)
>>   	socfpga_per_reset(reset, 0);
>>   }
>
> I just sent and applied very similar patch, can you try
> u-boot-socfpga/master and see if it works for you?

Done and works just fine. So please feel free to upstream your patch
version.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again
  2016-02-11 15:54   ` Stefan Roese
@ 2016-02-11 20:28     ` Simon Glass
  2016-02-11 20:58       ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2016-02-11 20:28 UTC (permalink / raw)
  To: u-boot

Hi,

On 11 February 2016 at 08:54, Stefan Roese <sr@denx.de> wrote:
> On 11.02.2016 16:49, Marek Vasut wrote:
>>
>> On 02/11/2016 04:45 PM, Stefan Roese wrote:
>>>
>>> With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
>>> model], cpu_eth_init() is not called on SoCFPGA any more. Since this
>>> function configures the internal PHY interface to RGMII (via the physel_X
>>> bits), its still needed. So lets rename this function and call it in
>>> arch_early_init_r().
>>>
>>> Tested on socfpga_sr1500.
>>>
>>> Signed-off-by: Stefan Roese <sr@denx.de>
>>> Cc: Simon Glass <sjg@chromium.org>
>>> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
>>> Cc: Marek Vasut <marex@denx.de>
>>> ---
>>>   arch/arm/mach-socfpga/misc.c | 6 +++++-
>>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
>>> index 9b43b92..2b1cd4a 100644
>>> --- a/arch/arm/mach-socfpga/misc.c
>>> +++ b/arch/arm/mach-socfpga/misc.c
>>> @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int
>>> of_reset_id)
>>>         socfpga_per_reset(reset, 0);
>>>   }
>>
>>
>> I just sent and applied very similar patch, can you try
>> u-boot-socfpga/master and see if it works for you?
>
>
> Done and works just fine. So please feel free to upstream your patch
> version.

Can this be done in the driver? You have a device tree representation
I think. If you are using the compat list in fdtdec.c then it suggests
that you need a driver.

Regards,
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again
  2016-02-11 20:28     ` Simon Glass
@ 2016-02-11 20:58       ` Marek Vasut
  2016-02-12  0:10         ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2016-02-11 20:58 UTC (permalink / raw)
  To: u-boot

On 02/11/2016 09:28 PM, Simon Glass wrote:
> Hi,
> 
> On 11 February 2016 at 08:54, Stefan Roese <sr@denx.de> wrote:
>> On 11.02.2016 16:49, Marek Vasut wrote:
>>>
>>> On 02/11/2016 04:45 PM, Stefan Roese wrote:
>>>>
>>>> With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
>>>> model], cpu_eth_init() is not called on SoCFPGA any more. Since this
>>>> function configures the internal PHY interface to RGMII (via the physel_X
>>>> bits), its still needed. So lets rename this function and call it in
>>>> arch_early_init_r().
>>>>
>>>> Tested on socfpga_sr1500.
>>>>
>>>> Signed-off-by: Stefan Roese <sr@denx.de>
>>>> Cc: Simon Glass <sjg@chromium.org>
>>>> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
>>>> Cc: Marek Vasut <marex@denx.de>
>>>> ---
>>>>   arch/arm/mach-socfpga/misc.c | 6 +++++-
>>>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
>>>> index 9b43b92..2b1cd4a 100644
>>>> --- a/arch/arm/mach-socfpga/misc.c
>>>> +++ b/arch/arm/mach-socfpga/misc.c
>>>> @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int
>>>> of_reset_id)
>>>>         socfpga_per_reset(reset, 0);
>>>>   }
>>>
>>>
>>> I just sent and applied very similar patch, can you try
>>> u-boot-socfpga/master and see if it works for you?
>>
>>
>> Done and works just fine. So please feel free to upstream your patch
>> version.
> 
> Can this be done in the driver? You have a device tree representation
> I think. If you are using the compat list in fdtdec.c then it suggests
> that you need a driver.

Does u-boot DM already have the ability to handle resets of various IP
blocks on the chip ? I don't think so, so for now I'll opt for fixing
this breakage.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again
  2016-02-11 20:58       ` Marek Vasut
@ 2016-02-12  0:10         ` Simon Glass
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2016-02-12  0:10 UTC (permalink / raw)
  To: u-boot

Hi Marek,

On 11 February 2016 at 13:58, Marek Vasut <marex@denx.de> wrote:
> On 02/11/2016 09:28 PM, Simon Glass wrote:
>> Hi,
>>
>> On 11 February 2016 at 08:54, Stefan Roese <sr@denx.de> wrote:
>>> On 11.02.2016 16:49, Marek Vasut wrote:
>>>>
>>>> On 02/11/2016 04:45 PM, Stefan Roese wrote:
>>>>>
>>>>> With commit c32a6fd0 [net: Don't call board/cpu_eth_init() with driver
>>>>> model], cpu_eth_init() is not called on SoCFPGA any more. Since this
>>>>> function configures the internal PHY interface to RGMII (via the physel_X
>>>>> bits), its still needed. So lets rename this function and call it in
>>>>> arch_early_init_r().
>>>>>
>>>>> Tested on socfpga_sr1500.
>>>>>
>>>>> Signed-off-by: Stefan Roese <sr@denx.de>
>>>>> Cc: Simon Glass <sjg@chromium.org>
>>>>> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
>>>>> Cc: Marek Vasut <marex@denx.de>
>>>>> ---
>>>>>   arch/arm/mach-socfpga/misc.c | 6 +++++-
>>>>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
>>>>> index 9b43b92..2b1cd4a 100644
>>>>> --- a/arch/arm/mach-socfpga/misc.c
>>>>> +++ b/arch/arm/mach-socfpga/misc.c
>>>>> @@ -104,7 +104,7 @@ static void dwmac_deassert_reset(const unsigned int
>>>>> of_reset_id)
>>>>>         socfpga_per_reset(reset, 0);
>>>>>   }
>>>>
>>>>
>>>> I just sent and applied very similar patch, can you try
>>>> u-boot-socfpga/master and see if it works for you?
>>>
>>>
>>> Done and works just fine. So please feel free to upstream your patch
>>> version.
>>
>> Can this be done in the driver? You have a device tree representation
>> I think. If you are using the compat list in fdtdec.c then it suggests
>> that you need a driver.
>
> Does u-boot DM already have the ability to handle resets of various IP
> blocks on the chip ? I don't think so, so for now I'll opt for fixing
> this breakage.
>

OK I see what you mean. We might need to rename the current
UCLASS_RESET to make room for this.

Regards,
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-12  0:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-11 15:45 [U-Boot] [PATCH] arm: socfpga: Enable ethernet PHY configuration to RGMII again Stefan Roese
2016-02-11 15:49 ` Marek Vasut
2016-02-11 15:54   ` Stefan Roese
2016-02-11 20:28     ` Simon Glass
2016-02-11 20:58       ` Marek Vasut
2016-02-12  0:10         ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox