All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/2] mips: ath79: ar933x: Fix probe error for kernel driver ag71xx
       [not found] <1463831918-18333-1-git-send-email-wills.wang@live.com>
@ 2016-05-21 11:58 ` Wills Wang
  2016-05-21 12:15   ` Marek Vasut
  2016-05-21 16:43   ` Daniel Schwierzeck
  0 siblings, 2 replies; 4+ messages in thread
From: Wills Wang @ 2016-05-21 11:58 UTC (permalink / raw)
  To: u-boot

We need reset the Ethernet Switch analog part before operation,
or the build-in Ethernet PHY don't work, openwrt kernel driver
ag71xx occur the following error:

[    1.854519] libphy: ag71xx_mdio: probed
[    2.646539] ag71xx-mdio.1: unknown phy id 'ffff:ffff'
[    3.235778] ag71xx ag71xx.0: no PHY found with phy_mask=00000010

Signed-off-by: Wills Wang <wills.wang@live.com>
---

 arch/mips/mach-ath79/include/mach/ar71xx_regs.h | 1 +
 arch/mips/mach-ath79/reset.c                    | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h
index a8e51cb..dabcad0 100644
--- a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h
+++ b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h
@@ -660,6 +660,7 @@
 
 #define AR933X_RESET_GE1_MDIO				BIT(23)
 #define AR933X_RESET_GE0_MDIO				BIT(22)
+#define AR933X_RESET_ETH_SWITCH_ANALOG			BIT(14)
 #define AR933X_RESET_GE1_MAC				BIT(13)
 #define AR933X_RESET_WMAC				BIT(11)
 #define AR933X_RESET_GE0_MAC				BIT(9)
diff --git a/arch/mips/mach-ath79/reset.c b/arch/mips/mach-ath79/reset.c
index 188eccb..473f89d 100644
--- a/arch/mips/mach-ath79/reset.c
+++ b/arch/mips/mach-ath79/reset.c
@@ -81,7 +81,7 @@ static int eth_init_ar933x(void)
 					  MAP_NOCACHE);
 	const u32 mask = AR933X_RESET_GE0_MAC | AR933X_RESET_GE0_MDIO |
 			 AR933X_RESET_GE1_MAC | AR933X_RESET_GE1_MDIO |
-			 AR933X_RESET_ETH_SWITCH;
+			 AR933X_RESET_ETH_SWITCH | AR933X_RESET_ETH_SWITCH_ANALOG;
 
 	/* Clear MDIO slave EN bit. */
 	clrbits_be32(rregs + AR933X_RESET_REG_BOOTSTRAP, BIT(17));
-- 
1.9.1

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

* [U-Boot] [PATCH 2/2] mips: ath79: ar933x: Fix probe error for kernel driver ag71xx
  2016-05-21 11:58 ` [U-Boot] [PATCH 2/2] mips: ath79: ar933x: Fix probe error for kernel driver ag71xx Wills Wang
@ 2016-05-21 12:15   ` Marek Vasut
  2016-05-21 16:43   ` Daniel Schwierzeck
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2016-05-21 12:15 UTC (permalink / raw)
  To: u-boot

On 05/21/2016 01:58 PM, Wills Wang wrote:
> We need reset the Ethernet Switch analog part before operation,
> or the build-in Ethernet PHY don't work, openwrt kernel driver
> ag71xx occur the following error:
> 
> [    1.854519] libphy: ag71xx_mdio: probed
> [    2.646539] ag71xx-mdio.1: unknown phy id 'ffff:ffff'
> [    3.235778] ag71xx ag71xx.0: no PHY found with phy_mask=00000010
> 
> Signed-off-by: Wills Wang <wills.wang@live.com>

Acked-by: Marek Vasut <marex@denx.de>

The kernel should be independent of bootloader, so you should cook
similar patch for Linux.

