[U-Boot] [PATCH 2/2] LaCie/common: Fix cloudbox ethernet leds

2013-06-25 Thread Frederic Leroy
From: Frédéric Leroy fr...@starox.org

The cloudbox device have a different ethernet phy setup than other ns2
devices. We get initialization value from the GPL LaCie source

Signed-off-by: Frédéric Leroy fr...@starox.org
---
 board/LaCie/common/common.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/board/LaCie/common/common.c b/board/LaCie/common/common.c
index a62bf9f..d828685 100644
--- a/board/LaCie/common/common.c
+++ b/board/LaCie/common/common.c
@@ -52,10 +52,18 @@ void mv_phy_88e1318_init(const char *name, u16 phyaddr)
/*
 * Set control mode 4 for LED[0].
 */
+   #ifndef CONFIG_CLOUDBOX
miiphy_write(name, phyaddr, MII_MARVELL_PHY_PAGE, 3);
miiphy_read(name, phyaddr, 16, reg);
reg |= 0xf;
miiphy_write(name, phyaddr, 16, reg);
+   #else
+   miiphy_write(name, phyaddr, MII_MARVELL_PHY_PAGE, 3);
+   miiphy_read(name, phyaddr, 17, reg);
+   reg = ~0x3f;
+   reg |= 0x15;
+   miiphy_write(name, phyaddr, 17, reg);
+   #endif
 
/*
 * Enable RGMII delay on Tx and Rx for CPU port
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] LaCie/common: Fix cloudbox ethernet leds

2013-06-25 Thread Wolfgang Denk
Dear Frederic Leroy,

In message 1372178945-11528-3-git-send-email-fr...@starox.org you wrote:

 diff --git a/board/LaCie/common/common.c b/board/LaCie/common/common.c
 index a62bf9f..d828685 100644
 --- a/board/LaCie/common/common.c
 +++ b/board/LaCie/common/common.c
...
 + #ifndef CONFIG_CLOUDBOX
...
 + #else
...
 + #endif

Preprocessor statements must start in column 1; please fix.

Also, can we not avoid the #ifdef alltogether by providing a #define
for the register number to read?  This could then be done in the board
config file.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Children begin by loving their parents. After a time they judge them.
Rarely, if ever, do they forgive them.  - Oscar Wilde
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] LaCie/common: Fix cloudbox ethernet leds

2013-06-25 Thread Simon Guinot
On Tue, Jun 25, 2013 at 06:49:05PM +0200, Frederic Leroy wrote:
 From: Frédéric Leroy fr...@starox.org
 
 The cloudbox device have a different ethernet phy setup than other ns2
 devices. We get initialization value from the GPL LaCie source
 
 Signed-off-by: Frédéric Leroy fr...@starox.org
 ---
  board/LaCie/common/common.c | 8 
  1 file changed, 8 insertions(+)
 
 diff --git a/board/LaCie/common/common.c b/board/LaCie/common/common.c
 index a62bf9f..d828685 100644
 --- a/board/LaCie/common/common.c
 +++ b/board/LaCie/common/common.c
 @@ -52,10 +52,18 @@ void mv_phy_88e1318_init(const char *name, u16 phyaddr)
   /*
* Set control mode 4 for LED[0].
*/
 + #ifndef CONFIG_CLOUDBOX
   miiphy_write(name, phyaddr, MII_MARVELL_PHY_PAGE, 3);
   miiphy_read(name, phyaddr, 16, reg);
   reg |= 0xf;
   miiphy_write(name, phyaddr, 16, reg);
 + #else
 + miiphy_write(name, phyaddr, MII_MARVELL_PHY_PAGE, 3);
 + miiphy_read(name, phyaddr, 17, reg);
 + reg = ~0x3f;
 + reg |= 0x15;
 + miiphy_write(name, phyaddr, 17, reg);
 + #endif

This doesn't look very common but I can't figure out a more elegant way.

Acked-by: Simon Guinot simon.gui...@sequanux.org


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot