Skip to contentSkip to conversation

RFC: Dreamplug support

PATCH Superseded u-boot at lakedaemon.net 1 participant 4 messages Jun 4, 2011 Arm (32-bit)

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

cover RFC: Dreamplug support

From: Jason Cooper <[email protected]>

This is my first attempt at adding the Marvell Dreamplug to U-Boot.

It compiles clean, and I've loaded it via JTAG and used it to dump the existing bootloader out of the SPI flash. I have _not_ used it to burn itself to the flash yet. I'm looking for comments before I try that. ;-)

Some concerns:

1.) does the 'make all' support need to be last? I've used
rebase to edit patches and commits, but I've never reshuffled. Each patch compiles clean.

2.) The SPI flash chip is a Macronix MX25L1606, however it has the
identical chip idcode to the MX25L1605. How is that properly handled? The 06 does have some new features [1].

3.) I added the board number [2], etc to asm/mach-types.h even
though it says to not to. ;-) Is there a proper way to do it? If it's copied from the Linux kernel, it hasn't been updated in a while...

[1] http://www.macronix.com/QuickPlace/hq/PageLibrary4825740B00298A3B.nsf/h_Index/5F41CDDCB837422C48257639003E5EC3/$File/AN055-Migrate_to_MX25L1606E_and_MX25L8006E-1.2.pdf
[2] http://www.arm.linux.org.uk/developer/machines/list.php?id=3550

Jason Cooper (3):
dreamplug: Initial support.
dreamplug: include in 'make all'
dreamplug: switch from NAND flash to SPI flash.

 MAKEALL                              |    1 +
 arch/arm/include/asm/mach-types.h    |   13 +++
 board/Marvell/dreamplug/Makefile     |   51 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  153 ++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   39 ++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  160 ++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  111 +++++++++++++++++++++++
 8 files changed, 529 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
#1 lore raw

PATCH 1/3 dreamplug: Initial support.

From: Jason Cooper <[email protected]>

Copied files from boards/Marvell/guruplug/ and did
s/GURUPLUG/DREAMPLUG/g s/guruplug/dreamplug/g

Also, added MACH_TYPE_DREAMPLUG 3550 registered with at
http://www.arm.linux.co.uk/developer/machines/

---
 arch/arm/include/asm/mach-types.h    |   13 +++
 board/Marvell/dreamplug/Makefile     |   51 +++++++++++
 board/Marvell/dreamplug/dreamplug.c  |  153 ++++++++++++++++++++++++++++++++
 board/Marvell/dreamplug/dreamplug.h  |   39 ++++++++
 board/Marvell/dreamplug/kwbimage.cfg |  162 ++++++++++++++++++++++++++++++++++
 boards.cfg                           |    1 +
 include/configs/dreamplug.h          |  111 +++++++++++++++++++++++
 7 files changed, 530 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/dreamplug/Makefile
 create mode 100644 board/Marvell/dreamplug/dreamplug.c
 create mode 100644 board/Marvell/dreamplug/dreamplug.h
 create mode 100644 board/Marvell/dreamplug/kwbimage.cfg
 create mode 100644 include/configs/dreamplug.h
arch/arm/include/asm/mach-types.h +13 -0
index a1fd03a..02baf58 100644
@@ -3312,6 +3312,7 @@ extern unsigned int __machine_arch_type;
 #define MACH_TYPE_T5388P               3336
 #define MACH_TYPE_DINGO                3337
 #define MACH_TYPE_GOFLEXHOME           3338
+#define MACH_TYPE_DREAMPLUG            3550
 
 #ifdef CONFIG_ARCH_EBSA110
 # ifdef machine_arch_type
@@ -42913,6 +42914,18 @@ extern unsigned int __machine_arch_type;
 # define machine_is_goflexhome()	(0)
 #endif
 
+#ifdef CONFIG_MACH_DREAMPLUG
+# ifdef machine_arch_type
+#  undef machine_arch_type
+#  define machine_arch_type	__machine_arch_type
+# else
+#  define machine_arch_type	MACH_TYPE_DREAMPLUG
+# endif
+# define machine_is_dreamplug()	(machine_arch_type == MACH_TYPE_DREAMPLUG)
+#else
+# define machine_is_dreamplug()	(0)
+#endif
+
 /*
  * These have not yet been registered
  */
board/Marvell/dreamplug/Makefile new file +51 -0

51 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.c new file +153 -0

153 lines not on this page · raw message

