Skip to contentSkip to conversation

Add support for LaCie NAS Network Space v2

PATCH Superseded Simon Guinot 3 participants 8 messages May 2, 2011

Subsystems (3)

v3 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add support for LaCie NAS Network Space v2

This patch series adds support for Network Space v2 board and parents.

Changes since v1:
- netconsole: restore NetOurIP check
- add entries to MAINTAINERS file
- move boards from root Makefile to boards.cfg
- move MACH_TYPE definition into netspace_v2.h
- remove CONFIG_SYS_HZ redefinition
- turn PHY initialization message into debug()

Changes since v2:
- drop patch for Macronix MX25L4005A
- rewrite patch "sf: disable write protection for Macronix flash", using the common spi flash code
- fix "Definitions" typo in mv-common.h
- netconsole: add a "/* Fall through */" comment before the NETCONS case label

Simon Guinot (6):
sf: disable write protection for Macronix flash
Kirkwood: allow to override CONFIG_SYS_TCLK
mv-common.h: fix DRAM banks configuration
netconsole: remove `serverip' check
Add support for Network Space v2

 MAINTAINERS                                    |    6 +
 arch/arm/include/asm/arch-kirkwood/kw88f6281.h |    8 +-
 board/LaCie/netspace_v2/Makefile               |   49 +++++++
 board/LaCie/netspace_v2/kwbimage.cfg           |  162 ++++++++++++++++++++++++
 board/LaCie/netspace_v2/netspace_v2.c          |  144 +++++++++++++++++++++
 board/LaCie/netspace_v2/netspace_v2.h          |   39 ++++++
 boards.cfg                                     |    3 +
 drivers/mtd/spi/macronix.c                     |   42 ++++++
 include/configs/mv-common.h                    |    8 +-
 include/configs/netspace_v2.h                  |  149 ++++++++++++++++++++++
 net/net.c                                      |    3 +-
 11 files changed, 605 insertions(+), 8 deletions(-)
#1 lore raw

PATCH v3 1/5 sf: disable write protection for Macronix flash

From: Simon Guinot <[email protected]>

---
 drivers/mtd/spi/macronix.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)
drivers/mtd/spi/macronix.c +42 -0
index 8e4d71c..9a3895d 100644
@@ -120,6 +120,45 @@ static const struct macronix_spi_flash_params macronix_spi_flash_table[] = {
 	},
 };
 
+static int macronix_write_status(struct spi_flash *flash, u8 sr)
+{
+	u8 cmd;
+	int ret;
+
+	ret = spi_flash_cmd(flash->spi, CMD_MX25XX_WREN, NULL, 0);
+	if (ret < 0) {
+		debug("SF: enabling write failed\n");
+		return ret;
+	}
+
+	cmd = CMD_MX25XX_WRSR;
+	ret = spi_flash_cmd_write(flash->spi, &cmd, 1, &sr, 1);
+	if (ret) {
+		debug("SF: fail to write status register\n");
+		return ret;
+	}
+
+	ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+	if (ret < 0) {
+		debug("SF: write status register timed out\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+static int macronix_unlock(struct spi_flash *flash)
+{
+	int ret;
+
+	/* Enable status register writing and clear BP# bits */
+	ret = macronix_write_status(flash, 0);
+	if (ret)
+		debug("SF: fail to disable write protection\n");
+
+	return ret;
+}
+
 static int macronix_write(struct spi_flash *flash,
 			  u32 offset, size_t len, const void *buf)
 {
@@ -223,5 +262,8 @@ struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
 		* params->sectors_per_block;
 	mcx->flash.size = mcx->flash.sector_size * params->nr_blocks;
 
+	/* Clear BP# bits for read-only flash */
+	macronix_unlock(&mcx->flash);
+
 	return &mcx->flash;
 }
Signature · 1 line
1.6.3.1
#2 lore raw

PATCH v3 1/5 sf: disable write protection for Macronix flash

drivers/mtd/spi/macronix.c line 128

Quoted 12 lines · Simon Guinot
drivers/mtd/spi/macronix.c +6 -0
@@ -120,6 +120,45 @@
 ? ? ? ?},
 ?};
 
+static int macronix_write_status(struct spi_flash *flash, u8 sr)
+{
+ ? ? ? u8 cmd;
+ ? ? ? int ret;
+
+ ? ? ? ret = spi_flash_cmd(flash->spi, CMD_MX25XX_WREN, NULL, 0);

this is spi_flash_cmd_write_enable() now
-mike

#3 lore raw

PATCH v3 1/5 sf: disable write protection for Macronix flash

Hi Mike,

Quoted 7 lines · Mike Frysinger
Quoted 6 lines · Simon Guinot
drivers/mtd/spi/macronix.c +0 -0
@@ -120,6 +120,45 @@
 ? ? ? ?},
 ?};
 
Quoted 8 lines

drivers/mtd/spi/macronix.c static const struct macronix_spi_flash_params macronix_spi_flash_table[] = {

Quoted 6 lines
drivers/mtd/spi/macronix.c +6 -0
+static int macronix_write_status(struct spi_flash *flash, u8 sr)
+{
+ ? ? ? u8 cmd;
+ ? ? ? int ret;
+
+ ? ? ? ret = spi_flash_cmd(flash->spi, CMD_MX25XX_WREN, NULL, 0);

this is spi_flash_cmd_write_enable() now

I will rebase this patch against your sf branch.

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/20110502/4228b12c/attachment.pgp

#4 lore raw

PATCH v3 2/5 Kirkwood: allow to override CONFIG_SYS_TCLK

In reply to Simon Guinot

From: Simon Guinot <[email protected]>

This patch allow to override CONFIG_SYS_TCLK from board configuration files. This is needed for the Network Space v2 which use a non standard core clock frequency (166MHz instead of 200MHz for a 6281 SoC).

As a possible enhancement for 6281 and 6282 devices, TCLK could be dynamically detected by checking the Sample at Reset register bit 21.

Additionally this patch fix a typo.

---
 arch/arm/include/asm/arch-kirkwood/kw88f6281.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/include/asm/arch-kirkwood/kw88f6281.h +5 -3
index 80723ea..22d10f1 100644
@@ -27,11 +27,13 @@
 #ifndef _ASM_ARCH_KW88F6281_H
 #define _ASM_ARCH_KW88F6281_H
 
-/* SOC specific definations */
+/* SOC specific definitions */
 #define KW88F6281_REGS_PHYS_BASE	0xf1000000
 #define KW_REGS_PHY_BASE		KW88F6281_REGS_PHYS_BASE
 
-/* TCLK Core Clock defination*/
-#define CONFIG_SYS_TCLK	  200000000 /* 200MHz */
+/* TCLK Core Clock definition */
+#ifndef CONFIG_SYS_TCLK
+#define CONFIG_SYS_TCLK	200000000 /* 200MHz */
+#endif
 
 #endif /* _ASM_ARCH_KW88F6281_H */
Signature · 1 line
1.6.3.1
#5 lore raw

PATCH v3 3/5 mv-common.h: fix DRAM banks configuration

In reply to Simon Guinot

From: Simon Guinot <[email protected]>

The asm/arch/config.h header define CONFIG_NR_DRAM_BANKS_MAX, which is needed to configure DRAM banks.

This patch move the asm/arch/config.h header inclusion above the DRAM banks configuration.

Additionally this patch fix a typo.

---
 include/configs/mv-common.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
include/configs/mv-common.h +4 -4
index a8937dd..0a39257 100644
@@ -113,6 +113,9 @@
 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000	/* Rst Vector Adr */
 #define CONFIG_SYS_MAXARGS	16	/* max number of command args */
 
+/* ====> Include platform Common Definitions */
+#include <asm/arch/config.h>
+
 /*
  * DRAM Banks configuration, Custom config can be done in <board>.h
  */
@@ -124,10 +127,7 @@
 #endif
 #endif /* CONFIG_NR_DRAM_BANKS */
 
-/* ====> Include platform Common Definations */
-#include <asm/arch/config.h>
-
-/* ====> Include driver Common Definations */
+/* ====> Include driver Common Definitions */
 /*
  * Common NAND configuration
  */
Signature · 1 line
1.6.3.1
#6 lore raw

PATCH v3 4/5 netconsole: remove `serverip' check

