diff mbox

[U-Boot] am335x_evm: Fix Ethernet LED issue on BeagleBone

Message ID 1352237838-22552-1-git-send-email-andrew@bradfordembedded.com
State Rejected
Delegated to: Tom Rini
Headers show

Commit Message

Andrew Bradford Nov. 6, 2012, 9:37 p.m. UTC
The default value for PRM_RSTTIME1 on am335x is 0x06 leading to a very
short assertion of SYS_RESETn on BeagleBones.  For PRM_RSTTIME1 values
less than 0x80, some BeagleBones will end up with inverted Ethernet LEDs
upon warm software reset leading to incorrect display of the Ethernet
link status on the Ethernet jack.

Extend PRM_RSTTIME1 to 0x80 to provide a longer assertion of SYS_RESETn
allowing the SMSC PHY more time to sample the strapping resistors which
set the LED orientation.

Signed-off-by: Andrew Bradford <andrew@bradfordembedded.com>
---
 arch/arm/include/asm/arch-am33xx/cpu.h |    1 +
 board/ti/am335x/board.c                |    8 ++++++++
 2 files changed, 9 insertions(+)

Comments

Andrew Bradford Nov. 20, 2012, 9:26 p.m. UTC | #1
Dear Tom,

On Tue,  6 Nov 2012 16:37:18 -0500
Andrew Bradford <andrew@bradfordembedded.com> wrote:

> The default value for PRM_RSTTIME1 on am335x is 0x06 leading to a very
> short assertion of SYS_RESETn on BeagleBones.  For PRM_RSTTIME1 values
> less than 0x80, some BeagleBones will end up with inverted Ethernet
> LEDs upon warm software reset leading to incorrect display of the
> Ethernet link status on the Ethernet jack.
> 
> Extend PRM_RSTTIME1 to 0x80 to provide a longer assertion of
> SYS_RESETn allowing the SMSC PHY more time to sample the strapping
> resistors which set the LED orientation.
> 
> Signed-off-by: Andrew Bradford <andrew@bradfordembedded.com>
> ---
>  arch/arm/include/asm/arch-am33xx/cpu.h |    1 +
>  board/ti/am335x/board.c                |    8 ++++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-am33xx/cpu.h
> b/arch/arm/include/asm/arch-am33xx/cpu.h index 819fd2f..bcd2fb0 100644
> --- a/arch/arm/include/asm/arch-am33xx/cpu.h
> +++ b/arch/arm/include/asm/arch-am33xx/cpu.h
> @@ -53,6 +53,7 @@
>  /* Reset control */
>  #ifdef CONFIG_AM33XX
>  #define PRM_RSTCTRL			0x44E00F00
> +#define PRM_RSTTIME			0x44E00F04
>  #define PRM_RSTST			0x44E00F08
>  #endif
>  #define PRM_RSTCTRL_RESET		0x01
> diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
> index b56a801..7c23a6e 100644
> --- a/board/ti/am335x/board.c
> +++ b/board/ti/am335x/board.c
> @@ -304,6 +304,14 @@ void s_init(void)
>  	else
>  		config_ddr(266, MT47H128M16RT25E_IOCTRL_VALUE,
> &ddr2_data, &ddr2_cmd_ctrl_data, &ddr2_emif_reg_data);
> +
> +	if (board_is_bone())
> +		/*
> +		 * For BeagleBone, extend PRM_RSTTIME1 to ensure
> SMSC PHY
> +		 * strapping resistors are properly read on warm
> software reset
> +		 * to reduce the chance of Ethernet LEDs being
> inverted.
> +		 */
> +		writeb(0x80, PRM_RSTTIME);
>  #endif
>  }
>  

NAK.

Please do not apply this patch.  It does not accomplish the desired
goal (fixing Ethernet LED inversion) when some capes are connected to
BeagleBone and is not be the proper way to resolve the issue.

Thanks,
Andrew
diff mbox

Patch

diff --git a/arch/arm/include/asm/arch-am33xx/cpu.h b/arch/arm/include/asm/arch-am33xx/cpu.h
index 819fd2f..bcd2fb0 100644
--- a/arch/arm/include/asm/arch-am33xx/cpu.h
+++ b/arch/arm/include/asm/arch-am33xx/cpu.h
@@ -53,6 +53,7 @@ 
 /* Reset control */
 #ifdef CONFIG_AM33XX
 #define PRM_RSTCTRL			0x44E00F00
+#define PRM_RSTTIME			0x44E00F04
 #define PRM_RSTST			0x44E00F08
 #endif
 #define PRM_RSTCTRL_RESET		0x01
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index b56a801..7c23a6e 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -304,6 +304,14 @@  void s_init(void)
 	else
 		config_ddr(266, MT47H128M16RT25E_IOCTRL_VALUE, &ddr2_data,
 			   &ddr2_cmd_ctrl_data, &ddr2_emif_reg_data);
+
+	if (board_is_bone())
+		/*
+		 * For BeagleBone, extend PRM_RSTTIME1 to ensure SMSC PHY
+		 * strapping resistors are properly read on warm software reset
+		 * to reduce the chance of Ethernet LEDs being inverted.
+		 */
+		writeb(0x80, PRM_RSTTIME);
 #endif
 }