Skip to contentSkip to conversation

arm: add support for LaCie CloudBox

PATCH Superseded Frédéric Leroy 3 participants 8 messages Jul 1, 2013 – Sep 8, 2013

lore
Share & tools
lore
#0 lore raw

v3 cover arm: add support for LaCie CloudBox

This series adds support for the LaCie Cloudbox v2 device.

Changes in v3:

- prepare other LaCie boards for led patch
- fix Machine ID
- use one commit for adding device

Changes in v2:

- sort unsorted #ifdef list in lacie_kw.h
- add entry to MAINTAINERS
- remove unused GPIO definitions
- remove empty misc_init_r()
- add Machine ID
- Use #define values for ethernet phy init
- checkpatch compliant

Fr?d?ric Leroy (3):
lacie_kw: sort #ifdef lists by CONFIG_ identifiers LaCie/common: Uses #defines for ethernet phy leds setup
arm: add support for LaCie CloudBox

 MAINTAINERS                       |   4 +
 board/LaCie/cloudbox/Makefile     |  46 +++++++++++
 board/LaCie/cloudbox/cloudbox.c   |  94 +++++++++++++++++++++
 board/LaCie/cloudbox/cloudbox.h   |  36 ++++++++
 board/LaCie/cloudbox/kwbimage.cfg | 167 ++++++++++++++++++++++++++++++++++++++
 board/LaCie/common/common.c       |  13 ++-
 boards.cfg                        |   1 +
 include/configs/lacie_kw.h        |  45 ++++++----
 8 files changed, 388 insertions(+), 18 deletions(-)
 create mode 100644 board/LaCie/cloudbox/Makefile
 create mode 100644 board/LaCie/cloudbox/cloudbox.c
 create mode 100644 board/LaCie/cloudbox/cloudbox.h
 create mode 100644 board/LaCie/cloudbox/kwbimage.cfg
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v3 1/3 lacie_kw: sort #ifdef lists by CONFIG_ identifiers

---
 include/configs/lacie_kw.h | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
include/configs/lacie_kw.h +13 -13
index e2b3b21..cac616a 100644
@@ -21,29 +21,29 @@
 /*
  * Machine number definition
  */
-#if defined(CONFIG_INETSPACE_V2)
+#if defined(CONFIG_D2NET_V2)
+#define CONFIG_MACH_TYPE		MACH_TYPE_D2NET_V2
+#define CONFIG_IDENT_STRING		" D2 v2"
+#elif defined(CONFIG_INETSPACE_V2)
 #define CONFIG_MACH_TYPE		MACH_TYPE_INETSPACE_V2
 #define CONFIG_IDENT_STRING		" IS v2"
-#elif defined(CONFIG_NETSPACE_V2)
-#define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_V2
-#define CONFIG_IDENT_STRING		" NS v2"
+#elif defined(CONFIG_NET2BIG_V2)
+#define CONFIG_MACH_TYPE		MACH_TYPE_NET2BIG_V2
+#define CONFIG_IDENT_STRING		" 2Big v2"
 #elif defined(CONFIG_NETSPACE_LITE_V2)
 #define MACH_TYPE_NETSPACE_LITE_V2	2983 /* missing in mach-types.h */
 #define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_LITE_V2
 #define CONFIG_IDENT_STRING		" NS v2 Lite"
+#elif defined(CONFIG_NETSPACE_MAX_V2)
+#define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_MAX_V2
+#define CONFIG_IDENT_STRING		" NS Max v2"
 #elif defined(CONFIG_NETSPACE_MINI_V2)
 #define MACH_TYPE_NETSPACE_MINI_V2	2831 /* missing in mach-types.h */
 #define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_MINI_V2
 #define CONFIG_IDENT_STRING		" NS v2 Mini"