board/Marvell/dreamplug/dreamplug.h new file +39 -0
new file mode 100644
index 0000000..b597859
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Siddarth Gore <[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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef __DREAMPLUG_H
+#define __DREAMPLUG_H
+
+#define DREAMPLUG_OE_LOW	(~(0))
+#define DREAMPLUG_OE_HIGH	(~(0))
+#define DREAMPLUG_OE_VAL_LOW	0
+#define DREAMPLUG_OE_VAL_HIGH	(0xf << 16) /* 4 LED Pins high */
+
+/* PHY related */
+#define MV88E1121_MAC_CTRL2_REG		21
+#define MV88E1121_PGADR_REG		22
+#define MV88E1121_RGMII_TXTM_CTRL	(1 << 4)
+#define MV88E1121_RGMII_RXTM_CTRL	(1 << 5)
+
+#endif /* __DREAMPLUG_H */
board/Marvell/dreamplug/kwbimage.cfg new file +162 -0

162 lines not on this page · raw message

boards.cfg +1 -0
index d2cacc8..a69ada6 100644
@@ -110,6 +110,7 @@ suen3                        arm         arm926ejs   km_arm              keymile
 suen8                        arm         arm926ejs   km_arm              keymile        kirkwood
 mgcoge3un                    arm         arm926ejs   km_arm              keymile        kirkwood
 guruplug                     arm         arm926ejs   -                   Marvell        kirkwood
+dreamplug                    arm         arm926ejs   -                   Marvell        kirkwood
 mv88f6281gtw_ge              arm         arm926ejs   -                   Marvell        kirkwood
 openrd_base                  arm         arm926ejs   openrd              Marvell        kirkwood        openrd:BOARD_IS_OPENRD_BASE
 openrd_client                arm         arm926ejs   openrd              Marvell        kirkwood        openrd:BOARD_IS_OPENRD_CLIENT
include/configs/dreamplug.h new file +111 -0

111 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 3/3 dreamplug: switch from NAND flash to SPI flash.

In reply to u-boot at lakedaemon.net

From: Jason Cooper <[email protected]>

MPP._SPI_ configuration copied from
boards/Marvell/mv88f6281gtw_ge/mv88f6281gtw_ge.c

---
 board/Marvell/dreamplug/dreamplug.c  |   18 +++++++++---------
 board/Marvell/dreamplug/kwbimage.cfg |    4 +---
 include/configs/dreamplug.h          |    2 +-
 3 files changed, 11 insertions(+), 13 deletions(-)
board/Marvell/dreamplug/dreamplug.c +9 -9
index 32d82ba..6442396 100644
@@ -43,14 +43,14 @@ int board_early_init_f(void)
 
 	/* Multi-Purpose Pins Functionality configuration */
 	u32 kwmpp_config[] = {
-		MPP0_NF_IO2,
-		MPP1_NF_IO3,
-		MPP2_NF_IO4,
-		MPP3_NF_IO5,
-		MPP4_NF_IO6,
-		MPP5_NF_IO7,
+		MPP0_SPI_SCn,
+		MPP1_SPI_MOSI,
+		MPP2_SPI_SCK,
+		MPP3_SPI_MISO,
+		MPP4_GPIO,
+		MPP5_GPO,
 		MPP6_SYSRST_OUTn,
-		MPP7_GPO,	/* GPIO_RST */
+		MPP7_SPI_SCn,
 		MPP8_TW_SDA,
 		MPP9_TW_SCK,
 		MPP10_UART0_TXD,
@@ -61,8 +61,8 @@ int board_early_init_f(void)
 		MPP15_SD_D1,
 		MPP16_SD_D2,
 		MPP17_SD_D3,
-		MPP18_NF_IO0,
-		MPP19_NF_IO1,
+		MPP18_GPO,
+		MPP19_GPO,
 		MPP20_GE1_0,
 		MPP21_GE1_1,
 		MPP22_GE1_2,
board/Marvell/dreamplug/kwbimage.cfg +1 -3
index 2afd927..ae76b32 100644
@@ -26,9 +26,7 @@
 #
 
 # Boot Media configurations
-BOOT_FROM	nand
-NAND_ECC_MODE	default
-NAND_PAGE_SIZE	0x0800
+BOOT_FROM	spi
 
 # SOC registers configuration using bootrom header extension
 # Maximum KWBIMAGE_MAX_CONFIG configurations allowed
include/configs/dreamplug.h +1 -1
index 7b494cc..bf477b2 100644
@@ -47,7 +47,7 @@
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ENV
 #define CONFIG_CMD_FAT
-#define CONFIG_CMD_NAND
+#define CONFIG_CMD_SF
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_USB
 #define CONFIG_CMD_IDE
Signature · 1 line
1.7.0.4