diff mbox

[U-Boot,v3,03/16] drivers/net/vsc9953: Fix bug when enabling a port

Message ID 1437745979-14234-4-git-send-email-codrin.ciubotariu@freescale.com
State Accepted
Delegated to: York Sun
Headers show

Commit Message

Codrin Ciubotariu July 24, 2015, 1:52 p.m. UTC
When a port is enabled at init time, the initializing function
touches more bits than necessary to enable a port (also touches
reserved bits and default bit values). This patch fixes this issue
by changing the value of the define used to enable the port and
assures that no other bits are changes by replacing out_le32()
with setbits_le32().

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@freescale.com>
---

Dhanges for v3:
	- none; new patch;

 drivers/net/vsc9953.c | 4 ++--
 include/vsc9953.h     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Joe Hershberger Aug. 7, 2015, 8:17 p.m. UTC | #1
Hi Codrin,

On Fri, Jul 24, 2015 at 8:52 AM, Codrin Ciubotariu
<codrin.ciubotariu@freescale.com> wrote:
> When a port is enabled at init time, the initializing function
> touches more bits than necessary to enable a port (also touches
> reserved bits and default bit values). This patch fixes this issue
> by changing the value of the define used to enable the port and
> assures that no other bits are changes by replacing out_le32()
> with setbits_le32().
>
> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@freescale.com>
> ---
>
> Dhanges for v3:
>         - none; new patch;
>
>  drivers/net/vsc9953.c | 4 ++--
>  include/vsc9953.h     | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff mbox

Patch

diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
index 524b979..2e8eec4 100644
--- a/drivers/net/vsc9953.c
+++ b/drivers/net/vsc9953.c
@@ -259,8 +259,8 @@  void vsc9953_init(bd_t *bis)
 		out_le32(&l2dev_gmii_reg->mac_cfg_status.mac_hdx_cfg, hdx_cfg);
 		out_le32(&l2sys_reg->sys.front_port_mode[i],
 			 VSC9953_FRONT_PORT_MODE);
-		out_le32(&l2qsys_reg->sys.switch_port_mode[i],
-			 VSC9953_PORT_ENA);
+		setbits_le32(&l2qsys_reg->sys.switch_port_mode[i],
+			     VSC9953_PORT_ENA);
 		out_le32(&l2dev_gmii_reg->mac_cfg_status.mac_maxlen_cfg,
 			 VSC9953_MAC_MAX_LEN);
 		out_le32(&l2sys_reg->pause_cfg.pause_cfg[i],
diff --git a/include/vsc9953.h b/include/vsc9953.h
index 6ebe141..6ae5fec 100644
--- a/include/vsc9953.h
+++ b/include/vsc9953.h
@@ -81,7 +81,7 @@ 
 #define VSC9953_VCAP_UPDATE_CTRL	0x01000004
 
 /* Macros for vsc9953_qsys_sys.switch_port_mode register */
-#define VSC9953_PORT_ENA		0x00003a00
+#define VSC9953_PORT_ENA		0x00002000
 
 #define VSC9953_MAX_PORTS		10
 #define VSC9953_PORT_CHECK(port)	\