-#elif defined(CONFIG_NETSPACE_MAX_V2)
-#define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_MAX_V2
-#define CONFIG_IDENT_STRING		" NS Max v2"
-#elif defined(CONFIG_D2NET_V2)
-#define CONFIG_MACH_TYPE		MACH_TYPE_D2NET_V2
-#define CONFIG_IDENT_STRING		" D2 v2"
-#elif defined(CONFIG_NET2BIG_V2)
-#define CONFIG_MACH_TYPE		MACH_TYPE_NET2BIG_V2
-#define CONFIG_IDENT_STRING		" 2Big v2"
+#elif defined(CONFIG_NETSPACE_V2)
+#define CONFIG_MACH_TYPE		MACH_TYPE_NETSPACE_V2
+#define CONFIG_IDENT_STRING		" NS v2"
 #else
 #error "Unknown board"
 #endif
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH v3 2/3 LaCie/common: Uses #defines for ethernet phy leds setup

In reply to Frédéric Leroy

The CloudBox device have a different ethernet phy setup than other ns2 devices.
Prepare source to use different init registers

---
 board/LaCie/common/common.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
board/LaCie/common/common.c +10 -3
index a62bf9f..85480e7 100644
@@ -21,6 +21,12 @@
 #define MV88E1116_RGMII_TXTM_CTRL	(1 << 4)
 #define MV88E1116_RGMII_RXTM_CTRL	(1 << 5)
 