> ---
> 
>  arch/mips/mach-ath79/include/mach/ar71xx_regs.h | 1 +
>  arch/mips/mach-ath79/reset.c                    | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h
> index a8e51cb..dabcad0 100644
> --- a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h
> +++ b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h
> @@ -660,6 +660,7 @@
>  
>  #define AR933X_RESET_GE1_MDIO				BIT(23)
>  #define AR933X_RESET_GE0_MDIO				BIT(22)
> +#define AR933X_RESET_ETH_SWITCH_ANALOG			BIT(14)
>  #define AR933X_RESET_GE1_MAC				BIT(13)
>  #define AR933X_RESET_WMAC				BIT(11)
>  #define AR933X_RESET_GE0_MAC				BIT(9)
> diff --git a/arch/mips/mach-ath79/reset.c b/arch/mips/mach-ath79/reset.c
> index 188eccb..473f89d 100644
> --- a/arch/mips/mach-ath79/reset.c
> +++ b/arch/mips/mach-ath79/reset.c
> @@ -81,7 +81,7 @@ static int eth_init_ar933x(void)
>  					  MAP_NOCACHE);
>  	const u32 mask = AR933X_RESET_GE0_MAC | AR933X_RESET_GE0_MDIO |
>  			 AR933X_RESET_GE1_MAC | AR933X_RESET_GE1_MDIO |
> -			 AR933X_RESET_ETH_SWITCH;
> +			 AR933X_RESET_ETH_SWITCH | AR933X_RESET_ETH_SWITCH_ANALOG;
>  
>  	/* Clear MDIO slave EN bit. */
>  	clrbits_be32(rregs + AR933X_RESET_REG_BOOTSTRAP, BIT(17));
> 


-- 
Best regards,
Marek Vasut

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

* [U-Boot] [PATCH 2/2] mips: ath79: ar933x: Fix probe error for kernel driver ag71xx
  2016-05-21 11:58 ` [U-Boot] [PATCH 2/2] mips: ath79: ar933x: Fix probe error for kernel driver ag71xx Wills Wang
  2016-05-21 12:15   ` Marek Vasut
@ 2016-05-21 16:43   ` Daniel Schwierzeck
  2016-05-22  2:06     ` Wills Wang
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Schwierzeck @ 2016-05-21 16:43 UTC (permalink / raw)
  To: u-boot

2016-05-21 13:58 GMT+02:00 Wills Wang <wills.wang@live.com>:
> We need reset the Ethernet Switch analog part before operation,
> or the build-in Ethernet PHY don't work, openwrt kernel driver
> ag71xx occur the following error:
>
> [    1.854519] libphy: ag71xx_mdio: probed
> [    2.646539] ag71xx-mdio.1: unknown phy id 'ffff:ffff'
> [    3.235778] ag71xx ag71xx.0: no PHY found with phy_mask=00000010
>
> Signed-off-by: Wills Wang <wills.wang@live.com>
> ---

could you please change the commit subject and message? Your intention
is to make Marek's ag71xx ethernet driver working for AR933x, isn't
it?

If a kernel driver is dependent on the initialization of the
bootloader, then that should be fixed in the kernel driver. The
philosophy of U-Boot is to not initialize hardware at all when it's
not needed by U-Boot itself. Thus if one boots a board without using
network in the bootloader or if one doesn't compile in network
support, the ethernet hardware parts are never initialized. But the
kernel and it's drivers should still work.

-- 
- Daniel

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

* [U-Boot] [PATCH 2/2] mips: ath79: ar933x: Fix probe error for kernel driver ag71xx
  2016-05-21 16:43   ` Daniel Schwierzeck
@ 2016-05-22  2:06     ` Wills Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Wills Wang @ 2016-05-22  2:06 UTC (permalink / raw)
  To: u-boot



On 05/22/2016 12:43 AM, Daniel Schwierzeck wrote:
> 2016-05-21 13:58 GMT+02:00 Wills Wang <wills.wang@live.com>:
>> We need reset the Ethernet Switch analog part before operation,
>> or the build-in Ethernet PHY don't work, openwrt kernel driver
>> ag71xx occur the following error:
>>
>> [    1.854519] libphy: ag71xx_mdio: probed
>> [    2.646539] ag71xx-mdio.1: unknown phy id 'ffff:ffff'
>> [    3.235778] ag71xx ag71xx.0: no PHY found with phy_mask=00000010
>>
>> Signed-off-by: Wills Wang <wills.wang@live.com>
>> ---
> could you please change the commit subject and message? Your intention
> is to make Marek's ag71xx ethernet driver working for AR933x, isn't
> it?
Ok
> If a kernel driver is dependent on the initialization of the
> bootloader, then that should be fixed in the kernel driver. The
> philosophy of U-Boot is to not initialize hardware at all when it's
> not needed by U-Boot itself. Thus if one boots a board without using
> network in the bootloader or if one doesn't compile in network
> support, the ethernet hardware parts are never initialized. But the
> kernel and it's drivers should still work.
>

-- 
Best Regards
Wills

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

end of thread, other threads:[~2016-05-22  2:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1463831918-18333-1-git-send-email-wills.wang@live.com>
2016-05-21 11:58 ` [U-Boot] [PATCH 2/2] mips: ath79: ar933x: Fix probe error for kernel driver ag71xx Wills Wang
2016-05-21 12:15   ` Marek Vasut
2016-05-21 16:43   ` Daniel Schwierzeck
2016-05-22  2:06     ` Wills Wang

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.