In reply to Simon Guinot

From: Simon Guinot <[email protected]>

Netconsole use the environment variable ncip' to configure the destination IP. serverip' don't need to be defined.

---
 net/net.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/net.c +2 -1
index e50bdf1..19ac019 100644
@@ -1718,7 +1718,6 @@ static int net_check_prereq (proto_t protocol)
 #if defined(CONFIG_CMD_NFS)
 	case NFS:
 #endif
-	case NETCONS:
 	case TFTP:
 		if (NetServerIP == 0) {
 			puts ("*** ERROR: `serverip' not set\n");
@@ -1728,7 +1727,9 @@ static int net_check_prereq (proto_t protocol)
     defined(CONFIG_CMD_DNS)
     common:
 #endif
+		/* Fall through */
 
+	case NETCONS:
 		if (NetOurIP == 0) {
 			puts ("*** ERROR: `ipaddr' not set\n");
 			return (1);
Signature · 1 line
1.6.3.1
#7 lore raw

PATCH v3 5/5 Add support for Network Space v2

In reply to Simon Guinot

From: Simon Guinot <[email protected]>

This patch add support for the Network Space v2 board and parents. This include Network Space (Max) v2 and Internet Space v2.

---
 MAINTAINERS                           |    6 +
 board/LaCie/netspace_v2/Makefile      |   49 ++++++++++
 board/LaCie/netspace_v2/kwbimage.cfg  |  162 +++++++++++++++++++++++++++++++++
 board/LaCie/netspace_v2/netspace_v2.c |  144 +++++++++++++++++++++++++++++
 board/LaCie/netspace_v2/netspace_v2.h |   39 ++++++++
 boards.cfg                            |    3 +
 include/configs/netspace_v2.h         |  149 ++++++++++++++++++++++++++++++
 7 files changed, 552 insertions(+), 0 deletions(-)
 create mode 100644 board/LaCie/netspace_v2/Makefile
 create mode 100644 board/LaCie/netspace_v2/kwbimage.cfg
 create mode 100644 board/LaCie/netspace_v2/netspace_v2.c
 create mode 100644 board/LaCie/netspace_v2/netspace_v2.h
 create mode 100644 include/configs/netspace_v2.h
MAINTAINERS +6 -0
index 24a55c2..47b724c 100644
@@ -645,6 +645,12 @@ Sedji Gaouaou<[email protected]>
 	at91sam9g10ek		ARM926EJS (AT91SAM9G10 SoC)
 	at91sam9m10g45ek	ARM926EJS (AT91SAM9G45 SoC)
 
+Simon Guinot <[email protected]>
+
+	inetspace_v2	ARM926EJS (Kirkwood SoC)
+	netspace_v2	ARM926EJS (Kirkwood SoC)
+	netspace_max_v2	ARM926EJS (Kirkwood SoC)
+
 Marius Gr?ger <[email protected]>
 
 	impa7		ARM720T (EP7211)
board/LaCie/netspace_v2/Makefile new file +49 -0

49 lines not on this page · raw message

board/LaCie/netspace_v2/kwbimage.cfg new file +162 -0

162 lines not on this page · raw message

board/LaCie/netspace_v2/netspace_v2.c new file +144 -0

144 lines not on this page · raw message

board/LaCie/netspace_v2/netspace_v2.h new file +39 -0
new file mode 100644
index 0000000..c26a6e0
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2011 Simon Guinot <[email protected]>
+ *
+ * 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 NETSPACE_V2_H
+#define NETSPACE_V2_H
+
+#define NETSPACE_V2_OE_LOW		0x06004000
+#define NETSPACE_V2_OE_HIGH		0x00000031
+#define NETSPACE_V2_OE_VAL_LOW		0x10030000
+#define NETSPACE_V2_OE_VAL_HIGH		0x00000000
+
+/* PHY related */
+#define MV88E1116_LED_FCTRL_REG		10
+#define MV88E1116_CPRSP_CR3_REG		21
+#define MV88E1116_MAC_CTRL_REG		21
+#define MV88E1116_PGADR_REG		22
+#define MV88E1116_RGMII_TXTM_CTRL	(1 << 4)
+#define MV88E1116_RGMII_RXTM_CTRL	(1 << 5)
+
+#endif /* NETSPACE_V2_H */
boards.cfg +3 -0
index ac83a6e..4273190 100644
@@ -104,6 +104,9 @@ davinci_schmoogie            arm         arm926ejs   schmoogie           davinci
 davinci_sffsdr               arm         arm926ejs   sffsdr              davinci        davinci
 davinci_sonata               arm         arm926ejs   sonata              davinci        davinci
 suen3                        arm         arm926ejs   km_arm              keymile        kirkwood
+inetspace_v2                 arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:INETSPACE_V2
+netspace_v2                  arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:NETSPACE_V2
+netspace_max_v2              arm         arm926ejs   netspace_v2         LaCie          kirkwood    netspace_v2:NETSPACE_MAX_V2
 guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
 mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
 openrd_base                  arm         arm926ejs   -                   Marvell        kirkwood
include/configs/netspace_v2.h new file +149 -0

149 lines not on this page · raw message

Signature · 1 line
1.6.3.1