+#if !defined(MII_MARVELL_LED_REG)
+# define MII_MARVELL_LED_REG 16
+# define MII_MARVELL_LED_MASK 0xf0
+# define MII_MARVELL_LED_VALUE 0x0f
+#endif
+
 void mv_phy_88e1116_init(const char *name, u16 phyaddr)
 {
 	u16 reg;
@@ -53,9 +59,10 @@ void mv_phy_88e1318_init(const char *name, u16 phyaddr)
 	 * Set control mode 4 for LED[0].
 	 */
 	miiphy_write(name, phyaddr, MII_MARVELL_PHY_PAGE, 3);
-	miiphy_read(name, phyaddr, 16, &reg);
-	reg |= 0xf;
-	miiphy_write(name, phyaddr, 16, reg);
+	miiphy_read(name, phyaddr, MII_MARVELL_LED_REG, &reg);
+	reg &= MII_MARVELL_LED_MASK;
+	reg |= MII_MARVELL_LED_VALUE;
+	miiphy_write(name, phyaddr, MII_MARVELL_LED_REG, reg);
 
 	/*
 	 * Enable RGMII delay on Tx and Rx for CPU port
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH v3 3/3 arm: add support for LaCie CloudBox

In reply to Frédéric Leroy

The LaCie CloudBox device is a Kirkwood based nas :

- SoC: Marvell 88F6702 1000Mhz
- SDRAM memory: 256MB DDR2 400Mhz
- Gigabit ethernet: PHY Marvell 88E1318
- Flash memory: SPI NOR 512KB (Macronix MX25L4005A)
- 1 push button
- 1 reset switch
- 1 SATA port
- 1 LED (bi-color, blue and red)

---
 MAINTAINERS                       |   4 +
 board/LaCie/cloudbox/Makefile     |  46 +++++++++++
 board/LaCie/cloudbox/cloudbox.c   |  94 +++++++++++++++++++++
 board/LaCie/cloudbox/cloudbox.h   |  36 ++++++++
 board/LaCie/cloudbox/kwbimage.cfg | 167 ++++++++++++++++++++++++++++++++++++++
 boards.cfg                        |   1 +
 include/configs/lacie_kw.h        |  21 ++++-
 7 files changed, 366 insertions(+), 3 deletions(-)
 create mode 100644 board/LaCie/cloudbox/Makefile
 create mode 100644 board/LaCie/cloudbox/cloudbox.c
 create mode 100644 board/LaCie/cloudbox/cloudbox.h
 create mode 100644 board/LaCie/cloudbox/kwbimage.cfg
MAINTAINERS +4 -0
index 3e70b03..9bf561d 100644
@@ -770,6 +770,10 @@ Sergey Lapin <[email protected]>
 
 	afeb9260	ARM926EJS (AT91SAM9260 SoC)
 
+Frederic Leroy <[email protected]>
+
+	cloudbox	ARM926EJS (Kirkwood SoC)
+
 Valentin Longchamp <[email protected]>
 
 	km_kirkwood	ARM926EJS (Kirkwood SoC)
board/LaCie/cloudbox/Makefile new file +46 -0

46 lines not on this page · raw message

board/LaCie/cloudbox/cloudbox.c new file +94 -0

94 lines not on this page · raw message

board/LaCie/cloudbox/cloudbox.h new file +36 -0
new file mode 100644
index 0000000..fb8af83
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2013 Frederic Leroy <[email protected]>
+ *
+ * Based on LaCie u-boot sources
+ *
+ * Based on Kirkwood support:
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef CLOUDBOX_H
+#define CLOUDBOX_H
+
+/* GPIO configuration */
+#define CLOUDBOX_OE_LOW		0xF0310000
+#define CLOUDBOX_OE_HIGH		0x00000001
+#define CLOUDBOX_OE_VAL_LOW		0x00000010
+#define CLOUDBOX_OE_VAL_HIGH		0x00000000
+
+#define CLOUDBOX_GPIO_BUTTON         16
+
+#endif /* CLOUDBOX_H */
board/LaCie/cloudbox/kwbimage.cfg new file +167 -0

167 lines not on this page · raw message

boards.cfg +1 -0
index 1458289..11d7718 100644
@@ -170,6 +170,7 @@ kmsuv31                      arm         arm926ejs   km_arm              keymile
 mgcoge3un                    arm         arm926ejs   km_arm              keymile        kirkwood    km_kirkwood:KM_MGCOGE3UN
 kmcoge5un                    arm         arm926ejs   km_arm              keymile        kirkwood    km_kirkwood:KM_COGE5UN
 portl2                       arm         arm926ejs   km_arm              keymile        kirkwood    km_kirkwood:KM_PORTL2
+cloudbox                     arm         arm926ejs   cloudbox            LaCie          kirkwood	lacie_kw:CLOUDBOX
 d2net_v2                     arm         arm926ejs   net2big_v2          LaCie          kirkwood        lacie_kw:D2NET_V2
 inetspace_v2                 arm         arm926ejs   netspace_v2         LaCie          kirkwood	lacie_kw:INETSPACE_V2
 net2big_v2                   arm         arm926ejs   net2big_v2          LaCie          kirkwood	lacie_kw:NET2BIG_V2
include/configs/lacie_kw.h +18 -3
index cac616a..7d784d3 100644
@@ -21,7 +21,11 @@
 /*
  * Machine number definition
  */
-#if defined(CONFIG_D2NET_V2)
+#if defined(CONFIG_CLOUDBOX)
+#define MACH_TYPE_CLOUDBOX		4170 /* missing in mach-types.h */
+#define CONFIG_MACH_TYPE		MACH_TYPE_CLOUDBOX
+#define CONFIG_IDENT_STRING		" CloudBox"
+#elif defined(CONFIG_D2NET_V2)
 #define CONFIG_MACH_TYPE		MACH_TYPE_D2NET_V2
 #define CONFIG_IDENT_STRING		" D2 v2"
 #elif defined(CONFIG_INETSPACE_V2)
@@ -70,9 +74,11 @@
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_SF
+#if !defined(CONFIG_CLOUDBOX)
 #define CONFIG_CMD_I2C
+#endif
 #define CONFIG_CMD_IDE
-#ifndef CONFIG_NETSPACE_MINI_V2 /* No USB ports on Network Space v2 Mini */
+#if !defined(CONFIG_NETSPACE_MINI_V2) && !defined(CONFIG_CLOUDBOX)
 #define CONFIG_CMD_USB
 #endif
 
@@ -111,7 +117,9 @@
 #define CONFIG_ENV_SPI_MAX_HZ           20000000 /* 20Mhz */
 #define CONFIG_SYS_IDE_MAXBUS           1
 #define CONFIG_SYS_IDE_MAXDEVICE        1
-#if defined(CONFIG_D2NET_V2)
+#if defined(CONFIG_CLOUDBOX)
+#define CONFIG_SYS_PROMPT		"cb> "
+#elif defined(CONFIG_D2NET_V2)
 #define CONFIG_SYS_PROMPT		"d2v2> "
 #elif defined(CONFIG_NET2BIG_V2)
 #define CONFIG_SYS_PROMPT		"2big2> "
@@ -122,7 +130,9 @@
 /*
  * Enable platform initialisation via misc_init_r() function
  */
+#if !defined(CONFIG_CLOUDBOX)
 #define CONFIG_MISC_INIT_R
+#endif
 
 /*
  * Ethernet Driver configuration
@@ -130,6 +140,11 @@
 #ifdef CONFIG_CMD_NET
 #define CONFIG_MVGBE_PORTS		{1, 0} /* enable port 0 only */
 #define CONFIG_NETCONSOLE
+#if defined(CONFIG_CLOUDBOX)
+# define MII_MARVELL_LED_REG 17
+# define MII_MARVELL_LED_MASK 0xffc0
+# define MII_MARVELL_LED_VALUE 0x15
+#endif
 #endif
 
 /*
Signature · 1 line
1.8.1.2
#4 lore raw

v3 cover arm: add support for LaCie CloudBox

In reply to Frédéric Leroy
Quoted 23 lines · Fr?d?ric Leroy

This series adds support for the LaCie Cloudbox v2 device.

Changes in v3:

- prepare other LaCie boards for led patch
- fix Machine ID
- use one commit for adding device

Changes in v2:

- sort unsorted #ifdef list in lacie_kw.h
- add entry to MAINTAINERS
- remove unused GPIO definitions
- remove empty misc_init_r()
- add Machine ID
- Use #define values for ethernet phy init
- checkpatch compliant

Fr?d?ric Leroy (3):
lacie_kw: sort #ifdef lists by CONFIG_ identifiers LaCie/common: Uses #defines for ethernet phy leds setup
arm: add support for LaCie CloudBox

Quoted 13 lines
 MAINTAINERS                       |   4 +
 board/LaCie/cloudbox/Makefile     |  46 +++++++++++
 board/LaCie/cloudbox/cloudbox.c   |  94 +++++++++++++++++++++
 board/LaCie/cloudbox/cloudbox.h   |  36 ++++++++
 board/LaCie/cloudbox/kwbimage.cfg | 167 ++++++++++++++++++++++++++++++++++++++
 board/LaCie/common/common.c       |  13 ++-
 boards.cfg                        |   1 +
 include/configs/lacie_kw.h        |  45 ++++++----
 8 files changed, 388 insertions(+), 18 deletions(-)
 create mode 100644 board/LaCie/cloudbox/Makefile
 create mode 100644 board/LaCie/cloudbox/cloudbox.c
 create mode 100644 board/LaCie/cloudbox/cloudbox.h
 create mode 100644 board/LaCie/cloudbox/kwbimage.cfg

For the whole patch series:

Regards,

Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130701/443dd596/attachment.pgp>

#5 lore raw

v3 cover arm: add support for LaCie CloudBox

In reply to Frédéric Leroy
Quoted 34 lines

-----Original Message-----
From: Fr?d?ric Leroy [mailto:fredo at starox.org]
Sent: 01 July 2013 18:28
To: u-boot at lists.denx.de
Cc: Wolfgang Denk; Prafulla Wadaskar; Albert ARIBAUD; Simon Guinot
Subject: [PATCH v3 0/3] arm: add support for LaCie CloudBox

This series adds support for the LaCie Cloudbox v2 device.

Changes in v3:

- prepare other LaCie boards for led patch
- fix Machine ID
- use one commit for adding device

Changes in v2:

- sort unsorted #ifdef list in lacie_kw.h
- add entry to MAINTAINERS
- remove unused GPIO definitions
- remove empty misc_init_r()
- add Machine ID
- Use #define values for ethernet phy init
- checkpatch compliant

Fr?d?ric Leroy (3):
lacie_kw: sort #ifdef lists by CONFIG_ identifiers LaCie/common: Uses #defines for ethernet phy leds
setup
arm: add support for LaCie CloudBox

Quoted 16 lines
 MAINTAINERS                       |   4 +
 board/LaCie/cloudbox/Makefile     |  46 +++++++++++
 board/LaCie/cloudbox/cloudbox.c   |  94
+++++++++++++++++++++
 board/LaCie/cloudbox/cloudbox.h   |  36 ++++++++
 board/LaCie/cloudbox/kwbimage.cfg | 167
++++++++++++++++++++++++++++++++++++++
 board/LaCie/common/common.c       |  13 ++-
 boards.cfg                        |   1 +
 include/configs/lacie_kw.h        |  45 ++++++----
 8 files changed, 388 insertions(+), 18 deletions(-)
 create mode 100644 board/LaCie/cloudbox/Makefile
 create mode 100644 board/LaCie/cloudbox/cloudbox.c
 create mode 100644 board/LaCie/cloudbox/cloudbox.h
 create mode 100644 board/LaCie/cloudbox/kwbimage.cfg

Dear Fr?d?ric Leroy

I express my great apology for not providing review comments in time. I am very busy with some priority task.

I would be free by 16th July to do the right justification with the review of all the patches on my plate.

This is applicable to all other patches too, those seeks my attention on the mailing list.

For any urgent matters, may be Albert can pull the Marvell specific stuffs directly (if he thinks this is okay).

Once again sorry for inconvenience :(

Regards...
Prafulla . . .

#6 lore raw

v3 cover arm: add support for LaCie CloudBox

Hello Prafulla,

Le 02/07/2013 00:24, Prafulla Wadaskar a ?crit :

Quoted 20 lines
Quoted 11 lines

-----Original Message-----
From: Fr?d?ric Leroy [mailto:fredo at starox.org]
Sent: 01 July 2013 18:28
To: u-boot at lists.denx.de
Cc: Wolfgang Denk; Prafulla Wadaskar; Albert ARIBAUD; Simon Guinot
Subject: [PATCH v3 0/3] arm: add support for LaCie CloudBox

This series adds support for the LaCie Cloudbox v2 device.

Dear Fr?d?ric Leroy

I express my great apology for not providing review comments in time. I am very busy with some priority task.

I would be free by 16th July to do the right justification with the review of all the patches on my plate.

This is applicable to all other patches too, those seeks my attention on the mailing list.

Quoted 8 lines

For any urgent matters, may be Albert can pull the Marvell specific stuffs directly (if he thinks this is okay).

Once again sorry for inconvenience :(

Regards...
Prafulla . . .
_______________________________________________

We are now well over the 16th July. Do you had time to review my patches ?

Best regards,

Signature · 1 line
Fr?d?ric
#7 lore raw

v3 cover arm: add support for LaCie CloudBox

In reply to Prafulla Wadaskar

Le 02/07/2013 00:24, Prafulla Wadaskar a ?crit :

Quoted 23 lines
Quoted 9 lines

-----Original Message-----
From: Fr?d?ric Leroy [mailto:fredo at starox.org]
Sent: 01 July 2013 18:28
To: u-boot at lists.denx.de
Cc: Wolfgang Denk; Prafulla Wadaskar; Albert ARIBAUD; Simon Guinot
Subject: [PATCH v3 0/3] arm: add support for LaCie CloudBox

Quoted 7 lines

This series adds support for the LaCie Cloudbox v2 device.

Changes in v3:

[...]

Dear Fr?d?ric Leroy

I express my great apology for not providing review comments in time. I am very busy with some priority task.

I would be free by 16th July to do the right justification with the review of all the patches on my plate.

Quoted 9 lines

This is applicable to all other patches too, those seeks my attention on the mailing list.

For any urgent matters, may be Albert can pull the Marvell specific stuffs directly (if he thinks this is okay).

Once again sorry for inconvenience :(

Regards...
Prafulla . . .

Hello Prafulla,

Have you time to review my patch ?
Does Albert need to take it ?

Regards,

Signature · 1 line
Fr?d?ric Leroy