diff mbox

[OpenWrt-Devel] b53: reverse duplex bit meaning for IMP state override register

Message ID 1426663133-18131-1-git-send-email-zajec5@gmail.com
State Accepted
Delegated to: Jonas Gorski
Headers show

Commit Message

Rafał Miłecki March 18, 2015, 7:18 a.m. UTC
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
When reading bcmrobo.c code for BCM5301X I've noticed that it uses
REG_CTRL_MIIPO (0x0e) with a following comment:
/* default(1 << 1) DUPLX_MODE:
 * Full Duplex
 */
So I guess our bit definition may be reversed. Can someone verify this?
---
 target/linux/generic/files/drivers/net/phy/b53/b53_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexandru Ardelean March 18, 2015, 7:52 a.m. UTC | #1
On Wed, Mar 18, 2015 at 9:18 AM, Rafał Miłecki <zajec5@gmail.com> wrote:

> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
> When reading bcmrobo.c code for BCM5301X I've noticed that it uses
> REG_CTRL_MIIPO (0x0e) with a following comment:
> /* default(1 << 1) DUPLX_MODE:
>  * Full Duplex
>  */
> So I guess our bit definition may be reversed. Can someone verify this?
> ---
>  target/linux/generic/files/drivers/net/phy/b53/b53_regs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
> b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
> index ba50915..4899cc4 100644
> --- a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
> +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
> @@ -75,7 +75,7 @@
>  /* IMP Port state override register (8 bit) */
>  #define B53_PORT_OVERRIDE_CTRL         0x0e
>  #define   PORT_OVERRIDE_LINK           BIT(0)
> -#define   PORT_OVERRIDE_HALF_DUPLEX    BIT(1) /* 0 = Full Duplex */
> +#define   PORT_OVERRIDE_FULL_DUPLEX    BIT(1) /* 0 = Half Duplex */
>  #define   PORT_OVERRIDE_SPEED_S                2
>  #define   PORT_OVERRIDE_SPEED_10M      (0 << PORT_OVERRIDE_SPEED_S)
>  #define   PORT_OVERRIDE_SPEED_100M     (1 << PORT_OVERRIDE_SPEED_S)
> --
> 1.8.4.5
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>

I can validate that this fix is correct on my BCM53128.
Jonas Gorski March 18, 2015, 10:29 a.m. UTC | #2
On Wed, Mar 18, 2015 at 8:52 AM, Alexandru Ardelean
<ardeleanalex@gmail.com> wrote:
> On Wed, Mar 18, 2015 at 9:18 AM, Rafał Miłecki <zajec5@gmail.com> wrote:
>>
>> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
>> ---
>> When reading bcmrobo.c code for BCM5301X I've noticed that it uses
>> REG_CTRL_MIIPO (0x0e) with a following comment:
>> /* default(1 << 1) DUPLX_MODE:
>>  * Full Duplex
>>  */
>> So I guess our bit definition may be reversed. Can someone verify this?
>> ---
>>  target/linux/generic/files/drivers/net/phy/b53/b53_regs.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
>> b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
>> index ba50915..4899cc4 100644
>> --- a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
>> +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
>> @@ -75,7 +75,7 @@
>>  /* IMP Port state override register (8 bit) */
>>  #define B53_PORT_OVERRIDE_CTRL         0x0e
>>  #define   PORT_OVERRIDE_LINK           BIT(0)
>> -#define   PORT_OVERRIDE_HALF_DUPLEX    BIT(1) /* 0 = Full Duplex */
>> +#define   PORT_OVERRIDE_FULL_DUPLEX    BIT(1) /* 0 = Half Duplex */
>>  #define   PORT_OVERRIDE_SPEED_S                2
>>  #define   PORT_OVERRIDE_SPEED_10M      (0 << PORT_OVERRIDE_SPEED_S)
>>  #define   PORT_OVERRIDE_SPEED_100M     (1 << PORT_OVERRIDE_SPEED_S)
>> --
>
>
> I can validate that this fix is correct on my BCM53128.

Yeah, I can too, whatever I was drinking at this time %)


Jonas.
diff mbox

Patch

diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
index ba50915..4899cc4 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
@@ -75,7 +75,7 @@ 
 /* IMP Port state override register (8 bit) */
 #define B53_PORT_OVERRIDE_CTRL		0x0e
 #define   PORT_OVERRIDE_LINK		BIT(0)
-#define   PORT_OVERRIDE_HALF_DUPLEX	BIT(1) /* 0 = Full Duplex */
+#define   PORT_OVERRIDE_FULL_DUPLEX	BIT(1) /* 0 = Half Duplex */
 #define   PORT_OVERRIDE_SPEED_S		2
 #define   PORT_OVERRIDE_SPEED_10M	(0 << PORT_OVERRIDE_SPEED_S)
 #define   PORT_OVERRIDE_SPEED_100M	(1 << PORT_OVERRIDE_SPEED_S)